diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-02-03 10:01:33 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-02-03 15:09:14 +0100 |
commit | 2a1f5f802e1c62b40e57beabbd7413d12a715059 (patch) | |
tree | 0af8e8d205559495af8256bdd387e1e77df768a4 /arch/arm/boards/freescale-mx53-qsb | |
parent | 46c034db92676dd569797c4cf03f072e56fd6734 (diff) | |
download | barebox-2a1f5f802e1c62b40e57beabbd7413d12a715059.tar.gz barebox-2a1f5f802e1c62b40e57beabbd7413d12a715059.tar.xz |
ARM: rename boards to more consistent naming
This renames the Freescale and Phytec board directories and defconfig
files to a common naming scheme. The board directories are named
<vendor>-<board> and the defconfig files are named
<vendor>-<board>_defconfig. Also the DataModul realq7 is renamed to its
Marketing Name eDM-QMX6.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/freescale-mx53-qsb')
-rw-r--r-- | arch/arm/boards/freescale-mx53-qsb/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/boards/freescale-mx53-qsb/board.c | 135 | ||||
-rw-r--r-- | arch/arm/boards/freescale-mx53-qsb/env/config-board | 7 | ||||
-rw-r--r-- | arch/arm/boards/freescale-mx53-qsb/flash-header-imx53-loco.imxcfg | 54 | ||||
-rw-r--r-- | arch/arm/boards/freescale-mx53-qsb/lowlevel.c | 30 | ||||
-rw-r--r-- | arch/arm/boards/freescale-mx53-qsb/mx53-pdk.dox | 4 |
6 files changed, 233 insertions, 0 deletions
diff --git a/arch/arm/boards/freescale-mx53-qsb/Makefile b/arch/arm/boards/freescale-mx53-qsb/Makefile new file mode 100644 index 0000000000..bcaa974f35 --- /dev/null +++ b/arch/arm/boards/freescale-mx53-qsb/Makefile @@ -0,0 +1,3 @@ +obj-y += board.o flash-header-imx53-loco.dcd.o +extra-y += flash-header-imx53-loco.dcd.S flash-header-imx53-loco.dcd +lwl-y += lowlevel.o diff --git a/arch/arm/boards/freescale-mx53-qsb/board.c b/arch/arm/boards/freescale-mx53-qsb/board.c new file mode 100644 index 0000000000..69036dafcf --- /dev/null +++ b/arch/arm/boards/freescale-mx53-qsb/board.c @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2007 Sascha Hauer, Pengutronix + * Copyright (C) 2011 Marc Kleine-Budde <mkl@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 <environment.h> +#include <partition.h> +#include <common.h> +#include <sizes.h> +#include <gpio.h> +#include <init.h> +#include <fs.h> +#include <io.h> +#include <of.h> + +#include <mfd/mc13xxx.h> +#include <i2c/i2c.h> + +#include <asm/armlinux.h> +#include <asm/mmu.h> + +#include <generated/mach-types.h> + +#include <mach/imx-flash-header.h> +#include <mach/imx53-regs.h> +#include <mach/revision.h> +#include <mach/generic.h> +#include <mach/imx5.h> +#include <mach/bbu.h> +#include <mach/iim.h> + +/* + * Revision to be passed to kernel. The kernel provided + * by freescale relies on this. + * + * C --> CPU type + * S --> Silicon revision + * B --> Board rev + * + * 31 20 16 12 8 4 0 + * | Cmaj | Cmin | B | Smaj | Smin| + * + * e.g 0x00053120 --> i.MX35, Cpu silicon rev 2.0, Board rev 2 +*/ +static unsigned int loco_system_rev = 0x00053000; + +static void set_silicon_rev( int rev) +{ + loco_system_rev = loco_system_rev | (rev & 0xFF); +} + +static void set_board_rev(int rev) +{ + loco_system_rev = (loco_system_rev & ~(0xF << 8)) | (rev & 0xF) << 8; +} + +#define LOCO_FEC_PHY_RST IMX_GPIO_NR(7, 6) + +static void loco_fec_reset(void) +{ + gpio_direction_output(LOCO_FEC_PHY_RST, 0); + mdelay(1); + gpio_set_value(LOCO_FEC_PHY_RST, 1); +} + +#define MX53_LOCO_USB_PWREN IMX_GPIO_NR(7, 8) + +extern char flash_header_imx53_loco_start[]; +extern char flash_header_imx53_loco_end[]; + +static int loco_late_init(void) +{ + struct mc13xxx *mc34708; + int rev; + + if (!of_machine_is_compatible("fsl,imx53-qsb")) + return 0; + + device_detect_by_name("mmc0"); + + devfs_add_partition("mmc0", 0x40000, 0x20000, DEVFS_PARTITION_FIXED, "env0"); + + mc34708 = mc13xxx_get(); + if (mc34708) { + /* get the board revision from fuse */ + rev = readl(MX53_IIM_BASE_ADDR + 0x878); + set_board_rev(rev); + printf("MCIMX53-START-R board 1.0 rev %c\n", (rev == 1) ? 'A' : 'B' ); + armlinux_set_revision(loco_system_rev); + } else { + /* so we have a DA9053 based board */ + printf("MCIMX53-START board 1.0\n"); + armlinux_set_revision(loco_system_rev); + return 0; + } + + /* USB PWR enable */ + gpio_direction_output(MX53_LOCO_USB_PWREN, 0); + gpio_set_value(MX53_LOCO_USB_PWREN, 1); + + loco_fec_reset(); + + set_silicon_rev(imx_silicon_revision()); + + armlinux_set_architecture(MACH_TYPE_MX53_LOCO); + + imx53_bbu_internal_mmc_register_handler("mmc", "/dev/mmc0", + BBU_HANDLER_FLAG_DEFAULT, (void *)flash_header_imx53_loco_start, + flash_header_imx53_loco_end - flash_header_imx53_loco_start, 0); + + return 0; +} +late_initcall(loco_late_init); + +static int loco_postcore_init(void) +{ + if (!of_machine_is_compatible("fsl,imx53-qsb")) + return 0; + + imx53_init_lowlevel(1000); + + return 0; +} +postcore_initcall(loco_postcore_init); diff --git a/arch/arm/boards/freescale-mx53-qsb/env/config-board b/arch/arm/boards/freescale-mx53-qsb/env/config-board new file mode 100644 index 0000000000..a6cf69ddbc --- /dev/null +++ b/arch/arm/boards/freescale-mx53-qsb/env/config-board @@ -0,0 +1,7 @@ +#!/bin/sh + +# board defaults, do not change in running system. Change /env/config +# instead + +global.hostname=loco +global.linux.bootargs.base="console=ttymxc0,115200" diff --git a/arch/arm/boards/freescale-mx53-qsb/flash-header-imx53-loco.imxcfg b/arch/arm/boards/freescale-mx53-qsb/flash-header-imx53-loco.imxcfg new file mode 100644 index 0000000000..95bcd19805 --- /dev/null +++ b/arch/arm/boards/freescale-mx53-qsb/flash-header-imx53-loco.imxcfg @@ -0,0 +1,54 @@ +loadaddr 0x70000000 +soc imx53 +dcdofs 0x400 +wm 32 0x53fa8554 0x00300000 +wm 32 0x53fa8558 0x00300040 +wm 32 0x53fa8560 0x00300000 +wm 32 0x53fa8564 0x00300040 +wm 32 0x53fa8568 0x00300040 +wm 32 0x53fa8570 0x00300000 +wm 32 0x53fa8574 0x00300000 +wm 32 0x53fa8578 0x00300000 +wm 32 0x53fa857c 0x00300040 +wm 32 0x53fa8580 0x00300040 +wm 32 0x53fa8584 0x00300000 +wm 32 0x53fa8588 0x00300000 +wm 32 0x53fa8590 0x00300040 +wm 32 0x53fa8594 0x00300000 +wm 32 0x53fa86f0 0x00300000 +wm 32 0x53fa86f4 0x00000000 +wm 32 0x53fa86fc 0x00000000 +wm 32 0x53fa8714 0x00000000 +wm 32 0x53fa8718 0x00300000 +wm 32 0x53fa871c 0x00300000 +wm 32 0x53fa8720 0x00300000 +wm 32 0x53fa8724 0x04000000 +wm 32 0x53fa8728 0x00300000 +wm 32 0x53fa872c 0x00300000 +wm 32 0x63fd9088 0x35343535 +wm 32 0x63fd9090 0x4d444c44 +wm 32 0x63fd907c 0x01370138 +wm 32 0x63fd9080 0x013b013c +wm 32 0x63fd9018 0x00011740 +wm 32 0x63fd9000 0xc3190000 +wm 32 0x63fd900c 0x9f5152e3 +wm 32 0x63fd9010 0xb68e8a63 +wm 32 0x63fd9014 0x01ff00db +wm 32 0x63fd902c 0x000026d2 +wm 32 0x63fd9030 0x009f0e21 +wm 32 0x63fd9008 0x12273030 +wm 32 0x63fd9004 0x0002002d +wm 32 0x63fd901c 0x00008032 +wm 32 0x63fd901c 0x00008033 +wm 32 0x63fd901c 0x00028031 +wm 32 0x63fd901c 0x052080b0 +wm 32 0x63fd901c 0x04008040 +wm 32 0x63fd901c 0x0000803a +wm 32 0x63fd901c 0x0000803b +wm 32 0x63fd901c 0x00028039 +wm 32 0x63fd901c 0x05208138 +wm 32 0x63fd901c 0x04008048 +wm 32 0x63fd9020 0x00005800 +wm 32 0x63fd9040 0x04b80003 +wm 32 0x63fd9058 0x00022227 +wm 32 0x63fd901c 0x00000000 diff --git a/arch/arm/boards/freescale-mx53-qsb/lowlevel.c b/arch/arm/boards/freescale-mx53-qsb/lowlevel.c new file mode 100644 index 0000000000..c9e057ae67 --- /dev/null +++ b/arch/arm/boards/freescale-mx53-qsb/lowlevel.c @@ -0,0 +1,30 @@ +#include <common.h> +#include <mach/esdctl.h> +#include <asm/barebox-arm-head.h> +#include <asm/barebox-arm.h> + +extern char __dtb_imx53_qsb_start[]; + +ENTRY_FUNCTION(start_imx53_loco, r0, r1, r2) +{ + uint32_t fdt; + + arm_cpu_lowlevel_init(); + + fdt = (uint32_t)__dtb_imx53_qsb_start - get_runtime_offset(); + + imx53_barebox_entry(fdt); +} + +extern char __dtb_imx53_qsrb_start[]; + +ENTRY_FUNCTION(start_imx53_loco_r, r0, r1, r2) +{ + uint32_t fdt; + + arm_cpu_lowlevel_init(); + + fdt = (uint32_t)__dtb_imx53_qsrb_start - get_runtime_offset(); + + imx53_barebox_entry(fdt); +} diff --git a/arch/arm/boards/freescale-mx53-qsb/mx53-pdk.dox b/arch/arm/boards/freescale-mx53-qsb/mx53-pdk.dox new file mode 100644 index 0000000000..3a2c84fc3f --- /dev/null +++ b/arch/arm/boards/freescale-mx53-qsb/mx53-pdk.dox @@ -0,0 +1,4 @@ +/** @page board_loco Freescale i.MX53 PDK (Loco) Board + + +*/ |