Skip to contentSkip to conversation

Add support for extension boards detection and DT overlays application

PATCH New Kory Maincent 4 participants 27 messages May 4, 2021 – May 17, 2021

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v5 cover Add support for extension boards detection and DT overlays application

This series of patches aims at proposing a generic U-Boot mechanism to detect extension boards connected to the HW platform, and apply the appropriate Device Tree overlays depending on the detected extension boards.

Indeed, numerous popular platforms, such as the BeagleBone or the RaspberryPi, feature some kind of extension board mechanism. These extension boards are often discoverable through some kind of EEPROM (connected on I2C, 1-wire, etc.) and require Device Tree overlays to be applied at the U-Boot level to provide a complete HW description to the Linux kernel. However, currently this logic is usually implemented ad-hoc in downstream forks of U-Boot.

This series proposes to bring a HW-agnostic and generic solution to this problem to upstream U-Boot. The series shows that it is generic enough by implementing its usage for 2 different families of HW platforms and expansion boards:

- The BeagleBone Black and BeagleBone AI, that use extension boards where the EEPROM describing the extension boards is connected over I2C.

- The CHIP, that uses extension boards where the EEPROM describing the extension boards is connected over 1-wire.

The patch series implements a new command called "extension", with two sub-commands:

- "extension scan" to detect available extension boards

- "extension list" will simply list the detected extension boards

- "extension apply" will allow to apply the Device Tree overlays corresponding to one extension board or to all expansion boards

Note that the name "extension" has been chosen to not refer to any particular board-specific terminology for extension boards ("cape" for BeagleBone, "DIP" for CHIP, "hat" for RaspberryPi, etc.). However, we welcome suggestions of other names and are definitely willing to use a different naming.

The "extension apply" command requires two environment variables to be defined so that it knows how to apply DT overlays. This is described in more details in PATCH 1.

This generic code requires board-specific code for the detection and enumeration of extension boards. This is simply implemented in the form of a board-specific extension_board_scan() function, which fills in a list of detected extension boards.

In detail:

- PATCH 1 move fdt_valid function to fdt_support file
- PATCH 2 implements the generic command and logic
- PATCH 3 implements the python test for the "extension" command
- PATCH 4 implements the board-specific code for the BeagleBone platforms
- PATCH 5 enables the mechanism for the BeagleBone AI
- PATCH 6 review the detection mechanism of one-wire devices
- PATCH 7 and 8 enable the mechanism for the CHIP
- PATCH 9 and 10 enable the mechanism for the BeagleBone Black

Thanks in advance for your review and feedback

Change since v1:
- remove the one wire devicetree description of the CHIP board
- rewrite the detection of w1 to makes it automatic and not devicetree dependent
- replace Kconfig CHIP board target by Kconfig CHIP_DIP_SCAN simple option
- rewrite doc to rST syntax
- make few syntax update

Change since v2:
- review the detection of w1 to makes it compatible with automatic detection alongside the devicetree description detection
- update the patch separation between the mechanism for the CHIP and the configuration activation

Change since v3:
- Update commit messages on the extension command patch
- Remove a test on CMD_EXTENSION in the chip.c file.

Change since v4:
- Rebase on master

Kory Maincent (10):
fdt_support: move fdt_valid from cmd_fdt.c to fdt_support.c
cmd: add support for a new "extension" command
pytest: add sandbox test for "extension" command ti/common: add support for extension_scan_board function
am57xx: add support for cape detect functionality
w1: replace dt detection by automatic detection
arm: sunxi: add support for DIP detection to CHIP board
configs: CHIP: add support for DIP detect functionality
arm: am335x: add support for i2c2 bus
am335x: add support for cape detect functionality

 arch/Kconfig                              |   2 +
 arch/arm/mach-omap2/am33xx/Kconfig        |   1 +
 arch/arm/mach-omap2/am33xx/clock_am33xx.c |   1 +
 arch/arm/mach-omap2/omap5/Kconfig         |   1 +
 arch/arm/mach-sunxi/Kconfig               |   9 ++
 arch/sandbox/dts/Makefile                 |   1 +
 arch/sandbox/dts/overlay0.dts             |   9 ++
 arch/sandbox/dts/overlay1.dts             |   9 ++
 board/sandbox/sandbox.c                   |  23 +++
 board/sunxi/Makefile                      |   1 +
 board/sunxi/chip.c                        | 100 +++++++++++++
 board/ti/am335x/board.c                   |   3 +
 board/ti/am335x/board.h                   |   1 +
 board/ti/am335x/mux.c                     |  15 ++
 board/ti/am57xx/board.c                   |   1 +
 board/ti/common/Kconfig                   |   6 +
 board/ti/common/Makefile                  |   1 +
 board/ti/common/cape_detect.c             |  96 +++++++++++++
 board/ti/common/cape_detect.h             |  28 ++++
 cmd/Kconfig                               |  12 ++
 cmd/Makefile                              |   1 +
 cmd/extension_board.c                     | 167 ++++++++++++++++++++++
 cmd/fdt.c                                 |  49 -------
 common/fdt_support.c                      |  46 ++++++
 configs/CHIP_defconfig                    |   1 +
 doc/usage/extension.rst                   | 111 ++++++++++++++
 drivers/w1-eeprom/ds24xxx.c               |   7 +
 drivers/w1-eeprom/ds2502.c                |   6 +
 drivers/w1-eeprom/w1-eeprom-uclass.c      |  31 ----
 drivers/w1/w1-uclass.c                    |  76 +++++++++-
 include/extension_board.h                 |  31 ++++
 include/fdt_support.h                     |   2 +
 include/w1-eeprom.h                       |   2 -
 include/w1.h                              |  17 +++
 test/py/tests/test_extension.py           |  52 +++++++
 35 files changed, 835 insertions(+), 84 deletions(-)
 create mode 100644 arch/sandbox/dts/overlay0.dts
 create mode 100644 arch/sandbox/dts/overlay1.dts
 create mode 100644 board/sunxi/chip.c
 create mode 100644 board/ti/common/cape_detect.c
 create mode 100644 board/ti/common/cape_detect.h
 create mode 100644 cmd/extension_board.c
 create mode 100644 doc/usage/extension.rst
 create mode 100644 include/extension_board.h
 create mode 100644 test/py/tests/test_extension.py
Signature · 1 line
2.17.1
#1 lore raw

PATCH v5 1/10 fdt_support: move fdt_valid from cmd_fdt.c to fdt_support.c

