Commit 1bf25e78 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'cleanup-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC late cleanups from Arnd Bergmann:
 "These are cleanups and smaller changes that either depend on earlier
  feature branches or came in late during the development cycle.  We
  normally try to get all cleanups early, so these are the exceptions:

   - A follow-up on the clocksource reworks, hopefully the last time we
     need to merge clocksource subsystem changes through arm-soc.

     A first set of patches was part of the original 3.10 arm-soc
     cleanup series because of interdependencies with timer drivers now
     moved out of arch/arm.

   - Migrating the SPEAr13xx platform away from using auxdata for DMA
     channel descriptions towards using information in device tree,
     based on the earlier SPEAr multiplatform series

   - A few follow-ups on the Atmel SAMA5 support and other changes for
     Atmel at91 based on the larger at91 reworks.

   - Moving the armada irqchip implementation to drivers/irqchip

   - Several OMAP cleanups following up on the larger series already
     merged in 3.10."

* tag 'cleanup-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (50 commits)
  ARM: OMAP4: change the device names in usb_bind_phy
  ARM: OMAP2+: Fix mismerge for timer.c between ff931c82 and da4a686a
  ARM: SPEAr: conditionalize SMP code
  ARM: arch_timer: Silence debug preempt warnings
  ARM: OMAP: remove unused variable
  serial: amba-pl011: fix !CONFIG_DMA_ENGINE case
  ata: arasan: remove the need for platform_data
  ARM: at91/sama5d34ek.dts: remove not needed compatibility string
  ARM: at91: dts: add MCI DMA support
  ARM: at91: dts: add i2c dma support
  ARM: at91: dts: set #dma-cells to the correct value
  ARM: at91: suspend both memory controllers on at91sam9263
  irqchip: armada-370-xp: slightly cleanup irq controller driver
  irqchip: armada-370-xp: move IRQ handler to avoid forward declaration
  irqchip: move IRQ driver for Armada 370/XP
  ARM: mvebu: move L2 cache initialization in init_early()
  devtree: add binding documentation for sp804
  ARM: integrator-cp: convert use CLKSRC_OF for timer init
  ARM: versatile: use OF init for sp804 timer
  ARM: versatile: add versatile dtbs to dtbs target
  ...
