summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-07-07 22:58:18 -0400
committerTom Rini <trini@konsulko.com>2020-07-07 22:58:18 -0400
commit0b59138690a93f3d880be3d5aa675f7219376e58 (patch)
treeb139bf8d951a50c2196f3f36dc2f5ab2f3bb1cc7 /arch
parent1e88e78177da80fa8e9fa9fc7613657478d61d1e (diff)
parent9b9f10e3ccded02443162980d34be517886b0645 (diff)
Merge branch '2020-07-07-misc-new-features'
- Improve s700 SoC support - Fix building with clang on ARM. - Juno platform updates - fs/dm cmd improvements - Other assorted improvements / fixes
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/Kconfig3
-rw-r--r--arch/arm/dts/s700-u-boot.dtsi13
-rw-r--r--arch/arm/include/asm/arch-owl/regs_s700.h8
-rw-r--r--arch/arm/include/asm/arch-owl/regs_s900.h4
-rw-r--r--arch/arm/include/asm/global_data.h4
-rw-r--r--arch/arm/include/asm/system.h10
-rw-r--r--arch/arm/mach-owl/soc.c22
7 files changed, 54 insertions, 10 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 760e901364..f115fcdcc4 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -908,6 +908,7 @@ config ARCH_MX5
config ARCH_OWL
bool "Actions Semi OWL SoCs"
select DM
+ select DM_ETH
select DM_SERIAL
select OWL_SERIAL
select CLK
@@ -1179,7 +1180,7 @@ config TARGET_VEXPRESS64_JUNO
select DM_SERIAL
select ARM_PSCI_FW
select PSCI_RESET
- select DM
+ select DM_ETH
select BLK
select USB
select DM_USB
diff --git a/arch/arm/dts/s700-u-boot.dtsi b/arch/arm/dts/s700-u-boot.dtsi
index a527cccc75..1b2768272c 100644
--- a/arch/arm/dts/s700-u-boot.dtsi
+++ b/arch/arm/dts/s700-u-boot.dtsi
@@ -6,6 +6,19 @@
/{
soc {
u-boot,dm-pre-reloc;
+
+ gmac: ethernet@e0220000 {
+ compatible = "actions,s700-ethernet";
+ reg = <0 0xe0220000 0 0x2000>;
+ interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "macirq";
+ local-mac-address = [ 00 18 fe 66 66 66 ];
+ clocks = <&cmu CLK_ETHERNET>, <&cmu CLK_RMII_REF>;
+ clock-names = "ethernet", "rmii_ref";
+ phy-mode = "rmii";
+ status = "okay";
+ };
+
};
};
diff --git a/arch/arm/include/asm/arch-owl/regs_s700.h b/arch/arm/include/asm/arch-owl/regs_s700.h
index 2f21c15cca..0f79faec69 100644
--- a/arch/arm/include/asm/arch-owl/regs_s700.h
+++ b/arch/arm/include/asm/arch-owl/regs_s700.h
@@ -53,4 +53,12 @@
#define CMU_CVBSPLL 0x00B8
#define CMU_SSTSCLK 0x00C0
+#define CMU_DEVCLKEN1_ETH BIT(23)
+
+#define GPIO_MFP_PWM (0xE01B0000)
+#define MFP_CTL0 (GPIO_MFP_PWM + 0x40)
+#define MFP_CTL1 (GPIO_MFP_PWM + 0x44)
+#define MFP_CTL2 (GPIO_MFP_PWM + 0x48)
+#define MFP_CTL3 (GPIO_MFP_PWM + 0x4C)
+
#endif
diff --git a/arch/arm/include/asm/arch-owl/regs_s900.h b/arch/arm/include/asm/arch-owl/regs_s900.h
index 9e9106ddaa..084bc9b8c3 100644
--- a/arch/arm/include/asm/arch-owl/regs_s900.h
+++ b/arch/arm/include/asm/arch-owl/regs_s900.h
@@ -61,4 +61,8 @@
#define CMU_TVOUTPLLDEBUG0 (0x00EC)
#define CMU_TVOUTPLLDEBUG1 (0x00FC)
+#define CMU_DEVCLKEN1_ETH BIT(22)
+#define CLK_ETHERNET CLK_ETH_MAC
+#define CMU_ETHERNETPLL CMU_ASSISTPLL
+
#endif
diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h
index 7c0905d240..2aafc6d206 100644
--- a/arch/arm/include/asm/global_data.h
+++ b/arch/arm/include/asm/global_data.h
@@ -96,10 +96,6 @@ static inline gd_t *get_gd(void)
gd_t *gd_ptr;
#ifdef CONFIG_ARM64
- /*
- * Make will already error that reserving x18 is not supported at the
- * time of writing, clang: error: unknown argument: '-ffixed-x18'
- */
__asm__ volatile("mov %0, x18\n" : "=r" (gd_ptr));
#else
__asm__ volatile("mov %0, r9\n" : "=r" (gd_ptr));
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 7a40b56acd..b8c1b4ea74 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -133,14 +133,16 @@ enum dcache_option {
static inline unsigned int current_el(void)
{
- unsigned int el;
+ unsigned long el;
+
asm volatile("mrs %0, CurrentEL" : "=r" (el) : : "cc");
- return el >> 2;
+ return 3 & (el >> 2);
}
static inline unsigned int get_sctlr(void)
{
- unsigned int el, val;
+ unsigned int el;
+ unsigned long val;
el = current_el();
if (el == 1)
@@ -153,7 +155,7 @@ static inline unsigned int get_sctlr(void)
return val;
}
-static inline void set_sctlr(unsigned int val)
+static inline void set_sctlr(unsigned long val)
{
unsigned int el;
diff --git a/arch/arm/mach-owl/soc.c b/arch/arm/mach-owl/soc.c
index 7d3f6f6285..fd6ee7c1c0 100644
--- a/arch/arm/mach-owl/soc.c
+++ b/arch/arm/mach-owl/soc.c
@@ -15,14 +15,34 @@
#include <asm/mach-types.h>
#include <asm/psci.h>
+#define DMM_INTERLEAVE_PER_CH_CFG 0xe0290028
+
DECLARE_GLOBAL_DATA_PTR;
+unsigned int owl_get_ddrcap(void)
+{
+ unsigned int val, cap;
+
+ /* ddr capacity register initialized by ddr driver
+ * in early bootloader
+ */
+#if defined(CONFIG_MACH_S700)
+ val = (readl(DMM_INTERLEAVE_PER_CH_CFG) >> 8) & 0x7;
+ cap = (val + 1) * 256;
+#elif defined(CONFIG_MACH_S900)
+ val = (readl(DMM_INTERLEAVE_PER_CH_CFG) >> 8) & 0xf;
+ cap = 64 * (1 << val);
+#endif
+
+ return cap;
+}
+
/*
* dram_init - sets uboots idea of sdram size
*/
int dram_init(void)
{
- gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+ gd->ram_size = owl_get_ddrcap() * 1024 * 1024;
return 0;
}