summaryrefslogtreecommitdiff
path: root/include/configs/km
diff options
context:
space:
mode:
authorHolger Brunck <holger.brunck@keymile.com>2012-07-05 05:37:46 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-07-07 14:07:36 +0200
commit8170aefc84b04af1e5bd217b04aef81a047f8d28 (patch)
tree8d6519d049658c4bd45108269717995eef408c0f /include/configs/km
parentfa042186b932e9b9ee9a2fd8a04a3acf7c70d224 (diff)
downloadu-boot-imx-8170aefc84b04af1e5bd217b04aef81a047f8d28.zip
u-boot-imx-8170aefc84b04af1e5bd217b04aef81a047f8d28.tar.gz
u-boot-imx-8170aefc84b04af1e5bd217b04aef81a047f8d28.tar.bz2
arm/km: add kmnusa board support
This board is similar to portl2, but it has the u-boot environment in a SPI NOR flash and not in an i2c eeprom like portl2 have. Some other details: - IVM EEPROM is at adress: pca9547:70:9 - PCI is enabled - PIGGY4 is connected via MV88E6352 simple switch. There is no phy between the simple switch and the kirkwood. Signed-off-by: Holger Brunck <holger.brunck@keymile.com> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com> cc: Gerlando Falauto <gerlando.falauto@keymile.com> cc: Prafulla Wadaskar <prafulla@marvell.com>
Diffstat (limited to 'include/configs/km')
-rw-r--r--include/configs/km/km_arm.h44
1 files changed, 35 insertions, 9 deletions
diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h
index b14093f..60e2450 100644
--- a/include/configs/km/km_arm.h
+++ b/include/configs/km/km_arm.h
@@ -57,6 +57,13 @@
#define CONFIG_CMD_SF
#define CONFIG_SOFT_I2C /* I2C bit-banged */
+#if defined CONFIG_KM_ENV_IS_IN_SPI_NOR
+#define CONFIG_ENV_SPI_BUS 0
+#define CONFIG_ENV_SPI_CS 0
+#define CONFIG_ENV_SPI_MAX_HZ 5000000
+#define CONFIG_ENV_SPI_MODE SPI_MODE_3
+#endif
+
#include "asm/arch/config.h"
#define CONFIG_SYS_TEXT_BASE 0x07d00000 /* code address before reloc */
@@ -211,6 +218,15 @@ int get_scl(void);
/*
* Environment variables configurations
*/
+#if defined CONFIG_KM_ENV_IS_IN_SPI_NOR
+#define CONFIG_ENV_IS_IN_SPI_FLASH /* use SPI-Flash for environment vars */
+#define CONFIG_ENV_OFFSET 0xc0000 /* no bracets! */
+#define CONFIG_ENV_SIZE 0x02000 /* Size of Environment */
+#define CONFIG_ENV_SECT_SIZE 0x10000
+#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + \
+ CONFIG_ENV_SECT_SIZE)
+#define CONFIG_ENV_TOTAL_SIZE 0x20000 /* no bracets! */
+#else
#define CONFIG_ENV_IS_IN_EEPROM /* use EEPROM for environment vars */
#define CONFIG_SYS_DEF_EEPROM_ADDR 0x50
#define CONFIG_ENV_EEPROM_IS_ON_I2C
@@ -218,11 +234,11 @@ int get_scl(void);
#define CONFIG_ENV_OFFSET 0x0 /* no bracets! */
#define CONFIG_ENV_SIZE (0x2000 - CONFIG_ENV_OFFSET)
#define CONFIG_I2C_ENV_EEPROM_BUS KM_ENV_BUS "\0"
-
-/* offset redund: (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) */
-#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
#define CONFIG_ENV_OFFSET_REDUND 0x2000 /* no bracets! */
#define CONFIG_ENV_SIZE_REDUND (CONFIG_ENV_SIZE)
+#endif
+
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
#define CONFIG_SPI_FLASH
#define CONFIG_SPI_FLASH_STMICRO
@@ -248,17 +264,27 @@ int get_scl(void);
"sf probe 0;sf erase 0 +${filesize};" \
"sf write ${load_addr_r} 0 ${filesize};\0"
-/*
- * Default environment variables
- */
-#define CONFIG_EXTRA_ENV_SETTINGS \
- CONFIG_KM_DEF_ENV \
+#if defined CONFIG_KM_ENV_IS_IN_SPI_NOR
+#define CONFIG_KM_NEW_ENV \
+ "newenv=sf probe 0;" \
+ "sf erase " xstr(CONFIG_ENV_OFFSET) " " \
+ xstr(CONFIG_ENV_TOTAL_SIZE)"\0"
+#else
+#define CONFIG_KM_NEW_ENV \
"newenv=setenv addr 0x100000 && " \
"i2c dev 1; mw.b ${addr} 0 4 && " \
"eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR) \
" ${addr} " xstr(CONFIG_ENV_OFFSET) " 4 && " \
"eeprom write " xstr(CONFIG_SYS_DEF_EEPROM_ADDR) \
- " ${addr} " xstr(CONFIG_ENV_OFFSET_REDUND) " 4\0" \
+ " ${addr} " xstr(CONFIG_ENV_OFFSET_REDUND) " 4\0"
+#endif
+
+/*
+ * Default environment variables
+ */
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ CONFIG_KM_DEF_ENV \
+ CONFIG_KM_NEW_ENV \
"arch=arm\0" \
"EEprom_ivm=" KM_IVM_BUS "\0" \
""