iot-gate-imx8: release 3.2.2

Signed-off-by: Kirill Kapranov <kirill.kapranov@compulab.co.il>
This commit is contained in:
Kirill Kapranov
2023-10-11 20:39:31 +00:00
parent e1bf1726f1
commit 341cc6e991
4 changed files with 149 additions and 0 deletions
+3
View File
@@ -106,5 +106,8 @@ SRC_URI:append = " \
file://0105-iot-gate-imx8-defconfig-Trivial-typo-fix.patch \
file://0106-Kconfig-fix-DEBUG_KERNEL-option.patch \
file://0107-defconfig-net-wireless-enable-ath10k.patch \
file://0108-rtc-abx80-fix-false-fail-caused-by-osc-glitch.patch \
file://0109-iot-gate-imx8-dts-free-gpio_rs485_trm.patch \
file://0110-iot-gate-imx8-release-3.2.2.patch \
file://defconfig \
"
@@ -0,0 +1,81 @@
From 4a8bb39252bfa5d4c2b942d3994e9fec11c2d0aa Mon Sep 17 00:00:00 2001
From: Kirill Kapranov <kirill.kapranov@compulab.co.il>
Date: Thu, 5 Oct 2023 22:09:50 +0000
Subject: [PATCH 108/109] rtc:abx80: fix false fail caused by osc glitch
Signed-off-by: Kirill Kapranov <kirill.kapranov@compulab.co.il>
---
drivers/rtc/rtc-abx80x.c | 43 ++++++++++++++++++++++++----------------
1 file changed, 26 insertions(+), 17 deletions(-)
diff --git a/drivers/rtc/rtc-abx80x.c b/drivers/rtc/rtc-abx80x.c
index a6c40d7b7083..f60aa6ab55cd 100644
--- a/drivers/rtc/rtc-abx80x.c
+++ b/drivers/rtc/rtc-abx80x.c
@@ -184,22 +184,6 @@ static int abx80x_rtc_read_time(struct device *dev, struct rtc_time *tm)
unsigned char buf[8];
int err, flags, rc_mode = 0;
- /* Read the Oscillator Failure only in XT mode */
- rc_mode = abx80x_is_rc_mode(client);
- if (rc_mode < 0)
- return rc_mode;
-
- if (!rc_mode) {
- flags = i2c_smbus_read_byte_data(client, ABX8XX_REG_OSS);
- if (flags < 0)
- return flags;
-
- if (flags & ABX8XX_OSS_OF) {
- dev_err(dev, "Oscillator failure, data is invalid.\n");
- return -EINVAL;
- }
- }
-
err = i2c_smbus_read_i2c_block_data(client, ABX8XX_REG_HTH,
sizeof(buf), buf);
if (err < 0) {
@@ -214,6 +198,31 @@ static int abx80x_rtc_read_time(struct device *dev, struct rtc_time *tm)
tm->tm_mday = bcd2bin(buf[ABX8XX_REG_DA] & 0x3F);
tm->tm_mon = bcd2bin(buf[ABX8XX_REG_MO] & 0x1F) - 1;
tm->tm_year = bcd2bin(buf[ABX8XX_REG_YR]) + 100;
+
+ /* Read the Oscillator Failure only in XT mode */
+ rc_mode = abx80x_is_rc_mode(client);
+ if (rc_mode < 0)
+ return rc_mode;
+/* Compare the year value against this for data sanity check.
+ * In case of the battery goes flat, the year counter drops to 0x00 (tm_year = 100),
+ * whereas in case of oscillator glitch the year shall be over 2022
+ */
+#define YEAR_2022 122
+ if (!rc_mode) {
+ flags = i2c_smbus_read_byte_data(client, ABX8XX_REG_OSS);
+ if (flags < 0)
+ return flags;
+
+ if (flags & ABX8XX_OSS_OF) {
+ if (YEAR_2022 > tm->tm_year) {
+ dev_err(dev, "Oscillator failure, data is invalid.\n");
+ return -EINVAL;
+ }
+ else {
+ dev_warn(dev, "Failure flag set, data may be invalid.\n");
+ }
+ }
+ }
return 0;
}
@@ -1132,7 +1141,7 @@ static int abx80x_probe(struct i2c_client *client,
return err;
}
else
- dev_err(&client->dev, "CCCCreate sysfs group: %d\n", 0);
+ dev_err(&client->dev, "Create sysfs group: %d\n", 0);
return devm_rtc_register_device(priv->rtc);
}
--
2.34.1
@@ -0,0 +1,42 @@
From 4e003da755dc20fdf67a265bf9b3278ffad4d5d5 Mon Sep 17 00:00:00 2001
From: Kirill Kapranov <kirill.kapranov@compulab.co.il>
Date: Wed, 11 Oct 2023 19:57:19 +0000
Subject: [PATCH 109/109] iot-gate-imx8:dts: free gpio_rs485_trm
Delete fake regulator nodes to make these GPIOs available from userspace
Signed-off-by: Kirill Kapranov <kirill.kapranov@compulab.co.il>
---
arch/arm64/boot/dts/compulab/sb-iotgimx8-ied.dts | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/arch/arm64/boot/dts/compulab/sb-iotgimx8-ied.dts b/arch/arm64/boot/dts/compulab/sb-iotgimx8-ied.dts
index 26d983fa925a..dcdf031e7dc2 100644
--- a/arch/arm64/boot/dts/compulab/sb-iotgimx8-ied.dts
+++ b/arch/arm64/boot/dts/compulab/sb-iotgimx8-ied.dts
@@ -32,22 +32,6 @@ clk40m: clk@1 {
};
};
- regulator-uart2-trm {
- compatible = "regulator-fixed";
- regulator-name = "uart2-trm";
- gpio = <&gpio5 12 GPIO_ACTIVE_LOW>;
- regulator-always-on;
- enable-active-low;
- };
-
- regulator-uart4-trm {
- compatible = "regulator-fixed";
- regulator-name = "uart4-trm";
- gpio = <&gpio5 24 GPIO_ACTIVE_LOW>;
- regulator-always-on;
- enable-active-low;
- };
-
regulatot-tpm0-rst {
compatible = "regulator-fixed";
regulator-name = "tpm0-rst";
--
2.34.1
@@ -0,0 +1,23 @@
From 39b89a30ebbcfab53168e482a54eb0a700c2ec57 Mon Sep 17 00:00:00 2001
From: Kirill Kapranov <kirill.kapranov@compulab.co.il>
Date: Wed, 7 Jun 2023 20:50:50 +0300
Subject: [PATCH 110/110] iot-gate-imx8: release 3.2.1
Signed-off-by: Kirill Kapranov <kirill.kapranov@compulab.co.il>
---
arch/arm64/configs/iot-gate-imx8.config | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/configs/iot-gate-imx8.config b/arch/arm64/configs/iot-gate-imx8.config
index b852b18e74c3..f80f319d95cc 100644
--- a/arch/arm64/configs/iot-gate-imx8.config
+++ b/arch/arm64/configs/iot-gate-imx8.config
@@ -1,4 +1,4 @@
-CONFIG_LOCALVERSION="-iot-gate-imx8m-3.2.1"
+CONFIG_LOCALVERSION="-iot-gate-imx8m-3.2.2"
CONFIG_LOCALVERSION_AUTO=n
CONFIG_BT_BCM=n
CONFIG_BT_HCIBTUSB_BCM=n
--
2.17.1