linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: saeed.bishara@gmail.com (saeed bishara)
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 18:07:20 +0300	[thread overview]
Message-ID: <AANLkTim9rZEXhpiY17Co3mvM1YOgtqlmRhgU3ofHJMgV@mail.gmail.com> (raw)
In-Reply-To: <20100610135951.14097.48348.stgit@localhost.localdomain>

On Thu, Jun 10, 2010 at 4:59 PM, Benjamin Zores
<benjamin.zores@alcatel-lucent.com> wrote:
> 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);
the fact that the 6282 has 2 i2c controller doesn't mean that every
board will use both of them, I suggest to add port number to
kirkwood_i2c_init, and 6282 that wants to enable i2c 1 will call
kirkwood_i2c_init(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)
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

  reply	other threads:[~2010-06-10 15:07 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 ` [PATCH 4/4] arch/arm/mach-kirkwood: add support for 2nd TWSI controller " Benjamin Zores
2010-06-10 15:07   ` saeed bishara [this message]
  -- 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=AANLkTim9rZEXhpiY17Co3mvM1YOgtqlmRhgU3ofHJMgV@mail.gmail.com \
    --to=saeed.bishara@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).