Skip to contentSkip to conversation

ARM: imx: mxs: Add support for imx287 based BTT devices

PATCH Superseded Lukasz Majewski 2 participants 2 messages May 31, 2025 – Jun 2, 2025

Subsystems (3)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx: mxs: Add support for imx287 based BTT devices

The btt[c3] devices are based on imx287 SoC.

U-Boot SPL 2025.04-01081-g07e086681d26 (Apr 16 2025 - 12:24:36 +0200) Trying to boot from MMC1

U-Boot 2025.04-01081-g07e086681d26 (Apr 16 2025 - 12:24:36 +0200)

CPU:   Freescale i.MX28 rev1.2 at 454 MHz
BOOT:  SSP SPI #3, master, 3V3 NOR
Model: BTT3
Board: LWE BTT SoM HW rev 0
DRAM:  256 MiB
Core:  86 devices, 15 uclasses, devicetree: separate
MMC:   MXS MMC: 0
Loading Environment from SPIFlash... SF: Detected is25lp128 with page
                    size 256 Bytes, erase size 64 KiB, total 16 MiB
OK
In:    serial@80074000
Out:   serial@80074000
Err:   serial@80074000
Net:   eth0: ethernet@800f0000
Hit any key to stop autoboot:  0
---
 arch/arm/dts/imx28-btt3-0-u-boot.dtsi |   7 +
 arch/arm/dts/imx28-btt3-1-u-boot.dtsi |   7 +
 arch/arm/dts/imx28-btt3-2-u-boot.dtsi |   7 +
 arch/arm/dts/imx28-btt3-u-boot.dtsi   |  90 ++++++
 arch/arm/mach-imx/mxs/Kconfig         |   6 +
 board/liebherr/btt/Kconfig            |  24 ++
 board/liebherr/btt/MAINTAINERS        |   6 +
 board/liebherr/btt/Makefile           |   9 +
 board/liebherr/btt/README             |  11 +
 board/liebherr/btt/boot_img_scr.h     |  27 ++
 board/liebherr/btt/btt.c              | 449 ++++++++++++++++++++++++++
 board/liebherr/btt/btt.env            | 139 ++++++++
 board/liebherr/btt/spl_btt.c          | 316 ++++++++++++++++++
 configs/imx28_btt3_defconfig          | 140 ++++++++
 include/configs/btt.h                 |  17 +
 15 files changed, 1255 insertions(+)
 create mode 100644 arch/arm/dts/imx28-btt3-0-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx28-btt3-1-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx28-btt3-2-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx28-btt3-u-boot.dtsi
 create mode 100644 board/liebherr/btt/Kconfig
 create mode 100644 board/liebherr/btt/MAINTAINERS
 create mode 100644 board/liebherr/btt/Makefile
 create mode 100644 board/liebherr/btt/README
 create mode 100644 board/liebherr/btt/boot_img_scr.h
 create mode 100644 board/liebherr/btt/btt.c
 create mode 100644 board/liebherr/btt/btt.env
 create mode 100644 board/liebherr/btt/spl_btt.c
 create mode 100644 configs/imx28_btt3_defconfig
 create mode 100644 include/configs/btt.h
arch/arm/dts/imx28-btt3-0-u-boot.dtsi new file +7 -0
new file mode 100644
index 00000000000..b128eef9e17
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2025
+ * Lukasz Majewski, DENX Software Engineering, [email protected]
+ */
+
+#include "imx28-btt3-u-boot.dtsi"
arch/arm/dts/imx28-btt3-1-u-boot.dtsi new file +7 -0
new file mode 100644
index 00000000000..b128eef9e17
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2025
+ * Lukasz Majewski, DENX Software Engineering, [email protected]
+ */
+
+#include "imx28-btt3-u-boot.dtsi"
arch/arm/dts/imx28-btt3-2-u-boot.dtsi new file +7 -0
new file mode 100644
index 00000000000..b128eef9e17
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2025
+ * Lukasz Majewski, DENX Software Engineering, [email protected]
+ */
+
+#include "imx28-btt3-u-boot.dtsi"
arch/arm/dts/imx28-btt3-u-boot.dtsi new file +90 -0

90 lines not on this page · raw message

arch/arm/mach-imx/mxs/Kconfig +6 -0
index d2e4205c5ce..6d466868fe4 100644
@@ -38,6 +38,11 @@ choice
 	prompt "MX28 board select"
 	optional
 
+config TARGET_BTT
+	bool "Support BTT"
+	select PL01X_SERIAL
+	imply OF_UPSTREAM
+
 config TARGET_MX28EVK
 	bool "Support mx28evk"
 	select PL01X_SERIAL
@@ -69,6 +74,7 @@ config SPL_MXS_PMU_ENABLE_4P2_LINEAR_REGULATOR
 	  This option enables the 4P2 linear regulator (derived
 	  from VDD5V) - so the VDD4P2 power source is operational.
 
+source "board/liebherr/btt/Kconfig"
 source "board/freescale/mx28evk/Kconfig"
 source "board/liebherr/xea/Kconfig"
 
