Skip to contentSkip to conversation

Add MNT Reform 2 board support

PATCH Superseded Patrick Wildt 4 participants 15 messages Sep 2, 2021 – Nov 24, 2021

Subsystems (3)

v2 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add MNT Reform 2 board support

The MNT Reform 2 is a modular DIY laptop. In its initial version it is based on the BoundaryDevices i.MX8MQ SoM. Some parts have been lifted from BoundaryDevices official U-Boot downstream project.

This U-Boot patchset supports the serial console, the SD card and eMMC, Gigabit Ethernet and USB.

Changes since v2:
- Synced DTS with files in Linux git repo.
- Added support for USB host ports.

Patrick Wildt (2):
arm: dts: imx8mq: add MNT Reform 2
board: mntre: imx8mq: Add MNT Reform 2 board support

 arch/arm/dts/Makefile                         |    1 +
 arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi   |   11 +
 arch/arm/dts/imx8mq-mnt-reform2.dts           |  213 ++++
 arch/arm/dts/imx8mq-nitrogen-som.dtsi         |  275 +++++
 arch/arm/mach-imx/imx8m/Kconfig               |    6 +
 board/mntre/imx8mq_reform2/Kconfig            |   12 +
 board/mntre/imx8mq_reform2/MAINTAINERS        |    7 +
 board/mntre/imx8mq_reform2/Makefile           |   12 +
 board/mntre/imx8mq_reform2/imx8mq_reform2.c   |  213 ++++
 board/mntre/imx8mq_reform2/lpddr4_timing.c    | 1014 +++++++++++++++++
 .../mntre/imx8mq_reform2/lpddr4_timing_ch2.h  |   95 ++
 board/mntre/imx8mq_reform2/spl.c              |  260 +++++
 configs/imx8mq_reform2_defconfig              |   67 ++
 include/configs/imx8mq_reform2.h              |  151 +++
 14 files changed, 2337 insertions(+)
 create mode 100644 arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mq-mnt-reform2.dts
 create mode 100644 arch/arm/dts/imx8mq-nitrogen-som.dtsi
 create mode 100644 board/mntre/imx8mq_reform2/Kconfig
 create mode 100644 board/mntre/imx8mq_reform2/MAINTAINERS
 create mode 100644 board/mntre/imx8mq_reform2/Makefile
 create mode 100644 board/mntre/imx8mq_reform2/imx8mq_reform2.c
 create mode 100644 board/mntre/imx8mq_reform2/lpddr4_timing.c
 create mode 100644 board/mntre/imx8mq_reform2/lpddr4_timing_ch2.h
 create mode 100644 board/mntre/imx8mq_reform2/spl.c
 create mode 100644 configs/imx8mq_reform2_defconfig
 create mode 100644 include/configs/imx8mq_reform2.h
Signature · 1 line
2.32.0
#1 lore raw

PATCH v2 1/2 arm: dts: imx8mq: add MNT Reform 2

---
 arch/arm/dts/Makefile                 |   1 +
 arch/arm/dts/imx8mq-mnt-reform2.dts   | 213 ++++++++++++++++++++
 arch/arm/dts/imx8mq-nitrogen-som.dtsi | 275 ++++++++++++++++++++++++++
 3 files changed, 489 insertions(+)
 create mode 100644 arch/arm/dts/imx8mq-mnt-reform2.dts
 create mode 100644 arch/arm/dts/imx8mq-nitrogen-som.dtsi
arch/arm/dts/Makefile +1 -0
index fc16a57e60..ecd4fc0a19 100644
@@ -884,6 +884,7 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
 	imx8mq-evk.dtb \
 	imx8mm-beacon-kit.dtb \
 	imx8mn-beacon-kit.dtb \
+	imx8mq-mnt-reform2.dtb \
 	imx8mq-phanbell.dtb \
 	imx8mp-evk.dtb \
 	imx8mp-phyboard-pollux-rdk.dtb \
arch/arm/dts/imx8mq-mnt-reform2.dts new file +213 -0

213 lines not on this page · raw message

arch/arm/dts/imx8mq-nitrogen-som.dtsi new file +275 -0

275 lines not on this page · raw message

Signature · 1 line
2.32.0
#2 lore raw

PATCH v2 2/2 board: mntre: imx8mq: Add MNT Reform 2 board support

In reply to Patrick Wildt

The MNT Reform 2 is a modular DIY laptop. In its initial version it is based on the BoundaryDevices i.MX8MQ SoM. Some parts have been lifted from BoundaryDevices official U-Boot downstream project.

---
 arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi   |   11 +
 arch/arm/mach-imx/imx8m/Kconfig               |    6 +
 board/mntre/imx8mq_reform2/Kconfig            |   12 +
 board/mntre/imx8mq_reform2/MAINTAINERS        |    7 +
 board/mntre/imx8mq_reform2/Makefile           |   12 +
 board/mntre/imx8mq_reform2/imx8mq_reform2.c   |  213 ++++
 board/mntre/imx8mq_reform2/lpddr4_timing.c    | 1014 +++++++++++++++++
 .../mntre/imx8mq_reform2/lpddr4_timing_ch2.h  |   95 ++
 board/mntre/imx8mq_reform2/spl.c              |  260 +++++
 configs/imx8mq_reform2_defconfig              |   67 ++
 include/configs/imx8mq_reform2.h              |  151 +++
 11 files changed, 1848 insertions(+)
 create mode 100644 arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi
 create mode 100644 board/mntre/imx8mq_reform2/Kconfig
 create mode 100644 board/mntre/imx8mq_reform2/MAINTAINERS
 create mode 100644 board/mntre/imx8mq_reform2/Makefile
 create mode 100644 board/mntre/imx8mq_reform2/imx8mq_reform2.c
 create mode 100644 board/mntre/imx8mq_reform2/lpddr4_timing.c
 create mode 100644 board/mntre/imx8mq_reform2/lpddr4_timing_ch2.h
 create mode 100644 board/mntre/imx8mq_reform2/spl.c
 create mode 100644 configs/imx8mq_reform2_defconfig
 create mode 100644 include/configs/imx8mq_reform2.h
arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi new file +11 -0
new file mode 100644
index 0000000000..7e928e875b
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+&usdhc1 {
+	mmc-hs400-1_8v;
+};
+
+&usdhc2 {
+	cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
+	sd-uhs-sdr104;
+	sd-uhs-ddr50;
+};
arch/arm/mach-imx/imx8m/Kconfig +6 -0
index ccaf106be5..44582ad152 100644
@@ -44,6 +44,11 @@ config TARGET_IMX8MQ_PHANBELL
         select IMX8MQ
         select IMX8M_LPDDR4
 
+config TARGET_IMX8MQ_REFORM2
+	bool "imx8mq_reform2"
+	select IMX8MQ
+	select IMX8M_LPDDR4
+
 config TARGET_IMX8MM_EVK
 	bool "imx8mm LPDDR4 EVK board"
 	select BINMAN
@@ -150,6 +155,7 @@ source "board/freescale/imx8mn_evk/Kconfig"
 source "board/freescale/imx8mp_evk/Kconfig"
 source "board/gateworks/venice/Kconfig"
 source "board/google/imx8mq_phanbell/Kconfig"
+source "board/mntre/imx8mq_reform2/Kconfig"
 source "board/phytec/phycore_imx8mm/Kconfig"
 source "board/phytec/phycore_imx8mp/Kconfig"
 source "board/ronetix/imx8mq-cm/Kconfig"
board/mntre/imx8mq_reform2/Kconfig new file +12 -0
new file mode 100644
index 0000000000..8070ef377b
@@ -0,0 +1,12 @@
+if TARGET_IMX8MQ_REFORM2
+
+config SYS_BOARD
+	default "imx8mq_reform2"
+
+config SYS_VENDOR
+	default "mntre"
+
+config SYS_CONFIG_NAME
+	default "imx8mq_reform2"
+
+endif
board/mntre/imx8mq_reform2/MAINTAINERS new file +7 -0
new file mode 100644
index 0000000000..946f287ecf
@@ -0,0 +1,7 @@
+REFORM2 IMX8MQ BOARD
+M:	Lukas F. Hartmann <[email protected]>
+M:	Patrick Wildt <[email protected]>
+S:	Maintained
+F:	board/mntre/imx8mq_reform2/
+F:	include/configs/imx8mq_reform2.h
+F:	configs/imx8mq_reform2_defconfig
board/mntre/imx8mq_reform2/Makefile new file +12 -0
new file mode 100644
index 0000000000..2efd56bb4a
@@ -0,0 +1,12 @@
+#
+# Copyright 2017 NXP
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+
+obj-y += imx8mq_reform2.o
+
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o
+obj-$(CONFIG_IMX8M_LPDDR4) += lpddr4_timing.o
+endif
board/mntre/imx8mq_reform2/imx8mq_reform2.c new file +213 -0

213 lines not on this page · raw message

board/mntre/imx8mq_reform2/lpddr4_timing.c new file +1014 -0

1,014 lines not on this page · raw message

board/mntre/imx8mq_reform2/lpddr4_timing_ch2.h new file +95 -0

95 lines not on this page · raw message

board/mntre/imx8mq_reform2/spl.c new file +260 -0

260 lines not on this page · raw message

configs/imx8mq_reform2_defconfig new file +67 -0

67 lines not on this page · raw message

include/configs/imx8mq_reform2.h new file +151 -0

151 lines not on this page · raw message

Signature · 1 line
2.32.0
#3 lore raw

Re: [PATCH v2 2/2] board: mntre: imx8mq: Add MNT Reform 2 board support

Hi Patrick,

Am Do., 2. Sept. 2021 um 23:44 Uhr schrieb Patrick Wildt <[email protected]>:

Quoted 6 lines

The MNT Reform 2 is a modular DIY laptop. In its initial version it is based on the BoundaryDevices i.MX8MQ SoM. Some parts have been lifted from BoundaryDevices official U-Boot downstream project.

I just sent a patch to add board support for the Kontron pitx-imx8m that is also based on the imx8mq SOC. I already switched the flash.bin generation to binman. Maybe you can use this patchset as a template and also switch to binman for that board.

--
Heiko

#4 lore raw

Re: [PATCH v2 2/2] board: mntre: imx8mq: Add MNT Reform 2 board support

Am Fri, Sep 03, 2021 at 11:01:06AM +0200 schrieb Heiko Thiery:

Quoted 10 lines

Hi Patrick,

Am Do., 2. Sept. 2021 um 23:44 Uhr schrieb Patrick Wildt <[email protected]>:

Quoted 6 lines

The MNT Reform 2 is a modular DIY laptop. In its initial version it is based on the BoundaryDevices i.MX8MQ SoM. Some parts have been lifted from BoundaryDevices official U-Boot downstream project.

Quoted 7 lines

I just sent a patch to add board support for the Kontron pitx-imx8m that is also based on the imx8mq SOC. I already switched the flash.bin generation to binman. Maybe you can use this patchset as a template and also switch to binman for that board.

--
Heiko

Hi Heiko,

I think that's a good idea. But I seem to be having issues:

U-Boot SPL 2021.10-rc3-00023-g2c634e01b6-dirty (Sep 03 2021 - 18:22:04 +0200) Normal Boot
Could not get FIT buffer of 686592 bytes
check CONFIG_SYS_SPL_MALLOC_SIZE

Is there anything specific I need to change to make that work?

Otherwise we can probably also switch to binman after this patchset is merged.

Patrick

#5 lore raw

Re: [PATCH v2 2/2] board: mntre: imx8mq: Add MNT Reform 2 board support

Hi Patrick,

Am Fr., 3. Sept. 2021 um 16:30 Uhr schrieb Patrick Wildt <[email protected]>:

