From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 403A7EB64D9 for ; Mon, 10 Jul 2023 14:50:50 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3B591866BF; Mon, 10 Jul 2023 16:50:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="dVg0ZWnn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A4A9286702; Mon, 10 Jul 2023 16:50:40 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BF72E866BF for ; Mon, 10 Jul 2023 16:50:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rogerq@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 47A1861029; Mon, 10 Jul 2023 14:50:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0F96C433C9; Mon, 10 Jul 2023 14:50:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689000635; bh=GL4p31qOWQYPTImnhCI4uOGTPNBtYbp0XdMmGPKH3qE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dVg0ZWnn7+qD/bj23PbHEsRz4J2IeIPVyZHV8G2rlP5LNFqUnhnPuFAt4o+39AwJR UJU4UtHLhvudCVZdS7ZnzVxwnbHOlXGHdzm5jojbQ5jClh0Uy5El+haNxDIWfOrlDX L6QBaSDZGEh4Qw8tgtLvTfxdb43KDCeJOt0brLdPPC2zdxA0WK1IQ20u5usvhes+JM iEO1kMvvyvnL4S/IRJPAVuakP0wXdFrSlsOj/AK2D6DZYP3AZRs3BrLzindJ2qPGkv i3Y/TR0HZjgPcNbTFgGGSGwQMh/EqCz7zkW4TycnCPvK2bORMnRbrXV13/BsYDBR5m RtzB6paKjDxnA== From: Roger Quadros To: nm@ti.com, vigneshr@ti.com, trini@konsulko.com Cc: srk@ti.com, robertcnelson@gmail.com, u-boot@lists.denx.de, Roger Quadros Subject: [RFC PATCH 1/2] board: ti: common: Add CONFIG_TI_CAPE_DETECT for cape detection Date: Mon, 10 Jul 2023 17:50:25 +0300 Message-Id: <20230710145026.128481-2-rogerq@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230710145026.128481-1-rogerq@kernel.org> References: <20230710145026.128481-1-rogerq@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 CONFIG_CMD_EXTENSION may be used on other TI boards that may not require Cape detection logic. Add CONFIG_TI_CAPE_DETECT for Cape detection logic so it can be enabled independently. Enable it by default only for platforms that require it. i.e. AM335X Signed-off-by: Roger Quadros --- board/ti/am335x/board.c | 8 ++++++++ board/ti/common/Kconfig | 8 ++++++++ board/ti/common/Makefile | 2 +- board/ti/common/cape_detect.c | 2 +- board/ti/common/cape_detect.h | 2 +- 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index ecb9fa02de..8bbabc5da8 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -86,6 +86,14 @@ void do_board_detect(void) } #endif +int extension_board_scan(struct list_head *extension_list) +{ + if (IS_ENABLED(CONFIG_TI_CAPE_DETECT)) + return ti_cape_extension_board_scan(extension_list); + else + return -EINVAL; +} + #ifndef CONFIG_DM_SERIAL struct serial_device *default_serial_console(void) { diff --git a/board/ti/common/Kconfig b/board/ti/common/Kconfig index 49edd98014..72ee2d6d0e 100644 --- a/board/ti/common/Kconfig +++ b/board/ti/common/Kconfig @@ -4,6 +4,14 @@ config TI_I2C_BOARD_DETECT Support for detection board information on Texas Instrument's Evaluation Boards which have I2C based EEPROM detection +config TI_CAPE_DETECT + bool "Support BeagleBone Cape detection for TI platforms" + default y if TARGET_AM335X_EVM + depends on SUPPORT_EXTENSION_SCAN + help + Support Beagle Bone Cape detection for TI platforms + e.g. AM335x BeagleBone. + config EEPROM_BUS_ADDRESS int "Board EEPROM's I2C bus address" range 0 8 diff --git a/board/ti/common/Makefile b/board/ti/common/Makefile index 3172d87b46..5db433f77f 100644 --- a/board/ti/common/Makefile +++ b/board/ti/common/Makefile @@ -2,4 +2,4 @@ # Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/ obj-${CONFIG_TI_I2C_BOARD_DETECT} += board_detect.o -obj-${CONFIG_CMD_EXTENSION} += cape_detect.o +obj-${CONFIG_TI_CAPE_DETECT} += cape_detect.o diff --git a/board/ti/common/cape_detect.c b/board/ti/common/cape_detect.c index 2e6105cfbf..d345a4d8eb 100644 --- a/board/ti/common/cape_detect.c +++ b/board/ti/common/cape_detect.c @@ -21,7 +21,7 @@ static void sanitize_field(char *text, size_t size) } } -int extension_board_scan(struct list_head *extension_list) +int ti_cape_extension_board_scan(struct list_head *extension_list) { struct extension *cape; struct am335x_cape_eeprom_id eeprom_header; diff --git a/board/ti/common/cape_detect.h b/board/ti/common/cape_detect.h index b0d5c9f18b..ea486adbb2 100644 --- a/board/ti/common/cape_detect.h +++ b/board/ti/common/cape_detect.h @@ -23,6 +23,6 @@ struct am335x_cape_eeprom_id { #define CAPE_MAGIC 0xEE3355AA -int extension_board_scan(struct list_head *extension_list); +int ti_cape_extension_board_scan(struct list_head *extension_list); #endif /* __CAPE_DETECT_H */ -- 2.34.1