All of lore.kernel.org
 help / color / mirror / Atom feed
From: benjamin.zores@alcatel-lucent.com (Benjamin Zores)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] arch/arm/mach-kirkwood: add support for 2nd TWSI controller on 88f6282.
Date: Thu, 10 Jun 2010 15:59:51 +0200	[thread overview]
Message-ID: <20100610135951.14097.48348.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100610135936.14097.22635.stgit@localhost.localdomain>

Signed-off-by: Benjamin Zores <benjamin.zores@alcatel-lucent.com>
---
 arch/arm/mach-kirkwood/common.c                |   46 +++++++++++++++++++-----
 arch/arm/mach-kirkwood/include/mach/irqs.h     |    3 +-
 arch/arm/mach-kirkwood/include/mach/kirkwood.h |    3 +-
 3 files changed, 41 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 473a1d0..93b7762 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -458,23 +458,45 @@ static struct mv64xxx_i2c_pdata kirkwood_i2c_pdata = {
 	.timeout	= 1000, /* Default timeout of 1 second */
 };
 
-static struct resource kirkwood_i2c_resources[] = {
+static struct resource kirkwood_i2c_0_resources[] = {
 	{
-		.start	= I2C_PHYS_BASE,
-		.end	= I2C_PHYS_BASE + 0x1f,
+		.start	= I2C_0_PHYS_BASE,
+		.end	= I2C_0_PHYS_BASE + 0x1f,
 		.flags	= IORESOURCE_MEM,
 	}, {
-		.start	= IRQ_KIRKWOOD_TWSI,
-		.end	= IRQ_KIRKWOOD_TWSI,
+		.start	= IRQ_KIRKWOOD_TWSI0,
+		.end	= IRQ_KIRKWOOD_TWSI0,
 		.flags	= IORESOURCE_IRQ,
 	},
 };
 
-static struct platform_device kirkwood_i2c = {
+static struct resource kirkwood_i2c_1_resources[] = {
+	{
+		.start	= I2C_1_PHYS_BASE,
+		.end	= I2C_1_PHYS_BASE + 0x1f,
+		.flags	= IORESOURCE_MEM,
+	}, {
+		.start	= IRQ_KIRKWOOD_TWSI1,
+		.end	= IRQ_KIRKWOOD_TWSI1,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device kirkwood_i2c_0 = {
 	.name		= MV64XXX_I2C_CTLR_NAME,
 	.id		= 0,
-	.num_resources	= ARRAY_SIZE(kirkwood_i2c_resources),
-	.resource	= kirkwood_i2c_resources,
+	.num_resources	= ARRAY_SIZE(kirkwood_i2c_0_resources),
+	.resource	= kirkwood_i2c_0_resources,
+	.dev		= {
+		.platform_data	= &kirkwood_i2c_pdata,
+	},
+};
+
+static struct platform_device kirkwood_i2c_1 = {
+	.name		= MV64XXX_I2C_CTLR_NAME,
+	.id		= 0,
+	.num_resources	= ARRAY_SIZE(kirkwood_i2c_1_resources),
+	.resource	= kirkwood_i2c_1_resources,
 	.dev		= {
 		.platform_data	= &kirkwood_i2c_pdata,
 	},
@@ -482,7 +504,13 @@ static struct platform_device kirkwood_i2c = {
 
 void __init kirkwood_i2c_init(void)
 {
-	platform_device_register(&kirkwood_i2c);
+	u32 dev, rev;
+
+	kirkwood_pcie_id(&dev, &rev);
+
+	platform_device_register(&kirkwood_i2c_0);
+	if (dev == MV88F6282_DEV_ID && (rev == MV88F6282_REV_A0))
+	  platform_device_register(&kirkwood_i2c_1);
 }
 
 
diff --git a/arch/arm/mach-kirkwood/include/mach/irqs.h b/arch/arm/mach-kirkwood/include/mach/irqs.h
index 9da2eb5..d82ecf0 100644
--- a/arch/arm/mach-kirkwood/include/mach/irqs.h
+++ b/arch/arm/mach-kirkwood/include/mach/irqs.h
@@ -33,13 +33,14 @@
 #define IRQ_KIRKWOOD_I2S	24
 #define IRQ_KIRKWOOD_TS_0	26
 #define IRQ_KIRKWOOD_SDIO	28
-#define IRQ_KIRKWOOD_TWSI	29
+#define IRQ_KIRKWOOD_TWSI0	29
 #define IRQ_KIRKWOOD_AVB	30
 #define IRQ_KIRKWOOD_TDMI	31
 
 /*
  * High Interrupt Controller
  */
+#define IRQ_KIRKWOOD_TWSI1	32
 #define IRQ_KIRKWOOD_UART_0	33
 #define IRQ_KIRKWOOD_UART_1	34
 #define IRQ_KIRKWOOD_GPIO_LOW_0_7	35
diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
index 7f0b50a..b2f2f5d 100644
--- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h
+++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h
@@ -68,7 +68,8 @@
 #define  DEVICE_ID		(DEV_BUS_VIRT_BASE | 0x0034)
 #define  RTC_PHYS_BASE		(DEV_BUS_PHYS_BASE | 0x0300)
 #define  SPI_PHYS_BASE		(DEV_BUS_PHYS_BASE | 0x0600)
-#define  I2C_PHYS_BASE		(DEV_BUS_PHYS_BASE | 0x1000)
+#define  I2C_0_PHYS_BASE	(DEV_BUS_PHYS_BASE | 0x1000)
+#define  I2C_1_PHYS_BASE	(DEV_BUS_PHYS_BASE | 0x1100)
 #define  UART0_PHYS_BASE	(DEV_BUS_PHYS_BASE | 0x2000)
 #define  UART0_VIRT_BASE	(DEV_BUS_VIRT_BASE | 0x2000)
 #define  UART1_PHYS_BASE	(DEV_BUS_PHYS_BASE | 0x2100)

  parent reply	other threads:[~2010-06-10 13:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-10 13:59 [PATCH 1/4] arch/arm/mach-kirkwood: update MPP definition Benjamin Zores
2010-06-10 13:59 ` [PATCH 2/4] arch/arm/mach-kirkwood: add support for 88F6282-A0 revision Benjamin Zores
2010-06-10 13:59 ` [PATCH 3/4] arch/arm/mach-kirkwood: add support for 2nd PCIe port on 88f6282 Benjamin Zores
2010-06-10 15:29   ` saeed bishara
2010-06-17  6:58     ` Benjamin Zores
2010-06-10 13:59 ` Benjamin Zores [this message]
2010-06-10 15:07   ` [PATCH 4/4] arch/arm/mach-kirkwood: add support for 2nd TWSI controller " saeed bishara
  -- strict thread matches above, loose matches on Subject: below --
2010-06-17  7:58 [PATCH 0/4] Series short description Benjamin Zores
2010-06-17  7:59 ` [PATCH 4/4] arch/arm/mach-kirkwood: add support for 2nd TWSI controller on 88f6282 Benjamin Zores

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100610135951.14097.48348.stgit@localhost.localdomain \
    --to=benjamin.zores@alcatel-lucent.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.