aboutsummaryrefslogtreecommitdiffstats
path: root/roms/u-boot/arch/arm/mach-owl
diff options
context:
space:
mode:
Diffstat (limited to 'roms/u-boot/arch/arm/mach-owl')
-rw-r--r--roms/u-boot/arch/arm/mach-owl/Kconfig27
-rw-r--r--roms/u-boot/arch/arm/mach-owl/Makefile4
-rw-r--r--roms/u-boot/arch/arm/mach-owl/soc.c80
-rw-r--r--roms/u-boot/arch/arm/mach-owl/sysmap-owl.c32
4 files changed, 143 insertions, 0 deletions
diff --git a/roms/u-boot/arch/arm/mach-owl/Kconfig b/roms/u-boot/arch/arm/mach-owl/Kconfig
new file mode 100644
index 000000000..cde2ade30
--- /dev/null
+++ b/roms/u-boot/arch/arm/mach-owl/Kconfig
@@ -0,0 +1,27 @@
+if ARCH_OWL
+
+choice
+ prompt "Actions Semi Owl SoC Variant"
+ optional
+
+config MACH_S900
+ bool "Actions Semi S900 SoC"
+ select ARM64
+
+config MACH_S700
+ bool "Actions Semi S700 SoC"
+ select ARM64
+
+endchoice
+
+config SYS_TEXT_BASE
+ default 0x11000000
+
+config SYS_CONFIG_NAME
+ default "owl-common"
+
+config SYS_SOC
+ default "s900" if MACH_S900
+ default "s700" if MACH_S700
+
+endif
diff --git a/roms/u-boot/arch/arm/mach-owl/Makefile b/roms/u-boot/arch/arm/mach-owl/Makefile
new file mode 100644
index 000000000..f3a69ebf1
--- /dev/null
+++ b/roms/u-boot/arch/arm/mach-owl/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+obj-y += soc.o
+obj-$(CONFIG_ARM64) += sysmap-owl.o
diff --git a/roms/u-boot/arch/arm/mach-owl/soc.c b/roms/u-boot/arch/arm/mach-owl/soc.c
new file mode 100644
index 000000000..4baef2eed
--- /dev/null
+++ b/roms/u-boot/arch/arm/mach-owl/soc.c
@@ -0,0 +1,80 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Actions Semi Owl SoCs platform support.
+ *
+ * Copyright (C) 2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
+ */
+
+#include <cpu_func.h>
+#include <init.h>
+#include <asm/cache.h>
+#include <asm/global_data.h>
+#include <linux/arm-smccc.h>
+#include <linux/psci.h>
+#include <common.h>
+#include <asm/io.h>
+#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 = owl_get_ddrcap() * 1024 * 1024;
+ return 0;
+}
+
+/* This is called after dram_init() so use get_ram_size result */
+int dram_init_banksize(void)
+{
+ gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
+ gd->bd->bi_dram[0].size = gd->ram_size;
+
+ return 0;
+}
+
+static void show_psci_version(void)
+{
+ struct arm_smccc_res res;
+
+ arm_smccc_smc(ARM_PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0, 0, 0, 0, 0, &res);
+
+ printf("PSCI: v%ld.%ld\n",
+ PSCI_VERSION_MAJOR(res.a0),
+ PSCI_VERSION_MINOR(res.a0));
+}
+
+int board_init(void)
+{
+ show_psci_version();
+
+ return 0;
+}
+
+void reset_cpu(void)
+{
+ psci_system_reset();
+}
diff --git a/roms/u-boot/arch/arm/mach-owl/sysmap-owl.c b/roms/u-boot/arch/arm/mach-owl/sysmap-owl.c
new file mode 100644
index 000000000..81f6ca2e4
--- /dev/null
+++ b/roms/u-boot/arch/arm/mach-owl/sysmap-owl.c
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Memory map for Actions Semi Owl series SoCs.
+ *
+ * Copyright (C) 2015 Actions Semi Co., Ltd.
+ * Copyright (C) 2018 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
+ */
+
+#include <common.h>
+#include <asm/armv8/mmu.h>
+
+static struct mm_region owl_mem_map[] = {
+ {
+ .virt = 0x0UL, /* DDR */
+ .phys = 0x0UL, /* DDR */
+ .size = 0x80000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+ PTE_BLOCK_INNER_SHARE
+ }, {
+ .virt = 0xE0000000UL, /* Peripheral block */
+ .phys = 0xE0000000UL, /* Peripheral block */
+ .size = 0x08000000UL,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE |
+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
+ }, {
+ /* List terminator */
+ 0,
+ }
+};
+
+struct mm_region *mem_map = owl_mem_map;