Skip to contentSkip to conversation

omap3: Derive config for Beagleboard-XM sans NAND support

PATCH New Sanjeev Premi 2 participants 3 messages Jan 5, 2014 – Feb 1, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omap3: Derive config for Beagleboard-XM sans NAND support

Beagleboard XM doesn't have a NAND chip.
Let the configuration reflect so.

---

Patch was created and tested against:
183acb70: Prepare v2013.10

Forward ported to latest master for submission.

 Difference in binary sizes:   MLO     u-boot.img
   Before                      47932   337784
   After                       44676   277700
 boards.cfg                     |  1 +
 include/configs/omap3_beagle.h | 23 +++++++++++++++++++++--
 2 files changed, 22 insertions(+), 2 deletions(-)
boards.cfg +1 -0
index c602a16..3a6fb87 100644
@@ -332,6 +332,7 @@ Active  arm         armv7          omap3       technexion      twister
 Active  arm         armv7          omap3       teejet          mt_ventoux          mt_ventoux                           -                                                                                                                                 Stefano Babic <[email protected]>
 Active  arm         armv7          omap3       ti              am3517crane         am3517_crane                         -                                                                                                                                 Nagendra T S  <[email protected]>
 Active  arm         armv7          omap3       ti              beagle              omap3_beagle                         -                                                                                                                                 Tom Rini <[email protected]>
+Active  arm         armv7          omap3       ti              beagle              omap3_beagle_xm                      omap3_beagle:BEAGLE_XM                                                                                                            Tom Rini <[email protected]>
 Active  arm         armv7          omap3       ti              evm                 omap3_evm                            -                                                                                                                                 Tom Rini <[email protected]>
 Active  arm         armv7          omap3       ti              evm                 omap3_evm_quick_mmc                  -                                                                                                                                 -
 Active  arm         armv7          omap3       ti              evm                 omap3_evm_quick_nand                 -                                                                                                                                 -
include/configs/omap3_beagle.h +21 -2
index 3acb854..51f9cfd 100644
@@ -129,21 +129,31 @@
 
 #define CONFIG_CMD_ASKENV
 
+#ifdef CONFIG_BEAGLE_XM
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV	0
+#else
+#define CONFIG_ENV_IS_IN_NAND
+#endif	/* CONFIG_BEAGLE_XM */
+
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_EXT2		/* EXT2 Support			*/
 #define CONFIG_CMD_FAT		/* FAT support			*/
 #define CONFIG_CMD_FS_GENERIC	/* Generic FS support */
+
+#ifndef CONFIG_BEAGLE_XM
 #define CONFIG_CMD_MTDPARTS	/* Enable MTD parts commands */
 #define CONFIG_MTD_DEVICE	/* needed for mtdparts commands */
 #define MTDIDS_DEFAULT			"nand0=nand"
 #define MTDPARTS_DEFAULT		"mtdparts=nand:512k(x-loader),"\
 					"1920k(u-boot),128k(u-boot-env),"\
 					"4m(kernel),-(fs)"
+#define CONFIG_CMD_NAND		/* NAND support			*/
+#endif	/* CONFIG_BEAGLE_XM */
 
 #define CONFIG_CMD_I2C		/* I2C serial bus support	*/
 #define CONFIG_CMD_MMC		/* MMC support			*/
 #define CONFIG_USB_STORAGE	/* USB storage support		*/
-#define CONFIG_CMD_NAND		/* NAND support			*/
 #define CONFIG_CMD_LED		/* LED support			*/
 #define CONFIG_CMD_NET      /* bootp, tftpboot, rarpboot    */
 #define CONFIG_CMD_NFS      /* NFS support          */
@@ -173,6 +183,7 @@
 /*
  * Board NAND Info.
  */
+#ifndef CONFIG_BEAGLE_XM
 #define CONFIG_SYS_NAND_QUIET_TEST	1
 #define CONFIG_NAND_OMAP_GPMC
 #define CONFIG_SYS_NAND_ADDR		NAND_BASE	/* physical address */
@@ -184,6 +195,7 @@
 
 #define CONFIG_SYS_MAX_NAND_DEVICE	1		/* Max number of NAND */
 							/* devices */
+#endif	/* CONFIG_BEAGLE_XM */
 
 /* Environment information */
 #define CONFIG_BOOTDELAY		3
@@ -351,6 +363,7 @@
 
 /* **** PISMO SUPPORT *** */
 
