summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/boards')
-rw-r--r--arch/arm/boards/Makefile4
-rw-r--r--arch/arm/boards/a9m2410/env/bin/hush_hack1
-rw-r--r--arch/arm/boards/a9m2410/env/bin/init4
-rw-r--r--arch/arm/boards/a9m2440/env/bin/hush_hack1
-rw-r--r--arch/arm/boards/a9m2440/env/bin/init4
-rw-r--r--arch/arm/boards/boundarydevices-nitrogen6x/flash-header-nitrogen6x-1g.imxcfg5
-rw-r--r--arch/arm/boards/chumby_falconwing/falconwing.c4
-rw-r--r--arch/arm/boards/crystalfontz-cfa10036/cfa10036.c5
-rw-r--r--arch/arm/boards/embest-riotboard/Makefile3
-rw-r--r--arch/arm/boards/embest-riotboard/board.c90
-rw-r--r--arch/arm/boards/embest-riotboard/flash-header-embest-riotboard.imxcfg62
-rw-r--r--arch/arm/boards/embest-riotboard/lowlevel.c43
-rw-r--r--arch/arm/boards/eukrea_cpuimx27/env/bin/hush_hack1
-rw-r--r--arch/arm/boards/eukrea_cpuimx27/env/bin/init4
-rw-r--r--arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c3
-rw-r--r--arch/arm/boards/freescale-mx25-3ds/env/bin/hush_hack1
-rw-r--r--arch/arm/boards/freescale-mx25-3ds/env/bin/init4
-rw-r--r--arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c5
-rw-r--r--arch/arm/boards/mmccpu/env/bin/hush_hack1
-rw-r--r--arch/arm/boards/mmccpu/env/bin/init4
-rw-r--r--arch/arm/boards/phytec-phycard-imx6/Makefile2
-rw-r--r--arch/arm/boards/phytec-phycard-imx6/board.c60
-rw-r--r--arch/arm/boards/phytec-phycard-imx6/env/boot/nand12
-rw-r--r--arch/arm/boards/phytec-phycard-imx6/env/boot/sd-ext311
-rw-r--r--arch/arm/boards/phytec-phycard-imx6/env/config-board7
-rw-r--r--arch/arm/boards/phytec-phycard-imx6/flash-header-phytec-pcaaxl3-1gib-1bank.imxcfg7
-rw-r--r--arch/arm/boards/phytec-phycard-imx6/flash-header-phytec-pcaaxl3-1gib.imxcfg7
-rw-r--r--arch/arm/boards/phytec-phycard-imx6/flash-header-phytec-pcaaxl3-2gib.imxcfg8
-rw-r--r--arch/arm/boards/phytec-phycard-imx6/flash-header-phytec-pcaaxl3.h97
-rw-r--r--arch/arm/boards/phytec-phycard-imx6/lowlevel.c87
-rw-r--r--arch/arm/boards/pm9263/env/bin/hush_hack1
-rw-r--r--arch/arm/boards/pm9263/env/bin/init4
32 files changed, 504 insertions, 48 deletions
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index 16742d9138..040eebbce8 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -28,6 +28,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_EMBEST_RIOTBOARD) += embest-riotboard/
obj-$(CONFIG_MACH_EUKREA_CPUIMX25) += eukrea_cpuimx25/
obj-$(CONFIG_MACH_EUKREA_CPUIMX27) += eukrea_cpuimx27/
obj-$(CONFIG_MACH_EUKREA_CPUIMX35) += eukrea_cpuimx35/
@@ -62,6 +63,7 @@ obj-$(CONFIG_MACH_PANDA) += panda/
obj-$(CONFIG_MACH_PCA100) += phytec-phycard-imx27/
obj-$(CONFIG_MACH_PCAAL1) += phytec-phycard-omap3/
obj-$(CONFIG_MACH_PCAAXL2) += phytec-phycard-omap4/
+obj-$(CONFIG_MACH_PCAAXL3) += phytec-phycard-imx6/
obj-$(CONFIG_MACH_PCM037) += phytec-phycore-imx31/
obj-$(CONFIG_MACH_PCM038) += phytec-phycore-imx27/
obj-$(CONFIG_MACH_PCM043) += phytec-phycore-imx35/
@@ -93,7 +95,7 @@ obj-$(CONFIG_MACH_TX25) += karo-tx25/
obj-$(CONFIG_MACH_TX28) += karo-tx28/
obj-$(CONFIG_MACH_TX51) += karo-tx51/
obj-$(CONFIG_MACH_TX53) += karo-tx53/
-obj-$(CONFIG_MACH_UDOO) += udoo/
+obj-$(CONFIG_MACH_UDOO) += udoo/
obj-$(CONFIG_MACH_USB_A9260) += usb-a926x/
obj-$(CONFIG_MACH_USB_A9263) += usb-a926x/
obj-$(CONFIG_MACH_USB_A9G20) += usb-a926x/
diff --git a/arch/arm/boards/a9m2410/env/bin/hush_hack b/arch/arm/boards/a9m2410/env/bin/hush_hack
deleted file mode 100644
index 5fffa92ecd..0000000000
--- a/arch/arm/boards/a9m2410/env/bin/hush_hack
+++ /dev/null
@@ -1 +0,0 @@
-nand -a /dev/nand0.*
diff --git a/arch/arm/boards/a9m2410/env/bin/init b/arch/arm/boards/a9m2410/env/bin/init
index 5ae44dd455..dd94ef6be0 100644
--- a/arch/arm/boards/a9m2410/env/bin/init
+++ b/arch/arm/boards/a9m2410/env/bin/init
@@ -7,10 +7,6 @@ export PATH
if [ -e /dev/nand0 ]; then
addpart /dev/nand0 $nand_parts
-
- # Uh, oh, hush first expands wildcards and then starts executing
- # commands. What a bug!
- source /env/bin/hush_hack
fi
if [ -z $eth0.ethaddr ]; then
diff --git a/arch/arm/boards/a9m2440/env/bin/hush_hack b/arch/arm/boards/a9m2440/env/bin/hush_hack
deleted file mode 100644
index 5fffa92ecd..0000000000
--- a/arch/arm/boards/a9m2440/env/bin/hush_hack
+++ /dev/null
@@ -1 +0,0 @@
-nand -a /dev/nand0.*
diff --git a/arch/arm/boards/a9m2440/env/bin/init b/arch/arm/boards/a9m2440/env/bin/init
index 5ae44dd455..dd94ef6be0 100644
--- a/arch/arm/boards/a9m2440/env/bin/init
+++ b/arch/arm/boards/a9m2440/env/bin/init
@@ -7,10 +7,6 @@ export PATH
if [ -e /dev/nand0 ]; then
addpart /dev/nand0 $nand_parts
-
- # Uh, oh, hush first expands wildcards and then starts executing
- # commands. What a bug!
- source /env/bin/hush_hack
fi
if [ -z $eth0.ethaddr ]; then
diff --git a/arch/arm/boards/boundarydevices-nitrogen6x/flash-header-nitrogen6x-1g.imxcfg b/arch/arm/boards/boundarydevices-nitrogen6x/flash-header-nitrogen6x-1g.imxcfg
index 60a39fe870..b6c75800c6 100644
--- a/arch/arm/boards/boundarydevices-nitrogen6x/flash-header-nitrogen6x-1g.imxcfg
+++ b/arch/arm/boards/boundarydevices-nitrogen6x/flash-header-nitrogen6x-1g.imxcfg
@@ -99,8 +99,3 @@ wm 32 0x020c4074 0x3ff00000
wm 32 0x020c4078 0x00fff300
wm 32 0x020c407c 0x0f0000c3
wm 32 0x020c4080 0x000003ff
-/* enable AXI cache for VDOA/VPU/IPU */
-wm 32 0x020e0010 0xf00000cf
-/* set IPU AXI-id0 Qos=0xf(bypass AXI-id1 Qos=0x7 */
-wm 32 0x020e0018 0x007f007f
-wm 32 0x020e001c 0x007f007f
diff --git a/arch/arm/boards/chumby_falconwing/falconwing.c b/arch/arm/boards/chumby_falconwing/falconwing.c
index 24dc6e3216..669de95b37 100644
--- a/arch/arm/boards/chumby_falconwing/falconwing.c
+++ b/arch/arm/boards/chumby_falconwing/falconwing.c
@@ -299,9 +299,7 @@ static int falconwing_devices_init(void)
armlinux_set_architecture(MACH_TYPE_CHUMBY);
- rc = envfs_register_partition("disk0", 1);
- if (rc != 0)
- printf("Cannot create the 'env0' persistent environment storage (%d)\n", rc);
+ default_environment_path_set("/dev/disk0.1");
return 0;
}
diff --git a/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c b/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c
index 60f09d4e4d..337433856d 100644
--- a/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c
+++ b/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c
@@ -135,10 +135,7 @@ static int cfa10036_devices_init(void)
cfa10036_detect_hw();
- ret = envfs_register_partition("disk0", 1);
- if (ret != 0)
- printf("Cannot create the 'env0' persistent "
- "environment storage (%d)\n", ret);
+ default_environment_path_set("/dev/disk0.1");
return 0;
}
diff --git a/arch/arm/boards/embest-riotboard/Makefile b/arch/arm/boards/embest-riotboard/Makefile
new file mode 100644
index 0000000000..9f8e1f2b21
--- /dev/null
+++ b/arch/arm/boards/embest-riotboard/Makefile
@@ -0,0 +1,3 @@
+obj-y += board.o flash-header-embest-riotboard.dcd.o
+extra-y += flash-header-embest-riotboard.dcd.S flash-header-embest-riotboard.dcd
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/embest-riotboard/board.c b/arch/arm/boards/embest-riotboard/board.c
new file mode 100644
index 0000000000..638d0f6f18
--- /dev/null
+++ b/arch/arm/boards/embest-riotboard/board.c
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2014 Eric BĂ©nard <eric@eukrea.com>
+ * Copyright (C) 2013 Lucas Stach <l.stach@pengutronix.de>
+ *
+ * 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 <asm/armlinux.h>
+#include <asm/io.h>
+#include <bootsource.h>
+#include <common.h>
+#include <environment.h>
+#include <envfs.h>
+#include <gpio.h>
+#include <init.h>
+#include <mach/generic.h>
+#include <mach/imx6-regs.h>
+#include <mach/imx6.h>
+#include <mach/bbu.h>
+#include <mfd/imx6q-iomuxc-gpr.h>
+#include <sizes.h>
+#include <linux/phy.h>
+
+static int ar8035_phy_fixup(struct phy_device *dev)
+{
+ u16 val;
+
+ /* Ar803x phy SmartEEE feature cause link status generates glitch,
+ * which cause ethernet link down/up issue, so disable SmartEEE
+ */
+ phy_write(dev, 0xd, 0x3);
+ phy_write(dev, 0xe, 0x805d);
+ phy_write(dev, 0xd, 0x4003);
+
+ val = phy_read(dev, 0xe);
+ phy_write(dev, 0xe, val & ~(1 << 8));
+
+ /* To enable AR8031 ouput a 125MHz clk from CLK_25M */
+ phy_write(dev, 0xd, 0x7);
+ phy_write(dev, 0xe, 0x8016);
+ phy_write(dev, 0xd, 0x4007);
+
+ val = phy_read(dev, 0xe);
+ val &= 0xffe3;
+ val |= 0x18;
+ phy_write(dev, 0xe, val);
+
+ /* introduce tx clock delay */
+ phy_write(dev, 0x1d, 0x5);
+ val = phy_read(dev, 0x1e);
+ val |= 0x0100;
+ phy_write(dev, 0x1e, val);
+
+ return 0;
+}
+
+static int riotboard_device_init(void)
+{
+ if (!of_machine_is_compatible("embest,riotboard"))
+ return 0;
+
+ phy_register_fixup_for_uid(0x004dd072, 0xffffffef, ar8035_phy_fixup);
+
+ imx6_bbu_internal_mmc_register_handler("emmc", "/dev/mmc3.barebox",
+ BBU_HANDLER_FLAG_DEFAULT, NULL, 0, 0);
+
+ return 0;
+}
+device_initcall(riotboard_device_init);
+
+static int riotboard_lwl_init(void)
+{
+ if (!of_machine_is_compatible("embest,riotboard"))
+ return 0;
+
+ barebox_set_hostname("riotboard");
+
+ imx6_init_lowlevel();
+
+ return 0;
+}
+postcore_initcall(riotboard_lwl_init);
diff --git a/arch/arm/boards/embest-riotboard/flash-header-embest-riotboard.imxcfg b/arch/arm/boards/embest-riotboard/flash-header-embest-riotboard.imxcfg
new file mode 100644
index 0000000000..04e162b8f1
--- /dev/null
+++ b/arch/arm/boards/embest-riotboard/flash-header-embest-riotboard.imxcfg
@@ -0,0 +1,62 @@
+loadaddr 0x20000000
+soc imx6
+dcdofs 0x400
+wm 32 0x020e0774 0x000c0000
+wm 32 0x020e0754 0x00000000
+wm 32 0x020e04ac 0x00000030
+wm 32 0x020e04b0 0x00000030
+wm 32 0x020e0464 0x00000030
+wm 32 0x020e0490 0x00000030
+wm 32 0x020e074c 0x00000030
+wm 32 0x020e0494 0x00000030
+wm 32 0x020e04a0 0x00000000
+wm 32 0x020e04b4 0x00000030
+wm 32 0x020e04b8 0x00000030
+wm 32 0x020e076c 0x00000030
+wm 32 0x020e0750 0x00020000
+wm 32 0x020e04bc 0x00000028
+wm 32 0x020e04c0 0x00000028
+wm 32 0x020e04c4 0x00000028
+wm 32 0x020e04c8 0x00000028
+wm 32 0x020e0760 0x00020000
+wm 32 0x020e0764 0x00000028
+wm 32 0x020e0770 0x00000028
+wm 32 0x020e0778 0x00000028
+wm 32 0x020e077c 0x00000028
+wm 32 0x020e0470 0x00000028
+wm 32 0x020e0474 0x00000028
+wm 32 0x020e0478 0x00000028
+wm 32 0x020e047c 0x00000028
+wm 32 0x021b0800 0xa1390003
+wm 32 0x021b080c 0x001f001f
+wm 32 0x021b0810 0x001f001f
+wm 32 0x021b083c 0x421c0216
+wm 32 0x021b0840 0x017b017a
+wm 32 0x021b0848 0x4b4a4e4c
+wm 32 0x021b0850 0x3f3f3334
+wm 32 0x021b081c 0x33333333
+wm 32 0x021b0820 0x33333333
+wm 32 0x021b0824 0x33333333
+wm 32 0x021b0828 0x33333333
+wm 32 0x021b08b8 0x00000800
+wm 32 0x021b0004 0x00020025
+wm 32 0x021b0008 0x00333030
+wm 32 0x021b000c 0x676b5313
+wm 32 0x021b0010 0xb66e8b63
+wm 32 0x021b0014 0x01ff00db
+wm 32 0x021b0018 0x00001740
+wm 32 0x021b001c 0x00008000
+wm 32 0x021b002c 0x000026d2
+wm 32 0x021b0030 0x006b1023
+wm 32 0x021b0040 0x00000027
+wm 32 0x021b0000 0x84190000
+wm 32 0x021b001c 0x04008032
+wm 32 0x021b001c 0x00008033
+wm 32 0x021b001c 0x00048031
+wm 32 0x021b001c 0x05208030
+wm 32 0x021b001c 0x04008040
+wm 32 0x021b0020 0x00005800
+wm 32 0x021b0818 0x00011117
+wm 32 0x021b0004 0x00025565
+wm 32 0x021b0404 0x00011006
+wm 32 0x021b001c 0x00000000
diff --git a/arch/arm/boards/embest-riotboard/lowlevel.c b/arch/arm/boards/embest-riotboard/lowlevel.c
new file mode 100644
index 0000000000..814658aaf5
--- /dev/null
+++ b/arch/arm/boards/embest-riotboard/lowlevel.c
@@ -0,0 +1,43 @@
+#include <debug_ll.h>
+#include <common.h>
+#include <sizes.h>
+#include <io.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <asm/sections.h>
+#include <asm/cache.h>
+#include <asm/mmu.h>
+#include <mach/imx6-mmdc.h>
+#include <mach/imx6.h>
+
+static inline void setup_uart(void)
+{
+ /* Enable UART for lowlevel debugging purposes */
+ writel(0x00000000, 0x021e8080);
+ writel(0x00004027, 0x021e8084);
+ writel(0x00000704, 0x021e8088);
+ writel(0x00000a81, 0x021e8090);
+ writel(0x0000002b, 0x021e809c);
+ writel(0x00013880, 0x021e80b0);
+ writel(0x0000047f, 0x021e80a4);
+ writel(0x0000c34f, 0x021e80a8);
+ writel(0x00000001, 0x021e8080);
+}
+
+extern char __dtb_imx6s_riotboard_start[];
+
+ENTRY_FUNCTION(start_imx6s_riotboard, r0, r1, r2)
+{
+ uint32_t fdt;
+
+ arm_cpu_lowlevel_init();
+
+ if (IS_ENABLED(CONFIG_DEBUG_LL)) {
+ writel(0x4, 0x020e016c);
+ setup_uart();
+ putc_ll('a');
+ }
+
+ fdt = (uint32_t)__dtb_imx6s_riotboard_start - get_runtime_offset();
+ barebox_arm_entry(0x10000000, SZ_1G, fdt);
+}
diff --git a/arch/arm/boards/eukrea_cpuimx27/env/bin/hush_hack b/arch/arm/boards/eukrea_cpuimx27/env/bin/hush_hack
deleted file mode 100644
index 5fffa92ecd..0000000000
--- a/arch/arm/boards/eukrea_cpuimx27/env/bin/hush_hack
+++ /dev/null
@@ -1 +0,0 @@
-nand -a /dev/nand0.*
diff --git a/arch/arm/boards/eukrea_cpuimx27/env/bin/init b/arch/arm/boards/eukrea_cpuimx27/env/bin/init
index cd74974e25..e3c109135a 100644
--- a/arch/arm/boards/eukrea_cpuimx27/env/bin/init
+++ b/arch/arm/boards/eukrea_cpuimx27/env/bin/init
@@ -10,10 +10,6 @@ fi
if [ -e /dev/nand0 ]; then
addpart /dev/nand0 $nand_parts
-
- # Uh, oh, hush first expands wildcards and then starts executing
- # commands. What a bug!
- source /env/bin/hush_hack
fi
if [ -f /env/logo.bmp ]; then
diff --git a/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c b/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
index e2ad1c86dd..31422e64a0 100644
--- a/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
+++ b/arch/arm/boards/eukrea_cpuimx27/eukrea_cpuimx27.c
@@ -223,7 +223,8 @@ static int eukrea_cpuimx27_console_init(void)
imx27_setup_weimcs(3, 0x0000D603, 0x0D1D0D01, 0x00D20000);
#ifdef CONFIG_DRIVER_SERIAL_NS16550
add_ns16550_device(DEVICE_ID_DYNAMIC, MX27_CS3_BASE_ADDR + QUART_OFFSET, 0xf,
- IORESOURCE_MEM_16BIT, &quad_uart_serial_plat);
+ IORESOURCE_MEM | IORESOURCE_MEM_16BIT,
+ &quad_uart_serial_plat);
#endif
return 0;
}
diff --git a/arch/arm/boards/freescale-mx25-3ds/env/bin/hush_hack b/arch/arm/boards/freescale-mx25-3ds/env/bin/hush_hack
deleted file mode 100644
index 5fffa92ecd..0000000000
--- a/arch/arm/boards/freescale-mx25-3ds/env/bin/hush_hack
+++ /dev/null
@@ -1 +0,0 @@
-nand -a /dev/nand0.*
diff --git a/arch/arm/boards/freescale-mx25-3ds/env/bin/init b/arch/arm/boards/freescale-mx25-3ds/env/bin/init
index 0600b9e661..8eafa34dc8 100644
--- a/arch/arm/boards/freescale-mx25-3ds/env/bin/init
+++ b/arch/arm/boards/freescale-mx25-3ds/env/bin/init
@@ -10,10 +10,6 @@ fi
if [ -e /dev/nand0 ]; then
addpart /dev/nand0 $nand_parts
-
- # Uh, oh, hush first expands wildcards and then starts executing
- # commands. What a bug!
- source /env/bin/hush_hack
fi
echo
diff --git a/arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c b/arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c
index 11816125d4..3d466047b0 100644
--- a/arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c
+++ b/arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c
@@ -129,10 +129,7 @@ static int imx23_olinuxino_devices_init(void)
olinuxino_init_usb();
- rc = envfs_register_partition("disk0", 1);
- if (rc != 0)
- printf("Cannot create the 'env0' persistent "
- "environment storage (%d)\n", rc);
+ default_environment_path_set("/dev/disk0.1");
return 0;
}
diff --git a/arch/arm/boards/mmccpu/env/bin/hush_hack b/arch/arm/boards/mmccpu/env/bin/hush_hack
deleted file mode 100644
index 5fffa92ecd..0000000000
--- a/arch/arm/boards/mmccpu/env/bin/hush_hack
+++ /dev/null
@@ -1 +0,0 @@
-nand -a /dev/nand0.*
diff --git a/arch/arm/boards/mmccpu/env/bin/init b/arch/arm/boards/mmccpu/env/bin/init
index ac84bd596f..ad9b65a765 100644
--- a/arch/arm/boards/mmccpu/env/bin/init
+++ b/arch/arm/boards/mmccpu/env/bin/init
@@ -10,10 +10,6 @@ fi
if [ -e /dev/nand0 ]; then
addpart /dev/nand0 $nand_parts
-
- # Uh, oh, hush first expands wildcards and then starts executing
- # commands. What a bug!
- source /env/bin/hush_hack
fi
if [ -z $eth0.ethaddr ]; then
diff --git a/arch/arm/boards/phytec-phycard-imx6/Makefile b/arch/arm/boards/phytec-phycard-imx6/Makefile
new file mode 100644
index 0000000000..01c7a259e9
--- /dev/null
+++ b/arch/arm/boards/phytec-phycard-imx6/Makefile
@@ -0,0 +1,2 @@
+obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/phytec-phycard-imx6/board.c b/arch/arm/boards/phytec-phycard-imx6/board.c
new file mode 100644
index 0000000000..6ed431adcd
--- /dev/null
+++ b/arch/arm/boards/phytec-phycard-imx6/board.c
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2014 Christian Hemp, Phytec Messtechnik GmbH
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation.
+ *
+ */
+
+#include <environment.h>
+#include <bootsource.h>
+#include <common.h>
+#include <gpio.h>
+#include <init.h>
+#include <of.h>
+
+#include <mach/bbu.h>
+#include <mach/imx6.h>
+
+static int phytec_pcaaxl3_init(void)
+{
+ if (!of_machine_is_compatible("phytec,imx6q-pcaaxl3"))
+ return 0;
+
+ switch (bootsource_get()) {
+ case BOOTSOURCE_MMC:
+ of_device_enable_path("/chosen/environment-sd");
+ break;
+ default:
+ case BOOTSOURCE_NAND:
+ of_device_enable_path("/chosen/environment-nand");
+ break;
+ }
+
+ imx6_bbu_nand_register_handler("nand", BBU_HANDLER_FLAG_DEFAULT);
+
+ return 0;
+}
+device_initcall(phytec_pcaaxl3_init);
+
+static int phytec_pcaaxl3_core_init(void)
+{
+ if (!of_machine_is_compatible("phytec,imx6q-pcaaxl3"))
+ return 0;
+
+ imx6_init_lowlevel();
+
+ return 0;
+}
+postcore_initcall(phytec_pcaaxl3_core_init);
diff --git a/arch/arm/boards/phytec-phycard-imx6/env/boot/nand b/arch/arm/boards/phytec-phycard-imx6/env/boot/nand
new file mode 100644
index 0000000000..a51da9e340
--- /dev/null
+++ b/arch/arm/boards/phytec-phycard-imx6/env/boot/nand
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+ boot-menu-add-entry "$0" "Kernel:nand;rootfs:nand"
+ exit
+fi
+
+global.bootm.image="/dev/nand0.kernel.bb"
+#global.bootm.oftree="/env/oftree"
+bootargs-ip
+global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"
+
diff --git a/arch/arm/boards/phytec-phycard-imx6/env/boot/sd-ext3 b/arch/arm/boards/phytec-phycard-imx6/env/boot/sd-ext3
new file mode 100644
index 0000000000..fa1e9d68c9
--- /dev/null
+++ b/arch/arm/boards/phytec-phycard-imx6/env/boot/sd-ext3
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+ boot-menu-add-entry "$0" "MMC (ext3)"
+ exit
+fi
+
+global.bootm.image="/mnt/kernel/linuximage"
+#global.bootm.oftree="/boot/oftree"
+bootargs-ip
+global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext3 rootwait"
diff --git a/arch/arm/boards/phytec-phycard-imx6/env/config-board b/arch/arm/boards/phytec-phycard-imx6/env/config-board
new file mode 100644
index 0000000000..44008aa3e7
--- /dev/null
+++ b/arch/arm/boards/phytec-phycard-imx6/env/config-board
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# board defaults, do not change in running system. Change /env/config
+# instead
+
+global.hostname=phyCARD-i.MX6
+global.linux.bootargs.base="console=ttymxc2,115200"
diff --git a/arch/arm/boards/phytec-phycard-imx6/flash-header-phytec-pcaaxl3-1gib-1bank.imxcfg b/arch/arm/boards/phytec-phycard-imx6/flash-header-phytec-pcaaxl3-1gib-1bank.imxcfg
new file mode 100644
index 0000000000..481e085477
--- /dev/null
+++ b/arch/arm/boards/phytec-phycard-imx6/flash-header-phytec-pcaaxl3-1gib-1bank.imxcfg
@@ -0,0 +1,7 @@
+#define SETUP_1GIB_2GIB \
+ wm 32 0x021b000c 0x54597955; \
+ wm 32 0x021b0030 0x00591023; \
+ wm 32 0x021b0040 0x00000027; \
+ wm 32 0x021b0000 0x831a0000
+
+#include "flash-header-phytec-pcaaxl3.h"
diff --git a/arch/arm/boards/phytec-phycard-imx6/flash-header-phytec-pcaaxl3-1gib.imxcfg b/arch/arm/boards/phytec-phycard-imx6/flash-header-phytec-pcaaxl3-1gib.imxcfg
new file mode 100644
index 0000000000..b21bd894b0
--- /dev/null
+++ b/arch/arm/boards/phytec-phycard-imx6/flash-header-phytec-pcaaxl3-1gib.imxcfg
@@ -0,0 +1,7 @@
+#define SETUP_1GIB_2GIB \
+ wm 32 0x021b000c 0x3a3f7975; \
+ wm 32 0x021b0030 0x003f1023; \
+ wm 32 0x021b0040 0x00000017; \
+ wm 32 0x021b0000 0xc21a0000
+
+#include "flash-header-phytec-pcaaxl3.h"
diff --git a/arch/arm/boards/phytec-phycard-imx6/flash-header-phytec-pcaaxl3-2gib.imxcfg b/arch/arm/boards/phytec-phycard-imx6/flash-header-phytec-pcaaxl3-2gib.imxcfg
new file mode 100644
index 0000000000..858b6d754b
--- /dev/null
+++ b/arch/arm/boards/phytec-phycard-imx6/flash-header-phytec-pcaaxl3-2gib.imxcfg
@@ -0,0 +1,8 @@
+
+#define SETUP_1GIB_2GIB \
+ wm 32 0x021b000c 0x54597955; \
+ wm 32 0x021b0030 0x00591023; \
+ wm 32 0x021b0040 0x00000027; \
+ wm 32 0x021b0000 0xc31a0000
+
+#include "flash-header-phytec-pcaaxl3.h"
diff --git a/arch/arm/boards/phytec-phycard-imx6/flash-header-phytec-pcaaxl3.h b/arch/arm/boards/phytec-phycard-imx6/flash-header-phytec-pcaaxl3.h
new file mode 100644
index 0000000000..aecaf160bb
--- /dev/null
+++ b/arch/arm/boards/phytec-phycard-imx6/flash-header-phytec-pcaaxl3.h
@@ -0,0 +1,97 @@
+soc imx6
+loadaddr 0x20000000
+dcdofs 0x400
+
+wm 32 0x020e05a8 0x00000028
+wm 32 0x020e05b0 0x00000028
+wm 32 0x020e0524 0x00000028
+wm 32 0x020e051c 0x00000028
+wm 32 0x020e0518 0x00000028
+wm 32 0x020e050c 0x00000028
+wm 32 0x020e05b8 0x00000028
+wm 32 0x020e05c0 0x00000028
+wm 32 0x020e05ac 0x00000028
+wm 32 0x020e05b4 0x00000028
+wm 32 0x020e0528 0x00000028
+wm 32 0x020e0520 0x00000028
+wm 32 0x020e0514 0x00000028
+wm 32 0x020e0510 0x00000028
+wm 32 0x020e05bc 0x00000028
+wm 32 0x020e05c4 0x00000028
+wm 32 0x020e056c 0x00000028
+wm 32 0x020e0578 0x00000028
+wm 32 0x020e0588 0x00000028
+wm 32 0x020e0594 0x00000028
+wm 32 0x020e057c 0x00000028
+wm 32 0x020e0590 0x00003000
+wm 32 0x020e0598 0x00003000
+wm 32 0x020e058c 0x00000000
+wm 32 0x020e059c 0x00000028
+wm 32 0x020e05a0 0x00000028
+wm 32 0x020e0784 0x00000028
+wm 32 0x020e0788 0x00000028
+wm 32 0x020e0794 0x00000028
+wm 32 0x020e079c 0x00000028
+wm 32 0x020e07a0 0x00000028
+wm 32 0x020e07a4 0x00000028
+wm 32 0x020e07a8 0x00000028
+wm 32 0x020e0748 0x00000028
+wm 32 0x020e074c 0x00000028
+wm 32 0x020e0750 0x00020000
+wm 32 0x020e0758 0x00000000
+wm 32 0x020e0774 0x00020000
+wm 32 0x020e078c 0x00000028
+wm 32 0x020e0798 0x000c0000
+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 0x021b0018 0x00091740
+wm 32 0x021b001c 0x00008000
+wm 32 0x021b0010 0xff328f64
+wm 32 0x021b0014 0x01ff00db
+wm 32 0x021b002c 0x000026d2
+wm 32 0x021b0008 0x09444040
+wm 32 0x021b0004 0x00025576
+
+SETUP_1GIB_2GIB
+
+wm 32 0x021b001c 0x04088032
+wm 32 0x021b001c 0x0408803a
+wm 32 0x021b001c 0x00008033
+wm 32 0x021b001c 0x0000803b
+wm 32 0x021b001c 0x00048031
+wm 32 0x021b001c 0x00048039
+wm 32 0x021b001c 0x09408030
+wm 32 0x021b001c 0x09408038
+wm 32 0x021b001c 0x04008040
+wm 32 0x021b001c 0x04008048
+wm 32 0x021b0800 0xa1390003
+wm 32 0x021b4800 0xa1380003
+wm 32 0x021b0020 0x00007800
+wm 32 0x021b0818 0x00011117
+wm 32 0x021b4818 0x00011117
+wm 32 0x021b083c 0x4350035e
+wm 32 0x021b0840 0x035c0358
+wm 32 0x021b483c 0x436e0376
+wm 32 0x021b4840 0x03770352
+wm 32 0x021b0848 0x3c333436
+wm 32 0x021b4848 0x35332f3b
+wm 32 0x021b0850 0x37363e39
+wm 32 0x021b4850 0x432f433d
+wm 32 0x021b080c 0x0013001b
+wm 32 0x021b0810 0x003b0034
+wm 32 0x021b480c 0x0037004b
+wm 32 0x021b4810 0x004b0055
+wm 32 0x021b08b8 0x00000800
+wm 32 0x021b48b8 0x00000800
+wm 32 0x021b001c 0x00000000
+wm 32 0x021b0404 0x00011006
+wm 32 0x020e0010 0xf00000ff
+wm 32 0x020e0018 0x007f007f
+wm 32 0x020e001c 0x007f007f
+wm 32 0x020c8000 0x80002021
diff --git a/arch/arm/boards/phytec-phycard-imx6/lowlevel.c b/arch/arm/boards/phytec-phycard-imx6/lowlevel.c
new file mode 100644
index 0000000000..14df18f835
--- /dev/null
+++ b/arch/arm/boards/phytec-phycard-imx6/lowlevel.c
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2014 Christian Hemp <c.hemp@phytec.de>
+ *
+ * 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 <debug_ll.h>
+#include <common.h>
+#include <sizes.h>
+#include <io.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <asm/sections.h>
+#include <asm/cache.h>
+#include <asm/mmu.h>
+#include <mach/imx6-mmdc.h>
+#include <mach/imx6.h>
+
+static inline void setup_uart(void)
+{
+ void __iomem *ccmbase = IOMEM(MX6_CCM_BASE_ADDR);
+ void __iomem *uartbase = IOMEM(MX6_UART3_BASE_ADDR);
+ void __iomem *iomuxbase = IOMEM(MX6_IOMUXC_BASE_ADDR);
+
+ writel(0x4, iomuxbase + 0x01f8);
+
+ writel(0xffffffff, ccmbase + 0x68);
+ writel(0xffffffff, ccmbase + 0x6c);
+ writel(0xffffffff, ccmbase + 0x70);
+ writel(0xffffffff, ccmbase + 0x74);
+ writel(0xffffffff, ccmbase + 0x78);
+ writel(0xffffffff, ccmbase + 0x7c);
+ writel(0xffffffff, ccmbase + 0x80);
+
+ writel(0x00000000, uartbase + 0x80);
+ writel(0x00004027, uartbase + 0x84);
+ writel(0x00000704, uartbase + 0x88);
+ writel(0x00000a81, uartbase + 0x90);
+ writel(0x0000002b, uartbase + 0x9c);
+ writel(0x00013880, uartbase + 0xb0);
+ writel(0x0000047f, uartbase + 0xa4);
+ writel(0x0000c34f, uartbase + 0xa8);
+ writel(0x00000001, uartbase + 0x80);
+
+ putc_ll('>');
+}
+
+extern char __dtb_imx6q_phytec_pbaa03_start[];
+
+static void __noreturn start_imx6q_phytec_pbaa03_common(uint32_t size)
+{
+ uint32_t fdt;
+
+ arm_cpu_lowlevel_init();
+
+ arm_setup_stack(0x00920000 - 8);
+
+ if (IS_ENABLED(CONFIG_DEBUG_LL))
+ setup_uart();
+
+ fdt = (uint32_t)__dtb_imx6q_phytec_pbaa03_start - get_runtime_offset();
+
+ barebox_arm_entry(0x10000000, size, fdt);
+}
+
+ENTRY_FUNCTION(start_phytec_pbaa03_1gib, r0, r1, r2)
+{
+ start_imx6q_phytec_pbaa03_common(SZ_1G);
+}
+
+ENTRY_FUNCTION(start_phytec_pbaa03_1gib_1bank, r0, r1, r2)
+{
+ start_imx6q_phytec_pbaa03_common(SZ_1G);
+}
+
+ENTRY_FUNCTION(start_phytec_pbaa03_2gib, r0, r1, r2)
+{
+ start_imx6q_phytec_pbaa03_common(SZ_2G);
+}
diff --git a/arch/arm/boards/pm9263/env/bin/hush_hack b/arch/arm/boards/pm9263/env/bin/hush_hack
deleted file mode 100644
index 5fffa92ecd..0000000000
--- a/arch/arm/boards/pm9263/env/bin/hush_hack
+++ /dev/null
@@ -1 +0,0 @@
-nand -a /dev/nand0.*
diff --git a/arch/arm/boards/pm9263/env/bin/init b/arch/arm/boards/pm9263/env/bin/init
index 02f5cd415b..ad9b65a765 100644
--- a/arch/arm/boards/pm9263/env/bin/init
+++ b/arch/arm/boards/pm9263/env/bin/init
@@ -10,10 +10,6 @@ fi
if [ -e /dev/nand0 ]; then
addpart /dev/nand0 $nand_parts
-
- # Uh, oh, hush first expands wildcards and then starts executing
- # commands. What a bug!
- source /env/bin/hush_hack
fi
if [ -z $eth0.ethaddr ]; then