Move the fdt_valid function to fdt_support.
This changes allow to be able to test the validity of a devicetree in other c files.

Update code syntax.

---
 cmd/fdt.c             | 49 -------------------------------------------
 common/fdt_support.c  | 46 ++++++++++++++++++++++++++++++++++++++++
 include/fdt_support.h |  2 ++
 3 files changed, 48 insertions(+), 49 deletions(-)
cmd/fdt.c +0 -49
index 89ab572d8d..f1e2fc2fd8 100644
@@ -27,7 +27,6 @@
  */
 DECLARE_GLOBAL_DATA_PTR;
 
-static int fdt_valid(struct fdt_header **blobp);
 static int fdt_parse_prop(char *const*newval, int count, char *data, int *len);
 static int fdt_print(const char *pathp, char *prop, int depth);
 static int is_printable_string(const void *data, int len);
@@ -732,54 +731,6 @@ static int do_fdt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 
 /****************************************************************************/
 
-/**
- * fdt_valid() - Check if an FDT is valid. If not, change it to NULL
- *
- * @blobp: Pointer to FDT pointer
- * @return 1 if OK, 0 if bad (in which case *blobp is set to NULL)
- */
-static int fdt_valid(struct fdt_header **blobp)
-{
-	const void *blob = *blobp;
-	int err;
-
-	if (blob == NULL) {
-		printf ("The address of the fdt is invalid (NULL).\n");
-		return 0;
-	}
-
-	err = fdt_check_header(blob);
-	if (err == 0)
-		return 1;	/* valid */
-
-	if (err < 0) {
-		printf("libfdt fdt_check_header(): %s", fdt_strerror(err));
-		/*
-		 * Be more informative on bad version.
-		 */
-		if (err == -FDT_ERR_BADVERSION) {
-			if (fdt_version(blob) <
-			    FDT_FIRST_SUPPORTED_VERSION) {
-				printf (" - too old, fdt %d < %d",
-					fdt_version(blob),
-					FDT_FIRST_SUPPORTED_VERSION);
-			}
-			if (fdt_last_comp_version(blob) >
-			    FDT_LAST_SUPPORTED_VERSION) {
-				printf (" - too new, fdt %d > %d",
-					fdt_version(blob),
-					FDT_LAST_SUPPORTED_VERSION);
-			}
-		}
-		printf("\n");
-		*blobp = NULL;
-		return 0;
-	}
-	return 1;
-}
-
-/****************************************************************************/
-
 /*
  * Parse the user's input, partially heuristic.  Valid formats:
  * <0x00112233 4 05>	- an array of cells.  Numbers follow standard
common/fdt_support.c +46 -0

49 lines not on this page · raw message

include/fdt_support.h +2 -0
index 46eb1dbbb2..412cbb99c1 100644
@@ -342,6 +342,8 @@ int fdt_setup_simplefb_node(void *fdt, int node, u64 base_address, u32 width,
 
 int fdt_overlay_apply_verbose(void *fdt, void *fdto);
 
+int fdt_valid(struct fdt_header **blobp);
+
 /**
  * fdt_get_cells_len() - Get the length of a type of cell in top-level nodes
  *
Signature · 1 line
2.17.1
#2 lore raw

PATCH v5 1/10 fdt_support: move fdt_valid from cmd_fdt.c to fdt_support.c

Quoted 9 lines · Kory Maincent

Move the fdt_valid function to fdt_support.
This changes allow to be able to test the validity of a devicetree in other c files.

Update code syntax.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210513/f242052a/attachment.sig>
#3 lore raw

PATCH v5 2/10 cmd: add support for a new "extension" command

In reply to Kory Maincent

This patch adds a new "extension" command, which aims at detecting extension boards connected to the hardware platform, and apply the Device Tree overlays that describe the hardware present on those extension boards.

In order to enable this mechanism, board-specific code must implement the extension_board_scan() function that fills in a linked list of "struct extension", each describing one extension board. In addition, the board-specific code must select the SUPPORT_EXTENSION_SCAN Kconfig boolean.

Based on this:

- "extension scan" makes the generic code call the board-specific extension_board_scan() function to retrieve the list of detected extension boards.

- "extension list" allows to list the detected extension boards.

- "extension apply <number>|all" allows to apply the Device Tree overlay(s) corresponding to one, or all, extension boards

The latter requires two environment variables to exist and set one variable to run:

- extension_overlay_addr: the RAM address where to load the Device Tree overlays

- extension_overlay_cmd: the U-Boot command to load one overlay. Indeed, the location and mechanism to load DT overlays is very setup specific.

- extension_overlay_name: set by the command: the name of the DT which will be load during the execution.

When calling the command described in the extension_overlay_cmd variable, the variable extension_overlay_name will be defined. So a typical extension_overlay_cmd will look like this:

extension_overlay_cmd=load mmc 0:1 $extension_overlay_addr /boot/$extension_overlay_name

Here is an example on how to use it:
=> run loadfdt
=> fdt addr $fdtaddr
=> setenv extension_overlay_addr 0x1000
=> setenv extension_overlay_cmd 'load mmc 0:1 ${extension_overlay_addr} /boot/${extension_overlay_name}' => extension scan
Found 1 extension board(s).
=> extension apply 0
519 bytes read in 3 ms (168.9 KiB/s)

---

Change since v1:
- Add list_for_each_entry loop bracket
- Move doc location and update it to rST

Change since v3:
- Update commit message

 cmd/Kconfig               |  12 +++
 cmd/Makefile              |   1 +
 cmd/extension_board.c     | 167 ++++++++++++++++++++++++++++++++++++++
 doc/usage/extension.rst   | 111 +++++++++++++++++++++++++
 include/extension_board.h |  31 +++++++
 5 files changed, 322 insertions(+)
 create mode 100644 cmd/extension_board.c
 create mode 100644 doc/usage/extension.rst
 create mode 100644 include/extension_board.h
cmd/Kconfig +12 -0
index 9e8b69258f..f962bb7141 100644
@@ -332,6 +332,18 @@ config CMD_FDT
 	help
 	  Do FDT related setup before booting into the Operating System.
 
+config SUPPORT_EXTENSION_SCAN
+	bool
+
+config CMD_EXTENSION
+	bool "Extension board management command"
+	select CMD_FDT
+	depends on SUPPORT_EXTENSION_SCAN
+	help
+	  Enables the "extension" command, which allows to detect
+	  extension boards connected to the system, and apply
+	  corresponding Device Tree overlays.
+
 config CMD_GO
 	bool "go"
 	default y
cmd/Makefile +1 -0
index 4977fa15f4..9d10e07f0e 100644
@@ -54,6 +54,7 @@ obj-$(CONFIG_CMD_DIAG) += diag.o
 endif
 obj-$(CONFIG_CMD_ADTIMG) += adtimg.o
 obj-$(CONFIG_CMD_ABOOTIMG) += abootimg.o
+obj-$(CONFIG_CMD_EXTENSION) += extension_board.o
 obj-$(CONFIG_CMD_ECHO) += echo.o
 obj-$(CONFIG_ENV_IS_IN_EEPROM) += eeprom.o
 obj-$(CONFIG_CMD_EEPROM) += eeprom.o
cmd/extension_board.c new file +167 -0

167 lines not on this page · raw message

doc/usage/extension.rst new file +111 -0

111 lines not on this page · raw message

include/extension_board.h new file +31 -0
new file mode 100644
index 0000000000..c530a0ad8a
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2021
+ * K?ry Maincent, Bootlin, <[email protected]>
+ */
+
+#ifndef __EXTENSION_SUPPORT_H
+#define __EXTENSION_SUPPORT_H
+
+struct extension {
+	struct list_head list;
+	char name[32];
+	char owner[32];
+	char version[32];
+	char overlay[32];
+	char other[32];
+};
+
+/**
+ * extension_board_scan - Add system-specific function to scan extension board.
+ * @param extension_list	List of extension board information to update.
+ * @return the number of extension.
+ *
+ * This function is called if CONFIG_CMD_EXTENSION is defined.
+ * Needs to fill the list extension_list with elements.
+ * Each element need to be allocated to an extension structure.
+ *
+ */
+int extension_board_scan(struct list_head *extension_list);
+
+#endif /* __EXTENSION_SUPPORT_H */
Signature · 1 line
2.17.1
#4 lore raw

