diff options
author | Matthias Fuchs <matthias.fuchs@esd.eu> | 2012-01-18 01:33:09 +0000 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2012-02-27 21:19:22 +0100 |
commit | ed97abed27455b4f9e0dec6274976f5010258ed9 (patch) | |
tree | 589d5888f0048912246a21e8e6782e87c34782c4 /include/configs | |
parent | 598aa2bbfb5aeab43fbfb5ca63218daa9c425871 (diff) |
mx28evk: add SPI support
This patch adds SPI support for the MX28EVK. Support for
an optionally installed SPI flash is also added. An example
configuration for redundant envrionment from SPI flash is also
added but disabled by default.
This patch has been tested on a MX28EVK Rev. D with an installed
SST25VF032B 32Mbit SPI flash.
Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
Acked-by: Fabio Estevam <fabio.estevam@freescale.com>
Diffstat (limited to 'include/configs')
-rw-r--r-- | include/configs/mx28evk.h | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h index 8f791aa4847..04967d7d2c6 100644 --- a/include/configs/mx28evk.h +++ b/include/configs/mx28evk.h @@ -64,6 +64,8 @@ #define CONFIG_CMD_NET #define CONFIG_CMD_NFS #define CONFIG_CMD_PING +#define CONFIG_CMD_SF +#define CONFIG_CMD_SPI #define CONFIG_CMD_USB /* @@ -127,9 +129,11 @@ * MMC Driver */ #define CONFIG_ENV_IS_IN_MMC -#define CONFIG_ENV_OFFSET (256 * 1024) -#define CONFIG_ENV_SIZE (16 * 1024) -#define CONFIG_SYS_MMC_ENV_DEV 0 +#ifdef CONFIG_ENV_IS_IN_MMC + #define CONFIG_ENV_OFFSET (256 * 1024) + #define CONFIG_ENV_SIZE (16 * 1024) + #define CONFIG_SYS_MMC_ENV_DEV 0 +#endif #define CONFIG_CMD_SAVEENV #ifdef CONFIG_CMD_MMC #define CONFIG_MMC @@ -170,6 +174,40 @@ #endif /* + * SPI + */ +#ifdef CONFIG_CMD_SPI +#define CONFIG_HARD_SPI +#define CONFIG_MXS_SPI +#define CONFIG_SPI_HALF_DUPLEX +#define CONFIG_DEFAULT_SPI_BUS 2 +#define CONFIG_DEFAULT_SPI_MODE SPI_MODE_0 + +/* SPI Flash */ +#ifdef CONFIG_CMD_SF +#define CONFIG_SPI_FLASH +/* this may vary and depends on the installed chip */ +#define CONFIG_SPI_FLASH_SST +#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0 +#define CONFIG_SF_DEFAULT_SPEED 24000000 + +/* (redundant) environemnt in SPI flash */ +#undef CONFIG_ENV_IS_IN_SPI_FLASH +#ifdef CONFIG_ENV_IS_IN_SPI_FLASH +#define CONFIG_SYS_REDUNDAND_ENVIRONMENT +#define CONFIG_ENV_SIZE 0x1000 /* 4KB */ +#define CONFIG_ENV_OFFSET 0x40000 /* 256K */ +#define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) +#define CONFIG_ENV_SECT_SIZE 0x1000 +#define CONFIG_ENV_SPI_CS 0 +#define CONFIG_ENV_SPI_BUS 2 +#define CONFIG_ENV_SPI_MAX_HZ 24000000 +#define CONFIG_ENV_SPI_MODE SPI_MODE_0 +#endif +#endif +#endif + +/* * Boot Linux */ #define CONFIG_CMDLINE_TAG |