uio_pruss cleanup and platform support
v4 cover uio_pruss cleanup and platform support
Changes since v3:
- Reordered series to avoid dependency breakage
- Squashed iotable/ioremap patches to one and removed deprecated description comment about the SRAM consolidation series
- Separated gen_pool_add_virt status assignment and conditional
- Cleaned up board-da850-evm.c include ordering
- Changed the pdata l3ram_pool->sram_pool
- Separated DA850 SoC and board file changes
- Fixed pruss clk_lookup entry to have a dev_id value
- Moved pruss mem base definition in order with others
- Use DMA_BIT_MASK for our dma_mask
- Added testing information to commit descriptions
Changes since v2:
- Dropped AM33xx/OMAP support from series.
- Changed the DA850 L3 RAM gen_pool support to be based on a previous Davinci SRAM series from Subhasish Ghosh and Ben Gardiner.
Changes since v1:
- Replaced uio_pruss private SRAM API use with genalloc
- Added DA850 platform device and clock support
- Added DA850 L3 RAM gen_pool support
- Split out DT binding
This series enables uio_pruss on DA850 and removes use of the private SRAM API by the driver. The driver previously was not enabled by any platform and the private SRAM API was accessing an invalid SRAM bank.
It is regression tested on AM180x EVM with suspend/resume due to the new use of the shared SRAM for both PM and PRUSS. The uio_pruss driver is tested on the same platform using the PRU_memAccessPRUDataRam and PRU_memAccessL3andDDR examples from the PRU userspace tools available from http://www.ti.com/tool/sprc940
Ben Gardiner (1):
ARM: davinci: sram: switch from iotable to ioremapped regions
Matt Porter (5):
uio: uio_pruss: replace private SRAM API with genalloc
ARM: davinci: add platform hook to fetch the SRAM pool
ARM: davinci: add DA850 PRUSS support
ARM: davinci: clean up DA850 EVM include ordering
ARM: davinci: register pruss_uio device on DA850 EVM
Subhasish Ghosh (1):
ARM: davinci: da850: changed SRAM allocator to shared ram.
arch/arm/mach-davinci/board-da850-evm.c | 40 +++++++++++------ arch/arm/mach-davinci/da850.c | 17 +++---- arch/arm/mach-davinci/devices-da8xx.c | 65 +++++++++++++++++++++++++++ arch/arm/mach-davinci/dm355.c | 6 --- arch/arm/mach-davinci/dm365.c | 6 --- arch/arm/mach-davinci/dm644x.c | 6 --- arch/arm/mach-davinci/dm646x.c | 6 --- arch/arm/mach-davinci/include/mach/common.h | 2 - arch/arm/mach-davinci/include/mach/da8xx.h | 3 ++ arch/arm/mach-davinci/include/mach/sram.h | 3 ++ arch/arm/mach-davinci/sram.c | 23 ++++++++-- drivers/uio/Kconfig | 1 + drivers/uio/uio_pruss.c | 24 +++++++--- include/linux/platform_data/uio_pruss.h | 3 +- 14 files changed, 146 insertions(+), 59 deletions(-)
Signature · 1 line
1.7.9.5
PATCH v4 1/7 uio: uio_pruss: replace private SRAM API with genalloc
Remove the use of the private DaVinci SRAM API in favor of genalloc. The pool to be used is provided by platform data.
--- drivers/uio/Kconfig | 1 + drivers/uio/uio_pruss.c | 24 +++++++++++++++++------- include/linux/platform_data/uio_pruss.h | 3 ++- 3 files changed, 20 insertions(+), 8 deletions(-)
drivers/uio/Kconfig +1 -0
@@ -97,6 +97,7 @@ config UIO_NETX config UIO_PRUSS tristate "Texas Instruments PRUSS driver" depends on ARCH_DAVINCI_DA850 + select GENERIC_ALLOCATOR help PRUSS driver for OMAPL138/DA850/AM18XX devices PRUSS driver requires user space components, examples and user space
drivers/uio/uio_pruss.c +17 -7
@@ -25,7 +25,7 @@#include <linux/clk.h> #include <linux/dma-mapping.h> #include <linux/slab.h> -#include <mach/sram.h> +#include <linux/genalloc.h> #define DRV_NAME "pruss_uio"#define DRV_VERSION "1.0"
@@ -65,10 +65,11 @@ struct uio_pruss_dev {dma_addr_t sram_paddr;dma_addr_t ddr_paddr;void __iomem *prussio_vaddr; -void *sram_vaddr; +unsigned long sram_vaddr;void *ddr_vaddr;unsigned int hostirq_start;unsigned int pintc_base; +struct gen_pool *sram_pool; };static irqreturn_t pruss_handler (int irq,struct uio_info *info)
@@ -106,7 +107,9 @@ static void pruss_cleanup(struct platform_device *dev, gdev->ddr_paddr); }if (gdev->sram_vaddr) -sram_free (gdev->sram_vaddr, sram_pool_sz); +gen_pool_free (gdev->sram_pool, + gdev->sram_vaddr, + sram_pool_sz);kfree (gdev->info);clk_put (gdev->pruss_clk);kfree (gdev);
@@ -152,10 +155,17 @@ static int __devinit pruss_probe(struct platform_device *dev) goto out_free; } - gdev->sram_vaddr =sram_alloc (sram_pool_sz, &(gdev->sram_paddr)); -if (!gdev->sram_vaddr) { -dev_err (&dev->dev,"Could not allocate SRAM pool\n" ); - goto out_free; +if (pdata->sram_pool) { + gdev->sram_pool = pdata->sram_pool; + gdev->sram_vaddr = +gen_pool_alloc (gdev->sram_pool, sram_pool_sz); +if (!gdev->sram_vaddr) { +dev_err (&dev->dev,"Could not allocate SRAM pool\n" ); + goto out_free; + } + gdev->sram_paddr = +gen_pool_virt_to_phys (gdev->sram_pool, + gdev->sram_vaddr); } gdev->ddr_vaddr = dma_alloc_coherent(&dev->dev, extram_pool_sz,
include/linux/platform_data/uio_pruss.h +2 -1
@@ -20,6 +20,7 @@/* To configure the PRUSS INTC base offset for UIO driver */ struct uio_pruss_pdata { -u32 pintc_base; +u32 pintc_base; +struct gen_pool *sram_pool; };#endif /* _UIO_PRUSS_H_ */
Signature · 1 line
1.7.9.5
Re: [PATCH v4 1/7] uio: uio_pruss: replace private SRAM API with genalloc
Quoted 5 lines · Matt Porter
Remove the use of the private DaVinci SRAM API in favor of genalloc. The pool to be used is provided by platform data.
Signed-off-by Matt Porter <[email protected]>
Hans,
Any additional concerns on this patch? Sekhar is holding off on applying parts 4,5,7 for davinci until this is accepted.
Thanks,
Matt
Quoted 93 lines
--- drivers/uio/Kconfig | 1 + drivers/uio/uio_pruss.c | 24 +++++++++++++++++------- include/linux/platform_data/uio_pruss.h | 3 ++- 3 files changed, 20 insertions(+), 8 deletions(-)drivers/uio/Kconfig +1
-0@@ -97,6 +97,7 @@ config UIO_NETX config UIO_PRUSS tristate "Texas Instruments PRUSS driver" depends on ARCH_DAVINCI_DA850 + select GENERIC_ALLOCATOR help PRUSS driver for OMAPL138/DA850/AM18XX devices PRUSS driver requires user space components, examples and user spacedrivers/uio/uio_pruss.c +17
-7@@ -25,7 +25,7 @@#include <linux/clk.h> #include <linux/dma-mapping.h> #include <linux/slab.h> -#include <mach/sram.h> +#include <linux/genalloc.h> #define DRV_NAME "pruss_uio"#define DRV_VERSION "1.0"@@ -65,10 +65,11 @@ struct uio_pruss_dev {dma_addr_t sram_paddr;dma_addr_t ddr_paddr;void __iomem *prussio_vaddr; -void *sram_vaddr; +unsigned long sram_vaddr;void *ddr_vaddr;unsigned int hostirq_start;unsigned int pintc_base; +struct gen_pool *sram_pool; };static irqreturn_t pruss_handler (int irq,struct uio_info *info)@@ -106,7 +107,9 @@ static void pruss_cleanup(struct platform_device *dev, gdev->ddr_paddr); }if (gdev->sram_vaddr) -sram_free (gdev->sram_vaddr, sram_pool_sz); +gen_pool_free (gdev->sram_pool, + gdev->sram_vaddr, + sram_pool_sz);kfree (gdev->info);clk_put (gdev->pruss_clk);kfree (gdev);@@ -152,10 +155,17 @@ static int __devinit pruss_probe(struct platform_device *dev) goto out_free; } - gdev->sram_vaddr =sram_alloc (sram_pool_sz, &(gdev->sram_paddr)); -if (!gdev->sram_vaddr) { -dev_err (&dev->dev,"Could not allocate SRAM pool\n" ); - goto out_free; +if (pdata->sram_pool) { + gdev->sram_pool = pdata->sram_pool; + gdev->sram_vaddr = +gen_pool_alloc (gdev->sram_pool, sram_pool_sz); +if (!gdev->sram_vaddr) { +dev_err (&dev->dev,"Could not allocate SRAM pool\n" ); + goto out_free; + } + gdev->sram_paddr = +gen_pool_virt_to_phys (gdev->sram_pool, + gdev->sram_vaddr); } gdev->ddr_vaddr = dma_alloc_coherent(&dev->dev, extram_pool_sz,include/linux/platform_data/uio_pruss.h +2
-1@@ -20,6 +20,7 @@/* To configure the PRUSS INTC base offset for UIO driver */ struct uio_pruss_pdata { -u32 pintc_base; +u32 pintc_base; +struct gen_pool *sram_pool; };#endif /* _UIO_PRUSS_H_ */ Signature · 1 line
1.7.9.5
Re: [PATCH v4 1/7] uio: uio_pruss: replace private SRAM API with genalloc
Quoted 10 lines · Matt Porter
Quoted 5 lines · Matt Porter
Remove the use of the private DaVinci SRAM API in favor of genalloc. The pool to be used is provided by platform data.
Signed-off-by Matt Porter <[email protected]>Hans,
Any additional concerns on this patch?
Not from my side. I was waiting for your discussion to calm down.
Quoted 2 lines
Sekhar is holding off on applying
parts 4,5,7 for davinci until this is accepted.
You can add my
Thanks,
Hans
Quoted 103 lines
Thanks,
MattQuoted 93 lines
--- drivers/uio/Kconfig | 1 + drivers/uio/uio_pruss.c | 24 +++++++++++++++++------- include/linux/platform_data/uio_pruss.h | 3 ++- 3 files changed, 20 insertions(+), 8 deletions(-)drivers/uio/Kconfig +1
-0@@ -97,6 +97,7 @@ config UIO_NETX config UIO_PRUSS tristate "Texas Instruments PRUSS driver" depends on ARCH_DAVINCI_DA850 + select GENERIC_ALLOCATOR help PRUSS driver for OMAPL138/DA850/AM18XX devices PRUSS driver requires user space components, examples and user spacedrivers/uio/uio_pruss.c +17
-7@@ -25,7 +25,7 @@#include <linux/clk.h> #include <linux/dma-mapping.h> #include <linux/slab.h> -#include <mach/sram.h> +#include <linux/genalloc.h> #define DRV_NAME "pruss_uio"#define DRV_VERSION "1.0"@@ -65,10 +65,11 @@ struct uio_pruss_dev {dma_addr_t sram_paddr;dma_addr_t ddr_paddr;void __iomem *prussio_vaddr; -void *sram_vaddr; +unsigned long sram_vaddr;void *ddr_vaddr;unsigned int hostirq_start;unsigned int pintc_base; +struct gen_pool *sram_pool; };static irqreturn_t pruss_handler (int irq,struct uio_info *info)@@ -106,7 +107,9 @@ static void pruss_cleanup(struct platform_device *dev, gdev->ddr_paddr); }if (gdev->sram_vaddr) -sram_free (gdev->sram_vaddr, sram_pool_sz); +gen_pool_free (gdev->sram_pool, + gdev->sram_vaddr, + sram_pool_sz);kfree (gdev->info);clk_put (gdev->pruss_clk);kfree (gdev);@@ -152,10 +155,17 @@ static int __devinit pruss_probe(struct platform_device *dev) goto out_free; } - gdev->sram_vaddr =sram_alloc (sram_pool_sz, &(gdev->sram_paddr)); -if (!gdev->sram_vaddr) { -dev_err (&dev->dev,"Could not allocate SRAM pool\n" ); - goto out_free; +if (pdata->sram_pool) { + gdev->sram_pool = pdata->sram_pool; + gdev->sram_vaddr = +gen_pool_alloc (gdev->sram_pool, sram_pool_sz); +if (!gdev->sram_vaddr) { +dev_err (&dev->dev,"Could not allocate SRAM pool\n" ); + goto out_free; + } + gdev->sram_paddr = +gen_pool_virt_to_phys (gdev->sram_pool, + gdev->sram_vaddr); } gdev->ddr_vaddr = dma_alloc_coherent(&dev->dev, extram_pool_sz,include/linux/platform_data/uio_pruss.h +2
-1@@ -20,6 +20,7 @@/* To configure the PRUSS INTC base offset for UIO driver */ struct uio_pruss_pdata { -u32 pintc_base; +u32 pintc_base; +struct gen_pool *sram_pool; };#endif /* _UIO_PRUSS_H_ */ Signature · 1 line
1.7.9.5--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
PATCH v4 2/7 ARM: davinci: sram: switch from iotable to ioremapped regions
In reply to Matt PorterFrom: Ben Gardiner <[email protected]>
The current davinci init sets up SRAM in iotables. There has been an observed failure to boot a da850 with 128K specified in the iotable.
Make the davinci sram allocator do an ioremap of the region specified by the entries in davinci_soc_info before registering with gen_pool_add_virt(). Remove all iotable SRAM mappings and SRAM_VIRT.
Regression tested suspend/resume on AM180x EVM.
--- arch/arm/mach-davinci/da850.c | 6 ------ arch/arm/mach-davinci/dm355.c | 6 ------ arch/arm/mach-davinci/dm365.c | 6 ------ arch/arm/mach-davinci/dm644x.c | 6 ------ arch/arm/mach-davinci/dm646x.c | 6 ------ arch/arm/mach-davinci/include/mach/common.h | 2 -- arch/arm/mach-davinci/sram.c | 18 +++++++++++++++--- 7 files changed, 15 insertions(+), 35 deletions(-)
arch/arm/mach-davinci/da850.c +0 -6
@@ -713,12 +713,6 @@ static struct map_desc da850_io_desc[] = { .length = DA8XX_CP_INTC_SIZE, .type =MT_DEVICE }, - { - .virtual = SRAM_VIRT, - .pfn = __phys_to_pfn(DA8XX_ARM_RAM_BASE), - .length = SZ_8K, - .type =MT_DEVICE - }, };static u32 da850_psc_bases[] = {DA8XX_PSC0_BASE ,DA8XX_PSC1_BASE };
arch/arm/mach-davinci/dm355.c +0 -6
@@ -758,12 +758,6 @@ static struct map_desc dm355_io_desc[] = { .length = IO_SIZE, .type =MT_DEVICE }, - { - .virtual = SRAM_VIRT, - .pfn = __phys_to_pfn(0x00010000), - .length = SZ_32K, - .type = MT_MEMORY_NONCACHED, - }, };/* Contents of JTAG ID register used to identify exact cpu type */
arch/arm/mach-davinci/dm365.c +0 -6
@@ -985,12 +985,6 @@ static struct map_desc dm365_io_desc[] = { .length = IO_SIZE, .type =MT_DEVICE }, - { - .virtual = SRAM_VIRT, - .pfn = __phys_to_pfn(0x00010000), - .length = SZ_32K, - .type = MT_MEMORY_NONCACHED, - }, };static struct resource dm365_ks_resources[] = {
arch/arm/mach-davinci/dm644x.c +0 -6
@@ -795,12 +795,6 @@ static struct map_desc dm644x_io_desc[] = { .length = IO_SIZE, .type =MT_DEVICE }, - { - .virtual = SRAM_VIRT, - .pfn = __phys_to_pfn(0x00008000), - .length = SZ_16K, - .type = MT_MEMORY_NONCACHED, - }, };/* Contents of JTAG ID register used to identify exact cpu type */
arch/arm/mach-davinci/dm646x.c +0 -6
@@ -756,12 +756,6 @@ static struct map_desc dm646x_io_desc[] = { .length = IO_SIZE, .type =MT_DEVICE }, - { - .virtual = SRAM_VIRT, - .pfn = __phys_to_pfn(0x00010000), - .length = SZ_32K, - .type = MT_MEMORY_NONCACHED, - }, };/* Contents of JTAG ID register used to identify exact cpu type */
arch/arm/mach-davinci/include/mach/common.h +0 -2
@@ -104,8 +104,6 @@ int davinci_pm_init(void);static inline int davinci_pm_init (void ) {return 0 ; }#endif -/* standard place to map on-chip SRAMs; they *may* support DMA */ -#define SRAM_VIRT 0xfffe0000#define SRAM_SIZE SZ_128K#endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
arch/arm/mach-davinci/sram.c +15 -3
@@ -10,6 +10,7 @@*/ #include <linux/module.h> #include <linux/init.h> +#include <linux/io.h> #include <linux/genalloc.h> #include <mach/common.h>
@@ -32,7 +33,7 @@ void *sram_alloc(size_t len, dma_addr_t *dma)return NULL ;if (dma) - *dma = dma_base + (vaddr -SRAM_VIRT ); + *dma =gen_pool_virt_to_phys (sram_pool, vaddr);return (void *)vaddr; }
@@ -53,8 +54,10 @@ EXPORT_SYMBOL(sram_free);*/ static int __init sram_init (void ) { +phys_addr_t phys = davinci_soc_info.sram_dma;unsigned len = davinci_soc_info.sram_len;int status =0 ; +void *addr;if (len) { len =min_t (unsigned, len,SRAM_SIZE );
@@ -62,8 +65,17 @@ static int __init sram_init(void)if (!sram_pool) status = -ENOMEM ; } -if (sram_pool) - status =gen_pool_add (sram_pool,SRAM_VIRT , len,-1 ); + +if (sram_pool) { + addr =ioremap (phys, len); +if (!addr) +return -ENOMEM ; + status =gen_pool_add_virt (sram_pool, (unsigned )addr, + phys, len,-1 ); +if (status <0 ) +iounmap (addr); + } +WARN_ON (status <0 );return status; }
Signature · 1 line
1.7.9.5
PATCH v4 3/7 ARM: davinci: da850: changed SRAM allocator to shared ram.
In reply to Matt PorterFrom: Subhasish Ghosh <[email protected]>
This patch modifies the sram allocator to allocate memory from the DA8XX shared RAM.
Regression tested suspend/resume on AM180x EVM.
--- arch/arm/mach-davinci/da850.c | 4 ++-- arch/arm/mach-davinci/include/mach/da8xx.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-davinci/da850.c +2 -2
@@ -1081,8 +1081,8 @@ static struct davinci_soc_info davinci_soc_info_da850 = { .gpio_irq = IRQ_DA8XX_GPIO0, .serial_dev = &da8xx_serial_device, .emac_pdata = &da8xx_emac_pdata, - .sram_dma = DA8XX_ARM_RAM_BASE, - .sram_len = SZ_8K, + .sram_dma = DA8XX_SHARED_RAM_BASE, + .sram_len = SZ_128K, };void __init da850_init (void )
arch/arm/mach-davinci/include/mach/da8xx.h +1 -0
@@ -68,6 +68,7 @@ extern unsigned int da850_max_speed;#define DA8XX_AEMIF_CS2_BASE 0x60000000#define DA8XX_AEMIF_CS3_BASE 0x62000000#define DA8XX_AEMIF_CTL_BASE 0x68000000 +#define DA8XX_SHARED_RAM_BASE 0x80000000#define DA8XX_ARM_RAM_BASE 0xffff0000void __init da830_init (void );
Signature · 1 line
1.7.9.5
PATCH v4 4/7 ARM: davinci: add platform hook to fetch the SRAM pool
In reply to Matt PorterAdds sram_get_gen_pool() which allows platform code to get the machine's SRAM gen_pool. The gen_pool may be passed in platform data for driver genalloc use.
--- arch/arm/mach-davinci/include/mach/sram.h | 3 +++ arch/arm/mach-davinci/sram.c | 5 +++++ 2 files changed, 8 insertions(+)
arch/arm/mach-davinci/include/mach/sram.h +3 -0
@@ -24,4 +24,7 @@extern void *sram_alloc (size_t len,dma_addr_t *dma);extern void sram_free (void *addr,size_t len); +/* Get the struct gen_pool * for use in platform data */ +extern struct gen_pool *sram_get_gen_pool (void ); +#endif /* __MACH_SRAM_H */
arch/arm/mach-davinci/sram.c +5 -0
@@ -18,6 +18,11 @@static struct gen_pool *sram_pool; +struct gen_pool *sram_get_gen_pool (void ) +{ +return sram_pool; +} +void *sram_alloc (size_t len,dma_addr_t *dma) {unsigned long vaddr;
Signature · 1 line
1.7.9.5
PATCH v4 5/7 ARM: davinci: add DA850 PRUSS support
In reply to Matt PorterAdds PRUSS clock support and registration helper for the pruss_uio device.
--- arch/arm/mach-davinci/da850.c | 7 +++ arch/arm/mach-davinci/devices-da8xx.c | 65 ++++++++++++++++++++++++++++ arch/arm/mach-davinci/include/mach/da8xx.h | 2 + 3 files changed, 74 insertions(+)
arch/arm/mach-davinci/da850.c +7 -0
@@ -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 ("pruss_uio" ,"pruss" , &pruss_clk),CLK (NULL ,"uart0" , &uart0_clk),CLK (NULL ,"uart1" , &uart1_clk), CLK(NULL, "uart2", &uart2_clk),
arch/arm/mach-davinci/devices-da8xx.c +65 -0
77 lines not on this page · raw message
arch/arm/mach-davinci/include/mach/da8xx.h +2 -0
@@ -25,6 +25,7 @@#include <linux/platform_data/mmc-davinci.h> #include <linux/platform_data/usb-davinci.h> #include <linux/platform_data/spi-davinci.h> +#include <linux/platform_data/uio_pruss.h> extern void __iomem *da8xx_syscfg0_base;extern void __iomem *da8xx_syscfg1_base;
@@ -83,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);
Signature · 1 line
1.7.9.5
PATCH v5 5/7 ARM: davinci: da8xx: add DA850 PRUSS support
Adds PRUSS clock support and registration helper for the uio_pruss device.
--- arch/arm/mach-davinci/da850.c | 7 +++ arch/arm/mach-davinci/devices-da8xx.c | 71 ++++++++++++++++++++++++++++ arch/arm/mach-davinci/include/mach/da8xx.h | 2 + 3 files changed, 80 insertions(+)
arch/arm/mach-davinci/da850.c +7 -0
@@ -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 ("pruss_uio" ,"pruss" , &pruss_clk),CLK (NULL ,"uart0" , &uart0_clk),CLK (NULL ,"uart1" , &uart1_clk), CLK(NULL, "uart2", &uart2_clk),
arch/arm/mach-davinci/devices-da8xx.c +71 -0
89 lines not on this page · raw message
arch/arm/mach-davinci/include/mach/da8xx.h +2 -0
@@ -25,6 +25,7 @@#include <linux/platform_data/mmc-davinci.h> #include <linux/platform_data/usb-davinci.h> #include <linux/platform_data/spi-davinci.h> +#include <linux/platform_data/uio_pruss.h> extern void __iomem *da8xx_syscfg0_base;extern void __iomem *da8xx_syscfg1_base;
@@ -83,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_uio_pruss (void );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);
Signature · 1 line
1.7.9.5
PATCH v4 6/7 ARM: davinci: clean up DA850 EVM include ordering
In reply to Matt PorterReorder includes so they are grouped by linux/mach/asm
--- arch/arm/mach-davinci/board-da850-evm.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
arch/arm/mach-davinci/board-da850-evm.c +14 -14
@@ -11,39 +11,39 @@* is licensed "as is" without any warranty of any kind, whether express * or implied. */ -#include <linux/kernel.h> -#include <linux/init.h> #include <linux/console.h> +#include <linux/delay.h> +#include <linux/gpio.h> +#include <linux/gpio_keys.h> +#include <linux/init.h> +#include <linux/kernel.h> #include <linux/i2c.h> #include <linux/i2c/at24.h> #include <linux/i2c/pca953x.h> #include <linux/input.h> +#include <linux/input/tps6507x-ts.h> #include <linux/mfd/tps6507x.h> -#include <linux/gpio.h> -#include <linux/gpio_keys.h> -#include <linux/platform_device.h> #include <linux/mtd/mtd.h> #include <linux/mtd/nand.h> #include <linux/mtd/partitions.h> #include <linux/mtd/physmap.h> +#include <linux/platform_device.h> +#include <linux/platform_data/mtd-davinci.h> +#include <linux/platform_data/mtd-davinci-aemif.h> +#include <linux/platform_data/spi-davinci.h> #include <linux/regulator/machine.h> #include <linux/regulator/tps6507x.h> -#include <linux/input/tps6507x-ts.h> #include <linux/spi/spi.h> #include <linux/spi/flash.h> -#include <linux/delay.h> #include <linux/wl12xx.h> -#include <asm/mach-types.h> -#include <asm/mach/arch.h> -#include <asm/system_info.h> -#include <mach/cp_intc.h> #include <mach/da8xx.h> -#include <linux/platform_data/mtd-davinci.h> #include <mach/mux.h> -#include <linux/platform_data/mtd-davinci-aemif.h> -#include <linux/platform_data/spi-davinci.h> + +#include <asm/mach-types.h> +#include <asm/mach/arch.h> +#include <asm/system_info.h> #define DA850_EVM_PHY_ID "davinci_mdio-0:00"#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)
Signature · 1 line
1.7.9.5
Re: [PATCH v4 6/7] ARM: davinci: clean up DA850 EVM include ordering
Quoted 3 lines · Matt Porter
Reorder includes so they are grouped by linux/mach/asm
Signed-off-by Matt Porter <[email protected]>
Thanks for the clean-up. While committing, I changed the subject to:
"ARM: davinci: da850 evm: clean up include ordering"
which is the convention I prefer.
Thanks,
Sekhar
PATCH v4 7/7 ARM: davinci: register pruss_uio device on DA850 EVM
In reply to Matt PorterConfigures the required pdata and registers the pruss_uio platform device on the DA850 EVM.
Tested on AM180x-EVM using the PRU_memAccessPRUDataRam and PRU_memAccessL3andDDR examples from the PRU userspace tools available from http://www.ti.com/tool/sprc940
--- arch/arm/mach-davinci/board-da850-evm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm/mach-davinci/board-da850-evm.c +12 -0
@@ -31,6 +31,7 @@#include <linux/platform_data/mtd-davinci.h> #include <linux/platform_data/mtd-davinci-aemif.h> #include <linux/platform_data/spi-davinci.h> +#include <linux/platform_data/uio_pruss.h> #include <linux/regulator/machine.h> #include <linux/regulator/tps6507x.h> #include <linux/spi/spi.h>
@@ -40,6 +41,7 @@#include <mach/cp_intc.h> #include <mach/da8xx.h> #include <mach/mux.h> +#include <mach/sram.h> #include <asm/mach-types.h> #include <asm/mach/arch.h>
@@ -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.sram_pool =sram_get_gen_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)
Signature · 1 line
1.7.9.5
Re: [PATCH v4 7/7] ARM: davinci: register pruss_uio device on DA850 EVM
Quoted 44 lines · Matt Porter
Configures the required pdata and registers the
pruss_uioplatform device on the DA850 EVM.Tested on AM180x-EVM using the
PRU_memAccessPRUDataRamandPRU_memAccessL3andDDRexamples from the PRU userspace tools available from http://www.ti.com/tool/sprc940Signed-off-by Matt Porter <[email protected]>--- arch/arm/mach-davinci/board-da850-evm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)arch/arm/mach-davinci/board-da850-evm.c +6
-0@@ -31,6 +31,7 @@#include <linux/platform_data/mtd-davinci.h> #include <linux/platform_data/mtd-davinci-aemif.h> #include <linux/platform_data/spi-davinci.h> +#include <linux/platform_data/uio_pruss.h> #include <linux/regulator/machine.h> #include <linux/regulator/tps6507x.h> #include <linux/spi/spi.h> @@ -40,6 +41,7 @@#include <mach/cp_intc.h> #include <mach/da8xx.h> #include <mach/mux.h> +#include <mach/sram.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> @@ -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 )
arch/arm/mach-davinci/board-da850-evm.c static __init void da850_evm_init(void) · line 1352
Quoted 8 lines
arch/arm/mach-davinci/board-da850-evm.c +5
-0@@ -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.sram_pool =sram_get_gen_pool (); + ret =da8xx_register_pruss_uio (&da8xx_pruss_uio_pdata); +if (ret) +pr_warning ("pruss_uio initialization failed: %d\n" , + ret);
I failed to mention this last time around, but is there any reason platform data will change from board to board? Looks like the pintc_base is SoC specific and that all platforms would use SRAM when using the pruss driver. Looks like you can make da8xx_register_pruss_uio() take no parameters at all.
Thanks,
Sekhar
Re: [PATCH v4 7/7] ARM: davinci: register pruss_uio device on DA850 EVM
Quoted 48 lines · Sekhar Nori
Quoted 47 lines · Matt Porter
Configures the required pdata and registers the
pruss_uioplatform device on the DA850 EVM.Tested on AM180x-EVM using the
PRU_memAccessPRUDataRamandPRU_memAccessL3andDDRexamples from the PRU userspace tools available from http://www.ti.com/tool/sprc940Signed-off-by Matt Porter <[email protected]>--- arch/arm/mach-davinci/board-da850-evm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)arch/arm/mach-davinci/board-da850-evm.c +6
-0@@ -31,6 +31,7 @@#include <linux/platform_data/mtd-davinci.h> #include <linux/platform_data/mtd-davinci-aemif.h> #include <linux/platform_data/spi-davinci.h> +#include <linux/platform_data/uio_pruss.h> #include <linux/regulator/machine.h> #include <linux/regulator/tps6507x.h> #include <linux/spi/spi.h> @@ -40,6 +41,7 @@#include <mach/cp_intc.h> #include <mach/da8xx.h> #include <mach/mux.h> +#include <mach/sram.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> @@ -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);
Quoted 11 lines
arch/arm/mach-davinci/board-da850-evm.c static __init void da850_evm_init(void) · line 1352
Quoted 5 lines
arch/arm/mach-davinci/board-da850-evm.c +5
-0+ da8xx_pruss_uio_pdata.sram_pool =sram_get_gen_pool (); + ret =da8xx_register_pruss_uio (&da8xx_pruss_uio_pdata); +if (ret) +pr_warning ("pruss_uio initialization failed: %d\n" , + ret);I failed to mention this last time around, but is there any reason platform data will change from board to board? Looks like the
pintc_baseis SoC specific and that all platforms would use SRAM when using the pruss driver. Looks like you can makeda8xx_register_pruss_uio()take no parameters at all.
No reason, just oversight here. I'll update these two patches so this is done at the SoC level.
-Matt
PATCH v5 7/7 ARM: davinci: da850 evm: register uio_pruss device
In reply to Matt PorterRegisters the uio_pruss platform device on the DA850 EVM.
Tested on AM180x-EVM using the PRU_memAccessPRUDataRam and PRU_memAccessL3andDDR examples from the PRU userspace tools available from http://www.ti.com/tool/sprc940
--- arch/arm/mach-davinci/board-da850-evm.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/mach-davinci/board-da850-evm.c +6 -0
@@ -31,6 +31,7 @@#include <linux/platform_data/mtd-davinci.h> #include <linux/platform_data/mtd-davinci-aemif.h> #include <linux/platform_data/spi-davinci.h> +#include <linux/platform_data/uio_pruss.h> #include <linux/regulator/machine.h> #include <linux/regulator/tps6507x.h> #include <linux/spi/spi.h>
@@ -1339,6 +1340,11 @@ static __init void da850_evm_init(void)pr_warning ("da850_evm_init: lcdcntl mux setup failed: %d\n" , ret); + ret =da8xx_register_uio_pruss (); +if (ret) +pr_warning ("da850_evm_init: pruss initialization failed: %d\n" , + ret); +/* Handle board specific muxing for LCD here */ ret =davinci_cfg_reg_list (da850_evm_lcdc_pins);if (ret)
Signature · 1 line
1.7.9.5
Re: [PATCH v5 7/7] ARM: davinci: da850 evm: register uio_pruss device
Quoted 24 lines · Matt Porter
Registers the
uio_prussplatform device on the DA850 EVM.Tested on AM180x-EVM using the
PRU_memAccessPRUDataRamandPRU_memAccessL3andDDRexamples from the PRU userspace tools available from http://www.ti.com/tool/sprc940Signed-off-by Matt Porter <[email protected]>--- arch/arm/mach-davinci/board-da850-evm.c | 6 ++++++ 1 file changed, 6 insertions(+)arch/arm/mach-davinci/board-da850-evm.c +1
-0@@ -31,6 +31,7 @@#include <linux/platform_data/mtd-davinci.h> #include <linux/platform_data/mtd-davinci-aemif.h> #include <linux/platform_data/spi-davinci.h> +#include <linux/platform_data/uio_pruss.h> #include <linux/regulator/machine.h> #include <linux/regulator/tps6507x.h> #include <linux/spi/spi.h>
arch/arm/mach-davinci/board-da850-evm.c static __init void da850_evm_init(void) · line 1345
Quoted 6 lines
arch/arm/mach-davinci/board-da850-evm.c +3
-0@@ -1339,6 +1340,11 @@ static __init void da850_evm_init(void)pr_warning ("da850_evm_init: lcdcntl mux setup failed: %d\n" , ret); + ret =da8xx_register_uio_pruss (); +if (ret) + pr_warning("da850_evm_init: pruss initialization failed: %d\n",
So this gave a checkpatch warning asking you to use pr_warn() instead. I fixed this locally.
Thanks,
Sekhar
Quoted 10 lines · Matt Porter
This series enables
uio_prusson DA850 and removes use of the private SRAM API by the driver. The driver previously was not enabled by any platform and the private SRAM API was accessing an invalid SRAM bank.It is regression tested on AM180x EVM with suspend/resume due to the new use of the shared SRAM for both PM and PRUSS. The
uio_prussdriver is tested on the same platform using thePRU_memAccessPRUDataRamandPRU_memAccessL3andDDRexamples from the PRU userspace tools available from http://www.ti.com/tool/sprc940
I applied patches 2/7, 3/7 and 6/7 of this series for v3.8. I have some comments on the board patch. Rest of the patches depend on acceptance of 1/7 so I will take them only after that is accepted.
Thanks,
Sekhar
Quoted 13 lines · Sekhar Nori
Quoted 10 lines · Matt Porter
This series enables
uio_prusson DA850 and removes use of the private SRAM API by the driver. The driver previously was not enabled by any platform and the private SRAM API was accessing an invalid SRAM bank.It is regression tested on AM180x EVM with suspend/resume due to the new use of the shared SRAM for both PM and PRUSS. The
uio_prussdriver is tested on the same platform using thePRU_memAccessPRUDataRamandPRU_memAccessL3andDDRexamples from the PRU userspace tools available from http://www.ti.com/tool/sprc940
Quoted 3 lines
I applied patches 2/7, 3/7 and 6/7 of this series for v3.8. I have some comments on the board patch. Rest of the patches depend on acceptance of 1/7 so I will take them only after that is accepted.
Ok, thanks...and I'll post a v5 of 5/7 and 7/7 and those should be ready when 1/7 is accepted.
-Matt
Quoted 13 lines · Sekhar Nori
Quoted 10 lines · Matt Porter
This series enables
uio_prusson DA850 and removes use of the private SRAM API by the driver. The driver previously was not enabled by any platform and the private SRAM API was accessing an invalid SRAM bank.It is regression tested on AM180x EVM with suspend/resume due to the new use of the shared SRAM for both PM and PRUSS. The
uio_prussdriver is tested on the same platform using thePRU_memAccessPRUDataRamandPRU_memAccessL3andDDRexamples from the PRU userspace tools available from http://www.ti.com/tool/sprc940
Quoted 3 lines
I applied patches 2/7, 3/7 and 6/7 of this series for v3.8. I have some comments on the board patch. Rest of the patches depend on acceptance of 1/7 so I will take them only after that is accepted.
Ok, Hans has accepted 1/7, will you take the entire series through the Davinci tree?
-Matt
Quoted 14 lines · Matt Porter
Quoted 13 lines · Sekhar Nori
Quoted 10 lines · Matt Porter
This series enables
uio_prusson DA850 and removes use of the private SRAM API by the driver. The driver previously was not enabled by any platform and the private SRAM API was accessing an invalid SRAM bank.It is regression tested on AM180x EVM with suspend/resume due to the new use of the shared SRAM for both PM and PRUSS. The
uio_prussdriver is tested on the same platform using thePRU_memAccessPRUDataRamandPRU_memAccessL3andDDRexamples from the PRU userspace tools available from http://www.ti.com/tool/sprc940
Quoted 6 lines
Quoted 3 lines
I applied patches 2/7, 3/7 and 6/7 of this series for v3.8. I have some comments on the board patch. Rest of the patches depend on acceptance of 1/7 so I will take them only after that is accepted.
Ok, Hans has accepted 1/7, will you take the entire series through the Davinci tree?
Yes.
Thanks,
Sekhar