Skip to contentSkip to conversation

omap3_logic: Add Device Tree Support and more DM drivers

PATCH Superseded Adam Ford 2 participants 4 messages Apr 12, 2017

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH 7/7 omap3_logic: Add Device Tree Support and more DM drivers

The previous version of omap3_logic_defconfig supported either Torpedo or SOM-LV. Now with the device tree, there are two different defconfig files:

omap3_logic_defconfig = torpedo
omap3_logic_somlv_defconfig = SOM-LV

This patch also removes all the excessive code in trying to determine the differences between these boards as well as removing the some of the unnecessary NS16550 intiailization as the device tree can do that now. This also adds DM_I2C and DM_MMC since the overlying drivers have the built-in support already. The corresponding include/config/omap3_logic.h also reduced in size due to the new device tree support.

The device trees were sync'd with 4.9.y stable with two changes:
disable mmc2 and stdout-path = &uart1. Both of those two changes will be submitted to the linux-omap list.

arch/arm/dts/Makefile +4 -0
index 7378c88..44c586d 100644
@@ -341,6 +341,10 @@ dtb-$(CONFIG_SOC_KEYSTONE) += keystone-k2hk-evm.dtb \
 	keystone-k2e-evm.dtb \
 	keystone-k2g-evm.dtb
 
+dtb-$(CONFIG_TARGET_OMAP3_LOGIC) += \
+	logicpd-torpedo-37xx-devkit.dtb \
+	logicpd-som-lv-37xx-devkit.dts
+
 dtb-$(CONFIG_TARGET_SAMA5D2_XPLAINED) += \
 	at91-sama5d2_xplained.dtb
 
arch/arm/dts/logicpd-som-lv-37xx-devkit.dts new file +271 -0

271 lines not on this page · raw message

arch/arm/dts/logicpd-som-lv.dtsi new file +271 -0

271 lines not on this page · raw message

arch/arm/dts/logicpd-torpedo-37xx-devkit.dts new file +412 -0

412 lines not on this page · raw message

arch/arm/dts/logicpd-torpedo-som.dtsi new file +217 -0

217 lines not on this page · raw message

arch/arm/mach-omap2/omap3/Kconfig +0 -1
index 933fcba..a9d7e29 100644
@@ -67,7 +67,6 @@ config TARGET_MCX
 
 config TARGET_OMAP3_LOGIC
 	bool "OMAP3 Logic"
-	select BOARD_LATE_INIT
 	select DM
 	select DM_SERIAL
 	select DM_GPIO
board/logicpd/omap3som/omap3logic.c +15 -106

142 lines not on this page · raw message

configs/omap3_logic_defconfig +6 -1
index 89bf38f..13c996d 100644
@@ -3,6 +3,7 @@ CONFIG_OMAP34XX=y
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_TARGET_OMAP3_LOGIC=y
 CONFIG_SPL_STACK_R_ADDR=0x82000000
+CONFIG_DEFAULT_DEVICE_TREE="logicpd-torpedo-37xx-devkit"
 CONFIG_SYS_EXTRA_OPTIONS="NAND"
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
@@ -36,6 +37,11 @@ CONFIG_CMD_FS_GENERIC=y
 CONFIG_CMD_UBI=y
 CONFIG_ISO_PARTITION=y
 CONFIG_EFI_PARTITION=y
+CONFIG_OF_CONTROL=y
+# CONFIG_BLK is not set
+CONFIG_DM_I2C=y
+CONFIG_DM_MMC=y
+# CONFIG_DM_MMC_OPS is not set
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MMC_OMAP36XX_PINS=y
 CONFIG_SYS_NS16550=y
@@ -46,4 +52,3 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_G_DNL_MANUFACTURER="TI"
 CONFIG_G_DNL_VENDOR_NUM=0x0451
 CONFIG_G_DNL_PRODUCT_NUM=0xd022
-CONFIG_OF_LIBFDT=y
configs/omap3_logic_somlv_defconfig new file +54 -0

54 lines not on this page · raw message

include/configs/omap3_logic.h +16 -9
index 706175c..dde52e7 100644
@@ -17,6 +17,20 @@
 
 #include <configs/ti_omap3_common.h>
 
+#ifdef CONFIG_SPL_BUILD
+/*
+ * Disable MMC DM for SPL build and can be re-enabled after adding
+ * DM support in SPL
+ */
+#undef CONFIG_DM_MMC
+#undef OMAP_HSMMC_USE_GPIO
+
+/* select serial console configuration for SPL */
+#undef CONFIG_CONS_INDEX
+#define CONFIG_CONS_INDEX		1
+#define CONFIG_SYS_NS16550_COM1		OMAP34XX_UART1
+#endif
+
 /*
  * We are only ever GP parts and will utilize all of the "downloaded image"
  * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB) in
@@ -34,16 +48,10 @@
 /* Hardware drivers */
 
 /* GPIO banks */
-#define CONFIG_OMAP3_GPIO_6		/* GPIO160..191 is in GPIO bank 6 */
+#define CONFIG_OMAP3_GPIO_4		/* GPIO 96..128 is in GPIO bank 4 */
 
 #define CONFIG_USB_OMAP3
 
-/* select serial console configuration */
-#undef CONFIG_CONS_INDEX
-#define CONFIG_CONS_INDEX		1
-#define CONFIG_SYS_NS16550_COM1		OMAP34XX_UART1
-#define CONFIG_SERIAL1			1	/* UART1 on OMAP Logic boards */
-
 /* commands to include */
 #define CONFIG_CMD_NAND
 #define CONFIG_CMD_MTDPARTS
@@ -52,8 +60,6 @@
 /* I2C */
 #define CONFIG_SYS_I2C_OMAP34XX
 #define CONFIG_SYS_I2C_EEPROM_ADDR	0x50	/* EEPROM AT24C64      */
