Skip to contentSkip to conversation

arm64: Add LECARC ACPI IDs for DesignWare GPIO, SPI, I2C

PATCH In review Thomas Lin 5 participants 11 messages May 20 – Jun 5

Subsystems (7)
lore
Share & tools
lore

Thomas Lin

author
#0 lore raw

v4 cover arm64: Add LECARC ACPI IDs for DesignWare GPIO, SPI, I2C

This patch series adds ACPI identification for LECARC SoCs that integrate Synopsys DesignWare peripherals.

LECARC platforms use the following ACPI HIDs:

GPIO: LECA0001 (V1 register offsets)

SPI: LECA0002 (requires custom init function)

I2C: LECA0003

The patches are independent but share a common dependency on the ACPI description file (acpi_apd.c) for SPI and I2C. To avoid merge conflicts, they are submitted as a single series with the following order:

Patch 1: GPIO – add LECA0001 to dwapb_gpio ACPI match table. Patch 2: SPI – add LECA0002 and dw_spi_lecarc_init() to spi-dw-mmio, plus corresponding entry in acpi_apd.c.
Patch 3: I2C – add LECA0003 to DesignWare I2C ACPI match table, plus corresponding entry in acpi_apd.c.

All changes have been tested on LECARC evaluation board with kernel v7.0.0-rc7. No regressions observed on existing hardware.

Changes since v1:

- Revised subject lines to match subsystem style guidelines
- No functional changes
- All the comments from reviews has been fixed

Changes since v2:
- Wrap long commit description lines to 72 columns
- Fix code indentation in spi-dw-mmio.c: use tabs + spaces for alignment
- No functional changes

Changes since v3:
- Start a new thread for each revision

Thomas Lin (3):
gpio: dwapb: Add ACPI ID LECA0001 for LECARC SoCs
spi: dw-mmio: Add ACPI ID LECA0002 for LECARC SoCs
i2c: designware: Add ACPI ID LECA0003 for LECARC SoCs

 drivers/acpi/acpi_apd.c                     | 13 +++++++++++++
 drivers/gpio/gpio-dwapb.c                   |  1 +
 drivers/i2c/busses/i2c-designware-platdrv.c |  1 +
 drivers/spi/spi-dw-mmio.c                   |  7 ++++---
 4 files changed, 19 insertions(+), 3 deletions(-)
Signature · 1 line
2.43.0
author
#1 lore raw

PATCH v4 1/3 gpio: dwapb: Add ACPI ID LECA0001 for LECARC SoCs

Add ACPI ID "LECA0001" for LECARC SoCs that use the DesignWare GPIO controller with V1 register offsets.

---
 drivers/gpio/gpio-dwapb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpio-dwapb.c +1 -0
index 15cebc8b5d66..c1f3d83a67c1 100644
@@ -694,6 +694,7 @@ static const struct acpi_device_id dwapb_acpi_match[] = {
 	{"APMC0D07", GPIO_REG_OFFSET_V1},
 	{"APMC0D81", GPIO_REG_OFFSET_V2},
 	{"FUJI200A", GPIO_REG_OFFSET_V1},
+	{"LECA0001", GPIO_REG_OFFSET_V1},
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, dwapb_acpi_match);
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH v4 1/3] gpio: dwapb: Add ACPI ID LECA0001 for LECARC SoCs

Quoted 24 lines · Thomas Lin

Add ACPI ID "LECA0001" for LECARC SoCs that use the DesignWare GPIO controller with V1 register offsets.

---
 drivers/gpio/gpio-dwapb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpio-dwapb.c +1 -1
index 15cebc8b5d66..c1f3d83a67c1 100644
@@ -694,6 +694,7 @@ static const struct acpi_device_id dwapb_acpi_match[] = {
        {"APMC0D07", GPIO_REG_OFFSET_V1},
        {"APMC0D81", GPIO_REG_OFFSET_V2},
        {"FUJI200A", GPIO_REG_OFFSET_V1},
+       {"LECA0001", GPIO_REG_OFFSET_V1},
        { }
 };
 MODULE_DEVICE_TABLE(acpi, dwapb_acpi_match);
--
Quoted 2 lines

