From fa85b0217db0ceb024e5018db979d78f97651ff6 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Thu, 17 Aug 2017 17:48:50 +0800 Subject: imx: mx7: psci: add copyright and license Add copyright and license header. Signed-off-by: Peng Fan Cc: Stefano Babic --- arch/arm/mach-imx/mx7/psci-mx7.c | 7 +++++++ arch/arm/mach-imx/mx7/psci.S | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/mach-imx/mx7/psci-mx7.c b/arch/arm/mach-imx/mx7/psci-mx7.c index 502552d171..7f429b0a43 100644 --- a/arch/arm/mach-imx/mx7/psci-mx7.c +++ b/arch/arm/mach-imx/mx7/psci-mx7.c @@ -1,3 +1,10 @@ +/* + * Copyright (C) 2015-2016 Freescale Semiconductor, Inc. + * Copyright 2017 NXP + * + * SPDX-License-Identifier: GPL-2.0+ + */ + #include #include #include diff --git a/arch/arm/mach-imx/mx7/psci.S b/arch/arm/mach-imx/mx7/psci.S index 96e88d6184..fc5eb34c88 100644 --- a/arch/arm/mach-imx/mx7/psci.S +++ b/arch/arm/mach-imx/mx7/psci.S @@ -1,3 +1,10 @@ +/* + * Copyright (C) 2015-2016 Freescale Semiconductor, Inc. + * Copyright 2017 NXP + * + * SPDX-License-Identifier: GPL-2.0+ + */ + #include #include -- cgit From 7c09cbf68bd1881450dbac13f38486aab5640090 Mon Sep 17 00:00:00 2001 From: Stefano Babic Date: Thu, 17 Aug 2017 13:55:20 +0200 Subject: imx: fix licensing in i.MX files Some files for i.MX do not yet have the SPDX ID to reference the correct license. Signed-off-by: Stefano Babic Reviewed-by: Wolfgang Denk --- arch/arm/include/asm/arch-mx35/mmc_host_def.h | 18 +----------------- arch/arm/include/asm/arch-mx5/iomux-mx51.h | 7 +------ arch/arm/include/asm/arch-mxs/iomux-mx23.h | 7 +------ arch/arm/include/asm/arch-mxs/iomux-mx28.h | 7 +------ 4 files changed, 4 insertions(+), 35 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/include/asm/arch-mx35/mmc_host_def.h b/arch/arm/include/asm/arch-mx35/mmc_host_def.h index 775b9552ca..0775511491 100644 --- a/arch/arm/include/asm/arch-mx35/mmc_host_def.h +++ b/arch/arm/include/asm/arch-mx35/mmc_host_def.h @@ -3,23 +3,7 @@ * Texas Instruments, * Syed Mohammed Khasim * - * See file CREDITS for list of people who contributed to this - * project. - * - * 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's version 2 of - * the License. - * - * 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, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0 */ #ifndef MMC_HOST_DEF_H diff --git a/arch/arm/include/asm/arch-mx5/iomux-mx51.h b/arch/arm/include/asm/arch-mx5/iomux-mx51.h index 5c636acc03..522512eec3 100644 --- a/arch/arm/include/asm/arch-mx5/iomux-mx51.h +++ b/arch/arm/include/asm/arch-mx5/iomux-mx51.h @@ -3,12 +3,7 @@ * Copyright (C) 2010 Freescale Semiconductor, Inc. * Copyright (C) 2009-2012 Genesi USA, Inc. * - * The code contained herein is licensed under the GNU General Public - * License. You may obtain a copy of the GNU General Public License - * Version 2 or later at the following locations: - * - * http://www.opensource.org/licenses/gpl-license.html - * http://www.gnu.org/copyleft/gpl.html + * SPDX-License-Identifier: GPL-2.0+ */ /* diff --git a/arch/arm/include/asm/arch-mxs/iomux-mx23.h b/arch/arm/include/asm/arch-mxs/iomux-mx23.h index 7cb5e71688..690929c06a 100644 --- a/arch/arm/include/asm/arch-mxs/iomux-mx23.h +++ b/arch/arm/include/asm/arch-mxs/iomux-mx23.h @@ -2,12 +2,7 @@ * Copyright (C) 2009-2010 Amit Kucheria * Copyright (C) 2010 Freescale Semiconductor, Inc. * - * The code contained herein is licensed under the GNU General Public - * License. You may obtain a copy of the GNU General Public License - * Version 2 or later at the following locations: - * - * http://www.opensource.org/licenses/gpl-license.html - * http://www.gnu.org/copyleft/gpl.html + * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __MACH_IOMUX_MX23_H__ diff --git a/arch/arm/include/asm/arch-mxs/iomux-mx28.h b/arch/arm/include/asm/arch-mxs/iomux-mx28.h index b42820de74..39ea74bc21 100644 --- a/arch/arm/include/asm/arch-mxs/iomux-mx28.h +++ b/arch/arm/include/asm/arch-mxs/iomux-mx28.h @@ -2,12 +2,7 @@ * Copyright (C) 2009-2010 Amit Kucheria * Copyright (C) 2010 Freescale Semiconductor, Inc. * - * The code contained herein is licensed under the GNU General Public - * License. You may obtain a copy of the GNU General Public License - * Version 2 or later at the following locations: - * - * http://www.opensource.org/licenses/gpl-license.html - * http://www.gnu.org/copyleft/gpl.html + * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __MACH_IOMUX_MX28_H__ -- cgit From 3bd1642d4d50171291cb18bbae0cb3c8bf7fa5f7 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 15 Aug 2017 17:49:42 -0700 Subject: imx: fix USB boot mode detection for i.MX 6UL and 6ULL Add the reserved boot mode used in the bmode command for i.MX 6UL and 6ULL as introduced in commit 3fd9579085fa ("imx: mx6ull: fix USB bmode for i.MX 6UL and 6ULL"). Also replace BMODE_UART with BMODE_RESERVED, which is more appropriate. Commit 96aac843b68d ("imx: Use IMX6_BMODE_* macros instead of numericals") added macros for boot modes, in the process the reserved boot mode got named BMODE_UART. We use the reserved boot mode in the bmode command to let the boot ROM enter serial downloader recovery mode. But this is only a side effect, the actual boot mode is reserved... Signed-off-by: Stefan Agner --- arch/arm/include/asm/mach-imx/sys_proto.h | 7 ++++++- arch/arm/mach-imx/spl.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h index 046df6291a..d94c095118 100644 --- a/arch/arm/include/asm/mach-imx/sys_proto.h +++ b/arch/arm/include/asm/mach-imx/sys_proto.h @@ -69,8 +69,13 @@ enum imx6_bmode_emi { enum imx6_bmode { IMX6_BMODE_EMI, - IMX6_BMODE_UART, +#if defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL) + IMX6_BMODE_QSPI, + IMX6_BMODE_RESERVED, +#else + IMX6_BMODE_RESERVED, IMX6_BMODE_SATA, +#endif IMX6_BMODE_SERIAL_ROM, IMX6_BMODE_SD, IMX6_BMODE_ESD, diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c index 75698c48ea..836b334fa9 100644 --- a/arch/arm/mach-imx/spl.c +++ b/arch/arm/mach-imx/spl.c @@ -42,7 +42,7 @@ u32 spl_boot_device(void) break; } /* Reserved: Used to force Serial Downloader */ - case IMX6_BMODE_UART: + case IMX6_BMODE_RESERVED: return BOOT_DEVICE_UART; /* SATA: See 8.5.4, Table 8-20 */ case IMX6_BMODE_SATA: -- cgit From 962c78b1dfa6cd69333cad52c9298a3e1f85f606 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 15 Aug 2017 17:49:43 -0700 Subject: imx: use BOOT_DEVICE_BOARD instead of UART i.MX 6 serial downloader is not necessarily booting via UART but can also boot from USB. In fact only some i.MX chips have serial downloader support via UART (e.g. 6UL/ULL and Vybrid) but all of them have serial downloader support via USB. Use the more appropriate BOOT_DEVICE_BOARD define which is used for ROM provided recovery mechanisms in general. Signed-off-by: Stefan Agner --- arch/arm/mach-imx/spl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c index 836b334fa9..bcd1033fdb 100644 --- a/arch/arm/mach-imx/spl.c +++ b/arch/arm/mach-imx/spl.c @@ -27,7 +27,7 @@ u32 spl_boot_device(void) * BOOT_MODE - see IMX6DQRM Table 8-1 */ if (((bmode >> 24) & 0x03) == 0x01) /* Serial Downloader */ - return BOOT_DEVICE_UART; + return BOOT_DEVICE_BOARD; /* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */ switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) { @@ -43,7 +43,7 @@ u32 spl_boot_device(void) } /* Reserved: Used to force Serial Downloader */ case IMX6_BMODE_RESERVED: - return BOOT_DEVICE_UART; + return BOOT_DEVICE_BOARD; /* SATA: See 8.5.4, Table 8-20 */ case IMX6_BMODE_SATA: return BOOT_DEVICE_SATA; -- cgit From 3aa4b703b483f165dd2eb5c3324b44b60fbb1672 Mon Sep 17 00:00:00 2001 From: Breno Lima Date: Thu, 24 Aug 2017 10:00:16 -0300 Subject: imx: imx6: Move gpr_init() function to soc.c Since the gpr_init() function is common for boards using MX6S, MX6DL, MX6D, MX6Q and MX6QP processors move it to the soc.c file. Signed-off-by: Breno Lima Acked-by: Stefano Babic Reviewed-by: Lukasz Majewski Reviewed-by: Fabio Estevam --- arch/arm/include/asm/mach-imx/sys_proto.h | 2 ++ arch/arm/mach-imx/mx6/soc.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h index d94c095118..970c4ca760 100644 --- a/arch/arm/include/asm/mach-imx/sys_proto.h +++ b/arch/arm/include/asm/mach-imx/sys_proto.h @@ -90,6 +90,8 @@ static inline u8 imx6_is_bmode_from_gpr9(void) } u32 imx6_src_get_boot_mode(void); +void gpr_init(void); + #endif /* CONFIG_MX6 */ u32 get_nr_cpus(void); diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c index 9ede1f5435..f8bc05e68b 100644 --- a/arch/arm/mach-imx/mx6/soc.c +++ b/arch/arm/mach-imx/mx6/soc.c @@ -681,6 +681,23 @@ void imx_setup_hdmi(void) } #endif +void gpr_init(void) +{ + struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR; + + /* enable AXI cache for VDOA/VPU/IPU */ + writel(0xF00000CF, &iomux->gpr[4]); + if (is_mx6dqp()) { + /* set IPU AXI-id1 Qos=0x1 AXI-id0/2/3 Qos=0x7 */ + writel(0x77177717, &iomux->gpr[6]); + writel(0x77177717, &iomux->gpr[7]); + } else { + /* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */ + writel(0x007F007F, &iomux->gpr[6]); + writel(0x007F007F, &iomux->gpr[7]); + } +} + #ifdef CONFIG_IMX_BOOTAUX int arch_auxiliary_core_up(u32 core_id, u32 boot_private_data) { -- cgit From ae64226dbec2a50a2d88027018c9bd25b20c4ae0 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Mon, 28 Aug 2017 17:46:32 +0200 Subject: imx: timer: don't clear the GPT control register multiple times There is no need to clear the control register 100 times in a loop, a single zero write clears the register. I didn't find any justification why clearing this register in a loop is needed (no info in i.MX6 errata or GPT timer linux driver, linux driver uses single write to clear this control register). Signed-off-by: Anatolij Gustschin Acked-by: Stefano Babic --- arch/arm/mach-imx/timer.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-imx/timer.c b/arch/arm/mach-imx/timer.c index 9b011147d6..69dbf3c2ce 100644 --- a/arch/arm/mach-imx/timer.c +++ b/arch/arm/mach-imx/timer.c @@ -74,8 +74,7 @@ int timer_init(void) __raw_writel(GPTCR_SWR, &cur_gpt->control); /* We have no udelay by now */ - for (i = 0; i < 100; i++) - __raw_writel(0, &cur_gpt->control); + __raw_writel(0, &cur_gpt->control); i = __raw_readl(&cur_gpt->control); i &= ~GPTCR_CLKSOURCE_MASK; -- cgit From ffc36f57bc769bc111b157e2f27791756f8d4057 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Mon, 28 Aug 2017 17:51:33 +0200 Subject: imx6: don't include unneeded boot_mode array in SPL The soc_boot_modes array is only used by bmode command and not needed in SPL. Don't include it into SPL. Signed-off-by: Anatolij Gustschin Reviewed-by: Stefano Babic --- arch/arm/mach-imx/mx6/soc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c index f8bc05e68b..b72466808c 100644 --- a/arch/arm/mach-imx/mx6/soc.c +++ b/arch/arm/mach-imx/mx6/soc.c @@ -551,6 +551,7 @@ void imx_get_mac_from_fuse(int dev_id, unsigned char *mac) } #endif +#ifndef CONFIG_SPL_BUILD /* * cfg_val will be used for * Boot_cfg4[7:0]:Boot_cfg3[7:0]:Boot_cfg2[7:0]:Boot_cfg1[7:0] @@ -577,6 +578,7 @@ const struct boot_mode soc_boot_modes[] = { {"esdhc4", MAKE_CFGVAL(0x40, 0x38, 0x00, 0x00)}, {NULL, 0}, }; +#endif void reset_misc(void) { -- cgit From 624da53ca8a8196985a48bc32d788b434ae0f788 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 29 Aug 2017 09:10:11 -0700 Subject: imx: remove SATA boot mode for i.MX 6UL and 6ULL The NXP i.MX 6UL and 6ULL do not support SATA and have no SATA boot mode, hence remove it from the boot device detecion. This fixes a build error introduced with 3bd1642d4d50 ("imx: fix USB boot mode detection for i.MX 6UL and 6ULL") Fixes: 3bd1642d4d50 ("imx: fix USB boot mode detection for i.MX 6UL and 6ULL") Signed-off-by: Stefan Agner Reviewed-by: Stefano Babic Reviewed-by: Jagan Teki --- arch/arm/mach-imx/spl.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c index bcd1033fdb..3853e7739d 100644 --- a/arch/arm/mach-imx/spl.c +++ b/arch/arm/mach-imx/spl.c @@ -45,8 +45,10 @@ u32 spl_boot_device(void) case IMX6_BMODE_RESERVED: return BOOT_DEVICE_BOARD; /* SATA: See 8.5.4, Table 8-20 */ +#if !defined(CONFIG_MX6UL) && !defined(CONFIG_MX6ULL) case IMX6_BMODE_SATA: return BOOT_DEVICE_SATA; +#endif /* Serial ROM: See 8.5.5.1, Table 8-22 */ case IMX6_BMODE_SERIAL_ROM: /* BOOT_CFG4[2:0] */ -- cgit From 46668df5d0a94c6f546bcd31bd56c0ded7b4193f Mon Sep 17 00:00:00 2001 From: Jagan Teki Date: Mon, 28 Aug 2017 16:45:47 +0530 Subject: i.MX6Q: spl: Fix falcon to use dram_init_banksize Memory dt node update introduced by spl_fixup_fdt() in below commit was making DDR configuration in-appropriate to boot falcon mode. Hence added dram_init_banksize for explicit assignment of proper base and size of DDR. "boot: fdt: Perform arch_fixup_fdt() on the given device tree for falcon boot" (sha1: 6e7585bb64b12f632681c80c4b193349e1985d92) Signed-off-by: Jagan Teki --- arch/arm/mach-imx/spl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c index 3853e7739d..258578ac25 100644 --- a/arch/arm/mach-imx/spl.c +++ b/arch/arm/mach-imx/spl.c @@ -15,6 +15,8 @@ #include #include +DECLARE_GLOBAL_DATA_PTR; + #if defined(CONFIG_MX6) /* determine boot device from SRC_SBMR1 (BOOT_CFG[4:1]) or SRC_GPR9 register */ u32 spl_boot_device(void) @@ -128,3 +130,13 @@ __weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) } #endif + +#if defined(CONFIG_MX6) && defined(CONFIG_SPL_OS_BOOT) +int dram_init_banksize(void) +{ + gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; + gd->bd->bi_dram[0].size = imx_ddr_size(); + + return 0; +} +#endif -- cgit