This patch series implements probing the s3c24xx i2c bus device from ACPI tables.
I have included an update to the DSDT for the correct information for I2C0 which is the port connected to the PMIC so is easy to test with i2c tools.
On boot I can successfully communicate with the slave at 0x66 on this bus.
root@arndale:~# i2cdump -f -y 0 0x66 No size specified (using byte-data access) 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 00: 03 00 00 00 c0 78 00 01 17 07 01 0e e5 85 4f de ?...?x.???????O? 10: 03 03 03 23 23 23 23 23 23 23 23 23 23 23 23 23 ???############# 20: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 00 ###############. 30: 00 45 d9 38 fa 34 00 50 50 50 50 50 50 db 40 00 .E?8?4.PPPPPP?@. 40: 40 40 40 40 40 40 3a 40 00 40 40 40 40 40 40 d9 @@@@@@:@.@@@@@@? 50: 58 70 88 b8 18 58 d8 68 d8 30 98 a8 cc d0 16 1c Xp???X?h?0?????? 60: 28 d4 d4 d4 cc cc c8 2c d4 d4 ec d4 d4 c8 d4 e8 (??????,???????? 70: 28 2c 2c 2c 32 28 2c 08 14 14 14 00 00 00 00 00 (,,,2(,????..... 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ e0: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?............... f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
can see the correct IRQ allocated
root@arndale:~# cat /proc/interrupts CPU0 CPU1 29: 0 0 GIC arch_timer 30: 24177 6574 GIC arch_timer 66: 0 0 GIC dma-pl330.0 67: 0 0 GIC dma-pl330.1 85: 538 0 GIC exynos4210-uart.2 88: 1024 0 GIC LINA0001:00 97: 0 0 GIC exynos-tmu 103: 11813 0 GIC ehci_hcd:usb1, ohci_hcd:usb2 104: 0 0 GIC xhci-hcd:usb3 107: 432 0 GIC dw-mci 109: 67422 0 GIC dw-mci 126: 0 0 GIC drm_mixer 152: 0 0 GIC mct_tick0_irq 153: 0 0 GIC mct_tick1_irq 156: 0 0 GIC dma-pl330.2 347: 0 0 COMBINER mct_comp_irq IPI0: 0 1 CPU wakeup interrupts IPI1: 0 0 Timer broadcast interrupts IPI2: 5233 6766 Rescheduling interrupts IPI3: 0 0 Function call interrupts IPI4: 98 44 Single function call interrupts IPI5: 0 0 CPU stop interrupts IPI6: 0 0 CPU backtrace Err: 0
and can see the correct GPIO allocated.
GPIOs 42-45, GPB3: gpio-42 (i2c-bus ) in hi gpio-43 (i2c-bus ) in hi
The GPIO allocation is not how it would be in a final implementation as similar to FDT the GPIO providers (like GIC) can be hierachical so you would normally use the device name + offset to locate the correct GPIO. This is very similar to how it works in FDT as well.
Thanks
Graeme
From: Graeme Gregory graeme.gregory@linaro.org
Add prototype ACPI probing for this driver. It fetches resources required by probe from the ACPI tables.
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org --- drivers/i2c/busses/i2c-s3c2410.c | 167 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 162 insertions(+), 5 deletions(-)
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 580199c..845a2fe 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -38,6 +38,7 @@ #include <linux/io.h> #include <linux/of_i2c.h> #include <linux/of_gpio.h> +#include <linux/acpi.h> #include <linux/pinctrl/consumer.h>
#include <asm/irq.h> @@ -123,6 +124,14 @@ static const struct of_device_id s3c24xx_i2c_match[] = { MODULE_DEVICE_TABLE(of, s3c24xx_i2c_match); #endif
+#ifdef CONFIG_ACPI +static const struct acpi_device_id s3c24xx_i2c_acpi_match[] = { + { "LINA0001", }, + { } +}; +MODULE_DEVICE_TABLE(acpi, s3c24xx_i2c_acpi_match); +#endif + /* s3c24xx_get_device_quirks * * Get controller type either from device tree or platform device variant. @@ -130,12 +139,22 @@ MODULE_DEVICE_TABLE(of, s3c24xx_i2c_match);
static inline unsigned int s3c24xx_get_device_quirks(struct platform_device *pdev) { + struct acpi_handle *dev_handle; + struct acpi_device_id const *dev_id; + + dev_handle = ACPI_HANDLE(&pdev->dev); + if (pdev->dev.of_node) { const struct of_device_id *match; match = of_match_node(s3c24xx_i2c_match, pdev->dev.of_node); return (unsigned int)match->data; }
+ if (dev_handle) { + dev_id = acpi_match_device(s3c24xx_i2c_acpi_match, &pdev->dev); + return (unsigned int)dev_id->driver_data; + } + return platform_get_device_id(pdev)->driver_data; }
@@ -946,6 +965,107 @@ static void s3c24xx_i2c_dt_gpio_free(struct s3c24xx_i2c *i2c) } #endif
+#ifdef CONFIG_ACPI +/* + * ACPI resource callback + */ +static acpi_status +s3c24xx_i2c_acpi_resource(struct acpi_resource *resource, void *context) +{ + u32 i; + struct s3c24xx_i2c *i2c = context; + + switch (resource->type) { + case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: + /* IRQ resources have already been read */ + return AE_OK; + + case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: + /* Mem resources have already been read */ + return AE_OK; + + case ACPI_RESOURCE_TYPE_GPIO: + { + struct acpi_resource_gpio *p = &resource->data.gpio; + + if (p->pin_table_length != 2) { + dev_err(i2c->dev, "2 GPIOS required in resource\n"); + return AE_OK; + } + + for (i = 0; i < p->pin_table_length; i++) + i2c->gpios[i] = p->pin_table[i]; + + return AE_OK; + } + default: + dev_info(i2c->dev, "Resource %d isn't MMIO, IRQ or GPIO\n", + resource->type); + + case ACPI_RESOURCE_TYPE_END_TAG: + return AE_OK; + } + return AE_CTRL_TERMINATE; +} + +static int s3c24xx_i2c_parse_acpi_gpio(struct s3c24xx_i2c *i2c) +{ + int idx, gpio, ret; + struct acpi_handle *dev_handle = ACPI_HANDLE(i2c->dev); + + if (i2c->quirks & QUIRK_NO_GPIO) + return 0; + + ret = acpi_walk_resources(dev_handle, METHOD_NAME__CRS, + s3c24xx_i2c_acpi_resource, i2c); + if (ACPI_FAILURE(ret)) { + pr_warn("Failure evaluating %s\n", METHOD_NAME__CRS); + return -EINVAL; + } + + for (idx = 0; idx < 2; idx++) { + gpio = i2c->gpios[idx]; + if (!gpio_is_valid(gpio)) { + dev_err(i2c->dev, "invalid gpio[%d]: %d\n", idx, gpio); + goto free_gpio; + } + i2c->gpios[idx] = gpio; + + ret = gpio_request(gpio, "i2c-bus"); + if (ret) { + dev_err(i2c->dev, "gpio [%d] request failed\n", gpio); + goto free_gpio; + } + } + return 0; + +free_gpio: + while (--idx >= 0) + gpio_free(i2c->gpios[idx]); + return -EINVAL; +} + +static void s3c24xx_i2c_acpi_gpio_free(struct s3c24xx_i2c *i2c) +{ + unsigned int idx; + + if (i2c->quirks & QUIRK_NO_GPIO) + return; + + for (idx = 0; idx < 2; idx++) + gpio_free(i2c->gpios[idx]); +} +#else +static int s3c24xx_i2c_parse_acpi_gpio(struct s3c24xx_i2c *i2c) +{ + return 0; +} + +static void s3c24xx_i2c_acpi_gpio_free(struct s3c24xx_i2c *i2c) +{ +} +#endif + /* s3c24xx_i2c_init * * initialise the controller, set the IO lines and frequency @@ -1013,6 +1133,27 @@ s3c24xx_i2c_parse_dt(struct device_node *np, struct s3c24xx_i2c *i2c) } #endif
+#ifdef CONFIG_ACPI +/* s3c24xx_i2c_parse_acpi + * + * Parse the device tree node and retreive the platform data. +*/ + +static void +s3c24xx_i2c_parse_acpi(struct device *device, struct s3c24xx_i2c *i2c) +{ + struct s3c2410_platform_i2c *pdata = i2c->pdata; + + pdata->bus_num = -1; /* i2c bus number is dynamically assigned */ +} +#else +static void +s3c24xx_i2c_parse_acpi(struct device_node *np, struct s3c24xx_i2c *i2c) +{ + return; +} +#endif + /* s3c24xx_i2c_probe * * called by the bus driver when a suitable device is found @@ -1023,9 +1164,12 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) struct s3c24xx_i2c *i2c; struct s3c2410_platform_i2c *pdata = NULL; struct resource *res; + struct acpi_handle *dev_handle; int ret;
- if (!pdev->dev.of_node) { + dev_handle = DEVICE_ACPI_HANDLE(&pdev->dev); + + if (!pdev->dev.of_node && !dev_handle) { pdata = pdev->dev.platform_data; if (!pdata) { dev_err(&pdev->dev, "no platform data\n"); @@ -1046,10 +1190,14 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) }
i2c->quirks = s3c24xx_get_device_quirks(pdev); - if (pdata) + if (pdata) { memcpy(i2c->pdata, pdata, sizeof(*pdata)); - else - s3c24xx_i2c_parse_dt(pdev->dev.of_node, i2c); + } else { + if (pdev->dev.of_node) + s3c24xx_i2c_parse_dt(pdev->dev.of_node, i2c); + if (dev_handle) + s3c24xx_i2c_parse_acpi(&pdev->dev, i2c); + }
strlcpy(i2c->adap.name, "s3c2410-i2c", sizeof(i2c->adap.name)); i2c->adap.owner = THIS_MODULE; @@ -1071,7 +1219,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
dev_dbg(&pdev->dev, "clock source %p\n", i2c->clk);
- /* map the registers */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -1099,6 +1246,8 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
if (i2c->pdata->cfg_gpio) { i2c->pdata->cfg_gpio(to_platform_device(i2c->dev)); + } else if (dev_handle) { + s3c24xx_i2c_parse_acpi_gpio(i2c); } else if (IS_ERR(i2c->pctrl) && s3c24xx_i2c_parse_dt_gpio(i2c)) { return -EINVAL; } @@ -1172,6 +1321,9 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) static int s3c24xx_i2c_remove(struct platform_device *pdev) { struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev); + struct acpi_handle *dev_handle; + + dev_handle = DEVICE_ACPI_HANDLE(&pdev->dev);
pm_runtime_disable(&i2c->adap.dev); pm_runtime_disable(&pdev->dev); @@ -1182,9 +1334,13 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)
clk_disable_unprepare(i2c->clk);
+ if (pdev->dev.of_node && IS_ERR(i2c->pctrl)) s3c24xx_i2c_dt_gpio_free(i2c);
+ if (dev_handle) + s3c24xx_i2c_acpi_gpio_free(i2c); + return 0; }
@@ -1237,6 +1393,7 @@ static struct platform_driver s3c24xx_i2c_driver = { .name = "s3c-i2c", .pm = S3C24XX_DEV_PM_OPS, .of_match_table = of_match_ptr(s3c24xx_i2c_match), + .acpi_match_table = ACPI_PTR(s3c24xx_i2c_acpi_match), }, };
Graeme,
very nice patch, very clear, it turns out to be also the first excellent example documenting how to add ACPI support alongside FDT support for all developers! Shall we copy-paste few excerpts into the ACPI wiki page maybe?
I was about to ask one silly question of mine in the code below but found the answer myself by reading the code itself!
thanks!
Andrea
On 27 May 2013 17:40, Graeme Gregory graeme.gregory@linaro.org wrote:
From: Graeme Gregory graeme.gregory@linaro.org
Add prototype ACPI probing for this driver. It fetches resources required by probe from the ACPI tables.
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org
drivers/i2c/busses/i2c-s3c2410.c | 167 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 162 insertions(+), 5 deletions(-)
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 580199c..845a2fe 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -38,6 +38,7 @@ #include <linux/io.h> #include <linux/of_i2c.h> #include <linux/of_gpio.h> +#include <linux/acpi.h> #include <linux/pinctrl/consumer.h>
#include <asm/irq.h> @@ -123,6 +124,14 @@ static const struct of_device_id s3c24xx_i2c_match[] = { MODULE_DEVICE_TABLE(of, s3c24xx_i2c_match); #endif
+#ifdef CONFIG_ACPI +static const struct acpi_device_id s3c24xx_i2c_acpi_match[] = {
{ "LINA0001", },
{ }
+}; +MODULE_DEVICE_TABLE(acpi, s3c24xx_i2c_acpi_match); +#endif
/* s3c24xx_get_device_quirks
- Get controller type either from device tree or platform device variant.
@@ -130,12 +139,22 @@ MODULE_DEVICE_TABLE(of, s3c24xx_i2c_match);
static inline unsigned int s3c24xx_get_device_quirks(struct platform_device *pdev) {
struct acpi_handle *dev_handle;
struct acpi_device_id const *dev_id;
dev_handle = ACPI_HANDLE(&pdev->dev);
if (pdev->dev.of_node) { const struct of_device_id *match; match = of_match_node(s3c24xx_i2c_match, pdev->dev.of_node); return (unsigned int)match->data; }
if (dev_handle) {
dev_id = acpi_match_device(s3c24xx_i2c_acpi_match, &pdev->dev);
return (unsigned int)dev_id->driver_data;
}
return platform_get_device_id(pdev)->driver_data;
}
@@ -946,6 +965,107 @@ static void s3c24xx_i2c_dt_gpio_free(struct s3c24xx_i2c *i2c) } #endif
+#ifdef CONFIG_ACPI +/*
- ACPI resource callback
- */
+static acpi_status +s3c24xx_i2c_acpi_resource(struct acpi_resource *resource, void *context) +{
u32 i;
struct s3c24xx_i2c *i2c = context;
switch (resource->type) {
case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
/* IRQ resources have already been read */
return AE_OK;
case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
/* Mem resources have already been read */
return AE_OK;
case ACPI_RESOURCE_TYPE_GPIO:
{
struct acpi_resource_gpio *p = &resource->data.gpio;
if (p->pin_table_length != 2) {
dev_err(i2c->dev, "2 GPIOS required in resource\n");
return AE_OK;
}
for (i = 0; i < p->pin_table_length; i++)
i2c->gpios[i] = p->pin_table[i];
return AE_OK;
}
default:
dev_info(i2c->dev, "Resource %d isn't MMIO, IRQ or GPIO\n",
resource->type);
case ACPI_RESOURCE_TYPE_END_TAG:
return AE_OK;
}
return AE_CTRL_TERMINATE;
+}
+static int s3c24xx_i2c_parse_acpi_gpio(struct s3c24xx_i2c *i2c) +{
int idx, gpio, ret;
struct acpi_handle *dev_handle = ACPI_HANDLE(i2c->dev);
if (i2c->quirks & QUIRK_NO_GPIO)
return 0;
ret = acpi_walk_resources(dev_handle, METHOD_NAME__CRS,
s3c24xx_i2c_acpi_resource, i2c);
if (ACPI_FAILURE(ret)) {
pr_warn("Failure evaluating %s\n", METHOD_NAME__CRS);
return -EINVAL;
}
for (idx = 0; idx < 2; idx++) {
gpio = i2c->gpios[idx];
if (!gpio_is_valid(gpio)) {
dev_err(i2c->dev, "invalid gpio[%d]: %d\n", idx, gpio);
goto free_gpio;
}
i2c->gpios[idx] = gpio;
ret = gpio_request(gpio, "i2c-bus");
if (ret) {
dev_err(i2c->dev, "gpio [%d] request failed\n", gpio);
goto free_gpio;
}
}
return 0;
+free_gpio:
while (--idx >= 0)
gpio_free(i2c->gpios[idx]);
return -EINVAL;
+}
+static void s3c24xx_i2c_acpi_gpio_free(struct s3c24xx_i2c *i2c) +{
unsigned int idx;
if (i2c->quirks & QUIRK_NO_GPIO)
return;
for (idx = 0; idx < 2; idx++)
gpio_free(i2c->gpios[idx]);
+} +#else +static int s3c24xx_i2c_parse_acpi_gpio(struct s3c24xx_i2c *i2c) +{
return 0;
+}
+static void s3c24xx_i2c_acpi_gpio_free(struct s3c24xx_i2c *i2c) +{ +} +#endif
/* s3c24xx_i2c_init
- initialise the controller, set the IO lines and frequency
@@ -1013,6 +1133,27 @@ s3c24xx_i2c_parse_dt(struct device_node *np, struct s3c24xx_i2c *i2c) } #endif
+#ifdef CONFIG_ACPI +/* s3c24xx_i2c_parse_acpi
- Parse the device tree node and retreive the platform data.
+*/
+static void +s3c24xx_i2c_parse_acpi(struct device *device, struct s3c24xx_i2c *i2c) +{
struct s3c2410_platform_i2c *pdata = i2c->pdata;
pdata->bus_num = -1; /* i2c bus number is dynamically assigned */
+} +#else +static void +s3c24xx_i2c_parse_acpi(struct device_node *np, struct s3c24xx_i2c *i2c) +{
return;
+} +#endif
/* s3c24xx_i2c_probe
- called by the bus driver when a suitable device is found
@@ -1023,9 +1164,12 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) struct s3c24xx_i2c *i2c; struct s3c2410_platform_i2c *pdata = NULL; struct resource *res;
struct acpi_handle *dev_handle; int ret;
if (!pdev->dev.of_node) {
dev_handle = DEVICE_ACPI_HANDLE(&pdev->dev);
if (!pdev->dev.of_node && !dev_handle) { pdata = pdev->dev.platform_data; if (!pdata) { dev_err(&pdev->dev, "no platform data\n");
@@ -1046,10 +1190,14 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) }
i2c->quirks = s3c24xx_get_device_quirks(pdev);
if (pdata)
if (pdata) { memcpy(i2c->pdata, pdata, sizeof(*pdata));
else
s3c24xx_i2c_parse_dt(pdev->dev.of_node, i2c);
} else {
if (pdev->dev.of_node)
s3c24xx_i2c_parse_dt(pdev->dev.of_node, i2c);
if (dev_handle)
s3c24xx_i2c_parse_acpi(&pdev->dev, i2c);
} strlcpy(i2c->adap.name, "s3c2410-i2c", sizeof(i2c->adap.name)); i2c->adap.owner = THIS_MODULE;
@@ -1071,7 +1219,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
dev_dbg(&pdev->dev, "clock source %p\n", i2c->clk);
/* map the registers */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1099,6 +1246,8 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
if (i2c->pdata->cfg_gpio) { i2c->pdata->cfg_gpio(to_platform_device(i2c->dev));
} else if (dev_handle) {
s3c24xx_i2c_parse_acpi_gpio(i2c); } else if (IS_ERR(i2c->pctrl) && s3c24xx_i2c_parse_dt_gpio(i2c)) { return -EINVAL; }
@@ -1172,6 +1321,9 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) static int s3c24xx_i2c_remove(struct platform_device *pdev) { struct s3c24xx_i2c *i2c = platform_get_drvdata(pdev);
struct acpi_handle *dev_handle;
dev_handle = DEVICE_ACPI_HANDLE(&pdev->dev); pm_runtime_disable(&i2c->adap.dev); pm_runtime_disable(&pdev->dev);
@@ -1182,9 +1334,13 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)
clk_disable_unprepare(i2c->clk);
if (pdev->dev.of_node && IS_ERR(i2c->pctrl)) s3c24xx_i2c_dt_gpio_free(i2c);
if (dev_handle)
s3c24xx_i2c_acpi_gpio_free(i2c);
return 0;
}
@@ -1237,6 +1393,7 @@ static struct platform_driver s3c24xx_i2c_driver = { .name = "s3c-i2c", .pm = S3C24XX_DEV_PM_OPS, .of_match_table = of_match_ptr(s3c24xx_i2c_match),
.acpi_match_table = ACPI_PTR(s3c24xx_i2c_acpi_match), },
};
-- 1.7.10.4
Linaro-acpi mailing list Linaro-acpi@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-acpi
-- Andrea Gallo Director, Linaro Enterprise Group email: andrea.gallo@linaro.org mobile: +39 338 4075993 IRC: agallo@#linaro on irc.linaro.org Skype: agallo70
From: Graeme Gregory graeme.gregory@linaro.org
The device name is used to allow access to the clocks, for the ACPI probing the name comes from ACPI for the prototype I used LINA0001 as the name. This needs to be added in the table for now!
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org --- arch/arm/mach-exynos/clock-exynos5.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c index 87c022b..25ba5d6 100644 --- a/arch/arm/mach-exynos/clock-exynos5.c +++ b/arch/arm/mach-exynos/clock-exynos5.c @@ -778,6 +778,12 @@ static struct clk exynos5_init_clocks_off[] = { .ctrlbit = (1 << 6), }, { .name = "i2c", + .devname = "LINA0001:00", + .parent = &exynos5_clk_aclk_66.clk, + .enable = exynos5_clk_ip_peric_ctrl, + .ctrlbit = (1 << 6), + }, { + .name = "i2c", .devname = "s3c2440-i2c.1", .parent = &exynos5_clk_aclk_66.clk, .enable = exynos5_clk_ip_peric_ctrl,
From: Graeme Gregory graeme.gregory@linaro.org
ACPI will only probe whitelisted ACPI platform devices. So add the dummy LINA0001 for s3c24xx-i2c.
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org --- drivers/acpi/acpi_platform.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c index 26fce4b..f2daae1 100644 --- a/drivers/acpi/acpi_platform.c +++ b/drivers/acpi/acpi_platform.c @@ -43,6 +43,8 @@ static const struct acpi_device_id acpi_platform_device_ids[] = { { "INT33C6", ACPI_PLATFORM_CLK }, { "INT33C7", ACPI_PLATFORM_CLK },
+ { "LINA0001", 0 }, + { } };
From: Graeme Gregory graeme.gregory@linaro.org
For prototype add information for s3c24xx-i2c probing from DSDT
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org --- arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl | 46 ++++++++++++++------ 1 file changed, 33 insertions(+), 13 deletions(-)
diff --git a/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl b/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl index ed99d6e..165f283 100644 --- a/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl +++ b/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl @@ -1,23 +1,43 @@ /* * Copyright (c) 2013, Al Stone ahs3@redhat.com - * + * * [DSDT] Description of the Arndale board (exynos5250) * * This source is released under the terms of the GPLv2. */
DefinitionBlock ( - "dsdt.aml", // output filename - "DSDT", // table signature - 1, // DSDT compliance revision - "REDHAT", // OEM ID - "ARNDALE ", // table ID - 0x00000002) // OEM revision + "dsdt.aml", // output filename + "DSDT", // table signature + 1, // DSDT compliance revision + "REDHAT", // OEM ID + "ARNDALE ", // table ID + 0x00000002) // OEM revision { - Scope (_PR) - { - Processor (CPU0, 0x01, 0x00000410, 0x06) {} - Processor (CPU1, 0x02, 0x00000410, 0x06) {} - } -} + Scope (_PR) + { + Processor (CPU0, 0x01, 0x00000410, 0x06) {} + Processor (CPU1, 0x02, 0x00000410, 0x06) {} + } + + Scope (_SB) + { + Device (GPB3) { + }
+ Device (I2C) { + Name (_HID, "LINA0001") + Name (_UID, 0) + + Method (_CRS, 0x0, NotSerialized) { + Name (RBUF, ResourceTemplate () + { + Memory32Fixed (ReadWrite, 0x12C60000, 0x00000100) + Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, , , ) {0x58} + GpioIo (Exclusive, PullDefault, , , , "\_SB.GPB3") {0x2A, 0x2B} + }) + Return (RBUF) + } + } + } +}
On 27 May 2013 17:40, Graeme Gregory graeme.gregory@linaro.org wrote:
From: Graeme Gregory graeme.gregory@linaro.org
For prototype add information for s3c24xx-i2c probing from DSDT
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org
arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl | 46 ++++++++++++++------ 1 file changed, 33 insertions(+), 13 deletions(-)
diff --git a/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl b/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl index ed99d6e..165f283 100644 --- a/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl +++ b/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl @@ -1,23 +1,43 @@ /*
- Copyright (c) 2013, Al Stone ahs3@redhat.com
*/
- [DSDT] Description of the Arndale board (exynos5250)
- This source is released under the terms of the GPLv2.
DefinitionBlock (
"dsdt.aml", // output filename
"DSDT", // table signature
1, // DSDT compliance revision
"REDHAT", // OEM ID
"ARNDALE ", // table ID
0x00000002) // OEM revision
"dsdt.aml", // output filename
"DSDT", // table signature
1, // DSDT compliance revision
"REDHAT", // OEM ID
"ARNDALE ", // table ID
0x00000002) // OEM revision
[AG] why REDHAT as OEM ID? is this referring to the board manufacturer or the author of the table?
If the former, then OEM should be Samsung. If the latter, I guess it should be then LINARO instead of REDHAT, if this refers to the work done by Al under his Linaro assignment.
Hope Masters-Jon-Masters does not get mad at me :-)
{
- Scope (_PR)
- {
Processor (CPU0, 0x01, 0x00000410, 0x06) {}
Processor (CPU1, 0x02, 0x00000410, 0x06) {}
- }
-}
Scope (\_PR)
{
Processor (CPU0, 0x01, 0x00000410, 0x06) {}
Processor (CPU1, 0x02, 0x00000410, 0x06) {}
}
Scope (\_SB)
{
Device (GPB3) {
}
Device (I2C) {
Name (_HID, "LINA0001")
Name (_UID, 0)
Method (_CRS, 0x0, NotSerialized) {
Name (RBUF, ResourceTemplate ()
{
Memory32Fixed (ReadWrite, 0x12C60000, 0x00000100)
Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, , , ) {0x58}
GpioIo (Exclusive, PullDefault, , , , "\\_SB.GPB3") {0x2A, 0x2B}
})
Return (RBUF)
}
}
}
+}
1.7.10.4
On Tue, May 28, 2013 at 05:07:55PM +0200, Andrea Gallo wrote:
On 27 May 2013 17:40, Graeme Gregory graeme.gregory@linaro.org wrote:
From: Graeme Gregory graeme.gregory@linaro.org
For prototype add information for s3c24xx-i2c probing from DSDT
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org
arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl | 46 ++++++++++++++------ 1 file changed, 33 insertions(+), 13 deletions(-)
diff --git a/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl b/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl index ed99d6e..165f283 100644 --- a/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl +++ b/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl @@ -1,23 +1,43 @@ /*
- Copyright (c) 2013, Al Stone ahs3@redhat.com
*/
- [DSDT] Description of the Arndale board (exynos5250)
- This source is released under the terms of the GPLv2.
DefinitionBlock (
"dsdt.aml", // output filename
"DSDT", // table signature
1, // DSDT compliance revision
"REDHAT", // OEM ID
"ARNDALE ", // table ID
0x00000002) // OEM revision
"dsdt.aml", // output filename
"DSDT", // table signature
1, // DSDT compliance revision
"REDHAT", // OEM ID
"ARNDALE ", // table ID
0x00000002) // OEM revision
[AG] why REDHAT as OEM ID? is this referring to the board manufacturer or the author of the table?
If the former, then OEM should be Samsung. If the latter, I guess it should be then LINARO instead of REDHAT, if this refers to the work done by Al under his Linaro assignment.
Hope Masters-Jon-Masters does not get mad at me :-)
These were set by Al, they should not actually have been in my patch but I think my editor settings have changed the whitespacing to be kernel compliant and I did not notice when I commited.
Graeme
{
- Scope (_PR)
- {
Processor (CPU0, 0x01, 0x00000410, 0x06) {}
Processor (CPU1, 0x02, 0x00000410, 0x06) {}
- }
-}
Scope (\_PR)
{
Processor (CPU0, 0x01, 0x00000410, 0x06) {}
Processor (CPU1, 0x02, 0x00000410, 0x06) {}
}
Scope (\_SB)
{
Device (GPB3) {
}
Device (I2C) {
Name (_HID, "LINA0001")
Name (_UID, 0)
Method (_CRS, 0x0, NotSerialized) {
Name (RBUF, ResourceTemplate ()
{
Memory32Fixed (ReadWrite, 0x12C60000, 0x00000100)
Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive, , , ) {0x58}
GpioIo (Exclusive, PullDefault, , , , "\\_SB.GPB3") {0x2A, 0x2B}
})
Return (RBUF)
}
}
}
+}
1.7.10.4
On 05/28/2013 09:21 AM, Graeme Gregory wrote:
On Tue, May 28, 2013 at 05:07:55PM +0200, Andrea Gallo wrote:
On 27 May 2013 17:40, Graeme Gregory graeme.gregory@linaro.org wrote:
From: Graeme Gregory graeme.gregory@linaro.org
For prototype add information for s3c24xx-i2c probing from DSDT
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org
arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl | 46 ++++++++++++++------ 1 file changed, 33 insertions(+), 13 deletions(-)
diff --git a/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl b/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl index ed99d6e..165f283 100644 --- a/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl +++ b/arch/arm/boot/asl/exynos5250-arndale.acpi/dsdt.asl @@ -1,23 +1,43 @@ /*
- Copyright (c) 2013, Al Stone ahs3@redhat.com
- [DSDT] Description of the Arndale board (exynos5250)
- This source is released under the terms of the GPLv2.
*/
DefinitionBlock (
"dsdt.aml", // output filename
"DSDT", // table signature
1, // DSDT compliance revision
"REDHAT", // OEM ID
"ARNDALE ", // table ID
0x00000002) // OEM revision
"dsdt.aml", // output filename
"DSDT", // table signature
1, // DSDT compliance revision
"REDHAT", // OEM ID
"ARNDALE ", // table ID
0x00000002) // OEM revision
[AG] why REDHAT as OEM ID? is this referring to the board manufacturer or the author of the table?
According to the spec, the OEM ID is whatever the table writer wishes. As a practical matter, it appears it is usually the board manufacturer who also is typically the table writer.
If the former, then OEM should be Samsung. If the latter, I guess it should be then LINARO instead of REDHAT, if this refers to the work done by Al under his Linaro assignment.
Hope Masters-Jon-Masters does not get mad at me :-)
Sweet little old Jon? How could he ever get mad :)?
These were set by Al, they should not actually have been in my patch but I think my editor settings have changed the whitespacing to be kernel compliant and I did not notice when I commited.
Graeme
Hrm. I didn't even think about these much when I made the initial tables, just sort of filled them in while on autopilot; the templates say "INTEL " and that was _definitely_ not going to work :).
I should probably put together a patch to clean these up with an OEM ID of "SAMSNG" (6 chars only)....or, as people make changes, toss that one in, too...
From: Graeme Gregory graeme.gregory@linaro.org
To allow prototype to probe i2c from ACPI we need to remove the FDT definitions of the same device.
Signed-off-by: Graeme Gregory graeme.gregory@linaro.org --- arch/arm/boot/dts/exynos5250-arndale.dts | 12 +++++++----- arch/arm/boot/dts/exynos5250.dtsi | 8 ++++---- 2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/arch/arm/boot/dts/exynos5250-arndale.dts b/arch/arm/boot/dts/exynos5250-arndale.dts index b2781ef..8ccdb6b 100644 --- a/arch/arm/boot/dts/exynos5250-arndale.dts +++ b/arch/arm/boot/dts/exynos5250-arndale.dts @@ -37,6 +37,7 @@ samsung,mfc-l = <0x51000000 0x800000>; };
+/* i2c@12C60000 { samsung,i2c-sda-delay = <100>; samsung,i2c-max-bus-freq = <20000>; @@ -352,11 +353,12 @@ reg = <0x38>; }; }; +*/
sata@122F0000 { samsung,sata-freq = <66>; }; - + dwmmc_0: dwmmc0@12200000 { num-slots = <1>; supports-highspeed; @@ -516,12 +518,12 @@ }; };
- hdmi { +/* hdmi { hpd-gpio = <&gpx3 7 0xf 1 3>; vdd_osc-supply = <&ldo10_reg>; vdd_pll-supply = <&ldo8_reg>; vdd-supply = <&ldo8_reg>; - }; + };*/
mmc_reg: voltage-regulator { compatible = "regulator-fixed"; @@ -546,7 +548,7 @@
leds { compatible = "gpio-leds"; - + user1 { label = "D12"; gpios = <&gpy6 5 1 0 0>; @@ -564,6 +566,6 @@ label = "D15"; gpios = <&gpy6 4 1 0 0>; }; - + }; }; diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi index ac3de7e..c52497f 100644 --- a/arch/arm/boot/dts/exynos5250.dtsi +++ b/arch/arm/boot/dts/exynos5250.dtsi @@ -35,7 +35,7 @@ mshc1 = &dwmmc_1; mshc2 = &dwmmc_2; mshc3 = &dwmmc_3; - i2c0 = &i2c_0; +/* i2c0 = &i2c_0; i2c1 = &i2c_1; i2c2 = &i2c_2; i2c3 = &i2c_3; @@ -43,7 +43,7 @@ i2c5 = &i2c_5; i2c6 = &i2c_6; i2c7 = &i2c_7; - i2c8 = &i2c_8; + i2c8 = &i2c_8;*/ };
gic:interrupt-controller@10481000 { @@ -184,7 +184,7 @@ reg = <0x12170000 0x1ff>; };
- i2c_0: i2c@12C60000 { +/* i2c_0: i2c@12C60000 { compatible = "samsung,s3c2440-i2c"; reg = <0x12C60000 0x100>; interrupts = <0 56 0>; @@ -261,7 +261,7 @@ reg = <0x121D0000 0x100>; #address-cells = <1>; #size-cells = <0>; - }; + };*/
spi_0: spi@12d20000 { compatible = "samsung,exynos4210-spi";
Hi Graeme,
Have you push this patch set to the acpi-proto tree? The latest commit I got is "Enable the D12-D15 LEDs next to the SATA port to show how to enable them via DT", did I get the right git repo?
Thanks Hanjun
On 2013-5-27 23:40, Graeme Gregory wrote:
This patch series implements probing the s3c24xx i2c bus device from ACPI tables.
I have included an update to the DSDT for the correct information for I2C0 which is the port connected to the PMIC so is easy to test with i2c tools.
On boot I can successfully communicate with the slave at 0x66 on this bus.
root@arndale:~# i2cdump -f -y 0 0x66 No size specified (using byte-data access) 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 00: 03 00 00 00 c0 78 00 01 17 07 01 0e e5 85 4f de ?...?x.???????O? 10: 03 03 03 23 23 23 23 23 23 23 23 23 23 23 23 23 ???############# 20: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 00 ###############. 30: 00 45 d9 38 fa 34 00 50 50 50 50 50 50 db 40 00 .E?8?4.PPPPPP?@. 40: 40 40 40 40 40 40 3a 40 00 40 40 40 40 40 40 d9 @@@@@@:@.@@@@@@? 50: 58 70 88 b8 18 58 d8 68 d8 30 98 a8 cc d0 16 1c Xp???X?h?0?????? 60: 28 d4 d4 d4 cc cc c8 2c d4 d4 ec d4 d4 c8 d4 e8 (??????,???????? 70: 28 2c 2c 2c 32 28 2c 08 14 14 14 00 00 00 00 00 (,,,2(,????..... 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ e0: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?............... f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
can see the correct IRQ allocated
root@arndale:~# cat /proc/interrupts CPU0 CPU1 29: 0 0 GIC arch_timer 30: 24177 6574 GIC arch_timer 66: 0 0 GIC dma-pl330.0 67: 0 0 GIC dma-pl330.1 85: 538 0 GIC exynos4210-uart.2 88: 1024 0 GIC LINA0001:00 97: 0 0 GIC exynos-tmu 103: 11813 0 GIC ehci_hcd:usb1, ohci_hcd:usb2 104: 0 0 GIC xhci-hcd:usb3 107: 432 0 GIC dw-mci 109: 67422 0 GIC dw-mci 126: 0 0 GIC drm_mixer 152: 0 0 GIC mct_tick0_irq 153: 0 0 GIC mct_tick1_irq 156: 0 0 GIC dma-pl330.2 347: 0 0 COMBINER mct_comp_irq IPI0: 0 1 CPU wakeup interrupts IPI1: 0 0 Timer broadcast interrupts IPI2: 5233 6766 Rescheduling interrupts IPI3: 0 0 Function call interrupts IPI4: 98 44 Single function call interrupts IPI5: 0 0 CPU stop interrupts IPI6: 0 0 CPU backtrace Err: 0
and can see the correct GPIO allocated.
GPIOs 42-45, GPB3: gpio-42 (i2c-bus ) in hi gpio-43 (i2c-bus ) in hi
The GPIO allocation is not how it would be in a final implementation as similar to FDT the GPIO providers (like GIC) can be hierachical so you would normally use the device name + offset to locate the correct GPIO. This is very similar to how it works in FDT as well.
Thanks
Graeme
Linaro-acpi mailing list Linaro-acpi@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-acpi
Hi Hanjun,
I just checked and I have pushed the patches
https://git.linaro.org/gitweb?p=arm/acpi/acpi.git%3Ba=shortlog%3Bh=refs/head...
I am unsure why you do not see them, the above is the correct repo please let me know if you got an incorrect address from somewhere so I can correct it.
Thanks
Graeme
On Mon, Jun 03, 2013 at 08:39:07PM +0800, Hanjun Guo wrote:
Hi Graeme,
Have you push this patch set to the acpi-proto tree? The latest commit I got is "Enable the D12-D15 LEDs next to the SATA port to show how to enable them via DT", did I get the right git repo?
Thanks Hanjun
On 2013-5-27 23:40, Graeme Gregory wrote:
This patch series implements probing the s3c24xx i2c bus device from ACPI tables.
I have included an update to the DSDT for the correct information for I2C0 which is the port connected to the PMIC so is easy to test with i2c tools.
On boot I can successfully communicate with the slave at 0x66 on this bus.
root@arndale:~# i2cdump -f -y 0 0x66 No size specified (using byte-data access) 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 00: 03 00 00 00 c0 78 00 01 17 07 01 0e e5 85 4f de ?...?x.???????O? 10: 03 03 03 23 23 23 23 23 23 23 23 23 23 23 23 23 ???############# 20: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 00 ###############. 30: 00 45 d9 38 fa 34 00 50 50 50 50 50 50 db 40 00 .E?8?4.PPPPPP?@. 40: 40 40 40 40 40 40 3a 40 00 40 40 40 40 40 40 d9 @@@@@@:@.@@@@@@? 50: 58 70 88 b8 18 58 d8 68 d8 30 98 a8 cc d0 16 1c Xp???X?h?0?????? 60: 28 d4 d4 d4 cc cc c8 2c d4 d4 ec d4 d4 c8 d4 e8 (??????,???????? 70: 28 2c 2c 2c 32 28 2c 08 14 14 14 00 00 00 00 00 (,,,2(,????..... 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ e0: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?............... f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
can see the correct IRQ allocated
root@arndale:~# cat /proc/interrupts CPU0 CPU1 29: 0 0 GIC arch_timer 30: 24177 6574 GIC arch_timer 66: 0 0 GIC dma-pl330.0 67: 0 0 GIC dma-pl330.1 85: 538 0 GIC exynos4210-uart.2 88: 1024 0 GIC LINA0001:00 97: 0 0 GIC exynos-tmu 103: 11813 0 GIC ehci_hcd:usb1, ohci_hcd:usb2 104: 0 0 GIC xhci-hcd:usb3 107: 432 0 GIC dw-mci 109: 67422 0 GIC dw-mci 126: 0 0 GIC drm_mixer 152: 0 0 GIC mct_tick0_irq 153: 0 0 GIC mct_tick1_irq 156: 0 0 GIC dma-pl330.2 347: 0 0 COMBINER mct_comp_irq IPI0: 0 1 CPU wakeup interrupts IPI1: 0 0 Timer broadcast interrupts IPI2: 5233 6766 Rescheduling interrupts IPI3: 0 0 Function call interrupts IPI4: 98 44 Single function call interrupts IPI5: 0 0 CPU stop interrupts IPI6: 0 0 CPU backtrace Err: 0
and can see the correct GPIO allocated.
GPIOs 42-45, GPB3: gpio-42 (i2c-bus ) in hi gpio-43 (i2c-bus ) in hi
The GPIO allocation is not how it would be in a final implementation as similar to FDT the GPIO providers (like GIC) can be hierachical so you would normally use the device name + offset to locate the correct GPIO. This is very similar to how it works in FDT as well.
Thanks
Graeme
Linaro-acpi mailing list Linaro-acpi@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-acpi
On 2013-6-4 18:58, Graeme Gregory wrote:
Hi Hanjun,
I just checked and I have pushed the patches
https://git.linaro.org/gitweb?p=arm/acpi/acpi.git%3Ba=shortlog%3Bh=refs/head...
Sorry, I got the wrong git repo which is: https://git.linaro.org/gitweb?p=people/graemegregory/linux-linaro-acpi%3Ba=s...
That's my bad, I will clone the correct repo.
Thanks Hanjun
I am unsure why you do not see them, the above is the correct repo please let me know if you got an incorrect address from somewhere so I can correct it.
Thanks
Graeme
On Mon, Jun 03, 2013 at 08:39:07PM +0800, Hanjun Guo wrote:
Hi Graeme,
Have you push this patch set to the acpi-proto tree? The latest commit I got is "Enable the D12-D15 LEDs next to the SATA port to show how to enable them via DT", did I get the right git repo?
Thanks Hanjun
On 2013-5-27 23:40, Graeme Gregory wrote:
This patch series implements probing the s3c24xx i2c bus device from ACPI tables.
I have included an update to the DSDT for the correct information for I2C0 which is the port connected to the PMIC so is easy to test with i2c tools.
On boot I can successfully communicate with the slave at 0x66 on this bus.
root@arndale:~# i2cdump -f -y 0 0x66 No size specified (using byte-data access) 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 00: 03 00 00 00 c0 78 00 01 17 07 01 0e e5 85 4f de ?...?x.???????O? 10: 03 03 03 23 23 23 23 23 23 23 23 23 23 23 23 23 ???############# 20: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 00 ###############. 30: 00 45 d9 38 fa 34 00 50 50 50 50 50 50 db 40 00 .E?8?4.PPPPPP?@. 40: 40 40 40 40 40 40 3a 40 00 40 40 40 40 40 40 d9 @@@@@@:@.@@@@@@? 50: 58 70 88 b8 18 58 d8 68 d8 30 98 a8 cc d0 16 1c Xp???X?h?0?????? 60: 28 d4 d4 d4 cc cc c8 2c d4 d4 ec d4 d4 c8 d4 e8 (??????,???????? 70: 28 2c 2c 2c 32 28 2c 08 14 14 14 00 00 00 00 00 (,,,2(,????..... 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ e0: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?............... f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
can see the correct IRQ allocated
root@arndale:~# cat /proc/interrupts CPU0 CPU1 29: 0 0 GIC arch_timer 30: 24177 6574 GIC arch_timer 66: 0 0 GIC dma-pl330.0 67: 0 0 GIC dma-pl330.1 85: 538 0 GIC exynos4210-uart.2 88: 1024 0 GIC LINA0001:00 97: 0 0 GIC exynos-tmu 103: 11813 0 GIC ehci_hcd:usb1, ohci_hcd:usb2 104: 0 0 GIC xhci-hcd:usb3 107: 432 0 GIC dw-mci 109: 67422 0 GIC dw-mci 126: 0 0 GIC drm_mixer 152: 0 0 GIC mct_tick0_irq 153: 0 0 GIC mct_tick1_irq 156: 0 0 GIC dma-pl330.2 347: 0 0 COMBINER mct_comp_irq IPI0: 0 1 CPU wakeup interrupts IPI1: 0 0 Timer broadcast interrupts IPI2: 5233 6766 Rescheduling interrupts IPI3: 0 0 Function call interrupts IPI4: 98 44 Single function call interrupts IPI5: 0 0 CPU stop interrupts IPI6: 0 0 CPU backtrace Err: 0
and can see the correct GPIO allocated.
GPIOs 42-45, GPB3: gpio-42 (i2c-bus ) in hi gpio-43 (i2c-bus ) in hi
The GPIO allocation is not how it would be in a final implementation as similar to FDT the GPIO providers (like GIC) can be hierachical so you would normally use the device name + offset to locate the correct GPIO. This is very similar to how it works in FDT as well.
Thanks
Graeme
Linaro-acpi mailing list Linaro-acpi@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-acpi