parents 38f56f33 0592c218
...@@ -16,14 +16,31 @@ Optional properties: ...@@ -16,14 +16,31 @@ Optional properties:
- clocks : From common clock binding. First clock is phandle to clock for apb - clocks : From common clock binding. First clock is phandle to clock for apb
pclk. Additional clocks are optional and specific to those peripherals. pclk. Additional clocks are optional and specific to those peripherals.
- clock-names : From common clock binding. Shall be "apb_pclk" for first clock. - clock-names : From common clock binding. Shall be "apb_pclk" for first clock.
- dmas : From common DMA binding. If present, refers to one or more dma channels.
- dma-names : From common DMA binding, needs to match the 'dmas' property.
Devices with exactly one receive and transmit channel shall name
these "rx" and "tx", respectively.
- pinctrl-<n> : Pinctrl states as described in bindings/pinctrl/pinctrl-bindings.txt
- pinctrl-names : Names corresponding to the numbered pinctrl states
- interrupts : one or more interrupt specifiers
- interrupt-names : names corresponding to the interrupts properties
Example: Example:
serial@fff36000 { serial@fff36000 {
compatible = "arm,pl011", "arm,primecell"; compatible = "arm,pl011", "arm,primecell";
arm,primecell-periphid = <0x00341011>; arm,primecell-periphid = <0x00341011>;
clocks = <&pclk>; clocks = <&pclk>;
clock-names = "apb_pclk"; clock-names = "apb_pclk";
dmas = <&dma-controller 4>, <&dma-controller 5>;
dma-names = "rx", "tx";
pinctrl-0 = <&uart0_default_mux>, <&uart0_default_mode>;
pinctrl-1 = <&uart0_sleep_mode>;
pinctrl-names = "default","sleep";
interrupts = <0 11 0x4>;
}; };
...@@ -6,6 +6,26 @@ Required properties: ...@@ -6,6 +6,26 @@ Required properties:
- interrupt-parent: Should be the phandle for the interrupt controller - interrupt-parent: Should be the phandle for the interrupt controller
that services interrupts for this device that services interrupts for this device
- interrupt: Should contain the CF interrupt number - interrupt: Should contain the CF interrupt number
- clock-frequency: Interface clock rate, in Hz, one of
25000000
33000000
40000000
50000000
66000000
75000000
100000000
125000000
150000000
166000000
200000000
Optional properties:
- arasan,broken-udma: if present, UDMA mode is unusable
- arasan,broken-mwdma: if present, MWDMA mode is unusable
- arasan,broken-pio: if present, PIO mode is unusable
- dmas: one DMA channel, as described in bindings/dma/dma.txt
required unless both UDMA and MWDMA mode are broken
- dma-names: the corresponding channel name, must be "data"
Example: Example:
...@@ -14,4 +34,6 @@ Example: ...@@ -14,4 +34,6 @@ Example:
reg = <0xfc000000 0x1000>; reg = <0xfc000000 0x1000>;
interrupt-parent = <&vic1>; interrupt-parent = <&vic1>;
interrupts = <12>; interrupts = <12>;
dmas = <&dma-controller 23>;
dma-names = "data";
}; };
* ARM AMBA Primecell PL011 serial UART
Required properties:
- compatible: must be "arm,primecell", "arm,pl011"
- reg: exactly one register range with length 0x1000
- interrupts: exactly one interrupt specifier
Optional properties:
- pinctrl: When present, must have one state named "sleep"
and one state named "default"
- clocks: When present, must refer to exactly one clock named
"apb_pclk"
- dmas: When present, may have one or two dma channels.
The first one must be named "rx", the second one
must be named "tx".
See also bindings/arm/primecell.txt
...@@ -16,6 +16,11 @@ Optional properties: ...@@ -16,6 +16,11 @@ Optional properties:
device will be suspended immediately device will be suspended immediately
- pl022,rt : indicates the controller should run the message pump with realtime - pl022,rt : indicates the controller should run the message pump with realtime
priority to minimise the transfer latency on the bus (boolean) priority to minimise the transfer latency on the bus (boolean)
- dmas : Two or more DMA channel specifiers following the convention outlined
in bindings/dma/dma.txt
- dma-names: Names for the dma channels, if present. There must be at
least one channel named "tx" for transmit and named "rx" for
receive.
SPI slave nodes must be children of the SPI master node and can SPI slave nodes must be children of the SPI master node and can
...@@ -32,3 +37,34 @@ contain the following properties. ...@@ -32,3 +37,34 @@ contain the following properties.
- pl022,wait-state : Microwire interface: Wait state - pl022,wait-state : Microwire interface: Wait state
- pl022,duplex : Microwire interface: Full/Half duplex - pl022,duplex : Microwire interface: Full/Half duplex
Example:
spi@e0100000 {
compatible = "arm,pl022", "arm,primecell";
reg = <0xe0100000 0x1000>;
#address-cells = <1>;
#size-cells = <0>;
interrupts = <0 31 0x4>;
dmas = <&dma-controller 23 1>,
<&dma-controller 24 0>;
dma-names = "rx", "tx";
m25p80@1 {
compatible = "st,m25p80";
reg = <1>;
spi-max-frequency = <12000000>;
spi-cpol;
spi-cpha;
pl022,hierarchy = <0>;
pl022,interface = <0>;
pl022,slave-tx-disable;
pl022,com-mode = <0x2>;
pl022,rx-level-trig = <0>;
pl022,tx-level-trig = <0>;
pl022,ctrl-len = <0x11>;
pl022,wait-state = <0>;
pl022,duplex = <0>;
};
};
ARM sp804 Dual Timers
---------------------------------------
Required properties:
- compatible: Should be "arm,sp804" & "arm,primecell"
- interrupts: Should contain the list of Dual Timer interrupts. This is the
interrupt for timer 1 and timer 2. In the case of a single entry, it is
the combined interrupt or if "arm,sp804-has-irq" is present that
specifies which timer interrupt is connected.
- reg: Should contain location and length for dual timer register.
- clocks: clocks driving the dual timer hardware. This list should be 1 or 3
clocks. With 3 clocks, the order is timer0 clock, timer1 clock,
apb_pclk. A single clock can also be specified if the same clock is
used for all clock inputs.
Optional properties:
- arm,sp804-has-irq = <#>: In the case of only 1 timer irq line connected, this
specifies if the irq connection is for timer 1 or timer 2. A value of 1
or 2 should be used.
Example:
timer0: timer@fc800000 {
compatible = "arm,sp804", "arm,primecell";
reg = <0xfc800000 0x1000>;
interrupts = <0 0 4>, <0 1 4>;
clocks = <&timclk1 &timclk2 &pclk>;
clock-names = "timer1", "timer2", "apb_pclk";
};
...@@ -1059,6 +1059,7 @@ config PLAT_VERSATILE ...@@ -1059,6 +1059,7 @@ config PLAT_VERSATILE
config ARM_TIMER_SP804 config ARM_TIMER_SP804
bool bool
select CLKSRC_MMIO select CLKSRC_MMIO
select CLKSRC_OF if OF
source arch/arm/mm/Kconfig source arch/arm/mm/Kconfig
......
...@@ -194,6 +194,8 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \ ...@@ -194,6 +194,8 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \
tegra30-cardhu-a04.dtb \ tegra30-cardhu-a04.dtb \
tegra114-dalmore.dtb \ tegra114-dalmore.dtb \
tegra114-pluto.dtb tegra114-pluto.dtb
dtb-$(CONFIG_ARCH_VERSATILE) += versatile-ab.dtb \
versatile-pb.dtb
dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \ dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \
vexpress-v2p-ca9.dtb \ vexpress-v2p-ca9.dtb \
vexpress-v2p-ca15-tc1.dtb \ vexpress-v2p-ca15-tc1.dtb \
......
...@@ -108,6 +108,7 @@ dma: dma-controller@ffffec00 { ...@@ -108,6 +108,7 @@ dma: dma-controller@ffffec00 {
compatible = "atmel,at91sam9g45-dma"; compatible = "atmel,at91sam9g45-dma";
reg = <0xffffec00 0x200>; reg = <0xffffec00 0x200>;
interrupts = <21 4 0>; interrupts = <21 4 0>;
#dma-cells = <2>;
}; };
pinctrl@fffff200 { pinctrl@fffff200 {
...@@ -533,6 +534,8 @@ mmc0: mmc@fff80000 { ...@@ -533,6 +534,8 @@ mmc0: mmc@fff80000 {
compatible = "atmel,hsmci"; compatible = "atmel,hsmci";
reg = <0xfff80000 0x600>; reg = <0xfff80000 0x600>;
interrupts = <11 4 0>; interrupts = <11 4 0>;
dmas = <&dma 1 0>;
dma-names = "rxtx";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
status = "disabled"; status = "disabled";
...@@ -542,6 +545,8 @@ mmc1: mmc@fffd0000 { ...@@ -542,6 +545,8 @@ mmc1: mmc@fffd0000 {
compatible = "atmel,hsmci"; compatible = "atmel,hsmci";
reg = <0xfffd0000 0x600>; reg = <0xfffd0000 0x600>;
interrupts = <29 4 0>; interrupts = <29 4 0>;
dmas = <&dma 1 13>;
dma-names = "rxtx";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
status = "disabled"; status = "disabled";
......
...@@ -89,6 +89,8 @@ mmc0: mmc@f0008000 { ...@@ -89,6 +89,8 @@ mmc0: mmc@f0008000 {
compatible = "atmel,hsmci"; compatible = "atmel,hsmci";
reg = <0xf0008000 0x600>; reg = <0xf0008000 0x600>;
interrupts = <12 4 0>; interrupts = <12 4 0>;
dmas = <&dma 1 0>;
dma-names = "rxtx";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
status = "disabled"; status = "disabled";
...@@ -110,6 +112,7 @@ dma: dma-controller@ffffec00 { ...@@ -110,6 +112,7 @@ dma: dma-controller@ffffec00 {
compatible = "atmel,at91sam9g45-dma"; compatible = "atmel,at91sam9g45-dma";
reg = <0xffffec00 0x200>; reg = <0xffffec00 0x200>;
interrupts = <20 4 0>; interrupts = <20 4 0>;
#dma-cells = <2>;
}; };
pinctrl@fffff400 { pinctrl@fffff400 {
...@@ -378,6 +381,9 @@ i2c0: i2c@f8010000 { ...@@ -378,6 +381,9 @@ i2c0: i2c@f8010000 {
compatible = "atmel,at91sam9x5-i2c"; compatible = "atmel,at91sam9x5-i2c";
reg = <0xf8010000 0x100>; reg = <0xf8010000 0x100>;
interrupts = <9 4 6>; interrupts = <9 4 6>;
dmas = <&dma 1 13>,
<&dma 1 14>;
dma-names = "tx", "rx";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
status = "disabled"; status = "disabled";
...@@ -387,6 +393,9 @@ i2c1: i2c@f8014000 { ...@@ -387,6 +393,9 @@ i2c1: i2c@f8014000 {
compatible = "atmel,at91sam9x5-i2c"; compatible = "atmel,at91sam9x5-i2c";
reg = <0xf8014000 0x100>; reg = <0xf8014000 0x100>;
interrupts = <10 4 6>; interrupts = <10 4 6>;
dmas = <&dma 1 15>,
<&dma 1 16>;
dma-names = "tx", "rx";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
status = "disabled"; status = "disabled";
......
...@@ -104,12 +104,14 @@ dma0: dma-controller@ffffec00 { ...@@ -104,12 +104,14 @@ dma0: dma-controller@ffffec00 {
compatible = "atmel,at91sam9g45-dma"; compatible = "atmel,at91sam9g45-dma";
reg = <0xffffec00 0x200>; reg = <0xffffec00 0x200>;
interrupts = <20 4 0>; interrupts = <20 4 0>;
#dma-cells = <2>;
}; };
dma1: dma-controller@ffffee00 { dma1: dma-controller@ffffee00 {
compatible = "atmel,at91sam9g45-dma"; compatible = "atmel,at91sam9g45-dma";
reg = <0xffffee00 0x200>; reg = <0xffffee00 0x200>;
interrupts = <21 4 0>; interrupts = <21 4 0>;
#dma-cells = <2>;
}; };
pinctrl@fffff400 { pinctrl@fffff400 {
...@@ -465,6 +467,8 @@ mmc0: mmc@f0008000 { ...@@ -465,6 +467,8 @@ mmc0: mmc@f0008000 {
compatible = "atmel,hsmci"; compatible = "atmel,hsmci";
reg = <0xf0008000 0x600>; reg = <0xf0008000 0x600>;
interrupts = <12 4 0>; interrupts = <12 4 0>;
dmas = <&dma0 1 0>;
dma-names = "rxtx";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
status = "disabled"; status = "disabled";
...@@ -474,6 +478,8 @@ mmc1: mmc@f000c000 { ...@@ -474,6 +478,8 @@ mmc1: mmc@f000c000 {
compatible = "atmel,hsmci"; compatible = "atmel,hsmci";
reg = <0xf000c000 0x600>; reg = <0xf000c000 0x600>;
interrupts = <26 4 0>; interrupts = <26 4 0>;
dmas = <&dma1 1 0>;
dma-names = "rxtx";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
status = "disabled"; status = "disabled";
...@@ -535,6 +541,9 @@ i2c0: i2c@f8010000 { ...@@ -535,6 +541,9 @@ i2c0: i2c@f8010000 {
compatible = "atmel,at91sam9x5-i2c"; compatible = "atmel,at91sam9x5-i2c";
reg = <0xf8010000 0x100>; reg = <0xf8010000 0x100>;
interrupts = <9 4 6>; interrupts = <9 4 6>;
dmas = <&dma0 1 7>,
<&dma0 1 8>;
dma-names = "tx", "rx";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
pinctrl-names = "default"; pinctrl-names = "default";
...@@ -546,6 +555,9 @@ i2c1: i2c@f8014000 { ...@@ -546,6 +555,9 @@ i2c1: i2c@f8014000 {
compatible = "atmel,at91sam9x5-i2c"; compatible = "atmel,at91sam9x5-i2c";
reg = <0xf8014000 0x100>; reg = <0xf8014000 0x100>;
interrupts = <10 4 6>; interrupts = <10 4 6>;
dmas = <&dma1 1 5>,
<&dma1 1 6>;
dma-names = "tx", "rx";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
pinctrl-names = "default"; pinctrl-names = "default";
...@@ -557,6 +569,9 @@ i2c2: i2c@f8018000 { ...@@ -557,6 +569,9 @@ i2c2: i2c@f8018000 {
compatible = "atmel,at91sam9x5-i2c"; compatible = "atmel,at91sam9x5-i2c";
reg = <0xf8018000 0x100>; reg = <0xf8018000 0x100>;
interrupts = <11 4 6>; interrupts = <11 4 6>;
dmas = <&dma0 1 9>,
<&dma0 1 10>;
dma-names = "tx", "rx";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
pinctrl-names = "default"; pinctrl-names = "default";
......
...@@ -24,15 +24,15 @@ cpcon { ...@@ -24,15 +24,15 @@ cpcon {
}; };
timer0: timer@13000000 { timer0: timer@13000000 {
compatible = "arm,sp804", "arm,primecell"; compatible = "arm,integrator-cp-timer";
}; };
timer1: timer@13000100 { timer1: timer@13000100 {
compatible = "arm,sp804", "arm,primecell"; compatible = "arm,integrator-cp-timer";
}; };
timer2: timer@13000200 { timer2: timer@13000200 {
compatible = "arm,sp804", "arm,primecell"; compatible = "arm,integrator-cp-timer";
}; };
pic: pic@14000000 { pic: pic@14000000 {
......
...@@ -60,6 +60,8 @@ mmc0: mmc@f0000000 { ...@@ -60,6 +60,8 @@ mmc0: mmc@f0000000 {
compatible = "atmel,hsmci"; compatible = "atmel,hsmci";
reg = <0xf0000000 0x600>; reg = <0xf0000000 0x600>;
interrupts = <21 4 0>; interrupts = <21 4 0>;
dmas = <&dma0 2 0>;
dma-names = "rxtx";
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_dat4_7>; pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_dat4_7>;
status = "disabled"; status = "disabled";
...@@ -111,6 +113,9 @@ i2c0: i2c@f0014000 { ...@@ -111,6 +113,9 @@ i2c0: i2c@f0014000 {
compatible = "atmel,at91sam9x5-i2c"; compatible = "atmel,at91sam9x5-i2c";
reg = <0xf0014000 0x4000>; reg = <0xf0014000 0x4000>;
interrupts = <18 4 6>; interrupts = <18 4 6>;
dmas = <&dma0 2 7>,
<&dma0 2 8>;
dma-names = "tx", "rx";
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c0>; pinctrl-0 = <&pinctrl_i2c0>;
#address-cells = <1>; #address-cells = <1>;
...@@ -122,6 +127,9 @@ i2c1: i2c@f0018000 { ...@@ -122,6 +127,9 @@ i2c1: i2c@f0018000 {
compatible = "atmel,at91sam9x5-i2c"; compatible = "atmel,at91sam9x5-i2c";
reg = <0xf0018000 0x4000>; reg = <0xf0018000 0x4000>;
interrupts = <19 4 6>; interrupts = <19 4 6>;
dmas = <&dma0 2 9>,
<&dma0 2 10>;
dma-names = "tx", "rx";
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c1>; pinctrl-0 = <&pinctrl_i2c1>;
#address-cells = <1>; #address-cells = <1>;
...@@ -167,6 +175,8 @@ mmc1: mmc@f8000000 { ...@@ -167,6 +175,8 @@ mmc1: mmc@f8000000 {
compatible = "atmel,hsmci"; compatible = "atmel,hsmci";
reg = <0xf8000000 0x600>; reg = <0xf8000000 0x600>;
interrupts = <22 4 0>; interrupts = <22 4 0>;
dmas = <&dma1 2 0>;
dma-names = "rxtx";
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3>; pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3>;
status = "disabled"; status = "disabled";
...@@ -178,6 +188,8 @@ mmc2: mmc@f8004000 { ...@@ -178,6 +188,8 @@ mmc2: mmc@f8004000 {
compatible = "atmel,hsmci"; compatible = "atmel,hsmci";
reg = <0xf8004000 0x600>; reg = <0xf8004000 0x600>;
interrupts = <23 4 0>; interrupts = <23 4 0>;
dmas = <&dma1 2 1>;
dma-names = "rxtx";
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&pinctrl_mmc2_clk_cmd_dat0 &pinctrl_mmc2_dat1_3>; pinctrl-0 = <&pinctrl_mmc2_clk_cmd_dat0 &pinctrl_mmc2_dat1_3>;
status = "disabled"; status = "disabled";
...@@ -294,6 +306,9 @@ i2c2: i2c@f801c000 { ...@@ -294,6 +306,9 @@ i2c2: i2c@f801c000 {
compatible = "atmel,at91sam9x5-i2c"; compatible = "atmel,at91sam9x5-i2c";
reg = <0xf801c000 0x4000>; reg = <0xf801c000 0x4000>;
interrupts = <20 4 6>; interrupts = <20 4 6>;
dmas = <&dma1 2 11>,
<&dma1 2 12>;
dma-names = "tx", "rx";
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
status = "disabled"; status = "disabled";
...@@ -348,14 +363,14 @@ dma0: dma-controller@ffffe600 { ...@@ -348,14 +363,14 @@ dma0: dma-controller@ffffe600 {
compatible = "atmel,at91sam9g45-dma"; compatible = "atmel,at91sam9g45-dma";
reg = <0xffffe600 0x200>; reg = <0xffffe600 0x200>;
interrupts = <30 4 0>; interrupts = <30 4 0>;
#dma-cells = <1>; #dma-cells = <2>;
}; };
dma1: dma-controller@ffffe800 { dma1: dma-controller@ffffe800 {
compatible = "atmel,at91sam9g45-dma"; compatible = "atmel,at91sam9g45-dma";
reg = <0xffffe800 0x200>; reg = <0xffffe800 0x200>;
interrupts = <31 4 0>; interrupts = <31 4 0>;
#dma-cells = <1>; #dma-cells = <2>;
}; };
ramc0: ramc@ffffea00 { ramc0: ramc@ffffea00 {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
/ { / {
model = "Atmel SAMA5D34-EK"; model = "Atmel SAMA5D34-EK";
compatible = "atmel,sama5d34ek", "atmel,sama5ek", "atmel,sama5d3xmb", "atmel,sama5d3xcm", "atmel,sama5d3", "atmel,sama5"; compatible = "atmel,sama5d34ek", "atmel,sama5d3xmb", "atmel,sama5d3xcm", "atmel,sama5d3", "atmel,sama5";
ahb { ahb {
apb { apb {
......
...@@ -113,6 +113,9 @@ serial@b4100000 { ...@@ -113,6 +113,9 @@ serial@b4100000 {
reg = <0xb4100000 0x1000>; reg = <0xb4100000 0x1000>;
interrupts = <0 105 0x4>; interrupts = <0 105 0x4>;
status = "disabled"; status = "disabled";
dmas = <&dwdma0 0x600 0 0 1>, /* 0xC << 11 */
<&dwdma0 0x680 0 1 0>; /* 0xD << 7 */
dma-names = "tx", "rx";
}; };
thermal@e07008c4 { thermal@e07008c4 {
......
...@@ -98,13 +98,24 @@ cf@b2800000 { ...@@ -98,13 +98,24 @@ cf@b2800000 {
reg = <0xb2800000 0x1000>; reg = <0xb2800000 0x1000>;
interrupts = <0 29 0x4>; interrupts = <0 29 0x4>;
status = "disabled"; status = "disabled";
dmas = <&dwdma0 0 0 0 0>;
dma-names = "data";
}; };
dma@ea800000 { dwdma0: dma@ea800000 {
compatible = "snps,dma-spear1340"; compatible = "snps,dma-spear1340";
reg = <0xea800000 0x1000>; reg = <0xea800000 0x1000>;
interrupts = <0 19 0x4>; interrupts = <0 19 0x4>;
status = "disabled"; status = "disabled";
dma-channels = <8>;
#dma-cells = <3>;
dma-requests = <32>;
chan_allocation_order = <1>;
chan_priority = <1>;
block_size = <0xfff>;
dma-masters = <2>;
data_width = <3 3 0 0>;
}; };
dma@eb000000 { dma@eb000000 {
...@@ -112,6 +123,15 @@ dma@eb000000 { ...@@ -112,6 +123,15 @@ dma@eb000000 {
reg = <0xeb000000 0x1000>; reg = <0xeb000000 0x1000>;
interrupts = <0 59 0x4>; interrupts = <0 59 0x4>;
status = "disabled"; status = "disabled";
dma-requests = <32>;
dma-channels = <8>;
dma-masters = <2>;
#dma-cells = <3>;
chan_allocation_order = <1>;
chan_priority = <1>;
block_size = <0xfff>;
data_width = <3 3 0 0>;
}; };
fsmc: flash@b0000000 { fsmc: flash@b0000000 {
...@@ -261,6 +281,9 @@ spi0: spi@e0100000 { ...@@ -261,6 +281,9 @@ spi0: spi@e0100000 {
#size-cells = <0>; #size-cells = <0>;
interrupts = <0 31 0x4>; interrupts = <0 31 0x4>;
status = "disabled"; status = "disabled";
dmas = <&dwdma0 0x2000 0 0 0>, /* 0x4 << 11 */
<&dwdma0 0x0280 0 0 0>; /* 0x5 << 7 */
dma-names = "tx", "rx";
}; };
rtc@e0580000 { rtc@e0580000 {
......
...@@ -121,6 +121,18 @@ watchdog@101e1000 { ...@@ -121,6 +121,18 @@ watchdog@101e1000 {
interrupts = <0>; interrupts = <0>;
}; };
timer@101e2000 {
compatible = "arm,sp804", "arm,primecell";
reg = <0x101e2000 0x1000>;
interrupts = <4>;
};
timer@101e3000 {
compatible = "arm,sp804", "arm,primecell";
reg = <0x101e3000 0x1000>;
interrupts = <5>;
};
gpio0: gpio@101e4000 { gpio0: gpio@101e4000 {
compatible = "arm,pl061", "arm,primecell"; compatible = "arm,pl061", "arm,primecell";
reg = <0x101e4000 0x1000>; reg = <0x101e4000 0x1000>;
......
...@@ -98,6 +98,7 @@ timer@100e4000 { ...@@ -98,6 +98,7 @@ timer@100e4000 {
<0 49 4>; <0 49 4>;
clocks = <&oscclk2>, <&oscclk2>; clocks = <&oscclk2>, <&oscclk2>;
clock-names = "timclk", "apb_pclk"; clock-names = "timclk", "apb_pclk";
status = "disabled";
}; };
watchdog@100e5000 { watchdog@100e5000 {
......
...@@ -25,33 +25,29 @@ ...@@ -25,33 +25,29 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <asm/sched_clock.h> #include <asm/sched_clock.h>
#include <asm/hardware/arm_timer.h> #include <asm/hardware/arm_timer.h>
#include <asm/hardware/timer-sp.h>
static long __init sp804_get_clock_rate(const char *name) static long __init sp804_get_clock_rate(struct clk *clk)
{ {
struct clk *clk;
long rate; long rate;
int err; int err;
clk = clk_get_sys("sp804", name);
if (IS_ERR(clk)) {
pr_err("sp804: %s clock not found: %d\n", name,
(int)PTR_ERR(clk));
return PTR_ERR(clk);
}
err = clk_prepare(clk); err = clk_prepare(clk);
if (err) { if (err) {
pr_err("sp804: %s clock failed to prepare: %d\n", name, err); pr_err("sp804: clock failed to prepare: %d\n", err);
clk_put(clk); clk_put(clk);
return err; return err;
} }
err = clk_enable(clk); err = clk_enable(clk);
if (err) { if (err) {
pr_err("sp804: %s clock failed to enable: %d\n", name, err); pr_err("sp804: clock failed to enable: %d\n", err);
clk_unprepare(clk); clk_unprepare(clk);
clk_put(clk); clk_put(clk);
return err; return err;
...@@ -59,7 +55,7 @@ static long __init sp804_get_clock_rate(const char *name) ...@@ -59,7 +55,7 @@ static long __init sp804_get_clock_rate(const char *name)
rate = clk_get_rate(clk); rate = clk_get_rate(clk);
if (rate < 0) { if (rate < 0) {
pr_err("sp804: %s clock failed to get rate: %ld\n", name, rate); pr_err("sp804: clock failed to get rate: %ld\n", rate);
clk_disable(clk); clk_disable(clk);
clk_unprepare(clk); clk_unprepare(clk);
clk_put(clk); clk_put(clk);
...@@ -77,9 +73,21 @@ static u32 sp804_read(void) ...@@ -77,9 +73,21 @@ static u32 sp804_read(void)
void __init __sp804_clocksource_and_sched_clock_init(void __iomem *base, void __init __sp804_clocksource_and_sched_clock_init(void __iomem *base,
const char *name, const char *name,
struct clk *clk,
int use_sched_clock) int use_sched_clock)
{ {
long rate = sp804_get_clock_rate(name); long rate;
if (!clk) {
clk = clk_get_sys("sp804", name);
if (IS_ERR(clk)) {
pr_err("sp804: clock not found: %d\n",
(int)PTR_ERR(clk));
return;
}
}
rate = sp804_get_clock_rate(clk);
if (rate < 0) if (rate < 0)
return; return;
...@@ -171,12 +179,20 @@ static struct irqaction sp804_timer_irq = { ...@@ -171,12 +179,20 @@ static struct irqaction sp804_timer_irq = {
.dev_id = &sp804_clockevent, .dev_id = &sp804_clockevent,
}; };
void __init sp804_clockevents_init(void __iomem *base, unsigned int irq, void __init __sp804_clockevents_init(void __iomem *base, unsigned int irq, struct clk *clk, const char *name)
const char *name)
{ {
struct clock_event_device *evt = &sp804_clockevent; struct clock_event_device *evt = &sp804_clockevent;
long rate = sp804_get_clock_rate(name); long rate;
if (!clk)
clk = clk_get_sys("sp804", name);
if (IS_ERR(clk)) {
pr_err("sp804: %s clock not found: %d\n", name,
(int)PTR_ERR(clk));
return;
}
rate = sp804_get_clock_rate(clk);
if (rate < 0) if (rate < 0)
return; return;
...@@ -186,6 +202,98 @@ void __init sp804_clockevents_init(void __iomem *base, unsigned int irq, ...@@ -186,6 +202,98 @@ void __init sp804_clockevents_init(void __iomem *base, unsigned int irq,
evt->irq = irq; evt->irq = irq;
evt->cpumask = cpu_possible_mask; evt->cpumask = cpu_possible_mask;
writel(0, base + TIMER_CTRL);
setup_irq(irq, &sp804_timer_irq); setup_irq(irq, &sp804_timer_irq);
clockevents_config_and_register(evt, rate, 0xf, 0xffffffff); clockevents_config_and_register(evt, rate, 0xf, 0xffffffff);
} }
static void __init sp804_of_init(struct device_node *np)
{
static bool initialized = false;
void __iomem *base;
int irq;
u32 irq_num = 0;
struct clk *clk1, *clk2;
const char *name = of_get_property(np, "compatible", NULL);
base = of_iomap(np, 0);
if (WARN_ON(!base))
return;
/* Ensure timers are disabled */
writel(0, base + TIMER_CTRL);
writel(0, base + TIMER_2_BASE + TIMER_CTRL);
if (initialized || !of_device_is_available(np))
goto err;
clk1 = of_clk_get(np, 0);
if (IS_ERR(clk1))
clk1 = NULL;
/* Get the 2nd clock if the timer has 2 timer clocks */
if (of_count_phandle_with_args(np, "clocks", "#clock-cells") == 3) {
clk2 = of_clk_get(np, 1);
if (IS_ERR(clk2)) {
pr_err("sp804: %s clock not found: %d\n", np->name,
(int)PTR_ERR(clk2));
goto err;
}
} else
clk2 = clk1;
irq = irq_of_parse_and_map(np, 0);
if (irq <= 0)
goto err;
of_property_read_u32(np, "arm,sp804-has-irq", &irq_num);
if (irq_num == 2) {
__sp804_clockevents_init(base + TIMER_2_BASE, irq, clk2, name);
__sp804_clocksource_and_sched_clock_init(base, name, clk1, 1);
} else {
__sp804_clockevents_init(base, irq, clk1 , name);
__sp804_clocksource_and_sched_clock_init(base + TIMER_2_BASE,
name, clk2, 1);
}
initialized = true;
return;
err:
iounmap(base);
}
CLOCKSOURCE_OF_DECLARE(sp804, "arm,sp804", sp804_of_init);
static void __init integrator_cp_of_init(struct device_node *np)
{
static int init_count = 0;
void __iomem *base;
int irq;
const char *name = of_get_property(np, "compatible", NULL);
base = of_iomap(np, 0);
if (WARN_ON(!base))
return;
/* Ensure timer is disabled */
writel(0, base + TIMER_CTRL);
if (init_count == 2 || !of_device_is_available(np))
goto err;
if (!init_count)
sp804_clocksource_init(base, name);
else {
irq = irq_of_parse_and_map(np, 0);
if (irq <= 0)
goto err;
sp804_clockevents_init(base, irq, name);
}
init_count++;
return;
err:
iounmap(base);
}
CLOCKSOURCE_OF_DECLARE(intcp, "arm,integrator-cp-timer", integrator_cp_of_init);
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
#include <clocksource/arm_arch_timer.h> #include <clocksource/arm_arch_timer.h>
#ifdef CONFIG_ARM_ARCH_TIMER #ifdef CONFIG_ARM_ARCH_TIMER
int arch_timer_of_register(void); int arch_timer_arch_init(void);
int arch_timer_sched_clock_init(void);
/* /*
* These register accessors are marked inline so the compiler can * These register accessors are marked inline so the compiler can
...@@ -110,16 +109,6 @@ static inline void __cpuinit arch_counter_set_user_access(void) ...@@ -110,16 +109,6 @@ static inline void __cpuinit arch_counter_set_user_access(void)
asm volatile("mcr p15, 0, %0, c14, c1, 0" : : "r" (cntkctl)); asm volatile("mcr p15, 0, %0, c14, c1, 0" : : "r" (cntkctl));
} }
#else
static inline int arch_timer_of_register(void)
{
return -ENXIO;
}
static inline int arch_timer_sched_clock_init(void)
{
return -ENXIO;
}
#endif #endif
#endif #endif
struct clk;
void __sp804_clocksource_and_sched_clock_init(void __iomem *, void __sp804_clocksource_and_sched_clock_init(void __iomem *,
const char *, int); const char *, struct clk *, int);
void __sp804_clockevents_init(void __iomem *, unsigned int,
struct clk *, const char *);
static inline void sp804_clocksource_init(void __iomem *base, const char *name) static inline void sp804_clocksource_init(void __iomem *base, const char *name)
{ {
__sp804_clocksource_and_sched_clock_init(base, name, 0); __sp804_clocksource_and_sched_clock_init(base, name, NULL, 0);
} }
static inline void sp804_clocksource_and_sched_clock_init(void __iomem *base, static inline void sp804_clocksource_and_sched_clock_init(void __iomem *base,
const char *name) const char *name)
{ {
__sp804_clocksource_and_sched_clock_init(base, name, 1); __sp804_clocksource_and_sched_clock_init(base, name, NULL, 1);
} }
void sp804_clockevents_init(void __iomem *, unsigned int, const char *); static inline void sp804_clockevents_init(void __iomem *base, unsigned int irq, const char *name)
{
__sp804_clockevents_init(base, irq, NULL, name);
}
...@@ -11,4 +11,6 @@ ...@@ -11,4 +11,6 @@
extern void sched_clock_postinit(void); extern void sched_clock_postinit(void);
extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate); extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate);
extern unsigned long long (*sched_clock_func)(void);
#endif #endif
...@@ -22,9 +22,11 @@ static unsigned long arch_timer_read_counter_long(void) ...@@ -22,9 +22,11 @@ static unsigned long arch_timer_read_counter_long(void)
return arch_timer_read_counter(); return arch_timer_read_counter();
} }
static u32 arch_timer_read_counter_u32(void) static u32 sched_clock_mult __read_mostly;
static unsigned long long notrace arch_timer_sched_clock(void)
{ {
return arch_timer_read_counter(); return arch_timer_read_counter() * sched_clock_mult;
} }
static struct delay_timer arch_delay_timer; static struct delay_timer arch_delay_timer;
...@@ -37,25 +39,20 @@ static void __init arch_timer_delay_timer_register(void) ...@@ -37,25 +39,20 @@ static void __init arch_timer_delay_timer_register(void)
register_current_timer_delay(&arch_delay_timer); register_current_timer_delay(&arch_delay_timer);
} }
int __init arch_timer_of_register(void) int __init arch_timer_arch_init(void)
{ {
int ret; u32 arch_timer_rate = arch_timer_get_rate();
ret = arch_timer_init(); if (arch_timer_rate == 0)
if (ret) return -ENXIO;
return ret;
arch_timer_delay_timer_register(); arch_timer_delay_timer_register();
return 0; /* Cache the sched_clock multiplier to save a divide in the hot path. */
} sched_clock_mult = NSEC_PER_SEC / arch_timer_rate;
sched_clock_func = arch_timer_sched_clock;
int __init arch_timer_sched_clock_init(void) pr_info("sched_clock: ARM arch timer >56 bits at %ukHz, resolution %uns\n",
{ arch_timer_rate / 1000, sched_clock_mult);
if (arch_timer_get_rate() == 0)
return -ENXIO;
setup_sched_clock(arch_timer_read_counter_u32,
32, arch_timer_get_rate());
return 0; return 0;
} }
...@@ -20,6 +20,7 @@ struct clock_data { ...@@ -20,6 +20,7 @@ struct clock_data {
u64 epoch_ns; u64 epoch_ns;
u32 epoch_cyc; u32 epoch_cyc;
u32 epoch_cyc_copy; u32 epoch_cyc_copy;
unsigned long rate;
u32 mult; u32 mult;
u32 shift; u32 shift;
bool suspended; bool suspended;
...@@ -113,11 +114,14 @@ void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate) ...@@ -113,11 +114,14 @@ void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate)
u64 res, wrap; u64 res, wrap;
char r_unit; char r_unit;
if (cd.rate > rate)
return;
BUG_ON(bits > 32); BUG_ON(bits > 32);
WARN_ON(!irqs_disabled()); WARN_ON(!irqs_disabled());
WARN_ON(read_sched_clock != jiffy_sched_clock_read);
read_sched_clock = read; read_sched_clock = read;
sched_clock_mask = (1 << bits) - 1; sched_clock_mask = (1 << bits) - 1;
cd.rate = rate;
/* calculate the mult/shift to convert counter ticks to ns. */ /* calculate the mult/shift to convert counter ticks to ns. */
clocks_calc_mult_shift(&cd.mult, &cd.shift, rate, NSEC_PER_SEC, 0); clocks_calc_mult_shift(&cd.mult, &cd.shift, rate, NSEC_PER_SEC, 0);
...@@ -161,12 +165,19 @@ void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate) ...@@ -161,12 +165,19 @@ void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate)
pr_debug("Registered %pF as sched_clock source\n", read); pr_debug("Registered %pF as sched_clock source\n", read);
} }
unsigned long long notrace sched_clock(void) static unsigned long long notrace sched_clock_32(void)
{ {
u32 cyc = read_sched_clock(); u32 cyc = read_sched_clock();
return cyc_to_sched_clock(cyc, sched_clock_mask); return cyc_to_sched_clock(cyc, sched_clock_mask);
} }
unsigned long long __read_mostly (*sched_clock_func)(void) = sched_clock_32;
unsigned long long notrace sched_clock(void)
{
return sched_clock_func();
}
void __init sched_clock_postinit(void) void __init sched_clock_postinit(void)
{ {
/* /*
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/profile.h> #include <linux/profile.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/clocksource.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <asm/thread_info.h> #include <asm/thread_info.h>
...@@ -115,6 +116,10 @@ int __init register_persistent_clock(clock_access_fn read_boot, ...@@ -115,6 +116,10 @@ int __init register_persistent_clock(clock_access_fn read_boot,
void __init time_init(void) void __init time_init(void)
{ {
machine_desc->init_time(); if (machine_desc->init_time)
machine_desc->init_time();
else
clocksource_of_init();
sched_clock_postinit(); sched_clock_postinit();
} }
...@@ -36,6 +36,8 @@ static int at91_enter_idle(struct cpuidle_device *dev, ...@@ -36,6 +36,8 @@ static int at91_enter_idle(struct cpuidle_device *dev,
at91rm9200_standby(); at91rm9200_standby();
else if (cpu_is_at91sam9g45()) else if (cpu_is_at91sam9g45())
at91sam9g45_standby(); at91sam9g45_standby();
else if (cpu_is_at91sam9263())
at91sam9263_standby();
else else
at91sam9_standby(); at91sam9_standby();
......
...@@ -86,7 +86,7 @@ enum at91_soc_type { ...@@ -86,7 +86,7 @@ enum at91_soc_type {
AT91_SOC_SAMA5D3, AT91_SOC_SAMA5D3,
/* Unknown type */ /* Unknown type */
AT91_SOC_NONE AT91_SOC_UNKNOWN,
}; };
enum at91_soc_subtype { enum at91_soc_subtype {
...@@ -107,8 +107,11 @@ enum at91_soc_subtype { ...@@ -107,8 +107,11 @@ enum at91_soc_subtype {
AT91_SOC_SAMA5D31, AT91_SOC_SAMA5D33, AT91_SOC_SAMA5D34, AT91_SOC_SAMA5D31, AT91_SOC_SAMA5D33, AT91_SOC_SAMA5D34,
AT91_SOC_SAMA5D35, AT91_SOC_SAMA5D35,
/* No subtype for this SoC */
AT91_SOC_SUBTYPE_NONE,
/* Unknown subtype */ /* Unknown subtype */
AT91_SOC_SUBTYPE_NONE AT91_SOC_SUBTYPE_UNKNOWN,
}; };
struct at91_socinfo { struct at91_socinfo {
...@@ -122,7 +125,7 @@ const char *at91_get_soc_subtype(struct at91_socinfo *c); ...@@ -122,7 +125,7 @@ const char *at91_get_soc_subtype(struct at91_socinfo *c);
static inline int at91_soc_is_detected(void) static inline int at91_soc_is_detected(void)
{ {
return at91_soc_initdata.type != AT91_SOC_NONE; return at91_soc_initdata.type != AT91_SOC_UNKNOWN;
} }
#ifdef CONFIG_SOC_AT91RM9200 #ifdef CONFIG_SOC_AT91RM9200
......
...@@ -270,6 +270,8 @@ static int at91_pm_enter(suspend_state_t state) ...@@ -270,6 +270,8 @@ static int at91_pm_enter(suspend_state_t state)
at91rm9200_standby(); at91rm9200_standby();
else if (cpu_is_at91sam9g45()) else if (cpu_is_at91sam9g45())
at91sam9g45_standby(); at91sam9g45_standby();
else if (cpu_is_at91sam9263())
at91sam9263_standby();
else else
at91sam9_standby(); at91sam9_standby();
break; break;
......
...@@ -70,13 +70,31 @@ static inline void at91sam9g45_standby(void) ...@@ -70,13 +70,31 @@ static inline void at91sam9g45_standby(void)
at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1); at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1);
} }
#ifdef CONFIG_SOC_AT91SAM9263 /* We manage both DDRAM/SDRAM controllers, we need more than one value to
/* * remember.
* FIXME either or both the SDRAM controllers (EB0, EB1) might be in use;
* handle those cases both here and in the Suspend-To-RAM support.
*/ */
#warning Assuming EB1 SDRAM controller is *NOT* used static inline void at91sam9263_standby(void)
#endif {
u32 lpr0, lpr1;
u32 saved_lpr0, saved_lpr1;
saved_lpr1 = at91_ramc_read(1, AT91_SDRAMC_LPR);
lpr1 = saved_lpr1 & ~AT91_SDRAMC_LPCB;
lpr1 |= AT91_SDRAMC_LPCB_SELF_REFRESH;
saved_lpr0 = at91_ramc_read(0, AT91_SDRAMC_LPR);
lpr0 = saved_lpr0 & ~AT91_SDRAMC_LPCB;
lpr0 |= AT91_SDRAMC_LPCB_SELF_REFRESH;
/* self-refresh mode now */
at91_ramc_write(0, AT91_SDRAMC_LPR, lpr0);
at91_ramc_write(1, AT91_SDRAMC_LPR, lpr1);
cpu_do_idle();
at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr0);
at91_ramc_write(1, AT91_SDRAMC_LPR, saved_lpr1);
}
static inline void at91sam9_standby(void) static inline void at91sam9_standby(void)
{ {
......
...@@ -105,28 +105,32 @@ static void __init soc_detect(u32 dbgu_base) ...@@ -105,28 +105,32 @@ static void __init soc_detect(u32 dbgu_base)
switch (socid) { switch (socid) {
case ARCH_ID_AT91RM9200: case ARCH_ID_AT91RM9200:
at91_soc_initdata.type = AT91_SOC_RM9200; at91_soc_initdata.type = AT91_SOC_RM9200;
if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_NONE) if (at91_soc_initdata.subtype == AT91_SOC_SUBTYPE_UNKNOWN)
at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA; at91_soc_initdata.subtype = AT91_SOC_RM9200_BGA;
at91_boot_soc = at91rm9200_soc; at91_boot_soc = at91rm9200_soc;
break; break;
case ARCH_ID_AT91SAM9260: case ARCH_ID_AT91SAM9260:
at91_soc_initdata.type = AT91_SOC_SAM9260; at91_soc_initdata.type = AT91_SOC_SAM9260;
at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
at91_boot_soc = at91sam9260_soc; at91_boot_soc = at91sam9260_soc;
break; break;
case ARCH_ID_AT91SAM9261: case ARCH_ID_AT91SAM9261:
at91_soc_initdata.type = AT91_SOC_SAM9261; at91_soc_initdata.type = AT91_SOC_SAM9261;
at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
at91_boot_soc = at91sam9261_soc; at91_boot_soc = at91sam9261_soc;
break; break;
case ARCH_ID_AT91SAM9263: case ARCH_ID_AT91SAM9263:
at91_soc_initdata.type = AT91_SOC_SAM9263; at91_soc_initdata.type = AT91_SOC_SAM9263;
at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
at91_boot_soc = at91sam9263_soc; at91_boot_soc = at91sam9263_soc;
break; break;
case ARCH_ID_AT91SAM9G20: case ARCH_ID_AT91SAM9G20:
at91_soc_initdata.type = AT91_SOC_SAM9G20; at91_soc_initdata.type = AT91_SOC_SAM9G20;
at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
at91_boot_soc = at91sam9260_soc; at91_boot_soc = at91sam9260_soc;
break; break;
...@@ -139,6 +143,7 @@ static void __init soc_detect(u32 dbgu_base) ...@@ -139,6 +143,7 @@ static void __init soc_detect(u32 dbgu_base)
case ARCH_ID_AT91SAM9RL64: case ARCH_ID_AT91SAM9RL64:
at91_soc_initdata.type = AT91_SOC_SAM9RL; at91_soc_initdata.type = AT91_SOC_SAM9RL;
at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
at91_boot_soc = at91sam9rl_soc; at91_boot_soc = at91sam9rl_soc;
break; break;
...@@ -161,6 +166,7 @@ static void __init soc_detect(u32 dbgu_base) ...@@ -161,6 +166,7 @@ static void __init soc_detect(u32 dbgu_base)
/* at91sam9g10 */ /* at91sam9g10 */
if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) { if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
at91_soc_initdata.type = AT91_SOC_SAM9G10; at91_soc_initdata.type = AT91_SOC_SAM9G10;
at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE;
at91_boot_soc = at91sam9261_soc; at91_boot_soc = at91sam9261_soc;
} }
/* at91sam9xe */ /* at91sam9xe */
...@@ -242,7 +248,7 @@ static const char *soc_name[] = { ...@@ -242,7 +248,7 @@ static const char *soc_name[] = {
[AT91_SOC_SAM9X5] = "at91sam9x5", [AT91_SOC_SAM9X5] = "at91sam9x5",
[AT91_SOC_SAM9N12] = "at91sam9n12", [AT91_SOC_SAM9N12] = "at91sam9n12",
[AT91_SOC_SAMA5D3] = "sama5d3", [AT91_SOC_SAMA5D3] = "sama5d3",
[AT91_SOC_NONE] = "Unknown" [AT91_SOC_UNKNOWN] = "Unknown",
}; };
const char *at91_get_soc_type(struct at91_socinfo *c) const char *at91_get_soc_type(struct at91_socinfo *c)
...@@ -268,7 +274,8 @@ static const char *soc_subtype_name[] = { ...@@ -268,7 +274,8 @@ static const char *soc_subtype_name[] = {
[AT91_SOC_SAMA5D33] = "sama5d33", [AT91_SOC_SAMA5D33] = "sama5d33",
[AT91_SOC_SAMA5D34] = "sama5d34", [AT91_SOC_SAMA5D34] = "sama5d34",
[AT91_SOC_SAMA5D35] = "sama5d35", [AT91_SOC_SAMA5D35] = "sama5d35",
[AT91_SOC_SUBTYPE_NONE] = "Unknown" [AT91_SOC_SUBTYPE_NONE] = "None",
[AT91_SOC_SUBTYPE_UNKNOWN] = "Unknown",
}; };
const char *at91_get_soc_subtype(struct at91_socinfo *c) const char *at91_get_soc_subtype(struct at91_socinfo *c)
...@@ -282,8 +289,8 @@ void __init at91_map_io(void) ...@@ -282,8 +289,8 @@ void __init at91_map_io(void)
/* Map peripherals */ /* Map peripherals */
iotable_init(&at91_io_desc, 1); iotable_init(&at91_io_desc, 1);
at91_soc_initdata.type = AT91_SOC_NONE; at91_soc_initdata.type = AT91_SOC_UNKNOWN;
at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_NONE; at91_soc_initdata.subtype = AT91_SOC_SUBTYPE_UNKNOWN;
soc_detect(AT91_BASE_DBGU0); soc_detect(AT91_BASE_DBGU0);
if (!at91_soc_is_detected()) if (!at91_soc_is_detected())
...@@ -294,8 +301,9 @@ void __init at91_map_io(void) ...@@ -294,8 +301,9 @@ void __init at91_map_io(void)
pr_info("AT91: Detected soc type: %s\n", pr_info("AT91: Detected soc type: %s\n",
at91_get_soc_type(&at91_soc_initdata)); at91_get_soc_type(&at91_soc_initdata));
pr_info("AT91: Detected soc subtype: %s\n", if (at91_soc_initdata.subtype != AT91_SOC_SUBTYPE_NONE)
at91_get_soc_subtype(&at91_soc_initdata)); pr_info("AT91: Detected soc subtype: %s\n",
at91_get_soc_subtype(&at91_soc_initdata));
if (!at91_soc_is_enabled()) if (!at91_soc_is_enabled())
panic("AT91: Soc not enabled"); panic("AT91: Soc not enabled");
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/clkdev.h> #include <linux/clkdev.h>
#include <linux/clocksource.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/irq.h> #include <linux/irq.h>
...@@ -28,12 +29,9 @@ ...@@ -28,12 +29,9 @@
#include <linux/amba/bus.h> #include <linux/amba/bus.h>
#include <linux/clk-provider.h> #include <linux/clk-provider.h>
#include <asm/arch_timer.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/cputype.h> #include <asm/cputype.h>
#include <asm/smp_plat.h> #include <asm/smp_plat.h>
#include <asm/hardware/arm_timer.h>
#include <asm/hardware/timer-sp.h>
#include <asm/hardware/cache-l2x0.h> #include <asm/hardware/cache-l2x0.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
...@@ -90,36 +88,16 @@ static void __init highbank_init_irq(void) ...@@ -90,36 +88,16 @@ static void __init highbank_init_irq(void)
#endif #endif
} }
static struct clk_lookup lookup = {
.dev_id = "sp804",
.con_id = NULL,
};
static void __init highbank_timer_init(void) static void __init highbank_timer_init(void)
{ {
int irq;
struct device_node *np; struct device_node *np;
void __iomem *timer_base;
/* Map system registers */ /* Map system registers */
np = of_find_compatible_node(NULL, NULL, "calxeda,hb-sregs"); np = of_find_compatible_node(NULL, NULL, "calxeda,hb-sregs");
sregs_base = of_iomap(np, 0); sregs_base = of_iomap(np, 0);
WARN_ON(!sregs_base); WARN_ON(!sregs_base);
np = of_find_compatible_node(NULL, NULL, "arm,sp804");
timer_base = of_iomap(np, 0);
WARN_ON(!timer_base);
irq = irq_of_parse_and_map(np, 0);
of_clk_init(NULL); of_clk_init(NULL);
lookup.clk = of_clk_get(np, 0);
clkdev_add(&lookup);
sp804_clocksource_and_sched_clock_init(timer_base + 0x20, "timer1");
sp804_clockevents_init(timer_base, irq, "timer0");
arch_timer_of_register();
arch_timer_sched_clock_init();
clocksource_of_init(); clocksource_of_init();
} }
......
...@@ -250,39 +250,6 @@ static void __init intcp_init_early(void) ...@@ -250,39 +250,6 @@ static void __init intcp_init_early(void)
} }
#ifdef CONFIG_OF #ifdef CONFIG_OF
static void __init cp_of_timer_init(void)
{
struct device_node *node;
const char *path;
void __iomem *base;
int err;
int irq;
err = of_property_read_string(of_aliases,
"arm,timer-primary", &path);
if (WARN_ON(err))
return;
node = of_find_node_by_path(path);
base = of_iomap(node, 0);
if (WARN_ON(!base))
return;
writel(0, base + TIMER_CTRL);
sp804_clocksource_init(base, node->name);
err = of_property_read_string(of_aliases,
"arm,timer-secondary", &path);
if (WARN_ON(err))
return;
node = of_find_node_by_path(path);
base = of_iomap(node, 0);
if (WARN_ON(!base))
return;
irq = irq_of_parse_and_map(node, 0);
writel(0, base + TIMER_CTRL);
sp804_clockevents_init(base, irq, node->name);
}
static const struct of_device_id fpga_irq_of_match[] __initconst = { static const struct of_device_id fpga_irq_of_match[] __initconst = {
{ .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, }, { .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, },
{ /* Sentinel */ } { /* Sentinel */ }
...@@ -383,7 +350,6 @@ DT_MACHINE_START(INTEGRATOR_CP_DT, "ARM Integrator/CP (Device Tree)") ...@@ -383,7 +350,6 @@ DT_MACHINE_START(INTEGRATOR_CP_DT, "ARM Integrator/CP (Device Tree)")
.init_early = intcp_init_early, .init_early = intcp_init_early,
.init_irq = intcp_init_irq_of, .init_irq = intcp_init_irq_of,
.handle_irq = fpga_handle_irq, .handle_irq = fpga_handle_irq,
.init_time = cp_of_timer_init,
.init_machine = intcp_init_of, .init_machine = intcp_init_of,
.restart = integrator_restart, .restart = integrator_restart,
.dt_compat = intcp_dt_board_compat, .dt_compat = intcp_dt_board_compat,
......
...@@ -5,6 +5,6 @@ AFLAGS_coherency_ll.o := -Wa,-march=armv7-a ...@@ -5,6 +5,6 @@ AFLAGS_coherency_ll.o := -Wa,-march=armv7-a
obj-y += system-controller.o obj-y += system-controller.o
obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o
obj-$(CONFIG_ARCH_MVEBU) += coherency.o coherency_ll.o pmsu.o irq-armada-370-xp.o obj-$(CONFIG_ARCH_MVEBU) += coherency.o coherency_ll.o pmsu.o
obj-$(CONFIG_SMP) += platsmp.o headsmp.o obj-$(CONFIG_SMP) += platsmp.o headsmp.o
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#include <linux/clk/mvebu.h> #include <linux/clk/mvebu.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/mbus.h> #include <linux/mbus.h>
#include <linux/irqchip.h>
#include <asm/hardware/cache-l2x0.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
...@@ -72,6 +74,10 @@ void __init armada_370_xp_init_early(void) ...@@ -72,6 +74,10 @@ void __init armada_370_xp_init_early(void)
ARMADA_370_XP_MBUS_WINS_SIZE, ARMADA_370_XP_MBUS_WINS_SIZE,
ARMADA_370_XP_SDRAM_WINS_BASE, ARMADA_370_XP_SDRAM_WINS_BASE,
ARMADA_370_XP_SDRAM_WINS_SIZE); ARMADA_370_XP_SDRAM_WINS_SIZE);
#ifdef CONFIG_CACHE_L2X0
l2x0_of_init(0, ~0UL);
#endif
} }
static void __init armada_370_xp_dt_init(void) static void __init armada_370_xp_dt_init(void)
...@@ -90,8 +96,7 @@ DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)") ...@@ -90,8 +96,7 @@ DT_MACHINE_START(ARMADA_XP_DT, "Marvell Armada 370/XP (Device Tree)")
.init_machine = armada_370_xp_dt_init, .init_machine = armada_370_xp_dt_init,
.map_io = armada_370_xp_map_io, .map_io = armada_370_xp_map_io,
.init_early = armada_370_xp_init_early, .init_early = armada_370_xp_init_early,
.init_irq = armada_370_xp_init_irq, .init_irq = irqchip_init,
.handle_irq = armada_370_xp_handle_irq,
.init_time = armada_370_xp_timer_and_clk_init, .init_time = armada_370_xp_timer_and_clk_init,
.restart = mvebu_restart, .restart = mvebu_restart,
.dt_compat = armada_370_xp_dt_compat, .dt_compat = armada_370_xp_dt_compat,
......
...@@ -108,24 +108,13 @@ static struct platform_device *sdp2430_devices[] __initdata = { ...@@ -108,24 +108,13 @@ static struct platform_device *sdp2430_devices[] __initdata = {
#define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91 #define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91
#define SDP2430_LCD_PANEL_ENABLE_GPIO 154 #define SDP2430_LCD_PANEL_ENABLE_GPIO 154
static int sdp2430_panel_enable_lcd(struct omap_dss_device *dssdev)
{
gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 1);
gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 1);
return 0;
}
static void sdp2430_panel_disable_lcd(struct omap_dss_device *dssdev)
{
gpio_direction_output(SDP2430_LCD_PANEL_ENABLE_GPIO, 0);
gpio_direction_output(SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 0);
}
static struct panel_generic_dpi_data sdp2430_panel_data = { static struct panel_generic_dpi_data sdp2430_panel_data = {
.name = "nec_nl2432dr22-11b", .name = "nec_nl2432dr22-11b",
.platform_enable = sdp2430_panel_enable_lcd, .num_gpios = 2,
.platform_disable = sdp2430_panel_disable_lcd, .gpios = {
SDP2430_LCD_PANEL_ENABLE_GPIO,
SDP2430_LCD_PANEL_BACKLIGHT_GPIO,
},
}; };
static struct omap_dss_device sdp2430_lcd_device = { static struct omap_dss_device sdp2430_lcd_device = {
...@@ -146,26 +135,6 @@ static struct omap_dss_board_info sdp2430_dss_data = { ...@@ -146,26 +135,6 @@ static struct omap_dss_board_info sdp2430_dss_data = {
.default_device = &sdp2430_lcd_device, .default_device = &sdp2430_lcd_device,
}; };
static void __init sdp2430_display_init(void)
{
int r;
static struct gpio gpios[] __initdata = {
{ SDP2430_LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW,
"LCD reset" },
{ SDP2430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW,
"LCD Backlight" },
};
r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
if (r) {
pr_err("Cannot request LCD GPIOs, error %d\n", r);
return;
}
omap_display_init(&sdp2430_dss_data);
}
#if IS_ENABLED(CONFIG_SMC91X) #if IS_ENABLED(CONFIG_SMC91X)
static struct omap_smc91x_platform_data board_smc91x_data = { static struct omap_smc91x_platform_data board_smc91x_data = {
...@@ -273,7 +242,7 @@ static void __init omap_2430sdp_init(void) ...@@ -273,7 +242,7 @@ static void __init omap_2430sdp_init(void)
gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW, gpio_request_one(SECONDARY_LCD_GPIO, GPIOF_OUT_INIT_LOW,
"Secondary LCD backlight"); "Secondary LCD backlight");
sdp2430_display_init(); omap_display_init(&sdp2430_dss_data);
} }
MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board")
......
...@@ -108,53 +108,38 @@ static struct twl4030_keypad_data sdp3430_kp_data = { ...@@ -108,53 +108,38 @@ static struct twl4030_keypad_data sdp3430_kp_data = {
#define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 8 #define SDP3430_LCD_PANEL_BACKLIGHT_GPIO 8
#define SDP3430_LCD_PANEL_ENABLE_GPIO 5 #define SDP3430_LCD_PANEL_ENABLE_GPIO 5
static struct gpio sdp3430_dss_gpios[] __initdata = {
{SDP3430_LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, "LCD reset" },
{SDP3430_LCD_PANEL_BACKLIGHT_GPIO, GPIOF_OUT_INIT_LOW, "LCD Backlight"},
};
static void __init sdp3430_display_init(void) static void __init sdp3430_display_init(void)
{ {
int r; int r;
r = gpio_request_array(sdp3430_dss_gpios, /*
ARRAY_SIZE(sdp3430_dss_gpios)); * the backlight GPIO doesn't directly go to the panel, it enables
* an internal circuit on 3430sdp to create the signal V_BKL_28V,
* this is connected to LED+ pin of the sharp panel. This GPIO
* is left enabled in the board file, and not passed to the panel
* as platform_data.
*/
r = gpio_request_one(SDP3430_LCD_PANEL_BACKLIGHT_GPIO,
GPIOF_OUT_INIT_HIGH, "LCD Backlight");
if (r) if (r)
printk(KERN_ERR "failed to get LCD control GPIOs\n"); pr_err("failed to get LCD Backlight GPIO\n");
}
static int sdp3430_panel_enable_lcd(struct omap_dss_device *dssdev)
{
gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 1);
gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 1);
return 0;
}
static void sdp3430_panel_disable_lcd(struct omap_dss_device *dssdev)
{
gpio_direction_output(SDP3430_LCD_PANEL_ENABLE_GPIO, 0);
gpio_direction_output(SDP3430_LCD_PANEL_BACKLIGHT_GPIO, 0);
}
static int sdp3430_panel_enable_tv(struct omap_dss_device *dssdev)
{
return 0;
}
static void sdp3430_panel_disable_tv(struct omap_dss_device *dssdev)
{
} }
static struct panel_sharp_ls037v7dw01_data sdp3430_lcd_data = {
.resb_gpio = SDP3430_LCD_PANEL_ENABLE_GPIO,
.ini_gpio = -1,
.mo_gpio = -1,
.lr_gpio = -1,
.ud_gpio = -1,
};
static struct omap_dss_device sdp3430_lcd_device = { static struct omap_dss_device sdp3430_lcd_device = {
.name = "lcd", .name = "lcd",
.driver_name = "sharp_ls_panel", .driver_name = "sharp_ls_panel",
.type = OMAP_DISPLAY_TYPE_DPI, .type = OMAP_DISPLAY_TYPE_DPI,
.phy.dpi.data_lines = 16, .phy.dpi.data_lines = 16,
.platform_enable = sdp3430_panel_enable_lcd, .data = &sdp3430_lcd_data,
.platform_disable = sdp3430_panel_disable_lcd,
}; };
static struct tfp410_platform_data dvi_panel = { static struct tfp410_platform_data dvi_panel = {
...@@ -175,8 +160,6 @@ static struct omap_dss_device sdp3430_tv_device = { ...@@ -175,8 +160,6 @@ static struct omap_dss_device sdp3430_tv_device = {
.driver_name = "venc", .driver_name = "venc",
.type = OMAP_DISPLAY_TYPE_VENC, .type = OMAP_DISPLAY_TYPE_VENC,
.phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
.platform_enable = sdp3430_panel_enable_tv,
.platform_disable = sdp3430_panel_disable_tv,
}; };
......
...@@ -730,7 +730,7 @@ static void __init omap_4430sdp_init(void) ...@@ -730,7 +730,7 @@ static void __init omap_4430sdp_init(void)
omap4_sdp4430_wifi_init(); omap4_sdp4430_wifi_init();
omap4_twl6030_hsmmc_init(mmc); omap4_twl6030_hsmmc_init(mmc);
usb_bind_phy("musb-hdrc.0.auto", 0, "omap-usb2.1.auto"); usb_bind_phy("musb-hdrc.2.auto", 0, "omap-usb2.3.auto");
usb_musb_init(&musb_board_data); usb_musb_init(&musb_board_data);
status = omap_ethernet_init(); status = omap_ethernet_init();
......
...@@ -120,63 +120,14 @@ static int __init am3517_evm_i2c_init(void) ...@@ -120,63 +120,14 @@ static int __init am3517_evm_i2c_init(void)
return 0; return 0;
} }
static int lcd_enabled;
static int dvi_enabled;
#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
static struct gpio am3517_evm_dss_gpios[] __initdata = {
/* GPIO 182 = LCD Backlight Power */
{ LCD_PANEL_BKLIGHT_PWR, GPIOF_OUT_INIT_HIGH, "lcd_backlight_pwr" },
/* GPIO 181 = LCD Panel PWM */
{ LCD_PANEL_PWM, GPIOF_OUT_INIT_HIGH, "lcd bl enable" },
/* GPIO 176 = LCD Panel Power enable pin */
{ LCD_PANEL_PWR, GPIOF_OUT_INIT_HIGH, "dvi enable" },
};
static void __init am3517_evm_display_init(void)
{
int r;
omap_mux_init_gpio(LCD_PANEL_PWR, OMAP_PIN_INPUT_PULLUP);
omap_mux_init_gpio(LCD_PANEL_BKLIGHT_PWR, OMAP_PIN_INPUT_PULLDOWN);
omap_mux_init_gpio(LCD_PANEL_PWM, OMAP_PIN_INPUT_PULLDOWN);
r = gpio_request_array(am3517_evm_dss_gpios,
ARRAY_SIZE(am3517_evm_dss_gpios));
if (r) {
printk(KERN_ERR "failed to get DSS panel control GPIOs\n");
return;
}
printk(KERN_INFO "Display initialized successfully\n");
}
#else
static void __init am3517_evm_display_init(void) {}
#endif
static int am3517_evm_panel_enable_lcd(struct omap_dss_device *dssdev)
{
if (dvi_enabled) {
printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
return -EINVAL;
}
gpio_set_value(LCD_PANEL_PWR, 1);
lcd_enabled = 1;
return 0;
}
static void am3517_evm_panel_disable_lcd(struct omap_dss_device *dssdev)
{
gpio_set_value(LCD_PANEL_PWR, 0);
lcd_enabled = 0;
}
static struct panel_generic_dpi_data lcd_panel = { static struct panel_generic_dpi_data lcd_panel = {
.name = "sharp_lq", .name = "sharp_lq",
.platform_enable = am3517_evm_panel_enable_lcd, .num_gpios = 3,
.platform_disable = am3517_evm_panel_disable_lcd, .gpios = {
LCD_PANEL_PWR,
LCD_PANEL_BKLIGHT_PWR,
LCD_PANEL_PWM,
},
}; };
static struct omap_dss_device am3517_evm_lcd_device = { static struct omap_dss_device am3517_evm_lcd_device = {
...@@ -187,22 +138,11 @@ static struct omap_dss_device am3517_evm_lcd_device = { ...@@ -187,22 +138,11 @@ static struct omap_dss_device am3517_evm_lcd_device = {
.phy.dpi.data_lines = 16, .phy.dpi.data_lines = 16,
}; };
static int am3517_evm_panel_enable_tv(struct omap_dss_device *dssdev)
{
return 0;
}
static void am3517_evm_panel_disable_tv(struct omap_dss_device *dssdev)
{
}
static struct omap_dss_device am3517_evm_tv_device = { static struct omap_dss_device am3517_evm_tv_device = {
.type = OMAP_DISPLAY_TYPE_VENC, .type = OMAP_DISPLAY_TYPE_VENC,
.name = "tv", .name = "tv",
.driver_name = "venc", .driver_name = "venc",
.phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
.platform_enable = am3517_evm_panel_enable_tv,
.platform_disable = am3517_evm_panel_disable_tv,
}; };
static struct tfp410_platform_data dvi_panel = { static struct tfp410_platform_data dvi_panel = {
...@@ -365,8 +305,6 @@ static void __init am3517_evm_init(void) ...@@ -365,8 +305,6 @@ static void __init am3517_evm_init(void)
usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data)); usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
usbhs_init(&usbhs_bdata); usbhs_init(&usbhs_bdata);
am3517_evm_hecc_init(&am3517_evm_hecc_pdata); am3517_evm_hecc_init(&am3517_evm_hecc_pdata);
/* DSS */
am3517_evm_display_init();
/* RTC - S35390A */ /* RTC - S35390A */
am3517_evm_rtc_init(); am3517_evm_rtc_init();
......
...@@ -190,45 +190,12 @@ static inline void cm_t35_init_nand(void) {} ...@@ -190,45 +190,12 @@ static inline void cm_t35_init_nand(void) {}
#define CM_T35_LCD_BL_GPIO 58 #define CM_T35_LCD_BL_GPIO 58
#define CM_T35_DVI_EN_GPIO 54 #define CM_T35_DVI_EN_GPIO 54
static int lcd_enabled;
static int dvi_enabled;
static int cm_t35_panel_enable_lcd(struct omap_dss_device *dssdev)
{
if (dvi_enabled) {
printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
return -EINVAL;
}
gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
gpio_set_value(CM_T35_LCD_BL_GPIO, 1);
lcd_enabled = 1;
return 0;
}
static void cm_t35_panel_disable_lcd(struct omap_dss_device *dssdev)
{
lcd_enabled = 0;
gpio_set_value(CM_T35_LCD_BL_GPIO, 0);
gpio_set_value(CM_T35_LCD_EN_GPIO, 0);
}
static int cm_t35_panel_enable_tv(struct omap_dss_device *dssdev)
{
return 0;
}
static void cm_t35_panel_disable_tv(struct omap_dss_device *dssdev)
{
}
static struct panel_generic_dpi_data lcd_panel = { static struct panel_generic_dpi_data lcd_panel = {
.name = "toppoly_tdo35s", .name = "toppoly_tdo35s",
.platform_enable = cm_t35_panel_enable_lcd, .num_gpios = 1,
.platform_disable = cm_t35_panel_disable_lcd, .gpios = {
CM_T35_LCD_BL_GPIO,
},
}; };
static struct omap_dss_device cm_t35_lcd_device = { static struct omap_dss_device cm_t35_lcd_device = {
...@@ -257,8 +224,6 @@ static struct omap_dss_device cm_t35_tv_device = { ...@@ -257,8 +224,6 @@ static struct omap_dss_device cm_t35_tv_device = {
.driver_name = "venc", .driver_name = "venc",
.type = OMAP_DISPLAY_TYPE_VENC, .type = OMAP_DISPLAY_TYPE_VENC,
.phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
.platform_enable = cm_t35_panel_enable_tv,
.platform_disable = cm_t35_panel_disable_tv,
}; };
static struct omap_dss_device *cm_t35_dss_devices[] = { static struct omap_dss_device *cm_t35_dss_devices[] = {
...@@ -292,11 +257,6 @@ static struct spi_board_info cm_t35_lcd_spi_board_info[] __initdata = { ...@@ -292,11 +257,6 @@ static struct spi_board_info cm_t35_lcd_spi_board_info[] __initdata = {
}, },
}; };
static struct gpio cm_t35_dss_gpios[] __initdata = {
{ CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW, "lcd enable" },
{ CM_T35_LCD_BL_GPIO, GPIOF_OUT_INIT_LOW, "lcd bl enable" },
};
static void __init cm_t35_init_display(void) static void __init cm_t35_init_display(void)
{ {
int err; int err;
...@@ -304,23 +264,21 @@ static void __init cm_t35_init_display(void) ...@@ -304,23 +264,21 @@ static void __init cm_t35_init_display(void)
spi_register_board_info(cm_t35_lcd_spi_board_info, spi_register_board_info(cm_t35_lcd_spi_board_info,
ARRAY_SIZE(cm_t35_lcd_spi_board_info)); ARRAY_SIZE(cm_t35_lcd_spi_board_info));
err = gpio_request_array(cm_t35_dss_gpios,
ARRAY_SIZE(cm_t35_dss_gpios)); err = gpio_request_one(CM_T35_LCD_EN_GPIO, GPIOF_OUT_INIT_LOW,
"lcd bl enable");
if (err) { if (err) {
pr_err("CM-T35: failed to request DSS control GPIOs\n"); pr_err("CM-T35: failed to request LCD EN GPIO\n");
return; return;
} }
gpio_export(CM_T35_LCD_EN_GPIO, 0);
gpio_export(CM_T35_LCD_BL_GPIO, 0);
msleep(50); msleep(50);
gpio_set_value(CM_T35_LCD_EN_GPIO, 1); gpio_set_value(CM_T35_LCD_EN_GPIO, 1);
err = omap_display_init(&cm_t35_dss_data); err = omap_display_init(&cm_t35_dss_data);
if (err) { if (err) {
pr_err("CM-T35: failed to register DSS device\n"); pr_err("CM-T35: failed to register DSS device\n");
gpio_free_array(cm_t35_dss_gpios, ARRAY_SIZE(cm_t35_dss_gpios)); gpio_free(CM_T35_LCD_EN_GPIO);
} }
} }
......
...@@ -103,19 +103,6 @@ static struct omap2_hsmmc_info mmc[] = { ...@@ -103,19 +103,6 @@ static struct omap2_hsmmc_info mmc[] = {
{} /* Terminator */ {} /* Terminator */
}; };
static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
{
if (gpio_is_valid(dssdev->reset_gpio))
gpio_set_value_cansleep(dssdev->reset_gpio, 1);
return 0;
}
static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
{
if (gpio_is_valid(dssdev->reset_gpio))
gpio_set_value_cansleep(dssdev->reset_gpio, 0);
}
static struct regulator_consumer_supply devkit8000_vmmc1_supply[] = { static struct regulator_consumer_supply devkit8000_vmmc1_supply[] = {
REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
}; };
...@@ -127,8 +114,7 @@ static struct regulator_consumer_supply devkit8000_vio_supply[] = { ...@@ -127,8 +114,7 @@ static struct regulator_consumer_supply devkit8000_vio_supply[] = {
static struct panel_generic_dpi_data lcd_panel = { static struct panel_generic_dpi_data lcd_panel = {
.name = "innolux_at070tn83", .name = "innolux_at070tn83",
.platform_enable = devkit8000_panel_enable_lcd, /* gpios filled in code */
.platform_disable = devkit8000_panel_disable_lcd,
}; };
static struct omap_dss_device devkit8000_lcd_device = { static struct omap_dss_device devkit8000_lcd_device = {
...@@ -210,8 +196,6 @@ static struct gpio_led gpio_leds[]; ...@@ -210,8 +196,6 @@ static struct gpio_led gpio_leds[];
static int devkit8000_twl_gpio_setup(struct device *dev, static int devkit8000_twl_gpio_setup(struct device *dev,
unsigned gpio, unsigned ngpio) unsigned gpio, unsigned ngpio)
{ {
int ret;
/* gpio + 0 is "mmc0_cd" (input/IRQ) */ /* gpio + 0 is "mmc0_cd" (input/IRQ) */
mmc[0].gpio_cd = gpio + 0; mmc[0].gpio_cd = gpio + 0;
omap_hsmmc_late_init(mmc); omap_hsmmc_late_init(mmc);
...@@ -220,13 +204,8 @@ static int devkit8000_twl_gpio_setup(struct device *dev, ...@@ -220,13 +204,8 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
/* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */ /* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */
devkit8000_lcd_device.reset_gpio = gpio + TWL4030_GPIO_MAX + 0; lcd_panel.num_gpios = 1;
ret = gpio_request_one(devkit8000_lcd_device.reset_gpio, lcd_panel.gpios[0] = gpio + TWL4030_GPIO_MAX + 0;
GPIOF_OUT_INIT_LOW, "LCD_PWREN");
if (ret < 0) {
devkit8000_lcd_device.reset_gpio = -EINVAL;
printk(KERN_ERR "Failed to request GPIO for LCD_PWRN\n");
}
/* gpio + 7 is "DVI_PD" (out, active low) */ /* gpio + 7 is "DVI_PD" (out, active low) */
dvi_panel.power_down_gpio = gpio + 7; dvi_panel.power_down_gpio = gpio + 7;
......
...@@ -181,34 +181,13 @@ static inline void __init ldp_init_smsc911x(void) ...@@ -181,34 +181,13 @@ static inline void __init ldp_init_smsc911x(void)
/* LCD */ /* LCD */
static int ldp_backlight_gpio;
static int ldp_lcd_enable_gpio;
#define LCD_PANEL_RESET_GPIO 55 #define LCD_PANEL_RESET_GPIO 55
#define LCD_PANEL_QVGA_GPIO 56 #define LCD_PANEL_QVGA_GPIO 56
static int ldp_panel_enable_lcd(struct omap_dss_device *dssdev)
{
if (gpio_is_valid(ldp_lcd_enable_gpio))
gpio_direction_output(ldp_lcd_enable_gpio, 1);
if (gpio_is_valid(ldp_backlight_gpio))
gpio_direction_output(ldp_backlight_gpio, 1);
return 0;
}
static void ldp_panel_disable_lcd(struct omap_dss_device *dssdev)
{
if (gpio_is_valid(ldp_lcd_enable_gpio))
gpio_direction_output(ldp_lcd_enable_gpio, 0);
if (gpio_is_valid(ldp_backlight_gpio))
gpio_direction_output(ldp_backlight_gpio, 0);
}
static struct panel_generic_dpi_data ldp_panel_data = { static struct panel_generic_dpi_data ldp_panel_data = {
.name = "nec_nl2432dr22-11b", .name = "nec_nl2432dr22-11b",
.platform_enable = ldp_panel_enable_lcd, .num_gpios = 4,
.platform_disable = ldp_panel_disable_lcd, /* gpios filled in code */
}; };
static struct omap_dss_device ldp_lcd_device = { static struct omap_dss_device ldp_lcd_device = {
...@@ -231,41 +210,19 @@ static struct omap_dss_board_info ldp_dss_data = { ...@@ -231,41 +210,19 @@ static struct omap_dss_board_info ldp_dss_data = {
static void __init ldp_display_init(void) static void __init ldp_display_init(void)
{ {
int r; ldp_panel_data.gpios[2] = LCD_PANEL_RESET_GPIO;
ldp_panel_data.gpios[3] = LCD_PANEL_QVGA_GPIO;
static struct gpio gpios[] __initdata = {
{LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
{LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
};
r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
if (r) {
pr_err("Cannot request LCD GPIOs, error %d\n", r);
return;
}
omap_display_init(&ldp_dss_data); omap_display_init(&ldp_dss_data);
} }
static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
{ {
int r; ldp_panel_data.gpios[0] = gpio + 7;
ldp_panel_data.gpio_invert[0] = true;
struct gpio gpios[] = {
{gpio + 7 , GPIOF_OUT_INIT_LOW, "LCD ENABLE"}, ldp_panel_data.gpios[1] = gpio + 15;
{gpio + 15, GPIOF_OUT_INIT_LOW, "LCD BACKLIGHT"}, ldp_panel_data.gpio_invert[1] = true;
};
r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
if (r) {
pr_err("Cannot request LCD GPIOs, error %d\n", r);
ldp_backlight_gpio = -EINVAL;
ldp_lcd_enable_gpio = -EINVAL;
return r;
}
ldp_backlight_gpio = gpio + 15;
ldp_lcd_enable_gpio = gpio + 7;
return 0; return 0;
} }
......
...@@ -155,61 +155,43 @@ static inline void __init omap3evm_init_smsc911x(void) { return; } ...@@ -155,61 +155,43 @@ static inline void __init omap3evm_init_smsc911x(void) { return; }
#define OMAP3EVM_LCD_PANEL_LR 2 #define OMAP3EVM_LCD_PANEL_LR 2
#define OMAP3EVM_LCD_PANEL_UD 3 #define OMAP3EVM_LCD_PANEL_UD 3
#define OMAP3EVM_LCD_PANEL_INI 152 #define OMAP3EVM_LCD_PANEL_INI 152
#define OMAP3EVM_LCD_PANEL_ENVDD 153
#define OMAP3EVM_LCD_PANEL_QVGA 154 #define OMAP3EVM_LCD_PANEL_QVGA 154
#define OMAP3EVM_LCD_PANEL_RESB 155 #define OMAP3EVM_LCD_PANEL_RESB 155
#define OMAP3EVM_LCD_PANEL_ENVDD 153
#define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO 210 #define OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO 210
/*
* OMAP3EVM DVI control signals
*/
#define OMAP3EVM_DVI_PANEL_EN_GPIO 199 #define OMAP3EVM_DVI_PANEL_EN_GPIO 199
static struct gpio omap3_evm_dss_gpios[] __initdata = { static struct panel_sharp_ls037v7dw01_data omap3_evm_lcd_data = {
{ OMAP3EVM_LCD_PANEL_RESB, GPIOF_OUT_INIT_HIGH, "lcd_panel_resb" }, .resb_gpio = OMAP3EVM_LCD_PANEL_RESB,
{ OMAP3EVM_LCD_PANEL_INI, GPIOF_OUT_INIT_HIGH, "lcd_panel_ini" }, .ini_gpio = OMAP3EVM_LCD_PANEL_INI,
{ OMAP3EVM_LCD_PANEL_QVGA, GPIOF_OUT_INIT_LOW, "lcd_panel_qvga" }, .mo_gpio = OMAP3EVM_LCD_PANEL_QVGA,
{ OMAP3EVM_LCD_PANEL_LR, GPIOF_OUT_INIT_HIGH, "lcd_panel_lr" }, .lr_gpio = OMAP3EVM_LCD_PANEL_LR,
{ OMAP3EVM_LCD_PANEL_UD, GPIOF_OUT_INIT_HIGH, "lcd_panel_ud" }, .ud_gpio = OMAP3EVM_LCD_PANEL_UD,
{ OMAP3EVM_LCD_PANEL_ENVDD, GPIOF_OUT_INIT_LOW, "lcd_panel_envdd" },
}; };
static int lcd_enabled;
static int dvi_enabled;
static void __init omap3_evm_display_init(void) static void __init omap3_evm_display_init(void)
{ {
int r; int r;
r = gpio_request_array(omap3_evm_dss_gpios, r = gpio_request_one(OMAP3EVM_LCD_PANEL_ENVDD, GPIOF_OUT_INIT_LOW,
ARRAY_SIZE(omap3_evm_dss_gpios)); "lcd_panel_envdd");
if (r) if (r)
printk(KERN_ERR "failed to get lcd_panel_* gpios\n"); pr_err("failed to get lcd_panel_envdd GPIO\n");
}
static int omap3_evm_enable_lcd(struct omap_dss_device *dssdev) r = gpio_request_one(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO,
{ GPIOF_OUT_INIT_LOW, "lcd_panel_bklight");
if (dvi_enabled) { if (r)
printk(KERN_ERR "cannot enable LCD, DVI is enabled\n"); pr_err("failed to get lcd_panel_bklight GPIO\n");
return -EINVAL;
}
gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 0);
if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0); gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0);
else else
gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1); gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1);
lcd_enabled = 1;
return 0;
}
static void omap3_evm_disable_lcd(struct omap_dss_device *dssdev)
{
gpio_set_value(OMAP3EVM_LCD_PANEL_ENVDD, 1);
if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2)
gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 1);
else
gpio_set_value_cansleep(OMAP3EVM_LCD_PANEL_BKLIGHT_GPIO, 0);
lcd_enabled = 0;
} }
static struct omap_dss_device omap3_evm_lcd_device = { static struct omap_dss_device omap3_evm_lcd_device = {
...@@ -217,26 +199,14 @@ static struct omap_dss_device omap3_evm_lcd_device = { ...@@ -217,26 +199,14 @@ static struct omap_dss_device omap3_evm_lcd_device = {
.driver_name = "sharp_ls_panel", .driver_name = "sharp_ls_panel",
.type = OMAP_DISPLAY_TYPE_DPI, .type = OMAP_DISPLAY_TYPE_DPI,
.phy.dpi.data_lines = 18, .phy.dpi.data_lines = 18,
.platform_enable = omap3_evm_enable_lcd, .data = &omap3_evm_lcd_data,
.platform_disable = omap3_evm_disable_lcd,
}; };
static int omap3_evm_enable_tv(struct omap_dss_device *dssdev)
{
return 0;
}
static void omap3_evm_disable_tv(struct omap_dss_device *dssdev)
{
}
static struct omap_dss_device omap3_evm_tv_device = { static struct omap_dss_device omap3_evm_tv_device = {
.name = "tv", .name = "tv",
.driver_name = "venc", .driver_name = "venc",
.type = OMAP_DISPLAY_TYPE_VENC, .type = OMAP_DISPLAY_TYPE_VENC,
.phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
.platform_enable = omap3_evm_enable_tv,
.platform_disable = omap3_evm_disable_tv,
}; };
static struct tfp410_platform_data dvi_panel = { static struct tfp410_platform_data dvi_panel = {
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "common.h" #include "common.h"
#include <video/omapdss.h> #include <video/omapdss.h>
#include <video/omap-panel-data.h>
#include <linux/platform_data/mtd-nand-omap2.h> #include <linux/platform_data/mtd-nand-omap2.h>
#include "mux.h" #include "mux.h"
...@@ -230,12 +231,16 @@ static struct twl4030_keypad_data pandora_kp_data = { ...@@ -230,12 +231,16 @@ static struct twl4030_keypad_data pandora_kp_data = {
.rep = 1, .rep = 1,
}; };
static struct panel_tpo_td043_data lcd_data = {
.nreset_gpio = 157,
};
static struct omap_dss_device pandora_lcd_device = { static struct omap_dss_device pandora_lcd_device = {
.name = "lcd", .name = "lcd",
.driver_name = "tpo_td043mtea1_panel", .driver_name = "tpo_td043mtea1_panel",
.type = OMAP_DISPLAY_TYPE_DPI, .type = OMAP_DISPLAY_TYPE_DPI,
.phy.dpi.data_lines = 24, .phy.dpi.data_lines = 24,
.reset_gpio = 157, .data = &lcd_data,
}; };
static struct omap_dss_device pandora_tv_device = { static struct omap_dss_device pandora_tv_device = {
......
...@@ -94,15 +94,6 @@ static void __init omap3_stalker_display_init(void) ...@@ -94,15 +94,6 @@ static void __init omap3_stalker_display_init(void)
return; return;
} }
static int omap3_stalker_enable_tv(struct omap_dss_device *dssdev)
{
return 0;
}
static void omap3_stalker_disable_tv(struct omap_dss_device *dssdev)
{
}
static struct omap_dss_device omap3_stalker_tv_device = { static struct omap_dss_device omap3_stalker_tv_device = {
.name = "tv", .name = "tv",
.driver_name = "venc", .driver_name = "venc",
...@@ -112,8 +103,6 @@ static struct omap_dss_device omap3_stalker_tv_device = { ...@@ -112,8 +103,6 @@ static struct omap_dss_device omap3_stalker_tv_device = {
#elif defined(CONFIG_OMAP2_VENC_OUT_TYPE_COMPOSITE) #elif defined(CONFIG_OMAP2_VENC_OUT_TYPE_COMPOSITE)
.u.venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE, .u.venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE,
#endif #endif
.platform_enable = omap3_stalker_enable_tv,
.platform_disable = omap3_stalker_disable_tv,
}; };
static struct tfp410_platform_data dvi_panel = { static struct tfp410_platform_data dvi_panel = {
......
...@@ -435,7 +435,7 @@ static void __init omap4_panda_init(void) ...@@ -435,7 +435,7 @@ static void __init omap4_panda_init(void)
omap_sdrc_init(NULL, NULL); omap_sdrc_init(NULL, NULL);
omap4_twl6030_hsmmc_init(mmc); omap4_twl6030_hsmmc_init(mmc);
omap4_ehci_init(); omap4_ehci_init();
usb_bind_phy("musb-hdrc.0.auto", 0, "omap-usb2.1.auto"); usb_bind_phy("musb-hdrc.2.auto", 0, "omap-usb2.3.auto");
usb_musb_init(&musb_board_data); usb_musb_init(&musb_board_data);
omap4_panda_display_init(); omap4_panda_display_init();
} }
......
...@@ -145,28 +145,9 @@ static inline void __init overo_init_smsc911x(void) { return; } ...@@ -145,28 +145,9 @@ static inline void __init overo_init_smsc911x(void) { return; }
#endif #endif
/* DSS */ /* DSS */
static int lcd_enabled;
static int dvi_enabled;
#define OVERO_GPIO_LCD_EN 144 #define OVERO_GPIO_LCD_EN 144
#define OVERO_GPIO_LCD_BL 145 #define OVERO_GPIO_LCD_BL 145
static struct gpio overo_dss_gpios[] __initdata = {
{ OVERO_GPIO_LCD_EN, GPIOF_OUT_INIT_HIGH, "OVERO_GPIO_LCD_EN" },
{ OVERO_GPIO_LCD_BL, GPIOF_OUT_INIT_HIGH, "OVERO_GPIO_LCD_BL" },
};
static void __init overo_display_init(void)
{
if (gpio_request_array(overo_dss_gpios, ARRAY_SIZE(overo_dss_gpios))) {
printk(KERN_ERR "could not obtain DSS control GPIOs\n");
return;
}
gpio_export(OVERO_GPIO_LCD_EN, 0);
gpio_export(OVERO_GPIO_LCD_BL, 0);
}
static struct tfp410_platform_data dvi_panel = { static struct tfp410_platform_data dvi_panel = {
.i2c_bus_num = 3, .i2c_bus_num = 3,
.power_down_gpio = -1, .power_down_gpio = -1,
...@@ -187,30 +168,13 @@ static struct omap_dss_device overo_tv_device = { ...@@ -187,30 +168,13 @@ static struct omap_dss_device overo_tv_device = {
.phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
}; };
static int overo_panel_enable_lcd(struct omap_dss_device *dssdev)
{
if (dvi_enabled) {
printk(KERN_ERR "cannot enable LCD, DVI is enabled\n");
return -EINVAL;
}
gpio_set_value(OVERO_GPIO_LCD_EN, 1);
gpio_set_value(OVERO_GPIO_LCD_BL, 1);
lcd_enabled = 1;
return 0;
}
static void overo_panel_disable_lcd(struct omap_dss_device *dssdev)
{
gpio_set_value(OVERO_GPIO_LCD_EN, 0);
gpio_set_value(OVERO_GPIO_LCD_BL, 0);
lcd_enabled = 0;
}
static struct panel_generic_dpi_data lcd43_panel = { static struct panel_generic_dpi_data lcd43_panel = {
.name = "samsung_lte430wq_f0c", .name = "samsung_lte430wq_f0c",
.platform_enable = overo_panel_enable_lcd, .num_gpios = 2,
.platform_disable = overo_panel_disable_lcd, .gpios = {
OVERO_GPIO_LCD_EN,
OVERO_GPIO_LCD_BL
},
}; };
static struct omap_dss_device overo_lcd43_device = { static struct omap_dss_device overo_lcd43_device = {
...@@ -223,13 +187,20 @@ static struct omap_dss_device overo_lcd43_device = { ...@@ -223,13 +187,20 @@ static struct omap_dss_device overo_lcd43_device = {
#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \ #if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE) defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
static struct panel_generic_dpi_data lcd35_panel = {
.num_gpios = 2,
.gpios = {
OVERO_GPIO_LCD_EN,
OVERO_GPIO_LCD_BL
},
};
static struct omap_dss_device overo_lcd35_device = { static struct omap_dss_device overo_lcd35_device = {
.type = OMAP_DISPLAY_TYPE_DPI, .type = OMAP_DISPLAY_TYPE_DPI,
.name = "lcd35", .name = "lcd35",
.driver_name = "lgphilips_lb035q02_panel", .driver_name = "lgphilips_lb035q02_panel",
.phy.dpi.data_lines = 24, .phy.dpi.data_lines = 24,
.platform_enable = overo_panel_enable_lcd, .data = &lcd35_panel,
.platform_disable = overo_panel_disable_lcd,
}; };
#endif #endif
...@@ -508,7 +479,6 @@ static void __init overo_init(void) ...@@ -508,7 +479,6 @@ static void __init overo_init(void)
usbhs_init(&usbhs_bdata); usbhs_init(&usbhs_bdata);
overo_spi_init(); overo_spi_init();
overo_init_smsc911x(); overo_init_smsc911x();
overo_display_init();
overo_init_led(); overo_init_led();
overo_init_keys(); overo_init_keys();
omap_twl4030_audio_init("overo", NULL); omap_twl4030_audio_init("overo", NULL);
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <video/omapdss.h> #include <video/omapdss.h>
#include <video/omap-panel-data.h>
#include <linux/platform_data/spi-omap2-mcspi.h> #include <linux/platform_data/spi-omap2-mcspi.h>
#include "soc.h" #include "soc.h"
...@@ -27,25 +29,16 @@ ...@@ -27,25 +29,16 @@
#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
static int rx51_lcd_enable(struct omap_dss_device *dssdev) static struct panel_acx565akm_data lcd_data = {
{ .reset_gpio = RX51_LCD_RESET_GPIO,
gpio_set_value(dssdev->reset_gpio, 1); };
return 0;
}
static void rx51_lcd_disable(struct omap_dss_device *dssdev)
{
gpio_set_value(dssdev->reset_gpio, 0);
}
static struct omap_dss_device rx51_lcd_device = { static struct omap_dss_device rx51_lcd_device = {
.name = "lcd", .name = "lcd",
.driver_name = "panel-acx565akm", .driver_name = "panel-acx565akm",
.type = OMAP_DISPLAY_TYPE_SDI, .type = OMAP_DISPLAY_TYPE_SDI,
.phy.sdi.datapairs = 2, .phy.sdi.datapairs = 2,
.reset_gpio = RX51_LCD_RESET_GPIO, .data = &lcd_data,
.platform_enable = rx51_lcd_enable,
.platform_disable = rx51_lcd_disable,
}; };
static struct omap_dss_device rx51_tv_device = { static struct omap_dss_device rx51_tv_device = {
...@@ -76,13 +69,8 @@ static int __init rx51_video_init(void) ...@@ -76,13 +69,8 @@ static int __init rx51_video_init(void)
return 0; return 0;
} }
if (gpio_request_one(RX51_LCD_RESET_GPIO, GPIOF_OUT_INIT_HIGH,
"LCD ACX565AKM reset")) {
pr_err("%s failed to get LCD Reset GPIO\n", __func__);
return 0;
}
omap_display_init(&rx51_dss_board_info); omap_display_init(&rx51_dss_board_info);
return 0; return 0;
} }
......
...@@ -15,8 +15,9 @@ ...@@ -15,8 +15,9 @@
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/platform_data/spi-omap2-mcspi.h> #include <linux/platform_data/spi-omap2-mcspi.h>
#include <video/omapdss.h> #include <video/omapdss.h>
#include "board-zoom.h" #include <video/omap-panel-data.h>
#include "board-zoom.h"
#include "soc.h" #include "soc.h"
#include "common.h" #include "common.h"
...@@ -24,37 +25,17 @@ ...@@ -24,37 +25,17 @@
#define LCD_PANEL_RESET_GPIO_PILOT 55 #define LCD_PANEL_RESET_GPIO_PILOT 55
#define LCD_PANEL_QVGA_GPIO 56 #define LCD_PANEL_QVGA_GPIO 56
static struct gpio zoom_lcd_gpios[] __initdata = { static struct panel_nec_nl8048_data zoom_lcd_data = {
{ -EINVAL, GPIOF_OUT_INIT_HIGH, "lcd reset" }, /* res_gpio filled in code */
{ LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "lcd qvga" }, .qvga_gpio = LCD_PANEL_QVGA_GPIO,
}; };
static void __init zoom_lcd_panel_init(void)
{
zoom_lcd_gpios[0].gpio = (omap_rev() > OMAP3430_REV_ES3_0) ?
LCD_PANEL_RESET_GPIO_PROD :
LCD_PANEL_RESET_GPIO_PILOT;
if (gpio_request_array(zoom_lcd_gpios, ARRAY_SIZE(zoom_lcd_gpios)))
pr_err("%s: Failed to get LCD GPIOs.\n", __func__);
}
static int zoom_panel_enable_lcd(struct omap_dss_device *dssdev)
{
return 0;
}
static void zoom_panel_disable_lcd(struct omap_dss_device *dssdev)
{
}
static struct omap_dss_device zoom_lcd_device = { static struct omap_dss_device zoom_lcd_device = {
.name = "lcd", .name = "lcd",
.driver_name = "NEC_8048_panel", .driver_name = "NEC_8048_panel",
.type = OMAP_DISPLAY_TYPE_DPI, .type = OMAP_DISPLAY_TYPE_DPI,
.phy.dpi.data_lines = 24, .phy.dpi.data_lines = 24,
.platform_enable = zoom_panel_enable_lcd, .data = &zoom_lcd_data,
.platform_disable = zoom_panel_disable_lcd,
}; };
static struct omap_dss_device *zoom_dss_devices[] = { static struct omap_dss_device *zoom_dss_devices[] = {
...@@ -67,6 +48,13 @@ static struct omap_dss_board_info zoom_dss_data = { ...@@ -67,6 +48,13 @@ static struct omap_dss_board_info zoom_dss_data = {
.default_device = &zoom_lcd_device, .default_device = &zoom_lcd_device,
}; };
static void __init zoom_lcd_panel_init(void)
{
zoom_lcd_data.res_gpio = (omap_rev() > OMAP3430_REV_ES3_0) ?
LCD_PANEL_RESET_GPIO_PROD :
LCD_PANEL_RESET_GPIO_PILOT;
}
static struct omap2_mcspi_device_config dss_lcd_mcspi_config = { static struct omap2_mcspi_device_config dss_lcd_mcspi_config = {
.turbo_mode = 1, .turbo_mode = 1,
}; };
......
...@@ -52,7 +52,6 @@ static struct omap_dss_device omap4_panda_dvi_device = { ...@@ -52,7 +52,6 @@ static struct omap_dss_device omap4_panda_dvi_device = {
.driver_name = "tfp410", .driver_name = "tfp410",
.data = &omap4_dvi_panel, .data = &omap4_dvi_panel,
.phy.dpi.data_lines = 24, .phy.dpi.data_lines = 24,
.reset_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
.channel = OMAP_DSS_CHANNEL_LCD2, .channel = OMAP_DSS_CHANNEL_LCD2,
}; };
...@@ -177,45 +176,12 @@ static struct picodlp_panel_data sdp4430_picodlp_pdata = { ...@@ -177,45 +176,12 @@ static struct picodlp_panel_data sdp4430_picodlp_pdata = {
.pwrgood_gpio = 45, .pwrgood_gpio = 45,
}; };
static void sdp4430_picodlp_init(void)
{
int r;
const struct gpio picodlp_gpios[] = {
{DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
"DLP POWER ON"},
{sdp4430_picodlp_pdata.emu_done_gpio, GPIOF_IN,
"DLP EMU DONE"},
{sdp4430_picodlp_pdata.pwrgood_gpio, GPIOF_OUT_INIT_LOW,
"DLP PWRGOOD"},
};
r = gpio_request_array(picodlp_gpios, ARRAY_SIZE(picodlp_gpios));
if (r)
pr_err("Cannot request PicoDLP GPIOs, error %d\n", r);
}
static int sdp4430_panel_enable_picodlp(struct omap_dss_device *dssdev)
{
gpio_set_value(DISPLAY_SEL_GPIO, 0);
gpio_set_value(DLP_POWER_ON_GPIO, 1);
return 0;
}
static void sdp4430_panel_disable_picodlp(struct omap_dss_device *dssdev)
{
gpio_set_value(DLP_POWER_ON_GPIO, 0);
gpio_set_value(DISPLAY_SEL_GPIO, 1);
}
static struct omap_dss_device sdp4430_picodlp_device = { static struct omap_dss_device sdp4430_picodlp_device = {
.name = "picodlp", .name = "picodlp",
.driver_name = "picodlp_panel", .driver_name = "picodlp_panel",
.type = OMAP_DISPLAY_TYPE_DPI, .type = OMAP_DISPLAY_TYPE_DPI,
.phy.dpi.data_lines = 24, .phy.dpi.data_lines = 24,
.channel = OMAP_DSS_CHANNEL_LCD2, .channel = OMAP_DSS_CHANNEL_LCD2,
.platform_enable = sdp4430_panel_enable_picodlp,
.platform_disable = sdp4430_panel_disable_picodlp,
.data = &sdp4430_picodlp_pdata, .data = &sdp4430_picodlp_pdata,
}; };
...@@ -232,17 +198,26 @@ static struct omap_dss_board_info sdp4430_dss_data = { ...@@ -232,17 +198,26 @@ static struct omap_dss_board_info sdp4430_dss_data = {
.default_device = &sdp4430_lcd_device, .default_device = &sdp4430_lcd_device,
}; };
/*
* we select LCD2 by default (instead of Pico DLP) by setting DISPLAY_SEL_GPIO.
* Setting DLP_POWER_ON gpio enables the VDLP_2V5 VDLP_1V8 and VDLP_1V0 rails
* used by picodlp on the 4430sdp platform. Keep this gpio disabled as LCD2 is
* selected by default
*/
void __init omap_4430sdp_display_init(void) void __init omap_4430sdp_display_init(void)
{ {
int r; int r;
/* Enable LCD2 by default (instead of Pico DLP) */
r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH, r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH,
"display_sel"); "display_sel");
if (r) if (r)
pr_err("%s: Could not get display_sel GPIO\n", __func__); pr_err("%s: Could not get display_sel GPIO\n", __func__);
sdp4430_picodlp_init(); r = gpio_request_one(DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
"DLP POWER ON");
if (r)
pr_err("%s: Could not get DLP POWER ON GPIO\n", __func__);
omap_display_init(&sdp4430_dss_data); omap_display_init(&sdp4430_dss_data);
/* /*
* OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and
...@@ -262,12 +237,15 @@ void __init omap_4430sdp_display_init_of(void) ...@@ -262,12 +237,15 @@ void __init omap_4430sdp_display_init_of(void)
{ {
int r; int r;
/* Enable LCD2 by default (instead of Pico DLP) */
r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH, r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH,
"display_sel"); "display_sel");
if (r) if (r)
pr_err("%s: Could not get display_sel GPIO\n", __func__); pr_err("%s: Could not get display_sel GPIO\n", __func__);
sdp4430_picodlp_init(); r = gpio_request_one(DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
"DLP POWER ON");
if (r)
pr_err("%s: Could not get DLP POWER ON GPIO\n", __func__);
omap_display_init(&sdp4430_dss_data); omap_display_init(&sdp4430_dss_data);
} }
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
#include <asm/smp_twd.h> #include <asm/smp_twd.h>
#include <asm/sched_clock.h> #include <asm/sched_clock.h>
#include <asm/arch_timer.h>
#include "omap_hwmod.h" #include "omap_hwmod.h"
#include "omap_device.h" #include "omap_device.h"
#include <plat/counter-32k.h> #include <plat/counter-32k.h>
...@@ -627,14 +626,10 @@ void __init omap4_local_timer_init(void) ...@@ -627,14 +626,10 @@ void __init omap4_local_timer_init(void)
#ifdef CONFIG_SOC_OMAP5 #ifdef CONFIG_SOC_OMAP5
void __init omap5_realtime_timer_init(void) void __init omap5_realtime_timer_init(void)
{ {
int err;
omap4_sync32k_timer_init(); omap4_sync32k_timer_init();
realtime_counter_init(); realtime_counter_init();
err = arch_timer_of_register(); clocksource_of_init();
if (err)
pr_err("%s: arch_timer_register failed %d\n", __func__, err);
} }
#endif /* CONFIG_SOC_OMAP5 */ #endif /* CONFIG_SOC_OMAP5 */
......
...@@ -90,6 +90,5 @@ DT_MACHINE_START(KZM9D_DT, "kzm9d") ...@@ -90,6 +90,5 @@ DT_MACHINE_START(KZM9D_DT, "kzm9d")
.init_irq = emev2_init_irq, .init_irq = emev2_init_irq,
.init_machine = kzm9d_add_standard_devices, .init_machine = kzm9d_add_standard_devices,
.init_late = shmobile_init_late, .init_late = shmobile_init_late,
.init_time = shmobile_timer_init,
.dt_compat = kzm9d_boards_compat_dt, .dt_compat = kzm9d_boards_compat_dt,
MACHINE_END MACHINE_END
...@@ -456,7 +456,6 @@ DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)") ...@@ -456,7 +456,6 @@ DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)")
.nr_irqs = NR_IRQS_LEGACY, .nr_irqs = NR_IRQS_LEGACY,
.init_irq = irqchip_init, .init_irq = irqchip_init,
.init_machine = emev2_add_standard_devices_dt, .init_machine = emev2_add_standard_devices_dt,
.init_time = shmobile_timer_init,
.dt_compat = emev2_boards_compat_dt, .dt_compat = emev2_boards_compat_dt,
MACHINE_END MACHINE_END
......
...@@ -1030,7 +1030,6 @@ DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)") ...@@ -1030,7 +1030,6 @@ DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
.init_early = r8a7740_add_early_devices_dt, .init_early = r8a7740_add_early_devices_dt,
.init_irq = r8a7740_init_irq, .init_irq = r8a7740_init_irq,
.init_machine = r8a7740_add_standard_devices_dt, .init_machine = r8a7740_add_standard_devices_dt,
.init_time = shmobile_timer_init,
.dt_compat = r8a7740_boards_compat_dt, .dt_compat = r8a7740_boards_compat_dt,
MACHINE_END MACHINE_END
......
...@@ -1175,7 +1175,6 @@ DT_MACHINE_START(SH7372_DT, "Generic SH7372 (Flattened Device Tree)") ...@@ -1175,7 +1175,6 @@ DT_MACHINE_START(SH7372_DT, "Generic SH7372 (Flattened Device Tree)")
.init_irq = sh7372_init_irq, .init_irq = sh7372_init_irq,
.handle_irq = shmobile_handle_irq_intc, .handle_irq = shmobile_handle_irq_intc,
.init_machine = sh7372_add_standard_devices_dt, .init_machine = sh7372_add_standard_devices_dt,
.init_time = shmobile_timer_init,
.dt_compat = sh7372_boards_compat_dt, .dt_compat = sh7372_boards_compat_dt,
MACHINE_END MACHINE_END
......
...@@ -1037,7 +1037,6 @@ DT_MACHINE_START(SH73A0_DT, "Generic SH73A0 (Flattened Device Tree)") ...@@ -1037,7 +1037,6 @@ DT_MACHINE_START(SH73A0_DT, "Generic SH73A0 (Flattened Device Tree)")
.nr_irqs = NR_IRQS_LEGACY, .nr_irqs = NR_IRQS_LEGACY,
.init_irq = irqchip_init, .init_irq = irqchip_init,
.init_machine = sh73a0_add_standard_devices_dt, .init_machine = sh73a0_add_standard_devices_dt,
.init_time = shmobile_timer_init,
.dt_compat = sh73a0_boards_compat_dt, .dt_compat = sh73a0_boards_compat_dt,
MACHINE_END MACHINE_END
#endif /* CONFIG_USE_OF */ #endif /* CONFIG_USE_OF */
...@@ -19,10 +19,8 @@ ...@@ -19,10 +19,8 @@
* *
*/ */
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/clocksource.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <asm/arch_timer.h>
#include <asm/mach/time.h>
#include <asm/smp_twd.h>
void __init shmobile_setup_delay(unsigned int max_cpu_core_mhz, void __init shmobile_setup_delay(unsigned int max_cpu_core_mhz,
unsigned int mult, unsigned int div) unsigned int mult, unsigned int div)
...@@ -63,6 +61,5 @@ void __init shmobile_earlytimer_init(void) ...@@ -63,6 +61,5 @@ void __init shmobile_earlytimer_init(void)
void __init shmobile_timer_init(void) void __init shmobile_timer_init(void)
{ {
arch_timer_of_register(); clocksource_of_init();
arch_timer_sched_clock_init();
} }
...@@ -7,10 +7,10 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include ...@@ -7,10 +7,10 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
# Common support # Common support
obj-y := restart.o time.o obj-y := restart.o time.o
obj-$(CONFIG_SMP) += headsmp.o platsmp.o smp-$(CONFIG_SMP) += headsmp.o platsmp.o
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o smp-$(CONFIG_HOTPLUG_CPU) += hotplug.o
obj-$(CONFIG_ARCH_SPEAR13XX) += spear13xx.o obj-$(CONFIG_ARCH_SPEAR13XX) += spear13xx.o $(smp-y)
obj-$(CONFIG_MACH_SPEAR1310) += spear1310.o obj-$(CONFIG_MACH_SPEAR1310) += spear1310.o
obj-$(CONFIG_MACH_SPEAR1340) += spear1340.o obj-$(CONFIG_MACH_SPEAR1340) += spear1340.o
......
...@@ -22,11 +22,6 @@ extern void spear13xx_timer_init(void); ...@@ -22,11 +22,6 @@ extern void spear13xx_timer_init(void);
extern void spear3xx_timer_init(void); extern void spear3xx_timer_init(void);
extern struct pl022_ssp_controller pl022_plat_data; extern struct pl022_ssp_controller pl022_plat_data;
extern struct pl08x_platform_data pl080_plat_data; extern struct pl08x_platform_data pl080_plat_data;
extern struct dw_dma_platform_data dmac_plat_data;
extern struct dw_dma_slave cf_dma_priv;
extern struct dw_dma_slave nand_read_dma_priv;
extern struct dw_dma_slave nand_write_dma_priv;
bool dw_dma_filter(struct dma_chan *chan, void *slave);
void __init spear_setup_of_timer(void); void __init spear_setup_of_timer(void);
void __init spear3xx_clk_init(void __iomem *misc_base, void __init spear3xx_clk_init(void __iomem *misc_base,
......
...@@ -82,8 +82,6 @@ ...@@ -82,8 +82,6 @@
#define VA_L2CC_BASE IOMEM(UL(0xFB000000)) #define VA_L2CC_BASE IOMEM(UL(0xFB000000))
/* others */ /* others */
#define DMAC0_BASE UL(0xEA800000)
#define DMAC1_BASE UL(0xEB000000)
#define MCIF_CF_BASE UL(0xB2800000) #define MCIF_CF_BASE UL(0xB2800000)
/* Debug uart for linux, will be used for debug and uncompress messages */ /* Debug uart for linux, will be used for debug and uncompress messages */
......
...@@ -23,40 +23,12 @@ ...@@ -23,40 +23,12 @@
#include <mach/spear.h> #include <mach/spear.h>
/* Base addresses */ /* Base addresses */
#define SPEAR1310_SSP1_BASE UL(0x5D400000)
#define SPEAR1310_SATA0_BASE UL(0xB1000000)
#define SPEAR1310_SATA1_BASE UL(0xB1800000)
#define SPEAR1310_SATA2_BASE UL(0xB4000000)
#define SPEAR1310_RAS_GRP1_BASE UL(0xD8000000) #define SPEAR1310_RAS_GRP1_BASE UL(0xD8000000)
#define VA_SPEAR1310_RAS_GRP1_BASE UL(0xFA000000) #define VA_SPEAR1310_RAS_GRP1_BASE UL(0xFA000000)
static struct arasan_cf_pdata cf_pdata = {
.cf_if_clk = CF_IF_CLK_166M,
.quirk = CF_BROKEN_UDMA,
.dma_priv = &cf_dma_priv,
};
/* ssp device registration */
static struct pl022_ssp_controller ssp1_plat_data = {
.enable_dma = 0,
};
/* Add SPEAr1310 auxdata to pass platform data */
static struct of_dev_auxdata spear1310_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, &cf_pdata),
OF_DEV_AUXDATA("snps,dma-spear1340", DMAC0_BASE, NULL, &dmac_plat_data),
OF_DEV_AUXDATA("snps,dma-spear1340", DMAC1_BASE, NULL, &dmac_plat_data),
OF_DEV_AUXDATA("arm,pl022", SSP_BASE, NULL, &pl022_plat_data),
OF_DEV_AUXDATA("arm,pl022", SPEAR1310_SSP1_BASE, NULL, &ssp1_plat_data),
{}
};
static void __init spear1310_dt_init(void) static void __init spear1310_dt_init(void)
{ {
of_platform_populate(NULL, of_default_bus_match_table, of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
spear1310_auxdata_lookup, NULL);
} }
static const char * const spear1310_dt_board_compat[] = { static const char * const spear1310_dt_board_compat[] = {
......
...@@ -16,18 +16,16 @@ ...@@ -16,18 +16,16 @@
#include <linux/ahci_platform.h> #include <linux/ahci_platform.h>
#include <linux/amba/serial.h> #include <linux/amba/serial.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/dw_dmac.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/irqchip.h> #include <linux/irqchip.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include "generic.h" #include "generic.h"
#include <mach/spear.h> #include <mach/spear.h>
#include "spear13xx-dma.h" /* FIXME: Move SATA PHY code into a standalone driver */
/* Base addresses */ /* Base addresses */
#define SPEAR1340_SATA_BASE UL(0xB1000000) #define SPEAR1340_SATA_BASE UL(0xB1000000)
#define SPEAR1340_UART1_BASE UL(0xB4100000)
/* Power Management Registers */ /* Power Management Registers */
#define SPEAR1340_PCM_CFG (VA_MISC_BASE + 0x100) #define SPEAR1340_PCM_CFG (VA_MISC_BASE + 0x100)
...@@ -79,28 +77,6 @@ ...@@ -79,28 +77,6 @@
(SPEAR1340_MIPHY_OSC_BYPASS_EXT | \ (SPEAR1340_MIPHY_OSC_BYPASS_EXT | \
SPEAR1340_MIPHY_PLL_RATIO_TOP(25)) SPEAR1340_MIPHY_PLL_RATIO_TOP(25))
static struct dw_dma_slave uart1_dma_param[] = {
{
/* Tx */
.cfg_hi = DWC_CFGH_DST_PER(SPEAR1340_DMA_REQ_UART1_TX),
.cfg_lo = 0,
.src_master = DMA_MASTER_MEMORY,
.dst_master = SPEAR1340_DMA_MASTER_UART1,
}, {
/* Rx */
.cfg_hi = DWC_CFGH_SRC_PER(SPEAR1340_DMA_REQ_UART1_RX),
.cfg_lo = 0,
.src_master = SPEAR1340_DMA_MASTER_UART1,
.dst_master = DMA_MASTER_MEMORY,
}
};
static struct amba_pl011_data uart1_data = {
.dma_filter = dw_dma_filter,
.dma_tx_param = &uart1_dma_param[0],
.dma_rx_param = &uart1_dma_param[1],
};
/* SATA device registration */ /* SATA device registration */
static int sata_miphy_init(struct device *dev, void __iomem *addr) static int sata_miphy_init(struct device *dev, void __iomem *addr)
{ {
...@@ -159,14 +135,8 @@ static struct ahci_platform_data sata_pdata = { ...@@ -159,14 +135,8 @@ static struct ahci_platform_data sata_pdata = {
/* Add SPEAr1340 auxdata to pass platform data */ /* Add SPEAr1340 auxdata to pass platform data */
static struct of_dev_auxdata spear1340_auxdata_lookup[] __initdata = { static struct of_dev_auxdata spear1340_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA("arasan,cf-spear1340", MCIF_CF_BASE, NULL, &cf_dma_priv),
OF_DEV_AUXDATA("snps,dma-spear1340", DMAC0_BASE, NULL, &dmac_plat_data),
OF_DEV_AUXDATA("snps,dma-spear1340", DMAC1_BASE, NULL, &dmac_plat_data),
OF_DEV_AUXDATA("arm,pl022", SSP_BASE, NULL, &pl022_plat_data),
OF_DEV_AUXDATA("snps,spear-ahci", SPEAR1340_SATA_BASE, NULL, OF_DEV_AUXDATA("snps,spear-ahci", SPEAR1340_SATA_BASE, NULL,
&sata_pdata), &sata_pdata),
OF_DEV_AUXDATA("arm,pl011", SPEAR1340_UART1_BASE, NULL, &uart1_data),
{} {}
}; };
......
/*
* arch/arm/mach-spear13xx/include/mach/dma.h
*
* DMA information for SPEAr13xx machine family
*
* Copyright (C) 2012 ST Microelectronics
* Viresh Kumar <viresh.linux@gmail.com>
*
* This file is licensed under the terms of the GNU General Public
* License version 2. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#ifndef __MACH_DMA_H
#define __MACH_DMA_H
/* request id of all the peripherals */
enum dma_master_info {
/* Accessible from only one master */
DMA_MASTER_MCIF = 0,
DMA_MASTER_FSMC = 1,
/* Accessible from both 0 & 1 */
DMA_MASTER_MEMORY = 0,
DMA_MASTER_ADC = 0,
DMA_MASTER_UART0 = 0,
DMA_MASTER_SSP0 = 0,
DMA_MASTER_I2C0 = 0,
#ifdef CONFIG_MACH_SPEAR1310
/* Accessible from only one master */
SPEAR1310_DMA_MASTER_JPEG = 1,
/* Accessible from both 0 & 1 */
SPEAR1310_DMA_MASTER_I2S = 0,
SPEAR1310_DMA_MASTER_UART1 = 0,
SPEAR1310_DMA_MASTER_UART2 = 0,
SPEAR1310_DMA_MASTER_UART3 = 0,
SPEAR1310_DMA_MASTER_UART4 = 0,
SPEAR1310_DMA_MASTER_UART5 = 0,
SPEAR1310_DMA_MASTER_I2C1 = 0,
SPEAR1310_DMA_MASTER_I2C2 = 0,
SPEAR1310_DMA_MASTER_I2C3 = 0,
SPEAR1310_DMA_MASTER_I2C4 = 0,
SPEAR1310_DMA_MASTER_I2C5 = 0,
SPEAR1310_DMA_MASTER_I2C6 = 0,
SPEAR1310_DMA_MASTER_I2C7 = 0,
SPEAR1310_DMA_MASTER_SSP1 = 0,
#endif
#ifdef CONFIG_MACH_SPEAR1340
/* Accessible from only one master */
SPEAR1340_DMA_MASTER_I2S_PLAY = 1,
SPEAR1340_DMA_MASTER_I2S_REC = 1,
SPEAR1340_DMA_MASTER_I2C1 = 1,
SPEAR1340_DMA_MASTER_UART1 = 1,
/* following are accessible from both master 0 & 1 */
SPEAR1340_DMA_MASTER_SPDIF = 0,
SPEAR1340_DMA_MASTER_CAM = 1,
SPEAR1340_DMA_MASTER_VIDEO_IN = 0,
SPEAR1340_DMA_MASTER_MALI = 0,
#endif
};
enum request_id {
DMA_REQ_ADC = 0,
DMA_REQ_SSP0_TX = 4,
DMA_REQ_SSP0_RX = 5,
DMA_REQ_UART0_TX = 6,
DMA_REQ_UART0_RX = 7,
DMA_REQ_I2C0_TX = 8,
DMA_REQ_I2C0_RX = 9,
#ifdef CONFIG_MACH_SPEAR1310
SPEAR1310_DMA_REQ_FROM_JPEG = 2,
SPEAR1310_DMA_REQ_TO_JPEG = 3,
SPEAR1310_DMA_REQ_I2S_TX = 10,
SPEAR1310_DMA_REQ_I2S_RX = 11,
SPEAR1310_DMA_REQ_I2C1_RX = 0,
SPEAR1310_DMA_REQ_I2C1_TX = 1,
SPEAR1310_DMA_REQ_I2C2_RX = 2,
SPEAR1310_DMA_REQ_I2C2_TX = 3,
SPEAR1310_DMA_REQ_I2C3_RX = 4,
SPEAR1310_DMA_REQ_I2C3_TX = 5,
SPEAR1310_DMA_REQ_I2C4_RX = 6,
SPEAR1310_DMA_REQ_I2C4_TX = 7,
SPEAR1310_DMA_REQ_I2C5_RX = 8,
SPEAR1310_DMA_REQ_I2C5_TX = 9,
SPEAR1310_DMA_REQ_I2C6_RX = 10,
SPEAR1310_DMA_REQ_I2C6_TX = 11,
SPEAR1310_DMA_REQ_UART1_RX = 12,
SPEAR1310_DMA_REQ_UART1_TX = 13,
SPEAR1310_DMA_REQ_UART2_RX = 14,
SPEAR1310_DMA_REQ_UART2_TX = 15,
SPEAR1310_DMA_REQ_UART5_RX = 16,
SPEAR1310_DMA_REQ_UART5_TX = 17,
SPEAR1310_DMA_REQ_SSP1_RX = 18,
SPEAR1310_DMA_REQ_SSP1_TX = 19,
SPEAR1310_DMA_REQ_I2C7_RX = 20,
SPEAR1310_DMA_REQ_I2C7_TX = 21,
SPEAR1310_DMA_REQ_UART3_RX = 28,
SPEAR1310_DMA_REQ_UART3_TX = 29,
SPEAR1310_DMA_REQ_UART4_RX = 30,
SPEAR1310_DMA_REQ_UART4_TX = 31,
#endif
#ifdef CONFIG_MACH_SPEAR1340
SPEAR1340_DMA_REQ_SPDIF_TX = 2,
SPEAR1340_DMA_REQ_SPDIF_RX = 3,
SPEAR1340_DMA_REQ_I2S_TX = 10,
SPEAR1340_DMA_REQ_I2S_RX = 11,
SPEAR1340_DMA_REQ_UART1_TX = 12,
SPEAR1340_DMA_REQ_UART1_RX = 13,
SPEAR1340_DMA_REQ_I2C1_TX = 14,
SPEAR1340_DMA_REQ_I2C1_RX = 15,
SPEAR1340_DMA_REQ_CAM0_EVEN = 0,
SPEAR1340_DMA_REQ_CAM0_ODD = 1,
SPEAR1340_DMA_REQ_CAM1_EVEN = 2,
SPEAR1340_DMA_REQ_CAM1_ODD = 3,
SPEAR1340_DMA_REQ_CAM2_EVEN = 4,
SPEAR1340_DMA_REQ_CAM2_ODD = 5,
SPEAR1340_DMA_REQ_CAM3_EVEN = 6,
SPEAR1340_DMA_REQ_CAM3_ODD = 7,
#endif
};
#endif /* __MACH_DMA_H */
...@@ -16,70 +16,12 @@ ...@@ -16,70 +16,12 @@
#include <linux/amba/pl022.h> #include <linux/amba/pl022.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/clocksource.h> #include <linux/clocksource.h>
#include <linux/dw_dmac.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/of.h> #include <linux/of.h>
#include <asm/hardware/cache-l2x0.h> #include <asm/hardware/cache-l2x0.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include "generic.h"
#include <mach/spear.h> #include <mach/spear.h>
#include "generic.h"
#include "spear13xx-dma.h"
/* common dw_dma filter routine to be used by peripherals */
bool dw_dma_filter(struct dma_chan *chan, void *slave)
{
struct dw_dma_slave *dws = (struct dw_dma_slave *)slave;
if (chan->device->dev == dws->dma_dev) {
chan->private = slave;
return true;
} else {
return false;
}
}
/* ssp device registration */
static struct dw_dma_slave ssp_dma_param[] = {
{
/* Tx */
.cfg_hi = DWC_CFGH_DST_PER(DMA_REQ_SSP0_TX),
.cfg_lo = 0,
.src_master = DMA_MASTER_MEMORY,
.dst_master = DMA_MASTER_SSP0,
}, {
/* Rx */
.cfg_hi = DWC_CFGH_SRC_PER(DMA_REQ_SSP0_RX),
.cfg_lo = 0,
.src_master = DMA_MASTER_SSP0,
.dst_master = DMA_MASTER_MEMORY,
}
};
struct pl022_ssp_controller pl022_plat_data = {
.enable_dma = 1,
.dma_filter = dw_dma_filter,
.dma_rx_param = &ssp_dma_param[1],
.dma_tx_param = &ssp_dma_param[0],
};
/* CF device registration */
struct dw_dma_slave cf_dma_priv = {
.cfg_hi = 0,
.cfg_lo = 0,
.src_master = 0,
.dst_master = 0,
};
/* dmac device registeration */
struct dw_dma_platform_data dmac_plat_data = {
.nr_channels = 8,
.chan_allocation_order = CHAN_ALLOCATION_DESCENDING,
.chan_priority = CHAN_PRIORITY_DESCENDING,
.block_size = 4095U,
.nr_masters = 2,
.data_width = { 3, 3, 0, 0 },
};
void __init spear13xx_l2x0_init(void) void __init spear13xx_l2x0_init(void)
{ {
......
...@@ -749,12 +749,25 @@ void versatile_restart(char mode, const char *cmd) ...@@ -749,12 +749,25 @@ void versatile_restart(char mode, const char *cmd)
/* Early initializations */ /* Early initializations */
void __init versatile_init_early(void) void __init versatile_init_early(void)
{ {
u32 val;
void __iomem *sys = __io_address(VERSATILE_SYS_BASE); void __iomem *sys = __io_address(VERSATILE_SYS_BASE);
osc4_clk.vcoreg = sys + VERSATILE_SYS_OSCCLCD_OFFSET; osc4_clk.vcoreg = sys + VERSATILE_SYS_OSCCLCD_OFFSET;
clkdev_add_table(lookups, ARRAY_SIZE(lookups)); clkdev_add_table(lookups, ARRAY_SIZE(lookups));
versatile_sched_clock_init(sys + VERSATILE_SYS_24MHz_OFFSET, 24000000); versatile_sched_clock_init(sys + VERSATILE_SYS_24MHz_OFFSET, 24000000);
/*
* set clock frequency:
* VERSATILE_REFCLK is 32KHz
* VERSATILE_TIMCLK is 1MHz
*/
val = readl(__io_address(VERSATILE_SCTL_BASE));
writel((VERSATILE_TIMCLK << VERSATILE_TIMER1_EnSel) |
(VERSATILE_TIMCLK << VERSATILE_TIMER2_EnSel) |
(VERSATILE_TIMCLK << VERSATILE_TIMER3_EnSel) |
(VERSATILE_TIMCLK << VERSATILE_TIMER4_EnSel) | val,
__io_address(VERSATILE_SCTL_BASE));
} }
void __init versatile_init(void) void __init versatile_init(void)
...@@ -785,19 +798,6 @@ void __init versatile_init(void) ...@@ -785,19 +798,6 @@ void __init versatile_init(void)
*/ */
void __init versatile_timer_init(void) void __init versatile_timer_init(void)
{ {
u32 val;
/*
* set clock frequency:
* VERSATILE_REFCLK is 32KHz
* VERSATILE_TIMCLK is 1MHz
*/
val = readl(__io_address(VERSATILE_SCTL_BASE));
writel((VERSATILE_TIMCLK << VERSATILE_TIMER1_EnSel) |
(VERSATILE_TIMCLK << VERSATILE_TIMER2_EnSel) |
(VERSATILE_TIMCLK << VERSATILE_TIMER3_EnSel) |
(VERSATILE_TIMCLK << VERSATILE_TIMER4_EnSel) | val,
__io_address(VERSATILE_SCTL_BASE));
/* /*
* Initialise to a known state (all timers off) * Initialise to a known state (all timers off)
......
...@@ -45,7 +45,6 @@ DT_MACHINE_START(VERSATILE_PB, "ARM-Versatile (Device Tree Support)") ...@@ -45,7 +45,6 @@ DT_MACHINE_START(VERSATILE_PB, "ARM-Versatile (Device Tree Support)")
.map_io = versatile_map_io, .map_io = versatile_map_io,
.init_early = versatile_init_early, .init_early = versatile_init_early,
.init_irq = versatile_init_irq, .init_irq = versatile_init_irq,
.init_time = versatile_timer_init,
.init_machine = versatile_dt_init, .init_machine = versatile_dt_init,
.dt_compat = versatile_dt_match, .dt_compat = versatile_dt_match,
.restart = versatile_restart, .restart = versatile_restart,
......
/* /*
* Versatile Express V2M Motherboard Support * Versatile Express V2M Motherboard Support
*/ */
#include <linux/clocksource.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/amba/bus.h> #include <linux/amba/bus.h>
#include <linux/amba/mmci.h> #include <linux/amba/mmci.h>
...@@ -25,7 +26,6 @@ ...@@ -25,7 +26,6 @@
#include <linux/clk-provider.h> #include <linux/clk-provider.h>
#include <linux/clkdev.h> #include <linux/clkdev.h>
#include <asm/arch_timer.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/sizes.h> #include <asm/sizes.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
...@@ -63,9 +63,6 @@ static void __init v2m_sp804_init(void __iomem *base, unsigned int irq) ...@@ -63,9 +63,6 @@ static void __init v2m_sp804_init(void __iomem *base, unsigned int irq)
if (WARN_ON(!base || irq == NO_IRQ)) if (WARN_ON(!base || irq == NO_IRQ))
return; return;
writel(0, base + TIMER_1_BASE + TIMER_CTRL);
writel(0, base + TIMER_2_BASE + TIMER_CTRL);
sp804_clocksource_init(base + TIMER_2_BASE, "v2m-timer1"); sp804_clocksource_init(base + TIMER_2_BASE, "v2m-timer1");
sp804_clockevents_init(base + TIMER_1_BASE, irq, "v2m-timer0"); sp804_clockevents_init(base + TIMER_1_BASE, irq, "v2m-timer0");
} }
...@@ -430,29 +427,11 @@ void __init v2m_dt_init_early(void) ...@@ -430,29 +427,11 @@ void __init v2m_dt_init_early(void)
static void __init v2m_dt_timer_init(void) static void __init v2m_dt_timer_init(void)
{ {
struct device_node *node = NULL;
of_clk_init(NULL); of_clk_init(NULL);
clocksource_of_init(); clocksource_of_init();
do {
node = of_find_compatible_node(node, NULL, "arm,sp804");
} while (node && vexpress_get_site_by_node(node) != VEXPRESS_SITE_MB);
if (node) {
pr_info("Using SP804 '%s' as a clock & events source\n",
node->full_name);
WARN_ON(clk_register_clkdev(of_clk_get_by_name(node,
"timclken1"), "v2m-timer0", "sp804"));
WARN_ON(clk_register_clkdev(of_clk_get_by_name(node,
"timclken2"), "v2m-timer1", "sp804"));
v2m_sp804_init(of_iomap(node, 0),
irq_of_parse_and_map(node, 0));
}
arch_timer_of_register();
if (arch_timer_sched_clock_init() != 0) versatile_sched_clock_init(vexpress_get_24mhz_clock_base(),
versatile_sched_clock_init(vexpress_get_24mhz_clock_base(),
24000000); 24000000);
} }
......
...@@ -23,21 +23,13 @@ ...@@ -23,21 +23,13 @@
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <asm/arch_timer.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/mach/time.h>
static void __init virt_init(void) static void __init virt_init(void)
{ {
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
} }
static void __init virt_timer_init(void)
{
WARN_ON(arch_timer_of_register() != 0);
WARN_ON(arch_timer_sched_clock_init() != 0);
}
static const char *virt_dt_match[] = { static const char *virt_dt_match[] = {
"linux,dummy-virt", "linux,dummy-virt",
NULL NULL
...@@ -47,7 +39,6 @@ extern struct smp_operations virt_smp_ops; ...@@ -47,7 +39,6 @@ extern struct smp_operations virt_smp_ops;
DT_MACHINE_START(VIRT, "Dummy Virtual Machine") DT_MACHINE_START(VIRT, "Dummy Virtual Machine")
.init_irq = irqchip_init, .init_irq = irqchip_init,
.init_time = virt_timer_init,
.init_machine = virt_init, .init_machine = virt_init,
.smp = smp_ops(virt_smp_ops), .smp = smp_ops(virt_smp_ops),
.dt_compat = virt_dt_match, .dt_compat = virt_dt_match,
......
...@@ -130,4 +130,9 @@ static inline u64 arch_counter_get_cntvct(void) ...@@ -130,4 +130,9 @@ static inline u64 arch_counter_get_cntvct(void)
return cval; return cval;
} }
static inline int arch_timer_arch_init(void)
{
return 0;
}
#endif #endif
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/clocksource.h>
#include <clocksource/arm_arch_timer.h> #include <clocksource/arm_arch_timer.h>
...@@ -77,10 +78,11 @@ void __init time_init(void) ...@@ -77,10 +78,11 @@ void __init time_init(void)
{ {
u32 arch_timer_rate; u32 arch_timer_rate;
if (arch_timer_init()) clocksource_of_init();
panic("Unable to initialise architected timer.\n");
arch_timer_rate = arch_timer_get_rate(); arch_timer_rate = arch_timer_get_rate();
if (!arch_timer_rate)
panic("Unable to initialise architected timer.\n");
/* Cache the sched_clock multiplier to save a divide in the hot path. */ /* Cache the sched_clock multiplier to save a divide in the hot path. */
sched_clock_mult = NSEC_PER_SEC / arch_timer_rate; sched_clock_mult = NSEC_PER_SEC / arch_timer_rate;
......
...@@ -209,8 +209,6 @@ struct arasan_cf_dev { ...@@ -209,8 +209,6 @@ struct arasan_cf_dev {
struct dma_chan *dma_chan; struct dma_chan *dma_chan;
/* Mask for DMA transfers */ /* Mask for DMA transfers */
dma_cap_mask_t mask; dma_cap_mask_t mask;
/* dma channel private data */
void *dma_priv;
/* DMA transfer work */ /* DMA transfer work */
struct work_struct work; struct work_struct work;
/* DMA delayed finish work */ /* DMA delayed finish work */
...@@ -308,6 +306,7 @@ static void cf_card_detect(struct arasan_cf_dev *acdev, bool hotplugged) ...@@ -308,6 +306,7 @@ static void cf_card_detect(struct arasan_cf_dev *acdev, bool hotplugged)
static int cf_init(struct arasan_cf_dev *acdev) static int cf_init(struct arasan_cf_dev *acdev)
{ {
struct arasan_cf_pdata *pdata = dev_get_platdata(acdev->host->dev); struct arasan_cf_pdata *pdata = dev_get_platdata(acdev->host->dev);
unsigned int if_clk;
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
...@@ -325,8 +324,12 @@ static int cf_init(struct arasan_cf_dev *acdev) ...@@ -325,8 +324,12 @@ static int cf_init(struct arasan_cf_dev *acdev)
spin_lock_irqsave(&acdev->host->lock, flags); spin_lock_irqsave(&acdev->host->lock, flags);
/* configure CF interface clock */ /* configure CF interface clock */
writel((pdata->cf_if_clk <= CF_IF_CLK_200M) ? pdata->cf_if_clk : /* TODO: read from device tree */
CF_IF_CLK_166M, acdev->vbase + CLK_CFG); if_clk = CF_IF_CLK_166M;
if (pdata && pdata->cf_if_clk <= CF_IF_CLK_200M)
if_clk = pdata->cf_if_clk;
writel(if_clk, acdev->vbase + CLK_CFG);
writel(TRUE_IDE_MODE | CFHOST_ENB, acdev->vbase + OP_MODE); writel(TRUE_IDE_MODE | CFHOST_ENB, acdev->vbase + OP_MODE);
cf_interrupt_enable(acdev, CARD_DETECT_IRQ, 1); cf_interrupt_enable(acdev, CARD_DETECT_IRQ, 1);
...@@ -357,12 +360,6 @@ static void dma_callback(void *dev) ...@@ -357,12 +360,6 @@ static void dma_callback(void *dev)
complete(&acdev->dma_completion); complete(&acdev->dma_completion);
} }
static bool filter(struct dma_chan *chan, void *slave)
{
chan->private = slave;
return true;
}
static inline void dma_complete(struct arasan_cf_dev *acdev) static inline void dma_complete(struct arasan_cf_dev *acdev)
{ {
struct ata_queued_cmd *qc = acdev->qc; struct ata_queued_cmd *qc = acdev->qc;
...@@ -530,8 +527,7 @@ static void data_xfer(struct work_struct *work) ...@@ -530,8 +527,7 @@ static void data_xfer(struct work_struct *work)
/* request dma channels */ /* request dma channels */
/* dma_request_channel may sleep, so calling from process context */ /* dma_request_channel may sleep, so calling from process context */
acdev->dma_chan = dma_request_channel(acdev->mask, filter, acdev->dma_chan = dma_request_slave_channel(acdev->host->dev, "data");
acdev->dma_priv);
if (!acdev->dma_chan) { if (!acdev->dma_chan) {
dev_err(acdev->host->dev, "Unable to get dma_chan\n"); dev_err(acdev->host->dev, "Unable to get dma_chan\n");
goto chan_request_fail; goto chan_request_fail;
...@@ -798,6 +794,7 @@ static int arasan_cf_probe(struct platform_device *pdev) ...@@ -798,6 +794,7 @@ static int arasan_cf_probe(struct platform_device *pdev)
struct ata_host *host; struct ata_host *host;
struct ata_port *ap; struct ata_port *ap;
struct resource *res; struct resource *res;
u32 quirk;
irq_handler_t irq_handler = NULL; irq_handler_t irq_handler = NULL;
int ret = 0; int ret = 0;
...@@ -817,12 +814,17 @@ static int arasan_cf_probe(struct platform_device *pdev) ...@@ -817,12 +814,17 @@ static int arasan_cf_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
} }
if (pdata)
quirk = pdata->quirk;
else
quirk = CF_BROKEN_UDMA; /* as it is on spear1340 */
/* if irq is 0, support only PIO */ /* if irq is 0, support only PIO */
acdev->irq = platform_get_irq(pdev, 0); acdev->irq = platform_get_irq(pdev, 0);
if (acdev->irq) if (acdev->irq)
irq_handler = arasan_cf_interrupt; irq_handler = arasan_cf_interrupt;
else else
pdata->quirk |= CF_BROKEN_MWDMA | CF_BROKEN_UDMA; quirk |= CF_BROKEN_MWDMA | CF_BROKEN_UDMA;
acdev->pbase = res->start; acdev->pbase = res->start;
acdev->vbase = devm_ioremap_nocache(&pdev->dev, res->start, acdev->vbase = devm_ioremap_nocache(&pdev->dev, res->start,
...@@ -859,17 +861,16 @@ static int arasan_cf_probe(struct platform_device *pdev) ...@@ -859,17 +861,16 @@ static int arasan_cf_probe(struct platform_device *pdev)
INIT_WORK(&acdev->work, data_xfer); INIT_WORK(&acdev->work, data_xfer);
INIT_DELAYED_WORK(&acdev->dwork, delayed_finish); INIT_DELAYED_WORK(&acdev->dwork, delayed_finish);
dma_cap_set(DMA_MEMCPY, acdev->mask); dma_cap_set(DMA_MEMCPY, acdev->mask);
acdev->dma_priv = pdata->dma_priv;
/* Handle platform specific quirks */ /* Handle platform specific quirks */
if (pdata->quirk) { if (quirk) {
if (pdata->quirk & CF_BROKEN_PIO) { if (quirk & CF_BROKEN_PIO) {
ap->ops->set_piomode = NULL; ap->ops->set_piomode = NULL;
ap->pio_mask = 0; ap->pio_mask = 0;
} }
if (pdata->quirk & CF_BROKEN_MWDMA) if (quirk & CF_BROKEN_MWDMA)
ap->mwdma_mask = 0; ap->mwdma_mask = 0;
if (pdata->quirk & CF_BROKEN_UDMA) if (quirk & CF_BROKEN_UDMA)
ap->udma_mask = 0; ap->udma_mask = 0;
} }
ap->flags |= ATA_FLAG_PIO_POLLING | ATA_FLAG_NO_ATAPI; ap->flags |= ATA_FLAG_PIO_POLLING | ATA_FLAG_NO_ATAPI;
......
...@@ -65,6 +65,7 @@ config CLKSRC_DBX500_PRCMU_SCHED_CLOCK ...@@ -65,6 +65,7 @@ config CLKSRC_DBX500_PRCMU_SCHED_CLOCK
config ARM_ARCH_TIMER config ARM_ARCH_TIMER
bool bool
select CLKSRC_OF if OF
config CLKSRC_METAG_GENERIC config CLKSRC_METAG_GENERIC
def_bool y if METAG def_bool y if METAG
......
...@@ -248,14 +248,16 @@ static void __cpuinit arch_timer_stop(struct clock_event_device *clk) ...@@ -248,14 +248,16 @@ static void __cpuinit arch_timer_stop(struct clock_event_device *clk)
static int __cpuinit arch_timer_cpu_notify(struct notifier_block *self, static int __cpuinit arch_timer_cpu_notify(struct notifier_block *self,
unsigned long action, void *hcpu) unsigned long action, void *hcpu)
{ {
struct clock_event_device *evt = this_cpu_ptr(arch_timer_evt); /*
* Grab cpu pointer in each case to avoid spurious
* preemptible warnings
*/
switch (action & ~CPU_TASKS_FROZEN) { switch (action & ~CPU_TASKS_FROZEN) {
case CPU_STARTING: case CPU_STARTING:
arch_timer_setup(evt); arch_timer_setup(this_cpu_ptr(arch_timer_evt));
break; break;
case CPU_DYING: case CPU_DYING:
arch_timer_stop(evt); arch_timer_stop(this_cpu_ptr(arch_timer_evt));
break; break;
} }
...@@ -337,22 +339,14 @@ static int __init arch_timer_register(void) ...@@ -337,22 +339,14 @@ static int __init arch_timer_register(void)
return err; return err;
} }
static const struct of_device_id arch_timer_of_match[] __initconst = { static void __init arch_timer_init(struct device_node *np)
{ .compatible = "arm,armv7-timer", },
{ .compatible = "arm,armv8-timer", },
{},
};
int __init arch_timer_init(void)
{ {
struct device_node *np;
u32 freq; u32 freq;
int i; int i;
np = of_find_matching_node(NULL, arch_timer_of_match); if (arch_timer_get_rate()) {
if (!np) { pr_warn("arch_timer: multiple nodes in dt, skipping\n");
pr_err("arch_timer: can't find DT node\n"); return;
return -ENODEV;
} }
/* Try to determine the frequency from the device tree or CNTFRQ */ /* Try to determine the frequency from the device tree or CNTFRQ */
...@@ -378,7 +372,7 @@ int __init arch_timer_init(void) ...@@ -378,7 +372,7 @@ int __init arch_timer_init(void)
if (!arch_timer_ppi[PHYS_SECURE_PPI] || if (!arch_timer_ppi[PHYS_SECURE_PPI] ||
!arch_timer_ppi[PHYS_NONSECURE_PPI]) { !arch_timer_ppi[PHYS_NONSECURE_PPI]) {
pr_warn("arch_timer: No interrupt available, giving up\n"); pr_warn("arch_timer: No interrupt available, giving up\n");
return -EINVAL; return;
} }
} }
...@@ -387,5 +381,8 @@ int __init arch_timer_init(void) ...@@ -387,5 +381,8 @@ int __init arch_timer_init(void)
else else
arch_timer_read_counter = arch_counter_get_cntpct; arch_timer_read_counter = arch_counter_get_cntpct;
return arch_timer_register(); arch_timer_register();
arch_timer_arch_init();
} }
CLOCKSOURCE_OF_DECLARE(armv7_arch_timer, "arm,armv7-timer", arch_timer_init);
CLOCKSOURCE_OF_DECLARE(armv8_arch_timer, "arm,armv8-timer", arch_timer_init);
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/clocksource.h> #include <linux/clocksource.h>
#include <asm/arch_timer.h>
#include <asm/localtimer.h> #include <asm/localtimer.h>
#include <plat/cpu.h> #include <plat/cpu.h>
......
...@@ -2,6 +2,7 @@ obj-$(CONFIG_IRQCHIP) += irqchip.o ...@@ -2,6 +2,7 @@ obj-$(CONFIG_IRQCHIP) += irqchip.o
obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o obj-$(CONFIG_ARCH_BCM2835) += irq-bcm2835.o
obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o obj-$(CONFIG_ARCH_EXYNOS) += exynos-combiner.o
obj-$(CONFIG_ARCH_MVEBU) += irq-armada-370-xp.o
obj-$(CONFIG_ARCH_MXS) += irq-mxs.o obj-$(CONFIG_ARCH_MXS) += irq-mxs.o
obj-$(CONFIG_ARCH_S3C24XX) += irq-s3c24xx.o obj-$(CONFIG_ARCH_S3C24XX) += irq-s3c24xx.o
obj-$(CONFIG_METAG) += irq-metag-ext.o obj-$(CONFIG_METAG) += irq-metag-ext.o
......
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/exception.h> #include <asm/exception.h>
#include <asm/smp_plat.h> #include <asm/smp_plat.h>
#include <asm/hardware/cache-l2x0.h> #include <asm/mach/irq.h>
#include "irqchip.h"
/* Interrupt Controller Registers Map */ /* Interrupt Controller Registers Map */
#define ARMADA_370_XP_INT_SET_MASK_OFFS (0x48) #define ARMADA_370_XP_INT_SET_MASK_OFFS (0x48)
...@@ -46,7 +48,9 @@ ...@@ -46,7 +48,9 @@
#define ARMADA_370_XP_TIMER0_PER_CPU_IRQ (5) #define ARMADA_370_XP_TIMER0_PER_CPU_IRQ (5)
#define ACTIVE_DOORBELLS (8) #define IPI_DOORBELL_START (0)
#define IPI_DOORBELL_END (8)
#define IPI_DOORBELL_MASK 0xFF
static DEFINE_RAW_SPINLOCK(irq_controller_lock); static DEFINE_RAW_SPINLOCK(irq_controller_lock);
...@@ -184,7 +188,7 @@ void armada_xp_mpic_smp_cpu_init(void) ...@@ -184,7 +188,7 @@ void armada_xp_mpic_smp_cpu_init(void)
writel(0, per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS); writel(0, per_cpu_int_base + ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS);
/* Enable first 8 IPIs */ /* Enable first 8 IPIs */
writel((1 << ACTIVE_DOORBELLS) - 1, per_cpu_int_base + writel(IPI_DOORBELL_MASK, per_cpu_int_base +
ARMADA_370_XP_IN_DRBEL_MSK_OFFS); ARMADA_370_XP_IN_DRBEL_MSK_OFFS);
/* Unmask IPI interrupt */ /* Unmask IPI interrupt */
...@@ -197,46 +201,8 @@ static struct irq_domain_ops armada_370_xp_mpic_irq_ops = { ...@@ -197,46 +201,8 @@ static struct irq_domain_ops armada_370_xp_mpic_irq_ops = {
.xlate = irq_domain_xlate_onecell, .xlate = irq_domain_xlate_onecell,
}; };
static int __init armada_370_xp_mpic_of_init(struct device_node *node, static asmlinkage void __exception_irq_entry
struct device_node *parent) armada_370_xp_handle_irq(struct pt_regs *regs)
{
u32 control;
main_int_base = of_iomap(node, 0);
per_cpu_int_base = of_iomap(node, 1);
BUG_ON(!main_int_base);
BUG_ON(!per_cpu_int_base);
control = readl(main_int_base + ARMADA_370_XP_INT_CONTROL);
armada_370_xp_mpic_domain =
irq_domain_add_linear(node, (control >> 2) & 0x3ff,
&armada_370_xp_mpic_irq_ops, NULL);
if (!armada_370_xp_mpic_domain)
panic("Unable to add Armada_370_Xp MPIC irq domain (DT)\n");
irq_set_default_host(armada_370_xp_mpic_domain);
#ifdef CONFIG_SMP
armada_xp_mpic_smp_cpu_init();
/*
* Set the default affinity from all CPUs to the boot cpu.
* This is required since the MPIC doesn't limit several CPUs
* from acknowledging the same interrupt.
*/
cpumask_clear(irq_default_affinity);
cpumask_set_cpu(smp_processor_id(), irq_default_affinity);
#endif
return 0;
}
asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs
*regs)
{ {
u32 irqstat, irqnr; u32 irqstat, irqnr;
...@@ -261,13 +227,14 @@ asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs ...@@ -261,13 +227,14 @@ asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs
ipimask = readl_relaxed(per_cpu_int_base + ipimask = readl_relaxed(per_cpu_int_base +
ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS) ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS)
& 0xFF; & IPI_DOORBELL_MASK;
writel(0x0, per_cpu_int_base + writel(~IPI_DOORBELL_MASK, per_cpu_int_base +
ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS); ARMADA_370_XP_IN_DRBEL_CAUSE_OFFS);
/* Handle all pending doorbells */ /* Handle all pending doorbells */
for (ipinr = 0; ipinr < ACTIVE_DOORBELLS; ipinr++) { for (ipinr = IPI_DOORBELL_START;
ipinr < IPI_DOORBELL_END; ipinr++) {
if (ipimask & (0x1 << ipinr)) if (ipimask & (0x1 << ipinr))
handle_IPI(ipinr, regs); handle_IPI(ipinr, regs);
} }
...@@ -278,15 +245,44 @@ asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs ...@@ -278,15 +245,44 @@ asmlinkage void __exception_irq_entry armada_370_xp_handle_irq(struct pt_regs
} while (1); } while (1);
} }
static const struct of_device_id mpic_of_match[] __initconst = { static int __init armada_370_xp_mpic_of_init(struct device_node *node,
{.compatible = "marvell,mpic", .data = armada_370_xp_mpic_of_init}, struct device_node *parent)
{},
};
void __init armada_370_xp_init_irq(void)
{ {
of_irq_init(mpic_of_match); u32 control;
#ifdef CONFIG_CACHE_L2X0
l2x0_of_init(0, ~0UL); main_int_base = of_iomap(node, 0);
per_cpu_int_base = of_iomap(node, 1);
BUG_ON(!main_int_base);
BUG_ON(!per_cpu_int_base);
control = readl(main_int_base + ARMADA_370_XP_INT_CONTROL);
armada_370_xp_mpic_domain =
irq_domain_add_linear(node, (control >> 2) & 0x3ff,
&armada_370_xp_mpic_irq_ops, NULL);
if (!armada_370_xp_mpic_domain)
panic("Unable to add Armada_370_Xp MPIC irq domain (DT)\n");
irq_set_default_host(armada_370_xp_mpic_domain);
#ifdef CONFIG_SMP
armada_xp_mpic_smp_cpu_init();
/*
* Set the default affinity from all CPUs to the boot cpu.
* This is required since the MPIC doesn't limit several CPUs
* from acknowledging the same interrupt.
*/
cpumask_clear(irq_default_affinity);
cpumask_set_cpu(smp_processor_id(), irq_default_affinity);
#endif #endif
set_handle_irq(armada_370_xp_handle_irq);
return 0;
} }
IRQCHIP_DECLARE(armada_370_xp_mpic, "marvell,mpic", armada_370_xp_mpic_of_init);
...@@ -1139,6 +1139,35 @@ static int pl022_dma_probe(struct pl022 *pl022) ...@@ -1139,6 +1139,35 @@ static int pl022_dma_probe(struct pl022 *pl022)
return -ENODEV; return -ENODEV;
} }
static int pl022_dma_autoprobe(struct pl022 *pl022)
{
struct device *dev = &pl022->adev->dev;
/* automatically configure DMA channels from platform, normally using DT */
pl022->dma_rx_channel = dma_request_slave_channel(dev, "rx");
if (!pl022->dma_rx_channel)
goto err_no_rxchan;
pl022->dma_tx_channel = dma_request_slave_channel(dev, "tx");
if (!pl022->dma_tx_channel)
goto err_no_txchan;
pl022->dummypage = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!pl022->dummypage)
goto err_no_dummypage;
return 0;
err_no_dummypage:
dma_release_channel(pl022->dma_tx_channel);
pl022->dma_tx_channel = NULL;
err_no_txchan:
dma_release_channel(pl022->dma_rx_channel);
pl022->dma_rx_channel = NULL;
err_no_rxchan:
return -ENODEV;
}
static void terminate_dma(struct pl022 *pl022) static void terminate_dma(struct pl022 *pl022)
{ {
struct dma_chan *rxchan = pl022->dma_rx_channel; struct dma_chan *rxchan = pl022->dma_rx_channel;
...@@ -1167,6 +1196,11 @@ static inline int configure_dma(struct pl022 *pl022) ...@@ -1167,6 +1196,11 @@ static inline int configure_dma(struct pl022 *pl022)
return -ENODEV; return -ENODEV;
} }
static inline int pl022_dma_autoprobe(struct pl022 *pl022)
{
return 0;
}
static inline int pl022_dma_probe(struct pl022 *pl022) static inline int pl022_dma_probe(struct pl022 *pl022)
{ {
return 0; return 0;
...@@ -2226,8 +2260,13 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id) ...@@ -2226,8 +2260,13 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id)
goto err_no_irq; goto err_no_irq;
} }
/* Get DMA channels */ /* Get DMA channels, try autoconfiguration first */
if (platform_info->enable_dma) { status = pl022_dma_autoprobe(pl022);
/* If that failed, use channels from platform_info */
if (status == 0)
platform_info->enable_dma = 1;
else if (platform_info->enable_dma) {
status = pl022_dma_probe(pl022); status = pl022_dma_probe(pl022);
if (status != 0) if (status != 0)
platform_info->enable_dma = 0; platform_info->enable_dma = 0;
......
...@@ -267,7 +267,7 @@ static void pl011_sgbuf_free(struct dma_chan *chan, struct pl011_sgbuf *sg, ...@@ -267,7 +267,7 @@ static void pl011_sgbuf_free(struct dma_chan *chan, struct pl011_sgbuf *sg,
} }
} }
static void pl011_dma_probe_initcall(struct uart_amba_port *uap) static void pl011_dma_probe_initcall(struct device *dev, struct uart_amba_port *uap)
{ {
/* DMA is the sole user of the platform data right now */ /* DMA is the sole user of the platform data right now */
struct amba_pl011_data *plat = uap->port.dev->platform_data; struct amba_pl011_data *plat = uap->port.dev->platform_data;
...@@ -281,20 +281,25 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap) ...@@ -281,20 +281,25 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap)
struct dma_chan *chan; struct dma_chan *chan;
dma_cap_mask_t mask; dma_cap_mask_t mask;
/* We need platform data */ chan = dma_request_slave_channel(dev, "tx");
if (!plat || !plat->dma_filter) {
dev_info(uap->port.dev, "no DMA platform data\n");
return;
}
/* Try to acquire a generic DMA engine slave TX channel */
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
chan = dma_request_channel(mask, plat->dma_filter, plat->dma_tx_param);
if (!chan) { if (!chan) {
dev_err(uap->port.dev, "no TX DMA channel!\n"); /* We need platform data */
return; if (!plat || !plat->dma_filter) {
dev_info(uap->port.dev, "no DMA platform data\n");
return;
}
/* Try to acquire a generic DMA engine slave TX channel */
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
chan = dma_request_channel(mask, plat->dma_filter,
plat->dma_tx_param);
if (!chan) {
dev_err(uap->port.dev, "no TX DMA channel!\n");
return;
}
} }
dmaengine_slave_config(chan, &tx_conf); dmaengine_slave_config(chan, &tx_conf);
...@@ -304,7 +309,18 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap) ...@@ -304,7 +309,18 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap)
dma_chan_name(uap->dmatx.chan)); dma_chan_name(uap->dmatx.chan));
/* Optionally make use of an RX channel as well */ /* Optionally make use of an RX channel as well */
if (plat->dma_rx_param) { chan = dma_request_slave_channel(dev, "rx");
if (!chan && plat->dma_rx_param) {
chan = dma_request_channel(mask, plat->dma_filter, plat->dma_rx_param);
if (!chan) {
dev_err(uap->port.dev, "no RX DMA channel!\n");
return;
}
}
if (chan) {
struct dma_slave_config rx_conf = { struct dma_slave_config rx_conf = {
.src_addr = uap->port.mapbase + UART01x_DR, .src_addr = uap->port.mapbase + UART01x_DR,
.src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE, .src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE,
...@@ -313,12 +329,6 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap) ...@@ -313,12 +329,6 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap)
.device_fc = false, .device_fc = false,
}; };
chan = dma_request_channel(mask, plat->dma_filter, plat->dma_rx_param);
if (!chan) {
dev_err(uap->port.dev, "no RX DMA channel!\n");
return;
}
dmaengine_slave_config(chan, &rx_conf); dmaengine_slave_config(chan, &rx_conf);
uap->dmarx.chan = chan; uap->dmarx.chan = chan;
...@@ -360,6 +370,7 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap) ...@@ -360,6 +370,7 @@ static void pl011_dma_probe_initcall(struct uart_amba_port *uap)
struct dma_uap { struct dma_uap {
struct list_head node; struct list_head node;
struct uart_amba_port *uap; struct uart_amba_port *uap;
struct device *dev;
}; };
static LIST_HEAD(pl011_dma_uarts); static LIST_HEAD(pl011_dma_uarts);
...@@ -370,7 +381,7 @@ static int __init pl011_dma_initcall(void) ...@@ -370,7 +381,7 @@ static int __init pl011_dma_initcall(void)
list_for_each_safe(node, tmp, &pl011_dma_uarts) { list_for_each_safe(node, tmp, &pl011_dma_uarts) {
struct dma_uap *dmau = list_entry(node, struct dma_uap, node); struct dma_uap *dmau = list_entry(node, struct dma_uap, node);
pl011_dma_probe_initcall(dmau->uap); pl011_dma_probe_initcall(dmau->dev, dmau->uap);
list_del(node); list_del(node);
kfree(dmau); kfree(dmau);
} }
...@@ -379,18 +390,19 @@ static int __init pl011_dma_initcall(void) ...@@ -379,18 +390,19 @@ static int __init pl011_dma_initcall(void)
device_initcall(pl011_dma_initcall); device_initcall(pl011_dma_initcall);
static void pl011_dma_probe(struct uart_amba_port *uap) static void pl011_dma_probe(struct device *dev, struct uart_amba_port *uap)
{ {
struct dma_uap *dmau = kzalloc(sizeof(struct dma_uap), GFP_KERNEL); struct dma_uap *dmau = kzalloc(sizeof(struct dma_uap), GFP_KERNEL);
if (dmau) { if (dmau) {
dmau->uap = uap; dmau->uap = uap;
dmau->dev = dev;
list_add_tail(&dmau->node, &pl011_dma_uarts); list_add_tail(&dmau->node, &pl011_dma_uarts);
} }
} }
#else #else
static void pl011_dma_probe(struct uart_amba_port *uap) static void pl011_dma_probe(struct device *dev, struct uart_amba_port *uap)
{ {
pl011_dma_probe_initcall(uap); pl011_dma_probe_initcall(dev, uap);
} }
#endif #endif
...@@ -1096,7 +1108,7 @@ static inline bool pl011_dma_rx_running(struct uart_amba_port *uap) ...@@ -1096,7 +1108,7 @@ static inline bool pl011_dma_rx_running(struct uart_amba_port *uap)
#else #else
/* Blank functions if the DMA engine is not available */ /* Blank functions if the DMA engine is not available */
static inline void pl011_dma_probe(struct uart_amba_port *uap) static inline void pl011_dma_probe(struct device *dev, struct uart_amba_port *uap)
{ {
} }
...@@ -2155,7 +2167,7 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) ...@@ -2155,7 +2167,7 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
uap->port.ops = &amba_pl011_pops; uap->port.ops = &amba_pl011_pops;
uap->port.flags = UPF_BOOT_AUTOCONF; uap->port.flags = UPF_BOOT_AUTOCONF;
uap->port.line = i; uap->port.line = i;
pl011_dma_probe(uap); pl011_dma_probe(&dev->dev, uap);
/* Ensure interrupts from this UART are masked and cleared */ /* Ensure interrupts from this UART are masked and cleared */
writew(0, uap->port.membase + UART011_IMSC); writew(0, uap->port.membase + UART011_IMSC);
......
...@@ -31,18 +31,12 @@ ...@@ -31,18 +31,12 @@
#ifdef CONFIG_ARM_ARCH_TIMER #ifdef CONFIG_ARM_ARCH_TIMER
extern int arch_timer_init(void);
extern u32 arch_timer_get_rate(void); extern u32 arch_timer_get_rate(void);
extern u64 (*arch_timer_read_counter)(void); extern u64 (*arch_timer_read_counter)(void);
extern struct timecounter *arch_timer_get_timecounter(void); extern struct timecounter *arch_timer_get_timecounter(void);
#else #else
static inline int arch_timer_init(void)
{
return -ENXIO;
}
static inline u32 arch_timer_get_rate(void) static inline u32 arch_timer_get_rate(void)
{ {
return 0; return 0;
......
...@@ -387,6 +387,11 @@ static inline int of_device_is_compatible(const struct device_node *device, ...@@ -387,6 +387,11 @@ static inline int of_device_is_compatible(const struct device_node *device,
return 0; return 0;
} }
static inline int of_device_is_available(const struct device_node *device)
{
return 0;
}
static inline struct property *of_find_property(const struct device_node *np, static inline struct property *of_find_property(const struct device_node *np,
const char *name, const char *name,
int *lenp) int *lenp)
......
...@@ -37,8 +37,6 @@ struct arasan_cf_pdata { ...@@ -37,8 +37,6 @@ struct arasan_cf_pdata {
#define CF_BROKEN_PIO (1) #define CF_BROKEN_PIO (1)
#define CF_BROKEN_MWDMA (1 << 1) #define CF_BROKEN_MWDMA (1 << 1)
#define CF_BROKEN_UDMA (1 << 2) #define CF_BROKEN_UDMA (1 << 2)
/* This is platform specific data for the DMA controller */
void *dma_priv;
}; };
static inline void static inline void
......
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