* [PATCH V4 0/4] ARM: tegra: Enable SLINK controller driver
From: Laxman Dewangan @ 2012-10-31 9:02 UTC (permalink / raw)
To: linux-arm-kernel
This series modify the dts file to add the slink addresses,
make AUXDATA in board dt files, enable slink4 for tegra30-cardhu and
enable slink controller defconfig.
Changes from V1:
- Remove changes from clock tables.
- Make the dma req dt property name to nvidia,dma-request-selector.
- change the spi max frequency prop to spi-max-frequency.
Changes from V2:
- make node name to spi.
- get rid of iomap.h.
Changes from V3:
- Enable spi flash connected on slink4-cs1.
- Enable require defconfigs.
Laxman Dewangan (4):
ARM: tegra: dts: add slink controller dt entry
ARM: tegra: Add OF_DEV_AUXDATA for SLINK driver in board dt
ARM: tegra: dts: cardhu: enable SLINK4
ARM: tegra: config: enable spi driver for Tegra SLINK controller
.../devicetree/bindings/vendor-prefixes.txt | 1 +
arch/arm/boot/dts/tegra20.dtsi | 41 +++++++++++++
arch/arm/boot/dts/tegra30-cardhu.dtsi | 10 +++
arch/arm/boot/dts/tegra30.dtsi | 60 ++++++++++++++++++++
arch/arm/configs/tegra_defconfig | 5 +-
arch/arm/mach-tegra/board-dt-tegra20.c | 8 +++
arch/arm/mach-tegra/board-dt-tegra30.c | 12 ++++
7 files changed, 136 insertions(+), 1 deletions(-)
^ permalink raw reply
* [PATCH RFC] i2c: omap: Fix the revision register read
From: Shubhrajyoti D @ 2012-10-31 8:59 UTC (permalink / raw)
To: linux-arm-kernel
The revision register on OMAP4 is a 16-bit lo and a 16-bit
hi. Currently the driver reads only the lower 8-bits.
Fix the same by preventing the truncating of the rev register
for OMAP4.
Also use the scheme bit ie bit-14 of the hi register to know if it
is OMAP_I2C_IP_VERSION_2.
On platforms previous to OMAP4 the offset 0x04 is IE register whose
bit-14 reset value is 0, the code uses the same to its advantage.
The dev->regs is populated after reading the rev_hi. A NULL check
has been added in the resume handler to prevent the access before
the setting of the regs.
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
todo: some of the flag checks can be removed in favour of revision check.
drivers/i2c/busses/i2c-omap.c | 35 +++++++++++++++++++++++++----------
1 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index db31eae..651a7f7 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -51,7 +51,8 @@
/* I2C controller revisions present on specific hardware */
#define OMAP_I2C_REV_ON_2430 0x36
#define OMAP_I2C_REV_ON_3430_3530 0x3C
-#define OMAP_I2C_REV_ON_3630_4430 0x40
+#define OMAP_I2C_REV_ON_3630 0x40
+#define OMAP_I2C_REV_ON_4430_PLUS 0x5040
/* timeout waiting for the controller to respond */
#define OMAP_I2C_TIMEOUT (msecs_to_jiffies(1000))
@@ -202,7 +203,7 @@ struct omap_i2c_dev {
* fifo_size==0 implies no fifo
* if set, should be trsh+1
*/
- u8 rev;
+ u16 rev;
unsigned b_hw:1; /* bad h/w fixes */
unsigned receiver:1; /* true when we're in receiver mode */
u16 iestate; /* Saved interrupt register */
@@ -490,7 +491,7 @@ static void omap_i2c_resize_fifo(struct omap_i2c_dev *dev, u8 size, bool is_rx)
omap_i2c_write_reg(dev, OMAP_I2C_BUF_REG, buf);
- if (dev->rev < OMAP_I2C_REV_ON_3630_4430)
+ if (dev->rev < OMAP_I2C_REV_ON_3630)
dev->b_hw = 1; /* Enable hardware fixes */
/* calculate wakeup latency constraint for MPU */
@@ -1064,6 +1065,8 @@ omap_i2c_probe(struct platform_device *pdev)
const struct of_device_id *match;
int irq;
int r;
+ u16 rev_lo;
+ u16 rev_hi;
/* NOTE: driver uses the static register mapping */
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1117,11 +1120,6 @@ omap_i2c_probe(struct platform_device *pdev)
dev->reg_shift = (dev->flags >> OMAP_I2C_FLAG_BUS_SHIFT__SHIFT) & 3;
- if (dev->dtrev == OMAP_I2C_IP_VERSION_2)
- dev->regs = (u8 *)reg_map_ip_v2;
- else
- dev->regs = (u8 *)reg_map_ip_v1;
-
pm_runtime_enable(dev->dev);
pm_runtime_set_autosuspend_delay(dev->dev, OMAP_I2C_PM_TIMEOUT);
pm_runtime_use_autosuspend(dev->dev);
@@ -1130,7 +1128,21 @@ omap_i2c_probe(struct platform_device *pdev)
if (IS_ERR_VALUE(r))
goto err_free_mem;
- dev->rev = omap_i2c_read_reg(dev, OMAP_I2C_REV_REG) & 0xff;
+ /* Read the Rev hi bit-14 ie scheme this is 1 indicates ver2 or
+ * highlander.
+ * On omap3 Offset 4 is IE Reg the bit 14 is XDR_IE which is 0 at reset.
+ */
+ rev_hi = __raw_readw(dev->base + 0x04);
+
+ if (rev_hi & 0x4000) {/* If scheme 1*/
+ dev->regs = (u8 *)reg_map_ip_v2;
+ dev->rev = omap_i2c_read_reg(dev, OMAP_I2C_IP_V2_REVNB_HI);
+ rev_lo = omap_i2c_read_reg(dev, OMAP_I2C_IP_V2_REVNB_LO);
+ dev_info(dev->dev, "the low rev %x\n", rev_lo);
+ } else {
+ dev->regs = (u8 *)reg_map_ip_v1;
+ dev->rev = omap_i2c_read_reg(dev, OMAP_I2C_REV_REG) & 0xff;
+ }
dev->errata = 0;
@@ -1155,7 +1167,7 @@ omap_i2c_probe(struct platform_device *pdev)
dev->fifo_size = (dev->fifo_size / 2);
- if (dev->rev < OMAP_I2C_REV_ON_3630_4430)
+ if (dev->rev < OMAP_I2C_REV_ON_3630)
dev->b_hw = 1; /* Enable hardware fixes */
/* calculate wakeup latency constraint for MPU */
@@ -1264,6 +1276,9 @@ static int omap_i2c_runtime_resume(struct device *dev)
struct platform_device *pdev = to_platform_device(dev);
struct omap_i2c_dev *_dev = platform_get_drvdata(pdev);
+ if (!_dev->regs)
+ return 0;
+
if (_dev->flags & OMAP_I2C_FLAG_RESET_REGS_POSTIDLE) {
omap_i2c_write_reg(_dev, OMAP_I2C_CON_REG, 0);
omap_i2c_write_reg(_dev, OMAP_I2C_PSC_REG, _dev->pscstate);
--
1.7.5.4
^ permalink raw reply related
* [PATCH v3 06/10] net/macb: clean up ring buffer logic
From: David Laight @ 2012-10-31 8:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CACiLriQnQcoXFqrqNt3nkY47nR8FnXbqWjtPRp250gueHSMDmQ@mail.gmail.com>
> On Tue, Oct 30, 2012 at 4:12 AM, David Laight <David.Laight@aculab.com> wrote:
> >> Instead of masking head and tail every time we increment them, just let them
> >> wrap through UINT_MAX and mask them when subscripting. Add simple accessor
> >> functions to do the subscripting properly to minimize the chances of messing
> >> this up.
> > ...
> >> +static unsigned int macb_tx_ring_avail(struct macb *bp)
> >> +{
> >> + return TX_RING_SIZE - (bp->tx_head - bp->tx_tail);
> >> +}
> >
> > That one doesn't look quite right to me.
> > Surely it should be masking with 'TX_RING_SIZE - 1'
>
> Why is that? head and tail can never be more than TX_RING_SIZE apart,
> so it shouldn't make any difference.
It's a ring buffer (I presume) the pointers can be in either order.
David
^ permalink raw reply
* [PATCH V3 0/4] ARM: tegra: Enable SLINK controller driver
From: Laxman Dewangan @ 2012-10-31 8:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <509038BA.30600@wwwdotorg.org>
On Wednesday 31 October 2012 01:59 AM, Stephen Warren wrote:
> On 10/30/2012 01:05 AM, Laxman Dewangan wrote:
>> This series modify the dts file to add the slink addresses,
>> make AUXDATA in board dt files, enable slink4 for tegra30-cardhu and
>> enable slink controller defconfig.
> This series only instantiates the SPI controller, and not any SPI
> devices. I tried to solve this:
>
>> diff --git a/arch/arm/boot/dts/tegra30-cardhu.dtsi b/arch/arm/boot/dts/tegra30-cardhu.dtsi
>> index 700f0a3..3689853 100644
>> --- a/arch/arm/boot/dts/tegra30-cardhu.dtsi
>> +++ b/arch/arm/boot/dts/tegra30-cardhu.dtsi
>> @@ -278,6 +278,11 @@
>> spi at 7000da00 {
>> status = "okay";
>> spi-max-frequency =<25000000>;
>> + flash at 0 {
>> + reg =<0>;
>> + compatible = "atmel,at25df321a";
>> + spi-max-frequency =<25000000>;
>> + };
>> };
>>
>> ahub {
> However, this didn't work. Has the driver been tested? I'm seeing the
> exact same problems I saw with the old driver, namely that the SPI flash
> chip can't be identified; I think the ID bytes are read back as 0, and
> hence drivers/mtd/devices/m25p80.c falls back to identifying the device
> as mr25h256. Attempting to hexdump -C /dev/mtd0 gives me 32K of zeros,
> whereas the device is 4M and full of non-zero data according to U-Boot.
>
> Do you know what the problem is here? Can you please update the patch
> series so that the SPI flash is instantiated and works correctly?
I will send the new patch series for taking care of the issue.
In Cardhu, there is 2 different type of flash, Winbond and Atmel.
There is hw rework require in Cardhu A02 to enable the serial flash and
it is already taken care in Cardhu A04. I will forward the hw rework
details to you in internal mail communication.
Also Serial flash is in CS1, not in CS0. So even if you have hw rework,
above change will not work.
I had tested on different way earlier (dynamic allocating master for
serial flash) and also tested on above method.
For this I enable MTD, MTD_CHAR and MTD_M25P80.
Debug prints as:
[ 1.279424] m25p_probe
[ 1.282536] m25p80 spi32766.1: w25q32 (4096 Kbytes)
[ 1.287418] mtd .name = spi32766.1, .size = 0x400000 (4MiB)
.erasesize = 0x00
001000 (4KiB) .numeraseregions = 0
[ 1.298120] m25p_probe() returns 0
^ permalink raw reply
* [PATCH] ARM: zynq: move ttc timer code to drivers/clocksource
From: Michal Simek @ 2012-10-31 8:48 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <201210302236.43473.arnd@arndb.de>
> -----Original Message-----
> From: Arnd Bergmann [mailto:arnd at arndb.de]
> Sent: Tuesday, October 30, 2012 11:37 PM
> To: monstr at monstr.eu
> Cc: Josh Cartwright; Michal Simek; linux-arm-kernel at lists.infradead.org; linux-
> kernel at vger.kernel.org; arm at kernel.org; Thomas Gleixner
> Subject: Re: [PATCH] ARM: zynq: move ttc timer code to drivers/clocksource
>
> On Tuesday 30 October 2012, Michal Simek wrote:
> > On 10/29/2012 07:56 PM, Josh Cartwright wrote:
> > > Suggested cleanup by Arnd Bergmann. Move the ttc timer.c code to
> > > drivers/clocksource, and out of the mach-zynq directory.
> > >
> > > The common.h (which only held the timer declaration) was renamed to
> > > xilinx_ttc.h and moved into include/linux.
> > >
> > > Signed-off-by: Josh Cartwright <josh.cartwright@ni.com>
> > > Cc: Arnd Bergmann <arnd@arndb.de>
> > > ---
> > > arch/arm/mach-zynq/Makefile | 2 +-
> > > arch/arm/mach-zynq/common.c | 2 +-
> > > arch/arm/mach-zynq/common.h | 24 ----
> > > arch/arm/mach-zynq/timer.c | 298 ---------------------------------------
> > > drivers/clocksource/Makefile | 1 +
> > > drivers/clocksource/xilinx_ttc.c | 297
> ++++++++++++++++++++++++++++++++++++++
> > > include/linux/xilinx_ttc.h | 24 ++++
> > > 7 files changed, 324 insertions(+), 324 deletions(-)
>
> When you submit a patch that moves files around, please use the '-M' flag to git-
> format-patch so we can see the actual changes instead of a file being removed
> and another one added.
>
> > > delete mode 100644 arch/arm/mach-zynq/common.h
> > > delete mode 100644 arch/arm/mach-zynq/timer.c
> > > create mode 100644 drivers/clocksource/xilinx_ttc.c
> > > create mode 100644 include/linux/xilinx_ttc.h
> >
> > Really?
> > If yes. shouldn't be there any better naming convention especially for
> > headers. linux/clocksource/xilinx_ttc.h.
>
> Moving it is certainly the right direction, but I think we need a better way to
> handle those forward declarations. "struct sys_timer" is actually an ARM specific
> structure, so we might just want to add all the forward declarations for the
> timers into arch/arm/include/asm/mach/time.h. It's not ideal to do it like that,
> but I think it's much better than having a new globally visible header for each
> timer that is used on ARM.
>
> Eventually, we might want to do something similar to what we are discussing for
> the top-level IRQ controllers at the moment, where we just autodetect them
> from DT if possible, so we don't need to have any pointer to the timer from arch
> code at all.
Ok. It means that it is not big deal to keep timer as is in mach and when we
have any generic solution we can follow it. This patch just move the code out
of mach-zynq.
It should be done across architecture because for example timer I use for microblaze
can be used by zynq too, also by Xilinx ppc.
Thanks,
Michal
^ permalink raw reply
* [PATCH 1/2] ARM: OMAP2+: move mailbox.h out of plat-omap headers
From: Loic PALLARDY @ 2012-10-31 8:45 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CALLhW=6p06MPdfbD2S-PRs=w0zLNsEifsJ2xL0hjEZaFpbadDA@mail.gmail.com>
Hi Omar,
On 10/31/2012 08:22 AM, Omar Ramirez Luna wrote:
>
> As part of plat-omap code cleanup, I was planning to move omap-mailbox
> framework to a newly drivers/mailbox folder, right now this code is
> specific to OMAP platforms, but with some clean up it could be the
> base for a generic framework. And living under drivers/mailbox could
> give it some exposure for interested developers to give feedback and
> propose changes.
>
> In the past there was a mailbox-like driver in mach-ux500, I was
> hoping both could live under the same folder, however the platform
> using it, was dropped a couple of kernel releases back and with it the
> other similar mailbox implementation.
On STE side, we are working on a mailbox driver which will rely on
mailbox framework.
However some modifications in current Omap mailbox framework are needed
to fit STE HW specificities.
- API naming should be generic (replace omap prefix by mailbox)
- message type should be enhanced
- fifo mechanism is linked to Omap maibox, not needed in STE case since
it relies on cross interrupt + shared memory
I already have modifications I'll send you to see how we can create a
common and generic mailbox framework.
Regards
Loic
^ permalink raw reply
* [PATCH v4 4/5] ARM: annotate VMALLOC_END definition with _AC
From: Michal Simek @ 2012-10-31 8:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <201210302222.15656.arnd@arndb.de>
> -----Original Message-----
> From: Arnd Bergmann [mailto:arnd at arndb.de]
> Sent: Tuesday, October 30, 2012 11:22 PM
> To: Michal Simek
> Cc: Josh Cartwright; arm at kernel.org; linux-kernel at vger.kernel.org; linux-arm-
> kernel at lists.infradead.org; John Linn; Nick Bowler; Russell King - ARM Linux
> Subject: Re: [PATCH v4 4/5] ARM: annotate VMALLOC_END definition with _AC
>
> On Saturday 27 October 2012, Michal Simek wrote:
> > > diff --git a/arch/arm/include/asm/pgtable.h
> > > b/arch/arm/include/asm/pgtable.h index 08c1231..72904a2 100644
> > > --- a/arch/arm/include/asm/pgtable.h
> > > +++ b/arch/arm/include/asm/pgtable.h
> > > @@ -40,7 +40,7 @@
> > > */
> > > #define VMALLOC_OFFSET (8*1024*1024)
> > > #define VMALLOC_START (((unsigned long)high_memory +
> > > VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
> > > -#define VMALLOC_END 0xff000000UL
> > > +#define VMALLOC_END _AC(0xff000000,UL)
> >
> > This shouldn't be the part of this series but should go to mainline through
> different tree.
> > Arnd, Olof: Can you take this patch to your arm-soc tree?
> >
> > I don't think it is a good workstyle to propose it to mainline through zynq soc
> tree.
> > What do you think?
>
> The arm-soc tree is not the right place either, this is architecture code which is in
> Russell's domain. I would suggest getting an Ack from Russell if he's ok with it
> and then merging it together with your other changes into arm-soc.
That's what I thought too.
Not sure if Josh wants to push this to mainline.
Thanks,
Michal
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
^ permalink raw reply
* OMAP baseline test results for v3.7-rc1
From: Jean Pihet @ 2012-10-31 8:34 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <alpine.DEB.2.00.1210301400100.12697@utopia.booyaka.com>
Paul,
- Added Rafael for the PM QoS discussion -
On Tue, Oct 30, 2012 at 10:04 AM, Paul Walmsley <paul@pwsan.com> wrote:
> On Tue, 30 Oct 2012, Paul Walmsley wrote:
>
>> Based on a very quick look, I'd say the original patch 3db11fe is broken.
>> I don't see how it can ensure that its PM_QOS_CPU_DMA_LATENCY request is
>> honored when CONFIG_CPU_IDLE=n. CONFIG_CPU_IDLE=n is the default for
>> omap2plus_defconfig.
>
> So in fact to follow up on this, looks like one of two changes are needed:
>
> 1. Revert 3db11fe
>
> or
>
> 2. If CONFIG_CPU_IDLE=n, the driver needs to call disable_hlt() in place
> of the pm_qos constraint add, and call enable_hlt() in place of the pm_qos
> constraint remove.
I do not think this is correct. Using disable_hlt is a too radical
solution and will prevent the idle completely, this is not what we
want.
Rafael, what do you think?
Furthermore without the patch 3db11fe enable_hlt and disable_hlt are
not used in the driver so this change is not the real fix for the
issue. To me the cause is somewhere else. I was hoping Felipe's
ordering fix would do it...
>
> Jean, could you please pick a solution and send a patch for the 3.7-rc
> timeframe, to fix the bug in 3db11fe?
> ?
Let me try to reproduce the issue and hopefully investigate a bit more.
Feel free to revert the patch if you feel like it is the thing to do.
>
> - Paul
Jean
^ permalink raw reply
* OMAP baseline test results for v3.7-rc1
From: Jean Pihet @ 2012-10-31 8:22 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <alpine.DEB.2.00.1210301313190.12697@utopia.booyaka.com>
On Tue, Oct 30, 2012 at 9:17 AM, Paul Walmsley <paul@pwsan.com> wrote:
> On Tue, 30 Oct 2012, Felipe Balbi wrote:
>
>> On Tue, Oct 30, 2012 at 12:50:52PM +0000, Paul Walmsley wrote:
>> > certainly PM-idle related, given that the problem goes away by reverting
>> > Jean's commit 3db11feffc1ad2ab9dea27789e6b5b3032827adc "ARM: OMAP: convert
>> > I2C driver to PM QoS for MPU latency constraints".
>> >
>> > The problem is consistent and easy to reproduce here.
>>
>> I don't doubt that :-) What I think, however, is that PM QoS just made
I dont doubt either but cannot have it reproduced.
>> the problem a bit easier to trigger for whatever reason. Maybe because
>> pm qos defers constraint updates, or something similar ?
PM QoS just influences the cpuidle decision on the next power state of
the CPU and CORE power domains.
>
> Based on a very quick look, I'd say the original patch 3db11fe is broken.
> I don't see how it can ensure that its PM_QOS_CPU_DMA_LATENCY request is
> honored when CONFIG_CPU_IDLE=n. CONFIG_CPU_IDLE=n is the default for
> omap2plus_defconfig.
Withtout CPU_IDLE set the PM QoS has no influence on the power domains states.
>
>
> - Paul
Jean
^ permalink raw reply
* OMAP baseline test results for v3.7-rc1
From: Jean Pihet @ 2012-10-31 8:18 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <alpine.DEB.2.00.1210301120290.12697@utopia.booyaka.com>
Hi Paul,
On Tue, Oct 30, 2012 at 7:23 AM, Paul Walmsley <paul@pwsan.com> wrote:
> Hi Jean,
>
> On Tue, 30 Oct 2012, Jean Pihet wrote:
>
>> On Tue, Oct 30, 2012 at 5:16 AM, Paul Walmsley <paul@pwsan.com> wrote:
>> > On Tue, 23 Oct 2012, Jean Pihet wrote:
>> >
>> >> Let me try with the same setup as yours (bootloader images,
>> >> omap2pus_defconfig, angstrom roots).
>> >
>> > Had any luck reproducing this one that Aaro & I are seeing?
>> Unfortunately not. I could not reproduce the issue on my side, using
>> an ES2.1 Beagleboard with the latest l-o kernel and your bootloader
>> and rootfs images.
>> Is there some specific to enable in order to reproduce the issue?
>
> Could you please post a bootlog from your terminal program, similar to
>
> http://www.pwsan.com/omap/testlogs/test_v3.7-rc3/20121028162003/boot/3530es3beagle/3530es3beagle_log.txt
>
> ?
Yes sure. Let me try to reproduce the problem again. As said
previously I cannot have the timeouts issue.
More to come.
Jean
>
>
> - Paul
^ permalink raw reply
* [PATCH] slab : allow SLAB_RED_ZONE and SLAB_STORE_USER to work on arm
From: Pekka Enberg @ 2012-10-31 7:59 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1350386231-770-1-git-send-email-matthieu.castet@parrot.com>
Hi,
(Adding more people to CC.)
On Tue, Oct 16, 2012 at 2:17 PM, Matthieu CASTET
<matthieu.castet@parrot.com> wrote:
> From: Matthieu CASTET <castet.matthieu@free.fr>
>
> on cortexA8 (omap3) ralign is 64 and __alignof__(unsigned long long) is 8.
> So we always disable debug.
>
> This patch is based on 5c5e3b33b7cb959a401f823707bee006caadd76e, but fix
> case were align < sizeof(unsigned long long).
>
> Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>
> CC: Russell King <rmk@arm.linux.org.uk>
> CC: Pekka Enberg <penberg@cs.helsinki.fi>
> ---
> mm/slab.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/mm/slab.c b/mm/slab.c
> index c685475..8427901 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -2462,9 +2462,6 @@ __kmem_cache_create (const char *name, size_t size, size_t align,
> if (ralign < align) {
> ralign = align;
> }
> - /* disable debug if necessary */
> - if (ralign > __alignof__(unsigned long long))
> - flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER);
> /*
> * 4) Store it.
> */
> @@ -2491,8 +2488,9 @@ __kmem_cache_create (const char *name, size_t size, size_t align,
> */
> if (flags & SLAB_RED_ZONE) {
> /* add space for red zone words */
> - cachep->obj_offset += sizeof(unsigned long long);
> - size += 2 * sizeof(unsigned long long);
> + int offset = max(align, sizeof(unsigned long long));
> + cachep->obj_offset += offset;
> + size += offset + sizeof(unsigned long long);
> }
> if (flags & SLAB_STORE_USER) {
> /* user store requires one word storage behind the end of
This piece of code tends to break in peculiar ways every time someone
touches it. I could use some more convincing in the changelog this
time it won't...
^ permalink raw reply
* Two questions about streaming DMA flushing
From: Catalin Marinas @ 2012-10-31 7:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAFNq8R7Fb5Dn6pMDDNvQp=kgpY9vmdpxyhNAPUXYA0-QbfHoJg@mail.gmail.com>
On Wed, Oct 31, 2012 at 02:15:04AM +0000, Li Haifeng wrote:
> Sorry to disturb you.
>
> I have two questions for streaming DMA flushing @ arch/arm/mm/cache-v7.S.
>
> 1.
> 332 ENTRY(v7_dma_map_area)
> 333 add r1, r1, r0
> 334 teq r2, #DMA_FROM_DEVICE
> 335 beq v7_dma_inv_range
> 336 b v7_dma_clean_range
> 337 ENDPROC(v7_dma_map_area)
>
> The function of v7_dma_map_area will invalidate corresponding cache line
> firstly and then clean the cache for DMA_FROM_DEVICE . I am confused the
> sequence of the operations. IMO, the invalidate should be followed by the clean
> action. Is it right?
If the direction is DMA_FROM_DEVICE, it only invalidates the cache (beq
instruction).
> 2.
> 345 ENTRY(v7_dma_unmap_area)
> 346 add r1, r1, r0
> 347 teq r2, #DMA_TO_DEVICE
> 348 bne v7_dma_inv_range
> 349 mov pc, lr
> 350 ENDPROC(v7_dma_unmap_area)
>
> v7_dma_unmap_area, will invalidate corresponding cache line for
> DMA_FROM_DEVICE . But, at v7_dma_map_area, the invalidate has been done. Why do
> this again?
There can be speculative loads into the cache, so once the transfer has
finished you need to invalidate the range again to avoid reading stale
data (the first invalidate is needed to make sure there aren't any dirty
cache lines that could be evicted).
--
Catalin
^ permalink raw reply
* [PATCH] Add device tree file for the armadeus apf27
From: Sascha Hauer @ 2012-10-31 7:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1351626944.55016.YahooMailNeo@web28804.mail.ir2.yahoo.com>
On Tue, Oct 30, 2012 at 07:55:44PM +0000, Philippe Reynes wrote:
>
>
> Hi Sascha,
> >> +??? ??? osc26m {
>
> >> +??? ??? ??? compatible = "fsl,imx-osc26m", "fixed-clock";
> >> +??? ??? ??? clock-frequency = <33554432>;
>
> >Is this really correct? The Datasheet specificies 26MHz, some boards
> >have 27Mhz, but 33?
>
> The clock value on this board is? 32.768kHz, so 32768 * 1024.
> I've tried others value, all others produce weird behaviour on the serial.
Ok, so your board runs with the 32.768KHz clock input. I didn't know
there are boards that use this as the reference clock. It seems this
is not handled in the current clk code. Could you test the patch I just
sent to the mailing list (Cced you) and provide a Tested-by tag if it
works? The clock frequency provided in the device tree shouldn't make
a difference then anymore. You should specify it to 0 if you have
nothing connected there.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply
* [PATCH] ARM i.MX27: Fix low reference clock path
From: Sascha Hauer @ 2012-10-31 7:28 UTC (permalink / raw)
To: linux-arm-kernel
The i.MX27 clock tree can either be driven from a 26MHz oscillator
or from a 32768Hz oscillator. The latter was not properly implemented,
the mux between these two pathes was missing. Add this mux and while
at it rename the 'prem' (premultiplier) clk to 'fpm' (Frequency
Pre-Multiplier) to better match the datasheet.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-imx/clk-imx27.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index 3b6b640..f8d9129 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -51,8 +51,10 @@
static const char *vpu_sel_clks[] = { "spll", "mpll_main2", };
static const char *cpu_sel_clks[] = { "mpll_main2", "mpll", };
+static const char *mpll_sel_clks[] = { "fpm", "mpll_osc_sel", };
+static const char *mpll_osc_sel_clks[] = { "ckih", "ckih_div1p5", };
static const char *clko_sel_clks[] = {
- "ckil", "prem", "ckih", "ckih",
+ "ckil", "fpm", "ckih", "ckih",
"ckih", "mpll", "spll", "cpu_div",
"ahb", "ipg", "per1_div", "per2_div",
"per3_div", "per4_div", "ssi1_div", "ssi2_div",
@@ -79,7 +81,8 @@ enum mx27_clks {
vpu_ahb_gate, fec_ahb_gate, emma_ahb_gate, emi_ahb_gate, dma_ahb_gate,
csi_ahb_gate, brom_ahb_gate, ata_ahb_gate, wdog_ipg_gate, usb_ipg_gate,
uart6_ipg_gate, uart5_ipg_gate, uart4_ipg_gate, uart3_ipg_gate,
- uart2_ipg_gate, uart1_ipg_gate, clk_max
+ uart2_ipg_gate, uart1_ipg_gate, ckih_div1p5, fpm, mpll_osc_sel,
+ mpll_sel, clk_max
};
static struct clk *clk[clk_max];
@@ -91,7 +94,15 @@ int __init mx27_clocks_init(unsigned long fref)
clk[dummy] = imx_clk_fixed("dummy", 0);
clk[ckih] = imx_clk_fixed("ckih", fref);
clk[ckil] = imx_clk_fixed("ckil", 32768);
- clk[mpll] = imx_clk_pllv1("mpll", "ckih", CCM_MPCTL0);
+ clk[fpm] = imx_clk_fixed_factor("fpm", "ckil", 1024, 1);
+ clk[ckih_div1p5] = imx_clk_fixed_factor("ckih_div1p5", "ckih", 2, 3);
+
+ clk[mpll_osc_sel] = imx_clk_mux("mpll_osc_sel", CCM_CSCR, 4, 1,
+ mpll_osc_sel_clks,
+ ARRAY_SIZE(mpll_osc_sel_clks));
+ clk[mpll_sel] = imx_clk_mux("mpll_sel", CCM_CSCR, 16, 1, mpll_sel_clks,
+ ARRAY_SIZE(mpll_sel_clks));
+ clk[mpll] = imx_clk_pllv1("mpll", "mpll_sel", CCM_MPCTL0);
clk[spll] = imx_clk_pllv1("spll", "ckih", CCM_SPCTL0);
clk[mpll_main2] = imx_clk_fixed_factor("mpll_main2", "mpll", 2, 3);
--
1.7.10.4
^ permalink raw reply related
* [Patch v2 4/4] ASoC: sam9g20-wm8731: convert to device tree support
From: Bo Shen @ 2012-10-31 7:27 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1351668420-18447-1-git-send-email-voice.shen@atmel.com>
convert sam9g20-wm8731 to device tree support.
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
Change since v1:
Add sam9g20-wm8731 binding document
---
.../bindings/sound/atmel-sam9g20-audio-wm8731.txt | 21 ++++++++
arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 25 +++++++++-
sound/soc/atmel/Kconfig | 3 +-
sound/soc/atmel/sam9g20_wm8731.c | 51 +++++++++++++++++++-
4 files changed, 94 insertions(+), 6 deletions(-)
create mode 100644 Documentation/devicetree/bindings/sound/atmel-sam9g20-audio-wm8731.txt
diff --git a/Documentation/devicetree/bindings/sound/atmel-sam9g20-audio-wm8731.txt b/Documentation/devicetree/bindings/sound/atmel-sam9g20-audio-wm8731.txt
new file mode 100644
index 0000000..04a39dd
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/atmel-sam9g20-audio-wm8731.txt
@@ -0,0 +1,21 @@
+* Atmel sam9g20ek audio complex
+
+Required properties:
+ - compatible: "atmel,at91sam9g20-audio"
+ - atmel,model: The user-visible name of this sound complex.
+ - atmel,audio-routing: A list of the connections between audio components.
+ - atmel,dai: The phandle of the dai based on SSC controller
+ - atmel,audio-codec: The phandle of the WM8731 audio codec
+
+Example:
+sound {
+ compatible = "atmel,at91sam9g20-audio";
+ atmel,model = "wm8731 @ sam9g20ek";
+
+ atmel,audio-routing =
+ "Ext Spk", "LHPOUT",
+ "Int MIC", "MICIN";
+
+ atmel,dai = <&dai>;
+ atmel,audio-codec = <&wm8731>;
+};
diff --git a/arch/arm/boot/dts/at91sam9g20ek_common.dtsi b/arch/arm/boot/dts/at91sam9g20ek_common.dtsi
index b06c0db..056ff33 100644
--- a/arch/arm/boot/dts/at91sam9g20ek_common.dtsi
+++ b/arch/arm/boot/dts/at91sam9g20ek_common.dtsi
@@ -51,6 +51,10 @@
atmel,vbus-gpio = <&pioC 5 0>;
status = "okay";
};
+
+ ssc0: ssc at fffbc000 {
+ status = "okay";
+ };
};
nand0: nand at 40000000 {
@@ -114,8 +118,8 @@
reg = <0x50>;
};
- wm8731 at 1b {
- compatible = "wm8731";
+ wm8731: wm8731 at 1b {
+ compatible = "wlf,wm8731";
reg = <0x1b>;
};
};
@@ -139,4 +143,21 @@
gpio-key,wakeup;
};
};
+
+ dai: dai {
+ compatible = "atmel,atmel-ssc-dai";
+ atmel,dai-master = <&ssc0>;
+ };
+
+ sound {
+ compatible = "atmel,at91sam9g20-audio";
+ atmel,model = "wm8731 @ sam9g20ek";
+
+ atmel,audio-routing =
+ "Ext Spk", "LHPOUT",
+ "Int Mic", "MICIN";
+
+ atmel,audio-codec = <&wm8731>;
+ atmel,dai = <&dai>;
+ };
};
diff --git a/sound/soc/atmel/Kconfig b/sound/soc/atmel/Kconfig
index 72b09cf..397ec75 100644
--- a/sound/soc/atmel/Kconfig
+++ b/sound/soc/atmel/Kconfig
@@ -16,8 +16,7 @@ config SND_ATMEL_SOC_SSC
config SND_AT91_SOC_SAM9G20_WM8731
tristate "SoC Audio support for WM8731-based At91sam9g20 evaluation board"
- depends on ATMEL_SSC && ARCH_AT91SAM9G20 && SND_ATMEL_SOC && \
- AT91_PROGRAMMABLE_CLOCKS
+ depends on ATMEL_SSC && SND_ATMEL_SOC && AT91_PROGRAMMABLE_CLOCKS
select SND_ATMEL_SOC_SSC
select SND_SOC_WM8731
help
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
index c3e1df5..0a275d0 100644
--- a/sound/soc/atmel/sam9g20_wm8731.c
+++ b/sound/soc/atmel/sam9g20_wm8731.c
@@ -197,13 +197,17 @@ static struct snd_soc_card snd_soc_at91sam9g20ek = {
static int __devinit at91sam9g20ek_audio_probe(struct platform_device *pdev)
{
+ struct device_node *np = pdev->dev.of_node;
+ struct device_node *codec_np, *cpu_np;
struct clk *pllb;
struct snd_soc_card *card =&snd_soc_at91sam9g20ek;
int ret;
- if (!(machine_is_at91sam9g20ek() || machine_is_at91sam9g20ek_2mmc()))
+ if (!np) {
+ if (!(machine_is_at91sam9g20ek()
+ || machine_is_at91sam9g20ek_2mmc()))
return -ENODEV;
-
+ }
/*
* Codec MCLK is supplied by PCK0 - set it up.
*/
@@ -230,6 +234,40 @@ static int __devinit at91sam9g20ek_audio_probe(struct platform_device *pdev)
clk_set_rate(mclk, MCLK_RATE);
card->dev = &pdev->dev;
+
+ /* Parse device node info */
+ if (np) {
+ ret = snd_soc_of_parse_card_name(card, "atmel,model");
+ if (ret)
+ goto err;
+
+ ret = snd_soc_of_parse_audio_routing(card,
+ "atmel,audio-routing");
+ if (ret)
+ goto err;
+
+ /* Parse codec dai info */
+ at91sam9g20ek_dai.codec_name = NULL;
+ codec_np = of_parse_phandle(np, "atmel,audio-codec", 0);
+ if (!codec_np) {
+ dev_err(&pdev->dev, "codec info missing\n");
+ return -EINVAL;
+ }
+ at91sam9g20ek_dai.codec_of_node = codec_np;
+ at91sam9g20ek_dai.cpu_dai_name = NULL;
+ at91sam9g20ek_dai.platform_name = NULL;
+ cpu_np = of_parse_phandle(np, "atmel,dai", 0);
+ if (!cpu_np) {
+ dev_err(&pdev->dev, "dai info missing\n");
+ return -EINVAL;
+ }
+ at91sam9g20ek_dai.cpu_of_node = cpu_np;
+ at91sam9g20ek_dai.platform_of_node = cpu_np;
+
+ of_node_put(codec_np);
+ of_node_put(cpu_np);
+ }
+
ret = snd_soc_register_card(card);
if (ret) {
printk(KERN_ERR "ASoC: snd_soc_register_card() failed\n");
@@ -255,10 +293,19 @@ static int __devexit at91sam9g20ek_audio_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_OF
+static const struct of_device_id sam9g20ek_wm8731_dt_ids[] = {
+ { .compatible = "atmel,at91sam9g20-audio", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, sam9g20ek_wm8731_dt_ids);
+#endif
+
static struct platform_driver at91sam9g20ek_audio_driver = {
.driver = {
.name = "at91sam9g20ek-audio",
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(sam9g20ek_wm8731_dt_ids),
},
.probe = at91sam9g20ek_audio_probe,
.remove = __devexit_p(at91sam9g20ek_audio_remove),
--
1.7.9.5
^ permalink raw reply related
* [Patch v2 3/4] ASoC: atmel-ssc-dai: register platform from DAIs
From: Bo Shen @ 2012-10-31 7:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1351668420-18447-1-git-send-email-voice.shen@atmel.com>
Register platform from DAIs
Add atmel-ssc-dai device tree support
Although atmel-ssc-dai is a virtual devices, but it needs the ssc
controller as his parent. So, when use dai based on ssc, you should
let the dai know which ssc should be used.
Using ssc_request to implement this, so in dts file, need to assign
"atmel,dai-master" to dai.
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
.../devicetree/bindings/sound/atmel-ssc-dai.txt | 18 ++
arch/arm/mach-at91/board-sam9g20ek.c | 6 -
sound/soc/atmel/atmel-pcm.c | 23 +-
sound/soc/atmel/atmel-pcm.h | 3 +
sound/soc/atmel/atmel_ssc_dai.c | 251 ++++++--------------
sound/soc/atmel/sam9g20_wm8731.c | 2 +-
6 files changed, 103 insertions(+), 200 deletions(-)
create mode 100644 Documentation/devicetree/bindings/sound/atmel-ssc-dai.txt
diff --git a/Documentation/devicetree/bindings/sound/atmel-ssc-dai.txt b/Documentation/devicetree/bindings/sound/atmel-ssc-dai.txt
new file mode 100644
index 0000000..5afb0e9
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/atmel-ssc-dai.txt
@@ -0,0 +1,18 @@
+* Atmel DAI interface based on SSC controller
+
+THe ssc is physical device. Which can be used to connect audio codec,
+DAC, Magnetic card reader, and etc. So, build ssc controller as a
+library.
+
+The dai is a virtual device, which will build on ssc controller.
+So, use "atmel,dai-master" to let the dai know which ssc as his master.
+
+Required properties:
+ - compatible: "atmel,atmel-ssc-dai"
+ - atmel,dai-master: this dai base on which ssc controller
+
+Example:
+dai: dai {
+ compatible = "atmel,atmel-ssc-dai";
+ atmel,dai-master = <&ssc0>;
+};
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index 5b6a6f9..ebdbf42 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -353,11 +353,6 @@ static struct i2c_board_info __initdata ek_i2c_devices[] = {
},
};
-static struct platform_device sam9g20ek_pcm_device = {
- .name = "atmel-pcm-audio",
- .id = -1,
-};
-
static struct platform_device sam9g20ek_audio_device = {
.name = "at91sam9g20ek-audio",
.id = -1,
@@ -365,7 +360,6 @@ static struct platform_device sam9g20ek_audio_device = {
static void __init ek_add_device_audio(void)
{
- platform_device_register(&sam9g20ek_pcm_device);
platform_device_register(&sam9g20ek_audio_device);
}
diff --git a/sound/soc/atmel/atmel-pcm.c b/sound/soc/atmel/atmel-pcm.c
index 9b84f98..1e9cd2c 100644
--- a/sound/soc/atmel/atmel-pcm.c
+++ b/sound/soc/atmel/atmel-pcm.c
@@ -473,28 +473,17 @@ static struct snd_soc_platform_driver atmel_soc_platform = {
.resume = atmel_pcm_resume,
};
-static int __devinit atmel_soc_platform_probe(struct platform_device *pdev)
+int __devinit atmel_pcm_platform_register(struct device *dev)
{
- return snd_soc_register_platform(&pdev->dev, &atmel_soc_platform);
+ return snd_soc_register_platform(dev, &atmel_soc_platform);
}
+EXPORT_SYMBOL(atmel_pcm_platform_register);
-static int __devexit atmel_soc_platform_remove(struct platform_device *pdev)
+void __devexit atmel_pcm_platform_unregister(struct device *dev)
{
- snd_soc_unregister_platform(&pdev->dev);
- return 0;
+ snd_soc_unregister_platform(dev);
}
-
-static struct platform_driver atmel_pcm_driver = {
- .driver = {
- .name = "atmel-pcm-audio",
- .owner = THIS_MODULE,
- },
-
- .probe = atmel_soc_platform_probe,
- .remove = __devexit_p(atmel_soc_platform_remove),
-};
-
-module_platform_driver(atmel_pcm_driver);
+EXPORT_SYMBOL(atmel_pcm_platform_unregister);
MODULE_AUTHOR("Sedji Gaouaou <sedji.gaouaou@atmel.com>");
MODULE_DESCRIPTION("Atmel PCM module");
diff --git a/sound/soc/atmel/atmel-pcm.h b/sound/soc/atmel/atmel-pcm.h
index 5e0a95e..2d1c60f 100644
--- a/sound/soc/atmel/atmel-pcm.h
+++ b/sound/soc/atmel/atmel-pcm.h
@@ -80,4 +80,7 @@ struct atmel_pcm_dma_params {
#define ssc_readx(base, reg) (__raw_readl((base) + (reg)))
#define ssc_writex(base, reg, value) __raw_writel((value), (base) + (reg))
+int __devexit atmel_pcm_platform_register(struct device *dev);
+void __devexit atmel_pcm_platform_unregister(struct device *dev);
+
#endif /* _ATMEL_PCM_H */
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
index 354341e..5ff0774 100644
--- a/sound/soc/atmel/atmel_ssc_dai.c
+++ b/sound/soc/atmel/atmel_ssc_dai.c
@@ -42,18 +42,13 @@
#include <sound/initval.h>
#include <sound/soc.h>
+#include <linux/of.h>
+
#include <mach/hardware.h>
#include "atmel-pcm.h"
#include "atmel_ssc_dai.h"
-
-#if defined(CONFIG_ARCH_AT91SAM9260) || defined(CONFIG_ARCH_AT91SAM9G20)
-#define NUM_SSC_DEVICES 1
-#else
-#define NUM_SSC_DEVICES 3
-#endif
-
/*
* SSC PDC registers required by the PCM DMA engine.
*/
@@ -96,63 +91,24 @@ static struct atmel_ssc_mask ssc_rx_mask = {
/*
* DMA parameters.
*/
-static struct atmel_pcm_dma_params ssc_dma_params[NUM_SSC_DEVICES][2] = {
- {{
- .name = "SSC0 PCM out",
- .pdc = &pdc_tx_reg,
- .mask = &ssc_tx_mask,
- },
+static struct atmel_pcm_dma_params ssc_dma_params[2] = {
{
- .name = "SSC0 PCM in",
- .pdc = &pdc_rx_reg,
- .mask = &ssc_rx_mask,
- } },
-#if NUM_SSC_DEVICES == 3
- {{
- .name = "SSC1 PCM out",
+ .name = "SSC PCM out",
.pdc = &pdc_tx_reg,
.mask = &ssc_tx_mask,
},
{
- .name = "SSC1 PCM in",
+ .name = "SSC PCM in",
.pdc = &pdc_rx_reg,
.mask = &ssc_rx_mask,
- } },
- {{
- .name = "SSC2 PCM out",
- .pdc = &pdc_tx_reg,
- .mask = &ssc_tx_mask,
},
- {
- .name = "SSC2 PCM in",
- .pdc = &pdc_rx_reg,
- .mask = &ssc_rx_mask,
- } },
-#endif
};
-
-static struct atmel_ssc_info ssc_info[NUM_SSC_DEVICES] = {
- {
- .name = "ssc0",
+static struct atmel_ssc_info ssc_info = {
+ .name = "ssc",
.lock = __SPIN_LOCK_UNLOCKED(ssc_info[0].lock),
.dir_mask = SSC_DIR_MASK_UNUSED,
.initialized = 0,
- },
-#if NUM_SSC_DEVICES == 3
- {
- .name = "ssc1",
- .lock = __SPIN_LOCK_UNLOCKED(ssc_info[1].lock),
- .dir_mask = SSC_DIR_MASK_UNUSED,
- .initialized = 0,
- },
- {
- .name = "ssc2",
- .lock = __SPIN_LOCK_UNLOCKED(ssc_info[2].lock),
- .dir_mask = SSC_DIR_MASK_UNUSED,
- .initialized = 0,
- },
-#endif
};
@@ -205,7 +161,7 @@ static irqreturn_t atmel_ssc_interrupt(int irq, void *dev_id)
static int atmel_ssc_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
+ struct atmel_ssc_info *ssc_p = &ssc_info;
int dir_mask;
pr_debug("atmel_ssc_startup: SSC_SR=0x%u\n",
@@ -234,7 +190,7 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream,
static void atmel_ssc_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
+ struct atmel_ssc_info *ssc_p = &ssc_info;
struct atmel_pcm_dma_params *dma_params;
int dir, dir_mask;
@@ -285,7 +241,7 @@ static void atmel_ssc_shutdown(struct snd_pcm_substream *substream,
static int atmel_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai,
unsigned int fmt)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
+ struct atmel_ssc_info *ssc_p = &ssc_info;
ssc_p->daifmt = fmt;
return 0;
@@ -297,7 +253,7 @@ static int atmel_ssc_set_dai_fmt(struct snd_soc_dai *cpu_dai,
static int atmel_ssc_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
int div_id, int div)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[cpu_dai->id];
+ struct atmel_ssc_info *ssc_p = &ssc_info;
switch (div_id) {
case ATMEL_SSC_CMR_DIV:
@@ -336,8 +292,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
- int id = dai->id;
- struct atmel_ssc_info *ssc_p = &ssc_info[id];
+ struct atmel_ssc_info *ssc_p = &ssc_info;
struct atmel_pcm_dma_params *dma_params;
int dir, channels, bits;
u32 tfmr, rfmr, tcmr, rcmr;
@@ -354,7 +309,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
else
dir = 1;
- dma_params = &ssc_dma_params[id][dir];
+ dma_params = &ssc_dma_params[dir];
dma_params->ssc = ssc_p->ssc;
dma_params->substream = substream;
@@ -603,7 +558,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
static int atmel_ssc_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
+ struct atmel_ssc_info *ssc_p = &ssc_info;
struct atmel_pcm_dma_params *dma_params;
int dir;
@@ -631,7 +586,7 @@ static int atmel_ssc_suspend(struct snd_soc_dai *cpu_dai)
if (!cpu_dai->active)
return 0;
- ssc_p = &ssc_info[cpu_dai->id];
+ ssc_p = &ssc_info;
/* Save the status register before disabling transmit and receive */
ssc_p->ssc_state.ssc_sr = ssc_readl(ssc_p->ssc->regs, SR);
@@ -660,7 +615,7 @@ static int atmel_ssc_resume(struct snd_soc_dai *cpu_dai)
if (!cpu_dai->active)
return 0;
- ssc_p = &ssc_info[cpu_dai->id];
+ ssc_p = &ssc_info;
/* restore SSC register settings */
ssc_writel(ssc_p->ssc->regs, TFMR, ssc_p->ssc_state.ssc_tfmr);
@@ -689,31 +644,14 @@ static int atmel_ssc_resume(struct snd_soc_dai *cpu_dai)
static int atmel_ssc_probe(struct snd_soc_dai *dai)
{
- struct atmel_ssc_info *ssc_p = &ssc_info[dai->id];
+ struct atmel_ssc_info *ssc_p = &ssc_info;
int ret = 0;
snd_soc_dai_set_drvdata(dai, ssc_p);
- /*
- * Request SSC device
- */
- ssc_p->ssc = ssc_request(dai->id);
- if (IS_ERR(ssc_p->ssc)) {
- printk(KERN_ERR "ASoC: Failed to request SSC %d\n", dai->id);
- ret = PTR_ERR(ssc_p->ssc);
- }
-
return ret;
}
-static int atmel_ssc_remove(struct snd_soc_dai *dai)
-{
- struct atmel_ssc_info *ssc_p = snd_soc_dai_get_drvdata(dai);
-
- ssc_free(ssc_p->ssc);
- return 0;
-}
-
#define ATMEL_SSC_RATES (SNDRV_PCM_RATE_8000_96000)
#define ATMEL_SSC_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE |\
@@ -728,11 +666,9 @@ static const struct snd_soc_dai_ops atmel_ssc_dai_ops = {
.set_clkdiv = atmel_ssc_set_dai_clkdiv,
};
-static struct snd_soc_dai_driver atmel_ssc_dai[NUM_SSC_DEVICES] = {
- {
- .name = "atmel-ssc-dai.0",
+static struct snd_soc_dai_driver atmel_ssc_dai = {
+ .name = "atmel-ssc-dai",
.probe = atmel_ssc_probe,
- .remove = atmel_ssc_remove,
.suspend = atmel_ssc_suspend,
.resume = atmel_ssc_resume,
.playback = {
@@ -746,119 +682,82 @@ static struct snd_soc_dai_driver atmel_ssc_dai[NUM_SSC_DEVICES] = {
.rates = ATMEL_SSC_RATES,
.formats = ATMEL_SSC_FORMATS,},
.ops = &atmel_ssc_dai_ops,
- },
-#if NUM_SSC_DEVICES == 3
- {
- .name = "atmel-ssc-dai.1",
- .probe = atmel_ssc_probe,
- .remove = atmel_ssc_remove,
- .suspend = atmel_ssc_suspend,
- .resume = atmel_ssc_resume,
- .playback = {
- .channels_min = 1,
- .channels_max = 2,
- .rates = ATMEL_SSC_RATES,
- .formats = ATMEL_SSC_FORMATS,},
- .capture = {
- .channels_min = 1,
- .channels_max = 2,
- .rates = ATMEL_SSC_RATES,
- .formats = ATMEL_SSC_FORMATS,},
- .ops = &atmel_ssc_dai_ops,
- },
- {
- .name = "atmel-ssc-dai.2",
- .probe = atmel_ssc_probe,
- .remove = atmel_ssc_remove,
- .suspend = atmel_ssc_suspend,
- .resume = atmel_ssc_resume,
- .playback = {
- .channels_min = 1,
- .channels_max = 2,
- .rates = ATMEL_SSC_RATES,
- .formats = ATMEL_SSC_FORMATS,},
- .capture = {
- .channels_min = 1,
- .channels_max = 2,
- .rates = ATMEL_SSC_RATES,
- .formats = ATMEL_SSC_FORMATS,},
- .ops = &atmel_ssc_dai_ops,
- },
-#endif
};
static __devinit int asoc_ssc_probe(struct platform_device *pdev)
{
- BUG_ON(pdev->id < 0);
- BUG_ON(pdev->id >= ARRAY_SIZE(atmel_ssc_dai));
- return snd_soc_register_dai(&pdev->dev, &atmel_ssc_dai[pdev->id]);
+ struct ssc_device *ssc;
+ int ret, id;
+
+ if (pdev->dev.of_node) {
+ struct device_node *np = pdev->dev.of_node;
+ struct device_node *dai_master_np;
+
+ dai_master_np = of_parse_phandle(np, "atmel,dai-master", 0);
+ if (!dai_master_np) {
+ dev_err(&pdev->dev, "No SSC for atmel dai");
+ return -EINVAL;
+ }
+
+ id = of_alias_get_id(dai_master_np, "ssc");
+ } else {
+ id = to_platform_device(pdev->dev.parent)->id;
+ }
+
+ ssc = ssc_request(id);
+ if (IS_ERR(ssc)) {
+ dev_err(&pdev->dev, "Failed to request SSC %d\n", id);
+ return PTR_ERR(ssc);
+ }
+ ssc_info.ssc = ssc;
+ pdev->dev.parent = &(ssc->pdev->dev);
+
+ ret = snd_soc_register_dai(&pdev->dev, &atmel_ssc_dai);
+ if (ret) {
+ dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
+ goto err_unregister_dai;
+ }
+
+ ret = atmel_pcm_platform_register(&pdev->dev);
+ if (ret) {
+ dev_err(&pdev->dev, "Could not register PCM: %d\n", ret);
+ goto err;
+ };
+
+ return 0;
+
+err_unregister_dai:
+ snd_soc_unregister_dai(&pdev->dev);
+err:
+ return ret;
}
static int __devexit asoc_ssc_remove(struct platform_device *pdev)
{
+ atmel_pcm_platform_unregister(&pdev->dev);
snd_soc_unregister_dai(&pdev->dev);
return 0;
}
+#ifdef CONFIG_OF
+static const struct of_device_id atmel_ssc_dai_dt_ids[] = {
+ { .compatible = "atmel,atmel-ssc-dai", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, atmel_ssc_dai_dt_ids);
+#endif
+
static struct platform_driver asoc_ssc_driver = {
.driver = {
- .name = "atmel-ssc-dai",
- .owner = THIS_MODULE,
+ .name = "atmel-ssc-dai",
+ .owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(atmel_ssc_dai_dt_ids),
},
.probe = asoc_ssc_probe,
.remove = __devexit_p(asoc_ssc_remove),
};
-/**
- * atmel_ssc_set_audio - Allocate the specified SSC for audio use.
- */
-int atmel_ssc_set_audio(int ssc_id)
-{
- struct ssc_device *ssc;
- static struct platform_device *dma_pdev;
- struct platform_device *ssc_pdev;
- int ret;
-
- if (ssc_id < 0 || ssc_id >= ARRAY_SIZE(atmel_ssc_dai))
- return -EINVAL;
-
- /* Allocate a dummy device for DMA if we don't have one already */
- if (!dma_pdev) {
- dma_pdev = platform_device_alloc("atmel-pcm-audio", -1);
- if (!dma_pdev)
- return -ENOMEM;
-
- ret = platform_device_add(dma_pdev);
- if (ret < 0) {
- platform_device_put(dma_pdev);
- dma_pdev = NULL;
- return ret;
- }
- }
-
- ssc_pdev = platform_device_alloc("atmel-ssc-dai", ssc_id);
- if (!ssc_pdev)
- return -ENOMEM;
-
- /* If we can grab the SSC briefly to parent the DAI device off it */
- ssc = ssc_request(ssc_id);
- if (IS_ERR(ssc))
- pr_warn("Unable to parent ASoC SSC DAI on SSC: %ld\n",
- PTR_ERR(ssc));
- else {
- ssc_pdev->dev.parent = &(ssc->pdev->dev);
- ssc_free(ssc);
- }
-
- ret = platform_device_add(ssc_pdev);
- if (ret < 0)
- platform_device_put(ssc_pdev);
-
- return ret;
-}
-EXPORT_SYMBOL_GPL(atmel_ssc_set_audio);
-
module_platform_driver(asoc_ssc_driver);
/* Module information */
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
index e5e27db..c3e1df5 100644
--- a/sound/soc/atmel/sam9g20_wm8731.c
+++ b/sound/soc/atmel/sam9g20_wm8731.c
@@ -182,7 +182,7 @@ static struct snd_soc_dai_link at91sam9g20ek_dai = {
.cpu_dai_name = "atmel-ssc-dai.0",
.codec_dai_name = "wm8731-hifi",
.init = at91sam9g20ek_wm8731_init,
- .platform_name = "atmel-pcm-audio",
+ .platform_name = "atmel-ssc-dai.0",
.codec_name = "wm8731.0-001b",
.ops = &at91sam9g20ek_ops,
};
--
1.7.9.5
^ permalink raw reply related
* [Patch v2 2/4] ARM: at91: atmel-ssc: add device tree support
From: Bo Shen @ 2012-10-31 7:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1351668420-18447-1-git-send-email-voice.shen@atmel.com>
Add atmel-ssc for device tree support
Match "atmel,at91rm9200-ssc" for using pdc for data transfer
Match "atmel,at91sam9g45-ssc" for using pdc for data transfer
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
Change since v1:
change the underscore to dash in atmel-ssc binding document
---
.../devicetree/bindings/misc/atmel-ssc.txt | 15 ++++++
arch/arm/boot/dts/at91sam9260.dtsi | 8 ++++
arch/arm/boot/dts/at91sam9263.dtsi | 16 +++++++
arch/arm/boot/dts/at91sam9g45.dtsi | 16 +++++++
arch/arm/boot/dts/at91sam9x5.dtsi | 8 ++++
arch/arm/mach-at91/at91rm9200.c | 3 ++
arch/arm/mach-at91/at91sam9260.c | 1 +
arch/arm/mach-at91/at91sam9261.c | 3 ++
arch/arm/mach-at91/at91sam9263.c | 2 +
arch/arm/mach-at91/at91sam9g45.c | 2 +
arch/arm/mach-at91/at91sam9rl.c | 2 +
arch/arm/mach-at91/at91sam9x5.c | 1 +
drivers/misc/atmel-ssc.c | 49 ++++++++++++++++++--
13 files changed, 123 insertions(+), 3 deletions(-)
create mode 100644 Documentation/devicetree/bindings/misc/atmel-ssc.txt
diff --git a/Documentation/devicetree/bindings/misc/atmel-ssc.txt b/Documentation/devicetree/bindings/misc/atmel-ssc.txt
new file mode 100644
index 0000000..38e51ad
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/atmel-ssc.txt
@@ -0,0 +1,15 @@
+* Atmel SSC driver.
+
+Required properties:
+- compatible: "atmel,at91rm9200-ssc" or "atmel,at91sam9g45-ssc"
+ - atmel,at91rm9200-ssc: support pdc transfer
+ - atmel,at91sam9g45-ssc: support dma transfer
+- reg: Should contain SSC registers location and length
+- interrupts: Should contain SSC interrupt
+
+Example:
+ssc0: ssc at fffbc000 {
+ compatible = "atmel,at91rm9200-ssc";
+ reg = <0xfffbc000 0x4000>;
+ interrupts = <14 4 5>;
+};
diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi
index d410581..aaa42d8 100644
--- a/arch/arm/boot/dts/at91sam9260.dtsi
+++ b/arch/arm/boot/dts/at91sam9260.dtsi
@@ -29,6 +29,7 @@
tcb0 = &tcb0;
tcb1 = &tcb1;
i2c0 = &i2c0;
+ ssc0 = &ssc0;
};
cpus {
cpu at 0 {
@@ -212,6 +213,13 @@
status = "disabled";
};
+ ssc0: ssc at fffbc000 {
+ compatible = "atmel,at91rm9200-ssc";
+ reg = <0xfffbc000 0x4000>;
+ interrupts = <14 4 5>;
+ status = "disable";
+ };
+
adc0: adc at fffe0000 {
compatible = "atmel,at91sam9260-adc";
reg = <0xfffe0000 0x100>;
diff --git a/arch/arm/boot/dts/at91sam9263.dtsi b/arch/arm/boot/dts/at91sam9263.dtsi
index 3e6e5c1..3b721ee 100644
--- a/arch/arm/boot/dts/at91sam9263.dtsi
+++ b/arch/arm/boot/dts/at91sam9263.dtsi
@@ -25,6 +25,8 @@
gpio4 = &pioE;
tcb0 = &tcb0;
i2c0 = &i2c0;
+ ssc0 = &ssc0;
+ ssc1 = &ssc1;
};
cpus {
cpu at 0 {
@@ -173,6 +175,20 @@
status = "disabled";
};
+ ssc0: ssc at fff98000 {
+ compatible = "atmel,at91rm9200-ssc";
+ reg = <0xfff98000 0x4000>;
+ interrupts = <16 4 5>;
+ status = "disable";
+ };
+
+ ssc1: ssc at fff9c000 {
+ compatible = "atmel,at91rm9200-ssc";
+ reg = <0xfff9c000 0x4000>;
+ interrupts = <17 4 5>;
+ status = "disable";
+ };
+
macb0: ethernet at fffbc000 {
compatible = "cdns,at32ap7000-macb", "cdns,macb";
reg = <0xfffbc000 0x100>;
diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi
index 3add030..cd9af7c 100644
--- a/arch/arm/boot/dts/at91sam9g45.dtsi
+++ b/arch/arm/boot/dts/at91sam9g45.dtsi
@@ -31,6 +31,8 @@
tcb1 = &tcb1;
i2c0 = &i2c0;
i2c1 = &i2c1;
+ ssc0 = &ssc0;
+ ssc1 = &ssc1;
};
cpus {
cpu at 0 {
@@ -226,6 +228,20 @@
status = "disabled";
};
+ ssc0: ssc at fff9c000 {
+ compatible = "atmel,at91sam9g45-ssc";
+ reg = <0xfff9c000 0x4000>;
+ interrupts = <16 4 5>;
+ status = "disable";
+ };
+
+ ssc0: ssc at fffa0000 {
+ compatible = "atmel,at91sam9g45-ssc";
+ reg = <0xfffa0000 0x4000>;
+ interrupts = <17 4 5>;
+ status = "disable";
+ };
+
adc0: adc at fffb0000 {
compatible = "atmel,at91sam9260-adc";
reg = <0xfffb0000 0x100>;
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi
index 03fc136..69667d0 100644
--- a/arch/arm/boot/dts/at91sam9x5.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5.dtsi
@@ -30,6 +30,7 @@
i2c0 = &i2c0;
i2c1 = &i2c1;
i2c2 = &i2c2;
+ ssc0 = &ssc0;
};
cpus {
cpu at 0 {
@@ -87,6 +88,13 @@
interrupts = <1 4 7>;
};
+ ssc0: ssc at f0010000 {
+ compatible = "atmel,at91sam9g45-ssc";
+ reg = <0xf0010000 0x4000>;
+ interrupts = <28 4 5>;
+ status = "disable";
+ };
+
tcb0: timer at f8008000 {
compatible = "atmel,at91sam9x5-tcb";
reg = <0xf8008000 0x100>;
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 85d53c5..6d65feb 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -187,6 +187,9 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.2", &ssc2_clk),
+ CLKDEV_CON_DEV_ID("pclk", "fffd0000.ssc", &ssc0_clk),
+ CLKDEV_CON_DEV_ID("pclk", "fffd4000.ssc", &ssc1_clk),
+ CLKDEV_CON_DEV_ID("pclk", "fffd8000.ssc", &ssc2_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91rm9200", &twi_clk),
/* fake hclk clock */
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 2c8aab0..54d4aea 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -211,6 +211,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk),
CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk),
CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.0", &ssc_clk),
+ CLKDEV_CON_DEV_ID("pclk", "fffbc000.ssc", &ssc_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260", &twi_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20", &twi_clk),
/* more usart lookup table for DT entries */
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 4e8c56e..5c7a482 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -177,6 +177,9 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.2", &ssc2_clk),
+ CLKDEV_CON_DEV_ID("pclk", "fffbc000.ssc", &ssc0_clk),
+ CLKDEV_CON_DEV_ID("pclk", "fffc0000.ssc", &ssc1_clk),
+ CLKDEV_CON_DEV_ID("pclk", "fffc4000.ssc", &ssc2_clk),
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9261", &twi_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10", &twi_clk),
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 95a5471..1f523de 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -188,6 +188,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_ID("hclk", &macb_clk),
CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk),
+ CLKDEV_CON_DEV_ID("pclk", "fff98000.ssc", &ssc0_clk),
+ CLKDEV_CON_DEV_ID("pclk", "fff9c000.ssc", &ssc1_clk),
CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_clk),
CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.1", &mmc1_clk),
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index f4f96a6..a4282d3 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -241,6 +241,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10.1", &twi1_clk),
CLKDEV_CON_DEV_ID("pclk", "at91sam9g45_ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "at91sam9g45_ssc.1", &ssc1_clk),
+ CLKDEV_CON_DEV_ID("pclk", "fff9c000.ssc", &ssc0_clk),
+ CLKDEV_CON_DEV_ID("pclk", "fffa0000.ssc", &ssc1_clk),
CLKDEV_CON_DEV_ID(NULL, "atmel-trng", &trng_clk),
CLKDEV_CON_DEV_ID(NULL, "atmel_sha", &aestdessha_clk),
CLKDEV_CON_DEV_ID(NULL, "atmel_tdes", &aestdessha_clk),
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 4110b54..b683fdc 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -186,6 +186,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.0", &ssc0_clk),
CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk),
+ CLKDEV_CON_DEV_ID("pclk", "fffc0000.ssc", &ssc0_clk),
+ CLKDEV_CON_DEV_ID("pclk", "fffc4000.ssc", &ssc1_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.0", &twi0_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.1", &twi1_clk),
CLKDEV_CON_ID("pioA", &pioA_clk),
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
index e503538..18fbbb2 100644
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ b/arch/arm/mach-at91/at91sam9x5.c
@@ -231,6 +231,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb0_clk),
CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma0_clk),
CLKDEV_CON_DEV_ID("dma_clk", "ffffee00.dma-controller", &dma1_clk),
+ CLKDEV_CON_DEV_ID("pclk", "f0010000.ssc", &ssc_clk),
CLKDEV_CON_DEV_ID(NULL, "f8010000.i2c", &twi0_clk),
CLKDEV_CON_DEV_ID(NULL, "f8014000.i2c", &twi1_clk),
CLKDEV_CON_DEV_ID(NULL, "f8018000.i2c", &twi2_clk),
diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index f40abd8..a769719 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -18,6 +18,8 @@
#include <linux/slab.h>
#include <linux/module.h>
+#include <linux/of.h>
+
/* Serialize access to ssc_list and user count */
static DEFINE_SPINLOCK(user_lock);
static LIST_HEAD(ssc_list);
@@ -29,7 +31,13 @@ struct ssc_device *ssc_request(unsigned int ssc_num)
spin_lock(&user_lock);
list_for_each_entry(ssc, &ssc_list, list) {
- if (ssc->pdev->id == ssc_num) {
+ if (ssc->pdev->dev.of_node) {
+ if (of_alias_get_id(ssc->pdev->dev.of_node, "ssc")
+ == ssc_num) {
+ ssc_valid = 1;
+ break;
+ }
+ } else if (ssc->pdev->id == ssc_num) {
ssc_valid = 1;
break;
}
@@ -88,10 +96,41 @@ static const struct platform_device_id atmel_ssc_devtypes[] = {
}
};
+#ifdef CONFIG_OF
+static const struct of_device_id atmel_ssc_dt_ids[] = {
+ {
+ .compatible = "atmel,at91rm9200-ssc",
+ .data = &at91rm9200_config,
+ }, {
+ .compatible = "atmel,at91sam9g45-ssc",
+ .data = &at91sam9g45_config,
+ }, {
+ /* sentinel */
+ }
+};
+MODULE_DEVICE_TABLE(of, atmel_ssc_dt_ids);
+#endif
+
+static inline const struct atmel_ssc_platform_data * __init
+ atmel_ssc_get_driver_data(struct platform_device *pdev)
+{
+ if (pdev->dev.of_node) {
+ const struct of_device_id *match;
+ match = of_match_node(atmel_ssc_dt_ids, pdev->dev.of_node);
+ if (match == NULL)
+ return NULL;
+ return match->data;
+ }
+
+ return (struct atmel_ssc_platform_data *)
+ platform_get_device_id(pdev)->driver_data;
+}
+
static int ssc_probe(struct platform_device *pdev)
{
struct resource *regs;
struct ssc_device *ssc;
+ const struct atmel_ssc_platform_data *plat_dat;
ssc = devm_kzalloc(&pdev->dev, sizeof(struct ssc_device), GFP_KERNEL);
if (!ssc) {
@@ -100,8 +139,11 @@ static int ssc_probe(struct platform_device *pdev)
}
ssc->pdev = pdev;
- ssc->pdata = (struct atmel_ssc_platform_data *)
- platform_get_device_id(pdev)->driver_data;
+
+ plat_dat = atmel_ssc_get_driver_data(pdev);
+ if (!plat_dat)
+ return -ENODEV;
+ ssc->pdata = (struct atmel_ssc_platform_data *)plat_dat;
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!regs) {
@@ -160,6 +202,7 @@ static struct platform_driver ssc_driver = {
.driver = {
.name = "ssc",
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(atmel_ssc_dt_ids),
},
.id_table = atmel_ssc_devtypes,
.probe = ssc_probe,
--
1.7.9.5
^ permalink raw reply related
* [Patch v2 1/4] ARM: at91: atmel-ssc: add platform device id table
From: Bo Shen @ 2012-10-31 7:26 UTC (permalink / raw)
To: linux-arm-kernel
Add platform device id to check whether the SSC controller support
pdc or dam for data transfer
If match "at91rm9200_ssc", which support pdc for data transfer
If match "at91sam9g45_ssc", which support dma for data transfer
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
No change between v1 and v2
---
arch/arm/mach-at91/at91rm9200.c | 6 +++---
arch/arm/mach-at91/at91rm9200_devices.c | 6 +++---
arch/arm/mach-at91/at91sam9260.c | 2 +-
arch/arm/mach-at91/at91sam9260_devices.c | 2 +-
arch/arm/mach-at91/at91sam9261.c | 6 +++---
arch/arm/mach-at91/at91sam9261_devices.c | 6 +++---
arch/arm/mach-at91/at91sam9263.c | 4 ++--
arch/arm/mach-at91/at91sam9263_devices.c | 4 ++--
arch/arm/mach-at91/at91sam9g45.c | 4 ++--
arch/arm/mach-at91/at91sam9g45_devices.c | 4 ++--
arch/arm/mach-at91/at91sam9rl.c | 4 ++--
arch/arm/mach-at91/at91sam9rl_devices.c | 4 ++--
drivers/misc/atmel-ssc.c | 23 +++++++++++++++++++++++
include/linux/atmel-ssc.h | 5 +++++
14 files changed, 54 insertions(+), 26 deletions(-)
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index b4f0565..85d53c5 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -184,9 +184,9 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tc3_clk),
CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk),
CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk),
- CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
- CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
- CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
+ CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.0", &ssc0_clk),
+ CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk),
+ CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.2", &ssc2_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91rm9200", &twi_clk),
/* fake hclk clock */
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index a563189..59ceea1 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -752,7 +752,7 @@ static struct resource ssc0_resources[] = {
};
static struct platform_device at91rm9200_ssc0_device = {
- .name = "ssc",
+ .name = "at91rm9200_ssc",
.id = 0,
.dev = {
.dma_mask = &ssc0_dmamask,
@@ -794,7 +794,7 @@ static struct resource ssc1_resources[] = {
};
static struct platform_device at91rm9200_ssc1_device = {
- .name = "ssc",
+ .name = "at91rm9200_ssc",
.id = 1,
.dev = {
.dma_mask = &ssc1_dmamask,
@@ -836,7 +836,7 @@ static struct resource ssc2_resources[] = {
};
static struct platform_device at91rm9200_ssc2_device = {
- .name = "ssc",
+ .name = "at91rm9200_ssc",
.id = 2,
.dev = {
.dma_mask = &ssc2_dmamask,
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index ad29f93..2c8aab0 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -210,7 +210,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tc3_clk),
CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk),
CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk),
- CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk),
+ CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.0", &ssc_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260", &twi_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20", &twi_clk),
/* more usart lookup table for DT entries */
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index 805ef95..9cfdc3f 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -742,7 +742,7 @@ static struct resource ssc_resources[] = {
};
static struct platform_device at91sam9260_ssc_device = {
- .name = "ssc",
+ .name = "at91rm9200_ssc",
.id = 0,
.dev = {
.dma_mask = &ssc_dmamask,
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 8d999eb..4e8c56e 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -174,9 +174,9 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk),
CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
- CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
- CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
- CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
+ CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.0", &ssc0_clk),
+ CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk),
+ CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.2", &ssc2_clk),
CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9261", &twi_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10", &twi_clk),
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index 9752f17..299637f 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -706,7 +706,7 @@ static struct resource ssc0_resources[] = {
};
static struct platform_device at91sam9261_ssc0_device = {
- .name = "ssc",
+ .name = "at91rm9200_ssc",
.id = 0,
.dev = {
.dma_mask = &ssc0_dmamask,
@@ -748,7 +748,7 @@ static struct resource ssc1_resources[] = {
};
static struct platform_device at91sam9261_ssc1_device = {
- .name = "ssc",
+ .name = "at91rm9200_ssc",
.id = 1,
.dev = {
.dma_mask = &ssc1_dmamask,
@@ -790,7 +790,7 @@ static struct resource ssc2_resources[] = {
};
static struct platform_device at91sam9261_ssc2_device = {
- .name = "ssc",
+ .name = "at91rm9200_ssc",
.id = 2,
.dev = {
.dma_mask = &ssc2_dmamask,
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 6a01d03..95a5471 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -186,8 +186,8 @@ static struct clk *periph_clocks[] __initdata = {
static struct clk_lookup periph_clocks_lookups[] = {
/* One additional fake clock for macb_hclk */
CLKDEV_CON_ID("hclk", &macb_clk),
- CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
- CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
+ CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.0", &ssc0_clk),
+ CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_clk),
CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.1", &mmc1_clk),
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 8dde220..df89a00 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -1199,7 +1199,7 @@ static struct resource ssc0_resources[] = {
};
static struct platform_device at91sam9263_ssc0_device = {
- .name = "ssc",
+ .name = "at91rm9200_ssc",
.id = 0,
.dev = {
.dma_mask = &ssc0_dmamask,
@@ -1241,7 +1241,7 @@ static struct resource ssc1_resources[] = {
};
static struct platform_device at91sam9263_ssc1_device = {
- .name = "ssc",
+ .name = "at91rm9200_ssc",
.id = 1,
.dev = {
.dma_mask = &ssc1_dmamask,
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 84af1b5..f4f96a6 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -239,8 +239,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10.0", &twi0_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10.1", &twi1_clk),
- CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
- CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
+ CLKDEV_CON_DEV_ID("pclk", "at91sam9g45_ssc.0", &ssc0_clk),
+ CLKDEV_CON_DEV_ID("pclk", "at91sam9g45_ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID(NULL, "atmel-trng", &trng_clk),
CLKDEV_CON_DEV_ID(NULL, "atmel_sha", &aestdessha_clk),
CLKDEV_CON_DEV_ID(NULL, "atmel_tdes", &aestdessha_clk),
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index b159607..27e3bf6 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -1459,7 +1459,7 @@ static struct resource ssc0_resources[] = {
};
static struct platform_device at91sam9g45_ssc0_device = {
- .name = "ssc",
+ .name = "at91sam9g45_ssc",
.id = 0,
.dev = {
.dma_mask = &ssc0_dmamask,
@@ -1501,7 +1501,7 @@ static struct resource ssc1_resources[] = {
};
static struct platform_device at91sam9g45_ssc1_device = {
- .name = "ssc",
+ .name = "at91sam9g45_ssc",
.id = 1,
.dev = {
.dma_mask = &ssc1_dmamask,
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 72e9084..4110b54 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -184,8 +184,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk),
CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
- CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
- CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
+ CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.0", &ssc0_clk),
+ CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.0", &twi0_clk),
CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.1", &twi1_clk),
CLKDEV_CON_ID("pioA", &pioA_clk),
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
index d6ca054..01220c7 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -832,7 +832,7 @@ static struct resource ssc0_resources[] = {
};
static struct platform_device at91sam9rl_ssc0_device = {
- .name = "ssc",
+ .name = "at91rm9200_ssc",
.id = 0,
.dev = {
.dma_mask = &ssc0_dmamask,
@@ -874,7 +874,7 @@ static struct resource ssc1_resources[] = {
};
static struct platform_device at91sam9rl_ssc1_device = {
- .name = "ssc",
+ .name = "at91rm9200_ssc",
.id = 1,
.dev = {
.dma_mask = &ssc1_dmamask,
diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index ac00f83..f40abd8 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -68,6 +68,26 @@ void ssc_free(struct ssc_device *ssc)
}
EXPORT_SYMBOL(ssc_free);
+static struct atmel_ssc_platform_data at91rm9200_config = {
+ .use_dma = 0,
+};
+
+static struct atmel_ssc_platform_data at91sam9g45_config = {
+ .use_dma = 1,
+};
+
+static const struct platform_device_id atmel_ssc_devtypes[] = {
+ {
+ .name = "at91rm9200_ssc",
+ .driver_data = (unsigned long) &at91rm9200_config,
+ }, {
+ .name = "at91sam9g45_ssc",
+ .driver_data = (unsigned long) &at91sam9g45_config,
+ }, {
+ /* sentinel */
+ }
+};
+
static int ssc_probe(struct platform_device *pdev)
{
struct resource *regs;
@@ -80,6 +100,8 @@ static int ssc_probe(struct platform_device *pdev)
}
ssc->pdev = pdev;
+ ssc->pdata = (struct atmel_ssc_platform_data *)
+ platform_get_device_id(pdev)->driver_data;
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!regs) {
@@ -139,6 +161,7 @@ static struct platform_driver ssc_driver = {
.name = "ssc",
.owner = THIS_MODULE,
},
+ .id_table = atmel_ssc_devtypes,
.probe = ssc_probe,
.remove = __devexit_p(ssc_remove),
};
diff --git a/include/linux/atmel-ssc.h b/include/linux/atmel-ssc.h
index 4eb3175..1ca0e32 100644
--- a/include/linux/atmel-ssc.h
+++ b/include/linux/atmel-ssc.h
@@ -5,10 +5,15 @@
#include <linux/list.h>
#include <linux/io.h>
+struct atmel_ssc_platform_data {
+ int use_dma;
+};
+
struct ssc_device {
struct list_head list;
void __iomem *regs;
struct platform_device *pdev;
+ struct atmel_ssc_platform_data *pdata;
struct clk *clk;
int user;
int irq;
--
1.7.9.5
^ permalink raw reply related
* [PATCH 06/16] mm/slob: use min_t() to compare ARCH_SLAB_MINALIGN
From: Pekka Enberg @ 2012-10-31 7:25 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <0000013a31d206df-8822ffd8-055d-4e9b-9b81-a8ec130ccc9d-000000@email.amazonses.com>
On Fri, 5 Oct 2012, Christoph Lameter wrote:
> On Fri, 5 Oct 2012, Arnd Bergmann wrote:
>
> > Without this patch, building ARM collie_defconfig results in:
> >
> > mm/slob.c: In function '__kmalloc_node':
> > mm/slob.c:431:152: warning: comparison of distinct pointer types lacks a cast [enabled by default]
> > mm/slob.c: In function 'kfree':
> > mm/slob.c:484:153: warning: comparison of distinct pointer types lacks a cast [enabled by default]
> > mm/slob.c: In function 'ksize':
> > mm/slob.c:503:153: warning: comparison of distinct pointer types lacks a cast [enabled by default]
>
> Acked-by: Christoph Lameter <cl@linux.com>
Applied, thanks!
^ permalink raw reply
* [PATCH 1/2] ARM: OMAP2+: move mailbox.h out of plat-omap headers
From: Omar Ramirez Luna @ 2012-10-31 7:22 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121030210213.GA6098@kroah.com>
Hi Greg,
On 30 October 2012 16:02, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>> OK.
>>
>> Greg, do these patches look OK to you to move to live under
>> drivers/mailbox?
>
> Um, I don't know, I wasn't paying attention here, sorry.
As part of plat-omap code cleanup, I was planning to move omap-mailbox
framework to a newly drivers/mailbox folder, right now this code is
specific to OMAP platforms, but with some clean up it could be the
base for a generic framework. And living under drivers/mailbox could
give it some exposure for interested developers to give feedback and
propose changes.
In the past there was a mailbox-like driver in mach-ux500, I was
hoping both could live under the same folder, however the platform
using it, was dropped a couple of kernel releases back and with it the
other similar mailbox implementation.
So, here it is the thread with the patches:
http://thread.gmane.org/gmane.linux.kernel/1384603, if you think it is
OK for them to be moved under drivers/mailbox, I just need to re-spin
them to move the mailbox header file to include/linux/mailbox instead
of include/linux/platform_data.
Cheers,
Omar
^ permalink raw reply
* [PATCH 1/2] ARM: Exynos5250: Enabling ehci-s5p driver
From: Vivek Gautam @ 2012-10-31 6:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <003801cda5f7$f7fd9a30$e7f8ce90$%han@samsung.com>
Hi all,
On Tue, Oct 9, 2012 at 1:57 PM, Jingoo Han <jg1.han@samsung.com> wrote:
> On Friday, October 05, 2012 7:10 PM Vivek Gautam wrote
>>
>> Adding EHCI device tree node for Exynos5250 along with
>> the device base adress and gpio line for vbus.
>>
>> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
>
> It looks good. Also I have tested this patch with Exynos5250.
>
> Acked-by: Jingoo Han <jg1.han@samsung.com>
>
Any thoughts about this please.
>> ---
>> .../devicetree/bindings/usb/exynos-usb.txt | 25 ++++++++++++++++++++
>> arch/arm/boot/dts/exynos5250-smdk5250.dts | 4 +++
>> arch/arm/boot/dts/exynos5250.dtsi | 6 ++++
>> arch/arm/mach-exynos/include/mach/map.h | 1 +
>> arch/arm/mach-exynos/mach-exynos5-dt.c | 2 +
>> 5 files changed, 38 insertions(+), 0 deletions(-)
>> create mode 100644 Documentation/devicetree/bindings/usb/exynos-usb.txt
>>
>> diff --git a/Documentation/devicetree/bindings/usb/exynos-usb.txt
>> b/Documentation/devicetree/bindings/usb/exynos-usb.txt
>> new file mode 100644
>> index 0000000..56e35c7
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/usb/exynos-usb.txt
>> @@ -0,0 +1,25 @@
>> +Samsung Exynos SoC USB controller
>> +
>> +The USB devices interface with USB controllers on Exynos SOCs.
>> +The device node has following properties.
>> +
>> +EHCI
>> +Required properties:
>> + - compatible: should be "samsung,exynos-ehci" for USB 2.0
>> + EHCI controller in host mode.
>> + - reg: physical base address of the controller and length of memory mapped
>> + region.
>> + - interrupts: interrupt number to the cpu.
>> +
>> +Optional properties:
>> + - samsung,vbus-gpio: if present, specifies the GPIO that
>> + needs to be pulled up for the bus to be powered.
>> +
>> +Example:
>> +
>> + ehci {
>> + compatible = "samsung,exynos-ehci";
>> + reg = <0x12110000 0x100>;
>> + interrupts = <0 71 0>;
>> + samsung,vbus-gpio = <&gpx2 6 1 3 3>;
>> + };
>> diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts
>> index a352df4..089576b 100644
>> --- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
>> +++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
>> @@ -166,4 +166,8 @@
>> spi_2: spi at 12d40000 {
>> status = "disabled";
>> };
>> +
>> + ehci {
>> + samsung,vbus-gpio = <&gpx2 6 1 3 3>;
>> + };
>> };
>> diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
>> index dddfd6e..73ea844 100644
>> --- a/arch/arm/boot/dts/exynos5250.dtsi
>> +++ b/arch/arm/boot/dts/exynos5250.dtsi
>> @@ -218,6 +218,12 @@
>> #size-cells = <0>;
>> };
>>
>> + ehci {
>> + compatible = "samsung,exynos-ehci";
>> + reg = <0x12110000 0x100>;
>> + interrupts = <0 71 0>;
>> + };
>> +
>> amba {
>> #address-cells = <1>;
>> #size-cells = <1>;
>> diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
>> index 8480849..825fe40 100644
>> --- a/arch/arm/mach-exynos/include/mach/map.h
>> +++ b/arch/arm/mach-exynos/include/mach/map.h
>> @@ -195,6 +195,7 @@
>> #define EXYNOS4_PA_EHCI 0x12580000
>> #define EXYNOS4_PA_OHCI 0x12590000
>> #define EXYNOS4_PA_HSPHY 0x125B0000
>> +#define EXYNOS5_PA_EHCI 0x12110000
>> #define EXYNOS4_PA_MFC 0x13400000
>>
>> #define EXYNOS4_PA_UART 0x13800000
>> diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c
>> index fee9dcd..6d950d7b 100644
>> --- a/arch/arm/mach-exynos/mach-exynos5-dt.c
>> +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
>> @@ -72,6 +72,8 @@ static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = {
>> "exynos-gsc.2", NULL),
>> OF_DEV_AUXDATA("samsung,exynos5-gsc", EXYNOS5_PA_GSC3,
>> "exynos-gsc.3", NULL),
>> + OF_DEV_AUXDATA("samsung,exynos-ehci", EXYNOS5_PA_EHCI,
>> + "s5p-ehci", NULL),
>> {},
>> };
>>
>> --
>> 1.7.6.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Thanks & Regards
Vivek
^ permalink raw reply
* [PATCH 2/2] ARM: Exynos5250: Enabling ohci-exynos driver
From: Vivek Gautam @ 2012-10-31 6:55 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <003901cda5f8$2a4f3980$7eedac80$%han@samsung.com>
Hi all,
On Tue, Oct 9, 2012 at 1:59 PM, Jingoo Han <jg1.han@samsung.com> wrote:
> On Friday, October 05, 2012 7:10 PM Vivek Gautam wrote
>>
>> Adding OHCI device tree node for Exynos5250 along with
>> the device base address.
>>
>> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
>
> It looks good. Also I have tested this patch with Exynos5250.
>
> Acked-by: Jingoo Han <jg1.han@samsung.com>
>
Any thought about this please.
>> ---
>> .../devicetree/bindings/usb/exynos-usb.txt | 15 +++++++++++++++
>> arch/arm/boot/dts/exynos5250.dtsi | 6 ++++++
>> arch/arm/mach-exynos/include/mach/map.h | 1 +
>> arch/arm/mach-exynos/mach-exynos5-dt.c | 2 ++
>> 4 files changed, 24 insertions(+), 0 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/usb/exynos-usb.txt
>> b/Documentation/devicetree/bindings/usb/exynos-usb.txt
>> index 56e35c7..bff10a8 100644
>> --- a/Documentation/devicetree/bindings/usb/exynos-usb.txt
>> +++ b/Documentation/devicetree/bindings/usb/exynos-usb.txt
>> @@ -23,3 +23,18 @@ Example:
>> interrupts = <0 71 0>;
>> samsung,vbus-gpio = <&gpx2 6 1 3 3>;
>> };
>> +
>> +OHCI
>> +Required properties:
>> + - compatible: should be "samsung,exynos-ohci" for USB 2.0
>> + OHCI companion controller in host mode.
>> + - reg: physical base address of the controller and length of memory mapped
>> + region.
>> + - interrupts: interrupt number to the cpu.
>> +
>> +Example:
>> + ohci {
>> + compatible = "samsung,exynos-ohci";
>> + reg = <0x12120000 0x100>;
>> + interrupts = <0 71 0>;
>> + };
>> diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
>> index 73ea844..bcdfbe2 100644
>> --- a/arch/arm/boot/dts/exynos5250.dtsi
>> +++ b/arch/arm/boot/dts/exynos5250.dtsi
>> @@ -224,6 +224,12 @@
>> interrupts = <0 71 0>;
>> };
>>
>> + ohci {
>> + compatible = "samsung,exynos-ohci";
>> + reg = <0x12120000 0x100>;
>> + interrupts = <0 71 0>;
>> + };
>> +
>> amba {
>> #address-cells = <1>;
>> #size-cells = <1>;
>> diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
>> index 825fe40..cfede1f 100644
>> --- a/arch/arm/mach-exynos/include/mach/map.h
>> +++ b/arch/arm/mach-exynos/include/mach/map.h
>> @@ -196,6 +196,7 @@
>> #define EXYNOS4_PA_OHCI 0x12590000
>> #define EXYNOS4_PA_HSPHY 0x125B0000
>> #define EXYNOS5_PA_EHCI 0x12110000
>> +#define EXYNOS5_PA_OHCI 0x12120000
>> #define EXYNOS4_PA_MFC 0x13400000
>>
>> #define EXYNOS4_PA_UART 0x13800000
>> diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c
>> index 6d950d7b..e6c2144 100644
>> --- a/arch/arm/mach-exynos/mach-exynos5-dt.c
>> +++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
>> @@ -74,6 +74,8 @@ static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = {
>> "exynos-gsc.3", NULL),
>> OF_DEV_AUXDATA("samsung,exynos-ehci", EXYNOS5_PA_EHCI,
>> "s5p-ehci", NULL),
>> + OF_DEV_AUXDATA("samsung,exynos-ohci", EXYNOS5_PA_OHCI,
>> + "exynos-ohci", NULL),
>> {},
>> };
>>
>> --
>> 1.7.6.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Thanks & Regards
Vivek
^ permalink raw reply
* [PATCH 05/13] ARM: OMAP2+: PRCM: create SoC-specific chip restart functions
From: Paul Walmsley @ 2012-10-31 6:38 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <5090C6B5.3080407@ti.com>
On Wed, 31 Oct 2012, Vaibhav Hiremath wrote:
> omap5xxx_restart declaration needs to be removed from here.
> There is no such function implemented in code.
Thanks, prototype dropped.
- Paul
^ permalink raw reply
* [PATCH 05/13] ARM: OMAP2+: PRCM: create SoC-specific chip restart functions
From: Vaibhav Hiremath @ 2012-10-31 6:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121025232116.17558.47458.stgit@dusk.lan>
On 10/26/2012 4:51 AM, Paul Walmsley wrote:
> Split omap_prcm_restart() from mach-omap2/prcm.c into SoC-specific
> variants. These functions need to be able to save the reboot reason
> into the scratchpad RAM. This implies a dependency on both the PRM
> and SCM IP blocks, so they've been moved into their own file. This
> will eventually call functions in the PRM and SCM drivers, once those
> are created.
>
> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> ---
> arch/arm/mach-omap2/Makefile | 5 +++
> arch/arm/mach-omap2/common.h | 4 ++
> arch/arm/mach-omap2/omap2-restart.c | 65 +++++++++++++++++++++++++++++++++++
> arch/arm/mach-omap2/omap3-restart.c | 36 +++++++++++++++++++
> arch/arm/mach-omap2/omap4-common.c | 16 +++++++++
> 5 files changed, 126 insertions(+)
> create mode 100644 arch/arm/mach-omap2/omap2-restart.c
> create mode 100644 arch/arm/mach-omap2/omap3-restart.c
>
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index 7a628e7..aa0f59c 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -49,6 +49,11 @@ AFLAGS_sram242x.o :=-Wa,-march=armv6
> AFLAGS_sram243x.o :=-Wa,-march=armv6
> AFLAGS_sram34xx.o :=-Wa,-march=armv7-a
>
> +# Restart code (OMAP4/5 currently in omap4-common.c)
> +obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o
> +obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o
> +obj-$(CONFIG_ARCH_OMAP3) += omap3-restart.o
> +
> # Pin multiplexing
> obj-$(CONFIG_SOC_OMAP2420) += mux2420.o
> obj-$(CONFIG_SOC_OMAP2430) += mux2430.o
> diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h
> index 320f0d7..06dff1a 100644
> --- a/arch/arm/mach-omap2/common.h
> +++ b/arch/arm/mach-omap2/common.h
> @@ -115,6 +115,10 @@ void ti81xx_init_late(void);
> void omap4430_init_late(void);
> int omap2_common_pm_late_init(void);
> void omap_prcm_restart(char, const char *);
> +void omap2xxx_restart(char, const char *);
> +void omap3xxx_restart(char, const char *);
> +void omap44xx_restart(char, const char *);
> +void omap5xxx_restart(char, const char *);
>
Paul,
omap5xxx_restart declaration needs to be removed from here.
There is no such function implemented in code.
Thanks,
Vaibhav
> /* This gets called from mach-omap2/io.c, do not call this */
> void __init omap2_set_globals_tap(u32 class, void __iomem *tap);
> diff --git a/arch/arm/mach-omap2/omap2-restart.c b/arch/arm/mach-omap2/omap2-restart.c
> new file mode 100644
> index 0000000..be6bc89
> --- /dev/null
> +++ b/arch/arm/mach-omap2/omap2-restart.c
> @@ -0,0 +1,65 @@
> +/*
> + * omap2-restart.c - code common to all OMAP2xxx machines.
> + *
> + * Copyright (C) 2012 Texas Instruments
> + * Paul Walmsley
> + *
> + * 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 <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/clk.h>
> +#include <linux/io.h>
> +
> +#include "common.h"
> +#include "prm2xxx.h"
> +
> +/*
> + * reset_virt_prcm_set_ck, reset_sys_ck: pointers to the virt_prcm_set
> + * clock and the sys_ck. Used during the reset process
> + */
> +static struct clk *reset_virt_prcm_set_ck, *reset_sys_ck;
> +
> +/* Reboot handling */
> +
> +/**
> + * omap2xxx_restart - Set DPLL to bypass mode for reboot to work
> + *
> + * Set the DPLL to bypass so that reboot completes successfully. No
> + * return value.
> + */
> +void omap2xxx_restart(char mode, const char *cmd)
> +{
> + u32 rate;
> +
> + rate = clk_get_rate(reset_sys_ck);
> + clk_set_rate(reset_virt_prcm_set_ck, rate);
> +
> + /* XXX Should save the cmd argument for use after the reboot */
> +
> + omap2xxx_prm_dpll_reset(); /* never returns */
> + while (1);
> +}
> +
> +/**
> + * omap2xxx_common_look_up_clks_for_reset - look up clocks needed for restart
> + *
> + * Some clocks need to be looked up in advance for the SoC restart
> + * operation to work - see omap2xxx_restart(). Returns -EINVAL upon
> + * error or 0 upon success.
> + */
> +static int __init omap2xxx_common_look_up_clks_for_reset(void)
> +{
> + reset_virt_prcm_set_ck = clk_get(NULL, "virt_prcm_set");
> + if (IS_ERR(reset_virt_prcm_set_ck))
> + return -EINVAL;
> +
> + reset_sys_ck = clk_get(NULL, "sys_ck");
> + if (IS_ERR(reset_sys_ck))
> + return -EINVAL;
> +
> + return 0;
> +}
> +core_initcall(omap2xxx_common_look_up_clks_for_reset);
> diff --git a/arch/arm/mach-omap2/omap3-restart.c b/arch/arm/mach-omap2/omap3-restart.c
> new file mode 100644
> index 0000000..923c582
> --- /dev/null
> +++ b/arch/arm/mach-omap2/omap3-restart.c
> @@ -0,0 +1,36 @@
> +/*
> + * omap3-restart.c - Code common to all OMAP3xxx machines.
> + *
> + * Copyright (C) 2009, 2012 Texas Instruments
> + * Copyright (C) 2010 Nokia Corporation
> + * Tony Lindgren <tony@atomide.com>
> + * Santosh Shilimkar <santosh.shilimkar@ti.com>
> + *
> + * 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 <linux/kernel.h>
> +#include <linux/init.h>
> +
> +#include "iomap.h"
> +#include "common.h"
> +#include "control.h"
> +#include "prm3xxx.h"
> +
> +/* Global address base setup code */
> +
> +/**
> + * omap3xxx_restart - trigger a software restart of the SoC
> + * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
> + * @cmd: passed from the userspace program rebooting the system (if provided)
> + *
> + * Resets the SoC. For @cmd, see the 'reboot' syscall in
> + * kernel/sys.c. No return value.
> + */
> +void omap3xxx_restart(char mode, const char *cmd)
> +{
> + omap3_ctrl_write_boot_mode((cmd ? (u8)*cmd : 0));
> + omap3xxx_prm_dpll3_reset(); /* never returns */
> + while (1);
> +}
> diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
> index 6560e99..5348788 100644
> --- a/arch/arm/mach-omap2/omap4-common.c
> +++ b/arch/arm/mach-omap2/omap4-common.c
> @@ -35,6 +35,7 @@
> #include "iomap.h"
> #include "common.h"
> #include "hsmmc.h"
> +#include "prminst44xx.h"
> #include "omap4-sar-layout.h"
>
> #ifdef CONFIG_CACHE_L2X0
> @@ -249,6 +250,21 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev)
> return 0;
> }
>
> +/**
> + * omap44xx_restart - trigger a software restart of the SoC
> + * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
> + * @cmd: passed from the userspace program rebooting the system (if provided)
> + *
> + * Resets the SoC. For @cmd, see the 'reboot' syscall in
> + * kernel/sys.c. No return value.
> + */
> +void omap44xx_restart(char mode, const char *cmd)
> +{
> + /* XXX Should save 'cmd' into scratchpad for use after reboot */
> + omap4_prminst_global_warm_sw_reset(); /* never returns */
> + while (1);
> +}
> +
> static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
> {
> struct omap_mmc_platform_data *pdata;
>
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply
* [PATCH] ARM: EXYNOS5: Remove wrongly placed usb2.0 PHY_CFG definition from PMU_REG
From: Vivek Gautam @ 2012-10-31 5:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <003b01cda5f8$f84e35c0$e8eaa140$%han@samsung.com>
Hi all,
On Tue, Oct 9, 2012 at 2:04 PM, Jingoo Han <jg1.han@samsung.com> wrote:
> On Friday, October 05, 2012 10:27 PM Vivek Gautam wrote
>>
>> EXYNOS5_USB_CFG macro should actually point to USB20PHY_CFG
>> system register (base addr + 0x230). It's wrongly placed in regs-pmu.
>> Actual register at offset 0x230 in PMU is SEQ_TRANSITION4.
>>
>> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
>
> As you mentioned, this definition is wrong.
> So, it should be removed.
>
> Reviewed-by: Jingoo Han <jg1.han@samsung.com>
>
>
>> ---
>> arch/arm/mach-exynos/include/mach/regs-pmu.h | 2 --
>> 1 files changed, 0 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/mach-exynos/include/mach/regs-pmu.h b/arch/arm/mach-exynos/include/mach/regs-pmu.h
>> index d4e392b..70b2795 100644
>> --- a/arch/arm/mach-exynos/include/mach/regs-pmu.h
>> +++ b/arch/arm/mach-exynos/include/mach/regs-pmu.h
>> @@ -230,8 +230,6 @@
>>
>> /* For EXYNOS5 */
>>
>> -#define EXYNOS5_USB_CFG S5P_PMUREG(0x0230)
>> -
Any thoughts about this please.
>> #define EXYNOS5_AUTO_WDTRESET_DISABLE S5P_PMUREG(0x0408)
>> #define EXYNOS5_MASK_WDTRESET_REQUEST S5P_PMUREG(0x040C)
>>
>> --
>> 1.7.6.5
>>
--
Thanks & Regards
Vivek
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox