summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-08-07 06:14:58 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-08-07 06:14:58 +0200
commit7e094e336c312178c898f19fcd4c7af6a992c038 (patch)
treebe60e483b334d7237b7c2e73257a57359c28c723 /arch/arm/boards
parentf64760777b022e25909e05212b490edb1afdf764 (diff)
parentd73ad85a93584f5cf7e4c8604831e106e9273c3a (diff)
downloadbarebox-7e094e336c312178c898f19fcd4c7af6a992c038.tar.gz
barebox-7e094e336c312178c898f19fcd4c7af6a992c038.tar.xz
Merge branch 'for-next/imx'
Diffstat (limited to 'arch/arm/boards')
-rw-r--r--arch/arm/boards/Makefile1
-rw-r--r--arch/arm/boards/embedsky-e9/Makefile4
-rw-r--r--arch/arm/boards/embedsky-e9/board.c87
-rw-r--r--arch/arm/boards/embedsky-e9/defaultenv-e9/boot/mmc16
-rw-r--r--arch/arm/boards/embedsky-e9/defaultenv-e9/boot/mmc36
-rw-r--r--arch/arm/boards/embedsky-e9/defaultenv-e9/config-board7
-rw-r--r--arch/arm/boards/embedsky-e9/flash-header-e9.imxcfg87
-rw-r--r--arch/arm/boards/embedsky-e9/lowlevel.c18
8 files changed, 216 insertions, 0 deletions
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index e195870439..c60da81261 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_MACH_EDB9307) += edb93xx/
obj-$(CONFIG_MACH_EDB9315A) += edb93xx/
obj-$(CONFIG_MACH_EDB9315) += edb93xx/
obj-$(CONFIG_MACH_EFIKA_MX_SMARTBOOK) += efika-mx-smartbook/
+obj-$(CONFIG_MACH_EMBEDSKY_E9) += embedsky-e9/
obj-$(CONFIG_MACH_EMBEST_RIOTBOARD) += embest-riotboard/
obj-$(CONFIG_MACH_EUKREA_CPUIMX25) += eukrea_cpuimx25/
obj-$(CONFIG_MACH_EUKREA_CPUIMX27) += eukrea_cpuimx27/
diff --git a/arch/arm/boards/embedsky-e9/Makefile b/arch/arm/boards/embedsky-e9/Makefile
new file mode 100644
index 0000000000..db2dba7769
--- /dev/null
+++ b/arch/arm/boards/embedsky-e9/Makefile
@@ -0,0 +1,4 @@
+obj-y += board.o flash-header-e9.dcd.o
+extra-y += flash-header-e9.dcd.S flash-header-e9.dcd
+lwl-y += lowlevel.o
+bbenv-y += defaultenv-e9
diff --git a/arch/arm/boards/embedsky-e9/board.c b/arch/arm/boards/embedsky-e9/board.c
new file mode 100644
index 0000000000..55b4320219
--- /dev/null
+++ b/arch/arm/boards/embedsky-e9/board.c
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2014 Andrey Panov <rockford@yandex.ru>
+ *
+ * based on arch/arm/boards/freescale-mx6-sabresd/board.c
+ * Copyright (C) 2013 Hubert Feurstein <h.feurstein@gmail.com>
+ *
+ * based on arch/arm/boards/freescale-mx6-sabrelite/board.c
+ * Copyright (C) 2012 Steffen Trumtrar, Pengutronix
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * 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 <environment.h>
+#include <mach/imx6-regs.h>
+#include <fec.h>
+#include <gpio.h>
+#include <asm/armlinux.h>
+#include <generated/mach-types.h>
+#include <partition.h>
+#include <linux/phy.h>
+#include <asm/io.h>
+#include <asm/mmu.h>
+#include <mach/generic.h>
+#include <sizes.h>
+#include <net.h>
+#include <mach/imx6.h>
+#include <mach/devices-imx6.h>
+#include <mach/iomux-mx6.h>
+#include <spi/spi.h>
+#include <mach/spi.h>
+#include <mach/usb.h>
+#include <envfs.h>
+
+#define PHY_ID_RTL8211E 0x001cc915
+#define PHY_ID_MASK 0xffffffff
+
+/*
+ * This should reset a PHY. Taken from E9 U-Boot/Linux source.
+ */
+static int rtl8211e_phy_fixup(struct phy_device *dev)
+{
+ phy_write(dev, 0x00, 0x3140);
+ mdelay(10);
+ phy_write(dev, 0x00, 0x3340);
+ mdelay(10);
+
+ return 0;
+}
+
+static int e9_devices_init(void)
+{
+ if (!of_machine_is_compatible("embedsky,e9"))
+ return 0;
+
+ armlinux_set_architecture(3980);
+ barebox_set_hostname("e9");
+ defaultenv_append_directory(defaultenv_e9);
+
+ return 0;
+}
+device_initcall(e9_devices_init);
+
+static int e9_coredevices_init(void)
+{
+ if (!of_machine_is_compatible("embedsky,e9"))
+ return 0;
+
+ phy_register_fixup_for_uid(PHY_ID_RTL8211E, PHY_ID_MASK,
+ rtl8211e_phy_fixup);
+
+ return 0;
+}
+/*
+ * Do this before the fec initializes but after our
+ * gpios are available.
+ */
+coredevice_initcall(e9_coredevices_init);
diff --git a/arch/arm/boards/embedsky-e9/defaultenv-e9/boot/mmc1 b/arch/arm/boards/embedsky-e9/defaultenv-e9/boot/mmc1
new file mode 100644
index 0000000000..0177e6c6b8
--- /dev/null
+++ b/arch/arm/boards/embedsky-e9/defaultenv-e9/boot/mmc1
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+mount /dev/mmc1.0
+
+global.bootm.image=/mnt/mmc1.0/zImage
+global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootwait"
diff --git a/arch/arm/boards/embedsky-e9/defaultenv-e9/boot/mmc3 b/arch/arm/boards/embedsky-e9/defaultenv-e9/boot/mmc3
new file mode 100644
index 0000000000..374eb1cfe6
--- /dev/null
+++ b/arch/arm/boards/embedsky-e9/defaultenv-e9/boot/mmc3
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+mount /dev/mmc3.0
+
+global.bootm.image=/mnt/mmc3.0/boot/zImage
+global.linux.bootargs.dyn.root="root=/dev/mmcblk1p1 rootwait"
diff --git a/arch/arm/boards/embedsky-e9/defaultenv-e9/config-board b/arch/arm/boards/embedsky-e9/defaultenv-e9/config-board
new file mode 100644
index 0000000000..6cba769921
--- /dev/null
+++ b/arch/arm/boards/embedsky-e9/defaultenv-e9/config-board
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# board defaults, do not change in running system. Change /env/config
+# instead
+
+global.hostname=e9
+global.boot.default=$bootsource$bootsource_instance
diff --git a/arch/arm/boards/embedsky-e9/flash-header-e9.imxcfg b/arch/arm/boards/embedsky-e9/flash-header-e9.imxcfg
new file mode 100644
index 0000000000..52edefd77a
--- /dev/null
+++ b/arch/arm/boards/embedsky-e9/flash-header-e9.imxcfg
@@ -0,0 +1,87 @@
+loadaddr 0x27800000
+soc imx6
+dcdofs 0x400
+
+wm 32 0x020e0798 0x000c0000
+wm 32 0x020e0758 0x00000000
+wm 32 0x020e0588 0x00000030
+wm 32 0x020e0594 0x00000030
+wm 32 0x020e056c 0x00000030
+wm 32 0x020e0578 0x00000030
+wm 32 0x020e074c 0x00000030
+wm 32 0x020e057c 0x00000030
+wm 32 0x020e058c 0x00000000
+wm 32 0x020e059c 0x00000030
+wm 32 0x020e05a0 0x00000030
+wm 32 0x020e078c 0x00000030
+wm 32 0x020e0750 0x00020000
+wm 32 0x020e05a8 0x00000018
+wm 32 0x020e05b0 0x00000018
+wm 32 0x020e0524 0x00000018
+wm 32 0x020e051c 0x00000018
+wm 32 0x020e0518 0x00000018
+wm 32 0x020e050c 0x00000018
+wm 32 0x020e05b8 0x00000018
+wm 32 0x020e05c0 0x00000018
+wm 32 0x020e0774 0x00020000
+wm 32 0x020e0784 0x00000018
+wm 32 0x020e0788 0x00000018
+wm 32 0x020e0794 0x00000018
+wm 32 0x020e079c 0x00000018
+wm 32 0x020e07a0 0x00000018
+wm 32 0x020e07a4 0x00000018
+wm 32 0x020e07a8 0x00000018
+wm 32 0x020e0748 0x00000018
+wm 32 0x020e05ac 0x00000018
+wm 32 0x020e05b4 0x00000018
+wm 32 0x020e0528 0x00000018
+wm 32 0x020e0520 0x00000018
+wm 32 0x020e0514 0x00000018
+wm 32 0x020e0510 0x00000018
+wm 32 0x020e05bc 0x00000018
+wm 32 0x020e05c4 0x00000018
+wm 32 0x021b0800 0xa1390003
+wm 32 0x021b080c 0x001f001f
+wm 32 0x021b0810 0x001f001f
+wm 32 0x021b480c 0x001f001f
+wm 32 0x021b4810 0x001f001f
+wm 32 0x021b083c 0x4333033f
+wm 32 0x021b0840 0x032c031d
+wm 32 0x021b483c 0x43200332
+wm 32 0x021b4840 0x031a026a
+wm 32 0x021b0848 0x4d464746
+wm 32 0x021b4848 0x47453f4d
+wm 32 0x021b0850 0x3e434440
+wm 32 0x021b4850 0x47384839
+wm 32 0x021b081c 0x33333333
+wm 32 0x021b0820 0x33333333
+wm 32 0x021b0824 0x33333333
+wm 32 0x021b0828 0x33333333
+wm 32 0x021b481c 0x33333333
+wm 32 0x021b4820 0x33333333
+wm 32 0x021b4824 0x33333333
+wm 32 0x021b4828 0x33333333
+wm 32 0x021b08b8 0x00000800
+wm 32 0x021b48b8 0x00000800
+wm 32 0x021b0004 0x00020036
+wm 32 0x021b0008 0x09444040
+wm 32 0x021b000c 0x8a8f7955
+wm 32 0x021b0010 0xff328f64
+wm 32 0x021b0014 0x01ff00db
+wm 32 0x021b0018 0x00001740
+wm 32 0x021b001c 0x00008000
+wm 32 0x021b002c 0x000026d2
+wm 32 0x021b0030 0x008f1023
+wm 32 0x021b0040 0x00000047
+wm 32 0x021b0000 0x841a0000
+wm 32 0x021b001c 0x04088032
+wm 32 0x021b001c 0x00008033
+wm 32 0x021b001c 0x00048031
+wm 32 0x021b001c 0x09408030
+wm 32 0x021b001c 0x04008040
+wm 32 0x021b0020 0x00005800
+wm 32 0x021b0818 0x00011117
+wm 32 0x021b4818 0x00011117
+wm 32 0x021b0004 0x00025576
+wm 32 0x021b0404 0x00011006
+wm 32 0x021b001c 0x00000000
diff --git a/arch/arm/boards/embedsky-e9/lowlevel.c b/arch/arm/boards/embedsky-e9/lowlevel.c
new file mode 100644
index 0000000000..fee1011700
--- /dev/null
+++ b/arch/arm/boards/embedsky-e9/lowlevel.c
@@ -0,0 +1,18 @@
+#include <common.h>
+#include <sizes.h>
+#include <mach/generic.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+
+extern char __dtb_imx6q_embedsky_e9_start[];
+
+ENTRY_FUNCTION(start_imx6q_embedsky_e9, r0, r1, r2)
+{
+ void *fdt;
+
+ imx6_cpu_lowlevel_init();
+
+ fdt = __dtb_imx6q_embedsky_e9_start - get_runtime_offset();
+
+ barebox_arm_entry(0x10000000, SZ_2G, fdt);
+}