Commit cbda94e0 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'drivers-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC driver changes from Arnd Bergmann:
 "These changes are mostly for ARM specific device drivers that either
  don't have an upstream maintainer, or that had the maintainer ask us
  to pick up the changes to avoid conflicts.

  A large chunk of this are clock drivers (bcm281xx, exynos, versatile,
  shmobile), aside from that, reset controllers for STi as well as a
  large rework of the Marvell Orion/EBU watchdog driver are notable"

* tag 'drivers-3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (99 commits)
  Revert "dts: socfpga: Add DTS entry for adding the stmmac glue layer for stmmac."
  Revert "net: stmmac: Add SOCFPGA glue driver"
  ARM: shmobile: r8a7791: Fix SCIFA3-5 clocks
  ARM: STi: Add reset controller support to mach-sti Kconfig
  drivers: reset: stih416: add softreset controller
  drivers: reset: stih415: add softreset controller
  drivers: reset: Reset controller driver for STiH416
  drivers: reset: Reset controller driver for STiH415
  drivers: reset: STi SoC system configuration reset controller support
  dts: socfpga: Add sysmgr node so the gmac can use to reference
  dts: socfpga: Add support for SD/MMC on the SOCFPGA platform
  reset: Add optional resets and stubs
  ARM: shmobile: r7s72100: fix bus clock calculation
  Power: Reset: Generalize qnap-poweroff to work on Synology devices.
  dts: socfpga: Update clock entry to support multiple parents
  ARM: socfpga: Update socfpga_defconfig
  dts: socfpga: Add DTS entry for adding the stmmac glue layer for stmmac.
  net: stmmac: Add SOCFPGA glue driver
  watchdog: orion_wdt: Use %pa to print 'phys_addr_t'
  drivers: cci: Export CCI PMU revision
  ...
