History log of /arch/sh/include/asm/pci.h
Revision Date Author Comments
a43ae58c848cfbadaba81c8d63202b4487f922a0 06-May-2014 Hanjun Guo <hanjun.guo@linaro.org> PCI: Turn pcibios_penalize_isa_irq() into a weak function

pcibios_penalize_isa_irq() is only implemented by x86 now, and legacy ISA
is not used by some architectures. Make pcibios_penalize_isa_irq() a
__weak function to simplify the code. This removes the need for new
platforms to add stub implementations of pcibios_penalize_isa_irq().

[bhelgaas: changelog, comments]
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
fb127cb9de791d62fb393d6e65fa9869bddd2460 24-Feb-2012 Bjorn Helgaas <bhelgaas@google.com> PCI: collapse pcibios_resource_to_bus

Everybody uses the generic pcibios_resource_to_bus() supplied by the core
now, so remove the ARCH_HAS_GENERIC_PCI_OFFSETS used during conversion.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
7fa6a50eb3625638d5c8fec6187d3da9d1733dca 24-Feb-2012 Bjorn Helgaas <bhelgaas@google.com> sh/PCI: get rid of device resource fixups

Tell the PCI core about host bridge address translation so it can take
care of bus-to-resource conversion for us.

CC: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
d5341942d784134f2997b3ff82cd63cf71d1f932 10-Jun-2011 Ralf Baechle <ralf@linux-mips.org> PCI: Make the struct pci_dev * argument of pci_fixup_irqs const.

Aside of the usual motivation for constification, this function has a
history of being abused a hook for interrupt and other fixups so I turned
this function const ages ago in the MIPS code but it should be done
treewide.

Due to function pointer passing in varous places a few other functions
had to be constified as well.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: Anton Vorontsov <avorontsov@mvista.com>
To: Chris Metcalf <cmetcalf@tilera.com>
To: Colin Cross <ccross@android.com>
Acked-by: "David S. Miller" <davem@davemloft.net>
To: Eric Miao <eric.y.miao@gmail.com>
To: Erik Gilling <konkers@android.com>
Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
To: "H. Peter Anvin" <hpa@zytor.com>
To: Imre Kaloz <kaloz@openwrt.org>
To: Ingo Molnar <mingo@redhat.com>
To: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Krzysztof Halasa <khc@pm.waw.pl>
To: Lennert Buytenhek <kernel@wantstofly.org>
To: Matt Turner <mattst88@gmail.com>
To: Nicolas Pitre <nico@fluxnic.net>
To: Olof Johansson <olof@lixom.net>
Acked-by: Paul Mundt <lethal@linux-sh.org>
To: Richard Henderson <rth@twiddle.net>
To: Russell King <linux@arm.linux.org.uk>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-alpha@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-pci@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: sparclinux@vger.kernel.org
Cc: x86@kernel.org
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
39a90865f07f05343c450e91a56578bb8f69c5e8 20-Sep-2010 Paul Mundt <lethal@linux-sh.org> sh: pci: Use a generic raw spinlock for PCI config access locking.

This copies the pci_config_lock idea from x86 over, allowing us to kill
off a couple of existing private locks. At the same time, these need to
be converted to raw spinlocks for -rt kernels, so we make that change at
the same time. This should make it easier for future parts to get the
locking right instead of inevitable ending up with lock type mismatches.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
f41b177157718abe9a93868bb76e47d4a6f3681d 11-Mar-2010 FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> pci-dma: add linux/pci-dma.h to linux/pci.h

All the architectures properly set NEED_DMA_MAP_STATE now so we can safely
add linux/pci-dma.h to linux/pci.h and remove the linux/pci-dma.h
inclusion in arch's asm/pci.h

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
5cabbb6277286adf973fbb30aca9b194922a316e 11-Mar-2010 FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> pci-dma: sh: use include/linux/pci-dma.h

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9ad62ec4f752c82b39aa5927f23d894b46ae10b9 03-Feb-2010 Paul Mundt <lethal@linux-sh.org> sh: Fix up early PCI PERR/SERR IRQ handling.

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>
b6c58b1d987a5795086c5c2babd8c7367d2fdb8c 01-Feb-2010 Paul Mundt <lethal@linux-sh.org> sh: Improved multi-resource handling for SH7780 PCI.

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>
ef407beefbd9928792ccc93857e408e0057bc17b 01-Feb-2010 Paul Mundt <lethal@linux-sh.org> sh: Hook up ERR/PERR/SERR detection for SH7780 PCI host controllers.

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>
bcf39352eb9e9026f7a1028d4bce3707b65f104b 01-Feb-2010 Paul Mundt <lethal@linux-sh.org> sh: Handle PCI controller resource conflicts.

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>
85b59f5bb24aeca1a987cbb206e228bf630c8327 01-Feb-2010 Paul Mundt <lethal@linux-sh.org> sh: Enable PCI66 support for SH7780 host controller.

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>
320e68da59353fe6ad51b81f6865c4b674ad66ea 29-Jan-2010 Paul Mundt <lethal@linux-sh.org> sh: support PCI domains.

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>
9762528f37ddc7071509dddb10e7b4b3b957fd01 29-Jan-2010 Paul Mundt <lethal@linux-sh.org> sh: Kill off deprecated fixed PCI memory window accessors.

This kills off the deprected fixed memory range accessors for
the cases of non-translatable ioremapping.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
01be5d63fd4645eab1d05a7caa04462c11c8b7a1 27-Oct-2009 Paul Mundt <lethal@linux-sh.org> sh: Revamp PCI DMA coherence Kconfig bits.

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>
73c926bee0e4b7739bbb992a0a3df561178dd522 19-Oct-2009 Paul Mundt <lethal@linux-sh.org> sh: Convert to asm-generic/dma-mapping-common.h

This converts the old DMA mapping support to the new generic
dma-mapping-common.h abstraction.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
a7db50405216610c8a0d62b8b400180b6f366733 22-Jun-2009 Alex Chiang <achiang@hp.com> PCI: remove pcibios_scan_all_fns()

This was #define'd as 0 on all platforms, so let's get rid of it.

This change makes pci_scan_slot() slightly easier to read.

Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Tony Luck <tony.luck@intel.com>
Cc: David Howells <dhowells@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Acked-by: Russell King <linux@arm.linux.org.uk>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Kyle McMartin <kyle@mcmartin.ca>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
a6c140969b4685f9b9f6773c0760f55ca66d1825 17-Jun-2009 Matthew Wilcox <willy@linux.intel.com> Delete pcibios_select_root

This function was only used by pci_claim_resource(), and the last commit
deleted that use.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
b7e2ac619465f1774b827d9997109ceef4a61851 26-May-2009 Paul Mundt <lethal@linux-sh.org> sh: pci: Disable MWI and make pci_dma_burst_advice() a bit more accurate.

None of the SH PCI controllers support MWI, it is always treated as a
direct memory write, so simply disable it outright. In the case of the
PCI cache line size, consult that for the pci_dma_burst_advice()
strategy, and switch over to PCI_DMA_BURST_MULTIPLE, as PPC64.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
3e98f9f15e916c48dfc5231d7e6a59be7f122764 24-Apr-2009 Paul Mundt <lethal@linux-sh.org> sh: pci: Fix up the build for CONFIG_PCI=n.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
805fcc88999162b361ef0b0ce25782ef65f147d7 20-Apr-2009 Paul Mundt <lethal@linux-sh.org> sh: pci: Kill off the last remnants of the now unused pci-auto code.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
5ba7205fc49ff72e88784c94fb661f93e7ae7d36 20-Apr-2009 Paul Mundt <lethal@linux-sh.org> sh: pci: Kill off the now unused hose->io_base.

Nothing is using this any more, so kill it off.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
09cfeb133e3cac39b8b9a2cb1d8ab4f77e396248 20-Apr-2009 Paul Mundt <lethal@linux-sh.org> sh: pci: Track io and mem_offset per-channel.

This implements a per-hose offset for I/O and mem resources.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
e79066a659b893debe19010179d3f3f015d76d1c 20-Apr-2009 Paul Mundt <lethal@linux-sh.org> sh: pci: New-style controller registration.

This moves off of the board_pci_channels[] approach for bus registration
and over to a cleaner register_pci_controller(), all derived from the
MIPS code.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
99f95f117848088f2708b45c70be73152e78bb8a 20-Apr-2009 Paul Mundt <lethal@linux-sh.org> sh: pci: Rework fixed region checks in ioremap().

Not all PCI channels have non-translatable memory windows, this is a
special property of the on-chip PCIC with its 0xfd00... mapping, handle
this explicitly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
0bb34a6bf1f71d5ad2abfda582a2c2794957bc7b 20-Apr-2009 Paul Mundt <lethal@linux-sh.org> sh: pci: Consolidate pci_iomap() and use the generic I/O base.

This consolidates the pci_iomap() definitions and reworks how the I/O
port base is handled. PCI channels can register their own I/O map base,
or if none is provided, the system-wide generic I/O base is used instead.

Functionally nothing changes, while this allows us to kill off lots of
I/O address special casing and lookups.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
394b6d2fe624246e258a218dac68d44fe9a8411f 20-Apr-2009 Paul Mundt <lethal@linux-sh.org> sh: pci: Kill off unused pcibios_fixup().

This is left over cruft that hasn't been used by anything in a long time,
kill off bits that weren't purged previously.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
a3c0e0d0032d5bbfd7dc04827a257c717d432a5b 20-Apr-2009 Paul Mundt <lethal@linux-sh.org> sh: pci: Consolidate pcibios_align_resource() definitions.

This introduces a saner pcibios_align_resource() that can be used
regardless of whether pci-auto or pci-new are being used, and
consolidates it in pci-lib.c.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
9833385131fc4e8c52f95320ab899051d1c06831 20-Apr-2009 Paul Mundt <lethal@linux-sh.org> sh: pci: HAVE_PCI_MMAP support.

Derived from the MIPS version, now uses pgprot_noncached().

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
9ade1217c9ba39ad2f004a898ddfbb815fd5fe74 20-Apr-2009 Paul Mundt <lethal@linux-sh.org> sh: pci: Drop asm-generic/pci.h, so we can use our own fixups.

The new PCI code wants its own bus<->resource mappings instead of the
generic equivalents, so drop the asm-generic include in preparation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
8ce0143b11cdc519b8e1fd94a262b654ef0bc3ab 19-Feb-2008 Magnus Damm <magnus.damm@gmail.com> sh: pci io port base address code

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>
ef339f241b08a16af58897e6288ba200e0c7a8c7 19-Feb-2008 Magnus Damm <magnus.damm@gmail.com> sh: pci memory range checking code

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>
ef53fdeb7e0cb139aff33665635b886700137abb 19-Feb-2008 Magnus Damm <magnus.damm@gmail.com> sh: add io_base member to pci_channel

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>
e4c6a3604e07185046e2ce4be82a201f4447d788 19-Feb-2008 Magnus Damm <magnus.damm@gmail.com> sh: add reg_base member to pci_channel

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>
b6706ef10f75921733d7275fd45d268f2f6254c8 19-Feb-2008 Magnus Damm <magnus.damm@gmail.com> sh: hook in struct pci_channel in sysdata

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>
d0e3db40e2a1352aa2a2f425a7d4631bddc03d51 11-Mar-2009 Magnus Damm <damm@igel.co.jp> sh: add init member to pci_channel data

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>
f15cbe6f1a4b4d9df59142fc8e4abb973302cf44 29-Jul-2008 Paul Mundt <lethal@linux-sh.org> sh: migrate to arch/sh/include/

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>