-#define EXPANSION_EEPROM_I2C_BUS	2	/* I2C Bus for AT24C64 */
-#define CONFIG_OMAP3_LOGIC_USE_NEW_PRODUCT_ID
 
 /* USB */
 #define CONFIG_USB_MUSB_OMAP2PLUS
@@ -138,6 +144,7 @@
 			"fi; " \
 		"else run defaultboot; fi\0" \
 	"defaultboot=run mmcramboot\0" \
+	"fdtimage=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
 	"consoledevice=ttyO0\0" \
 	"setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
 	"dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
Signature · 1 line
2.7.4
#1 lore raw

PATCH 7/7 omap3_logic: Add Device Tree Support and more DM drivers

Quoted 15 lines · Adam Ford

The previous version of omap3_logic_defconfig supported either Torpedo or SOM-LV. Now with the device tree, there are two different defconfig files:

omap3_logic_defconfig = torpedo
omap3_logic_somlv_defconfig = SOM-LV

This patch also removes all the excessive code in trying to determine the differences between these boards as well as removing the some of the unnecessary NS16550 intiailization as the device tree can do that now. This also adds DM_I2C and DM_MMC since the overlying drivers have the built-in support already. The corresponding include/config/omap3_logic.h also reduced in size due to the new device tree support.

Quoted 6 lines

The device trees were sync'd with 4.9.y stable with two changes:
disable mmc2 and stdout-path = &uart1. Both of those two changes will be submitted to the linux-omap list.

OK, why can't we support both in a single defconfig? And perhaps a README to say that if you need to support only one, modify the config as follows... ? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170412/4f2357fe/attachment.sig>
author
#2 lore raw

PATCH 7/7 omap3_logic: Add Device Tree Support and more DM drivers

Quoted 21 lines · Tom Rini
Quoted 19 lines · Adam Ford

The previous version of omap3_logic_defconfig supported either Torpedo or SOM-LV. Now with the device tree, there are two different defconfig files:

omap3_logic_defconfig = torpedo
omap3_logic_somlv_defconfig = SOM-LV

This patch also removes all the excessive code in trying to determine the differences between these boards as well as removing the some of the unnecessary NS16550 intiailization as the device tree can do that now. This also adds DM_I2C and DM_MMC since the overlying drivers have the built-in support already. The corresponding include/config/omap3_logic.h also reduced in size due to the new device tree support.

The device trees were sync'd with 4.9.y stable with two changes:
disable mmc2 and stdout-path = &uart1. Both of those two changes will be submitted to the linux-omap list.

Quoted 6 lines
Quoted 2 lines

OK, why can't we support both in a single defconfig? And perhaps a README to say that if you need to support only one, modify the config as follows... ? Thanks!

I can certainly do a readme file. Is there a way to build U-Boot with two different device tree options? The SOM-LV and Torpedo have separate device trees. The original code had a mechanism to autodetect which hardware was being used and would then select the corresponding dtb. With the device tree integrated into U-Boot it seemed to me like the auto detect code didn't make sense since the U-Boot with the corresponding DTB would have to be loaded from the beginning. I looked at the variety of am33xx boards, and it seemed like different versions have different _defconfig files. I would prefer to have a since defconfig and separate U-Boot files generated for each DTB, but it wasn't clear to me whether or not that was possible. If you have an example I can look at that and redo this to eliminate the second defconfig.

adam

Quoted 3 lines

--
Tom

#3 lore raw

PATCH 7/7 omap3_logic: Add Device Tree Support and more DM drivers

Quoted 29 lines · Adam Ford
Quoted 21 lines · Tom Rini
Quoted 19 lines · Adam Ford

The previous version of omap3_logic_defconfig supported either Torpedo or SOM-LV. Now with the device tree, there are two different defconfig files:

omap3_logic_defconfig = torpedo
omap3_logic_somlv_defconfig = SOM-LV

This patch also removes all the excessive code in trying to determine the differences between these boards as well as removing the some of the unnecessary NS16550 intiailization as the device tree can do that now. This also adds DM_I2C and DM_MMC since the overlying drivers have the built-in support already. The corresponding include/config/omap3_logic.h also reduced in size due to the new device tree support.

The device trees were sync'd with 4.9.y stable with two changes:
disable mmc2 and stdout-path = &uart1. Both of those two changes will be submitted to the linux-omap list.

Quoted 6 lines
Quoted 2 lines

OK, why can't we support both in a single defconfig? And perhaps a README to say that if you need to support only one, modify the config as follows... ? Thanks!

Quoted 13 lines

I can certainly do a readme file. Is there a way to build U-Boot with two different device tree options? The SOM-LV and Torpedo have separate device trees. The original code had a mechanism to autodetect which hardware was being used and would then select the corresponding dtb. With the device tree integrated into U-Boot it seemed to me like the auto detect code didn't make sense since the U-Boot with the corresponding DTB would have to be loaded from the beginning. I looked at the variety of am33xx boards, and it seemed like different versions have different _defconfig files. I would prefer to have a since defconfig and separate U-Boot files generated for each DTB, but it wasn't clear to me whether or not that was possible. If you have an example I can look at that and redo this to eliminate the second defconfig.

No, and yes, is how I would answer the first question. For SPL, this is much trickier (and I would recommend a fake dts file that works well enough for SPL and runs on both boards). But for U-Boot itself, yes, with U-Boot in a FIT image and all DTB files included as well, SPL can get the right one for the board at run time.

So, no, we cannot make N MLO+u-boot.img (of legacy uImage-style u-boot.bin). But we can make MLO+u-boot.img (as a FIT image of u-boot + N dtb files). See am335x_evm for an example.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170412/05b8a39b/attachment.sig>