diff options
author | Jeremy Laine <jeremy.laine@m4x.org> | 2008-09-17 13:15:56 +0000 |
---|---|---|
committer | Jeremy Laine <jeremy.laine@m4x.org> | 2008-09-17 13:15:56 +0000 |
commit | 1be23a85a9044ac34ebd07d561b8029d0764f916 (patch) | |
tree | e0d511043a58985c14a16b96a48d08b741ea5648 /packages/u-boot/u-boot-1.3.2/mpc8313e-rdb-spi.patch | |
parent | d4e452b6d6fafe058a84e7623893537536dc2695 (diff) |
u-boot: add SPI, EEPROM and DTT support for mpc8313e-rdb
Diffstat (limited to 'packages/u-boot/u-boot-1.3.2/mpc8313e-rdb-spi.patch')
-rw-r--r-- | packages/u-boot/u-boot-1.3.2/mpc8313e-rdb-spi.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/packages/u-boot/u-boot-1.3.2/mpc8313e-rdb-spi.patch b/packages/u-boot/u-boot-1.3.2/mpc8313e-rdb-spi.patch new file mode 100644 index 0000000000..039996c7f3 --- /dev/null +++ b/packages/u-boot/u-boot-1.3.2/mpc8313e-rdb-spi.patch @@ -0,0 +1,70 @@ +Index: u-boot-1.3.2/board/freescale/mpc8313erdb/mpc8313erdb.c +=================================================================== +--- u-boot-1.3.2.orig/board/freescale/mpc8313erdb/mpc8313erdb.c 2008-09-12 18:48:23.000000000 +0200 ++++ u-boot-1.3.2/board/freescale/mpc8313erdb/mpc8313erdb.c 2008-09-12 18:50:10.000000000 +0200 +@@ -28,6 +28,7 @@ + #endif + #include <pci.h> + #include <mpc83xx.h> ++#include <spi.h> + + DECLARE_GLOBAL_DATA_PTR; + +@@ -107,3 +108,33 @@ + #endif + } + #endif ++ ++ ++/* ++ * The following are used to control the SPI chip selects for the SPI command. ++ */ ++#ifdef CONFIG_HARD_SPI ++ ++#define SPI_CS_MASK 0x80000000 ++ ++void spi_eeprom_chipsel(int cs) ++{ ++ volatile gpio83xx_t *iopd = &((immap_t *)CFG_IMMR)->gpio[0]; ++ ++ if (cs) ++ iopd->dat &= ~SPI_CS_MASK; ++ else ++ iopd->dat |= SPI_CS_MASK; ++} ++ ++/* ++ * The SPI command uses this table of functions for controlling the SPI ++ * chip selects. ++ */ ++spi_chipsel_type spi_chipsel[] = { ++ spi_eeprom_chipsel, ++}; ++int spi_chipsel_cnt = sizeof(spi_chipsel) / sizeof(spi_chipsel[0]); ++ ++#endif /* CONFIG_HARD_SPI */ ++ +Index: u-boot-1.3.2/include/configs/MPC8313ERDB.h +=================================================================== +--- u-boot-1.3.2.orig/include/configs/MPC8313ERDB.h 2008-09-12 18:50:09.000000000 +0200 ++++ u-boot-1.3.2/include/configs/MPC8313ERDB.h 2008-09-12 18:50:50.000000000 +0200 +@@ -359,6 +359,7 @@ + #define CONFIG_CMD_DATE + #define CONFIG_CMD_PCI + #define CONFIG_CMD_NAND ++#define CONFIG_CMD_SPI + + #if defined(CFG_RAMBOOT) + #undef CONFIG_CMD_ENV +@@ -367,6 +368,11 @@ + + #define CONFIG_CMDLINE_EDITING 1 + ++/* SPI */ ++#define CONFIG_MPC8XXX_SPI ++#define CONFIG_HARD_SPI /* SPI with hardware support */ ++#undef CONFIG_SOFT_SPI /* SPI bit-banged */ ++ + /* + * JFFS2 partitions (mtdparts command line support) + */ |