From patchwork Thu Dec 17 15:09:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tim Small X-Patchwork-Id: 344959 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp1373667ejs; Thu, 17 Dec 2020 08:37:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJLrgNL6DrKLEBbH6Nv/xzgCYogqisPgoO2IgcOsmUmtxj9OdNMi427BPm8JKyhRFIz5Ox X-Received: by 2002:a50:d5c1:: with SMTP id g1mr132091edj.299.1608223023956; Thu, 17 Dec 2020 08:37:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608223023; cv=none; d=google.com; s=arc-20160816; b=CmnxUTa6rvJqMCbWrZSMoope4f7OOc3b8jd8IHf4F7wIoRvUZgMfRxQPW4XxuM+qoW t+VumxTLXPBwV6Kr/38jOpAKoUNeqkk4mLC2PbCW+EIL/TFJnUGkys42BDAkNVeYVY5p C1hTpE2G+jh8KnR9RMOLutWrrn5tcyiuA9bGiymn3at5YPDqackX9OUKeN6s2CPYqKCV OSZrWiqjcjisGMpvCTgmceBf40Q7zHX0EB2hMrbnMyTd69T2AuqL2BjLZ+EeFAIO2GCV ovy/3KIBOwTUxKxNpu8eFEoRn1oqdWxnCfbD9tPwXK/8B1WGSiXhjQv4Hh31AZO3Xr0h doBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-language :content-transfer-encoding:mime-version:user-agent:date:message-id :subject:cc:to:from:dkim-signature; bh=q4iP2TnIKN1oeae0b/CKleKLubaux70VlHhZ0W/NzmM=; b=nt/9v+PxlC3up9Or4SCo30G8hGsQ3V8KMmB63pHJnTshPmEhucL5lRJimfcLKH6YL9 yh7m5F7ITeJpSHLoy42uv1Jx3FnY8SDCKuBH5hKGn0OlbaxrDp+ubJltir5ASO97LMG+ aaZGM5WrWeogOXPuMHOPhxpVvbu+ltaiGZgg4I+2wMdYTbJdhySDY/vjVu41anONLyDK CotcywTgdQMIxlDno0uMmL08knx5gG+i6UCd4588FIARaMvAmtX7kfXJM+xseeQWwlH/ 1M4wXOs1YBPwIP6FcHi66jtSJx2KJw7V9FTHFCnfHiaPTXWOigK/N6nWABfEOfv/pCd7 jEnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@seoss.co.uk header.s=asd201810 header.b=ONP3sy7L; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id a2si2918436ejp.666.2020.12.17.08.37.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 08:37:03 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=fail header.i=@seoss.co.uk header.s=asd201810 header.b=ONP3sy7L; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 860828276E; Thu, 17 Dec 2020 17:36:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=seoss.co.uk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=seoss.co.uk header.i=@seoss.co.uk header.b="ONP3sy7L"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8504A82BE5; Thu, 17 Dec 2020 16:09:19 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from relay0.allsecuredomains.com (relay0.allsecuredomains.com [51.68.204.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6912782BAD for ; Thu, 17 Dec 2020 16:09:16 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=seoss.co.uk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tim@seoss.co.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=seoss.co.uk ; s=asd201810; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date: Message-ID:Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=q4iP2TnIKN1oeae0b/CKleKLubaux70VlHhZ0W/NzmM=; b=ONP3sy7LXwtFIyikjdYfB/pnwC yuIPS/iN98iuvu4Y0RecgovsdICCgzBWx7LYffTsctAi0CK4l47Dj10biGSsBYd3OoVegqo0/LS09 5Zmxml6SmFI00IHaWcDm8YzVnSZ/CWg85BitMc+CMWrmLLUfl0O5kdtvigA9odWWzY7A=; Received: from [81.174.144.187] (helo=[172.19.198.126]) by relay0.allsecuredomains.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1kpuu3-0001ZI-Nw; Thu, 17 Dec 2020 15:09:15 +0000 From: Tim Small To: u-boot@lists.denx.de Cc: Eugen.Hristev@microchip.com Subject: AT91 - SAMA5D27 adding a new board - common initialisation code and file names Message-ID: <7c87ca0e-dd90-07f8-cff5-badcde5e2073@seoss.co.uk> Date: Thu, 17 Dec 2020 15:09:15 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 Content-Language: en-GB X-Mailman-Approved-At: Thu, 17 Dec 2020 17:36:51 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Hi, I'm in the process of adding support to U-Boot for an AT91 SAMA5D27 based board. There may be a USB port configuration change pending, but otherwise it's functionally complete. The design is quite similar to the Microchip SAMA5D2 Xplained Board, to the extent that I have only 6 lines of code changes out of the ~180 lines of (non-comment) code in  board/atmel/sama5d2_xplained/sama5d2_xplained.c In particular the clocks and memory setup code is non-trivial, but identical. With this in mind I was wondering whether (and to what extent) an acceptable patch to support this board would require factoring out this common code? The (non-comment) diff between my interim init code for the new board, and eval/reference board is currently:   I'm also uncertain about file naming - there seem to be a number of different conventions in use for file and directory names (different combinations of SoC, board, architecture, and manufacturer). The new board is: mfr: South Coast Science model: Cube MB v1 Do the following file and directory names look reasonable? arch/arm/dts/Makefile | 3 +++ arch/arm/dts/at91-sama5d27_cubemb1.dts | 263 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ arch/arm/mach-at91/Kconfig | 8 +++++++ board/scs/cubemb1/Kconfig | 15 +++++++++++++ board/scs/cubemb1/MAINTAINERS | 6 ++++++ board/scs/cubemb1/Makefile | 8 +++++++ board/scs/cubemb1/cubemb1.c | 198 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ configs/cubemb1_emmc_defconfig | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ configs/cubemb1_sdcard_defconfig | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ include/configs/cubemb1.h | 9 ++++++++ 10 files changed, 718 insertions(+) Cheers, Tim. -- South East Open Source Solutions Limited Registered in England and Wales with company number 06134732. Registered Office: 2 Powell Gardens, Redhill, Surrey, RH1 1TQ VAT number: GB 900 6633 53 http://seoss.co.uk/ +44-(0)1273-808309 --- board/atmel/sama5d2_xplained/sama5d2_xplained.c 2020-12-15 10:52:32.175616057 +0000 +++ board/scs/cubemb1/cubemb1.c 2020-12-17 14:42:42.399610818 +0000 @@ -30,10 +30,6 @@ #ifdef CONFIG_BOARD_LATE_INIT int board_late_init(void) { -#ifdef CONFIG_DM_VIDEO - at91_video_show_board_info(); -#endif - at91_pda_detect(); return 0; } #endif @@ -83,13 +79,13 @@ return 0; } -#define AT24MAC_MAC_OFFSET 0x9a +#define MAC24AA_MAC_OFFSET 0xfa #ifdef CONFIG_MISC_INIT_R int misc_init_r(void) { #ifdef CONFIG_I2C_EEPROM - at91_set_ethaddr(AT24MAC_MAC_OFFSET); + at91_set_ethaddr(MAC24AA_MAC_OFFSET); #endif return 0;