]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
sbc8548: reclaim wasted sector in boot flash
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Fri, 25 Sep 2009 15:14:11 +0000 (11:14 -0400)
committerKumar Gala <galak@kernel.crashing.org>
Wed, 30 Sep 2009 13:29:47 +0000 (08:29 -0500)
By nature of being based off the MPC8548CDS board, this
board inherited an ENV_SIZE setting of 256k.  But since
it has a smaller flash device (8MB soldered on), it has
a native sector size of 128k, and hence the ENV_SIZE was
causing 2 sectors to be used for the environment.

By removing the unused sector, we can push TEXT_BASE up
closer to the end of address space and reclaim that
sector for any other application.  This also fixes the
mismatch between TEXT_BASE and MONITOR_LEN reported by
Kumar earlier.

Since this board also supports the ability to boot off
the 64MB SODIMM flash, this change is forward looking
with that in mind; i.e. the settings for MONITOR_LEN
and ENV_SIZE will work when the 512k sectors of the
SODIMM flash are used for alternate boot in the future.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
board/sbc8548/config.mk
doc/README.sbc8548
include/configs/sbc8548.h

index 440d6502ab1fc943f013c4a9a441e07ec149a410..b2013d66791e1b41f9713505d328695d27d6a255 100644 (file)
@@ -24,5 +24,5 @@
 # sbc8548 board
 #
 ifndef TEXT_BASE
-TEXT_BASE = 0xfff80000
+TEXT_BASE = 0xfffa0000
 endif
index d72d97d027e7d6a07d26115472b70de29a6be836..6cbe12f1f5848e18e1e67d91588a8ce611aeca8a 100644 (file)
@@ -63,6 +63,30 @@ a 33MHz PCI configuration is currently untested.)
     =>
 
 
+Updating U-boot with U-boot:
+============================
+
+Note that versions of u-boot up to and including 2009.08 had u-boot stored
+at 0xfff8_0000 -> 0xffff_ffff (512k).  Currently it is being stored from
+0xfffa_0000 -> 0xffff_ffff (384k).  If you use an old macro/script to
+update u-boot with u-boot and it uses the old address, you will render
+your board inoperable, and you will require JTAG recovery.
+
+The following steps list how to update with the current address:
+
+       tftp u-boot.bin
+       md 200000 10
+       protect off all
+       erase fffa0000 ffffffff
+       cp.b 200000 fffa0000 60000
+       md fffa0000 10
+       protect on all
+
+The "md" steps in the above are just a precautionary step that allow
+you to confirm the u-boot version that was downloaded, and then confirm
+that it was copied to flash.
+
+
 Hardware Reference:
 ===================
 
index d10792a22dab57d2d02843a0356e193234853050..aeac2dea3e491af4789954b44099d0348ec7441b 100644 (file)
 #define CONFIG_SYS_GBL_DATA_OFFSET     (CONFIG_SYS_INIT_RAM_END - CONFIG_SYS_GBL_DATA_SIZE)
 #define CONFIG_SYS_INIT_SP_OFFSET      CONFIG_SYS_GBL_DATA_OFFSET
 
-#define CONFIG_SYS_MONITOR_LEN         (256 * 1024) /* Reserve 256 kB for Mon */
+/*
+ * For soldered on flash, (128kB/sector) we use 2 sectors for u-boot and
+ * one for env+bootpg (TEXT_BASE=0xfffa_0000, 384kB total).  For SODIMM
+ * flash (512kB/sector) we use 1 sector for u-boot, and one for env+bootpg
+ * (TEXT_BASE=0xfff0_0000, 1MB total).  This dynamically sets the right
+ * thing for MONITOR_LEN in both cases.
+ */
+#define CONFIG_SYS_MONITOR_LEN         (~TEXT_BASE + 1)
 #define CONFIG_SYS_MALLOC_LEN          (128 * 1024)    /* Reserved for malloc */
 
 /* Serial Port */
  * Environment
  */
 #define CONFIG_ENV_IS_IN_FLASH 1
-#define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE + 0x40000)
-#define CONFIG_ENV_SECT_SIZE   0x40000 /* 256K(one sector) for env */
 #define CONFIG_ENV_SIZE                0x2000
+#if TEXT_BASE == 0xfff00000    /* Boot from 64MB SODIMM */
+#define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE + 0x80000)
+#define CONFIG_ENV_SECT_SIZE   0x80000 /* 512K(one sector) for env */
+#elif TEXT_BASE == 0xfffa0000  /* Boot from 8MB soldered flash */
+#define CONFIG_ENV_ADDR                (CONFIG_SYS_MONITOR_BASE + 0x40000)
+#define CONFIG_ENV_SECT_SIZE   0x20000 /* 128K(one sector) for env */
+#else
+#warning undefined environment size/location.
+#endif
 
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download */
 #define CONFIG_SYS_LOADS_BAUD_CHANGE   1       /* allow baudrate change */