[U-Boot] [PATCH 0/5] omap3_beagle: configs: improve BOOT_CMD options

With the latest transition to device tree, there is a need to simplify the load of device tree depending on board type etc. While at it, simplify few other changes as well.
Testing: with a uEnv.txt as: bootdir=/ bootpart=0:1
The following were the boot results: Beagle (rev C1D): http://pastebin.com/fMdsKkgr Beagle XM (rev C1): http://pastebin.com/p1zp9AhG
Nishanth Menon (5): omap3_beagle: remove JFFS2 support. omap3_beagle: replace uImage.beagle with generic uImage omap3_beagle: enable CMD_FS_GENERIC and simplify load of image/ramdisk omap3_beagle: support findfdt and loadfdt for devicetree support omap3_beagle: support booting from zImage and device tree as last option
include/configs/omap3_beagle.h | 46 ++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 13 deletions(-)
Regards, Nishanth Menon

We do not use JFFS2 by default and it conflicts with CONFIG_CMD_FS_GENERIC (ls command is the same). Since most of our BOOTCMD can be simplified by using the FS_GENERIC, dropping JFFS2
Signed-off-by: Nishanth Menon nm@ti.com --- include/configs/omap3_beagle.h | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 48ce4c0..9adf4a5 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -150,7 +150,6 @@ #define CONFIG_CMD_CACHE #define CONFIG_CMD_EXT2 /* EXT2 Support */ #define CONFIG_CMD_FAT /* FAT support */ -#define CONFIG_CMD_JFFS2 /* JFFS2 Support */ #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */ #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ #define MTDIDS_DEFAULT "nand0=nand" @@ -203,13 +202,6 @@
#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */ /* devices */ -#define CONFIG_JFFS2_NAND -/* nand device jffs2 lives on */ -#define CONFIG_JFFS2_DEV "nand0" -/* start of jffs2 partition */ -#define CONFIG_JFFS2_PART_OFFSET 0x680000 -#define CONFIG_JFFS2_PART_SIZE 0xf980000 /* size of jffs2 */ - /* partition */
/* Environment information */ #define CONFIG_BOOTDELAY 3

On Thu, Jul 11, 2013 at 4:52 PM, Nishanth Menon nm@ti.com wrote:
We do not use JFFS2 by default and it conflicts with CONFIG_CMD_FS_GENERIC (ls command is the same). Since most of our BOOTCMD can be simplified by using the FS_GENERIC, dropping JFFS2
Signed-off-by: Nishanth Menon nm@ti.com
include/configs/omap3_beagle.h | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 48ce4c0..9adf4a5 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -150,7 +150,6 @@ #define CONFIG_CMD_CACHE #define CONFIG_CMD_EXT2 /* EXT2 Support */ #define CONFIG_CMD_FAT /* FAT support */ -#define CONFIG_CMD_JFFS2 /* JFFS2 Support */ #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */ #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ #define MTDIDS_DEFAULT "nand0=nand" @@ -203,13 +202,6 @@
#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */ /* devices */ -#define CONFIG_JFFS2_NAND -/* nand device jffs2 lives on */ -#define CONFIG_JFFS2_DEV "nand0" -/* start of jffs2 partition */ -#define CONFIG_JFFS2_PART_OFFSET 0x680000 -#define CONFIG_JFFS2_PART_SIZE 0xf980000 /* size of jffs2 */
Minor nit, can we perhaps leave the JFFS configuration and only remove/comment CONFIG_CMD_JFFS. That way we wont lose these paritition offsets/size for folks who might need them.
Otherwise, Acked-by: Joel Fernandes joelf@ti.com
Thanks,
-Joel

On 21:49-20130711, Joel Fernandes wrote:
On Thu, Jul 11, 2013 at 4:52 PM, Nishanth Menon nm@ti.com wrote:
We do not use JFFS2 by default and it conflicts with CONFIG_CMD_FS_GENERIC (ls command is the same). Since most of our BOOTCMD can be simplified by using the FS_GENERIC, dropping JFFS2
Signed-off-by: Nishanth Menon nm@ti.com
include/configs/omap3_beagle.h | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 48ce4c0..9adf4a5 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -150,7 +150,6 @@ #define CONFIG_CMD_CACHE #define CONFIG_CMD_EXT2 /* EXT2 Support */ #define CONFIG_CMD_FAT /* FAT support */ -#define CONFIG_CMD_JFFS2 /* JFFS2 Support */ #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */ #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ #define MTDIDS_DEFAULT "nand0=nand" @@ -203,13 +202,6 @@
#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */ /* devices */ -#define CONFIG_JFFS2_NAND -/* nand device jffs2 lives on */ -#define CONFIG_JFFS2_DEV "nand0" -/* start of jffs2 partition */ -#define CONFIG_JFFS2_PART_OFFSET 0x680000 -#define CONFIG_JFFS2_PART_SIZE 0xf980000 /* size of jffs2 */
Minor nit, can we perhaps leave the JFFS configuration and only remove/comment CONFIG_CMD_JFFS. That way we wont lose these paritition offsets/size for folks who might need them.
then we have to drop the usage of FS_GENERIC. code wont build with both.
There is no point in keeping something as an option if it cant be used. dont you agree?

On Thu, Jul 11, 2013 at 10:49 PM, Nishanth Menon nm@ti.com wrote:
On 21:49-20130711, Joel Fernandes wrote:
On Thu, Jul 11, 2013 at 4:52 PM, Nishanth Menon nm@ti.com wrote:
We do not use JFFS2 by default and it conflicts with CONFIG_CMD_FS_GENERIC (ls command is the same). Since most of our BOOTCMD can be simplified by using the FS_GENERIC, dropping JFFS2
Signed-off-by: Nishanth Menon nm@ti.com
include/configs/omap3_beagle.h | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 48ce4c0..9adf4a5 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -150,7 +150,6 @@ #define CONFIG_CMD_CACHE #define CONFIG_CMD_EXT2 /* EXT2 Support */ #define CONFIG_CMD_FAT /* FAT support */ -#define CONFIG_CMD_JFFS2 /* JFFS2 Support */ #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */ #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ #define MTDIDS_DEFAULT "nand0=nand" @@ -203,13 +202,6 @@
#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */ /* devices */ -#define CONFIG_JFFS2_NAND -/* nand device jffs2 lives on */ -#define CONFIG_JFFS2_DEV "nand0" -/* start of jffs2 partition */ -#define CONFIG_JFFS2_PART_OFFSET 0x680000 -#define CONFIG_JFFS2_PART_SIZE 0xf980000 /* size of jffs2 */
Minor nit, can we perhaps leave the JFFS configuration and only remove/comment CONFIG_CMD_JFFS. That way we wont lose these paritition offsets/size for folks who might need them.
then we have to drop the usage of FS_GENERIC. code wont build with both.
No I meant drop CMD_JFFS but not the other JFFS.
There is no point in keeping something as an option if it cant be used. dont you agree?
Either way is OK with me, you have a point too.
Thanks,
-Joel

On 23:25-20130711, Joel Fernandes wrote:
On Thu, Jul 11, 2013 at 10:49 PM, Nishanth Menon nm@ti.com wrote:
On 21:49-20130711, Joel Fernandes wrote:
On Thu, Jul 11, 2013 at 4:52 PM, Nishanth Menon nm@ti.com wrote:
We do not use JFFS2 by default and it conflicts with CONFIG_CMD_FS_GENERIC (ls command is the same). Since most of our BOOTCMD can be simplified by using the FS_GENERIC, dropping JFFS2
Signed-off-by: Nishanth Menon nm@ti.com
include/configs/omap3_beagle.h | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 48ce4c0..9adf4a5 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -150,7 +150,6 @@ #define CONFIG_CMD_CACHE #define CONFIG_CMD_EXT2 /* EXT2 Support */ #define CONFIG_CMD_FAT /* FAT support */ -#define CONFIG_CMD_JFFS2 /* JFFS2 Support */ #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */ #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ #define MTDIDS_DEFAULT "nand0=nand" @@ -203,13 +202,6 @@
#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */ /* devices */ -#define CONFIG_JFFS2_NAND -/* nand device jffs2 lives on */ -#define CONFIG_JFFS2_DEV "nand0" -/* start of jffs2 partition */ -#define CONFIG_JFFS2_PART_OFFSET 0x680000 -#define CONFIG_JFFS2_PART_SIZE 0xf980000 /* size of jffs2 */
Minor nit, can we perhaps leave the JFFS configuration and only remove/comment CONFIG_CMD_JFFS. That way we wont lose these paritition offsets/size for folks who might need them.
then we have to drop the usage of FS_GENERIC. code wont build with both.
No I meant drop CMD_JFFS but not the other JFFS.
Those wont come into play unless CMD_JFFS2 is enabled, and as stated, makes no sense to keep the second part around and trick some poor bloke into thinking CMD_JFFS2 was left out by mistake..
There is no point in keeping something as an option if it cant be used. dont you agree?
Either way is OK with me, you have a point too.
OK, will take this to mean that you are ok with the patch as is. Thanks for the review.

