From patchwork Fri Sep 28 19:37:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Porter X-Patchwork-Id: 1522631 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id BC34DDF283 for ; Fri, 28 Sep 2012 19:41:15 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1THgP5-0001pi-9y; Fri, 28 Sep 2012 19:39:15 +0000 Received: from mail-ie0-f177.google.com ([209.85.223.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1THgNk-0001Mp-NG for linux-arm-kernel@lists.infradead.org; Fri, 28 Sep 2012 19:37:54 +0000 Received: by mail-ie0-f177.google.com with SMTP id e14so8694156iej.36 for ; Fri, 28 Sep 2012 12:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=ZTp+/B3h5wNu1py1cjxjQmD8DfOXfQKHAP6hc/oDUA8=; b=tBicENZHxFwYGYoS9kj+52EVpcl5l1JBfXzxVd7ZFo+G/3T23ya/aVaYYpc81Oj9ni lCpcr6462ucfVZGK7n6zTN8HklrRNEHFWypAtL8TtKavZpJXkKdJkw8QBsT8GTeb0h1d 4udhs3mbtE6slkEh+H2n/1yhqXcmRDfzfOjtLsLma39V5i4WDapS3OjwfbONnzc4nBRd e5QOK+MnJPp4Yg5z/EYi6cDdQEHIH/EEuqxxahLgT52pBwsimsR47Gb3HhqdoFYh1wqh 3uYSkCrlKLnR0jBlVHSlGhp/hlv2zzQdGorvc2OBOSEaBhStaKM+3VYTIWla5+d6nA4T vcyg== Received: by 10.50.33.147 with SMTP id r19mr2600949igi.73.1348861072571; Fri, 28 Sep 2012 12:37:52 -0700 (PDT) Received: from beef.ohporter.com (cpe-24-166-64-7.neo.res.rr.com. [24.166.64.7]) by mx.google.com with ESMTPS id q1sm449747igj.15.2012.09.28.12.37.50 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 28 Sep 2012 12:37:51 -0700 (PDT) From: Matt Porter To: Greg Kroah-Hartman , "Hans J. Koch" , Benoit Cousson , Paul Walmsley , Sekhar Nori Subject: [PATCH v2 5/7] ARM: davinci: Add support for PRUSS on DA850 Date: Fri, 28 Sep 2012 15:37:50 -0400 Message-Id: <1348861072-14507-6-git-send-email-mporter@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1348861072-14507-1-git-send-email-mporter@ti.com> References: <1348861072-14507-1-git-send-email-mporter@ti.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.223.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ohiomdp[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Linux DaVinci Kernel List , Russell King , Tony Lindgren , Linux Kernel Mailing List , Linux OMAP List , Linux ARM Kernel List X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Adds PRUSS clock, registers the L3RAM pool, and registers the platform device for uio_pruss on DA850. Signed-off-by: Matt Porter --- arch/arm/mach-davinci/board-da850-evm.c | 12 +++++ arch/arm/mach-davinci/da850.c | 9 ++++ arch/arm/mach-davinci/devices-da8xx.c | 66 ++++++++++++++++++++++++++++ arch/arm/mach-davinci/include/mach/da8xx.h | 3 ++ 4 files changed, 90 insertions(+) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 1295e61..d4f1720 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,7 @@ #include #include #include +#include #include #include @@ -1253,6 +1255,10 @@ static __init int da850_wl12xx_init(void) #endif /* CONFIG_DA850_WL12XX */ +struct uio_pruss_pdata da8xx_pruss_uio_pdata = { + .pintc_base = 0x4000, +}; + #define DA850EVM_SATA_REFCLKPN_RATE (100 * 1000 * 1000) static __init void da850_evm_init(void) @@ -1339,6 +1345,12 @@ static __init void da850_evm_init(void) pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n", ret); + da8xx_pruss_uio_pdata.l3ram_pool = sram_get_l3ram_pool(); + ret = da8xx_register_pruss_uio(&da8xx_pruss_uio_pdata); + if (ret) + pr_warning("pruss_uio initialization failed: %d\n", + ret); + /* Handle board specific muxing for LCD here */ ret = davinci_cfg_reg_list(da850_evm_lcdc_pins); if (ret) diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index 6676dee..131c175 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -212,6 +212,12 @@ static struct clk tptc2_clk = { .flags = ALWAYS_ENABLED, }; +static struct clk pruss_clk = { + .name = "pruss", + .parent = &pll0_sysclk2, + .lpsc = DA8XX_LPSC0_PRUSS, +}; + static struct clk uart0_clk = { .name = "uart0", .parent = &pll0_sysclk2, @@ -378,6 +384,7 @@ static struct clk_lookup da850_clks[] = { CLK(NULL, "tptc1", &tptc1_clk), CLK(NULL, "tpcc1", &tpcc1_clk), CLK(NULL, "tptc2", &tptc2_clk), + CLK(NULL, "pruss", &pruss_clk), CLK(NULL, "uart0", &uart0_clk), CLK(NULL, "uart1", &uart1_clk), CLK(NULL, "uart2", &uart2_clk), @@ -1089,6 +1096,8 @@ static struct davinci_soc_info davinci_soc_info_da850 = { .emac_pdata = &da8xx_emac_pdata, .sram_dma = DA8XX_ARM_RAM_BASE, .sram_len = SZ_8K, + .l3ram_dma = DA8XX_SHARED_RAM_BASE, + .l3ram_len = SZ_128K, }; void __init da850_init(void) diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index bd2f72b..7c2e0d2 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -518,6 +518,72 @@ void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata) } } +#define DA8XX_PRUSS_MEM_BASE 0x01C30000 + +static struct resource da8xx_pruss_resources[] = { + { + .start = DA8XX_PRUSS_MEM_BASE, + .end = DA8XX_PRUSS_MEM_BASE + 0xFFFF, + .flags = IORESOURCE_MEM, + }, + { + .start = IRQ_DA8XX_EVTOUT0, + .end = IRQ_DA8XX_EVTOUT0, + .flags = IORESOURCE_IRQ, + }, + { + .start = IRQ_DA8XX_EVTOUT1, + .end = IRQ_DA8XX_EVTOUT1, + .flags = IORESOURCE_IRQ, + }, + { + .start = IRQ_DA8XX_EVTOUT2, + .end = IRQ_DA8XX_EVTOUT2, + .flags = IORESOURCE_IRQ, + }, + { + .start = IRQ_DA8XX_EVTOUT3, + .end = IRQ_DA8XX_EVTOUT3, + .flags = IORESOURCE_IRQ, + }, + { + .start = IRQ_DA8XX_EVTOUT4, + .end = IRQ_DA8XX_EVTOUT4, + .flags = IORESOURCE_IRQ, + }, + { + .start = IRQ_DA8XX_EVTOUT5, + .end = IRQ_DA8XX_EVTOUT5, + .flags = IORESOURCE_IRQ, + }, + { + .start = IRQ_DA8XX_EVTOUT6, + .end = IRQ_DA8XX_EVTOUT6, + .flags = IORESOURCE_IRQ, + }, + { + .start = IRQ_DA8XX_EVTOUT7, + .end = IRQ_DA8XX_EVTOUT7, + .flags = IORESOURCE_IRQ, + }, +}; + +static struct platform_device da8xx_pruss_uio_dev = { + .name = "pruss_uio", + .id = -1, + .num_resources = ARRAY_SIZE(da8xx_pruss_resources), + .resource = da8xx_pruss_resources, + .dev = { + .coherent_dma_mask = 0xffffffff, + } +}; + +int __init da8xx_register_pruss_uio(struct uio_pruss_pdata *config) +{ + da8xx_pruss_uio_dev.dev.platform_data = config; + return platform_device_register(&da8xx_pruss_uio_dev); +} + static const struct display_panel disp_panel = { QVGA, 16, diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h index c9ee723..5320e12 100644 --- a/arch/arm/mach-davinci/include/mach/da8xx.h +++ b/arch/arm/mach-davinci/include/mach/da8xx.h @@ -25,6 +25,7 @@ #include #include #include +#include extern void __iomem *da8xx_syscfg0_base; extern void __iomem *da8xx_syscfg1_base; @@ -69,6 +70,7 @@ extern unsigned int da850_max_speed; #define DA8XX_AEMIF_CS3_BASE 0x62000000 #define DA8XX_AEMIF_CTL_BASE 0x68000000 #define DA8XX_ARM_RAM_BASE 0xffff0000 +#define DA8XX_SHARED_RAM_BASE 0x80000000 void __init da830_init(void); void __init da850_init(void); @@ -82,6 +84,7 @@ int da8xx_register_watchdog(void); int da8xx_register_usb20(unsigned mA, unsigned potpgt); int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata); int da8xx_register_emac(void); +int da8xx_register_pruss_uio(struct uio_pruss_pdata *config); int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata); int da8xx_register_mmcsd0(struct davinci_mmc_config *config); int da850_register_mmcsd1(struct davinci_mmc_config *config);