Re: [PATCH v5] board: purism: add the Purism Librem5 phone

2022-05-24 Thread Angus Ainslie

On 2022-05-24 08:10, Tom Rini wrote:

On Tue, May 24, 2022 at 07:15:01AM -0700, Angus Ainslie wrote:

Hi Stefano,

On 2022-05-23 02:36, Stefano Babic wrote:
> On 06.05.22 14:44, Angus Ainslie wrote:
> > Initial commit of Librem5 u-boot and SPL
> >
> > Signed-off-by: Angus Ainslie 
> > Co-developed-by: Sebastian Krzyszkowiak
> > 
> > Signed-off-by: Sebastian Krzyszkowiak 
> > ---
>
> Hi Angus,
>
> with "configs: get rid of build warnings due to SPL_USB_DWC3_GENERIC"
> most issues are solved, but a TI board is still broken.
>

I'll resend the patch that includes a fix for the aarch64 board.

> A second issue is for the blob signed_dp_imx8m.bin, it should be done
> like for signed_hdmi.bin to avoid CI breakages.
>
> Here the result of pipeline:
>
> https://source.denx.de/u-boot/custodians/u-boot-imx/-/jobs/437965
>

I see that the imx8mq_evk does not fail CI build but I'm not seeing 
how the

missing signed_hdmi.bin file is handled. Any hints ?


You need to use binman to handle it, does
arch/arm/dts/imx8mq-u-boot.dtsi provide some clues?


Currently the librem5-r4-u-boot.dtsi ( text below ) includes 
imx8mq-u-boot.dtsi and I tried deleting the signed-hdmi and including a 
signed-dp in it's place. Now instead of an error about a missing 
"signed_hdmi_imx8m.bin" I get an error about a missing 
"signed_dp_imx8m.bin" so I know I'm having an effect but not enough of 
one.


// SPDX-License-Identifier: (GPL-2.0 OR MIT)

#include "imx8mq-u-boot.dtsi"

_uart1 {
u-boot,dm-spl;
};

 { /* console */
u-boot,dm-spl;
};

 {
/delete-node/ signed-hdmi;

signed-dp {
filename = "signed_dp_imx8m.bin";

signed-dp-imx8m {
filename = "signed_dp_imx8m.bin";
type = "blob-ext";
};
};
};



Re: [PATCH v5] board: purism: add the Purism Librem5 phone

2022-05-24 Thread Tom Rini
On Tue, May 24, 2022 at 07:15:01AM -0700, Angus Ainslie wrote:
> Hi Stefano,
> 
> On 2022-05-23 02:36, Stefano Babic wrote:
> > On 06.05.22 14:44, Angus Ainslie wrote:
> > > Initial commit of Librem5 u-boot and SPL
> > > 
> > > Signed-off-by: Angus Ainslie 
> > > Co-developed-by: Sebastian Krzyszkowiak
> > > 
> > > Signed-off-by: Sebastian Krzyszkowiak 
> > > ---
> > 
> > Hi Angus,
> > 
> > with "configs: get rid of build warnings due to SPL_USB_DWC3_GENERIC"
> > most issues are solved, but a TI board is still broken.
> > 
> 
> I'll resend the patch that includes a fix for the aarch64 board.
> 
> > A second issue is for the blob signed_dp_imx8m.bin, it should be done
> > like for signed_hdmi.bin to avoid CI breakages.
> > 
> > Here the result of pipeline:
> > 
> > https://source.denx.de/u-boot/custodians/u-boot-imx/-/jobs/437965
> > 
> 
> I see that the imx8mq_evk does not fail CI build but I'm not seeing how the
> missing signed_hdmi.bin file is handled. Any hints ?

You need to use binman to handle it, does
arch/arm/dts/imx8mq-u-boot.dtsi provide some clues?

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v5] board: purism: add the Purism Librem5 phone

2022-05-24 Thread Angus Ainslie

Hi Stefano,

On 2022-05-23 02:36, Stefano Babic wrote:

On 06.05.22 14:44, Angus Ainslie wrote:

Initial commit of Librem5 u-boot and SPL

Signed-off-by: Angus Ainslie 
Co-developed-by: Sebastian Krzyszkowiak 


Signed-off-by: Sebastian Krzyszkowiak 
---


Hi Angus,

with "configs: get rid of build warnings due to SPL_USB_DWC3_GENERIC"
most issues are solved, but a TI board is still broken.



I'll resend the patch that includes a fix for the aarch64 board.


A second issue is for the blob signed_dp_imx8m.bin, it should be done
like for signed_hdmi.bin to avoid CI breakages.

Here the result of pipeline:

https://source.denx.de/u-boot/custodians/u-boot-imx/-/jobs/437965



I see that the imx8mq_evk does not fail CI build but I'm not seeing how 
the missing signed_hdmi.bin file is handled. Any hints ?


Thanks
Angus


Best regards,
Stefano



[PATCH v5] board: purism: add the Purism Librem5 phone

2022-05-06 Thread Angus Ainslie
Initial commit of Librem5 u-boot and SPL

Signed-off-by: Angus Ainslie 
Co-developed-by: Sebastian Krzyszkowiak 
Signed-off-by: Sebastian Krzyszkowiak 
---

All of the pre-requisite patches for this board are now upstream or in review.

Changes since v4:

Include imx8mq-u-boot.dtsi instead of adding a new copy

Changes since v3:

