summaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers
Commit message (Collapse)AuthorAgeFilesLines
* sh: Hook up 3rd memory window for all SH7786 PCIe channels.Paul Mundt2010-09-071-0/+3
| | | | | | | | Now that the resource assignment issues are resolved, we can finally wire up the small third memory window -- in the future we may reclaim this for MSI. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Properly wire up channel 2's I/O window on SH7786 PCIe.Paul Mundt2010-09-071-0/+1
| | | | | | | | | An IORESOURCE_IO was missing here, which meant that we weren't properly establishing the I/O window for this particular slot. With this corrected, cards with I/O BARs have them actually assigned and accessible. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Ignore 32-bit windows in 29-bit mode for SH7786 PCIe.Paul Mundt2010-09-071-8/+16
| | | | | | | | | Certain memory windows are only available for 32-bit space, so skip over these in 29-bit mode. This will severely restrict the amount of memory that can be mapped, but since a boot loader bug makes booting in 29-bit mode close to impossible anyways, everything is ok. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Establish a SuperHyway<->PCIe window mapping on SH7786 PCIe.Paul Mundt2010-09-071-1/+1
| | | | | | | | This bumps up the low address to match the physical memory windows for SHway<->PCIe transfers. The previous implementation was banking on a 1:1 virt<->phys SHway mapping, which doesn't apply here. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Make SH7786 PCIe port reset logic more aggressive.Paul Mundt2010-09-071-1/+11
| | | | | | | This attempts a more complete port reset, building on top of the existing approach. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Additional register definitions for SH7786 PCIe.Matt Fleming2010-09-071-2/+54
| | | | | Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Relax devfn constraints for SH7786 PCIe.Paul Mundt2010-08-201-9/+4
| | | | | | | | SH7786 PCIe has 1 slot per port, but no specific restriction on function. Relax the devfn restriction and look to the slot number instead when configured as a root complex. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Fix up SH7786 PCIe PHY initialization.Paul Mundt2010-08-201-12/+18
| | | | | | | This brings the clocking and register setting in line with the somewhat factually ambiguous specification. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Support type 1 accesses for SH7786 PCI.Paul Mundt2010-08-201-7/+21
| | | | | | | | This enables support for type 1 config space accesses on the SH7786 PCI controller. At the same time, add in some extra sanity checks for controller asserted errors. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Fix up IORESOURCE_PCI_FIXED usage in pcibios_fixup_device_resources().Paul Mundt2010-06-071-2/+0
| | | | | | | | | | | | pcibios_fixup_device_resources() presently skips over resources flagged with IORESOURCE_PCI_FIXED, which is a remnant of the old PCI-auto code. The only user for this at present is the Dreamast GAPSPCI code which can't tolerate any adjustments to the BARs, but a combination of the IORESOURCE_PCI_FIXED and zeroed out hose offsets does the right thing for this case already, so we simply kill off the special casing. Reported-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: sh7751 pci controller io port fixMagnus Damm2010-04-261-2/+3
| | | | | | | | | | This patch updates the sh7751 pci code to handle io ports correctly. The code is based on the sh7788x implementation. Tested on a R2D-1 board with CONFIG_8139TOO_PIO=y. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo2010-03-305-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6Linus Torvalds2010-02-2623-473/+911
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (187 commits) sh: remove dead LED code for migo-r and ms7724se sh: ecovec build fix for CONFIG_I2C=n sh: ecovec r-standby support sh: ms7724se r-standby support sh: SH-Mobile R-standby register save/restore clocksource: Fix up a registration/IRQ race in the sh drivers. sh: ms7724: modify scan_timing for KEYSC sh: ms7724: Add sh_sir support sh: mach-ecovec24: Add sh_sir support sh: wire up SET/GET_UNALIGN_CTL. sh: allow alignment fault mode to be configured at kernel boot. sh: sh7724: Update FSI/SPU2 clock sh: always enable sh7724 vpu_clk and set to 166MHz on Ecovec sh: add sh7724 kick callback to clk_div4_table sh: introduce struct clk_div4_table sh: clock-cpg div4 set_rate() shift fix sh: Turn on speculative return for SH7785 and SH7786 sh: Merge legacy and dynamic PMB modes. sh: Use uncached I/O helpers in PMB setup. sh: Provide uncached I/O helpers. ...
| * sh: Fix up multi-resource mapping for SH7786 PCIe.Paul Mundt2010-02-102-43/+82
| | | | | | | | | | | | | | | | | | | | | | | | This reworks some of the SH7786 PCIe initialization code to dynamically setup and size the various resource windows, as opposed to the original code that simply wired in a couple of them statically. At the same time, we tidy up the initialization code a bit, kill off some read-only register twiddling that was gleaned from the bus analyzer, and also propagate the physical slot/channel mapping. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * sh: Fix up SH7786 PCI resource definitions.Paul Mundt2010-02-082-87/+63
| | | | | | | | | | | | | | This adds in some of the missing memory resources for channels 1/2 and gets the code building again for the recent changes. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * Merge branch 'sh/dmaengine'Paul Mundt2010-02-081-1/+4
| |\ | | | | | | | | | | | | Conflicts: arch/sh/drivers/dma/dma-sh.c
| | * sh: fix Transfer Size calculation in both DMA driversGuennadi Liakhovetski2010-02-081-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both the original arch/sh/drivers/dma/dma-sh.c and the new SH dmaengine drivers do not take into account bits 3:2 of the Transfer Size field in the CHCR register, besides, bit-field defines set bit 2, but the mask only passes bits 1:0 through. TS_16BLK and TS_32BLK macros are bogus too. This patch fixes all these issues for sh7722 and sh7724, other CPUs stay unchanged and might need to be fixed too. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Fix an off-by-1 in SH7780 PCIC memory resource mapping.Paul Mundt2010-02-051-5/+5
| | | | | | | | | | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Fix up early PCI PERR/SERR IRQ handling.Paul Mundt2010-02-033-26/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for handling early PERR/SERR triggering in between controller registration and the initial bus scan. Buggy cards end up asserting these as soon as the M66EN scan is undertaken, resulting in an early crash. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Improved multi-resource handling for SH7780 PCI.Paul Mundt2010-02-018-90/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SH7780 PCI controller supports 3 different ranges of PCI memory in addition to its PCI I/O window. In the case of 29-bit mode, only 2 memory windows are supported, while in 32-bit mode all 3 are visible. This attempts to make the resource handling completely dynamic and to permit platforms to map in as many apertures as they can handle. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Hook up ERR/PERR/SERR detection for SH7780 PCI host controllers.Paul Mundt2010-02-014-29/+306
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These were never handled before, so implement some common infrastructure to support them, then make use of that in the SH7780-specific code. In practice there is little here that can not be generalized for SH4 parts, which will be an incremental change as the 7780/7751 code is gradually unified. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Handle PCI controller resource conflicts.Paul Mundt2010-02-016-15/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | register_pci_controller() can fail, but presently is a void function. Change this over to an int so that we can bail early before continuing on with post-registration initialization (such as throwing the controller in to 66MHz mode in the case of the SH7780 host controller). Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Enable PCI66 support for SH7780 host controller.Paul Mundt2010-02-014-1/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds some helper glue for scanning the bus and determining if all of the devices are 66MHz capable or not before flipping on 66MHz mode. This isn't quite to spec, but it's fairly consistent with what other embedded controllers end up having to do. Scanning code cribbed from the MIPS txx9 PCI code. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Fix up large system memory handling for SH7780 PCI.Paul Mundt2010-02-011-6/+28
| | | | | | | | | | | | | | | | | | | | | | | | For systems that have more than 512MB we need to set up an additional mapping, this fixes up the rounding to the next power of two and splits out the mapping accordingly between the two local bus mapping windows. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Kill off broken type 1 PCI config access checks.Paul Mundt2010-01-304-37/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The host controllers only support type 1, so there's not much else to test for. Some of the older controllers also supported type 2 accesses, but we've never supported those, and likely never will. Beyond that, the P1SEG test is meaningless for 32-bit mode, so rather than refactoring it, just kill the type 1 test off completely. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: support PCI domains.Paul Mundt2010-01-291-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | Newer SH parts are now commonly shipping with multiple controllers, so we wire up PCI domain support to deal with them. Shamelessly cloned from the MIPS implementation. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Bail out early on PCI resource conflicts.Paul Mundt2010-01-291-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | Presently we just call in to request_resource() for the ioport and iomem resources without checking for errors. This has already hidden a couple of bugs, so add some error handling in for good measure. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Reworked SH7780 PCI initialization.Paul Mundt2010-01-295-145/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This consolidates the PCI initialization code for all of the pci-sh7780 users, and sets up the memory window dynamically as opposed to using hardcoded window positions. A number of bugs were fixed at the same time, including the PIO handling and master abort timeout settings being incorrect. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Fix up read-only variable assignment in pcibios_align_resource().Paul Mundt2010-01-281-3/+1
| | | | | | | | | | | | | | | | | | arch/sh/drivers/pci/pci.c:167: error: assignment of read-only location '*res' Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Mass ctrl_in/outX to __raw_read/writeX conversion.Paul Mundt2010-01-268-49/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old ctrl in/out routines are non-portable and unsuitable for cross-platform use. While drivers/sh has already been sanitized, there is still quite a lot of code that is not. This converts the arch/sh/ bits over, which permits us to flag the routines as deprecated whilst still building with -Werror for the architecture code, and to ensure that future users are not added. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: Generalize SH7786 PCIe support.Paul Mundt2010-01-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | Previously this was only built in for Urquell boards, but the same approach can be used on SDK7786 now that the mode pin reading is supported, so make it generic to SH7786. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
| * | sh: heartbeat: Support access size specification via resource flags.Paul Mundt2010-01-151-5/+17
| |/ | | | | | | | | | | | | | | This permits the resource access size to be handed off through the resource flags, which saves platforms from having to establish platform data only to specify the register width. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | resource/PCI: mark struct resource as constDominik Brodowski2010-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | Now that we return the new resource start position, there is no need to update "struct resource" inside the align function. Therefore, mark the struct resource as const. Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
* | resource/PCI: align functions now return start of resourceDominik Brodowski2010-02-221-3/+3
|/ | | | | | | | | | | As suggested by Linus, align functions should return the start of a resource, not void. An update of "res->start" is no longer necessary. Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
* sh: move machtypes.h to include/generatedSam Ravnborg2009-12-121-1/+1
| | | | | | | Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Michal Marek <mmarek@suse.cz>
* sh: dma: Kill off bogus dma_sysclass symbol export.Paul Mundt2009-11-131-2/+0
| | | | | | | | This is a static symbol, so the export is wholly superfluous. Recent kbuild updates flagged this as an error, resulting in build failure, so this tidies that up. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Kill off superfluous arch/sh/drivers/pci/Kconfig.Paul Mundt2009-10-271-7/+0
| | | | | | | | Now that this contains a grand total of 1 Kconfig option, it's hardly worth keeping split out. Roll CONFIG_PCI back in to the top-level architecture Kconfig, along with the other bus types. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Revamp PCI DMA coherence Kconfig bits.Paul Mundt2009-10-271-12/+0
| | | | | | | | | Leaving this configurable caused more trouble than it was ever worth, so just make it explicit. Boards that are verified one way or the other can fix up their selects accordingly. We presently default to non-coherent for most platforms. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* Merge branch 'next' of ↵NeilBrown2009-09-232-5/+10
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx into for-linus
| * dmaengine: sh: Add Support SuperH DMA Engine driverNobuhiro Iwamatsu2009-09-082-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | This supported all DMA channels, and it was tested in SH7722, SH7780, SH7785 and SH7763. This can not use with SH DMA API. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> Reviewed-by: Matt Fleming <matt@console-pimps.org> Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com> Acked-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | sh: Allow use of GENERIC_IOMAPDavid McKay2009-08-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The synopsys PCI cell used in the later STMicro chips requires code to be run in order to do IO cycles, rather than just memory mapping the IO space. Rather than extending the existing SH infrastructure to allow this, use the GENERIC_IOMAP implmentation to save re-inventing the wheel. This set of changes allows the SH to be built with GENERIC_IOMAP enabled, it just ifdef's out the functions provided by the GENERIC_IOMAP implementation, and provides a few required missing functions. Signed-off-by: David McKay <david.mckay@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Add SH7724 support to NR_ONCHIP_DMA_CHANNELSKuninori Morimoto2009-08-191-3/+3
| | | | | | | | | | | | | | This patch also update help comment Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh: Prevent heartbeat from scribbling over non-LED bits.Kuninori Morimoto2009-08-181-0/+10
|/ | | | | | | | | | While most platforms implement LED banks in sets of 8/16/32, some use different configurations. This adds a LED mask to the heartbeat platform data to allow platforms to constrain the bitmap, which is otherwise derived from the register size. Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pci: Initial PCI-Express support for SH7786 Urquell board.Paul Mundt2009-06-172-0/+356
| | | | | | | | | | | | | This adds initial support for the PCI-Express module in the SH7786, particularly as it relates to the urquell platform. Presently it is only supported in root complex mode, with endpoint mode still requiring more debugging. 29/32-bit mode and lane configurations are selectable via board mode pins, and are otherwise fixed. Only 4x and 1x PCI channels are presently handled, the PCI bridge still requires additional debugging and stabilization in hardware. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pci: SH7786 PCI ops.Paul Mundt2009-06-163-0/+724
| | | | | | | This adds in preliminary support for the SH7786 PCIe module PCI ops, and the corresponding module definitions. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pci: Allow register_pci_controller() to handle overlapping regions.Paul Mundt2009-06-161-12/+2
| | | | | | | | Some host controllers (such as SH7786) have overlapping regions that are fixed in hardware. The resource allocator does the right thing in managing this space already, so the conflict case is non-fatal. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pci: remove duplicated #include'sHuang Weiyi2009-06-141-1/+0
| | | | | Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pci-sh7780: Fix up for PCI_DISABLE_MWI changes.Paul Mundt2009-05-271-6/+1
| | | | | | | | This fixes a build error where references to pci_cache_line_size are undefined, as this ceases to be exported when PCI_DISABLE_MWI is enabled, as is now the default. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: pci-sh7751: Initialize io_map_base in controller definition.Paul Mundt2009-05-261-3/+2
| | | | | | | | | As there is only a single controller and remapping has no impact for the address range in question, just initialize it directly in the controller definition. This fixes up boot time warnings about not having the field initialized. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: multiple vectors per irq - sh7760Magnus Damm2009-05-111-1/+2
| | | | | | | | | | | | Update intc tables and platform data to use one linux irq per maskable interrupt source instead of keeping the one-to-one mapping between vectors and linux irqs. This fixes potential irq masking issues for sh7760 hardware blocks such as DMAC/TMU2/REF. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
OpenPOWER on IntegriCloud