2.43.0

I'm not sure about how to interpret the cover letter - is it fine to take this independently through the GPIO tree for v7.2?

Bart

maintainer
#3 lore raw

Re: [PATCH v4 1/3] gpio: dwapb: Add ACPI ID LECA0001 for LECARC SoCs

Quoted 2 lines · Bartosz Golaszewski

I'm not sure about how to interpret the cover letter - is it fine to take this independently through the GPIO tree for v7.2?

AFAICT any dependency that exists is runtime only, it's just a bunch of quirks and none of the patches touch header files.

#4 lore raw

Re: [PATCH v4 1/3] gpio: dwapb: Add ACPI ID LECA0001 for LECARC SoCs

Quoted 7 lines · Mark Brown
Quoted 2 lines · Bartosz Golaszewski

I'm not sure about how to interpret the cover letter - is it fine to take this independently through the GPIO tree for v7.2?

AFAICT any dependency that exists is runtime only, it's just a bunch of quirks and none of the patches touch header files.

Patch 3 depends on patch 2. So, maybe it can go all in via GPIO?

maintainer
#5 lore raw

Re: [PATCH v4 1/3] gpio: dwapb: Add ACPI ID LECA0001 for LECARC SoCs

Quoted 6 lines · Wolfram Sang
Quoted 2 lines · Mark Brown

AFAICT any dependency that exists is runtime only, it's just a bunch of quirks and none of the patches touch header files.

Patch 3 depends on patch 2. So, maybe it can go all in via GPIO?

Oh, right - you'd end up with a trivial add/add conflict.

author
#6 lore raw

PATCH v4 2/3 spi: dw-mmio: Add ACPI ID LECA0002 for LECARC SoCs

In reply to Thomas Lin

This ID requires a custom initialization function dw_spi_hssi_no_dma_init() that sets dws->dws.ip to DW_HSSI_ID.

---
 drivers/acpi/acpi_apd.c   | 7 +++++++
 drivers/spi/spi-dw-mmio.c | 7 ++++---
 2 files changed, 11 insertions(+), 3 deletions(-)
drivers/acpi/acpi_apd.c +7 -0
index bed0791c17fc..4d5a51d30adc 100644
@@ -181,6 +181,12 @@ static const struct apd_device_desc hip08_spi_desc = {
 	.setup = acpi_apd_setup,
 	.fixed_clk_rate = 250000000,
 };
+
+static const struct apd_device_desc leca_spi_desc = {
+	.setup = acpi_apd_setup,
+	.fixed_clk_rate = 400000000,
+};
+
 #endif /* CONFIG_ARM64 */
 
 #endif
@@ -251,6 +257,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
 	{ "HISI02A2", APD_ADDR(hip08_i2c_desc) },
 	{ "HISI02A3", APD_ADDR(hip08_lite_i2c_desc) },
 	{ "HISI0173", APD_ADDR(hip08_spi_desc) },
+	{ "LECA0002", APD_ADDR(leca_spi_desc) },
 	{ "NXP0001", APD_ADDR(nxp_i2c_desc) },
 #endif
 	{ }
drivers/spi/spi-dw-mmio.c +4 -3
index 1bfdf24c3227..4fc864d38cff 100644
@@ -226,8 +226,8 @@ static int dw_spi_hssi_init(struct platform_device *pdev,
 	return 0;
 }
 
