aboutsummaryrefslogtreecommitdiffstats
path: root/roms/u-boot/board/freescale/imxrt1020-evk
diff options
context:
space:
mode:
Diffstat (limited to 'roms/u-boot/board/freescale/imxrt1020-evk')
-rw-r--r--roms/u-boot/board/freescale/imxrt1020-evk/Kconfig22
-rw-r--r--roms/u-boot/board/freescale/imxrt1020-evk/MAINTAINERS6
-rw-r--r--roms/u-boot/board/freescale/imxrt1020-evk/Makefile6
-rw-r--r--roms/u-boot/board/freescale/imxrt1020-evk/imximage.cfg36
-rw-r--r--roms/u-boot/board/freescale/imxrt1020-evk/imxrt1020-evk.c84
5 files changed, 154 insertions, 0 deletions
diff --git a/roms/u-boot/board/freescale/imxrt1020-evk/Kconfig b/roms/u-boot/board/freescale/imxrt1020-evk/Kconfig
new file mode 100644
index 000000000..d00cbff09
--- /dev/null
+++ b/roms/u-boot/board/freescale/imxrt1020-evk/Kconfig
@@ -0,0 +1,22 @@
+if TARGET_IMXRT1020_EVK
+
+config SYS_BOARD
+ string
+ default "imxrt1020-evk"
+
+config SYS_VENDOR
+ string
+ default "freescale"
+
+config SYS_SOC
+ string
+ default "imxrt1020"
+
+config SYS_CONFIG_NAME
+ string
+ default "imxrt1020-evk"
+
+config IMX_CONFIG
+ default "board/freescale/imxrt1020-evk/imximage.cfg"
+
+endif
diff --git a/roms/u-boot/board/freescale/imxrt1020-evk/MAINTAINERS b/roms/u-boot/board/freescale/imxrt1020-evk/MAINTAINERS
new file mode 100644
index 000000000..05f017b2b
--- /dev/null
+++ b/roms/u-boot/board/freescale/imxrt1020-evk/MAINTAINERS
@@ -0,0 +1,6 @@
+IMXRT1020 EVALUATION KIT
+M: Giulio Benetti <giulio.benetti@benettiengineering.com>
+S: Maintained
+F: board/freescale/imxrt1020-evk
+F: include/configs/imxrt1020-evk.h
+F: configs/imxrt1020-evk_defconfig
diff --git a/roms/u-boot/board/freescale/imxrt1020-evk/Makefile b/roms/u-boot/board/freescale/imxrt1020-evk/Makefile
new file mode 100644
index 000000000..807dc7c35
--- /dev/null
+++ b/roms/u-boot/board/freescale/imxrt1020-evk/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2020
+# Author(s): Giulio Benetti <giulio.benetti@benettiengineering.com>
+
+obj-y := imxrt1020-evk.o
diff --git a/roms/u-boot/board/freescale/imxrt1020-evk/imximage.cfg b/roms/u-boot/board/freescale/imxrt1020-evk/imximage.cfg
new file mode 100644
index 000000000..9bcc2c159
--- /dev/null
+++ b/roms/u-boot/board/freescale/imxrt1020-evk/imximage.cfg
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2020
+ * Author(s): Giulio Benetti <giulio.benetti@benettiengineering.com>
+ */
+
+#define __ASSEMBLY__
+#include <config.h>
+
+/* image version */
+
+IMAGE_VERSION 2
+
+/*
+ * Boot Device : one of
+ * spi/sd/nand/onenand, qspi/nor
+ */
+
+BOOT_FROM sd
+
+/*
+ * Device Configuration Data (DCD)
+ *
+ * Each entry must have the format:
+ * Addr-type Address Value
+ *
+ * where:
+ * Addr-type register length (1,2 or 4 bytes)
+ * Address absolute address of the register
+ * value value to be stored in the register
+ */
+
+/* Set all FlexRAM as OCRAM(01b) */
+DATA 4 0x400AC044 0x00005555
+/* Use FLEXRAM_BANK_CFG to config FlexRAM */
+SET_BIT 4 0x400AC040 0x4
diff --git a/roms/u-boot/board/freescale/imxrt1020-evk/imxrt1020-evk.c b/roms/u-boot/board/freescale/imxrt1020-evk/imxrt1020-evk.c
new file mode 100644
index 000000000..479e66bdd
--- /dev/null
+++ b/roms/u-boot/board/freescale/imxrt1020-evk/imxrt1020-evk.c
@@ -0,0 +1,84 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2020
+ * Author(s): Giulio Benetti <giulio.benetti@benettiengineering.com>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <init.h>
+#include <log.h>
+#include <ram.h>
+#include <spl.h>
+#include <asm/global_data.h>
+#include <asm/io.h>
+#include <asm/armv7m.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int dram_init(void)
+{
+#ifndef CONFIG_SUPPORT_SPL
+ int rv;
+ struct udevice *dev;
+
+ rv = uclass_get_device(UCLASS_RAM, 0, &dev);
+ if (rv) {
+ debug("DRAM init failed: %d\n", rv);
+ return rv;
+ }
+
+#endif
+ return fdtdec_setup_mem_size_base();
+}
+
+int dram_init_banksize(void)
+{
+ return fdtdec_setup_memory_banksize();
+}
+
+#ifdef CONFIG_SPL_BUILD
+#ifdef CONFIG_SPL_OS_BOOT
+int spl_start_uboot(void)
+{
+ debug("SPL: booting kernel\n");
+ /* break into full u-boot on 'c' */
+ return serial_tstc() && serial_getc() == 'c';
+}
+#endif
+
+int spl_dram_init(void)
+{
+ struct udevice *dev;
+ int rv;
+
+ rv = uclass_get_device(UCLASS_RAM, 0, &dev);
+ if (rv)
+ debug("DRAM init failed: %d\n", rv);
+ return rv;
+}
+
+void spl_board_init(void)
+{
+ preloader_console_init();
+ spl_dram_init();
+ arch_cpu_init(); /* to configure mpu for sdram rw permissions */
+}
+
+u32 spl_boot_device(void)
+{
+ return BOOT_DEVICE_MMC1;
+}
+#endif
+
+u32 get_board_rev(void)
+{
+ return 0;
+}
+
+int board_init(void)
+{
+ gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
+
+ return 0;
+}