summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-02-04 19:09:15 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-02-04 19:09:15 +0100
commit7b0f932bcdfadf37e8d25388b29266faa3d3c824 (patch)
treeec1f5f9ccea83367d0e75c360c1532c575d65f44 /arch/arm/boards
parentce961e341258dc9f78da3c0d64231cf1afdc4e63 (diff)
parent99dc5005935070e1680e5f08dd1cd9eee1f2f284 (diff)
downloadbarebox-7b0f932bcdfadf37e8d25388b29266faa3d3c824.tar.gz
barebox-7b0f932bcdfadf37e8d25388b29266faa3d3c824.tar.xz
Merge branch 'for-next/mxs'
Diffstat (limited to 'arch/arm/boards')
-rw-r--r--arch/arm/boards/Makefile1
-rw-r--r--arch/arm/boards/crystalfontz-cfa10036/cfa10036.c3
-rw-r--r--arch/arm/boards/duckbill/Makefile2
-rw-r--r--arch/arm/boards/duckbill/board.c82
-rw-r--r--arch/arm/boards/duckbill/lowlevel.c73
-rw-r--r--arch/arm/boards/freescale-mx28-evk/env/config50
-rw-r--r--arch/arm/boards/freescale-mx28-evk/lowlevel.c58
-rw-r--r--arch/arm/boards/freescale-mx28-evk/mx28-evk.c2
-rw-r--r--arch/arm/boards/imx233-olinuxino/lowlevel.c2
-rw-r--r--arch/arm/boards/karo-tx28/lowlevel.c2
-rw-r--r--arch/arm/boards/karo-tx28/tx28-stk5.c3
11 files changed, 216 insertions, 62 deletions
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index bf04f38dcd..f9daa08a38 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_MACH_CFA10036) += crystalfontz-cfa10036/
obj-$(CONFIG_MACH_CHUMBY) += chumby_falconwing/
obj-$(CONFIG_MACH_CLEP7212) += clep7212/
obj-$(CONFIG_MACH_DFI_FS700_M60) += dfi-fs700-m60/
+obj-$(CONFIG_MACH_DUCKBILL) += duckbill/
obj-$(CONFIG_MACH_DSS11) += dss11/
obj-$(CONFIG_MACH_EDB93012) += edb93xx/
obj-$(CONFIG_MACH_EDB9301) += edb93xx/
diff --git a/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c b/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c
index 1412eff4a7..6e83570c55 100644
--- a/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c
+++ b/arch/arm/boards/crystalfontz-cfa10036/cfa10036.c
@@ -127,9 +127,6 @@ static int cfa10036_devices_init(void)
add_generic_device("mxs_mci", 0, NULL, IMX_SSP0_BASE, SZ_8K,
IORESOURCE_MEM, &mci_pdata);
- add_generic_device("ocotp", 0, NULL, IMX_OCOTP_BASE, SZ_8K,
- IORESOURCE_MEM, NULL);
-
i2c_register_board_info(0, cfa10036_i2c_devices, ARRAY_SIZE(cfa10036_i2c_devices));
add_generic_device_res("i2c-gpio", 0, NULL, 0, &i2c_gpio_pdata);
diff --git a/arch/arm/boards/duckbill/Makefile b/arch/arm/boards/duckbill/Makefile
new file mode 100644
index 0000000000..01c7a259e9
--- /dev/null
+++ b/arch/arm/boards/duckbill/Makefile
@@ -0,0 +1,2 @@
+obj-y += board.o
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/duckbill/board.c b/arch/arm/boards/duckbill/board.c
new file mode 100644
index 0000000000..3c6ab8e596
--- /dev/null
+++ b/arch/arm/boards/duckbill/board.c
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2010 Juergen Beisert, Pengutronix <kernel@pengutronix.de>
+ * Copyright (C) 2011 Marc Kleine-Budde, Pengutronix <mkl@pengutronix.de>
+ * Copyright (C) 2011 Wolfram Sang, Pengutronix <w.sang@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 <common.h>
+#include <environment.h>
+#include <errno.h>
+#include <gpio.h>
+#include <init.h>
+#include <io.h>
+#include <net.h>
+
+#include <mach/clock.h>
+#include <mach/imx-regs.h>
+#include <mach/iomux-imx28.h>
+#include <mach/iomux.h>
+#include <mach/ocotp.h>
+#include <mach/devices.h>
+#include <mach/usb.h>
+#include <usb/fsl_usb2.h>
+
+#include <asm/armlinux.h>
+#include <asm/mmu.h>
+
+static void duckbill_get_ethaddr(void)
+{
+ u8 mac_ocotp[3], mac[6];
+ int ret;
+
+ ret = mxs_ocotp_read(mac_ocotp, 3, 0);
+ if (ret != 3) {
+ pr_err("Reading MAC from OCOTP failed!\n");
+ return;
+ }
+
+ mac[0] = 0x00;
+ mac[1] = 0x04;
+ mac[2] = 0x9f;
+ mac[3] = mac_ocotp[2];
+ mac[4] = mac_ocotp[1];
+ mac[5] = mac_ocotp[0];
+
+ eth_register_ethaddr(0, mac);
+}
+
+static struct fsl_usb2_platform_data usb_pdata = {
+ .operating_mode = FSL_USB2_DR_DEVICE,
+ .phy_mode = FSL_USB2_PHY_UTMI,
+};
+
+static int duckbill_devices_init(void)
+{
+ duckbill_get_ethaddr(); /* must be after registering ocotp */
+
+ imx28_usb_phy0_enable();
+ add_generic_device("fsl-udc", DEVICE_ID_DYNAMIC, NULL, IMX_USB0_BASE,
+ 0x200, IORESOURCE_MEM, &usb_pdata);
+
+ return 0;
+}
+fs_initcall(duckbill_devices_init);
+
+static int duckbill_console_init(void)
+{
+ barebox_set_model("I2SE Duckbill");
+ barebox_set_hostname("duckbill");
+
+ return 0;
+}
+console_initcall(duckbill_console_init);
diff --git a/arch/arm/boards/duckbill/lowlevel.c b/arch/arm/boards/duckbill/lowlevel.c
new file mode 100644
index 0000000000..77d2e83aed
--- /dev/null
+++ b/arch/arm/boards/duckbill/lowlevel.c
@@ -0,0 +1,73 @@
+#define pr_fmt(fmt) "Freescale MX28evk: " fmt
+#define DEBUG
+
+#include <common.h>
+#include <linux/sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/imx28-regs.h>
+#include <mach/init.h>
+#include <io.h>
+#include <debug_ll.h>
+#include <mach/iomux.h>
+#include <stmp-device.h>
+
+extern char __dtb_imx28_duckbill_start[];
+
+ENTRY_FUNCTION(start_barebox_duckbill, r0, r1, r2)
+{
+ void *fdt;
+
+ pr_debug("here we are!\n");
+
+ fdt = __dtb_imx28_duckbill_start - get_runtime_offset();
+
+ barebox_arm_entry(IMX_MEMORY_BASE, SZ_128M, fdt);
+}
+
+static const uint32_t iomux_pads[] = {
+ /* EMI */
+ EMI_DATA0, EMI_DATA1, EMI_DATA2, EMI_DATA3, EMI_DATA4, EMI_DATA5,
+ EMI_DATA6, EMI_DATA7, EMI_DATA8, EMI_DATA9, EMI_DATA10, EMI_DATA11,
+ EMI_DATA12, EMI_DATA13, EMI_DATA14, EMI_DATA15, EMI_ODT0, EMI_DQM0,
+ EMI_ODT1, EMI_DQM1, EMI_DDR_OPEN_FB, EMI_CLK, EMI_DSQ0, EMI_DSQ1,
+ EMI_DDR_OPEN, EMI_A0, EMI_A1, EMI_A2, EMI_A3, EMI_A4, EMI_A5,
+ EMI_A6, EMI_A7, EMI_A8, EMI_A9, EMI_A10, EMI_A11, EMI_A12, EMI_A13,
+ EMI_A14, EMI_BA0, EMI_BA1, EMI_BA2, EMI_CASN, EMI_RASN, EMI_WEN,
+ EMI_CE0N, EMI_CE1N, EMI_CKE,
+
+ /* Debug UART */
+ PWM0_DUART_RX | VE_3_3V,
+ PWM1_DUART_TX | VE_3_3V,
+};
+
+static noinline void duckbill_init(void)
+{
+ int i;
+
+ /* initialize muxing */
+ for (i = 0; i < ARRAY_SIZE(iomux_pads); i++)
+ imx_gpio_mode(iomux_pads[i]);
+
+ pr_debug("initializing power...\n");
+
+ mx28_power_init(0, 0, 1);
+
+ pr_debug("initializing SDRAM...\n");
+
+ mx28_mem_init();
+
+ pr_debug("DONE\n");
+}
+
+ENTRY_FUNCTION(prep_start_barebox_duckbill, r0, r1, r2)
+{
+ void (*back)(unsigned long) = (void *)get_lr();
+
+ relocate_to_current_adr();
+ setup_c();
+
+ duckbill_init();
+
+ back(0);
+}
diff --git a/arch/arm/boards/freescale-mx28-evk/env/config b/arch/arm/boards/freescale-mx28-evk/env/config
deleted file mode 100644
index adbe7f4973..0000000000
--- a/arch/arm/boards/freescale-mx28-evk/env/config
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/sh
-
-#user=
-
-# use 'dhcp' to do dhcp in barebox and in kernel
-# use 'none' if you want to skip kernel ip autoconfiguration
-ip=dhcp
-
-# or set your networking parameters here
-#eth0.ipaddr=a.b.c.d
-#eth0.netmask=a.b.c.d
-#eth0.serverip=a.b.c.d
-#eth0.gateway=a.b.c.d
-#eth0.ethaddr=de:ad:be:ef:00:00
-
-# can be either 'tftp', 'nfs', 'nand', 'nor' or 'disk'
-kernel_loc=tftp
-# can be either 'net', 'nand', 'nor', 'disk' or 'initrd'
-rootfs_loc=net
-
-# for flash based rootfs: 'jffs2' or 'ubifs'
-# in case of disk any regular filesystem like 'ext2', 'ext3', 'reiserfs'
-rootfs_type=ext2
-# where is the rootfs in case of 'rootfs_loc=disk' (linux name)
-rootfs_part_linux_dev=mmcblk0p4
-rootfsimage=rootfs-${global.hostname}.$rootfs_type
-
-# where is the kernel image in case of 'kernel_loc=disk'
-kernel_part=disk0.2
-
-kernelimage=zImage-${global.hostname}
-bareboximage=barebox-${global.hostname}.bin
-bareboxenvimage=barebox-${global.hostname}.bin
-
-if [ -n $user ]; then
- bareboximage="$user"-"$bareboximage"
- bareboxenvimage="$user"-"$bareboxenvimage"
- kernelimage="$user"-"$kernelimage"
- rootfsimage="$user"-"$rootfsimage"
- nfsroot="/home/$user/nfsroot/${global.hostname}"
-else
- nfsroot="/path/to/nfs/root"
-fi
-
-autoboot_timeout=3
-
-bootargs="console=ttyAMA0,115200"
-
-# set a fancy prompt (if support is compiled in)
-PS1="\e[1;32mbarebox@\e[1;31m\h:\w\e[0m "
diff --git a/arch/arm/boards/freescale-mx28-evk/lowlevel.c b/arch/arm/boards/freescale-mx28-evk/lowlevel.c
index 3c7248ef65..1f567568da 100644
--- a/arch/arm/boards/freescale-mx28-evk/lowlevel.c
+++ b/arch/arm/boards/freescale-mx28-evk/lowlevel.c
@@ -1,11 +1,65 @@
+#define pr_fmt(fmt) "Freescale MX28evk: " fmt
+#define DEBUG
+
#include <common.h>
#include <linux/sizes.h>
#include <asm/barebox-arm-head.h>
#include <asm/barebox-arm.h>
#include <mach/imx28-regs.h>
+#include <mach/init.h>
+#include <io.h>
+#include <debug_ll.h>
+#include <mach/iomux.h>
+#include <stmp-device.h>
-void __naked barebox_arm_reset_vector(void)
+ENTRY_FUNCTION(start_barebox_freescale_mx28evk, r0, r1, r2)
{
- arm_cpu_lowlevel_init();
barebox_arm_entry(IMX_MEMORY_BASE, SZ_128M, NULL);
}
+
+static const uint32_t iomux_pads[] = {
+ /* EMI */
+ EMI_DATA0, EMI_DATA1, EMI_DATA2, EMI_DATA3, EMI_DATA4, EMI_DATA5,
+ EMI_DATA6, EMI_DATA7, EMI_DATA8, EMI_DATA9, EMI_DATA10, EMI_DATA11,
+ EMI_DATA12, EMI_DATA13, EMI_DATA14, EMI_DATA15, EMI_ODT0, EMI_DQM0,
+ EMI_ODT1, EMI_DQM1, EMI_DDR_OPEN_FB, EMI_CLK, EMI_DSQ0, EMI_DSQ1,
+ EMI_DDR_OPEN, EMI_A0, EMI_A1, EMI_A2, EMI_A3, EMI_A4, EMI_A5,
+ EMI_A6, EMI_A7, EMI_A8, EMI_A9, EMI_A10, EMI_A11, EMI_A12, EMI_A13,
+ EMI_A14, EMI_BA0, EMI_BA1, EMI_BA2, EMI_CASN, EMI_RASN, EMI_WEN,
+ EMI_CE0N, EMI_CE1N, EMI_CKE,
+
+ /* Debug UART */
+ PWM0_DUART_RX | VE_3_3V,
+ PWM1_DUART_TX | VE_3_3V,
+};
+
+static noinline void freescale_mx28evk_init(void)
+{
+ int i;
+
+ /* initialize muxing */
+ for (i = 0; i < ARRAY_SIZE(iomux_pads); i++)
+ imx_gpio_mode(iomux_pads[i]);
+
+ pr_debug("initializing power...\n");
+
+ mx28_power_init(0, 1, 0);
+
+ pr_debug("initializing SDRAM...\n");
+
+ mx28_mem_init();
+
+ pr_debug("DONE\n");
+}
+
+ENTRY_FUNCTION(prep_start_barebox_freescale_mx28evk, r0, r1, r2)
+{
+ void (*back)(unsigned long) = (void *)get_lr();
+
+ relocate_to_current_adr();
+ setup_c();
+
+ freescale_mx28evk_init();
+
+ back(0);
+}
diff --git a/arch/arm/boards/freescale-mx28-evk/mx28-evk.c b/arch/arm/boards/freescale-mx28-evk/mx28-evk.c
index dce6d31030..d77a6c7156 100644
--- a/arch/arm/boards/freescale-mx28-evk/mx28-evk.c
+++ b/arch/arm/boards/freescale-mx28-evk/mx28-evk.c
@@ -275,8 +275,6 @@ static int mx28_evk_devices_init(void)
add_generic_device("stmfb", 0, NULL, IMX_FB_BASE, 0x2000,
IORESOURCE_MEM, &mx28_evk_fb_pdata);
- add_generic_device("ocotp", 0, NULL, IMX_OCOTP_BASE, 0x2000,
- IORESOURCE_MEM, NULL);
mx28_evk_get_ethaddr(); /* must be after registering ocotp */
mx28_evk_fec_reset();
diff --git a/arch/arm/boards/imx233-olinuxino/lowlevel.c b/arch/arm/boards/imx233-olinuxino/lowlevel.c
index 6e4b830485..ce46f7e143 100644
--- a/arch/arm/boards/imx233-olinuxino/lowlevel.c
+++ b/arch/arm/boards/imx233-olinuxino/lowlevel.c
@@ -154,7 +154,7 @@ static noinline void imx23_olinuxino_init(void)
pr_debug("initializing power...\n");
- mx23_power_init();
+ mx23_power_init(0, 1, 0);
pr_debug("initializing SDRAM...\n");
diff --git a/arch/arm/boards/karo-tx28/lowlevel.c b/arch/arm/boards/karo-tx28/lowlevel.c
index c5fdda1902..96a8b9bfc6 100644
--- a/arch/arm/boards/karo-tx28/lowlevel.c
+++ b/arch/arm/boards/karo-tx28/lowlevel.c
@@ -43,7 +43,7 @@ static noinline void karo_tx28_init(void)
pr_debug("initializing power...\n");
- mx28_power_init_battery_input();
+ mx28_power_init(0, 1, 0);
pr_debug("initializing SDRAM...\n");
diff --git a/arch/arm/boards/karo-tx28/tx28-stk5.c b/arch/arm/boards/karo-tx28/tx28-stk5.c
index c4c51099b4..9b86d1c883 100644
--- a/arch/arm/boards/karo-tx28/tx28-stk5.c
+++ b/arch/arm/boards/karo-tx28/tx28-stk5.c
@@ -382,9 +382,6 @@ void base_board_init(void)
add_generic_device("stmfb", 0, NULL, IMX_FB_BASE, 0x2000,
IORESOURCE_MEM, &tx28_fb_pdata);
- add_generic_device("ocotp", 0, NULL, IMX_OCOTP_BASE, 0x2000,
- IORESOURCE_MEM, NULL);
-
tx28_get_ethaddr();
add_generic_device("imx28-fec", 0, NULL, IMX_FEC0_BASE, 0x4000,