Skip to contentSkip to conversation

i.MX53, add access to third I2C peripheral

DISCUSSION Applied George Pontis 3 participants 6 messages Feb 4, 2013 – Feb 6, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

All versions of the i.MX53 have three I2C peripherals. This patch provides access to it.

diff -Naur a/arch/arm/mach-imx/include/mach/devices-imx53.h b/arch/arm/mach-imx/include/mach/devices-imx
53.h
--- bb.a/arch/arm/mach-imx/include/mach/devices-imx53.h 2013-02-04 06:24:51.000000000 -0800
+++ bb.b/arch/arm/mach-imx/include/mach/devices-imx53.h 2013-02-03 22:24:26.930091420 -0800
@@ -21,6 +21,11 @@

        return imx_add_i2c((void *)MX53_I2C2_BASE_ADDR, 1, pdata);

}

+static inline struct device_d *imx53_add_i2c2(struct i2c_platform_data *pdata)
+{
+ return imx_add_i2c((void *)MX53_I2C2_BASE_ADDR, 2, pdata);
+}
+
static inline struct device_d *imx53_add_uart0(void)

 {
        return imx_add_uart_imx21((void *)MX53_UART1_BASE_ADDR, 0);

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw
Quoted 2 lines

All versions of the i.MX53 have three I2C peripherals. This patch provides access to it.

...

Review

Quoted 6 lines

+static inline struct device_d *imx53_add_i2c2(struct i2c_platform_data *pdata)

(quoted diff) +4 -0
+{
+       return imx_add_i2c((void *)MX53_I2C2_BASE_ADDR, 2, pdata);
+}
+

MX53_I2C3_BASE_ADDR ?

---
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#2 lore raw
Quoted 13 lines

-----Original Message-----
From: Alexander Shiyan [mailto:[email protected]]
Sent: Monday, February 04, 2013 11:09 AM
To: George Pontis
Cc: [email protected]
Subject: Re: i.MX53, add access to third I2C peripheral

Quoted 1 line

All versions of the i.MX53 have three I2C peripherals. This patch

provides

Quoted 1 line

access to it.

...

Quoted 1 line

+static inline struct device_d *imx53_add_i2c2(struct

i2c_platform_data

Quoted 8 lines

Review

Quoted 5 lines

*pdata)

(quoted diff) +4 -0
+{
+       return imx_add_i2c((void *)MX53_I2C2_BASE_ADDR, 2, pdata);
+}
+

MX53_I2C3_BASE_ADDR ?

---

Thanks for the correction Alex. I also forgot to handle the clock for this new peripheral. With both in place, a device on the third bus is recognized at boot and listed by devinfo.

diff -Naur bb.a/arch/arm/mach-imx/include/mach/devices-imx53.h bb.b/arch/arm/mach-imx/include/mach/devic es-imx53.h

arch/arm/mach-imx/include/mach/devices-imx53.h 2013-02-03 22:24:26.930091420 -0800 renamed from arch/arm/mach-imx/include/mach/devices-imx53.h 2013-02-04 06:24:51.000000000 -0800 +5 -0
@@ -21,6 +21,11 @@
        return imx_add_i2c((void *)MX53_I2C2_BASE_ADDR, 1, pdata);
 }
 
