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

2021-11-24 Thread Patrick Wildt
On Fri, Nov 12, 2021 at 11:59:29AM -0800, Vagrant Cascadian wrote:
> On 2021-11-11, Patrick Wildt wrote:
> > On Thu, Nov 11, 2021 at 12:21:26PM +0100, Patrick Wildt wrote:
> >> On Wed, Nov 10, 2021 at 02:26:54PM -0800, Vagrant Cascadian wrote:
> >> > On 2021-09-02, Patrick Wildt wrote:
> >> > > 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.
> ...
> >> > Both simply hanging with:
> >> > 
> >> >   U-Boot SPL 2021.10 (Jan 01 1970 - 00:00:01 +)
> 
> Still hanging with the below patch...
> 

Might just be the ATF, hm.

> 
> >> 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.
> >
> > 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:
> 
> diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
> index 07954bc201..e51b5317fc 100644
> --- a/arch/arm/mach-imx/Makefile
> +++ b/arch/arm/mach-imx/Makefile
> @@ -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
> 

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.

> >> > 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.
> >> 
> >> > 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.
> 
> 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.

> 
> >> > 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?

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

Patrick

> But at the moment, it appears to still be guesswork.
>
> live well,
>   vagrant


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

2021-11-12 Thread Vagrant Cascadian
On 2021-11-11, Patrick Wildt wrote:
> On Thu, Nov 11, 2021 at 12:21:26PM +0100, Patrick Wildt wrote:
>> On Wed, Nov 10, 2021 at 02:26:54PM -0800, Vagrant Cascadian wrote:
>> > On 2021-09-02, Patrick Wildt wrote:
>> > > 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.
...
>> > Both simply hanging with:
>> > 
>> >   U-Boot SPL 2021.10 (Jan 01 1970 - 00:00:01 +)

Still hanging with the below patch...


>> 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.
>
> 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:

diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 07954bc201..e51b5317fc 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -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


>> > 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.
>> 
>> > 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.

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...


>> > 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


signature.asc
Description: PGP signature


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

2021-11-11 Thread Patrick Wildt
On Thu, Nov 11, 2021 at 12:21:26PM +0100, Patrick Wildt wrote:
> On Wed, Nov 10, 2021 at 02:26:54PM -0800, Vagrant Cascadian wrote:
> > On 2021-09-02, Patrick Wildt wrote:
> > > 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
> 
> 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.

> > 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 +)
> 
> 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.

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

> > 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.
> 
> > 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.
> 
> > 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
> 
> > 
> > I would be nice if you could CC me on future patch series revisions to
> > be able to test. Thanks!
> > 
> > 
> > live well,
> >   vagrant

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index cc34da7bd8..6c14e9328e 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -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 \
diff --git a/arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi 
b/arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi
new file mode 100644
index 00..c38c698794
--- /dev/null
+++ b/arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi
@@ -0,0 +1,13 @@
+// SPDX-License-

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

2021-11-11 Thread Patrick Wildt
On Wed, Nov 10, 2021 at 02:26:54PM -0800, Vagrant Cascadian wrote:
> On 2021-09-02, Patrick Wildt wrote:
> > 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

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

> 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 +)

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.

> 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.

> 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.

> 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

> 
> I would be nice if you could CC me on future patch series revisions to
> be able to test. Thanks!
> 
> 
> live well,
>   vagrant
> 
> 
> > Signed-off-by: Patrick Wildt 
> > ---
> >  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




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

2021-11-10 Thread Vagrant Cascadian
On 2021-09-02, Patrick Wildt wrote:
> 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 +)

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


> Signed-off-by: Patrick Wildt 
> ---
>  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


signature.asc
Description: PGP signature


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

2021-09-03 Thread Heiko Thiery
Hi,

Am Fr., 3. Sept. 2021 um 22:54 Uhr schrieb Patrick Wildt :
>
> Am Fri, Sep 03, 2021 at 08:25:39PM +0200 schrieb Heiko Thiery:
> > Hi Patrick,
> >
> > Am Fr., 3. Sept. 2021 um 16:30 Uhr schrieb Patrick Wildt 
> > :
> > >
> > > Am Fri, Sep 03, 2021 at 11:01:06AM +0200 schrieb Heiko Thiery:
> > > > Hi Patrick,
> > > >
> > > > Am Do., 2. Sept. 2021 um 23:44 Uhr schrieb 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.
> > > > >
> > > > > Signed-off-by: Patrick Wildt 
> > > >
> > > > 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
> >
> > 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

-- 
Heiko


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

2021-09-03 Thread Patrick Wildt
Am Fri, Sep 03, 2021 at 05:58:07PM -0300 schrieb Fabio Estevam:
> Hi Patrick,
> 
> On Fri, Sep 3, 2021 at 11:30 AM Patrick Wildt  wrote:
> 
> > 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 = ;
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.


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