Quoted 20 lines

Am Fri, Sep 03, 2021 at 11:01:06AM +0200 schrieb Heiko Thiery:

Quoted 10 lines

Hi Patrick,

Am Do., 2. Sept. 2021 um 23:44 Uhr schrieb Patrick Wildt <[email protected]>:

Quoted 6 lines

The MNT Reform 2 is a modular DIY laptop. In its initial version it is based on the BoundaryDevices i.MX8MQ SoM. Some parts have been lifted from BoundaryDevices official U-Boot downstream project.

Quoted 7 lines

I just sent a patch to add board support for the Kontron pitx-imx8m that is also based on the imx8mq SOC. I already switched the flash.bin generation to binman. Maybe you can use this patchset as a template and also switch to binman for that board.

--
Heiko

Quoted 8 lines

Hi Heiko,

I think that's a good idea. But I seem to be having issues:

U-Boot SPL 2021.10-rc3-00023-g2c634e01b6-dirty (Sep 03 2021 - 18:22:04 +0200) Normal Boot
Could not get FIT buffer of 686592 bytes
check CONFIG_SYS_SPL_MALLOC_SIZE

I'm not sure, but could you check that no old fragments are left in the output folder before building the flash.bin with binman. I can remember that I had also some strange issues while switching to binman.

Signature · 1 line
Heiko
#6 lore raw

Re: [PATCH v2 2/2] board: mntre: imx8mq: Add MNT Reform 2 board support

Am Fri, Sep 03, 2021 at 08:25:39PM +0200 schrieb Heiko Thiery:

Quoted 32 lines

Hi Patrick,

Am Fr., 3. Sept. 2021 um 16:30 Uhr schrieb Patrick Wildt <[email protected]>:

Quoted 20 lines

Am Fri, Sep 03, 2021 at 11:01:06AM +0200 schrieb Heiko Thiery:

Quoted 10 lines

Hi Patrick,

Am Do., 2. Sept. 2021 um 23:44 Uhr schrieb Patrick Wildt <[email protected]>:

Quoted 6 lines

The MNT Reform 2 is a modular DIY laptop. In its initial version it is based on the BoundaryDevices i.MX8MQ SoM. Some parts have been lifted from BoundaryDevices official U-Boot downstream project.

Quoted 7 lines

I just sent a patch to add board support for the Kontron pitx-imx8m that is also based on the imx8mq SOC. I already switched the flash.bin generation to binman. Maybe you can use this patchset as a template and also switch to binman for that board.

--
Heiko

Quoted 8 lines

Hi Heiko,

I think that's a good idea. But I seem to be having issues:

U-Boot SPL 2021.10-rc3-00023-g2c634e01b6-dirty (Sep 03 2021 - 18:22:04 +0200) Normal Boot
Could not get FIT buffer of 686592 bytes
check CONFIG_SYS_SPL_MALLOC_SIZE

Quoted 4 lines

I'm not sure, but could you check that no old fragments are left in the output folder before building the flash.bin with binman. I can remember that I had also some strange issues while switching to binman.

No change. Is your u-boot.itb that much smaller?

-rw-r--r-- 1 patrick patrick 670K Sep 4 00:50 imx8mq_reform2/u-boot.itb

#7 lore raw

Re: [PATCH v2 2/2] board: mntre: imx8mq: Add MNT Reform 2 board support

Hi,

Am Fr., 3. Sept. 2021 um 22:54 Uhr schrieb Patrick Wildt <[email protected]>:

Quoted 34 lines

Am Fri, Sep 03, 2021 at 08:25:39PM +0200 schrieb Heiko Thiery:

Quoted 32 lines

Hi Patrick,

Am Fr., 3. Sept. 2021 um 16:30 Uhr schrieb Patrick Wildt <[email protected]>:

Quoted 28 lines

Am Fri, Sep 03, 2021 at 11:01:06AM +0200 schrieb Heiko Thiery:

Quoted 10 lines

Hi Patrick,

Am Do., 2. Sept. 2021 um 23:44 Uhr schrieb Patrick Wildt <[email protected]>:

Quoted 6 lines

The MNT Reform 2 is a modular DIY laptop. In its initial version it is based on the BoundaryDevices i.MX8MQ SoM. Some parts have been lifted from BoundaryDevices official U-Boot downstream project.

Quoted 7 lines

I just sent a patch to add board support for the Kontron pitx-imx8m that is also based on the imx8mq SOC. I already switched the flash.bin generation to binman. Maybe you can use this patchset as a template and also switch to binman for that board.

--
Heiko

Hi Heiko,

I think that's a good idea. But I seem to be having issues:

U-Boot SPL 2021.10-rc3-00023-g2c634e01b6-dirty (Sep 03 2021 - 18:22:04 +0200) Normal Boot
Could not get FIT buffer of 686592 bytes
check CONFIG_SYS_SPL_MALLOC_SIZE

Quoted 8 lines
Quoted 4 lines

I'm not sure, but could you check that no old fragments are left in the output folder before building the flash.bin with binman. I can remember that I had also some strange issues while switching to binman.

No change. Is your u-boot.itb that much smaller?

-rw-r--r-- 1 patrick patrick 670K Sep 4 00:50 imx8mq_reform2/u-boot.itb

My u-boot.itbs:
-rw-r--r-- 1 hthiery hthiery 686440 Sep 4 07:41 u-boot.itb

Signature · 1 line
Heiko
reviewer
#8 lore raw

Re: [PATCH v2 2/2] board: mntre: imx8mq: Add MNT Reform 2 board support

In reply to Patrick Wildt

Hi Patrick,

Quoted 6 lines · Patrick Wildt

U-Boot SPL 2021.10-rc3-00023-g2c634e01b6-dirty (Sep 03 2021 - 18:22:04 +0200) Normal Boot
Could not get FIT buffer of 686592 bytes
check CONFIG_SYS_SPL_MALLOC_SIZE