Dropped unused MMCROOT
Rebased on u-boot-imx
Needs this patch to supress SPL warnings
https://lists.denx.de/pipermail/u-boot/2022-April/482369.html

Changes since v2:

Cleanup Kconfig symbols used in librem5.h
Cleanup various checkpatch issues
Drop some un-used functions

Changes since v1:

Merged patches into a monolithic board patch
Using DM drivers for devices in u-boot
Added USB storage support for uSD rootfs
Dropped many SPL_BUILD guarded define's
Fixed documentation index

 arch/arm/dts/Makefile|3 +-
 arch/arm/dts/imx8mq-librem5-r4-u-boot.dtsi   |3 +
 arch/arm/dts/imx8mq-librem5-r4.dts   |   35 +
 arch/arm/dts/imx8mq-librem5.dtsi | 1255 +
 arch/arm/mach-imx/imx8m/Kconfig  |9 +
 board/purism/librem5/Kconfig |   15 +
 board/purism/librem5/MAINTAINERS |8 +
 board/purism/librem5/Makefile|   13 +
 board/purism/librem5/imximage-8mq-lpddr4.cfg |8 +
 board/purism/librem5/librem5.c   |  425 ++
 board/purism/librem5/librem5.h   |  181 +++
 board/purism/librem5/lpddr4_timing.c | 1324 ++
 board/purism/librem5/lpddr4_timing_b0.c  | 1191 
 board/purism/librem5/spl.c   |  593 
 configs/librem5_defconfig|  142 ++
 doc/board/index.rst  |1 +
 doc/board/purism/index.rst   |9 +
 doc/board/purism/librem5.rst |   60 +
 include/configs/librem5.h|  113 ++
 19 files changed, 5387 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx8mq-librem5-r4-u-boot.dtsi
 create mode 100644 arch/arm/dts/imx8mq-librem5-r4.dts
 create mode 100644 arch/arm/dts/imx8mq-librem5.dtsi
 create mode 100644 board/purism/librem5/Kconfig
 create mode 100644 board/purism/librem5/MAINTAINERS
 create mode 100644 board/purism/librem5/Makefile
 create mode 100644 board/purism/librem5/imximage-8mq-lpddr4.cfg
 create mode 100644 board/purism/librem5/librem5.c
 create mode 100644 board/purism/librem5/librem5.h
 create mode 100644 board/purism/librem5/lpddr4_timing.c
 create mode 100644 board/purism/librem5/lpddr4_timing_b0.c
 create mode 100644 board/purism/librem5/spl.c
 create mode 100644 configs/librem5_defconfig
 create mode 100644 doc/board/purism/index.rst
 create mode 100644 doc/board/purism/librem5.rst
 create mode 100644 include/configs/librem5.h

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 90f86e3fca..719fd7db8d 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -937,7 +937,8 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
imx8mp-venice-gw74xx.dtb \
imx8mp-verdin.dtb \
imx8mq-pico-pi.dtb \
-   imx8mq-kontron-pitx-imx8m.dtb
+   imx8mq-kontron-pitx-imx8m.dtb \
+   imx8mq-librem5-r4.dtb
 
 dtb-$(CONFIG_ARCH_IMXRT) += imxrt1050-evk.dtb \
imxrt1020-evk.dtb
diff --git a/arch/arm/dts/imx8mq-librem5-r4-u-boot.dtsi 
b/arch/arm/dts/imx8mq-librem5-r4-u-boot.dtsi
new file mode 100644
index 00..8a68f53ace
--- /dev/null
+++ b/arch/arm/dts/imx8mq-librem5-r4-u-boot.dtsi
@@ -0,0 +1,3 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+#include "imx8mq-u-boot.dtsi"
diff --git a/arch/arm/dts/imx8mq-librem5-r4.dts 
b/arch/arm/dts/imx8mq-librem5-r4.dts
new file mode 100644
index 00..cbfb49aa25
--- /dev/null
+++ b/arch/arm/dts/imx8mq-librem5-r4.dts
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (C) 2020 Purism SPC 
+
+/dts-v1/;
+
+#include "imx8mq-librem5.dtsi"
+
+/ {
+   model = "Purism Librem 5r4";
+   compatible = "purism,librem5r4", "purism,librem5", "fsl,imx8mq";
+};
+
+_gyro {
+   mount-matrix =  "1",  "0",  "0",
+   "0",  "1",  "0",
+   "0",  "0", "-1";
+};
+
+ {
+   maxim,rsns-microohm = <1667>;
+};
+
+ {
+   ti,battery-regulation-voltage = <420>; /* uV */
+   ti,charge-current = <150>; /* uA */
+   ti,termination-current = <144000>;  /* uA */
+};
+
+_backlight {
+   led-max-microamp = <25000>;
+};
+
+ {
+   proximity-near-level = <10>;
+};
diff --git a/arch/arm/dts/imx8mq-librem5.dtsi b/arch/arm/dts/imx8mq-librem5.dtsi
new file mode 100644
index 00..60d47c7149
--- /dev/null
+++ b/arch/arm/dts/imx8mq-librem5.dtsi
@@ -0,0 +1,1255 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2018-2020 Purism SPC
+ */
+
+/dts-v1/;
+
+#include "dt-bindings/input/input.h"
+#include 
+#include "dt-bindings/pwm/pwm.h"
+#include "dt-bindings/usb/pd.h"
+#include "imx8mq.dtsi"
+
+/ {
+   model = "Purism