RE: [RFC PATCH v4] Consolidate SRAM support
On Fri, Jul 08, 2011 at 22:21:52, Nori, Sekhar wrote: > Hi Jean-Christophe, > > On Thu, May 26, 2011 at 06:32:57, Jean-Christophe PLAGNIOL-VILLARD wrote: > > From: Russell King - ARM Linux > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > > index f4b7dfa..5ec5e5f 100644 > > --- a/arch/arm/Kconfig > > +++ b/arch/arm/Kconfig > > @@ -848,6 +848,7 @@ config ARCH_DAVINCI > > bool "TI DaVinci" > > select GENERIC_CLOCKEVENTS > > select ARCH_REQUIRE_GPIOLIB > > + select GENERIC_ALLOCATOR > > select ZONE_DMA > > select HAVE_IDE > > select CLKDEV_LOOKUP > > GENERIC_ALLOCATOR is already selected for > DaVinci (below the "select CLKDEV_LOOKUP" > line). > > Please drop this hunk. This mail popped up at the top of my inbox as an unread message and I replied to it without looking at the sent date assuming it is a patch resend. Sorry about the noise. Thanks, Sekhar -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [RFC PATCH v4] Consolidate SRAM support
Hi Jean-Christophe, On Thu, May 26, 2011 at 06:32:57, Jean-Christophe PLAGNIOL-VILLARD wrote: > From: Russell King - ARM Linux > > We have two SoCs using SRAM, both with their own allocation systems, > and both with their own ways of copying functions into the SRAM. > > Let's unify this before we have additional SoCs re-implementing this > obviously common functionality themselves. > > For this use the generic allocator and the newly introduce > gen_pool_add_virt and gen_pool_virt_to_phys > > Uio_pruss should probably take the SRAM pool pointer via > platform data so that it doesn't have to include Davinci specific > includes. > > Signed-off-by: Russell King > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > Cc: Sekhar Nori > Cc: Kevin Hilman > Cc: Tony Lindgren > Cc: Sascha Hauer > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index f4b7dfa..5ec5e5f 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -848,6 +848,7 @@ config ARCH_DAVINCI > bool "TI DaVinci" > select GENERIC_CLOCKEVENTS > select ARCH_REQUIRE_GPIOLIB > + select GENERIC_ALLOCATOR > select ZONE_DMA > select HAVE_IDE > select CLKDEV_LOOKUP GENERIC_ALLOCATOR is already selected for DaVinci (below the "select CLKDEV_LOOKUP" line). Please drop this hunk. Thanks, Sekhar -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [RFC PATCH v4] Consolidate SRAM support
Hi Jean-Christophe, On Thu, May 26, 2011 at 06:32:57, Jean-Christophe PLAGNIOL-VILLARD wrote: > From: Russell King - ARM Linux > > We have two SoCs using SRAM, both with their own allocation systems, > and both with their own ways of copying functions into the SRAM. > > Let's unify this before we have additional SoCs re-implementing this > obviously common functionality themselves. > > For this use the generic allocator and the newly introduce > gen_pool_add_virt and gen_pool_virt_to_phys > > Uio_pruss should probably take the SRAM pool pointer via > platform data so that it doesn't have to include Davinci specific > includes. > > Signed-off-by: Russell King > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > Cc: Sekhar Nori > Cc: Kevin Hilman > Cc: Tony Lindgren > Cc: Sascha Hauer Is this patch slated to be merged for v3.1? I did not find it in linux-next. There is some further cleanup done by Ben Gardiner for DaVinci which depends on this patch. > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index f4b7dfa..5ec5e5f 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -848,6 +848,7 @@ config ARCH_DAVINCI > bool "TI DaVinci" > select GENERIC_CLOCKEVENTS > select ARCH_REQUIRE_GPIOLIB > + select GENERIC_ALLOCATOR > select ZONE_DMA > select HAVE_IDE > select CLKDEV_LOOKUP Just noticed that GENERIC_ALLOCATOR is already selected For DaVinci (it is right below the CLKDEV_LOOKUP selection) so this part of the patch can be dropped. Thanks, Sekhar -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC PATCH v4] Consolidate SRAM support
On Tue, May 31, 2011 at 10:39:48PM +0530, Nori, Sekhar wrote: > I also found some check patch errors. Feel free to merge > the attached patch. And this introduces another style issue... > diff --git a/arch/arm/plat-mxc/include/mach/iram.h > b/arch/arm/plat-mxc/include/mach/iram.h > index 8279c47..aae5e35 100644 > --- a/arch/arm/plat-mxc/include/mach/iram.h > +++ b/arch/arm/plat-mxc/include/mach/iram.h > @@ -31,7 +31,7 @@ static inline void *iram_alloc(size_t size, phys_addr_t > *phys) > > *phys = gen_pool_virt_to_phys(iram_pool, addr); > > - return (void*)addr; > + return (void *) addr; The style here is: return (void *)addr; -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [RFC PATCH v4] Consolidate SRAM support
Hi Jean-Christophe, On Thu, May 26, 2011 at 06:32:57, Jean-Christophe PLAGNIOL-VILLARD wrote: > From: Russell King - ARM Linux > > We have two SoCs using SRAM, both with their own allocation systems, > and both with their own ways of copying functions into the SRAM. > > Let's unify this before we have additional SoCs re-implementing this > obviously common functionality themselves. > > For this use the generic allocator and the newly introduce > gen_pool_add_virt and gen_pool_virt_to_phys > > Uio_pruss should probably take the SRAM pool pointer via > platform data so that it doesn't have to include Davinci specific > includes. > > Signed-off-by: Russell King > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > Cc: Sekhar Nori > Cc: Kevin Hilman > Cc: Tony Lindgren > Cc: Sascha Hauer I tested this on DA850 using suspend-to-RAM and audio, it works well! > arch/arm/Kconfig |2 + > arch/arm/mach-davinci/da850.c |2 +- > arch/arm/mach-davinci/dm355.c |2 +- > arch/arm/mach-davinci/dm365.c |2 +- > arch/arm/mach-davinci/dm644x.c |2 +- > arch/arm/mach-davinci/dm646x.c |2 +- > arch/arm/mach-davinci/include/mach/common.h|2 +- > arch/arm/mach-davinci/include/mach/sram.h | 13 + > arch/arm/mach-davinci/pm.c | 21 +++ > arch/arm/mach-davinci/sram.c | 57 +-- > arch/arm/plat-mxc/include/mach/iram.h | 28 -- > .../plat-mxc/{include/mach/iram.h => iram_alloc.c} | 40 -- I had trouble applying the plat-mxc stuff on v3.0-rc1. Can you please check? I also found some check patch errors. Feel free to merge the attached patch. With these, please add my: Acked-by: Sekhar Nori Thanks, Sekhar 8<--- diff --git a/arch/arm/plat-mxc/include/mach/iram.h b/arch/arm/plat-mxc/include/mach/iram.h index 8279c47..aae5e35 100644 --- a/arch/arm/plat-mxc/include/mach/iram.h +++ b/arch/arm/plat-mxc/include/mach/iram.h @@ -31,7 +31,7 @@ static inline void *iram_alloc(size_t size, phys_addr_t *phys) *phys = gen_pool_virt_to_phys(iram_pool, addr); - return (void*)addr; + return (void *) addr; } static inline void iram_free(void *addr, size_t size) diff --git a/arch/arm/plat-omap/include/plat/sram.h b/arch/arm/plat-omap/include/plat/sram.h index 52b9b5c..cc99397 100644 --- a/arch/arm/plat-omap/include/plat/sram.h +++ b/arch/arm/plat-omap/include/plat/sram.h @@ -27,7 +27,7 @@ extern struct gen_pool *omap_gen_pool; size_t _sz = size; \ void *_sram = gen_pool_alloc(omap_gen_pool, _sz); \ _res = (_sram ? fncpy(_sram, &(funcp), _sz) : NULL);\ - if (!_res) \ + if (!_res) \ pr_err("Not enough space in SRAM\n"); \ _res; \ }) diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c index db486cc..444176e 100644 --- a/drivers/uio/uio_pruss.c +++ b/drivers/uio/uio_pruss.c @@ -153,7 +153,7 @@ static int __devinit pruss_probe(struct platform_device *dev) goto out_free; } - gdev->sram_vaddr = (void*)gen_pool_alloc(davinci_gen_pool, sram_pool_sz); + gdev->sram_vaddr = (void *)gen_pool_alloc(davinci_gen_pool, sram_pool_sz); if (!gdev->sram_vaddr) { dev_err(&dev->dev, "Could not allocate SRAM pool\n"); goto out_free; diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c index dd305a2..1c383ab 100644 --- a/sound/soc/davinci/davinci-pcm.c +++ b/sound/soc/davinci/davinci-pcm.c @@ -239,7 +239,7 @@ static int allocate_sram(struct snd_pcm_substream *substream, unsigned size, return 0; ppcm->period_bytes_max = size; - iram_virt = (void*)gen_pool_alloc(davinci_gen_pool, size); + iram_virt = (void *)gen_pool_alloc(davinci_gen_pool, size); if (!iram_virt) goto exit1; iram_phys = gen_pool_virt_to_phys(davinci_gen_pool, -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC PATCH v4] Consolidate SRAM support
From: Russell King - ARM Linux We have two SoCs using SRAM, both with their own allocation systems, and both with their own ways of copying functions into the SRAM. Let's unify this before we have additional SoCs re-implementing this obviously common functionality themselves. For this use the generic allocator and the newly introduce gen_pool_add_virt and gen_pool_virt_to_phys Uio_pruss should probably take the SRAM pool pointer via platform data so that it doesn't have to include Davinci specific includes. Signed-off-by: Russell King Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Cc: Sekhar Nori Cc: Kevin Hilman Cc: Tony Lindgren Cc: Sascha Hauer --- v4: update against linus tree and genalloc gen_pool_add_virt and gen_pool_virt_to_phys Best Regards, J. arch/arm/Kconfig |2 + arch/arm/mach-davinci/da850.c |2 +- arch/arm/mach-davinci/dm355.c |2 +- arch/arm/mach-davinci/dm365.c |2 +- arch/arm/mach-davinci/dm644x.c |2 +- arch/arm/mach-davinci/dm646x.c |2 +- arch/arm/mach-davinci/include/mach/common.h|2 +- arch/arm/mach-davinci/include/mach/sram.h | 13 + arch/arm/mach-davinci/pm.c | 21 +++ arch/arm/mach-davinci/sram.c | 57 +-- arch/arm/plat-mxc/include/mach/iram.h | 28 -- .../plat-mxc/{include/mach/iram.h => iram_alloc.c} | 40 -- arch/arm/plat-omap/include/plat/sram.h | 19 +-- arch/arm/plat-omap/sram.c | 38 + drivers/uio/uio_pruss.c| 10 +++- sound/soc/davinci/davinci-pcm.c| 11 +++-- 16 files changed, 122 insertions(+), 129 deletions(-) copy arch/arm/plat-mxc/{include/mach/iram.h => iram_alloc.c} (56%) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index f4b7dfa..5ec5e5f 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -848,6 +848,7 @@ config ARCH_DAVINCI bool "TI DaVinci" select GENERIC_CLOCKEVENTS select ARCH_REQUIRE_GPIOLIB + select GENERIC_ALLOCATOR select ZONE_DMA select HAVE_IDE select CLKDEV_LOOKUP @@ -862,6 +863,7 @@ config ARCH_OMAP select HAVE_CLK select ARCH_REQUIRE_GPIOLIB select ARCH_HAS_CPUFREQ + select GENERIC_ALLOCATOR select GENERIC_CLOCKEVENTS select HAVE_SCHED_CLOCK select ARCH_HAS_HOLES_MEMORYMODEL diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c index b95b919..09f6c12 100644 --- a/arch/arm/mach-davinci/da850.c +++ b/arch/arm/mach-davinci/da850.c @@ -1099,7 +1099,7 @@ 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_phys = DA8XX_ARM_RAM_BASE, .sram_len = SZ_8K, .reset_device = &da8xx_wdt_device, }; diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index a3a94e9..9bda687 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c @@ -850,7 +850,7 @@ static struct davinci_soc_info davinci_soc_info_dm355 = { .gpio_num = 104, .gpio_irq = IRQ_DM355_GPIOBNK0, .serial_dev = &dm355_serial_device, - .sram_dma = 0x0001, + .sram_phys = 0x0001, .sram_len = SZ_32K, .reset_device = &davinci_wdt_device, }; diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index 4604e72..d306034 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c @@ -1082,7 +1082,7 @@ static struct davinci_soc_info davinci_soc_info_dm365 = { .gpio_unbanked = 8,/* really 16 ... skip muxed GPIOs */ .serial_dev = &dm365_serial_device, .emac_pdata = &dm365_emac_pdata, - .sram_dma = 0x0001, + .sram_phys = 0x0001, .sram_len = SZ_32K, .reset_device = &davinci_wdt_device, }; diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index 4c82c27..3949ed7 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c @@ -764,7 +764,7 @@ static struct davinci_soc_info davinci_soc_info_dm644x = { .gpio_irq = IRQ_GPIOBNK0, .serial_dev = &dm644x_serial_device, .emac_pdata = &dm644x_emac_pdata, - .sram_dma = 0x8000, + .sram_phys = 0x8000, .sram_