Is there anything specific I need to change to make that work?

Does it help if you increase CONFIG_SYS_SPL_MALLOC_SIZE to SZ_1M?

#9 lore raw

Re: [PATCH v2 2/2] board: mntre: imx8mq: Add MNT Reform 2 board support

Am Fri, Sep 03, 2021 at 05:58:07PM -0300 schrieb Fabio Estevam:

Quoted 4 lines

Hi Patrick,

On Fri, Sep 3, 2021 at 11:30 AM Patrick Wildt <[email protected]> wrote:

Quoted 8 lines
Quoted 6 lines

U-Boot SPL 2021.10-rc3-00023-g2c634e01b6-dirty (Sep 03 2021 - 18:22:04 +0200) Normal Boot
Could not get FIT buffer of 686592 bytes
check CONFIG_SYS_SPL_MALLOC_SIZE

Is there anything specific I need to change to make that work?

Does it help if you increase CONFIG_SYS_SPL_MALLOC_SIZE to SZ_1M?

I think the issue is something else. The old .itb used external data, but the one with binman seems to not make use of that. It's weird though because fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; is set and CONFIG_FIT_EXTERNAL_OFFSET is 0x3000.

So, even though binman seems to be calling mkimage -E -p 0x3000, the u-boot.itb does *not* use external data.

#10 lore raw

Re: [PATCH v2 2/2] board: mntre: imx8mq: Add MNT Reform 2 board support

In reply to Patrick Wildt
Quoted 3 lines · Patrick Wildt

The MNT Reform 2 is a modular DIY laptop. In its initial version it is based on the BoundaryDevices i.MX8MQ SoM. Some parts have been lifted from BoundaryDevices official U-Boot downstream project.

Thanks for working on this!

I'm struggling a bit getting it to actually boot; how is this supposed to be installed to the device?

I've built with the two applied patches on a patched v2021.10, copying various firmware parts from:

https://source.mnt.re/reform/reform-boundary-uboot/-/blob/master/bl31-iMX8MQ.bin
https://source.mnt.re/reform/reform-boundary-uboot/-/blob/master/lpddr4_pmu_train_1d_dmem.bin
https://source.mnt.re/reform/reform-boundary-uboot/-/blob/master/lpddr4_pmu_train_1d_imem.bin
https://source.mnt.re/reform/reform-boundary-uboot/-/blob/master/lpddr4_pmu_train_2d_dmem.bin
https://source.mnt.re/reform/reform-boundary-uboot/-/blob/master/lpddr4_pmu_train_2d_imem.bin

export BL31=bl31-iMX8MQ.bin

make imx8mq_reform2_defconfig
make
make flash.bin

Then grepping various other README's from imx8mq devices, I tried two different processes:

dd if=flash.bin of=/dev/sd[x] bs=1K seek=33

and:

dd if=flash.bin of=/dev/sd[x] bs=1024 seek=33 conv=sync dd if=u-boot.itb of=/dev/sd[x] bs=1024 seek=384 conv=sync

Both simply hanging with:

U-Boot SPL 2021.10 (Jan 01 1970 - 00:00:01 +0000)

Is the flash.bin step unecessary? I see DDR timing code in the patch series; are corresponding lpddr4*.bin no longer necessary?

I also tried building with an old version of arm-trusted-firmware (v2.2), as that was the most recent upstream version that successfully built. This seems to be a fork of ATF that has support for iMX8MQ, but it is unclear which branch/tag/etc. should be used with the mnt/reform:

https://source.codeaurora.org/external/imx/imx-atf

It would be nice to include a board README in the next patch revision to spell out some of the details of exactly which other projects and versions/comments/branches are expected to work with MNT Reform2.

I would be nice if you could CC me on future patch series revisions to be able to test. Thanks!

live well,
vagrant

Quoted 24 lines
---
 arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi   |   11 +
 arch/arm/mach-imx/imx8m/Kconfig               |    6 +
 board/mntre/imx8mq_reform2/Kconfig            |   12 +
 board/mntre/imx8mq_reform2/MAINTAINERS        |    7 +
 board/mntre/imx8mq_reform2/Makefile           |   12 +
 board/mntre/imx8mq_reform2/imx8mq_reform2.c   |  213 ++++
 board/mntre/imx8mq_reform2/lpddr4_timing.c    | 1014 +++++++++++++++++
 .../mntre/imx8mq_reform2/lpddr4_timing_ch2.h  |   95 ++
 board/mntre/imx8mq_reform2/spl.c              |  260 +++++
 configs/imx8mq_reform2_defconfig              |   67 ++
 include/configs/imx8mq_reform2.h              |  151 +++
 11 files changed, 1848 insertions(+)
 create mode 100644 arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi
 create mode 100644 board/mntre/imx8mq_reform2/Kconfig
 create mode 100644 board/mntre/imx8mq_reform2/MAINTAINERS
 create mode 100644 board/mntre/imx8mq_reform2/Makefile
 create mode 100644 board/mntre/imx8mq_reform2/imx8mq_reform2.c
 create mode 100644 board/mntre/imx8mq_reform2/lpddr4_timing.c
 create mode 100644 board/mntre/imx8mq_reform2/lpddr4_timing_ch2.h
 create mode 100644 board/mntre/imx8mq_reform2/spl.c
 create mode 100644 configs/imx8mq_reform2_defconfig
 create mode 100644 include/configs/imx8mq_reform2.h
#11 lore raw

Re: [PATCH v2 2/2] board: mntre: imx8mq: Add MNT Reform 2 board support

Quoted 21 lines · Vagrant Cascadian
Quoted 3 lines · Patrick Wildt

The MNT Reform 2 is a modular DIY laptop. In its initial version it is based on the BoundaryDevices i.MX8MQ SoM. Some parts have been lifted from BoundaryDevices official U-Boot downstream project.

Thanks for working on this!

I'm struggling a bit getting it to actually boot; how is this supposed to be installed to the device?

I've built with the two applied patches on a patched v2021.10, copying various firmware parts from:

https://source.mnt.re/reform/reform-boundary-uboot/-/blob/master/bl31-iMX8MQ.bin
https://source.mnt.re/reform/reform-boundary-uboot/-/blob/master/lpddr4_pmu_train_1d_dmem.bin
https://source.mnt.re/reform/reform-boundary-uboot/-/blob/master/lpddr4_pmu_train_1d_imem.bin
https://source.mnt.re/reform/reform-boundary-uboot/-/blob/master/lpddr4_pmu_train_2d_dmem.bin
https://source.mnt.re/reform/reform-boundary-uboot/-/blob/master/lpddr4_pmu_train_2d_imem.bin

export BL31=bl31-iMX8MQ.bin

Quoted 8 lines

make imx8mq_reform2_defconfig
make
make flash.bin

Then grepping various other README's from imx8mq devices, I tried two different processes:

dd if=flash.bin of=/dev/sd[x] bs=1K seek=33

You only need to dd flash.bin, the command looks fine.

Quoted 8 lines

and:

dd if=flash.bin of=/dev/sd[x] bs=1024 seek=33 conv=sync dd if=u-boot.itb of=/dev/sd[x] bs=1024 seek=384 conv=sync

Both simply hanging with:

U-Boot SPL 2021.10 (Jan 01 1970 - 00:00:01 +0000)

There have been a few changes in U-Boot since I sent my patchset, it's possible the diff by itself might not be enough.

I will send out a new patchset soon, but the move to Binman doesn't work for me yet. It's weird, because I don't see a diff to other i.MX8MQ platforms, so I'm still debugging that. Maybe the other i.MX8MQ boards don't work with Binman either?

Keep note that the build procedure (how to supply bl31) changes once Binman is used.

Quoted 2 lines

Is the flash.bin step unecessary? I see DDR timing code in the patch series; are corresponding lpddr4*.bin no longer necessary?

The flash.bin has all bits: U-Boot, U-Boot SPL, lpddr4*.bin and bl31.bin

lpddr4*.bin is the firmware for the DDR controller. So you need the timing information *and* the firmware.

Quoted 6 lines

I also tried building with an old version of arm-trusted-firmware (v2.2), as that was the most recent upstream version that successfully built. This seems to be a fork of ATF that has support for iMX8MQ, but it is unclear which branch/tag/etc. should be used with the mnt/reform:

https://source.codeaurora.org/external/imx/imx-atf

Not sure right now, but I think I was using the one that's build on OpenBSD-current, which seems to be arm-trusted-firmware 2.5. I'll check it.

Quoted 4 lines

It would be nice to include a board README in the next patch revision to spell out some of the details of exactly which other projects and versions/comments/branches are expected to work with MNT Reform2.

This is nothing specific to the MNT Reform2. It's the same for all i.MX8MQ boards. ATF+DDR+U-Boot have to work together, and it doesn't matter which board it is. Hence I don't believe providing that kind information in a Reform-specific README makes sense.

Patrick

Quoted 33 lines

I would be nice if you could CC me on future patch series revisions to be able to test. Thanks!

live well,
vagrant

Quoted 24 lines
---
 arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi   |   11 +
 arch/arm/mach-imx/imx8m/Kconfig               |    6 +
 board/mntre/imx8mq_reform2/Kconfig            |   12 +
 board/mntre/imx8mq_reform2/MAINTAINERS        |    7 +
 board/mntre/imx8mq_reform2/Makefile           |   12 +
 board/mntre/imx8mq_reform2/imx8mq_reform2.c   |  213 ++++
 board/mntre/imx8mq_reform2/lpddr4_timing.c    | 1014 +++++++++++++++++
 .../mntre/imx8mq_reform2/lpddr4_timing_ch2.h  |   95 ++
 board/mntre/imx8mq_reform2/spl.c              |  260 +++++
 configs/imx8mq_reform2_defconfig              |   67 ++
 include/configs/imx8mq_reform2.h              |  151 +++
 11 files changed, 1848 insertions(+)
 create mode 100644 arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi
 create mode 100644 board/mntre/imx8mq_reform2/Kconfig
 create mode 100644 board/mntre/imx8mq_reform2/MAINTAINERS
 create mode 100644 board/mntre/imx8mq_reform2/Makefile
 create mode 100644 board/mntre/imx8mq_reform2/imx8mq_reform2.c
 create mode 100644 board/mntre/imx8mq_reform2/lpddr4_timing.c
 create mode 100644 board/mntre/imx8mq_reform2/lpddr4_timing_ch2.h
 create mode 100644 board/mntre/imx8mq_reform2/spl.c
 create mode 100644 configs/imx8mq_reform2_defconfig
 create mode 100644 include/configs/imx8mq_reform2.h
#12 lore raw

Re: [PATCH v2 2/2] board: mntre: imx8mq: Add MNT Reform 2 board support

Quoted 26 lines · Patrick Wildt
Quoted 25 lines · Vagrant Cascadian
Quoted 3 lines · Patrick Wildt

The MNT Reform 2 is a modular DIY laptop. In its initial version it is based on the BoundaryDevices i.MX8MQ SoM. Some parts have been lifted from BoundaryDevices official U-Boot downstream project.

Thanks for working on this!

I'm struggling a bit getting it to actually boot; how is this supposed to be installed to the device?

I've built with the two applied patches on a patched v2021.10, copying various firmware parts from:

https://source.mnt.re/reform/reform-boundary-uboot/-/blob/master/bl31-iMX8MQ.bin
https://source.mnt.re/reform/reform-boundary-uboot/-/blob/master/lpddr4_pmu_train_1d_dmem.bin
https://source.mnt.re/reform/reform-boundary-uboot/-/blob/master/lpddr4_pmu_train_1d_imem.bin
https://source.mnt.re/reform/reform-boundary-uboot/-/blob/master/lpddr4_pmu_train_2d_dmem.bin
https://source.mnt.re/reform/reform-boundary-uboot/-/blob/master/lpddr4_pmu_train_2d_imem.bin

