Skip to contentSkip to conversation

Config and device tree updates for the Librem5 Devkit

PATCH Superseded Guido Günther 2 participants 9 messages Dec 13, 2020 – Dec 15, 2020

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover Config and device tree updates for the Librem5 Devkit

This enables more components to get a working display, panel, audio and sensors. It also updates some device tree bits to make mainline boot.

I've skipped wifi (which needs some more driver work) and devfreq (since Martin is working on that).

The config changes don't depend on the DT parts so could be applied independently. The series was tested against next-20201209 and i made sure the defconfig changes also apply on top of shawnguo/imx/defconfig.

Guido Günther (4):
arm64: defconfig: Enable Librem5 Devkit components
arm64: dts: imx8mq-librem5-devkit: Disable snvs_rtc
arm64: dts: imx8mq-librem5-devkit: Mark more regulators as always-on
arm64: dts: imx8mq-librem5-devkit: Drop custom clock settings

 .../dts/freescale/imx8mq-librem5-devkit.dts   | 28 +++++++++----------
 arch/arm64/configs/defconfig                  |  8 ++++++
 2 files changed, 22 insertions(+), 14 deletions(-)
Signature · 1 line
2.29.2
#1 lore raw

PATCH 1/4 arm64: defconfig: Enable Librem5 Devkit components

This enables

- touchscreen: CONFIG_TOUCHSCREEN_GOODIX
- charge controller: CONFIG_CHARGER_BQ25890
- audio codec: CONFIG_SND_SOC_IMX_SGTL5000
- rtc: CONFIG_RTC_DRV_M41T80
- magnetometer: CONFIG_IIO_ST_MAGN_3AXIS
- pwm: CONFIG_PWM_IMX27
- modem codec: CONFIG_SND_SOC_GTM601
- modem serial: CONFIG_USB_SERIAL_OPTION

---
 arch/arm64/configs/defconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/configs/defconfig +8 -0
index c8ca76751a34..dd70bf09659d 100644
@@ -386,6 +386,7 @@ CONFIG_KEYBOARD_IMX_SC_KEY=m
 CONFIG_KEYBOARD_CROS_EC=y
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_ATMEL_MXT=m
+CONFIG_TOUCHSCREEN_GOODIX=m
 CONFIG_TOUCHSCREEN_EDT_FT5X06=m
 CONFIG_INPUT_MISC=y
 CONFIG_INPUT_PM8941_PWRKEY=y
@@ -534,6 +535,7 @@ CONFIG_BATTERY_SBS=m
 CONFIG_BATTERY_BQ27XXX=y
 CONFIG_SENSORS_ARM_SCMI=y
 CONFIG_BATTERY_MAX17042=m
+CONFIG_CHARGER_BQ25890=m
 CONFIG_CHARGER_BQ25980=m
 CONFIG_SENSORS_ARM_SCPI=y
 CONFIG_SENSORS_LM90=m
@@ -715,6 +717,7 @@ CONFIG_SND_SOC_FSL_ASRC=m
 CONFIG_SND_SOC_FSL_MICFIL=m
 CONFIG_SND_SOC_FSL_EASRC=m
 CONFIG_SND_IMX_SOC=m
+CONFIG_SND_SOC_IMX_SGTL5000=m
 CONFIG_SND_SOC_IMX_SPDIF=m
 CONFIG_SND_SOC_IMX_AUDMIX=m
 CONFIG_SND_MESON_AXG_SOUND_CARD=m
@@ -740,6 +743,7 @@ CONFIG_SND_SOC_TEGRA210_ADMAIF=m
 CONFIG_SND_SOC_AK4613=m
 CONFIG_SND_SOC_ES7134=m
 CONFIG_SND_SOC_ES7241=m
+CONFIG_SND_SOC_GTM601=m
 CONFIG_SND_SOC_PCM3168A_I2C=m
 CONFIG_SND_SOC_SIMPLE_AMPLIFIER=m
 CONFIG_SND_SOC_TAS571X=m
@@ -775,6 +779,7 @@ CONFIG_USB_ISP1760=y
 CONFIG_USB_SERIAL=m
 CONFIG_USB_SERIAL_CP210X=m
 CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_OPTION=m
 CONFIG_USB_HSIC_USB3503=y
 CONFIG_NOP_USB_XCEIV=y
 CONFIG_USB_GADGET=y
