Skip to content

Commit

Permalink
Merge tag 'drivers-3.13' of git://git.infradead.org/linux-mvebu into …
Browse files Browse the repository at this point in the history
…next/drivers

From Jason Cooper:
mvebu drivers changes for v3.13

 - irqchip
    - add MSI support for armada-370/XP

 - pci
    - add MSI support
    - add support for Marvell Dove SoCs

 - mvebu (soc changes depending on the pci and irq changes)
    - probe mbus windows via DT
    - probe pcie and clock via DT

 - docs for mvebu
    - update gated clock documentation

* tag 'drivers-3.13' of git://git.infradead.org/linux-mvebu:
  ARM: mvebu: fix gated clock documentation
  ARM: dove: remove legacy pcie and clock init
  ARM: dove: switch to DT probed mbus address windows
  PCI: mvebu: add support for Marvell Dove SoCs
  PCI: mvebu: add support for reset on GPIO
  PCI: mvebu: remove subsys_initcall
  PCI: mvebu: increment nports only for registered ports
  PCI: mvebu: move clock enable before register access
  PCI: mvebu: add support for MSI
  irqchip: armada-370-xp: implement MSI support
  irqchip: armada-370-xp: properly request resources

Signed-off-by: Kevin Hilman <khilman@linaro.org>
  • Loading branch information
Kevin Hilman committed Oct 9, 2013
2 parents 3d729d3 + 96ae0b5 commit 0397bb8
Show file tree
Hide file tree
Showing 7 changed files with 307 additions and 84 deletions.
3 changes: 3 additions & 0 deletions Documentation/devicetree/bindings/arm/armada-370-xp-mpic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Marvell Armada 370 and Armada XP Interrupt Controller
Required properties:
- compatible: Should be "marvell,mpic"
- interrupt-controller: Identifies the node as an interrupt controller.
- msi-controller: Identifies the node as an PCI Message Signaled
Interrupt controller.
- #interrupt-cells: The number of cells to define the interrupts. Should be 1.
The cell is the IRQ number

Expand All @@ -24,6 +26,7 @@ Example:
#address-cells = <1>;
#size-cells = <1>;
interrupt-controller;
msi-controller;
reg = <0xd0020a00 0x1d0>,
<0xd0021070 0x58>;
};
14 changes: 8 additions & 6 deletions Documentation/devicetree/bindings/clock/mvebu-gated-clock.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
* Gated Clock bindings for Marvell Orion SoCs
* Gated Clock bindings for Marvell EBU SoCs

Marvell Dove and Kirkwood allow some peripheral clocks to be gated to save
some power. The clock consumer should specify the desired clock by having
the clock ID in its "clocks" phandle cell. The clock ID is directly mapped to
the corresponding clock gating control bit in HW to ease manual clock lookup
in datasheet.
Marvell Armada 370/XP, Dove and Kirkwood allow some peripheral clocks to be
gated to save some power. The clock consumer should specify the desired clock
by having the clock ID in its "clocks" phandle cell. The clock ID is directly
mapped to the corresponding clock gating control bit in HW to ease manual clock
lookup in datasheet.

The following is a list of provided IDs for Armada 370:
ID Clock Peripheral
Expand Down Expand Up @@ -94,6 +94,8 @@ ID Clock Peripheral

Required properties:
- compatible : shall be one of the following:
"marvell,armada-370-gating-clock" - for Armada 370 SoC clock gating
"marvell,armada-xp-gating-clock" - for Armada XP SoC clock gating
"marvell,dove-gating-clock" - for Dove SoC clock gating
"marvell,kirkwood-gating-clock" - for Kirkwood SoC clock gating
- reg : shall be the register address of the Clock Gating Control register
Expand Down
10 changes: 10 additions & 0 deletions Documentation/devicetree/bindings/pci/mvebu-pci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Mandatory properties:
- compatible: one of the following values:
marvell,armada-370-pcie
marvell,armada-xp-pcie
marvell,dove-pcie
marvell,kirkwood-pcie
- #address-cells, set to <3>
- #size-cells, set to <2>
Expand All @@ -14,6 +15,8 @@ Mandatory properties:
- ranges: ranges describing the MMIO registers to control the PCIe
interfaces, and ranges describing the MBus windows needed to access
the memory and I/O regions of each PCIe interface.
- msi-parent: Link to the hardware entity that serves as the Message
Signaled Interrupt controller for this PCI controller.

The ranges describing the MMIO registers have the following layout:

Expand Down Expand Up @@ -74,6 +77,8 @@ and the following optional properties:
- marvell,pcie-lane: the physical PCIe lane number, for ports having
multiple lanes. If this property is not found, we assume that the
value is 0.
- reset-gpios: optional gpio to PERST#
- reset-delay-us: delay in us to wait after reset de-assertion

Example:

Expand All @@ -86,6 +91,7 @@ pcie-controller {
#size-cells = <2>;

bus-range = <0x00 0xff>;
msi-parent = <&mpic>;

ranges =
<0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000 /* Port 0.0 registers */
Expand Down Expand Up @@ -135,6 +141,10 @@ pcie-controller {
interrupt-map = <0 0 0 0 &mpic 58>;
marvell,pcie-port = <0>;
marvell,pcie-lane = <0>;
/* low-active PERST# reset on GPIO 25 */
reset-gpios = <&gpio0 25 1>;
/* wait 20ms for device settle after reset deassertion */
reset-delay-us = <20000>;
clocks = <&gateclk 5>;
status = "disabled";
};
Expand Down
39 changes: 1 addition & 38 deletions arch/arm/mach-dove/board-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,56 +23,20 @@
#include <plat/irq.h>
#include "common.h"

/*
* There are still devices that doesn't even know about DT,
* get clock gates here and add a clock lookup.
*/
static void __init dove_legacy_clk_init(void)
{
struct device_node *np = of_find_compatible_node(NULL, NULL,
"marvell,dove-gating-clock");
struct of_phandle_args clkspec;

clkspec.np = np;
clkspec.args_count = 1;

clkspec.args[0] = CLOCK_GATING_BIT_PCIE0;
orion_clkdev_add("0", "pcie",
of_clk_get_from_provider(&clkspec));

clkspec.args[0] = CLOCK_GATING_BIT_PCIE1;
orion_clkdev_add("1", "pcie",
of_clk_get_from_provider(&clkspec));
}

static void __init dove_dt_time_init(void)
{
of_clk_init(NULL);
clocksource_of_init();
}

static void __init dove_dt_init_early(void)
{
mvebu_mbus_init("marvell,dove-mbus",
BRIDGE_WINS_BASE, BRIDGE_WINS_SZ,
DOVE_MC_WINS_BASE, DOVE_MC_WINS_SZ);
}

static void __init dove_dt_init(void)
{
pr_info("Dove 88AP510 SoC\n");

#ifdef CONFIG_CACHE_TAUROS2
tauros2_init(0);
#endif
dove_setup_cpu_wins();

/* Setup clocks for legacy devices */
dove_legacy_clk_init();

/* Internal devices not ported to DT yet */
dove_pcie_init(1, 1);

BUG_ON(mvebu_mbus_dt_init());
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}

Expand All @@ -83,7 +47,6 @@ static const char * const dove_dt_board_compat[] = {

DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)")
.map_io = dove_map_io,
.init_early = dove_dt_init_early,
.init_time = dove_dt_time_init,
.init_machine = dove_dt_init,
.restart = dove_restart,
Expand Down
Loading

0 comments on commit 0397bb8

Please sign in to comment.