summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2019-01-16 10:29:52 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-01-18 09:43:10 +0100
commit2787c15908a42dc3ee35e1a8037c634afe535b37 (patch)
tree3fb3188dacd8f72bb22d018674baebef3d7b2c24 /arch
parent51b307f6ec4c1cdb53771ef016f93aeef8831e97 (diff)
downloadbarebox-2787c15908a42dc3ee35e1a8037c634afe535b37.tar.gz
barebox-2787c15908a42dc3ee35e1a8037c634afe535b37.tar.xz
ARM: imx: add support for Udoo Neo full
Original patch from Uwe Kleine-König, I fixed the review comments and the imxcfg file to use the udoo neo values. I also tested the support on the udoo neo full board. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boards/Makefile1
-rw-r--r--arch/arm/boards/udoo-neo/Makefile2
-rw-r--r--arch/arm/boards/udoo-neo/board.c27
-rw-r--r--arch/arm/boards/udoo-neo/flash-header-mx6sx-udoo-neo_full.imxcfg131
-rw-r--r--arch/arm/boards/udoo-neo/lowlevel.c39
-rw-r--r--arch/arm/dts/Makefile1
-rw-r--r--arch/arm/dts/imx6sx-udoo-neo-full.dts4
-rw-r--r--arch/arm/mach-imx/Kconfig4
-rw-r--r--arch/arm/mach-imx/include/mach/esdctl.h1
9 files changed, 210 insertions, 0 deletions
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index ab5191fe04..b806f58bc1 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -139,6 +139,7 @@ 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_UDOO_NEO) += udoo-neo/
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/udoo-neo/Makefile b/arch/arm/boards/udoo-neo/Makefile
new file mode 100644
index 0000000000..01c7a259e9
--- /dev/null
+++ b/arch/arm/boards/udoo-neo/Makefile
@@ -0,0 +1,2 @@
+obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/udoo-neo/board.c b/arch/arm/boards/udoo-neo/board.c
new file mode 100644
index 0000000000..9bf480305d
--- /dev/null
+++ b/arch/arm/boards/udoo-neo/board.c
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2014 Pengutronix, Sascha Hauer
+ *
+ * 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 <linux/clk.h>
+
+static int imx6sx_udoneo_coredevices_init(void)
+{
+ if (!of_machine_is_compatible("fsl,imx6sx-udoo-neo"))
+ return 0;
+
+ barebox_set_hostname("mx6sx-udooneo");
+
+ return 0;
+}
+coredevice_initcall(imx6sx_udoneo_coredevices_init);
diff --git a/arch/arm/boards/udoo-neo/flash-header-mx6sx-udoo-neo_full.imxcfg b/arch/arm/boards/udoo-neo/flash-header-mx6sx-udoo-neo_full.imxcfg
new file mode 100644
index 0000000000..39f2a8a221
--- /dev/null
+++ b/arch/arm/boards/udoo-neo/flash-header-mx6sx-udoo-neo_full.imxcfg
@@ -0,0 +1,131 @@
+/*
+ * These values are taken from:
+ * repository: https://github.com/UDOOboard/uboot-imx
+ * branch: udoo/2015.04.imx
+ * file: board/udoo/udoo_neo/udoo_neo.cfg
+ */
+
+loadaddr 0x80000000
+soc imx6
+dcdofs 0x400
+
+/* Enable all clocks */
+wm 32 0x020c4068 0xffffffff
+wm 32 0x020c406c 0xffffffff
+wm 32 0x020c4070 0xffffffff
+wm 32 0x020c4074 0xffffffff
+wm 32 0x020c4078 0xffffffff
+wm 32 0x020c407c 0xffffffff
+wm 32 0x020c4080 0xffffffff
+wm 32 0x020c4084 0xffffffff
+/********************************************/
+
+/* IOMUX */
+/* DDR IO TYPE */
+wm 32 0x020e0618 0x000c0000
+wm 32 0x020e05fc 0x00000000
+/********************************************/
+
+/* CLOCK */
+wm 32 0x020e032c 0x00000030
+/********************************************/
+
+/* ADDRESS */
+wm 32 0x020e0300 0x00000020
+wm 32 0x020e02fc 0x00000020
+wm 32 0x020e05f4 0x00000020
+/********************************************/
+
+/* CONTROL */
+wm 32 0x020e0340 0x00000020
+
+wm 32 0x020e0320 0x00000000
+wm 32 0x020e0310 0x00000020
+wm 32 0x020e0314 0x00000020
+wm 32 0x020e0614 0x00000020
+/********************************************/
+
+/* DATA STROBE */
+wm 32 0x020e05f8 0x00020000
+wm 32 0x020e0330 0x00000028
+wm 32 0x020e0334 0x00000028
+wm 32 0x020e0338 0x00000028
+wm 32 0x020e033c 0x00000028
+/********************************************/
+
+/* DATA */
+wm 32 0x020e0608 0x00020000
+wm 32 0x020e060c 0x00000028
+wm 32 0x020e0610 0x00000028
+wm 32 0x020e061c 0x00000028
+wm 32 0x020e0620 0x00000028
+wm 32 0x020e02ec 0x00000028
+wm 32 0x020e02f0 0x00000028
+wm 32 0x020e02f4 0x00000028
+wm 32 0x020e02f8 0x00000028
+/********************************************/
+
+/* Calibrations */
+/* ZQ */
+wm 32 0x021b0800 0xa1390003
+/********************************************/
+
+/* write leveling */
+wm 32 0x021b080c 0x000E000B
+wm 32 0x021b0810 0x000E0010
+/********************************************/
+
+/* DQS Read Gate */
+wm 32 0x021b083c 0x41600158
+wm 32 0x021b0840 0x01500140
+/********************************************/
+
+/* Read/Write Delay */
+wm 32 0x021b0848 0x3A383E3E
+wm 32 0x021b0850 0x3A383C38
+/********************************************/
+
+/* read data bit delay */
+wm 32 0x021b081c 0x33333333
+wm 32 0x021b0820 0x33333333
+wm 32 0x021b0824 0x33333333
+wm 32 0x021b0828 0x33333333
+/********************************************/
+
+/* Complete calibration by forced measurment */
+wm 32 0x021b08b8 0x00000800
+/********************************************/
+
+/* MMDC init */
+/* in DDR3, 64-bit mode, only MMDC0 is initiated */
+wm 32 0x021b0004 0x0002002d
+wm 32 0x021b0008 0x00333030
+wm 32 0x021b000c 0x676b52f3
+wm 32 0x021b0010 0xb66d8b63
+wm 32 0x021b0014 0x01ff00db
+wm 32 0x021b0018 0x00011740
+wm 32 0x021b001c 0x00008000
+wm 32 0x021b002c 0x000026d2
+wm 32 0x021b0030 0x006b1023
+wm 32 0x021b0040 0x0000005f
+wm 32 0x021b0000 0x83190000
+/********************************************/
+
+/* Initialize MT41K256M16HA-125 */
+/* MR2 */
+wm 32 0x021b001c 0x04008032
+/* MR3 */
+wm 32 0x021b001c 0x00008033
+/* MR1 */
+wm 32 0x021b001c 0x00048031
+/* MR0 */
+wm 32 0x021b001c 0x05208030
+/* DDR device ZQ calibration */
+wm 32 0x021b001c 0x04008040
+/********************************************/
+
+/* final DDR setup, before operation start */
+wm 32 0x021b0020 0x00000800
+wm 32 0x021b0818 0x00011117
+wm 32 0x021b001c 0x00000000
+/********************************************/
diff --git a/arch/arm/boards/udoo-neo/lowlevel.c b/arch/arm/boards/udoo-neo/lowlevel.c
new file mode 100644
index 0000000000..bb6b7d8332
--- /dev/null
+++ b/arch/arm/boards/udoo-neo/lowlevel.c
@@ -0,0 +1,39 @@
+#include <debug_ll.h>
+#include <common.h>
+#include <linux/sizes.h>
+#include <mach/generic.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/esdctl.h>
+
+static inline void setup_uart(void)
+{
+ void __iomem *iomuxbase = (void *)MX6_IOMUXC_BASE_ADDR;
+
+ imx6_ungate_all_peripherals();
+
+ writel(0x0, iomuxbase + 0x24);
+ writel(0x1b0b1, iomuxbase + 0x036C);
+ writel(0x0, iomuxbase + 0x28);
+ writel(0x1b0b1, iomuxbase + 0x0370);
+
+ imx6_uart_setup_ll();
+
+ putc_ll('>');
+}
+
+extern char __dtb_imx6sx_udoo_neo_full_start[];
+
+ENTRY_FUNCTION(start_imx6sx_udoo_neo, r0, r1, r2)
+{
+ void *fdt;
+
+ imx6_cpu_lowlevel_init();
+
+ if (IS_ENABLED(CONFIG_DEBUG_LL))
+ setup_uart();
+
+ fdt = __dtb_imx6sx_udoo_neo_full_start + get_runtime_offset();
+
+ imx6sx_barebox_entry(fdt);
+}
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index caa97e7137..20606c3c7a 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -100,6 +100,7 @@ pbl-dtb-$(CONFIG_MACH_TX6X) += imx6dl-tx6u.dtb.o
pbl-dtb-$(CONFIG_MACH_TX6X) += imx6q-tx6q.dtb.o
pbl-dtb-$(CONFIG_MACH_TURRIS_OMNIA) += armada-385-turris-omnia-bb.dtb.o
pbl-dtb-$(CONFIG_MACH_UDOO) += imx6q-udoo.dtb.o
+pbl-dtb-$(CONFIG_MACH_UDOO_NEO) += imx6sx-udoo-neo-full.dtb.o
pbl-dtb-$(CONFIG_MACH_USI_TOPKICK) += kirkwood-topkick-bb.dtb.o
pbl-dtb-$(CONFIG_MACH_VARISCITE_MX6) += imx6q-var-custom.dtb.o
pbl-dtb-$(CONFIG_MACH_VEXPRESS) += vexpress-v2p-ca9.dtb.o
diff --git a/arch/arm/dts/imx6sx-udoo-neo-full.dts b/arch/arm/dts/imx6sx-udoo-neo-full.dts
new file mode 100644
index 0000000000..9203d40207
--- /dev/null
+++ b/arch/arm/dts/imx6sx-udoo-neo-full.dts
@@ -0,0 +1,4 @@
+#include <arm/imx6sx-udoo-neo-full.dts>
+
+/{
+};
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 44ca27096b..784279ebd9 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -395,6 +395,10 @@ config MACH_UDOO
bool "Freescale i.MX6 UDOO Board"
select ARCH_IMX6
+config MACH_UDOO_NEO
+ bool "i.MX6 UDOO Neo Board (full variant)"
+ select ARCH_IMX6SX
+
config MACH_VARISCITE_MX6
bool "Variscite i.MX6 Quad SOM"
select ARCH_IMX6
diff --git a/arch/arm/mach-imx/include/mach/esdctl.h b/arch/arm/mach-imx/include/mach/esdctl.h
index bc6c733953..18c4a28360 100644
--- a/arch/arm/mach-imx/include/mach/esdctl.h
+++ b/arch/arm/mach-imx/include/mach/esdctl.h
@@ -141,6 +141,7 @@ void __noreturn imx6ul_barebox_entry(void *boarddata);
void __noreturn vf610_barebox_entry(void *boarddata);
void __noreturn imx8mq_barebox_entry(void *boarddata);
void __noreturn imx7d_barebox_entry(void *boarddata);
+#define imx6sx_barebox_entry(boarddata) imx6ul_barebox_entry(boarddata)
void imx_esdctl_disable(void);
#endif