Skip to content
Snippets Groups Projects
Commit 6aee2ab6 authored by Tom Rini's avatar Tom Rini
Browse files

Signed-off-by: default avatarTom Rini <trini@konsulko.com>

Conflicts:
	configs/imx6qdl_icore_mmc_defconfig
	configs/imx6qdl_icore_rqs_defconfig
parents 4109d702 63af4b0a
No related branches found
No related tags found
No related merge requests found
Showing
with 74 additions and 163 deletions
...@@ -3,23 +3,7 @@ ...@@ -3,23 +3,7 @@
* Texas Instruments, <www.ti.com> * Texas Instruments, <www.ti.com>
* Syed Mohammed Khasim <khasim@ti.com> * Syed Mohammed Khasim <khasim@ti.com>
* *
* See file CREDITS for list of people who contributed to this * SPDX-License-Identifier: GPL-2.0
* 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
*/ */
#ifndef MMC_HOST_DEF_H #ifndef MMC_HOST_DEF_H
......
...@@ -3,12 +3,7 @@ ...@@ -3,12 +3,7 @@
* Copyright (C) 2010 Freescale Semiconductor, Inc. * Copyright (C) 2010 Freescale Semiconductor, Inc.
* Copyright (C) 2009-2012 Genesi USA, Inc. * Copyright (C) 2009-2012 Genesi USA, Inc.
* *
* The code contained herein is licensed under the GNU General Public * SPDX-License-Identifier: GPL-2.0+
* 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
*/ */
/* /*
......
...@@ -2,12 +2,7 @@ ...@@ -2,12 +2,7 @@
* Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com> * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com>
* Copyright (C) 2010 Freescale Semiconductor, Inc. * Copyright (C) 2010 Freescale Semiconductor, Inc.
* *
* The code contained herein is licensed under the GNU General Public * SPDX-License-Identifier: GPL-2.0+
* 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
*/ */
#ifndef __MACH_IOMUX_MX23_H__ #ifndef __MACH_IOMUX_MX23_H__
......
...@@ -2,12 +2,7 @@ ...@@ -2,12 +2,7 @@
* Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com> * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com>
* Copyright (C) 2010 Freescale Semiconductor, Inc. * Copyright (C) 2010 Freescale Semiconductor, Inc.
* *
* The code contained herein is licensed under the GNU General Public * SPDX-License-Identifier: GPL-2.0+
* 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
*/ */
#ifndef __MACH_IOMUX_MX28_H__ #ifndef __MACH_IOMUX_MX28_H__
......
...@@ -69,8 +69,13 @@ enum imx6_bmode_emi { ...@@ -69,8 +69,13 @@ enum imx6_bmode_emi {
enum imx6_bmode { enum imx6_bmode {
IMX6_BMODE_EMI, 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, IMX6_BMODE_SATA,
#endif
IMX6_BMODE_SERIAL_ROM, IMX6_BMODE_SERIAL_ROM,
IMX6_BMODE_SD, IMX6_BMODE_SD,
IMX6_BMODE_ESD, IMX6_BMODE_ESD,
...@@ -85,6 +90,8 @@ static inline u8 imx6_is_bmode_from_gpr9(void) ...@@ -85,6 +90,8 @@ static inline u8 imx6_is_bmode_from_gpr9(void)
} }
u32 imx6_src_get_boot_mode(void); u32 imx6_src_get_boot_mode(void);
void gpr_init(void);
#endif /* CONFIG_MX6 */ #endif /* CONFIG_MX6 */
u32 get_nr_cpus(void); u32 get_nr_cpus(void);
......
...@@ -551,6 +551,7 @@ void imx_get_mac_from_fuse(int dev_id, unsigned char *mac) ...@@ -551,6 +551,7 @@ void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
} }
#endif #endif
#ifndef CONFIG_SPL_BUILD
/* /*
* cfg_val will be used for * cfg_val will be used for
* Boot_cfg4[7:0]:Boot_cfg3[7:0]:Boot_cfg2[7:0]:Boot_cfg1[7:0] * 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[] = { ...@@ -577,6 +578,7 @@ const struct boot_mode soc_boot_modes[] = {
{"esdhc4", MAKE_CFGVAL(0x40, 0x38, 0x00, 0x00)}, {"esdhc4", MAKE_CFGVAL(0x40, 0x38, 0x00, 0x00)},
{NULL, 0}, {NULL, 0},
}; };
#endif
void reset_misc(void) void reset_misc(void)
{ {
...@@ -681,6 +683,23 @@ void imx_setup_hdmi(void) ...@@ -681,6 +683,23 @@ void imx_setup_hdmi(void)
} }
#endif #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 #ifdef CONFIG_IMX_BOOTAUX
int arch_auxiliary_core_up(u32 core_id, u32 boot_private_data) int arch_auxiliary_core_up(u32 core_id, u32 boot_private_data)
{ {
......
/*
* Copyright (C) 2015-2016 Freescale Semiconductor, Inc.
* Copyright 2017 NXP
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <asm/io.h> #include <asm/io.h>
#include <asm/psci.h> #include <asm/psci.h>
#include <asm/secure.h> #include <asm/secure.h>
......
/*
* Copyright (C) 2015-2016 Freescale Semiconductor, Inc.
* Copyright 2017 NXP
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <config.h> #include <config.h>
#include <linux/linkage.h> #include <linux/linkage.h>
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include <spl.h> #include <spl.h>
#include <asm/mach-imx/hab.h> #include <asm/mach-imx/hab.h>
DECLARE_GLOBAL_DATA_PTR;
#if defined(CONFIG_MX6) #if defined(CONFIG_MX6)
/* determine boot device from SRC_SBMR1 (BOOT_CFG[4:1]) or SRC_GPR9 register */ /* determine boot device from SRC_SBMR1 (BOOT_CFG[4:1]) or SRC_GPR9 register */
u32 spl_boot_device(void) u32 spl_boot_device(void)
...@@ -27,7 +29,7 @@ u32 spl_boot_device(void) ...@@ -27,7 +29,7 @@ u32 spl_boot_device(void)
* BOOT_MODE - see IMX6DQRM Table 8-1 * BOOT_MODE - see IMX6DQRM Table 8-1
*/ */
if (((bmode >> 24) & 0x03) == 0x01) /* Serial Downloader */ if (((bmode >> 24) & 0x03) == 0x01) /* Serial Downloader */
return BOOT_DEVICE_UART; return BOOT_DEVICE_BOARD;
/* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */ /* BOOT_CFG1[7:4] - see IMX6DQRM Table 8-8 */
switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) { switch ((reg & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
...@@ -42,11 +44,13 @@ u32 spl_boot_device(void) ...@@ -42,11 +44,13 @@ u32 spl_boot_device(void)
break; break;
} }
/* Reserved: Used to force Serial Downloader */ /* Reserved: Used to force Serial Downloader */
case IMX6_BMODE_UART: case IMX6_BMODE_RESERVED:
return BOOT_DEVICE_UART; return BOOT_DEVICE_BOARD;
/* SATA: See 8.5.4, Table 8-20 */ /* SATA: See 8.5.4, Table 8-20 */
#if !defined(CONFIG_MX6UL) && !defined(CONFIG_MX6ULL)
case IMX6_BMODE_SATA: case IMX6_BMODE_SATA:
return BOOT_DEVICE_SATA; return BOOT_DEVICE_SATA;
#endif
/* Serial ROM: See 8.5.5.1, Table 8-22 */ /* Serial ROM: See 8.5.5.1, Table 8-22 */
case IMX6_BMODE_SERIAL_ROM: case IMX6_BMODE_SERIAL_ROM:
/* BOOT_CFG4[2:0] */ /* BOOT_CFG4[2:0] */
...@@ -126,3 +130,13 @@ __weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) ...@@ -126,3 +130,13 @@ __weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
} }
#endif #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
...@@ -74,8 +74,7 @@ int timer_init(void) ...@@ -74,8 +74,7 @@ int timer_init(void)
__raw_writel(GPTCR_SWR, &cur_gpt->control); __raw_writel(GPTCR_SWR, &cur_gpt->control);
/* We have no udelay by now */ /* 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 = __raw_readl(&cur_gpt->control);
i &= ~GPTCR_CLKSOURCE_MASK; i &= ~GPTCR_CLKSOURCE_MASK;
......
...@@ -169,17 +169,6 @@ static void ccgr_init(void) ...@@ -169,17 +169,6 @@ static void ccgr_init(void)
writel(0x000003FF, &ccm->CCGR6); writel(0x000003FF, &ccm->CCGR6);
} }
static void gpr_init(void)
{
struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
/* enable AXI cache for VDOA/VPU/IPU */
writel(0xF00000CF, &iomux->gpr[4]);
/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
writel(0x007F007F, &iomux->gpr[6]);
writel(0x007F007F, &iomux->gpr[7]);
}
int board_early_init_f(void) int board_early_init_f(void)
{ {
ccgr_init(); ccgr_init();
......
...@@ -75,15 +75,4 @@ static inline void ccgr_init(void) ...@@ -75,15 +75,4 @@ static inline void ccgr_init(void)
writel(0x000003FF, &ccm->CCGR6); writel(0x000003FF, &ccm->CCGR6);
} }
static inline void gpr_init(void)
{
struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
/* enable AXI cache for VDOA/VPU/IPU */
writel(0xF00000CF, &iomux->gpr[4]);
/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
writel(0x007F007F, &iomux->gpr[6]);
writel(0x007F007F, &iomux->gpr[7]);
}
#endif /* _PLATINUM_H_ */ #endif /* _PLATINUM_H_ */
...@@ -955,17 +955,6 @@ static void ccgr_init(void) ...@@ -955,17 +955,6 @@ static void ccgr_init(void)
writel(0x000003FF, &ccm->CCGR6); writel(0x000003FF, &ccm->CCGR6);
} }
static void gpr_init(void)
{
struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
/* enable AXI cache for VDOA/VPU/IPU */
writel(0xF00000CF, &iomux->gpr[4]);
/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
writel(0x007F007F, &iomux->gpr[6]);
writel(0x007F007F, &iomux->gpr[7]);
}
/* Define a minimal structure so that the part number can be read via SPL */ /* Define a minimal structure so that the part number can be read via SPL */
struct mfgdata { struct mfgdata {
unsigned char tsize; unsigned char tsize;
......
...@@ -570,17 +570,6 @@ static void ccgr_init(void) ...@@ -570,17 +570,6 @@ static void ccgr_init(void)
writel(0x000003FF, &ccm->CCGR6); writel(0x000003FF, &ccm->CCGR6);
} }
static void gpr_init(void)
{
struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
/* enable AXI cache for VDOA/VPU/IPU */
writel(0xF00000CF, &iomux->gpr[4]);
/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
writel(0x007F007F, &iomux->gpr[6]);
writel(0x007F007F, &iomux->gpr[7]);
}
/* /*
* This section requires the differentiation between iMX6 Sabre boards, but * This section requires the differentiation between iMX6 Sabre boards, but
* for now, it will configure only for the mx6q variant. * for now, it will configure only for the mx6q variant.
......
...@@ -39,6 +39,17 @@ static iomux_v3_cfg_t const uart_pads[] = { ...@@ -39,6 +39,17 @@ static iomux_v3_cfg_t const uart_pads[] = {
#endif #endif
}; };
#ifdef CONFIG_SPL_OS_BOOT
int spl_start_uboot(void)
{
/* break into full u-boot on 'c' */
if (serial_tstc() && serial_getc() == 'c')
return 1;
return 0;
}
#endif
#ifdef CONFIG_MX6QDL #ifdef CONFIG_MX6QDL
/* /*
* Driving strength: * Driving strength:
...@@ -332,17 +343,6 @@ static void ccgr_init(void) ...@@ -332,17 +343,6 @@ static void ccgr_init(void)
#endif #endif
} }
static void gpr_init(void)
{
struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
/* enable AXI cache for VDOA/VPU/IPU */
writel(0xF00000CF, &iomux->gpr[4]);
/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
writel(0x007F007F, &iomux->gpr[6]);
writel(0x007F007F, &iomux->gpr[7]);
}
static void spl_dram_init(void) static void spl_dram_init(void)
{ {
#ifdef CONFIG_MX6QDL #ifdef CONFIG_MX6QDL
......
...@@ -798,23 +798,6 @@ static void ccgr_init(void) ...@@ -798,23 +798,6 @@ static void ccgr_init(void)
writel(0x000003FF, &ccm->CCGR6); writel(0x000003FF, &ccm->CCGR6);
} }
static 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]);
}
}
static int mx6q_dcd_table[] = { static int mx6q_dcd_table[] = {
0x020e0798, 0x000C0000, 0x020e0798, 0x000C0000,
0x020e0758, 0x00000000, 0x020e0758, 0x00000000,
......
...@@ -747,23 +747,6 @@ static void ccgr_init(void) ...@@ -747,23 +747,6 @@ static void ccgr_init(void)
writel(0x000003FF, &ccm->CCGR6); writel(0x000003FF, &ccm->CCGR6);
} }
static 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]);
}
}
static int mx6q_dcd_table[] = { static int mx6q_dcd_table[] = {
0x020e0798, 0x000C0000, 0x020e0798, 0x000C0000,
0x020e0758, 0x00000000, 0x020e0758, 0x00000000,
......
...@@ -583,17 +583,6 @@ static void ccgr_init(void) ...@@ -583,17 +583,6 @@ static void ccgr_init(void)
writel(0x000003FF, &ccm->CCGR6); writel(0x000003FF, &ccm->CCGR6);
} }
static void gpr_init(void)
{
struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
/* enable AXI cache for VDOA/VPU/IPU */
writel(0xF00000CF, &iomux->gpr[4]);
/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
writel(0x007F007F, &iomux->gpr[6]);
writel(0x007F007F, &iomux->gpr[7]);
}
/* /*
* called from C runtime startup code (arch/arm/lib/crt0.S:_main) * called from C runtime startup code (arch/arm/lib/crt0.S:_main)
* - we have a stack and a place to store GD, both in SRAM * - we have a stack and a place to store GD, both in SRAM
......
...@@ -550,17 +550,6 @@ static void ccgr_init(void) ...@@ -550,17 +550,6 @@ static void ccgr_init(void)
writel(0x000003FF, &ccm->CCGR6); writel(0x000003FF, &ccm->CCGR6);
} }
static void gpr_init(void)
{
struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
/* enable AXI cache for VDOA/VPU/IPU */
writel(0xF00000CF, &iomux->gpr[4]);
/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
writel(0x007F007F, &iomux->gpr[6]);
writel(0x007F007F, &iomux->gpr[7]);
}
/* /*
* called from C runtime startup code (arch/arm/lib/crt0.S:_main) * called from C runtime startup code (arch/arm/lib/crt0.S:_main)
* - we have a stack and a place to store GD, both in SRAM * - we have a stack and a place to store GD, both in SRAM
......
...@@ -260,17 +260,6 @@ static void ccgr_init(void) ...@@ -260,17 +260,6 @@ static void ccgr_init(void)
writel(0x000003FF, &ccm->CCGR6); writel(0x000003FF, &ccm->CCGR6);
} }
static void gpr_init(void)
{
struct iomuxc *iomux = (struct iomuxc *)IOMUXC_BASE_ADDR;
/* enable AXI cache for VDOA/VPU/IPU */
writel(0xF00000CF, &iomux->gpr[4]);
/* set IPU AXI-id0 Qos=0xf(bypass) AXI-id1 Qos=0x7 */
writel(0x007F007F, &iomux->gpr[6]);
writel(0x007F007F, &iomux->gpr[7]);
}
static void spl_dram_init(void) static void spl_dram_init(void)
{ {
if (is_cpu_type(MXC_CPU_MX6SOLO)) { if (is_cpu_type(MXC_CPU_MX6SOLO)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment