History log of /arch/sh/drivers/pci/pcie-sh7786.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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>
/arch/sh/drivers/pci/pcie-sh7786.c
cd7bb53ff88a5acef942a87c1d04e6211b6470dc 28-Jan-2011 Paul Mundt <lethal@linux-sh.org> sh: Fix up async PCIe probing on SMP.

For the SMP case we run in to a lockup without a full synchronization
prior to continuing with the boot.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
/arch/sh/drivers/pci/pcie-sh7786.c
1da09c43ce5f4fcd98143feb7d2513fe6fd62848 18-Jan-2011 Paul Mundt <lethal@linux-sh.org> sh: pci: Support asynchronous initialization of SH-X3 PCIe channels.

SH-X3 controllers all have pretty dire delays needed for PHY wakeup, so
we attempt to mitigate the damage by bringing them up asynchronously,
simply using the synchronization points for persistent bridge to channel
numbering.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
/arch/sh/drivers/pci/pcie-sh7786.c
a80be1680502f99de5f9565c491208e90a9a3afe 14-Oct-2010 Paul Mundt <lethal@linux-sh.org> sh: pci: Convert to upper/lower_32_bits() helpers.

Instead of hand-rolling our own, just use the generic ones instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
/arch/sh/drivers/pci/pcie-sh7786.c
b6b77b2d5ffd2f8ee74fcc27661f7f4962c34705 14-Oct-2010 Paul Mundt <lethal@linux-sh.org> sh: pci: Support secondary FPGA-driven PCIe clocks on SDK7786.

The SDK7786 FPGA has secondary control over the PCIe clocks, specifically
relating to the slots and oscillator. This ties the FPGA clocks in to the
clock framework and balances the refcounting similar to how the primary
on-chip clocks are managed. While the on-chip clocks are per-port, the
FPGA clock enable/disable is global for the entire block.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
/arch/sh/drivers/pci/pcie-sh7786.c
c524ebf5a6b78d25219d64a05b3876cde719b5ff 20-Sep-2010 Paul Mundt <lethal@linux-sh.org> sh: pci: clock framework support for SH7786 PCIe.

This gets each port handling its MSTP bit, as well as moving the PHY
clock management in to the clock framework.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
/arch/sh/drivers/pci/pcie-sh7786.c
cecf48e23fd9270053850643a56e8e791322e3d5 20-Sep-2010 Paul Mundt <lethal@linux-sh.org> sh: pci: Use I/O accessors consistently in SH7786 PCIe init code.

Some of the existing code is flipping between __raw_xxx() and
pci_{read,write}_reg(). As the latter are just wrappers for the former,
flip over to using them consistently.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
/arch/sh/drivers/pci/pcie-sh7786.c
bd792aea441a3dcdede462486ab8c63045803844 20-Sep-2010 Paul Mundt <lethal@linux-sh.org> sh: pci: Support ports with disabled links on SH7786 PCIe.

Presently we error out if a link is disabled and simply drop the port
registration outright. This follows the PPC changes and simply reports on
the link state on boot, leaving the port registered, in order to more
easily deal with hotplug on future parts.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
/arch/sh/drivers/pci/pcie-sh7786.c
beb54ad9c6fb60901d9445056d40bdaccdc3e819 20-Sep-2010 Paul Mundt <lethal@linux-sh.org> sh: pci: Discard initial PCICONF4/5 settings for SH7786 PCIe.

These settings are properly propagated by the hardware already, so
there's no need to bother with them manually.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
/arch/sh/drivers/pci/pcie-sh7786.c
2c65d75ec4dde5e619a462e70cdd7b67e0e64bb8 20-Sep-2010 Paul Mundt <lethal@linux-sh.org> sh: pci: Support root complex config accesses on SH7786 PCIe.

The SH7786 PCIe is presently unable to enumerate itself in root complex
mode, and has no visibility through either type 0 or type 1 accesses,
despite having a mostly sensible extended config space for each port.
Attempts to generate type 0 or type 1 config cycles result in completer
aborts, so we're ultimately forced to use SuperHyway transactions
instead.

As each port has a single port <-> device mapping that resolves for any
PCI_SLOT definition, we simply hijack devfn 0 for the SuperHyway
transaction and bump up the devfn limit.

With enumeration of the root complex now possible, we also need to insert
an early fixup to hide the BARs from the kernel. With all of that done,
it's now possible to use the pcieport services with all of the PCIe
ports, which is the first step to power management support.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
/arch/sh/drivers/pci/pcie-sh7786.c
81df84f4060f4f19c7e6f39c7c527a6098436a2a 19-Sep-2010 Paul Mundt <lethal@linux-sh.org> sh: pci: Give SH7786 PHY some time to settle.

The spec suggests waiting up to 500ms for the PHY to settle before
testing link state, but practice shows that 100ms is sufficient (this is
the delay value we also use on the other SH-4A PCI controllers, too).
This makes device detection much more reliable, although in the future it
should be a bit faster to simply serialize with a TLP IRQ.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
/arch/sh/drivers/pci/pcie-sh7786.c
52204705b2fef6cb70b49dfa19c363fc88e72bde 07-Sep-2010 Paul Mundt <lethal@linux-sh.org> Merge branch 'sh/pci-express-integration'
1c3bb3871af53a2a8620bc48b5535f6d83386773 07-Sep-2010 Paul Mundt <lethal@linux-sh.org> sh: Hook up 3rd memory window for all SH7786 PCIe channels.

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>
/arch/sh/drivers/pci/pcie-sh7786.c
f048519309dbaedd03807ddbb9fa22f5616cfd43 07-Sep-2010 Paul Mundt <lethal@linux-sh.org> sh: Properly wire up channel 2's I/O window on SH7786 PCIe.

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>
/arch/sh/drivers/pci/pcie-sh7786.c
da03a63ac843711887a85e5d90dd69399b1b9164 07-Sep-2010 Paul Mundt <lethal@linux-sh.org> sh: Ignore 32-bit windows in 29-bit mode for SH7786 PCIe.

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>
/arch/sh/drivers/pci/pcie-sh7786.c
2c5f674339d5e4c02cca7af13ec02bd9b5a96b60 07-Sep-2010 Paul Mundt <lethal@linux-sh.org> sh: Establish a SuperHyway<->PCIe window mapping on SH7786 PCIe.

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>
/arch/sh/drivers/pci/pcie-sh7786.c
2dbfa1e37dc703631d5421e0b04aecc5a7aff37d 07-Sep-2010 Paul Mundt <lethal@linux-sh.org> sh: Make SH7786 PCIe port reset logic more aggressive.

This attempts a more complete port reset, building on top of the existing
approach.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
/arch/sh/drivers/pci/pcie-sh7786.c
144c7494239f12d554806439a17ad8203c7b2d3a 20-Aug-2010 Paul Mundt <lethal@linux-sh.org> Merge branch 'sh/pci-express-integration'
53178d71b9f2d5c96bfcd2dd2c4b99c4e95a77d5 20-Aug-2010 Paul Mundt <lethal@linux-sh.org> sh: Fix up SH7786 PCIe PHY initialization.

This brings the clocking and register setting in line with the somewhat
factually ambiguous specification.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
/arch/sh/drivers/pci/pcie-sh7786.c
3b554c33dcde9d67efcb8d0a5acca201afd44730 19-Jun-2010 Matt Fleming <matt@console-pimps.org> sh: Fix typos in PCI initialization message

This typo seems to have been copy and pasted in the PCI initialization
code. Replace 'intialization' with 'initialization'.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
/arch/sh/drivers/pci/pcie-sh7786.c
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking 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>
/arch/sh/drivers/pci/pcie-sh7786.c
7578a4c625a5cc32812946338a4549f3090be113 10-Feb-2010 Paul Mundt <lethal@linux-sh.org> sh: Fix up multi-resource mapping for SH7786 PCIe.

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>
/arch/sh/drivers/pci/pcie-sh7786.c
7561f2dd393bd0c6397e6b2a6b021cdb827a2eb1 08-Feb-2010 Paul Mundt <lethal@linux-sh.org> sh: Fix up SH7786 PCI resource definitions.

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>
/arch/sh/drivers/pci/pcie-sh7786.c
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>
/arch/sh/drivers/pci/pcie-sh7786.c
5713e602106545ff601c158d0864ce8e79de6d0a 17-Jun-2009 Paul Mundt <lethal@linux-sh.org> sh: pci: Initial PCI-Express support for SH7786 Urquell board.

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>
/arch/sh/drivers/pci/pcie-sh7786.c