more fix on p-board-h6-add-THS

This commit is contained in:
Martin Ayotte 2019-03-14 21:46:31 -04:00
parent f566841baf
commit 072a3dfe36

View file

@ -49,77 +49,6 @@ index b6f2d6b2ecae..2e97173c9204 100644
2.17.1
From 6bfc6aab9a9cd82578a7e782c83d04f4cf7fe6c4 Mon Sep 17 00:00:00 2001
From: Icenowy Zheng <icenowy@aosc.io>
Date: Fri, 27 Jul 2018 16:22:01 +0800
Subject: [PATCH 37/45] nvmem: sunxi-sid: add support for H6 SID
The SID controller in Allwinner H6 SoC is similar to the one in
Allwinner A64, except the size of the eFUSE is enlarged to 512 bytes
(4Kbit).
Add support for it.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
.../devicetree/bindings/nvmem/allwinner,sunxi-sid.txt | 1 +
drivers/nvmem/sunxi_sid.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index 1a8086476514..8e3c47c7c797 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -174,6 +174,11 @@
#interrupt-cells = <3>;
};
+ sid: efuse@3006000 {
+ compatible = "allwinner,sun50i-h6-sid";
+ reg = <0x03006000 0x1000>;
+ };
+
pio: pinctrl@300b000 {
compatible = "allwinner,sun50i-h6-pinctrl";
reg = <0x0300b000 0x400>;
--
2.17.1
From 8cdaf449f2936b608862b0a0175dd05fb52233b1 Mon Sep 17 00:00:00 2001
From: Icenowy Zheng <icenowy@aosc.io>
Date: Fri, 27 Jul 2018 17:34:35 +0800
Subject: [PATCH 39/45] nvmem: sunxi-sid: fix endian
The data in the SID is stored as little endian. However, when accessing
the SID via sunxi-sid driver, it converts little endian to big endian at
4 byte border. This makes addressing sub-4-byte items in the SID wrong.
Fix the endian by read out the SID 4-byte words as little endian, not
big endian.
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
drivers/nvmem/sunxi_sid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvmem/sunxi_sid.c b/drivers/nvmem/sunxi_sid.c
index fa58c3574afa..af30d62b1426 100644
--- a/drivers/nvmem/sunxi_sid.c
+++ b/drivers/nvmem/sunxi_sid.c
@@ -63,7 +63,7 @@ static u8 sunxi_sid_read_byte(const struct sunxi_sid *sid,
{
u32 sid_key;
- sid_key = ioread32be(sid->base + round_down(offset, 4));
+ sid_key = readl(sid->base + round_down(offset, 4));
sid_key >>= (offset % 4) * 8;
return sid_key; /* Only return the last byte */
--
2.17.1
From e7690d51c51dd6c97475bef2b207244d3a5f91b3 Mon Sep 17 00:00:00 2001
From: Icenowy Zheng <icenowy@aosc.io>
Date: Fri, 27 Jul 2018 16:18:35 +0800
@ -155,18 +84,6 @@ index 82979880f985..1b302248633a 100644
menu "Broadcom thermal drivers"
depends on ARCH_BCM || ARCH_BRCMSTB || ARCH_BCM2835 || COMPILE_TEST
source "drivers/thermal/broadcom/Kconfig"
diff --git a/drivers/thermal/Makefile b/drivers/thermal/Makefile
index 610344eb3e03..bdc5ba49f170 100644
--- a/drivers/thermal/Makefile
+++ b/drivers/thermal/Makefile
@@ -58,6 +58,7 @@ obj-$(CONFIG_QCOM_TSENS) += qcom/
obj-y += tegra/
obj-$(CONFIG_HISI_THERMAL) += hisi_thermal.o
obj-$(CONFIG_MTK_THERMAL) += mtk_thermal.o
+obj-$(CONFIG_SUN50I_H6_THS) += sun50i_h6_ths.o
obj-$(CONFIG_GENERIC_ADC_THERMAL) += thermal-generic-adc.o
obj-$(CONFIG_ZX2967_THERMAL) += zx2967_thermal.o
obj-$(CONFIG_UNIPHIER_THERMAL) += uniphier_thermal.o
diff --git a/drivers/thermal/sun50i_h6_ths.c b/drivers/thermal/sun50i_h6_ths.c
new file mode 100644
index 000000000000..ad3c5f3e47c7