* [PATCH v3] mmc: mxs-mmc: add mmc host driver for i.MX23/28
From: Arnd Bergmann @ 2011-02-22 16:15 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110222103349.GA2755@pengutronix.de>
On Tuesday 22 February 2011, Wolfram Sang wrote:
> # mount -t vfat /dev/mmcblk0p1 /mnt
> # dd if=/mnt/test.dat of=/tmp/a bs=1024
> # umount /mnt
> # ./dd --version
> dd (coreutils) 8.5
In general, you should try to rule out file system, garbage collection,
partitioning and cache effects.
With coreutils dd, a good command is
dd if=/dev/zero of=/dev/mmcblk0 bs=64K count=64 seek=256 oflag=direct
* Always write multiples of 4 MB to avoid garbage collection
* smaller block sizes may be faster, so writing 64 times 64K may
be better than writing 4 MB once, depending on the card
* don't write to the FAT area, so start writing at 16 MB into the
device.
* use direct I/O to bypass the page cache.
* read from /dev/zero instead of a disk file to avoid measuring the
wrong thing
Arnd
^ permalink raw reply
* [PATCH v2 5/5] mmc: sdhci-esdhc: enable esdhc on imx53
From: Wolfram Sang @ 2011-02-22 15:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <AANLkTimbx6=YvRHFuVkmPVYvYtwME31PxXWNHNfFsVRQ@mail.gmail.com>
> > Thanks for respinning \o/ This approach looks better to me, but CCing
> > Olof to comment on abstraction issues if he has them. Will do a deeper
> > review later this week.
>
>
> I like it! Definitely the right approach. Pushing quirks down into the
> I/O accessors is definitely the only scalable way to handle all the
> various buggy controllers out there.
>
> Acked-by: Olof Johansson <olof@lixom.net>
Glad to hear that. I do have a few issues though, will report them later
as mentioned before, it needs a bit of time.
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110222/3b2754ad/attachment.sig>
^ permalink raw reply
* [PATCH 4/6] ARM: tegra: harmony: register sdhci devices
From: Olof Johansson @ 2011-02-22 15:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <4D635EC4.2030102@compulab.co.il>
On Mon, Feb 21, 2011 at 10:59 PM, Mike Rapoport <mike@compulab.co.il> wrote:
> Hi Olof,
> Sorry for jumping late, haven't thought about the proposal below yesterday.
> I'm not objecting to applying the patch as is, we can refactor the code
> afterwards as well.
Thanks for the input. And yeah, I'd say we can refactor later when we
see how things will fit well with flat devicetrees. More below.
>> ?static void __init tegra_harmony_init(void)
>> ?{
>> ? ? ? tegra_common_init();
>> @@ -85,6 +111,10 @@ static void __init tegra_harmony_init(void)
>>
>> ? ? ? harmony_pinmux_init();
>>
>> + ? ? tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
>> + ? ? tegra_sdhci_device2.dev.platform_data = &sdhci_pdata2;
>> + ? ? tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
>> +
>
> I think that instead of copying explicit initialization of the platform_data
> member from board to board we can do something similar to what PXA does. The
> board file would have to call something like
> tegra_set_device_X_info(struct tegra_device_X_platform_data *data);
> and then static registration of platform devices in the board files can be dropped.
>
> For instance, the devices.c would have
>
> void __init tegra_register_device(struct platform_device *dev, void *data)
> {
> ? ? ? ?int ret;
>
> ? ? ? ?dev->dev.platform_data = data;
>
> ? ? ? ?ret = platform_device_register(dev);
> ? ? ? ?if (ret)
> ? ? ? ? ? ? ? ?dev_err(&dev->dev, "unable to register device: %d\n", ret);
> }
>
> void __init tegra_set_sdhci1_info(struct tegra_sdhci_platform_data *info)
> {
> ? ? ? ?tegra_register_device(&tegra_sdhci_device1, info);
> }
>
> and the board files would just call tegra_set_sdhci1_info to pass the platform
> data for the tegra_sdhci_device1 and register the device.
>
> This way we could reduce amount of copy/paste between the board files. Besides,
> if/when tegra will be using device trees, handling of the device registration in
> common place would make the transition easier.
I don't see how that reduces the amount of copy and paste
(significantly), since you still need the platform_data defined per
board so you'll need to add the calls there. Maybe a generic
"set_platform_data" hook instead of doing the pointer assignment
open-coded would be an improvement though.
I'm personally not a fan of the style where data is described as code,
i.e. where there would be a tegra_set_<dev>_info function for every
possible device out there. If anything that adds to the amount of
copy-and-paste (per device), when it could just be handled with one
common function being passed the appropriate data (i.e. like
tegra_register_device).
Anyway, I'm not looking to argue over it. :) I think we'll see when
the FDT pieces start to take shape what kind of model will work well,
and there's no reason to do premature refactoring.
-Olof
^ permalink raw reply
* [PATCH v2 5/5] mmc: sdhci-esdhc: enable esdhc on imx53
From: Olof Johansson @ 2011-02-22 15:35 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110222113222.GE2755@pengutronix.de>
Hi,
On Tue, Feb 22, 2011 at 3:32 AM, Wolfram Sang <w.sang@pengutronix.de> wrote:
> On Tue, Feb 22, 2011 at 06:13:26PM +0800, Richard Zhu wrote:
>> Fix the NO INT in the Multi-BLK IO in SD/MMC, and
>> Multi-BLK read in SDIO
>>
>> Signed-off-by: Richard Zhu <Hong-Xing.Zhu@freescale.com>
>
> Thanks for respinning \o/ This approach looks better to me, but CCing
> Olof to comment on abstraction issues if he has them. Will do a deeper
> review later this week.
I like it! Definitely the right approach. Pushing quirks down into the
I/O accessors is definitely the only scalable way to handle all the
various buggy controllers out there.
Acked-by: Olof Johansson <olof@lixom.net>
^ permalink raw reply
* [PATCH 1/6] ARM: tegra: add tegra_gpio_table and tegra_gpio_config
From: Olof Johansson @ 2011-02-22 15:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <4D63B661.6000407@ru.mvista.com>
Hi,
On Tue, Feb 22, 2011 at 5:13 AM, Sergei Shtylyov <sshtylyov@mvista.com> wrote:
>> +void __init tegra_gpio_config(struct tegra_gpio_table *table, int num);
>
> ? You don't need to annotate the declaration as __init.
D'oh. Fixed. Thanks.
-Olof
^ permalink raw reply
* [PATCH 7/7] ARM: tegra: clock: Disable clocks left on by bootloader
From: Olof Johansson @ 2011-02-22 15:30 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <AANLkTi==wykFCCjamRNh2ngEaubgeLqmZ7Mv9OsH=0cL@mail.gmail.com>
Hi,
On Tue, Feb 22, 2011 at 12:05 AM, Colin Cross <ccross@android.com> wrote:
> It doesn't need to be an early_param, I can make it a __setup.
Sounds good.
>> Also, Documentation/kernel-parameters.txt should be updated with it.
> Is it really worth adding every debug flag on every platform to
> kernel-parametes.txt? ?I could add the flag to the warning message
> instead.
It looks like most arm sub-archs haven't added theirs, so it's OK to
leave out. I'm not too bothered either way myself.
-Olof
^ permalink raw reply
* [PATCH 5/7] ARM: tegra: timer: Enable timer and rtc clocks
From: Olof Johansson @ 2011-02-22 15:28 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <AANLkTi=pJw7oTUY2jmaSB=chds0fXFaA3+jrT=y8Jpzv@mail.gmail.com>
On Tue, Feb 22, 2011 at 12:00 AM, Colin Cross <ccross@android.com> wrote:
> On Mon, Feb 21, 2011 at 9:32 PM, Olof Johansson <olof@lixom.net> wrote:
>> Hi,
>>
>>
>> On Mon, Feb 21, 2011 at 6:39 PM, Colin Cross <ccross@android.com> wrote:
>>> Enable the timer and rtc clocks to prevent them being
>>> turned off by the bootloader clock disabling code.
>>>
>>> Signed-off-by: Colin Cross <ccross@android.com>
>>> ---
>>> ?arch/arm/mach-tegra/timer.c | ? 14 ++++++++++++--
>>> ?1 files changed, 12 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
>>> index ffa6a68..31b4f56 100644
>>> --- a/arch/arm/mach-tegra/timer.c
>>> +++ b/arch/arm/mach-tegra/timer.c
>>> @@ -18,6 +18,7 @@
>>> ?*/
>>>
>>> ?#include <linux/init.h>
>>> +#include <linux/err.h>
>>> ?#include <linux/sched.h>
>>> ?#include <linux/time.h>
>>> ?#include <linux/interrupt.h>
>>> @@ -193,9 +194,20 @@ static struct irqaction tegra_timer_irq = {
>>>
>>> ?static void __init tegra_init_timer(void)
>>> ?{
>>> + ? ? ? struct clk *clk;
>>> ? ? ? ?unsigned long rate = clk_measure_input_freq();
>>> ? ? ? ?int ret;
>>>
>>> + ? ? ? clk = clk_get_sys("timer", NULL);
>>> + ? ? ? BUG_ON(IS_ERR(clk));
>>> + ? ? ? clk_enable(clk);
>>> + ? ? ? clk_put(clk);
>>> +
>>> + ? ? ? clk = clk_get_sys("rtc-tegra", NULL);
>>> + ? ? ? BUG_ON(IS_ERR(clk));
>>> + ? ? ? clk_enable(clk);
>>> + ? ? ? clk_put(clk);
>>
>> Why initialize the rtc clock here? Not all boards use it and instead
>> use the rtc on the pmic. Seems wasteful to clock it unless the driver
>> for it is probed and configured.
>
> timekeeping_suspend uses read_persistent_clock and not the RTC driver
> to track time in suspend. ?The Tegra implementation of
> read_persistent_clock reads from the internal RTC registers. ?Its a 32
> kHz clock, so it's power usage is negligible, and it is required on
> all Tegra boards.
Ah, right. A short comment to that effect near the clock enablement
would be useful, but other than that:
Acked-by: Olof Johansson <olof@lixom.net>
-Olof
^ permalink raw reply
* [PATCH v3] mmc: mxs-mmc: add mmc host driver for i.MX23/28
From: Chris Ball @ 2011-02-22 15:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298284528-14761-1-git-send-email-shawn.guo@freescale.com>
Hi Shawn,
On Mon, Feb 21, 2011 at 06:35:28PM +0800, Shawn Guo wrote:
> This adds the mmc host driver for Freescale MXS-based SoC i.MX23/28.
> The driver calls into mxs-dma via generic dmaengine api for both pio
> and data transfer.
Thanks very much, pushed to mmc-next for .39.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply
* [PATCH V2 0/5] sdhci-esdhc-imx: use gpio for write protection and card detection
From: Wolfram Sang @ 2011-02-22 15:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <87wrks5dgo.fsf@lebrac.rtp-net.org>
On Tue, Feb 22, 2011 at 03:52:07PM +0100, Arnaud Patard wrote:
> Has this been tested on imx51 ? By default (even after applying your
> patches), the sdhci has quirk SDHCI_QUIRK_BROKEN_CARD_DETECTION set, so
> we're polling.
Ouch, thanks for that. I missed to delete the above quirk from
sdhci_esdhc_imx_pdata. Can you give another try removing it?
- | SDHCI_QUIRK_BROKEN_CARD_DETECTION,
That should prevent polling. Fixed here already. Will wait for Eric's
tests and send a v3 then.
> I've been wondering if it was a good idea to configure for everyone sdhc
> host card detect pin as gpio 1 1 or gpio 1 8 on imx51, which would mean
> no more polling. What do you think ? Would it be working or it's just a
> stupid idea ?
MX51 won't need platform data. The pins can be routed to the controller,
like efika-mx51 does (judging from the source and documentation).
Regards,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110222/4df3eb02/attachment.sig>
^ permalink raw reply
* [PATCH V2 0/5] sdhci-esdhc-imx: use gpio for write protection and card detection
From: Arnaud Patard (Rtp) @ 2011-02-22 14:52 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298379500-27590-1-git-send-email-w.sang@pengutronix.de>
Wolfram Sang <w.sang@pengutronix.de> writes:
> Hi,
Hi,
>
> Second version of my series, no major changes:
>
> * rephrased warnings
> * collected some tags
> * rebased to mmc/mmc-next as of today
>
> Eric wanted to tested these patches soonish. Thanks to Marc for testing the
> first three already.
Has this been tested on imx51 ? By default (even after applying your
patches), the sdhci has quirk SDHCI_QUIRK_BROKEN_CARD_DETECTION set, so
we're polling.
I've been wondering if it was a good idea to configure for everyone sdhc
host card detect pin as gpio 1 1 or gpio 1 8 on imx51, which would mean
no more polling. What do you think ? Would it be working or it's just a
stupid idea ?
Arnaud
^ permalink raw reply
* [PATCH v2 13/13] tty: pruss SUART driver
From: Greg KH @ 2011-02-22 14:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <9826735BD9DD48A599C595D28C4A05F0@subhasishg>
On Tue, Feb 22, 2011 at 02:12:32PM +0530, Subhasish Ghosh wrote:
> Hello,
>
> I had kept separate files to affirm the modularity and ease of
> portability of the system.
>
> There are three different interfaces,
> 1. The Linux driver interface
> 2. The PRU control interface
> 3. The McASP serializer interface.
>
> To maintain modularity, I had classified the files respectively as :
> 1. pruss_suart.c
> 2. pruss_suart_api.c
> 3. pruss_suart_utils.c
>
> This is not a single device which can be expressed as a single file,
> but functionally different devices logically cascaded together to
> work in unison.
>
> We use the PRU for packet processing, but the actual data is
> transmitted/received through the
> McASP, which we use as a serializer.
>
> I feel to combine these disparate functionalities into a single file
> will not
>
> 1. Help better understanding the device. I mean, why should a TTY
> UART driver be aware of the McASP or the PRU.
> 2. In case of a bug in the API layer or McASP, the driver need not
> be touched, thus improve maintainability.
> 3. If we need to port it to another Linux version, just editing the
> driver file should suffice, this will reduce bugs while porting.
If your code is in the kernel tree, you do not need to ever port it to a
new version, as it will happen automatically as new kernels are
released, so this really isn't anything to worry about.
> To me, combining all of these into a single file only creates a
> mess. This is the reason I had separated them into different files!!
> I don't understand why should it be better to have all of these into
> a single file.
As Alan stated, just use 3 files in the directory with the other
drivers, you don't need a subdir for something small like this.
thanks,
greg k-h
^ permalink raw reply
* [PATCHv3] amba: support pm ops
From: Linus Walleij @ 2011-02-22 14:17 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298353261-22193-1-git-send-email-rabin.vincent@stericsson.com>
2011/2/22 Rabin Vincent <rabin.vincent@stericsson.com>:
> Support pm_ops in the AMBA bus, required to allow drivers to use runtime pm.
> The implementation of AMBA bus pm ops is based on the platform bus
> implementation.
>
> Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
> ---
> v3: add a missing header. don't keep an empty dev_pm_ops struct when it's
> ? ?not used.
FWIW:
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH 2/5] ARM: omap: update GPIO chained IRQ handler to use EOI in parent chip
From: Santosh Shilimkar @ 2011-02-22 14:14 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <e25ffece0a5b549a68c28ca29abb847a@mail.gmail.com>
Will,
> -----Original Message-----
> From: Santosh Shilimkar [mailto:santosh.shilimkar at ti.com]
> Sent: Tuesday, February 22, 2011 12:45 AM
> To: Will Deacon; linux-arm-kernel at lists.infradead.org
> Cc: linux at arm.linux.org.uk; adharmap at codeaurora.org; rabin at rab.in;
> tglx at linutronix.de; catalin.marinas at arm.com; ccross at google.com;
> kyungmin.park at samsung.com
> Subject: RE: [PATCH 2/5] ARM: omap: update GPIO chained IRQ handler
> to use EOI in parent chip
>
> > -----Original Message-----
> > From: Will Deacon [mailto:will.deacon at arm.com]
> > Sent: Monday, February 21, 2011 8:58 PM
> > To: linux-arm-kernel at lists.infradead.org
> > Cc: linux at arm.linux.org.uk; adharmap at codeaurora.org; rabin at rab.in;
> > tglx at linutronix.de; catalin.marinas at arm.com;
> > santosh.shilimkar at ti.com; ccross at google.com;
> > kyungmin.park at samsung.com; Will Deacon
> > Subject: [PATCH 2/5] ARM: omap: update GPIO chained IRQ handler to
> > use EOI in parent chip
> >
> > On OMAP4, gpio_irq_handler can be chained to a physical interrupt
> > using
> > the GIC as the primary IRQ chip. Now that the GIC uses the fasteoi
> > flow
> > model, the chained handler must invoke ->irq_eoi once handling is
> > complete.
> >
> > This patch adds a conditional call to ->irq_eoi in the GPIO IRQ
> > handler
> > for OMAP platforms. For OMAP implementations using other primary
> > interrupt controllers, the ->irq_ack call remains and is also made
> > conditional on the support offered by the controller.
> >
> > Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
> > Cc: Colin Cross <ccross@google.com>
> > Signed-off-by: Will Deacon <will.deacon@arm.com>
> > ---
> Thanks Will for changes. They look fine.
> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
>
> I will test your series tomorrow on OMAP with some
> GPIO interrupts.
>
Tested your series on OMAP4 SDP, where GPIO is used for
ethernet interrupts. They seems to work as expected.
For omap changes,
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Regards,
Santosh
^ permalink raw reply
* SAMSUNG: any example code for soc_camera, tv output, etc...?
From: 余谨智 @ 2011-02-22 14:00 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <9f2nkr$9lh756@out1.ip04ir2.opaltelecom.net>
> I've just gone through a lot of Samsung platform setup files in arch/arm/ , but >haven't yet found any Samsung-SoC-based boards pre-plumbed into V4L2, nor >any that connect up to a TV out (rather than to an LCD screen).
I have port a embeded linux system on my board based on EP9315, with
support for usb video capture device, V4L2. Do you need V4L2 based on
usb video capture device or other video/FM/AM controller on your
board? If conveniently, can you provide more details about your
project?
>Alternatively, please say if you know which specific file(s) I should be asking >Samsung tech support for under NDA (via my distributor's tech support).
You MUST need the datasheet of S5PC100 on your board, and other
peripheral device's datasheet, like dm9000 ethernet controller if not
integrated in SoC, and schematic diagrams of your board.
^ permalink raw reply
* [PATCH] ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic
From: Dave Martin @ 2011-02-22 13:48 UTC (permalink / raw)
To: linux-arm-kernel
Loading Thumb-2 modules into an ARM kernel or vice-versa isn't
guaranteed to work safely, since the kernel is not interworking-
aware everywhere.
This patch adds "thumb2" to the module vermagic when
CONFIG_THUMB2_KERNEL is enabled, to help avoid accidental loading
of modules into the wrong kernel.
Signed-off-by: Dave Martin <dave.martin@linaro.org>
---
arch/arm/include/asm/module.h | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
index 12c8e68..09fcaa0 100644
--- a/arch/arm/include/asm/module.h
+++ b/arch/arm/include/asm/module.h
@@ -25,8 +25,15 @@ struct mod_arch_specific {
};
/*
- * Include the ARM architecture version.
+ * Include the ARM architecture version and instruction set architecture.
*/
-#define MODULE_ARCH_VERMAGIC "ARMv" __stringify(__LINUX_ARM_ARCH__) " "
+#ifdef CONFIG_THUMB2_KERNEL
+#define ARM_ARCH_VERMAGIC_ISAFAMILY " thumb2"
+#else
+#define ARM_ARCH_VERMAGIC_ISAFAMILY ""
+#endif
+
+#define MODULE_ARCH_VERMAGIC "ARMv" __stringify(__LINUX_ARM_ARCH__) \
+ ARM_ARCH_VERMAGIC_ISAFAMILY " "
#endif /* _ASM_ARM_MODULE_H */
--
1.7.1
^ permalink raw reply related
* [PATCH v3 9/9] davinci: add spi devices support for da830/omap-l137/am17x evm
From: Michael Williamson @ 2011-02-22 13:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298381824-7723-1-git-send-email-michael.williamson@criticallink.com>
From: Sekhar Nori <nsekhar@ti.com>
This patch adds the on-board SPI flash device to the
DA830/OMAP-L137/AM17x EVM. It also registers the SPI flash
device to the MTD subsystem.
Based on SPI flash device support for MityDSP-L138F platform.
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
[michael.williamson at criticallink.com: moved da830evm_spi0_pdata to devices-da8xx.c]
Signed-off-by: Michael Williamson <michael.williamson@criticallink.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
---
arch/arm/mach-davinci/board-da830-evm.c | 80 +++++++++++++++++++++++++++++++
1 files changed, 80 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index b52a3a1..93a47e3 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -20,6 +20,8 @@
#include <linux/i2c/at24.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -30,6 +32,7 @@
#include <mach/da8xx.h>
#include <mach/usb.h>
#include <mach/aemif.h>
+#include <mach/spi.h>
#define DA830_EVM_PHY_ID ""
/*
@@ -534,6 +537,81 @@ static struct edma_rsv_info da830_edma_rsv[] = {
},
};
+static struct mtd_partition da830evm_spiflash_part[] = {
+ [0] = {
+ .name = "DSP-UBL",
+ .offset = 0,
+ .size = SZ_8K,
+ .mask_flags = MTD_WRITEABLE,
+ },
+ [1] = {
+ .name = "ARM-UBL",
+ .offset = MTDPART_OFS_APPEND,
+ .size = SZ_16K + SZ_8K,
+ .mask_flags = MTD_WRITEABLE,
+ },
+ [2] = {
+ .name = "U-Boot",
+ .offset = MTDPART_OFS_APPEND,
+ .size = SZ_256K - SZ_32K,
+ .mask_flags = MTD_WRITEABLE,
+ },
+ [3] = {
+ .name = "U-Boot-Environment",
+ .offset = MTDPART_OFS_APPEND,
+ .size = SZ_16K,
+ .mask_flags = 0,
+ },
+ [4] = {
+ .name = "Kernel",
+ .offset = MTDPART_OFS_APPEND,
+ .size = MTDPART_SIZ_FULL,
+ .mask_flags = 0,
+ },
+};
+
+static struct flash_platform_data da830evm_spiflash_data = {
+ .name = "m25p80",
+ .parts = da830evm_spiflash_part,
+ .nr_parts = ARRAY_SIZE(da830evm_spiflash_part),
+ .type = "w25x32",
+};
+
+static struct davinci_spi_config da830evm_spiflash_cfg = {
+ .io_type = SPI_IO_TYPE_DMA,
+ .c2tdelay = 8,
+ .t2cdelay = 8,
+};
+
+static struct spi_board_info da830evm_spi_info[] = {
+ {
+ .modalias = "m25p80",
+ .platform_data = &da830evm_spiflash_data,
+ .controller_data = &da830evm_spiflash_cfg,
+ .mode = SPI_MODE_0,
+ .max_speed_hz = 30000000,
+ .bus_num = 0,
+ .chip_select = 0,
+ },
+};
+
+static void __init da830evm_init_spi0(struct spi_board_info *info, unsigned len)
+{
+ int ret;
+
+ ret = spi_register_board_info(info, len);
+ if (ret)
+ pr_warning("%s: failed to register board info : %d\n",
+ __func__, ret);
+
+ da8xx_spi_pdata[0].num_chipselect = len;
+
+ ret = da8xx_register_spi(0);
+ if (ret)
+ pr_warning("%s: failed to register spi 0 device : %d\n",
+ __func__, ret);
+}
+
static __init void da830_evm_init(void)
{
struct davinci_soc_info *soc_info = &davinci_soc_info;
@@ -590,6 +668,8 @@ static __init void da830_evm_init(void)
ret = da8xx_register_rtc();
if (ret)
pr_warning("da830_evm_init: rtc setup failed: %d\n", ret);
+
+ da830evm_init_spi0(da830evm_spi_info, ARRAY_SIZE(da830evm_spi_info));
}
#ifdef CONFIG_SERIAL_8250_CONSOLE
--
1.7.0.4
^ permalink raw reply related
* [PATCH v3 8/9] davinci: add spi devices support for da850/omap-l138/am18x evm
From: Michael Williamson @ 2011-02-22 13:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298381824-7723-1-git-send-email-michael.williamson@criticallink.com>
From: Sekhar Nori <nsekhar@ti.com>
This patch adds the on-board SPI flash device to the
DA850/OMAP-L138/AM18x EVM. It also registers the SPI flash
device to the MTD subsystem.
Based on SPI flash device support for MityDSP-L138F platform.
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
[michael.williamson at criticallink.com: moved da850_evm_spi1_pdata to devices-da8xx.c]
Signed-off-by: Michael Williamson <michael.williamson@criticallink.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
---
arch/arm/mach-davinci/board-da850-evm.c | 86 +++++++++++++++++++++++++++++++
1 files changed, 86 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 11f986b..ee2094f 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -29,6 +29,8 @@
#include <linux/regulator/machine.h>
#include <linux/regulator/tps6507x.h>
#include <linux/input/tps6507x-ts.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -38,6 +40,7 @@
#include <mach/nand.h>
#include <mach/mux.h>
#include <mach/aemif.h>
+#include <mach/spi.h>
#define DA850_EVM_PHY_ID "0:00"
#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)
@@ -48,6 +51,87 @@
#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6)
+static struct mtd_partition da850evm_spiflash_part[] = {
+ [0] = {
+ .name = "UBL",
+ .offset = 0,
+ .size = SZ_64K,
+ .mask_flags = MTD_WRITEABLE,
+ },
+ [1] = {
+ .name = "U-Boot",
+ .offset = MTDPART_OFS_APPEND,
+ .size = SZ_512K,
+ .mask_flags = MTD_WRITEABLE,
+ },
+ [2] = {
+ .name = "U-Boot-Env",
+ .offset = MTDPART_OFS_APPEND,
+ .size = SZ_64K,
+ .mask_flags = MTD_WRITEABLE,
+ },
+ [3] = {
+ .name = "Kernel",
+ .offset = MTDPART_OFS_APPEND,
+ .size = SZ_2M + SZ_512K,
+ .mask_flags = 0,
+ },
+ [4] = {
+ .name = "Filesystem",
+ .offset = MTDPART_OFS_APPEND,
+ .size = SZ_4M,
+ .mask_flags = 0,
+ },
+ [5] = {
+ .name = "MAC-Address",
+ .offset = SZ_8M - SZ_64K,
+ .size = SZ_64K,
+ .mask_flags = MTD_WRITEABLE,
+ },
+};
+
+static struct flash_platform_data da850evm_spiflash_data = {
+ .name = "m25p80",
+ .parts = da850evm_spiflash_part,
+ .nr_parts = ARRAY_SIZE(da850evm_spiflash_part),
+ .type = "m25p64",
+};
+
+static struct davinci_spi_config da850evm_spiflash_cfg = {
+ .io_type = SPI_IO_TYPE_DMA,
+ .c2tdelay = 8,
+ .t2cdelay = 8,
+};
+
+static struct spi_board_info da850evm_spi_info[] = {
+ {
+ .modalias = "m25p80",
+ .platform_data = &da850evm_spiflash_data,
+ .controller_data = &da850evm_spiflash_cfg,
+ .mode = SPI_MODE_0,
+ .max_speed_hz = 30000000,
+ .bus_num = 1,
+ .chip_select = 0,
+ },
+};
+
+static void __init da850evm_init_spi1(struct spi_board_info *info, unsigned len)
+{
+ int ret;
+
+ ret = spi_register_board_info(info, len);
+ if (ret)
+ pr_warning("%s: failed to register board info : %d\n",
+ __func__, ret);
+
+ da8xx_spi_pdata[1].num_chipselect = len;
+
+ ret = da8xx_register_spi(1);
+ if (ret)
+ pr_warning("%s: failed to register spi 1 device : %d\n",
+ __func__, ret);
+}
+
static struct mtd_partition da850_evm_norflash_partition[] = {
{
.name = "bootloaders + env",
@@ -1167,6 +1251,8 @@ static __init void da850_evm_init(void)
if (ret)
pr_warning("da850_evm_init: suspend registration failed: %d\n",
ret);
+
+ da850evm_init_spi1(da850evm_spi_info, ARRAY_SIZE(da850evm_spi_info));
}
#ifdef CONFIG_SERIAL_8250_CONSOLE
--
1.7.0.4
^ permalink raw reply related
* [PATCH v3 7/9] davinci: add spi devices support for MityDSP-L138/MityARM-1808 platform
From: Michael Williamson @ 2011-02-22 13:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298381824-7723-1-git-send-email-michael.williamson@criticallink.com>
This patch adds support for accessing the on board SPI NOR FLASH
device for MityDSP-L138 and MityARM-1808 SoMs.
Signed-off-by: Michael Williamson <michael.williamson@criticallink.com>
Tested-by: Michael Williamson <michael.williamson@criticallink.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
---
arch/arm/mach-davinci/board-mityomapl138.c | 100 ++++++++++++++++++++++++++++
1 files changed, 100 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index 0ea5932..dc4c3f1 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -17,6 +17,8 @@
#include <linux/i2c.h>
#include <linux/i2c/at24.h>
#include <linux/etherdevice.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/flash.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -25,6 +27,7 @@
#include <mach/da8xx.h>
#include <mach/nand.h>
#include <mach/mux.h>
+#include <mach/spi.h>
#define MITYOMAPL138_PHY_ID "0:03"
@@ -294,6 +297,100 @@ static int __init pmic_tps65023_init(void)
}
/*
+ * SPI Devices:
+ * SPI1_CS0: 8M Flash ST-M25P64-VME6G
+ */
+static struct mtd_partition spi_flash_partitions[] = {
+ [0] = {
+ .name = "ubl",
+ .offset = 0,
+ .size = SZ_64K,
+ .mask_flags = MTD_WRITEABLE,
+ },
+ [1] = {
+ .name = "u-boot",
+ .offset = MTDPART_OFS_APPEND,
+ .size = SZ_512K,
+ .mask_flags = MTD_WRITEABLE,
+ },
+ [2] = {
+ .name = "u-boot-env",
+ .offset = MTDPART_OFS_APPEND,
+ .size = SZ_64K,
+ .mask_flags = MTD_WRITEABLE,
+ },
+ [3] = {
+ .name = "periph-config",
+ .offset = MTDPART_OFS_APPEND,
+ .size = SZ_64K,
+ .mask_flags = MTD_WRITEABLE,
+ },
+ [4] = {
+ .name = "reserved",
+ .offset = MTDPART_OFS_APPEND,
+ .size = SZ_256K + SZ_64K,
+ },
+ [5] = {
+ .name = "kernel",
+ .offset = MTDPART_OFS_APPEND,
+ .size = SZ_2M + SZ_1M,
+ },
+ [6] = {
+ .name = "fpga",
+ .offset = MTDPART_OFS_APPEND,
+ .size = SZ_2M,
+ },
+ [7] = {
+ .name = "spare",
+ .offset = MTDPART_OFS_APPEND,
+ .size = MTDPART_SIZ_FULL,
+ },
+};
+
+static struct flash_platform_data mityomapl138_spi_flash_data = {
+ .name = "m25p80",
+ .parts = spi_flash_partitions,
+ .nr_parts = ARRAY_SIZE(spi_flash_partitions),
+ .type = "m24p64",
+};
+
+static struct davinci_spi_config spi_eprom_config = {
+ .io_type = SPI_IO_TYPE_DMA,
+ .c2tdelay = 8,
+ .t2cdelay = 8,
+};
+
+static struct spi_board_info mityomapl138_spi_flash_info[] = {
+ {
+ .modalias = "m25p80",
+ .platform_data = &mityomapl138_spi_flash_data,
+ .controller_data = &spi_eprom_config,
+ .mode = SPI_MODE_0,
+ .max_speed_hz = 30000000,
+ .bus_num = 1,
+ .chip_select = 0,
+ },
+};
+
+static void __init mityomapl138_init_spi1(struct spi_board_info *info,
+ unsigned len)
+{
+ int ret;
+
+ ret = spi_register_board_info(info, len);
+ if (ret)
+ pr_warning("%s: failed to register board info : %d\n",
+ __func__, ret);
+
+ da8xx_spi_pdata[1].num_chipselect = len;
+
+ ret = da8xx_register_spi(1);
+ if (ret)
+ pr_warning("%s: failed to register spi 1 device : %d\n",
+ __func__, ret);
+}
+
+/*
* MityDSP-L138 includes a 256 MByte large-page NAND flash
* (128K blocks).
*/
@@ -448,6 +545,9 @@ static void __init mityomapl138_init(void)
mityomapl138_setup_nand();
+ mityomapl138_init_spi1(mityomapl138_spi_flash_info,
+ ARRAY_SIZE(mityomapl138_spi_flash_info));
+
mityomapl138_config_emac();
ret = da8xx_register_rtc();
--
1.7.0.4
^ permalink raw reply related
* [PATCH v3 6/9] davinci: da8xx: add spi resources and registration routine
From: Michael Williamson @ 2011-02-22 13:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298381824-7723-1-git-send-email-michael.williamson@criticallink.com>
Add IO resource structures, platform data, and a registration
routine in order to support spi device on DA850/OMAP-L138/AM18x
and DA830/OMAP-L137/AM17x platforms.
Signed-off-by: Michael Williamson <michael.williamson@criticallink.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
---
arch/arm/mach-davinci/devices-da8xx.c | 98 ++++++++++++++++++++++++++++
arch/arm/mach-davinci/include/mach/da8xx.h | 3 +
2 files changed, 101 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 119d46e..3a6e4fd 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -38,14 +38,20 @@
#define DA8XX_EMAC_MDIO_BASE 0x01e24000
#define DA8XX_GPIO_BASE 0x01e26000
#define DA8XX_I2C1_BASE 0x01e28000
+#define DA8XX_SPI0_BASE 0x01c41000
+#define DA8XX_SPI1_BASE 0x01f0e000
#define DA8XX_EMAC_CTRL_REG_OFFSET 0x3000
#define DA8XX_EMAC_MOD_REG_OFFSET 0x2000
#define DA8XX_EMAC_RAM_OFFSET 0x0000
#define DA8XX_EMAC_CTRL_RAM_SIZE SZ_8K
+#define DA8XX_DMA_SPI0_RX EDMA_CTLR_CHAN(0, 14)
+#define DA8XX_DMA_SPI0_TX EDMA_CTLR_CHAN(0, 15)
#define DA8XX_DMA_MMCSD0_RX EDMA_CTLR_CHAN(0, 16)
#define DA8XX_DMA_MMCSD0_TX EDMA_CTLR_CHAN(0, 17)
+#define DA8XX_DMA_SPI1_RX EDMA_CTLR_CHAN(0, 18)
+#define DA8XX_DMA_SPI1_TX EDMA_CTLR_CHAN(0, 19)
#define DA850_DMA_MMCSD1_RX EDMA_CTLR_CHAN(1, 28)
#define DA850_DMA_MMCSD1_TX EDMA_CTLR_CHAN(1, 29)
@@ -730,3 +736,95 @@ int __init da8xx_register_cpuidle(void)
return platform_device_register(&da8xx_cpuidle_device);
}
+
+static struct resource da8xx_spi0_resources[] = {
+ [0] = {
+ .start = DA8XX_SPI0_BASE,
+ .end = DA8XX_SPI0_BASE + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = IRQ_DA8XX_SPINT0,
+ .end = IRQ_DA8XX_SPINT0,
+ .flags = IORESOURCE_IRQ,
+ },
+ [2] = {
+ .start = DA8XX_DMA_SPI0_RX,
+ .end = DA8XX_DMA_SPI0_RX,
+ .flags = IORESOURCE_DMA,
+ },
+ [3] = {
+ .start = DA8XX_DMA_SPI0_TX,
+ .end = DA8XX_DMA_SPI0_TX,
+ .flags = IORESOURCE_DMA,
+ },
+};
+
+static struct resource da8xx_spi1_resources[] = {
+ [0] = {
+ .start = DA8XX_SPI1_BASE,
+ .end = DA8XX_SPI1_BASE + SZ_4K - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = IRQ_DA8XX_SPINT1,
+ .end = IRQ_DA8XX_SPINT1,
+ .flags = IORESOURCE_IRQ,
+ },
+ [2] = {
+ .start = DA8XX_DMA_SPI1_RX,
+ .end = DA8XX_DMA_SPI1_RX,
+ .flags = IORESOURCE_DMA,
+ },
+ [3] = {
+ .start = DA8XX_DMA_SPI1_TX,
+ .end = DA8XX_DMA_SPI1_TX,
+ .flags = IORESOURCE_DMA,
+ },
+};
+
+struct davinci_spi_platform_data da8xx_spi_pdata[] = {
+ [0] = {
+ .version = SPI_VERSION_2,
+ .intr_line = 1,
+ .dma_event_q = EVENTQ_0,
+ },
+ [1] = {
+ .version = SPI_VERSION_2,
+ .intr_line = 1,
+ .dma_event_q = EVENTQ_0,
+ },
+};
+
+static struct platform_device da8xx_spi_device[] = {
+ [0] = {
+ .name = "spi_davinci",
+ .id = 0,
+ .num_resources = ARRAY_SIZE(da8xx_spi0_resources),
+ .resource = da8xx_spi0_resources,
+ .dev = {
+ .platform_data = &da8xx_spi_pdata[0],
+ },
+ },
+ [1] = {
+ .name = "spi_davinci",
+ .id = 1,
+ .num_resources = ARRAY_SIZE(da8xx_spi1_resources),
+ .resource = da8xx_spi1_resources,
+ .dev = {
+ .platform_data = &da8xx_spi_pdata[1],
+ },
+ },
+};
+
+int __init da8xx_register_spi(int instance)
+{
+ struct platform_device *pdev;
+
+ if (instance == 0 || instance == 1)
+ pdev = &da8xx_spi_device[instance];
+ else
+ return -EINVAL;
+
+ return platform_device_register(pdev);
+}
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index cfcb223..0c5fa01 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -23,6 +23,7 @@
#include <mach/mmc.h>
#include <mach/usb.h>
#include <mach/pm.h>
+#include <mach/spi.h>
extern void __iomem *da8xx_syscfg0_base;
extern void __iomem *da8xx_syscfg1_base;
@@ -77,6 +78,7 @@ void __init da850_init(void);
int da830_register_edma(struct edma_rsv_info *rsv);
int da850_register_edma(struct edma_rsv_info *rsv[2]);
int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata);
+int da8xx_register_spi(int instance);
int da8xx_register_watchdog(void);
int da8xx_register_usb20(unsigned mA, unsigned potpgt);
int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata);
@@ -95,6 +97,7 @@ extern struct platform_device da8xx_serial_device;
extern struct emac_platform_data da8xx_emac_pdata;
extern struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata;
extern struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata;
+extern struct davinci_spi_platform_data da8xx_spi_pdata[];
extern struct platform_device da8xx_wdt_device;
--
1.7.0.4
^ permalink raw reply related
* [PATCH v3 5/9] davinci: da850: add spi device clock definitions
From: Michael Williamson @ 2011-02-22 13:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298381824-7723-1-git-send-email-michael.williamson@criticallink.com>
Add spi clock information for da850.
Signed-off-by: Michael Williamson <michael.williamson@criticallink.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
---
arch/arm/mach-davinci/da850.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-davinci/da850.c b/arch/arm/mach-davinci/da850.c
index 3443d97..68fe4c2 100644
--- a/arch/arm/mach-davinci/da850.c
+++ b/arch/arm/mach-davinci/da850.c
@@ -359,6 +359,20 @@ static struct clk usb20_clk = {
.gpsc = 1,
};
+static struct clk spi0_clk = {
+ .name = "spi0",
+ .parent = &pll0_sysclk2,
+ .lpsc = DA8XX_LPSC0_SPI0,
+};
+
+static struct clk spi1_clk = {
+ .name = "spi1",
+ .parent = &pll0_sysclk2,
+ .lpsc = DA8XX_LPSC1_SPI1,
+ .gpsc = 1,
+ .flags = DA850_CLK_ASYNC3,
+};
+
static struct clk_lookup da850_clks[] = {
CLK(NULL, "ref", &ref_clk),
CLK(NULL, "pll0", &pll0_clk),
@@ -403,6 +417,8 @@ static struct clk_lookup da850_clks[] = {
CLK(NULL, "aemif", &aemif_clk),
CLK(NULL, "usb11", &usb11_clk),
CLK(NULL, "usb20", &usb20_clk),
+ CLK("spi_davinci.0", NULL, &spi0_clk),
+ CLK("spi_davinci.1", NULL, &spi1_clk),
CLK(NULL, NULL, NULL),
};
--
1.7.0.4
^ permalink raw reply related
* [PATCH v3 4/9] davinci: da830: fix driver name for spi clocks
From: Michael Williamson @ 2011-02-22 13:36 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298381824-7723-1-git-send-email-michael.williamson@criticallink.com>
The spi driver name called out for the da830 spi clock list is not correct,
fix it.
Signed-off-by: Michael Williamson <michael.williamson@criticallink.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
---
arch/arm/mach-davinci/da830.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-davinci/da830.c b/arch/arm/mach-davinci/da830.c
index ec23ab4..826118e 100644
--- a/arch/arm/mach-davinci/da830.c
+++ b/arch/arm/mach-davinci/da830.c
@@ -397,8 +397,8 @@ static struct clk_lookup da830_clks[] = {
CLK(NULL, "uart0", &uart0_clk),
CLK(NULL, "uart1", &uart1_clk),
CLK(NULL, "uart2", &uart2_clk),
- CLK("dm_spi.0", NULL, &spi0_clk),
- CLK("dm_spi.1", NULL, &spi1_clk),
+ CLK("spi_davinci.0", NULL, &spi0_clk),
+ CLK("spi_davinci.1", NULL, &spi1_clk),
CLK(NULL, "ecap0", &ecap0_clk),
CLK(NULL, "ecap1", &ecap1_clk),
CLK(NULL, "ecap2", &ecap2_clk),
--
1.7.0.4
^ permalink raw reply related
* [PATCH v3 3/9] davinci: spi: move event queue parameter to platform data
From: Michael Williamson @ 2011-02-22 13:36 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298381824-7723-1-git-send-email-michael.williamson@criticallink.com>
For DMA operation, the davinci spi driver needs an event queue number.
Currently, this number is passed as a IORESOURCE_DMA. This is not
correct, as the event queue is not a DMA channel. Pass the event queue
via the platform data structure instead.
On dm355 and dm365, move the eventq assignment for spi0 out of resources
array and into platform data.
Signed-off-by: Michael Williamson <michael.williamson@criticallink.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Sekhar Nori <nsekhar@ti.com>
---
arch/arm/mach-davinci/dm355.c | 5 +----
arch/arm/mach-davinci/dm365.c | 5 +----
arch/arm/mach-davinci/include/mach/spi.h | 15 ++++++++++-----
drivers/spi/davinci_spi.c | 11 +++--------
4 files changed, 15 insertions(+), 21 deletions(-)
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index a5f8a80..76364d1 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -403,16 +403,13 @@ static struct resource dm355_spi0_resources[] = {
.start = 16,
.flags = IORESOURCE_DMA,
},
- {
- .start = EVENTQ_1,
- .flags = IORESOURCE_DMA,
- },
};
static struct davinci_spi_platform_data dm355_spi0_pdata = {
.version = SPI_VERSION_1,
.num_chipselect = 2,
.cshold_bug = true,
+ .dma_event_q = EVENTQ_1,
};
static struct platform_device dm355_spi0_device = {
.name = "spi_davinci",
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index 02d2cc3..4604e72 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -625,6 +625,7 @@ static u64 dm365_spi0_dma_mask = DMA_BIT_MASK(32);
static struct davinci_spi_platform_data dm365_spi0_pdata = {
.version = SPI_VERSION_1,
.num_chipselect = 2,
+ .dma_event_q = EVENTQ_3,
};
static struct resource dm365_spi0_resources[] = {
@@ -645,10 +646,6 @@ static struct resource dm365_spi0_resources[] = {
.start = 16,
.flags = IORESOURCE_DMA,
},
- {
- .start = EVENTQ_3,
- .flags = IORESOURCE_DMA,
- },
};
static struct platform_device dm365_spi0_device = {
diff --git a/arch/arm/mach-davinci/include/mach/spi.h b/arch/arm/mach-davinci/include/mach/spi.h
index 38f4da5..7af305b 100644
--- a/arch/arm/mach-davinci/include/mach/spi.h
+++ b/arch/arm/mach-davinci/include/mach/spi.h
@@ -19,6 +19,8 @@
#ifndef __ARCH_ARM_DAVINCI_SPI_H
#define __ARCH_ARM_DAVINCI_SPI_H
+#include <mach/edma.h>
+
#define SPI_INTERN_CS 0xFF
enum {
@@ -39,13 +41,16 @@ enum {
* to populate if all chip-selects are internal.
* @cshold_bug: set this to true if the SPI controller on your chip requires
* a write to CSHOLD bit in between transfers (like in DM355).
+ * @dma_event_q: DMA event queue to use if SPI_IO_TYPE_DMA is used for any
+ * device on the bus.
*/
struct davinci_spi_platform_data {
- u8 version;
- u8 num_chipselect;
- u8 intr_line;
- u8 *chip_sel;
- bool cshold_bug;
+ u8 version;
+ u8 num_chipselect;
+ u8 intr_line;
+ u8 *chip_sel;
+ bool cshold_bug;
+ enum dma_event_q dma_event_q;
};
/**
diff --git a/drivers/spi/davinci_spi.c b/drivers/spi/davinci_spi.c
index 6beab99..166a879 100644
--- a/drivers/spi/davinci_spi.c
+++ b/drivers/spi/davinci_spi.c
@@ -790,7 +790,6 @@ static int davinci_spi_probe(struct platform_device *pdev)
struct resource *r, *mem;
resource_size_t dma_rx_chan = SPI_NO_RESOURCE;
resource_size_t dma_tx_chan = SPI_NO_RESOURCE;
- resource_size_t dma_eventq = SPI_NO_RESOURCE;
int i = 0, ret = 0;
u32 spipc0;
@@ -878,17 +877,13 @@ static int davinci_spi_probe(struct platform_device *pdev)
r = platform_get_resource(pdev, IORESOURCE_DMA, 1);
if (r)
dma_tx_chan = r->start;
- r = platform_get_resource(pdev, IORESOURCE_DMA, 2);
- if (r)
- dma_eventq = r->start;
dspi->bitbang.txrx_bufs = davinci_spi_bufs;
if (dma_rx_chan != SPI_NO_RESOURCE &&
- dma_tx_chan != SPI_NO_RESOURCE &&
- dma_eventq != SPI_NO_RESOURCE) {
+ dma_tx_chan != SPI_NO_RESOURCE) {
dspi->dma.rx_channel = dma_rx_chan;
dspi->dma.tx_channel = dma_tx_chan;
- dspi->dma.eventq = dma_eventq;
+ dspi->dma.eventq = pdata->dma_event_q;
ret = davinci_spi_request_dma(dspi);
if (ret)
@@ -897,7 +892,7 @@ static int davinci_spi_probe(struct platform_device *pdev)
dev_info(&pdev->dev, "DMA: supported\n");
dev_info(&pdev->dev, "DMA: RX channel: %d, TX channel: %d, "
"event queue: %d\n", dma_rx_chan, dma_tx_chan,
- dma_eventq);
+ pdata->dma_event_q);
}
dspi->get_rx = davinci_spi_rx_buf_u8;
--
1.7.0.4
^ permalink raw reply related
* [PATCH v3 2/9] davinci: da8xx: clean up magic numbers in devices-da8xx.c
From: Michael Williamson @ 2011-02-22 13:36 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298381824-7723-1-git-send-email-michael.williamson@criticallink.com>
Extract magic numbers from DMA resource initializers to #defines.
Signed-off-by: Michael Williamson <michael.williamson@criticallink.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
---
arch/arm/mach-davinci/devices-da8xx.c | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index beda8a4..119d46e 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -44,6 +44,11 @@
#define DA8XX_EMAC_RAM_OFFSET 0x0000
#define DA8XX_EMAC_CTRL_RAM_SIZE SZ_8K
+#define DA8XX_DMA_MMCSD0_RX EDMA_CTLR_CHAN(0, 16)
+#define DA8XX_DMA_MMCSD0_TX EDMA_CTLR_CHAN(0, 17)
+#define DA850_DMA_MMCSD1_RX EDMA_CTLR_CHAN(1, 28)
+#define DA850_DMA_MMCSD1_TX EDMA_CTLR_CHAN(1, 29)
+
void __iomem *da8xx_syscfg0_base;
void __iomem *da8xx_syscfg1_base;
@@ -573,13 +578,13 @@ static struct resource da8xx_mmcsd0_resources[] = {
.flags = IORESOURCE_IRQ,
},
{ /* DMA RX */
- .start = EDMA_CTLR_CHAN(0, 16),
- .end = EDMA_CTLR_CHAN(0, 16),
+ .start = DA8XX_DMA_MMCSD0_RX,
+ .end = DA8XX_DMA_MMCSD0_RX,
.flags = IORESOURCE_DMA,
},
{ /* DMA TX */
- .start = EDMA_CTLR_CHAN(0, 17),
- .end = EDMA_CTLR_CHAN(0, 17),
+ .start = DA8XX_DMA_MMCSD0_TX,
+ .end = DA8XX_DMA_MMCSD0_TX,
.flags = IORESOURCE_DMA,
},
};
@@ -610,13 +615,13 @@ static struct resource da850_mmcsd1_resources[] = {
.flags = IORESOURCE_IRQ,
},
{ /* DMA RX */
- .start = EDMA_CTLR_CHAN(1, 28),
- .end = EDMA_CTLR_CHAN(1, 28),
+ .start = DA850_DMA_MMCSD1_RX,
+ .end = DA850_DMA_MMCSD1_RX,
.flags = IORESOURCE_DMA,
},
{ /* DMA TX */
- .start = EDMA_CTLR_CHAN(1, 29),
- .end = EDMA_CTLR_CHAN(1, 29),
+ .start = DA850_DMA_MMCSD1_TX,
+ .end = DA850_DMA_MMCSD1_TX,
.flags = IORESOURCE_DMA,
},
};
--
1.7.0.4
^ permalink raw reply related
* [PATCH v3 1/9] davinci: remove unused DA830_edma_ch enum
From: Michael Williamson @ 2011-02-22 13:36 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1298381824-7723-1-git-send-email-michael.williamson@criticallink.com>
The DA830_edma_ch enum set is not used. Remove it.
Signed-off-by: Michael Williamson <michael.williamson@criticallink.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
---
arch/arm/mach-davinci/include/mach/edma.h | 36 -----------------------------
1 files changed, 0 insertions(+), 36 deletions(-)
diff --git a/arch/arm/mach-davinci/include/mach/edma.h b/arch/arm/mach-davinci/include/mach/edma.h
index dc10ef6..20c77f2 100644
--- a/arch/arm/mach-davinci/include/mach/edma.h
+++ b/arch/arm/mach-davinci/include/mach/edma.h
@@ -151,42 +151,6 @@ struct edmacc_param {
#define DA830_DMACH2EVENT_MAP1 0x00000000u
#define DA830_EDMA_ARM_OWN 0x30FFCCFFu
-/* DA830 specific EDMA3 Events Information */
-enum DA830_edma_ch {
- DA830_DMACH_MCASP0_RX,
- DA830_DMACH_MCASP0_TX,
- DA830_DMACH_MCASP1_RX,
- DA830_DMACH_MCASP1_TX,
- DA830_DMACH_MCASP2_RX,
- DA830_DMACH_MCASP2_TX,
- DA830_DMACH_GPIO_BNK0INT,
- DA830_DMACH_GPIO_BNK1INT,
- DA830_DMACH_UART0_RX,
- DA830_DMACH_UART0_TX,
- DA830_DMACH_TMR64P0_EVTOUT12,
- DA830_DMACH_TMR64P0_EVTOUT34,
- DA830_DMACH_UART1_RX,
- DA830_DMACH_UART1_TX,
- DA830_DMACH_SPI0_RX,
- DA830_DMACH_SPI0_TX,
- DA830_DMACH_MMCSD_RX,
- DA830_DMACH_MMCSD_TX,
- DA830_DMACH_SPI1_RX,
- DA830_DMACH_SPI1_TX,
- DA830_DMACH_DMAX_EVTOUT6,
- DA830_DMACH_DMAX_EVTOUT7,
- DA830_DMACH_GPIO_BNK2INT,
- DA830_DMACH_GPIO_BNK3INT,
- DA830_DMACH_I2C0_RX,
- DA830_DMACH_I2C0_TX,
- DA830_DMACH_I2C1_RX,
- DA830_DMACH_I2C1_TX,
- DA830_DMACH_GPIO_BNK4INT,
- DA830_DMACH_GPIO_BNK5INT,
- DA830_DMACH_UART2_RX,
- DA830_DMACH_UART2_TX
-};
-
/*ch_status paramater of callback function possible values*/
#define DMA_COMPLETE 1
#define DMA_CC_ERROR 2
--
1.7.0.4
^ permalink raw reply related
* [PATCH v3 0/9] davinci: Add spi support for da8xx platforms
From: Michael Williamson @ 2011-02-22 13:36 UTC (permalink / raw)
To: linux-arm-kernel
This patch series adds the necessary SPI resources and registration
routines for da850/OMAP-L138/AM18x and da830/OMAP-L137/AM17x devices.
It removes some unused enumerations related to the DMA channels
for the da830 platform as a result of initial reviews of the patch
series.
It moves the event queue number for the SPI DMA control out of
the resources array and into the platform data structure passed to
the davinci spi driver.
It adds on-board SPI FLASH devices for the da830 evm, the da850
evm, and the MityDSP-L138/MityARM-1808 platforms.
These patches are based on work done during testing of davinci SPI driver
submissions incorporated in version 2.6.38 of the kernel, at [1].
This patch series has been tested using a MityDSP-L138 platform,
and the da850 and da830 EVMs.
The patch series is against linux-davinci tree. The davinci spi driver
portion of this patch has been reviewed by the spi list and Acked
by Grant with the agreement to submit through linux-davinci tree.
[1] http://arago-project.org/git/projects/?p=linux-davinci.git;a=shortlog;h=refs/heads/davinci-spi-rewrite
---
Changes since v2:
- combined previously approved / Acked patches into this
patch series per request from maintainer.
- fixed whitespace issue identified by checkpatch
- added function name for warning tracing per comments
Michael Williamson (7):
davinci: remove unused DA830_edma_ch enum
davinci: da8xx: clean up magic numbers in devices-da8xx.c
davinci: spi: move event queue parameter to platform data
davinci: da830: fix driver name for spi clocks
davinci: da850: add spi device clock definitions
davinci: da8xx: add spi resources and registration routine
davinci: add spi devices support for MityDSP-L138/MityARM-1808
platform
Sekhar Nori (2):
davinci: add spi devices support for da850/omap-l138/am18x evm
davinci: add spi devices support for da830/omap-l137/am17x evm
arch/arm/mach-davinci/board-da830-evm.c | 80 +++++++++++++++++++
arch/arm/mach-davinci/board-da850-evm.c | 86 ++++++++++++++++++++
arch/arm/mach-davinci/board-mityomapl138.c | 100 +++++++++++++++++++++++
arch/arm/mach-davinci/da830.c | 4 +-
arch/arm/mach-davinci/da850.c | 16 ++++
arch/arm/mach-davinci/devices-da8xx.c | 119 ++++++++++++++++++++++++++--
arch/arm/mach-davinci/dm355.c | 5 +-
arch/arm/mach-davinci/dm365.c | 5 +-
arch/arm/mach-davinci/include/mach/da8xx.h | 3 +
arch/arm/mach-davinci/include/mach/edma.h | 36 ---------
arch/arm/mach-davinci/include/mach/spi.h | 15 +++-
drivers/spi/davinci_spi.c | 11 +--
12 files changed, 413 insertions(+), 67 deletions(-)
^ 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