+#ifndef CONFIG_BEAGLE_XM
 /* Configure the PISMO */
 #define PISMO1_NAND_SIZE		GPMC_SIZE_128M
 #define PISMO1_ONEN_SIZE		GPMC_SIZE_128M
@@ -365,13 +378,13 @@
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
 #define CONFIG_SYS_ONENAND_BASE		ONENAND_MAP
 
-#define CONFIG_ENV_IS_IN_NAND		1
 #define ONENAND_ENV_OFFSET		0x260000 /* environment starts here */
 #define SMNAND_ENV_OFFSET		0x260000 /* environment starts here */
 
 #define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
 #define CONFIG_ENV_OFFSET		SMNAND_ENV_OFFSET
 #define CONFIG_ENV_ADDR			SMNAND_ENV_OFFSET
+#endif	/* CONFIG_BEAGLE_XM */
 
 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
 #define CONFIG_SYS_INIT_RAM_ADDR	0x4020f800
@@ -408,16 +421,21 @@
 #define CONFIG_SPL_MMC_SUPPORT
 #define CONFIG_SPL_FAT_SUPPORT
 #define CONFIG_SPL_SERIAL_SUPPORT
+
+#ifndef CONFIG_BEAGLE_XM
 #define CONFIG_SPL_NAND_SUPPORT
 #define CONFIG_SPL_NAND_BASE
 #define CONFIG_SPL_NAND_DRIVERS
 #define CONFIG_SPL_NAND_ECC
+#endif	/* CONFIG_BEAGLE_XM */
+
 #define CONFIG_SPL_GPIO_SUPPORT
 #define CONFIG_SPL_POWER_SUPPORT
 #define CONFIG_SPL_OMAP3_ID_NAND
 #define CONFIG_SPL_LDSCRIPT		"$(CPUDIR)/omap-common/u-boot-spl.lds"
 
 /* NAND boot config */
+#ifndef CONFIG_BEAGLE_XM
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 #define CONFIG_SYS_NAND_PAGE_COUNT	64
 #define CONFIG_SYS_NAND_PAGE_SIZE	2048
@@ -431,6 +449,7 @@
 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_HAM1_CODE_HW
 #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x80000
+#endif	/* CONFIG_BEAGLE_XM */
 
 /*
  * 1MB into the SDRAM to allow for SPL's bss@the beginning of SDRAM
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 omap3: Derive config for Beagleboard-XM sans NAND support

Quoted 5 lines · Sanjeev Premi

Beagleboard XM doesn't have a NAND chip.
Let the configuration reflect so.

True, but why? And please note that:

include/configs/omap3_beagle.h line 137

Quoted 6 lines
include/configs/omap3_beagle.h +6 -0
+#ifdef CONFIG_BEAGLE_XM
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV	0
+#else
+#define CONFIG_ENV_IS_IN_NAND
+#endif	/* CONFIG_BEAGLE_XM */

Means that we'll be using part of the SD card for the stored environment so a 'saveenv' will start breaking peoples SD cards if they didn't re-partition them.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140106/fb3bd369/attachment.pgp>
#2 lore raw

PATCH 1/1 omap3: Derive config for Beagleboard-XM sans NAND support

Quoted 13 lines · Tom Rini
Quoted 8 lines · Sanjeev Premi

Beagleboard XM doesn't have a NAND chip.
Let the configuration reflect so.

True, but why?? And please note that:

Because there is no NAND on certain BeagleXM, but saveenv would result in:

OMAP3 beagleboard.org # saveenv
Saving Environment to NAND...
Erasing NAND...
Attempt to erase non block-aligned data
OMAP3 beagleboard.org #

Can be a problem when someone is working on mixed revisions of beagle boards esp. on a remote setup.

Quoted 11 lines
Quoted 7 lines

+#ifdef CONFIG_BEAGLE_XM
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV??? 0
+#else
+#define CONFIG_ENV_IS_IN_NAND
+#endif??? /* CONFIG_BEAGLE_XM */

Means that we'll be using part of the SD card for the stored environment so a 'saveenv' will start breaking peoples SD cards if they didn't re-partition them.

Understood. But today everyone is using and can continue to use omap3_beagle_config. But someone explicitly using BeagleXM and expect saveenv to work on BeagleXM, manual change won't be required with each U-Boot release.

~sanjeev

Quoted 5 lines
Signature · 2 lines
-- 
Tom