Patchwork [U-Boot,v2,3/7] am335x_evm: Update SPI_BOOT support, add MTDPARTS info

login
register
mail settings
Submitter Tom Rini
Date May 13, 2013, 6:28 p.m.
Message ID <1368469719-22406-3-git-send-email-trini@ti.com>
Download mbox | patch
Permalink /patch/243485/
State Changes Requested
Delegated to: Tom Rini
Headers show

Comments

Tom Rini - May 13, 2013, 6:28 p.m.
- Style cleanup (# define -> #define)
- Due to ROM issues, redudant loading isn't feasible, so drop.
- Given extra space, increase max size of U-Boot to 512KiB
- Correct env size to match usage (we had not re-defined ENV_SIZE).
- Given extra space, keep env size as 128KiB, add redundant environment.

Signed-off-by: Tom Rini <trini@ti.com>

---
Changes in v2:
- Correct physmap -> m25p80 in mtdparts (Peter K).
- Style fixups, drop redundant SPL space, add redundant environment.

Signed-off-by: Tom Rini <trini@ti.com>
---
 include/configs/am335x_evm.h |   33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)
Peter Korsgaard - May 15, 2013, 8:41 p.m.
>>>>> "Tom" == Tom Rini <trini@ti.com> writes:

 Tom> - Style cleanup (# define -> #define)
 Tom> - Due to ROM issues, redudant loading isn't feasible, so drop.
 Tom> - Given extra space, increase max size of U-Boot to 512KiB
 Tom> - Correct env size to match usage (we had not re-defined ENV_SIZE).
 Tom> - Given extra space, keep env size as 128KiB, add redundant environment.

 Tom> Signed-off-by: Tom Rini <trini@ti.com>

Reviewed-by: Peter Korsgaard <jacmet@sunsite.dk>

 Tom> ---
 Tom> Changes in v2:
 Tom> - Correct physmap -> m25p80 in mtdparts (Peter K).
 Tom> - Style fixups, drop redundant SPL space, add redundant environment.

 Tom> Signed-off-by: Tom Rini <trini@ti.com>

1 s-o-b is probably enough ;)

Patch

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 945ec09..15822b4 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -330,7 +330,7 @@ 
 #define CONFIG_SPL_SPI_LOAD
 #define CONFIG_SPL_SPI_BUS		0
 #define CONFIG_SPL_SPI_CS		0
-#define CONFIG_SYS_SPI_U_BOOT_OFFS	0x80000
+#define CONFIG_SYS_SPI_U_BOOT_OFFS	0x20000
 #define CONFIG_SPL_MUSB_NEW_SUPPORT
 #define CONFIG_SPL_LDSCRIPT		"$(CPUDIR)/am33xx/u-boot-spl.lds"
 
@@ -420,22 +420,27 @@ 
 #endif
 
 /*
- * Default to using SPI for environment, etc.  We have multiple copies
- * of SPL as the ROM will check these locations.
- * 0x0 - 0x20000 : First copy of SPL
- * 0x20000 - 0x40000 : Second copy of SPL
- * 0x40000 - 0x60000 : Third copy of SPL
- * 0x60000 - 0x80000 : Fourth copy of SPL
- * 0x80000 - 0xDF000 : U-Boot
- * 0xDF000 - 0xE0000 : U-Boot Environment
- * 0xE0000 - 0x442000 : Linux Kernel
+ * Default to using SPI for environment, etc.
+ * 0x000000 - 0x020000 : SPL (128KiB)
+ * 0x020000 - 0x0A0000 : U-Boot (512KiB)
+ * 0x0A0000 - 0x0BFFFF : First copy of U-Boot Environment (128KiB)
+ * 0x0C0000 - 0x0DFFFF : Second copy of U-Boot Environment (128KiB)
+ * 0x0E0000 - 0x442000 : Linux Kernel
  * 0x442000 - 0x800000 : Userland
  */
 #if defined(CONFIG_SPI_BOOT)
-# define CONFIG_ENV_IS_IN_SPI_FLASH
-# define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
-# define CONFIG_ENV_OFFSET		(892 << 10) /* 892 KiB in */
-# define CONFIG_ENV_SECT_SIZE		(4 << 10) /* 4 KB sectors */
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+#define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
+#define CONFIG_ENV_SECT_SIZE		(4 << 10) /* 4 KB sectors */
+#define CONFIG_ENV_OFFSET		(768 << 10) /* 768 KiB in */
+#define CONFIG_ENV_OFFSET_REDUND	(896 << 10) /* 896 KiB in */
+#define CONFIG_CMD_MTDPARTS
+#define MTDIDS_DEFAULT			"nor0=m25p80-flash.0"
+#define MTDPARTS_DEFAULT		"mtdparts=m25p80-flash.0:128k(SPL)," \
+					"512k(u-boot),128k(u-boot-env1)," \
+					"128k(u-boot-env2),3464k(kernel)," \
+					"-(rootfs)"
 #endif /* SPI support */
 
 /* Unsupported features */