summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/dts/sun6i-a31-pangolin.dts7
-rw-r--r--board/sunxi/Kconfig34
-rw-r--r--configs/Pangolin_defconfig1
-rw-r--r--include/configs/sun6i.h5
-rw-r--r--include/configs/sunxi-common.h18
5 files changed, 55 insertions, 10 deletions
diff --git a/arch/arm/dts/sun6i-a31-pangolin.dts b/arch/arm/dts/sun6i-a31-pangolin.dts
index 6dab44add7..21a5a1b97a 100644
--- a/arch/arm/dts/sun6i-a31-pangolin.dts
+++ b/arch/arm/dts/sun6i-a31-pangolin.dts
@@ -140,6 +140,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 5712dde822..a62f3e1113 100644
--- a/board/sunxi/Kconfig
+++ b/board/sunxi/Kconfig
@@ -163,6 +163,31 @@ config DRAM_TYPE
---help---
Set the dram type, 3: DDR3, 7: LPDDR3
+choice
+ prompt "Sunxi Board Variant"
+ optional
+
+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
+
config DRAM_CLK
int "sunxi dram clock speed"
default 792 if MACH_SUN9I
@@ -293,15 +318,6 @@ config SYS_CONFIG_NAME
default "sun9i" if MACH_SUN9I
default "sun50i" if MACH_SUN50I
-choice
- prompt "Sunxi Board Variant"
- optional
-
-config SUNXI_PANGOLIN
- bool "Theobroma A31 uQ7 Board"
-
-endchoice
-
config SYS_BOARD
default "sunxi"
diff --git a/configs/Pangolin_defconfig b/configs/Pangolin_defconfig
index e176151d40..21aec72d48 100644
--- a/configs/Pangolin_defconfig
+++ b/configs/Pangolin_defconfig
@@ -33,5 +33,6 @@ CONFIG_USB_KEYBOARD=y
CONFIG_DM_ETH=y
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 6c1eca4d26..49cf92df94 100644
--- a/include/configs/sun6i.h
+++ b/include/configs/sun6i.h
@@ -24,6 +24,11 @@
#define CONFIG_ARMV7_SECURE_BASE SUNXI_SRAM_B_BASE
#define CONFIG_ARMV7_SECURE_MAX_SIZE (64 * 1024) /* 64 KB */
+#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 59d52348b4..a05ddbd1b3 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -141,6 +141,23 @@
/* mmc config */
#ifdef CONFIG_MMC
#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 */
#define CONFIG_SYS_MMC_MAX_DEVICE 4
@@ -172,7 +189,6 @@
#define CONFIG_SYS_MONITOR_LEN (768 << 10) /* 768 KiB */
-#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 */