-static int dw_spi_intel_init(struct platform_device *pdev,
-			     struct dw_spi_mmio *dwsmmio)
+static int dw_spi_hssi_no_dma_init(struct platform_device *pdev,
+				   struct dw_spi_mmio *dwsmmio)
 {
 	dwsmmio->dws.ip = DW_HSSI_ID;
 
@@ -438,7 +438,7 @@ static const struct of_device_id dw_spi_mmio_of_match[] = {
 	{ .compatible = "amazon,alpine-dw-apb-ssi", .data = dw_spi_alpine_init},
 	{ .compatible = "renesas,rzn1-spi", .data = dw_spi_pssi_init},
 	{ .compatible = "snps,dwc-ssi-1.01a", .data = dw_spi_hssi_init},
-	{ .compatible = "intel,keembay-ssi", .data = dw_spi_intel_init},
+	{ .compatible = "intel,keembay-ssi", .data = dw_spi_hssi_no_dma_init},
 	{
 		.compatible = "intel,mountevans-imc-ssi",
 		.data = dw_spi_mountevans_imc_init,
@@ -453,6 +453,7 @@ MODULE_DEVICE_TABLE(of, dw_spi_mmio_of_match);
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id dw_spi_mmio_acpi_match[] = {
 	{"HISI0173", (kernel_ulong_t)dw_spi_pssi_init},
+	{"LECA0002", (kernel_ulong_t)dw_spi_hssi_no_dma_init},
 	{},
 };
 MODULE_DEVICE_TABLE(acpi, dw_spi_mmio_acpi_match);
Signature · 1 line
2.43.0
maintainer Acked-by on v4 2/3
#7 lore raw

Re: [PATCH v4 2/3] spi: dw-mmio: Add ACPI ID LECA0002 for LECARC SoCs

Quoted 2 lines · Thomas Lin

This ID requires a custom initialization function dw_spi_hssi_no_dma_init() that sets dws->dws.ip to DW_HSSI_ID.

author
#8 lore raw

PATCH v4 3/3 i2c: designware: Add ACPI ID LECA0003 for LECARC SoCs

In reply to Thomas Lin

Add ACPI ID "LECA0003" for LECARC SoCs that integrate the DesignWare I2C controller.
Also add corresponding ACPI description in acpi_apd.c.

---
 drivers/acpi/acpi_apd.c                     | 6 ++++++
 drivers/i2c/busses/i2c-designware-platdrv.c | 1 +
 2 files changed, 7 insertions(+)
drivers/acpi/acpi_apd.c +6 -0
index 4d5a51d30adc..008bd0552cb7 100644
@@ -187,6 +187,11 @@ static const struct apd_device_desc leca_spi_desc = {
 	.fixed_clk_rate = 400000000,
 };
 
+static const struct apd_device_desc leca_i2c_desc = {
+	.setup = acpi_apd_setup,
+	.fixed_clk_rate = 250000000,
+};
+
 #endif /* CONFIG_ARM64 */
 
 #endif
@@ -258,6 +263,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
 	{ "HISI02A3", APD_ADDR(hip08_lite_i2c_desc) },
 	{ "HISI0173", APD_ADDR(hip08_spi_desc) },
 	{ "LECA0002", APD_ADDR(leca_spi_desc) },
+	{ "LECA0003", APD_ADDR(leca_i2c_desc) },
 	{ "NXP0001", APD_ADDR(nxp_i2c_desc) },
 #endif
 	{ }
drivers/i2c/busses/i2c-designware-platdrv.c +1 -0
index 3351c4a9ef11..b435b4015f02 100644
@@ -279,6 +279,7 @@ static const struct acpi_device_id dw_i2c_acpi_match[] = {
 	{ "INT3432", 0 },
 	{ "INT3433", 0 },
 	{ "INTC10EF", 0 },
+	{ "LECA0003", 0 },
 	{}
 };
 MODULE_DEVICE_TABLE(acpi, dw_i2c_acpi_match);
Signature · 1 line
2.43.0
Acked-by on v4 3/3
#9 lore raw

Re: [PATCH v4 3/3] i2c: designware: Add ACPI ID LECA0003 for LECARC SoCs

Quoted 7 lines · Thomas Lin

Add ACPI ID "LECA0003" for LECARC SoCs that integrate the DesignWare I2C controller.
Also add corresponding ACPI description in acpi_apd.c.

Because of the dependency, it should probably go in via GPIO or SPI, right? So:

maintainer Reviewed-by on v4 3/3
#10 lore raw

Re: [PATCH v4 3/3] i2c: designware: Add ACPI ID LECA0003 for LECARC SoCs

In reply to Thomas Lin

Hi Thomas,

Quoted 7 lines · Thomas Lin

Add ACPI ID "LECA0003" for LECARC SoCs that integrate the DesignWare I2C controller.
Also add corresponding ACPI description in acpi_apd.c.

I'm OK for this to go through GPIO.

Andi