2021-09-03 Thread Fabio Estevam
Hi Patrick,

On Fri, Sep 3, 2021 at 11:30 AM Patrick Wildt  wrote:

> 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?


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

2021-09-03 Thread Patrick Wildt
Am Fri, Sep 03, 2021 at 08:25:39PM +0200 schrieb Heiko Thiery:
> Hi Patrick,
> 
> Am Fr., 3. Sept. 2021 um 16:30 Uhr schrieb Patrick Wildt :
> >
> > Am Fri, Sep 03, 2021 at 11:01:06AM +0200 schrieb Heiko Thiery:
> > > Hi Patrick,
> > >
> > > Am Do., 2. Sept. 2021 um 23:44 Uhr schrieb 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.
> > > >
> > > > Signed-off-by: Patrick Wildt 
> > >
> > > 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
> 
> 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


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

2021-09-03 Thread Heiko Thiery
Hi Patrick,

Am Fr., 3. Sept. 2021 um 16:30 Uhr schrieb Patrick Wildt :
>
> Am Fri, Sep 03, 2021 at 11:01:06AM +0200 schrieb Heiko Thiery:
> > Hi Patrick,
> >
> > Am Do., 2. Sept. 2021 um 23:44 Uhr schrieb 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.
> > >
> > > Signed-off-by: Patrick Wildt 
> >
> > 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

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.

-- 
Heiko


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

2021-09-03 Thread Patrick Wildt
Am Fri, Sep 03, 2021 at 11:01:06AM +0200 schrieb Heiko Thiery:
> Hi Patrick,
> 
> Am Do., 2. Sept. 2021 um 23:44 Uhr schrieb 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.
> >
> > Signed-off-by: Patrick Wildt 
> 
> 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


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

2021-09-03 Thread Heiko Thiery
Hi Patrick,

Am Do., 2. Sept. 2021 um 23:44 Uhr schrieb 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.
>
> Signed-off-by: Patrick Wildt 

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


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

2021-09-02 Thread 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.

Signed-off-by: Patrick Wildt 
---
 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

diff --git a/arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi 
b/arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi
new file mode 100644
index 00..7e928e875b
--- /dev/null
+++ b/arch/arm/dts/imx8mq-mnt-reform2-u-boot.dtsi
@@ -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;
+};
diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig
index ccaf106be5..44582ad152 100644
--- a/arch/arm/mach-imx/imx8m/Kconfig
+++ b/arch/arm/mach-imx/imx8m/Kconfig
@@ -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"
diff --git a/board/mntre/imx8mq_reform2/Kconfig 
b/board/mntre/imx8mq_reform2/Kconfig
new file mode 100644
index 00..8070ef377b
--- /dev/null
+++ b/board/mntre/imx8mq_reform2/Kconfig
@@ -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
diff --git a/board/mntre/imx8mq_reform2/MAINTAINERS 
b/board/mntre/imx8mq_reform2/MAINTAINERS
new file mode 100644
index 00..946f287ecf
--- /dev/null
+++ b/board/mntre/imx8mq_reform2/MAINTAINERS
@@ -0,0 +1,7 @@
+REFORM2 IMX8MQ BOARD
+M: Lukas F. Hartmann 
+M: Patrick Wildt 
+S: Maintained
+F: board/mntre/imx8mq_reform2/
+F: include/configs/imx8mq_reform2.h
+F: configs/imx8mq_reform2_defconfig
diff --git a/board/mntre/imx8mq_reform2/Makefile 
b/board/mntre/imx8mq_reform2/Makefile
new file mode 100644
index 00..2efd56bb4a
--- /dev/null
+++ b/board/mntre/imx8mq_reform2/Makefile
@@ -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
diff --git a/board/mntre/imx8mq_reform2/imx8mq_reform2.c 
b/board/mntre/imx8mq_reform2/imx8mq_reform2.c
new file mode 100644
index 00..f7cb32dd98
--- /dev/null
+++ b/board/mntre/imx8mq_reform2/imx8mq_reform2.c
@@ -0,0 +1,213 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2018 NXP
+ * Copyright (C) 2018, Boundary Devices 
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define UART_PAD_CTRL  (PAD_CTL_DSE6 | PAD_CTL_FSEL1)
+
+#define WDOG_PAD_CTRL  (PAD_CTL_DSE6 | PAD_CTL_HYS | PAD_CTL_PUE)
+
+static iomux_v3_cfg_t const wdog_pads[] = {
+   IMX8MQ_PAD_GPIO1_IO02__WDOG1_WDOG_B | MUX_PAD_CTRL(WDOG_PAD_CTRL),
+};
+
+static iomux_v3_cfg_t const uart_pads[] = {
+   IMX8MQ_PAD_UART1_RXD__UART1_RX