board/liebherr/btt/Kconfig new file +24 -0
new file mode 100644
index 00000000000..ff35dd04532
@@ -0,0 +1,24 @@
+if TARGET_BTT
+
+config SYS_BOARD
+	default "btt"
+
+config SYS_VENDOR
+	default "liebherr"
+
+config SYS_SOC
+	default "mxs"
+
+config SYS_CONFIG_NAME
+	default "btt"
+
+config ENV_SIZE
+	default 0x2000
+
+config ENV_SECT_SIZE
+	default 0x10000 if ENV_IS_IN_SPI_FLASH
+
+config ENV_OFFSET
+	default 0x80000 if ENV_IS_IN_SPI_FLASH
+
+endif
board/liebherr/btt/MAINTAINERS new file +6 -0
new file mode 100644
index 00000000000..b4afed5aaeb
@@ -0,0 +1,6 @@
+BTT BOARD
+M:	Lukasz Majewski <[email protected]>
+S:	Maintained
+F:	board/liebherr/btt/
+F:	include/configs/btt.h
+F:	configs/imx28_btt3_defconfig
board/liebherr/btt/Makefile new file +9 -0
new file mode 100644
index 00000000000..a8ab657a9e0
@@ -0,0 +1,9 @@
+#
+# (C) Copyright 2025
+# Lukasz Majewski, DENX Software Engineering, [email protected].
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= btt.o
+obj-$(CONFIG_XPL_BUILD) += spl_btt.o
board/liebherr/btt/README new file +11 -0
new file mode 100644
index 00000000000..31d9e33ae53
@@ -0,0 +1,11 @@
+Building SPL/U-Boot for btt board
+=================================
+
+Setup environment, configure and build, e.g. by:
+
+ $ make imx28_btt3_defconfig
+ $ make -j4 u-boot.sb u-boot.img
+
+Now you should see u-boot.sb and u-boot.img files in the build directory.
+
+Description regarding the btt board is idential as the one for the xea board.
board/liebherr/btt/boot_img_scr.h new file +27 -0
new file mode 100644
index 00000000000..baa3072b49c
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier:     GPL-2.0+ */
+/*
+ * Struct for boot image source description for placing in last
+ * two SPI NOR flash sectors on legcom.
+ */
+
+struct boot_img_src {
+	u8 magic;	/* Must be 'B' = 0x42 */
+	u8 flags;	/* flags to specify mmcblk[0|1] boot[0|1] */
+	u8 crc8;	/* CRC-8 over above two bytes */
+} __packed;
+
+/*
+ * Bit definition in boot_img_src.flags:
+ *  Bit 0: mmcblk device 0 or 1 (1 - if this bit set)
+ *  Bit 1: mmcblk boot partition 0 or 1.
+ *         for eMMC: boot0 if this bit is cleared, boot1 - if set
+ *         for SD-card the boot partition value will always be 0
+ *         (independent of the value of this bit)
+ *
+ */
+#define BOOT_SRC_MMC1	BIT(0)
+#define BOOT_SRC_PART1	BIT(1)
+
+/* Offset of the first boot image source descriptor in SPI NOR */
+#define SPI_FLASH_BOOT_SRC_OFFS	0xFE0000
+#define SPI_FLASH_SECTOR_SIZE	0x10000
board/liebherr/btt/btt.c new file +449 -0

449 lines not on this page · raw message

board/liebherr/btt/btt.env new file +139 -0

139 lines not on this page · raw message

board/liebherr/btt/spl_btt.c new file +316 -0

316 lines not on this page · raw message

configs/imx28_btt3_defconfig new file +140 -0

140 lines not on this page · raw message

include/configs/btt.h new file +17 -0
new file mode 100644
index 00000000000..0e15e7299fb
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2025 DENX Software Engineering
+ * Lukasz Majewski, DENX Software Engineering, [email protected]
+ */
+#ifndef __CONFIGS_BTT_H__
+#define __CONFIGS_BTT_H__
+
+/* Memory configuration */
+#define PHYS_SDRAM_1			0x40000000	/* Base address */
+#define PHYS_SDRAM_1_SIZE		0x10000000	/* Max 256 MB RAM */
+#define CFG_SYS_SDRAM_BASE		PHYS_SDRAM_1
+
+/* The rest of the configuration is shared */
+#include <configs/mxs.h>
+
+#endif /* __CONFIGS_BTT_H__ */
Signature · 1 line
2.39.5
#1 lore raw
Quoted 24 lines · Lukasz Majewski

The btt[c3] devices are based on imx287 SoC.

U-Boot SPL 2025.04-01081-g07e086681d26 (Apr 16 2025 - 12:24:36 +0200) Trying to boot from MMC1

U-Boot 2025.04-01081-g07e086681d26 (Apr 16 2025 - 12:24:36 +0200)

CPU:   Freescale i.MX28 rev1.2 at 454 MHz
BOOT:  SSP SPI #3, master, 3V3 NOR
Model: BTT3
Board: LWE BTT SoM HW rev 0
DRAM:  256 MiB
Core:  86 devices, 15 uclasses, devicetree: separate
MMC:   MXS MMC: 0
Loading Environment from SPIFlash... SF: Detected is25lp128 with page
                    size 256 Bytes, erase size 64 KiB, total 16 MiB
OK
In:    serial@80074000
Out:   serial@80074000
Err:   serial@80074000
Net:   eth0: ethernet@800f0000
Hit any key to stop autoboot:  0
Quoted 10 lines
---
 arch/arm/dts/imx28-btt3-0-u-boot.dtsi |   7 +
 arch/arm/dts/imx28-btt3-1-u-boot.dtsi |   7 +
 arch/arm/dts/imx28-btt3-2-u-boot.dtsi |   7 +
 arch/arm/dts/imx28-btt3-u-boot.dtsi   |  90 ++++++
 arch/arm/mach-imx/mxs/Kconfig         |   6 +
 board/liebherr/btt/Kconfig            |  24 ++
 board/liebherr/btt/MAINTAINERS        |   6 +
 board/liebherr/btt/Makefile           |   9 +
 board/liebherr/btt/README             |  11 +

This needs to be under doc/board/ somewhere (and please make sure that 'make htmldocs KDOC_WERROR=1' passes), thanks. The rest of this looks reasonable, especially if we shouldn't more generically change where / when we call initf_malloc.

Signature · 1 line
Tom