summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards
diff options
context:
space:
mode:
authorWadim Egorov <w.egorov@phytec.de>2016-08-30 14:25:47 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-09-01 09:15:01 +0200
commitc13c4e433288a3deba37058b4997112919b664cd (patch)
treeb7b3739f2cbfe2125f840e0acaa1b03b942174d4 /arch/arm/boards
parent62c8ce6c4282fc8906eb7960c540fae31ca4e51a (diff)
downloadbarebox-c13c4e433288a3deba37058b4997112919b664cd.tar.gz
barebox-c13c4e433288a3deba37058b4997112919b664cd.tar.xz
ARM: Add phyCORE-RK3288 SOM support
The phyCORE-RK3288 aka PCM-059 is a SoM (System on Module) containing a RK3288 SoC. The module can be connected to different carrier boards. Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards')
-rw-r--r--arch/arm/boards/Makefile1
-rw-r--r--arch/arm/boards/phytec-som-rk3288/Makefile3
-rw-r--r--arch/arm/boards/phytec-som-rk3288/board.c31
-rw-r--r--arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/boot/emmc6
-rw-r--r--arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/boot/mmc6
-rw-r--r--arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/automount-mmc7
-rw-r--r--arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/nv/boot.default1
-rw-r--r--arch/arm/boards/phytec-som-rk3288/lowlevel.c44
8 files changed, 99 insertions, 0 deletions
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index 35b636f0cf..23a8dbd7d0 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -96,6 +96,7 @@ obj-$(CONFIG_MACH_PM9G45) += pm9g45/
obj-$(CONFIG_MACH_QIL_A9260) += qil-a926x/
obj-$(CONFIG_MACH_QIL_A9G20) += qil-a926x/
obj-$(CONFIG_MACH_RADXA_ROCK) += radxa-rock/
+obj-$(CONFIG_MACH_PHYTEC_SOM_RK3288) += phytec-som-rk3288/
obj-$(CONFIG_MACH_REALQ7) += datamodul-edm-qmx6/
obj-$(CONFIG_MACH_RPI_COMMON) += raspberry-pi/
obj-$(CONFIG_MACH_SABRELITE) += freescale-mx6-sabrelite/
diff --git a/arch/arm/boards/phytec-som-rk3288/Makefile b/arch/arm/boards/phytec-som-rk3288/Makefile
new file mode 100644
index 0000000000..6f34c9a2f2
--- /dev/null
+++ b/arch/arm/boards/phytec-som-rk3288/Makefile
@@ -0,0 +1,3 @@
+obj-y += board.o
+lwl-y += lowlevel.o
+bbenv-y += defaultenv-physom-rk3288
diff --git a/arch/arm/boards/phytec-som-rk3288/board.c b/arch/arm/boards/phytec-som-rk3288/board.c
new file mode 100644
index 0000000000..8ea6c6c47c
--- /dev/null
+++ b/arch/arm/boards/phytec-som-rk3288/board.c
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2016 PHYTEC Messtechnik GmbH,
+ * Author: Wadim Egorov <w.egorov@phytec.de>
+ *
+ * Device initialization for the phyCORE-RK3288 SoM
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <common.h>
+#include <init.h>
+#include <envfs.h>
+
+static int physom_devices_init(void)
+{
+ if (!of_machine_is_compatible("phytec,rk3288-phycore-som"))
+ return 0;
+
+ barebox_set_hostname("pcm059");
+ defaultenv_append_directory(defaultenv_physom_rk3288);
+
+ return 0;
+}
+device_initcall(physom_devices_init);
diff --git a/arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/boot/emmc b/arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/boot/emmc
new file mode 100644
index 0000000000..731b07f604
--- /dev/null
+++ b/arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/boot/emmc
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+global.bootm.image=/mnt/emmc/linuximage
+global.bootm.oftree=/mnt/emmc/oftree
+
+global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rw rootwait"
diff --git a/arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/boot/mmc b/arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/boot/mmc
new file mode 100644
index 0000000000..5b19dbac02
--- /dev/null
+++ b/arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/boot/mmc
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+global.bootm.image=/mnt/sdmmc/linuximage
+global.bootm.oftree=/mnt/sdmmc/oftree
+
+global.linux.bootargs.dyn.root="root=/dev/mmcblk1p2 rw rootwait"
diff --git a/arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/automount-mmc b/arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/automount-mmc
new file mode 100644
index 0000000000..8b3f043bba
--- /dev/null
+++ b/arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/init/automount-mmc
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+mkdir -p /mnt/emmc
+automount -d /mnt/emmc 'mshc0.probe=1 && [ -e /dev/mshc0.0 ] && mount /dev/mshc0.0 /mnt/emmc'
+
+mkdir -p /mnt/sdmmc
+automount -d /mnt/sdmmc 'mshc1.probe=1 && [ -e /dev/mshc1.0 ] && mount /dev/mshc1.0 /mnt/sdmmc'
diff --git a/arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/nv/boot.default b/arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/nv/boot.default
new file mode 100644
index 0000000000..b4cedfc16b
--- /dev/null
+++ b/arch/arm/boards/phytec-som-rk3288/defaultenv-physom-rk3288/nv/boot.default
@@ -0,0 +1 @@
+emmc mmc
diff --git a/arch/arm/boards/phytec-som-rk3288/lowlevel.c b/arch/arm/boards/phytec-som-rk3288/lowlevel.c
new file mode 100644
index 0000000000..7804a55bcd
--- /dev/null
+++ b/arch/arm/boards/phytec-som-rk3288/lowlevel.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2016 PHYTEC Messtechnik GmbH,
+ * Author: Wadim Egorov <w.egorov@phytec.de>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <common.h>
+#include <linux/sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/rk3288-regs.h>
+#include <mach/grf_rk3288.h>
+#include <mach/hardware.h>
+#include <debug_ll.h>
+
+extern char __dtb_rk3288_phycore_som_start[];
+
+ENTRY_FUNCTION(start_rk3288_phycore_som, r0, r1, r2)
+{
+ void *fdt;
+ arm_cpu_lowlevel_init();
+
+ if (IS_ENABLED(CONFIG_DEBUG_LL)) {
+ struct rk3288_grf * const grf = (void *)RK3288_GRF_BASE;
+ rk_clrsetreg(&grf->gpio4c_iomux,
+ GPIO4C1_MASK << GPIO4C1_SHIFT |
+ GPIO4C0_MASK << GPIO4C0_SHIFT,
+ GPIO4C1_UART0BT_SOUT << GPIO4C1_SHIFT |
+ GPIO4C0_UART0BT_SIN << GPIO4C0_SHIFT);
+ INIT_LL();
+ }
+
+ fdt = __dtb_rk3288_phycore_som_start - get_runtime_offset();
+
+ barebox_arm_entry(0x0, SZ_1G, fdt);
+}