PATCH v5 2/10 cmd: add support for a new "extension" command

Quoted 51 lines · Kory Maincent

This patch adds a new "extension" command, which aims at detecting extension boards connected to the hardware platform, and apply the Device Tree overlays that describe the hardware present on those extension boards.

In order to enable this mechanism, board-specific code must implement the extension_board_scan() function that fills in a linked list of "struct extension", each describing one extension board. In addition, the board-specific code must select the SUPPORT_EXTENSION_SCAN Kconfig boolean.

Based on this:

- "extension scan" makes the generic code call the board-specific extension_board_scan() function to retrieve the list of detected extension boards.

- "extension list" allows to list the detected extension boards.

- "extension apply <number>|all" allows to apply the Device Tree overlay(s) corresponding to one, or all, extension boards

The latter requires two environment variables to exist and set one variable to run:

- extension_overlay_addr: the RAM address where to load the Device Tree overlays

- extension_overlay_cmd: the U-Boot command to load one overlay. Indeed, the location and mechanism to load DT overlays is very setup specific.

- extension_overlay_name: set by the command: the name of the DT which will be load during the execution.

When calling the command described in the extension_overlay_cmd variable, the variable extension_overlay_name will be defined. So a typical extension_overlay_cmd will look like this:

extension_overlay_cmd=load mmc 0:1 $extension_overlay_addr /boot/$extension_overlay_name

Here is an example on how to use it:
=> run loadfdt
=> fdt addr $fdtaddr
=> setenv extension_overlay_addr 0x1000
=> setenv extension_overlay_cmd 'load mmc 0:1 ${extension_overlay_addr} /boot/${extension_overlay_name}' => extension scan
Found 1 extension board(s).
=> extension apply 0
519 bytes read in 3 ms (168.9 KiB/s)

Quoted 2 lines

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210513/5632b935/attachment.sig>
#5 lore raw

PATCH v5 3/10 pytest: add sandbox test for "extension" command

In reply to Kory Maincent

This commit extends the sandbox to implement a dummy extension_board_scan() function and enables the extension command in the sandbox configuration. It then adds a test that checks the proper functionality of the extension command by applying two Device Tree overlays to the sandbox Device Tree.

---
 arch/Kconfig                    |  2 ++
 arch/sandbox/dts/Makefile       |  1 +
 arch/sandbox/dts/overlay0.dts   |  9 ++++++
 arch/sandbox/dts/overlay1.dts   |  9 ++++++
 board/sandbox/sandbox.c         | 23 +++++++++++++++
 test/py/tests/test_extension.py | 52 +++++++++++++++++++++++++++++++++
 6 files changed, 96 insertions(+)
 create mode 100644 arch/sandbox/dts/overlay0.dts
 create mode 100644 arch/sandbox/dts/overlay1.dts
 create mode 100644 test/py/tests/test_extension.py
arch/Kconfig +2 -0
index e61a7528ba..6c4b81a486 100644
@@ -121,6 +121,7 @@ config SANDBOX
 	select SUPPORT_OF_CONTROL
 	select SYSRESET_CMD_POWEROFF
 	select IRQ
+	select SUPPORT_EXTENSION_SCAN
 	imply BITREVERSE
 	select BLOBLIST
 	imply CMD_DM
@@ -165,6 +166,7 @@ config SANDBOX
 	imply BOOTARGS_SUBST
 	imply PHY_FIXED
 	imply DM_DSA
+	imply CMD_EXTENSION
 
 config SH
 	bool "SuperH architecture"
arch/sandbox/dts/Makefile +1 -0
index d231dc2877..3e5dc67d53 100644
@@ -6,6 +6,7 @@ else
 dtb-$(CONFIG_SANDBOX) += sandbox.dtb
 endif
 dtb-$(CONFIG_UT_DM) += test.dtb
+dtb-$(CONFIG_CMD_EXTENSION) += overlay0.dtbo overlay1.dtbo
 
 targets += $(dtb-y)
 
arch/sandbox/dts/overlay0.dts new file +9 -0
new file mode 100644
index 0000000000..70c6cf77aa
@@ -0,0 +1,9 @@
+/dts-v1/;
+/plugin/;
+
+&{/buttons} {
+	btn3 {
+		gpios = <&gpio_a 5 0>;
+		label = "button3";
+	};
+};
arch/sandbox/dts/overlay1.dts new file +9 -0
new file mode 100644
index 0000000000..51621b3110
@@ -0,0 +1,9 @@
+/dts-v1/;
+/plugin/;
+
+&{/buttons} {
+	btn4 {
+		gpios = <&gpio_a 5 0>;
+		label = "button4";
+	};
+};
board/sandbox/sandbox.c +23 -0
index 902b99ed50..dcd73451a3 100644
@@ -14,6 +14,9 @@
 #include <asm/global_data.h>
 #include <asm/test.h>
 #include <asm/u-boot-sandbox.h>