+static inline struct device_d *imx53_add_i2c2(struct i2c_platform_data *pdata)
+{
+       return imx_add_i2c((void *)MX53_I2C3_BASE_ADDR, 2, pdata);
+}
+
 static inline struct device_d *imx53_add_uart0(void)
 {
        return imx_add_uart_imx21((void *)MX53_UART1_BASE_ADDR, 0);
arch/arm/mach-imx/clk-imx5.c 2013-02-04 16:14:04.729284183 -0800 renamed from arch/arm/mach-imx/clk-imx5.c 2013-02-04 06:24:51.000000000 -0800 +1 -0
diff -Naur bb.a/arch/arm/mach-imx/clk-imx5.c bb.b/arch/arm/mach-imx/clk-imx5.c
@@ -272,6 +272,7 @@
        clkdev_add_physbase(clks[uart_root], MX53_UART3_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[per_root], MX53_I2C1_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[per_root], MX53_I2C2_BASE_ADDR, NULL);
+       clkdev_add_physbase(clks[per_root], MX53_I2C3_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[per_root], MX53_GPT1_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[ipg], MX53_CSPI_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[ecspi_podf], MX53_ECSPI1_BASE_ADDR, NULL);

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

maintainer
#3 lore raw

Hi George,

Quoted 20 lines · George Pontis
Quoted 20 lines

-----Original Message-----
From: Alexander Shiyan [mailto:[email protected]]
Sent: Monday, February 04, 2013 11:09 AM
To: George Pontis
Cc: [email protected]
Subject: Re: i.MX53, add access to third I2C peripheral

Quoted 1 line

All versions of the i.MX53 have three I2C peripherals. This patch

provides

Quoted 1 line

access to it.

...

Quoted 1 line

+static inline struct device_d *imx53_add_i2c2(struct

i2c_platform_data

arch/arm/mach-imx/include/mach/devices-imx53.h 2013-02-03 22:24:26.930091420 -0800 line 28

Quoted 5 lines

*pdata)

arch/arm/mach-imx/include/mach/devices-imx53.h 2013-02-03 22:24:26.930091420 -0800 renamed from arch/arm/mach-imx/include/mach/devices-imx53.h 2013-02-04 06:24:51.000000000 -0800 +4 -0
+{
+       return imx_add_i2c((void *)MX53_I2C2_BASE_ADDR, 2, pdata);
+}
+

MX53_I2C3_BASE_ADDR ?

Quoted 3 lines
Quoted 1 line

---

Thanks for the correction Alex. I also forgot to handle the clock for this new peripheral. With both in place, a device on the third bus is recognized at boot and listed by devinfo.

This version looks ok. Please resend with a proper signed-off-by tag.

Sascha

Quoted 36 lines

diff -Naur bb.a/arch/arm/mach-imx/include/mach/devices-imx53.h bb.b/arch/arm/mach-imx/include/mach/devic es-imx53.h

arch/arm/mach-imx/include/mach/devices-imx53.h 2013-02-03 22:24:26.930091420 -0800 renamed from arch/arm/mach-imx/include/mach/devices-imx53.h 2013-02-04 06:24:51.000000000 -0800 +5 -0
@@ -21,6 +21,11 @@
        return imx_add_i2c((void *)MX53_I2C2_BASE_ADDR, 1, pdata);
 }
 
+static inline struct device_d *imx53_add_i2c2(struct i2c_platform_data *pdata)
+{
+       return imx_add_i2c((void *)MX53_I2C3_BASE_ADDR, 2, pdata);
+}
+
 static inline struct device_d *imx53_add_uart0(void)
 {
        return imx_add_uart_imx21((void *)MX53_UART1_BASE_ADDR, 0);

diff -Naur bb.a/arch/arm/mach-imx/clk-imx5.c bb.b/arch/arm/mach-imx/clk-imx5.c

arch/arm/mach-imx/clk-imx5.c 2013-02-04 16:14:04.729284183 -0800 renamed from arch/arm/mach-imx/clk-imx5.c 2013-02-04 06:24:51.000000000 -0800 +1 -0
@@ -272,6 +272,7 @@
        clkdev_add_physbase(clks[uart_root], MX53_UART3_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[per_root], MX53_I2C1_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[per_root], MX53_I2C2_BASE_ADDR, NULL);
+       clkdev_add_physbase(clks[per_root], MX53_I2C3_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[per_root], MX53_GPT1_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[ipg], MX53_CSPI_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[ecspi_podf], MX53_ECSPI1_BASE_ADDR, NULL);

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

RE: i.MX53, add access to third I2C peripheral ( resubmit with Signed-off tag )

Subject: i.MX53 i2c, add support for third i2c interface

---
diff -Naur bb.a/arch/arm/mach-imx/include/mach/devices-imx53.h bb.b/arch/arm/mach-imx/include/mach/devic
es-imx53.h
--- bb.a/arch/arm/mach-imx/include/mach/devices-imx53.h 2013-02-04 06:24:51.000000000 -0800
+++ bb.b/arch/arm/mach-imx/include/mach/devices-imx53.h 2013-02-03 22:24:26.930091420 -0800
@@ -21,6 +21,11 @@

        return imx_add_i2c((void *)MX53_I2C2_BASE_ADDR, 1, pdata);

}

