From patchwork Fri Jul 24 11:12:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335621 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCmp64BtGz9sTF for ; Fri, 24 Jul 2020 21:15:23 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 912A7821B3; Fri, 24 Jul 2020 13:15:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 603D7821BE; Fri, 24 Jul 2020 13:15:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SUBJ_OBFU_PUNCT_FEW, SUBJ_OBFU_PUNCT_MANY,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 95FDE8219C for ; Fri, 24 Jul 2020 13:15:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail.windriver.com (8.15.2/8.15.2) with ESMTPS id 06OBEtJn014600 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:14:55 -0700 (PDT) Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:14:42 -0700 From: Ovidiu Panait To: CC: Heiko Stuebner , Heinrich Schuchardt , Jean-Jacques Hiblot , Kever Yang , Marek Bykowski , Michal Simek , Philipp Tomsich , Reuben Dowle , Simon Glass Subject: [PATCH v4 01/17] Kconfig: Introduce CONFIG_SYS_HAS_SRAM Date: Fri, 24 Jul 2020 14:12:09 +0300 Message-ID: <20200724111225.12513-1-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 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 In order to be able to replace "#ifdef CONFIG_SYS_SRAM_BASE" sequences with the IS_ENABLED() equivalent, introduce a new boolean Kconfig option that signals whether the platform has SRAM support. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- Kconfig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Kconfig b/Kconfig index 566ca72c92..934c020a2f 100644 --- a/Kconfig +++ b/Kconfig @@ -350,6 +350,17 @@ config PLATFORM_ELFENTRY default "__start" if MIPS default "_start" +config SYS_HAS_SRAM + bool + default y if TARGET_PIC32MZDASK + default y if TARGET_DEVKIT8000 + default y if TARGET_TRICORDER + default n + help + Enable this to allow support for the on board SRAM. + SRAM base address is controlled by CONFIG_SYS_SRAM_BASE. + SRAM size is controlled by CONFIG_SYS_SRAM_SIZE. + endmenu # General setup menu "Boot images" From patchwork Fri Jul 24 11:12:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335630 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCmrs6vnYz9sRN for ; Fri, 24 Jul 2020 21:17:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7A83D8224A; Fri, 24 Jul 2020 13:16:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 9CAF582201; Fri, 24 Jul 2020 13:15:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 553D2821D8 for ; Fri, 24 Jul 2020 13:15:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail1.windriver.com (8.15.2/8.15.2) with ESMTPS id 06OBF1UD024036 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:15:03 -0700 (PDT) Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:15:00 -0700 From: Ovidiu Panait To: CC: Adam Ford , Heiko Schocher , Heinrich Schuchardt , Holger Brunck , Kever Yang , Marek Bykowski , Marek Vasut , Michal Simek , Pascal Linder , Purna Chandra Mandal , Reuben Dowle , Simon Glass , Stefan Roese Subject: [PATCH v4 02/17] Kconfig: Convert CONFIG_SYS_SRAM_BASE to Kconfig Date: Fri, 24 Jul 2020 14:12:10 +0300 Message-ID: <20200724111225.12513-2-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724111225.12513-1-ovidiu.panait@windriver.com> References: <20200724111225.12513-1-ovidiu.panait@windriver.com> MIME-Version: 1.0 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 This converts ad-hoc CONFIG_SYS_SRAM_BASE to Kconfig. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- Kconfig | 5 +++++ include/configs/pic32mzdask.h | 1 - scripts/config_whitelist.txt | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Kconfig b/Kconfig index 934c020a2f..4ff1000848 100644 --- a/Kconfig +++ b/Kconfig @@ -361,6 +361,11 @@ config SYS_HAS_SRAM SRAM base address is controlled by CONFIG_SYS_SRAM_BASE. SRAM size is controlled by CONFIG_SYS_SRAM_SIZE. +config SYS_SRAM_BASE + hex + default 0x80000000 if TARGET_PIC32MZDASK + default 0x0 + endmenu # General setup menu "Boot images" diff --git a/include/configs/pic32mzdask.h b/include/configs/pic32mzdask.h index 73edd28f1a..25b898f2e6 100644 --- a/include/configs/pic32mzdask.h +++ b/include/configs/pic32mzdask.h @@ -19,7 +19,6 @@ /*---------------------------------------------------------------------- * Memory Layout */ -#define CONFIG_SYS_SRAM_BASE 0x80000000 #define CONFIG_SYS_SRAM_SIZE 0x00080000 /* 512K */ /* Initial RAM for temporary stack, global data */ diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 2ec7642583..93233f066b 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -3788,7 +3788,6 @@ CONFIG_SYS_SPL_LEN CONFIG_SYS_SPL_MALLOC_SIZE CONFIG_SYS_SPL_MALLOC_START CONFIG_SYS_SPR -CONFIG_SYS_SRAM_BASE CONFIG_SYS_SRAM_SIZE CONFIG_SYS_SRAM_START CONFIG_SYS_SRIO From patchwork Fri Jul 24 11:12:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335639 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCmv10cjXz9sRN for ; Fri, 24 Jul 2020 21:19:41 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2837E8225C; Fri, 24 Jul 2020 13:18:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 4D5AB82259; Fri, 24 Jul 2020 13:18:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) (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 DA6B982255 for ; Fri, 24 Jul 2020 13:18:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id 06OBFIRl017339 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:15:33 -0700 Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:15:07 -0700 From: Ovidiu Panait To: CC: Adam Ford , Bin Meng , Heiko Schocher , Heiko Stuebner , Heinrich Schuchardt , Holger Brunck , Kever Yang , Marek Bykowski , Marek Vasut , Michal Simek , Pascal Linder , Purna Chandra Mandal , Reuben Dowle , Simon Glass , Stefan Roese , Thomas Weber Subject: [PATCH v4 03/17] Kconfig: Convert CONFIG_SYS_SRAM_SIZE to Kconfig Date: Fri, 24 Jul 2020 14:12:11 +0300 Message-ID: <20200724111225.12513-3-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724111225.12513-1-ovidiu.panait@windriver.com> References: <20200724111225.12513-1-ovidiu.panait@windriver.com> MIME-Version: 1.0 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 This converts ad-hoc CONFIG_SYS_SRAM_SIZE to Kconfig. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- Kconfig | 7 +++++++ include/configs/devkit8000.h | 1 - include/configs/pic32mzdask.h | 2 -- include/configs/tricorder.h | 1 - scripts/config_whitelist.txt | 1 - 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Kconfig b/Kconfig index 4ff1000848..d0f7ff80d1 100644 --- a/Kconfig +++ b/Kconfig @@ -366,6 +366,13 @@ config SYS_SRAM_BASE default 0x80000000 if TARGET_PIC32MZDASK default 0x0 +config SYS_SRAM_SIZE + hex + default 0x00080000 if TARGET_PIC32MZDASK + default 0x10000 if TARGET_DEVKIT8000 + default 0x10000 if TARGET_TRICORDER + default 0x0 + endmenu # General setup menu "Boot images" diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h index f90c1c5a18..cdf7d7aa21 100644 --- a/include/configs/devkit8000.h +++ b/include/configs/devkit8000.h @@ -140,7 +140,6 @@ /* SRAM config */ #define CONFIG_SYS_SRAM_START 0x40200000 -#define CONFIG_SYS_SRAM_SIZE 0x10000 /* Defines for SPL */ diff --git a/include/configs/pic32mzdask.h b/include/configs/pic32mzdask.h index 25b898f2e6..d50edc7715 100644 --- a/include/configs/pic32mzdask.h +++ b/include/configs/pic32mzdask.h @@ -19,8 +19,6 @@ /*---------------------------------------------------------------------- * Memory Layout */ -#define CONFIG_SYS_SRAM_SIZE 0x00080000 /* 512K */ - /* Initial RAM for temporary stack, global data */ #define CONFIG_SYS_INIT_RAM_SIZE 0x10000 #define CONFIG_SYS_INIT_RAM_ADDR \ diff --git a/include/configs/tricorder.h b/include/configs/tricorder.h index 83aa3cd468..d438a7e635 100644 --- a/include/configs/tricorder.h +++ b/include/configs/tricorder.h @@ -202,7 +202,6 @@ /* SRAM config */ #define CONFIG_SYS_SRAM_START 0x40200000 -#define CONFIG_SYS_SRAM_SIZE 0x10000 /* Defines for SPL */ diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 93233f066b..392b50875f 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -3788,7 +3788,6 @@ CONFIG_SYS_SPL_LEN CONFIG_SYS_SPL_MALLOC_SIZE CONFIG_SYS_SPL_MALLOC_START CONFIG_SYS_SPR -CONFIG_SYS_SRAM_SIZE CONFIG_SYS_SRAM_START CONFIG_SYS_SRIO CONFIG_SYS_SRIO1_MEM_BASE From patchwork Fri Jul 24 11:12:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335635 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCmt46nD7z9sRN for ; Fri, 24 Jul 2020 21:18:52 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8459682245; Fri, 24 Jul 2020 13:18:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 0B71A82225; Fri, 24 Jul 2020 13:18:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) (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 05216821F3 for ; Fri, 24 Jul 2020 13:18:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id 06OBFIRm017339 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:16:40 -0700 Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:15:42 -0700 From: Ovidiu Panait To: CC: Adam Ford , Bin Meng , Heiko Schocher , Heiko Stuebner , Holger Brunck , Jean-Jacques Hiblot , Kever Yang , Marek Bykowski , Marek Vasut , Michal Simek , Pascal Linder , Reuben Dowle , Simon Glass , Stefan Roese , Thomas Weber Subject: [PATCH v4 04/17] Kconfig: Remove CONFIG_SYS_SRAM_START Date: Fri, 24 Jul 2020 14:12:12 +0300 Message-ID: <20200724111225.12513-4-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724111225.12513-1-ovidiu.panait@windriver.com> References: <20200724111225.12513-1-ovidiu.panait@windriver.com> MIME-Version: 1.0 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 Remove ad-hoc CONFIG_SYS_SRAM_START and use CONFIG_SYS_SRAM_BASE instead. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- Kconfig | 2 ++ include/configs/devkit8000.h | 3 --- include/configs/tricorder.h | 3 --- scripts/config_whitelist.txt | 1 - 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Kconfig b/Kconfig index d0f7ff80d1..b16ee0f57d 100644 --- a/Kconfig +++ b/Kconfig @@ -364,6 +364,8 @@ config SYS_HAS_SRAM config SYS_SRAM_BASE hex default 0x80000000 if TARGET_PIC32MZDASK + default 0x40200000 if TARGET_DEVKIT8000 + default 0x40200000 if TARGET_TRICORDER default 0x0 config SYS_SRAM_SIZE diff --git a/include/configs/devkit8000.h b/include/configs/devkit8000.h index cdf7d7aa21..b4f649a958 100644 --- a/include/configs/devkit8000.h +++ b/include/configs/devkit8000.h @@ -138,9 +138,6 @@ /* Boot Argument Buffer Size */ -/* SRAM config */ -#define CONFIG_SYS_SRAM_START 0x40200000 - /* Defines for SPL */ /* NAND boot config */ diff --git a/include/configs/tricorder.h b/include/configs/tricorder.h index d438a7e635..8ffa39f92f 100644 --- a/include/configs/tricorder.h +++ b/include/configs/tricorder.h @@ -200,9 +200,6 @@ CONFIG_SYS_INIT_RAM_SIZE - \ GENERATED_GBL_DATA_SIZE) -/* SRAM config */ -#define CONFIG_SYS_SRAM_START 0x40200000 - /* Defines for SPL */ #define CONFIG_SPL_NAND_BASE diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 392b50875f..f840a504b6 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -3788,7 +3788,6 @@ CONFIG_SYS_SPL_LEN CONFIG_SYS_SPL_MALLOC_SIZE CONFIG_SYS_SPL_MALLOC_START CONFIG_SYS_SPR -CONFIG_SYS_SRAM_START CONFIG_SYS_SRIO CONFIG_SYS_SRIO1_MEM_BASE CONFIG_SYS_SRIO1_MEM_BUS From patchwork Fri Jul 24 11:12:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335634 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCmsr62Zxz9sRN for ; Fri, 24 Jul 2020 21:18:40 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B09BA8223D; Fri, 24 Jul 2020 13:18:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 654CD8222E; Fri, 24 Jul 2020 13:18:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) (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 630A8821F3 for ; Fri, 24 Jul 2020 13:18:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id 06OBFIRn017339 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:16:46 -0700 Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:16:16 -0700 From: Ovidiu Panait To: CC: Angelo Dureghello , Bin Meng , Huan Wang , Masahiro Yamada , Simon Glass , Stefan Roese , Wolfgang Denk Subject: [PATCH v4 05/17] cmd: bdinfo: Move sram info prints to generic code Date: Fri, 24 Jul 2020 14:12:13 +0300 Message-ID: <20200724111225.12513-5-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724111225.12513-1-ovidiu.panait@windriver.com> References: <20200724111225.12513-1-ovidiu.panait@windriver.com> MIME-Version: 1.0 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 bi_sramstart and bi_sramsize are generic members of the bd_info structure, so move the m68k/powerpc-specific prints to generic code. Also, print them only if SRAM support is enabled via CONFIG_SYS_HAS_SRAM. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- arch/m68k/lib/bdinfo.c | 4 ---- arch/powerpc/lib/bdinfo.c | 4 ---- cmd/bdinfo.c | 4 ++++ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/m68k/lib/bdinfo.c b/arch/m68k/lib/bdinfo.c index fb4d1a52fd..b7bc6a3044 100644 --- a/arch/m68k/lib/bdinfo.c +++ b/arch/m68k/lib/bdinfo.c @@ -15,10 +15,6 @@ void arch_print_bdinfo(void) { struct bd_info *bd = gd->bd; -#if defined(CONFIG_SYS_INIT_RAM_ADDR) - bdinfo_print_num("sramstart", (ulong)bd->bi_sramstart); - bdinfo_print_num("sramsize", (ulong)bd->bi_sramsize); -#endif bdinfo_print_mhz("busfreq", bd->bi_busfreq); #if defined(CONFIG_SYS_MBAR) bdinfo_print_num("mbar", bd->bi_mbar_base); diff --git a/arch/powerpc/lib/bdinfo.c b/arch/powerpc/lib/bdinfo.c index 75611e2592..07f823ee7a 100644 --- a/arch/powerpc/lib/bdinfo.c +++ b/arch/powerpc/lib/bdinfo.c @@ -20,10 +20,6 @@ void arch_print_bdinfo(void) { struct bd_info *bd = gd->bd; -#if defined(CONFIG_SYS_INIT_RAM_ADDR) - bdinfo_print_num("sramstart", (ulong)bd->bi_sramstart); - bdinfo_print_num("sramsize", (ulong)bd->bi_sramsize); -#endif bdinfo_print_mhz("busfreq", bd->bi_busfreq); #if defined(CONFIG_MPC8xx) || defined(CONFIG_E500) bdinfo_print_num("immr_base", bd->bi_immr_base); diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c index 8b2c105e77..7da36f8096 100644 --- a/cmd/bdinfo.c +++ b/cmd/bdinfo.c @@ -75,6 +75,10 @@ int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) print_bi_dram(bd); bdinfo_print_num("memstart", (ulong)bd->bi_memstart); print_lnum("memsize", (u64)bd->bi_memsize); + if (IS_ENABLED(CONFIG_SYS_HAS_SRAM)) { + bdinfo_print_num("sramstart", (ulong)bd->bi_sramstart); + bdinfo_print_num("sramsize", (ulong)bd->bi_sramsize); + } bdinfo_print_num("flashstart", (ulong)bd->bi_flashstart); bdinfo_print_num("flashsize", (ulong)bd->bi_flashsize); bdinfo_print_num("flashoffset", (ulong)bd->bi_flashoffset); From patchwork Fri Jul 24 11:12:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335633 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCmsc0Rf0z9sRN for ; Fri, 24 Jul 2020 21:18:27 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1728B82238; Fri, 24 Jul 2020 13:18:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 9177B82225; Fri, 24 Jul 2020 13:18:01 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) (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 BFE318223F for ; Fri, 24 Jul 2020 13:17:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id 06OBFIRo017339 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:17:01 -0700 Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:16:50 -0700 From: Ovidiu Panait To: CC: Bin Meng , Patrick Delaunay , Simon Glass , Simon Goldschmidt , Stephen Warren , Vikas Manocha Subject: [PATCH v4 06/17] board_f: Introduce setup_bdinfo initcall Date: Fri, 24 Jul 2020 14:12:14 +0300 Message-ID: <20200724111225.12513-6-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724111225.12513-1-ovidiu.panait@windriver.com> References: <20200724111225.12513-1-ovidiu.panait@windriver.com> MIME-Version: 1.0 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 Introduce setup_bdinfo initcall as a generic routine to populate bdinfo fields. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- common/board_f.c | 6 ++++++ include/init.h | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/common/board_f.c b/common/board_f.c index 88ff0424a7..72446f6da5 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -598,6 +598,11 @@ static int display_new_sp(void) return 0; } +int setup_bdinfo(void) +{ + return 0; +} + #if defined(CONFIG_M68K) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \ defined(CONFIG_SH) static int setup_board_part1(void) @@ -975,6 +980,7 @@ static const init_fnc_t init_sequence_f[] = { reserve_stacks, dram_init_banksize, show_dram_config, + setup_bdinfo, #if defined(CONFIG_M68K) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \ defined(CONFIG_SH) setup_board_part1, diff --git a/include/init.h b/include/init.h index e727031514..2a8c910677 100644 --- a/include/init.h +++ b/include/init.h @@ -141,6 +141,16 @@ int arch_reserve_stacks(void); */ int arch_reserve_mmu(void); +/** + * setup_bdinfo() - Generic boardinfo setup + * + * Routine for populating various generic boardinfo fields of + * gd->bd. It is called during the generic board init sequence. + * + * Return: 0 if OK + */ +int setup_bdinfo(void); + /** * init_cache_f_r() - Turn on the cache in preparation for relocation * From patchwork Fri Jul 24 11:12:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335631 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCms668tMz9sRN for ; Fri, 24 Jul 2020 21:18:02 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C2A08821E0; Fri, 24 Jul 2020 13:17:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 3C0C3821D0; Fri, 24 Jul 2020 13:17:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9AD3B821C6 for ; Fri, 24 Jul 2020 13:17:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail.windriver.com (8.15.2/8.15.2) with ESMTPS id 06OBHEVZ015001 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:17:14 -0700 (PDT) Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:17:13 -0700 From: Ovidiu Panait To: CC: Bin Meng , Joe Hershberger , Patrick Delaunay , Simon Glass , Simon Goldschmidt , Stephen Warren , Vikas Manocha Subject: [PATCH v4 07/17] board_f: Introduce arch_setup_bdinfo initcall Date: Fri, 24 Jul 2020 14:12:15 +0300 Message-ID: <20200724111225.12513-7-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724111225.12513-1-ovidiu.panait@windriver.com> References: <20200724111225.12513-1-ovidiu.panait@windriver.com> MIME-Version: 1.0 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 Certain architectures (ppc, mips, sh, m68k) use setup board_part1 and setup_board_part2 calls during pre-relocation init to populate gd->bd boardinfo fields. This makes the generic init sequence cluttered with arch-specific ifdefs. In order to clean these arch-specific sequences from generic init, introduce arch_setup_bdinfo weak initcall so that everyone can define their own bdinfo setup routines. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- common/board_f.c | 7 ++++++- include/init.h | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/common/board_f.c b/common/board_f.c index 72446f6da5..4356431488 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -598,11 +598,16 @@ static int display_new_sp(void) return 0; } -int setup_bdinfo(void) +__weak int arch_setup_bdinfo(void) { return 0; } +int setup_bdinfo(void) +{ + return arch_setup_bdinfo(); +} + #if defined(CONFIG_M68K) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \ defined(CONFIG_SH) static int setup_board_part1(void) diff --git a/include/init.h b/include/init.h index 2a8c910677..e9354e8fca 100644 --- a/include/init.h +++ b/include/init.h @@ -141,6 +141,18 @@ int arch_reserve_stacks(void); */ int arch_reserve_mmu(void); +/** + * arch_setup_bdinfo() - Architecture dependent boardinfo setup + * + * Architecture-specific routine for populating various boardinfo fields of + * gd->bd. It is called during the generic board init sequence. + * + * If an implementation is not provided, it will just be a nop stub. + * + * Return: 0 if OK + */ +int arch_setup_bdinfo(void); + /** * setup_bdinfo() - Generic boardinfo setup * From patchwork Fri Jul 24 11:12:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335632 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCmsM5DJ3z9sRN for ; Fri, 24 Jul 2020 21:18:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 71E0E821E8; Fri, 24 Jul 2020 13:17:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id EDE7A821F3; Fri, 24 Jul 2020 13:17:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B6888821D0 for ; Fri, 24 Jul 2020 13:17:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail1.windriver.com (8.15.2/8.15.2) with ESMTPS id 06OBHIkF024105 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:17:19 -0700 (PDT) Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:17:18 -0700 From: Ovidiu Panait To: CC: Alexey Brodkin , Bin Meng , Eugeniy Paltsev , Heinrich Schuchardt , Lukas Auer , Marek Vasut , Max Filippov , Michael Walle , Patrice Chotard , Patrick Delaunay , Simon Glass , Stephen Warren , Vikas Manocha , Subject: [PATCH v4 08/17] board_f: Factor out bdinfo bi_mem{start, size} to setup_bdinfo Date: Fri, 24 Jul 2020 14:12:16 +0300 Message-ID: <20200724111225.12513-8-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724111225.12513-1-ovidiu.panait@windriver.com> References: <20200724111225.12513-1-ovidiu.panait@windriver.com> MIME-Version: 1.0 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 Move all assignments to gd->bd->bi_mem{start,size} to generic code in setup_bdinfo. Xtensa architecture is special in this regard as it defines its own handling of gd->bd->bi_mem{start,size} fields. In order to avoid defining a weak SDRAM function, let arch_setup_bdinfo overwrite the generic flags. For ARC architecture, remove ARCH_EARLY_INIT_R from Kconfig since it is not needed anymore. Also, use gd->ram_base to populate bi_memstart to avoid an ifdef. Signed-off-by: Ovidiu Panait Acked-by: Alexey Brodkin Reviewed-by: Simon Glass --- arch/Kconfig | 1 - arch/arc/lib/cpu.c | 7 ------- arch/xtensa/lib/Makefile | 2 +- arch/xtensa/lib/bdinfo.c | 22 ++++++++++++++++++++++ board/cadence/xtfpga/xtfpga.c | 3 --- common/board_f.c | 11 +++++------ 6 files changed, 28 insertions(+), 18 deletions(-) create mode 100644 arch/xtensa/lib/bdinfo.c diff --git a/arch/Kconfig b/arch/Kconfig index 9be02d1319..4d9557959c 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -10,7 +10,6 @@ choice config ARC bool "ARC architecture" - select ARCH_EARLY_INIT_R select ARC_TIMER select CLK select HAVE_PRIVATE_LIBGCC diff --git a/arch/arc/lib/cpu.c b/arch/arc/lib/cpu.c index 27b5832a0c..d66a8c867a 100644 --- a/arch/arc/lib/cpu.c +++ b/arch/arc/lib/cpu.c @@ -25,13 +25,6 @@ int arch_cpu_init(void) return 0; } -int arch_early_init_r(void) -{ - gd->bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; - gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE; - return 0; -} - /* This is a dummy function on arc */ int dram_init(void) { diff --git a/arch/xtensa/lib/Makefile b/arch/xtensa/lib/Makefile index c59df7d372..ceee59b9bd 100644 --- a/arch/xtensa/lib/Makefile +++ b/arch/xtensa/lib/Makefile @@ -5,4 +5,4 @@ obj-$(CONFIG_CMD_BOOTM) += bootm.o -obj-y += cache.o misc.o relocate.o time.o +obj-y += cache.o misc.o relocate.o time.o bdinfo.o diff --git a/arch/xtensa/lib/bdinfo.c b/arch/xtensa/lib/bdinfo.c new file mode 100644 index 0000000000..4ec8529521 --- /dev/null +++ b/arch/xtensa/lib/bdinfo.c @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * XTENSA-specific information for the 'bd' command + * + * (C) Copyright 2003 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + */ + +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +int arch_setup_bdinfo(void) +{ + struct bd_info *bd = gd->bd; + + bd->bi_memstart = PHYSADDR(CONFIG_SYS_SDRAM_BASE); + bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE; + + return 0; +} diff --git a/board/cadence/xtfpga/xtfpga.c b/board/cadence/xtfpga/xtfpga.c index 2869e5cf68..4b49b6e5c8 100644 --- a/board/cadence/xtfpga/xtfpga.c +++ b/board/cadence/xtfpga/xtfpga.c @@ -51,9 +51,6 @@ int checkboard(void) int dram_init_banksize(void) { - gd->bd->bi_memstart = PHYSADDR(CONFIG_SYS_SDRAM_BASE); - gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE; - return 0; } diff --git a/common/board_f.c b/common/board_f.c index 4356431488..3b11f08725 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -605,6 +605,11 @@ __weak int arch_setup_bdinfo(void) int setup_bdinfo(void) { + struct bd_info *bd = gd->bd; + + bd->bi_memstart = gd->ram_base; /* start of memory */ + bd->bi_memsize = gd->ram_size; /* size in bytes */ + return arch_setup_bdinfo(); } @@ -614,12 +619,6 @@ static int setup_board_part1(void) { struct bd_info *bd = gd->bd; - /* - * Save local variables to board info struct - */ - bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; /* start of memory */ - bd->bi_memsize = gd->ram_size; /* size in bytes */ - #ifdef CONFIG_SYS_SRAM_BASE bd->bi_sramstart = CONFIG_SYS_SRAM_BASE; /* start of SRAM */ bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE; /* size of SRAM */ From patchwork Fri Jul 24 11:12:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335636 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCmtL3tbKz9sRN for ; Fri, 24 Jul 2020 21:19:06 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AECE48224E; Fri, 24 Jul 2020 13:18:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 9F1EC8224F; Fri, 24 Jul 2020 13:18:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) (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 99A7B821F3 for ; Fri, 24 Jul 2020 13:18:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id 06OBHYbO017414 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:17:44 -0700 Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:17:23 -0700 From: Ovidiu Panait To: CC: Joe Hershberger , Patrick Delaunay , Simon Glass , Stephen Warren , Vikas Manocha Subject: [PATCH v4 09/17] board_f: Move sram bdinfo assignments to generic code Date: Fri, 24 Jul 2020 14:12:17 +0300 Message-ID: <20200724111225.12513-9-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724111225.12513-1-ovidiu.panait@windriver.com> References: <20200724111225.12513-1-ovidiu.panait@windriver.com> MIME-Version: 1.0 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 Move sram related bdinfo from arch-specific setup_board_part1 to generic code in setup_bdinfo. Also use "if (IS_ENABLED(CONFIG_SYS_HAS_SRAM))" instead of "#ifdef CONFIG_SYS_SRAM_BASE". Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- common/board_f.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/board_f.c b/common/board_f.c index 3b11f08725..e83bc2eb05 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -610,6 +610,11 @@ int setup_bdinfo(void) bd->bi_memstart = gd->ram_base; /* start of memory */ bd->bi_memsize = gd->ram_size; /* size in bytes */ + if (IS_ENABLED(CONFIG_SYS_HAS_SRAM)) { + bd->bi_sramstart = CONFIG_SYS_SRAM_BASE; /* start of SRAM */ + bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE; /* size of SRAM */ + } + return arch_setup_bdinfo(); } @@ -619,11 +624,6 @@ static int setup_board_part1(void) { struct bd_info *bd = gd->bd; -#ifdef CONFIG_SYS_SRAM_BASE - bd->bi_sramstart = CONFIG_SYS_SRAM_BASE; /* start of SRAM */ - bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE; /* size of SRAM */ -#endif - #if defined(CONFIG_E500) || defined(CONFIG_MPC86xx) bd->bi_immr_base = CONFIG_SYS_IMMR; /* base of IMMR register */ #endif From patchwork Fri Jul 24 11:12:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335640 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCmvD33p0z9sSt for ; Fri, 24 Jul 2020 21:19:52 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 982FF82255; Fri, 24 Jul 2020 13:19:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 7F46482234; Fri, 24 Jul 2020 13:19:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) (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 405548220B for ; Fri, 24 Jul 2020 13:19:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id 06OBHYbP017414 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:18:05 -0700 Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:18:01 -0700 From: Ovidiu Panait To: CC: Angelo Dureghello , Bin Meng , Huan Wang , Masahiro Yamada , Patrick Delaunay , Simon Glass , Stefan Roese , Stephen Warren , Vikas Manocha Subject: [PATCH v4 10/17] board_f: m68k: Factor out m68k-specific bdinfo setup Date: Fri, 24 Jul 2020 14:12:18 +0300 Message-ID: <20200724111225.12513-10-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724111225.12513-1-ovidiu.panait@windriver.com> References: <20200724111225.12513-1-ovidiu.panait@windriver.com> MIME-Version: 1.0 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 Factor out m68k-specific bdinfo setup to arch_setup_bdinfo in arch/m68k/lib/bdinfo.c. Also, use if(IS_ENABLED()) instead of #ifdef where possible. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- arch/m68k/lib/bdinfo.c | 21 +++++++++++++++++++++ common/board_f.c | 19 ++++--------------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/arch/m68k/lib/bdinfo.c b/arch/m68k/lib/bdinfo.c index b7bc6a3044..404e5f19ed 100644 --- a/arch/m68k/lib/bdinfo.c +++ b/arch/m68k/lib/bdinfo.c @@ -11,6 +11,27 @@ DECLARE_GLOBAL_DATA_PTR; +int arch_setup_bdinfo(void) +{ + struct bd_info *bd = gd->bd; + + bd->bi_mbar_base = CONFIG_SYS_MBAR; /* base of internal registers */ + + bd->bi_intfreq = gd->cpu_clk; /* Internal Freq, in Hz */ + bd->bi_busfreq = gd->bus_clk; /* Bus Freq, in Hz */ + + if (IS_ENABLED(CONFIG_PCI)) + bd->bi_pcifreq = gd->pci_clk; + +#if defined(CONFIG_EXTRA_CLOCK) + bd->bi_inpfreq = gd->arch.inp_clk; /* input Freq in Hz */ + bd->bi_vcofreq = gd->arch.vco_clk; /* vco Freq in Hz */ + bd->bi_flbfreq = gd->arch.flb_clk; /* flexbus Freq in Hz */ +#endif + + return 0; +} + void arch_print_bdinfo(void) { struct bd_info *bd = gd->bd; diff --git a/common/board_f.c b/common/board_f.c index e83bc2eb05..0c20f3fadf 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -618,7 +618,7 @@ int setup_bdinfo(void) return arch_setup_bdinfo(); } -#if defined(CONFIG_M68K) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \ +#if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \ defined(CONFIG_SH) static int setup_board_part1(void) { @@ -627,9 +627,6 @@ static int setup_board_part1(void) #if defined(CONFIG_E500) || defined(CONFIG_MPC86xx) bd->bi_immr_base = CONFIG_SYS_IMMR; /* base of IMMR register */ #endif -#if defined(CONFIG_M68K) - bd->bi_mbar_base = CONFIG_SYS_MBAR; /* base of internal registers */ -#endif #if defined(CONFIG_MPC83xx) bd->bi_immrbar = CONFIG_SYS_IMMR; #endif @@ -638,7 +635,7 @@ static int setup_board_part1(void) } #endif -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) +#if defined(CONFIG_PPC) static int setup_board_part2(void) { struct bd_info *bd = gd->bd; @@ -651,14 +648,6 @@ static int setup_board_part2(void) bd->bi_sccfreq = gd->arch.scc_clk; bd->bi_vco = gd->arch.vco_out; #endif /* CONFIG_CPM2 */ -#if defined(CONFIG_M68K) && defined(CONFIG_PCI) - bd->bi_pcifreq = gd->pci_clk; -#endif -#if defined(CONFIG_EXTRA_CLOCK) - bd->bi_inpfreq = gd->arch.inp_clk; /* input Freq in Hz */ - bd->bi_vcofreq = gd->arch.vco_clk; /* vco Freq in Hz */ - bd->bi_flbfreq = gd->arch.flb_clk; /* flexbus Freq in Hz */ -#endif return 0; } @@ -985,11 +974,11 @@ static const init_fnc_t init_sequence_f[] = { dram_init_banksize, show_dram_config, setup_bdinfo, -#if defined(CONFIG_M68K) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \ +#if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \ defined(CONFIG_SH) setup_board_part1, #endif -#if defined(CONFIG_PPC) || defined(CONFIG_M68K) +#if defined(CONFIG_PPC) INIT_FUNC_WATCHDOG_RESET setup_board_part2, #endif From patchwork Fri Jul 24 11:12:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335638 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCmtq0Twnz9sRN for ; Fri, 24 Jul 2020 21:19:30 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E4F5382258; Fri, 24 Jul 2020 13:18:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 2843B82233; Fri, 24 Jul 2020 13:18:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 90C0182250 for ; Fri, 24 Jul 2020 13:18:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail.windriver.com (8.15.2/8.15.2) with ESMTPS id 06OBIXmo015137 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:18:33 -0700 (PDT) Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:18:32 -0700 From: Ovidiu Panait To: CC: Bin Meng , Joe Hershberger , Masahiro Yamada , Patrick Delaunay , Simon Glass , Stefan Roese , Stephen Warren , Vikas Manocha , Wolfgang Denk Subject: [PATCH v4 11/17] board_f: ppc: Factor out ppc-specific bdinfo setup Date: Fri, 24 Jul 2020 14:12:19 +0300 Message-ID: <20200724111225.12513-11-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724111225.12513-1-ovidiu.panait@windriver.com> References: <20200724111225.12513-1-ovidiu.panait@windriver.com> MIME-Version: 1.0 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 Factor out ppc-specific bdinfo setup from generic init sequence to arch_setup_bdinfo in arch/powerpc/lib/bdinfo.c. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- arch/powerpc/lib/bdinfo.c | 25 +++++++++++++++++++++++++ common/board_f.c | 36 ++---------------------------------- 2 files changed, 27 insertions(+), 34 deletions(-) diff --git a/arch/powerpc/lib/bdinfo.c b/arch/powerpc/lib/bdinfo.c index 07f823ee7a..36c9c99ee6 100644 --- a/arch/powerpc/lib/bdinfo.c +++ b/arch/powerpc/lib/bdinfo.c @@ -11,6 +11,31 @@ DECLARE_GLOBAL_DATA_PTR; +int arch_setup_bdinfo(void) +{ + struct bd_info *bd = gd->bd; + +#if defined(CONFIG_E500) || defined(CONFIG_MPC86xx) + bd->bi_immr_base = CONFIG_SYS_IMMR; /* base of IMMR register */ +#endif + +#if defined(CONFIG_MPC83xx) + bd->bi_immrbar = CONFIG_SYS_IMMR; +#endif + + bd->bi_intfreq = gd->cpu_clk; /* Internal Freq, in Hz */ + bd->bi_busfreq = gd->bus_clk; /* Bus Freq, in Hz */ + +#if defined(CONFIG_CPM2) + bd->bi_cpmfreq = gd->arch.cpm_clk; + bd->bi_brgfreq = gd->arch.brg_clk; + bd->bi_sccfreq = gd->arch.scc_clk; + bd->bi_vco = gd->arch.vco_out; +#endif /* CONFIG_CPM2 */ + + return 0; +} + void __weak board_detail(void) { /* Please define board_detail() for your PPC platform */ diff --git a/common/board_f.c b/common/board_f.c index 0c20f3fadf..e670155417 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -618,37 +618,9 @@ int setup_bdinfo(void) return arch_setup_bdinfo(); } -#if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \ - defined(CONFIG_SH) +#if defined(CONFIG_MIPS) || defined(CONFIG_SH) static int setup_board_part1(void) { - struct bd_info *bd = gd->bd; - -#if defined(CONFIG_E500) || defined(CONFIG_MPC86xx) - bd->bi_immr_base = CONFIG_SYS_IMMR; /* base of IMMR register */ -#endif -#if defined(CONFIG_MPC83xx) - bd->bi_immrbar = CONFIG_SYS_IMMR; -#endif - - return 0; -} -#endif - -#if defined(CONFIG_PPC) -static int setup_board_part2(void) -{ - struct bd_info *bd = gd->bd; - - bd->bi_intfreq = gd->cpu_clk; /* Internal Freq, in Hz */ - bd->bi_busfreq = gd->bus_clk; /* Bus Freq, in Hz */ -#if defined(CONFIG_CPM2) - bd->bi_cpmfreq = gd->arch.cpm_clk; - bd->bi_brgfreq = gd->arch.brg_clk; - bd->bi_sccfreq = gd->arch.scc_clk; - bd->bi_vco = gd->arch.vco_out; -#endif /* CONFIG_CPM2 */ - return 0; } #endif @@ -974,14 +946,10 @@ static const init_fnc_t init_sequence_f[] = { dram_init_banksize, show_dram_config, setup_bdinfo, -#if defined(CONFIG_MIPS) || defined(CONFIG_PPC) || \ - defined(CONFIG_SH) +#if defined(CONFIG_MIPS) || defined(CONFIG_SH) setup_board_part1, #endif -#if defined(CONFIG_PPC) INIT_FUNC_WATCHDOG_RESET - setup_board_part2, -#endif display_new_sp, #ifdef CONFIG_OF_BOARD_FIXUP fix_fdt, From patchwork Fri Jul 24 11:12:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335637 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCmtb3Jc4z9sSt for ; Fri, 24 Jul 2020 21:19:19 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A58C38223F; Fri, 24 Jul 2020 13:18:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 2F82B82252; Fri, 24 Jul 2020 13:18:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EAF3B8224E for ; Fri, 24 Jul 2020 13:18:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail1.windriver.com (8.15.2/8.15.2) with ESMTPS id 06OBIaoh024407 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:18:36 -0700 (PDT) Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:18:35 -0700 From: Ovidiu Panait To: CC: Joe Hershberger , Patrick Delaunay , Simon Glass , Stephen Warren , Vikas Manocha Subject: [PATCH v4 12/17] board_f: Remove setup_board_part1 Date: Fri, 24 Jul 2020 14:12:20 +0300 Message-ID: <20200724111225.12513-12-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724111225.12513-1-ovidiu.panait@windriver.com> References: <20200724111225.12513-1-ovidiu.panait@windriver.com> MIME-Version: 1.0 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 Now that all arch specific code was converted to setup_bdinfo, we can remove setup_board_part1. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- common/board_f.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/common/board_f.c b/common/board_f.c index e670155417..79532f4365 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -618,13 +618,6 @@ int setup_bdinfo(void) return arch_setup_bdinfo(); } -#if defined(CONFIG_MIPS) || defined(CONFIG_SH) -static int setup_board_part1(void) -{ - return 0; -} -#endif - #ifdef CONFIG_POST static int init_post(void) { @@ -945,11 +938,8 @@ static const init_fnc_t init_sequence_f[] = { reserve_stacks, dram_init_banksize, show_dram_config, - setup_bdinfo, -#if defined(CONFIG_MIPS) || defined(CONFIG_SH) - setup_board_part1, -#endif INIT_FUNC_WATCHDOG_RESET + setup_bdinfo, display_new_sp, #ifdef CONFIG_OF_BOARD_FIXUP fix_fdt, From patchwork Fri Jul 24 11:12:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335644 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCmx95fSfz9sRN for ; Fri, 24 Jul 2020 21:21:33 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9E63382274; Fri, 24 Jul 2020 13:21:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id B08D482274; Fri, 24 Jul 2020 13:21:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) (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 A6B6F8227E for ; Fri, 24 Jul 2020 13:21:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id 06OBImJk017442 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:19:04 -0700 Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:18:38 -0700 From: Ovidiu Panait To: CC: Anatolij Gustschin , Bin Meng , Heinrich Schuchardt , Simon Glass , Weijie Gao Subject: [PATCH v4 13/17] dm: blk: Use IS_ENABLED() instead of #ifdefs in blk_post_probe Date: Fri, 24 Jul 2020 14:12:21 +0300 Message-ID: <20200724111225.12513-13-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724111225.12513-1-ovidiu.panait@windriver.com> References: <20200724111225.12513-1-ovidiu.panait@windriver.com> MIME-Version: 1.0 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 Use IS_ENABLED() instead of #ifdef in blk_post_probe function. No functional change intended. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- drivers/block/blk-uclass.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c index b19375cbc8..b2738f5717 100644 --- a/drivers/block/blk-uclass.c +++ b/drivers/block/blk-uclass.c @@ -644,11 +644,12 @@ int blk_unbind_all(int if_type) static int blk_post_probe(struct udevice *dev) { -#if defined(CONFIG_PARTITIONS) && defined(CONFIG_HAVE_BLOCK_DEVICE) - struct blk_desc *desc = dev_get_uclass_platdata(dev); + if (IS_ENABLED(CONFIG_PARTITIONS) && + IS_ENABLED(CONFIG_HAVE_BLOCK_DEV)) { + struct blk_desc *desc = dev_get_uclass_platdata(dev); - part_init(desc); -#endif + part_init(desc); + } return 0; } From patchwork Fri Jul 24 11:12:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335643 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCmwk3JGDz9sRN for ; Fri, 24 Jul 2020 21:21:10 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8641B82234; Fri, 24 Jul 2020 13:21:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 0DC238223C; Fri, 24 Jul 2020 13:21:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) (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 2F39F82225 for ; Fri, 24 Jul 2020 13:20:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id 06OBImJl017442 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:19:29 -0700 Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:19:11 -0700 From: Ovidiu Panait To: CC: Andy Shevchenko , Bin Meng , Joe Hershberger , Sean Anderson , Simon Glass , Simon Goldschmidt , Trevor Woerner , Weijie Gao Subject: [PATCH v4 14/17] drivers: serial: Make serial_initialize return int Date: Fri, 24 Jul 2020 14:12:22 +0300 Message-ID: <20200724111225.12513-14-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724111225.12513-1-ovidiu.panait@windriver.com> References: <20200724111225.12513-1-ovidiu.panait@windriver.com> MIME-Version: 1.0 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 serial_initialize is called only during the common init sequence, after relocation (in common/board_r.c). Because it has a void return value, it has to wrapped in initr_serial. In order to be able to get rid of this indirection, make serial_initialize return int. Remove extern from prototype in order to silence the following checkpatch warning: check: extern prototypes should be avoided in .h files Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- drivers/serial/serial-uclass.c | 4 ++-- drivers/serial/serial.c | 4 +++- include/serial.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index a0af0e6bfd..0027625ebf 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -170,9 +170,9 @@ int serial_init(void) } /* Called after relocation */ -void serial_initialize(void) +int serial_initialize(void) { - serial_init(); + return serial_init(); } static void _serial_putc(struct udevice *dev, char ch) diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index da017dc5b3..53358acb81 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -170,7 +170,7 @@ void serial_register(struct serial_device *dev) * serial port to the serial core. That serial port is then used as a * default output. */ -void serial_initialize(void) +int serial_initialize(void) { atmel_serial_initialize(); mcf_serial_initialize(); @@ -183,6 +183,8 @@ void serial_initialize(void) mtk_serial_initialize(); serial_assign(default_serial_console()->name); + + return 0; } static int serial_stub_start(struct stdio_dev *sdev) diff --git a/include/serial.h b/include/serial.h index c590637b1f..6d1e62c677 100644 --- a/include/serial.h +++ b/include/serial.h @@ -42,10 +42,10 @@ extern struct serial_device eserial5_device; extern struct serial_device eserial6_device; extern void serial_register(struct serial_device *); -extern void serial_initialize(void); extern void serial_stdio_init(void); extern int serial_assign(const char *name); extern void serial_reinit_all(void); +int serial_initialize(void); /* For usbtty */ #ifdef CONFIG_USB_TTY From patchwork Fri Jul 24 11:12:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335641 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCmvR1xdQz9sRN for ; Fri, 24 Jul 2020 21:20:03 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A5BBB82259; Fri, 24 Jul 2020 13:19:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 6AA7782265; Fri, 24 Jul 2020 13:19:54 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 60D7682250 for ; Fri, 24 Jul 2020 13:19:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail.windriver.com (8.15.2/8.15.2) with ESMTPS id 06OBJkxc015220 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:19:46 -0700 (PDT) Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:19:46 -0700 From: Ovidiu Panait To: CC: Bin Meng , Joe Hershberger , Pankit Garg , Simon Glass , Simon Goldschmidt Subject: [PATCH v4 15/17] common/board_r: Remove initr_serial wrapper Date: Fri, 24 Jul 2020 14:12:23 +0300 Message-ID: <20200724111225.12513-15-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724111225.12513-1-ovidiu.panait@windriver.com> References: <20200724111225.12513-1-ovidiu.panait@windriver.com> MIME-Version: 1.0 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 Remove the initr_serial->serial_initialize indirection and call serial_initialize directly. Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- common/board_r.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/common/board_r.c b/common/board_r.c index 67dc25c7d2..79772135a4 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -187,12 +187,6 @@ static int initr_reloc_global_data(void) return 0; } -static int initr_serial(void) -{ - serial_initialize(); - return 0; -} - #if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_MIPS) static int initr_trap(void) { @@ -705,7 +699,7 @@ static init_fnc_t init_sequence_r[] = { #endif initr_dm_devices, stdio_init_tables, - initr_serial, + serial_initialize, initr_announce, #if CONFIG_IS_ENABLED(WDT) initr_watchdog, From patchwork Fri Jul 24 11:12:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335642 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCmvh0s08z9sRN for ; Fri, 24 Jul 2020 21:20:16 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3C19E82262; Fri, 24 Jul 2020 13:20:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id CF01C8225D; Fri, 24 Jul 2020 13:19:58 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3AF8482265 for ; Fri, 24 Jul 2020 13:19:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail1.windriver.com (8.15.2/8.15.2) with ESMTPS id 06OBJn30024419 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:19:49 -0700 (PDT) Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:19:48 -0700 From: Ovidiu Panait To: CC: Angelo Durgehello , Bin Meng , Eric Nelson , Joe Hershberger , Pankit Garg , Simon Glass Subject: [PATCH v4 16/17] blkcache: Extend blkcache_init to cover CONFIG_NEEDS_MANUAL_RELOC Date: Fri, 24 Jul 2020 14:12:24 +0300 Message-ID: <20200724111225.12513-16-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724111225.12513-1-ovidiu.panait@windriver.com> References: <20200724111225.12513-1-ovidiu.panait@windriver.com> MIME-Version: 1.0 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 Extend manual relocation of block_cache list pointers to all platforms that enable CONFIG_NEEDS_MANUAL_RELOC. Remove m68k-specific checks and provide a single implementation that adds gd->reloc_off to the pre-relocation pointers. Acked-by: Angelo Dureghello Tested-by: Angelo Dureghello Reviewed-by: Simon Glass Reviewed-by: Eric Nelson Signed-off-by: Ovidiu Panait --- common/board_r.c | 2 +- drivers/block/blkcache.c | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/common/board_r.c b/common/board_r.c index 79772135a4..63c53b7b96 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -836,7 +836,7 @@ static init_fnc_t init_sequence_r[] = { #if defined(CONFIG_PRAM) initr_mem, #endif -#if defined(CONFIG_M68K) && defined(CONFIG_BLOCK_CACHE) +#if defined(CONFIG_NEEDS_MANUAL_RELOC) && defined(CONFIG_BLOCK_CACHE) blkcache_init, #endif run_main_loop, diff --git a/drivers/block/blkcache.c b/drivers/block/blkcache.c index b6fc72fe98..d97ee99cf4 100644 --- a/drivers/block/blkcache.c +++ b/drivers/block/blkcache.c @@ -12,6 +12,8 @@ #include #include +DECLARE_GLOBAL_DATA_PTR; + struct block_cache_node { struct list_head lh; int iftype; @@ -22,21 +24,20 @@ struct block_cache_node { char *cache; }; -#ifndef CONFIG_M68K static LIST_HEAD(block_cache); -#else -static struct list_head block_cache; -#endif static struct block_cache_stats _stats = { .max_blocks_per_entry = 8, .max_entries = 32 }; -#ifdef CONFIG_M68K +#ifdef CONFIG_NEEDS_MANUAL_RELOC int blkcache_init(void) { - INIT_LIST_HEAD(&block_cache); + struct list_head *head = &block_cache; + + head->next = (uintptr_t)head->next + gd->reloc_off; + head->prev = (uintptr_t)head->prev + gd->reloc_off; return 0; } From patchwork Fri Jul 24 11:12:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1335645 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCmxN50cRz9sRN for ; Fri, 24 Jul 2020 21:21:44 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5B1ED82284; Fri, 24 Jul 2020 13:21:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 714D38223C; Fri, 24 Jul 2020 13:21:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) (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 2DD528223C for ; Fri, 24 Jul 2020 13:21:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id 06OBK2pL017476 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 24 Jul 2020 04:20:12 -0700 Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Fri, 24 Jul 2020 04:19:51 -0700 From: Ovidiu Panait To: CC: Bin Meng , Joe Hershberger , Pankit Garg , Simon Glass , Simon Goldschmidt Subject: [PATCH v4 17/17] common/board_r: Move blkcache_init call earlier in the boot sequence Date: Fri, 24 Jul 2020 14:12:25 +0300 Message-ID: <20200724111225.12513-17-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724111225.12513-1-ovidiu.panait@windriver.com> References: <20200724111225.12513-1-ovidiu.panait@windriver.com> MIME-Version: 1.0 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 blkcache_init manually relocates blkcache list pointers when CONFIG_NEEDS_MANUAL_RELOC is enabled. However, it is called very late in the boot sequence, which could be a problem if previous boot calls execute blkcache operations with the non-relocated pointers. For example, mmc is initialized earlier and might call blkcache_invalidate (in mmc_select_hwpart()) when trying to load the environment from mmc via env_load(). To fix this issue, move blkcache_init boot call earlier, before mmc gets initialized. Acked-by: Angelo Dureghello Tested-by: Angelo Dureghello Reviewed-by: Simon Glass Signed-off-by: Ovidiu Panait --- common/board_r.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/board_r.c b/common/board_r.c index 63c53b7b96..1c307383d5 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -705,6 +705,9 @@ static init_fnc_t init_sequence_r[] = { initr_watchdog, #endif INIT_FUNC_WATCHDOG_RESET +#if defined(CONFIG_NEEDS_MANUAL_RELOC) && defined(CONFIG_BLOCK_CACHE) + blkcache_init, +#endif #ifdef CONFIG_NEEDS_MANUAL_RELOC initr_manual_reloc_cmdtable, #endif @@ -835,9 +838,6 @@ static init_fnc_t init_sequence_r[] = { #endif #if defined(CONFIG_PRAM) initr_mem, -#endif -#if defined(CONFIG_NEEDS_MANUAL_RELOC) && defined(CONFIG_BLOCK_CACHE) - blkcache_init, #endif run_main_loop, };