@@ -844,6 +849,7 @@ CONFIG_RTC_DRV_HYM8563=m
 CONFIG_RTC_DRV_MAX77686=y
 CONFIG_RTC_DRV_RK808=m
 CONFIG_RTC_DRV_PCF85363=m
+CONFIG_RTC_DRV_M41T80=m
 CONFIG_RTC_DRV_RX8581=m
 CONFIG_RTC_DRV_RV8803=m
 CONFIG_RTC_DRV_S5M=y
@@ -1008,11 +1014,13 @@ CONFIG_IIO_ST_LSM6DSX=m
 CONFIG_IIO_CROS_EC_LIGHT_PROX=m
 CONFIG_SENSORS_ISL29018=m
 CONFIG_VCNL4000=m
+CONFIG_IIO_ST_MAGN_3AXIS=m
 CONFIG_IIO_CROS_EC_BARO=m
 CONFIG_MPL3115=m
 CONFIG_PWM=y
 CONFIG_PWM_BCM2835=m
 CONFIG_PWM_CROS_EC=m
+CONFIG_PWM_IMX27=m
 CONFIG_PWM_MESON=m
 CONFIG_PWM_RCAR=m
 CONFIG_PWM_ROCKCHIP=y
Signature · 7 lines
2.29.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#2 lore raw

Re: [PATCH 1/4] arm64: defconfig: Enable Librem5 Devkit components

Quoted 10 lines · Guido Günther

This enables

- touchscreen: CONFIG_TOUCHSCREEN_GOODIX
- charge controller: CONFIG_CHARGER_BQ25890
- audio codec: CONFIG_SND_SOC_IMX_SGTL5000
- rtc: CONFIG_RTC_DRV_M41T80
- magnetometer: CONFIG_IIO_ST_MAGN_3AXIS
- pwm: CONFIG_PWM_IMX27
- modem codec: CONFIG_SND_SOC_GTM601
- modem serial: CONFIG_USB_SERIAL_OPTION

Do not repeat the contents of the patch. We can easily see which configs you enable. Instead, please name the devices you want to use, not the CONFIG entries. Several drivers actually support multiple devices.

Describe also the board you are enabling it for. You wrote only "Librem5", but I am not sure whether this is specific enough. Is it even on NXP i.MX processor? Maybe on something else?

This is a generic defconfig so your change will affect everyone.

Best regards,
Krzysztof

#3 lore raw

PATCH 2/4 arm64: dts: imx8mq-librem5-devkit: Disable snvs_rtc

In reply to Guido Günther

The board has it's own rtc chip.

---
 arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts +4 -0
index af139b283daf..12f5d75a5e44 100644
@@ -886,6 +886,10 @@ &snvs_pwrkey {
 	status = "okay";
 };
 
+&snvs_rtc {
+	status = "disabled";
+};
+
 &sai2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_sai2>;
Signature · 7 lines
2.29.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#4 lore raw

Re: [PATCH 2/4] arm64: dts: imx8mq-librem5-devkit: Disable snvs_rtc

Quoted 1 line · Guido Günther

The board has it's own rtc chip.

s/rtc/RTC/

Even if you have on-board RTC, why disabling the SNVS?

Best regards,
Krzysztof

Quoted 24 lines
---
 arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts +4 -0
index af139b283daf..12f5d75a5e44 100644
@@ -886,6 +886,10 @@ &snvs_pwrkey {
 	status = "okay";
 };
 
+&snvs_rtc {
+	status = "disabled";
+};
+
 &sai2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_sai2>;
Signature · 1 line
2.29.2
#5 lore raw

PATCH 3/4 arm64: dts: imx8mq-librem5-devkit: Mark more regulators as always-on

In reply to Guido Günther

They power vital parts of the board and low power consumption is not really an issue here. It also brings things more in line with what Purism is using downstream.

---
 .../dts/freescale/imx8mq-librem5-devkit.dts   | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts +10 -9