+static inline struct device_d *imx53_add_i2c2(struct i2c_platform_data *pdata)
+{
+ return imx_add_i2c((void *)MX53_I2C3_BASE_ADDR, 2, pdata);
+}
+
static inline struct device_d *imx53_add_uart0(void)

 {
        return imx_add_uart_imx21((void *)MX53_UART1_BASE_ADDR, 0);

diff -Naur bb.a/arch/arm/mach-imx/clk-imx5.c
bb.b/arch/arm/mach-imx/clk-imx5.c

arch/arm/mach-imx/clk-imx5.c 2013-02-04 16:14:04.729284183 -0800 renamed from arch/arm/mach-imx/clk-imx5.c 2013-02-04 06:24:51.000000000 -0800 +1 -0
@@ -272,6 +272,7 @@
        clkdev_add_physbase(clks[uart_root], MX53_UART3_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[per_root], MX53_I2C1_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[per_root], MX53_I2C2_BASE_ADDR, NULL);
+       clkdev_add_physbase(clks[per_root], MX53_I2C3_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[per_root], MX53_GPT1_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[ipg], MX53_CSPI_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[ecspi_podf], MX53_ECSPI1_BASE_ADDR, NULL);

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

maintainer Applied
#5 lore raw

Re: i.MX53, add access to third I2C peripheral ( resubmit with Signed-off tag )

Quoted 3 lines · George Pontis

Subject: i.MX53 i2c, add support for third i2c interface

Applied, thanks.

Your mailer wraps lines. I had to apply this manually. Please figure out how to send patches correctly next time.

Sascha

Quoted 41 lines

---
diff -Naur bb.a/arch/arm/mach-imx/include/mach/devices-imx53.h bb.b/arch/arm/mach-imx/include/mach/devic
es-imx53.h
--- bb.a/arch/arm/mach-imx/include/mach/devices-imx53.h 2013-02-04 06:24:51.000000000 -0800
+++ bb.b/arch/arm/mach-imx/include/mach/devices-imx53.h 2013-02-03 22:24:26.930091420 -0800

(quoted diff) +5 -0
@@ -21,6 +21,11 @@
        return imx_add_i2c((void *)MX53_I2C2_BASE_ADDR, 1, pdata);
 }
 
+static inline struct device_d *imx53_add_i2c2(struct i2c_platform_data
 *pdata)
+{
+       return imx_add_i2c((void *)MX53_I2C3_BASE_ADDR, 2, pdata);
+}
+
 static inline struct device_d *imx53_add_uart0(void)
 {
        return imx_add_uart_imx21((void *)MX53_UART1_BASE_ADDR, 0);

diff -Naur bb.a/arch/arm/mach-imx/clk-imx5.c
bb.b/arch/arm/mach-imx/clk-imx5.c

arch/arm/mach-imx/clk-imx5.c 2013-02-04 16:14:04.729284183 -0800 renamed from arch/arm/mach-imx/clk-imx5.c 2013-02-04 06:24:51.000000000 -0800 +1 -0
@@ -272,6 +272,7 @@
        clkdev_add_physbase(clks[uart_root], MX53_UART3_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[per_root], MX53_I2C1_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[per_root], MX53_I2C2_BASE_ADDR, NULL);
+       clkdev_add_physbase(clks[per_root], MX53_I2C3_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[per_root], MX53_GPT1_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[ipg], MX53_CSPI_BASE_ADDR, NULL);
        clkdev_add_physbase(clks[ecspi_podf], MX53_ECSPI1_BASE_ADDR, NULL);

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox