summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOctav Zlatior <octav.zlatior@theobroma-systems.com>2015-07-10 18:32:00 +0200
committerKlaus Goger <klaus.goger@theobroma-systems.com>2015-07-30 18:44:08 +0200
commit626f511f31d20d4e9e0555aad86574868c27312b (patch)
tree826a886016ecc41c33030fde2d8a0102dbaad359
parentbe8f25e447b2206f78f329af580f62727d18ae9a (diff)
ARM: sun6i: spiflash: enables M25 SPI flash
Signed-off-by: Octav Zlatior <octav.zlatior@theobroma-systems.com>
-rw-r--r--arch/arm/dts/sun6i-a31-pangolin.dts7
-rw-r--r--board/sunxi/Kconfig16
-rw-r--r--configs/Pangolin_defconfig1
-rw-r--r--include/configs/sun6i.h5
-rw-r--r--include/configs/sunxi-common.h18
5 files changed, 46 insertions, 1 deletions
diff --git a/arch/arm/dts/sun6i-a31-pangolin.dts b/arch/arm/dts/sun6i-a31-pangolin.dts
index b3c5c125ff..3b172858b5 100644
--- a/arch/arm/dts/sun6i-a31-pangolin.dts
+++ b/arch/arm/dts/sun6i-a31-pangolin.dts
@@ -138,6 +138,13 @@
&spi0 {
status = "okay";
+
+ flash: flash@0 {
+ compatible = "spansion,m25p40";
+ spi-max-frequency = <16000000>;
+ spi-cpol;
+ spi-cpha;
+ };
};
&spi1 {
diff --git a/board/sunxi/Kconfig b/board/sunxi/Kconfig
index 1b147b2c68..badde3aea0 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -85,6 +85,22 @@ choice
config SUNXI_PANGOLIN
bool "Theobroma A31 uQ7 Board"
+ select DM_SPI
+ select DM_SPI_FLASH
+ select CMD_SF
+
+endchoice
+
+choice
+ prompt "U-Boot environment location"
+ depends on SUNXI_PANGOLIN
+ default SUNXI_ENV_MMC
+
+config SUNXI_ENV_MMC
+ bool "MMC/SD-Card"
+
+config SUNXI_ENV_SPI
+ bool "SPI"
endchoice
diff --git a/configs/Pangolin_defconfig b/configs/Pangolin_defconfig
index 7e459c6647..889e4e3430 100644
--- a/configs/Pangolin_defconfig
+++ b/configs/Pangolin_defconfig
@@ -32,4 +32,5 @@ CONFIG_DM_ETH=y
CONFIG_CMD_IMLS=n
CONFIG_ETH_DESIGNWARE=y
CONFIG_DM_SPI=y
+CONFIG_DM_SPI_FLASH=y
CONFIG_SUNXI_SPI=y
diff --git a/include/configs/sun6i.h b/include/configs/sun6i.h
index 93863b59bc..3afbd54068 100644
--- a/include/configs/sun6i.h
+++ b/include/configs/sun6i.h
@@ -27,6 +27,11 @@
#define CONFIG_ARMV7_SECURE_BASE SUNXI_SRAM_B_BASE
#define CONFIG_TIMER_CLK_FREQ 24000000
+#ifdef CONFIG_SUNXI_PANGOLIN
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_STMICRO
+#endif
+
/*
* Include common sunxi configuration where most the settings are
*/
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 82d52bca39..5f6eb73455 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -146,6 +146,23 @@
#define CONFIG_CMD_MMC
#define CONFIG_MMC_SUNXI
#define CONFIG_MMC_SUNXI_SLOT 0
+#ifdef CONFIG_SUNXI_PANGOLIN
+#ifdef CONFIG_SUNXI_ENV_MMC
+#define CONFIG_ENV_IS_IN_MMC
+#define CONFIG_SYS_MMC_ENV_DEV 0 /* first detected MMC controller */
+#define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */
+#endif
+#ifdef CONFIG_SUNXI_ENV_SPI
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_SECT_SIZE (64 * 1024)
+#define CONFIG_ENV_SPI 0
+#define CONFIG_ENV_SPI_CS 0
+#define CONFIG_ENV_SPI_MAX_HZ 16000000
+#define CONFIG_ENV_OFFSET 0
+#endif
+#endif
+#else
+#define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */
#define CONFIG_ENV_IS_IN_MMC
#define CONFIG_SYS_MMC_ENV_DEV 0 /* first detected MMC controller */
#endif
@@ -180,7 +197,6 @@
#define CONFIG_SYS_MONITOR_LEN (512 << 10) /* 512 KiB */
#define CONFIG_IDENT_STRING " Allwinner Technology"
-#define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */
#define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
#define CONFIG_FAT_WRITE /* enable write access */