From 733ecc5c06bb2892f04ab1881721d665644cd261 Mon Sep 17 00:00:00 2001 From: Hiroshi DOYU Date: Mon, 23 Mar 2009 18:07:23 -0700 Subject: omap mailbox: cleanup omap2 register definition with macro Signed-off-by: Hiroshi DOYU --- arch/arm/mach-omap2/mailbox.c | 77 ++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 48 deletions(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index 32b7af3c610..4487a4de52f 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c @@ -1,9 +1,9 @@ /* - * Mailbox reservation modules for OMAP2 + * Mailbox reservation modules for OMAP2/3 * - * Copyright (C) 2006 Nokia Corporation + * Copyright (C) 2006-2009 Nokia Corporation * Written by: Hiroshi DOYU - * and Paul Mundt + * and Paul Mundt * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive @@ -18,40 +18,19 @@ #include #include -#define MAILBOX_REVISION 0x00 -#define MAILBOX_SYSCONFIG 0x10 -#define MAILBOX_SYSSTATUS 0x14 -#define MAILBOX_MESSAGE_0 0x40 -#define MAILBOX_MESSAGE_1 0x44 -#define MAILBOX_MESSAGE_2 0x48 -#define MAILBOX_MESSAGE_3 0x4c -#define MAILBOX_MESSAGE_4 0x50 -#define MAILBOX_MESSAGE_5 0x54 -#define MAILBOX_FIFOSTATUS_0 0x80 -#define MAILBOX_FIFOSTATUS_1 0x84 -#define MAILBOX_FIFOSTATUS_2 0x88 -#define MAILBOX_FIFOSTATUS_3 0x8c -#define MAILBOX_FIFOSTATUS_4 0x90 -#define MAILBOX_FIFOSTATUS_5 0x94 -#define MAILBOX_MSGSTATUS_0 0xc0 -#define MAILBOX_MSGSTATUS_1 0xc4 -#define MAILBOX_MSGSTATUS_2 0xc8 -#define MAILBOX_MSGSTATUS_3 0xcc -#define MAILBOX_MSGSTATUS_4 0xd0 -#define MAILBOX_MSGSTATUS_5 0xd4 -#define MAILBOX_IRQSTATUS_0 0x100 -#define MAILBOX_IRQENABLE_0 0x104 -#define MAILBOX_IRQSTATUS_1 0x108 -#define MAILBOX_IRQENABLE_1 0x10c -#define MAILBOX_IRQSTATUS_2 0x110 -#define MAILBOX_IRQENABLE_2 0x114 -#define MAILBOX_IRQSTATUS_3 0x118 -#define MAILBOX_IRQENABLE_3 0x11c +#define MAILBOX_REVISION 0x000 +#define MAILBOX_SYSCONFIG 0x010 +#define MAILBOX_SYSSTATUS 0x014 +#define MAILBOX_MESSAGE(m) (0x040 + 4 * (m)) +#define MAILBOX_FIFOSTATUS(m) (0x080 + 4 * (m)) +#define MAILBOX_MSGSTATUS(m) (0x0c0 + 4 * (m)) +#define MAILBOX_IRQSTATUS(u) (0x100 + 8 * (u)) +#define MAILBOX_IRQENABLE(u) (0x104 + 8 * (u)) -static unsigned long mbox_base; +#define MAILBOX_IRQ_NEWMSG(u) (1 << (2 * (u))) +#define MAILBOX_IRQ_NOTFULL(u) (1 << (2 * (u) + 1)) -#define MAILBOX_IRQ_NOTFULL(n) (1 << (2 * (n) + 1)) -#define MAILBOX_IRQ_NEWMSG(n) (1 << (2 * (n))) +static unsigned long mbox_base; struct omap_mbox2_fifo { unsigned long msg; @@ -209,15 +188,15 @@ static struct omap_mbox_ops omap2_mbox_ops = { /* DSP */ static struct omap_mbox2_priv omap2_mbox_dsp_priv = { .tx_fifo = { - .msg = MAILBOX_MESSAGE_0, - .fifo_stat = MAILBOX_FIFOSTATUS_0, + .msg = MAILBOX_MESSAGE(0), + .fifo_stat = MAILBOX_FIFOSTATUS(0), }, .rx_fifo = { - .msg = MAILBOX_MESSAGE_1, - .msg_stat = MAILBOX_MSGSTATUS_1, + .msg = MAILBOX_MESSAGE(1), + .msg_stat = MAILBOX_MSGSTATUS(1), }, - .irqenable = MAILBOX_IRQENABLE_0, - .irqstatus = MAILBOX_IRQSTATUS_0, + .irqenable = MAILBOX_IRQENABLE(0), + .irqstatus = MAILBOX_IRQSTATUS(0), .notfull_bit = MAILBOX_IRQ_NOTFULL(0), .newmsg_bit = MAILBOX_IRQ_NEWMSG(1), }; @@ -232,15 +211,15 @@ EXPORT_SYMBOL(mbox_dsp_info); /* IVA */ static struct omap_mbox2_priv omap2_mbox_iva_priv = { .tx_fifo = { - .msg = MAILBOX_MESSAGE_2, - .fifo_stat = MAILBOX_FIFOSTATUS_2, + .msg = MAILBOX_MESSAGE(2), + .fifo_stat = MAILBOX_FIFOSTATUS(2), }, .rx_fifo = { - .msg = MAILBOX_MESSAGE_3, - .msg_stat = MAILBOX_MSGSTATUS_3, + .msg = MAILBOX_MESSAGE(3), + .msg_stat = MAILBOX_MSGSTATUS(3), }, - .irqenable = MAILBOX_IRQENABLE_3, - .irqstatus = MAILBOX_IRQSTATUS_3, + .irqenable = MAILBOX_IRQENABLE(3), + .irqstatus = MAILBOX_IRQSTATUS(3), .notfull_bit = MAILBOX_IRQ_NOTFULL(2), .newmsg_bit = MAILBOX_IRQ_NEWMSG(3), }; @@ -320,4 +299,6 @@ static void __exit omap2_mbox_exit(void) module_init(omap2_mbox_init); module_exit(omap2_mbox_exit); -MODULE_LICENSE("GPL"); +MODULE_LICENSE("GPL v2"); +MODULE_DESCRIPTION("omap mailbox: omap2/3 architecture specific functions"); +MODULE_AUTHOR("Hiroshi DOYU , Paul Mundt"); -- cgit v1.2.3 From 6c20a68372f158def0a29657ce11b3609ed24f9a Mon Sep 17 00:00:00 2001 From: Hiroshi DOYU Date: Mon, 23 Mar 2009 18:07:23 -0700 Subject: omap mailbox: add initial omap3 support Signed-off-by: Hiroshi DOYU --- arch/arm/mach-omap2/devices.c | 37 ++++++++++++++++++----- arch/arm/mach-omap2/mailbox.c | 70 ++++++++++++++++++++++++++----------------- 2 files changed, 71 insertions(+), 36 deletions(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index ce03fa75077..d5f2a8118df 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -28,13 +28,14 @@ #include #include -#if defined(CONFIG_OMAP_DSP) || defined(CONFIG_OMAP_DSP_MODULE) -#define OMAP2_MBOX_BASE IO_ADDRESS(OMAP24XX_MAILBOX_BASE) +#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) -static struct resource mbox_resources[] = { +#define MBOX_REG_SIZE 0x120 + +static struct resource omap2_mbox_resources[] = { { - .start = OMAP2_MBOX_BASE, - .end = OMAP2_MBOX_BASE + 0x11f, + .start = OMAP24XX_MAILBOX_BASE, + .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, .flags = IORESOURCE_MEM, }, { @@ -47,20 +48,40 @@ static struct resource mbox_resources[] = { }, }; +static struct resource omap3_mbox_resources[] = { + { + .start = OMAP34XX_MAILBOX_BASE, + .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + { + .start = INT_24XX_MAIL_U0_MPU, + .flags = IORESOURCE_IRQ, + }, +}; + static struct platform_device mbox_device = { .name = "mailbox", .id = -1, - .num_resources = ARRAY_SIZE(mbox_resources), - .resource = mbox_resources, }; static inline void omap_init_mbox(void) { + if (cpu_is_omap2420()) { + mbox_device.num_resources = ARRAY_SIZE(omap2_mbox_resources); + mbox_device.resource = omap2_mbox_resources; + } else if (cpu_is_omap3430()) { + mbox_device.num_resources = ARRAY_SIZE(omap3_mbox_resources); + mbox_device.resource = omap3_mbox_resources; + } else { + pr_err("%s: platform not supported\n", __func__); + return; + } platform_device_register(&mbox_device); } #else static inline void omap_init_mbox(void) { } -#endif +#endif /* CONFIG_OMAP_MBOX_FWK */ #if defined(CONFIG_OMAP_STI) diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index 4487a4de52f..d925ef3d7d4 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c @@ -30,7 +30,7 @@ #define MAILBOX_IRQ_NEWMSG(u) (1 << (2 * (u))) #define MAILBOX_IRQ_NOTFULL(u) (1 << (2 * (u) + 1)) -static unsigned long mbox_base; +static void __iomem *mbox_base; struct omap_mbox2_fifo { unsigned long msg; @@ -52,14 +52,14 @@ static struct clk *mbox_ick_handle; static void omap2_mbox_enable_irq(struct omap_mbox *mbox, omap_mbox_type_t irq); -static inline unsigned int mbox_read_reg(unsigned int reg) +static inline unsigned int mbox_read_reg(size_t ofs) { - return __raw_readl(mbox_base + reg); + return __raw_readl(mbox_base + ofs); } -static inline void mbox_write_reg(unsigned int val, unsigned int reg) +static inline void mbox_write_reg(u32 val, size_t ofs) { - __raw_writel(val, mbox_base + reg); + __raw_writel(val, mbox_base + ofs); } /* Mailbox H/W preparations */ @@ -208,7 +208,7 @@ struct omap_mbox mbox_dsp_info = { }; EXPORT_SYMBOL(mbox_dsp_info); -/* IVA */ +#if defined(CONFIG_ARCH_OMAP2420) /* IVA */ static struct omap_mbox2_priv omap2_mbox_iva_priv = { .tx_fifo = { .msg = MAILBOX_MESSAGE(2), @@ -229,17 +229,12 @@ static struct omap_mbox mbox_iva_info = { .ops = &omap2_mbox_ops, .priv = &omap2_mbox_iva_priv, }; +#endif static int __init omap2_mbox_probe(struct platform_device *pdev) { struct resource *res; - int ret = 0; - - if (pdev->num_resources != 3) { - dev_err(&pdev->dev, "invalid number of resources: %d\n", - pdev->num_resources); - return -ENODEV; - } + int ret; /* MBOX base */ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -247,34 +242,53 @@ static int __init omap2_mbox_probe(struct platform_device *pdev) dev_err(&pdev->dev, "invalid mem resource\n"); return -ENODEV; } - mbox_base = res->start; + mbox_base = ioremap(res->start, res->end - res->start); + if (!mbox_base) + return -ENOMEM; - /* DSP IRQ */ - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (unlikely(!res)) { + /* DSP or IVA2 IRQ */ + mbox_dsp_info.irq = platform_get_irq(pdev, 0); + if (mbox_dsp_info.irq < 0) { dev_err(&pdev->dev, "invalid irq resource\n"); - return -ENODEV; + ret = -ENODEV; + goto err_dsp; } - mbox_dsp_info.irq = res->start; ret = omap_mbox_register(&mbox_dsp_info); - - /* IVA IRQ */ - res = platform_get_resource(pdev, IORESOURCE_IRQ, 1); - if (unlikely(!res)) { - dev_err(&pdev->dev, "invalid irq resource\n"); - return -ENODEV; + if (ret) + goto err_dsp; + +#if defined(CONFIG_ARCH_OMAP2420) /* IVA */ + if (cpu_is_omap2420()) { + /* IVA IRQ */ + res = platform_get_resource(pdev, IORESOURCE_IRQ, 1); + if (unlikely(!res)) { + dev_err(&pdev->dev, "invalid irq resource\n"); + ret = -ENODEV; + goto err_iva1; + } + mbox_iva_info.irq = res->start; + ret = omap_mbox_register(&mbox_iva_info); + if (ret) + goto err_iva1; } - mbox_iva_info.irq = res->start; - - ret = omap_mbox_register(&mbox_iva_info); +#endif + return 0; +err_iva1: + omap_mbox_unregister(&mbox_dsp_info); +err_dsp: + iounmap(mbox_base); return ret; } static int omap2_mbox_remove(struct platform_device *pdev) { +#if defined(CONFIG_ARCH_OMAP2420) + omap_mbox_unregister(&mbox_iva_info); +#endif omap_mbox_unregister(&mbox_dsp_info); + iounmap(mbox_base); return 0; } -- cgit v1.2.3 From 94fc58c6da019257680ae711c061cb403582a362 Mon Sep 17 00:00:00 2001 From: Hiroshi DOYU Date: Mon, 23 Mar 2009 18:07:24 -0700 Subject: omap mailbox: print hardware revision at startup Signed-off-by: Hiroshi DOYU --- arch/arm/mach-omap2/mailbox.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index d925ef3d7d4..44e9101ab69 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c @@ -74,6 +74,9 @@ static int omap2_mbox_startup(struct omap_mbox *mbox) } clk_enable(mbox_ick_handle); + l = mbox_read_reg(MAILBOX_REVISION); + pr_info("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f)); + /* set smart-idle & autoidle */ l = mbox_read_reg(MAILBOX_SYSCONFIG); l |= 0x00000011; -- cgit v1.2.3 From da8cfe03a461fe759041e7f130f96913b262aa6b Mon Sep 17 00:00:00 2001 From: Hiroshi DOYU Date: Mon, 23 Mar 2009 18:07:25 -0700 Subject: omap mailbox: fix empty struct device for omap2 Signed-off-by: Hiroshi DOYU --- arch/arm/mach-omap2/devices.c | 2 +- arch/arm/mach-omap2/mailbox.c | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index d5f2a8118df..14537ffd8af 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -61,7 +61,7 @@ static struct resource omap3_mbox_resources[] = { }; static struct platform_device mbox_device = { - .name = "mailbox", + .name = "omap2-mailbox", .id = -1, }; diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index 44e9101ab69..0b8476ba95f 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c @@ -234,7 +234,7 @@ static struct omap_mbox mbox_iva_info = { }; #endif -static int __init omap2_mbox_probe(struct platform_device *pdev) +static int __devinit omap2_mbox_probe(struct platform_device *pdev) { struct resource *res; int ret; @@ -257,7 +257,7 @@ static int __init omap2_mbox_probe(struct platform_device *pdev) goto err_dsp; } - ret = omap_mbox_register(&mbox_dsp_info); + ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info); if (ret) goto err_dsp; @@ -271,7 +271,7 @@ static int __init omap2_mbox_probe(struct platform_device *pdev) goto err_iva1; } mbox_iva_info.irq = res->start; - ret = omap_mbox_register(&mbox_iva_info); + ret = omap_mbox_register(&pdev->dev, &mbox_iva_info); if (ret) goto err_iva1; } @@ -285,7 +285,7 @@ err_dsp: return ret; } -static int omap2_mbox_remove(struct platform_device *pdev) +static int __devexit omap2_mbox_remove(struct platform_device *pdev) { #if defined(CONFIG_ARCH_OMAP2420) omap_mbox_unregister(&mbox_iva_info); @@ -297,9 +297,9 @@ static int omap2_mbox_remove(struct platform_device *pdev) static struct platform_driver omap2_mbox_driver = { .probe = omap2_mbox_probe, - .remove = omap2_mbox_remove, + .remove = __devexit_p(omap2_mbox_remove), .driver = { - .name = "mailbox", + .name = "omap2-mailbox", }, }; @@ -319,3 +319,4 @@ module_exit(omap2_mbox_exit); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("omap mailbox: omap2/3 architecture specific functions"); MODULE_AUTHOR("Hiroshi DOYU , Paul Mundt"); +MODULE_ALIAS("platform:omap2-mailbox"); -- cgit v1.2.3 From c75ee7520b4ad48a6948f51ca43b2e46ebd3696a Mon Sep 17 00:00:00 2001 From: Hiroshi DOYU Date: Mon, 23 Mar 2009 18:07:26 -0700 Subject: omap mailbox: add save_/restore_ctx() for PM To preserve the registers during off-mode Signed-off-by: Hiroshi DOYU --- arch/arm/mach-omap2/mailbox.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index 0b8476ba95f..fd5b8a5925c 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c @@ -30,6 +30,9 @@ #define MAILBOX_IRQ_NEWMSG(u) (1 << (2 * (u))) #define MAILBOX_IRQ_NOTFULL(u) (1 << (2 * (u) + 1)) +#define MBOX_REG_SIZE 0x120 +#define MBOX_NR_REGS (MBOX_REG_SIZE / sizeof(u32)) + static void __iomem *mbox_base; struct omap_mbox2_fifo { @@ -45,6 +48,7 @@ struct omap_mbox2_priv { unsigned long irqstatus; u32 newmsg_bit; u32 notfull_bit; + u32 ctx[MBOX_NR_REGS]; }; static struct clk *mbox_ick_handle; @@ -165,6 +169,32 @@ static int omap2_mbox_is_irq(struct omap_mbox *mbox, return (enable & status & bit); } +static void omap2_mbox_save_ctx(struct omap_mbox *mbox) +{ + int i; + struct omap_mbox2_priv *p = mbox->priv; + + for (i = 0; i < MBOX_NR_REGS; i++) { + p->ctx[i] = mbox_read_reg(i * sizeof(u32)); + + dev_dbg(mbox->dev, "%s: [%02x] %08x\n", __func__, + i, p->ctx[i]); + } +} + +static void omap2_mbox_restore_ctx(struct omap_mbox *mbox) +{ + int i; + struct omap_mbox2_priv *p = mbox->priv; + + for (i = 0; i < MBOX_NR_REGS; i++) { + mbox_write_reg(p->ctx[i], i * sizeof(u32)); + + dev_dbg(mbox->dev, "%s: [%02x] %08x\n", __func__, + i, p->ctx[i]); + } +} + static struct omap_mbox_ops omap2_mbox_ops = { .type = OMAP_MBOX_TYPE2, .startup = omap2_mbox_startup, @@ -177,6 +207,8 @@ static struct omap_mbox_ops omap2_mbox_ops = { .disable_irq = omap2_mbox_disable_irq, .ack_irq = omap2_mbox_ack_irq, .is_irq = omap2_mbox_is_irq, + .save_ctx = omap2_mbox_save_ctx, + .restore_ctx = omap2_mbox_restore_ctx, }; /* -- cgit v1.2.3 From a362fdbddb713d27ec0931a8be64b767f85bae0d Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Mon, 23 Mar 2009 18:07:35 -0700 Subject: ARM: OMAP: No need to include board-omap2430sdp.h from hardware.h Move the defines to the associated board file and remove the now unnecessary header file. Also rename SDP2430_ETHR_GPIO_IRQ to SDP2430_ETHR_GPIO_IRQ. Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-2430sdp.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index 83fa37211d7..c8abe6a8dfe 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c @@ -38,9 +38,12 @@ #include "mmc-twl4030.h" +#define SDP2430_CS0_BASE 0x04000000 #define SDP2430_FLASH_CS 0 #define SDP2430_SMC91X_CS 5 +#define SDP2430_ETHR_GPIO_IRQ 149 + static struct mtd_partition sdp2430_partitions[] = { /* bootloader (U-Boot, etc) in first sector */ { @@ -102,8 +105,8 @@ static struct resource sdp2430_smc91x_resources[] = { .flags = IORESOURCE_MEM, }, [1] = { - .start = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ), - .end = OMAP_GPIO_IRQ(OMAP24XX_ETHR_GPIO_IRQ), + .start = OMAP_GPIO_IRQ(SDP2430_ETHR_GPIO_IRQ), + .end = OMAP_GPIO_IRQ(SDP2430_ETHR_GPIO_IRQ), .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, }, }; @@ -170,13 +173,13 @@ static inline void __init sdp2430_init_smc91x(void) sdp2430_smc91x_resources[0].end = cs_mem_base + 0x30f; udelay(100); - if (gpio_request(OMAP24XX_ETHR_GPIO_IRQ, "SMC91x irq") < 0) { + if (gpio_request(SDP2430_ETHR_GPIO_IRQ, "SMC91x irq") < 0) { printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", - OMAP24XX_ETHR_GPIO_IRQ); + SDP2430_ETHR_GPIO_IRQ); gpmc_cs_free(eth_cs); goto out; } - gpio_direction_input(OMAP24XX_ETHR_GPIO_IRQ); + gpio_direction_input(SDP2430_ETHR_GPIO_IRQ); out: clk_disable(gpmc_fck); -- cgit v1.2.3 From 7055477558686e106149bf0bb0edc0f5cd848ad9 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Mon, 23 Mar 2009 18:07:35 -0700 Subject: ARM: OMAP: No need to include board-apollon.h from hardware.h Move the defines to the associated board file and remove the now unnecessary header file. Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-apollon.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 0a7b24ba165..64561247d93 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c @@ -51,6 +51,7 @@ #define APOLLON_FLASH_CS 0 #define APOLLON_ETH_CS 1 +#define APOLLON_ETHR_GPIO_IRQ 74 static struct mtd_partition apollon_partitions[] = { { -- cgit v1.2.3 From 40662d77311d8de3a26c33f2fd5a2d4d810a4c8a Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Mon, 23 Mar 2009 18:07:36 -0700 Subject: ARM: OMAP: No need to include board-h4.h from hardware.h Move the defines to the associated board file and remove the now unnecessary header file. Also rename OMAP24XX_ETHR_GPIO_IRQ to H4_ETHR_GPIO_IRQ. Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-h4.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index 5e9b14675b1..71226973eee 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c @@ -47,6 +47,8 @@ #define H4_FLASH_CS 0 #define H4_SMC91X_CS 1 +#define H4_ETHR_GPIO_IRQ 92 + static unsigned int row_gpios[6] = { 88, 89, 124, 11, 6, 96 }; static unsigned int col_gpios[7] = { 90, 91, 100, 36, 12, 97, 98 }; @@ -341,7 +343,7 @@ static inline void __init h4_init_debug(void) udelay(100); omap_cfg_reg(M15_24XX_GPIO92); - if (debug_card_init(cs_mem_base, OMAP24XX_ETHR_GPIO_IRQ) < 0) + if (debug_card_init(cs_mem_base, H4_ETHR_GPIO_IRQ) < 0) gpmc_cs_free(eth_cs); out: -- cgit v1.2.3 From ec7558a62d2e28ec607fdfab1cd39b475d929ce5 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Mon, 23 Mar 2009 18:07:37 -0700 Subject: ARM: OMAP: No need to include board-ldp.h from hardware.h Move the defines to the associated board file and remove the now unnecessary header file. Also rename OMAP34XX_ETHR_START to LDP_ETHR_START. Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-ldp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index 6031e179926..f035d7836e5 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c @@ -28,7 +28,6 @@ #include #include -#include #include #include #include @@ -41,12 +40,15 @@ #include "mmc-twl4030.h" -#define SDP3430_SMC91X_CS 3 +#define LDP_SMC911X_CS 1 +#define LDP_SMC911X_GPIO 152 +#define DEBUG_BASE 0x08000000 +#define LDP_ETHR_START DEBUG_BASE static struct resource ldp_smc911x_resources[] = { [0] = { - .start = OMAP34XX_ETHR_START, - .end = OMAP34XX_ETHR_START + SZ_4K, + .start = LDP_ETHR_START, + .end = LDP_ETHR_START + SZ_4K, .flags = IORESOURCE_MEM, }, [1] = { -- cgit v1.2.3 From 0d4d9ab08ac28b4742dadc35b5ac7613abf71475 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Mon, 23 Mar 2009 18:07:38 -0700 Subject: ARM: OMAP: No need to include board-overo.h from hardware.h Move the defines to the associated board file and remove the now unnecessary header file. Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-overo.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 82b3dc557c9..b92313c8b84 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -37,7 +37,6 @@ #include #include -#include #include #include #include @@ -47,6 +46,12 @@ #include "mmc-twl4030.h" +#define OVERO_GPIO_BT_XGATE 15 +#define OVERO_GPIO_W2W_NRESET 16 +#define OVERO_GPIO_BT_NRESET 164 +#define OVERO_GPIO_USBH_CPEN 168 +#define OVERO_GPIO_USBH_NRESET 183 + #define NAND_BLOCK_SIZE SZ_128K #define GPMC_CS0_BASE 0x60 #define GPMC_CS_SIZE 0x30 -- cgit v1.2.3 From b0b5aa3f4c17c6a21423b9728d701216ab2e1ff1 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Mon, 23 Mar 2009 18:07:49 -0700 Subject: ARM: OMAP: get rid of OMAP_TAG_USB, v2 OMAP_TAGS should vanish soon since they're not generic arm tags. Most of them can be converted to a platform_data or parsed from a command line like e.g. serial tag. For OMAP_TAG_USB we just let boards call omap_usb_init() passing a pointer to omap_usb_config. Patch updated by Tony for mainline, basically make n770 and h4 compile. Also folded in a fix for OSK by David Brownell . Signed-off-by: Felipe Balbi Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-apollon.c | 2 +- arch/arm/mach-omap2/board-h4.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 64561247d93..41823538d36 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c @@ -273,7 +273,6 @@ static struct omap_lcd_config apollon_lcd_config __initdata = { static struct omap_board_config_kernel apollon_config[] = { { OMAP_TAG_UART, &apollon_uart_config }, - { OMAP_TAG_USB, &apollon_usb_config }, { OMAP_TAG_LCD, &apollon_lcd_config }, }; @@ -300,6 +299,7 @@ static void __init apollon_usb_init(void) omap_cfg_reg(P21_242X_GPIO12); gpio_request(12, "USB suspend"); gpio_direction_output(12, 0); + omap_usb_init(&apollon_usb_config); } static void __init omap_apollon_init(void) diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index 71226973eee..1343cebd19a 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c @@ -379,6 +379,39 @@ static struct omap_lcd_config h4_lcd_config __initdata = { .ctrl_name = "internal", }; +static struct omap_usb_config h4_usb_config __initdata = { +#ifdef CONFIG_MACH_OMAP2_H4_USB1 + /* NOTE: usb1 could also be used with 3 wire signaling */ + .pins[1] = 4, +#endif + +#ifdef CONFIG_MACH_OMAP_H4_OTG + /* S1.10 ON -- USB OTG port + * usb0 switched to Mini-AB port and isp1301 transceiver; + * S2.POS3 = OFF, S2.POS4 = ON ... to allow battery charging + */ + .otg = 1, + .pins[0] = 4, +#ifdef CONFIG_USB_GADGET_OMAP + /* use OTG cable, or standard A-to-MiniB */ + .hmc_mode = 0x14, /* 0:dev/otg 1:host 2:disable */ +#elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) + /* use OTG cable, or NONSTANDARD (B-to-MiniB) */ + .hmc_mode = 0x11, /* 0:host 1:host 2:disable */ +#endif /* XX */ + +#else + /* S1.10 OFF -- usb "download port" + * usb0 switched to Mini-B port and isp1105 transceiver; + * S2.POS3 = ON, S2.POS4 = OFF ... to enable battery charging + */ + .register_dev = 1, + .pins[0] = 3, +/* .hmc_mode = 0x14,*/ /* 0:dev 1:host 2:disable */ + .hmc_mode = 0x00, /* 0:dev|otg 1:disable 2:disable */ +#endif +}; + static struct omap_board_config_kernel h4_config[] = { { OMAP_TAG_UART, &h4_uart_config }, { OMAP_TAG_LCD, &h4_lcd_config }, @@ -430,6 +463,7 @@ static void __init omap_h4_init(void) platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices)); omap_board_config = h4_config; omap_board_config_size = ARRAY_SIZE(h4_config); + omap_usb_init(&h4_usb_config); omap_serial_init(); } -- cgit v1.2.3 From 2bb6c8026ccfa26ba713f4462f661aba7dd4dc16 Mon Sep 17 00:00:00 2001 From: Jarkko Nikula Date: Mon, 23 Mar 2009 18:23:46 -0700 Subject: ARM: OMAP3: Remove unused CONFIG_I2C2_OMAP_BEAGLE There is no CONFIG_I2C2_OMAP_BEAGLE in mainline and it is under removal in linux-omap also so remove this dead code now. Signed-off-by: Jarkko Nikula Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-omap3beagle.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index e39cd2c46cf..e3c862866b7 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -175,9 +175,6 @@ static int __init omap3_beagle_i2c_init(void) { omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo, ARRAY_SIZE(beagle_i2c_boardinfo)); -#ifdef CONFIG_I2C2_OMAP_BEAGLE - omap_register_i2c_bus(2, 400, NULL, 0); -#endif /* Bus 3 is attached to the DVI port where devices like the pico DLP * projector don't work reliably with 400kHz */ omap_register_i2c_bus(3, 100, NULL, 0); -- cgit v1.2.3 From b9d766c767d53a9be1f741a53fe8151354ba1da3 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Mon, 23 Mar 2009 18:23:46 -0700 Subject: ARM: OMAP3: Add more GPIO mux options This patch adds several new GPIO pins and updates the pin naming comments. The patch is based on earlier patches on linux-omap list by Manikandan Pillai , Vaibhav Hiremath and David Brownell . Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/mux.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index dacb41f130c..026c4fc883a 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c @@ -453,10 +453,37 @@ MUX_CFG_34XX("AC1_3430_USB3FS_PHY_MM3_TXEN_N", 0x18a, /* 34XX GPIO - bidirectional, unless the name has an "_OUT" suffix. + * (Always specify PIN_INPUT, except for names suffixed by "_OUT".) * No internal pullup/pulldown without "_UP" or "_DOWN" suffix. */ +MUX_CFG_34XX("AF26_34XX_GPIO0", 0x1e0, + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) +MUX_CFG_34XX("AF22_34XX_GPIO9", 0xa18, + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa, OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) +MUX_CFG_34XX("U8_34XX_GPIO54_OUT", 0x0b4, + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) +MUX_CFG_34XX("U8_34XX_GPIO54_DOWN", 0x0b4, + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLDOWN) +MUX_CFG_34XX("L8_34XX_GPIO63", 0x0ce, + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) +MUX_CFG_34XX("G25_34XX_GPIO86_OUT", 0x0fc, + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) +MUX_CFG_34XX("AG4_34XX_GPIO134_OUT", 0x160, + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) +MUX_CFG_34XX("AE4_34XX_GPIO136_OUT", 0x164, + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) +MUX_CFG_34XX("AF6_34XX_GPIO140_UP", 0x16c, + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT_PULLUP) +MUX_CFG_34XX("AE6_34XX_GPIO141", 0x16e, + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) +MUX_CFG_34XX("AF5_34XX_GPIO142", 0x170, + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) +MUX_CFG_34XX("AE5_34XX_GPIO143", 0x172, + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) +MUX_CFG_34XX("H19_34XX_GPIO164_OUT", 0x19c, + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) MUX_CFG_34XX("J25_34XX_GPIO170", 0x1c6, OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) }; -- cgit v1.2.3 From 8466032d862a2e52d73af3311bc97f950aaa36c8 Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Mon, 23 Mar 2009 18:23:46 -0700 Subject: ARM: OMAP3: mmc-twl4030 fix name buffer length, v2 Add 1 to buffer length for null terminator and use snprintf. Signed-off-by: Adrian Hunter Acked-by: David Brownell Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/mmc-twl4030.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c index 437f52073f6..84cac87537a 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.c +++ b/arch/arm/mach-omap2/mmc-twl4030.c @@ -59,7 +59,7 @@ static struct twl_mmc_controller { struct omap_mmc_platform_data *mmc; u8 twl_vmmc_dev_grp; u8 twl_mmc_dedicated; - char name[HSMMC_NAME_LEN]; + char name[HSMMC_NAME_LEN + 1]; } hsmmc[] = { { .twl_vmmc_dev_grp = VMMC1_DEV_GRP, @@ -349,7 +349,8 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) return; } - sprintf(twl->name, "mmc%islot%i", c->mmc, 1); + snprintf(twl->name, ARRAY_SIZE(twl->name), "mmc%islot%i", + c->mmc, 1); mmc->slots[0].name = twl->name; mmc->nr_slots = 1; mmc->slots[0].ocr_mask = MMC_VDD_165_195 | -- cgit v1.2.3 From 0329c3773e59aa7e50dc3760a27fb4e098773d0f Mon Sep 17 00:00:00 2001 From: David Brownell Date: Mon, 23 Mar 2009 18:23:47 -0700 Subject: ARM: OMAP3: mmc-twl4030 voltage cleanup Correct twl4030 MMC power switching: fix voltage ranges reported for each slot, and handle them fully. Lies corrected: - MMC-1 doesn't support the 2.6-2.7 Volt range - MMC-2 can't normally support anything except 1.8V Omissions corrected - MMC-1 *does* handle the 2.8-2.9 Volt range - MMC-2 can handle 2.5-3.2 Volt cards, given a transceiver Add transciever support for MMC-2; enable it for Overo and Pandora. (Depends on something else to have set up pinmuxing for control signals instead of as MMC2_DAT4..7 pins.) Also shrink twl4030_hsmmc_info a smidgeon ... padding is all gone. Signed-off-by: David Brownell Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-omap3pandora.c | 1 + arch/arm/mach-omap2/board-overo.c | 1 + arch/arm/mach-omap2/mmc-twl4030.c | 127 +++++++++++++++++++------------ arch/arm/mach-omap2/mmc-twl4030.h | 3 +- 4 files changed, 84 insertions(+), 48 deletions(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index b3196107afd..7a46a6563a5 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c @@ -53,6 +53,7 @@ static struct twl4030_hsmmc_info omap3pandora_mmc[] = { .gpio_cd = -EINVAL, .gpio_wp = 127, .ext_clock = 1, + .transceiver = true, }, {} /* Terminator */ }; diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index b92313c8b84..9c14324d8c6 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -214,6 +214,7 @@ static struct twl4030_hsmmc_info mmc[] __initdata = { .wires = 4, .gpio_cd = -EINVAL, .gpio_wp = -EINVAL, + .transceiver = true, }, {} /* Terminator */ }; diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c index 84cac87537a..df1539e2cd0 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.c +++ b/arch/arm/mach-omap2/mmc-twl4030.c @@ -44,6 +44,7 @@ #define VMMC2_315V 0x0c #define VMMC2_300V 0x0b #define VMMC2_285V 0x0a +#define VMMC2_280V 0x09 #define VMMC2_260V 0x08 #define VMMC2_185V 0x06 #define VMMC2_DEDICATED 0x2E @@ -166,56 +167,73 @@ static int twl_mmc_resume(struct device *dev, int slot) /* * Sets the MMC voltage in twl4030 */ + +#define MMC1_OCR (MMC_VDD_165_195 \ + |MMC_VDD_28_29|MMC_VDD_29_30|MMC_VDD_30_31|MMC_VDD_31_32) +#define MMC2_OCR (MMC_VDD_165_195 \ + |MMC_VDD_25_26|MMC_VDD_26_27|MMC_VDD_27_28 \ + |MMC_VDD_28_29|MMC_VDD_29_30|MMC_VDD_30_31|MMC_VDD_31_32) + static int twl_mmc_set_voltage(struct twl_mmc_controller *c, int vdd) { int ret; u8 vmmc, dev_grp_val; - switch (1 << vdd) { - case MMC_VDD_35_36: - case MMC_VDD_34_35: - case MMC_VDD_33_34: - case MMC_VDD_32_33: - case MMC_VDD_31_32: - case MMC_VDD_30_31: - if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP) - vmmc = VMMC1_315V; - else - vmmc = VMMC2_315V; - break; - case MMC_VDD_29_30: - if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP) - vmmc = VMMC1_315V; - else - vmmc = VMMC2_300V; - break; - case MMC_VDD_27_28: - case MMC_VDD_26_27: - if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP) - vmmc = VMMC1_285V; - else - vmmc = VMMC2_285V; - break; - case MMC_VDD_25_26: - case MMC_VDD_24_25: - case MMC_VDD_23_24: - case MMC_VDD_22_23: - case MMC_VDD_21_22: - case MMC_VDD_20_21: - if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP) - vmmc = VMMC1_285V; - else - vmmc = VMMC2_260V; - break; - case MMC_VDD_165_195: - if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP) + if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP) { + /* VMMC1: max 220 mA. And for 8-bit mode, + * VSIM: max 50 mA + */ + switch (1 << vdd) { + case MMC_VDD_165_195: vmmc = VMMC1_185V; - else + /* and VSIM_180V */ + break; + case MMC_VDD_28_29: + vmmc = VMMC1_285V; + /* and VSIM_280V */ + break; + case MMC_VDD_29_30: + case MMC_VDD_30_31: + vmmc = VMMC1_300V; + /* and VSIM_300V */ + break; + case MMC_VDD_31_32: + vmmc = VMMC1_315V; + /* error if VSIM needed */ + break; + default: + vmmc = 0; + break; + } + } else if (c->twl_vmmc_dev_grp == VMMC2_DEV_GRP) { + /* VMMC2: max 100 mA */ + switch (1 << vdd) { + case MMC_VDD_165_195: vmmc = VMMC2_185V; - break; - default: - vmmc = 0; - break; + break; + case MMC_VDD_25_26: + case MMC_VDD_26_27: + vmmc = VMMC2_260V; + break; + case MMC_VDD_27_28: + vmmc = VMMC2_280V; + break; + case MMC_VDD_28_29: + vmmc = VMMC2_285V; + break; + case MMC_VDD_29_30: + case MMC_VDD_30_31: + vmmc = VMMC2_300V; + break; + case MMC_VDD_31_32: + vmmc = VMMC2_315V; + break; + default: + vmmc = 0; + break; + } + } else { + return 0; } if (vmmc) @@ -242,6 +260,14 @@ static int twl_mmc1_set_power(struct device *dev, int slot, int power_on, struct twl_mmc_controller *c = &hsmmc[0]; struct omap_mmc_platform_data *mmc = dev->platform_data; + /* + * Assume we power both OMAP VMMC1 (for CMD, CLK, DAT0..3) and the + * card using the same TWL VMMC1 supply (hsmmc[0]); OMAP has both + * 1.8V and 3.0V modes, controlled by the PBIAS register. + * + * In 8-bit modes, OMAP VMMC1A (for DAT4..7) needs a supply, which + * is most naturally TWL VSIM; those pins also use PBIAS. + */ if (power_on) { if (cpu_is_omap2430()) { reg = omap_ctrl_readl(OMAP243X_CONTROL_DEVCONF1); @@ -298,6 +324,12 @@ static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vd struct twl_mmc_controller *c = &hsmmc[1]; struct omap_mmc_platform_data *mmc = dev->platform_data; + /* + * Assume TWL VMMC2 (hsmmc[1]) is used only to power the card ... OMAP + * VDDS is used to power the pins, optionally with a transceiver to + * support cards using voltages other than VDDS (1.8V nominal). When a + * transceiver is used, DAT3..7 are muxed as transceiver control pins. + */ if (power_on) { if (mmc->slots[0].internal_clock) { u32 reg; @@ -353,10 +385,6 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) c->mmc, 1); mmc->slots[0].name = twl->name; mmc->nr_slots = 1; - mmc->slots[0].ocr_mask = MMC_VDD_165_195 | - MMC_VDD_26_27 | MMC_VDD_27_28 | - MMC_VDD_29_30 | - MMC_VDD_30_31 | MMC_VDD_31_32; mmc->slots[0].wires = c->wires; mmc->slots[0].internal_clock = !c->ext_clock; mmc->dma_mask = 0xffffffff; @@ -392,9 +420,14 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) switch (c->mmc) { case 1: mmc->slots[0].set_power = twl_mmc1_set_power; + mmc->slots[0].ocr_mask = MMC1_OCR; break; case 2: mmc->slots[0].set_power = twl_mmc2_set_power; + if (c->transceiver) + mmc->slots[0].ocr_mask = MMC2_OCR; + else + mmc->slots[0].ocr_mask = MMC_VDD_165_195; break; default: pr_err("MMC%d configuration not supported!\n", c->mmc); diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h index e1c8076400c..380dde7bcfe 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.h +++ b/arch/arm/mach-omap2/mmc-twl4030.h @@ -9,9 +9,10 @@ struct twl4030_hsmmc_info { u8 mmc; /* controller 1/2/3 */ u8 wires; /* 1/4/8 wires */ + bool transceiver; /* MMC-2 option */ + bool ext_clock; /* use external pin for input clock */ int gpio_cd; /* or -EINVAL */ int gpio_wp; /* or -EINVAL */ - int ext_clock:1; /* use external pin for input clock */ }; #if defined(CONFIG_TWL4030_CORE) && \ -- cgit v1.2.3 From 01971f65ff88e3ebe2b6ae42b95d68e26b83718d Mon Sep 17 00:00:00 2001 From: David Brownell Date: Mon, 23 Mar 2009 18:23:47 -0700 Subject: ARM: OMAP3: mmc-twl4030 init passes device nodes back, v2 When setting up HSMMC devices, pass the device nodes back so board code can linking them to their power supply regulators. Signed-off-by: David Brownell Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/mmc-twl4030.c | 10 ++++++++++ arch/arm/mach-omap2/mmc-twl4030.h | 1 + 2 files changed, 11 insertions(+) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c index df1539e2cd0..c67078db07b 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.c +++ b/arch/arm/mach-omap2/mmc-twl4030.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -437,6 +438,15 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) } omap2_init_mmc(hsmmc_data, OMAP34XX_NR_MMC); + + /* pass the device nodes back to board setup code */ + for (c = controllers; c->mmc; c++) { + struct omap_mmc_platform_data *mmc = hsmmc_data[c->mmc - 1]; + + if (!c->mmc || c->mmc > nr_hsmmc) + continue; + c->dev = mmc->dev; + } } #endif diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h index 380dde7bcfe..21d35727f92 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.h +++ b/arch/arm/mach-omap2/mmc-twl4030.h @@ -13,6 +13,7 @@ struct twl4030_hsmmc_info { bool ext_clock; /* use external pin for input clock */ int gpio_cd; /* or -EINVAL */ int gpio_wp; /* or -EINVAL */ + struct device *dev; /* returned: pointer to mmc adapter */ }; #if defined(CONFIG_TWL4030_CORE) && \ -- cgit v1.2.3 From 07d83cc9c839a5f05c7c1b6d823a8f483bda0441 Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Mon, 23 Mar 2009 18:23:47 -0700 Subject: ARM: OMAP3: mmc-twl4030 add MMC3 support, v2 Device connected to MMC3 is assumed to be self-powered, so set_power() function is empty. It can't be omited because host driver requires it. Array size for hsmmc[] is specified to allocate to allocate an instance for the third MMC controller. Also fix a leak which happens if invalid controller id is passed. Signed-off-by: Grazvydas Ignotas Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-omap3pandora.c | 6 ++++++ arch/arm/mach-omap2/mmc-twl4030.c | 19 +++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index 7a46a6563a5..6e17180c1a5 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c @@ -55,6 +55,12 @@ static struct twl4030_hsmmc_info omap3pandora_mmc[] = { .ext_clock = 1, .transceiver = true, }, + { + .mmc = 3, + .wires = 4, + .gpio_cd = -EINVAL, + .gpio_wp = -EINVAL, + }, {} /* Terminator */ }; diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c index c67078db07b..d9fad8dda15 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.c +++ b/arch/arm/mach-omap2/mmc-twl4030.c @@ -62,7 +62,7 @@ static struct twl_mmc_controller { u8 twl_vmmc_dev_grp; u8 twl_mmc_dedicated; char name[HSMMC_NAME_LEN + 1]; -} hsmmc[] = { +} hsmmc[OMAP34XX_NR_MMC] = { { .twl_vmmc_dev_grp = VMMC1_DEV_GRP, .twl_mmc_dedicated = VMMC1_DEDICATED, @@ -347,6 +347,16 @@ static int twl_mmc2_set_power(struct device *dev, int slot, int power_on, int vd return ret; } +static int twl_mmc3_set_power(struct device *dev, int slot, int power_on, + int vdd) +{ + /* + * Assume MMC3 has self-powered device connected, for example on-board + * chip with external power source. + */ + return 0; +} + static struct omap_mmc_platform_data *hsmmc_data[OMAP34XX_NR_MMC] __initdata; void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) @@ -415,7 +425,7 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) /* NOTE: we assume OMAP's MMC1 and MMC2 use * the TWL4030's VMMC1 and VMMC2, respectively; - * and that OMAP's MMC3 isn't used. + * and that MMC3 device has it's own power source. */ switch (c->mmc) { @@ -430,8 +440,13 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) else mmc->slots[0].ocr_mask = MMC_VDD_165_195; break; + case 3: + mmc->slots[0].set_power = twl_mmc3_set_power; + mmc->slots[0].ocr_mask = MMC_VDD_165_195; + break; default: pr_err("MMC%d configuration not supported!\n", c->mmc); + kfree(mmc); continue; } hsmmc_data[c->mmc - 1] = mmc; -- cgit v1.2.3 From 034ae7b41720a26cadd4b2f02bf0b23e79240344 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Mon, 23 Mar 2009 18:23:48 -0700 Subject: ARM: OMAP3: mmc-twl4030 fix for vmmc = 0 Resolve longstanding issue noted by Adrian Hunter: confusion between settting VSEL=0 (which is 1.8V on MMC1) and poweroff. Also, leave VSEL alone if we're just powering the regulator off. Signed-off-by: David Brownell Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/mmc-twl4030.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c index d9fad8dda15..d43421400e9 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.c +++ b/arch/arm/mach-omap2/mmc-twl4030.c @@ -178,7 +178,10 @@ static int twl_mmc_resume(struct device *dev, int slot) static int twl_mmc_set_voltage(struct twl_mmc_controller *c, int vdd) { int ret; - u8 vmmc, dev_grp_val; + u8 vmmc = 0, dev_grp_val; + + if (!vdd) + goto doit; if (c->twl_vmmc_dev_grp == VMMC1_DEV_GRP) { /* VMMC1: max 220 mA. And for 8-bit mode, @@ -203,8 +206,7 @@ static int twl_mmc_set_voltage(struct twl_mmc_controller *c, int vdd) /* error if VSIM needed */ break; default: - vmmc = 0; - break; + return -EINVAL; } } else if (c->twl_vmmc_dev_grp == VMMC2_DEV_GRP) { /* VMMC2: max 100 mA */ @@ -230,21 +232,21 @@ static int twl_mmc_set_voltage(struct twl_mmc_controller *c, int vdd) vmmc = VMMC2_315V; break; default: - vmmc = 0; - break; + return -EINVAL; } } else { - return 0; + return -EINVAL; } - if (vmmc) +doit: + if (vdd) dev_grp_val = VMMC_DEV_GRP_P1; /* Power up */ else dev_grp_val = LDO_CLR; /* Power down */ ret = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, dev_grp_val, c->twl_vmmc_dev_grp); - if (ret) + if (ret || !vdd) return ret; ret = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, -- cgit v1.2.3 From 8d75e98b5880f8f02be68ddc3cc4e3d433630d7b Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Mon, 23 Mar 2009 18:23:48 -0700 Subject: ARM: OMAP3: mmc-twl4030 add cover switch Allow a cover switch to be used to cause a rescan of the MMC slot. Signed-off-by: Adrian Hunter Acked-by: David Brownell Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/mmc-twl4030.c | 13 ++++++++++++- arch/arm/mach-omap2/mmc-twl4030.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c index d43421400e9..e2b2aeb713d 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.c +++ b/arch/arm/mach-omap2/mmc-twl4030.c @@ -100,6 +100,14 @@ static int twl_mmc_get_ro(struct device *dev, int slot) return gpio_get_value_cansleep(mmc->slots[0].gpio_wp); } +static int twl_mmc_get_cover_state(struct device *dev, int slot) +{ + struct omap_mmc_platform_data *mmc = dev->platform_data; + + /* NOTE: assumes card detect signal is active-low */ + return !gpio_get_value_cansleep(mmc->slots[0].switch_pin); +} + /* * MMC Slot Initialization. */ @@ -411,7 +419,10 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) mmc->slots[0].switch_pin = c->gpio_cd; mmc->slots[0].card_detect_irq = gpio_to_irq(c->gpio_cd); - mmc->slots[0].card_detect = twl_mmc_card_detect; + if (c->cover_only) + mmc->slots[0].get_cover_state = twl_mmc_get_cover_state; + else + mmc->slots[0].card_detect = twl_mmc_card_detect; } else mmc->slots[0].switch_pin = -EINVAL; diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h index 21d35727f92..0aa168690ed 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.h +++ b/arch/arm/mach-omap2/mmc-twl4030.h @@ -11,6 +11,7 @@ struct twl4030_hsmmc_info { u8 wires; /* 1/4/8 wires */ bool transceiver; /* MMC-2 option */ bool ext_clock; /* use external pin for input clock */ + bool cover_only; /* No card detect - just cover switch */ int gpio_cd; /* or -EINVAL */ int gpio_wp; /* or -EINVAL */ struct device *dev; /* returned: pointer to mmc adapter */ -- cgit v1.2.3 From e51151a53fc85fb1730ec4d6c1474275dcdb9ec3 Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Mon, 23 Mar 2009 18:23:48 -0700 Subject: ARM: OMAP3: mmc-twl4030 allow arbitrary slot names, v3 Signed-off-by: Adrian Hunter Acked-by: David Brownell Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/mmc-twl4030.c | 7 +++++-- arch/arm/mach-omap2/mmc-twl4030.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/mmc-twl4030.c b/arch/arm/mach-omap2/mmc-twl4030.c index e2b2aeb713d..dc40b3e7220 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.c +++ b/arch/arm/mach-omap2/mmc-twl4030.c @@ -402,8 +402,11 @@ void __init twl4030_mmc_init(struct twl4030_hsmmc_info *controllers) return; } - snprintf(twl->name, ARRAY_SIZE(twl->name), "mmc%islot%i", - c->mmc, 1); + if (c->name) + strncpy(twl->name, c->name, HSMMC_NAME_LEN); + else + snprintf(twl->name, ARRAY_SIZE(twl->name), + "mmc%islot%i", c->mmc, 1); mmc->slots[0].name = twl->name; mmc->nr_slots = 1; mmc->slots[0].wires = c->wires; diff --git a/arch/arm/mach-omap2/mmc-twl4030.h b/arch/arm/mach-omap2/mmc-twl4030.h index 0aa168690ed..ea59e862429 100644 --- a/arch/arm/mach-omap2/mmc-twl4030.h +++ b/arch/arm/mach-omap2/mmc-twl4030.h @@ -14,6 +14,7 @@ struct twl4030_hsmmc_info { bool cover_only; /* No card detect - just cover switch */ int gpio_cd; /* or -EINVAL */ int gpio_wp; /* or -EINVAL */ + char *name; /* or NULL for default */ struct device *dev; /* returned: pointer to mmc adapter */ }; -- cgit v1.2.3 From 828c707e6dbd0ca7882f721a466ff28729376ff0 Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Mon, 23 Mar 2009 18:23:49 -0700 Subject: ARM: OMAP3: Add base address definitions and resources for OMAP 3 IS, v2 This replaces earlier patch from Sergio Aguirre titled "[REVIEW PATCH 03/14] OMAP34XX: CAM: Resources fixes". Signed-off-by: Sakari Ailus Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/devices.c | 108 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 14537ffd8af..7b2af1ba553 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -28,6 +28,113 @@ #include #include +#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) + +static struct resource cam_resources[] = { + { + .start = OMAP24XX_CAMERA_BASE, + .end = OMAP24XX_CAMERA_BASE + 0xfff, + .flags = IORESOURCE_MEM, + }, + { + .start = INT_24XX_CAM_IRQ, + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device omap_cam_device = { + .name = "omap24xxcam", + .id = -1, + .num_resources = ARRAY_SIZE(cam_resources), + .resource = cam_resources, +}; + +static inline void omap_init_camera(void) +{ + platform_device_register(&omap_cam_device); +} + +#elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) + +static struct resource omap3isp_resources[] = { + { + .start = OMAP3430_ISP_BASE, + .end = OMAP3430_ISP_END, + .flags = IORESOURCE_MEM, + }, + { + .start = OMAP3430_ISP_CBUFF_BASE, + .end = OMAP3430_ISP_CBUFF_END, + .flags = IORESOURCE_MEM, + }, + { + .start = OMAP3430_ISP_CCP2_BASE, + .end = OMAP3430_ISP_CCP2_END, + .flags = IORESOURCE_MEM, + }, + { + .start = OMAP3430_ISP_CCDC_BASE, + .end = OMAP3430_ISP_CCDC_END, + .flags = IORESOURCE_MEM, + }, + { + .start = OMAP3430_ISP_HIST_BASE, + .end = OMAP3430_ISP_HIST_END, + .flags = IORESOURCE_MEM, + }, + { + .start = OMAP3430_ISP_H3A_BASE, + .end = OMAP3430_ISP_H3A_END, + .flags = IORESOURCE_MEM, + }, + { + .start = OMAP3430_ISP_PREV_BASE, + .end = OMAP3430_ISP_PREV_END, + .flags = IORESOURCE_MEM, + }, + { + .start = OMAP3430_ISP_RESZ_BASE, + .end = OMAP3430_ISP_RESZ_END, + .flags = IORESOURCE_MEM, + }, + { + .start = OMAP3430_ISP_SBL_BASE, + .end = OMAP3430_ISP_SBL_END, + .flags = IORESOURCE_MEM, + }, + { + .start = OMAP3430_ISP_CSI2A_BASE, + .end = OMAP3430_ISP_CSI2A_END, + .flags = IORESOURCE_MEM, + }, + { + .start = OMAP3430_ISP_CSI2PHY_BASE, + .end = OMAP3430_ISP_CSI2PHY_END, + .flags = IORESOURCE_MEM, + }, + { + .start = INT_34XX_CAM_IRQ, + .flags = IORESOURCE_IRQ, + } +}; + +static struct platform_device omap3isp_device = { + .name = "omap3isp", + .id = -1, + .num_resources = ARRAY_SIZE(omap3isp_resources), + .resource = omap3isp_resources, +}; + +static inline void omap_init_camera(void) +{ + platform_device_register(&omap3isp_device); +} +#else +static inline void omap_init_camera(void) +{ +} +#endif + #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) #define MBOX_REG_SIZE 0x120 @@ -527,6 +634,7 @@ static int __init omap2_init_devices(void) * in alphabetical order so they're easier to sort through. */ omap_hsmmc_reset(); + omap_init_camera(); omap_init_mbox(); omap_init_mcspi(); omap_hdq_init(); -- cgit v1.2.3 From 18cb7aca6f94357d78d99970ec0bd5933ac4495d Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Mon, 23 Mar 2009 18:34:06 -0700 Subject: ARM: OMAP3: MUSB initialization for omap hw, v2 Create a generic board-file for initializing usb on omap2430 and omap3 boards. Patch modified by Tony to build the module based on CONFIG_USB_MUSB_SOC. Also merged in a patch adding the nop xceiv from Ajay Kumar Gupta . Signed-off-by: Ajay Kumar Gupta Signed-off-by: Felipe Balbi Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/Makefile | 4 + arch/arm/mach-omap2/board-2430sdp.c | 2 + arch/arm/mach-omap2/board-ldp.c | 2 + arch/arm/mach-omap2/board-omap3beagle.c | 2 + arch/arm/mach-omap2/board-omap3pandora.c | 2 + arch/arm/mach-omap2/board-overo.c | 2 + arch/arm/mach-omap2/usb-musb.c | 187 +++++++++++++++++++++++++++++++ 7 files changed, 201 insertions(+) create mode 100644 arch/arm/mach-omap2/usb-musb.c (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index bbd12bc10fd..29f6ca94c36 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -39,3 +39,7 @@ obj-$(CONFIG_MACH_OVERO) += board-overo.o \ obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \ mmc-twl4030.o +# Platform specific device init code +ifeq ($(CONFIG_USB_MUSB_SOC),y) +obj-y += usb-musb.o +endif diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index c8abe6a8dfe..21ee2195eb5 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c @@ -35,6 +35,7 @@ #include #include #include +#include #include "mmc-twl4030.h" @@ -254,6 +255,7 @@ static void __init omap_2430sdp_init(void) omap_board_config_size = ARRAY_SIZE(sdp2430_config); omap_serial_init(); twl4030_mmc_init(mmc); + usb_musb_init(); } static void __init omap_2430sdp_map_io(void) diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index f035d7836e5..92661e5df93 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "mmc-twl4030.h" @@ -164,6 +165,7 @@ static void __init omap_ldp_init(void) omap_board_config_size = ARRAY_SIZE(ldp_config); omap_serial_init(); twl4030_mmc_init(mmc); + usb_musb_init(); } static void __init omap_ldp_map_io(void) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index e3c862866b7..2f3d821e634 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -41,6 +41,7 @@ #include #include #include +#include #include "mmc-twl4030.h" @@ -313,6 +314,7 @@ static void __init omap3_beagle_init(void) /* REVISIT leave DVI powered down until it's needed ... */ gpio_direction_output(170, true); + usb_musb_init(); omap3beagle_flash_init(); } diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index 6e17180c1a5..16e2128daa1 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "mmc-twl4030.h" @@ -200,6 +201,7 @@ static void __init omap3pandora_init(void) spi_register_board_info(omap3pandora_spi_board_info, ARRAY_SIZE(omap3pandora_spi_board_info)); omap3pandora_ads7846_init(); + usb_musb_init(); } static void __init omap3pandora_map_io(void) diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 9c14324d8c6..d3ceed398e0 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -43,6 +43,7 @@ #include #include #include +#include #include "mmc-twl4030.h" @@ -228,6 +229,7 @@ static void __init overo_init(void) omap_serial_init(); twl4030_mmc_init(mmc); overo_flash_init(); + usb_musb_init(); if ((gpio_request(OVERO_GPIO_W2W_NRESET, "OVERO_GPIO_W2W_NRESET") == 0) && diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c new file mode 100644 index 00000000000..fc74e913c41 --- /dev/null +++ b/arch/arm/mach-omap2/usb-musb.c @@ -0,0 +1,187 @@ +/* + * linux/arch/arm/mach-omap2/usb-musb.c + * + * This file will contain the board specific details for the + * MENTOR USB OTG controller on OMAP3430 + * + * Copyright (C) 2007-2008 Texas Instruments + * Copyright (C) 2008 Nokia Corporation + * Author: Vikram Pandita + * + * Generalization by: + * Felipe Balbi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +static struct resource musb_resources[] = { + [0] = { /* start and end set dynamically */ + .flags = IORESOURCE_MEM, + }, + [1] = { /* general IRQ */ + .start = INT_243X_HS_USB_MC, + .flags = IORESOURCE_IRQ, + }, + [2] = { /* DMA IRQ */ + .start = INT_243X_HS_USB_DMA, + .flags = IORESOURCE_IRQ, + }, +}; + +static int clk_on; + +static int musb_set_clock(struct clk *clk, int state) +{ + if (state) { + if (clk_on > 0) + return -ENODEV; + + clk_enable(clk); + clk_on = 1; + } else { + if (clk_on == 0) + return -ENODEV; + + clk_disable(clk); + clk_on = 0; + } + + return 0; +} + +static struct musb_hdrc_eps_bits musb_eps[] = { + { "ep1_tx", 10, }, + { "ep1_rx", 10, }, + { "ep2_tx", 9, }, + { "ep2_rx", 9, }, + { "ep3_tx", 3, }, + { "ep3_rx", 3, }, + { "ep4_tx", 3, }, + { "ep4_rx", 3, }, + { "ep5_tx", 3, }, + { "ep5_rx", 3, }, + { "ep6_tx", 3, }, + { "ep6_rx", 3, }, + { "ep7_tx", 3, }, + { "ep7_rx", 3, }, + { "ep8_tx", 2, }, + { "ep8_rx", 2, }, + { "ep9_tx", 2, }, + { "ep9_rx", 2, }, + { "ep10_tx", 2, }, + { "ep10_rx", 2, }, + { "ep11_tx", 2, }, + { "ep11_rx", 2, }, + { "ep12_tx", 2, }, + { "ep12_rx", 2, }, + { "ep13_tx", 2, }, + { "ep13_rx", 2, }, + { "ep14_tx", 2, }, + { "ep14_rx", 2, }, + { "ep15_tx", 2, }, + { "ep15_rx", 2, }, +}; + +static struct musb_hdrc_config musb_config = { + .multipoint = 1, + .dyn_fifo = 1, + .soft_con = 1, + .dma = 1, + .num_eps = 16, + .dma_channels = 7, + .dma_req_chan = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3), + .ram_bits = 12, + .eps_bits = musb_eps, +}; + +static struct musb_hdrc_platform_data musb_plat = { +#ifdef CONFIG_USB_MUSB_OTG + .mode = MUSB_OTG, +#elif defined(CONFIG_USB_MUSB_HDRC_HCD) + .mode = MUSB_HOST, +#elif defined(CONFIG_USB_GADGET_MUSB_HDRC) + .mode = MUSB_PERIPHERAL, +#endif + /* .clock is set dynamically */ + .set_clock = musb_set_clock, + .config = &musb_config, + + /* REVISIT charge pump on TWL4030 can supply up to + * 100 mA ... but this value is board-specific, like + * "mode", and should be passed to usb_musb_init(). + */ + .power = 50, /* up to 100 mA */ +}; + +static u64 musb_dmamask = DMA_32BIT_MASK; + +static struct platform_device musb_device = { + .name = "musb_hdrc", + .id = -1, + .dev = { + .dma_mask = &musb_dmamask, + .coherent_dma_mask = DMA_32BIT_MASK, + .platform_data = &musb_plat, + }, + .num_resources = ARRAY_SIZE(musb_resources), + .resource = musb_resources, +}; + +#ifdef CONFIG_NOP_USB_XCEIV +static u64 nop_xceiv_dmamask = DMA_32BIT_MASK; + +static struct platform_device nop_xceiv_device = { + .name = "nop_usb_xceiv", + .id = -1, + .dev = { + .dma_mask = &nop_xceiv_dmamask, + .coherent_dma_mask = DMA_32BIT_MASK, + .platform_data = NULL, + }, +}; +#endif + +void __init usb_musb_init(void) +{ + if (cpu_is_omap243x()) + musb_resources[0].start = OMAP243X_HS_BASE; + else + musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE; + musb_resources[0].end = musb_resources[0].start + SZ_8K - 1; + + /* + * REVISIT: This line can be removed once all the platforms using + * musb_core.c have been converted to use use clkdev. + */ + musb_plat.clock = "ick"; + +#ifdef CONFIG_NOP_USB_XCEIV + if (platform_device_register(&nop_xceiv_device) < 0) { + printk(KERN_ERR "Unable to register NOP-XCEIV device\n"); + return; + } +#endif + + if (platform_device_register(&musb_device) < 0) { + printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n"); + return; + } +} -- cgit v1.2.3 From c6a81316c721a20639871f08cf0cbff7e83889b4 Mon Sep 17 00:00:00 2001 From: Steve Sakoman Date: Mon, 23 Mar 2009 18:38:16 -0700 Subject: ARM: OMAP3: Add ADS7846 touchscreen support to Overo platform, v3 An upcoming Overo expansion board includes an ADS7846 touchscreen controller. This patch adds support via the ads7846 driver when enabled in the kernel config. Signed-off-by: Steve Sakoman Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-overo.c | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index d3ceed398e0..782268c9194 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -57,6 +57,65 @@ #define GPMC_CS0_BASE 0x60 #define GPMC_CS_SIZE 0x30 +#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ + defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) + +#include +#include +#include + +static struct omap2_mcspi_device_config ads7846_mcspi_config = { + .turbo_mode = 0, + .single_channel = 1, /* 0: slave, 1: master */ +}; + +static int ads7846_get_pendown_state(void) +{ + return !gpio_get_value(OVERO_GPIO_PENDOWN); +} + +static struct ads7846_platform_data ads7846_config = { + .x_max = 0x0fff, + .y_max = 0x0fff, + .x_plate_ohms = 180, + .pressure_max = 255, + .debounce_max = 10, + .debounce_tol = 3, + .debounce_rep = 1, + .get_pendown_state = ads7846_get_pendown_state, + .keep_vref_on = 1, +}; + +static struct spi_board_info overo_spi_board_info[] __initdata = { + { + .modalias = "ads7846", + .bus_num = 1, + .chip_select = 0, + .max_speed_hz = 1500000, + .controller_data = &ads7846_mcspi_config, + .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN), + .platform_data = &ads7846_config, + } +}; + +static void __init overo_ads7846_init(void) +{ + if ((gpio_request(OVERO_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) && + (gpio_direction_input(OVERO_GPIO_PENDOWN) == 0)) { + gpio_export(OVERO_GPIO_PENDOWN, 0); + } else { + printk(KERN_ERR "could not obtain gpio for ADS7846_PENDOWN\n"); + return; + } + + spi_register_board_info(overo_spi_board_info, + ARRAY_SIZE(overo_spi_board_info)); +} + +#else +static inline void __init overo_ads7846_init(void) { return; } +#endif + static struct mtd_partition overo_nand_partitions[] = { { .name = "xloader", @@ -230,6 +289,7 @@ static void __init overo_init(void) twl4030_mmc_init(mmc); overo_flash_init(); usb_musb_init(); + overo_ads7846_init(); if ((gpio_request(OVERO_GPIO_W2W_NRESET, "OVERO_GPIO_W2W_NRESET") == 0) && -- cgit v1.2.3 From 6fdc29e262f9a776a77f50ca9157f7c0dcfbbbc8 Mon Sep 17 00:00:00 2001 From: Syed Mohammed Khasim Date: Mon, 23 Mar 2009 18:38:16 -0700 Subject: ARM: OMAP3: Add support for 3430 SDP, v4 Add support for 3430 SDP. Various updates have been merged into this patch from the linux-omap list. Patch updated to initialize regulators by David Brownell . Signed-off-by: Syed Mohammed Khasim David Brownell Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/Kconfig | 6 +- arch/arm/mach-omap2/Makefile | 2 + arch/arm/mach-omap2/board-3430sdp.c | 542 ++++++++++++++++++++++++++++++++++++ 3 files changed, 549 insertions(+), 1 deletion(-) create mode 100644 arch/arm/mach-omap2/board-3430sdp.c (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 3754b79092a..64ad5c04b64 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -58,4 +58,8 @@ config MACH_OVERO config MACH_OMAP3_PANDORA bool "OMAP3 Pandora" - depends on ARCH_OMAP3 && ARCH_OMAP34XX \ No newline at end of file + depends on ARCH_OMAP3 && ARCH_OMAP34XX + +config MACH_OMAP_3430SDP + bool "OMAP 3430 SDP board" + depends on ARCH_OMAP3 && ARCH_OMAP34XX diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 29f6ca94c36..809416dc644 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -38,6 +38,8 @@ obj-$(CONFIG_MACH_OVERO) += board-overo.o \ mmc-twl4030.o obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \ mmc-twl4030.o +obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \ + mmc-twl4030.o # Platform specific device init code ifeq ($(CONFIG_USB_MUSB_SOC),y) diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c new file mode 100644 index 00000000000..2af38e56db3 --- /dev/null +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -0,0 +1,542 @@ +/* + * linux/arch/arm/mach-omap2/board-3430sdp.c + * + * Copyright (C) 2007 Texas Instruments + * + * Modified from mach-omap2/board-generic.c + * + * Initial code: Syed Mohammed Khasim + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "mmc-twl4030.h" + +#define CONFIG_DISABLE_HFCLK 1 + +#define SDP3430_ETHR_GPIO_IRQ_SDPV1 29 +#define SDP3430_ETHR_GPIO_IRQ_SDPV2 6 +#define SDP3430_SMC91X_CS 3 + +#define SDP3430_TS_GPIO_IRQ_SDPV1 3 +#define SDP3430_TS_GPIO_IRQ_SDPV2 2 + +#define ENABLE_VAUX3_DEDICATED 0x03 +#define ENABLE_VAUX3_DEV_GRP 0x20 + +#define TWL4030_MSECURE_GPIO 22 + +static struct resource sdp3430_smc91x_resources[] = { + [0] = { + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = 0, + .end = 0, + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, + }, +}; + +static struct platform_device sdp3430_smc91x_device = { + .name = "smc91x", + .id = -1, + .num_resources = ARRAY_SIZE(sdp3430_smc91x_resources), + .resource = sdp3430_smc91x_resources, +}; + +static int sdp3430_keymap[] = { + KEY(0, 0, KEY_LEFT), + KEY(0, 1, KEY_RIGHT), + KEY(0, 2, KEY_A), + KEY(0, 3, KEY_B), + KEY(0, 4, KEY_C), + KEY(1, 0, KEY_DOWN), + KEY(1, 1, KEY_UP), + KEY(1, 2, KEY_E), + KEY(1, 3, KEY_F), + KEY(1, 4, KEY_G), + KEY(2, 0, KEY_ENTER), + KEY(2, 1, KEY_I), + KEY(2, 2, KEY_J), + KEY(2, 3, KEY_K), + KEY(2, 4, KEY_3), + KEY(3, 0, KEY_M), + KEY(3, 1, KEY_N), + KEY(3, 2, KEY_O), + KEY(3, 3, KEY_P), + KEY(3, 4, KEY_Q), + KEY(4, 0, KEY_R), + KEY(4, 1, KEY_4), + KEY(4, 2, KEY_T), + KEY(4, 3, KEY_U), + KEY(4, 4, KEY_D), + KEY(5, 0, KEY_V), + KEY(5, 1, KEY_W), + KEY(5, 2, KEY_L), + KEY(5, 3, KEY_S), + KEY(5, 4, KEY_H), + 0 +}; + +static struct twl4030_keypad_data sdp3430_kp_data = { + .rows = 5, + .cols = 6, + .keymap = sdp3430_keymap, + .keymapsize = ARRAY_SIZE(sdp3430_keymap), + .rep = 1, +}; + +static int ts_gpio; /* Needed for ads7846_get_pendown_state */ + +/** + * @brief ads7846_dev_init : Requests & sets GPIO line for pen-irq + * + * @return - void. If request gpio fails then Flag KERN_ERR. + */ +static void ads7846_dev_init(void) +{ + if (gpio_request(ts_gpio, "ADS7846 pendown") < 0) { + printk(KERN_ERR "can't get ads746 pen down GPIO\n"); + return; + } + + gpio_direction_input(ts_gpio); + + omap_set_gpio_debounce(ts_gpio, 1); + omap_set_gpio_debounce_time(ts_gpio, 0xa); +} + +static int ads7846_get_pendown_state(void) +{ + return !gpio_get_value(ts_gpio); +} + +static struct ads7846_platform_data tsc2046_config __initdata = { + .get_pendown_state = ads7846_get_pendown_state, + .keep_vref_on = 1, +}; + + +static struct omap2_mcspi_device_config tsc2046_mcspi_config = { + .turbo_mode = 0, + .single_channel = 1, /* 0: slave, 1: master */ +}; + +static struct spi_board_info sdp3430_spi_board_info[] __initdata = { + [0] = { + /* + * TSC2046 operates at a max freqency of 2MHz, so + * operate slightly below at 1.5MHz + */ + .modalias = "ads7846", + .bus_num = 1, + .chip_select = 0, + .max_speed_hz = 1500000, + .controller_data = &tsc2046_mcspi_config, + .irq = 0, + .platform_data = &tsc2046_config, + }, +}; + +static struct platform_device sdp3430_lcd_device = { + .name = "sdp2430_lcd", + .id = -1, +}; + +static struct regulator_consumer_supply sdp3430_vdac_supply = { + .supply = "vdac", + .dev = &sdp3430_lcd_device.dev, +}; + +static struct regulator_consumer_supply sdp3430_vdvi_supply = { + .supply = "vdvi", + .dev = &sdp3430_lcd_device.dev, +}; + +static struct platform_device *sdp3430_devices[] __initdata = { + &sdp3430_smc91x_device, + &sdp3430_lcd_device, +}; + +static inline void __init sdp3430_init_smc91x(void) +{ + int eth_cs; + unsigned long cs_mem_base; + int eth_gpio = 0; + + eth_cs = SDP3430_SMC91X_CS; + + if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) { + printk(KERN_ERR "Failed to request GPMC mem for smc91x\n"); + return; + } + + sdp3430_smc91x_resources[0].start = cs_mem_base + 0x300; + sdp3430_smc91x_resources[0].end = cs_mem_base + 0x30f; + udelay(100); + + if (omap_rev() > OMAP3430_REV_ES1_0) + eth_gpio = SDP3430_ETHR_GPIO_IRQ_SDPV2; + else + eth_gpio = SDP3430_ETHR_GPIO_IRQ_SDPV1; + + sdp3430_smc91x_resources[1].start = gpio_to_irq(eth_gpio); + + if (gpio_request(eth_gpio, "SMC91x irq") < 0) { + printk(KERN_ERR "Failed to request GPIO%d for smc91x IRQ\n", + eth_gpio); + return; + } + gpio_direction_input(eth_gpio); +} + +static void __init omap_3430sdp_init_irq(void) +{ + omap2_init_common_hw(); + omap_init_irq(); + omap_gpio_init(); + sdp3430_init_smc91x(); +} + +static struct omap_uart_config sdp3430_uart_config __initdata = { + .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), +}; + +static struct omap_lcd_config sdp3430_lcd_config __initdata = { + .ctrl_name = "internal", +}; + +static struct omap_board_config_kernel sdp3430_config[] __initdata = { + { OMAP_TAG_UART, &sdp3430_uart_config }, + { OMAP_TAG_LCD, &sdp3430_lcd_config }, +}; + +static int sdp3430_batt_table[] = { +/* 0 C*/ +30800, 29500, 28300, 27100, +26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900, +17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100, +11600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310, +8020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830, +5640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170, +4040, 3910, 3790, 3670, 3550 +}; + +static struct twl4030_bci_platform_data sdp3430_bci_data = { + .battery_tmp_tbl = sdp3430_batt_table, + .tblsize = ARRAY_SIZE(sdp3430_batt_table), +}; + +static struct twl4030_hsmmc_info mmc[] = { + { + .mmc = 1, + /* 8 bits (default) requires S6.3 == ON, + * so the SIM card isn't used; else 4 bits. + */ + .wires = 8, + .gpio_wp = 4, + }, + { + .mmc = 2, + .wires = 8, + .gpio_wp = 7, + }, + {} /* Terminator */ +}; + +static struct regulator_consumer_supply sdp3430_vmmc1_supply = { + .supply = "vmmc", +}; + +static struct regulator_consumer_supply sdp3430_vsim_supply = { + .supply = "vmmc_aux", +}; + +static struct regulator_consumer_supply sdp3430_vmmc2_supply = { + .supply = "vmmc", +}; + +static int sdp3430_twl_gpio_setup(struct device *dev, + unsigned gpio, unsigned ngpio) +{ + /* gpio + 0 is "mmc0_cd" (input/IRQ), + * gpio + 1 is "mmc1_cd" (input/IRQ) + */ + mmc[0].gpio_cd = gpio + 0; + mmc[1].gpio_cd = gpio + 1; + twl4030_mmc_init(mmc); + + /* link regulators to MMC adapters ... we "know" the + * regulators will be set up only *after* we return. + */ + sdp3430_vmmc1_supply.dev = mmc[0].dev; + sdp3430_vsim_supply.dev = mmc[0].dev; + sdp3430_vmmc2_supply.dev = mmc[1].dev; + + /* gpio + 7 is "sub_lcd_en_bkl" (output/PWM1) */ + gpio_request(gpio + 7, "sub_lcd_en_bkl"); + gpio_direction_output(gpio + 7, 0); + + /* gpio + 15 is "sub_lcd_nRST" (output) */ + gpio_request(gpio + 15, "sub_lcd_nRST"); + gpio_direction_output(gpio + 15, 0); + + return 0; +} + +static struct twl4030_gpio_platform_data sdp3430_gpio_data = { + .gpio_base = OMAP_MAX_GPIO_LINES, + .irq_base = TWL4030_GPIO_IRQ_BASE, + .irq_end = TWL4030_GPIO_IRQ_END, + .pulldowns = BIT(2) | BIT(6) | BIT(8) | BIT(13) + | BIT(16) | BIT(17), + .setup = sdp3430_twl_gpio_setup, +}; + +static struct twl4030_usb_data sdp3430_usb_data = { + .usb_mode = T2_USB_MODE_ULPI, +}; + +static struct twl4030_madc_platform_data sdp3430_madc_data = { + .irq_line = 1, +}; + +/* + * Apply all the fixed voltages since most versions of U-Boot + * don't bother with that initialization. + */ + +/* VAUX1 for mainboard (irda and sub-lcd) */ +static struct regulator_init_data sdp3430_vaux1 = { + .constraints = { + .min_uV = 2800000, + .max_uV = 2800000, + .apply_uV = true, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +}; + +/* VAUX2 for camera module */ +static struct regulator_init_data sdp3430_vaux2 = { + .constraints = { + .min_uV = 2800000, + .max_uV = 2800000, + .apply_uV = true, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +}; + +/* VAUX3 for LCD board */ +static struct regulator_init_data sdp3430_vaux3 = { + .constraints = { + .min_uV = 2800000, + .max_uV = 2800000, + .apply_uV = true, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +}; + +/* VAUX4 for OMAP VDD_CSI2 (camera) */ +static struct regulator_init_data sdp3430_vaux4 = { + .constraints = { + .min_uV = 1800000, + .max_uV = 1800000, + .apply_uV = true, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +}; + +/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ +static struct regulator_init_data sdp3430_vmmc1 = { + .constraints = { + .min_uV = 1850000, + .max_uV = 3150000, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 1, + .consumer_supplies = &sdp3430_vmmc1_supply, +}; + +/* VMMC2 for MMC2 card */ +static struct regulator_init_data sdp3430_vmmc2 = { + .constraints = { + .min_uV = 1850000, + .max_uV = 1850000, + .apply_uV = true, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 1, + .consumer_supplies = &sdp3430_vmmc2_supply, +}; + +/* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */ +static struct regulator_init_data sdp3430_vsim = { + .constraints = { + .min_uV = 1800000, + .max_uV = 3000000, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 1, + .consumer_supplies = &sdp3430_vsim_supply, +}; + +/* VDAC for DSS driving S-Video */ +static struct regulator_init_data sdp3430_vdac = { + .constraints = { + .min_uV = 1800000, + .max_uV = 1800000, + .apply_uV = true, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 1, + .consumer_supplies = &sdp3430_vdac_supply, +}; + +/* VPLL2 for digital video outputs */ +static struct regulator_init_data sdp3430_vpll2 = { + .constraints = { + .name = "VDVI", + .min_uV = 1800000, + .max_uV = 1800000, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 1, + .consumer_supplies = &sdp3430_vdvi_supply, +}; + +static struct twl4030_platform_data sdp3430_twldata = { + .irq_base = TWL4030_IRQ_BASE, + .irq_end = TWL4030_IRQ_END, + + /* platform_data for children goes here */ + .bci = &sdp3430_bci_data, + .gpio = &sdp3430_gpio_data, + .madc = &sdp3430_madc_data, + .keypad = &sdp3430_kp_data, + .usb = &sdp3430_usb_data, + + .vaux1 = &sdp3430_vaux1, + .vaux2 = &sdp3430_vaux2, + .vaux3 = &sdp3430_vaux3, + .vaux4 = &sdp3430_vaux4, + .vmmc1 = &sdp3430_vmmc1, + .vmmc2 = &sdp3430_vmmc2, + .vsim = &sdp3430_vsim, + .vdac = &sdp3430_vdac, + .vpll2 = &sdp3430_vpll2, +}; + +static struct i2c_board_info __initdata sdp3430_i2c_boardinfo[] = { + { + I2C_BOARD_INFO("twl4030", 0x48), + .flags = I2C_CLIENT_WAKE, + .irq = INT_34XX_SYS_NIRQ, + .platform_data = &sdp3430_twldata, + }, +}; + +static int __init omap3430_i2c_init(void) +{ + /* i2c1 for PMIC only */ + omap_register_i2c_bus(1, 2600, sdp3430_i2c_boardinfo, + ARRAY_SIZE(sdp3430_i2c_boardinfo)); + /* i2c2 on camera connector (for sensor control) and optional isp1301 */ + omap_register_i2c_bus(2, 400, NULL, 0); + /* i2c3 on display connector (for DVI, tfp410) */ + omap_register_i2c_bus(3, 400, NULL, 0); + return 0; +} + +static void __init omap_3430sdp_init(void) +{ + omap3430_i2c_init(); + platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices)); + omap_board_config = sdp3430_config; + omap_board_config_size = ARRAY_SIZE(sdp3430_config); + if (omap_rev() > OMAP3430_REV_ES1_0) + ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV2; + else + ts_gpio = SDP3430_TS_GPIO_IRQ_SDPV1; + sdp3430_spi_board_info[0].irq = gpio_to_irq(ts_gpio); + spi_register_board_info(sdp3430_spi_board_info, + ARRAY_SIZE(sdp3430_spi_board_info)); + ads7846_dev_init(); + omap_serial_init(); + usb_musb_init(); +} + +static void __init omap_3430sdp_map_io(void) +{ + omap2_set_globals_343x(); + omap2_map_common_io(); +} + +MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board") + /* Maintainer: Syed Khasim - Texas Instruments Inc */ + .phys_io = 0x48000000, + .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, + .boot_params = 0x80000100, + .map_io = omap_3430sdp_map_io, + .init_irq = omap_3430sdp_init_irq, + .init_machine = omap_3430sdp_init, + .timer = &omap_timer, +MACHINE_END -- cgit v1.2.3 From ffe7f95bb1a4d1e9ca5d252445dc38476e1a208e Mon Sep 17 00:00:00 2001 From: Lauri Leukkunen Date: Mon, 23 Mar 2009 18:38:17 -0700 Subject: ARM OMAP3: Initial support for Nokia RX-51, v3 Adds board files and related headers for Nokia RX-51 Internet Tablet. This patch has been updated with some clean-up patches posted earlier to linux-omap list. Signed-off-by: Lauri Leukkunen Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/Kconfig | 4 + arch/arm/mach-omap2/Makefile | 2 + arch/arm/mach-omap2/board-rx51-peripherals.c | 419 +++++++++++++++++++++++++++ arch/arm/mach-omap2/board-rx51.c | 96 ++++++ 4 files changed, 521 insertions(+) create mode 100644 arch/arm/mach-omap2/board-rx51-peripherals.c create mode 100644 arch/arm/mach-omap2/board-rx51.c (limited to 'arch/arm/mach-omap2') diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 64ad5c04b64..64ab386a65c 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -63,3 +63,7 @@ config MACH_OMAP3_PANDORA config MACH_OMAP_3430SDP bool "OMAP 3430 SDP board" depends on ARCH_OMAP3 && ARCH_OMAP34XX + +config MACH_NOKIA_RX51 + bool "Nokia RX-51 board" + depends on ARCH_OMAP3 && ARCH_OMAP34XX diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 809416dc644..e08e482b89f 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -41,6 +41,8 @@ obj-$(CONFIG_MACH_OMAP3_PANDORA) += board-omap3pandora.o \ obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \ mmc-twl4030.o +obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ + board-rx51-peripherals.o \ # Platform specific device init code ifeq ($(CONFIG_USB_MUSB_SOC),y) obj-y += usb-musb.o diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c new file mode 100644 index 00000000000..a7381729645 --- /dev/null +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c @@ -0,0 +1,419 @@ +/* + * linux/arch/arm/mach-omap2/board-rx51-flash.c + * + * Copyright (C) 2008-2009 Nokia + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "mmc-twl4030.h" + + +#define SMC91X_CS 1 +#define SMC91X_GPIO_IRQ 54 +#define SMC91X_GPIO_RESET 164 +#define SMC91X_GPIO_PWRDWN 86 + +static struct resource rx51_smc91x_resources[] = { + [0] = { + .flags = IORESOURCE_MEM, + }, + [1] = { + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, + }, +}; + +static struct platform_device rx51_smc91x_device = { + .name = "smc91x", + .id = -1, + .num_resources = ARRAY_SIZE(rx51_smc91x_resources), + .resource = rx51_smc91x_resources, +}; + +static int rx51_keymap[] = { + KEY(0, 0, KEY_Q), + KEY(0, 1, KEY_W), + KEY(0, 2, KEY_E), + KEY(0, 3, KEY_R), + KEY(0, 4, KEY_T), + KEY(0, 5, KEY_Y), + KEY(0, 6, KEY_U), + KEY(0, 7, KEY_I), + KEY(1, 0, KEY_O), + KEY(1, 1, KEY_D), + KEY(1, 2, KEY_DOT), + KEY(1, 3, KEY_V), + KEY(1, 4, KEY_DOWN), + KEY(2, 0, KEY_P), + KEY(2, 1, KEY_F), + KEY(2, 2, KEY_UP), + KEY(2, 3, KEY_B), + KEY(2, 4, KEY_RIGHT), + KEY(3, 0, KEY_COMMA), + KEY(3, 1, KEY_G), + KEY(3, 2, KEY_ENTER), + KEY(3, 3, KEY_N), + KEY(4, 0, KEY_BACKSPACE), + KEY(4, 1, KEY_H), + KEY(4, 3, KEY_M), + KEY(4, 4, KEY_LEFTCTRL), + KEY(5, 1, KEY_J), + KEY(5, 2, KEY_Z), + KEY(5, 3, KEY_SPACE), + KEY(5, 4, KEY_LEFTSHIFT), + KEY(6, 0, KEY_A), + KEY(6, 1, KEY_K), + KEY(6, 2, KEY_X), + KEY(6, 3, KEY_SPACE), + KEY(6, 4, KEY_FN), + KEY(7, 0, KEY_S), + KEY(7, 1, KEY_L), + KEY(7, 2, KEY_C), + KEY(7, 3, KEY_LEFT), + KEY(0xff, 0, KEY_F6), + KEY(0xff, 1, KEY_F7), + KEY(0xff, 2, KEY_F8), + KEY(0xff, 4, KEY_F9), + KEY(0xff, 5, KEY_F10), +}; + +static struct twl4030_keypad_data rx51_kp_data = { + .rows = 8, + .cols = 8, + .keymap = rx51_keymap, + .keymapsize = ARRAY_SIZE(rx51_keymap), + .rep = 1, +}; + +static struct platform_device *rx51_peripherals_devices[] = { + &rx51_smc91x_device, +}; + +/* + * Timings are taken from smsc-lan91c96-ms.pdf + */ +static int smc91x_init_gpmc(int cs) +{ + struct gpmc_timings t; + const int t2_r = 45; /* t2 in Figure 12.10 */ + const int t2_w = 30; /* t2 in Figure 12.11 */ + const int t3 = 15; /* t3 in Figure 12.10 */ + const int t5_r = 0; /* t5 in Figure 12.10 */ + const int t6_r = 45; /* t6 in Figure 12.10 */ + const int t6_w = 0; /* t6 in Figure 12.11 */ + const int t7_w = 15; /* t7 in Figure 12.11 */ + const int t15 = 12; /* t15 in Figure 12.2 */ + const int t20 = 185; /* t20 in Figure 12.2 */ + + memset(&t, 0, sizeof(t)); + + t.cs_on = t15; + t.cs_rd_off = t3 + t2_r + t5_r; /* Figure 12.10 */ + t.cs_wr_off = t3 + t2_w + t6_w; /* Figure 12.11 */ + t.adv_on = t3; /* Figure 12.10 */ + t.adv_rd_off = t3 + t2_r; /* Figure 12.10 */ + t.adv_wr_off = t3 + t2_w; /* Figure 12.11 */ + t.oe_off = t3 + t2_r + t5_r; /* Figure 12.10 */ + t.oe_on = t.oe_off - t6_r; /* Figure 12.10 */ + t.we_off = t3 + t2_w + t6_w; /* Figure 12.11 */ + t.we_on = t.we_off - t7_w; /* Figure 12.11 */ + t.rd_cycle = t20; /* Figure 12.2 */ + t.wr_cycle = t20; /* Figure 12.4 */ + t.access = t3 + t2_r + t5_r; /* Figure 12.10 */ + t.wr_access = t3 + t2_w + t6_w; /* Figure 12.11 */ + + gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, GPMC_CONFIG1_DEVICESIZE_16); + + return gpmc_cs_set_timings(cs, &t); +} + +static void __init rx51_init_smc91x(void) +{ + unsigned long cs_mem_base; + int ret; + + omap_cfg_reg(U8_34XX_GPIO54_DOWN); + omap_cfg_reg(G25_34XX_GPIO86_OUT); + omap_cfg_reg(H19_34XX_GPIO164_OUT); + + if (gpmc_cs_request(SMC91X_CS, SZ_16M, &cs_mem_base) < 0) { + printk(KERN_ERR "Failed to request GPMC mem for smc91x\n"); + return; + } + + rx51_smc91x_resources[0].start = cs_mem_base + 0x300; + rx51_smc91x_resources[0].end = cs_mem_base + 0x30f; + + smc91x_init_gpmc(SMC91X_CS); + + if (gpio_request(SMC91X_GPIO_IRQ, "SMC91X irq") < 0) + goto free1; + + gpio_direction_input(SMC91X_GPIO_IRQ); + rx51_smc91x_resources[1].start = gpio_to_irq(SMC91X_GPIO_IRQ); + + ret = gpio_request(SMC91X_GPIO_PWRDWN, "SMC91X powerdown"); + if (ret) + goto free2; + gpio_direction_output(SMC91X_GPIO_PWRDWN, 0); + + ret = gpio_request(SMC91X_GPIO_RESET, "SMC91X reset"); + if (ret) + goto free3; + gpio_direction_output(SMC91X_GPIO_RESET, 0); + gpio_set_value(SMC91X_GPIO_RESET, 1); + msleep(100); + gpio_set_value(SMC91X_GPIO_RESET, 0); + + return; + +free3: + gpio_free(SMC91X_GPIO_PWRDWN); +free2: + gpio_free(SMC91X_GPIO_IRQ); +free1: + gpmc_cs_free(SMC91X_CS); + + printk(KERN_ERR "Could not initialize smc91x\n"); +} + +static struct twl4030_madc_platform_data rx51_madc_data = { + .irq_line = 1, +}; + +static struct twl4030_hsmmc_info mmc[] = { + { + .name = "external", + .mmc = 1, + .wires = 4, + .cover_only = true, + .gpio_cd = 160, + .gpio_wp = -EINVAL, + }, + { + .name = "internal", + .mmc = 2, + .wires = 8, + .gpio_cd = -EINVAL, + .gpio_wp = -EINVAL, + }, + {} /* Terminator */ +}; + +static struct regulator_consumer_supply rx51_vmmc1_supply = { + .supply = "vmmc", +}; + +static struct regulator_consumer_supply rx51_vmmc2_supply = { + .supply = "vmmc", +}; + +static struct regulator_consumer_supply rx51_vsim_supply = { + .supply = "vmmc_aux", +}; + +static struct regulator_init_data rx51_vaux1 = { + .constraints = { + .name = "V28", + .min_uV = 2800000, + .max_uV = 2800000, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +}; + +static struct regulator_init_data rx51_vaux2 = { + .constraints = { + .name = "VCSI", + .min_uV = 1800000, + .max_uV = 1800000, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +}; + +/* VAUX3 - adds more power to VIO_18 rail */ +static struct regulator_init_data rx51_vaux3 = { + .constraints = { + .name = "VCAM_DIG_18", + .min_uV = 1800000, + .max_uV = 1800000, + .apply_uV = true, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +}; + +static struct regulator_init_data rx51_vaux4 = { + .constraints = { + .name = "VCAM_ANA_28", + .min_uV = 2800000, + .max_uV = 2800000, + .apply_uV = true, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +}; + +static struct regulator_init_data rx51_vmmc1 = { + .constraints = { + .min_uV = 1850000, + .max_uV = 3150000, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 1, + .consumer_supplies = &rx51_vmmc1_supply, +}; + +static struct regulator_init_data rx51_vmmc2 = { + .constraints = { + .name = "VMMC2_30", + .min_uV = 1850000, + .max_uV = 3150000, + .apply_uV = true, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 1, + .consumer_supplies = &rx51_vmmc2_supply, +}; + +static struct regulator_init_data rx51_vsim = { + .constraints = { + .name = "VMMC2_IO_18", + .min_uV = 1800000, + .max_uV = 1800000, + .apply_uV = true, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 1, + .consumer_supplies = &rx51_vsim_supply, +}; + +static struct regulator_init_data rx51_vdac = { + .constraints = { + .min_uV = 1800000, + .max_uV = 1800000, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +}; + +static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n) +{ + /* FIXME this gpio setup is just a placeholder for now */ + gpio_request(gpio + 6, "backlight_pwm"); + gpio_direction_output(gpio + 6, 0); + gpio_request(gpio + 7, "speaker_en"); + gpio_direction_output(gpio + 7, 1); + + /* set up MMC adapters, linking their regulators to them */ + twl4030_mmc_init(mmc); + rx51_vmmc1_supply.dev = mmc[0].dev; + rx51_vmmc2_supply.dev = mmc[1].dev; + rx51_vsim_supply.dev = mmc[1].dev; + + return 0; +} + +static struct twl4030_gpio_platform_data rx51_gpio_data = { + .gpio_base = OMAP_MAX_GPIO_LINES, + .irq_base = TWL4030_GPIO_IRQ_BASE, + .irq_end = TWL4030_GPIO_IRQ_END, + .pulldowns = BIT(0) | BIT(1) | BIT(2) | BIT(3) + | BIT(4) | BIT(5) + | BIT(8) | BIT(9) | BIT(10) | BIT(11) + | BIT(12) | BIT(13) | BIT(14) | BIT(15) + | BIT(16) | BIT(17) , + .setup = rx51_twlgpio_setup, +}; + +static struct twl4030_platform_data rx51_twldata = { + .irq_base = TWL4030_IRQ_BASE, + .irq_end = TWL4030_IRQ_END, + + /* platform_data for children goes here */ + .gpio = &rx51_gpio_data, + .keypad = &rx51_kp_data, + .madc = &rx51_madc_data, + + .vaux1 = &rx51_vaux1, + .vaux2 = &rx51_vaux2, + .vaux3 = &rx51_vaux3, + .vaux4 = &rx51_vaux4, + .vmmc1 = &rx51_vmmc1, + .vmmc2 = &rx51_vmmc2, + .vsim = &rx51_vsim, + .vdac = &rx51_vdac, +}; + +static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_1[] = { + { + I2C_BOARD_INFO("twl5030", 0x48), + .flags = I2C_CLIENT_WAKE, + .irq = INT_34XX_SYS_NIRQ, + .platform_data = &rx51_twldata, + }, +}; + +static int __init rx51_i2c_init(void) +{ + omap_register_i2c_bus(1, 2600, rx51_peripherals_i2c_board_info_1, + ARRAY_SIZE(rx51_peripherals_i2c_board_info_1)); + omap_register_i2c_bus(2, 100, NULL, 0); + omap_register_i2c_bus(3, 400, NULL, 0); + return 0; +} + + +void __init rx51_peripherals_init(void) +{ + platform_add_devices(rx51_peripherals_devices, + ARRAY_SIZE(rx51_peripherals_devices)); + rx51_i2c_init(); + rx51_init_smc91x(); +} + diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c new file mode 100644 index 00000000000..6a3c5e53d99 --- /dev/null +++ b/arch/arm/mach-omap2/board-rx51.c @@ -0,0 +1,96 @@ +/* + * linux/arch/arm/mach-omap2/board-rx51.c + * + * Copyright (C) 2007, 2008 Nokia + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +static struct omap_uart_config rx51_uart_config = { + .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), +}; + +static struct omap_lcd_config rx51_lcd_config = { + .ctrl_name = "internal", +}; + +static struct omap_fbmem_config rx51_fbmem0_config = { + .size = 752 * 1024, +}; + +static struct omap_fbmem_config rx51_fbmem1_config = { + .size = 752 * 1024, +}; + +static struct omap_fbmem_config rx51_fbmem2_config = { + .size = 752 * 1024, +}; + +static struct omap_board_config_kernel rx51_config[] = { + { OMAP_TAG_UART, &rx51_uart_config }, + { OMAP_TAG_FBMEM, &rx51_fbmem0_config }, + { OMAP_TAG_FBMEM, &rx51_fbmem1_config }, + { OMAP_TAG_FBMEM, &rx51_fbmem2_config }, + { OMAP_TAG_LCD, &rx51_lcd_config }, +}; + +static void __init rx51_init_irq(void) +{ + omap2_init_common_hw(); + omap_init_irq(); + omap_gpio_init(); +} + +extern void __init rx51_peripherals_init(void); + +static void __init rx51_init(void) +{ + omap_board_config = rx51_config; + omap_board_config_size = ARRAY_SIZE(rx51_config); + omap_serial_init(); + usb_musb_init(); + rx51_peripherals_init(); +} + +static void __init rx51_map_io(void) +{ + omap2_set_globals_343x(); + omap2_map_common_io(); +} + +MACHINE_START(NOKIA_RX51, "Nokia RX-51 board") + /* Maintainer: Lauri Leukkunen */ + .phys_io = 0x48000000, + .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, + .boot_params = 0x80000100, + .map_io = rx51_map_io, + .init_irq = rx51_init_irq, + .init_machine = rx51_init, + .timer = &omap_timer, +MACHINE_END -- cgit v1.2.3