diff options
author | 2023-10-10 14:33:42 +0000 | |
---|---|---|
committer | 2023-10-10 14:33:42 +0000 | |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/u-boot/arch/arm/mach-imx/imxrt | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/u-boot/arch/arm/mach-imx/imxrt')
-rw-r--r-- | roms/u-boot/arch/arm/mach-imx/imxrt/Kconfig | 34 | ||||
-rw-r--r-- | roms/u-boot/arch/arm/mach-imx/imxrt/Makefile | 7 | ||||
-rw-r--r-- | roms/u-boot/arch/arm/mach-imx/imxrt/soc.c | 49 |
3 files changed, 90 insertions, 0 deletions
diff --git a/roms/u-boot/arch/arm/mach-imx/imxrt/Kconfig b/roms/u-boot/arch/arm/mach-imx/imxrt/Kconfig new file mode 100644 index 000000000..d275fdf72 --- /dev/null +++ b/roms/u-boot/arch/arm/mach-imx/imxrt/Kconfig @@ -0,0 +1,34 @@ +if ARCH_IMXRT + +config IMXRT + bool + +config IMXRT1020 + bool + select IMXRT + +config IMXRT1050 + bool + select IMXRT + +config SYS_SOC + default "imxrt" + +choice + prompt "NXP i.MXRT board select" + optional + +config TARGET_IMXRT1020_EVK + bool "Support imxrt1020 EVK board" + select IMXRT1020 + +config TARGET_IMXRT1050_EVK + bool "Support imxrt1050 EVK board" + select IMXRT1050 + +endchoice + +source "board/freescale/imxrt1020-evk/Kconfig" +source "board/freescale/imxrt1050-evk/Kconfig" + +endif diff --git a/roms/u-boot/arch/arm/mach-imx/imxrt/Makefile b/roms/u-boot/arch/arm/mach-imx/imxrt/Makefile new file mode 100644 index 000000000..9621a8335 --- /dev/null +++ b/roms/u-boot/arch/arm/mach-imx/imxrt/Makefile @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2019 +# Author(s): Giulio Benetti <giulio.benetti@benettiengineering.com> +# + +obj-y := soc.o diff --git a/roms/u-boot/arch/arm/mach-imx/imxrt/soc.c b/roms/u-boot/arch/arm/mach-imx/imxrt/soc.c new file mode 100644 index 000000000..ba015992e --- /dev/null +++ b/roms/u-boot/arch/arm/mach-imx/imxrt/soc.c @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 + * Author(s): Giulio Benetti <giulio.benetti@benettiengineering.com> + */ + +#include <common.h> +#include <init.h> +#include <asm/io.h> +#include <asm/armv7_mpu.h> +#include <asm/mach-imx/sys_proto.h> +#include <linux/bitops.h> + +int arch_cpu_init(void) +{ + int i; + + struct mpu_region_config imxrt_region_config[] = { + { 0x00000000, REGION_0, XN_DIS, PRIV_RW_USR_RW, + STRONG_ORDER, REGION_4GB }, + { PHYS_SDRAM, REGION_1, XN_DIS, PRIV_RW_USR_RW, + O_I_WB_RD_WR_ALLOC, (ffs(PHYS_SDRAM_SIZE) - 2) }, + { DMAMEM_BASE, + REGION_2, XN_DIS, PRIV_RW_USR_RW, + STRONG_ORDER, (ffs(DMAMEM_SZ_ALL) - 2) }, + }; + + /* + * Configure the memory protection unit (MPU) to allow full access to + * the whole 4GB address space. + */ + disable_mpu(); + for (i = 0; i < ARRAY_SIZE(imxrt_region_config); i++) + mpu_config(&imxrt_region_config[i]); + enable_mpu(); + + return 0; +} + +u32 get_cpu_rev(void) +{ +#if defined(CONFIG_IMXRT1020) + return MXC_CPU_IMXRT1020 << 12; +#elif defined(CONFIG_IMXRT1050) + return MXC_CPU_IMXRT1050 << 12; +#else +#error This IMXRT SoC is not supported +#endif +} |