parents f83ccb93 f1d7d8c8
...@@ -50,6 +50,11 @@ Optional ...@@ -50,6 +50,11 @@ Optional
regions, used when the GIC doesn't have banked registers. The offset is regions, used when the GIC doesn't have banked registers. The offset is
cpu-offset * cpu-nr. cpu-offset * cpu-nr.
- arm,routable-irqs : Total number of gic irq inputs which are not directly
connected from the peripherals, but are routed dynamically
by a crossbar/multiplexer preceding the GIC. The GIC irq
input line is assigned dynamically when the corresponding
peripheral's crossbar line is mapped.
Example: Example:
intc: interrupt-controller@fff11000 { intc: interrupt-controller@fff11000 {
...@@ -57,6 +62,7 @@ Example: ...@@ -57,6 +62,7 @@ Example:
#interrupt-cells = <3>; #interrupt-cells = <3>;
#address-cells = <1>; #address-cells = <1>;
interrupt-controller; interrupt-controller;
arm,routable-irqs = <160>;
reg = <0xfff11000 0x1000>, reg = <0xfff11000 0x1000>,
<0xfff10100 0x100>; <0xfff10100 0x100>;
}; };
......
Some socs have a large number of interrupts requests to service
the needs of its many peripherals and subsystems. All of the
interrupt lines from the subsystems are not needed at the same
time, so they have to be muxed to the irq-controller appropriately.
In such places a interrupt controllers are preceded by an CROSSBAR
that provides flexibility in muxing the device requests to the controller
inputs.
Required properties:
- compatible : Should be "ti,irq-crossbar"
- reg: Base address and the size of the crossbar registers.
- ti,max-irqs: Total number of irqs available at the interrupt controller.
- ti,reg-size: Size of a individual register in bytes. Every individual
register is assumed to be of same size. Valid sizes are 1, 2, 4.
- ti,irqs-reserved: List of the reserved irq lines that are not muxed using
crossbar. These interrupt lines are reserved in the soc,
so crossbar bar driver should not consider them as free
lines.
Examples:
crossbar_mpu: @4a020000 {
compatible = "ti,irq-crossbar";
reg = <0x4a002a48 0x130>;
ti,max-irqs = <160>;
ti,reg-size = <2>;
ti,irqs-reserved = <0 1 2 3 5 6 131 132 139 140>;
};
Clock bindings for ARM Integrator Core Module clocks
Auxilary Oscillator Clock
This is a configurable clock fed from a 24 MHz chrystal,
used for generating e.g. video clocks. It is located on the
core module and there is only one of these.
This clock node *must* be a subnode of the core module, since
it obtains the base address for it's address range from its
parent node.
Required properties:
- compatible: must be "arm,integrator-cm-auxosc"
- #clock-cells: must be <0>
Optional properties:
- clocks: parent clock(s)
Example:
core-module@10000000 {
xtal24mhz: xtal24mhz@24M {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <24000000>;
};
auxosc: cm_aux_osc@25M {
#clock-cells = <0>;
compatible = "arm,integrator-cm-auxosc";
clocks = <&xtal24mhz>;
};
};
* Altera SOCFPGA specific extensions to the Synopsys Designware Mobile
Storage Host Controller
The Synopsys designware mobile storage host controller is used to interface
a SoC with storage medium such as eMMC or SD/MMC cards. This file documents
differences between the core Synopsys dw mshc controller properties described
by synopsys-dw-mshc.txt and the properties used by the Altera SOCFPGA specific
extensions to the Synopsys Designware Mobile Storage Host Controller.
Required Properties:
* compatible: should be
- "altr,socfpga-dw-mshc": for Altera's SOCFPGA platform
Example:
mmc: dwmmc0@ff704000 {
compatible = "altr,socfpga-dw-mshc";
reg = <0xff704000 0x1000>;
interrupts = <0 129 4>;
#address-cells = <1>;
#size-cells = <0>;
};
...@@ -6,8 +6,11 @@ Orion5x SoCs. Sending the character 'A', at 19200 baud, tells the ...@@ -6,8 +6,11 @@ Orion5x SoCs. Sending the character 'A', at 19200 baud, tells the
microcontroller to turn the power off. This driver adds a handler to microcontroller to turn the power off. This driver adds a handler to
pm_power_off which is called to turn the power off. pm_power_off which is called to turn the power off.
Synology NAS devices use a similar scheme, but a different baud rate,
9600, and a different character, '1'.
Required Properties: Required Properties:
- compatible: Should be "qnap,power-off" - compatible: Should be "qnap,power-off" or "synology,power-off"
- reg: Address and length of the register set for UART1 - reg: Address and length of the register set for UART1
- clocks: tclk clock - clocks: tclk clock
...@@ -3,17 +3,24 @@ ...@@ -3,17 +3,24 @@
Required Properties: Required Properties:
- Compatibility : "marvell,orion-wdt" - Compatibility : "marvell,orion-wdt"
- reg : Address of the timer registers "marvell,armada-370-wdt"
"marvell,armada-xp-wdt"
- reg : Should contain two entries: first one with the
timer control address, second one with the
rstout enable address.
Optional properties: Optional properties:
- interrupts : Contains the IRQ for watchdog expiration
- timeout-sec : Contains the watchdog timeout in seconds - timeout-sec : Contains the watchdog timeout in seconds
Example: Example:
wdt@20300 { wdt@20300 {
compatible = "marvell,orion-wdt"; compatible = "marvell,orion-wdt";
reg = <0x20300 0x28>; reg = <0x20300 0x28>, <0x20108 0x4>;
interrupts = <3>;
timeout-sec = <10>; timeout-sec = <10>;
status = "okay"; status = "okay";
}; };
...@@ -18,6 +18,28 @@ chosen { ...@@ -18,6 +18,28 @@ chosen {
bootargs = "root=/dev/ram0 console=ttyAM0,38400n8 earlyprintk"; bootargs = "root=/dev/ram0 console=ttyAM0,38400n8 earlyprintk";
}; };
/* 24 MHz chrystal on the core module */
xtal24mhz: xtal24mhz@24M {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <24000000>;
};
pclk: pclk@0 {
#clock-cells = <0>;
compatible = "fixed-factor-clock";
clock-div = <1>;
clock-mult = <1>;
clocks = <&xtal24mhz>;
};
/* The UART clock is 14.74 MHz divided by an ICS525 */
uartclk: uartclk@14.74M {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <14745600>;
};
syscon { syscon {
compatible = "arm,integrator-ap-syscon"; compatible = "arm,integrator-ap-syscon";
reg = <0x11000000 0x100>; reg = <0x11000000 0x100>;
...@@ -28,14 +50,17 @@ syscon { ...@@ -28,14 +50,17 @@ syscon {
timer0: timer@13000000 { timer0: timer@13000000 {
compatible = "arm,integrator-timer"; compatible = "arm,integrator-timer";
clocks = <&xtal24mhz>;
}; };
timer1: timer@13000100 { timer1: timer@13000100 {
compatible = "arm,integrator-timer"; compatible = "arm,integrator-timer";
clocks = <&xtal24mhz>;
}; };
timer2: timer@13000200 { timer2: timer@13000200 {
compatible = "arm,integrator-timer"; compatible = "arm,integrator-timer";
clocks = <&xtal24mhz>;
}; };
pic: pic@14000000 { pic: pic@14000000 {
...@@ -92,26 +117,36 @@ fpga { ...@@ -92,26 +117,36 @@ fpga {
rtc: rtc@15000000 { rtc: rtc@15000000 {
compatible = "arm,pl030", "arm,primecell"; compatible = "arm,pl030", "arm,primecell";
arm,primecell-periphid = <0x00041030>; arm,primecell-periphid = <0x00041030>;
clocks = <&pclk>;
clock-names = "apb_pclk";
}; };
uart0: uart@16000000 { uart0: uart@16000000 {
compatible = "arm,pl010", "arm,primecell"; compatible = "arm,pl010", "arm,primecell";
arm,primecell-periphid = <0x00041010>; arm,primecell-periphid = <0x00041010>;
clocks = <&uartclk>, <&pclk>;
clock-names = "uartclk", "apb_pclk";
}; };
uart1: uart@17000000 { uart1: uart@17000000 {
compatible = "arm,pl010", "arm,primecell"; compatible = "arm,pl010", "arm,primecell";
arm,primecell-periphid = <0x00041010>; arm,primecell-periphid = <0x00041010>;
clocks = <&uartclk>, <&pclk>;
clock-names = "uartclk", "apb_pclk";
}; };
kmi0: kmi@18000000 { kmi0: kmi@18000000 {
compatible = "arm,pl050", "arm,primecell"; compatible = "arm,pl050", "arm,primecell";
arm,primecell-periphid = <0x00041050>; arm,primecell-periphid = <0x00041050>;
clocks = <&xtal24mhz>, <&pclk>;
clock-names = "KMIREFCLK", "apb_pclk";
}; };
kmi1: kmi@19000000 { kmi1: kmi@19000000 {
compatible = "arm,pl050", "arm,primecell"; compatible = "arm,pl050", "arm,primecell";
arm,primecell-periphid = <0x00041050>; arm,primecell-periphid = <0x00041050>;
clocks = <&xtal24mhz>, <&pclk>;
clock-names = "KMIREFCLK", "apb_pclk";
}; };
}; };
}; };
...@@ -13,25 +13,107 @@ chosen { ...@@ -13,25 +13,107 @@ chosen {
bootargs = "root=/dev/ram0 console=ttyAMA0,38400n8 earlyprintk"; bootargs = "root=/dev/ram0 console=ttyAMA0,38400n8 earlyprintk";
}; };
/*
* The Integrator/CP overall clocking architecture can be found in
* ARM DUI 0184B page 7-28 "Integrator/CP922T system clocks" which
* appear to illustrate the layout used in most configurations.
*/
/* The codec chrystal operates at 24.576 MHz */
xtal_codec: xtal24.576@24.576M {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <24576000>;
};
/* The chrystal is divided by 2 by the codec for the AACI bit clock */
aaci_bitclk: aaci_bitclk@12.288M {
#clock-cells = <0>;
compatible = "fixed-factor-clock";
clock-div = <2>;
clock-mult = <1>;
clocks = <&xtal_codec>;
};
/* This is a 25MHz chrystal on the base board */
xtal25mhz: xtal25mhz@25M {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <25000000>;
};
/* The UART clock is 14.74 MHz divided from 25MHz by an ICS525 */
uartclk: uartclk@14.74M {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <14745600>;
};
/* Actually sysclk I think */
pclk: pclk@0 {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <0>;
};
core-module@10000000 {
/* 24 MHz chrystal on the core module */
xtal24mhz: xtal24mhz@24M {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <24000000>;
};
/*
* External oscillator on the core module, usually used
* to drive video circuitry. Driven from the 24MHz clock.
*/
auxosc: cm_aux_osc@25M {
#clock-cells = <0>;
compatible = "arm,integrator-cm-auxosc";
clocks = <&xtal24mhz>;
};
/* The KMI clock is the 24 MHz oscillator divided to 8MHz */
kmiclk: kmiclk@1M {
#clock-cells = <0>;
compatible = "fixed-factor-clock";
clock-div = <3>;
clock-mult = <1>;
clocks = <&xtal24mhz>;
};
/* The timer clock is the 24 MHz oscillator divided to 1MHz */
timclk: timclk@1M {
#clock-cells = <0>;
compatible = "fixed-factor-clock";
clock-div = <24>;
clock-mult = <1>;
clocks = <&xtal24mhz>;
};
};
syscon { syscon {
compatible = "arm,integrator-cp-syscon"; compatible = "arm,integrator-cp-syscon";
reg = <0xcb000000 0x100>; reg = <0xcb000000 0x100>;
}; };
timer0: timer@13000000 { timer0: timer@13000000 {
/* TIMER0 runs @ 25MHz */ /* TIMER0 runs directly on the 25MHz chrystal */
compatible = "arm,integrator-cp-timer"; compatible = "arm,integrator-cp-timer";
status = "disabled"; clocks = <&xtal25mhz>;
}; };
timer1: timer@13000100 { timer1: timer@13000100 {
/* TIMER1 runs @ 1MHz */ /* TIMER1 runs @ 1MHz */
compatible = "arm,integrator-cp-timer"; compatible = "arm,integrator-cp-timer";
clocks = <&timclk>;
}; };
timer2: timer@13000200 { timer2: timer@13000200 {
/* TIMER2 runs @ 1MHz */ /* TIMER2 runs @ 1MHz */
compatible = "arm,integrator-cp-timer"; compatible = "arm,integrator-cp-timer";
clocks = <&timclk>;
}; };
pic: pic@14000000 { pic: pic@14000000 {
...@@ -74,22 +156,32 @@ fpga { ...@@ -74,22 +156,32 @@ fpga {
*/ */
rtc@15000000 { rtc@15000000 {
compatible = "arm,pl031", "arm,primecell"; compatible = "arm,pl031", "arm,primecell";
clocks = <&pclk>;
clock-names = "apb_pclk";
}; };
uart@16000000 { uart@16000000 {
compatible = "arm,pl011", "arm,primecell"; compatible = "arm,pl011", "arm,primecell";
clocks = <&uartclk>, <&pclk>;
clock-names = "uartclk", "apb_pclk";
}; };
uart@17000000 { uart@17000000 {
compatible = "arm,pl011", "arm,primecell"; compatible = "arm,pl011", "arm,primecell";
clocks = <&uartclk>, <&pclk>;
clock-names = "uartclk", "apb_pclk";
}; };
kmi@18000000 { kmi@18000000 {
compatible = "arm,pl050", "arm,primecell"; compatible = "arm,pl050", "arm,primecell";
clocks = <&kmiclk>, <&pclk>;
clock-names = "KMIREFCLK", "apb_pclk";
}; };
kmi@19000000 { kmi@19000000 {
compatible = "arm,pl050", "arm,primecell"; compatible = "arm,pl050", "arm,primecell";
clocks = <&kmiclk>, <&pclk>;
clock-names = "KMIREFCLK", "apb_pclk";
}; };
/* /*
...@@ -100,18 +192,24 @@ mmc@1c000000 { ...@@ -100,18 +192,24 @@ mmc@1c000000 {
reg = <0x1c000000 0x1000>; reg = <0x1c000000 0x1000>;
interrupts = <23 24>; interrupts = <23 24>;
max-frequency = <515633>; max-frequency = <515633>;
clocks = <&uartclk>, <&pclk>;
clock-names = "mclk", "apb_pclk";
}; };
aaci@1d000000 { aaci@1d000000 {
compatible = "arm,pl041", "arm,primecell"; compatible = "arm,pl041", "arm,primecell";
reg = <0x1d000000 0x1000>; reg = <0x1d000000 0x1000>;
interrupts = <25>; interrupts = <25>;
clocks = <&pclk>;
clock-names = "apb_pclk";
}; };
clcd@c0000000 { clcd@c0000000 {
compatible = "arm,pl110", "arm,primecell"; compatible = "arm,pl110", "arm,primecell";
reg = <0xC0000000 0x1000>; reg = <0xC0000000 0x1000>;
interrupts = <22>; interrupts = <22>;
clocks = <&auxosc>, <&pclk>;
clock-names = "clcd", "apb_pclk";
}; };
}; };
}; };
...@@ -421,6 +421,29 @@ extal_clk: extal_clk { ...@@ -421,6 +421,29 @@ extal_clk: extal_clk {
clock-output-names = "extal"; clock-output-names = "extal";
}; };
/*
* The external audio clocks are configured as 0 Hz fixed frequency clocks by
* default. Boards that provide audio clocks should override them.
*/
audio_clk_a: audio_clk_a {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <0>;
clock-output-names = "audio_clk_a";
};
audio_clk_b: audio_clk_b {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <0>;
clock-output-names = "audio_clk_b";
};
audio_clk_c: audio_clk_c {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <0>;
clock-output-names = "audio_clk_c";
};
/* Special CPG clocks */ /* Special CPG clocks */
cpg_clocks: cpg_clocks@e6150000 { cpg_clocks: cpg_clocks@e6150000 {
compatible = "renesas,r8a7790-cpg-clocks", compatible = "renesas,r8a7790-cpg-clocks",
......
...@@ -92,7 +92,12 @@ clocks { ...@@ -92,7 +92,12 @@ clocks {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
osc: osc1 { osc1: osc1 {
#clock-cells = <0>;
compatible = "fixed-clock";
};
osc2: osc2 {
#clock-cells = <0>; #clock-cells = <0>;
compatible = "fixed-clock"; compatible = "fixed-clock";
}; };
...@@ -100,7 +105,11 @@ osc: osc1 { ...@@ -100,7 +105,11 @@ osc: osc1 {
f2s_periph_ref_clk: f2s_periph_ref_clk { f2s_periph_ref_clk: f2s_periph_ref_clk {
#clock-cells = <0>; #clock-cells = <0>;
compatible = "fixed-clock"; compatible = "fixed-clock";
clock-frequency = <10000000>; };
f2s_sdram_ref_clk: f2s_sdram_ref_clk {
#clock-cells = <0>;
compatible = "fixed-clock";
}; };
main_pll: main_pll { main_pll: main_pll {
...@@ -108,7 +117,7 @@ main_pll: main_pll { ...@@ -108,7 +117,7 @@ main_pll: main_pll {
#size-cells = <0>; #size-cells = <0>;
#clock-cells = <0>; #clock-cells = <0>;
compatible = "altr,socfpga-pll-clock"; compatible = "altr,socfpga-pll-clock";
clocks = <&osc>; clocks = <&osc1>;
reg = <0x40>; reg = <0x40>;
mpuclk: mpuclk { mpuclk: mpuclk {
...@@ -162,7 +171,7 @@ periph_pll: periph_pll { ...@@ -162,7 +171,7 @@ periph_pll: periph_pll {
#size-cells = <0>; #size-cells = <0>;
#clock-cells = <0>; #clock-cells = <0>;
compatible = "altr,socfpga-pll-clock"; compatible = "altr,socfpga-pll-clock";
clocks = <&osc>; clocks = <&osc1>, <&osc2>, <&f2s_periph_ref_clk>;
reg = <0x80>; reg = <0x80>;
emac0_clk: emac0_clk { emac0_clk: emac0_clk {
...@@ -213,7 +222,7 @@ sdram_pll: sdram_pll { ...@@ -213,7 +222,7 @@ sdram_pll: sdram_pll {
#size-cells = <0>; #size-cells = <0>;
#clock-cells = <0>; #clock-cells = <0>;
compatible = "altr,socfpga-pll-clock"; compatible = "altr,socfpga-pll-clock";
clocks = <&osc>; clocks = <&osc1>, <&osc2>, <&f2s_sdram_ref_clk>;
reg = <0xC0>; reg = <0xC0>;
ddr_dqs_clk: ddr_dqs_clk { ddr_dqs_clk: ddr_dqs_clk {
...@@ -475,6 +484,17 @@ L2: l2-cache@fffef000 { ...@@ -475,6 +484,17 @@ L2: l2-cache@fffef000 {
arm,data-latency = <2 1 1>; arm,data-latency = <2 1 1>;
}; };
mmc: dwmmc0@ff704000 {
compatible = "altr,socfpga-dw-mshc";
reg = <0xff704000 0x1000>;
interrupts = <0 139 4>;
fifo-depth = <0x400>;
#address-cells = <1>;
#size-cells = <0>;
clocks = <&l4_mp_clk>, <&sdmmc_clk>;
clock-names = "biu", "ciu";
};
/* Local timer */ /* Local timer */
timer@fffec600 { timer@fffec600 {
compatible = "arm,cortex-a9-twd-timer"; compatible = "arm,cortex-a9-twd-timer";
...@@ -528,9 +548,9 @@ rstmgr@ffd05000 { ...@@ -528,9 +548,9 @@ rstmgr@ffd05000 {
reg = <0xffd05000 0x1000>; reg = <0xffd05000 0x1000>;
}; };
sysmgr@ffd08000 { sysmgr: sysmgr@ffd08000 {
compatible = "altr,sys-mgr"; compatible = "altr,sys-mgr", "syscon";
reg = <0xffd08000 0x4000>; reg = <0xffd08000 0x4000>;
}; };
}; };
}; };
...@@ -27,6 +27,17 @@ osc1 { ...@@ -27,6 +27,17 @@ osc1 {
}; };
}; };
dwmmc0@ff704000 {
num-slots = <1>;
supports-highspeed;
broken-cd;
slot@0 {
reg = <0>;
bus-width = <4>;
};
};
serial0@ffc02000 { serial0@ffc02000 {
clock-frequency = <100000000>; clock-frequency = <100000000>;
}; };
......
...@@ -28,6 +28,17 @@ osc1 { ...@@ -28,6 +28,17 @@ osc1 {
}; };
}; };
dwmmc0@ff704000 {
num-slots = <1>;
supports-highspeed;
broken-cd;
slot@0 {
reg = <0>;
bus-width = <4>;
};
};
ethernet@ff702000 { ethernet@ff702000 {
phy-mode = "rgmii"; phy-mode = "rgmii";
phy-addr = <0xffffffff>; /* probe for phy addr */ phy-addr = <0xffffffff>; /* probe for phy addr */
......
...@@ -41,6 +41,17 @@ osc1 { ...@@ -41,6 +41,17 @@ osc1 {
}; };
}; };
dwmmc0@ff704000 {
num-slots = <1>;
supports-highspeed;
broken-cd;
slot@0 {
reg = <0>;
bus-width = <4>;
};
};
ethernet@ff700000 { ethernet@ff700000 {
phy-mode = "gmii"; phy-mode = "gmii";
status = "okay"; status = "okay";
......
...@@ -271,10 +271,14 @@ static void __init integrator_cp_of_init(struct device_node *np) ...@@ -271,10 +271,14 @@ static void __init integrator_cp_of_init(struct device_node *np)
void __iomem *base; void __iomem *base;
int irq; int irq;
const char *name = of_get_property(np, "compatible", NULL); const char *name = of_get_property(np, "compatible", NULL);
struct clk *clk;
base = of_iomap(np, 0); base = of_iomap(np, 0);
if (WARN_ON(!base)) if (WARN_ON(!base))
return; return;
clk = of_clk_get(np, 0);
if (WARN_ON(IS_ERR(clk)))
return;
/* Ensure timer is disabled */ /* Ensure timer is disabled */
writel(0, base + TIMER_CTRL); writel(0, base + TIMER_CTRL);
...@@ -283,13 +287,13 @@ static void __init integrator_cp_of_init(struct device_node *np) ...@@ -283,13 +287,13 @@ static void __init integrator_cp_of_init(struct device_node *np)
goto err; goto err;
if (!init_count) if (!init_count)
sp804_clocksource_init(base, name); __sp804_clocksource_and_sched_clock_init(base, name, clk, 0);
else { else {
irq = irq_of_parse_and_map(np, 0); irq = irq_of_parse_and_map(np, 0);
if (irq <= 0) if (irq <= 0)
goto err; goto err;
sp804_clockevents_init(base, irq, name); __sp804_clockevents_init(base, irq, clk, name);
} }
init_count++; init_count++;
......
...@@ -52,6 +52,7 @@ CONFIG_BLK_DEV_SD=y ...@@ -52,6 +52,7 @@ CONFIG_BLK_DEV_SD=y
# CONFIG_SCSI_LOWLEVEL is not set # CONFIG_SCSI_LOWLEVEL is not set
CONFIG_NETDEVICES=y CONFIG_NETDEVICES=y
CONFIG_STMMAC_ETH=y CONFIG_STMMAC_ETH=y
CONFIG_MICREL_PHY=y
# CONFIG_STMMAC_PHY_ID_ZERO_WORKAROUND is not set # CONFIG_STMMAC_PHY_ID_ZERO_WORKAROUND is not set
CONFIG_INPUT_EVDEV=y CONFIG_INPUT_EVDEV=y
# CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_SERPORT is not set
...@@ -66,6 +67,9 @@ CONFIG_SERIAL_8250_DW=y ...@@ -66,6 +67,9 @@ CONFIG_SERIAL_8250_DW=y
CONFIG_EXT2_FS=y CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y CONFIG_EXT2_FS_POSIX_ACL=y
CONFIG_EXT3_FS=y
CONFIG_NFS_FS=y
CONFIG_ROOT_NFS=y
# CONFIG_DNOTIFY is not set # CONFIG_DNOTIFY is not set
# CONFIG_INOTIFY_USER is not set # CONFIG_INOTIFY_USER is not set
CONFIG_VFAT_FS=y CONFIG_VFAT_FS=y
...@@ -82,3 +86,5 @@ CONFIG_DEBUG_INFO=y ...@@ -82,3 +86,5 @@ CONFIG_DEBUG_INFO=y
CONFIG_ENABLE_DEFAULT_TRACERS=y CONFIG_ENABLE_DEFAULT_TRACERS=y
CONFIG_DEBUG_USER=y CONFIG_DEBUG_USER=y
CONFIG_XZ_DEC=y CONFIG_XZ_DEC=y
CONFIG_MMC=y
CONFIG_MMC_DW=y
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/time.h> #include <linux/time.h>
#include <linux/platform_data/mtd-davinci-aemif.h> #include <linux/platform_data/mtd-davinci-aemif.h>
#include <linux/platform_data/mtd-davinci.h>
/* Timing value configuration */ /* Timing value configuration */
...@@ -43,6 +44,17 @@ ...@@ -43,6 +44,17 @@
WSTROBE(WSTROBE_MAX) | \ WSTROBE(WSTROBE_MAX) | \
WSETUP(WSETUP_MAX)) WSETUP(WSETUP_MAX))
static inline unsigned int davinci_aemif_readl(void __iomem *base, int offset)
{
return readl_relaxed(base + offset);
}
static inline void davinci_aemif_writel(void __iomem *base,
int offset, unsigned long value)
{
writel_relaxed(value, base + offset);
}
/* /*
* aemif_calc_rate - calculate timing data. * aemif_calc_rate - calculate timing data.
* @wanted: The cycle time needed in nanoseconds. * @wanted: The cycle time needed in nanoseconds.
...@@ -76,6 +88,7 @@ static int aemif_calc_rate(int wanted, unsigned long clk, int max) ...@@ -76,6 +88,7 @@ static int aemif_calc_rate(int wanted, unsigned long clk, int max)
* @t: timing values to be progammed * @t: timing values to be progammed
* @base: The virtual base address of the AEMIF interface * @base: The virtual base address of the AEMIF interface
* @cs: chip-select to program the timing values for * @cs: chip-select to program the timing values for
* @clkrate: the AEMIF clkrate
* *
* This function programs the given timing values (in real clock) into the * This function programs the given timing values (in real clock) into the
* AEMIF registers taking the AEMIF clock into account. * AEMIF registers taking the AEMIF clock into account.
...@@ -86,24 +99,17 @@ static int aemif_calc_rate(int wanted, unsigned long clk, int max) ...@@ -86,24 +99,17 @@ static int aemif_calc_rate(int wanted, unsigned long clk, int max)
* *
* Returns 0 on success, else negative errno. * Returns 0 on success, else negative errno.
*/ */
int davinci_aemif_setup_timing(struct davinci_aemif_timing *t, static int davinci_aemif_setup_timing(struct davinci_aemif_timing *t,
void __iomem *base, unsigned cs) void __iomem *base, unsigned cs,
unsigned long clkrate)
{ {
unsigned set, val; unsigned set, val;
int ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup; int ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup;
unsigned offset = A1CR_OFFSET + cs * 4; unsigned offset = A1CR_OFFSET + cs * 4;
struct clk *aemif_clk;
unsigned long clkrate;
if (!t) if (!t)
return 0; /* Nothing to do */ return 0; /* Nothing to do */
aemif_clk = clk_get(NULL, "aemif");
if (IS_ERR(aemif_clk))
return PTR_ERR(aemif_clk);
clkrate = clk_get_rate(aemif_clk);
clkrate /= 1000; /* turn clock into kHz for ease of use */ clkrate /= 1000; /* turn clock into kHz for ease of use */
ta = aemif_calc_rate(t->ta, clkrate, TA_MAX); ta = aemif_calc_rate(t->ta, clkrate, TA_MAX);
...@@ -130,4 +136,83 @@ int davinci_aemif_setup_timing(struct davinci_aemif_timing *t, ...@@ -130,4 +136,83 @@ int davinci_aemif_setup_timing(struct davinci_aemif_timing *t,
return 0; return 0;
} }
EXPORT_SYMBOL(davinci_aemif_setup_timing);
/**
* davinci_aemif_setup - setup AEMIF interface by davinci_nand_pdata
* @pdev - link to platform device to setup settings for
*
* This function does not use any locking while programming the AEMIF
* because it is expected that there is only one user of a given
* chip-select.
*
* Returns 0 on success, else negative errno.
*/
int davinci_aemif_setup(struct platform_device *pdev)
{
struct davinci_nand_pdata *pdata = dev_get_platdata(&pdev->dev);
uint32_t val;
unsigned long clkrate;
struct resource *res;
void __iomem *base;
struct clk *clk;
int ret = 0;
clk = clk_get(&pdev->dev, "aemif");
if (IS_ERR(clk)) {
ret = PTR_ERR(clk);
dev_dbg(&pdev->dev, "unable to get AEMIF clock, err %d\n", ret);
return ret;
}
ret = clk_prepare_enable(clk);
if (ret < 0) {
dev_dbg(&pdev->dev, "unable to enable AEMIF clock, err %d\n",
ret);
goto err_put;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!res) {
dev_err(&pdev->dev, "cannot get IORESOURCE_MEM\n");
ret = -ENOMEM;
goto err;
}
base = ioremap(res->start, resource_size(res));
if (!base) {
dev_err(&pdev->dev, "ioremap failed for resource %pR\n", res);
ret = -ENOMEM;
goto err;
}
/*
* Setup Async configuration register in case we did not boot
* from NAND and so bootloader did not bother to set it up.
*/
val = davinci_aemif_readl(base, A1CR_OFFSET + pdev->id * 4);
/*
* Extended Wait is not valid and Select Strobe mode is not
* used
*/
val &= ~(ACR_ASIZE_MASK | ACR_EW_MASK | ACR_SS_MASK);
if (pdata->options & NAND_BUSWIDTH_16)
val |= 0x1;
davinci_aemif_writel(base, A1CR_OFFSET + pdev->id * 4, val);
clkrate = clk_get_rate(clk);
if (pdata->timing)
ret = davinci_aemif_setup_timing(pdata->timing, base, pdev->id,
clkrate);
if (ret < 0)
dev_dbg(&pdev->dev, "NAND timing values setup fail\n");
iounmap(base);
err:
clk_disable_unprepare(clk);
err_put:
clk_put(clk);
return ret;
}
...@@ -419,6 +419,9 @@ static inline void da830_evm_init_nand(int mux_mode) ...@@ -419,6 +419,9 @@ static inline void da830_evm_init_nand(int mux_mode)
if (ret) if (ret)
pr_warning("da830_evm_init: NAND device not registered.\n"); pr_warning("da830_evm_init: NAND device not registered.\n");
if (davinci_aemif_setup(&da830_evm_nand_device))
pr_warn("%s: Cannot configure AEMIF.\n", __func__);
gpio_direction_output(mux_mode, 1); gpio_direction_output(mux_mode, 1);
} }
#else #else
......
...@@ -358,6 +358,9 @@ static inline void da850_evm_setup_nor_nand(void) ...@@ -358,6 +358,9 @@ static inline void da850_evm_setup_nor_nand(void)
platform_add_devices(da850_evm_devices, platform_add_devices(da850_evm_devices,
ARRAY_SIZE(da850_evm_devices)); ARRAY_SIZE(da850_evm_devices));
if (davinci_aemif_setup(&da850_evm_nandflash_device))
pr_warn("%s: Cannot configure AEMIF.\n", __func__);
} }
} }
......
...@@ -778,6 +778,11 @@ static __init void davinci_evm_init(void) ...@@ -778,6 +778,11 @@ static __init void davinci_evm_init(void)
/* only one device will be jumpered and detected */ /* only one device will be jumpered and detected */
if (HAS_NAND) { if (HAS_NAND) {
platform_device_register(&davinci_evm_nandflash_device); platform_device_register(&davinci_evm_nandflash_device);
if (davinci_aemif_setup(&davinci_evm_nandflash_device))
pr_warn("%s: Cannot configure AEMIF.\n",
__func__);
evm_leds[7].default_trigger = "nand-disk"; evm_leds[7].default_trigger = "nand-disk";
if (HAS_NOR) if (HAS_NOR)
pr_warning("WARNING: both NAND and NOR flash " pr_warning("WARNING: both NAND and NOR flash "
......
...@@ -805,6 +805,9 @@ static __init void evm_init(void) ...@@ -805,6 +805,9 @@ static __init void evm_init(void)
platform_device_register(&davinci_nand_device); platform_device_register(&davinci_nand_device);
if (davinci_aemif_setup(&davinci_nand_device))
pr_warn("%s: Cannot configure AEMIF.\n", __func__);
dm646x_init_edma(dm646x_edma_rsv); dm646x_init_edma(dm646x_edma_rsv);
if (HAS_ATA) if (HAS_ATA)
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <mach/cp_intc.h> #include <mach/cp_intc.h>
#include <mach/da8xx.h> #include <mach/da8xx.h>
#include <linux/platform_data/mtd-davinci.h> #include <linux/platform_data/mtd-davinci.h>
#include <linux/platform_data/mtd-davinci-aemif.h>
#include <mach/mux.h> #include <mach/mux.h>
#include <linux/platform_data/spi-davinci.h> #include <linux/platform_data/spi-davinci.h>
...@@ -432,6 +433,9 @@ static void __init mityomapl138_setup_nand(void) ...@@ -432,6 +433,9 @@ static void __init mityomapl138_setup_nand(void)
{ {
platform_add_devices(mityomapl138_devices, platform_add_devices(mityomapl138_devices,
ARRAY_SIZE(mityomapl138_devices)); ARRAY_SIZE(mityomapl138_devices));
if (davinci_aemif_setup(&mityomapl138_nandflash_device))
pr_warn("%s: Cannot configure AEMIF.\n", __func__);
} }
static const short mityomap_mii_pins[] = { static const short mityomap_mii_pins[] = {
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#define CPU_CTRL_PCIE1_LINK 0x00000008 #define CPU_CTRL_PCIE1_LINK 0x00000008
#define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108) #define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
#define RSTOUTn_MASK_PHYS (BRIDGE_PHYS_BASE + 0x0108)
#define SOFT_RESET_OUT_EN 0x00000004 #define SOFT_RESET_OUT_EN 0x00000004
#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c) #define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
......
...@@ -35,56 +35,6 @@ ...@@ -35,56 +35,6 @@
#include "common.h" #include "common.h"
#include "regs-pmu.h" #include "regs-pmu.h"
#define EXYNOS4_EPLL_LOCK (S5P_VA_CMU + 0x0C010)
#define EXYNOS4_VPLL_LOCK (S5P_VA_CMU + 0x0C020)
#define EXYNOS4_EPLL_CON0 (S5P_VA_CMU + 0x0C110)
#define EXYNOS4_EPLL_CON1 (S5P_VA_CMU + 0x0C114)
#define EXYNOS4_VPLL_CON0 (S5P_VA_CMU + 0x0C120)
#define EXYNOS4_VPLL_CON1 (S5P_VA_CMU + 0x0C124)
#define EXYNOS4_CLKSRC_MASK_TOP (S5P_VA_CMU + 0x0C310)
#define EXYNOS4_CLKSRC_MASK_CAM (S5P_VA_CMU + 0x0C320)
#define EXYNOS4_CLKSRC_MASK_TV (S5P_VA_CMU + 0x0C324)
#define EXYNOS4_CLKSRC_MASK_LCD0 (S5P_VA_CMU + 0x0C334)
#define EXYNOS4_CLKSRC_MASK_MAUDIO (S5P_VA_CMU + 0x0C33C)
#define EXYNOS4_CLKSRC_MASK_FSYS (S5P_VA_CMU + 0x0C340)
#define EXYNOS4_CLKSRC_MASK_PERIL0 (S5P_VA_CMU + 0x0C350)
#define EXYNOS4_CLKSRC_MASK_PERIL1 (S5P_VA_CMU + 0x0C354)
#define EXYNOS4_CLKSRC_MASK_DMC (S5P_VA_CMU + 0x10300)
#define EXYNOS4_EPLLCON0_LOCKED_SHIFT (29)
#define EXYNOS4_VPLLCON0_LOCKED_SHIFT (29)
#define EXYNOS4210_CLKSRC_MASK_LCD1 (S5P_VA_CMU + 0x0C338)
static const struct sleep_save exynos4_set_clksrc[] = {
{ .reg = EXYNOS4_CLKSRC_MASK_TOP , .val = 0x00000001, },
{ .reg = EXYNOS4_CLKSRC_MASK_CAM , .val = 0x11111111, },
{ .reg = EXYNOS4_CLKSRC_MASK_TV , .val = 0x00000111, },
{ .reg = EXYNOS4_CLKSRC_MASK_LCD0 , .val = 0x00001111, },
{ .reg = EXYNOS4_CLKSRC_MASK_MAUDIO , .val = 0x00000001, },
{ .reg = EXYNOS4_CLKSRC_MASK_FSYS , .val = 0x01011111, },
{ .reg = EXYNOS4_CLKSRC_MASK_PERIL0 , .val = 0x01111111, },
{ .reg = EXYNOS4_CLKSRC_MASK_PERIL1 , .val = 0x01110111, },
{ .reg = EXYNOS4_CLKSRC_MASK_DMC , .val = 0x00010000, },
};
static const struct sleep_save exynos4210_set_clksrc[] = {
{ .reg = EXYNOS4210_CLKSRC_MASK_LCD1 , .val = 0x00001111, },
};
static struct sleep_save exynos4_epll_save[] = {
SAVE_ITEM(EXYNOS4_EPLL_CON0),
SAVE_ITEM(EXYNOS4_EPLL_CON1),
};
static struct sleep_save exynos4_vpll_save[] = {
SAVE_ITEM(EXYNOS4_VPLL_CON0),
SAVE_ITEM(EXYNOS4_VPLL_CON1),
};
static struct sleep_save exynos5_sys_save[] = { static struct sleep_save exynos5_sys_save[] = {
SAVE_ITEM(EXYNOS5_SYS_I2C_CFG), SAVE_ITEM(EXYNOS5_SYS_I2C_CFG),
}; };
...@@ -124,10 +74,7 @@ static void exynos_pm_prepare(void) ...@@ -124,10 +74,7 @@ static void exynos_pm_prepare(void)
s3c_pm_do_save(exynos_core_save, ARRAY_SIZE(exynos_core_save)); s3c_pm_do_save(exynos_core_save, ARRAY_SIZE(exynos_core_save));
if (!soc_is_exynos5250()) { if (soc_is_exynos5250()) {
s3c_pm_do_save(exynos4_epll_save, ARRAY_SIZE(exynos4_epll_save));
s3c_pm_do_save(exynos4_vpll_save, ARRAY_SIZE(exynos4_vpll_save));
} else {
s3c_pm_do_save(exynos5_sys_save, ARRAY_SIZE(exynos5_sys_save)); s3c_pm_do_save(exynos5_sys_save, ARRAY_SIZE(exynos5_sys_save));
/* Disable USE_RETENTION of JPEG_MEM_OPTION */ /* Disable USE_RETENTION of JPEG_MEM_OPTION */
tmp = __raw_readl(EXYNOS5_JPEG_MEM_OPTION); tmp = __raw_readl(EXYNOS5_JPEG_MEM_OPTION);
...@@ -143,15 +90,6 @@ static void exynos_pm_prepare(void) ...@@ -143,15 +90,6 @@ static void exynos_pm_prepare(void)
/* ensure at least INFORM0 has the resume address */ /* ensure at least INFORM0 has the resume address */
__raw_writel(virt_to_phys(s3c_cpu_resume), S5P_INFORM0); __raw_writel(virt_to_phys(s3c_cpu_resume), S5P_INFORM0);
/* Before enter central sequence mode, clock src register have to set */
if (!soc_is_exynos5250())
s3c_pm_do_restore_core(exynos4_set_clksrc, ARRAY_SIZE(exynos4_set_clksrc));
if (soc_is_exynos4210())
s3c_pm_do_restore_core(exynos4210_set_clksrc, ARRAY_SIZE(exynos4210_set_clksrc));
} }
static int exynos_pm_add(struct device *dev, struct subsys_interface *sif) static int exynos_pm_add(struct device *dev, struct subsys_interface *sif)
...@@ -162,73 +100,6 @@ static int exynos_pm_add(struct device *dev, struct subsys_interface *sif) ...@@ -162,73 +100,6 @@ static int exynos_pm_add(struct device *dev, struct subsys_interface *sif)
return 0; return 0;
} }
static unsigned long pll_base_rate;
static void exynos4_restore_pll(void)
{
unsigned long pll_con, locktime, lockcnt;
unsigned long pll_in_rate;
unsigned int p_div, epll_wait = 0, vpll_wait = 0;
if (pll_base_rate == 0)
return;
pll_in_rate = pll_base_rate;
/* EPLL */
pll_con = exynos4_epll_save[0].val;
if (pll_con & (1 << 31)) {
pll_con &= (PLL46XX_PDIV_MASK << PLL46XX_PDIV_SHIFT);
p_div = (pll_con >> PLL46XX_PDIV_SHIFT);
pll_in_rate /= 1000000;
locktime = (3000 / pll_in_rate) * p_div;
lockcnt = locktime * 10000 / (10000 / pll_in_rate);
__raw_writel(lockcnt, EXYNOS4_EPLL_LOCK);
s3c_pm_do_restore_core(exynos4_epll_save,
ARRAY_SIZE(exynos4_epll_save));
epll_wait = 1;
}
pll_in_rate = pll_base_rate;
/* VPLL */
pll_con = exynos4_vpll_save[0].val;
if (pll_con & (1 << 31)) {
pll_in_rate /= 1000000;
/* 750us */
locktime = 750;
lockcnt = locktime * 10000 / (10000 / pll_in_rate);
__raw_writel(lockcnt, EXYNOS4_VPLL_LOCK);
s3c_pm_do_restore_core(exynos4_vpll_save,
ARRAY_SIZE(exynos4_vpll_save));
vpll_wait = 1;
}
/* Wait PLL locking */
do {
if (epll_wait) {
pll_con = __raw_readl(EXYNOS4_EPLL_CON0);
if (pll_con & (1 << EXYNOS4_EPLLCON0_LOCKED_SHIFT))
epll_wait = 0;
}
if (vpll_wait) {
pll_con = __raw_readl(EXYNOS4_VPLL_CON0);
if (pll_con & (1 << EXYNOS4_VPLLCON0_LOCKED_SHIFT))
vpll_wait = 0;
}
} while (epll_wait || vpll_wait);
}
static struct subsys_interface exynos_pm_interface = { static struct subsys_interface exynos_pm_interface = {
.name = "exynos_pm", .name = "exynos_pm",
.subsys = &exynos_subsys, .subsys = &exynos_subsys,
...@@ -237,7 +108,6 @@ static struct subsys_interface exynos_pm_interface = { ...@@ -237,7 +108,6 @@ static struct subsys_interface exynos_pm_interface = {
static __init int exynos_pm_drvinit(void) static __init int exynos_pm_drvinit(void)
{ {
struct clk *pll_base;
unsigned int tmp; unsigned int tmp;
if (soc_is_exynos5440()) if (soc_is_exynos5440())
...@@ -251,15 +121,6 @@ static __init int exynos_pm_drvinit(void) ...@@ -251,15 +121,6 @@ static __init int exynos_pm_drvinit(void)
tmp |= ((0xFF << 8) | (0x1F << 1)); tmp |= ((0xFF << 8) | (0x1F << 1));
__raw_writel(tmp, S5P_WAKEUP_MASK); __raw_writel(tmp, S5P_WAKEUP_MASK);
if (!soc_is_exynos5250()) {
pll_base = clk_get(NULL, "xtal");
if (!IS_ERR(pll_base)) {
pll_base_rate = clk_get_rate(pll_base);
clk_put(pll_base);
}
}
return subsys_interface_register(&exynos_pm_interface); return subsys_interface_register(&exynos_pm_interface);
} }
arch_initcall(exynos_pm_drvinit); arch_initcall(exynos_pm_drvinit);
...@@ -343,13 +204,8 @@ static void exynos_pm_resume(void) ...@@ -343,13 +204,8 @@ static void exynos_pm_resume(void)
s3c_pm_do_restore_core(exynos_core_save, ARRAY_SIZE(exynos_core_save)); s3c_pm_do_restore_core(exynos_core_save, ARRAY_SIZE(exynos_core_save));
if (!soc_is_exynos5250()) { if (IS_ENABLED(CONFIG_SMP) && !soc_is_exynos5250())
exynos4_restore_pll();
#ifdef CONFIG_SMP
scu_enable(S5P_VA_SCU); scu_enable(S5P_VA_SCU);
#endif
}
early_wakeup: early_wakeup:
......
...@@ -30,6 +30,9 @@ config ARCH_CINTEGRATOR ...@@ -30,6 +30,9 @@ config ARCH_CINTEGRATOR
config INTEGRATOR_IMPD1 config INTEGRATOR_IMPD1
tristate "Include support for Integrator/IM-PD1" tristate "Include support for Integrator/IM-PD1"
depends on ARCH_INTEGRATOR_AP depends on ARCH_INTEGRATOR_AP
select ARCH_REQUIRE_GPIOLIB
select ARM_VIC
select GPIO_PL061 if GPIOLIB
help help
The IM-PD1 is an add-on logic module for the Integrator which The IM-PD1 is an add-on logic module for the Integrator which
allows ARM(R) Ltd PrimeCells to be developed and evaluated. allows ARM(R) Ltd PrimeCells to be developed and evaluated.
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/platform_data/clk-integrator.h> #include <linux/platform_data/clk-integrator.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/irqchip/arm-vic.h>
#include <mach/lm.h> #include <mach/lm.h>
#include <mach/impd1.h> #include <mach/impd1.h>
...@@ -35,6 +36,7 @@ MODULE_PARM_DESC(lmid, "logic module stack position"); ...@@ -35,6 +36,7 @@ MODULE_PARM_DESC(lmid, "logic module stack position");
struct impd1_module { struct impd1_module {
void __iomem *base; void __iomem *base;
void __iomem *vic_base;
}; };
void impd1_tweak_control(struct device *dev, u32 mask, u32 val) void impd1_tweak_control(struct device *dev, u32 mask, u32 val)
...@@ -262,9 +264,6 @@ struct impd1_device { ...@@ -262,9 +264,6 @@ struct impd1_device {
static struct impd1_device impd1_devs[] = { static struct impd1_device impd1_devs[] = {
{ {
.offset = 0x03000000,
.id = 0x00041190,
}, {
.offset = 0x00100000, .offset = 0x00100000,
.irq = { 1 }, .irq = { 1 },
.id = 0x00141011, .id = 0x00141011,
...@@ -304,46 +303,72 @@ static struct impd1_device impd1_devs[] = { ...@@ -304,46 +303,72 @@ static struct impd1_device impd1_devs[] = {
} }
}; };
static int impd1_probe(struct lm_device *dev) /*
* Valid IRQs: 0 thru 9 and 11, 10 unused.
*/
#define IMPD1_VALID_IRQS 0x00000bffU
static int __init impd1_probe(struct lm_device *dev)
{ {
struct impd1_module *impd1; struct impd1_module *impd1;
int i, ret; int irq_base;
int i;
if (dev->id != module_id) if (dev->id != module_id)
return -EINVAL; return -EINVAL;
if (!request_mem_region(dev->resource.start, SZ_4K, "LM registers")) if (!devm_request_mem_region(&dev->dev, dev->resource.start,
SZ_4K, "LM registers"))
return -EBUSY; return -EBUSY;
impd1 = kzalloc(sizeof(struct impd1_module), GFP_KERNEL); impd1 = devm_kzalloc(&dev->dev, sizeof(struct impd1_module),
if (!impd1) { GFP_KERNEL);
ret = -ENOMEM; if (!impd1)
goto release_lm; return -ENOMEM;
}
impd1->base = ioremap(dev->resource.start, SZ_4K); impd1->base = devm_ioremap(&dev->dev, dev->resource.start, SZ_4K);
if (!impd1->base) { if (!impd1->base)
ret = -ENOMEM; return -ENOMEM;
goto free_impd1;
}
lm_set_drvdata(dev, impd1); integrator_impd1_clk_init(impd1->base, dev->id);
printk("IM-PD1 found at 0x%08lx\n", if (!devm_request_mem_region(&dev->dev,
(unsigned long)dev->resource.start); dev->resource.start + 0x03000000,
SZ_4K, "VIC"))
return -EBUSY;
integrator_impd1_clk_init(impd1->base, dev->id); impd1->vic_base = devm_ioremap(&dev->dev,
dev->resource.start + 0x03000000,
SZ_4K);
if (!impd1->vic_base)
return -ENOMEM;
irq_base = vic_init_cascaded(impd1->vic_base, dev->irq,
IMPD1_VALID_IRQS, 0);
lm_set_drvdata(dev, impd1);
dev_info(&dev->dev, "IM-PD1 found at 0x%08lx\n",
(unsigned long)dev->resource.start);
for (i = 0; i < ARRAY_SIZE(impd1_devs); i++) { for (i = 0; i < ARRAY_SIZE(impd1_devs); i++) {
struct impd1_device *idev = impd1_devs + i; struct impd1_device *idev = impd1_devs + i;
struct amba_device *d; struct amba_device *d;
unsigned long pc_base; unsigned long pc_base;
char devname[32]; char devname[32];
int irq1 = idev->irq[0];
int irq2 = idev->irq[1];
/* Translate IRQs to IM-PD1 local numberspace */
if (irq1)
irq1 += irq_base;
if (irq2)
irq2 += irq_base;
pc_base = dev->resource.start + idev->offset; pc_base = dev->resource.start + idev->offset;
snprintf(devname, 32, "lm%x:%5.5lx", dev->id, idev->offset >> 12); snprintf(devname, 32, "lm%x:%5.5lx", dev->id, idev->offset >> 12);
d = amba_ahb_device_add_res(&dev->dev, devname, pc_base, SZ_4K, d = amba_ahb_device_add_res(&dev->dev, devname, pc_base, SZ_4K,
dev->irq, dev->irq, irq1, irq2,
idev->platform_data, idev->id, idev->platform_data, idev->id,
&dev->resource); &dev->resource);
if (IS_ERR(d)) { if (IS_ERR(d)) {
...@@ -353,14 +378,6 @@ static int impd1_probe(struct lm_device *dev) ...@@ -353,14 +378,6 @@ static int impd1_probe(struct lm_device *dev)
} }
return 0; return 0;
free_impd1:
if (impd1 && impd1->base)
iounmap(impd1->base);
kfree(impd1);
release_lm:
release_mem_region(dev->resource.start, SZ_4K);
return ret;
} }
static int impd1_remove_one(struct device *dev, void *data) static int impd1_remove_one(struct device *dev, void *data)
...@@ -371,16 +388,10 @@ static int impd1_remove_one(struct device *dev, void *data) ...@@ -371,16 +388,10 @@ static int impd1_remove_one(struct device *dev, void *data)
static void impd1_remove(struct lm_device *dev) static void impd1_remove(struct lm_device *dev)
{ {
struct impd1_module *impd1 = lm_get_drvdata(dev);
device_for_each_child(&dev->dev, NULL, impd1_remove_one); device_for_each_child(&dev->dev, NULL, impd1_remove_one);
integrator_impd1_clk_exit(dev->id); integrator_impd1_clk_exit(dev->id);
lm_set_drvdata(dev, NULL); lm_set_drvdata(dev, NULL);
iounmap(impd1->base);
kfree(impd1);
release_mem_region(dev->resource.start, SZ_4K);
} }
static struct lm_driver impd1_driver = { static struct lm_driver impd1_driver = {
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <linux/sys_soc.h> #include <linux/sys_soc.h>
#include <linux/termios.h> #include <linux/termios.h>
#include <linux/sched_clock.h> #include <linux/sched_clock.h>
#include <linux/clk-provider.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/platform.h> #include <mach/platform.h>
...@@ -402,10 +403,7 @@ static void __init ap_of_timer_init(void) ...@@ -402,10 +403,7 @@ static void __init ap_of_timer_init(void)
struct clk *clk; struct clk *clk;
unsigned long rate; unsigned long rate;
clk = clk_get_sys("ap_timer", NULL); of_clk_init(NULL);
BUG_ON(IS_ERR(clk));
clk_prepare_enable(clk);
rate = clk_get_rate(clk);
err = of_property_read_string(of_aliases, err = of_property_read_string(of_aliases,
"arm,timer-primary", &path); "arm,timer-primary", &path);
...@@ -415,6 +413,12 @@ static void __init ap_of_timer_init(void) ...@@ -415,6 +413,12 @@ static void __init ap_of_timer_init(void)
base = of_iomap(node, 0); base = of_iomap(node, 0);
if (WARN_ON(!base)) if (WARN_ON(!base))
return; return;
clk = of_clk_get(node, 0);
BUG_ON(IS_ERR(clk));
clk_prepare_enable(clk);
rate = clk_get_rate(clk);
writel(0, base + TIMER_CTRL); writel(0, base + TIMER_CTRL);
integrator_clocksource_init(rate, base); integrator_clocksource_init(rate, base);
...@@ -427,6 +431,12 @@ static void __init ap_of_timer_init(void) ...@@ -427,6 +431,12 @@ static void __init ap_of_timer_init(void)
if (WARN_ON(!base)) if (WARN_ON(!base))
return; return;
irq = irq_of_parse_and_map(node, 0); irq = irq_of_parse_and_map(node, 0);
clk = of_clk_get(node, 0);
BUG_ON(IS_ERR(clk));
clk_prepare_enable(clk);
rate = clk_get_rate(clk);
writel(0, base + TIMER_CTRL); writel(0, base + TIMER_CTRL);
integrator_clockevent_init(rate, base, irq); integrator_clockevent_init(rate, base, irq);
} }
...@@ -440,7 +450,6 @@ static void __init ap_init_irq_of(void) ...@@ -440,7 +450,6 @@ static void __init ap_init_irq_of(void)
{ {
cm_init(); cm_init();
of_irq_init(fpga_irq_of_match); of_irq_init(fpga_irq_of_match);
integrator_clk_init(false);
} }
/* For the Device Tree, add in the UART callbacks as AUXDATA */ /* For the Device Tree, add in the UART callbacks as AUXDATA */
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include <linux/irqchip/versatile-fpga.h> #include <linux/irqchip/versatile-fpga.h>
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/mtd/physmap.h> #include <linux/mtd/physmap.h>
#include <linux/platform_data/clk-integrator.h>
#include <linux/of_irq.h> #include <linux/of_irq.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
...@@ -33,8 +32,6 @@ ...@@ -33,8 +32,6 @@
#include <mach/platform.h> #include <mach/platform.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/hardware/arm_timer.h>
#include <asm/hardware/icst.h>
#include <mach/lm.h> #include <mach/lm.h>
...@@ -43,8 +40,6 @@ ...@@ -43,8 +40,6 @@
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
#include <asm/hardware/timer-sp.h>
#include <plat/clcd.h> #include <plat/clcd.h>
#include <plat/sched_clock.h> #include <plat/sched_clock.h>
...@@ -250,7 +245,6 @@ static void __init intcp_init_irq_of(void) ...@@ -250,7 +245,6 @@ static void __init intcp_init_irq_of(void)
{ {
cm_init(); cm_init();
of_irq_init(fpga_irq_of_match); of_irq_init(fpga_irq_of_match);
integrator_clk_init(true);
} }
/* /*
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#define CPU_RESET 0x00000002 #define CPU_RESET 0x00000002
#define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108) #define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
#define RSTOUTn_MASK_PHYS (BRIDGE_PHYS_BASE + 0x0108)
#define SOFT_RESET_OUT_EN 0x00000004 #define SOFT_RESET_OUT_EN 0x00000004
#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c) #define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#define L2_WRITETHROUGH 0x00020000 #define L2_WRITETHROUGH 0x00020000
#define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108) #define RSTOUTn_MASK (BRIDGE_VIRT_BASE + 0x0108)
#define RSTOUTn_MASK_PHYS (BRIDGE_PHYS_BASE + 0x0108)
#define SOFT_RESET_OUT_EN 0x00000004 #define SOFT_RESET_OUT_EN 0x00000004
#define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c) #define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE + 0x010c)
......
...@@ -74,6 +74,7 @@ config SOC_DRA7XX ...@@ -74,6 +74,7 @@ config SOC_DRA7XX
select ARM_CPU_SUSPEND if PM select ARM_CPU_SUSPEND if PM
select ARM_GIC select ARM_GIC
select HAVE_ARM_ARCH_TIMER select HAVE_ARM_ARCH_TIMER
select IRQ_CROSSBAR
config ARCH_OMAP2PLUS config ARCH_OMAP2PLUS
bool bool
......
...@@ -138,7 +138,7 @@ static void wakeupgen_mask(struct irq_data *d) ...@@ -138,7 +138,7 @@ static void wakeupgen_mask(struct irq_data *d)
unsigned long flags; unsigned long flags;
raw_spin_lock_irqsave(&wakeupgen_lock, flags); raw_spin_lock_irqsave(&wakeupgen_lock, flags);
_wakeupgen_clear(d->irq, irq_target_cpu[d->irq]); _wakeupgen_clear(d->hwirq, irq_target_cpu[d->hwirq]);
raw_spin_unlock_irqrestore(&wakeupgen_lock, flags); raw_spin_unlock_irqrestore(&wakeupgen_lock, flags);
} }
...@@ -150,7 +150,7 @@ static void wakeupgen_unmask(struct irq_data *d) ...@@ -150,7 +150,7 @@ static void wakeupgen_unmask(struct irq_data *d)
unsigned long flags; unsigned long flags;
raw_spin_lock_irqsave(&wakeupgen_lock, flags); raw_spin_lock_irqsave(&wakeupgen_lock, flags);
_wakeupgen_set(d->irq, irq_target_cpu[d->irq]); _wakeupgen_set(d->hwirq, irq_target_cpu[d->hwirq]);
raw_spin_unlock_irqrestore(&wakeupgen_lock, flags); raw_spin_unlock_irqrestore(&wakeupgen_lock, flags);
} }
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/irqchip/arm-gic.h> #include <linux/irqchip/arm-gic.h>
#include <linux/irqchip/irq-crossbar.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/reboot.h> #include <linux/reboot.h>
...@@ -288,5 +289,8 @@ void __init omap_gic_of_init(void) ...@@ -288,5 +289,8 @@ void __init omap_gic_of_init(void)
skip_errata_init: skip_errata_init:
omap_wakeupgen_init(); omap_wakeupgen_init();
#ifdef CONFIG_IRQ_CROSSBAR
irqcrossbar_init();
#endif
irqchip_init(); irqchip_init();
} }
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#define CPU_CTRL (ORION5X_BRIDGE_VIRT_BASE + 0x104) #define CPU_CTRL (ORION5X_BRIDGE_VIRT_BASE + 0x104)
#define RSTOUTn_MASK (ORION5X_BRIDGE_VIRT_BASE + 0x108) #define RSTOUTn_MASK (ORION5X_BRIDGE_VIRT_BASE + 0x108)
#define RSTOUTn_MASK_PHYS (ORION5X_BRIDGE_PHYS_BASE + 0x108)
#define CPU_SOFT_RESET (ORION5X_BRIDGE_VIRT_BASE + 0x10c) #define CPU_SOFT_RESET (ORION5X_BRIDGE_VIRT_BASE + 0x10c)
......
...@@ -22,12 +22,15 @@ ...@@ -22,12 +22,15 @@
#include <mach/common.h> #include <mach/common.h>
#include <mach/r7s72100.h> #include <mach/r7s72100.h>
/* registers */ /* Frequency Control Registers */
#define FRQCR 0xfcfe0010 #define FRQCR 0xfcfe0010
#define FRQCR2 0xfcfe0014 #define FRQCR2 0xfcfe0014
/* Standby Control Registers */
#define STBCR3 0xfcfe0420 #define STBCR3 0xfcfe0420
#define STBCR4 0xfcfe0424 #define STBCR4 0xfcfe0424
#define STBCR7 0xfcfe0430
#define STBCR9 0xfcfe0438 #define STBCR9 0xfcfe0438
#define STBCR10 0xfcfe043c
#define PLL_RATE 30 #define PLL_RATE 30
...@@ -67,7 +70,7 @@ static struct clk pll_clk = { ...@@ -67,7 +70,7 @@ static struct clk pll_clk = {
static unsigned long bus_recalc(struct clk *clk) static unsigned long bus_recalc(struct clk *clk)
{ {
return clk->parent->rate * 2 / 3; return clk->parent->rate / 3;
} }
static struct sh_clk_ops bus_clk_ops = { static struct sh_clk_ops bus_clk_ops = {
...@@ -145,15 +148,25 @@ struct clk div4_clks[DIV4_NR] = { ...@@ -145,15 +148,25 @@ struct clk div4_clks[DIV4_NR] = {
| CLK_ENABLE_ON_INIT), | CLK_ENABLE_ON_INIT),
}; };
enum { MSTP97, MSTP96, MSTP95, MSTP94, enum {
MSTP107, MSTP106, MSTP105, MSTP104, MSTP103,
MSTP97, MSTP96, MSTP95, MSTP94,
MSTP74,
MSTP47, MSTP46, MSTP45, MSTP44, MSTP43, MSTP42, MSTP41, MSTP40, MSTP47, MSTP46, MSTP45, MSTP44, MSTP43, MSTP42, MSTP41, MSTP40,
MSTP33, MSTP_NR }; MSTP33, MSTP_NR
};
static struct clk mstp_clks[MSTP_NR] = { static struct clk mstp_clks[MSTP_NR] = {
[MSTP107] = SH_CLK_MSTP8(&peripheral1_clk, STBCR10, 7, 0), /* RSPI0 */
[MSTP106] = SH_CLK_MSTP8(&peripheral1_clk, STBCR10, 6, 0), /* RSPI1 */
[MSTP105] = SH_CLK_MSTP8(&peripheral1_clk, STBCR10, 5, 0), /* RSPI2 */
[MSTP104] = SH_CLK_MSTP8(&peripheral1_clk, STBCR10, 4, 0), /* RSPI3 */
[MSTP103] = SH_CLK_MSTP8(&peripheral1_clk, STBCR10, 3, 0), /* RSPI4 */
[MSTP97] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 7, 0), /* RIIC0 */ [MSTP97] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 7, 0), /* RIIC0 */
[MSTP96] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 6, 0), /* RIIC1 */ [MSTP96] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 6, 0), /* RIIC1 */
[MSTP95] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 5, 0), /* RIIC2 */ [MSTP95] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 5, 0), /* RIIC2 */
[MSTP94] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 4, 0), /* RIIC3 */ [MSTP94] = SH_CLK_MSTP8(&peripheral0_clk, STBCR9, 4, 0), /* RIIC3 */
[MSTP74] = SH_CLK_MSTP8(&peripheral1_clk, STBCR7, 4, 0), /* Ether */
[MSTP47] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 7, 0), /* SCIF0 */ [MSTP47] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 7, 0), /* SCIF0 */
[MSTP46] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 6, 0), /* SCIF1 */ [MSTP46] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 6, 0), /* SCIF1 */
[MSTP45] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 5, 0), /* SCIF2 */ [MSTP45] = SH_CLK_MSTP8(&peripheral1_clk, STBCR4, 5, 0), /* SCIF2 */
...@@ -176,6 +189,21 @@ static struct clk_lookup lookups[] = { ...@@ -176,6 +189,21 @@ static struct clk_lookup lookups[] = {
CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]), CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
/* MSTP clocks */ /* MSTP clocks */
CLKDEV_DEV_ID("rspi-rz.0", &mstp_clks[MSTP107]),
CLKDEV_DEV_ID("rspi-rz.1", &mstp_clks[MSTP106]),
CLKDEV_DEV_ID("rspi-rz.2", &mstp_clks[MSTP105]),
CLKDEV_DEV_ID("rspi-rz.3", &mstp_clks[MSTP104]),
CLKDEV_DEV_ID("rspi-rz.4", &mstp_clks[MSTP103]),
CLKDEV_DEV_ID("e800c800.spi", &mstp_clks[MSTP107]),
CLKDEV_DEV_ID("e800d000.spi", &mstp_clks[MSTP106]),
CLKDEV_DEV_ID("e800d800.spi", &mstp_clks[MSTP105]),
CLKDEV_DEV_ID("e800e000.spi", &mstp_clks[MSTP104]),
CLKDEV_DEV_ID("e800e800.spi", &mstp_clks[MSTP103]),
CLKDEV_DEV_ID("fcfee000.i2c", &mstp_clks[MSTP97]),
CLKDEV_DEV_ID("fcfee400.i2c", &mstp_clks[MSTP96]),
CLKDEV_DEV_ID("fcfee800.i2c", &mstp_clks[MSTP95]),
CLKDEV_DEV_ID("fcfeec00.i2c", &mstp_clks[MSTP94]),
CLKDEV_DEV_ID("r7s72100-ether", &mstp_clks[MSTP74]),
CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP33]), CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP33]),
/* ICK */ /* ICK */
......
...@@ -221,6 +221,10 @@ static struct clk_lookup lookups[] = { ...@@ -221,6 +221,10 @@ static struct clk_lookup lookups[] = {
CLKDEV_DEV_ID("fffc6000.spi", &mstp_clks[MSTP007]), /* HSPI2 */ CLKDEV_DEV_ID("fffc6000.spi", &mstp_clks[MSTP007]), /* HSPI2 */
CLKDEV_DEV_ID("rcar_sound", &mstp_clks[MSTP008]), /* SRU */ CLKDEV_DEV_ID("rcar_sound", &mstp_clks[MSTP008]), /* SRU */
CLKDEV_ICK_ID("clk_a", "rcar_sound", &audio_clk_a),
CLKDEV_ICK_ID("clk_b", "rcar_sound", &audio_clk_b),
CLKDEV_ICK_ID("clk_c", "rcar_sound", &audio_clk_c),
CLKDEV_ICK_ID("clk_i", "rcar_sound", &s1_clk),
CLKDEV_ICK_ID("ssi.0", "rcar_sound", &mstp_clks[MSTP012]), CLKDEV_ICK_ID("ssi.0", "rcar_sound", &mstp_clks[MSTP012]),
CLKDEV_ICK_ID("ssi.1", "rcar_sound", &mstp_clks[MSTP011]), CLKDEV_ICK_ID("ssi.1", "rcar_sound", &mstp_clks[MSTP011]),
CLKDEV_ICK_ID("ssi.2", "rcar_sound", &mstp_clks[MSTP010]), CLKDEV_ICK_ID("ssi.2", "rcar_sound", &mstp_clks[MSTP010]),
......
...@@ -120,16 +120,16 @@ static struct clk mstp_clks[MSTP_NR] = { ...@@ -120,16 +120,16 @@ static struct clk mstp_clks[MSTP_NR] = {
[MSTP322] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 22, 0), /* SDHI1 */ [MSTP322] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 22, 0), /* SDHI1 */
[MSTP321] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 21, 0), /* SDHI2 */ [MSTP321] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 21, 0), /* SDHI2 */
[MSTP320] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 20, 0), /* SDHI3 */ [MSTP320] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 20, 0), /* SDHI3 */
[MSTP120] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 20, 0), /* VIN3 */ [MSTP120] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 20, MSTPSR1, 0), /* VIN3 */
[MSTP116] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 16, 0), /* PCIe */ [MSTP116] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 16, MSTPSR1, 0), /* PCIe */
[MSTP115] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 15, 0), /* SATA */ [MSTP115] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 15, MSTPSR1, 0), /* SATA */
[MSTP114] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 14, 0), /* Ether */ [MSTP114] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 14, MSTPSR1, 0), /* Ether */
[MSTP110] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 10, 0), /* VIN0 */ [MSTP110] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 10, MSTPSR1, 0), /* VIN0 */
[MSTP109] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 9, 0), /* VIN1 */ [MSTP109] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 9, MSTPSR1, 0), /* VIN1 */
[MSTP108] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 8, 0), /* VIN2 */ [MSTP108] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 8, MSTPSR1, 0), /* VIN2 */
[MSTP103] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 3, 0), /* DU */ [MSTP103] = SH_CLK_MSTP32_STS(&clks_clk, MSTPCR1, 3, MSTPSR1, 0), /* DU */
[MSTP101] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 1, 0), /* USB2 */ [MSTP101] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 1, MSTPSR1, 0), /* USB2 */
[MSTP100] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 0, 0), /* USB0/1 */ [MSTP100] = SH_CLK_MSTP32_STS(&clkp_clk, MSTPCR1, 0, MSTPSR1, 0), /* USB0/1 */
[MSTP030] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 30, 0), /* I2C0 */ [MSTP030] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 30, 0), /* I2C0 */
[MSTP029] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 29, 0), /* I2C1 */ [MSTP029] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 29, 0), /* I2C1 */
[MSTP028] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 28, 0), /* I2C2 */ [MSTP028] = SH_CLK_MSTP32(&clkp_clk, MSTPCR0, 28, 0), /* I2C2 */
......
This diff is collapsed.
...@@ -59,10 +59,19 @@ ...@@ -59,10 +59,19 @@
#define SMSTPCR10 0xE6150998 #define SMSTPCR10 0xE6150998
#define SMSTPCR11 0xE615099C #define SMSTPCR11 0xE615099C
#define MSTPSR1 IOMEM(0xe6150038)
#define MSTPSR2 IOMEM(0xe6150040)
#define MSTPSR3 IOMEM(0xe6150048)
#define MSTPSR5 IOMEM(0xe615003c)
#define MSTPSR7 IOMEM(0xe61501c4)
#define MSTPSR8 IOMEM(0xe61509a0)
#define MSTPSR9 IOMEM(0xe61509a4)
#define MSTPSR11 IOMEM(0xe61509ac)
#define MODEMR 0xE6160060 #define MODEMR 0xE6160060
#define SDCKCR 0xE6150074 #define SDCKCR 0xE6150074
#define SD2CKCR 0xE6150078 #define SD1CKCR 0xE6150078
#define SD3CKCR 0xE615007C #define SD2CKCR 0xE615026c
#define MMC0CKCR 0xE6150240 #define MMC0CKCR 0xE6150240
#define MMC1CKCR 0xE6150244 #define MMC1CKCR 0xE6150244
#define SSPCKCR 0xE6150248 #define SSPCKCR 0xE6150248
...@@ -93,6 +102,7 @@ static struct clk main_clk = { ...@@ -93,6 +102,7 @@ static struct clk main_clk = {
*/ */
SH_FIXED_RATIO_CLK_SET(pll1_clk, main_clk, 1, 1); SH_FIXED_RATIO_CLK_SET(pll1_clk, main_clk, 1, 1);
SH_FIXED_RATIO_CLK_SET(pll3_clk, main_clk, 1, 1); SH_FIXED_RATIO_CLK_SET(pll3_clk, main_clk, 1, 1);
SH_FIXED_RATIO_CLK_SET(qspi_clk, pll1_clk, 1, 1);
/* fixed ratio clock */ /* fixed ratio clock */
SH_FIXED_RATIO_CLK_SET(extal_div2_clk, extal_clk, 1, 2); SH_FIXED_RATIO_CLK_SET(extal_div2_clk, extal_clk, 1, 2);
...@@ -103,7 +113,9 @@ SH_FIXED_RATIO_CLK_SET(hp_clk, pll1_clk, 1, 12); ...@@ -103,7 +113,9 @@ SH_FIXED_RATIO_CLK_SET(hp_clk, pll1_clk, 1, 12);
SH_FIXED_RATIO_CLK_SET(p_clk, pll1_clk, 1, 24); SH_FIXED_RATIO_CLK_SET(p_clk, pll1_clk, 1, 24);
SH_FIXED_RATIO_CLK_SET(rclk_clk, pll1_clk, 1, (48 * 1024)); SH_FIXED_RATIO_CLK_SET(rclk_clk, pll1_clk, 1, (48 * 1024));
SH_FIXED_RATIO_CLK_SET(mp_clk, pll1_div2_clk, 1, 15); SH_FIXED_RATIO_CLK_SET(mp_clk, pll1_div2_clk, 1, 15);
SH_FIXED_RATIO_CLK_SET(zg_clk, pll1_clk, 1, 3);
SH_FIXED_RATIO_CLK_SET(zx_clk, pll1_clk, 1, 3); SH_FIXED_RATIO_CLK_SET(zx_clk, pll1_clk, 1, 3);
SH_FIXED_RATIO_CLK_SET(zs_clk, pll1_clk, 1, 6);
static struct clk *main_clks[] = { static struct clk *main_clks[] = {
&extal_clk, &extal_clk,
...@@ -114,46 +126,103 @@ static struct clk *main_clks[] = { ...@@ -114,46 +126,103 @@ static struct clk *main_clks[] = {
&pll3_clk, &pll3_clk,
&hp_clk, &hp_clk,
&p_clk, &p_clk,
&qspi_clk,
&rclk_clk, &rclk_clk,
&mp_clk, &mp_clk,
&cp_clk, &cp_clk,
&zg_clk,
&zx_clk, &zx_clk,
&zs_clk,
};
/* SDHI (DIV4) clock */
static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 18, 24, 0, 36, 48, 10 };
static struct clk_div_mult_table div4_div_mult_table = {
.divisors = divisors,
.nr_divisors = ARRAY_SIZE(divisors),
};
static struct clk_div4_table div4_table = {
.div_mult_table = &div4_div_mult_table,
};
enum {
DIV4_SDH, DIV4_SD0,
DIV4_NR
};
static struct clk div4_clks[DIV4_NR] = {
[DIV4_SDH] = SH_CLK_DIV4(&pll1_clk, SDCKCR, 8, 0x0dff, CLK_ENABLE_ON_INIT),
[DIV4_SD0] = SH_CLK_DIV4(&pll1_clk, SDCKCR, 4, 0x1de0, CLK_ENABLE_ON_INIT),
};
/* DIV6 clocks */
enum {
DIV6_SD1, DIV6_SD2,
DIV6_NR
};
static struct clk div6_clks[DIV6_NR] = {
[DIV6_SD1] = SH_CLK_DIV6(&pll1_div2_clk, SD1CKCR, 0),
[DIV6_SD2] = SH_CLK_DIV6(&pll1_div2_clk, SD2CKCR, 0),
}; };
/* MSTP */ /* MSTP */
enum { enum {
MSTP1108, MSTP1107, MSTP1106,
MSTP931, MSTP930, MSTP929, MSTP928, MSTP927, MSTP925,
MSTP917,
MSTP815, MSTP814,
MSTP813, MSTP813,
MSTP811, MSTP810, MSTP809,
MSTP726, MSTP724, MSTP723, MSTP721, MSTP720, MSTP726, MSTP724, MSTP723, MSTP721, MSTP720,
MSTP719, MSTP718, MSTP715, MSTP714, MSTP719, MSTP718, MSTP715, MSTP714,
MSTP522, MSTP522,
MSTP314, MSTP312, MSTP311,
MSTP216, MSTP207, MSTP206, MSTP216, MSTP207, MSTP206,
MSTP204, MSTP203, MSTP202, MSTP1105, MSTP1106, MSTP1107, MSTP204, MSTP203, MSTP202,
MSTP124, MSTP124,
MSTP_NR MSTP_NR
}; };
static struct clk mstp_clks[MSTP_NR] = { static struct clk mstp_clks[MSTP_NR] = {
[MSTP813] = SH_CLK_MSTP32(&p_clk, SMSTPCR8, 13, 0), /* Ether */ [MSTP1108] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 8, MSTPSR11, 0), /* SCIFA5 */
[MSTP726] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 26, 0), /* LVDS0 */ [MSTP1107] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 7, MSTPSR11, 0), /* SCIFA4 */
[MSTP724] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 24, 0), /* DU0 */ [MSTP1106] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 6, MSTPSR11, 0), /* SCIFA3 */
[MSTP723] = SH_CLK_MSTP32(&zx_clk, SMSTPCR7, 23, 0), /* DU1 */ [MSTP931] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 31, MSTPSR9, 0), /* I2C0 */
[MSTP721] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 21, 0), /* SCIF0 */ [MSTP930] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 30, MSTPSR9, 0), /* I2C1 */
[MSTP720] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 20, 0), /* SCIF1 */ [MSTP929] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 29, MSTPSR9, 0), /* I2C2 */
[MSTP719] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 19, 0), /* SCIF2 */ [MSTP928] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */
[MSTP718] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 18, 0), /* SCIF3 */ [MSTP927] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 27, MSTPSR9, 0), /* I2C4 */
[MSTP715] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 15, 0), /* SCIF4 */ [MSTP925] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 25, MSTPSR9, 0), /* I2C5 */
[MSTP714] = SH_CLK_MSTP32(&p_clk, SMSTPCR7, 14, 0), /* SCIF5 */ [MSTP917] = SH_CLK_MSTP32_STS(&qspi_clk, SMSTPCR9, 17, MSTPSR9, 0), /* QSPI */
[MSTP522] = SH_CLK_MSTP32(&extal_clk, SMSTPCR5, 22, 0), /* Thermal */ [MSTP815] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 15, MSTPSR8, 0), /* SATA0 */
[MSTP216] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 16, 0), /* SCIFB2 */ [MSTP814] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 14, MSTPSR8, 0), /* SATA1 */
[MSTP207] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 7, 0), /* SCIFB1 */ [MSTP813] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR8, 13, MSTPSR8, 0), /* Ether */
[MSTP206] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 6, 0), /* SCIFB0 */ [MSTP811] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 11, MSTPSR8, 0), /* VIN0 */
[MSTP204] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 4, 0), /* SCIFA0 */ [MSTP810] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 10, MSTPSR8, 0), /* VIN1 */
[MSTP203] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 3, 0), /* SCIFA1 */ [MSTP809] = SH_CLK_MSTP32_STS(&zg_clk, SMSTPCR8, 9, MSTPSR8, 0), /* VIN2 */
[MSTP202] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 2, 0), /* SCIFA2 */ [MSTP726] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 26, MSTPSR7, 0), /* LVDS0 */
[MSTP1105] = SH_CLK_MSTP32(&mp_clk, SMSTPCR11, 5, 0), /* SCIFA3 */ [MSTP724] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 24, MSTPSR7, 0), /* DU0 */
[MSTP1106] = SH_CLK_MSTP32(&mp_clk, SMSTPCR11, 6, 0), /* SCIFA4 */ [MSTP723] = SH_CLK_MSTP32_STS(&zx_clk, SMSTPCR7, 23, MSTPSR7, 0), /* DU1 */
[MSTP1107] = SH_CLK_MSTP32(&mp_clk, SMSTPCR11, 7, 0), /* SCIFA5 */ [MSTP721] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 21, MSTPSR7, 0), /* SCIF0 */
[MSTP124] = SH_CLK_MSTP32(&rclk_clk, SMSTPCR1, 24, 0), /* CMT0 */ [MSTP720] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 20, MSTPSR7, 0), /* SCIF1 */
[MSTP719] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 19, MSTPSR7, 0), /* SCIF2 */
[MSTP718] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 18, MSTPSR7, 0), /* SCIF3 */
[MSTP715] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 15, MSTPSR7, 0), /* SCIF4 */
[MSTP714] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR7, 14, MSTPSR7, 0), /* SCIF5 */
[MSTP522] = SH_CLK_MSTP32_STS(&extal_clk, SMSTPCR5, 22, MSTPSR5, 0), /* Thermal */
[MSTP314] = SH_CLK_MSTP32_STS(&div4_clks[DIV4_SD0], SMSTPCR3, 14, MSTPSR3, 0), /* SDHI0 */
[MSTP312] = SH_CLK_MSTP32_STS(&div6_clks[DIV6_SD1], SMSTPCR3, 12, MSTPSR3, 0), /* SDHI1 */
[MSTP311] = SH_CLK_MSTP32_STS(&div6_clks[DIV6_SD2], SMSTPCR3, 11, MSTPSR3, 0), /* SDHI2 */
[MSTP216] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 16, MSTPSR2, 0), /* SCIFB2 */
[MSTP207] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 7, MSTPSR2, 0), /* SCIFB1 */
[MSTP206] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 6, MSTPSR2, 0), /* SCIFB0 */
[MSTP204] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 4, MSTPSR2, 0), /* SCIFA0 */
[MSTP203] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 3, MSTPSR2, 0), /* SCIFA1 */
[MSTP202] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR2, 2, MSTPSR2, 0), /* SCIFA2 */
[MSTP124] = SH_CLK_MSTP32_STS(&rclk_clk, SMSTPCR1, 24, MSTPSR1, 0), /* CMT0 */
}; };
static struct clk_lookup lookups[] = { static struct clk_lookup lookups[] = {
...@@ -165,8 +234,11 @@ static struct clk_lookup lookups[] = { ...@@ -165,8 +234,11 @@ static struct clk_lookup lookups[] = {
CLKDEV_CON_ID("pll1", &pll1_clk), CLKDEV_CON_ID("pll1", &pll1_clk),
CLKDEV_CON_ID("pll1_div2", &pll1_div2_clk), CLKDEV_CON_ID("pll1_div2", &pll1_div2_clk),
CLKDEV_CON_ID("pll3", &pll3_clk), CLKDEV_CON_ID("pll3", &pll3_clk),
CLKDEV_CON_ID("zg", &zg_clk),
CLKDEV_CON_ID("zs", &zs_clk),
CLKDEV_CON_ID("hp", &hp_clk), CLKDEV_CON_ID("hp", &hp_clk),
CLKDEV_CON_ID("p", &p_clk), CLKDEV_CON_ID("p", &p_clk),
CLKDEV_CON_ID("qspi", &qspi_clk),
CLKDEV_CON_ID("rclk", &rclk_clk), CLKDEV_CON_ID("rclk", &rclk_clk),
CLKDEV_CON_ID("mp", &mp_clk), CLKDEV_CON_ID("mp", &mp_clk),
CLKDEV_CON_ID("cp", &cp_clk), CLKDEV_CON_ID("cp", &cp_clk),
...@@ -188,13 +260,27 @@ static struct clk_lookup lookups[] = { ...@@ -188,13 +260,27 @@ static struct clk_lookup lookups[] = {
CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP718]), /* SCIF3 */ CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP718]), /* SCIF3 */
CLKDEV_DEV_ID("sh-sci.10", &mstp_clks[MSTP715]), /* SCIF4 */ CLKDEV_DEV_ID("sh-sci.10", &mstp_clks[MSTP715]), /* SCIF4 */
CLKDEV_DEV_ID("sh-sci.11", &mstp_clks[MSTP714]), /* SCIF5 */ CLKDEV_DEV_ID("sh-sci.11", &mstp_clks[MSTP714]), /* SCIF5 */
CLKDEV_DEV_ID("sh-sci.12", &mstp_clks[MSTP1105]), /* SCIFA3 */ CLKDEV_DEV_ID("sh-sci.12", &mstp_clks[MSTP1106]), /* SCIFA3 */
CLKDEV_DEV_ID("sh-sci.13", &mstp_clks[MSTP1106]), /* SCIFA4 */ CLKDEV_DEV_ID("sh-sci.13", &mstp_clks[MSTP1107]), /* SCIFA4 */
CLKDEV_DEV_ID("sh-sci.14", &mstp_clks[MSTP1107]), /* SCIFA5 */ CLKDEV_DEV_ID("sh-sci.14", &mstp_clks[MSTP1108]), /* SCIFA5 */
CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]),
CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP312]),
CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]),
CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]), CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
CLKDEV_DEV_ID("e61f0000.thermal", &mstp_clks[MSTP522]), CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]),
CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]), CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
CLKDEV_DEV_ID("i2c-rcar_gen2.0", &mstp_clks[MSTP931]),
CLKDEV_DEV_ID("i2c-rcar_gen2.1", &mstp_clks[MSTP930]),
CLKDEV_DEV_ID("i2c-rcar_gen2.2", &mstp_clks[MSTP929]),
CLKDEV_DEV_ID("i2c-rcar_gen2.3", &mstp_clks[MSTP928]),
CLKDEV_DEV_ID("i2c-rcar_gen2.4", &mstp_clks[MSTP927]),
CLKDEV_DEV_ID("i2c-rcar_gen2.5", &mstp_clks[MSTP925]),
CLKDEV_DEV_ID("r8a7791-ether", &mstp_clks[MSTP813]), /* Ether */ CLKDEV_DEV_ID("r8a7791-ether", &mstp_clks[MSTP813]), /* Ether */
CLKDEV_DEV_ID("r8a7791-vin.0", &mstp_clks[MSTP811]),
CLKDEV_DEV_ID("r8a7791-vin.1", &mstp_clks[MSTP810]),
CLKDEV_DEV_ID("r8a7791-vin.2", &mstp_clks[MSTP809]),
CLKDEV_DEV_ID("sata-r8a7791.0", &mstp_clks[MSTP815]),
CLKDEV_DEV_ID("sata-r8a7791.1", &mstp_clks[MSTP814]),
}; };
#define R8A7791_CLOCK_ROOT(e, m, p0, p1, p30, p31) \ #define R8A7791_CLOCK_ROOT(e, m, p0, p1, p30, p31) \
...@@ -232,9 +318,20 @@ void __init r8a7791_clock_init(void) ...@@ -232,9 +318,20 @@ void __init r8a7791_clock_init(void)
break; break;
} }
if ((mode & (MD(3) | MD(2) | MD(1))) == MD(2))
SH_CLK_SET_RATIO(&qspi_clk_ratio, 1, 16);
else
SH_CLK_SET_RATIO(&qspi_clk_ratio, 1, 20);
for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
ret = clk_register(main_clks[k]); ret = clk_register(main_clks[k]);
if (!ret)
ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
if (!ret)
ret = sh_clk_div6_register(div6_clks, DIV6_NR);
if (!ret) if (!ret)
ret = sh_clk_mstp_register(mstp_clks, MSTP_NR); ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
......
...@@ -3,6 +3,31 @@ ...@@ -3,6 +3,31 @@
#include <mach/rcar-gen2.h> #include <mach/rcar-gen2.h>
/* DMA slave IDs */
enum {
RCAR_DMA_SLAVE_INVALID,
AUDIO_DMAC_SLAVE_SSI0_TX,
AUDIO_DMAC_SLAVE_SSI0_RX,
AUDIO_DMAC_SLAVE_SSI1_TX,
AUDIO_DMAC_SLAVE_SSI1_RX,
AUDIO_DMAC_SLAVE_SSI2_TX,
AUDIO_DMAC_SLAVE_SSI2_RX,
AUDIO_DMAC_SLAVE_SSI3_TX,
AUDIO_DMAC_SLAVE_SSI3_RX,
AUDIO_DMAC_SLAVE_SSI4_TX,
AUDIO_DMAC_SLAVE_SSI4_RX,
AUDIO_DMAC_SLAVE_SSI5_TX,
AUDIO_DMAC_SLAVE_SSI5_RX,
AUDIO_DMAC_SLAVE_SSI6_TX,
AUDIO_DMAC_SLAVE_SSI6_RX,
AUDIO_DMAC_SLAVE_SSI7_TX,
AUDIO_DMAC_SLAVE_SSI7_RX,
AUDIO_DMAC_SLAVE_SSI8_TX,
AUDIO_DMAC_SLAVE_SSI8_RX,
AUDIO_DMAC_SLAVE_SSI9_TX,
AUDIO_DMAC_SLAVE_SSI9_RX,
};
void r8a7790_add_standard_devices(void); void r8a7790_add_standard_devices(void);
void r8a7790_add_dt_devices(void); void r8a7790_add_dt_devices(void);
void r8a7790_clock_init(void); void r8a7790_clock_init(void);
......
...@@ -24,12 +24,100 @@ ...@@ -24,12 +24,100 @@
#include <linux/platform_data/gpio-rcar.h> #include <linux/platform_data/gpio-rcar.h>
#include <linux/platform_data/irq-renesas-irqc.h> #include <linux/platform_data/irq-renesas-irqc.h>
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/sh_dma.h>
#include <linux/sh_timer.h> #include <linux/sh_timer.h>
#include <mach/common.h> #include <mach/common.h>
#include <mach/dma-register.h>
#include <mach/irqs.h> #include <mach/irqs.h>
#include <mach/r8a7790.h> #include <mach/r8a7790.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
/* Audio-DMAC */
#define AUDIO_DMAC_SLAVE(_id, _addr, t, r) \
{ \
.slave_id = AUDIO_DMAC_SLAVE_## _id ##_TX, \
.addr = _addr + 0x8, \
.chcr = CHCR_TX(XMIT_SZ_32BIT), \
.mid_rid = t, \
}, { \
.slave_id = AUDIO_DMAC_SLAVE_## _id ##_RX, \
.addr = _addr + 0xc, \
.chcr = CHCR_RX(XMIT_SZ_32BIT), \
.mid_rid = r, \
}
static const struct sh_dmae_slave_config r8a7790_audio_dmac_slaves[] = {
AUDIO_DMAC_SLAVE(SSI0, 0xec241000, 0x01, 0x02),
AUDIO_DMAC_SLAVE(SSI1, 0xec241040, 0x03, 0x04),
AUDIO_DMAC_SLAVE(SSI2, 0xec241080, 0x05, 0x06),
AUDIO_DMAC_SLAVE(SSI3, 0xec2410c0, 0x07, 0x08),
AUDIO_DMAC_SLAVE(SSI4, 0xec241100, 0x09, 0x0a),
AUDIO_DMAC_SLAVE(SSI5, 0xec241140, 0x0b, 0x0c),
AUDIO_DMAC_SLAVE(SSI6, 0xec241180, 0x0d, 0x0e),
AUDIO_DMAC_SLAVE(SSI7, 0xec2411c0, 0x0f, 0x10),
AUDIO_DMAC_SLAVE(SSI8, 0xec241200, 0x11, 0x12),
AUDIO_DMAC_SLAVE(SSI9, 0xec241240, 0x13, 0x14),
};
#define DMAE_CHANNEL(a, b) \
{ \
.offset = (a) - 0x20, \
.dmars = (a) - 0x20 + 0x40, \
.chclr_bit = (b), \
.chclr_offset = 0x80 - 0x20, \
}
static const struct sh_dmae_channel r8a7790_audio_dmac_channels[] = {
DMAE_CHANNEL(0x8000, 0),
DMAE_CHANNEL(0x8080, 1),
DMAE_CHANNEL(0x8100, 2),
DMAE_CHANNEL(0x8180, 3),
DMAE_CHANNEL(0x8200, 4),
DMAE_CHANNEL(0x8280, 5),
DMAE_CHANNEL(0x8300, 6),
DMAE_CHANNEL(0x8380, 7),
DMAE_CHANNEL(0x8400, 8),
DMAE_CHANNEL(0x8480, 9),
DMAE_CHANNEL(0x8500, 10),
DMAE_CHANNEL(0x8580, 11),
DMAE_CHANNEL(0x8600, 12),
};
static struct sh_dmae_pdata r8a7790_audio_dmac_platform_data = {
.slave = r8a7790_audio_dmac_slaves,
.slave_num = ARRAY_SIZE(r8a7790_audio_dmac_slaves),
.channel = r8a7790_audio_dmac_channels,
.channel_num = ARRAY_SIZE(r8a7790_audio_dmac_channels),
.ts_low_shift = TS_LOW_SHIFT,
.ts_low_mask = TS_LOW_BIT << TS_LOW_SHIFT,
.ts_high_shift = TS_HI_SHIFT,
.ts_high_mask = TS_HI_BIT << TS_HI_SHIFT,
.ts_shift = dma_ts_shift,
.ts_shift_num = ARRAY_SIZE(dma_ts_shift),
.dmaor_init = DMAOR_DME,
.chclr_present = 1,
.chclr_bitwise = 1,
};
static struct resource r8a7790_audio_dmac_resources[] = {
/* Channel registers and DMAOR for low */
DEFINE_RES_MEM(0xec700020, 0x8663 - 0x20),
DEFINE_RES_IRQ(gic_spi(346)),
DEFINE_RES_NAMED(gic_spi(320), 13, NULL, IORESOURCE_IRQ),
/* Channel registers and DMAOR for hi */
DEFINE_RES_MEM(0xec720020, 0x8663 - 0x20), /* hi */
DEFINE_RES_IRQ(gic_spi(347)),
DEFINE_RES_NAMED(gic_spi(333), 13, NULL, IORESOURCE_IRQ),
};
#define r8a7790_register_audio_dmac(id) \
platform_device_register_resndata( \
&platform_bus, "sh-dma-engine", id, \
&r8a7790_audio_dmac_resources[id * 3], 3, \
&r8a7790_audio_dmac_platform_data, \
sizeof(r8a7790_audio_dmac_platform_data))
static const struct resource pfc_resources[] __initconst = { static const struct resource pfc_resources[] __initconst = {
DEFINE_RES_MEM(0xe6060000, 0x250), DEFINE_RES_MEM(0xe6060000, 0x250),
}; };
...@@ -101,6 +189,8 @@ void __init r8a7790_pinmux_init(void) ...@@ -101,6 +189,8 @@ void __init r8a7790_pinmux_init(void)
r8a7790_register_i2c(1); r8a7790_register_i2c(1);
r8a7790_register_i2c(2); r8a7790_register_i2c(2);
r8a7790_register_i2c(3); r8a7790_register_i2c(3);
r8a7790_register_audio_dmac(0);
r8a7790_register_audio_dmac(1);
} }
#define __R8A7790_SCIF(scif_type, _scscr, index, baseaddr, irq) \ #define __R8A7790_SCIF(scif_type, _scscr, index, baseaddr, irq) \
......
...@@ -5,6 +5,7 @@ menuconfig ARCH_STI ...@@ -5,6 +5,7 @@ menuconfig ARCH_STI
select PINCTRL select PINCTRL
select PINCTRL_ST select PINCTRL_ST
select MFD_SYSCON select MFD_SYSCON
select ARCH_HAS_RESET_CONTROLLER
select HAVE_ARM_SCU if SMP select HAVE_ARM_SCU if SMP
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select ARM_ERRATA_754322 select ARM_ERRATA_754322
...@@ -24,6 +25,7 @@ if ARCH_STI ...@@ -24,6 +25,7 @@ if ARCH_STI
config SOC_STIH415 config SOC_STIH415
bool "STiH415 STMicroelectronics Consumer Electronics family" bool "STiH415 STMicroelectronics Consumer Electronics family"
default y default y
select STIH415_RESET
help help
This enables support for STMicroelectronics Digital Consumer This enables support for STMicroelectronics Digital Consumer
Electronics family StiH415 parts, primarily targeted at set-top-box Electronics family StiH415 parts, primarily targeted at set-top-box
...@@ -33,6 +35,7 @@ config SOC_STIH415 ...@@ -33,6 +35,7 @@ config SOC_STIH415
config SOC_STIH416 config SOC_STIH416
bool "STiH416 STMicroelectronics Consumer Electronics family" bool "STiH416 STMicroelectronics Consumer Electronics family"
default y default y
select STIH416_RESET
help help
This enables support for STMicroelectronics Digital Consumer This enables support for STMicroelectronics Digital Consumer
Electronics family StiH416 parts, primarily targeted at set-top-box Electronics family StiH416 parts, primarily targeted at set-top-box
......
...@@ -108,7 +108,7 @@ void __init versatile_init_irq(void) ...@@ -108,7 +108,7 @@ void __init versatile_init_irq(void)
np = of_find_matching_node_by_address(NULL, vic_of_match, np = of_find_matching_node_by_address(NULL, vic_of_match,
VERSATILE_VIC_BASE); VERSATILE_VIC_BASE);
__vic_init(VA_VIC_BASE, IRQ_VIC_START, ~0, 0, np); __vic_init(VA_VIC_BASE, 0, IRQ_VIC_START, ~0, 0, np);
writel(~0, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR); writel(~0, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR);
......
...@@ -595,14 +595,16 @@ void __init orion_spi_1_init(unsigned long mapbase) ...@@ -595,14 +595,16 @@ void __init orion_spi_1_init(unsigned long mapbase)
/***************************************************************************** /*****************************************************************************
* Watchdog * Watchdog
****************************************************************************/ ****************************************************************************/
static struct resource orion_wdt_resource = static struct resource orion_wdt_resource[] = {
DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x28); DEFINE_RES_MEM(TIMER_PHYS_BASE, 0x04),
DEFINE_RES_MEM(RSTOUTn_MASK_PHYS, 0x04),
};
static struct platform_device orion_wdt_device = { static struct platform_device orion_wdt_device = {
.name = "orion_wdt", .name = "orion_wdt",
.id = -1, .id = -1,
.num_resources = 1, .num_resources = ARRAY_SIZE(orion_wdt_resource),
.resource = &orion_wdt_resource, .resource = orion_wdt_resource,
}; };
void __init orion_wdt_init(void) void __init orion_wdt_init(void)
......
...@@ -256,8 +256,6 @@ static int tegra_ahb_probe(struct platform_device *pdev) ...@@ -256,8 +256,6 @@ static int tegra_ahb_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENODEV;
ahb->regs = devm_ioremap_resource(&pdev->dev, res); ahb->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(ahb->regs)) if (IS_ERR(ahb->regs))
return PTR_ERR(ahb->regs); return PTR_ERR(ahb->regs);
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#define DRIVER_NAME "CCI-400" #define DRIVER_NAME "CCI-400"
#define DRIVER_NAME_PMU DRIVER_NAME " PMU" #define DRIVER_NAME_PMU DRIVER_NAME " PMU"
#define PMU_NAME "CCI_400"
#define CCI_PORT_CTRL 0x0 #define CCI_PORT_CTRL 0x0
#define CCI_CTRL_STATUS 0xc #define CCI_CTRL_STATUS 0xc
...@@ -88,8 +87,7 @@ static unsigned long cci_ctrl_phys; ...@@ -88,8 +87,7 @@ static unsigned long cci_ctrl_phys;
#define CCI_REV_R0 0 #define CCI_REV_R0 0
#define CCI_REV_R1 1 #define CCI_REV_R1 1
#define CCI_REV_R0_P4 4 #define CCI_REV_R1_PX 5
#define CCI_REV_R1_P2 6
#define CCI_PMU_EVT_SEL 0x000 #define CCI_PMU_EVT_SEL 0x000
#define CCI_PMU_CNTR 0x004 #define CCI_PMU_CNTR 0x004
...@@ -163,6 +161,15 @@ static struct pmu_port_event_ranges port_event_range[] = { ...@@ -163,6 +161,15 @@ static struct pmu_port_event_ranges port_event_range[] = {
}, },
}; };
/*
* Export different PMU names for the different revisions so userspace knows
* because the event ids are different
*/
static char *const pmu_names[] = {
[CCI_REV_R0] = "CCI_400",
[CCI_REV_R1] = "CCI_400_r1",
};
struct cci_pmu_drv_data { struct cci_pmu_drv_data {
void __iomem *base; void __iomem *base;
struct arm_pmu *cci_pmu; struct arm_pmu *cci_pmu;
...@@ -193,21 +200,16 @@ static int probe_cci_revision(void) ...@@ -193,21 +200,16 @@ static int probe_cci_revision(void)
rev = readl_relaxed(cci_ctrl_base + CCI_PID2) & CCI_PID2_REV_MASK; rev = readl_relaxed(cci_ctrl_base + CCI_PID2) & CCI_PID2_REV_MASK;
rev >>= CCI_PID2_REV_SHIFT; rev >>= CCI_PID2_REV_SHIFT;
if (rev <= CCI_REV_R0_P4) if (rev < CCI_REV_R1_PX)
return CCI_REV_R0; return CCI_REV_R0;
else if (rev <= CCI_REV_R1_P2) else
return CCI_REV_R1; return CCI_REV_R1;
return -ENOENT;
} }
static struct pmu_port_event_ranges *port_range_by_rev(void) static struct pmu_port_event_ranges *port_range_by_rev(void)
{ {
int rev = probe_cci_revision(); int rev = probe_cci_revision();
if (rev < 0)
return NULL;
return &port_event_range[rev]; return &port_event_range[rev];
} }
...@@ -526,7 +528,7 @@ static void pmu_write_counter(struct perf_event *event, u32 value) ...@@ -526,7 +528,7 @@ static void pmu_write_counter(struct perf_event *event, u32 value)
static int cci_pmu_init(struct arm_pmu *cci_pmu, struct platform_device *pdev) static int cci_pmu_init(struct arm_pmu *cci_pmu, struct platform_device *pdev)
{ {
*cci_pmu = (struct arm_pmu){ *cci_pmu = (struct arm_pmu){
.name = PMU_NAME, .name = pmu_names[probe_cci_revision()],
.max_period = (1LLU << 32) - 1, .max_period = (1LLU << 32) - 1,
.get_hw_events = pmu_get_hw_events, .get_hw_events = pmu_get_hw_events,
.get_event_idx = pmu_get_event_idx, .get_event_idx = pmu_get_event_idx,
......
...@@ -890,13 +890,12 @@ int __init mvebu_mbus_dt_init(void) ...@@ -890,13 +890,12 @@ int __init mvebu_mbus_dt_init(void)
const __be32 *prop; const __be32 *prop;
int ret; int ret;
np = of_find_matching_node(NULL, of_mvebu_mbus_ids); np = of_find_matching_node_and_match(NULL, of_mvebu_mbus_ids, &of_id);
if (!np) { if (!np) {
pr_err("could not find a matching SoC family\n"); pr_err("could not find a matching SoC family\n");
return -ENODEV; return -ENODEV;
} }
of_id = of_match_node(of_mvebu_mbus_ids, np);
mbus_state.soc = of_id->data; mbus_state.soc = of_id->data;
prop = of_get_property(np, "controller", NULL); prop = of_get_property(np, "controller", NULL);
......
...@@ -342,11 +342,11 @@ config HW_RANDOM_TPM ...@@ -342,11 +342,11 @@ config HW_RANDOM_TPM
If unsure, say Y. If unsure, say Y.
config HW_RANDOM_MSM config HW_RANDOM_MSM
tristate "Qualcomm MSM Random Number Generator support" tristate "Qualcomm SoCs Random Number Generator support"
depends on HW_RANDOM && ARCH_MSM depends on HW_RANDOM && ARCH_QCOM
---help--- ---help---
This driver provides kernel-side support for the Random Number This driver provides kernel-side support for the Random Number
Generator hardware found on Qualcomm MSM SoCs. Generator hardware found on Qualcomm SoCs.
To compile this driver as a module, choose M here. the To compile this driver as a module, choose M here. the
module will be called msm-rng. module will be called msm-rng.
......
...@@ -111,4 +111,5 @@ source "drivers/clk/qcom/Kconfig" ...@@ -111,4 +111,5 @@ source "drivers/clk/qcom/Kconfig"
endmenu endmenu
source "drivers/clk/bcm/Kconfig"
source "drivers/clk/mvebu/Kconfig" source "drivers/clk/mvebu/Kconfig"
...@@ -29,6 +29,7 @@ obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o ...@@ -29,6 +29,7 @@ obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o
obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o
obj-$(CONFIG_COMMON_CLK_XGENE) += clk-xgene.o obj-$(CONFIG_COMMON_CLK_XGENE) += clk-xgene.o
obj-$(CONFIG_COMMON_CLK_AT91) += at91/ obj-$(CONFIG_COMMON_CLK_AT91) += at91/
obj-$(CONFIG_ARCH_BCM_MOBILE) += bcm/
obj-$(CONFIG_ARCH_HI3xxx) += hisilicon/ obj-$(CONFIG_ARCH_HI3xxx) += hisilicon/
obj-$(CONFIG_COMMON_CLK_KEYSTONE) += keystone/ obj-$(CONFIG_COMMON_CLK_KEYSTONE) += keystone/
ifeq ($(CONFIG_COMMON_CLK), y) ifeq ($(CONFIG_COMMON_CLK), y)
......
config CLK_BCM_KONA
bool "Broadcom Kona CCU clock support"
depends on ARCH_BCM_MOBILE
depends on COMMON_CLK
default y
help
Enable common clock framework support for Broadcom SoCs
using "Kona" style clock control units, including those
in the BCM281xx family.
obj-$(CONFIG_CLK_BCM_KONA) += clk-kona.o
obj-$(CONFIG_CLK_BCM_KONA) += clk-kona-setup.o
obj-$(CONFIG_CLK_BCM_KONA) += clk-bcm281xx.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/clk-provider.h> #include <linux/clk-provider.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/syscore_ops.h>
#include "clk.h" #include "clk.h"
...@@ -85,6 +86,11 @@ enum exynos5250_plls { ...@@ -85,6 +86,11 @@ enum exynos5250_plls {
nr_plls /* number of PLLs */ nr_plls /* number of PLLs */
}; };
static void __iomem *reg_base;
#ifdef CONFIG_PM_SLEEP
static struct samsung_clk_reg_dump *exynos5250_save;
/* /*
* list of controller registers to be saved and restored during a * list of controller registers to be saved and restored during a
* suspend/resume cycle. * suspend/resume cycle.
...@@ -137,6 +143,41 @@ static unsigned long exynos5250_clk_regs[] __initdata = { ...@@ -137,6 +143,41 @@ static unsigned long exynos5250_clk_regs[] __initdata = {
GATE_IP_ACP, GATE_IP_ACP,
}; };
static int exynos5250_clk_suspend(void)
{
samsung_clk_save(reg_base, exynos5250_save,
ARRAY_SIZE(exynos5250_clk_regs));
return 0;
}
static void exynos5250_clk_resume(void)
{
samsung_clk_restore(reg_base, exynos5250_save,
ARRAY_SIZE(exynos5250_clk_regs));
}
static struct syscore_ops exynos5250_clk_syscore_ops = {
.suspend = exynos5250_clk_suspend,
.resume = exynos5250_clk_resume,
};
static void exynos5250_clk_sleep_init(void)
{
exynos5250_save = samsung_clk_alloc_reg_dump(exynos5250_clk_regs,
ARRAY_SIZE(exynos5250_clk_regs));
if (!exynos5250_save) {
pr_warn("%s: failed to allocate sleep save data, no sleep support!\n",
__func__);
return;
}
register_syscore_ops(&exynos5250_clk_syscore_ops);
}
#else
static void exynos5250_clk_sleep_init(void) {}
#endif
/* list of all parent clock list */ /* list of all parent clock list */
PNAME(mout_apll_p) = { "fin_pll", "fout_apll", }; PNAME(mout_apll_p) = { "fin_pll", "fout_apll", };
PNAME(mout_cpu_p) = { "mout_apll", "mout_mpll", }; PNAME(mout_cpu_p) = { "mout_apll", "mout_mpll", };
...@@ -645,8 +686,6 @@ static struct of_device_id ext_clk_match[] __initdata = { ...@@ -645,8 +686,6 @@ static struct of_device_id ext_clk_match[] __initdata = {
/* register exynox5250 clocks */ /* register exynox5250 clocks */
static void __init exynos5250_clk_init(struct device_node *np) static void __init exynos5250_clk_init(struct device_node *np)
{ {
void __iomem *reg_base;
if (np) { if (np) {
reg_base = of_iomap(np, 0); reg_base = of_iomap(np, 0);
if (!reg_base) if (!reg_base)
...@@ -655,9 +694,7 @@ static void __init exynos5250_clk_init(struct device_node *np) ...@@ -655,9 +694,7 @@ static void __init exynos5250_clk_init(struct device_node *np)
panic("%s: unable to determine soc\n", __func__); panic("%s: unable to determine soc\n", __func__);
} }
samsung_clk_init(np, reg_base, CLK_NR_CLKS, samsung_clk_init(np, reg_base, CLK_NR_CLKS);
exynos5250_clk_regs, ARRAY_SIZE(exynos5250_clk_regs),
NULL, 0);
samsung_clk_of_register_fixed_ext(exynos5250_fixed_rate_ext_clks, samsung_clk_of_register_fixed_ext(exynos5250_fixed_rate_ext_clks,
ARRAY_SIZE(exynos5250_fixed_rate_ext_clks), ARRAY_SIZE(exynos5250_fixed_rate_ext_clks),
ext_clk_match); ext_clk_match);
...@@ -685,6 +722,8 @@ static void __init exynos5250_clk_init(struct device_node *np) ...@@ -685,6 +722,8 @@ static void __init exynos5250_clk_init(struct device_node *np)
samsung_clk_register_gate(exynos5250_gate_clks, samsung_clk_register_gate(exynos5250_gate_clks,
ARRAY_SIZE(exynos5250_gate_clks)); ARRAY_SIZE(exynos5250_gate_clks));
exynos5250_clk_sleep_init();
pr_info("Exynos5250: clock setup completed, armclk=%ld\n", pr_info("Exynos5250: clock setup completed, armclk=%ld\n",
_get_rate("div_arm2")); _get_rate("div_arm2"));
} }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/clk-provider.h> #include <linux/clk-provider.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/syscore_ops.h>
#include "clk.h" #include "clk.h"
...@@ -108,6 +109,11 @@ enum exynos5420_plls { ...@@ -108,6 +109,11 @@ enum exynos5420_plls {
nr_plls /* number of PLLs */ nr_plls /* number of PLLs */
}; };
static void __iomem *reg_base;
#ifdef CONFIG_PM_SLEEP
static struct samsung_clk_reg_dump *exynos5420_save;
/* /*
* list of controller registers to be saved and restored during a * list of controller registers to be saved and restored during a
* suspend/resume cycle. * suspend/resume cycle.
...@@ -174,6 +180,41 @@ static unsigned long exynos5420_clk_regs[] __initdata = { ...@@ -174,6 +180,41 @@ static unsigned long exynos5420_clk_regs[] __initdata = {
DIV_KFC0, DIV_KFC0,
}; };
static int exynos5420_clk_suspend(void)
{
samsung_clk_save(reg_base, exynos5420_save,
ARRAY_SIZE(exynos5420_clk_regs));
return 0;
}
static void exynos5420_clk_resume(void)
{
samsung_clk_restore(reg_base, exynos5420_save,
ARRAY_SIZE(exynos5420_clk_regs));
}
static struct syscore_ops exynos5420_clk_syscore_ops = {
.suspend = exynos5420_clk_suspend,
.resume = exynos5420_clk_resume,
};
static void exynos5420_clk_sleep_init(void)
{
exynos5420_save = samsung_clk_alloc_reg_dump(exynos5420_clk_regs,
ARRAY_SIZE(exynos5420_clk_regs));
if (!exynos5420_save) {
pr_warn("%s: failed to allocate sleep save data, no sleep support!\n",
__func__);
return;
}
register_syscore_ops(&exynos5420_clk_syscore_ops);
}
#else
static void exynos5420_clk_sleep_init(void) {}
#endif
/* list of all parent clocks */ /* list of all parent clocks */
PNAME(mspll_cpu_p) = { "sclk_cpll", "sclk_dpll", PNAME(mspll_cpu_p) = { "sclk_cpll", "sclk_dpll",
"sclk_mpll", "sclk_spll" }; "sclk_mpll", "sclk_spll" };
...@@ -737,8 +778,6 @@ static struct of_device_id ext_clk_match[] __initdata = { ...@@ -737,8 +778,6 @@ static struct of_device_id ext_clk_match[] __initdata = {
/* register exynos5420 clocks */ /* register exynos5420 clocks */
static void __init exynos5420_clk_init(struct device_node *np) static void __init exynos5420_clk_init(struct device_node *np)
{ {
void __iomem *reg_base;
if (np) { if (np) {
reg_base = of_iomap(np, 0); reg_base = of_iomap(np, 0);
if (!reg_base) if (!reg_base)
...@@ -747,9 +786,7 @@ static void __init exynos5420_clk_init(struct device_node *np) ...@@ -747,9 +786,7 @@ static void __init exynos5420_clk_init(struct device_node *np)
panic("%s: unable to determine soc\n", __func__); panic("%s: unable to determine soc\n", __func__);
} }
samsung_clk_init(np, reg_base, CLK_NR_CLKS, samsung_clk_init(np, reg_base, CLK_NR_CLKS);
exynos5420_clk_regs, ARRAY_SIZE(exynos5420_clk_regs),
NULL, 0);
samsung_clk_of_register_fixed_ext(exynos5420_fixed_rate_ext_clks, samsung_clk_of_register_fixed_ext(exynos5420_fixed_rate_ext_clks,
ARRAY_SIZE(exynos5420_fixed_rate_ext_clks), ARRAY_SIZE(exynos5420_fixed_rate_ext_clks),
ext_clk_match); ext_clk_match);
...@@ -765,5 +802,7 @@ static void __init exynos5420_clk_init(struct device_node *np) ...@@ -765,5 +802,7 @@ static void __init exynos5420_clk_init(struct device_node *np)
ARRAY_SIZE(exynos5420_div_clks)); ARRAY_SIZE(exynos5420_div_clks));
samsung_clk_register_gate(exynos5420_gate_clks, samsung_clk_register_gate(exynos5420_gate_clks,
ARRAY_SIZE(exynos5420_gate_clks)); ARRAY_SIZE(exynos5420_gate_clks));
exynos5420_clk_sleep_init();
} }
CLK_OF_DECLARE(exynos5420_clk, "samsung,exynos5420-clock", exynos5420_clk_init); CLK_OF_DECLARE(exynos5420_clk, "samsung,exynos5420-clock", exynos5420_clk_init);
...@@ -101,7 +101,7 @@ static void __init exynos5440_clk_init(struct device_node *np) ...@@ -101,7 +101,7 @@ static void __init exynos5440_clk_init(struct device_node *np)
return; return;
} }
samsung_clk_init(np, reg_base, CLK_NR_CLKS, NULL, 0, NULL, 0); samsung_clk_init(np, reg_base, CLK_NR_CLKS);
samsung_clk_of_register_fixed_ext(exynos5440_fixed_rate_ext_clks, samsung_clk_of_register_fixed_ext(exynos5440_fixed_rate_ext_clks,
ARRAY_SIZE(exynos5440_fixed_rate_ext_clks), ext_clk_match); ARRAY_SIZE(exynos5440_fixed_rate_ext_clks), ext_clk_match);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -16,4 +16,5 @@ struct clk_icst_desc { ...@@ -16,4 +16,5 @@ struct clk_icst_desc {
struct clk *icst_clk_register(struct device *dev, struct clk *icst_clk_register(struct device *dev,
const struct clk_icst_desc *desc, const struct clk_icst_desc *desc,
const char *name, const char *name,
const char *parent_name,
void __iomem *base); void __iomem *base);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
obj-$(CONFIG_RESET_CONTROLLER) += core.o obj-$(CONFIG_RESET_CONTROLLER) += core.o
obj-$(CONFIG_ARCH_SUNXI) += reset-sunxi.o obj-$(CONFIG_ARCH_SUNXI) += reset-sunxi.o
obj-$(CONFIG_ARCH_STI) += sti/
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment