From patchwork Fri Oct 1 11:55:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh KUMAR X-Patchwork-Id: 223562 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o91C2RtX013861 for ; Fri, 1 Oct 2010 12:02:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932449Ab0JAL74 (ORCPT ); Fri, 1 Oct 2010 07:59:56 -0400 Received: from eu1sys200aog120.obsmtp.com ([207.126.144.149]:56543 "EHLO eu1sys200aog120.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932442Ab0JAL7y (ORCPT ); Fri, 1 Oct 2010 07:59:54 -0400 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob120.postini.com ([207.126.147.11]) with SMTP ID DSNKTKXMzR6bkmjA4+K2mqCq440GDs4a2dRQ@postini.com; Fri, 01 Oct 2010 11:59:53 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DDB21C2; Fri, 1 Oct 2010 11:57:48 +0000 (GMT) Received: from mail2.dlh.st.com (mail2.dlh.st.com [10.199.8.22]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0B8FA2649; Fri, 1 Oct 2010 11:57:44 +0000 (GMT) Received: from localhost (dlhl0509.dlh.st.com [10.199.7.86]) by mail2.dlh.st.com (MOS 3.8.7a) with ESMTP id CUF00982 (AUTH viresh.kumar@st.com); Fri, 1 Oct 2010 17:27:44 +0530 (IST) From: Viresh KUMAR To: linux-arm-kernel@lists.infradead.org, rtc-linux@googlegroups.com, a.zummo@towertech.it, dbrownell@users.sourceforge.net, linux-usb@vger.kernel.org, linux-input@vger.kernel.org, dmitry.torokhov@gmail.com, linux-mtd@lists.infradead.org, dwmw2@infradead.org Cc: Viresh Kumar , shiraz.hashim@st.com, vipin.kumar@st.com, deepak.sikri@st.com, armando.visconti@st.com, vipulkumar.samar@st.com, rajeev-dlh.kumar@st.com, pratyush.anand@st.com, bhupesh.sharma@st.com Subject: [PATCH V2 36/69] ST SPEAr: Adding miscellaneous devices Date: Fri, 1 Oct 2010 17:25:56 +0530 Message-Id: X-Mailer: git-send-email 1.7.2.2 In-Reply-To: References: In-Reply-To: References: Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 01 Oct 2010 12:02:28 +0000 (UTC) diff --git a/arch/arm/mach-spear3xx/include/mach/generic.h b/arch/arm/mach-spear3xx/include/mach/generic.h index 9bd9424..ea170a6 100644 --- a/arch/arm/mach-spear3xx/include/mach/generic.h +++ b/arch/arm/mach-spear3xx/include/mach/generic.h @@ -161,6 +161,11 @@ extern struct clcd_board clcd_plat_data; /* spear310 declarations */ #elif defined(CONFIG_MACH_SPEAR310) /* Add spear310 machine device structure declarations here */ +extern struct amba_device uart1_device; +extern struct amba_device uart2_device; +extern struct amba_device uart3_device; +extern struct amba_device uart4_device; +extern struct amba_device uart5_device; extern struct platform_device plgpio_device; extern struct platform_device nand_device; @@ -182,6 +187,8 @@ void __init spear310_init(void); /* Add spear320 machine device structure declarations here */ extern struct amba_device clcd_device; extern struct amba_device ssp_device[]; +extern struct amba_device uart1_device; +extern struct amba_device uart2_device; extern struct platform_device i2c1_device; extern struct platform_device nand_device; extern struct platform_device plgpio_device; diff --git a/arch/arm/mach-spear3xx/spear310.c b/arch/arm/mach-spear3xx/spear310.c index 189e3d4..25a0e94 100644 --- a/arch/arm/mach-spear3xx/spear310.c +++ b/arch/arm/mach-spear3xx/spear310.c @@ -142,6 +142,96 @@ struct pmx_driver pmx_driver = { }; /* Add spear310 specific devices here */ +/* uart1 device registeration */ +struct amba_device uart1_device = { + .dev = { + .init_name = "uart1", + }, + .res = { + .start = SPEAR310_UART1_BASE, + .end = SPEAR310_UART1_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + .irq = {VIRQ_UART1, NO_IRQ}, +}; + +/* uart2 device registeration */ +struct amba_device uart2_device = { + .dev = { + .init_name = "uart2", + }, + .res = { + .start = SPEAR310_UART2_BASE, + .end = SPEAR310_UART2_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + .irq = {VIRQ_UART2, NO_IRQ}, +}; + +/* uart3 device registeration */ +struct amba_device uart3_device = { + .dev = { + .init_name = "uart3", + }, + .res = { + .start = SPEAR310_UART3_BASE, + .end = SPEAR310_UART3_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + .irq = {VIRQ_UART3, NO_IRQ}, +}; + +/* uart4 device registeration */ +struct amba_device uart4_device = { + .dev = { + .init_name = "uart4", + }, + .res = { + .start = SPEAR310_UART4_BASE, + .end = SPEAR310_UART4_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + .irq = {VIRQ_UART4, NO_IRQ}, +}; + +/* uart5 device registeration */ +struct amba_device uart5_device = { + .dev = { + .init_name = "uart5", + }, + .res = { + .start = SPEAR310_UART5_BASE, + .end = SPEAR310_UART5_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + .irq = {VIRQ_UART5, NO_IRQ}, +}; + +/* nand device registeration */ +static struct fsmc_nand_platform_data nand_platform_data; + +static struct resource nand_resources[] = { + { + .name = "nand_data", + .start = SPEAR310_NAND_BASE, + .end = SPEAR310_NAND_BASE + SZ_16 - 1, + .flags = IORESOURCE_MEM, + }, { + .name = "fsmc_regs", + .start = SPEAR310_FSMC_BASE, + .end = SPEAR310_FSMC_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, +}; + +struct platform_device nand_device = { + .name = "nand", + .id = -1, + .resource = nand_resources, + .num_resources = ARRAY_SIZE(nand_resources), + .dev.platform_data = &nand_platform_data, +}; + /* plgpio device registeration */ /* * pin to offset and offset to pin converter functions @@ -178,31 +268,6 @@ int spear300_o2p(int offset) return offset + 2; } -/* nand device registeration */ -static struct fsmc_nand_platform_data nand_platform_data; - -static struct resource nand_resources[] = { - { - .name = "nand_data", - .start = SPEAR310_NAND_BASE, - .end = SPEAR310_NAND_BASE + SZ_16 - 1, - .flags = IORESOURCE_MEM, - }, { - .name = "fsmc_regs", - .start = SPEAR310_FSMC_BASE, - .end = SPEAR310_FSMC_BASE + SZ_4K - 1, - .flags = IORESOURCE_MEM, - }, -}; - -struct platform_device nand_device = { - .name = "nand", - .id = -1, - .resource = nand_resources, - .num_resources = ARRAY_SIZE(nand_resources), - .dev.platform_data = &nand_platform_data, -}; - static struct plgpio_platform_data plgpio_plat_data = { .gpio_base = 8, .irq_base = SPEAR_PLGPIO_INT_BASE, diff --git a/arch/arm/mach-spear3xx/spear320.c b/arch/arm/mach-spear3xx/spear320.c index 3f1c88b..8ecad40 100644 --- a/arch/arm/mach-spear3xx/spear320.c +++ b/arch/arm/mach-spear3xx/spear320.c @@ -447,6 +447,32 @@ struct amba_device ssp_device[] = { } }; +/* uart1 device registeration */ +struct amba_device uart1_device = { + .dev = { + .init_name = "uart1", + }, + .res = { + .start = SPEAR320_UART1_BASE, + .end = SPEAR320_UART1_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + .irq = {VIRQ_UART1, NO_IRQ}, +}; + +/* uart2 device registeration */ +struct amba_device uart2_device = { + .dev = { + .init_name = "uart2", + }, + .res = { + .start = SPEAR320_UART2_BASE, + .end = SPEAR320_UART2_BASE + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, + .irq = {VIRQ_UART2, NO_IRQ}, +}; + /* plgpio device registeration */ static struct plgpio_platform_data plgpio_plat_data = { .gpio_base = 8,