diff options
Diffstat (limited to 'arch/arm/boards/tqma6x')
-rw-r--r-- | arch/arm/boards/tqma6x/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/boards/tqma6x/board.c | 69 | ||||
-rw-r--r-- | arch/arm/boards/tqma6x/flash-header-tqma6dl.imxcfg | 8 | ||||
-rw-r--r-- | arch/arm/boards/tqma6x/flash-header-tqma6q.imxcfg | 8 | ||||
-rw-r--r-- | arch/arm/boards/tqma6x/lowlevel.c | 28 |
5 files changed, 48 insertions, 67 deletions
diff --git a/arch/arm/boards/tqma6x/Makefile b/arch/arm/boards/tqma6x/Makefile index 01c7a259e9..da63d2625f 100644 --- a/arch/arm/boards/tqma6x/Makefile +++ b/arch/arm/boards/tqma6x/Makefile @@ -1,2 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0-only + obj-y += board.o lwl-y += lowlevel.o diff --git a/arch/arm/boards/tqma6x/board.c b/arch/arm/boards/tqma6x/board.c index ecf8fa06af..a2363913e2 100644 --- a/arch/arm/boards/tqma6x/board.c +++ b/arch/arm/boards/tqma6x/board.c @@ -1,26 +1,9 @@ -/* - * Copyright (C) 2013 Sascha Hauer, Pengutronix - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation. - * - */ - -#include <generated/mach-types.h> +// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-FileCopyrightText: 2013 Sascha Hauer, Pengutronix + +#include <asm/mach-types.h> #include <environment.h> #include <bootsource.h> -#include <partition.h> #include <common.h> #include <envfs.h> #include <linux/sizes.h> @@ -28,18 +11,19 @@ #include <gpio.h> #include <of.h> +#include <linux/mdio.h> +#include <linux/phy.h> #include <linux/micrel_phy.h> #include <mfd/stmpe-i2c.h> #include <asm/armlinux.h> #include <asm/io.h> -#include <mach/devices-imx6.h> -#include <mach/imx6-regs.h> -#include <mach/iomux-mx6.h> -#include <mach/generic.h> -#include <mach/imx6.h> -#include <mach/bbu.h> +#include <mach/imx/imx6-regs.h> +#include <mach/imx/iomux-mx6.h> +#include <mach/imx/generic.h> +#include <mach/imx/imx6.h> +#include <mach/imx/bbu.h> #define RQ7_GPIO_ENET_PHYADD2 IMX_GPIO_NR(6, 30) #define RQ7_GPIO_ENET_MODE0 IMX_GPIO_NR(6, 25) @@ -63,14 +47,14 @@ static int ksz9031rn_phy_fixup(struct phy_device *dev) * min rx data delay, max rx/tx clock delay, * min rx/tx control delay */ - phy_write_mmd_indirect(dev, 4, 2, 0); - phy_write_mmd_indirect(dev, 5, 2, 0); - phy_write_mmd_indirect(dev, 8, 2, 0x003ff); + phy_write_mmd(dev, MDIO_MMD_WIS, 4, 0); + phy_write_mmd(dev, MDIO_MMD_WIS, 5, 0); + phy_write_mmd(dev, MDIO_MMD_WIS, 8, 0x003ff); return 0; } -static int tqma6x_enet_init(void) +static int tq_mba6x_enet_init(void) { if (!of_machine_is_compatible("tq,mba6x")) return 0; @@ -94,20 +78,25 @@ static int tqma6x_enet_init(void) return 0; } -fs_initcall(tqma6x_enet_init); +fs_initcall(tq_mba6x_enet_init); -static int tqma6x_env_init(void) +static int tqma6x_init(void) { - if (!of_machine_is_compatible("tq,mba6x")) - return 0; - - devfs_add_partition("m25p0", 0, SZ_512K, DEVFS_PARTITION_FIXED, "m25p0.barebox"); - imx6_bbu_internal_spi_i2c_register_handler("spiflash", "/dev/m25p0.barebox", BBU_HANDLER_FLAG_DEFAULT); imx6_bbu_internal_mmcboot_register_handler("emmc", "mmc2", 0); - device_detect_by_name("mmc2"); + device_detect_by_name("mmc2"); // eMMC + + return 0; +} + +static int tq_mba6x_env_init(void) +{ + if (!of_machine_is_compatible("tq,mba6x")) + return 0; + + tqma6x_init(); default_environment_path_set("/dev/mmc2.boot1"); @@ -115,4 +104,4 @@ static int tqma6x_env_init(void) return 0; } -late_initcall(tqma6x_env_init); +late_initcall(tq_mba6x_env_init); diff --git a/arch/arm/boards/tqma6x/flash-header-tqma6dl.imxcfg b/arch/arm/boards/tqma6x/flash-header-tqma6dl.imxcfg index 192ebda743..e93d53ed79 100644 --- a/arch/arm/boards/tqma6x/flash-header-tqma6dl.imxcfg +++ b/arch/arm/boards/tqma6x/flash-header-tqma6dl.imxcfg @@ -1,9 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + soc imx6 loadaddr 0x20000000 -dcdofs 0x400 +ivtofs 0x400 -#include <mach/imx6-ddr-regs.h> -#include <mach/imx6dl-ddr-regs.h> +#include <mach/imx/imx6-ddr-regs.h> +#include <mach/imx/imx6dl-ddr-regs.h> wm 32 MX6_IOM_DRAM_SDQS0 0x00000030 wm 32 MX6_IOM_DRAM_SDQS1 0x00000030 diff --git a/arch/arm/boards/tqma6x/flash-header-tqma6q.imxcfg b/arch/arm/boards/tqma6x/flash-header-tqma6q.imxcfg index 1fd75a24b2..ec682e0109 100644 --- a/arch/arm/boards/tqma6x/flash-header-tqma6q.imxcfg +++ b/arch/arm/boards/tqma6x/flash-header-tqma6q.imxcfg @@ -1,9 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + soc imx6 loadaddr 0x20000000 -dcdofs 0x400 +ivtofs 0x400 -#include <mach/imx6-ddr-regs.h> -#include <mach/imx6q-ddr-regs.h> +#include <mach/imx/imx6-ddr-regs.h> +#include <mach/imx/imx6q-ddr-regs.h> wm 32 MX6_IOM_DRAM_SDQS0 0x00000030 wm 32 MX6_IOM_DRAM_SDQS1 0x00000030 diff --git a/arch/arm/boards/tqma6x/lowlevel.c b/arch/arm/boards/tqma6x/lowlevel.c index afbc1691eb..6e9c9bed0b 100644 --- a/arch/arm/boards/tqma6x/lowlevel.c +++ b/arch/arm/boards/tqma6x/lowlevel.c @@ -1,18 +1,8 @@ -/* - * Copyright (C) 2013 Sascha Hauer <s.hauer@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. - * - */ +// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-FileCopyrightText: 2013 Sascha Hauer <s.hauer@pengutronix.de> + #include <debug_ll.h> +#include <mach/imx/debug_ll.h> #include <common.h> #include <linux/sizes.h> #include <io.h> @@ -21,19 +11,17 @@ #include <asm/sections.h> #include <asm/cache.h> #include <asm/mmu.h> -#include <mach/imx6.h> +#include <mach/imx/imx6.h> extern char __dtb_imx6q_mba6x_start[]; extern char __dtb_imx6dl_mba6x_start[]; -ENTRY_FUNCTION(start_imx6q_mba6x, r0, r1, r2) +ENTRY_FUNCTION_WITHSTACK(start_imx6q_mba6x, 0x00920000, r0, r1, r2) { void *fdt; imx6_cpu_lowlevel_init(); - arm_setup_stack(0x00920000); - if (IS_ENABLED(CONFIG_DEBUG_LL)) { writel(0x2, 0x020e0338); imx6_uart_setup_ll(); @@ -47,14 +35,12 @@ ENTRY_FUNCTION(start_imx6q_mba6x, r0, r1, r2) barebox_arm_entry(0x10000000, SZ_1G, fdt); } -ENTRY_FUNCTION(start_imx6dl_mba6x, r0, r1, r2) +ENTRY_FUNCTION_WITHSTACK(start_imx6dl_mba6x, 0x00920000, r0, r1, r2) { void *fdt; imx6_cpu_lowlevel_init(); - arm_setup_stack(0x00920000); - if (IS_ENABLED(CONFIG_DEBUG_LL)) { writel(0x2, 0x020e035c); imx6_uart_setup_ll(); |