summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/dts/armada-388-clearfog-u-boot.dtsi8
-rw-r--r--arch/arm/dts/kirkwood-km_kirkwood.dts22
-rw-r--r--arch/arm/include/asm/arch-mvebu/spi.h11
-rw-r--r--arch/arm/mach-kirkwood/Kconfig9
-rw-r--r--arch/arm/mach-mvebu/Kconfig5
-rw-r--r--arch/arm/mach-mvebu/Makefile3
-rw-r--r--arch/arm/mach-mvebu/cpu.c4
-rw-r--r--arch/arm/mach-mvebu/include/mach/cpu.h7
-rw-r--r--arch/arm/mach-mvebu/include/mach/soc.h2
-rw-r--r--arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.c26
-rw-r--r--arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.h4
-rw-r--r--arch/arm/mach-mvebu/spl.c8
12 files changed, 92 insertions, 17 deletions
diff --git a/arch/arm/dts/armada-388-clearfog-u-boot.dtsi b/arch/arm/dts/armada-388-clearfog-u-boot.dtsi
index a12694e171..cf6c08881b 100644
--- a/arch/arm/dts/armada-388-clearfog-u-boot.dtsi
+++ b/arch/arm/dts/armada-388-clearfog-u-boot.dtsi
@@ -11,3 +11,11 @@
&sdhci {
u-boot,dm-spl;
};
+
+&ahci0 {
+ u-boot,dm-spl;
+};
+
+&ahci1 {
+ u-boot,dm-spl;
+};
diff --git a/arch/arm/dts/kirkwood-km_kirkwood.dts b/arch/arm/dts/kirkwood-km_kirkwood.dts
index f035eff1c1..b2c0209f5d 100644
--- a/arch/arm/dts/kirkwood-km_kirkwood.dts
+++ b/arch/arm/dts/kirkwood-km_kirkwood.dts
@@ -13,6 +13,10 @@
device_type = "memory";
reg = <0x00000000 0x08000000>;
};
+
+ aliases {
+ spi0 = &spi0;
+ };
};
&mdio {
@@ -29,3 +33,21 @@
phy-handle = <&ethphy0>;
};
};
+
+&spi0 {
+ status = "okay";
+
+ flash@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "st,m25p80", "jedec,spi-nor", "spi-flash";
+ reg = <0>;
+ spi-max-frequency = <33000000>;
+ mode = <3>;
+
+ partition@uboot {
+ reg = <0x000000 0x0c0000>;
+ label = "uboot";
+ };
+ };
+};
diff --git a/arch/arm/include/asm/arch-mvebu/spi.h b/arch/arm/include/asm/arch-mvebu/spi.h
index d6f6d1ac57..58b6c32c4d 100644
--- a/arch/arm/include/asm/arch-mvebu/spi.h
+++ b/arch/arm/include/asm/arch-mvebu/spi.h
@@ -23,17 +23,6 @@ struct kwspi_registers {
u32 dw_cfg; /* 0x10620 - Direct Write Configuration */
};
-/* They are used to define CONFIG_SYS_KW_SPI_MPP
- * each of the below #defines selects which mpp is
- * configured for each SPI signal in spi_claim_bus
- * bit 0: selects pin for MOSI (MPP1 if 0, MPP6 if 1)
- * bit 1: selects pin for SCK (MPP2 if 0, MPP10 if 1)
- * bit 2: selects pin for MISO (MPP3 if 0, MPP11 if 1)
- */
-#define MOSI_MPP6 (1 << 0)
-#define SCK_MPP10 (1 << 1)
-#define MISO_MPP11 (1 << 2)
-
/* Control Register */
#define KWSPI_CSN_ACT (1 << 0) /* Activates serial memory interface */
#define KWSPI_SMEMRDY (1 << 1) /* SerMem Data xfer ready */
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 7c4170399a..2f68092f82 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -32,11 +32,8 @@ config TARGET_ICONNECT
bool "iconnect Board"
config TARGET_KM_KIRKWOOD
- bool "KM_KIRKWOOD Board"
- select BOARD_LATE_INIT
- imply CMD_CRAMFS
- imply CMD_DIAG
- imply FS_CRAMFS
+ bool "KM Kirkwood Board"
+ select VENDOR_KM
config TARGET_NET2BIG_V2
bool "LaCie 2Big Network v2 NAS Board"
@@ -82,7 +79,7 @@ source "board/buffalo/lsxl/Kconfig"
source "board/cloudengines/pogo_e02/Kconfig"
source "board/d-link/dns325/Kconfig"
source "board/iomega/iconnect/Kconfig"
-source "board/keymile/km_arm/Kconfig"
+source "board/keymile/Kconfig"
source "board/LaCie/net2big_v2/Kconfig"
source "board/LaCie/netspace_v2/Kconfig"
source "board/raidsonic/ib62x0/Kconfig"
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index 495c48e6c7..fdd39685b7 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -239,6 +239,11 @@ config MVEBU_SPL_BOOT_DEVICE_MMC
bool "SDIO/MMC card"
select SPL_LIBDISK_SUPPORT
+config MVEBU_SPL_BOOT_DEVICE_SATA
+ bool "SATA"
+ select SPL_SATA_SUPPORT
+ select SPL_LIBDISK_SUPPORT
+
config MVEBU_SPL_BOOT_DEVICE_UART
bool "UART"
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
index 02d3ce27ee..8228a17972 100644
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
@@ -37,6 +37,9 @@ endif
ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC),)
KWB_CFG_BOOT_FROM=sdio
endif
+ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA),)
+ KWB_CFG_BOOT_FROM=sata
+endif
ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_UART),)
KWB_CFG_BOOT_FROM=uart
endif
diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c
index f09e7b10e9..f4b7a4fa80 100644
--- a/arch/arm/mach-mvebu/cpu.c
+++ b/arch/arm/mach-mvebu/cpu.c
@@ -542,6 +542,10 @@ static void ahci_mvebu_mbus_config(void __iomem *base)
const struct mbus_dram_target_info *dram;
int i;
+ /* mbus is not initialized in SPL; keep the ROM settings */
+ if (IS_ENABLED(CONFIG_SPL_BUILD))
+ return;
+
dram = mvebu_mbus_dram_info();
for (i = 0; i < 4; i++) {
diff --git a/arch/arm/mach-mvebu/include/mach/cpu.h b/arch/arm/mach-mvebu/include/mach/cpu.h
index e6140d6729..2e2d72aac8 100644
--- a/arch/arm/mach-mvebu/include/mach/cpu.h
+++ b/arch/arm/mach-mvebu/include/mach/cpu.h
@@ -163,6 +163,13 @@ int serdes_phy_config(void);
*/
int ddr3_init(void);
+/* Auto Voltage Scaling */
+#if defined(CONFIG_ARMADA_38X) || defined(CONFIG_ARMADA_39X)
+void mv_avs_init(void);
+#else
+static inline void mv_avs_init(void) {}
+#endif
+
/*
* get_ref_clk
*
diff --git a/arch/arm/mach-mvebu/include/mach/soc.h b/arch/arm/mach-mvebu/include/mach/soc.h
index f666ee2424..acb9257c90 100644
--- a/arch/arm/mach-mvebu/include/mach/soc.h
+++ b/arch/arm/mach-mvebu/include/mach/soc.h
@@ -159,7 +159,9 @@
#define BOOT_DEV_SEL_MASK (0x3f << BOOT_DEV_SEL_OFFS)
#define BOOT_FROM_NAND 0x0A
+#define BOOT_FROM_SATA 0x22
#define BOOT_FROM_UART 0x28
+#define BOOT_FROM_SATA_ALT 0x2A
#define BOOT_FROM_UART_ALT 0x3f
#define BOOT_FROM_SPI 0x32
#define BOOT_FROM_MMC 0x30
diff --git a/arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.c b/arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.c
index d387893af3..e9dd096ad0 100644
--- a/arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.c
+++ b/arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.c
@@ -256,3 +256,29 @@ u8 sys_env_device_rev_get(void)
value = reg_read(DEV_VERSION_ID_REG);
return (value & (REVISON_ID_MASK)) >> REVISON_ID_OFFS;
}
+
+void mv_avs_init(void)
+{
+ u32 sar_freq;
+
+ if (!(IS_ENABLED(CONFIG_ARMADA_38X) || IS_ENABLED(CONFIG_ARMADA_39X)))
+ return;
+
+ reg_write(AVS_DEBUG_CNTR_REG, AVS_DEBUG_CNTR_DEFAULT_VALUE);
+ reg_write(AVS_DEBUG_CNTR_REG, AVS_DEBUG_CNTR_DEFAULT_VALUE);
+
+ sar_freq = reg_read(DEVICE_SAMPLE_AT_RESET1_REG);
+ sar_freq = sar_freq >> SAR_FREQ_OFFSET & SAR_FREQ_MASK;
+
+ /* Set AVS value only for core frequency of 1600MHz or less.
+ * For higher frequency leave the default value.
+ */
+ if (sar_freq <= 0xd) {
+ u32 avs_reg_data = reg_read(AVS_ENABLED_CONTROL);
+
+ avs_reg_data &= ~(AVS_LOW_VDD_LIMIT_MASK
+ | AVS_HIGH_VDD_LIMIT_MASK);
+ avs_reg_data |= AVS_LOW_VDD_SLOW_VAL | AVS_HIGH_VDD_SLOW_VAL;
+ reg_write(AVS_ENABLED_CONTROL, avs_reg_data);
+ }
+}
diff --git a/arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.h b/arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.h
index 365332d2b0..1774a5b780 100644
--- a/arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.h
+++ b/arch/arm/mach-mvebu/serdes/a38x/sys_env_lib.h
@@ -33,6 +33,8 @@
#define DEV_ID_REG_DEVICE_ID_OFFS 16
#define DEV_ID_REG_DEVICE_ID_MASK 0xffff0000
+#define SAR_FREQ_OFFSET 10
+#define SAR_FREQ_MASK 0x1f
#define SAR_DEV_ID_OFFS 27
#define SAR_DEV_ID_MASK 0x7
@@ -155,10 +157,12 @@
#define AVS_LOW_VDD_LIMIT_OFFS 4
#define AVS_LOW_VDD_LIMIT_MASK (0xff << AVS_LOW_VDD_LIMIT_OFFS)
#define AVS_LOW_VDD_LIMIT_VAL (0x27 << AVS_LOW_VDD_LIMIT_OFFS)
+#define AVS_LOW_VDD_SLOW_VAL (0x23 << AVS_LOW_VDD_LIMIT_OFFS)
#define AVS_HIGH_VDD_LIMIT_OFFS 12
#define AVS_HIGH_VDD_LIMIT_MASK (0xff << AVS_HIGH_VDD_LIMIT_OFFS)
#define AVS_HIGH_VDD_LIMIT_VAL (0x27 << AVS_HIGH_VDD_LIMIT_OFFS)
+#define AVS_HIGH_VDD_SLOW_VAL (0x23 << AVS_HIGH_VDD_LIMIT_OFFS)
/* Board ID numbers */
#define MARVELL_BOARD_ID_MASK 0x10
diff --git a/arch/arm/mach-mvebu/spl.c b/arch/arm/mach-mvebu/spl.c
index 530b98c1aa..3cb27b7f4b 100644
--- a/arch/arm/mach-mvebu/spl.c
+++ b/arch/arm/mach-mvebu/spl.c
@@ -59,6 +59,11 @@ static u32 get_boot_device(void)
case BOOT_FROM_UART_ALT:
#endif
return BOOT_DEVICE_UART;
+#ifdef BOOT_FROM_SATA
+ case BOOT_FROM_SATA:
+ case BOOT_FROM_SATA_ALT:
+ return BOOT_DEVICE_SATA;
+#endif
case BOOT_FROM_SPI:
default:
return BOOT_DEVICE_SPI;
@@ -121,6 +126,9 @@ void board_init_f(ulong dummy)
ddr3_init();
#endif
+ /* Initialize Auto Voltage Scaling */
+ mv_avs_init();
+
/*
* Return to the BootROM to continue the Marvell xmodem
* UART boot protocol. As initiated by the kwboot tool.