export BL31=bl31-iMX8MQ.bin

make imx8mq_reform2_defconfig
make
make flash.bin

Quoted 6 lines
Quoted 4 lines

Then grepping various other README's from imx8mq devices, I tried two different processes:

dd if=flash.bin of=/dev/sd[x] bs=1K seek=33

You only need to dd flash.bin, the command looks fine.

Correction: With Peng's current Binman patchset you need both. But I think that is not correct, because for i.MX8MM Binman was changed back to generate a single image. The following patch includes that change, so you only need to dd flash.bin.

Quoted 12 lines
Quoted 8 lines

and:

dd if=flash.bin of=/dev/sd[x] bs=1024 seek=33 conv=sync dd if=u-boot.itb of=/dev/sd[x] bs=1024 seek=384 conv=sync

Both simply hanging with:

U-Boot SPL 2021.10 (Jan 01 1970 - 00:00:01 +0000)

There have been a few changes in U-Boot since I sent my patchset, it's possible the diff by itself might not be enough.

Quoted 7 lines

I will send out a new patchset soon, but the move to Binman doesn't work for me yet. It's weird, because I don't see a diff to other i.MX8MQ platforms, so I'm still debugging that. Maybe the other i.MX8MQ boards don't work with Binman either?

Keep note that the build procedure (how to supply bl31) changes once Binman is used.

I have fixed the issue. My changes depend on Peng's patchset to change i.MX8MQ to Binman, so I will re-issue a v3 of the patchset as soon as that is done (to not interfere any further with his patchset).

'Attached' you'll find a complete diff you can apply to origin/master, which includes some of Peng's changes. Let me know how it goes for you.

Patrick

Quoted 24 lines
Quoted 2 lines

Is the flash.bin step unecessary? I see DDR timing code in the patch series; are corresponding lpddr4*.bin no longer necessary?

The flash.bin has all bits: U-Boot, U-Boot SPL, lpddr4*.bin and bl31.bin

lpddr4*.bin is the firmware for the DDR controller. So you need the timing information *and* the firmware.

Quoted 6 lines

I also tried building with an old version of arm-trusted-firmware (v2.2), as that was the most recent upstream version that successfully built. This seems to be a fork of ATF that has support for iMX8MQ, but it is unclear which branch/tag/etc. should be used with the mnt/reform:

https://source.codeaurora.org/external/imx/imx-atf

Not sure right now, but I think I was using the one that's build on OpenBSD-current, which seems to be arm-trusted-firmware 2.5. I'll check it.

Quoted 4 lines

It would be nice to include a board README in the next patch revision to spell out some of the details of exactly which other projects and versions/comments/branches are expected to work with MNT Reform2.

Quoted 14 lines

This is nothing specific to the MNT Reform2. It's the same for all i.MX8MQ boards. ATF+DDR+U-Boot have to work together, and it doesn't matter which board it is. Hence I don't believe providing that kind information in a Reform-specific README makes sense.

Patrick

Quoted 7 lines

I would be nice if you could CC me on future patch series revisions to be able to test. Thanks!

live well,
vagrant

arch/arm/dts/Makefile +1 -0
index cc34da7bd8..6c14e9328e 100644
@@ -904,6 +904,7 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
 	imx8mq-evk.dtb \
 	imx8mm-beacon-kit.dtb \
 	imx8mn-beacon-kit.dtb \
+	imx8mq-mnt-reform2.dtb \
 	imx8mq-phanbell.dtb \
 	imx8mp-evk.dtb \
 	imx8mp-phyboard-pollux-rdk.dtb \
arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi new file +13 -0
new file mode 100644
index 0000000000..c38c698794
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+#include "imx8mq-u-boot.dtsi"
+
+&usdhc1 {
+	mmc-hs400-1_8v;
+};
+
+&usdhc2 {
+	cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>;
+	sd-uhs-sdr104;
+	sd-uhs-ddr50;
+};
arch/arm/dts/imx8mq-mnt-reform2.dts new file +214 -0

214 lines not on this page · raw message

arch/arm/dts/imx8mq-nitrogen-som.dtsi new file +275 -0

275 lines not on this page · raw message

arch/arm/dts/imx8mq-u-boot.dtsi new file +137 -0

137 lines not on this page · raw message

arch/arm/mach-imx/imx8m/Kconfig +7 -0
index 276b8bd974..c719da4c8b 100644
@@ -44,6 +44,12 @@ config TARGET_IMX8MQ_PHANBELL
         select IMX8MQ
         select IMX8M_LPDDR4
 
+config TARGET_IMX8MQ_REFORM2
+	bool "imx8mq_reform2"
+	select BINMAN
+	select IMX8MQ
+	select IMX8M_LPDDR4
+
 config TARGET_IMX8MM_EVK
 	bool "imx8mm LPDDR4 EVK board"
 	select BINMAN
@@ -167,6 +173,7 @@ source "board/freescale/imx8mp_evk/Kconfig"
 source "board/gateworks/venice/Kconfig"
 source "board/google/imx8mq_phanbell/Kconfig"
 source "board/kontron/sl-mx8mm/Kconfig"
+source "board/mntre/imx8mq_reform2/Kconfig"
 source "board/phytec/phycore_imx8mm/Kconfig"
 source "board/phytec/phycore_imx8mp/Kconfig"
 source "board/ronetix/imx8mq-cm/Kconfig"
arch/arm/mach-imx/imx8m/imximage.cfg +3 -9
index 714b24273b..2a3f959183 100644
@@ -1,17 +1,11 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * Copyright 2018 NXP
+ * Copyright 2018-2021 NXP
  */
 
 #define __ASSEMBLY__
 
 FIT
 BOOT_FROM	sd