+#include <malloc.h>
+
+#include <extension_board.h>
 
 /*
  * Pointer to initial global data area
@@ -79,6 +82,26 @@ int ft_board_setup(void *fdt, struct bd_info *bd)
 	return fdt_add_mem_rsv(fdt, 0x00d02000, 0x4000);
 }
 
+#ifdef CONFIG_CMD_EXTENSION
+int extension_board_scan(struct list_head *extension_list)
+{
+	struct extension *extension;
+	int i;
+
+	for (i = 0; i < 2; i++) {
+		extension = calloc(1, sizeof(struct extension));
+		snprintf(extension->overlay, sizeof(extension->overlay), "overlay%d.dtbo", i);
+		snprintf(extension->name, sizeof(extension->name), "extension board %d", i);
+		snprintf(extension->owner, sizeof(extension->owner), "sandbox");
+		snprintf(extension->version, sizeof(extension->version), "1.1");
+		snprintf(extension->other, sizeof(extension->other), "Fictionnal extension board");
+		list_add_tail(&extension->list, extension_list);
+	}
+
+	return i;
+}
+#endif
+
 #ifdef CONFIG_BOARD_LATE_INIT
 int board_late_init(void)
 {
test/py/tests/test_extension.py new file +52 -0

52 lines not on this page · raw message

Signature · 1 line
2.17.1
#6 lore raw

PATCH v5 3/10 pytest: add sandbox test for "extension" command

Quoted 7 lines · Kory Maincent

This commit extends the sandbox to implement a dummy extension_board_scan() function and enables the extension command in the sandbox configuration. It then adds a test that checks the proper functionality of the extension command by applying two Device Tree overlays to the sandbox Device Tree.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210513/907618ad/attachment.sig>
#7 lore raw

PATCH v5 4/10 ti/common: add support for extension_scan_board function

In reply to Kory Maincent

The BeagleBone platforms all use a common mechanism to discover and identify extension boards (called "capes"): each extension board has an I2C-connected EEPROM describing itself.

This patch implements a generic extension_scan_board() feature that can be used by all BeagleBone platforms to read those I2C EEPROMs and fill in the list of "extension" structures.

Following commits will enable this common logic on two BeagleBone platforms.

---

Change Since v1:
- Use CAPE_EEPROM_BUS_NUM in Kconfig in place of the board header

 board/ti/common/Kconfig       |  6 +++
 board/ti/common/Makefile      |  1 +
 board/ti/common/cape_detect.c | 96 +++++++++++++++++++++++++++++++++++
 board/ti/common/cape_detect.h | 28 ++++++++++
 4 files changed, 131 insertions(+)
 create mode 100644 board/ti/common/cape_detect.c
 create mode 100644 board/ti/common/cape_detect.h
board/ti/common/Kconfig +6 -0
index 9ead7ca038..49edd98014 100644
@@ -16,6 +16,12 @@ config EEPROM_CHIP_ADDRESS
 	default 0x50
 	depends on TI_I2C_BOARD_DETECT
 
+config CAPE_EEPROM_BUS_NUM
+	int "Cape EEPROM's I2C bus address"
+	range 0 8
+	default 2
+	depends on CMD_EXTENSION
+
 config TI_COMMON_CMD_OPTIONS
 	bool "Enable cmd options on TI platforms"
 	imply CMD_ASKENV
board/ti/common/Makefile +1 -0
index cb97f226ae..3172d87b46 100644
@@ -2,3 +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
board/ti/common/cape_detect.c new file +96 -0

96 lines not on this page · raw message

board/ti/common/cape_detect.h new file +28 -0
new file mode 100644
index 0000000000..b0d5c9f18b
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2021
+ * K?ry Maincent, Bootlin, <[email protected]>
+ */
+
+#ifndef __CAPE_DETECT_H
+#define __CAPE_DETECT_H
+
+struct am335x_cape_eeprom_id {
+	unsigned int header;
+	char eeprom_rev[2];
+	char board_name[32];
+	char version[4];
+	char manufacturer[16];
+	char part_number[16];
+};
+
+#define CAPE_EEPROM_FIRST_ADDR	0x54
+#define CAPE_EEPROM_LAST_ADDR	0x57
+
+#define CAPE_EEPROM_ADDR_LEN 0x10
+
+#define CAPE_MAGIC 0xEE3355AA
+
+int extension_board_scan(struct list_head *extension_list);
+
+#endif /* __CAPE_DETECT_H */
Signature · 1 line
2.17.1
#8 lore raw

PATCH v5 4/10 ti/common: add support for extension_scan_board function

Quoted 4 lines · Kory Maincent

The BeagleBone platforms all use a common mechanism to discover and identify extension boards (called "capes"): each extension board has an I2C-connected EEPROM describing itself.

Quoted 8 lines

This patch implements a generic extension_scan_board() feature that can be used by all BeagleBone platforms to read those I2C EEPROMs and fill in the list of "extension" structures.

Following commits will enable this common logic on two BeagleBone platforms.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210513/8cc48245/attachment.sig>
#9 lore raw

PATCH v5 5/10 am57xx: add support for cape detect functionality

In reply to Kory Maincent

This commit enables using the extension board detection mechanism on AM57xx based platforms.

---

Change Since v1:
- Remove CAPE_EEPROM_BUS_NUM from the header

 arch/arm/mach-omap2/omap5/Kconfig | 1 +
 board/ti/am57xx/board.c           | 1 +
 2 files changed, 2 insertions(+)
arch/arm/mach-omap2/omap5/Kconfig +1 -0
index a7132dae09..4c2f990b28 100644
@@ -36,6 +36,7 @@ config TARGET_AM57XX_EVM
 	select CMD_DDR3
 	select DRA7XX
 	select TI_I2C_BOARD_DETECT
+	select SUPPORT_EXTENSION_SCAN
 	imply DM_THERMAL
 	imply SCSI
 	imply SPL_THERMAL
board/ti/am57xx/board.c +1 -0
index 73063faee6..05c26c74d9 100644
@@ -43,6 +43,7 @@
 #include <hang.h>
 
 #include "../common/board_detect.h"
+#include "../common/cape_detect.h"
 #include "mux_data.h"
 
 #ifdef CONFIG_SUPPORT_EMMC_BOOT
Signature · 1 line
2.17.1
#10 lore raw

PATCH v5 5/10 am57xx: add support for cape detect functionality