index 12f5d75a5e44..5fdea6b74ed5 100644
@@ -297,7 +297,7 @@ buck1_reg: BUCK1 {
 				regulator-name = "buck1";
 				regulator-min-microvolt = <700000>;
 				regulator-max-microvolt = <1300000>;
-				regulator-boot-on;
+				regulator-always-on;
 				regulator-ramp-delay = <1250>;
 				rohm,dvs-run-voltage = <900000>;
 				rohm,dvs-idle-voltage = <850000>;
@@ -308,7 +308,7 @@ buck2_reg: BUCK2 {
 				regulator-name = "buck2";
 				regulator-min-microvolt = <700000>;
 				regulator-max-microvolt = <1300000>;
-				regulator-boot-on;
+				regulator-always-on;
 				regulator-ramp-delay = <1250>;
 				rohm,dvs-run-voltage = <1000000>;
 				rohm,dvs-idle-voltage = <900000>;
@@ -318,7 +318,7 @@ buck3_reg: BUCK3 {
 				regulator-name = "buck3";
 				regulator-min-microvolt = <700000>;
 				regulator-max-microvolt = <1300000>;
-				regulator-boot-on;
+				regulator-always-on;
 				rohm,dvs-run-voltage = <900000>;
 			};
 
@@ -333,7 +333,7 @@ buck5_reg: BUCK5 {
 				regulator-name = "buck5";
 				regulator-min-microvolt = <700000>;
 				regulator-max-microvolt = <1350000>;
-				regulator-boot-on;
+				regulator-always-on;
 			};
 
 			buck6_reg: BUCK6 {
@@ -354,7 +354,7 @@ buck8_reg: BUCK8 {
 				regulator-name = "buck8";
 				regulator-min-microvolt = <800000>;
 				regulator-max-microvolt = <1400000>;
-				regulator-boot-on;
+				regulator-always-on;
 			};
 
 			ldo1_reg: LDO1 {
@@ -379,34 +379,35 @@ ldo3_reg: LDO3 {
 				regulator-name = "ldo3";
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <3300000>;
-				regulator-boot-on;
+				regulator-always-on;
 			};
 
 			ldo4_reg: LDO4 {
 				regulator-name = "ldo4";
 				regulator-min-microvolt = <900000>;
 				regulator-max-microvolt = <1800000>;
-				regulator-boot-on;
+				regulator-always-on;
 			};
 
 			ldo5_reg: LDO5 {
 				regulator-name = "ldo5";
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
 			};
 
 			ldo6_reg: LDO6 {
 				regulator-name = "ldo6";
 				regulator-min-microvolt = <900000>;
 				regulator-max-microvolt = <1800000>;
-				regulator-boot-on;
+				regulator-always-on;
 			};
 
 			ldo7_reg: LDO7 {
 				regulator-name = "ldo7";
 				regulator-min-microvolt = <1800000>;
 				regulator-max-microvolt = <3300000>;
-				regulator-boot-on;
+				regulator-always-on;
 			};
 		};
 	};
Signature · 7 lines
2.29.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#6 lore raw

Re: [PATCH 3/4] arm64: dts: imx8mq-librem5-devkit: Mark more regulators as always-on

Quoted 3 lines · Guido Günther

They power vital parts of the board and low power consumption is not really an issue here. It also brings things more in line with what Purism is using downstream.

I don't find it a proper explanation. Not all regulators power vital parts of board. Having regulators always on makes people to skip adding proper supplies thus not describing the HW properly.

Aligning with downstream without clear reason (just because) is also not a good reason.

Please reduce the choice only to core regulators or describe it really why they have to be always on.

Best regards,
Krzysztof

#7 lore raw

PATCH 4/4 arm64: dts: imx8mq-librem5-devkit: Drop custom clock settings

In reply to Guido Günther

Otherwise the boot hangs early on.

---
 arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts | 5 -----
 1 file changed, 5 deletions(-)
arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts +0 -5
index 5fdea6b74ed5..b913a2aee328 100644
@@ -244,11 +244,6 @@ &A53_3 {
 	cpu-supply = <&buck2_reg>;
 };
 
-&clk {
-	assigned-clocks = <&clk IMX8MQ_AUDIO_PLL1>, <&clk IMX8MQ_AUDIO_PLL2>;
-	assigned-clock-rates = <786432000>, <722534400>;
-};
-
 &dphy {
 	status = "okay";
 };
Signature · 7 lines
2.29.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#8 lore raw

Re: [PATCH 4/4] arm64: dts: imx8mq-librem5-devkit: Drop custom clock settings

Quoted 1 line · Guido Günther

Otherwise the boot hangs early on.

And previously it was booting or maybe never tested? Maybe the issue is actually different, e.g. you miss some power domains?

Best regards,
Krzysztof