-SIGNED_HDMI	signed_hdmi_imx8m.bin
-LOADER		spl/u-boot-spl-ddr.bin	0x7E1000
-SECOND_LOADER	u-boot.itb		0x40200000 0x60000
-
-DDR_FW lpddr4_pmu_train_1d_imem.bin
-DDR_FW lpddr4_pmu_train_1d_dmem.bin
-DDR_FW lpddr4_pmu_train_2d_imem.bin
-DDR_FW lpddr4_pmu_train_2d_dmem.bin
+SIGNED_HDMI	signed_hdmi.bin
+LOADER		u-boot-spl-ddr.bin	0x7e1000
board/mntre/imx8mq_reform2/Kconfig new file +15 -0
new file mode 100644
index 0000000000..f9260cb7f5
@@ -0,0 +1,15 @@
+if TARGET_IMX8MQ_REFORM2
+
+config SYS_BOARD
+	default "imx8mq_reform2"
+
+config SYS_VENDOR
+	default "mntre"
+
+config SYS_CONFIG_NAME
+	default "imx8mq_reform2"
+
+config IMX_CONFIG
+	default "arch/arm/mach-imx/imx8m/imximage.cfg"
+
+endif
board/mntre/imx8mq_reform2/MAINTAINERS new file +7 -0
new file mode 100644
index 0000000000..946f287ecf
@@ -0,0 +1,7 @@
+REFORM2 IMX8MQ BOARD
+M:	Lukas F. Hartmann <[email protected]>
+M:	Patrick Wildt <[email protected]>
+S:	Maintained
+F:	board/mntre/imx8mq_reform2/
+F:	include/configs/imx8mq_reform2.h
+F:	configs/imx8mq_reform2_defconfig
board/mntre/imx8mq_reform2/Makefile new file +12 -0
new file mode 100644
index 0000000000..2efd56bb4a
@@ -0,0 +1,12 @@
+#
+# Copyright 2017 NXP
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+
+obj-y += imx8mq_reform2.o
+
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o
+obj-$(CONFIG_IMX8M_LPDDR4) += lpddr4_timing.o
+endif
board/mntre/imx8mq_reform2/imx8mq_reform2.c new file +213 -0

213 lines not on this page · raw message

board/mntre/imx8mq_reform2/imximage.cfg new file +11 -0
new file mode 100644
index 0000000000..74f12b30d2
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2021 NXP
+ */
+
+#define __ASSEMBLY__
+
+FIT
+BOOT_FROM	sd
+SIGNED_HDMI	signed_hdmi.bin
+LOADER		mkimage.flash.mkimage	0x7e1000
board/mntre/imx8mq_reform2/lpddr4_timing.c new file +1014 -0

1,014 lines not on this page · raw message

board/mntre/imx8mq_reform2/lpddr4_timing_ch2.h new file +95 -0

95 lines not on this page · raw message

board/mntre/imx8mq_reform2/spl.c new file +260 -0

260 lines not on this page · raw message

configs/imx8mq_reform2_defconfig new file +82 -0

82 lines not on this page · raw message

include/configs/imx8mq_reform2.h new file +114 -0

114 lines not on this page · raw message

#13 lore raw

Re: [PATCH v2 2/2] board: mntre: imx8mq: Add MNT Reform 2 board support

Quoted 6 lines · Patrick Wildt
Quoted 5 lines · Patrick Wildt
Quoted 4 lines · Vagrant Cascadian
Quoted 3 lines · Patrick Wildt

The MNT Reform 2 is a modular DIY laptop. In its initial version it is based on the BoundaryDevices i.MX8MQ SoM. Some parts have been lifted from BoundaryDevices official U-Boot downstream project.

...

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Both simply hanging with:

U-Boot SPL 2021.10 (Jan 01 1970 - 00:00:01 +0000)

Still hanging with the below patch...

Quoted 11 lines
Quoted 10 lines

There have been a few changes in U-Boot since I sent my patchset, it's possible the diff by itself might not be enough.

I will send out a new patchset soon, but the move to Binman doesn't work for me yet. It's weird, because I don't see a diff to other i.MX8MQ platforms, so I'm still debugging that. Maybe the other i.MX8MQ boards don't work with Binman either?

Keep note that the build procedure (how to supply bl31) changes once Binman is used.

Quoted 6 lines

I have fixed the issue. My changes depend on Peng's patchset to change i.MX8MQ to Binman, so I will re-issue a v3 of the patchset as soon as that is done (to not interfere any further with his patchset).

'Attached' you'll find a complete diff you can apply to origin/master, which includes some of Peng's changes. Let me know how it goes for you.

To get it to build, I needed to add this:

arch/arm/mach-imx/Makefile +2 -2
index 07954bc201..e51b5317fc 100644
@@ -161,9 +161,9 @@ spl/u-boot-spl.cfgout: $(IMX_CONFIG) FORCE
        $(Q)mkdir -p $(dir $@)
                $(call if_changed_dep,cpp_cfg)
 
-spl/u-boot-spl-ddr.bin: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE
+u-boot-spl-ddr.bin: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE
 
-flash.bin: spl/u-boot-spl-ddr.bin u-boot.itb FORCE
+flash.bin: u-boot-spl-ddr.bin u-boot.itb FORCE
        $(call if_changed,mkimage)
         endif
 
Quoted 13 lines
Quoted 13 lines
Quoted 2 lines

Is the flash.bin step unecessary? I see DDR timing code in the patch series; are corresponding lpddr4*.bin no longer necessary?

The flash.bin has all bits: U-Boot, U-Boot SPL, lpddr4*.bin and bl31.bin

lpddr4*.bin is the firmware for the DDR controller. So you need the timing information *and* the firmware.

Quoted 5 lines

I also tried building with an old version of arm-trusted-firmware (v2.2), as that was the most recent upstream version that successfully built. This seems to be a fork of ATF that has support for iMX8MQ, but it is unclear which branch/tag/etc. should be used with the mnt/reform:

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