Quoted 4 lines · Kory Maincent

This commit enables using the extension board detection mechanism on AM57xx based platforms.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210513/8ea438bb/attachment.sig>
#11 lore raw

PATCH v5 6/10 w1: replace dt detection by automatic detection

In reply to Kory Maincent

This patch changes the functioning of the detection of w1 devices. The old way was a comparison between detected w1 and the ones described in the device tree. Now it will just look for the driver matching the family id of the w1 detected.

The patch is inspired from Maxime Ripard code.

---

Change since v2:
- drop the remove action of devicetree match in the W1 EEPROMs drivers.
- move the w1_device_register function to w1-uclass.
- update the w1_device_register function to be compatible with automatic detection and devicetree detection. I will not bind the device if it as been found in the devicetree.
- update the w1 device driver list to have only two parameters in the U_BOOT_W1_DEVICE function.

 drivers/w1-eeprom/ds24xxx.c          |  7 +++
 drivers/w1-eeprom/ds2502.c           |  6 +++
 drivers/w1-eeprom/w1-eeprom-uclass.c | 31 ------------
 drivers/w1/w1-uclass.c               | 76 +++++++++++++++++++++++++++-
 include/w1-eeprom.h                  |  2 -
 include/w1.h                         | 17 +++++++
 6 files changed, 104 insertions(+), 35 deletions(-)
drivers/w1-eeprom/ds24xxx.c +7 -0
index d12fd5754e..4be378b43d 100644
@@ -53,3 +53,10 @@ U_BOOT_DRIVER(ds24xxx) = {
 	.ops		= &ds24xxx_ops,
 	.probe		= ds24xxx_probe,
 };
+
+u8 family_supported[] = {
+	W1_FAMILY_DS24B33,
+	W1_FAMILY_DS2431,
+};
+
+U_BOOT_W1_DEVICE(ds24xxx, family_supported);
drivers/w1-eeprom/ds2502.c +6 -0
index b3d68d7f05..a67f5edd0f 100644
@@ -243,3 +243,9 @@ U_BOOT_DRIVER(ds2502) = {
 	.ops		= &ds2502_ops,
 	.probe		= ds2502_probe,
 };
+
+u8 family_supported[] = {
+	W1_FAMILY_DS2502,
+};
+
+U_BOOT_W1_DEVICE(ds2502, family_supported);
drivers/w1-eeprom/w1-eeprom-uclass.c +0 -31
index 97a9d43b03..7a02af3dd6 100644
@@ -37,37 +37,6 @@ int w1_eeprom_read_buf(struct udevice *dev, unsigned int offset,
 	return ops->read_buf(dev, offset, buf, count);
 }
 
