aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers (follow)
AgeCommit message (Collapse)AuthorFilesLines
2009-04-16sh: export board_pci_channels in one placeMagnus Damm8-8/+2
Instead of sometimes exporting board_pci_channels[] in the board specific code just export it in one place. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16sh: pci io port base address codeMagnus Damm1-1/+0
Adds a __get_pci_io_base() function which is used to match a port range against struct pci_channel. This allows us to detect if a port range is assigned to pci or happens to be legacy port io. While at it, remove unused cpu-specific cruft. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16sh: pci memory range checking codeMagnus Damm1-3/+2
This patch changes the code to use __is_pci_memory() instead of is_pci_memaddr(). __is_pci_memory() loops through all the pci channels on the system to match memory windows. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16sh: add io_base member to pci_channelMagnus Damm2-4/+6
Store the io window base address in struct pci_channel and use that one instead of SH77xx_PCI_IO_BASE. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16sh: add reg_base member to pci_channelMagnus Damm6-6/+8
Store the base address of the pci host controller registers in struct pci_channel and use the address in pci_read_reg() and pci_write_reg(). Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16sh: hook in struct pci_channel in sysdataMagnus Damm2-5/+8
Store a struct pci_channel pointer in bus->sysdata. This makes whatever struct pci_channel assigned to a bus available for sh4_pci_read() and sh4_pci_write(). We also modify PCIBIOS_MIN_IO and PCIBIOS_MIN_MEM to use bus->sysdata - this to gives us support for multiple pci channels. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16sh: avoid using PCIBIOS_MIN_xxxMagnus Damm6-20/+19
Replaces PCIBIOS_MIN_IO and PCIBIOS_MIN_MEM with direct struct pci_channel access. This allows us to have more than one pci channel. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16sh: add init member to pci_channel dataMagnus Damm18-36/+54
This patch adds an init callback to struct pci_channel and makes sure it is initialized properly. Code is added to call this init function from pcibios_init(). Return values are adjusted and a warning is is printed if init fails. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-16sh: pass along struct pci_channelMagnus Damm19-149/+164
These patches rework the pci code for the sh architecture. Currently each board implements some kind of ioport to address mapping. Some boards use generic_io_base others try passing addresses as io ports. This is the first set of patches that try to unify the pci code as much as possible to avoid duplicated code. This will in the end lead to fewer lines board specific code and more generic code. This patch makes sure a struct pci_channel pointer is passed along to various pci functions such as pci_read_reg(), pci_write_reg(), pci_fixup_pcic(), sh7751_pcic_init() and sh7780_pcic_init(). Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-14sh: Add in PCI bus for DMA API debugging.Paul Mundt1-0/+3
This adds in the pci_bus_type for DMA API debug. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-06sh: sh7785lcr: fix PCI address map for 32-bit modeYoshihiro Shimoda2-0/+7
Fix the problem that cannot work PCI device on 32-bit mode because influence of the commit 68b42d1b548be1840aff7122fdebeb804daf0fa3 ("sh: sh7785lcr: Map whole PCI address space."). So this patch was implement like a 29-bit mode, map whole physical address space of DDR-SDRAM. Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-04sh: sh7785lcr: Map whole PCI address space.Takashi Yoshii2-17/+8
PCI still doesn't work on sh7785lcr 29bit 256M map mode. On SH7785, PCI -> SHwy address translation is not base+offset but somewhat like base|offset (See HW Manual (rej09b0261) Fig. 13.11). So, you can't export CS2,3,4,5 by 256M at CS2 (results CS0,1,2,3 exported, I guess). There are two candidates. a) 128M@CS2 + 128M@CS4 b) 512M@CS0 Attached patch is B. It maps 512M Byte at 0 independently of memory size. It results CS0 to CS6 and perhaps some more being accessible from PCI. Tested on 7785lcr 29bit 128M map 7785lcr 29bit 256M map (NOT tested on 32bit) Signed-off-by: Takashi YOSHII <yoshii.takashi@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-04-04sh: Fix up number of on-chip DMA channels on SH7091.Paul Mundt1-8/+12
This accidentally regressed when the multi-IRQ changes went in, switching SH7091 from 4 to 6 channels. Add SH7091 back in to the 4-channel dependency list. Reported-by: Adrian McMenamin <adrian@mcmen.demon.co.uk> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-17sh: dma: Make G2 DMA configurable.Paul Mundt2-1/+12
Follow the PVR2 DMAC change for G2 DMA. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-17sh: dma: Make PVR2 DMA configurable.Paul Mundt2-1/+15
With arch/sh/drivers/dma/ always being built, the Dreamcast DMA engines are being unconditionally built in, regardless of whether the DMA API is enabled or not. This is a regression from previous behaviour, but there is not much advantage in building them all in unconditionally regardless. Add a new config option to make it optional, and update the only user of it to reflect that. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-16sh: Move IRQ multi definition of DMAC to defconfigNobuhiro Iwamatsu2-12/+13
When SuperH CPU has IRQ multi of DMAC, SH_DMA_IRQ_MULTI becomes enable. The following CPU's are Multi IRQ of DMAC now. - SH775X and SH7091 - SH776X - SH7780 - SH7785 If SH_DMA_IRQ_MULTI becomes enable, dma-sh api driver is optimized for Multi IRQ. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-16sh: Disable get_dma_error_irq for non-SH4 targets.Nobuhiro Iwamatsu1-0/+2
dma-sh's get_dma_error_irq() is only used by SH4, as the SH3 doesn't have the DMA Error interrupt. Disable it out for non-SH4 builds. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-10sh: dma-sh updates for multi IRQ and new SH-4A CPUs.Nobuhiro Iwamatsu3-136/+119
This adds DMA support for newer SH-4A CPUs, particularly SH7763/64/80/85. This also enables multi IRQ support for platforms that have multiple vectors bound to the same IRQ source. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-03-10sh: pci-sh7780: fix pci memory address for fixed PMBYoshihiro Shimoda1-2/+2
Fix the problem that cannot work a PCI device when 32-bit physical address mode. Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2009-01-07PCI: sh: use generic INTx swizzle from PCI coreBjorn Helgaas1-16/+1
Use the generic pci_common_swizzle() instead of arch-specific code. Note that pci_common_swizzle() loops based on dev->bus->self, not dev->bus->parent as the sh simple_swizzle() did. I think they are equivalent for this purpose. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-01-07PCI: sh: use generic pci_swizzle_interrupt_pin()Bjorn Helgaas2-13/+3
Use the generic pci_swizzle_interrupt_pin() instead of arch-specific code. Acked-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2008-12-22sh: dma: Kill off ISA DMA wrapper.Paul Mundt2-107/+0
There are no more users for this code, and it has been deprecated for some time, so just kill it off. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22sh: mach-sh03: Use __set_io_port_base(), kill off special ioport_map().Paul Mundt1-1/+2
This also fixes up a long-standing bug for this platform where the PIO base was set to a register offset, rather than the actual PIO offset itself. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22sh: pci-sh7780: fix pci memory address maskYoshihiro Shimoda1-7/+5
Fix the problem that cannot work a PCI device when system memory size is 256Mbyte in 29bit address mode. Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22sh: add SH DMAC burst mode constantSteve Glendinning1-0/+1
The SH7709 datasheet defines bit 5 as set for burst mode, clear for cycle-steal mode. Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-12-22sh: fix DMAOR register access on SH7709Steve Glendinning1-1/+2
sh7709 hardware manual says DMAOR is 16 bits long on this platform. Tested and working with a modified smsc911x ethernet driver (sh-dma support patch for this driver is coming soon). Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-10-20sh: Migrate common board headers to mach-common/.Paul Mundt5-5/+5
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29sh: Move out the solution engine headers to arch/sh/include/mach-se/Paul Mundt1-1/+1
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29sh: dma-sh: Fix up dreamcast dma.h mach path.Paul Mundt1-1/+1
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-29sh: migrate to arch/sh/include/Paul Mundt8-10/+10
This follows the sparc changes a439fe51a1f8eb087c22dd24d69cebae4a3addac. Most of the moving about was done with Sam's directions at: http://marc.info/?l=linux-sh&m=121724823706062&w=2 with subsequent hacking and fixups entirely my fault. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28sh: Renesas R0P7785LC0011RL board supportYoshihiro Shimoda3-0/+113
This adds initial support for the Renesas R0P7785LC0011RL board. This patch supports 29bit address mode only. Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28sh: make pcibios_max_latency staticAdrian Bunk1-1/+1
This patch makes the needlessly global pcibios_max_latency static. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28sh: make EARLY_PCI_OP's staticAdrian Bunk1-1/+1
This patch makes the needlessly global EARLY_PCI_OP's static. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-28sh dreamcast: export board_pci_channelsAdrian Bunk1-0/+2
This patch fixes the following build error: <-- snip --> ... MODPOST 1837 modules ERROR: "board_pci_channels" [drivers/pcmcia/yenta_socket.ko] undefined! ... make[2]: *** [__modpost] Error 1 <-- snip --> I freely admit that it's a pathological configuration, but as long as it is allowed it should build. Reported-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-07-21sysdev: Pass the attribute to the low level sysdev show/store functionAndi Kleen1-4/+11
This allow to dynamically generate attributes and share show/store functions between attributes. Right now most attributes are generated by special macros and lots of duplicated code. With the attribute passed it's instead possible to attach some data to the attribute and then use that in shared low level functions to do different things. I need this for the dynamically generated bank attributes in the x86 machine check code, but it'll allow some further cleanups. I converted all users in tree to the new show/store prototype. It's a single huge patch to avoid unbisectable sections. Runtime tested: x86-32, x86-64 Compiled only: ia64, powerpc Not compile tested/only grep converted: sh, arm, avr32 Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-06-27PCI: remove unused arch pcibios_update_resource() functionsAdrian Bunk1-32/+0
Russell King did the following back in 2003: <-- snip --> [PCI] pci-9: Kill per-architecture pcibios_update_resource() Kill pcibios_update_resource(), replacing it with pci_update_resource(). pci_update_resource() uses pcibios_resource_to_bus() to convert a resource to a device BAR - the transformation should be exactly the same as the transformation used for the PCI bridges. pci_update_resource "knows" about 64-bit BARs, but doesn't attempt to set the high 32-bits to anything non-zero - currently no architecture attempts to do something different. If anyone cares, please fix; I'm going to reflect current behaviour for the time being. Ivan pointed out the following architectures need to examine their pcibios_update_resource() implementation - they should make sure that this new implementation does the right thing. #warning's have been added where appropriate. ia64 mips mips64 This cset also includes a fix for the problem reported by AKPM where 64-bit arch compilers complain about the resource mask being placed in a u32. <-- snip --> This patch removes the unused pcibios_update_resource() functions the kernel gained since, from FRV, m68k, mips & sh architectures. Signed-off-by: Adrian Bunk <bunk@kernel.org> Acked-by: David Howells <dhowells@redhat.com> Acked-by: Greg Ungerer <gerg@uclinux.org> Acked-by: Paul Mundt <lethal@linux-sh.org> Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2008-05-21MODULE_LICENSE expects "GPL v2", not "GPLv2"Al Viro1-1/+1
... and we have few enough places using the latter to make it simpler to do search and replace... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29iomap: fix 64 bits resources on 32 bitsBenjamin Herrenschmidt1-2/+2
Almost all implementations of pci_iomap() in the kernel, including the generic lib/iomap.c one, copies the content of a struct resource into unsigned long's which will break on 32 bits platforms with 64 bits resources. This fixes all definitions of pci_iomap() to use resource_size_t. I also "fixed" the 64bits arch for consistency. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-20PCI: remove initial bios sort of PCI devices on x86Greg Kroah-Hartman1-2/+0
We currently keep 2 lists of PCI devices in the system, one in the driver core, and one all on its own. This second list is sorted at boot time, in "BIOS" order, to try to remain compatible with older kernels (2.2 and earlier days). There was also a "nosort" option to turn this sorting off, to remain compatible with even older kernel versions, but that just ends up being what we have been doing from 2.5 days... Unfortunately, the second list of devices is not really ever used to determine the probing order of PCI devices or drivers[1]. That is done using the driver core list instead. This change happened back in the early 2.5 days. Relying on BIOS ording for the binding of drivers to specific device names is problematic for many reasons, and userspace tools like udev exist to properly name devices in a persistant manner if that is needed, no reliance on the BIOS is needed. Matt Domsch and others at Dell noticed this back in 2006, and added a boot option to sort the PCI device lists (both of them) in a breadth-first manner to help remain compatible with the 2.4 order, if needed for any reason. This option is not going away, as some systems rely on them. This patch removes the sorting of the internal PCI device list in "BIOS" mode, as it's not needed at all anymore, and hasn't for many years. I've also removed the PCI flags for this from some other arches that for some reason defined them, but never used them. This should not change the ordering of any drivers or device probing. [1] The old-style pci_get_device and pci_find_device() still used this sorting order, but there are very few drivers that use these functions, as they are deprecated for use in this manner. If for some reason, a driver rely on the order and uses these functions, the breadth-first boot option will resolve any problem. Cc: Matt Domsch <Matt_Domsch@dell.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-27arch/sh/drivers/dma/dma-sh.c: Correct use of ! and &Julia Lawall1-1/+1
In commit e6bafba5b4765a5a252f1b8d31cbf6d2459da337, a bug was fixed that involved converting !x & y to !(x & y). The code below shows the same pattern, and thus should perhaps be fixed in the same way. This is not tested and clearly changes the semantics, so it is only something to consider. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ expression E1,E2; @@ ( !E1 & !E2 | - !E1 & E2 + !(E1 & E2) ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-02-26sh: revert dreamcast pci changeMagnus Damm1-22/+22
Commit e036eaa681a17f71b64f6d9040fe605555623919 broke dreamcast pci, this patch fixes that by reverting the dreamcast specific bits. Signed-off-by: Magnus Damm <damm@igel.co.jp> Acked-by: Adrian McMenamin <adrian@mcmen.demon.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-02-26sh: heartbeat: ioremap is expected to succeedRoel Kluin1-1/+1
ioremap is expected to succeed Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-02-14sh: fix pci io access for r2d boardsMagnus Damm1-1/+2
Use generic_io_base to point out the pci io window, and make sure the highest port address used is SH7751_PCI_IO_SIZE - 1. This patch fixes pci io port access for the r2d boards - CONFIG_8139TOO_PIO now works as expected. So does the alsa driver for CMI8738. Signed-off-by: Magnus Damm <damm@igel.co.jp> Acked-by: Katsuya MATSUBARA <matsu@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-02-14sh: use ctrl_in/out for on chip pci accessMagnus Damm6-37/+37
This patch makes sure ctrl_inN/outN are used instead of inN/outN for on chip pci registers. Without this patch addresses may be adjusted using the value in generic_io_base. This patch makes it possible to set generic_io_base and have pci without reading and writing all over the place. Signed-off-by: Magnus Damm <damm@igel.co.jp> Acked-by: Katsuya MATSUBARA <matsu@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-02-14sh: remove unneeded castStephen Rothwell1-1/+1
now that platform_device_register_simple() takes a "const chat *". Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-02-01PCI: Kconfig help: don't refer to the PCI-HOWTOAdrian Bunk1-5/+0
A HOWTO that hasn't been updated for half a dozen years no longer "contains valuable information about which PCI hardware does work under Linux and which doesn't". Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-01-28sh: update r7780rp interrupt codeMagnus Damm1-14/+2
This patch updates the board specific irq code for r7780rp. The new code is very similar to the other highlander implementations, with the exception that the r7780rp handles pci interrupts using IRL. To simplify the pci code and use the same interrupt numbers as r7780mp and r7785rp we hook in to the cpu specific pci vectors. The pci interrupts and the push switch all work well with and without this patch. CF and AX88796 are not ok though and the source of the problem is unknown at this point. The AX88796 does for not detect it's proper mac address (IPL gets it right) and the kernel hangs on CF access. As a workaround this patch removes the CF and the AX88796 from the platform datain case of r7780rp. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28sh: use declared coherent memory for dreamcast pci ethernet adapterMagnus Damm3-72/+11
This patch makes the dreamcast use the recently added declared coherent memory functions to point out the memory window suitable for dma. Apart from cleaning up, this gives the dreamcast a proper memory allocator for pci dma memory. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28sh: Add support for SDK7780 board.Nicholas Beck3-0/+133
Add support for Renesas Technology Europe SDK7780 board. Signed-off-by: Nicholas Beck <nbeck@mpc-data.co.uk> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2008-01-28sh: Kill off dead HS771RVoIP board support.Paul Mundt1-2/+0
Signed-off-by: Paul Mundt <lethal@linux-sh.org>