summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/freescale-mx28-evk
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2012-01-02 12:13:30 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-01-02 13:08:47 +0100
commite2cee7cb67901c3413e802ec29157ee03294b3ee (patch)
tree2676191c71c845fae43c1f3719860ea274c8b238 /arch/arm/boards/freescale-mx28-evk
parent0777a18c0f85369cfe479fe48a0510fe90e26b1f (diff)
downloadbarebox-e2cee7cb67901c3413e802ec29157ee03294b3ee.tar.gz
barebox-e2cee7cb67901c3413e802ec29157ee03294b3ee.tar.xz
mxs: add support for mx28-evk
This patch adds basic support for the mx28-evk board. Debug UART, MMC and FEC have been successfully used. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/freescale-mx28-evk')
-rw-r--r--arch/arm/boards/freescale-mx28-evk/Makefile1
-rw-r--r--arch/arm/boards/freescale-mx28-evk/config.h16
-rw-r--r--arch/arm/boards/freescale-mx28-evk/env/config51
-rw-r--r--arch/arm/boards/freescale-mx28-evk/mx28-evk.c141
4 files changed, 209 insertions, 0 deletions
diff --git a/arch/arm/boards/freescale-mx28-evk/Makefile b/arch/arm/boards/freescale-mx28-evk/Makefile
new file mode 100644
index 0000000000..3e1f53b06d
--- /dev/null
+++ b/arch/arm/boards/freescale-mx28-evk/Makefile
@@ -0,0 +1 @@
+obj-y += mx28-evk.o
diff --git a/arch/arm/boards/freescale-mx28-evk/config.h b/arch/arm/boards/freescale-mx28-evk/config.h
new file mode 100644
index 0000000000..8f18fda7cc
--- /dev/null
+++ b/arch/arm/boards/freescale-mx28-evk/config.h
@@ -0,0 +1,16 @@
+/*
+ * 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.
+ */
+
+#ifndef _CONFIG_H_
+# define _CONFIG_H_
+
+#endif /* _CONFIG_H_ */
diff --git a/arch/arm/boards/freescale-mx28-evk/env/config b/arch/arm/boards/freescale-mx28-evk/env/config
new file mode 100644
index 0000000000..509563388e
--- /dev/null
+++ b/arch/arm/boards/freescale-mx28-evk/env/config
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+machine=mx28-evk
+#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-${machine}.$rootfs_type
+
+# where is the kernel image in case of 'kernel_loc=disk'
+kernel_part=disk0.2
+
+kernelimage=zImage-$machine
+bareboximage=barebox-${machine}.bin
+bareboxenvimage=barebox-${machine}.bin
+
+if [ -n $user ]; then
+ bareboximage="$user"-"$bareboximage"
+ bareboxenvimage="$user"-"$bareboxenvimage"
+ kernelimage="$user"-"$kernelimage"
+ rootfsimage="$user"-"$rootfsimage"
+ nfsroot="/home/$user/nfsroot/$machine"
+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/mx28-evk.c b/arch/arm/boards/freescale-mx28-evk/mx28-evk.c
new file mode 100644
index 0000000000..b80b910f54
--- /dev/null
+++ b/arch/arm/boards/freescale-mx28-evk/mx28-evk.c
@@ -0,0 +1,141 @@
+/*
+ * 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 <fec.h>
+#include <gpio.h>
+#include <init.h>
+#include <mci.h>
+#include <io.h>
+
+#include <mach/clock.h>
+#include <mach/imx-regs.h>
+#include <mach/iomux-imx28.h>
+#include <mach/mci.h>
+
+#include <asm/armlinux.h>
+#include <asm/mmu.h>
+
+#include <generated/mach-types.h>
+
+#define MX28EVK_FEC_PHY_RESET_GPIO 141
+
+/* setup the CPU card internal signals */
+static const uint32_t mx28evk_pads[] = {
+ /* duart */
+ PWM0_DUART_RX | VE_3_3V,
+ PWM1_DUART_TX | VE_3_3V,
+
+ /* fec0 */
+ ENET_CLK | VE_3_3V | BITKEEPER(0),
+ ENET0_MDC | VE_3_3V | PULLUP(1),
+ ENET0_MDIO | VE_3_3V | PULLUP(1),
+ ENET0_TXD0 | VE_3_3V | PULLUP(1),
+ ENET0_TXD1 | VE_3_3V | PULLUP(1),
+ ENET0_TX_EN | VE_3_3V | PULLUP(1),
+ ENET0_TX_CLK | VE_3_3V | BITKEEPER(0),
+ ENET0_RXD0 | VE_3_3V | PULLUP(1),
+ ENET0_RXD1 | VE_3_3V | PULLUP(1),
+ ENET0_RX_EN | VE_3_3V | PULLUP(1),
+ /* send a "good morning" to the ext. phy 0 = reset */
+ ENET0_RX_CLK_GPIO | VE_3_3V | PULLUP(0) | GPIO_OUT | GPIO_VALUE(0),
+ /* phy power control 1 = on */
+ SSP1_D3_GPIO | VE_3_3V | PULLUP(0) | GPIO_OUT | GPIO_VALUE(0),
+
+ /* mmc0 */
+ SSP0_D0 | VE_3_3V | PULLUP(1),
+ SSP0_D1 | VE_3_3V | PULLUP(1),
+ SSP0_D2 | VE_3_3V | PULLUP(1),
+ SSP0_D3 | VE_3_3V | PULLUP(1),
+ SSP0_D4 | VE_3_3V | PULLUP(1),
+ SSP0_D5 | VE_3_3V | PULLUP(1),
+ SSP0_D6 | VE_3_3V | PULLUP(1),
+ SSP0_D7 | VE_3_3V | PULLUP(1),
+ SSP0_CMD | VE_3_3V | PULLUP(1),
+ SSP0_CD | VE_3_3V | PULLUP(1),
+ SSP0_SCK | VE_3_3V | BITKEEPER(0),
+ /* MCI slot power control 1 = off */
+ PWM3_GPIO | VE_3_3V | GPIO_OUT | GPIO_VALUE(0),
+ /* MCI write protect 1 = not protected */
+ SSP1_SCK_GPIO | VE_3_3V | GPIO_IN,
+};
+
+static struct mxs_mci_platform_data mci_pdata = {
+ .caps = MMC_MODE_8BIT,
+ .voltages = MMC_VDD_32_33 | MMC_VDD_33_34, /* fixed to 3.3 V */
+ .f_min = 400 * 1000,
+ .f_max = 25000000,
+};
+
+/* fec */
+static void __init mx28_evk_fec_reset(void)
+{
+ mdelay(1);
+ gpio_set_value(MX28EVK_FEC_PHY_RESET_GPIO, 1);
+}
+
+/* PhyAD[0..2]=0, RMIISEL=1 */
+static struct fec_platform_data fec_info = {
+ .xcv_type = RMII,
+ .phy_addr = 0,
+};
+
+static int mx28_evk_mem_init(void)
+{
+ arm_add_mem_device("ram0", IMX_MEMORY_BASE, 128 * 1024 * 1024);
+
+ return 0;
+}
+mem_initcall(mx28_evk_mem_init);
+
+static int mx28_evk_devices_init(void)
+{
+ int i;
+
+ /* initizalize muxing */
+ for (i = 0; i < ARRAY_SIZE(mx28evk_pads); i++)
+ imx_gpio_mode(mx28evk_pads[i]);
+
+ /* enable IOCLK0 to run at the PLL frequency */
+ imx_set_ioclk(0, 480000000);
+ /* run the SSP unit clock at 100 MHz */
+ imx_set_sspclk(0, 100000000, 1);
+
+ armlinux_set_bootparams((void *)IMX_MEMORY_BASE + 0x100);
+ armlinux_set_architecture(MACH_TYPE_MX28EVK);
+
+ add_generic_device("mxs_mci", 0, NULL, IMX_SSP0_BASE, 0,
+ IORESOURCE_MEM, &mci_pdata);
+
+ imx_enable_enetclk();
+ mx28_evk_fec_reset();
+ add_generic_device("fec_imx", 0, NULL, IMX_FEC0_BASE, 0,
+ IORESOURCE_MEM, &fec_info);
+
+ return 0;
+}
+device_initcall(mx28_evk_devices_init);
+
+static int mx28_evk_console_init(void)
+{
+ add_generic_device("stm_serial", 0, NULL, IMX_DBGUART_BASE, 8192,
+ IORESOURCE_MEM, NULL);
+
+ return 0;
+}
+console_initcall(mx28_evk_console_init);