summaryrefslogtreecommitdiff
path: root/arch/arm/mach-owl/soc.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-04-25 08:20:22 -0400
committerTom Rini <trini@konsulko.com>2020-04-25 08:20:22 -0400
commitd202f67db0771247de562af5d6a5df778702857b (patch)
tree7c48f316e008c90e19b54f93e1ede85bfe237fcb /arch/arm/mach-owl/soc.c
parent4d131cdb6762694fc1a66d6b3e39a82f9ec691cf (diff)
parent691132e850539cb0956a106933d5bde37470bfc7 (diff)
Merge branch '2020-04-25-master-imports'
- Assorted minor fixes - Actions S700 SoC and Cubieboard7 support
Diffstat (limited to 'arch/arm/mach-owl/soc.c')
-rw-r--r--arch/arm/mach-owl/soc.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/arch/arm/mach-owl/soc.c b/arch/arm/mach-owl/soc.c
new file mode 100644
index 0000000000..409cbd319f
--- /dev/null
+++ b/arch/arm/mach-owl/soc.c
@@ -0,0 +1,57 @@
+// 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 <linux/arm-smccc.h>
+#include <linux/psci.h>
+#include <common.h>
+#include <asm/io.h>
+#include <asm/mach-types.h>
+#include <asm/psci.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * dram_init - sets uboots idea of sdram size
+ */
+int dram_init(void)
+{
+ gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+ 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(ulong addr)
+{
+ psci_system_reset();
+}