e682930867f7dfc4a01784fe452fad9e962d65a (BeagleBoard: config: use uImage.beagle for tftp)
Introduced uImage.beagle which does not happen to be default output file of Linux kernel build make uImage (output is uImage).
So, replace uImage.beagle with uImage
Signed-off-by: Nishanth Menon nm@ti.com --- include/configs/omap3_beagle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 9adf4a5..e152d3c 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,7 +210,7 @@ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \ "usbtty=cdc_acm\0" \ - "bootfile=uImage.beagle\0" \ + "bootfile=uImage\0" \ "console=ttyO2,115200n8\0" \ "mpurate=auto\0" \ "buddy=none\0" \

CMD_FS_GENERIC allows us to simplify where we load up our image from either from ext2/fat etc. So, lets use that instead of cumbersome options we currently use. Sticking with existing conventions, defaults will be: ramdisk=ramdisk.gz bootpart=0:2 (second partition) bootdir=/boot (/boot in second partition)
This matches with the default behavior, these can be overriden by env files as needed.
Signed-off-by: Nishanth Menon nm@ti.com --- include/configs/omap3_beagle.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index e152d3c..bdeee17 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -150,6 +150,7 @@ #define CONFIG_CMD_CACHE #define CONFIG_CMD_EXT2 /* EXT2 Support */ #define CONFIG_CMD_FAT /* FAT support */ +#define CONFIG_CMD_FS_GENERIC /* Generic FS support */ #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */ #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ #define MTDIDS_DEFAULT "nand0=nand" @@ -211,6 +212,9 @@ "rdaddr=0x81000000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ + "ramdisk=ramdisk.gz\0" \ + "bootdir=/boot\0" \ + "bootpart=0:2\0" \ "console=ttyO2,115200n8\0" \ "mpurate=auto\0" \ "buddy=none\0" \ @@ -259,9 +263,8 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${ramroot} " \ "rootfstype=${ramrootfstype}\0" \ - "loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \ - "loaduimagefat=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \ - "loaduimage=ext2load mmc ${mmcdev}:2 ${loadaddr} /boot/uImage\0" \ + "loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \ + "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ "bootm ${loadaddr}\0" \ @@ -293,7 +296,7 @@ "echo Running uenvcmd ...;" \ "run uenvcmd;" \ "fi;" \ - "if run loaduimage; then " \ + "if run loadimage; then " \ "run mmcboot;" \ "fi;" \ "fi;" \

With the latest transition to device tree, there is a need to simplify the load of device tree depending on board type etc. While at it, simplify few other changes as well.
Testing: with a uEnv.txt as: bootdir=/ bootpart=0:1
The following were the boot results: Beagle (rev C1D): http://pastebin.com/fMdsKkgr Beagle XM (rev C1): http://pastebin.com/p1zp9AhG
Changes in V2 since v1: - removed xMB version support based on review comments. http://marc.info/?t=137357970500004&r=1&w=2&n=5
V1: http://marc.info/?l=u-boot&m=137357963227510&w=2
Nishanth Menon (6): omap3_beagle: remove JFFS2 support. omap3_beagle: replace uImage.beagle with generic uImage beagleboard: remove RevB support for BeagleBoard Xm omap3_beagle: enable CMD_FS_GENERIC and simplify load of image/ramdisk omap3_beagle: support findfdt and loadfdt for devicetree support omap3_beagle: support booting from zImage and device tree as last option
board/ti/beagle/beagle.c | 28 ++++++------------------ board/ti/beagle/beagle.h | 3 +-- include/configs/omap3_beagle.h | 46 ++++++++++++++++++++++++++++------------ 3 files changed, 41 insertions(+), 36 deletions(-)
Regards, Nishanth Menon

We do not use JFFS2 by default and it conflicts with CONFIG_CMD_FS_GENERIC (ls command is the same). Since most of our BOOTCMD can be simplified by using the FS_GENERIC, dropping JFFS2
Signed-off-by: Nishanth Menon nm@ti.com --- include/configs/omap3_beagle.h | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 48ce4c0..9adf4a5 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -150,7 +150,6 @@ #define CONFIG_CMD_CACHE #define CONFIG_CMD_EXT2 /* EXT2 Support */ #define CONFIG_CMD_FAT /* FAT support */ -#define CONFIG_CMD_JFFS2 /* JFFS2 Support */ #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */ #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ #define MTDIDS_DEFAULT "nand0=nand" @@ -203,13 +202,6 @@
#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */ /* devices */ -#define CONFIG_JFFS2_NAND -/* nand device jffs2 lives on */ -#define CONFIG_JFFS2_DEV "nand0" -/* start of jffs2 partition */ -#define CONFIG_JFFS2_PART_OFFSET 0x680000 -#define CONFIG_JFFS2_PART_SIZE 0xf980000 /* size of jffs2 */ - /* partition */
/* Environment information */ #define CONFIG_BOOTDELAY 3

e682930867f7dfc4a01784fe452fad9e962d65a (BeagleBoard: config: use uImage.beagle for tftp)
Introduced uImage.beagle which does not happen to be default output file of Linux kernel build make uImage (output is uImage).
So, replace uImage.beagle with uImage
Signed-off-by: Nishanth Menon nm@ti.com --- include/configs/omap3_beagle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 9adf4a5..e152d3c 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,7 +210,7 @@ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \ "usbtty=cdc_acm\0" \ - "bootfile=uImage.beagle\0" \ + "bootfile=uImage\0" \ "console=ttyO2,115200n8\0" \ "mpurate=auto\0" \ "buddy=none\0" \

