
Hi,
On Wed, Mar 24, 2021 at 11:04:17AM +0100, Kory Maincent wrote:
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.
Signed-off-by: Kory Maincent kory.maincent@bootlin.com
Need the following patches series to fix a one-wire gpio issue. https://lists.denx.de/pipermail/u-boot/2021-February/440073.html
Change since v1:
- Replace TARGET_CHIP options by CHIP_DIP_SCAN
Change since v2:
- Fix typo
- Place the Kconfig symbol in that patch
arch/arm/mach-sunxi/Kconfig | 9 ++++ board/sunxi/Makefile | 1 + board/sunxi/chip.c | 104 ++++++++++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 board/sunxi/chip.c
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index 49ef217f08..2b6ba873ff 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -1017,3 +1017,12 @@ config PINEPHONE_DT_SELECTION correct PinePhone hardware revision during boot.
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
- imply CMD_EXTENSION
diff --git a/board/sunxi/Makefile b/board/sunxi/Makefile index c4e13f8c38..d96b7897b6 100644 --- a/board/sunxi/Makefile +++ b/board/sunxi/Makefile @@ -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 diff --git a/board/sunxi/chip.c b/board/sunxi/chip.c new file mode 100644 index 0000000000..9be2ede57b --- /dev/null +++ b/board/sunxi/chip.c @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: GPL-2.0+ +/*
- (C) Copyright 2021
- Köry Maincent, Bootlin, kory.maincent@bootlin.com
- 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>
+#ifdef CONFIG_CMD_EXTENSION
You depend on CMD_EXTENSION already, so that code won't even be compiled if that configuration option is false
Once fixed, Reviewed-by: Maxime Ripard maxime@cerno.tech
Maxime