diff options
Diffstat (limited to 'arch/arm/boards/ccxmx51')
-rw-r--r-- | arch/arm/boards/ccxmx51/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/boards/ccxmx51/ccxmx51.c | 24 | ||||
-rw-r--r-- | arch/arm/boards/ccxmx51/flash-header-x16.imxcfg | 61 | ||||
-rw-r--r-- | arch/arm/boards/ccxmx51/flash-header-x32.imxcfg (renamed from arch/arm/boards/ccxmx51/flash-header.imxcfg) | 3 | ||||
-rw-r--r-- | arch/arm/boards/ccxmx51/lowlevel.c | 47 |
5 files changed, 121 insertions, 16 deletions
diff --git a/arch/arm/boards/ccxmx51/Makefile b/arch/arm/boards/ccxmx51/Makefile index 50cf929c5d..9fbde144a5 100644 --- a/arch/arm/boards/ccxmx51/Makefile +++ b/arch/arm/boards/ccxmx51/Makefile @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + obj-y += ccxmx51.o lwl-y += lowlevel.o bbenv-$(CONFIG_DEFAULT_ENVIRONMENT) += defaultenv-ccxmx51 diff --git a/arch/arm/boards/ccxmx51/ccxmx51.c b/arch/arm/boards/ccxmx51/ccxmx51.c index 09437b047f..4ea71fe26b 100644 --- a/arch/arm/boards/ccxmx51/ccxmx51.c +++ b/arch/arm/boards/ccxmx51/ccxmx51.c @@ -16,12 +16,12 @@ #include <mfd/mc13xxx.h> #include <mfd/mc13892.h> -#include <mach/bbu.h> -#include <mach/esdctl.h> -#include <mach/iim.h> -#include <mach/imx5.h> -#include <mach/imx51-regs.h> -#include <mach/revision.h> +#include <mach/imx/bbu.h> +#include <mach/imx/esdctl.h> +#include <mach/imx/iim.h> +#include <mach/imx/imx5.h> +#include <mach/imx/imx51-regs.h> +#include <mach/imx/revision.h> static const struct ccxmx_ident { char *id_string; @@ -174,7 +174,7 @@ static void ccxmx51_power_init(struct mc13xxx *mc13xxx) static void ccxmx51_disable_device(struct device_node *root, const char *label) { - struct device_node *np = of_find_node_by_name(root, label); + struct device_node *np = of_find_node_by_name_address(root, label); if (np) of_device_disable(np); } @@ -189,11 +189,15 @@ static int ccxmx51_board_fixup(struct device_node *root, void *unused) if (!ccxmx_id->eth0) ccxmx51_disable_device(root, "ethernet@83fec000"); - if (!ccxmx_id->eth1) + if (!ccxmx_id->eth1) { ccxmx51_disable_device(root, "lan9221@5,0"); + ccxmx51_disable_device(root, "ethernet@5,0"); + } - if (!ccxmx_id->wless) + if (!ccxmx_id->wless) { ccxmx51_disable_device(root, "esdhc@70008000"); + ccxmx51_disable_device(root, "mmc@70008000"); + } serial = basprintf("%08x%08x", 0, boardserial); of_set_property(root, "serial-number", serial, strlen(serial) + 1, 1); @@ -245,8 +249,6 @@ static __init int ccxmx51_init(void) hang(); } - ccxmx_id = &ccxmx51_ids[hwid[0]]; - switch (hwid[2] & 0xc0) { case 0x00: manloc = 'B'; diff --git a/arch/arm/boards/ccxmx51/flash-header-x16.imxcfg b/arch/arm/boards/ccxmx51/flash-header-x16.imxcfg new file mode 100644 index 0000000000..6d77324fc8 --- /dev/null +++ b/arch/arm/boards/ccxmx51/flash-header-x16.imxcfg @@ -0,0 +1,61 @@ +# SPDX-License-Identifier: GPL-2.0-only + +soc imx51 +loadaddr 0x90000000 +ivtofs 0x400 +wm 32 0x73fa88a0 0x00000200 +wm 32 0x73fa850c 0x000020c5 +wm 32 0x73fa8510 0x000020c5 +wm 32 0x73fa883c 0x00000002 +wm 32 0x73fa8848 0x00000002 +wm 32 0x73fa84b8 0x000000e7 +wm 32 0x73fa84bc 0x00000045 +wm 32 0x73fa84c0 0x00000045 +wm 32 0x73fa84c4 0x00000045 +wm 32 0x73fa84c8 0x00000045 +wm 32 0x73fa8820 0x00000000 +wm 32 0x73fa84a4 0x00000003 +wm 32 0x73fa84a8 0x00000003 +wm 32 0x73fa84ac 0x000000e3 +wm 32 0x73fa84b0 0x000000e3 +wm 32 0x73fa84b4 0x000000e3 +wm 32 0x73fa84cc 0x000000e3 +wm 32 0x73fa84d0 0x000000e2 +wm 32 0x73fa882c 0x00000004 +wm 32 0x73fa88a4 0x00000004 +wm 32 0x73fa88ac 0x00000004 +wm 32 0x73fa88b8 0x00000004 +wm 32 0x83fd9000 0x82a10000 +wm 32 0x83fd9008 0x82a10000 +wm 32 0x83fd9010 0x000ad0d0 +wm 32 0x83fd9004 0x3f3584ab +wm 32 0x83fd900c 0x3f3584ab +wm 32 0x83fd9014 0x04008008 +wm 32 0x83fd9014 0x0000801a +wm 32 0x83fd9014 0x0000801b +wm 32 0x83fd9014 0x00448019 +wm 32 0x83fd9014 0x07328018 +wm 32 0x83fd9014 0x04008008 +wm 32 0x83fd9014 0x00008010 +wm 32 0x83fd9014 0x00008010 +wm 32 0x83fd9014 0x06328018 +wm 32 0x83fd9014 0x03808019 +wm 32 0x83fd9014 0x00408019 +wm 32 0x83fd9014 0x00008000 +wm 32 0x83fd9014 0x0400800c +wm 32 0x83fd9014 0x0000801e +wm 32 0x83fd9014 0x0000801f +wm 32 0x83fd9014 0x0000801d +wm 32 0x83fd9014 0x0732801c +wm 32 0x83fd9014 0x0400800c +wm 32 0x83fd9014 0x00008014 +wm 32 0x83fd9014 0x00008014 +wm 32 0x83fd9014 0x0632801c +wm 32 0x83fd9014 0x0380801d +wm 32 0x83fd9014 0x0040801d +wm 32 0x83fd9014 0x00008004 +wm 32 0x83fd9000 0xb2a10000 +wm 32 0x83fd9008 0xb2a10000 +wm 32 0x83fd9010 0x000ad6d0 +wm 32 0x83fd9034 0x90000000 +wm 32 0x83fd9014 0x00000000 diff --git a/arch/arm/boards/ccxmx51/flash-header.imxcfg b/arch/arm/boards/ccxmx51/flash-header-x32.imxcfg index 3b1df11133..6480aa590e 100644 --- a/arch/arm/boards/ccxmx51/flash-header.imxcfg +++ b/arch/arm/boards/ccxmx51/flash-header-x32.imxcfg @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0-only + soc imx51 loadaddr 0x90000000 ivtofs 0x400 @@ -57,4 +59,3 @@ wm 32 0x83fd9008 0xb2a20000 wm 32 0x83fd9010 0x000ad6d0 wm 32 0x83fd9034 0x90000000 wm 32 0x83fd9014 0x00000000 - diff --git a/arch/arm/boards/ccxmx51/lowlevel.c b/arch/arm/boards/ccxmx51/lowlevel.c index adcb30a7ff..b0881f9c5b 100644 --- a/arch/arm/boards/ccxmx51/lowlevel.c +++ b/arch/arm/boards/ccxmx51/lowlevel.c @@ -2,22 +2,61 @@ /* Author: Alexander Shiyan <shc_work@mail.ru> */ #include <common.h> -#include <mach/esdctl.h> -#include <mach/generic.h> +#include <debug_ll.h> +#include <mach/imx/debug_ll.h> +#include <mach/imx/clock-imx51_53.h> +#include <mach/imx/esdctl.h> +#include <mach/imx/generic.h> +#include <mach/imx/iomux-mx51.h> #include <asm/barebox-arm.h> #include <asm/barebox-arm-head.h> -#include <mach/imx51-regs.h> +#include <mach/imx/imx51-regs.h> -ENTRY_FUNCTION(start_ccxmx51, r0, r1, r2) +static inline void setup_uart(void) +{ + void __iomem *iomuxbase = IOMEM(MX51_IOMUXC_BASE_ADDR); + void __iomem *ccmbase = IOMEM(MX51_CCM_BASE_ADDR); + + /* + * Restore CCM values that might be changed by the Mask ROM + * code. + * + * Source: RealView debug scripts provided by Freescale + */ + writel(MX5_CCM_CBCDR_RESET_VALUE, ccmbase + MX5_CCM_CBCDR); + writel(MX5_CCM_CSCMR1_RESET_VALUE, ccmbase + MX5_CCM_CSCMR1); + writel(MX5_CCM_CSCDR1_RESET_VALUE, ccmbase + MX5_CCM_CSCDR1); + + imx_setup_pad(iomuxbase, MX51_PAD_UART1_TXD__UART1_TXD); + + imx51_uart_setup_ll(); + + putc_ll('>'); +} + +static inline void start_ccxmx51(void) { extern char __dtb_imx51_ccxmx51_start[]; void *fdt; imx5_cpu_lowlevel_init(); + if (IS_ENABLED(CONFIG_DEBUG_LL)) + setup_uart(); + arm_setup_stack(0x20000000); fdt = __dtb_imx51_ccxmx51_start + get_runtime_offset(); barebox_arm_entry(MX51_CSD0_BASE_ADDR, SZ_128M, fdt); } + +ENTRY_FUNCTION(start_ccxmx51_x16, r0, r1, r2) +{ + start_ccxmx51(); +} + +ENTRY_FUNCTION(start_ccxmx51_x32, r0, r1, r2) +{ + start_ccxmx51(); +} |