As reported in http://marc.info/?l=u-boot&m=137358037827735&w=2
There is no need for the "xMB" variant, as the gpio pins used for identification where never changed from the xMA when the newer silcon was used for the xMB, So rename XM A revision as AB revision and report accordingly
Reported-by: Robert Nelson robertcnelson@gmail.com Signed-off-by: Nishanth Menon nm@ti.com --- board/ti/beagle/beagle.c | 28 +++++++--------------------- board/ti/beagle/beagle.h | 3 +-- 2 files changed, 8 insertions(+), 23 deletions(-)
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index c686f40..cc2a783 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -182,8 +182,7 @@ void get_board_mem_timings(struct board_sdrc_timings *timings) timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz; break; } - case REVISION_XM_A: - case REVISION_XM_B: + case REVISION_XM_AB: case REVISION_XM_C: if (pop_mfr == 0) { /* 256MB DDR */ @@ -256,8 +255,7 @@ static void beagle_display_init(void) case REVISION_C4: omap3_dss_panel_config(&dvid_cfg); break; - case REVISION_XM_A: - case REVISION_XM_B: + case REVISION_XM_AB: case REVISION_XM_C: default: omap3_dss_panel_config(&dvid_cfg_xm); @@ -276,12 +274,11 @@ static void beagle_dvi_pup(void) case REVISION_AXBX: case REVISION_CX: case REVISION_C4: - case REVISION_XM_A: + case REVISION_XM_AB: gpio_request(170, ""); gpio_direction_output(170, 0); gpio_set_value(170, 1); break; - case REVISION_XM_B: case REVISION_XM_C: default: #define GPIODATADIR1 (TWL4030_BASEADD_GPIO+3) @@ -359,19 +356,9 @@ int misc_init_r(void) TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, TWL4030_PM_RECEIVER_DEV_GRP_P1); break; - case REVISION_XM_A: - printf("Beagle xM Rev A\n"); - setenv("beaglerev", "xMA"); - MUX_BEAGLE_XM(); - /* Set VAUX2 to 1.8V for EHCI PHY */ - twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, - TWL4030_PM_RECEIVER_VAUX2_VSEL_18, - TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, - TWL4030_PM_RECEIVER_DEV_GRP_P1); - break; - case REVISION_XM_B: - printf("Beagle xM Rev B\n"); - setenv("beaglerev", "xMB"); + case REVISION_XM_AB: + printf("Beagle xM Rev A/B\n"); + setenv("beaglerev", "xMAB"); MUX_BEAGLE_XM(); /* Set VAUX2 to 1.8V for EHCI PHY */ twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, @@ -484,8 +471,7 @@ int misc_init_r(void)
twl4030_power_init(); switch (get_board_revision()) { - case REVISION_XM_A: - case REVISION_XM_B: + case REVISION_XM_AB: twl4030_led_init(TWL4030_LED_LEDEN_LEDBON); break; default: diff --git a/board/ti/beagle/beagle.h b/board/ti/beagle/beagle.h index 6d71bbc..27f8b12 100644 --- a/board/ti/beagle/beagle.h +++ b/board/ti/beagle/beagle.h @@ -39,8 +39,7 @@ const omap3_sysinfo sysinfo = { #define REVISION_AXBX 0x7 #define REVISION_CX 0x6 #define REVISION_C4 0x5 -#define REVISION_XM_A 0x0 -#define REVISION_XM_B 0x1 +#define REVISION_XM_AB 0x0 #define REVISION_XM_C 0x2
/*

CMD_FS_GENERIC allows us to simplify where we load up our image from either from ext2/fat etc. So, lets use that instead of cumbersome options we currently use. Sticking with existing conventions, defaults will be: ramdisk=ramdisk.gz bootpart=0:2 (second partition) bootdir=/boot (/boot in second partition)
This matches with the default behavior, these can be overriden by env files as needed.
Signed-off-by: Nishanth Menon nm@ti.com --- include/configs/omap3_beagle.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index e152d3c..bdeee17 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -150,6 +150,7 @@ #define CONFIG_CMD_CACHE #define CONFIG_CMD_EXT2 /* EXT2 Support */ #define CONFIG_CMD_FAT /* FAT support */ +#define CONFIG_CMD_FS_GENERIC /* Generic FS support */ #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */ #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ #define MTDIDS_DEFAULT "nand0=nand" @@ -211,6 +212,9 @@ "rdaddr=0x81000000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ + "ramdisk=ramdisk.gz\0" \ + "bootdir=/boot\0" \ + "bootpart=0:2\0" \ "console=ttyO2,115200n8\0" \ "mpurate=auto\0" \ "buddy=none\0" \ @@ -259,9 +263,8 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${ramroot} " \ "rootfstype=${ramrootfstype}\0" \ - "loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \ - "loaduimagefat=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \ - "loaduimage=ext2load mmc ${mmcdev}:2 ${loadaddr} /boot/uImage\0" \ + "loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \ + "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ "bootm ${loadaddr}\0" \ @@ -293,7 +296,7 @@ "echo Running uenvcmd ...;" \ "run uenvcmd;" \ "fi;" \ - "if run loaduimage; then " \ + "if run loadimage; then " \ "run mmcboot;" \ "fi;" \ "fi;" \

For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com --- include/configs/omap3_beagle.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..614ab9b 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \ + "fdt_high=0xffffffff\0" \ + "fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \ @@ -250,6 +252,19 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \ + "findfdt=" \ + "if test $beaglerev = AxBx; then " \ + "setenv fdtfile omap3-beagle.dtb; fi; " \ + "if test $beaglerev = Cx; then " \ + "setenv fdtfile omap3-beagle.dtb; fi; " \ + "if test $beaglerev = xMAB; then " \ + "setenv fdtfile omap3-beagle-xm.dtb; fi; " \ + "if test $beaglerev = xMB; then " \ + "setenv fdtfile omap3-beagle-xm.dtb; fi; " \ + "if test $beaglerev = xMC; then " \ + "setenv fdtfile omap3-beagle-xm.dtb; fi; " \ + "if test $fdtfile = undefined; then " \ + "echo WARNING: Could not determine device tree to use; fi; \0" \ "bootenv=uEnv.txt\0" \ "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ "importbootenv=echo Importing environment from mmc ...; " \ @@ -265,6 +280,7 @@ "rootfstype=${ramrootfstype}\0" \ "loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ + "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ "bootm ${loadaddr}\0" \ @@ -281,6 +297,7 @@ "userbutton_nonxm=gpio input 7;\0" /* "run userbutton" will return 1 (false) if pressed and 0 (true) if not */ #define CONFIG_BOOTCOMMAND \ + "run findfdt; " \ "mmc dev ${mmcdev}; if mmc rescan; then " \ "if run userbutton; then " \ "setenv bootenv uEnv.txt;" \

On 07/11/2013 05:33 PM, Nishanth Menon wrote:
For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com
include/configs/omap3_beagle.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..614ab9b 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \
- "fdt_high=0xffffffff\0" \
- "fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \
@@ -250,6 +252,19 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \
- "findfdt=" \
"if test $beaglerev = AxBx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = Cx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = xMAB; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $beaglerev = xMB; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
OK, this is embarrassing! I should have dropped this! Sigh.. will will wait for more comments and stop spamming list before a new rev.
[...]

If no other bootoption works, try loading up device tree and zImage.
This is selected as the last option to allow backward compatibility as well as support the recent trend in moving kernel boot to using zImage and device tree.
NOTE: if uImage is present in bootpart, it will try this first and will assume this is to be booted with bootm (so may be concatenated image or plain vanilla ATAG MACHINE_ID based image)
Signed-off-by: Nishanth Menon nm@ti.com --- include/configs/omap3_beagle.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 614ab9b..f554de8 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -284,6 +284,9 @@ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ "bootm ${loadaddr}\0" \ + "mmcbootz=echo Booting with DT from mmc${mmcdev} ...; " \ + "run mmcargs; " \ + "bootz ${loadaddr} - ${fdtaddr}\0" \ "nandboot=echo Booting from nand ...; " \ "run nandargs; " \ "nand read ${loadaddr} 280000 400000; " \ @@ -318,6 +321,11 @@ "fi;" \ "fi;" \ "run nandboot;" \ + "setenv bootfile zImage;" \ + "if run loadimage; then " \ + "run loadfdt;" \ + "run mmcbootz; " \ + "fi; " \
#define CONFIG_AUTO_COMPLETE 1 /*

On Thu, Jul 11, 2013 at 05:33:19PM -0500, Nishanth Menon wrote:
With the latest transition to device tree, there is a need to simplify the load of device tree depending on board type etc. While at it, simplify few other changes as well.
Testing: with a uEnv.txt as: bootdir=/ bootpart=0:1
The following were the boot results: Beagle (rev C1D): http://pastebin.com/fMdsKkgr Beagle XM (rev C1): http://pastebin.com/p1zp9AhG
Changes in V2 since v1:
- removed xMB version support based on review comments. http://marc.info/?t=137357970500004&r=1&w=2&n=5
I have no new comments on the series, awaiting V3 Monday'ish, thanks!

With the latest transition to device tree, there is a need to simplify the load of device tree depending on board type etc. While at it, simplify few other changes as well.
Testing: with a uEnv.txt as: bootdir=/ bootpart=0:1
The following were the boot results: Beagle (rev C1D): http://pastebin.com/fMdsKkgr Beagle XM (rev C1): http://pastebin.com/p1zp9AhG
Changes in V3 since v2: - Minor fixes for RevB beagleboard DVIpup handling http://marc.info/?t=137357970500004&r=1&w=2 - Picked up acked-by from http://marc.info/?t=137357970700007&r=1&w=2
V2: http://marc.info/?l=u-boot&m=137358206228251&w=2 V1: http://marc.info/?l=u-boot&m=137357963227510&w=2
Nishanth Menon (6): omap3_beagle: remove JFFS2 support. omap3_beagle: replace uImage.beagle with generic uImage beagleboard: remove RevB support for BeagleBoard Xm omap3_beagle: enable CMD_FS_GENERIC and simplify load of image/ramdisk omap3_beagle: support findfdt and loadfdt for devicetree support omap3_beagle: support booting from zImage and device tree as last option
board/ti/beagle/beagle.c | 28 +++++++------------------ board/ti/beagle/beagle.h | 3 +-- include/configs/omap3_beagle.h | 44 ++++++++++++++++++++++++++++------------ 3 files changed, 39 insertions(+), 36 deletions(-)

We do not use JFFS2 by default and it conflicts with CONFIG_CMD_FS_GENERIC (ls command is the same). Since most of our BOOTCMD can be simplified by using the FS_GENERIC, dropping JFFS2
Signed-off-by: Nishanth Menon nm@ti.com Acked-by: Joel Fernandes joelf@ti.com --- include/configs/omap3_beagle.h | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 48ce4c0..9adf4a5 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -150,7 +150,6 @@ #define CONFIG_CMD_CACHE #define CONFIG_CMD_EXT2 /* EXT2 Support */ #define CONFIG_CMD_FAT /* FAT support */ -#define CONFIG_CMD_JFFS2 /* JFFS2 Support */ #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */ #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ #define MTDIDS_DEFAULT "nand0=nand" @@ -203,13 +202,6 @@
#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */ /* devices */ -#define CONFIG_JFFS2_NAND -/* nand device jffs2 lives on */ -#define CONFIG_JFFS2_DEV "nand0" -/* start of jffs2 partition */ -#define CONFIG_JFFS2_PART_OFFSET 0x680000 -#define CONFIG_JFFS2_PART_SIZE 0xf980000 /* size of jffs2 */ - /* partition */
/* Environment information */ #define CONFIG_BOOTDELAY 3

e682930867f7dfc4a01784fe452fad9e962d65a (BeagleBoard: config: use uImage.beagle for tftp)
Introduced uImage.beagle which does not happen to be default output file of Linux kernel build make uImage (output is uImage).
So, replace uImage.beagle with uImage
Signed-off-by: Nishanth Menon nm@ti.com --- include/configs/omap3_beagle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 9adf4a5..e152d3c 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,7 +210,7 @@ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \ "usbtty=cdc_acm\0" \ - "bootfile=uImage.beagle\0" \ + "bootfile=uImage\0" \ "console=ttyO2,115200n8\0" \ "mpurate=auto\0" \ "buddy=none\0" \

As reported in http://marc.info/?l=u-boot&m=137358037827735&w=2
There is no need for the "xMB" variant, as the gpio pins used for identification where never changed from the xMA when the newer silcon was used for the xMB, So rename XM A revision as AB revision and report accordingly
Reported-by: Robert Nelson robertcnelson@gmail.com Signed-off-by: Nishanth Menon nm@ti.com ---
V3 updates based on http://marc.info/?t=137357970500004&r=1&w=2
board/ti/beagle/beagle.c | 28 +++++++--------------------- board/ti/beagle/beagle.h | 3 +-- 2 files changed, 8 insertions(+), 23 deletions(-)
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index c686f40..c48dece 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -182,8 +182,7 @@ void get_board_mem_timings(struct board_sdrc_timings *timings) timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz; break; } - case REVISION_XM_A: - case REVISION_XM_B: + case REVISION_XM_AB: case REVISION_XM_C: if (pop_mfr == 0) { /* 256MB DDR */ @@ -256,8 +255,7 @@ static void beagle_display_init(void) case REVISION_C4: omap3_dss_panel_config(&dvid_cfg); break; - case REVISION_XM_A: - case REVISION_XM_B: + case REVISION_XM_AB: case REVISION_XM_C: default: omap3_dss_panel_config(&dvid_cfg_xm); @@ -276,12 +274,11 @@ static void beagle_dvi_pup(void) case REVISION_AXBX: case REVISION_CX: case REVISION_C4: - case REVISION_XM_A: gpio_request(170, ""); gpio_direction_output(170, 0); gpio_set_value(170, 1); break; - case REVISION_XM_B: + case REVISION_XM_AB: case REVISION_XM_C: default: #define GPIODATADIR1 (TWL4030_BASEADD_GPIO+3) @@ -359,19 +356,9 @@ int misc_init_r(void) TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, TWL4030_PM_RECEIVER_DEV_GRP_P1); break; - case REVISION_XM_A: - printf("Beagle xM Rev A\n"); - setenv("beaglerev", "xMA"); - MUX_BEAGLE_XM(); - /* Set VAUX2 to 1.8V for EHCI PHY */ - twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, - TWL4030_PM_RECEIVER_VAUX2_VSEL_18, - TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, - TWL4030_PM_RECEIVER_DEV_GRP_P1); - break; - case REVISION_XM_B: - printf("Beagle xM Rev B\n"); - setenv("beaglerev", "xMB"); + case REVISION_XM_AB: + printf("Beagle xM Rev A/B\n"); + setenv("beaglerev", "xMAB"); MUX_BEAGLE_XM(); /* Set VAUX2 to 1.8V for EHCI PHY */ twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, @@ -484,8 +471,7 @@ int misc_init_r(void)
twl4030_power_init(); switch (get_board_revision()) { - case REVISION_XM_A: - case REVISION_XM_B: + case REVISION_XM_AB: twl4030_led_init(TWL4030_LED_LEDEN_LEDBON); break; default: diff --git a/board/ti/beagle/beagle.h b/board/ti/beagle/beagle.h index 6d71bbc..27f8b12 100644 --- a/board/ti/beagle/beagle.h +++ b/board/ti/beagle/beagle.h @@ -39,8 +39,7 @@ const omap3_sysinfo sysinfo = { #define REVISION_AXBX 0x7 #define REVISION_CX 0x6 #define REVISION_C4 0x5 -#define REVISION_XM_A 0x0 -#define REVISION_XM_B 0x1 +#define REVISION_XM_AB 0x0 #define REVISION_XM_C 0x2
/*

CMD_FS_GENERIC allows us to simplify where we load up our image from either from ext2/fat etc. So, lets use that instead of cumbersome options we currently use. Sticking with existing conventions, defaults will be: ramdisk=ramdisk.gz bootpart=0:2 (second partition) bootdir=/boot (/boot in second partition)
This matches with the default behavior, these can be overriden by env files as needed.
Signed-off-by: Nishanth Menon nm@ti.com --- include/configs/omap3_beagle.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index e152d3c..bdeee17 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -150,6 +150,7 @@ #define CONFIG_CMD_CACHE #define CONFIG_CMD_EXT2 /* EXT2 Support */ #define CONFIG_CMD_FAT /* FAT support */ +#define CONFIG_CMD_FS_GENERIC /* Generic FS support */ #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */ #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ #define MTDIDS_DEFAULT "nand0=nand" @@ -211,6 +212,9 @@ "rdaddr=0x81000000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ + "ramdisk=ramdisk.gz\0" \ + "bootdir=/boot\0" \ + "bootpart=0:2\0" \ "console=ttyO2,115200n8\0" \ "mpurate=auto\0" \ "buddy=none\0" \ @@ -259,9 +263,8 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${ramroot} " \ "rootfstype=${ramrootfstype}\0" \ - "loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \ - "loaduimagefat=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \ - "loaduimage=ext2load mmc ${mmcdev}:2 ${loadaddr} /boot/uImage\0" \ + "loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \ + "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ "bootm ${loadaddr}\0" \ @@ -293,7 +296,7 @@ "echo Running uenvcmd ...;" \ "run uenvcmd;" \ "fi;" \ - "if run loaduimage; then " \ + "if run loadimage; then " \ "run mmcboot;" \ "fi;" \ "fi;" \

For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com --- V3: Fixes typo mistake reported in http://marc.info/?t=137358212300006&r=1&w=2
include/configs/omap3_beagle.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..5ec8ade 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \ + "fdt_high=0xffffffff\0" \ + "fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \ @@ -250,6 +252,17 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \ + "findfdt=" \ + "if test $beaglerev = AxBx; then " \ + "setenv fdtfile omap3-beagle.dtb; fi; " \ + "if test $beaglerev = Cx; then " \ + "setenv fdtfile omap3-beagle.dtb; fi; " \ + "if test $beaglerev = xMAB; then " \ + "setenv fdtfile omap3-beagle-xm.dtb; fi; " \ + "if test $beaglerev = xMC; then " \ + "setenv fdtfile omap3-beagle-xm.dtb; fi; " \ + "if test $fdtfile = undefined; then " \ + "echo WARNING: Could not determine device tree to use; fi; \0" \ "bootenv=uEnv.txt\0" \ "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ "importbootenv=echo Importing environment from mmc ...; " \ @@ -265,6 +278,7 @@ "rootfstype=${ramrootfstype}\0" \ "loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ + "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ "bootm ${loadaddr}\0" \ @@ -281,6 +295,7 @@ "userbutton_nonxm=gpio input 7;\0" /* "run userbutton" will return 1 (false) if pressed and 0 (true) if not */ #define CONFIG_BOOTCOMMAND \ + "run findfdt; " \ "mmc dev ${mmcdev}; if mmc rescan; then " \ "if run userbutton; then " \ "setenv bootenv uEnv.txt;" \

Op 15 jul. 2013, om 14:11 heeft Nishanth Menon nm@ti.com het volgende geschreven:
For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com
V3: Fixes typo mistake reported in http://marc.info/?t=137358212300006&r=1&w=2
include/configs/omap3_beagle.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..5ec8ade 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \
- "fdt_high=0xffffffff\0" \
- "fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \
@@ -250,6 +252,17 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \
- "findfdt=" \
"if test $beaglerev = AxBx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = Cx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = xMAB; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $beaglerev = xMC; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $fdtfile = undefined; then " \
"echo WARNING: Could not determine device tree to use; fi; \0" \
With the remote chance of a future xM rev D, can you make the fallthrough be 'omap3-beagle-xm.dtb' intead of 'undefined'?

On 14:16-20130715, Koen Kooi wrote:
Op 15 jul. 2013, om 14:11 heeft Nishanth Menon nm@ti.com het volgende geschreven:
For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com
V3: Fixes typo mistake reported in http://marc.info/?t=137358212300006&r=1&w=2
include/configs/omap3_beagle.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..5ec8ade 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \
- "fdt_high=0xffffffff\0" \
- "fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \
@@ -250,6 +252,17 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \
- "findfdt=" \
"if test $beaglerev = AxBx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = Cx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = xMAB; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $beaglerev = xMC; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $fdtfile = undefined; then " \
"echo WARNING: Could not determine device tree to use; fi; \0" \
With the remote chance of a future xM rev D, can you make the fallthrough be 'omap3-beagle-xm.dtb' intead of 'undefined'?
Lets add the detection of xMD and along with that we add omap3-beagle-xm.dtb detection - makes sense? OR do we assume all un-matched devices default to beagle xMD? what if there was a vanilla beagle rev D?

Op 15 jul. 2013, om 14:25 heeft Nishanth Menon nm@ti.com het volgende geschreven:
On 14:16-20130715, Koen Kooi wrote:
Op 15 jul. 2013, om 14:11 heeft Nishanth Menon nm@ti.com het volgende geschreven:
For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com
V3: Fixes typo mistake reported in http://marc.info/?t=137358212300006&r=1&w=2
include/configs/omap3_beagle.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..5ec8ade 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \
- "fdt_high=0xffffffff\0" \
- "fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \
@@ -250,6 +252,17 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \
- "findfdt=" \
"if test $beaglerev = AxBx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = Cx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = xMAB; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $beaglerev = xMC; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $fdtfile = undefined; then " \
"echo WARNING: Could not determine device tree to use; fi; \0" \
With the remote chance of a future xM rev D, can you make the fallthrough be 'omap3-beagle-xm.dtb' intead of 'undefined'?
Lets add the detection of xMD and along with that we add omap3-beagle-xm.dtb detection - makes sense? OR do we assume all un-matched devices default to beagle xMD? what if there was a vanilla beagle rev D?
The fallthrough case should always be the most recent board rev, any other way will just make the HW guys spoof the ID in the design and we all know how that ends :(

On 15:07-20130715, Koen Kooi wrote:
Op 15 jul. 2013, om 14:25 heeft Nishanth Menon nm@ti.com het volgende geschreven:
On 14:16-20130715, Koen Kooi wrote:
Op 15 jul. 2013, om 14:11 heeft Nishanth Menon nm@ti.com het volgende geschreven:
[..]
- "findfdt=" \
"if test $beaglerev = AxBx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = Cx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = xMAB; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $beaglerev = xMC; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $fdtfile = undefined; then " \
"echo WARNING: Could not determine device tree to use; fi; \0" \
With the remote chance of a future xM rev D, can you make the fallthrough be 'omap3-beagle-xm.dtb' intead of 'undefined'?
Lets add the detection of xMD and along with that we add omap3-beagle-xm.dtb detection - makes sense? OR do we assume all un-matched devices default to beagle xMD? what if there was a vanilla beagle rev D?
The fallthrough case should always be the most recent board rev, any other way will just make the HW guys spoof the ID in the design and we all know how that ends :(
Fair enough. Anyone else has a contrary opinion?
If none, the following is the replacement patch, wont repost unless a new series is needed:
From 07e1787cc59f4622c764d7da33da2684cf122d41 Mon Sep 17 00:00:00 2001
From: Nishanth Menon nm@ti.com Date: Thu, 11 Jul 2013 16:25:09 -0500 Subject: [PATCH V4] omap3_beagle: support findfdt and loadfdt for devicetree support
For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com --- include/configs/omap3_beagle.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..7e6e38c 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \ + "fdt_high=0xffffffff\0" \ + "fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \ @@ -250,6 +252,20 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \ + "findfdt=" \ + "if test $beaglerev = AxBx; then " \ + "setenv fdtfile omap3-beagle.dtb; fi; " \ + "if test $beaglerev = Cx; then " \ + "setenv fdtfile omap3-beagle.dtb; fi; " \ + "if test $beaglerev = xMAB; then " \ + "setenv fdtfile omap3-beagle-xm.dtb; fi; " \ + "if test $beaglerev = xMC; then " \ + "setenv fdtfile omap3-beagle-xm.dtb; fi; " \ + "if test $fdtfile = undefined; then " \ + "setenv fdtfile omap3-beagle-xm.dtb;" \ + "echo WARNING: Could not determine device tree to use;" \ + "echo WARNING: assuming ${fdtfile};" \ + "fi; \0" \ "bootenv=uEnv.txt\0" \ "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ "importbootenv=echo Importing environment from mmc ...; " \ @@ -265,6 +281,7 @@ "rootfstype=${ramrootfstype}\0" \ "loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ + "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ "bootm ${loadaddr}\0" \ @@ -281,6 +298,7 @@ "userbutton_nonxm=gpio input 7;\0" /* "run userbutton" will return 1 (false) if pressed and 0 (true) if not */ #define CONFIG_BOOTCOMMAND \ + "run findfdt; " \ "mmc dev ${mmcdev}; if mmc rescan; then " \ "if run userbutton; then " \ "setenv bootenv uEnv.txt;" \

On Mon, Jul 15, 2013 at 02:16:50PM +0200, Koen Kooi wrote:
Op 15 jul. 2013, om 14:11 heeft Nishanth Menon nm@ti.com het volgende geschreven:
For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com
V3: Fixes typo mistake reported in http://marc.info/?t=137358212300006&r=1&w=2
include/configs/omap3_beagle.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..5ec8ade 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \
- "fdt_high=0xffffffff\0" \
- "fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \
@@ -250,6 +252,17 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \
- "findfdt=" \
"if test $beaglerev = AxBx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = Cx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = xMAB; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $beaglerev = xMC; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $fdtfile = undefined; then " \
"echo WARNING: Could not determine device tree to use; fi; \0" \
With the remote chance of a future xM rev D, can you make the fallthrough be 'omap3-beagle-xm.dtb' intead of 'undefined'?
I don't like that idea. On am335x_evm configs we have undefined and then say "hey, it's undefined!" so it's clear that we don't know what to do. That in theory future xM rev D might need a different device tree for example.

Op 15 jul. 2013, om 16:49 heeft Tom Rini trini@ti.com het volgende geschreven:
On Mon, Jul 15, 2013 at 02:16:50PM +0200, Koen Kooi wrote:
Op 15 jul. 2013, om 14:11 heeft Nishanth Menon nm@ti.com het volgende geschreven:
For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com
V3: Fixes typo mistake reported in http://marc.info/?t=137358212300006&r=1&w=2
include/configs/omap3_beagle.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..5ec8ade 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \
- "fdt_high=0xffffffff\0" \
- "fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \
@@ -250,6 +252,17 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \
- "findfdt=" \
"if test $beaglerev = AxBx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = Cx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = xMAB; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $beaglerev = xMC; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $fdtfile = undefined; then " \
"echo WARNING: Could not determine device tree to use; fi; \0" \
With the remote chance of a future xM rev D, can you make the fallthrough be 'omap3-beagle-xm.dtb' intead of 'undefined'?
I don't like that idea. On am335x_evm configs we have undefined and then say "hey, it's undefined!" so it's clear that we don't know what to do. That in theory future xM rev D might need a different device tree for example.
And that's patched out on the build that actually ships with the beaglebone and beaglebone black so it will fall back to BBB when it can't ID the board. You'll see that the u-boot bits that need the ID for the xM also fallback to the latest rev. I don't see why the boardfile and script need to have different behaviour.

On Mon, Jul 15, 2013 at 04:52:51PM +0200, Koen Kooi wrote:
Op 15 jul. 2013, om 16:49 heeft Tom Rini trini@ti.com het volgende geschreven:
On Mon, Jul 15, 2013 at 02:16:50PM +0200, Koen Kooi wrote:
Op 15 jul. 2013, om 14:11 heeft Nishanth Menon nm@ti.com het volgende geschreven:
For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com
V3: Fixes typo mistake reported in http://marc.info/?t=137358212300006&r=1&w=2
include/configs/omap3_beagle.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..5ec8ade 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \
- "fdt_high=0xffffffff\0" \
- "fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \
@@ -250,6 +252,17 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \
- "findfdt=" \
"if test $beaglerev = AxBx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = Cx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = xMAB; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $beaglerev = xMC; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $fdtfile = undefined; then " \
"echo WARNING: Could not determine device tree to use; fi; \0" \
With the remote chance of a future xM rev D, can you make the fallthrough be 'omap3-beagle-xm.dtb' intead of 'undefined'?
I don't like that idea. On am335x_evm configs we have undefined and then say "hey, it's undefined!" so it's clear that we don't know what to do. That in theory future xM rev D might need a different device tree for example.
And that's patched out on the build that actually ships with the beaglebone and beaglebone black so it will fall back to BBB when it can't ID the board. You'll see that the u-boot bits that need the ID for the xM also fallback to the latest rev. I don't see why the boardfile and script need to have different behaviour.
Yes, I'm not terribly happy with what gets done for the shipping U-Boot on BBB, but I understand you're trying to not have too special of a binary used in programming versus distribution of the board. If the vendor wants to ship software that says "when in doubt, it's likely this board", that's OK for the vendor to do.

On Thu, Jul 18, 2013 at 11:13 AM, Tom Rini trini@ti.com wrote:
Yes, I'm not terribly happy with what gets done for the shipping U-Boot on BBB, but I understand you're trying to not have too special of a binary used in programming versus distribution of the board. If the vendor wants to ship software that says "when in doubt, it's likely this board", that's OK for the vendor to do.
Alrite, so we go with V3(current version) of the patch then.
Regards, Nishanth Menon

If no other bootoption works, try loading up device tree and zImage.
This is selected as the last option to allow backward compatibility as well as support the recent trend in moving kernel boot to using zImage and device tree.
NOTE: if uImage is present in bootpart, it will try this first and will assume this is to be booted with bootm (so may be concatenated image or plain vanilla ATAG MACHINE_ID based image)
Signed-off-by: Nishanth Menon nm@ti.com --- include/configs/omap3_beagle.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 5ec8ade..a2e6971 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -282,6 +282,9 @@ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ "bootm ${loadaddr}\0" \ + "mmcbootz=echo Booting with DT from mmc${mmcdev} ...; " \ + "run mmcargs; " \ + "bootz ${loadaddr} - ${fdtaddr}\0" \ "nandboot=echo Booting from nand ...; " \ "run nandargs; " \ "nand read ${loadaddr} 280000 400000; " \ @@ -316,6 +319,11 @@ "fi;" \ "fi;" \ "run nandboot;" \ + "setenv bootfile zImage;" \ + "if run loadimage; then " \ + "run loadfdt;" \ + "run mmcbootz; " \ + "fi; " \
#define CONFIG_AUTO_COMPLETE 1 /*

On Mon, Jul 15, 2013 at 07:11:27AM -0500, Nishanth Menon wrote:
With the latest transition to device tree, there is a need to simplify the load of device tree depending on board type etc. While at it, simplify few other changes as well.
Testing: with a uEnv.txt as: bootdir=/ bootpart=0:1
The following were the boot results: Beagle (rev C1D): http://pastebin.com/fMdsKkgr Beagle XM (rev C1): http://pastebin.com/p1zp9AhG
Changes in V3 since v2:
- Minor fixes for RevB beagleboard DVIpup handling http://marc.info/?t=137357970500004&r=1&w=2
- Picked up acked-by from http://marc.info/?t=137357970700007&r=1&w=2
V2: http://marc.info/?l=u-boot&m=137358206228251&w=2 V1: http://marc.info/?l=u-boot&m=137357963227510&w=2
Nishanth Menon (6): omap3_beagle: remove JFFS2 support. omap3_beagle: replace uImage.beagle with generic uImage beagleboard: remove RevB support for BeagleBoard Xm omap3_beagle: enable CMD_FS_GENERIC and simplify load of image/ramdisk omap3_beagle: support findfdt and loadfdt for devicetree support omap3_beagle: support booting from zImage and device tree as last option
board/ti/beagle/beagle.c | 28 +++++++------------------ board/ti/beagle/beagle.h | 3 +-- include/configs/omap3_beagle.h | 44 ++++++++++++++++++++++++++++------------ 3 files changed, 39 insertions(+), 36 deletions(-)
Applied to u-boot-ti/master, thanks!

For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com --- include/configs/omap3_beagle.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..7833208 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \ + "fdt_high=0xffffffff\0" \ + "fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \ @@ -250,6 +252,19 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \ + "findfdt=" \ + "if test $beaglerev = AxBx; then " \ + "setenv fdtfile omap3-beagle.dtb; fi; " \ + "if test $beaglerev = Cx; then " \ + "setenv fdtfile omap3-beagle.dtb; fi; " \ + "if test $beaglerev = xMA; then " \ + "setenv fdtfile omap3-beagle-xm.dtb; fi; " \ + "if test $beaglerev = xMB; then " \ + "setenv fdtfile omap3-beagle-xm.dtb; fi; " \ + "if test $beaglerev = xMC; then " \ + "setenv fdtfile omap3-beagle-xm.dtb; fi; " \ + "if test $fdtfile = undefined; then " \ + "echo WARNING: Could not determine device tree to use; fi; \0" \ "bootenv=uEnv.txt\0" \ "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ "importbootenv=echo Importing environment from mmc ...; " \ @@ -265,6 +280,7 @@ "rootfstype=${ramrootfstype}\0" \ "loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \ + "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ "bootm ${loadaddr}\0" \ @@ -281,6 +297,7 @@ "userbutton_nonxm=gpio input 7;\0" /* "run userbutton" will return 1 (false) if pressed and 0 (true) if not */ #define CONFIG_BOOTCOMMAND \ + "run findfdt; " \ "mmc dev ${mmcdev}; if mmc rescan; then " \ "if run userbutton; then " \ "setenv bootenv uEnv.txt;" \

On Thu, Jul 11, 2013 at 4:52 PM, Nishanth Menon nm@ti.com wrote:
For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com
include/configs/omap3_beagle.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..7833208 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \
"fdt_high=0xffffffff\0" \
"fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \
@@ -250,6 +252,19 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \
"findfdt=" \
"if test $beaglerev = AxBx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = Cx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = xMA; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $beaglerev = xMB; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
There is no need for the "xMB" variant, as the gpio pins used for identification where never changed from the xMA when the newer silcon was used for the xMB (i guess if we look at the omap's es revision, we could figure out which are xMB's, but right now that isn't done in u-boot....)
"if test $beaglerev = xMC; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $fdtfile = undefined; then " \
"echo WARNING: Could not determine device tree to use; fi; \0" \ "bootenv=uEnv.txt\0" \ "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \ "importbootenv=echo Importing environment from mmc ...; " \
@@ -265,6 +280,7 @@ "rootfstype=${ramrootfstype}\0" \ "loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \ "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ "bootm ${loadaddr}\0" \
@@ -281,6 +297,7 @@ "userbutton_nonxm=gpio input 7;\0" /* "run userbutton" will return 1 (false) if pressed and 0 (true) if not */ #define CONFIG_BOOTCOMMAND \
"run findfdt; " \ "mmc dev ${mmcdev}; if mmc rescan; then " \ "if run userbutton; then " \ "setenv bootenv uEnv.txt;" \
--
Regards,

On 17:02-20130711, Robert Nelson wrote:
On Thu, Jul 11, 2013 at 4:52 PM, Nishanth Menon nm@ti.com wrote:
For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com
include/configs/omap3_beagle.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..7833208 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \
"fdt_high=0xffffffff\0" \
"fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \
@@ -250,6 +252,19 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \
"findfdt=" \
"if test $beaglerev = AxBx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = Cx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = xMA; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $beaglerev = xMB; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
There is no need for the "xMB" variant, as the gpio pins used for identification where never changed from the xMA when the newer silcon was used for the xMB (i guess if we look at the omap's es revision, we could figure out which are xMB's, but right now that isn't done in u-boot....)
I suppose then the following is ok to do as well? diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index c686f40..6094b0f 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -369,16 +369,6 @@ int misc_init_r(void) TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, TWL4030_PM_RECEIVER_DEV_GRP_P1); break; - case REVISION_XM_B: - printf("Beagle xM Rev B\n"); - setenv("beaglerev", "xMB"); - MUX_BEAGLE_XM(); - /* Set VAUX2 to 1.8V for EHCI PHY */ - twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, - TWL4030_PM_RECEIVER_VAUX2_VSEL_18, - TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, - TWL4030_PM_RECEIVER_DEV_GRP_P1); - break; case REVISION_XM_C: printf("Beagle xM Rev C\n"); setenv("beaglerev", "xMC");

On Thu, Jul 11, 2013 at 5:03 PM, Nishanth Menon nm@ti.com wrote:
On 17:02-20130711, Robert Nelson wrote:
On Thu, Jul 11, 2013 at 4:52 PM, Nishanth Menon nm@ti.com wrote:
For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com
include/configs/omap3_beagle.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..7833208 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \
"fdt_high=0xffffffff\0" \
"fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \
@@ -250,6 +252,19 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \
"findfdt=" \
"if test $beaglerev = AxBx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = Cx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = xMA; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $beaglerev = xMB; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
There is no need for the "xMB" variant, as the gpio pins used for identification where never changed from the xMA when the newer silcon was used for the xMB (i guess if we look at the omap's es revision, we could figure out which are xMB's, but right now that isn't done in u-boot....)
I suppose then the following is ok to do as well? diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index c686f40..6094b0f 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -369,16 +369,6 @@ int misc_init_r(void) TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, TWL4030_PM_RECEIVER_DEV_GRP_P1); break;
case REVISION_XM_B:
printf("Beagle xM Rev B\n");
setenv("beaglerev", "xMB");
MUX_BEAGLE_XM();
/* Set VAUX2 to 1.8V for EHCI PHY */
twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
TWL4030_PM_RECEIVER_DEV_GRP_P1);
break; case REVISION_XM_C: printf("Beagle xM Rev C\n"); setenv("beaglerev", "xMC");
Correct, as a cleanup we can nuke that xMB section..
For some bike shed paining we could rename:
Beagle xM Rev A -> Beagle xM Rev A/B
Above that too. ;)
Regards,

On 17:05-20130711, Robert Nelson wrote:
On Thu, Jul 11, 2013 at 5:03 PM, Nishanth Menon nm@ti.com wrote:
On 17:02-20130711, Robert Nelson wrote:
On Thu, Jul 11, 2013 at 4:52 PM, Nishanth Menon nm@ti.com wrote:
For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com
include/configs/omap3_beagle.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..7833208 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \
"fdt_high=0xffffffff\0" \
"fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \
@@ -250,6 +252,19 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \
"findfdt=" \
"if test $beaglerev = AxBx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = Cx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = xMA; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $beaglerev = xMB; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
There is no need for the "xMB" variant, as the gpio pins used for identification where never changed from the xMA when the newer silcon was used for the xMB (i guess if we look at the omap's es revision, we could figure out which are xMB's, but right now that isn't done in u-boot....)
I suppose then the following is ok to do as well? diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index c686f40..6094b0f 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -369,16 +369,6 @@ int misc_init_r(void) TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, TWL4030_PM_RECEIVER_DEV_GRP_P1); break;
case REVISION_XM_B:
printf("Beagle xM Rev B\n");
setenv("beaglerev", "xMB");
MUX_BEAGLE_XM();
/* Set VAUX2 to 1.8V for EHCI PHY */
twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
TWL4030_PM_RECEIVER_DEV_GRP_P1);
break; case REVISION_XM_C: printf("Beagle xM Rev C\n"); setenv("beaglerev", "xMC");
Correct, as a cleanup we can nuke that xMB section..
For some bike shed paining we could rename:
Beagle xM Rev A -> Beagle xM Rev A/B
Above that too. ;)
OK - I suspect and am not sure how dvi_pup will get handled in the resultant diff, What do folks think of the following?
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index c686f40..01d76a5 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -182,8 +182,7 @@ void get_board_mem_timings(struct board_sdrc_timings *timings) timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz; break; } - case REVISION_XM_A: - case REVISION_XM_B: + case REVISION_XM_AB: case REVISION_XM_C: if (pop_mfr == 0) { /* 256MB DDR */ @@ -256,8 +255,7 @@ static void beagle_display_init(void) case REVISION_C4: omap3_dss_panel_config(&dvid_cfg); break; - case REVISION_XM_A: - case REVISION_XM_B: + case REVISION_XM_AB: case REVISION_XM_C: default: omap3_dss_panel_config(&dvid_cfg_xm); @@ -276,12 +274,11 @@ static void beagle_dvi_pup(void) case REVISION_AXBX: case REVISION_CX: case REVISION_C4: - case REVISION_XM_A: + case REVISION_XM_AB: gpio_request(170, ""); gpio_direction_output(170, 0); gpio_set_value(170, 1); break; - case REVISION_XM_B: case REVISION_XM_C: default: #define GPIODATADIR1 (TWL4030_BASEADD_GPIO+3) @@ -359,19 +356,9 @@ int misc_init_r(void) TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, TWL4030_PM_RECEIVER_DEV_GRP_P1); break; - case REVISION_XM_A: - printf("Beagle xM Rev A\n"); - setenv("beaglerev", "xMA"); - MUX_BEAGLE_XM(); - /* Set VAUX2 to 1.8V for EHCI PHY */ - twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, - TWL4030_PM_RECEIVER_VAUX2_VSEL_18, - TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, - TWL4030_PM_RECEIVER_DEV_GRP_P1); - break; - case REVISION_XM_B: - printf("Beagle xM Rev B\n"); - setenv("beaglerev", "xMB"); + case REVISION_XM_AB: + printf("Beagle xM Rev A/B\n"); + setenv("beaglerev", "xMA/xMB"); MUX_BEAGLE_XM(); /* Set VAUX2 to 1.8V for EHCI PHY */ twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, @@ -484,8 +471,7 @@ int misc_init_r(void)
twl4030_power_init(); switch (get_board_revision()) { - case REVISION_XM_A: - case REVISION_XM_B: + case REVISION_XM_AB: twl4030_led_init(TWL4030_LED_LEDEN_LEDBON); break; default: diff --git a/board/ti/beagle/beagle.h b/board/ti/beagle/beagle.h index 6d71bbc..27f8b12 100644 --- a/board/ti/beagle/beagle.h +++ b/board/ti/beagle/beagle.h @@ -39,8 +39,7 @@ const omap3_sysinfo sysinfo = { #define REVISION_AXBX 0x7 #define REVISION_CX 0x6 #define REVISION_C4 0x5 -#define REVISION_XM_A 0x0 -#define REVISION_XM_B 0x1 +#define REVISION_XM_AB 0x0 #define REVISION_XM_C 0x2
/*

On Thu, Jul 11, 2013 at 5:17 PM, Nishanth Menon nm@ti.com wrote:
On 17:05-20130711, Robert Nelson wrote:
On Thu, Jul 11, 2013 at 5:03 PM, Nishanth Menon nm@ti.com wrote:
On 17:02-20130711, Robert Nelson wrote:
On Thu, Jul 11, 2013 at 4:52 PM, Nishanth Menon nm@ti.com wrote:
For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com
include/configs/omap3_beagle.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..7833208 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \
"fdt_high=0xffffffff\0" \
"fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \
@@ -250,6 +252,19 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \
"findfdt=" \
"if test $beaglerev = AxBx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = Cx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = xMA; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $beaglerev = xMB; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
There is no need for the "xMB" variant, as the gpio pins used for identification where never changed from the xMA when the newer silcon was used for the xMB (i guess if we look at the omap's es revision, we could figure out which are xMB's, but right now that isn't done in u-boot....)
I suppose then the following is ok to do as well? diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index c686f40..6094b0f 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -369,16 +369,6 @@ int misc_init_r(void) TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, TWL4030_PM_RECEIVER_DEV_GRP_P1); break;
case REVISION_XM_B:
printf("Beagle xM Rev B\n");
setenv("beaglerev", "xMB");
MUX_BEAGLE_XM();
/* Set VAUX2 to 1.8V for EHCI PHY */
twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
TWL4030_PM_RECEIVER_DEV_GRP_P1);
break; case REVISION_XM_C: printf("Beagle xM Rev C\n"); setenv("beaglerev", "xMC");
Correct, as a cleanup we can nuke that xMB section..
For some bike shed paining we could rename:
Beagle xM Rev A -> Beagle xM Rev A/B
Above that too. ;)
OK - I suspect and am not sure how dvi_pup will get handled in the resultant diff, What do folks think of the following?
A quick review of all my old xM schematics i have access to and the ones on https://github.com/CircuitCo/
For the "dvi_pup" function
GPIO_170 was only used on the pre-production xM's P8/P9, i doubt any of them still operate (mine died)..
It was then switched to GPIO_129 for the xMA, however there where MMC issues, so it was changed for xMA1 (and thus xMA2) notes, top of this: https://github.com/CircuitCo/BeagleBoard-xM-RevC/blob/master/BeagleBoard-xM_...
TPS_GPIO_2: was then used on xMA3 -> and all later generations...
So also looking at: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/ar...
Looks like the original beagle needs GPIO_170..
So I'd just set GPIO_170 for:
case REVISION_AXBX: case REVISION_CX: case REVISION_C4:
and ignore all the pre-production xM P8/P8's/xMA..
Side note, I think 'first' customers just got the xMA2 and newer.. As i was one of the first, and it's still running downstairs..
Regards,

On 18:17-20130711, Robert Nelson wrote:
On Thu, Jul 11, 2013 at 5:17 PM, Nishanth Menon nm@ti.com wrote:
On 17:05-20130711, Robert Nelson wrote:
On Thu, Jul 11, 2013 at 5:03 PM, Nishanth Menon nm@ti.com wrote:
On 17:02-20130711, Robert Nelson wrote:
On Thu, Jul 11, 2013 at 4:52 PM, Nishanth Menon nm@ti.com wrote:
For folks not using concatenated device tree with uImage, having an handy function to find and load device tree is very handy.
So introduce findfdt and loadfdt and run findfdt by default to make it easier on user scripts.
Signed-off-by: Nishanth Menon nm@ti.com
include/configs/omap3_beagle.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index bdeee17..7833208 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -210,6 +210,8 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ "loadaddr=0x80200000\0" \ "rdaddr=0x81000000\0" \
"fdt_high=0xffffffff\0" \
"fdtaddr=0x80f80000\0" \ "usbtty=cdc_acm\0" \ "bootfile=uImage\0" \ "ramdisk=ramdisk.gz\0" \
@@ -250,6 +252,19 @@ "omapdss.def_disp=${defaultdisplay} " \ "root=${nandroot} " \ "rootfstype=${nandrootfstype}\0" \
"findfdt=" \
"if test $beaglerev = AxBx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = Cx; then " \
"setenv fdtfile omap3-beagle.dtb; fi; " \
"if test $beaglerev = xMA; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
"if test $beaglerev = xMB; then " \
"setenv fdtfile omap3-beagle-xm.dtb; fi; " \
There is no need for the "xMB" variant, as the gpio pins used for identification where never changed from the xMA when the newer silcon was used for the xMB (i guess if we look at the omap's es revision, we could figure out which are xMB's, but right now that isn't done in u-boot....)
I suppose then the following is ok to do as well? diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index c686f40..6094b0f 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -369,16 +369,6 @@ int misc_init_r(void) TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, TWL4030_PM_RECEIVER_DEV_GRP_P1); break;
case REVISION_XM_B:
printf("Beagle xM Rev B\n");
setenv("beaglerev", "xMB");
MUX_BEAGLE_XM();
/* Set VAUX2 to 1.8V for EHCI PHY */
twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
TWL4030_PM_RECEIVER_DEV_GRP_P1);
break; case REVISION_XM_C: printf("Beagle xM Rev C\n"); setenv("beaglerev", "xMC");
Correct, as a cleanup we can nuke that xMB section..
For some bike shed paining we could rename:
Beagle xM Rev A -> Beagle xM Rev A/B
Above that too. ;)
OK - I suspect and am not sure how dvi_pup will get handled in the resultant diff, What do folks think of the following?
A quick review of all my old xM schematics i have access to and the ones on https://github.com/CircuitCo/
For the "dvi_pup" function
GPIO_170 was only used on the pre-production xM's P8/P9, i doubt any of them still operate (mine died)..
It was then switched to GPIO_129 for the xMA, however there where MMC issues, so it was changed for xMA1 (and thus xMA2) notes, top of this: https://github.com/CircuitCo/BeagleBoard-xM-RevC/blob/master/BeagleBoard-xM_...
TPS_GPIO_2: was then used on xMA3 -> and all later generations...
So also looking at: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/ar...
Looks like the original beagle needs GPIO_170..
So I'd just set GPIO_170 for:
case REVISION_AXBX: case REVISION_CX: case REVISION_C4:
and ignore all the pre-production xM P8/P8's/xMA..
Side note, I think 'first' customers just got the xMA2 and newer.. As i was one of the first, and it's still running downstairs..
ok, here is how the code looks like with the V2 of my series:
Do we just default to none for XM_AB for dvi_pup?
static void beagle_dvi_pup(void) { uchar val;
switch (get_board_revision()) { case REVISION_AXBX: case REVISION_CX: case REVISION_C4: case REVISION_XM_AB: gpio_request(170, ""); gpio_direction_output(170, 0); gpio_set_value(170, 1); break; case REVISION_XM_C: default: #define GPIODATADIR1 (TWL4030_BASEADD_GPIO+3) #define GPIODATAOUT1 (TWL4030_BASEADD_GPIO+6)
i2c_read(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1); val |= 4; i2c_write(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1);
i2c_read(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1); val |= 4; i2c_write(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1); break; } }

On Thu, Jul 11, 2013 at 11:06 PM, Nishanth Menon nm@ti.com wrote:
On 18:17-20130711, Robert Nelson wrote:
On Thu, Jul 11, 2013 at 5:17 PM, Nishanth Menon nm@ti.com wrote:
On 17:05-20130711, Robert Nelson wrote:
On Thu, Jul 11, 2013 at 5:03 PM, Nishanth Menon nm@ti.com wrote:
On 17:02-20130711, Robert Nelson wrote:
On Thu, Jul 11, 2013 at 4:52 PM, Nishanth Menon nm@ti.com wrote: > For folks not using concatenated device tree with uImage, having > an handy function to find and load device tree is very handy. > > So introduce findfdt and loadfdt and run findfdt by default to make > it easier on user scripts. > > Signed-off-by: Nishanth Menon nm@ti.com > --- > include/configs/omap3_beagle.h | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h > index bdeee17..7833208 100644 > --- a/include/configs/omap3_beagle.h > +++ b/include/configs/omap3_beagle.h > @@ -210,6 +210,8 @@ > #define CONFIG_EXTRA_ENV_SETTINGS \ > "loadaddr=0x80200000\0" \ > "rdaddr=0x81000000\0" \ > + "fdt_high=0xffffffff\0" \ > + "fdtaddr=0x80f80000\0" \ > "usbtty=cdc_acm\0" \ > "bootfile=uImage\0" \ > "ramdisk=ramdisk.gz\0" \ > @@ -250,6 +252,19 @@ > "omapdss.def_disp=${defaultdisplay} " \ > "root=${nandroot} " \ > "rootfstype=${nandrootfstype}\0" \ > + "findfdt=" \ > + "if test $beaglerev = AxBx; then " \ > + "setenv fdtfile omap3-beagle.dtb; fi; " \ > + "if test $beaglerev = Cx; then " \ > + "setenv fdtfile omap3-beagle.dtb; fi; " \ > + "if test $beaglerev = xMA; then " \ > + "setenv fdtfile omap3-beagle-xm.dtb; fi; " \ > + "if test $beaglerev = xMB; then " \ > + "setenv fdtfile omap3-beagle-xm.dtb; fi; " \
There is no need for the "xMB" variant, as the gpio pins used for identification where never changed from the xMA when the newer silcon was used for the xMB (i guess if we look at the omap's es revision, we could figure out which are xMB's, but right now that isn't done in u-boot....)
I suppose then the following is ok to do as well? diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index c686f40..6094b0f 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -369,16 +369,6 @@ int misc_init_r(void) TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, TWL4030_PM_RECEIVER_DEV_GRP_P1); break;
case REVISION_XM_B:
printf("Beagle xM Rev B\n");
setenv("beaglerev", "xMB");
MUX_BEAGLE_XM();
/* Set VAUX2 to 1.8V for EHCI PHY */
twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
TWL4030_PM_RECEIVER_DEV_GRP_P1);
break; case REVISION_XM_C: printf("Beagle xM Rev C\n"); setenv("beaglerev", "xMC");
Correct, as a cleanup we can nuke that xMB section..
For some bike shed paining we could rename:
Beagle xM Rev A -> Beagle xM Rev A/B
Above that too. ;)
OK - I suspect and am not sure how dvi_pup will get handled in the resultant diff, What do folks think of the following?
A quick review of all my old xM schematics i have access to and the ones on https://github.com/CircuitCo/
For the "dvi_pup" function
GPIO_170 was only used on the pre-production xM's P8/P9, i doubt any of them still operate (mine died)..
It was then switched to GPIO_129 for the xMA, however there where MMC issues, so it was changed for xMA1 (and thus xMA2) notes, top of this: https://github.com/CircuitCo/BeagleBoard-xM-RevC/blob/master/BeagleBoard-xM_...
TPS_GPIO_2: was then used on xMA3 -> and all later generations...
So also looking at: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/ar...
Looks like the original beagle needs GPIO_170..
So I'd just set GPIO_170 for:
case REVISION_AXBX: case REVISION_CX: case REVISION_C4:
and ignore all the pre-production xM P8/P8's/xMA..
Side note, I think 'first' customers just got the xMA2 and newer.. As i was one of the first, and it's still running downstairs..
ok, here is how the code looks like with the V2 of my series:
Do we just default to none for XM_AB for dvi_pup?
static void beagle_dvi_pup(void) { uchar val;
switch (get_board_revision()) { case REVISION_AXBX: case REVISION_CX: case REVISION_C4: case REVISION_XM_AB: gpio_request(170, ""); gpio_direction_output(170, 0); gpio_set_value(170, 1); break; case REVISION_XM_C: default: #define GPIODATADIR1 (TWL4030_BASEADD_GPIO+3) #define GPIODATAOUT1 (TWL4030_BASEADD_GPIO+6) i2c_read(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1); val |= 4; i2c_write(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1); i2c_read(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1); val |= 4; i2c_write(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1); break; }
}
I'd do it like this, as...
On the xMA, xMA1, & xMA2: TPS_GPIO2 is not connected to anything... xMA3->xMC: TPS_GPIO2 is connected to dvi_pup
static void beagle_dvi_pup(void) { uchar val;
switch (get_board_revision()) { case REVISION_AXBX: case REVISION_CX: case REVISION_C4: gpio_request(170, ""); gpio_direction_output(170, 0); gpio_set_value(170, 1); break; case REVISION_XM_AB: case REVISION_XM_C: default: #define GPIODATADIR1 (TWL4030_BASEADD_GPIO+3) #define GPIODATAOUT1 (TWL4030_BASEADD_GPIO+6)
i2c_read(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1); val |= 4; i2c_write(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1);
i2c_read(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1); val |= 4; i2c_write(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1); break; } }
Regards,

On 08:32-20130712, Robert Nelson wrote:
On Thu, Jul 11, 2013 at 11:06 PM, Nishanth Menon nm@ti.com wrote:
ok, here is how the code looks like with the V2 of my series:
Do we just default to none for XM_AB for dvi_pup?
static void beagle_dvi_pup(void) { uchar val;
switch (get_board_revision()) { case REVISION_AXBX: case REVISION_CX: case REVISION_C4: case REVISION_XM_AB: gpio_request(170, ""); gpio_direction_output(170, 0); gpio_set_value(170, 1); break; case REVISION_XM_C: default: #define GPIODATADIR1 (TWL4030_BASEADD_GPIO+3) #define GPIODATAOUT1 (TWL4030_BASEADD_GPIO+6) i2c_read(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1); val |= 4; i2c_write(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1); i2c_read(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1); val |= 4; i2c_write(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1); break; }
}
I'd do it like this, as...
On the xMA, xMA1, & xMA2: TPS_GPIO2 is not connected to anything... xMA3->xMC: TPS_GPIO2 is connected to dvi_pup
static void beagle_dvi_pup(void) { uchar val;
switch (get_board_revision()) { case REVISION_AXBX: case REVISION_CX: case REVISION_C4: gpio_request(170, ""); gpio_direction_output(170, 0); gpio_set_value(170, 1); break; case REVISION_XM_AB: case REVISION_XM_C: default: #define GPIODATADIR1 (TWL4030_BASEADD_GPIO+3) #define GPIODATAOUT1 (TWL4030_BASEADD_GPIO+6) i2c_read(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1); val |= 4; i2c_write(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1); i2c_read(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1); val |= 4; i2c_write(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1); break; }
}
Thanks for the review. sounds good. I will update http://patchwork.ozlabs.org/patch/258634/ accordingly for a rev3.
Will wait till Monday before posting a new series to accommodate any further comments.

If no other bootoption works, try loading up device tree and zImage.
This is selected as the last option to allow backward compatibility as well as support the recent trend in moving kernel boot to using zImage and device tree.
NOTE: if uImage is present in bootpart, it will try this first and will assume this is to be booted with bootm (so may be concatenated image or plain vanilla ATAG MACHINE_ID based image)
Signed-off-by: Nishanth Menon nm@ti.com --- include/configs/omap3_beagle.h | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h index 7833208..3c0b059 100644 --- a/include/configs/omap3_beagle.h +++ b/include/configs/omap3_beagle.h @@ -284,6 +284,9 @@ "mmcboot=echo Booting from mmc ...; " \ "run mmcargs; " \ "bootm ${loadaddr}\0" \ + "mmcbootz=echo Booting with DT from mmc${mmcdev} ...; " \ + "run mmcargs; " \ + "bootz ${loadaddr} - ${fdtaddr}\0" \ "nandboot=echo Booting from nand ...; " \ "run nandargs; " \ "nand read ${loadaddr} 280000 400000; " \ @@ -318,6 +321,11 @@ "fi;" \ "fi;" \ "run nandboot;" \ + "setenv bootfile zImage;" \ + "if run loadimage; then " \ + "run loadfdt;" \ + "run mmcbootz; " \ + "fi; " \
#define CONFIG_AUTO_COMPLETE 1 /*
participants (5)
-
Joel Fernandes
-
Koen Kooi
-
Nishanth Menon
-
Robert Nelson
-
Tom Rini