From patchwork Thu Apr 6 16:38:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 1766243 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=ti-com-17Q1 header.b=qIhz7L7g; dkim-atps=neutral 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PsnKw6HPKz1yZF for ; Fri, 7 Apr 2023 02:40:20 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B3CDB8610B; Thu, 6 Apr 2023 18:39:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="qIhz7L7g"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6F50386078; Thu, 6 Apr 2023 18:38: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=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 1F14D8609F for ; Thu, 6 Apr 2023 18:38:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=afd@ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 336GcQhR101125; Thu, 6 Apr 2023 11:38:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1680799106; bh=3eWCKtssscRBBHIO6bEZCcbdnyygo7NFr/bwNsUf7rg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=qIhz7L7gYpiEejTQFVOuaJjSSHQE4A2en3Jkc3XcWIZG/lQGq8yecayMNFrJcCAa/ qCAAneHrajszSW9Vd+GA/r2nUzaTNwGSDVV0P3FN3s1aNwyGrhGJ39MGa3N94WDPXq lYxJtBJq45y3VD4GjnltimfQkIShTxvBqV+uTmRI= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 336GcQCc125810 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Apr 2023 11:38:26 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Thu, 6 Apr 2023 11:38:26 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Thu, 6 Apr 2023 11:38:27 -0500 Received: from lelv0854.itg.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 336GcN2A049417; Thu, 6 Apr 2023 11:38:26 -0500 From: Andrew Davis To: Simon Glass , Tom Rini , Christian Gmeiner , CC: Andrew Davis Subject: [PATCH v4 08/12] arm: mach-k3: Add weak do_board_detect() to common file Date: Thu, 6 Apr 2023 11:38:17 -0500 Message-ID: <20230406163821.25968-9-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230406163821.25968-1-afd@ti.com> References: <20230406163821.25968-1-afd@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 at phobos.denx.de X-Virus-Status: Clean This matches how it was done for pre-K3 TI platforms and it allows us to move the forward declaration out of sys_proto.h. It also removes the need for K3_BOARD_DETECT as one is free to simply override the weak function in their board files as needed. Signed-off-by: Andrew Davis Reviewed-by: Christian Gmeiner --- arch/arm/mach-k3/Kconfig | 5 ----- arch/arm/mach-k3/am642_init.c | 4 ++-- arch/arm/mach-k3/am654_init.c | 4 ++-- arch/arm/mach-k3/common.c | 10 ++++++++++ arch/arm/mach-k3/common.h | 2 ++ arch/arm/mach-k3/include/mach/sys_proto.h | 2 -- arch/arm/mach-k3/j721e_init.c | 8 ++++---- board/ti/common/Kconfig | 1 - 8 files changed, 20 insertions(+), 16 deletions(-) diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig index 7edbac26ccc..a8c3a593d57 100644 --- a/arch/arm/mach-k3/Kconfig +++ b/arch/arm/mach-k3/Kconfig @@ -187,11 +187,6 @@ config K3_X509_SWRV help SWRV for X509 certificate used for boot images -config K3_BOARD_DETECT - bool "Support for Board detection" - help - Support for board detection. - source "board/ti/am65x/Kconfig" source "board/ti/am64x/Kconfig" source "board/ti/am62x/Kconfig" diff --git a/arch/arm/mach-k3/am642_init.c b/arch/arm/mach-k3/am642_init.c index c7720cbaf35..ef84aad819c 100644 --- a/arch/arm/mach-k3/am642_init.c +++ b/arch/arm/mach-k3/am642_init.c @@ -100,8 +100,8 @@ void do_dt_magic(void) { int ret, rescan; - if (IS_ENABLED(CONFIG_K3_BOARD_DETECT)) - do_board_detect(); + /* Perform board detection */ + do_board_detect(); /* * Board detection has been done. diff --git a/arch/arm/mach-k3/am654_init.c b/arch/arm/mach-k3/am654_init.c index 12d74635cb0..2336da4b454 100644 --- a/arch/arm/mach-k3/am654_init.c +++ b/arch/arm/mach-k3/am654_init.c @@ -245,8 +245,8 @@ void board_init_f(ulong dummy) /* Output System Firmware version info */ k3_sysfw_print_ver(); - if (IS_ENABLED(CONFIG_K3_BOARD_DETECT)) - do_board_detect(); + /* Perform board detection */ + do_board_detect(); #if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0) ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(k3_avs), diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index 4f2e14c3105..115f5959734 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -636,3 +636,13 @@ int misc_init_r(void) return 0; } + +/** + * do_board_detect() - Detect board description + * + * Function to detect board description. This is expected to be + * overridden in the SoC family board file where desired. + */ +void __weak do_board_detect(void) +{ +} diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h index 531be0be54c..130f5021123 100644 --- a/arch/arm/mach-k3/common.h +++ b/arch/arm/mach-k3/common.h @@ -35,3 +35,5 @@ void mmr_unlock(phys_addr_t base, u32 partition); bool is_rom_loaded_sysfw(struct rom_extended_boot_data *data); enum k3_device_type get_device_type(void); void ti_secure_image_post_process(void **p_image, size_t *p_size); +struct ti_sci_handle *get_ti_sci_handle(void); +void do_board_detect(void); diff --git a/arch/arm/mach-k3/include/mach/sys_proto.h b/arch/arm/mach-k3/include/mach/sys_proto.h index 8cc75b636b5..939de0f79b4 100644 --- a/arch/arm/mach-k3/include/mach/sys_proto.h +++ b/arch/arm/mach-k3/include/mach/sys_proto.h @@ -10,8 +10,6 @@ void sdelay(unsigned long loops); u32 wait_on_value(u32 read_bit_mask, u32 match_value, void *read_addr, u32 bound); -struct ti_sci_handle *get_ti_sci_handle(void); -int do_board_detect(void); int fdt_disable_node(void *blob, char *node_path); void k3_spl_init(void); diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c index eec5b726b95..31d324e2179 100644 --- a/arch/arm/mach-k3/j721e_init.c +++ b/arch/arm/mach-k3/j721e_init.c @@ -140,8 +140,8 @@ void do_dt_magic(void) int ret, rescan, mmc_dev = -1; static struct mmc *mmc; - if (IS_ENABLED(CONFIG_K3_BOARD_DETECT)) - do_board_detect(); + /* Perform board detection */ + do_board_detect(); /* * Board detection has been done. @@ -267,8 +267,8 @@ void board_init_f(ulong dummy) /* Output System Firmware version info */ k3_sysfw_print_ver(); - if (IS_ENABLED(CONFIG_K3_BOARD_DETECT)) - do_board_detect(); + /* Perform board detection */ + do_board_detect(); #if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0) ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(k3_avs), diff --git a/board/ti/common/Kconfig b/board/ti/common/Kconfig index f03357cc751..49edd98014a 100644 --- a/board/ti/common/Kconfig +++ b/board/ti/common/Kconfig @@ -1,6 +1,5 @@ config TI_I2C_BOARD_DETECT bool "Support for Board detection for TI platforms" - select K3_BOARD_DETECT if ARCH_K3 help Support for detection board information on Texas Instrument's Evaluation Boards which have I2C based EEPROM detection