Skip to contentSkip to conversation

board: purism: add the Purism Librem5 phone

PATCH New Angus Ainslie 2 participants 2 messages Aug 26, 2022 – Sep 18, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v8 1/1 board: purism: add the Purism Librem5 phone

Initial commit of Librem5 u-boot and SPL

---

Changes since v7:

Added Reviewed-by
Move patch comments

Changes since v6:

Move migrated symbols
Rebase onto latest u-boot-imx

Changes since v5:

Proper handling of the Display Port firmware for CI builds Update the DP section of the docs

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

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   |   24 +
 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 |    9 +
 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                    |  152 ++
 doc/board/index.rst                          |    1 +
 doc/board/purism/index.rst                   |    9 +
 doc/board/purism/librem5.rst                 |   60 +
 include/configs/librem5.h                    |   95 ++
 19 files changed, 5401 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
arch/arm/dts/Makefile +2 -1
index 48cb1f52b7..5e9e4c0d09 100644
@@ -971,7 +971,8 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
 	imx8mp-venice-gw74xx.dtb \
 	imx8mp-verdin-wifi-dev.dtb \
 	imx8mq-pico-pi.dtb \
-	imx8mq-kontron-pitx-imx8m.dtb
+	imx8mq-kontron-pitx-imx8m.dtb \
+	imx8mq-librem5-r4.dtb
 
 dtb-$(CONFIG_ARCH_IMX9) += \
 	imx93-11x11-evk.dtb
arch/arm/dts/imx8mq-librem5-r4-u-boot.dtsi new file +24 -0
new file mode 100644
index 0000000000..9d0a54a32f
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+#include "imx8mq-u-boot.dtsi"
+
+&pinctrl_uart1 {
+	u-boot,dm-spl;
+};
+
+&uart1 { /* console */
+	u-boot,dm-spl;
+};
+
+&binman {
+	/delete-node/ signed-hdmi;
+
+	signed-hdmi {
+		filename = "signed_hdmi.bin";
+
+		signed-dp-imx8m {
+			filename = "signed_dp_imx8m.bin";
+			type = "blob-ext";
+		};
+	};
+};
arch/arm/dts/imx8mq-librem5-r4.dts new file +35 -0
new file mode 100644
index 0000000000..cbfb49aa25
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (C) 2020 Purism SPC <[email protected]>
+
+/dts-v1/;
+
+#include "imx8mq-librem5.dtsi"
+
+/ {
+	model = "Purism Librem 5r4";
+	compatible = "purism,librem5r4", "purism,librem5", "fsl,imx8mq";
+};
+
+&accel_gyro {
+	mount-matrix =  "1",  "0",  "0",
+			"0",  "1",  "0",
+			"0",  "0", "-1";
+};
+
+&bat {
+	maxim,rsns-microohm = <1667>;
+};
+
+&bq25895 {
+	ti,battery-regulation-voltage = <4200000>; /* uV */
+	ti,charge-current = <1500000>; /* uA */
+	ti,termination-current = <144000>;  /* uA */
+};
+
+&led_backlight {
+	led-max-microamp = <25000>;
+};
+
+&proximity {
+	proximity-near-level = <10>;
+};
arch/arm/dts/imx8mq-librem5.dtsi new file +1255 -0

1,255 lines not on this page · raw message

arch/arm/mach-imx/imx8m/Kconfig +9 -0
index 979b30ae39..3470160990 100644
@@ -269,6 +269,14 @@ config TARGET_IMX8MP_RSB3720A1_6G
 	select IMX8MP
 	select SUPPORT_SPL
 	select IMX8M_LPDDR4
+
+config TARGET_LIBREM5
+	bool "Purism Librem5 Phone"
+	select BINMAN
+	select IMX8MQ
+	select SUPPORT_SPL
+	select IMX8M_LPDDR4
+
 endchoice
 
 source "board/advantech/imx8mp_rsb3720a1/Kconfig"
@@ -290,6 +298,7 @@ source "board/kontron/sl-mx8mm/Kconfig"
 source "board/menlo/mx8menlo/Kconfig"
 source "board/phytec/phycore_imx8mm/Kconfig"
 source "board/phytec/phycore_imx8mp/Kconfig"
+source "board/purism/librem5/Kconfig"
 source "board/ronetix/imx8mq-cm/Kconfig"
 source "board/technexion/pico-imx8mq/Kconfig"
 source "board/variscite/imx8mn_var_som/Kconfig"
board/purism/librem5/Kconfig new file +15 -0
new file mode 100644
index 0000000000..cf0f303683
@@ -0,0 +1,15 @@
+if TARGET_LIBREM5
+
+config SYS_BOARD
+	default "librem5"
+
+config SYS_VENDOR
+	default "purism"
+
+config SYS_CONFIG_NAME
+	default "librem5"
+
+config IMX_CONFIG
+	default "board/purism/librem5/imximage-8mq-lpddr4.cfg"
+
+endif
board/purism/librem5/MAINTAINERS new file +8 -0
new file mode 100644
index 0000000000..09e7f20e33
@@ -0,0 +1,8 @@
+PURISM LIBREM5 PHONE
+M:	Angus Ainslie <[email protected]>
+R:	[email protected]
+S:	Supported
+F:	arch/arm/dts/imx8mq-librem5*
+F:	board/purism/librem5/
+F:	configs/librem5_defconfig
+F:	include/configs/librem5.h
board/purism/librem5/Makefile new file +13 -0
new file mode 100644
index 0000000000..47f25f047b
@@ -0,0 +1,13 @@
+#
+# Copyright 2017 NXP
+# Copyright 2019 Purism
+#
+# SPDX-License-Identifier:      GPL-2.0+
+#
+
+obj-y += librem5.o
+
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o
+obj-$(CONFIG_IMX8M_LPDDR4) += lpddr4_timing.o lpddr4_timing_b0.o
+endif
board/purism/librem5/imximage-8mq-lpddr4.cfg new file +9 -0
new file mode 100644
index 0000000000..3b5967105b
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2021 NXP
+ */
+
+FIT
+BOOT_FROM	sd
+SIGNED_HDMI     signed_hdmi.bin
+LOADER		u-boot-spl-ddr.bin	0x7E1000
board/purism/librem5/librem5.c new file +425 -0

425 lines not on this page · raw message

board/purism/librem5/librem5.h new file +181 -0

181 lines not on this page · raw message

board/purism/librem5/lpddr4_timing.c new file +1324 -0

1,005 lines not on this page · raw message

board/purism/librem5/lpddr4_timing_b0.c new file +1191 -0

1,191 lines not on this page · raw message

board/purism/librem5/spl.c new file +593 -0

593 lines not on this page · raw message

configs/librem5_defconfig new file +152 -0

152 lines not on this page · raw message

doc/board/index.rst +1 -0
index 01b99f9cf5..53edd5301f 100644

Lines of this file are not shown. View the raw message.

doc/board/purism/index.rst new file +9 -0
new file mode 100644
index 0000000000..a9cdc312d4

Lines of this file are not shown. View the raw message.

doc/board/purism/librem5.rst new file +60 -0

60 lines not on this page · raw message

include/configs/librem5.h new file +95 -0

95 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.34.1

Part of the diff is not shown here. View the raw message.

#1 lore raw

PATCH v8 1/1 board: purism: add the Purism Librem5 phone

Quoted 5 lines

Initial commit of Librem5 u-boot and SPL

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================