linux-purism-librem5: upgrade to 6.0

- the config diff is just rebasing

- drops the ship mode patch I wrote, since it is no longer required
  after a pending update to the device-purism-librem5 package...

- drops the dogwood voltage patch, apparently no longer necessary,
  see: https://source.puri.sm/Librem5/linux/-/issues/442#note_214984

- drops the usdhc bus patch
  see: https://source.puri.sm/Librem5/linux/-/issues/442#note_215026

[ci:skip-build] already built successfully in CI
This commit is contained in:
Clayton Craft 2022-10-01 20:13:47 -07:00
parent e10cf4fadc
commit 325cc8e483
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A
5 changed files with 203 additions and 254 deletions

View file

@ -1,108 +0,0 @@
From 27afc3e0e791b6dbf0fb2c1ee5073a646089eb59 Mon Sep 17 00:00:00 2001
From: Clayton Craft <clayton@craftyguy.net>
Date: Fri, 5 Mar 2021 18:55:28 -0800
Subject: [PATCH] bq25890_charger: enter ship mode on power off
This sets the charger device into 'ship mode' when powering off by
hooking onto pm_power_off. 'Ship mode' is skipped if the device is
actively charging. This feature is disabled by default, and can be
enabled by setting 'ship_mode=1' when loading this module.
Since the poweroff can be aborted (i.e. when charging), any previous
value for pm_power_off is saved and run in the cases where the
bq25890 is *not* used to power off system.
---
drivers/power/supply/bq25890_charger.c | 56 ++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
index ef3f152e2ba8..4e31a137bcba 100644
--- a/drivers/power/supply/bq25890_charger.c
+++ b/drivers/power/supply/bq25890_charger.c
@@ -40,6 +40,10 @@ static const char *const bq25890_chip_name[] = {
"BQ25896",
};
+static bool ship_mode;
+module_param(ship_mode, bool, 0644);
+MODULE_PARM_DESC(ship_mode, "Put device into 'ship mode' when powering off the computer");
+
enum bq25890_fields {
F_EN_HIZ, F_EN_ILIM, F_IILIM, /* Reg00 */
F_BHOT, F_BCOLD, F_VINDPM_OFS, /* Reg01 */
@@ -928,6 +932,43 @@ static int bq25890_power_supply_init(struct bq25890_device *bq)
return PTR_ERR_OR_ZERO(bq->charger);
}
+static struct bq25890_device *bq25890_dev;
+void (*previous_pm_power_off)(void) = NULL;
+static void bq25890_power_off(void)
+{
+ int ret;
+
+ /* Don't enable ship mode if charging */
+ if (bq25890_dev->state.online) {
+ dev_info(bq25890_dev->dev, "Charging, not entering ship mode");
+ goto end;
+ }
+
+ dev_info(bq25890_dev->dev, "Entering ship mode!");
+
+ /* Enable HIZ */
+ dev_info(bq25890_dev->dev, "Enabling HIZ");
+ ret = bq25890_field_write(bq25890_dev, F_EN_HIZ, 1);
+ if (ret < 0)
+ goto error;
+
+ /* Enable ship mode with no delay */
+ dev_info(bq25890_dev->dev, "Ship mode w/ no delay");
+ ret = bq25890_field_write(bq25890_dev, F_BATFET_DLY, 0);
+ if (ret < 0)
+ goto error;
+ ret = bq25890_field_write(bq25890_dev, F_BATFET_DIS, 1);
+ if (ret < 0)
+ goto error;
+
+error:
+ dev_err(bq25890_dev->dev, "Error entering ship mode.\n");
+
+end:
+ if (previous_pm_power_off)
+ previous_pm_power_off();
+}
+
static void bq25890_usb_work(struct work_struct *data)
{
int ret;
@@ -1232,6 +1273,17 @@ static int bq25890_probe(struct i2c_client *client,
goto battery_fail;
}
+ if (ship_mode) {
+ if (pm_power_off)
+ previous_pm_power_off = pm_power_off;
+ dev_info(bq->dev, "ship mode will be enabled");
+ bq25890_dev = bq;
+ pm_power_off = &bq25890_power_off;
+ } else {
+ dev_info(bq->dev, "ship mode not enabled");
+ }
+
+
return 0;
battery_fail:
@@ -1255,6 +1307,10 @@ static int bq25890_remove(struct i2c_client *client)
/* reset all registers to default values */
bq25890_chip_reset(bq);
+ if (pm_power_off == &bq25890_power_off)
+ /* restore previous pm_power_off */
+ pm_power_off = previous_pm_power_off;
+
return 0;
}
--
2.31.1

View file

