summaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-10-02 08:54:41 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-10-02 08:54:41 +0200
commit2a2a8b9052cf572ab13bcc3d8798addb2ed3470c (patch)
treed0f489ced378ddd10dbb8f0c21c8ddb4aa042793 /arch/arm
parentd0064495d3325cb630bc79550d60a4f4eef57e31 (diff)
parent8b8ffecb640bc378a80d35fe79a265b5cfa77e56 (diff)
downloadbarebox-2a2a8b9052cf572ab13bcc3d8798addb2ed3470c.tar.gz
barebox-2a2a8b9052cf572ab13bcc3d8798addb2ed3470c.tar.xz
Merge branch 'for-next/imx'
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/boards/Makefile2
-rw-r--r--arch/arm/boards/gateworks-ventana/Makefile2
-rw-r--r--arch/arm/boards/gateworks-ventana/board.c96
-rw-r--r--arch/arm/boards/gateworks-ventana/clocks.imxcfg8
-rw-r--r--arch/arm/boards/gateworks-ventana/flash-header-ventana-quad-1gx64.imxcfg11
-rw-r--r--arch/arm/boards/gateworks-ventana/gsc.c67
-rw-r--r--arch/arm/boards/gateworks-ventana/gsc.h58
-rw-r--r--arch/arm/boards/gateworks-ventana/lowlevel.c18
-rw-r--r--arch/arm/boards/gateworks-ventana/quad_128x64.imxcfg41
-rw-r--r--arch/arm/boards/gateworks-ventana/ram-base.imxcfg56
-rw-r--r--arch/arm/boards/karo-tx6x/1600mhz_4x128mx16.imxcfg101
-rw-r--r--arch/arm/boards/karo-tx6x/Makefile2
-rw-r--r--arch/arm/boards/karo-tx6x/board.c202
-rw-r--r--arch/arm/boards/karo-tx6x/flash-header-tx6dl-1g.imxcfg10
-rw-r--r--arch/arm/boards/karo-tx6x/lowlevel.c75
-rw-r--r--arch/arm/boards/karo-tx6x/ram-base.imxcfg71
-rw-r--r--arch/arm/configs/imx_v7_defconfig3
-rw-r--r--arch/arm/dts/Makefile2
-rw-r--r--arch/arm/dts/imx6dl-tx6u-801x.dts65
-rw-r--r--arch/arm/dts/imx6q-gw54xx.dts23
-rw-r--r--arch/arm/dts/imx6qdl-gw54xx.dtsi38
-rw-r--r--arch/arm/mach-imx/Kconfig7
-rw-r--r--arch/arm/mach-imx/include/mach/imx35-regs.h1
-rw-r--r--arch/arm/mach-imx/include/mach/imx6-ddr-regs.h6
-rw-r--r--arch/arm/mach-imx/include/mach/imx6dl-ddr-regs.h20
25 files changed, 984 insertions, 1 deletions
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index 5418c06db9..c80b9c920a 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -49,6 +49,7 @@ obj-$(CONFIG_MACH_GLOBALSCALE_MIRABOX) += globalscale-mirabox/
obj-$(CONFIG_MACH_GUF_CUPID) += guf-cupid/
obj-$(CONFIG_MACH_GUF_SANTARO) += guf-santaro/
obj-$(CONFIG_MACH_GUF_VINCELL) += guf-vincell/
+obj-$(CONFIG_MACH_GW_VENTANA) += gateworks-ventana/
obj-$(CONFIG_MACH_HIGHBANK) += highbank/
obj-$(CONFIG_MACH_IMX21ADS) += freescale-mx21-ads/
obj-$(CONFIG_MACH_IMX233_OLINUXINO) += imx233-olinuxino/
@@ -110,6 +111,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_TX6X) += karo-tx6x/
obj-$(CONFIG_MACH_UDOO) += udoo/
obj-$(CONFIG_MACH_USB_A9260) += usb-a926x/
obj-$(CONFIG_MACH_USB_A9263) += usb-a926x/
diff --git a/arch/arm/boards/gateworks-ventana/Makefile b/arch/arm/boards/gateworks-ventana/Makefile
new file mode 100644
index 0000000000..7d195eebd6
--- /dev/null
+++ b/arch/arm/boards/gateworks-ventana/Makefile
@@ -0,0 +1,2 @@
+obj-y += board.o gsc.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/gateworks-ventana/board.c b/arch/arm/boards/gateworks-ventana/board.c
new file mode 100644
index 0000000000..82dba7c93d
--- /dev/null
+++ b/arch/arm/boards/gateworks-ventana/board.c
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2014 Lucas Stach, 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 <environment.h>
+#include <i2c/i2c.h>
+#include <init.h>
+#include <linux/marvell_phy.h>
+#include <linux/phy.h>
+#include <mach/bbu.h>
+#include <mach/imx6.h>
+#include <net.h>
+
+#include "gsc.h"
+
+static int gw54xx_devices_init(void)
+{
+ struct i2c_client client;
+ struct device_node *dnode;
+ u8 reg;
+ u8 mac[6];
+
+ if (!of_machine_is_compatible("gw,imx6q-gw54xx"))
+ return 0;
+
+ client.adapter = i2c_get_adapter(0);
+ if (!client.adapter) {
+ pr_err("could not get system controller i2c bus\n");
+ return -ENODEV;
+ }
+
+ /* disable the GSC boot watchdog */
+ client.addr = GSC_SC_ADDR;
+ gsc_i2c_read(&client, GSC_SC_CTRL1, &reg, 1);
+ reg |= GSC_SC_CTRL1_WDDIS;
+ gsc_i2c_write(&client, GSC_SC_CTRL1, &reg, 1);
+
+ /* read MAC adresses from EEPROM and attach to eth devices */
+ dnode = of_find_node_by_alias(of_get_root_node(), "ethernet0");
+ if (dnode) {
+ client.addr = GSC_EEPROM_ADDR;
+ gsc_i2c_read(&client, 0x00, mac, 6);
+ of_eth_register_ethaddr(dnode, mac);
+ }
+ dnode = of_find_node_by_alias(of_get_root_node(), "ethernet1");
+ if (dnode) {
+ client.addr = GSC_EEPROM_ADDR;
+ gsc_i2c_read(&client, 0x06, mac, 6);
+ of_eth_register_ethaddr(dnode, mac);
+ }
+
+ imx6_bbu_nand_register_handler("nand", BBU_HANDLER_FLAG_DEFAULT);
+
+ barebox_set_hostname("gw54xx");
+
+ return 0;
+}
+device_initcall(gw54xx_devices_init);
+
+static int marvell_88e1510_phy_fixup(struct phy_device *dev)
+{
+ u32 val;
+
+ /* LED settings */
+ phy_write(dev, 22, 3);
+ val = phy_read(dev, 16);
+ val &= 0xff00;
+ val |= 0x0017;
+ phy_write(dev, 16, val);
+ phy_write(dev, 22, 0);
+
+ return 0;
+}
+
+static int gw54xx_coredevices_init(void)
+{
+ if (!of_machine_is_compatible("gw,imx6q-gw54xx"))
+ return 0;
+
+ phy_register_fixup_for_uid(MARVELL_PHY_ID_88E1510, MARVELL_PHY_ID_MASK,
+ marvell_88e1510_phy_fixup);
+
+ return 0;
+}
+coredevice_initcall(gw54xx_coredevices_init);
diff --git a/arch/arm/boards/gateworks-ventana/clocks.imxcfg b/arch/arm/boards/gateworks-ventana/clocks.imxcfg
new file mode 100644
index 0000000000..bfd5331f01
--- /dev/null
+++ b/arch/arm/boards/gateworks-ventana/clocks.imxcfg
@@ -0,0 +1,8 @@
+wm 32 MX6_CCM_CCGR0 0x00C03F3F
+wm 32 MX6_CCM_CCGR1 0x0030FC03
+wm 32 MX6_CCM_CCGR2 0x0FFFC000
+wm 32 MX6_CCM_CCGR3 0x3FF00000
+wm 32 MX6_CCM_CCGR4 0xFFFFF300
+wm 32 MX6_CCM_CCGR5 0x0F0000C3
+wm 32 MX6_CCM_CCGR6 0x000003FF
+wm 32 MX6_CCM_CCOSR 0x000000FB
diff --git a/arch/arm/boards/gateworks-ventana/flash-header-ventana-quad-1gx64.imxcfg b/arch/arm/boards/gateworks-ventana/flash-header-ventana-quad-1gx64.imxcfg
new file mode 100644
index 0000000000..75271e477d
--- /dev/null
+++ b/arch/arm/boards/gateworks-ventana/flash-header-ventana-quad-1gx64.imxcfg
@@ -0,0 +1,11 @@
+soc imx6
+loadaddr 0x20000000
+dcdofs 0x400
+
+#include <mach/imx6-ddr-regs.h>
+#include <mach/imx6q-ddr-regs.h>
+#include <mach/imx6-ccm-regs.h>
+
+#include "ram-base.imxcfg"
+#include "quad_128x64.imxcfg"
+#include "clocks.imxcfg"
diff --git a/arch/arm/boards/gateworks-ventana/gsc.c b/arch/arm/boards/gateworks-ventana/gsc.c
new file mode 100644
index 0000000000..3614230482
--- /dev/null
+++ b/arch/arm/boards/gateworks-ventana/gsc.c
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2013 Gateworks Corporation
+ * Copyright (C) 2014 Lucas Stach, Pengutronix
+ * Author: Tim Harvey <tharvey@gateworks.com>
+ *
+ * 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.
+ */
+
+/*
+ * The Gateworks System Controller will fail to ACK a master transaction if
+ * it is busy, which can occur during its 1HZ timer tick while reading ADC's.
+ * When this does occur, it will never be busy long enough to fail more than
+ * 2 back-to-back transfers. Thus we wrap i2c_read and i2c_write with
+ * 3 retries.
+ */
+
+#include <common.h>
+#include <i2c/i2c.h>
+
+#include "gsc.h"
+
+int gsc_i2c_read(struct i2c_client *client, u32 addr, u8 *buf, u16 count)
+{
+ int retry = 3;
+ int n = 0;
+ int ret;
+
+ while (n++ < retry) {
+ ret = i2c_read_reg(client, addr, buf, count);
+ if (!ret)
+ break;
+ pr_debug("GSC read failed\n");
+ if (ret != -ENODEV)
+ break;
+ mdelay(10);
+ }
+
+ return ret;
+}
+
+int gsc_i2c_write(struct i2c_client *client, u32 addr, const u8 *buf, u16 count)
+{
+ int retry = 3;
+ int n = 0;
+ int ret;
+
+ while (n++ < retry) {
+ ret = i2c_write_reg(client, addr, buf, count);
+ if (!ret)
+ break;
+ pr_debug("GSC write failed\n");
+ if (ret != -ENODEV)
+ break;
+ mdelay(10);
+ }
+ mdelay(100);
+
+ return ret;
+}
diff --git a/arch/arm/boards/gateworks-ventana/gsc.h b/arch/arm/boards/gateworks-ventana/gsc.h
new file mode 100644
index 0000000000..a6e7e2232d
--- /dev/null
+++ b/arch/arm/boards/gateworks-ventana/gsc.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2013 Gateworks Corporation
+ * Copyright (C) 2014 Lucas Stach, Pengutronix
+ * Author: Tim Harvey <tharvey@gateworks.com>
+ *
+ * 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.
+ */
+
+/* i2c slave addresses */
+#define GSC_SC_ADDR 0x20
+#define GSC_RTC_ADDR 0x68
+#define GSC_HWMON_ADDR 0x29
+#define GSC_EEPROM_ADDR 0x51
+
+/* System Controller registers */
+#define GSC_SC_CTRL0 0x00
+#define GSC_SC_CTRL1 0x01
+#define GSC_SC_CTRL1_WDDIS (1 << 7)
+#define GSC_SC_STATUS 0x0a
+#define GSC_SC_FWVER 0x0e
+
+/* System Controller Interrupt bits */
+#define GSC_SC_IRQ_PB 0 /* Pushbutton switch */
+#define GSC_SC_IRQ_SECURE 1 /* Secure Key erase complete */
+#define GSC_SC_IRQ_EEPROM_WP 2 /* EEPROM write violation */
+#define GSC_SC_IRQ_GPIO 4 /* GPIO change */
+#define GSC_SC_IRQ_TAMPER 5 /* Tamper detect */
+#define GSC_SC_IRQ_WATCHDOG 6 /* Watchdog trip */
+#define GSC_SC_IRQ_PBLONG 7 /* Pushbutton long hold */
+
+/* Hardware Monitor registers */
+#define GSC_HWMON_TEMP 0x00
+#define GSC_HWMON_VIN 0x02
+#define GSC_HWMON_VDD_3P3 0x05
+#define GSC_HWMON_VBATT 0x08
+#define GSC_HWMON_VDD_5P0 0x0b
+#define GSC_HWMON_VDD_CORE 0x0e
+#define GSC_HWMON_VDD_HIGH 0x14
+#define GSC_HWMON_VDD_DDR 0x17
+#define GSC_HWMON_VDD_SOC 0x11
+#define GSC_HWMON_VDD_1P8 0x1d
+#define GSC_HWMON_VDD_2P5 0x23
+#define GSC_HWMON_VDD_1P0 0x20
+
+/*
+ * I2C transactions to the GSC are done via these functions which
+ * perform retries in the case of a busy GSC NAK'ing the transaction
+ */
+int gsc_i2c_read(struct i2c_client *client, u32 addr, u8 *buf, u16 count);
+int gsc_i2c_write(struct i2c_client *client, u32 addr, const u8 *buf, u16 count);
diff --git a/arch/arm/boards/gateworks-ventana/lowlevel.c b/arch/arm/boards/gateworks-ventana/lowlevel.c
new file mode 100644
index 0000000000..10b2c4c780
--- /dev/null
+++ b/arch/arm/boards/gateworks-ventana/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_gw54xx_start[];
+
+ENTRY_FUNCTION(start_imx6q_gw54xx_1gx64, r0, r1, r2)
+{
+ void *fdt;
+
+ imx6_cpu_lowlevel_init();
+
+ fdt = __dtb_imx6q_gw54xx_start - get_runtime_offset();
+
+ barebox_arm_entry(0x10000000, SZ_1G, fdt);
+}
diff --git a/arch/arm/boards/gateworks-ventana/quad_128x64.imxcfg b/arch/arm/boards/gateworks-ventana/quad_128x64.imxcfg
new file mode 100644
index 0000000000..daf01a8ad1
--- /dev/null
+++ b/arch/arm/boards/gateworks-ventana/quad_128x64.imxcfg
@@ -0,0 +1,41 @@
+wm 32 MX6_MMDC_P0_MPWLDECTRL0 0x00190017
+wm 32 MX6_MMDC_P0_MPWLDECTRL1 0x00140026
+wm 32 MX6_MMDC_P1_MPWLDECTRL0 0x0021001C
+wm 32 MX6_MMDC_P1_MPWLDECTRL1 0x0011001D
+
+wm 32 MX6_MMDC_P0_MPDGCTRL0 0x43380347
+wm 32 MX6_MMDC_P0_MPDGCTRL1 0x433C034D
+wm 32 MX6_MMDC_P1_MPDGCTRL0 0x032C0324
+wm 32 MX6_MMDC_P1_MPDGCTRL1 0x03310232
+
+wm 32 MX6_MMDC_P0_MPRDDLCTL 0x3C313539
+wm 32 MX6_MMDC_P1_MPRDDLCTL 0x37343141
+wm 32 MX6_MMDC_P0_MPWRDLCTL 0x36393C39
+wm 32 MX6_MMDC_P1_MPWRDLCTL 0x42344438
+
+wm 32 MX6_MMDC_P0_MPODTCTRL 0x00022227
+wm 32 MX6_MMDC_P1_MPODTCTRL 0x00022227
+
+wm 32 MX6_MMDC_P0_MPMUR0 0x00000800
+wm 32 MX6_MMDC_P1_MPMUR0 0x00000800
+
+wm 32 MX6_MMDC_P0_MDSCR 0x00008000
+wm 32 MX6_MMDC_P0_MDCFG0 0x54597955
+wm 32 MX6_MMDC_P0_MDCFG1 0xFF328F64
+wm 32 MX6_MMDC_P0_MDCFG2 0x01FF00DB
+wm 32 MX6_MMDC_P0_MDOTC 0x09444040
+wm 32 MX6_MMDC_P0_MDASP 0x0000007F
+wm 32 MX6_MMDC_P0_MDMISC 0x00011740
+wm 32 MX6_MMDC_P0_MDOR 0x00591023
+wm 32 MX6_MMDC_P0_MDCTL 0x831A0000
+wm 32 MX6_MMDC_P0_MDSCR 0x02088032
+wm 32 MX6_MMDC_P0_MDSCR 0x00008033
+wm 32 MX6_MMDC_P0_MDSCR 0x00408031
+wm 32 MX6_MMDC_P0_MDSCR 0x09408030
+wm 32 MX6_MMDC_P0_MDSCR 0x04008040
+wm 32 MX6_MMDC_P0_MDPDC 0x00025576
+wm 32 MX6_MMDC_P0_MAPSR 0x00011006
+wm 32 MX6_MMDC_P0_MPZQHWCTRL 0xA1390003
+wm 32 MX6_MMDC_P1_MPZQHWCTRL 0xA1390003
+wm 32 MX6_MMDC_P0_MDREF 0x00007800
+wm 32 MX6_MMDC_P0_MDSCR 0x00000000
diff --git a/arch/arm/boards/gateworks-ventana/ram-base.imxcfg b/arch/arm/boards/gateworks-ventana/ram-base.imxcfg
new file mode 100644
index 0000000000..07dc34c0bb
--- /dev/null
+++ b/arch/arm/boards/gateworks-ventana/ram-base.imxcfg
@@ -0,0 +1,56 @@
+wm 32 MX6_IOM_DRAM_SDQS0 0x00000030
+wm 32 MX6_IOM_DRAM_SDQS1 0x00000030
+wm 32 MX6_IOM_DRAM_SDQS2 0x00000030
+wm 32 MX6_IOM_DRAM_SDQS3 0x00000030
+wm 32 MX6_IOM_DRAM_SDQS4 0x00000030
+wm 32 MX6_IOM_DRAM_SDQS5 0x00000030
+wm 32 MX6_IOM_DRAM_SDQS6 0x00000030
+wm 32 MX6_IOM_DRAM_SDQS7 0x00000030
+
+wm 32 MX6_IOM_DRAM_DQM0 0x00020030
+wm 32 MX6_IOM_DRAM_DQM1 0x00020030
+wm 32 MX6_IOM_DRAM_DQM2 0x00020030
+wm 32 MX6_IOM_DRAM_DQM3 0x00020030
+wm 32 MX6_IOM_DRAM_DQM4 0x00020030
+wm 32 MX6_IOM_DRAM_DQM5 0x00020030
+wm 32 MX6_IOM_DRAM_DQM6 0x00020030
+wm 32 MX6_IOM_DRAM_DQM7 0x00020030
+
+wm 32 MX6_IOM_GRP_B0DS 0x00000030
+wm 32 MX6_IOM_GRP_B1DS 0x00000030
+wm 32 MX6_IOM_GRP_B2DS 0x00000030
+wm 32 MX6_IOM_GRP_B3DS 0x00000030
+wm 32 MX6_IOM_GRP_B4DS 0x00000030
+wm 32 MX6_IOM_GRP_B5DS 0x00000030
+wm 32 MX6_IOM_GRP_B6DS 0x00000030
+wm 32 MX6_IOM_GRP_B7DS 0x00000030
+
+wm 32 MX6_IOM_DRAM_CAS 0x00020030
+wm 32 MX6_IOM_DRAM_RAS 0x00020030
+wm 32 MX6_IOM_DRAM_SDCLK_0 0x00020030
+wm 32 MX6_IOM_DRAM_SDCLK_1 0x00020030
+wm 32 MX6_IOM_DRAM_RESET 0x00020030
+
+wm 32 MX6_IOM_DRAM_SDCKE0 0x00003000
+wm 32 MX6_IOM_DRAM_SDCKE1 0x00003000
+
+wm 32 MX6_IOM_DRAM_SDBA2 0x00000000
+
+wm 32 MX6_IOM_DRAM_SDODT0 0x00003030
+wm 32 MX6_IOM_DRAM_SDODT1 0x00003030
+
+wm 32 MX6_IOM_GRP_DDR_TYPE 0x000C0000
+wm 32 MX6_IOM_DDRMODE_CTL 0x00020000
+wm 32 MX6_IOM_GRP_DDRPKE 0x00000000
+wm 32 MX6_IOM_GRP_ADDDS 0x00000030
+wm 32 MX6_IOM_GRP_CTLDS 0x00000030
+wm 32 MX6_IOM_GRP_DDRMODE 0x00020000
+
+wm 32 MX6_MMDC_P0_MPRDDQBY0DL 0x33333333
+wm 32 MX6_MMDC_P0_MPRDDQBY1DL 0x33333333
+wm 32 MX6_MMDC_P0_MPRDDQBY2DL 0x33333333
+wm 32 MX6_MMDC_P0_MPRDDQBY3DL 0x33333333
+wm 32 MX6_MMDC_P1_MPRDDQBY0DL 0x33333333
+wm 32 MX6_MMDC_P1_MPRDDQBY1DL 0x33333333
+wm 32 MX6_MMDC_P1_MPRDDQBY2DL 0x33333333
+wm 32 MX6_MMDC_P1_MPRDDQBY3DL 0x33333333
diff --git a/arch/arm/boards/karo-tx6x/1600mhz_4x128mx16.imxcfg b/arch/arm/boards/karo-tx6x/1600mhz_4x128mx16.imxcfg
new file mode 100644
index 0000000000..b5c59e3c3c
--- /dev/null
+++ b/arch/arm/boards/karo-tx6x/1600mhz_4x128mx16.imxcfg
@@ -0,0 +1,101 @@
+/* MDMISC mirroring interleaved (row/bank/col) */
+wm 32 MX6_MMDC_P0_MDMISC 0x00000742
+check 32 while_all_bits_clear MX6_MMDC_P0_MDMISC 0x00000002
+
+wm 32 MX6_MMDC_P0_MDSCR 0x00008000
+check 32 while_any_bit_clear MX6_MMDC_P0_MDSCR 0x00004000
+
+wm 32 MX6_MMDC_P0_MDCTL 0x831a0000
+check 32 while_any_bit_clear MX6_MMDC_P0_MDMISC 0x40000000
+
+wm 32 MX6_MMDC_P0_MDCFG0 0x3f435333
+wm 32 MX6_MMDC_P0_MDCFG1 0x926e8a63
+wm 32 MX6_MMDC_P0_MDCFG2 0x01ff00db
+wm 32 MX6_MMDC_P0_MDRWD 0x000026d2
+wm 32 MX6_MMDC_P0_MDOR 0x00431023
+wm 32 MX6_MMDC_P0_MDOTC 0x1b333030
+wm 32 MX6_MMDC_P0_MDPDC 0x0002006d
+wm 32 MX6_MMDC_P1_MDPDC 0x0002006d
+wm 32 MX6_MMDC_P0_MDASP 0x00000027
+
+wm 32 MX6_MMDC_P0_MDSCR 0x05208030
+wm 32 MX6_MMDC_P0_MDSCR 0x00048031
+wm 32 MX6_MMDC_P0_MDSCR 0x00408032
+wm 32 MX6_MMDC_P0_MDSCR 0x00008033
+wm 32 MX6_MMDC_P0_MDREF 0x0000c000
+wm 32 MX6_MMDC_P0_MDSCR 0x00008020
+
+wm 32 MX6_MMDC_P0_MPODTCTRL 0x00022222
+wm 32 MX6_MMDC_P1_MPODTCTRL 0x00022222
+
+wm 32 MX6_MMDC_P0_MPPDCMPR2 0x00000003
+wm 32 MX6_MMDC_P0_MAPSR 0x00001007
+wm 32 MX6_MMDC_P0_MDSCR 0x04008010
+wm 32 MX6_MMDC_P0_MDSCR 0x04008040
+
+wm 32 MX6_MMDC_P0_MPZQHWCTRL 0xA1390001
+check 32 while_all_bits_clear MX6_MMDC_P0_MPZQHWCTRL 0x00010000
+wm 32 MX6_MMDC_P0_MPZQHWCTRL 0xA1380000
+
+wm 32 MX6_MMDC_P0_MPWLDECTRL0 0x001e001e
+wm 32 MX6_MMDC_P0_MPWLDECTRL1 0x001e001e
+wm 32 MX6_MMDC_P1_MPWLDECTRL0 0x001e001e
+wm 32 MX6_MMDC_P1_MPWLDECTRL1 0x001e001e
+
+wm 32 MX6_MMDC_P0_MDSCR 0x00048033
+wm 32 MX6_IOM_DRAM_SDQS0 0x00007030
+wm 32 MX6_IOM_DRAM_SDQS1 0x00007030
+wm 32 MX6_IOM_DRAM_SDQS2 0x00007030
+wm 32 MX6_IOM_DRAM_SDQS3 0x00007030
+wm 32 MX6_IOM_DRAM_SDQS4 0x00007030
+wm 32 MX6_IOM_DRAM_SDQS5 0x00007030
+wm 32 MX6_IOM_DRAM_SDQS6 0x00007030
+wm 32 MX6_IOM_DRAM_SDQS7 0x00007030
+
+wm 32 MX6_MMDC_P0_MDSCR 0x00008020
+wm 32 MX6_MMDC_P0_MDSCR 0x04008050
+
+wm 32 MX6_MMDC_P0_MPRDDLCTL 0x40404040
+wm 32 MX6_MMDC_P0_MPWRDLCTL 0x40404040
+wm 32 MX6_MMDC_P1_MPRDDLCTL 0x40404040
+wm 32 MX6_MMDC_P1_MPWRDLCTL 0x40404040
+wm 32 MX6_MMDC_P0_MPMUR0 0x00000800
+
+wm 32 MX6_MMDC_P0_MPDGCTRL0 0x80000000
+check 32 while_all_bits_clear MX6_MMDC_P0_MPDGCTRL0 0x80000000
+wm 32 MX6_MMDC_P0_MPDGCTRL0 0x80000000
+check 32 while_all_bits_clear MX6_MMDC_P0_MPDGCTRL0 0x80000000
+wm 32 MX6_MMDC_P0_MPDGCTRL0 0x50800000
+check 32 while_all_bits_clear MX6_MMDC_P0_MPDGCTRL0 0x10001000
+
+wm 32 MX6_IOM_DRAM_SDQS0 0x00000030
+wm 32 MX6_IOM_DRAM_SDQS1 0x00000030
+wm 32 MX6_IOM_DRAM_SDQS2 0x00000030
+wm 32 MX6_IOM_DRAM_SDQS3 0x00000030
+wm 32 MX6_IOM_DRAM_SDQS4 0x00000030
+wm 32 MX6_IOM_DRAM_SDQS5 0x00000030
+wm 32 MX6_IOM_DRAM_SDQS6 0x00000030
+wm 32 MX6_IOM_DRAM_SDQS7 0x00000030
+
+wm 32 MX6_MMDC_P0_MDSCR 0x04008050
+wm 32 MX6_MMDC_P0_MPRDDLHWCTL 0x00000030
+wm 32 MX6_MMDC_P1_MPRDDLHWCTL 0x00000030
+
+check 32 while_all_bits_clear MX6_MMDC_P0_MPRDDLHWCTL 0x0000001f
+check 32 while_all_bits_clear MX6_MMDC_P1_MPRDDLHWCTL 0x0000001f
+
+wm 32 MX6_MMDC_P0_MDSCR 0x04008050
+wm 32 MX6_MMDC_P0_MPWRDLHWCTL 0x00000030
+check 32 while_all_bits_clear MX6_MMDC_P0_MPWRDLHWCTL 0x0000001f
+
+wm 32 MX6_MMDC_P0_MDSCR 0x04008050
+wm 32 MX6_MMDC_P1_MPWRDLHWCTL 0x00000030
+check 32 while_all_bits_clear MX6_MMDC_P1_MPWRDLHWCTL 0x0000001f
+wm 32 MX6_MMDC_P0_MDSCR 0x00008033
+wm 32 MX6_MMDC_P0_MPZQHWCTRL 0xa138002b
+wm 32 MX6_MMDC_P0_MDREF 0x00001800
+wm 32 MX6_MMDC_P0_MAPSR 0x00001006
+wm 32 MX6_MMDC_P0_MDPDC 0x0002556d
+wm 32 MX6_MMDC_P1_MDPDC 0x0002556d
+wm 32 MX6_MMDC_P0_MDSCR 0x00000000
+check 32 while_all_bits_clear MX6_MMDC_P0_MDSCR 0x00004000
diff --git a/arch/arm/boards/karo-tx6x/Makefile b/arch/arm/boards/karo-tx6x/Makefile
new file mode 100644
index 0000000000..01c7a259e9
--- /dev/null
+++ b/arch/arm/boards/karo-tx6x/Makefile
@@ -0,0 +1,2 @@
+obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/karo-tx6x/board.c b/arch/arm/boards/karo-tx6x/board.c
new file mode 100644
index 0000000000..6d9dd9a505
--- /dev/null
+++ b/arch/arm/boards/karo-tx6x/board.c
@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) 2014 Steffen Trumtrar, Pengutronix
+ *
+ *
+ * with the PMIC init code taken from u-boot
+ * Copyright (C) 2012,2013 Lothar Waßmann <LW@KARO-electronics.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 <common.h>
+#include <gpio.h>
+#include <init.h>
+#include <i2c/i2c.h>
+#include <linux/clk.h>
+#include <environment.h>
+#include <mach/bbu.h>
+#include <mach/imx6.h>
+#include <mfd/imx6q-iomuxc-gpr.h>
+
+#define ETH_PHY_RST IMX_GPIO_NR(7, 6)
+#define ETH_PHY_PWR IMX_GPIO_NR(3, 20)
+#define ETH_PHY_INT IMX_GPIO_NR(7, 1)
+#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
+#define DIV_ROUND(n,d) (((n) + ((d)/2)) / (d))
+
+#define LTC3676_BUCK1 0x01
+#define LTC3676_BUCK2 0x02
+#define LTC3676_BUCK3 0x03
+#define LTC3676_BUCK4 0x04
+#define LTC3676_DVB1A 0x0A
+#define LTC3676_DVB1B 0x0B
+#define LTC3676_DVB2A 0x0C
+#define LTC3676_DVB2B 0x0D
+#define LTC3676_DVB3A 0x0E
+#define LTC3676_DVB3B 0x0F
+#define LTC3676_DVB4A 0x10
+#define LTC3676_DVB4B 0x11
+#define LTC3676_MSKPG 0x13
+#define LTC3676_CLIRQ 0x1f
+
+#define LTC3676_BUCK_DVDT_FAST (1 << 0)
+#define LTC3676_BUCK_KEEP_ALIVE (1 << 1)
+#define LTC3676_BUCK_CLK_RATE_LOW (1 << 2)
+#define LTC3676_BUCK_PHASE_SEL (1 << 3)
+#define LTC3676_BUCK_ENABLE_300 (1 << 4)
+#define LTC3676_BUCK_PULSE_SKIP (0 << 5)
+#define LTC3676_BUCK_BURST_MODE (1 << 5)
+#define LTC3676_BUCK_CONTINUOUS (2 << 5)
+#define LTC3676_BUCK_ENABLE (1 << 7)
+
+#define LTC3676_PGOOD_MASK (1 << 5)
+
+#define LTC3676_MSKPG_BUCK1 (1 << 0)
+#define LTC3676_MSKPG_BUCK2 (1 << 1)
+#define LTC3676_MSKPG_BUCK3 (1 << 2)
+#define LTC3676_MSKPG_BUCK4 (1 << 3)
+#define LTC3676_MSKPG_LDO2 (1 << 5)
+#define LTC3676_MSKPG_LDO3 (1 << 6)
+#define LTC3676_MSKPG_LDO4 (1 << 7)
+
+#define VDD_IO_VAL mV_to_regval(vout_to_vref(3300 * 10, 5))
+#define VDD_IO_VAL_LP mV_to_regval(vout_to_vref(3100 * 10, 5))
+#define VDD_IO_VAL_2 mV_to_regval(vout_to_vref(3300 * 10, 5_2))
+#define VDD_IO_VAL_2_LP mV_to_regval(vout_to_vref(3100 * 10, 5_2))
+#define VDD_SOC_VAL mV_to_regval(vout_to_vref(1425 * 10, 6))
+#define VDD_SOC_VAL_LP mV_to_regval(vout_to_vref(900 * 10, 6))
+#define VDD_DDR_VAL mV_to_regval(vout_to_vref(1500 * 10, 7))
+#define VDD_DDR_VAL_LP mV_to_regval(vout_to_vref(1500 * 10, 7))
+#define VDD_CORE_VAL mV_to_regval(vout_to_vref(1425 * 10, 8))
+#define VDD_CORE_VAL_LP mV_to_regval(vout_to_vref(900 * 10, 8))
+
+/* LDO1 */
+#define R1_1 470
+#define R2_1 150
+/* LDO4 */
+#define R1_4 470
+#define R2_4 150
+/* Buck1 */
+#define R1_5 390
+#define R2_5 110
+#define R1_5_2 470
+#define R2_5_2 150
+/* Buck2 (SOC) */
+#define R1_6 150
+#define R2_6 180
+/* Buck3 (DDR) */
+#define R1_7 150
+#define R2_7 140
+/* Buck4 (CORE) */
+#define R1_8 150
+#define R2_8 180
+
+/* calculate voltages in 10mV */
+#define R1(idx) R1_##idx
+#define R2(idx) R2_##idx
+
+#define vout_to_vref(vout, idx) ((vout) * R2(idx) / (R1(idx) + R2(idx)))
+#define vref_to_vout(vref, idx) DIV_ROUND_UP((vref) * (R1(idx) + R2(idx)), R2(idx))
+
+#define mV_to_regval(mV) DIV_ROUND(((((mV) < 4125) ? 4125 : (mV)) - 4125), 125)
+#define regval_to_mV(v) (((v) * 125 + 4125))
+
+static struct ltc3673_regs {
+ u8 addr;
+ u8 val;
+ u8 mask;
+} ltc3676_regs[] = {
+ { LTC3676_MSKPG, ~LTC3676_MSKPG_BUCK1, },
+ { LTC3676_DVB2B, VDD_SOC_VAL_LP | LTC3676_PGOOD_MASK, ~0x3f, },
+ { LTC3676_DVB3B, VDD_DDR_VAL_LP, ~0x3f, },
+ { LTC3676_DVB4B, VDD_CORE_VAL_LP | LTC3676_PGOOD_MASK, ~0x3f, },
+ { LTC3676_DVB2A, VDD_SOC_VAL, ~0x3f, },
+ { LTC3676_DVB3A, VDD_DDR_VAL, ~0x3f, },
+ { LTC3676_DVB4A, VDD_CORE_VAL, ~0x3f, },
+ { LTC3676_BUCK1, LTC3676_BUCK_BURST_MODE | LTC3676_BUCK_CLK_RATE_LOW, },
+ { LTC3676_BUCK2, LTC3676_BUCK_BURST_MODE, },
+ { LTC3676_BUCK3, LTC3676_BUCK_BURST_MODE, },
+ { LTC3676_BUCK4, LTC3676_BUCK_BURST_MODE, },
+ { LTC3676_CLIRQ, 0, }, /* clear interrupt status */
+};
+
+static struct ltc3673_regs ltc3676_regs_2[] = {
+ { LTC3676_DVB1B, VDD_IO_VAL_2_LP | LTC3676_PGOOD_MASK, ~0x3f, },
+ { LTC3676_DVB1A, VDD_IO_VAL_2, ~0x3f, },
+};
+
+
+static int setup_pmic_voltages(void)
+{
+ struct i2c_adapter *adapter = NULL;
+ struct i2c_client client;
+ int addr = 0x3c;
+ int bus = 0;
+ int i;
+ struct ltc3673_regs *r;
+
+ adapter = i2c_get_adapter(bus);
+ if (!adapter) {
+ pr_err("i2c bus %d not found\n", bus);
+ return -ENODEV;
+ }
+
+ client.adapter = adapter;
+ client.addr = addr;
+
+ r = ltc3676_regs;
+
+ for (i = 0; i < ARRAY_SIZE(ltc3676_regs); i++, r++) {
+ if (i2c_write_reg(&client, r->addr, &r->val, 1) != 1) {
+ pr_err("i2c write error\n");
+ return -EIO;
+ }
+ }
+
+ r = ltc3676_regs_2;
+
+ for (i = 0; i < ARRAY_SIZE(ltc3676_regs_2); i++, r++) {
+ if (i2c_write_reg(&client, r->addr, &r->val, 1) != 1) {
+ pr_err("i2c write error\n");
+ return -EIO;
+ }
+ }
+
+ return 0;
+}
+
+static void eth_init(void)
+{
+ void __iomem *iomux = (void *)MX6_IOMUXC_BASE_ADDR;
+ uint32_t val;
+
+ val = readl(iomux + IOMUXC_GPR1);
+ val |= IMX6Q_GPR1_ENET_CLK_SEL_ANATOP;
+ writel(val, iomux + IOMUXC_GPR1);
+}
+
+static int tx6x_devices_init(void)
+{
+ if (!of_machine_is_compatible("karo,imx6dl-tx6dl") &&
+ !of_machine_is_compatible("karo,imx6q-tx6q"))
+ return 0;
+
+ barebox_set_hostname("tx6u");
+
+ eth_init();
+
+ setup_pmic_voltages();
+
+ imx6_bbu_nand_register_handler("nand", BBU_HANDLER_FLAG_DEFAULT);
+
+ return 0;
+}
+device_initcall(tx6x_devices_init);
diff --git a/arch/arm/boards/karo-tx6x/flash-header-tx6dl-1g.imxcfg b/arch/arm/boards/karo-tx6x/flash-header-tx6dl-1g.imxcfg
new file mode 100644
index 0000000000..2a1c42aeed
--- /dev/null
+++ b/arch/arm/boards/karo-tx6x/flash-header-tx6dl-1g.imxcfg
@@ -0,0 +1,10 @@
+soc imx6
+loadaddr 0x20000000
+dcdofs 0x400
+
+#include <mach/imx6-ddr-regs.h>
+#include <mach/imx6dl-ddr-regs.h>
+#include <mach/imx6-ccm-regs.h>
+
+#include "ram-base.imxcfg"
+#include "1600mhz_4x128mx16.imxcfg"
diff --git a/arch/arm/boards/karo-tx6x/lowlevel.c b/arch/arm/boards/karo-tx6x/lowlevel.c
new file mode 100644
index 0000000000..00008d403c
--- /dev/null
+++ b/arch/arm/boards/karo-tx6x/lowlevel.c
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2014 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 <debug_ll.h>
+#include <common.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <image-metadata.h>
+#include <mach/generic.h>
+#include <sizes.h>
+
+static inline void setup_uart(void)
+{
+ void __iomem *ccmbase = (void *)MX6_CCM_BASE_ADDR;
+ void __iomem *uartbase = (void *)MX6_UART1_BASE_ADDR;
+ void __iomem *iomuxbase = (void *)MX6_IOMUXC_BASE_ADDR;
+
+ writel(0x1, iomuxbase + 0x0314);
+ writel(0x1, iomuxbase + 0x0318);
+ writel(0x1, iomuxbase + 0x0330);
+ writel(0x1, iomuxbase + 0x032c);
+
+ 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(0x00000784, uartbase + 0x88);
+ writel(0x00000a81, uartbase + 0x90);
+ writel(0x0000002b, uartbase + 0x9c);
+ writel(0x0001b0b0, uartbase + 0xb0);
+ writel(0x0000047f, uartbase + 0xa4);
+ writel(0x0000c34f, uartbase + 0xa8);
+ writel(0x00000001, uartbase + 0x80);
+
+ putc_ll('>');
+}
+
+extern char __dtb_imx6dl_tx6u_801x_start[];
+
+BAREBOX_IMD_TAG_STRING(tx6x_mx6_memsize_1G, IMD_TYPE_PARAMETER, "memsize=1024", 0);
+
+ENTRY_FUNCTION(start_imx6dl_tx6x_1g, r0, r1, r2)
+{
+ void *fdt;
+
+ imx6_cpu_lowlevel_init();
+
+ arm_setup_stack(0x00920000 - 8);
+
+ IMD_USED(tx6x_mx6_memsize_1G);
+
+ if (IS_ENABLED(CONFIG_DEBUG_LL))
+ setup_uart();
+
+ fdt = __dtb_imx6dl_tx6u_801x_start - get_runtime_offset();
+
+ barebox_arm_entry(0x10000000, SZ_1G, fdt);
+}
diff --git a/arch/arm/boards/karo-tx6x/ram-base.imxcfg b/arch/arm/boards/karo-tx6x/ram-base.imxcfg
new file mode 100644
index 0000000000..e912fb0f2b
--- /dev/null
+++ b/arch/arm/boards/karo-tx6x/ram-base.imxcfg
@@ -0,0 +1,71 @@
+wm 32 MX6_IOM_DRAM_DQM0 0x00020030
+wm 32 MX6_IOM_DRAM_DQM1 0x00020030
+wm 32 MX6_IOM_DRAM_DQM2 0x00020030
+wm 32 MX6_IOM_DRAM_DQM3 0x00020030
+wm 32 MX6_IOM_DRAM_DQM4 0x00020030
+wm 32 MX6_IOM_DRAM_DQM5 0x00020030
+wm 32 MX6_IOM_DRAM_DQM6 0x00020030
+wm 32 MX6_IOM_DRAM_DQM7 0x00020030
+
+wm 32 MX6_IOM_DRAM_ADDR00 0x00000000
+wm 32 MX6_IOM_DRAM_ADDR01 0x00000000
+wm 32 MX6_IOM_DRAM_ADDR02 0x00000000
+wm 32 MX6_IOM_DRAM_ADDR03 0x00000000
+wm 32 MX6_IOM_DRAM_ADDR04 0x00000000
+wm 32 MX6_IOM_DRAM_ADDR05 0x00000000
+wm 32 MX6_IOM_DRAM_ADDR06 0x00000000
+wm 32 MX6_IOM_DRAM_ADDR07 0x00000000
+wm 32 MX6_IOM_DRAM_ADDR08 0x00000000
+wm 32 MX6_IOM_DRAM_ADDR09 0x00000000
+wm 32 MX6_IOM_DRAM_ADDR10 0x00000000
+wm 32 MX6_IOM_DRAM_ADDR11 0x00000000
+wm 32 MX6_IOM_DRAM_ADDR12 0x00000000
+wm 32 MX6_IOM_DRAM_ADDR13 0x00000000
+wm 32 MX6_IOM_DRAM_ADDR14 0x00000000
+wm 32 MX6_IOM_DRAM_ADDR15 0x00000000
+
+wm 32 MX6_IOM_DRAM_CAS 0x00020030
+wm 32 MX6_IOM_DRAM_RAS 0x00020030
+wm 32 MX6_IOM_DRAM_SDCLK_0 0x00020030
+wm 32 MX6_IOM_DRAM_SDCLK_1 0x00020030
+
+wm 32 MX6_IOM_DRAM_RESET 0x00020030
+wm 32 MX6_IOM_DRAM_SDCKE0 0x00003000
+wm 32 MX6_IOM_DRAM_SDCKE1 0x00003000
+wm 32 MX6_IOM_DRAM_SDBA0 0x00000000
+wm 32 MX6_IOM_DRAM_SDBA1 0x00000000
+wm 32 MX6_IOM_DRAM_SDBA2 0x00000000
+wm 32 MX6_IOM_DRAM_SDODT0 0x00003030
+wm 32 MX6_IOM_DRAM_SDODT1 0x00003030
+wm 32 MX6_IOM_GRP_B0DS 0x00000030
+wm 32 MX6_IOM_GRP_B1DS 0x00000030
+wm 32 MX6_IOM_GRP_B2DS 0x00000030
+wm 32 MX6_IOM_GRP_B3DS 0x00000030
+wm 32 MX6_IOM_GRP_B4DS 0x00000030
+wm 32 MX6_IOM_GRP_B5DS 0x00000030
+wm 32 MX6_IOM_GRP_B6DS 0x00000030
+wm 32 MX6_IOM_GRP_B7DS 0x00000030
+wm 32 MX6_IOM_GRP_ADDDS 0x00000030
+
+/* (differential input) */
+wm 32 MX6_IOM_DDRMODE_CTL 0x00020000
+/* disable ddr pullups */
+wm 32 MX6_IOM_GRP_DDRPKE 0x00000000
+/* (differential input) */
+wm 32 MX6_IOM_GRP_DDRMODE 0x00020000
+wm 32 MX6_IOM_GRP_CTLDS 0x00000030
+
+wm 32 MX6_IOM_GRP_DDR_TYPE 0x000c0000
+wm 32 MX6_IOM_GRP_DDRPKE 0x00002000
+/* GRP_DDRHYS */
+wm 32 MX6_IOM_GRP_DDRHYS 0x00000000
+
+/* Read data DQ Byte0-3 delay */
+wm 32 MX6_MMDC_P0_MPRDDQBY0DL 0x33333333
+wm 32 MX6_MMDC_P0_MPRDDQBY1DL 0x33333333
+wm 32 MX6_MMDC_P0_MPRDDQBY2DL 0x33333333
+wm 32 MX6_MMDC_P0_MPRDDQBY3DL 0x33333333
+wm 32 MX6_MMDC_P1_MPRDDQBY0DL 0x33333333
+wm 32 MX6_MMDC_P1_MPRDDQBY1DL 0x33333333
+wm 32 MX6_MMDC_P1_MPRDDQBY2DL 0x33333333
+wm 32 MX6_MMDC_P1_MPRDDQBY3DL 0x33333333
diff --git a/arch/arm/configs/imx_v7_defconfig b/arch/arm/configs/imx_v7_defconfig
index cad47fdff3..2c8eb856cf 100644
--- a/arch/arm/configs/imx_v7_defconfig
+++ b/arch/arm/configs/imx_v7_defconfig
@@ -1,6 +1,7 @@
CONFIG_ARCH_IMX=y
CONFIG_IMX_MULTI_BOARDS=y
CONFIG_MACH_EFIKA_MX_SMARTBOOK=y
+CONFIG_MACH_EMBEDSKY_E9=y
CONFIG_MACH_FREESCALE_MX51_PDK=y
CONFIG_MACH_FREESCALE_MX53_LOCO=y
CONFIG_MACH_TQMA53=y
@@ -16,10 +17,10 @@ CONFIG_MACH_SABRELITE=y
CONFIG_MACH_SABRESD=y
CONFIG_MACH_NITROGEN6X=y
CONFIG_MACH_SOLIDRUN_MICROSOM=y
-CONFIG_MACH_EMBEDSKY_E9=y
CONFIG_MACH_EMBEST_RIOTBOARD=y
CONFIG_MACH_UDOO=y
CONFIG_MACH_VARISCITE_MX6=y
+CONFIG_MACH_GW_VENTANA=y
CONFIG_IMX_IIM=y
CONFIG_IMX_IIM_FUSE_BLOW=y
CONFIG_IMX_OCOTP=y
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 33fb4781c7..3fcd5f1cc0 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -18,6 +18,7 @@ pbl-dtb-$(CONFIG_MACH_GK802) += imx6q-gk802.dtb.o
pbl-dtb-$(CONFIG_MACH_GLOBALSCALE_GURUPLUG) += kirkwood-guruplug-server-plus-bb.dtb.o
pbl-dtb-$(CONFIG_MACH_GLOBALSCALE_MIRABOX) += armada-370-mirabox-bb.dtb.o
pbl-dtb-$(CONFIG_MACH_GUF_SANTARO) += imx6q-guf-santaro.dtb.o
+pbl-dtb-$(CONFIG_MACH_GW_VENTANA) += imx6q-gw54xx.dtb.o
pbl-dtb-$(CONFIG_MACH_MARVELL_ARMADA_XP_GP) += armada-xp-gp-bb.dtb.o
pbl-dtb-$(CONFIG_MACH_NITROGEN6X) += imx6q-nitrogen6x.dtb.o imx6dl-nitrogen6x.dtb.o
pbl-dtb-$(CONFIG_MACH_NVIDIA_BEAVER) += tegra30-beaver.dtb.o
@@ -42,6 +43,7 @@ pbl-dtb-$(CONFIG_MACH_TOSHIBA_AC100) += tegra20-paz00.dtb.o
pbl-dtb-$(CONFIG_MACH_TQMA53) += imx53-mba53.dtb.o
pbl-dtb-$(CONFIG_MACH_TQMA6X) += imx6dl-mba6x.dtb.o imx6q-mba6x.dtb.o
pbl-dtb-$(CONFIG_MACH_TX25) += imx25-karo-tx25.dtb.o
+pbl-dtb-$(CONFIG_MACH_TX6X) += imx6dl-tx6u-801x.dtb.o
pbl-dtb-$(CONFIG_MACH_UDOO) += imx6q-udoo.dtb.o
pbl-dtb-$(CONFIG_MACH_USI_TOPKICK) += kirkwood-topkick-bb.dtb.o
pbl-dtb-$(CONFIG_MACH_VARISCITE_MX6) += imx6q-var-custom.dtb.o
diff --git a/arch/arm/dts/imx6dl-tx6u-801x.dts b/arch/arm/dts/imx6dl-tx6u-801x.dts
new file mode 100644
index 0000000000..43104b2b88
--- /dev/null
+++ b/arch/arm/dts/imx6dl-tx6u-801x.dts
@@ -0,0 +1,65 @@
+#include <arm/imx6dl-tx6u-801x.dts>
+#include "imx6qdl.dtsi"
+
+/ {
+ model = "Ka-Ro electronics TX6U-801x Module";
+ compatible = "karo,imx6dl-tx6dl", "fsl,imx6dl";
+
+ chosen {
+ linux,stdout-path = &uart1;
+
+ environment@0 {
+ compatible = "barebox,environment";
+ device-path = &gpmi, "partname:barebox-environment";
+ };
+ };
+};
+
+&gpmi {
+ partition@0 {
+ label = "barebox";
+ reg = <0x0 0x100000>;
+ };
+
+ partition@1 {
+ label = "barebox-environment";
+ reg = <0x100000 0x100000>;
+ };
+};
+
+&iomuxc {
+ imx6qdl-tx6 {
+ pinctrl_hog: hoggrp {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_A18__GPIO2_IO20 0x1b0b1 /* LED */
+ MX6QDL_PAD_SD3_DAT2__GPIO7_IO06 0x1b0b1 /* ETN PHY RESET */
+ MX6QDL_PAD_SD3_DAT4__GPIO7_IO01 0x1b0b1 /* ETN PHY INT */
+ MX6QDL_PAD_EIM_A25__GPIO5_IO02 0x1b0b1 /* PWR BTN */
+ MX6QDL_PAD_EIM_D20__GPIO3_IO20 0x1b0b1 /* ETN PHY POWER */
+ >;
+ };
+
+ pinctrl_enet: enetgrp {
+ fsl,pins = <
+ MX6QDL_PAD_ENET_MDC__ENET_MDC 0x1b0b0
+ MX6QDL_PAD_ENET_MDIO__ENET_MDIO 0x1b0b0
+ MX6QDL_PAD_ENET_RXD0__ENET_RX_DATA0 0x1b0b0
+ MX6QDL_PAD_ENET_RXD1__ENET_RX_DATA1 0x1b0b0
+ MX6QDL_PAD_ENET_RX_ER__ENET_RX_ER 0x1b0b0
+ MX6QDL_PAD_ENET_TX_EN__ENET_TX_EN 0x1b0b0
+ MX6QDL_PAD_ENET_TXD0__ENET_TX_DATA0 0x1b0b0
+ MX6QDL_PAD_ENET_TXD1__ENET_TX_DATA1 0x1b0b0
+ MX6QDL_PAD_ENET_CRS_DV__ENET_RX_EN 0x1b0b0
+ MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0x4001b0b0
+ >;
+ };
+ };
+};
+
+&fec {
+ phy-reset-duration = <22>;
+};
+
+&ocotp {
+ barebox,provide-mac-address = <&fec 0x620>;
+};
diff --git a/arch/arm/dts/imx6q-gw54xx.dts b/arch/arm/dts/imx6q-gw54xx.dts
new file mode 100644
index 0000000000..ab518d66a7
--- /dev/null
+++ b/arch/arm/dts/imx6q-gw54xx.dts
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2013 Gateworks Corporation
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+#include "imx6q.dtsi"
+#include "imx6qdl-gw54xx.dtsi"
+
+/ {
+ model = "Gateworks Ventana i.MX6 Quad GW54XX";
+ compatible = "gw,imx6q-gw54xx", "gw,ventana", "fsl,imx6q";
+};
+
+&sata {
+ status = "okay";
+};
diff --git a/arch/arm/dts/imx6qdl-gw54xx.dtsi b/arch/arm/dts/imx6qdl-gw54xx.dtsi
new file mode 100644
index 0000000000..ea5739ddcb
--- /dev/null
+++ b/arch/arm/dts/imx6qdl-gw54xx.dtsi
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2013 Gateworks Corporation
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+ #include <arm/imx6qdl-gw54xx.dtsi>
+
+ / {
+ chosen {
+ linux,stdout-path = &uart2;
+
+ environment@0 {
+ compatible = "barebox,environment";
+ device-path = &gpmi, "partname:barebox-environment";
+ };
+ };
+};
+
+&gpmi {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "barebox";
+ reg = <0x0 0x400000>;
+ };
+
+ partition@1 {
+ label = "barebox-environment";
+ reg = <0x400000 0x20000>;
+ };
+};
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 53a44a06e9..ef7c0a1963 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -261,6 +261,10 @@ config MACH_TQMA6X
bool "TQ tqma6x on mba6x"
select ARCH_IMX6
+config MACH_TX6X
+ bool "Karo TX6x"
+ select ARCH_IMX6
+
config MACH_SABRELITE
bool "Freescale i.MX6 Sabre Lite"
select ARCH_IMX6
@@ -291,6 +295,9 @@ config MACH_VARISCITE_MX6
bool "Variscite i.MX6 Quad SOM"
select ARCH_IMX6
+config MACH_GW_VENTANA
+ bool "Gateworks Ventana SBC"
+ select ARCH_IMX6
endif
diff --git a/arch/arm/mach-imx/include/mach/imx35-regs.h b/arch/arm/mach-imx/include/mach/imx35-regs.h
index bbfde2339a..b30037cf83 100644
--- a/arch/arm/mach-imx/include/mach/imx35-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx35-regs.h
@@ -153,6 +153,7 @@
#define MX35_CCM_CGR1_FEC_SHIFT 0
#define MX35_CCM_CGR1_I2C1_SHIFT 10
#define MX35_CCM_CGR1_SDHC1_SHIFT 26
+#define MX35_CCM_CGR2_UART2_SHIFT 18
#define MX35_CCM_CGR2_USB_SHIFT 22
#define MX35_CCM_RCSR_MEM_CTRL_SHIFT 25
diff --git a/arch/arm/mach-imx/include/mach/imx6-ddr-regs.h b/arch/arm/mach-imx/include/mach/imx6-ddr-regs.h
index 69707f0976..ac2764f1b6 100644
--- a/arch/arm/mach-imx/include/mach/imx6-ddr-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx6-ddr-regs.h
@@ -37,6 +37,9 @@
#define MX6_MMDC_P0_MPDGCTRL1 0x021b0840
#define MX6_MMDC_P0_MPRDDLCTL 0x021b0848
#define MX6_MMDC_P0_MPWRDLCTL 0x021b0850
+#define MX6_MMDC_P0_MPRDDLHWCTL 0x021b0860
+#define MX6_MMDC_P0_MPWRDLHWCTL 0x021b0864
+#define MX6_MMDC_P0_MPPDCMPR2 0x021b0890
#define MX6_MMDC_P0_MPMUR0 0x021b08b8
#define MX6_MMDC_P1_MDCTL 0x021b4000
@@ -64,4 +67,7 @@
#define MX6_MMDC_P1_MPDGCTRL1 0x021b4840
#define MX6_MMDC_P1_MPRDDLCTL 0x021b4848
#define MX6_MMDC_P1_MPWRDLCTL 0x021b4850
+#define MX6_MMDC_P1_MPRDDLHWCTL 0x021b4860
+#define MX6_MMDC_P1_MPWRDLHWCTL 0x021b4864
+#define MX6_MMDC_P1_MPPDCMPR2 0x021b4890
#define MX6_MMDC_P1_MPMUR0 0x021b48b8
diff --git a/arch/arm/mach-imx/include/mach/imx6dl-ddr-regs.h b/arch/arm/mach-imx/include/mach/imx6dl-ddr-regs.h
index 541d00e244..a312e63a99 100644
--- a/arch/arm/mach-imx/include/mach/imx6dl-ddr-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx6dl-ddr-regs.h
@@ -12,6 +12,23 @@
* GNU General Public License for more details.
*/
+#define MX6_IOM_DRAM_ADDR00 0x020e0424
+#define MX6_IOM_DRAM_ADDR01 0x020e0428
+#define MX6_IOM_DRAM_ADDR10 0x020e042c
+#define MX6_IOM_DRAM_ADDR11 0x020e0430
+#define MX6_IOM_DRAM_ADDR12 0x020e0434
+#define MX6_IOM_DRAM_ADDR13 0x020e0438
+#define MX6_IOM_DRAM_ADDR14 0x020e043c
+#define MX6_IOM_DRAM_ADDR15 0x020e0440
+#define MX6_IOM_DRAM_ADDR02 0x020e0444
+#define MX6_IOM_DRAM_ADDR03 0x020e0448
+#define MX6_IOM_DRAM_ADDR04 0x020e044c
+#define MX6_IOM_DRAM_ADDR05 0x020e0450
+#define MX6_IOM_DRAM_ADDR06 0x020e0454
+#define MX6_IOM_DRAM_ADDR07 0x020e0458
+#define MX6_IOM_DRAM_ADDR08 0x020e045c
+#define MX6_IOM_DRAM_ADDR09 0x020e0460
+
#define MX6_IOM_DRAM_DQM0 0x020e0470
#define MX6_IOM_DRAM_DQM1 0x020e0474
#define MX6_IOM_DRAM_DQM2 0x020e0478
@@ -24,6 +41,8 @@
#define MX6_IOM_DRAM_CAS 0x020e0464
#define MX6_IOM_DRAM_RAS 0x020e0490
#define MX6_IOM_DRAM_RESET 0x020e0494
+#define MX6_IOM_DRAM_SDBA0 0x020e0498
+#define MX6_IOM_DRAM_SDBA1 0x020e049c
#define MX6_IOM_DRAM_SDCLK_0 0x020e04ac
#define MX6_IOM_DRAM_SDCLK_1 0x020e04b0
#define MX6_IOM_DRAM_SDBA2 0x020e04a0
@@ -52,6 +71,7 @@
#define MX6_IOM_GRP_ADDDS 0x020e074c
#define MX6_IOM_DDRMODE_CTL 0x020e0750
#define MX6_IOM_GRP_DDRPKE 0x020e0754
+#define MX6_IOM_GRP_DDRHYS 0x020e075c
#define MX6_IOM_GRP_DDRMODE 0x020e0760
#define MX6_IOM_GRP_CTLDS 0x020e076c
#define MX6_IOM_GRP_DDR_TYPE 0x020e0774