public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@kernel.org>
To: nm@ti.com, vigneshr@ti.com, trini@konsulko.com
Cc: srk@ti.com, robertcnelson@gmail.com, u-boot@lists.denx.de,
	Roger Quadros <rogerq@kernel.org>
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	[thread overview]
Message-ID: <20230710145026.128481-2-rogerq@kernel.org> (raw)
In-Reply-To: <20230710145026.128481-1-rogerq@kernel.org>

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 <rogerq@kernel.org>
---
 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


  reply	other threads:[~2023-07-10 14:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10 14:50 [RFC PATCH 0/2] board: ti: Use Extension framework Roger Quadros
2023-07-10 14:50 ` Roger Quadros [this message]
2023-07-10 14:50 ` [RFC PATCH 2/2] board: ti: am65x: Move to using " Roger Quadros
2023-07-10 19:45   ` Simon Glass
2023-07-11 12:29     ` Roger Quadros
2023-07-13 18:44       ` Nishanth Menon
2023-10-04 12:39         ` Roger Quadros
2023-10-06 13:26           ` Köry Maincent
2023-10-06 15:48             ` Roger Quadros
2023-10-06 16:47             ` Simon Glass
2024-01-11 14:14               ` Roger Quadros

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230710145026.128481-2-rogerq@kernel.org \
    --to=rogerq@kernel.org \
    --cc=nm@ti.com \
    --cc=robertcnelson@gmail.com \
    --cc=srk@ti.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox