Skip to contentSkip to conversation

am3517_evm: add FIT support

PATCH Superseded yegorslists at googlemail.com 2 participants 3 messages Jul 27, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 am3517_evm: add FIT support

From: Yegor Yefremov <[email protected]>

Enable DTS support (CONFIG_OF_LIBFDT), create ft_board_setup() stub and select CONFIG_FIT in defconfig.

---
 board/logicpd/am3517evm/am3517evm.c | 5 +++++
 configs/am3517_evm_defconfig        | 1 +
 include/configs/am3517_evm.h        | 3 +++
 3 files changed, 9 insertions(+)
board/logicpd/am3517evm/am3517evm.c +5 -0
index 24be6ea..cd37f85 100644
@@ -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,
configs/am3517_evm_defconfig +1 -0
index 4589b30..c72d29e 100644
@@ -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
include/configs/am3517_evm.h +3 -0
index b90a60d..c0ac5dc 100644
@@ -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
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 am3517_evm: add FIT support

Dear Yegor,

Quoted 3 lines · In message <[email protected]> you…

Enable DTS support (CONFIG_OF_LIBFDT), create ft_board_setup() stub and select CONFIG_FIT in defconfig.

...

board/logicpd/am3517evm/am3517evm.c int board_init(void) · line 56

Quoted 4 lines
board/logicpd/am3517evm/am3517evm.c +4 -0
+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

Signature · 5 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If you don't have time to do it right, when will you have time to  do
it over?                                                - John Wooden
#2 lore raw

PATCH 1/1 am3517_evm: add FIT support

Quoted 26 lines · Wolfgang Denk

Dear Yegor,

Quoted 3 lines · In message <[email protected]> you…

Enable DTS support (CONFIG_OF_LIBFDT), create ft_board_setup() stub and select CONFIG_FIT in defconfig.

...

board/logicpd/am3517evm/am3517evm.c int board_init(void) · line 56

Quoted 4 lines
board/logicpd/am3517evm/am3517evm.c +4 -0
+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())

Quoted 8 lines

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