mirror of
https://xff.cz/git/u-boot/
synced 2025-09-07 11:42:13 +02:00
ARM: imx: Add bmode support for iMX7
Add the basic differentiation between i.MX6 and i.MX7 into the bmode command, the mechanism really works almost the same on both platforms. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <festevam@gmail.com> Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de>
This commit is contained in:
committed by
Stefano Babic
parent
789bfb5266
commit
c72372d38c
@@ -126,6 +126,10 @@ void gpr_init(void);
|
|||||||
|
|
||||||
#endif /* CONFIG_MX6 */
|
#endif /* CONFIG_MX6 */
|
||||||
|
|
||||||
|
#ifdef CONFIG_MX7
|
||||||
|
#define IMX7_SRC_GPR10_BMODE BIT(28)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* address translation table */
|
/* address translation table */
|
||||||
struct rproc_att {
|
struct rproc_att {
|
||||||
u32 da; /* device address (From Cortex M4 view) */
|
u32 da; /* device address (From Cortex M4 view) */
|
||||||
|
@@ -62,7 +62,7 @@ config CSF_SIZE
|
|||||||
config CMD_BMODE
|
config CMD_BMODE
|
||||||
bool "Support the 'bmode' command"
|
bool "Support the 'bmode' command"
|
||||||
default y
|
default y
|
||||||
depends on ARCH_MX6 || ARCH_MX5
|
depends on ARCH_MX7 || ARCH_MX6 || ARCH_MX5
|
||||||
help
|
help
|
||||||
This enables the 'bmode' (bootmode) command for forcing
|
This enables the 'bmode' (bootmode) command for forcing
|
||||||
a boot from specific media.
|
a boot from specific media.
|
||||||
|
@@ -103,14 +103,20 @@ void init_src(void)
|
|||||||
#ifdef CONFIG_CMD_BMODE
|
#ifdef CONFIG_CMD_BMODE
|
||||||
void boot_mode_apply(unsigned cfg_val)
|
void boot_mode_apply(unsigned cfg_val)
|
||||||
{
|
{
|
||||||
unsigned reg;
|
#ifdef CONFIG_MX6
|
||||||
|
const u32 bmode = IMX6_SRC_GPR10_BMODE;
|
||||||
|
#elif CONFIG_MX7
|
||||||
|
const u32 bmode = IMX7_SRC_GPR10_BMODE;
|
||||||
|
#endif
|
||||||
struct src *psrc = (struct src *)SRC_BASE_ADDR;
|
struct src *psrc = (struct src *)SRC_BASE_ADDR;
|
||||||
|
unsigned reg;
|
||||||
|
|
||||||
writel(cfg_val, &psrc->gpr9);
|
writel(cfg_val, &psrc->gpr9);
|
||||||
reg = readl(&psrc->gpr10);
|
reg = readl(&psrc->gpr10);
|
||||||
if (cfg_val)
|
if (cfg_val)
|
||||||
reg |= IMX6_SRC_GPR10_BMODE;
|
reg |= bmode;
|
||||||
else
|
else
|
||||||
reg &= ~IMX6_SRC_GPR10_BMODE;
|
reg &= ~bmode;
|
||||||
writel(reg, &psrc->gpr10);
|
writel(reg, &psrc->gpr10);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
#include <asm/mach-imx/hab.h>
|
#include <asm/mach-imx/hab.h>
|
||||||
#include <asm/mach-imx/rdc-sema.h>
|
#include <asm/mach-imx/rdc-sema.h>
|
||||||
#include <asm/arch/imx-rdc.h>
|
#include <asm/arch/imx-rdc.h>
|
||||||
|
#include <asm/mach-imx/boot_mode.h>
|
||||||
#include <asm/arch/crm_regs.h>
|
#include <asm/arch/crm_regs.h>
|
||||||
#include <dm.h>
|
#include <dm.h>
|
||||||
#include <env.h>
|
#include <env.h>
|
||||||
@@ -410,6 +411,13 @@ void s_init(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef CONFIG_SPL_BUILD
|
||||||
|
const struct boot_mode soc_boot_modes[] = {
|
||||||
|
{"normal", MAKE_CFGVAL(0x00, 0x00, 0x00, 0x00)},
|
||||||
|
{NULL, 0},
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
void reset_misc(void)
|
void reset_misc(void)
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_SPL_BUILD
|
#ifndef CONFIG_SPL_BUILD
|
||||||
|
Reference in New Issue
Block a user