https://source.codeaurora.org/external/imx/imx-atf

Not sure right now, but I think I was using the one that's build on OpenBSD-current, which seems to be arm-trusted-firmware 2.5. I'll check it.

I can't get atf 2.5 for imx8mq to build on Debian or GNU Guix; it seems that maybe it is no longer supported upstream:

https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=e3c07d2f5a082d8bb1684ca026d1789a77b3c870

Though it's not exactly clear what works...

Quoted 9 lines
Quoted 9 lines
Quoted 4 lines

It would be nice to include a board README in the next patch revision to spell out some of the details of exactly which other projects and versions/comments/branches are expected to work with MNT Reform2.

This is nothing specific to the MNT Reform2. It's the same for all i.MX8MQ boards. ATF+DDR+U-Boot have to work together, and it doesn't matter which board it is. Hence I don't believe providing that kind information in a Reform-specific README makes sense.

I guess we need a workable README for i.MX8MQ or something, and only boards that differ from that process document the differences?

But at the moment, it appears to still be guesswork.

live well,
vagrant

#14 lore raw

Re: [PATCH v2 2/2] board: mntre: imx8mq: Add MNT Reform 2 board support

Quoted 7 lines · Vagrant Cascadian
Quoted 6 lines · Patrick Wildt
Quoted 5 lines · Patrick Wildt
Quoted 4 lines · Vagrant Cascadian
Quoted 3 lines · Patrick Wildt

The MNT Reform 2 is a modular DIY laptop. In its initial version it is based on the BoundaryDevices i.MX8MQ SoM. Some parts have been lifted from BoundaryDevices official U-Boot downstream project.

Quoted 7 lines

...

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Both simply hanging with:

U-Boot SPL 2021.10 (Jan 01 1970 - 00:00:01 +0000)

Still hanging with the below patch...

Might just be the ATF, hm.

Quoted 27 lines
Quoted 12 lines
Quoted 11 lines

There have been a few changes in U-Boot since I sent my patchset, it's possible the diff by itself might not be enough.

I will send out a new patchset soon, but the move to Binman doesn't work for me yet. It's weird, because I don't see a diff to other i.MX8MQ platforms, so I'm still debugging that. Maybe the other i.MX8MQ boards don't work with Binman either?

Keep note that the build procedure (how to supply bl31) changes once Binman is used.

Quoted 6 lines

I have fixed the issue. My changes depend on Peng's patchset to change i.MX8MQ to Binman, so I will re-issue a v3 of the patchset as soon as that is done (to not interfere any further with his patchset).

'Attached' you'll find a complete diff you can apply to origin/master, which includes some of Peng's changes. Let me know how it goes for you.

To get it to build, I needed to add this:

arch/arm/mach-imx/Makefile +0 -0
index 07954bc201..e51b5317fc 100644
@@ -161,9 +161,9 @@ spl/u-boot-spl.cfgout: $(IMX_CONFIG) FORCE
        $(Q)mkdir -p $(dir $@)

arch/arm/mach-imx/Makefile spl/u-boot-spl.cfgout: $(IMX_CONFIG) FORCE · line 169

Quoted 10 lines
arch/arm/mach-imx/Makefile +2 -2
                $(call if_changed_dep,cpp_cfg)
 
-spl/u-boot-spl-ddr.bin: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE
+u-boot-spl-ddr.bin: spl/u-boot-spl.bin spl/u-boot-spl.cfgout FORCE
 
-flash.bin: spl/u-boot-spl-ddr.bin u-boot.itb FORCE
+flash.bin: u-boot-spl-ddr.bin u-boot.itb FORCE
        $(call if_changed,mkimage)
         endif
 

Are you doing 'make flash.bin'? Because that might be the build issue. I'm only running 'make', and for me that yields a working flash.bin.

I wonder if that flash.bin target is still relevant, because with binman the default target runs binman which parses a config file which decides which binaries to produce, so there's no need for the flash.bin target.

Quoted 19 lines
Quoted 13 lines
Quoted 13 lines
Quoted 2 lines

Is the flash.bin step unecessary? I see DDR timing code in the patch series; are corresponding lpddr4*.bin no longer necessary?

The flash.bin has all bits: U-Boot, U-Boot SPL, lpddr4*.bin and bl31.bin

lpddr4*.bin is the firmware for the DDR controller. So you need the timing information *and* the firmware.

Quoted 5 lines

I also tried building with an old version of arm-trusted-firmware (v2.2), as that was the most recent upstream version that successfully built. This seems to be a fork of ATF that has support for iMX8MQ, but it is unclear which branch/tag/etc. should be used with the mnt/reform:

Quoted 5 lines
Quoted 5 lines
Quoted 1 line

https://source.codeaurora.org/external/imx/imx-atf

Not sure right now, but I think I was using the one that's build on OpenBSD-current, which seems to be arm-trusted-firmware 2.5. I'll check it.

Quoted 7 lines

I can't get atf 2.5 for imx8mq to build on Debian or GNU Guix; it seems that maybe it is no longer supported upstream:

https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=e3c07d2f5a082d8bb1684ca026d1789a77b3c870

Though it's not exactly clear what works...

Huh, that's crazy. I can send you the ATF binary I'm using if you're interested.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

It would be nice to include a board README in the next patch revision to spell out some of the details of exactly which other projects and versions/comments/branches are expected to work with MNT Reform2.

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines

This is nothing specific to the MNT Reform2. It's the same for all i.MX8MQ boards. ATF+DDR+U-Boot have to work together, and it doesn't matter which board it is. Hence I don't believe providing that kind information in a Reform-specific README makes sense.

I guess we need a workable README for i.MX8MQ or something, and only boards that differ from that process document the differences?

I do hope at the end of Peng's patchset there won't be any boards that differ from the process.

Patrick

Quoted 4 lines

But at the moment, it appears to still be guesswork.

live well,
vagrant