[U-Boot] [PATCH] am3517_evm: add FIT support

From: Yegor Yefremov yegorslists@googlemail.com
Enable DTS support (CONFIG_OF_LIBFDT), create ft_board_setup() stub and select CONFIG_FIT in defconfig.
Signed-off-by: Yegor Yefremov yegorslists@googlemail.com --- board/logicpd/am3517evm/am3517evm.c | 5 +++++ configs/am3517_evm_defconfig | 1 + include/configs/am3517_evm.h | 3 +++ 3 files changed, 9 insertions(+)
diff --git a/board/logicpd/am3517evm/am3517evm.c b/board/logicpd/am3517evm/am3517evm.c index 24be6ea..cd37f85 100644 --- a/board/logicpd/am3517evm/am3517evm.c +++ b/board/logicpd/am3517evm/am3517evm.c @@ -50,6 +50,11 @@ int board_init(void) return 0; }
+int ft_board_setup(void *blob, bd_t *bd) +{ + return 0; +} + #ifdef CONFIG_USB_MUSB_AM35X static struct musb_hdrc_config musb_config = { .multipoint = 1, diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig index 4589b30..c72d29e 100644 --- a/configs/am3517_evm_defconfig +++ b/configs/am3517_evm_defconfig @@ -2,6 +2,7 @@ CONFIG_ARM=y CONFIG_OMAP34XX=y CONFIG_TARGET_AM3517_EVM=y CONFIG_SPL=y +CONFIG_FIT=y # CONFIG_CMD_IMI is not set # CONFIG_CMD_IMLS is not set # CONFIG_CMD_FLASH is not set diff --git a/include/configs/am3517_evm.h b/include/configs/am3517_evm.h index b90a60d..c0ac5dc 100644 --- a/include/configs/am3517_evm.h +++ b/include/configs/am3517_evm.h @@ -42,6 +42,9 @@
#define CONFIG_MISC_INIT_R
+#define CONFIG_OF_LIBFDT +#define CONFIG_OF_BOARD_SETUP + #define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */ #define CONFIG_SETUP_MEMORY_TAGS 1 #define CONFIG_INITRD_TAG 1

Dear Yegor,
In message 1437979451-14060-1-git-send-email-yegorslists@googlemail.com you wrote:
Enable DTS support (CONFIG_OF_LIBFDT), create ft_board_setup() stub and select CONFIG_FIT in defconfig.
...
+int ft_board_setup(void *blob, bd_t *bd) +{
- return 0;
+}
What is the purpose of such an empty implementation? Most boards have at least
ft_cpu_setup(blob, bd);
here. Many also include
#ifdef CONFIG_PCI ft_pci_setup(blob, bd); #endif
(or variants, like FT_FSL_PCI_SETUP or ft_board_pci_setup() or pci_of_setup())
Some architectures provide a "weak" default implementation to avoid repeating the same code everywhere, but apparently not all do that.
Q1: Would it make sense to call ft_cpu_setup() here?
Q2: Would it make sense to clean up the code and use a weak default implementation instead?
Best regards,
Wolfgang Denk

On Mon, Jul 27, 2015 at 10:44 AM, Wolfgang Denk wd@denx.de wrote:
Dear Yegor,
In message 1437979451-14060-1-git-send-email-yegorslists@googlemail.com you wrote:
Enable DTS support (CONFIG_OF_LIBFDT), create ft_board_setup() stub and select CONFIG_FIT in defconfig.
...
+int ft_board_setup(void *blob, bd_t *bd) +{
return 0;
+}
What is the purpose of such an empty implementation? Most boards have at least
ft_cpu_setup(blob, bd);
here. Many also include
#ifdef CONFIG_PCI ft_pci_setup(blob, bd); #endif
(or variants, like FT_FSL_PCI_SETUP or ft_board_pci_setup() or pci_of_setup())
Some architectures provide a "weak" default implementation to avoid repeating the same code everywhere, but apparently not all do that.
Q1: Would it make sense to call ft_cpu_setup() here?
Q2: Would it make sense to clean up the code and use a weak default implementation instead?
You're right. I was just looking at my Baltos setup, that really uses ft_board_setup() in order to place MAC address found in EEPROM into Device Tree. This stub is only needed, if you specify CONFIG_OF_BOARD_SETUP.
I've sent v2 with pure DTS and FIT support.
Yegor
participants (3)
-
Wolfgang Denk
-
Yegor Yefremov
-
yegorslists@googlemail.com