@ -1,37 +0,0 @@
From 8d4a1c39146442252ac5666889eab7f0160779b0 Mon Sep 17 00:00:00 2001
From: Angus Ainslie <angus@akkea.ca>
Date: Sun, 25 Apr 2021 07:49:49 -0700
Subject: [PATCH] arm64: dts: imx8mq-librem5.dtsi: adjust the usdhc bus speeds
Limit the usdhc2 bus speed
Match usdhc1 and usdhs2 bus clocks
Signed-off-by: Angus Ainslie <angus@akkea.ca>
---
arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi b/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi
index b2345dd6cc17..8b3d310f976d 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi
@@ -1723,7 +1723,7 @@ mass-storage@1 {
&usdhc1 {
assigned-clocks = <&clk IMX8MQ_CLK_USDHC1>;
- assigned-clock-rates = <400000000>;
+ assigned-clock-rates = <200000000>;
pinctrl-names = "default", "state_100mhz", "state_200mhz";
pinctrl-0 = <&pinctrl_usdhc1>;
pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
@@ -1750,6 +1750,7 @@ &usdhc2 {
cap-sdio-irq;
keep-power-in-suspend;
wakeup-source;
+ max-frequency = <50000000>;
status = "okay";
};
--
2.31.1

View file

@ -1,27 +0,0 @@
From 009aee6922803a9f21fd7d003676ebbfcfb92f4b Mon Sep 17 00:00:00 2001
From: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Date: Thu, 30 Jul 2020 00:20:09 +0200
Subject: [PATCH] imx8mq-librem5-r3: Set the CPU voltage to 1.0V when running
at 1GHz on Dogwood
---
arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dts | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dts
index dda383ec81d3..e6c501f7f24c 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dts
@@ -103,3 +103,9 @@ MX8MQ_IOMUXC_UART4_TXD_GPIO5_IO29 0x83
&proximity {
proximity-near-level = <25>;
};
+
+&a53_opp_table {
+ opp-1000000000 {
+ opp-microvolt = <1000000>;
+ };
+};
--
2.31.1

View file

@ -2,8 +2,8 @@
# Maintainer: Clayton Craft <clayton@craftyguy.net>
# Co-Maintainer: Bhushan Shah <bshah@kde.org>
pkgname=linux-purism-librem5
pkgver=5.18.11
pkgrel=2
pkgver=6.0.0
pkgrel=0
_purismrel=1
# <kernel ver>.<purism kernel release>
_purismver=${pkgver}pureos$_purismrel
@ -18,6 +18,7 @@ options="!strip !check !tracedeps
pmb:kconfigcheck-community
"
makedepends="
bash
bison
devicepkg-dev
findutils
@ -35,11 +36,10 @@ install="$pkgname.post-upgrade"
_repository="linux"
# kconfig generated with: ARCH=arm64 make defconfig KBUILD_DEFCONFIG=librem5_defconfig
_config="config-$_flavor.$arch"
source="
$pkgname-$_purismver.tar.gz::https://source.puri.sm/Librem5/linux/-/archive/pureos/$_purismver/linux-pureos-$_purismver.tar.gz
0001-bq25890_charger-enter-ship-mode-on-power-off.patch
0002-arm64-dts-imx8mq-librem5.dtsi-adjust-the-usdhc-bus-s.patch
0003-imx8mq-librem5-r3-Set-the-CPU-voltage-to-1.0V-when-r.patch
$_config
"
builddir="$srcdir/$_repository-pureos-$_purismver"
@ -48,6 +48,10 @@ prepare() {
default_prepare
REPLACE_GCCH=0 \
. downstreamkernel_prepare
# NOTE: only for generating a config based on Purism's defconfig, for rebasing...
# make ARCH="$_carch" CC="${CC:-gcc}" \
# defconfig KBUILD_DEFCONFIG=librem5_defconfig
}
build() {
@ -79,9 +83,6 @@ dev() {
INSTALL_HDR_PATH="$subpkgdir"/usr
}
sha512sums="
9f4a001ebb47cf7a166fb1d479a773443480199319022d0b411eee072ebc27aa6fed6f455a818a23f1c58e95eca5e6052d27a814d9f77943578d812cbd32c0ca linux-purism-librem5-5.18.11pureos1.tar.gz
0e3caf6275247e31b874b94330dc4f991837a4b62f3c15a1f8ad39a7edd02ae499679bcd7ddc9463bb1c1a5073ea5980fa144a2ece804d72a6b2fc8c76c50766 0001-bq25890_charger-enter-ship-mode-on-power-off.patch
1dbf2adaf097bcce3ee179cd6b0f10d2ebefdc82191d34fffea8cb336c9dcbc66b717bf97a2e264b8068f178c0254f2b1281a09ae72d4825fd7b4a39916c0461 0002-arm64-dts-imx8mq-librem5.dtsi-adjust-the-usdhc-bus-s.patch
c52f9e7e17f876697000a0c3b959a0d571ca506ba55ee5158e30ac00e148372097c88951a354190f669137a955405c87042a925c1bbe3cd91df40721650d45d3 0003-imx8mq-librem5-r3-Set-the-CPU-voltage-to-1.0V-when-r.patch
0acd0a7380eeacdc94b2f7fc9e50b5fb70ad4008e7d3fbf68ab42f953e3f952d0173d75cd37283cd716768f5280a025a1279dd0213ea187059958351d4385f49 config-purism-librem5.aarch64
19a6bd83a9ea6f0330228e95dce63a2241867459f6377302b60d929d122f610375ce2c9ed8f4ee9d1a3cf16190fca056c0162dec1c1b3c6a077e7e3a3cf11e4e linux-purism-librem5-6.0.0pureos1.tar.gz
203a6b2dd6207b0d482e99f89c6125e3ccfca70b338696bde9a0a99cd34aa033a0a8f8d21cbd1df6a8865980cb1c56a0f2eec2e7aa7f02313142aa8559d4f6d6 config-purism-librem5.aarch64
"