-int w1_eeprom_register_new_device(u64 id)
-{
-	u8 family = id & 0xff;
-	int ret;
-	struct udevice *dev;
-
-	for (ret = uclass_first_device(UCLASS_W1_EEPROM, &dev);
-	     !ret && dev;
-	     uclass_next_device(&dev)) {
-		if (ret || !dev) {
-			debug("cannot find w1 eeprom dev\n");
-			return ret;
-		}
-		if (dev_get_driver_data(dev) == family) {
-			struct w1_device *w1;
-
-			w1 = dev_get_parent_plat(dev);
-			if (w1->id) /* device already in use */
-				continue;
-			w1->id = id;
-			debug("%s: Match found: %s:%s %llx\n", __func__,
-			      dev->name, dev->driver->name, id);
-			return 0;
-		}
-	}
-
-	debug("%s: No matches found: error %d\n", __func__, ret);
-
-	return ret;
-}
-
 int w1_eeprom_get_id(struct udevice *dev, u64 *id)
 {
 	struct w1_device *w1 = dev_get_parent_plat(dev);
drivers/w1/w1-uclass.c +74 -2

97 lines not on this page · raw message

include/w1-eeprom.h +0 -2
index 22337368b4..b3cf77a81e 100644
@@ -27,7 +27,5 @@ int w1_eeprom_read_buf(struct udevice *dev, unsigned int offset,
 
 int w1_eeprom_dm_init(void);
 
-int w1_eeprom_register_new_device(u64 id);
-
 int w1_eeprom_get_id(struct udevice *dev, u64 *id);
 #endif
include/w1.h +17 -0
index 77f439e587..b18078ba15 100644
@@ -15,6 +15,23 @@ struct udevice;
 #define W1_FAMILY_DS2502	0x09
 #define W1_FAMILY_EEP_SANDBOX	0xfe
 
+struct w1_driver_entry {
+	struct driver	*driver;
+	u8		*family;
+};
+
+/* U_BOOT_W1_DEVICE() tells U-Boot to create a one-wire device.
+ *
+ * @__name: Device name (C identifier, not a string. E.g. gpio7_at_ff7e0000)
+ * @__driver: Driver name (C identifier, not a string. E.g. gpio7_at_ff7e0000)
+ * @__family: Family code number of the one-wire
+ */
+#define U_BOOT_W1_DEVICE(__name, __family)				\
+	ll_entry_declare(struct w1_driver_entry, __name, w1_driver_entry) = { \
+		.driver = llsym(struct driver, __name, driver),		\
+		.family = __family,					\
+	}
+
 struct w1_device {
 	u64	id;
 };
Signature · 1 line
2.17.1
#12 lore raw

PATCH v5 6/10 w1: replace dt detection by automatic detection

Quoted 9 lines · Kory Maincent

This patch changes the functioning of the detection of w1 devices. The old way was a comparison between detected w1 and the ones described in the device tree. Now it will just look for the driver matching the family id of the w1 detected.

The patch is inspired from Maxime Ripard code.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210513/0b6de607/attachment.sig>
#13 lore raw

PATCH v5 7/10 arm: sunxi: add support for DIP detection to CHIP board

In reply to Kory Maincent

Add the extension_board_scan specific function to scan the information of the EEPROM on one-wire and fill the extension struct. Add the Kconfig symbol to enable the needs to detect DIPs.

---

Change since v1:
- Replace TARGET_CHIP options by CHIP_DIP_SCAN

Change since v2:
- Fix typo
- Place the Kconfig symbol in that patch

Change since v3:
- Replace imply CMD_EXTENSION by select option. Remove the build test on CMD_EXTENSION in the chip.c file.

 arch/arm/mach-sunxi/Kconfig |   9 ++++
 board/sunxi/Makefile        |   1 +
 board/sunxi/chip.c          | 100 ++++++++++++++++++++++++++++++++++++
 3 files changed, 110 insertions(+)
 create mode 100644 board/sunxi/chip.c
arch/arm/mach-sunxi/Kconfig +9 -0
index 8e9012dbbf..bc8509b72a 100644
@@ -1089,3 +1089,12 @@ config BLUETOOTH_DT_DEVICE_FIXUP
 	  flipped elsewise.
 
 endif
+
+config CHIP_DIP_SCAN
+	bool "Enable DIPs detection for CHIP board"
+	select SUPPORT_EXTENSION_SCAN
+	select W1
+	select W1_GPIO
+	select W1_EEPROM
+	select W1_EEPROM_DS24XXX
+	select CMD_EXTENSION
board/sunxi/Makefile +1 -0
index c4e13f8c38..d96b7897b6 100644
@@ -11,3 +11,4 @@ obj-$(CONFIG_SUN7I_GMAC)	+= gmac.o
 obj-$(CONFIG_MACH_SUN4I)	+= dram_sun4i_auto.o
 obj-$(CONFIG_MACH_SUN5I)	+= dram_sun5i_auto.o
 obj-$(CONFIG_MACH_SUN7I)	+= dram_sun5i_auto.o
+obj-$(CONFIG_CHIP_DIP_SCAN)	+= chip.o
board/sunxi/chip.c new file +100 -0

100 lines not on this page · raw message

Signature · 1 line
2.17.1
#14 lore raw

PATCH v5 7/10 arm: sunxi: add support for DIP detection to CHIP board

Quoted 6 lines · On Tue, 4 May 2021 19:31:27 +0200 Kory Maincent <[email protected]>…

Add the extension_board_scan specific function to scan the information of the EEPROM on one-wire and fill the extension struct. Add the Kconfig symbol to enable the needs to detect DIPs.

We needlessly compile this for the SPL, but the toolchain garbage collection is clever enough to discard this, so it's not a problem.

Thanks,
Andre

Quoted 151 lines

---

Change since v1:
- Replace TARGET_CHIP options by CHIP_DIP_SCAN

Change since v2:
- Fix typo
- Place the Kconfig symbol in that patch

Change since v3:
- Replace imply CMD_EXTENSION by select option. Remove the build test on CMD_EXTENSION in the chip.c file.

 arch/arm/mach-sunxi/Kconfig |   9 ++++
 board/sunxi/Makefile        |   1 +
 board/sunxi/chip.c          | 100 ++++++++++++++++++++++++++++++++++++
 3 files changed, 110 insertions(+)
 create mode 100644 board/sunxi/chip.c
arch/arm/mach-sunxi/Kconfig +9 -0
index 8e9012dbbf..bc8509b72a 100644
@@ -1089,3 +1089,12 @@ config BLUETOOTH_DT_DEVICE_FIXUP
 	  flipped elsewise.
 
 endif
+
+config CHIP_DIP_SCAN
+	bool "Enable DIPs detection for CHIP board"
+	select SUPPORT_EXTENSION_SCAN
+	select W1
+	select W1_GPIO
+	select W1_EEPROM
+	select W1_EEPROM_DS24XXX
+	select CMD_EXTENSION
board/sunxi/Makefile +1 -0
index c4e13f8c38..d96b7897b6 100644
@@ -11,3 +11,4 @@ obj-$(CONFIG_SUN7I_GMAC)	+= gmac.o
 obj-$(CONFIG_MACH_SUN4I)	+= dram_sun4i_auto.o
 obj-$(CONFIG_MACH_SUN5I)	+= dram_sun5i_auto.o
 obj-$(CONFIG_MACH_SUN7I)	+= dram_sun5i_auto.o
+obj-$(CONFIG_CHIP_DIP_SCAN)	+= chip.o
board/sunxi/chip.c new file +100 -0
new file mode 100644
index 0000000000..cde04bebe9
@@ -0,0 +1,100 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2021
+ * K?ry Maincent, Bootlin, <[email protected]>
+ * Based on initial code from Maxime Ripard
+ */
+
+#include <common.h>
+#include <malloc.h>
+#include <dm.h>
+#include <w1.h>
+#include <w1-eeprom.h>
+#include <dm/device-internal.h>
+
+#include <asm/arch/gpio.h>
+
+#include <extension_board.h>
+
+#define for_each_w1_device(b, d) \
+	for (device_find_first_child(b, d); *d; device_find_next_child(d))
+
+#define dip_convert(field)						\
+	(								\
+		(sizeof(field) == 1) ? field :				\
+		(sizeof(field) == 2) ? be16_to_cpu(field) :		\
+		(sizeof(field) == 4) ? be32_to_cpu(field) :		\
+		-1							\
+	)
+
+#define DIP_MAGIC	0x50494843	/* CHIP */
+
+struct dip_w1_header {
+	u32     magic;                  /* CHIP */
+	u8      version;                /* spec version */
+	u32     vendor_id;
+	u16     product_id;
+	u8      product_version;
+	char    vendor_name[32];
+	char    product_name[32];
+	u8      rsvd[36];               /* rsvd for future spec versions */
+	u8      data[16];               /* user data, per-dip specific */
+} __packed;
+
+int extension_board_scan(struct list_head *extension_list)
+{
+	struct extension *dip;
+	struct dip_w1_header w1_header;
+	struct udevice *bus, *dev;
+	u32 vid;
+	u16 pid;
+	int ret;
+
+	int num_dip = 0;
+
+	sunxi_gpio_set_pull(SUNXI_GPD(2), SUNXI_GPIO_PULL_UP);
+
+	ret = w1_get_bus(0, &bus);
+	if (ret) {
+		printf("one wire interface not found\n");
+		return 0;
+	}
+
+	for_each_w1_device(bus, &dev) {
+		if (w1_get_device_family(dev) != W1_FAMILY_DS2431)
+			continue;
+
+		ret = device_probe(dev);
+		if (ret) {
+			printf("Couldn't probe device %s: error %d",
+			       dev->name, ret);
+			continue;
+		}
+
+		w1_eeprom_read_buf(dev, 0, (u8 *)&w1_header, sizeof(w1_header));
+
+		if (w1_header.magic != DIP_MAGIC)
+			continue;
+
+		vid = dip_convert(w1_header.vendor_id);
+		pid = dip_convert(w1_header.product_id);
+
+		printf("DIP: %s (0x%x) from %s (0x%x)\n",
+		       w1_header.product_name, pid,
+		       w1_header.vendor_name, vid);
+
+		dip = calloc(1, sizeof(struct extension));
+		if (!dip) {
+			printf("Error in memory allocation\n");
+			return num_dip;
+		}
+
+		snprintf(dip->overlay, sizeof(dip->overlay), "dip-%x-%x.dtbo",
+			 vid, pid);
+		strncpy(dip->name, w1_header.product_name, 32);
+		strncpy(dip->owner, w1_header.vendor_name, 32);
+		list_add_tail(&dip->list, extension_list);
+		num_dip++;
+	}
+	return num_dip;
+}
#15 lore raw

PATCH v5 7/10 arm: sunxi: add support for DIP detection to CHIP board

In reply to Kory Maincent
Quoted 7 lines · Kory Maincent

Add the extension_board_scan specific function to scan the information of the EEPROM on one-wire and fill the extension struct. Add the Kconfig symbol to enable the needs to detect DIPs.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210513/8b125b8a/attachment-0001.sig>
#16 lore raw

PATCH v5 8/10 configs: CHIP: add support for DIP detect functionality

In reply to Kory Maincent

This commit enables using the extension board detection mechanism on CHIP boards

---
 configs/CHIP_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/CHIP_defconfig +1 -0
index a70ee31d40..8d40da090b 100644
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_SPL=y
+CONFIG_CHIP_DIP_SCAN=y
 CONFIG_MACH_SUN5I=y
 CONFIG_DRAM_TIMINGS_DDR3_800E_1066G_1333J=y
 CONFIG_USB0_VBUS_PIN="PB10"
Signature · 1 line
2.17.1
#17 lore raw

PATCH v5 8/10 configs: CHIP: add support for DIP detect functionality

Quoted 5 lines · On Tue, 4 May 2021 19:31:28 +0200 Kory Maincent <[email protected]>…

This commit enables using the extension board detection mechanism on CHIP boards

Cheers,
Andre

P.S. Out of curiosity: what is the story for the CHIP Pro here? Does it not work there or is it just not tested?

Quoted 16 lines
---
 configs/CHIP_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/CHIP_defconfig +1 -0
index a70ee31d40..8d40da090b 100644
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_SPL=y
+CONFIG_CHIP_DIP_SCAN=y
 CONFIG_MACH_SUN5I=y
 CONFIG_DRAM_TIMINGS_DDR3_800E_1066G_1333J=y
 CONFIG_USB0_VBUS_PIN="PB10"
#18 lore raw

PATCH v5 8/10 configs: CHIP: add support for DIP detect functionality

Hello Andre,

Quoted 9 lines · On Thu, 13 May 2021 12:03:05 +0100 Andre Przywara <[email protected]>…
Quoted 5 lines · On Tue, 4 May 2021 19:31:28 +0200 Kory Maincent <[email protected]>…

This commit enables using the extension board detection mechanism on CHIP boards

Quoted 7 lines

Cheers,
Andre

P.S. Out of curiosity: what is the story for the CHIP Pro here? Does it not work there or is it just not tested?

The CHIP PRO design is not compatible with the DIPs in the market. I do not have heard about DIPs for CHIP PRO pinout, maybe Maxime has more information about it.

Regards,
K?ry

#19 lore raw

PATCH v5 8/10 configs: CHIP: add support for DIP detect functionality

In reply to Kory Maincent
Quoted 6 lines · Kory Maincent

This commit enables using the extension board detection mechanism on CHIP boards

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210513/0bb98eb1/attachment-0001.sig>
#20 lore raw

PATCH v5 9/10 arm: am335x: add support for i2c2 bus

In reply to Kory Maincent

The am335x from BeagleBone use i2c EEPROM to detect capes. The memory is wired to i2c bus 2 therefore it need to be enabled.

Add i2c2 clock, pinmux description and pinmux enable function.

---
 arch/arm/mach-omap2/am33xx/clock_am33xx.c |  1 +
 board/ti/am335x/board.c                   |  2 ++
 board/ti/am335x/board.h                   |  1 +
 board/ti/am335x/mux.c                     | 15 +++++++++++++++
 4 files changed, 19 insertions(+)
arch/arm/mach-omap2/am33xx/clock_am33xx.c +1 -0
index cf71192360..3a7ac60264 100644
@@ -220,6 +220,7 @@ void enable_basic_clocks(void)
 		&cmper->gpio2clkctrl,
 		&cmper->gpio3clkctrl,
 		&cmper->i2c1clkctrl,
+		&cmper->i2c2clkctrl,
 		&cmper->cpgmac0clkctrl,
 		&cmper->spi0clkctrl,
 		&cmrtc->rtcclkctrl,
board/ti/am335x/board.c +2 -0
index bc1657e88f..c7476b3a8c 100644
@@ -77,8 +77,10 @@ static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 void do_board_detect(void)
 {
 	enable_i2c0_pin_mux();
+	enable_i2c2_pin_mux();
 #if !CONFIG_IS_ENABLED(DM_I2C)
 	i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
+	i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED2, CONFIG_SYS_OMAP24_I2C_SLAVE2);
 #endif
 	if (ti_i2c_eeprom_am_get(CONFIG_EEPROM_BUS_ADDRESS,
 				 CONFIG_EEPROM_CHIP_ADDRESS))
board/ti/am335x/board.h +1 -0
index 48df914af9..c2962111c1 100644
@@ -93,5 +93,6 @@ void enable_uart3_pin_mux(void);
 void enable_uart4_pin_mux(void);
 void enable_uart5_pin_mux(void);
 void enable_i2c0_pin_mux(void);
+void enable_i2c2_pin_mux(void);
 void enable_board_pin_mux(void);
 #endif
board/ti/am335x/mux.c +15 -0
index 03adcd2b76..e450ff64d8 100644
@@ -124,6 +124,14 @@ static struct module_pin_mux i2c1_pin_mux[] = {
 	{-1},
 };
 
+static struct module_pin_mux i2c2_pin_mux[] = {
+	{OFFSET(uart1_ctsn), (MODE(3) | RXACTIVE |
+			PULLUDEN | PULLUP_EN | SLEWCTRL)},	/* I2C_DATA */
+	{OFFSET(uart1_rtsn), (MODE(3) | RXACTIVE |
+			PULLUDEN | PULLUP_EN | SLEWCTRL)},	/* I2C_SCLK */
+	{-1},
+};
+
 static struct module_pin_mux spi0_pin_mux[] = {
 	{OFFSET(spi0_sclk), (MODE(0) | RXACTIVE | PULLUDEN)},	/* SPI0_SCLK */
 	{OFFSET(spi0_d0), (MODE(0) | RXACTIVE |
@@ -308,6 +316,11 @@ void enable_i2c0_pin_mux(void)
 	configure_module_pin_mux(i2c0_pin_mux);
 }
 
+void enable_i2c2_pin_mux(void)
+{
+	configure_module_pin_mux(i2c2_pin_mux);
+}
+
 /*
  * The AM335x GP EVM, if daughter card(s) are connected, can have 8
  * different profiles.  These profiles determine what peripherals are
@@ -367,6 +380,7 @@ void enable_board_pin_mux(void)
 #else
 		configure_module_pin_mux(mmc1_pin_mux);
 #endif
+		configure_module_pin_mux(i2c2_pin_mux);
 	} else if (board_is_gp_evm()) {
 		/* General Purpose EVM */
 		unsigned short profile = detect_daughter_board_profile();
@@ -411,6 +425,7 @@ void enable_board_pin_mux(void)
 #else
 		configure_module_pin_mux(mmc1_pin_mux);
 #endif
+		configure_module_pin_mux(i2c2_pin_mux);
 	} else if (board_is_pb()) {
 		configure_module_pin_mux(mii1_pin_mux);
 		configure_module_pin_mux(mmc0_pin_mux);
Signature · 1 line
2.17.1
#21 lore raw

PATCH v5 9/10 arm: am335x: add support for i2c2 bus

Quoted 6 lines · Kory Maincent

The am335x from BeagleBone use i2c EEPROM to detect capes. The memory is wired to i2c bus 2 therefore it need to be enabled.

Add i2c2 clock, pinmux description and pinmux enable function.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210513/303d0135/attachment.sig>
#22 lore raw

PATCH v5 10/10 am335x: add support for cape detect functionality

In reply to Kory Maincent

Update the Kconfig and the board file to make the am335x board compatible with cape detection.

---

Change Since v1:
- Remove CAPE_EEPROM_BUS_NUM from board header

 arch/arm/mach-omap2/am33xx/Kconfig | 1 +
 board/ti/am335x/board.c            | 1 +
 2 files changed, 2 insertions(+)
arch/arm/mach-omap2/am33xx/Kconfig +1 -0
index 9a98e8a0a9..11e54cd293 100644
@@ -34,6 +34,7 @@ config TARGET_AM335X_EVM
 	select DM_GPIO
 	select DM_SERIAL
 	select TI_I2C_BOARD_DETECT
+	select SUPPORT_EXTENSION_SCAN
 	imply CMD_DM
 	imply SPL_DM
 	imply SPL_DM_SEQ_ALIAS
board/ti/am335x/board.c +1 -0
index c7476b3a8c..5959ff73dc 100644
@@ -44,6 +44,7 @@
 #include <env_internal.h>
 #include <watchdog.h>
 #include "../common/board_detect.h"
+#include "../common/cape_detect.h"
 #include "board.h"
 
 DECLARE_GLOBAL_DATA_PTR;
Signature · 1 line
2.17.1
#23 lore raw

PATCH v5 10/10 am335x: add support for cape detect functionality

Quoted 4 lines · Kory Maincent

Update the Kconfig and the board file to make the am335x board compatible with cape detection.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210513/9c706282/attachment.sig>
#24 lore raw

v5 cover Add support for extension boards detection and DT overlays application

In reply to Kory Maincent

Hello Tom,

Quoted 11 lines · On Tue, 4 May 2021 19:31:20 +0200 Kory Maincent <[email protected]>…

Kory Maincent (10):
fdt_support: move fdt_valid from cmd_fdt.c to fdt_support.c
cmd: add support for a new "extension" command
pytest: add sandbox test for "extension" command ti/common: add support for extension_scan_board function
am57xx: add support for cape detect functionality
w1: replace dt detection by automatic detection
arm: sunxi: add support for DIP detection to CHIP board
configs: CHIP: add support for DIP detect functionality
arm: am335x: add support for i2c2 bus
am335x: add support for cape detect functionality

This series has gone through 5 iterations since the first posting mid-February. On version 4, we haven't received any feedback except your request to resend an updated version based on the latest master.

What are the plans with this series? Do you expect to receive more reviews? Or do you plan to apply it? Indeed, as the only comment on v4 was to rebase on master and v5 doesn't get apply soon enough, it will again no longer cleanly apply on master :-)

Do not hesitate to let us know what is needed to get this series considered for merging.

Thanks a lot!

Thomas Petazzoni

Signature · 3 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#25 lore raw

v5 cover Add support for extension boards detection and DT overlays application

Quoted 21 lines · Thomas Petazzoni

Hello Tom,

Quoted 11 lines · On Tue, 4 May 2021 19:31:20 +0200 Kory Maincent <[email protected]>…

Kory Maincent (10):
fdt_support: move fdt_valid from cmd_fdt.c to fdt_support.c
cmd: add support for a new "extension" command
pytest: add sandbox test for "extension" command ti/common: add support for extension_scan_board function
am57xx: add support for cape detect functionality
w1: replace dt detection by automatic detection
arm: sunxi: add support for DIP detection to CHIP board
configs: CHIP: add support for DIP detect functionality
arm: am335x: add support for i2c2 bus
am335x: add support for cape detect functionality

This series has gone through 5 iterations since the first posting mid-February. On version 4, we haven't received any feedback except your request to resend an updated version based on the latest master.

Quoted 7 lines

What are the plans with this series? Do you expect to receive more reviews? Or do you plan to apply it? Indeed, as the only comment on v4 was to rebase on master and v5 doesn't get apply soon enough, it will again no longer cleanly apply on master :-)

Do not hesitate to let us know what is needed to get this series considered for merging.

Thanks for the reminder. I've fixed up a small issue with the test (it needs to only run on sandbox and not say real hardware wit CMD_FDT) and am otherwise world build testing it again now.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210513/d316dbf5/attachment.sig>
#26 lore raw

v5 cover Add support for extension boards detection and DT overlays application

Quoted 6 lines · On Thu, 13 May 2021 08:18:53 -0400 Tom Rini <[email protected]> wrote:
Quoted 2 lines

Do not hesitate to let us know what is needed to get this series considered for merging.

Thanks for the reminder. I've fixed up a small issue with the test (it needs to only run on sandbox and not say real hardware wit CMD_FDT) and am otherwise world build testing it again now.

Excellent, thanks. Once again, do not hesitate to let us know if there's any remaining issue to investigate and fix, or any concern about the overall design/approach.

Best regards,

Thomas Petazzoni

Signature · 3 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com