mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
Merge branch 'late/clksrc' into late/cleanup
There is no reason to keep the clksrc cleanups separate from the other cleanups, and this resolves some merge conflicts. Conflicts: arch/arm/mach-spear/spear13xx.c drivers/irqchip/Makefile
This commit is contained in:
commit
442a33ebce
353 changed files with 15288 additions and 4972 deletions
|
|
@ -673,6 +673,7 @@ config ARCH_TEGRA
|
|||
select HAVE_CLK
|
||||
select HAVE_SMP
|
||||
select MIGHT_HAVE_CACHE_L2X0
|
||||
select SOC_BUS
|
||||
select SPARSE_IRQ
|
||||
select USE_OF
|
||||
help
|
||||
|
|
@ -769,12 +770,15 @@ config ARCH_SA1100
|
|||
config ARCH_S3C24XX
|
||||
bool "Samsung S3C24XX SoCs"
|
||||
select ARCH_HAS_CPUFREQ
|
||||
select ARCH_USES_GETTIMEOFFSET
|
||||
select CLKDEV_LOOKUP
|
||||
select CLKSRC_MMIO
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select GENERIC_GPIO
|
||||
select HAVE_CLK
|
||||
select HAVE_S3C2410_I2C if I2C
|
||||
select HAVE_S3C2410_WATCHDOG if WATCHDOG
|
||||
select HAVE_S3C_RTC if RTC_CLASS
|
||||
select MULTI_IRQ_HANDLER
|
||||
select NEED_MACH_GPIO_H
|
||||
select NEED_MACH_IO_H
|
||||
help
|
||||
|
|
@ -787,10 +791,11 @@ config ARCH_S3C64XX
|
|||
bool "Samsung S3C64XX"
|
||||
select ARCH_HAS_CPUFREQ
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
select ARCH_USES_GETTIMEOFFSET
|
||||
select ARM_VIC
|
||||
select CLKDEV_LOOKUP
|
||||
select CLKSRC_MMIO
|
||||
select CPU_V6
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select HAVE_CLK
|
||||
select HAVE_S3C2410_I2C if I2C
|
||||
select HAVE_S3C2410_WATCHDOG if WATCHDOG
|
||||
|
|
@ -824,9 +829,11 @@ config ARCH_S5P64X0
|
|||
|
||||
config ARCH_S5PC100
|
||||
bool "Samsung S5PC100"
|
||||
select ARCH_USES_GETTIMEOFFSET
|
||||
select CLKDEV_LOOKUP
|
||||
select CLKSRC_MMIO
|
||||
select CPU_V7
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select GENERIC_GPIO
|
||||
select HAVE_CLK
|
||||
select HAVE_S3C2410_I2C if I2C
|
||||
select HAVE_S3C2410_WATCHDOG if WATCHDOG
|
||||
|
|
@ -1165,6 +1172,7 @@ config PLAT_VERSATILE
|
|||
config ARM_TIMER_SP804
|
||||
bool
|
||||
select CLKSRC_MMIO
|
||||
select CLKSRC_OF if OF
|
||||
select HAVE_SCHED_CLOCK
|
||||
|
||||
source arch/arm/mm/Kconfig
|
||||
|
|
@ -1595,6 +1603,7 @@ config HAVE_ARM_ARCH_TIMER
|
|||
config HAVE_ARM_TWD
|
||||
bool
|
||||
depends on SMP
|
||||
select CLKSRC_OF if OF
|
||||
help
|
||||
This options enables support for the ARM timer and watchdog unit
|
||||
|
||||
|
|
@ -1648,7 +1657,7 @@ config LOCAL_TIMERS
|
|||
bool "Use local timer interrupts"
|
||||
depends on SMP
|
||||
default y
|
||||
select HAVE_ARM_TWD if (!ARCH_MSM_SCORPIONMP && !EXYNOS4_MCT)
|
||||
select HAVE_ARM_TWD if (!ARCH_MSM_SCORPIONMP && !CLKSRC_EXYNOS_MCT)
|
||||
help
|
||||
Enable support for local timers on SMP platforms, rather then the
|
||||
legacy IPI broadcast method. Local timers allows the system
|
||||
|
|
@ -1663,7 +1672,8 @@ config ARCH_NR_GPIO
|
|||
default 1024 if ARCH_SHMOBILE || ARCH_TEGRA
|
||||
default 512 if SOC_OMAP5
|
||||
default 355 if ARCH_U8500
|
||||
default 288 if ARCH_VT8500 || ARCH_SUNXI
|
||||
default 352 if ARCH_VT8500
|
||||
default 288 if ARCH_SUNXI
|
||||
default 264 if MACH_H4700
|
||||
default 0
|
||||
help
|
||||
|
|
|
|||
|
|
@ -170,6 +170,8 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \
|
|||
tegra30-cardhu-a04.dtb \
|
||||
tegra114-dalmore.dtb \
|
||||
tegra114-pluto.dtb
|
||||
dtb-$(CONFIG_ARCH_VERSATILE) += versatile-ab.dtb \
|
||||
versatile-pb.dtb
|
||||
dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \
|
||||
vexpress-v2p-ca9.dtb \
|
||||
vexpress-v2p-ca15-tc1.dtb \
|
||||
|
|
|
|||
|
|
@ -47,6 +47,28 @@
|
|||
<0 12 0>, <0 13 0>, <0 14 0>, <0 15 0>;
|
||||
};
|
||||
|
||||
mct@10050000 {
|
||||
compatible = "samsung,exynos4210-mct";
|
||||
reg = <0x10050000 0x800>;
|
||||
interrupt-controller;
|
||||
#interrups-cells = <2>;
|
||||
interrupt-parent = <&mct_map>;
|
||||
interrupts = <0 0>, <1 0>, <2 0>, <3 0>,
|
||||
<4 0>, <5 0>;
|
||||
|
||||
mct_map: mct-map {
|
||||
#interrupt-cells = <2>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-map = <0x0 0 &gic 0 57 0>,
|
||||
<0x1 0 &gic 0 69 0>,
|
||||
<0x2 0 &combiner 12 6>,
|
||||
<0x3 0 &combiner 12 7>,
|
||||
<0x4 0 &gic 0 42 0>,
|
||||
<0x5 0 &gic 0 48 0>;
|
||||
};
|
||||
};
|
||||
|
||||
pinctrl_0: pinctrl@11400000 {
|
||||
compatible = "samsung,exynos4210-pinctrl";
|
||||
reg = <0x11400000 0x1000>;
|
||||
|
|
|
|||
|
|
@ -25,4 +25,26 @@
|
|||
gic:interrupt-controller@10490000 {
|
||||
cpu-offset = <0x8000>;
|
||||
};
|
||||
|
||||
mct@10050000 {
|
||||
compatible = "samsung,exynos4412-mct";
|
||||
reg = <0x10050000 0x800>;
|
||||
interrupt-controller;
|
||||
#interrups-cells = <2>;
|
||||
interrupt-parent = <&mct_map>;
|
||||
interrupts = <0 0>, <1 0>, <2 0>, <3 0>,
|
||||
<4 0>, <5 0>;
|
||||
|
||||
mct_map: mct-map {
|
||||
#interrupt-cells = <2>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-map = <0x0 0 &gic 0 57 0>,
|
||||
<0x1 0 &combiner 12 5>,
|
||||
<0x2 0 &combiner 12 6>,
|
||||
<0x3 0 &combiner 12 7>,
|
||||
<0x4 0 &gic 1 12 0>,
|
||||
<0x5 0 &gic 1 12 0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -25,4 +25,28 @@
|
|||
gic:interrupt-controller@10490000 {
|
||||
cpu-offset = <0x4000>;
|
||||
};
|
||||
|
||||
mct@10050000 {
|
||||
compatible = "samsung,exynos4412-mct";
|
||||
reg = <0x10050000 0x800>;
|
||||
interrupt-controller;
|
||||
#interrups-cells = <2>;
|
||||
interrupt-parent = <&mct_map>;
|
||||
interrupts = <0 0>, <1 0>, <2 0>, <3 0>,
|
||||
<4 0>, <5 0>, <6 0>, <7 0>;
|
||||
|
||||
mct_map: mct-map {
|
||||
#interrupt-cells = <2>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-map = <0x0 0 &gic 0 57 0>,
|
||||
<0x1 0 &combiner 12 5>,
|
||||
<0x2 0 &combiner 12 6>,
|
||||
<0x3 0 &combiner 12 7>,
|
||||
<0x4 0 &gic 1 12 0>,
|
||||
<0x5 0 &gic 1 12 0>,
|
||||
<0x6 0 &gic 1 12 0>,
|
||||
<0x7 0 &gic 1 12 0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -69,6 +69,28 @@
|
|||
<0 28 0>, <0 29 0>, <0 30 0>, <0 31 0>;
|
||||
};
|
||||
|
||||
mct@101C0000 {
|
||||
compatible = "samsung,exynos4210-mct";
|
||||
reg = <0x101C0000 0x800>;
|
||||
interrupt-controller;
|
||||
#interrups-cells = <2>;
|
||||
interrupt-parent = <&mct_map>;
|
||||
interrupts = <0 0>, <1 0>, <2 0>, <3 0>,
|
||||
<4 0>, <5 0>;
|
||||
|
||||
mct_map: mct-map {
|
||||
#interrupt-cells = <2>;
|
||||
#address-cells = <0>;
|
||||
#size-cells = <0>;
|
||||
interrupt-map = <0x0 0 &combiner 23 3>,
|
||||
<0x1 0 &combiner 23 4>,
|
||||
<0x2 0 &combiner 25 2>,
|
||||
<0x3 0 &combiner 25 3>,
|
||||
<0x4 0 &gic 0 120 0>,
|
||||
<0x5 0 &gic 0 121 0>;
|
||||
};
|
||||
};
|
||||
|
||||
watchdog {
|
||||
compatible = "samsung,s3c2410-wdt";
|
||||
reg = <0x101D0000 0x100>;
|
||||
|
|
|
|||
|
|
@ -24,15 +24,15 @@
|
|||
};
|
||||
|
||||
timer0: timer@13000000 {
|
||||
compatible = "arm,sp804", "arm,primecell";
|
||||
compatible = "arm,integrator-cp-timer";
|
||||
};
|
||||
|
||||
timer1: timer@13000100 {
|
||||
compatible = "arm,sp804", "arm,primecell";
|
||||
compatible = "arm,integrator-cp-timer";
|
||||
};
|
||||
|
||||
timer2: timer@13000200 {
|
||||
compatible = "arm,sp804", "arm,primecell";
|
||||
compatible = "arm,integrator-cp-timer";
|
||||
};
|
||||
|
||||
pic: pic@14000000 {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,57 @@
|
|||
};
|
||||
};
|
||||
|
||||
/* HS USB Port 2 RESET */
|
||||
hsusb2_reset: hsusb2_reset_reg {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "hsusb2_reset";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
gpio = <&gpio5 19 0>; /* gpio_147 */
|
||||
startup-delay-us = <70000>;
|
||||
enable-active-high;
|
||||
};
|
||||
|
||||
/* HS USB Port 2 Power */
|
||||
hsusb2_power: hsusb2_power_reg {
|
||||
compatible = "regulator-fixed";
|
||||
regulator-name = "hsusb2_vbus";
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
gpio = <&twl_gpio 18 0>; /* GPIO LEDA */
|
||||
startup-delay-us = <70000>;
|
||||
};
|
||||
|
||||
/* HS USB Host PHY on PORT 2 */
|
||||
hsusb2_phy: hsusb2_phy {
|
||||
compatible = "usb-nop-xceiv";
|
||||
reset-supply = <&hsusb2_reset>;
|
||||
vcc-supply = <&hsusb2_power>;
|
||||
};
|
||||
};
|
||||
|
||||
&omap3_pmx_core {
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <
|
||||
&hsusbb2_pins
|
||||
>;
|
||||
|
||||
hsusbb2_pins: pinmux_hsusbb2_pins {
|
||||
pinctrl-single,pins = <
|
||||
0x5c0 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk OUTPUT */
|
||||
0x5c2 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp OUTPUT */
|
||||
0x5c4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir INPUT | PULLDOWN */
|
||||
0x5c6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt INPUT | PULLDOWN */
|
||||
0x5c8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 INPUT | PULLDOWN */
|
||||
0x5cA 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 INPUT | PULLDOWN */
|
||||
0x1a4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 INPUT | PULLDOWN */
|
||||
0x1a6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 INPUT | PULLDOWN */
|
||||
0x1a8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 INPUT | PULLDOWN */
|
||||
0x1aa 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 INPUT | PULLDOWN */
|
||||
0x1ac 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 INPUT | PULLDOWN */
|
||||
0x1ae 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 INPUT | PULLDOWN */
|
||||
>;
|
||||
};
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
|
|
@ -65,3 +116,23 @@
|
|||
&mmc3 {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&usbhshost {
|
||||
port2-mode = "ehci-phy";
|
||||
};
|
||||
|
||||
&usbhsehci {
|
||||
phys = <0 &hsusb2_phy>;
|
||||
};
|
||||
|
||||
&twl_gpio {
|
||||
ti,use-leds;
|
||||
/* pullups: BIT(1) */
|
||||
ti,pullups = <0x000002>;
|
||||
/*
|
||||
* pulldowns:
|
||||
* BIT(2), BIT(6), BIT(7), BIT(8), BIT(13)
|
||||
* BIT(15), BIT(16), BIT(17)
|
||||
*/
|
||||
ti,pulldowns = <0x03a1c4>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -397,5 +397,36 @@
|
|||
ti,timer-alwon;
|
||||
ti,timer-secure;
|
||||
};
|
||||
|
||||
usbhstll: usbhstll@48062000 {
|
||||
compatible = "ti,usbhs-tll";
|
||||
reg = <0x48062000 0x1000>;
|
||||
interrupts = <78>;
|
||||
ti,hwmods = "usb_tll_hs";
|
||||
};
|
||||
|
||||
usbhshost: usbhshost@48064000 {
|
||||
compatible = "ti,usbhs-host";
|
||||
reg = <0x48064000 0x400>;
|
||||
ti,hwmods = "usb_host_hs";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
|
||||
usbhsohci: ohci@48064400 {
|
||||
compatible = "ti,ohci-omap3", "usb-ohci";
|
||||
reg = <0x48064400 0x400>;
|
||||
interrupt-parent = <&intc>;
|
||||
interrupts = <76>;
|
||||
};
|
||||
|
||||
usbhsehci: ehci@48064800 {
|
||||
compatible = "ti,ehci-omap", "usb-ehci";
|
||||
reg = <0x48064800 0x400>;
|
||||
interrupt-parent = <&intc>;
|
||||
interrupts = <77>;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -529,5 +529,35 @@
|
|||
ti,hwmods = "timer11";
|
||||
ti,timer-pwm;
|
||||
};
|
||||
|
||||
usbhstll: usbhstll@4a062000 {
|
||||
compatible = "ti,usbhs-tll";
|
||||
reg = <0x4a062000 0x1000>;
|
||||
interrupts = <0 78 0x4>;
|
||||
ti,hwmods = "usb_tll_hs";
|
||||
};
|
||||
|
||||
usbhshost: usbhshost@4a064000 {
|
||||
compatible = "ti,usbhs-host";
|
||||
reg = <0x4a064000 0x800>;
|
||||
ti,hwmods = "usb_host_hs";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
ranges;
|
||||
|
||||
usbhsohci: ohci@4a064800 {
|
||||
compatible = "ti,ohci-omap3", "usb-ohci";
|
||||
reg = <0x4a064800 0x400>;
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <0 76 0x4>;
|
||||
};
|
||||
|
||||
usbhsehci: ehci@4a064c00 {
|
||||
compatible = "ti,ehci-omap", "usb-ehci";
|
||||
reg = <0x4a064c00 0x400>;
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <0 77 0x4>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
98
arch/arm/boot/dts/r8a7779.dtsi
Normal file
98
arch/arm/boot/dts/r8a7779.dtsi
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* Device Tree Source for Renesas r8a7779
|
||||
*
|
||||
* Copyright (C) 2013 Renesas Solutions Corp.
|
||||
* Copyright (C) 2013 Simon Horman
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/include/ "skeleton.dtsi"
|
||||
|
||||
/ {
|
||||
compatible = "renesas,r8a7779";
|
||||
|
||||
cpus {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
cpu@0 {
|
||||
device_type = "cpu";
|
||||
compatible = "arm,cortex-a9";
|
||||
reg = <0>;
|
||||
};
|
||||
cpu@1 {
|
||||
device_type = "cpu";
|
||||
compatible = "arm,cortex-a9";
|
||||
reg = <1>;
|
||||
};
|
||||
cpu@2 {
|
||||
device_type = "cpu";
|
||||
compatible = "arm,cortex-a9";
|
||||
reg = <2>;
|
||||
};
|
||||
cpu@3 {
|
||||
device_type = "cpu";
|
||||
compatible = "arm,cortex-a9";
|
||||
reg = <3>;
|
||||
};
|
||||
};
|
||||
|
||||
gic: interrupt-controller@f0001000 {
|
||||
compatible = "arm,cortex-a9-gic";
|
||||
#interrupt-cells = <3>;
|
||||
interrupt-controller;
|
||||
reg = <0xf0001000 0x1000>,
|
||||
<0xf0000100 0x100>;
|
||||
};
|
||||
|
||||
i2c0: i2c@0xffc70000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "renesas,rmobile-iic";
|
||||
reg = <0xffc70000 0x1000>;
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <0 79 0x4>;
|
||||
};
|
||||
|
||||
i2c1: i2c@0xffc71000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "renesas,rmobile-iic";
|
||||
reg = <0xffc71000 0x1000>;
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <0 82 0x4>;
|
||||
};
|
||||
|
||||
i2c2: i2c@0xffc72000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "renesas,rmobile-iic";
|
||||
reg = <0xffc72000 0x1000>;
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <0 80 0x4>;
|
||||
};
|
||||
|
||||
i2c3: i2c@0xffc73000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "renesas,rmobile-iic";
|
||||
reg = <0xffc73000 0x1000>;
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <0 81 0x4>;
|
||||
};
|
||||
|
||||
thermal@ffc48000 {
|
||||
compatible = "renesas,rcar-thermal";
|
||||
reg = <0xffc48000 0x38>;
|
||||
};
|
||||
|
||||
sata: sata@fc600000 {
|
||||
compatible = "renesas,rcar-sata";
|
||||
reg = <0xfc600000 0x2000>;
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <0 100 0x4>;
|
||||
};
|
||||
};
|
||||
|
|
@ -12,10 +12,22 @@
|
|||
|
||||
serial@70006300 {
|
||||
status = "okay";
|
||||
clock-frequency = <408000000>;
|
||||
};
|
||||
|
||||
pmc {
|
||||
nvidia,invert-interrupt;
|
||||
};
|
||||
|
||||
clocks {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
clk32k_in: clock {
|
||||
compatible = "fixed-clock";
|
||||
reg=<0>;
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <32768>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,10 +12,22 @@
|
|||
|
||||
serial@70006300 {
|
||||
status = "okay";
|
||||
clock-frequency = <408000000>;
|
||||
};
|
||||
|
||||
pmc {
|
||||
nvidia,invert-interrupt;
|
||||
};
|
||||
|
||||
clocks {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
clk32k_in: clock {
|
||||
compatible = "fixed-clock";
|
||||
reg=<0>;
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <32768>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -24,10 +24,11 @@
|
|||
0 42 0x04
|
||||
0 121 0x04
|
||||
0 122 0x04>;
|
||||
clocks = <&tegra_car 5>;
|
||||
};
|
||||
|
||||
tegra_car: clock {
|
||||
compatible = "nvidia,tegra114-car, nvidia,tegra30-car";
|
||||
compatible = "nvidia,tegra114-car";
|
||||
reg = <0x60006000 0x1000>;
|
||||
#clock-cells = <1>;
|
||||
};
|
||||
|
|
@ -66,6 +67,7 @@
|
|||
reg-shift = <2>;
|
||||
interrupts = <0 36 0x04>;
|
||||
status = "disabled";
|
||||
clocks = <&tegra_car 6>;
|
||||
};
|
||||
|
||||
serial@70006040 {
|
||||
|
|
@ -74,6 +76,7 @@
|
|||
reg-shift = <2>;
|
||||
interrupts = <0 37 0x04>;
|
||||
status = "disabled";
|
||||
clocks = <&tegra_car 192>;
|
||||
};
|
||||
|
||||
serial@70006200 {
|
||||
|
|
@ -82,6 +85,7 @@
|
|||
reg-shift = <2>;
|
||||
interrupts = <0 46 0x04>;
|
||||
status = "disabled";
|
||||
clocks = <&tegra_car 55>;
|
||||
};
|
||||
|
||||
serial@70006300 {
|
||||
|
|
@ -90,17 +94,21 @@
|
|||
reg-shift = <2>;
|
||||
interrupts = <0 90 0x04>;
|
||||
status = "disabled";
|
||||
clocks = <&tegra_car 65>;
|
||||
};
|
||||
|
||||
rtc {
|
||||
compatible = "nvidia,tegra114-rtc", "nvidia,tegra20-rtc";
|
||||
reg = <0x7000e000 0x100>;
|
||||
interrupts = <0 2 0x04>;
|
||||
clocks = <&tegra_car 4>;
|
||||
};
|
||||
|
||||
pmc {
|
||||
compatible = "nvidia,tegra114-pmc", "nvidia,tegra30-pmc";
|
||||
compatible = "nvidia,tegra114-pmc";
|
||||
reg = <0x7000e400 0x400>;
|
||||
clocks = <&tegra_car 261>, <&clk32k_in>;
|
||||
clock-names = "pclk", "clk32k_in";
|
||||
};
|
||||
|
||||
iommu {
|
||||
|
|
|
|||
|
|
@ -444,7 +444,20 @@
|
|||
};
|
||||
|
||||
sdhci@c8000600 {
|
||||
cd-gpios = <&gpio 23 0>; /* gpio PC7 */
|
||||
cd-gpios = <&gpio 23 1>; /* gpio PC7 */
|
||||
};
|
||||
|
||||
clocks {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
clk32k_in: clock {
|
||||
compatible = "fixed-clock";
|
||||
reg=<0>;
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <32768>;
|
||||
};
|
||||
};
|
||||
|
||||
sound {
|
||||
|
|
|
|||
|
|
@ -437,7 +437,7 @@
|
|||
|
||||
sdhci@c8000200 {
|
||||
status = "okay";
|
||||
cd-gpios = <&gpio 69 0>; /* gpio PI5 */
|
||||
cd-gpios = <&gpio 69 1>; /* gpio PI5 */
|
||||
wp-gpios = <&gpio 57 0>; /* gpio PH1 */
|
||||
power-gpios = <&gpio 155 0>; /* gpio PT3 */
|
||||
bus-width = <4>;
|
||||
|
|
@ -445,12 +445,25 @@
|
|||
|
||||
sdhci@c8000600 {
|
||||
status = "okay";
|
||||
cd-gpios = <&gpio 58 0>; /* gpio PH2 */
|
||||
cd-gpios = <&gpio 58 1>; /* gpio PH2 */
|
||||
wp-gpios = <&gpio 59 0>; /* gpio PH3 */
|
||||
power-gpios = <&gpio 70 0>; /* gpio PI6 */
|
||||
bus-width = <8>;
|
||||
};
|
||||
|
||||
clocks {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
clk32k_in: clock {
|
||||
compatible = "fixed-clock";
|
||||
reg=<0>;
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <32768>;
|
||||
};
|
||||
};
|
||||
|
||||
kbc {
|
||||
status = "okay";
|
||||
nvidia,debounce-delay-ms = <2>;
|
||||
|
|
|
|||
|
|
@ -436,7 +436,7 @@
|
|||
|
||||
sdhci@c8000000 {
|
||||
status = "okay";
|
||||
cd-gpios = <&gpio 173 0>; /* gpio PV5 */
|
||||
cd-gpios = <&gpio 173 1>; /* gpio PV5 */
|
||||
wp-gpios = <&gpio 57 0>; /* gpio PH1 */
|
||||
power-gpios = <&gpio 169 0>; /* gpio PV1 */
|
||||
bus-width = <4>;
|
||||
|
|
@ -447,6 +447,19 @@
|
|||
bus-width = <8>;
|
||||
};
|
||||
|
||||
clocks {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
clk32k_in: clock {
|
||||
compatible = "fixed-clock";
|
||||
reg=<0>;
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <32768>;
|
||||
};
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
|
|
|
|||
|
|
@ -584,7 +584,7 @@
|
|||
|
||||
sdhci@c8000400 {
|
||||
status = "okay";
|
||||
cd-gpios = <&gpio 69 0>; /* gpio PI5 */
|
||||
cd-gpios = <&gpio 69 1>; /* gpio PI5 */
|
||||
wp-gpios = <&gpio 57 0>; /* gpio PH1 */
|
||||
power-gpios = <&gpio 70 0>; /* gpio PI6 */
|
||||
bus-width = <4>;
|
||||
|
|
@ -595,6 +595,19 @@
|
|||
bus-width = <8>;
|
||||
};
|
||||
|
||||
clocks {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
clk32k_in: clock {
|
||||
compatible = "fixed-clock";
|
||||
reg=<0>;
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <32768>;
|
||||
};
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
compatible = "gpio-keys";
|
||||
|
||||
|
|
|
|||
|
|
@ -465,12 +465,25 @@
|
|||
};
|
||||
|
||||
sdhci@c8000600 {
|
||||
cd-gpios = <&gpio 58 0>; /* gpio PH2 */
|
||||
cd-gpios = <&gpio 58 1>; /* gpio PH2 */
|
||||
wp-gpios = <&gpio 59 0>; /* gpio PH3 */
|
||||
bus-width = <4>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
clocks {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
clk32k_in: clock {
|
||||
compatible = "fixed-clock";
|
||||
reg=<0>;
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <32768>;
|
||||
};
|
||||
};
|
||||
|
||||
regulators {
|
||||
compatible = "simple-bus";
|
||||
|
||||
|
|
|
|||
|
|
@ -325,11 +325,24 @@
|
|||
|
||||
sdhci@c8000600 {
|
||||
status = "okay";
|
||||
cd-gpios = <&gpio 121 0>; /* gpio PP1 */
|
||||
cd-gpios = <&gpio 121 1>; /* gpio PP1 */
|
||||
wp-gpios = <&gpio 122 0>; /* gpio PP2 */
|
||||
bus-width = <4>;
|
||||
};
|
||||
|
||||
clocks {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
clk32k_in: clock {
|
||||
compatible = "fixed-clock";
|
||||
reg=<0>;
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <32768>;
|
||||
};
|
||||
};
|
||||
|
||||
poweroff {
|
||||
compatible = "gpio-poweroff";
|
||||
gpios = <&gpio 191 1>; /* gpio PX7, active low */
|
||||
|
|
|
|||
|
|
@ -520,7 +520,7 @@
|
|||
|
||||
sdhci@c8000400 {
|
||||
status = "okay";
|
||||
cd-gpios = <&gpio 69 0>; /* gpio PI5 */
|
||||
cd-gpios = <&gpio 69 1>; /* gpio PI5 */
|
||||
wp-gpios = <&gpio 57 0>; /* gpio PH1 */
|
||||
power-gpios = <&gpio 70 0>; /* gpio PI6 */
|
||||
bus-width = <4>;
|
||||
|
|
@ -531,6 +531,19 @@
|
|||
bus-width = <8>;
|
||||
};
|
||||
|
||||
clocks {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
clk32k_in: clock {
|
||||
compatible = "fixed-clock";
|
||||
reg=<0>;
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <32768>;
|
||||
};
|
||||
};
|
||||
|
||||
regulators {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
|
|
|
|||
|
|
@ -510,6 +510,7 @@
|
|||
|
||||
sdhci@c8000400 {
|
||||
status = "okay";
|
||||
cd-gpios = <&gpio 69 1>; /* gpio PI5 */
|
||||
wp-gpios = <&gpio 173 0>; /* gpio PV5 */
|
||||
bus-width = <8>;
|
||||
};
|
||||
|
|
@ -519,6 +520,19 @@
|
|||
bus-width = <8>;
|
||||
};
|
||||
|
||||
clocks {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
clk32k_in: clock {
|
||||
compatible = "fixed-clock";
|
||||
reg=<0>;
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <32768>;
|
||||
};
|
||||
};
|
||||
|
||||
kbc {
|
||||
status = "okay";
|
||||
nvidia,debounce-delay-ms = <20>;
|
||||
|
|
|
|||
|
|
@ -145,6 +145,7 @@
|
|||
0 1 0x04
|
||||
0 41 0x04
|
||||
0 42 0x04>;
|
||||
clocks = <&tegra_car 5>;
|
||||
};
|
||||
|
||||
tegra_car: clock {
|
||||
|
|
@ -304,6 +305,7 @@
|
|||
compatible = "nvidia,tegra20-rtc";
|
||||
reg = <0x7000e000 0x100>;
|
||||
interrupts = <0 2 0x04>;
|
||||
clocks = <&tegra_car 4>;
|
||||
};
|
||||
|
||||
i2c@7000c000 {
|
||||
|
|
@ -416,6 +418,8 @@
|
|||
pmc {
|
||||
compatible = "nvidia,tegra20-pmc";
|
||||
reg = <0x7000e400 0x400>;
|
||||
clocks = <&tegra_car 110>, <&clk32k_in>;
|
||||
clock-names = "pclk", "clk32k_in";
|
||||
};
|
||||
|
||||
memory-controller@7000f000 {
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@
|
|||
|
||||
sdhci@78000000 {
|
||||
status = "okay";
|
||||
cd-gpios = <&gpio 69 0>; /* gpio PI5 */
|
||||
cd-gpios = <&gpio 69 1>; /* gpio PI5 */
|
||||
wp-gpios = <&gpio 155 0>; /* gpio PT3 */
|
||||
power-gpios = <&gpio 31 0>; /* gpio PD7 */
|
||||
bus-width = <4>;
|
||||
|
|
@ -268,6 +268,19 @@
|
|||
bus-width = <8>;
|
||||
};
|
||||
|
||||
clocks {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
clk32k_in: clock {
|
||||
compatible = "fixed-clock";
|
||||
reg=<0>;
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <32768>;
|
||||
};
|
||||
};
|
||||
|
||||
regulators {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@
|
|||
|
||||
sdhci@78000000 {
|
||||
status = "okay";
|
||||
cd-gpios = <&gpio 69 0>; /* gpio PI5 */
|
||||
cd-gpios = <&gpio 69 1>; /* gpio PI5 */
|
||||
wp-gpios = <&gpio 155 0>; /* gpio PT3 */
|
||||
power-gpios = <&gpio 31 0>; /* gpio PD7 */
|
||||
bus-width = <4>;
|
||||
|
|
@ -322,6 +322,19 @@
|
|||
bus-width = <8>;
|
||||
};
|
||||
|
||||
clocks {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
clk32k_in: clock {
|
||||
compatible = "fixed-clock";
|
||||
reg=<0>;
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <32768>;
|
||||
};
|
||||
};
|
||||
|
||||
regulators {
|
||||
compatible = "simple-bus";
|
||||
#address-cells = <1>;
|
||||
|
|
|
|||
|
|
@ -148,6 +148,7 @@
|
|||
0 42 0x04
|
||||
0 121 0x04
|
||||
0 122 0x04>;
|
||||
clocks = <&tegra_car 5>;
|
||||
};
|
||||
|
||||
tegra_car: clock {
|
||||
|
|
@ -291,6 +292,7 @@
|
|||
compatible = "nvidia,tegra30-rtc", "nvidia,tegra20-rtc";
|
||||
reg = <0x7000e000 0x100>;
|
||||
interrupts = <0 2 0x04>;
|
||||
clocks = <&tegra_car 4>;
|
||||
};
|
||||
|
||||
i2c@7000c000 {
|
||||
|
|
@ -423,8 +425,10 @@
|
|||
};
|
||||
|
||||
pmc {
|
||||
compatible = "nvidia,tegra20-pmc", "nvidia,tegra30-pmc";
|
||||
compatible = "nvidia,tegra30-pmc";
|
||||
reg = <0x7000e400 0x400>;
|
||||
clocks = <&tegra_car 218>, <&clk32k_in>;
|
||||
clock-names = "pclk", "clk32k_in";
|
||||
};
|
||||
|
||||
memory-controller {
|
||||
|
|
|
|||
|
|
@ -121,6 +121,18 @@
|
|||
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 {
|
||||
compatible = "arm,pl061", "arm,primecell";
|
||||
reg = <0x101e4000 0x1000>;
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@
|
|||
<0 49 4>;
|
||||
clocks = <&oscclk2>, <&oscclk2>;
|
||||
clock-names = "timclk", "apb_pclk";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
watchdog@100e5000 {
|
||||
|
|
|
|||
|
|
@ -25,11 +25,13 @@
|
|||
#interrupt-cells = <1>;
|
||||
};
|
||||
|
||||
gpio: gpio-controller@d8110000 {
|
||||
compatible = "via,vt8500-gpio";
|
||||
gpio-controller;
|
||||
pinctrl: pinctrl@d8110000 {
|
||||
compatible = "via,vt8500-pinctrl";
|
||||
reg = <0xd8110000 0x10000>;
|
||||
#gpio-cells = <3>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
};
|
||||
|
||||
pmc@d8130000 {
|
||||
|
|
|
|||
|
|
@ -40,11 +40,13 @@
|
|||
interrupts = <56 57 58 59 60 61 62 63>;
|
||||
};
|
||||
|
||||
gpio: gpio-controller@d8110000 {
|
||||
compatible = "wm,wm8505-gpio";
|
||||
gpio-controller;
|
||||
pinctrl: pinctrl@d8110000 {
|
||||
compatible = "wm,wm8505-pinctrl";
|
||||
reg = <0xd8110000 0x10000>;
|
||||
#gpio-cells = <3>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
};
|
||||
|
||||
pmc@d8130000 {
|
||||
|
|
|
|||
|
|
@ -34,11 +34,13 @@
|
|||
interrupts = <56 57 58 59 60 61 62 63>;
|
||||
};
|
||||
|
||||
gpio: gpio-controller@d8110000 {
|
||||
compatible = "wm,wm8650-gpio";
|
||||
gpio-controller;
|
||||
pinctrl: pinctrl@d8110000 {
|
||||
compatible = "wm,wm8650-pinctrl";
|
||||
reg = <0xd8110000 0x10000>;
|
||||
#gpio-cells = <3>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
};
|
||||
|
||||
pmc@d8130000 {
|
||||
|
|
|
|||
|
|
@ -41,11 +41,13 @@
|
|||
interrupts = <56 57 58 59 60 61 62 63>;
|
||||
};
|
||||
|
||||
gpio: gpio-controller@d8110000 {
|
||||
compatible = "wm,wm8650-gpio";
|
||||
gpio-controller;
|
||||
pinctrl: pinctrl@d8110000 {
|
||||
compatible = "wm,wm8850-pinctrl";
|
||||
reg = <0xd8110000 0x10000>;
|
||||
#gpio-cells = <3>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
};
|
||||
|
||||
pmc@d8130000 {
|
||||
|
|
|
|||
|
|
@ -111,56 +111,23 @@
|
|||
};
|
||||
|
||||
ttc0: ttc0@f8001000 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "xlnx,ttc";
|
||||
interrupt-parent = <&intc>;
|
||||
interrupts = < 0 10 4 0 11 4 0 12 4 >;
|
||||
compatible = "cdns,ttc";
|
||||
reg = <0xF8001000 0x1000>;
|
||||
clocks = <&cpu_clk 3>;
|
||||
clock-names = "cpu_1x";
|
||||
clock-ranges;
|
||||
|
||||
ttc0_0: ttc0.0 {
|
||||
status = "disabled";
|
||||
reg = <0>;
|
||||
interrupts = <0 10 4>;
|
||||
};
|
||||
ttc0_1: ttc0.1 {
|
||||
status = "disabled";
|
||||
reg = <1>;
|
||||
interrupts = <0 11 4>;
|
||||
};
|
||||
ttc0_2: ttc0.2 {
|
||||
status = "disabled";
|
||||
reg = <2>;
|
||||
interrupts = <0 12 4>;
|
||||
};
|
||||
};
|
||||
|
||||
ttc1: ttc1@f8002000 {
|
||||
#interrupt-parent = <&intc>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "xlnx,ttc";
|
||||
interrupt-parent = <&intc>;
|
||||
interrupts = < 0 37 4 0 38 4 0 39 4 >;
|
||||
compatible = "cdns,ttc";
|
||||
reg = <0xF8002000 0x1000>;
|
||||
clocks = <&cpu_clk 3>;
|
||||
clock-names = "cpu_1x";
|
||||
clock-ranges;
|
||||
|
||||
ttc1_0: ttc1.0 {
|
||||
status = "disabled";
|
||||
reg = <0>;
|
||||
interrupts = <0 37 4>;
|
||||
};
|
||||
ttc1_1: ttc1.1 {
|
||||
status = "disabled";
|
||||
reg = <1>;
|
||||
interrupts = <0 38 4>;
|
||||
};
|
||||
ttc1_2: ttc1.2 {
|
||||
status = "disabled";
|
||||
reg = <2>;
|
||||
interrupts = <0 39 4>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -32,13 +32,3 @@
|
|||
&ps_clk {
|
||||
clock-frequency = <33333330>;
|
||||
};
|
||||
|
||||
&ttc0_0 {
|
||||
status = "ok"
|
||||
compatible = "xlnx,ttc-counter-clocksource";
|
||||
};
|
||||
|
||||
&ttc0_1 {
|
||||
status = "ok"
|
||||
compatible = "xlnx,ttc-counter-clockevent";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -25,33 +25,29 @@
|
|||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.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/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;
|
||||
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);
|
||||
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);
|
||||
return err;
|
||||
}
|
||||
|
||||
err = clk_enable(clk);
|
||||
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_put(clk);
|
||||
return err;
|
||||
|
|
@ -59,7 +55,7 @@ static long __init sp804_get_clock_rate(const char *name)
|
|||
|
||||
rate = clk_get_rate(clk);
|
||||
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_unprepare(clk);
|
||||
clk_put(clk);
|
||||
|
|
@ -77,9 +73,21 @@ static u32 sp804_read(void)
|
|||
|
||||
void __init __sp804_clocksource_and_sched_clock_init(void __iomem *base,
|
||||
const char *name,
|
||||
struct clk *clk,
|
||||
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)
|
||||
return;
|
||||
|
|
@ -171,12 +179,20 @@ static struct irqaction sp804_timer_irq = {
|
|||
.dev_id = &sp804_clockevent,
|
||||
};
|
||||
|
||||
void __init sp804_clockevents_init(void __iomem *base, unsigned int irq,
|
||||
const char *name)
|
||||
void __init __sp804_clockevents_init(void __iomem *base, unsigned int irq, struct clk *clk, const char *name)
|
||||
{
|
||||
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)
|
||||
return;
|
||||
|
||||
|
|
@ -186,6 +202,98 @@ void __init sp804_clockevents_init(void __iomem *base, unsigned int irq,
|
|||
evt->irq = irq;
|
||||
evt->cpumask = cpu_possible_mask;
|
||||
|
||||
writel(0, base + TIMER_CTRL);
|
||||
|
||||
setup_irq(irq, &sp804_timer_irq);
|
||||
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 @@
|
|||
#include <clocksource/arm_arch_timer.h>
|
||||
|
||||
#ifdef CONFIG_ARM_ARCH_TIMER
|
||||
int arch_timer_of_register(void);
|
||||
int arch_timer_sched_clock_init(void);
|
||||
int arch_timer_arch_init(void);
|
||||
|
||||
/*
|
||||
* These register accessors are marked inline so the compiler can
|
||||
|
|
@ -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));
|
||||
}
|
||||
#else
|
||||
static inline int arch_timer_of_register(void)
|
||||
{
|
||||
return -ENXIO;
|
||||
}
|
||||
|
||||
static inline int arch_timer_sched_clock_init(void)
|
||||
{
|
||||
return -ENXIO;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,15 +1,23 @@
|
|||
struct clk;
|
||||
|
||||
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)
|
||||
{
|
||||
__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,
|
||||
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 @@
|
|||
extern void sched_clock_postinit(void);
|
||||
extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate);
|
||||
|
||||
extern unsigned long long (*sched_clock_func)(void);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -34,12 +34,4 @@ struct twd_local_timer name __initdata = { \
|
|||
|
||||
int twd_local_timer_register(struct twd_local_timer *);
|
||||
|
||||
#ifdef CONFIG_HAVE_ARM_TWD
|
||||
void twd_local_timer_of_register(void);
|
||||
#else
|
||||
static inline void twd_local_timer_of_register(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -22,9 +22,11 @@ static unsigned long arch_timer_read_counter_long(void)
|
|||
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;
|
||||
|
|
@ -37,25 +39,20 @@ static void __init arch_timer_delay_timer_register(void)
|
|||
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 (ret)
|
||||
return ret;
|
||||
if (arch_timer_rate == 0)
|
||||
return -ENXIO;
|
||||
|
||||
arch_timer_delay_timer_register();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __init arch_timer_sched_clock_init(void)
|
||||
{
|
||||
if (arch_timer_get_rate() == 0)
|
||||
return -ENXIO;
|
||||
|
||||
setup_sched_clock(arch_timer_read_counter_u32,
|
||||
32, arch_timer_get_rate());
|
||||
/* 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;
|
||||
pr_info("sched_clock: ARM arch timer >56 bits at %ukHz, resolution %uns\n",
|
||||
arch_timer_rate / 1000, sched_clock_mult);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -562,21 +562,21 @@ ENDPROC(__und_usr)
|
|||
@ Fall-through from Thumb-2 __und_usr
|
||||
@
|
||||
#ifdef CONFIG_NEON
|
||||
get_thread_info r10 @ get current thread
|
||||
adr r6, .LCneon_thumb_opcodes
|
||||
b 2f
|
||||
#endif
|
||||
call_fpe:
|
||||
get_thread_info r10 @ get current thread
|
||||
#ifdef CONFIG_NEON
|
||||
adr r6, .LCneon_arm_opcodes
|
||||
2:
|
||||
ldr r7, [r6], #4 @ mask value
|
||||
cmp r7, #0 @ end mask?
|
||||
beq 1f
|
||||
and r8, r0, r7
|
||||
2: ldr r5, [r6], #4 @ mask value
|
||||
ldr r7, [r6], #4 @ opcode bits matching in mask
|
||||
cmp r5, #0 @ end mask?
|
||||
beq 1f
|
||||
and r8, r0, r5
|
||||
cmp r8, r7 @ NEON instruction?
|
||||
bne 2b
|
||||
get_thread_info r10
|
||||
mov r7, #1
|
||||
strb r7, [r10, #TI_USED_CP + 10] @ mark CP#10 as used
|
||||
strb r7, [r10, #TI_USED_CP + 11] @ mark CP#11 as used
|
||||
|
|
@ -586,7 +586,6 @@ call_fpe:
|
|||
tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27
|
||||
tstne r0, #0x04000000 @ bit 26 set on both ARM and Thumb-2
|
||||
moveq pc, lr
|
||||
get_thread_info r10 @ get current thread
|
||||
and r8, r0, #0x00000f00 @ mask out CP number
|
||||
THUMB( lsr r8, r8, #8 )
|
||||
mov r7, #1
|
||||
|
|
|
|||
|
|
@ -459,15 +459,16 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
|
|||
* atomic helpers and the signal restart code. Insert it into the
|
||||
* gate_vma so that it is visible through ptrace and /proc/<pid>/mem.
|
||||
*/
|
||||
static struct vm_area_struct gate_vma;
|
||||
static struct vm_area_struct gate_vma = {
|
||||
.vm_start = 0xffff0000,
|
||||
.vm_end = 0xffff0000 + PAGE_SIZE,
|
||||
.vm_flags = VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYEXEC,
|
||||
.vm_mm = &init_mm,
|
||||
};
|
||||
|
||||
static int __init gate_vma_init(void)
|
||||
{
|
||||
gate_vma.vm_start = 0xffff0000;
|
||||
gate_vma.vm_end = 0xffff0000 + PAGE_SIZE;
|
||||
gate_vma.vm_page_prot = PAGE_READONLY_EXEC;
|
||||
gate_vma.vm_flags = VM_READ | VM_EXEC |
|
||||
VM_MAYREAD | VM_MAYEXEC;
|
||||
gate_vma.vm_page_prot = PAGE_READONLY_EXEC;
|
||||
return 0;
|
||||
}
|
||||
arch_initcall(gate_vma_init);
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ struct clock_data {
|
|||
u64 epoch_ns;
|
||||
u32 epoch_cyc;
|
||||
u32 epoch_cyc_copy;
|
||||
unsigned long rate;
|
||||
u32 mult;
|
||||
u32 shift;
|
||||
bool suspended;
|
||||
|
|
@ -113,11 +114,14 @@ void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate)
|
|||
u64 res, wrap;
|
||||
char r_unit;
|
||||
|
||||
if (cd.rate > rate)
|
||||
return;
|
||||
|
||||
BUG_ON(bits > 32);
|
||||
WARN_ON(!irqs_disabled());
|
||||
WARN_ON(read_sched_clock != jiffy_sched_clock_read);
|
||||
read_sched_clock = read;
|
||||
sched_clock_mask = (1 << bits) - 1;
|
||||
cd.rate = rate;
|
||||
|
||||
/* calculate the mult/shift to convert counter ticks to ns. */
|
||||
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)
|
|||
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();
|
||||
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)
|
||||
{
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -362,25 +362,13 @@ int __init twd_local_timer_register(struct twd_local_timer *tlt)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
const static struct of_device_id twd_of_match[] __initconst = {
|
||||
{ .compatible = "arm,cortex-a9-twd-timer", },
|
||||
{ .compatible = "arm,cortex-a5-twd-timer", },
|
||||
{ .compatible = "arm,arm11mp-twd-timer", },
|
||||
{ },
|
||||
};
|
||||
|
||||
void __init twd_local_timer_of_register(void)
|
||||
static void __init twd_local_timer_of_register(struct device_node *np)
|
||||
{
|
||||
struct device_node *np;
|
||||
int err;
|
||||
|
||||
if (!is_smp() || !setup_max_cpus)
|
||||
return;
|
||||
|
||||
np = of_find_matching_node(NULL, twd_of_match);
|
||||
if (!np)
|
||||
return;
|
||||
|
||||
twd_ppi = irq_of_parse_and_map(np, 0);
|
||||
if (!twd_ppi) {
|
||||
err = -EINVAL;
|
||||
|
|
@ -398,4 +386,7 @@ void __init twd_local_timer_of_register(void)
|
|||
out:
|
||||
WARN(err, "twd_local_timer_of_register failed (%d)\n", err);
|
||||
}
|
||||
CLOCKSOURCE_OF_DECLARE(arm_twd_a9, "arm,cortex-a9-twd-timer", twd_local_timer_of_register);
|
||||
CLOCKSOURCE_OF_DECLARE(arm_twd_a5, "arm,cortex-a5-twd-timer", twd_local_timer_of_register);
|
||||
CLOCKSOURCE_OF_DECLARE(arm_twd_11mp, "arm,arm11mp-twd-timer", twd_local_timer_of_register);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include <linux/errno.h>
|
||||
#include <linux/profile.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/clocksource.h>
|
||||
#include <linux/irq.h>
|
||||
|
||||
#include <asm/thread_info.h>
|
||||
|
|
@ -115,6 +116,10 @@ int __init register_persistent_clock(clock_access_fn read_boot,
|
|||
|
||||
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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,6 +169,8 @@ static struct clk *periph_clocks[] __initdata = {
|
|||
};
|
||||
|
||||
static struct clk_lookup periph_clocks_lookups[] = {
|
||||
CLKDEV_CON_DEV_ID("hclk", "at91sam9261-lcdfb.0", &hck1),
|
||||
CLKDEV_CON_DEV_ID("hclk", "at91sam9g10-lcdfb.0", &hck1),
|
||||
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
|
||||
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
|
||||
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
|
||||
|
|
|
|||
|
|
@ -488,7 +488,6 @@ static struct resource lcdc_resources[] = {
|
|||
};
|
||||
|
||||
static struct platform_device at91_lcdc_device = {
|
||||
.name = "atmel_lcdfb",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.dma_mask = &lcdc_dmamask,
|
||||
|
|
@ -505,6 +504,11 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
|
|||
return;
|
||||
}
|
||||
|
||||
if (cpu_is_at91sam9g10())
|
||||
at91_lcdc_device.name = "at91sam9g10-lcdfb";
|
||||
else
|
||||
at91_lcdc_device.name = "at91sam9261-lcdfb";
|
||||
|
||||
#if defined(CONFIG_FB_ATMEL_STN)
|
||||
at91_set_A_periph(AT91_PIN_PB0, 0); /* LCDVSYNC */
|
||||
at91_set_A_periph(AT91_PIN_PB1, 0); /* LCDHSYNC */
|
||||
|
|
|
|||
|
|
@ -190,6 +190,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
|
|||
CLKDEV_CON_DEV_ID("pclk", "at91rm9200_ssc.1", &ssc1_clk),
|
||||
CLKDEV_CON_DEV_ID("pclk", "fff98000.ssc", &ssc0_clk),
|
||||
CLKDEV_CON_DEV_ID("pclk", "fff9c000.ssc", &ssc1_clk),
|
||||
CLKDEV_CON_DEV_ID("hclk", "at91sam9263-lcdfb.0", &lcdc_clk),
|
||||
CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_clk),
|
||||
CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.1", &mmc1_clk),
|
||||
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
|
||||
|
|
|
|||
|
|
@ -848,7 +848,7 @@ static struct resource lcdc_resources[] = {
|
|||
};
|
||||
|
||||
static struct platform_device at91_lcdc_device = {
|
||||
.name = "atmel_lcdfb",
|
||||
.name = "at91sam9263-lcdfb",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.dma_mask = &lcdc_dmamask,
|
||||
|
|
|
|||
|
|
@ -228,6 +228,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
|
|||
CLKDEV_CON_ID("hclk", &macb_clk),
|
||||
/* One additional fake clock for ohci */
|
||||
CLKDEV_CON_ID("ohci_clk", &uhphs_clk),
|
||||
CLKDEV_CON_DEV_ID("hclk", "at91sam9g45-lcdfb.0", &lcdc_clk),
|
||||
CLKDEV_CON_DEV_ID("hclk", "at91sam9g45es-lcdfb.0", &lcdc_clk),
|
||||
CLKDEV_CON_DEV_ID("ehci_clk", "atmel-ehci", &uhphs_clk),
|
||||
CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk),
|
||||
CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk),
|
||||
|
|
|
|||
|
|
@ -981,7 +981,6 @@ static struct resource lcdc_resources[] = {
|
|||
};
|
||||
|
||||
static struct platform_device at91_lcdc_device = {
|
||||
.name = "atmel_lcdfb",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.dma_mask = &lcdc_dmamask,
|
||||
|
|
@ -997,6 +996,11 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
|
|||
if (!data)
|
||||
return;
|
||||
|
||||
if (cpu_is_at91sam9g45es())
|
||||
at91_lcdc_device.name = "at91sam9g45es-lcdfb";
|
||||
else
|
||||
at91_lcdc_device.name = "at91sam9g45-lcdfb";
|
||||
|
||||
at91_set_A_periph(AT91_PIN_PE0, 0); /* LCDDPWR */
|
||||
|
||||
at91_set_A_periph(AT91_PIN_PE2, 0); /* LCDCC */
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@ static struct clk *periph_clocks[] __initdata = {
|
|||
};
|
||||
|
||||
static struct clk_lookup periph_clocks_lookups[] = {
|
||||
CLKDEV_CON_DEV_ID("hclk", "at91sam9rl-lcdfb.0", &lcdc_clk),
|
||||
CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk),
|
||||
CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk),
|
||||
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
|
||||
|
|
|
|||
|
|
@ -514,7 +514,7 @@ static struct resource lcdc_resources[] = {
|
|||
};
|
||||
|
||||
static struct platform_device at91_lcdc_device = {
|
||||
.name = "atmel_lcdfb",
|
||||
.name = "at91sam9rl-lcdfb",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.dma_mask = &lcdc_dmamask,
|
||||
|
|
|
|||
|
|
@ -79,12 +79,6 @@ config SOC_EXYNOS5440
|
|||
help
|
||||
Enable EXYNOS5440 SoC support
|
||||
|
||||
config EXYNOS4_MCT
|
||||
bool
|
||||
default y
|
||||
help
|
||||
Use MCT (Multi Core Timer) as kernel timers
|
||||
|
||||
config EXYNOS_DEV_DMA
|
||||
bool
|
||||
help
|
||||
|
|
@ -276,8 +270,8 @@ config MACH_UNIVERSAL_C210
|
|||
select S5P_DEV_ONENAND
|
||||
select S5P_DEV_TV
|
||||
select S5P_GPIO_INT
|
||||
select S5P_HRT
|
||||
select S5P_SETUP_MIPIPHY
|
||||
select SAMSUNG_HRT
|
||||
help
|
||||
Machine support for Samsung Mobile Universal S5PC210 Reference
|
||||
Board.
|
||||
|
|
@ -406,6 +400,7 @@ config MACH_EXYNOS4_DT
|
|||
bool "Samsung Exynos4 Machine using device tree"
|
||||
depends on ARCH_EXYNOS4
|
||||
select ARM_AMBA
|
||||
select CLKSRC_OF
|
||||
select CPU_EXYNOS4210
|
||||
select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD
|
||||
select PINCTRL
|
||||
|
|
@ -422,6 +417,7 @@ config MACH_EXYNOS5_DT
|
|||
default y
|
||||
depends on ARCH_EXYNOS5
|
||||
select ARM_AMBA
|
||||
select CLKSRC_OF
|
||||
select USE_OF
|
||||
help
|
||||
Machine support for Samsung EXYNOS5 machine with device tree enabled.
|
||||
|
|
|
|||
|
|
@ -26,8 +26,6 @@ obj-$(CONFIG_ARCH_EXYNOS) += pmu.o
|
|||
|
||||
obj-$(CONFIG_SMP) += platsmp.o headsmp.o
|
||||
|
||||
obj-$(CONFIG_EXYNOS4_MCT) += mct.o
|
||||
|
||||
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
|
||||
|
||||
# machine support
|
||||
|
|
|
|||
|
|
@ -256,11 +256,6 @@ static struct map_desc exynos5_iodesc[] __initdata = {
|
|||
.pfn = __phys_to_pfn(EXYNOS5_PA_SROMC),
|
||||
.length = SZ_4K,
|
||||
.type = MT_DEVICE,
|
||||
}, {
|
||||
.virtual = (unsigned long)S5P_VA_SYSTIMER,
|
||||
.pfn = __phys_to_pfn(EXYNOS5_PA_SYSTIMER),
|
||||
.length = SZ_4K,
|
||||
.type = MT_DEVICE,
|
||||
}, {
|
||||
.virtual = (unsigned long)S5P_VA_SYSRAM,
|
||||
.pfn = __phys_to_pfn(EXYNOS5_PA_SYSRAM),
|
||||
|
|
@ -822,6 +817,7 @@ static int __init exynos_init_irq_eint(void)
|
|||
static const struct of_device_id exynos_pinctrl_ids[] = {
|
||||
{ .compatible = "samsung,exynos4210-pinctrl", },
|
||||
{ .compatible = "samsung,exynos4x12-pinctrl", },
|
||||
{ .compatible = "samsung,exynos5250-pinctrl", },
|
||||
};
|
||||
struct device_node *pctrl_np, *wkup_np;
|
||||
const char *wkup_compat = "samsung,exynos4210-wakeup-eint";
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#ifndef __ARCH_ARM_MACH_EXYNOS_COMMON_H
|
||||
#define __ARCH_ARM_MACH_EXYNOS_COMMON_H
|
||||
|
||||
extern void exynos4_timer_init(void);
|
||||
extern void mct_init(void);
|
||||
|
||||
struct map_desc;
|
||||
void exynos_init_io(struct map_desc *mach_desc, int size);
|
||||
|
|
|
|||
|
|
@ -30,8 +30,6 @@
|
|||
|
||||
/* For EXYNOS4 and EXYNOS5 */
|
||||
|
||||
#define EXYNOS_IRQ_MCT_LOCALTIMER IRQ_PPI(12)
|
||||
|
||||
#define EXYNOS_IRQ_EINT16_31 IRQ_SPI(32)
|
||||
|
||||
/* For EXYNOS4 SoCs */
|
||||
|
|
@ -323,8 +321,6 @@
|
|||
#define EXYNOS5_IRQ_CEC IRQ_SPI(114)
|
||||
#define EXYNOS5_IRQ_SATA IRQ_SPI(115)
|
||||
|
||||
#define EXYNOS5_IRQ_MCT_L0 IRQ_SPI(120)
|
||||
#define EXYNOS5_IRQ_MCT_L1 IRQ_SPI(121)
|
||||
#define EXYNOS5_IRQ_MMC44 IRQ_SPI(123)
|
||||
#define EXYNOS5_IRQ_MDMA1 IRQ_SPI(124)
|
||||
#define EXYNOS5_IRQ_FIMC_LITE0 IRQ_SPI(125)
|
||||
|
|
@ -419,8 +415,6 @@
|
|||
#define EXYNOS5_IRQ_PMU_CPU1 COMBINER_IRQ(22, 4)
|
||||
|
||||
#define EXYNOS5_IRQ_EINT0 COMBINER_IRQ(23, 0)
|
||||
#define EXYNOS5_IRQ_MCT_G0 COMBINER_IRQ(23, 3)
|
||||
#define EXYNOS5_IRQ_MCT_G1 COMBINER_IRQ(23, 4)
|
||||
|
||||
#define EXYNOS5_IRQ_EINT1 COMBINER_IRQ(24, 0)
|
||||
#define EXYNOS5_IRQ_SYSMMU_LITE1_0 COMBINER_IRQ(24, 1)
|
||||
|
|
|
|||
|
|
@ -65,7 +65,6 @@
|
|||
#define EXYNOS5_PA_CMU 0x10010000
|
||||
|
||||
#define EXYNOS4_PA_SYSTIMER 0x10050000
|
||||
#define EXYNOS5_PA_SYSTIMER 0x101C0000
|
||||
|
||||
#define EXYNOS4_PA_WATCHDOG 0x10060000
|
||||
#define EXYNOS5_PA_WATCHDOG 0x101D0000
|
||||
|
|
|
|||
|
|
@ -1,53 +0,0 @@
|
|||
/* arch/arm/mach-exynos4/include/mach/regs-mct.h
|
||||
*
|
||||
* Copyright (c) 2011 Samsung Electronics Co., Ltd.
|
||||
* http://www.samsung.com
|
||||
*
|
||||
* EXYNOS4 MCT configutation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __ASM_ARCH_REGS_MCT_H
|
||||
#define __ASM_ARCH_REGS_MCT_H __FILE__
|
||||
|
||||
#include <mach/map.h>
|
||||
|
||||
#define EXYNOS4_MCTREG(x) (S5P_VA_SYSTIMER + (x))
|
||||
|
||||
#define EXYNOS4_MCT_G_CNT_L EXYNOS4_MCTREG(0x100)
|
||||
#define EXYNOS4_MCT_G_CNT_U EXYNOS4_MCTREG(0x104)
|
||||
#define EXYNOS4_MCT_G_CNT_WSTAT EXYNOS4_MCTREG(0x110)
|
||||
|
||||
#define EXYNOS4_MCT_G_COMP0_L EXYNOS4_MCTREG(0x200)
|
||||
#define EXYNOS4_MCT_G_COMP0_U EXYNOS4_MCTREG(0x204)
|
||||
#define EXYNOS4_MCT_G_COMP0_ADD_INCR EXYNOS4_MCTREG(0x208)
|
||||
|
||||
#define EXYNOS4_MCT_G_TCON EXYNOS4_MCTREG(0x240)
|
||||
|
||||
#define EXYNOS4_MCT_G_INT_CSTAT EXYNOS4_MCTREG(0x244)
|
||||
#define EXYNOS4_MCT_G_INT_ENB EXYNOS4_MCTREG(0x248)
|
||||
#define EXYNOS4_MCT_G_WSTAT EXYNOS4_MCTREG(0x24C)
|
||||
|
||||
#define _EXYNOS4_MCT_L_BASE EXYNOS4_MCTREG(0x300)
|
||||
#define EXYNOS4_MCT_L_BASE(x) (_EXYNOS4_MCT_L_BASE + (0x100 * x))
|
||||
#define EXYNOS4_MCT_L_MASK (0xffffff00)
|
||||
|
||||
#define MCT_L_TCNTB_OFFSET (0x00)
|
||||
#define MCT_L_ICNTB_OFFSET (0x08)
|
||||
#define MCT_L_TCON_OFFSET (0x20)
|
||||
#define MCT_L_INT_CSTAT_OFFSET (0x30)
|
||||
#define MCT_L_INT_ENB_OFFSET (0x34)
|
||||
#define MCT_L_WSTAT_OFFSET (0x40)
|
||||
|
||||
#define MCT_G_TCON_START (1 << 8)
|
||||
#define MCT_G_TCON_COMP0_AUTO_INC (1 << 1)
|
||||
#define MCT_G_TCON_COMP0_ENABLE (1 << 0)
|
||||
|
||||
#define MCT_L_TCON_INTERVAL_MODE (1 << 2)
|
||||
#define MCT_L_TCON_INT_START (1 << 1)
|
||||
#define MCT_L_TCON_TIMER_START (1 << 0)
|
||||
|
||||
#endif /* __ASM_ARCH_REGS_MCT_H */
|
||||
|
|
@ -202,6 +202,6 @@ MACHINE_START(ARMLEX4210, "ARMLEX4210")
|
|||
.map_io = armlex4210_map_io,
|
||||
.init_machine = armlex4210_machine_init,
|
||||
.init_late = exynos_init_late,
|
||||
.init_time = exynos4_timer_init,
|
||||
.init_time = mct_init,
|
||||
.restart = exynos4_restart,
|
||||
MACHINE_END
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/serial_core.h>
|
||||
#include <linux/clocksource.h>
|
||||
|
||||
#include <asm/mach/arch.h>
|
||||
#include <mach/map.h>
|
||||
|
|
@ -142,7 +143,7 @@ DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)")
|
|||
.map_io = exynos4_dt_map_io,
|
||||
.init_machine = exynos4_dt_machine_init,
|
||||
.init_late = exynos_init_late,
|
||||
.init_time = exynos4_timer_init,
|
||||
.init_time = clocksource_of_init,
|
||||
.dt_compat = exynos4_dt_compat,
|
||||
.restart = exynos4_restart,
|
||||
MACHINE_END
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include <linux/serial_core.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/clocksource.h>
|
||||
|
||||
#include <asm/mach/arch.h>
|
||||
#include <mach/map.h>
|
||||
|
|
@ -216,7 +217,6 @@ DT_MACHINE_START(EXYNOS5_DT, "SAMSUNG EXYNOS5 (Flattened Device Tree)")
|
|||
.map_io = exynos5_dt_map_io,
|
||||
.init_machine = exynos5_dt_machine_init,
|
||||
.init_late = exynos_init_late,
|
||||
.init_time = exynos4_timer_init,
|
||||
.dt_compat = exynos5_dt_compat,
|
||||
.restart = exynos5_restart,
|
||||
.reserve = exynos5_reserve,
|
||||
|
|
|
|||
|
|
@ -1380,7 +1380,7 @@ MACHINE_START(NURI, "NURI")
|
|||
.map_io = nuri_map_io,
|
||||
.init_machine = nuri_machine_init,
|
||||
.init_late = exynos_init_late,
|
||||
.init_time = exynos4_timer_init,
|
||||
.init_time = mct_init,
|
||||
.reserve = &nuri_reserve,
|
||||
.restart = exynos4_restart,
|
||||
MACHINE_END
|
||||
|
|
|
|||
|
|
@ -815,7 +815,7 @@ MACHINE_START(ORIGEN, "ORIGEN")
|
|||
.map_io = origen_map_io,
|
||||
.init_machine = origen_machine_init,
|
||||
.init_late = exynos_init_late,
|
||||
.init_time = exynos4_timer_init,
|
||||
.init_time = mct_init,
|
||||
.reserve = &origen_reserve,
|
||||
.restart = exynos4_restart,
|
||||
MACHINE_END
|
||||
|
|
|
|||
|
|
@ -376,7 +376,7 @@ MACHINE_START(SMDK4212, "SMDK4212")
|
|||
.init_irq = exynos4_init_irq,
|
||||
.map_io = smdk4x12_map_io,
|
||||
.init_machine = smdk4x12_machine_init,
|
||||
.init_time = exynos4_timer_init,
|
||||
.init_time = mct_init,
|
||||
.restart = exynos4_restart,
|
||||
.reserve = &smdk4x12_reserve,
|
||||
MACHINE_END
|
||||
|
|
@ -390,7 +390,7 @@ MACHINE_START(SMDK4412, "SMDK4412")
|
|||
.map_io = smdk4x12_map_io,
|
||||
.init_machine = smdk4x12_machine_init,
|
||||
.init_late = exynos_init_late,
|
||||
.init_time = exynos4_timer_init,
|
||||
.init_time = mct_init,
|
||||
.restart = exynos4_restart,
|
||||
.reserve = &smdk4x12_reserve,
|
||||
MACHINE_END
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ MACHINE_START(SMDKV310, "SMDKV310")
|
|||
.init_irq = exynos4_init_irq,
|
||||
.map_io = smdkv310_map_io,
|
||||
.init_machine = smdkv310_machine_init,
|
||||
.init_time = exynos4_timer_init,
|
||||
.init_time = mct_init,
|
||||
.reserve = &smdkv310_reserve,
|
||||
.restart = exynos4_restart,
|
||||
MACHINE_END
|
||||
|
|
@ -436,7 +436,7 @@ MACHINE_START(SMDKC210, "SMDKC210")
|
|||
.map_io = smdkv310_map_io,
|
||||
.init_machine = smdkv310_machine_init,
|
||||
.init_late = exynos_init_late,
|
||||
.init_time = exynos4_timer_init,
|
||||
.init_time = mct_init,
|
||||
.reserve = &smdkv310_reserve,
|
||||
.restart = exynos4_restart,
|
||||
MACHINE_END
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
#include <plat/mfc.h>
|
||||
#include <plat/sdhci.h>
|
||||
#include <plat/fimc-core.h>
|
||||
#include <plat/s5p-time.h>
|
||||
#include <plat/samsung-time.h>
|
||||
#include <plat/camport.h>
|
||||
|
||||
#include <mach/map.h>
|
||||
|
|
@ -1094,7 +1094,7 @@ static void __init universal_map_io(void)
|
|||
exynos_init_io(NULL, 0);
|
||||
s3c24xx_init_clocks(clk_xusbxti.rate);
|
||||
s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
|
||||
s5p_set_timer_source(S5P_PWM2, S5P_PWM4);
|
||||
samsung_set_timer_source(SAMSUNG_PWM2, SAMSUNG_PWM4);
|
||||
}
|
||||
|
||||
static void s5p_tv_setup(void)
|
||||
|
|
@ -1152,7 +1152,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
|
|||
.map_io = universal_map_io,
|
||||
.init_machine = universal_machine_init,
|
||||
.init_late = exynos_init_late,
|
||||
.init_time = s5p_timer_init,
|
||||
.init_time = samsung_timer_init,
|
||||
.reserve = &universal_reserve,
|
||||
.restart = exynos4_restart,
|
||||
MACHINE_END
|
||||
|
|
|
|||
|
|
@ -1,485 +0,0 @@
|
|||
/* linux/arch/arm/mach-exynos4/mct.c
|
||||
*
|
||||
* Copyright (c) 2011 Samsung Electronics Co., Ltd.
|
||||
* http://www.samsung.com
|
||||
*
|
||||
* EXYNOS4 MCT(Multi-Core Timer) support
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/sched.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/clockchips.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/of.h>
|
||||
|
||||
#include <asm/arch_timer.h>
|
||||
#include <asm/localtimer.h>
|
||||
|
||||
#include <plat/cpu.h>
|
||||
|
||||
#include <mach/map.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/regs-mct.h>
|
||||
#include <asm/mach/time.h>
|
||||
|
||||
#define TICK_BASE_CNT 1
|
||||
|
||||
enum {
|
||||
MCT_INT_SPI,
|
||||
MCT_INT_PPI
|
||||
};
|
||||
|
||||
static unsigned long clk_rate;
|
||||
static unsigned int mct_int_type;
|
||||
|
||||
struct mct_clock_event_device {
|
||||
struct clock_event_device *evt;
|
||||
void __iomem *base;
|
||||
char name[10];
|
||||
};
|
||||
|
||||
static void exynos4_mct_write(unsigned int value, void *addr)
|
||||
{
|
||||
void __iomem *stat_addr;
|
||||
u32 mask;
|
||||
u32 i;
|
||||
|
||||
__raw_writel(value, addr);
|
||||
|
||||
if (likely(addr >= EXYNOS4_MCT_L_BASE(0))) {
|
||||
u32 base = (u32) addr & EXYNOS4_MCT_L_MASK;
|
||||
switch ((u32) addr & ~EXYNOS4_MCT_L_MASK) {
|
||||
case (u32) MCT_L_TCON_OFFSET:
|
||||
stat_addr = (void __iomem *) base + MCT_L_WSTAT_OFFSET;
|
||||
mask = 1 << 3; /* L_TCON write status */
|
||||
break;
|
||||
case (u32) MCT_L_ICNTB_OFFSET:
|
||||
stat_addr = (void __iomem *) base + MCT_L_WSTAT_OFFSET;
|
||||
mask = 1 << 1; /* L_ICNTB write status */
|
||||
break;
|
||||
case (u32) MCT_L_TCNTB_OFFSET:
|
||||
stat_addr = (void __iomem *) base + MCT_L_WSTAT_OFFSET;
|
||||
mask = 1 << 0; /* L_TCNTB write status */
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
switch ((u32) addr) {
|
||||
case (u32) EXYNOS4_MCT_G_TCON:
|
||||
stat_addr = EXYNOS4_MCT_G_WSTAT;
|
||||
mask = 1 << 16; /* G_TCON write status */
|
||||
break;
|
||||
case (u32) EXYNOS4_MCT_G_COMP0_L:
|
||||
stat_addr = EXYNOS4_MCT_G_WSTAT;
|
||||
mask = 1 << 0; /* G_COMP0_L write status */
|
||||
break;
|
||||
case (u32) EXYNOS4_MCT_G_COMP0_U:
|
||||
stat_addr = EXYNOS4_MCT_G_WSTAT;
|
||||
mask = 1 << 1; /* G_COMP0_U write status */
|
||||
break;
|
||||
case (u32) EXYNOS4_MCT_G_COMP0_ADD_INCR:
|
||||
stat_addr = EXYNOS4_MCT_G_WSTAT;
|
||||
mask = 1 << 2; /* G_COMP0_ADD_INCR w status */
|
||||
break;
|
||||
case (u32) EXYNOS4_MCT_G_CNT_L:
|
||||
stat_addr = EXYNOS4_MCT_G_CNT_WSTAT;
|
||||
mask = 1 << 0; /* G_CNT_L write status */
|
||||
break;
|
||||
case (u32) EXYNOS4_MCT_G_CNT_U:
|
||||
stat_addr = EXYNOS4_MCT_G_CNT_WSTAT;
|
||||
mask = 1 << 1; /* G_CNT_U write status */
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Wait maximum 1 ms until written values are applied */
|
||||
for (i = 0; i < loops_per_jiffy / 1000 * HZ; i++)
|
||||
if (__raw_readl(stat_addr) & mask) {
|
||||
__raw_writel(mask, stat_addr);
|
||||
return;
|
||||
}
|
||||
|
||||
panic("MCT hangs after writing %d (addr:0x%08x)\n", value, (u32)addr);
|
||||
}
|
||||
|
||||
/* Clocksource handling */
|
||||
static void exynos4_mct_frc_start(u32 hi, u32 lo)
|
||||
{
|
||||
u32 reg;
|
||||
|
||||
exynos4_mct_write(lo, EXYNOS4_MCT_G_CNT_L);
|
||||
exynos4_mct_write(hi, EXYNOS4_MCT_G_CNT_U);
|
||||
|
||||
reg = __raw_readl(EXYNOS4_MCT_G_TCON);
|
||||
reg |= MCT_G_TCON_START;
|
||||
exynos4_mct_write(reg, EXYNOS4_MCT_G_TCON);
|
||||
}
|
||||
|
||||
static cycle_t exynos4_frc_read(struct clocksource *cs)
|
||||
{
|
||||
unsigned int lo, hi;
|
||||
u32 hi2 = __raw_readl(EXYNOS4_MCT_G_CNT_U);
|
||||
|
||||
do {
|
||||
hi = hi2;
|
||||
lo = __raw_readl(EXYNOS4_MCT_G_CNT_L);
|
||||
hi2 = __raw_readl(EXYNOS4_MCT_G_CNT_U);
|
||||
} while (hi != hi2);
|
||||
|
||||
return ((cycle_t)hi << 32) | lo;
|
||||
}
|
||||
|
||||
static void exynos4_frc_resume(struct clocksource *cs)
|
||||
{
|
||||
exynos4_mct_frc_start(0, 0);
|
||||
}
|
||||
|
||||
struct clocksource mct_frc = {
|
||||
.name = "mct-frc",
|
||||
.rating = 400,
|
||||
.read = exynos4_frc_read,
|
||||
.mask = CLOCKSOURCE_MASK(64),
|
||||
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
|
||||
.resume = exynos4_frc_resume,
|
||||
};
|
||||
|
||||
static void __init exynos4_clocksource_init(void)
|
||||
{
|
||||
exynos4_mct_frc_start(0, 0);
|
||||
|
||||
if (clocksource_register_hz(&mct_frc, clk_rate))
|
||||
panic("%s: can't register clocksource\n", mct_frc.name);
|
||||
}
|
||||
|
||||
static void exynos4_mct_comp0_stop(void)
|
||||
{
|
||||
unsigned int tcon;
|
||||
|
||||
tcon = __raw_readl(EXYNOS4_MCT_G_TCON);
|
||||
tcon &= ~(MCT_G_TCON_COMP0_ENABLE | MCT_G_TCON_COMP0_AUTO_INC);
|
||||
|
||||
exynos4_mct_write(tcon, EXYNOS4_MCT_G_TCON);
|
||||
exynos4_mct_write(0, EXYNOS4_MCT_G_INT_ENB);
|
||||
}
|
||||
|
||||
static void exynos4_mct_comp0_start(enum clock_event_mode mode,
|
||||
unsigned long cycles)
|
||||
{
|
||||
unsigned int tcon;
|
||||
cycle_t comp_cycle;
|
||||
|
||||
tcon = __raw_readl(EXYNOS4_MCT_G_TCON);
|
||||
|
||||
if (mode == CLOCK_EVT_MODE_PERIODIC) {
|
||||
tcon |= MCT_G_TCON_COMP0_AUTO_INC;
|
||||
exynos4_mct_write(cycles, EXYNOS4_MCT_G_COMP0_ADD_INCR);
|
||||
}
|
||||
|
||||
comp_cycle = exynos4_frc_read(&mct_frc) + cycles;
|
||||
exynos4_mct_write((u32)comp_cycle, EXYNOS4_MCT_G_COMP0_L);
|
||||
exynos4_mct_write((u32)(comp_cycle >> 32), EXYNOS4_MCT_G_COMP0_U);
|
||||
|
||||
exynos4_mct_write(0x1, EXYNOS4_MCT_G_INT_ENB);
|
||||
|
||||
tcon |= MCT_G_TCON_COMP0_ENABLE;
|
||||
exynos4_mct_write(tcon , EXYNOS4_MCT_G_TCON);
|
||||
}
|
||||
|
||||
static int exynos4_comp_set_next_event(unsigned long cycles,
|
||||
struct clock_event_device *evt)
|
||||
{
|
||||
exynos4_mct_comp0_start(evt->mode, cycles);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void exynos4_comp_set_mode(enum clock_event_mode mode,
|
||||
struct clock_event_device *evt)
|
||||
{
|
||||
unsigned long cycles_per_jiffy;
|
||||
exynos4_mct_comp0_stop();
|
||||
|
||||
switch (mode) {
|
||||
case CLOCK_EVT_MODE_PERIODIC:
|
||||
cycles_per_jiffy =
|
||||
(((unsigned long long) NSEC_PER_SEC / HZ * evt->mult) >> evt->shift);
|
||||
exynos4_mct_comp0_start(mode, cycles_per_jiffy);
|
||||
break;
|
||||
|
||||
case CLOCK_EVT_MODE_ONESHOT:
|
||||
case CLOCK_EVT_MODE_UNUSED:
|
||||
case CLOCK_EVT_MODE_SHUTDOWN:
|
||||
case CLOCK_EVT_MODE_RESUME:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static struct clock_event_device mct_comp_device = {
|
||||
.name = "mct-comp",
|
||||
.features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
|
||||
.rating = 250,
|
||||
.set_next_event = exynos4_comp_set_next_event,
|
||||
.set_mode = exynos4_comp_set_mode,
|
||||
};
|
||||
|
||||
static irqreturn_t exynos4_mct_comp_isr(int irq, void *dev_id)
|
||||
{
|
||||
struct clock_event_device *evt = dev_id;
|
||||
|
||||
exynos4_mct_write(0x1, EXYNOS4_MCT_G_INT_CSTAT);
|
||||
|
||||
evt->event_handler(evt);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static struct irqaction mct_comp_event_irq = {
|
||||
.name = "mct_comp_irq",
|
||||
.flags = IRQF_TIMER | IRQF_IRQPOLL,
|
||||
.handler = exynos4_mct_comp_isr,
|
||||
.dev_id = &mct_comp_device,
|
||||
};
|
||||
|
||||
static void exynos4_clockevent_init(void)
|
||||
{
|
||||
mct_comp_device.cpumask = cpumask_of(0);
|
||||
clockevents_config_and_register(&mct_comp_device, clk_rate,
|
||||
0xf, 0xffffffff);
|
||||
|
||||
if (soc_is_exynos5250())
|
||||
setup_irq(EXYNOS5_IRQ_MCT_G0, &mct_comp_event_irq);
|
||||
else
|
||||
setup_irq(EXYNOS4_IRQ_MCT_G0, &mct_comp_event_irq);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LOCAL_TIMERS
|
||||
|
||||
static DEFINE_PER_CPU(struct mct_clock_event_device, percpu_mct_tick);
|
||||
|
||||
/* Clock event handling */
|
||||
static void exynos4_mct_tick_stop(struct mct_clock_event_device *mevt)
|
||||
{
|
||||
unsigned long tmp;
|
||||
unsigned long mask = MCT_L_TCON_INT_START | MCT_L_TCON_TIMER_START;
|
||||
void __iomem *addr = mevt->base + MCT_L_TCON_OFFSET;
|
||||
|
||||
tmp = __raw_readl(addr);
|
||||
if (tmp & mask) {
|
||||
tmp &= ~mask;
|
||||
exynos4_mct_write(tmp, addr);
|
||||
}
|
||||
}
|
||||
|
||||
static void exynos4_mct_tick_start(unsigned long cycles,
|
||||
struct mct_clock_event_device *mevt)
|
||||
{
|
||||
unsigned long tmp;
|
||||
|
||||
exynos4_mct_tick_stop(mevt);
|
||||
|
||||
tmp = (1 << 31) | cycles; /* MCT_L_UPDATE_ICNTB */
|
||||
|
||||
/* update interrupt count buffer */
|
||||
exynos4_mct_write(tmp, mevt->base + MCT_L_ICNTB_OFFSET);
|
||||
|
||||
/* enable MCT tick interrupt */
|
||||
exynos4_mct_write(0x1, mevt->base + MCT_L_INT_ENB_OFFSET);
|
||||
|
||||
tmp = __raw_readl(mevt->base + MCT_L_TCON_OFFSET);
|
||||
tmp |= MCT_L_TCON_INT_START | MCT_L_TCON_TIMER_START |
|
||||
MCT_L_TCON_INTERVAL_MODE;
|
||||
exynos4_mct_write(tmp, mevt->base + MCT_L_TCON_OFFSET);
|
||||
}
|
||||
|
||||
static int exynos4_tick_set_next_event(unsigned long cycles,
|
||||
struct clock_event_device *evt)
|
||||
{
|
||||
struct mct_clock_event_device *mevt = this_cpu_ptr(&percpu_mct_tick);
|
||||
|
||||
exynos4_mct_tick_start(cycles, mevt);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void exynos4_tick_set_mode(enum clock_event_mode mode,
|
||||
struct clock_event_device *evt)
|
||||
{
|
||||
struct mct_clock_event_device *mevt = this_cpu_ptr(&percpu_mct_tick);
|
||||
unsigned long cycles_per_jiffy;
|
||||
|
||||
exynos4_mct_tick_stop(mevt);
|
||||
|
||||
switch (mode) {
|
||||
case CLOCK_EVT_MODE_PERIODIC:
|
||||
cycles_per_jiffy =
|
||||
(((unsigned long long) NSEC_PER_SEC / HZ * evt->mult) >> evt->shift);
|
||||
exynos4_mct_tick_start(cycles_per_jiffy, mevt);
|
||||
break;
|
||||
|
||||
case CLOCK_EVT_MODE_ONESHOT:
|
||||
case CLOCK_EVT_MODE_UNUSED:
|
||||
case CLOCK_EVT_MODE_SHUTDOWN:
|
||||
case CLOCK_EVT_MODE_RESUME:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int exynos4_mct_tick_clear(struct mct_clock_event_device *mevt)
|
||||
{
|
||||
struct clock_event_device *evt = mevt->evt;
|
||||
|
||||
/*
|
||||
* This is for supporting oneshot mode.
|
||||
* Mct would generate interrupt periodically
|
||||
* without explicit stopping.
|
||||
*/
|
||||
if (evt->mode != CLOCK_EVT_MODE_PERIODIC)
|
||||
exynos4_mct_tick_stop(mevt);
|
||||
|
||||
/* Clear the MCT tick interrupt */
|
||||
if (__raw_readl(mevt->base + MCT_L_INT_CSTAT_OFFSET) & 1) {
|
||||
exynos4_mct_write(0x1, mevt->base + MCT_L_INT_CSTAT_OFFSET);
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static irqreturn_t exynos4_mct_tick_isr(int irq, void *dev_id)
|
||||
{
|
||||
struct mct_clock_event_device *mevt = dev_id;
|
||||
struct clock_event_device *evt = mevt->evt;
|
||||
|
||||
exynos4_mct_tick_clear(mevt);
|
||||
|
||||
evt->event_handler(evt);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static struct irqaction mct_tick0_event_irq = {
|
||||
.name = "mct_tick0_irq",
|
||||
.flags = IRQF_TIMER | IRQF_NOBALANCING,
|
||||
.handler = exynos4_mct_tick_isr,
|
||||
};
|
||||
|
||||
static struct irqaction mct_tick1_event_irq = {
|
||||
.name = "mct_tick1_irq",
|
||||
.flags = IRQF_TIMER | IRQF_NOBALANCING,
|
||||
.handler = exynos4_mct_tick_isr,
|
||||
};
|
||||
|
||||
static int __cpuinit exynos4_local_timer_setup(struct clock_event_device *evt)
|
||||
{
|
||||
struct mct_clock_event_device *mevt;
|
||||
unsigned int cpu = smp_processor_id();
|
||||
int mct_lx_irq;
|
||||
|
||||
mevt = this_cpu_ptr(&percpu_mct_tick);
|
||||
mevt->evt = evt;
|
||||
|
||||
mevt->base = EXYNOS4_MCT_L_BASE(cpu);
|
||||
sprintf(mevt->name, "mct_tick%d", cpu);
|
||||
|
||||
evt->name = mevt->name;
|
||||
evt->cpumask = cpumask_of(cpu);
|
||||
evt->set_next_event = exynos4_tick_set_next_event;
|
||||
evt->set_mode = exynos4_tick_set_mode;
|
||||
evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
|
||||
evt->rating = 450;
|
||||
clockevents_config_and_register(evt, clk_rate / (TICK_BASE_CNT + 1),
|
||||
0xf, 0x7fffffff);
|
||||
|
||||
exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET);
|
||||
|
||||
if (mct_int_type == MCT_INT_SPI) {
|
||||
if (cpu == 0) {
|
||||
mct_lx_irq = soc_is_exynos4210() ? EXYNOS4_IRQ_MCT_L0 :
|
||||
EXYNOS5_IRQ_MCT_L0;
|
||||
mct_tick0_event_irq.dev_id = mevt;
|
||||
evt->irq = mct_lx_irq;
|
||||
setup_irq(mct_lx_irq, &mct_tick0_event_irq);
|
||||
} else {
|
||||
mct_lx_irq = soc_is_exynos4210() ? EXYNOS4_IRQ_MCT_L1 :
|
||||
EXYNOS5_IRQ_MCT_L1;
|
||||
mct_tick1_event_irq.dev_id = mevt;
|
||||
evt->irq = mct_lx_irq;
|
||||
setup_irq(mct_lx_irq, &mct_tick1_event_irq);
|
||||
irq_set_affinity(mct_lx_irq, cpumask_of(1));
|
||||
}
|
||||
} else {
|
||||
enable_percpu_irq(EXYNOS_IRQ_MCT_LOCALTIMER, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void exynos4_local_timer_stop(struct clock_event_device *evt)
|
||||
{
|
||||
unsigned int cpu = smp_processor_id();
|
||||
evt->set_mode(CLOCK_EVT_MODE_UNUSED, evt);
|
||||
if (mct_int_type == MCT_INT_SPI)
|
||||
if (cpu == 0)
|
||||
remove_irq(evt->irq, &mct_tick0_event_irq);
|
||||
else
|
||||
remove_irq(evt->irq, &mct_tick1_event_irq);
|
||||
else
|
||||
disable_percpu_irq(EXYNOS_IRQ_MCT_LOCALTIMER);
|
||||
}
|
||||
|
||||
static struct local_timer_ops exynos4_mct_tick_ops __cpuinitdata = {
|
||||
.setup = exynos4_local_timer_setup,
|
||||
.stop = exynos4_local_timer_stop,
|
||||
};
|
||||
#endif /* CONFIG_LOCAL_TIMERS */
|
||||
|
||||
static void __init exynos4_timer_resources(void)
|
||||
{
|
||||
struct clk *mct_clk;
|
||||
mct_clk = clk_get(NULL, "xtal");
|
||||
|
||||
clk_rate = clk_get_rate(mct_clk);
|
||||
|
||||
#ifdef CONFIG_LOCAL_TIMERS
|
||||
if (mct_int_type == MCT_INT_PPI) {
|
||||
int err;
|
||||
|
||||
err = request_percpu_irq(EXYNOS_IRQ_MCT_LOCALTIMER,
|
||||
exynos4_mct_tick_isr, "MCT",
|
||||
&percpu_mct_tick);
|
||||
WARN(err, "MCT: can't request IRQ %d (%d)\n",
|
||||
EXYNOS_IRQ_MCT_LOCALTIMER, err);
|
||||
}
|
||||
|
||||
local_timer_register(&exynos4_mct_tick_ops);
|
||||
#endif /* CONFIG_LOCAL_TIMERS */
|
||||
}
|
||||
|
||||
void __init exynos4_timer_init(void)
|
||||
{
|
||||
if (soc_is_exynos5440()) {
|
||||
arch_timer_of_register();
|
||||
return;
|
||||
}
|
||||
|
||||
if ((soc_is_exynos4210()) || (soc_is_exynos5250()))
|
||||
mct_int_type = MCT_INT_SPI;
|
||||
else
|
||||
mct_int_type = MCT_INT_PPI;
|
||||
|
||||
exynos4_timer_resources();
|
||||
exynos4_clocksource_init();
|
||||
exynos4_clockevent_init();
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
#include <linux/clk.h>
|
||||
#include <linux/clkdev.h>
|
||||
#include <linux/clocksource.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/irq.h>
|
||||
|
|
@ -28,13 +29,9 @@
|
|||
#include <linux/amba/bus.h>
|
||||
#include <linux/clk-provider.h>
|
||||
|
||||
#include <asm/arch_timer.h>
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/cputype.h>
|
||||
#include <asm/smp_plat.h>
|
||||
#include <asm/smp_twd.h>
|
||||
#include <asm/hardware/arm_timer.h>
|
||||
#include <asm/hardware/timer-sp.h>
|
||||
#include <asm/hardware/cache-l2x0.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
|
|
@ -91,38 +88,18 @@ static void __init highbank_init_irq(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
static struct clk_lookup lookup = {
|
||||
.dev_id = "sp804",
|
||||
.con_id = NULL,
|
||||
};
|
||||
|
||||
static void __init highbank_timer_init(void)
|
||||
{
|
||||
int irq;
|
||||
struct device_node *np;
|
||||
void __iomem *timer_base;
|
||||
|
||||
/* Map system registers */
|
||||
np = of_find_compatible_node(NULL, NULL, "calxeda,hb-sregs");
|
||||
sregs_base = of_iomap(np, 0);
|
||||
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);
|
||||
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");
|
||||
|
||||
twd_local_timer_of_register();
|
||||
|
||||
arch_timer_of_register();
|
||||
arch_timer_sched_clock_init();
|
||||
clocksource_of_init();
|
||||
}
|
||||
|
||||
static void highbank_power_off(void)
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ struct clk *imx_clk_busy_mux(const char *name, void __iomem *reg, u8 shift,
|
|||
|
||||
busy->mux.reg = reg;
|
||||
busy->mux.shift = shift;
|
||||
busy->mux.width = width;
|
||||
busy->mux.mask = BIT(width) - 1;
|
||||
busy->mux.lock = &imx_ccm_lock;
|
||||
busy->mux_ops = &clk_mux_ops;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include <linux/clk.h>
|
||||
#include <linux/clkdev.h>
|
||||
#include <linux/clocksource.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/export.h>
|
||||
|
|
@ -28,11 +29,9 @@
|
|||
#include <linux/regmap.h>
|
||||
#include <linux/micrel_phy.h>
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <asm/smp_twd.h>
|
||||
#include <asm/hardware/cache-l2x0.h>
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <asm/mach/time.h>
|
||||
#include <asm/system_misc.h>
|
||||
|
||||
#include "common.h"
|
||||
|
|
@ -292,7 +291,7 @@ static void __init imx6q_init_irq(void)
|
|||
static void __init imx6q_timer_init(void)
|
||||
{
|
||||
mx6q_clocks_init();
|
||||
twd_local_timer_of_register();
|
||||
clocksource_of_init();
|
||||
imx_print_silicon_rev("i.MX6Q", imx6q_revision());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -536,16 +536,14 @@ static void __init ap_init_of(void)
|
|||
'A' + (ap_sc_id & 0x0f));
|
||||
|
||||
soc_dev = soc_device_register(soc_dev_attr);
|
||||
if (IS_ERR_OR_NULL(soc_dev)) {
|
||||
if (IS_ERR(soc_dev)) {
|
||||
kfree(soc_dev_attr->revision);
|
||||
kfree(soc_dev_attr);
|
||||
return;
|
||||
}
|
||||
|
||||
parent = soc_device_to_device(soc_dev);
|
||||
|
||||
if (!IS_ERR_OR_NULL(parent))
|
||||
integrator_init_sysfs(parent, ap_sc_id);
|
||||
integrator_init_sysfs(parent, ap_sc_id);
|
||||
|
||||
of_platform_populate(root, of_default_bus_match_table,
|
||||
ap_auxdata_lookup, parent);
|
||||
|
|
|
|||
|
|
@ -250,39 +250,6 @@ static void __init intcp_init_early(void)
|
|||
}
|
||||
|
||||
#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 = {
|
||||
{ .compatible = "arm,versatile-fpga-irq", .data = fpga_irq_of_init, },
|
||||
{ /* Sentinel */ }
|
||||
|
|
@ -360,17 +327,14 @@ static void __init intcp_init_of(void)
|
|||
'A' + (intcp_sc_id & 0x0f));
|
||||
|
||||
soc_dev = soc_device_register(soc_dev_attr);
|
||||
if (IS_ERR_OR_NULL(soc_dev)) {
|
||||
if (IS_ERR(soc_dev)) {
|
||||
kfree(soc_dev_attr->revision);
|
||||
kfree(soc_dev_attr);
|
||||
return;
|
||||
}
|
||||
|
||||
parent = soc_device_to_device(soc_dev);
|
||||
|
||||
if (!IS_ERR_OR_NULL(parent))
|
||||
integrator_init_sysfs(parent, intcp_sc_id);
|
||||
|
||||
integrator_init_sysfs(parent, intcp_sc_id);
|
||||
of_platform_populate(root, of_default_bus_match_table,
|
||||
intcp_auxdata_lookup, parent);
|
||||
}
|
||||
|
|
@ -386,7 +350,6 @@ DT_MACHINE_START(INTEGRATOR_CP_DT, "ARM Integrator/CP (Device Tree)")
|
|||
.init_early = intcp_init_early,
|
||||
.init_irq = intcp_init_irq_of,
|
||||
.handle_irq = fpga_handle_irq,
|
||||
.init_time = cp_of_timer_init,
|
||||
.init_machine = intcp_init_of,
|
||||
.restart = integrator_restart,
|
||||
.dt_compat = intcp_dt_board_compat,
|
||||
|
|
|
|||
|
|
@ -428,16 +428,23 @@ static void enable_board_wakeup_source(void)
|
|||
OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
|
||||
}
|
||||
|
||||
static struct usbhs_phy_data phy_data[] __initdata = {
|
||||
{
|
||||
.port = 1,
|
||||
.reset_gpio = 57,
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
{
|
||||
.port = 2,
|
||||
.reset_gpio = 61,
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
|
||||
|
||||
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
|
||||
.phy_reset = true,
|
||||
.reset_gpio_port[0] = 57,
|
||||
.reset_gpio_port[1] = 61,
|
||||
.reset_gpio_port[2] = -EINVAL
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OMAP_MUX
|
||||
|
|
@ -589,6 +596,8 @@ static void __init omap_3430sdp_init(void)
|
|||
board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
|
||||
sdp3430_display_init();
|
||||
enable_board_wakeup_source();
|
||||
|
||||
usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
|
||||
usbhs_init(&usbhs_bdata);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,16 +53,23 @@ static void enable_board_wakeup_source(void)
|
|||
OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
|
||||
}
|
||||
|
||||
static struct usbhs_phy_data phy_data[] __initdata = {
|
||||
{
|
||||
.port = 1,
|
||||
.reset_gpio = 126,
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
{
|
||||
.port = 2,
|
||||
.reset_gpio = 61,
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
|
||||
|
||||
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
|
||||
.phy_reset = true,
|
||||
.reset_gpio_port[0] = 126,
|
||||
.reset_gpio_port[1] = 61,
|
||||
.reset_gpio_port[2] = -EINVAL
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OMAP_MUX
|
||||
|
|
@ -199,6 +206,8 @@ static void __init omap_sdp_init(void)
|
|||
board_smc91x_init();
|
||||
board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16);
|
||||
enable_board_wakeup_source();
|
||||
|
||||
usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
|
||||
usbhs_init(&usbhs_bdata);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,15 +47,17 @@ static struct omap_board_mux board_mux[] __initdata = {
|
|||
};
|
||||
#endif
|
||||
|
||||
static struct usbhs_phy_data phy_data[] __initdata = {
|
||||
{
|
||||
.port = 1,
|
||||
.reset_gpio = GPIO_USB_NRESET,
|
||||
.vcc_gpio = GPIO_USB_POWER,
|
||||
.vcc_polarity = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
|
||||
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
|
||||
.phy_reset = true,
|
||||
.reset_gpio_port[0] = GPIO_USB_NRESET,
|
||||
.reset_gpio_port[1] = -EINVAL,
|
||||
.reset_gpio_port[2] = -EINVAL
|
||||
};
|
||||
|
||||
static struct mtd_partition crane_nand_partitions[] = {
|
||||
|
|
@ -131,13 +133,7 @@ static void __init am3517_crane_init(void)
|
|||
return;
|
||||
}
|
||||
|
||||
ret = gpio_request_one(GPIO_USB_POWER, GPIOF_OUT_INIT_HIGH,
|
||||
"usb_ehci_enable");
|
||||
if (ret < 0) {
|
||||
pr_err("Can not request GPIO %d\n", GPIO_USB_POWER);
|
||||
return;
|
||||
}
|
||||
|
||||
usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
|
||||
usbhs_init(&usbhs_bdata);
|
||||
am35xx_emac_init(AM35XX_DEFAULT_MDIO_FREQUENCY, 1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -213,6 +213,14 @@ static __init void am3517_evm_mcbsp1_init(void)
|
|||
omap_ctrl_writel(devconf0, OMAP2_CONTROL_DEVCONF0);
|
||||
}
|
||||
|
||||
static struct usbhs_phy_data phy_data[] __initdata = {
|
||||
{
|
||||
.port = 1,
|
||||
.reset_gpio = 57,
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
|
||||
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
|
||||
|
|
@ -221,12 +229,6 @@ static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
|
|||
#else
|
||||
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
#endif
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
|
||||
.phy_reset = true,
|
||||
.reset_gpio_port[0] = 57,
|
||||
.reset_gpio_port[1] = -EINVAL,
|
||||
.reset_gpio_port[2] = -EINVAL
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OMAP_MUX
|
||||
|
|
@ -288,7 +290,6 @@ static struct omap2_hsmmc_info mmc[] = {
|
|||
{} /* Terminator */
|
||||
};
|
||||
|
||||
|
||||
static void __init am3517_evm_init(void)
|
||||
{
|
||||
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
|
||||
|
|
@ -300,6 +301,8 @@ static void __init am3517_evm_init(void)
|
|||
|
||||
/* Configure GPIO for EHCI port */
|
||||
omap_mux_init_gpio(57, OMAP_PIN_OUTPUT);
|
||||
|
||||
usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
|
||||
usbhs_init(&usbhs_bdata);
|
||||
am3517_evm_hecc_init(&am3517_evm_hecc_pdata);
|
||||
|
||||
|
|
|
|||
|
|
@ -376,15 +376,22 @@ static struct omap2_hsmmc_info mmc[] = {
|
|||
{} /* Terminator */
|
||||
};
|
||||
|
||||
static struct usbhs_phy_data phy_data[] __initdata = {
|
||||
{
|
||||
.port = 1,
|
||||
.reset_gpio = OMAP_MAX_GPIO_LINES + 6,
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
{
|
||||
.port = 2,
|
||||
.reset_gpio = OMAP_MAX_GPIO_LINES + 7,
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
|
||||
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
|
||||
.phy_reset = true,
|
||||
.reset_gpio_port[0] = OMAP_MAX_GPIO_LINES + 6,
|
||||
.reset_gpio_port[1] = OMAP_MAX_GPIO_LINES + 7,
|
||||
.reset_gpio_port[2] = -EINVAL
|
||||
};
|
||||
|
||||
static void __init cm_t35_init_usbh(void)
|
||||
|
|
@ -401,6 +408,7 @@ static void __init cm_t35_init_usbh(void)
|
|||
msleep(1);
|
||||
}
|
||||
|
||||
usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
|
||||
usbhs_init(&usbhs_bdata);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -188,15 +188,22 @@ static inline void cm_t3517_init_rtc(void) {}
|
|||
#define HSUSB2_RESET_GPIO (147)
|
||||
#define USB_HUB_RESET_GPIO (152)
|
||||
|
||||
static struct usbhs_phy_data phy_data[] __initdata = {
|
||||
{
|
||||
.port = 1,
|
||||
.reset_gpio = HSUSB1_RESET_GPIO,
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
{
|
||||
.port = 2,
|
||||
.reset_gpio = HSUSB2_RESET_GPIO,
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct usbhs_omap_platform_data cm_t3517_ehci_pdata __initdata = {
|
||||
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
|
||||
.phy_reset = true,
|
||||
.reset_gpio_port[0] = HSUSB1_RESET_GPIO,
|
||||
.reset_gpio_port[1] = HSUSB2_RESET_GPIO,
|
||||
.reset_gpio_port[2] = -EINVAL,
|
||||
};
|
||||
|
||||
static int __init cm_t3517_init_usbh(void)
|
||||
|
|
@ -213,6 +220,7 @@ static int __init cm_t3517_init_usbh(void)
|
|||
msleep(1);
|
||||
}
|
||||
|
||||
usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
|
||||
usbhs_init(&cm_t3517_ehci_pdata);
|
||||
|
||||
return 0;
|
||||
|
|
@ -324,6 +332,6 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517")
|
|||
.handle_irq = omap3_intc_handle_irq,
|
||||
.init_machine = cm_t3517_init,
|
||||
.init_late = am35xx_init_late,
|
||||
.init_time = omap3_gp_gptimer_timer_init,
|
||||
.init_time = omap3_gptimer_timer_init,
|
||||
.restart = omap3xxx_restart,
|
||||
MACHINE_END
|
||||
|
|
|
|||
|
|
@ -415,15 +415,7 @@ static struct platform_device *devkit8000_devices[] __initdata = {
|
|||
};
|
||||
|
||||
static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
|
||||
|
||||
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
|
||||
.phy_reset = true,
|
||||
.reset_gpio_port[0] = -EINVAL,
|
||||
.reset_gpio_port[1] = -EINVAL,
|
||||
.reset_gpio_port[2] = -EINVAL
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OMAP_MUX
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
|
|||
.init_irq = omap_intc_of_init,
|
||||
.handle_irq = omap3_intc_handle_irq,
|
||||
.init_machine = omap_generic_init,
|
||||
.init_time = omap3_am33xx_gptimer_timer_init,
|
||||
.init_time = omap3_gptimer_timer_init,
|
||||
.dt_compat = am33xx_boards_compat,
|
||||
.restart = am33xx_restart,
|
||||
MACHINE_END
|
||||
|
|
|
|||
|
|
@ -527,26 +527,28 @@ static void __init igep_i2c_init(void)
|
|||
omap3_pmic_init("twl4030", &igep_twldata);
|
||||
}
|
||||
|
||||
static struct usbhs_phy_data igep2_phy_data[] __initdata = {
|
||||
{
|
||||
.port = 1,
|
||||
.reset_gpio = IGEP2_GPIO_USBH_NRESET,
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct usbhs_phy_data igep3_phy_data[] __initdata = {
|
||||
{
|
||||
.port = 2,
|
||||
.reset_gpio = IGEP3_GPIO_USBH_NRESET,
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct usbhs_omap_platform_data igep2_usbhs_bdata __initdata = {
|
||||
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
|
||||
.phy_reset = true,
|
||||
.reset_gpio_port[0] = IGEP2_GPIO_USBH_NRESET,
|
||||
.reset_gpio_port[1] = -EINVAL,
|
||||
.reset_gpio_port[2] = -EINVAL,
|
||||
};
|
||||
|
||||
static struct usbhs_omap_platform_data igep3_usbhs_bdata __initdata = {
|
||||
.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
|
||||
.phy_reset = true,
|
||||
.reset_gpio_port[0] = -EINVAL,
|
||||
.reset_gpio_port[1] = IGEP3_GPIO_USBH_NRESET,
|
||||
.reset_gpio_port[2] = -EINVAL,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OMAP_MUX
|
||||
|
|
@ -642,8 +644,10 @@ static void __init igep_init(void)
|
|||
if (machine_is_igep0020()) {
|
||||
omap_display_init(&igep2_dss_data);
|
||||
igep2_init_smsc911x();
|
||||
usbhs_init_phys(igep2_phy_data, ARRAY_SIZE(igep2_phy_data));
|
||||
usbhs_init(&igep2_usbhs_bdata);
|
||||
} else {
|
||||
usbhs_init_phys(igep3_phy_data, ARRAY_SIZE(igep3_phy_data));
|
||||
usbhs_init(&igep3_usbhs_bdata);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include <linux/mtd/nand.h>
|
||||
#include <linux/mmc/host.h>
|
||||
#include <linux/usb/phy.h>
|
||||
#include <linux/usb/nop-usb-xceiv.h>
|
||||
|
||||
#include <linux/regulator/machine.h>
|
||||
#include <linux/i2c/twl.h>
|
||||
|
|
@ -277,6 +278,21 @@ static struct regulator_consumer_supply beagle_vsim_supply[] = {
|
|||
|
||||
static struct gpio_led gpio_leds[];
|
||||
|
||||
/* PHY's VCC regulator might be added later, so flag that we need it */
|
||||
static struct nop_usb_xceiv_platform_data hsusb2_phy_data = {
|
||||
.needs_vcc = true,
|
||||
};
|
||||
|
||||
static struct usbhs_phy_data phy_data[] = {
|
||||
{
|
||||
.port = 2,
|
||||
.reset_gpio = 147,
|
||||
.vcc_gpio = -1, /* updated in beagle_twl_gpio_setup */
|
||||
.vcc_polarity = 1, /* updated in beagle_twl_gpio_setup */
|
||||
.platform_data = &hsusb2_phy_data,
|
||||
},
|
||||
};
|
||||
|
||||
static int beagle_twl_gpio_setup(struct device *dev,
|
||||
unsigned gpio, unsigned ngpio)
|
||||
{
|
||||
|
|
@ -318,9 +334,11 @@ static int beagle_twl_gpio_setup(struct device *dev,
|
|||
}
|
||||
dvi_panel.power_down_gpio = beagle_config.dvi_pd_gpio;
|
||||
|
||||
gpio_request_one(gpio + TWL4030_GPIO_MAX, beagle_config.usb_pwr_level,
|
||||
"nEN_USB_PWR");
|
||||
/* TWL4030_GPIO_MAX i.e. LED_GPO controls HS USB Port 2 power */
|
||||
phy_data[0].vcc_gpio = gpio + TWL4030_GPIO_MAX;
|
||||
phy_data[0].vcc_polarity = beagle_config.usb_pwr_level;
|
||||
|
||||
usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -453,15 +471,7 @@ static struct platform_device *omap3_beagle_devices[] __initdata = {
|
|||
};
|
||||
|
||||
static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
|
||||
|
||||
.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
|
||||
.phy_reset = true,
|
||||
.reset_gpio_port[0] = -EINVAL,
|
||||
.reset_gpio_port[1] = 147,
|
||||
.reset_gpio_port[2] = -EINVAL
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OMAP_MUX
|
||||
|
|
@ -479,7 +489,7 @@ static int __init beagle_opp_init(void)
|
|||
|
||||
/* Initialize the omap3 opp table if not already created. */
|
||||
r = omap3_opp_init();
|
||||
if (IS_ERR_VALUE(r) && (r != -EEXIST)) {
|
||||
if (r < 0 && (r != -EEXIST)) {
|
||||
pr_err("%s: opp default init failed\n", __func__);
|
||||
return r;
|
||||
}
|
||||
|
|
@ -543,7 +553,9 @@ static void __init omap3_beagle_init(void)
|
|||
|
||||
usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
|
||||
usb_musb_init(NULL);
|
||||
|
||||
usbhs_init(&usbhs_bdata);
|
||||
|
||||
board_nand_init(omap3beagle_nand_partitions,
|
||||
ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS,
|
||||
NAND_BUSWIDTH_16, NULL);
|
||||
|
|
|
|||
|
|
@ -466,7 +466,7 @@ struct wl12xx_platform_data omap3evm_wlan_data __initdata = {
|
|||
static struct regulator_consumer_supply omap3evm_vaux2_supplies[] = {
|
||||
REGULATOR_SUPPLY("VDD_CSIPHY1", "omap3isp"), /* OMAP ISP */
|
||||
REGULATOR_SUPPLY("VDD_CSIPHY2", "omap3isp"), /* OMAP ISP */
|
||||
REGULATOR_SUPPLY("hsusb1", "ehci-omap.0"),
|
||||
REGULATOR_SUPPLY("vcc", "nop_usb_xceiv.2"), /* hsusb port 2 */
|
||||
REGULATOR_SUPPLY("vaux2", NULL),
|
||||
};
|
||||
|
||||
|
|
@ -509,17 +509,16 @@ static int __init omap3_evm_i2c_init(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct usbhs_phy_data phy_data[] __initdata = {
|
||||
{
|
||||
.port = 2,
|
||||
.reset_gpio = -1, /* set at runtime */
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
|
||||
|
||||
.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
|
||||
.phy_reset = true,
|
||||
/* PHY reset GPIO will be runtime programmed based on EVM version */
|
||||
.reset_gpio_port[0] = -EINVAL,
|
||||
.reset_gpio_port[1] = -EINVAL,
|
||||
.reset_gpio_port[2] = -EINVAL
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OMAP_MUX
|
||||
|
|
@ -695,7 +694,7 @@ static void __init omap3_evm_init(void)
|
|||
|
||||
/* setup EHCI phy reset config */
|
||||
omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP);
|
||||
usbhs_bdata.reset_gpio_port[1] = 21;
|
||||
phy_data[0].reset_gpio = 21;
|
||||
|
||||
/* EVM REV >= E can supply 500mA with EXTVBUS programming */
|
||||
musb_board_data.power = 500;
|
||||
|
|
@ -703,10 +702,12 @@ static void __init omap3_evm_init(void)
|
|||
} else {
|
||||
/* setup EHCI phy reset on MDC */
|
||||
omap_mux_init_gpio(135, OMAP_PIN_OUTPUT);
|
||||
usbhs_bdata.reset_gpio_port[1] = 135;
|
||||
phy_data[0].reset_gpio = 135;
|
||||
}
|
||||
usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
|
||||
usb_musb_init(&musb_board_data);
|
||||
|
||||
usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
|
||||
usbhs_init(&usbhs_bdata);
|
||||
board_nand_init(omap3evm_nand_partitions,
|
||||
ARRAY_SIZE(omap3evm_nand_partitions), NAND_CS,
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ static struct regulator_consumer_supply pandora_vcc_lcd_supply[] = {
|
|||
};
|
||||
|
||||
static struct regulator_consumer_supply pandora_usb_phy_supply[] = {
|
||||
REGULATOR_SUPPLY("hsusb1", "ehci-omap.0"),
|
||||
REGULATOR_SUPPLY("vcc", "nop_usb_xceiv.2"), /* hsusb port 2 */
|
||||
};
|
||||
|
||||
/* ads7846 on SPI and 2 nub controllers on I2C */
|
||||
|
|
@ -566,6 +566,14 @@ fail:
|
|||
printk(KERN_ERR "wl1251 board initialisation failed\n");
|
||||
}
|
||||
|
||||
static struct usbhs_phy_data phy_data[] __initdata = {
|
||||
{
|
||||
.port = 2,
|
||||
.reset_gpio = 16,
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device *omap3pandora_devices[] __initdata = {
|
||||
&pandora_leds_gpio,
|
||||
&pandora_keys_gpio,
|
||||
|
|
@ -574,15 +582,7 @@ static struct platform_device *omap3pandora_devices[] __initdata = {
|
|||
};
|
||||
|
||||
static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
|
||||
|
||||
.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
|
||||
.phy_reset = true,
|
||||
.reset_gpio_port[0] = -EINVAL,
|
||||
.reset_gpio_port[1] = 16,
|
||||
.reset_gpio_port[2] = -EINVAL
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OMAP_MUX
|
||||
|
|
@ -606,7 +606,10 @@ static void __init omap3pandora_init(void)
|
|||
spi_register_board_info(omap3pandora_spi_board_info,
|
||||
ARRAY_SIZE(omap3pandora_spi_board_info));
|
||||
omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL);
|
||||
|
||||
usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
|
||||
usbhs_init(&usbhs_bdata);
|
||||
|
||||
usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
|
||||
usb_musb_init(NULL);
|
||||
gpmc_nand_init(&pandora_nand_data, NULL);
|
||||
|
|
|
|||
|
|
@ -346,19 +346,20 @@ static int __init omap3_stalker_i2c_init(void)
|
|||
|
||||
#define OMAP3_STALKER_TS_GPIO 175
|
||||
|
||||
static struct usbhs_phy_data phy_data[] __initdata = {
|
||||
{
|
||||
.port = 2,
|
||||
.reset_gpio = 21,
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device *omap3_stalker_devices[] __initdata = {
|
||||
&keys_gpio,
|
||||
};
|
||||
|
||||
static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
|
||||
.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
|
||||
.phy_reset = true,
|
||||
.reset_gpio_port[0] = -EINVAL,
|
||||
.reset_gpio_port[1] = 21,
|
||||
.reset_gpio_port[2] = -EINVAL,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OMAP_MUX
|
||||
|
|
@ -395,6 +396,8 @@ static void __init omap3_stalker_init(void)
|
|||
omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL);
|
||||
usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
|
||||
usb_musb_init(NULL);
|
||||
|
||||
usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
|
||||
usbhs_init(&usbhs_bdata);
|
||||
omap_ads7846_init(1, OMAP3_STALKER_TS_GPIO, 310, NULL);
|
||||
|
||||
|
|
|
|||
|
|
@ -305,21 +305,22 @@ static struct omap_board_mux board_mux[] __initdata = {
|
|||
};
|
||||
#endif
|
||||
|
||||
static struct usbhs_phy_data phy_data[] __initdata = {
|
||||
{
|
||||
.port = 2,
|
||||
.reset_gpio = 147,
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device *omap3_touchbook_devices[] __initdata = {
|
||||
&leds_gpio,
|
||||
&keys_gpio,
|
||||
};
|
||||
|
||||
static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
|
||||
|
||||
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
|
||||
.phy_reset = true,
|
||||
.reset_gpio_port[0] = -EINVAL,
|
||||
.reset_gpio_port[1] = 147,
|
||||
.reset_gpio_port[2] = -EINVAL
|
||||
};
|
||||
|
||||
static void omap3_touchbook_poweroff(void)
|
||||
|
|
@ -368,6 +369,8 @@ static void __init omap3_touchbook_init(void)
|
|||
omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata);
|
||||
usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
|
||||
usb_musb_init(NULL);
|
||||
|
||||
usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
|
||||
usbhs_init(&usbhs_bdata);
|
||||
board_nand_init(omap3touchbook_nand_partitions,
|
||||
ARRAY_SIZE(omap3touchbook_nand_partitions), NAND_CS,
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include <linux/ti_wilink_st.h>
|
||||
#include <linux/usb/musb.h>
|
||||
#include <linux/usb/phy.h>
|
||||
#include <linux/usb/nop-usb-xceiv.h>
|
||||
#include <linux/wl12xx.h>
|
||||
#include <linux/irqchip/arm-gic.h>
|
||||
#include <linux/platform_data/omap-abe-twl6040.h>
|
||||
|
|
@ -132,6 +133,22 @@ static struct platform_device btwilink_device = {
|
|||
.id = -1,
|
||||
};
|
||||
|
||||
/* PHY device on HS USB Port 1 i.e. nop_usb_xceiv.1 */
|
||||
static struct nop_usb_xceiv_platform_data hsusb1_phy_data = {
|
||||
/* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */
|
||||
.clk_rate = 19200000,
|
||||
};
|
||||
|
||||
static struct usbhs_phy_data phy_data[] __initdata = {
|
||||
{
|
||||
.port = 1,
|
||||
.reset_gpio = GPIO_HUB_NRESET,
|
||||
.vcc_gpio = GPIO_HUB_POWER,
|
||||
.vcc_polarity = 1,
|
||||
.platform_data = &hsusb1_phy_data,
|
||||
},
|
||||
};
|
||||
|
||||
static struct platform_device *panda_devices[] __initdata = {
|
||||
&leds_gpio,
|
||||
&wl1271_device,
|
||||
|
|
@ -142,49 +159,19 @@ static struct platform_device *panda_devices[] __initdata = {
|
|||
|
||||
static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
|
||||
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
.phy_reset = false,
|
||||
.reset_gpio_port[0] = -EINVAL,
|
||||
.reset_gpio_port[1] = -EINVAL,
|
||||
.reset_gpio_port[2] = -EINVAL
|
||||
};
|
||||
|
||||
static struct gpio panda_ehci_gpios[] __initdata = {
|
||||
{ GPIO_HUB_POWER, GPIOF_OUT_INIT_LOW, "hub_power" },
|
||||
{ GPIO_HUB_NRESET, GPIOF_OUT_INIT_LOW, "hub_nreset" },
|
||||
};
|
||||
|
||||
static void __init omap4_ehci_init(void)
|
||||
{
|
||||
int ret;
|
||||
struct clk *phy_ref_clk;
|
||||
|
||||
/* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */
|
||||
phy_ref_clk = clk_get(NULL, "auxclk3_ck");
|
||||
if (IS_ERR(phy_ref_clk)) {
|
||||
pr_err("Cannot request auxclk3\n");
|
||||
return;
|
||||
}
|
||||
clk_set_rate(phy_ref_clk, 19200000);
|
||||
clk_prepare_enable(phy_ref_clk);
|
||||
|
||||
/* disable the power to the usb hub prior to init and reset phy+hub */
|
||||
ret = gpio_request_array(panda_ehci_gpios,
|
||||
ARRAY_SIZE(panda_ehci_gpios));
|
||||
if (ret) {
|
||||
pr_err("Unable to initialize EHCI power/reset\n");
|
||||
return;
|
||||
}
|
||||
|
||||
gpio_export(GPIO_HUB_POWER, 0);
|
||||
gpio_export(GPIO_HUB_NRESET, 0);
|
||||
gpio_set_value(GPIO_HUB_NRESET, 1);
|
||||
ret = clk_add_alias("main_clk", "nop_usb_xceiv.1", "auxclk3_ck", NULL);
|
||||
if (ret)
|
||||
pr_err("Failed to add main_clk alias to auxclk3_ck\n");
|
||||
|
||||
usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
|
||||
usbhs_init(&usbhs_bdata);
|
||||
|
||||
/* enable power to hub */
|
||||
gpio_set_value(GPIO_HUB_POWER, 1);
|
||||
}
|
||||
|
||||
static struct omap_musb_board_data musb_board_data = {
|
||||
|
|
|
|||
|
|
@ -428,14 +428,16 @@ static int __init overo_spi_init(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct usbhs_phy_data phy_data[] __initdata = {
|
||||
{
|
||||
.port = 2,
|
||||
.reset_gpio = OVERO_GPIO_USBH_NRESET,
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
|
||||
.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
.phy_reset = true,
|
||||
.reset_gpio_port[0] = -EINVAL,
|
||||
.reset_gpio_port[1] = OVERO_GPIO_USBH_NRESET,
|
||||
.reset_gpio_port[2] = -EINVAL
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OMAP_MUX
|
||||
|
|
@ -472,6 +474,8 @@ static void __init overo_init(void)
|
|||
ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL);
|
||||
usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb");
|
||||
usb_musb_init(NULL);
|
||||
|
||||
usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
|
||||
usbhs_init(&usbhs_bdata);
|
||||
overo_spi_init();
|
||||
overo_init_smsc911x();
|
||||
|
|
|
|||
|
|
@ -92,14 +92,16 @@ static struct mtd_partition zoom_nand_partitions[] = {
|
|||
},
|
||||
};
|
||||
|
||||
static struct usbhs_phy_data phy_data[] __initdata = {
|
||||
{
|
||||
.port = 2,
|
||||
.reset_gpio = ZOOM3_EHCI_RESET_GPIO,
|
||||
.vcc_gpio = -EINVAL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
|
||||
.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
|
||||
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
|
||||
.phy_reset = true,
|
||||
.reset_gpio_port[0] = -EINVAL,
|
||||
.reset_gpio_port[1] = ZOOM3_EHCI_RESET_GPIO,
|
||||
.reset_gpio_port[2] = -EINVAL,
|
||||
};
|
||||
|
||||
static void __init omap_zoom_init(void)
|
||||
|
|
@ -109,6 +111,8 @@ static void __init omap_zoom_init(void)
|
|||
} else if (machine_is_omap_zoom3()) {
|
||||
omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
|
||||
omap_mux_init_gpio(ZOOM3_EHCI_RESET_GPIO, OMAP_PIN_OUTPUT);
|
||||
|
||||
usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
|
||||
usbhs_init(&usbhs_bdata);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -596,7 +596,7 @@ int __init omap2_clk_switch_mpurate_at_boot(const char *mpurate_ck_name)
|
|||
return -ENOENT;
|
||||
|
||||
r = clk_set_rate(mpurate_ck, mpurate);
|
||||
if (IS_ERR_VALUE(r)) {
|
||||
if (r < 0) {
|
||||
WARN(1, "clock: %s: unable to set MPU rate to %d: %d\n",
|
||||
mpurate_ck_name, mpurate, r);
|
||||
clk_put(mpurate_ck);
|
||||
|
|
|
|||
|
|
@ -82,8 +82,7 @@ extern void omap2_init_common_infrastructure(void);
|
|||
extern void omap2_sync32k_timer_init(void);
|
||||
extern void omap3_sync32k_timer_init(void);
|
||||
extern void omap3_secure_sync32k_timer_init(void);
|
||||
extern void omap3_gp_gptimer_timer_init(void);
|
||||
extern void omap3_am33xx_gptimer_timer_init(void);
|
||||
extern void omap3_gptimer_timer_init(void);
|
||||
extern void omap4_local_timer_init(void);
|
||||
extern void omap5_realtime_timer_init(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -74,14 +74,6 @@ static int omap2_nand_gpmc_retime(
|
|||
t.cs_wr_off = gpmc_t->cs_wr_off;
|
||||
t.wr_cycle = gpmc_t->wr_cycle;
|
||||
|
||||
/* Configure GPMC */
|
||||
if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16)
|
||||
gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 1);
|
||||
else
|
||||
gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0);
|
||||
gpmc_cs_configure(gpmc_nand_data->cs,
|
||||
GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND);
|
||||
gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_WP, 0);
|
||||
err = gpmc_cs_set_timings(gpmc_nand_data->cs, &t);
|
||||
if (err)
|
||||
return err;
|
||||
|
|
@ -115,14 +107,18 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
|
|||
struct gpmc_timings *gpmc_t)
|
||||
{
|
||||
int err = 0;
|
||||
struct gpmc_settings s;
|
||||
struct device *dev = &gpmc_nand_device.dev;
|
||||
|
||||
memset(&s, 0, sizeof(struct gpmc_settings));
|
||||
|
||||
gpmc_nand_device.dev.platform_data = gpmc_nand_data;
|
||||
|
||||
err = gpmc_cs_request(gpmc_nand_data->cs, NAND_IO_SIZE,
|
||||
(unsigned long *)&gpmc_nand_resource[0].start);
|
||||
if (err < 0) {
|
||||
dev_err(dev, "Cannot request GPMC CS\n");
|
||||
dev_err(dev, "Cannot request GPMC CS %d, error %d\n",
|
||||
gpmc_nand_data->cs, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
@ -140,11 +136,31 @@ int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
|
|||
dev_err(dev, "Unable to set gpmc timings: %d\n", err);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
/* Enable RD PIN Monitoring Reg */
|
||||
if (gpmc_nand_data->dev_ready) {
|
||||
gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_RDY_BSY, 1);
|
||||
if (gpmc_nand_data->of_node) {
|
||||
gpmc_read_settings_dt(gpmc_nand_data->of_node, &s);
|
||||
} else {
|
||||
s.device_nand = true;
|
||||
|
||||
/* Enable RD PIN Monitoring Reg */
|
||||
if (gpmc_nand_data->dev_ready) {
|
||||
s.wait_on_read = true;
|
||||
s.wait_on_write = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16)
|
||||
s.device_width = GPMC_DEVWIDTH_16BIT;
|
||||
else
|
||||
s.device_width = GPMC_DEVWIDTH_8BIT;
|
||||
|
||||
err = gpmc_cs_program_settings(gpmc_nand_data->cs, &s);
|
||||
if (err < 0)
|
||||
goto out_free_cs;
|
||||
|
||||
err = gpmc_configure(GPMC_CONFIG_WP, 0);
|
||||
if (err < 0)
|
||||
goto out_free_cs;
|
||||
}
|
||||
|
||||
gpmc_update_nand_reg(&gpmc_nand_data->reg, gpmc_nand_data->cs);
|
||||
|
|
|
|||
|
|
@ -47,11 +47,23 @@ static struct platform_device gpmc_onenand_device = {
|
|||
.resource = &gpmc_onenand_resource,
|
||||
};
|
||||
|
||||
static struct gpmc_timings omap2_onenand_calc_async_timings(void)
|
||||
static struct gpmc_settings onenand_async = {
|
||||
.device_width = GPMC_DEVWIDTH_16BIT,
|
||||
.mux_add_data = GPMC_MUX_AD,
|
||||
};
|
||||
|
||||
static struct gpmc_settings onenand_sync = {
|
||||
.burst_read = true,
|
||||
.burst_wrap = true,
|
||||
.burst_len = GPMC_BURST_16,
|
||||
.device_width = GPMC_DEVWIDTH_16BIT,
|
||||
.mux_add_data = GPMC_MUX_AD,
|
||||
.wait_pin = 0,
|
||||
};
|
||||
|
||||
static void omap2_onenand_calc_async_timings(struct gpmc_timings *t)
|
||||
{
|
||||
struct gpmc_device_timings dev_t;
|
||||
struct gpmc_timings t;
|
||||
|
||||
const int t_cer = 15;
|
||||
const int t_avdp = 12;
|
||||
const int t_aavdh = 7;
|
||||
|
|
@ -64,7 +76,6 @@ static struct gpmc_timings omap2_onenand_calc_async_timings(void)
|
|||
|
||||
memset(&dev_t, 0, sizeof(dev_t));
|
||||
|
||||
dev_t.mux = true;
|
||||
dev_t.t_avdp_r = max_t(int, t_avdp, t_cer) * 1000;
|
||||
dev_t.t_avdp_w = dev_t.t_avdp_r;
|
||||
dev_t.t_aavdh = t_aavdh * 1000;
|
||||
|
|
@ -76,19 +87,7 @@ static struct gpmc_timings omap2_onenand_calc_async_timings(void)
|
|||
dev_t.t_wpl = t_wpl * 1000;
|
||||
dev_t.t_wph = t_wph * 1000;
|
||||
|
||||
gpmc_calc_timings(&t, &dev_t);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
static int gpmc_set_async_mode(int cs, struct gpmc_timings *t)
|
||||
{
|
||||
/* Configure GPMC for asynchronous read */
|
||||
gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1,
|
||||
GPMC_CONFIG1_DEVICESIZE_16 |
|
||||
GPMC_CONFIG1_MUXADDDATA);
|
||||
|
||||
return gpmc_cs_set_timings(cs, t);
|
||||
gpmc_calc_timings(t, &onenand_async, &dev_t);
|
||||
}
|
||||
|
||||
static void omap2_onenand_set_async_mode(void __iomem *onenand_base)
|
||||
|
|
@ -158,12 +157,11 @@ static int omap2_onenand_get_freq(struct omap_onenand_platform_data *cfg,
|
|||
return freq;
|
||||
}
|
||||
|
||||
static struct gpmc_timings
|
||||
omap2_onenand_calc_sync_timings(struct omap_onenand_platform_data *cfg,
|
||||
int freq)
|
||||
static void omap2_onenand_calc_sync_timings(struct gpmc_timings *t,
|
||||
unsigned int flags,
|
||||
int freq)
|
||||
{
|
||||
struct gpmc_device_timings dev_t;
|
||||
struct gpmc_timings t;
|
||||
const int t_cer = 15;
|
||||
const int t_avdp = 12;
|
||||
const int t_cez = 20; /* max of t_cez, t_oez */
|
||||
|
|
@ -172,9 +170,9 @@ omap2_onenand_calc_sync_timings(struct omap_onenand_platform_data *cfg,
|
|||
int min_gpmc_clk_period, t_ces, t_avds, t_avdh, t_ach, t_aavdh, t_rdyo;
|
||||
int div, gpmc_clk_ns;
|
||||
|
||||
if (cfg->flags & ONENAND_SYNC_READ)
|
||||
if (flags & ONENAND_SYNC_READ)
|
||||
onenand_flags = ONENAND_FLAG_SYNCREAD;
|
||||
else if (cfg->flags & ONENAND_SYNC_READWRITE)
|
||||
else if (flags & ONENAND_SYNC_READWRITE)
|
||||
onenand_flags = ONENAND_FLAG_SYNCREAD | ONENAND_FLAG_SYNCWRITE;
|
||||
|
||||
switch (freq) {
|
||||
|
|
@ -239,10 +237,11 @@ omap2_onenand_calc_sync_timings(struct omap_onenand_platform_data *cfg,
|
|||
/* Set synchronous read timings */
|
||||
memset(&dev_t, 0, sizeof(dev_t));
|
||||
|
||||
dev_t.mux = true;
|
||||
dev_t.sync_read = true;
|
||||
if (onenand_flags & ONENAND_FLAG_SYNCREAD)
|
||||
onenand_sync.sync_read = true;
|
||||
if (onenand_flags & ONENAND_FLAG_SYNCWRITE) {
|
||||
dev_t.sync_write = true;
|
||||
onenand_sync.sync_write = true;
|
||||
onenand_sync.burst_write = true;
|
||||
} else {
|
||||
dev_t.t_avdp_w = max(t_avdp, t_cer) * 1000;
|
||||
dev_t.t_wpl = t_wpl * 1000;
|
||||
|
|
@ -265,32 +264,7 @@ omap2_onenand_calc_sync_timings(struct omap_onenand_platform_data *cfg,
|
|||
dev_t.cyc_aavdh_oe = 1;
|
||||
dev_t.t_rdyo = t_rdyo * 1000 + min_gpmc_clk_period;
|
||||
|
||||
gpmc_calc_timings(&t, &dev_t);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
static int gpmc_set_sync_mode(int cs, struct gpmc_timings *t)
|
||||
{
|
||||
unsigned sync_read = onenand_flags & ONENAND_FLAG_SYNCREAD;
|
||||
unsigned sync_write = onenand_flags & ONENAND_FLAG_SYNCWRITE;
|
||||
|
||||
/* Configure GPMC for synchronous read */
|
||||
gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1,
|
||||
GPMC_CONFIG1_WRAPBURST_SUPP |
|
||||
GPMC_CONFIG1_READMULTIPLE_SUPP |
|
||||
(sync_read ? GPMC_CONFIG1_READTYPE_SYNC : 0) |
|
||||
(sync_write ? GPMC_CONFIG1_WRITEMULTIPLE_SUPP : 0) |
|
||||
(sync_write ? GPMC_CONFIG1_WRITETYPE_SYNC : 0) |
|
||||
GPMC_CONFIG1_PAGE_LEN(2) |
|
||||
(cpu_is_omap34xx() ? 0 :
|
||||
(GPMC_CONFIG1_WAIT_READ_MON |
|
||||
GPMC_CONFIG1_WAIT_PIN_SEL(0))) |
|
||||
GPMC_CONFIG1_DEVICESIZE_16 |
|
||||
GPMC_CONFIG1_DEVICETYPE_NOR |
|
||||
GPMC_CONFIG1_MUXADDDATA);
|
||||
|
||||
return gpmc_cs_set_timings(cs, t);
|
||||
gpmc_calc_timings(t, &onenand_sync, &dev_t);
|
||||
}
|
||||
|
||||
static int omap2_onenand_setup_async(void __iomem *onenand_base)
|
||||
|
|
@ -298,12 +272,20 @@ static int omap2_onenand_setup_async(void __iomem *onenand_base)
|
|||
struct gpmc_timings t;
|
||||
int ret;
|
||||
|
||||
if (gpmc_onenand_data->of_node)
|
||||
gpmc_read_settings_dt(gpmc_onenand_data->of_node,
|
||||
&onenand_async);
|
||||
|
||||
omap2_onenand_set_async_mode(onenand_base);
|
||||
|
||||
t = omap2_onenand_calc_async_timings();
|
||||
omap2_onenand_calc_async_timings(&t);
|
||||
|
||||
ret = gpmc_set_async_mode(gpmc_onenand_data->cs, &t);
|
||||
if (IS_ERR_VALUE(ret))
|
||||
ret = gpmc_cs_program_settings(gpmc_onenand_data->cs, &onenand_async);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = gpmc_cs_set_timings(gpmc_onenand_data->cs, &t);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
omap2_onenand_set_async_mode(onenand_base);
|
||||
|
|
@ -322,10 +304,26 @@ static int omap2_onenand_setup_sync(void __iomem *onenand_base, int *freq_ptr)
|
|||
set_onenand_cfg(onenand_base);
|
||||
}
|
||||
|
||||
t = omap2_onenand_calc_sync_timings(gpmc_onenand_data, freq);
|
||||
if (gpmc_onenand_data->of_node) {
|
||||
gpmc_read_settings_dt(gpmc_onenand_data->of_node,
|
||||
&onenand_sync);
|
||||
} else {
|
||||
/*
|
||||
* FIXME: Appears to be legacy code from initial ONENAND commit.
|
||||
* Unclear what boards this is for and if this can be removed.
|
||||
*/
|
||||
if (!cpu_is_omap34xx())
|
||||
onenand_sync.wait_on_read = true;
|
||||
}
|
||||
|
||||
ret = gpmc_set_sync_mode(gpmc_onenand_data->cs, &t);
|
||||
if (IS_ERR_VALUE(ret))
|
||||
omap2_onenand_calc_sync_timings(&t, gpmc_onenand_data->flags, freq);
|
||||
|
||||
ret = gpmc_cs_program_settings(gpmc_onenand_data->cs, &onenand_sync);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = gpmc_cs_set_timings(gpmc_onenand_data->cs, &t);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
set_onenand_cfg(onenand_base);
|
||||
|
|
@ -359,6 +357,7 @@ static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr)
|
|||
void gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
|
||||
{
|
||||
int err;
|
||||
struct device *dev = &gpmc_onenand_device.dev;
|
||||
|
||||
gpmc_onenand_data = _onenand_data;
|
||||
gpmc_onenand_data->onenand_setup = gpmc_onenand_setup;
|
||||
|
|
@ -366,7 +365,7 @@ void gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
|
|||
|
||||
if (cpu_is_omap24xx() &&
|
||||
(gpmc_onenand_data->flags & ONENAND_SYNC_READWRITE)) {
|
||||
printk(KERN_ERR "Onenand using only SYNC_READ on 24xx\n");
|
||||
dev_warn(dev, "OneNAND using only SYNC_READ on 24xx\n");
|
||||
gpmc_onenand_data->flags &= ~ONENAND_SYNC_READWRITE;
|
||||
gpmc_onenand_data->flags |= ONENAND_SYNC_READ;
|
||||
}
|
||||
|
|
@ -379,7 +378,8 @@ void gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
|
|||
err = gpmc_cs_request(gpmc_onenand_data->cs, ONENAND_IO_SIZE,
|
||||
(unsigned long *)&gpmc_onenand_resource.start);
|
||||
if (err < 0) {
|
||||
pr_err("%s: Cannot request GPMC CS\n", __func__);
|
||||
dev_err(dev, "Cannot request GPMC CS %d, error %d\n",
|
||||
gpmc_onenand_data->cs, err);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -387,7 +387,7 @@ void gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
|
|||
ONENAND_IO_SIZE - 1;
|
||||
|
||||
if (platform_device_register(&gpmc_onenand_device) < 0) {
|
||||
pr_err("%s: Unable to register OneNAND device\n", __func__);
|
||||
dev_err(dev, "Unable to register OneNAND device\n");
|
||||
gpmc_cs_free(gpmc_onenand_data->cs);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,10 @@ static struct platform_device gpmc_smc91x_device = {
|
|||
.resource = gpmc_smc91x_resources,
|
||||
};
|
||||
|
||||
static struct gpmc_settings smc91x_settings = {
|
||||
.device_width = GPMC_DEVWIDTH_16BIT,
|
||||
};
|
||||
|
||||
/*
|
||||
* Set the gpmc timings for smc91c96. The timings are taken
|
||||
* from the data sheet available at:
|
||||
|
|
@ -67,18 +71,6 @@ static int smc91c96_gpmc_retime(void)
|
|||
const int t7 = 5; /* Figure 12.4 write */
|
||||
const int t8 = 5; /* Figure 12.4 write */
|
||||
const int t20 = 185; /* Figure 12.2 read and 12.4 write */
|
||||
u32 l;
|
||||
|
||||
l = GPMC_CONFIG1_DEVICESIZE_16;
|
||||
if (gpmc_cfg->flags & GPMC_MUX_ADD_DATA)
|
||||
l |= GPMC_CONFIG1_MUXADDDATA;
|
||||
if (gpmc_cfg->flags & GPMC_READ_MON)
|
||||
l |= GPMC_CONFIG1_WAIT_READ_MON;
|
||||
if (gpmc_cfg->flags & GPMC_WRITE_MON)
|
||||
l |= GPMC_CONFIG1_WAIT_WRITE_MON;
|
||||
if (gpmc_cfg->wait_pin)
|
||||
l |= GPMC_CONFIG1_WAIT_PIN_SEL(gpmc_cfg->wait_pin);
|
||||
gpmc_cs_write_reg(gpmc_cfg->cs, GPMC_CS_CONFIG1, l);
|
||||
|
||||
/*
|
||||
* FIXME: Calculate the address and data bus muxed timings.
|
||||
|
|
@ -104,7 +96,7 @@ static int smc91c96_gpmc_retime(void)
|
|||
dev_t.t_cez_w = t4_w * 1000;
|
||||
dev_t.t_wr_cycle = (t20 - t3) * 1000;
|
||||
|
||||
gpmc_calc_timings(&t, &dev_t);
|
||||
gpmc_calc_timings(&t, &smc91x_settings, &dev_t);
|
||||
|
||||
return gpmc_cs_set_timings(gpmc_cfg->cs, &t);
|
||||
}
|
||||
|
|
@ -133,6 +125,18 @@ void __init gpmc_smc91x_init(struct omap_smc91x_platform_data *board_data)
|
|||
gpmc_smc91x_resources[0].end = cs_mem_base + 0x30f;
|
||||
gpmc_smc91x_resources[1].flags |= (gpmc_cfg->flags & IRQF_TRIGGER_MASK);
|
||||
|
||||
if (gpmc_cfg->flags & GPMC_MUX_ADD_DATA)
|
||||
smc91x_settings.mux_add_data = GPMC_MUX_AD;
|
||||
if (gpmc_cfg->flags & GPMC_READ_MON)
|
||||
smc91x_settings.wait_on_read = true;
|
||||
if (gpmc_cfg->flags & GPMC_WRITE_MON)
|
||||
smc91x_settings.wait_on_write = true;
|
||||
if (gpmc_cfg->wait_pin)
|
||||
smc91x_settings.wait_pin = gpmc_cfg->wait_pin;
|
||||
ret = gpmc_cs_program_settings(gpmc_cfg->cs, &smc91x_settings);
|
||||
if (ret < 0)
|
||||
goto free1;
|
||||
|
||||
if (gpmc_cfg->retime) {
|
||||
ret = gpmc_cfg->retime();
|
||||
if (ret != 0)
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include <linux/interrupt.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_address.h>
|
||||
#include <linux/of_mtd.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/mtd/nand.h>
|
||||
|
|
@ -91,9 +92,7 @@
|
|||
#define GPMC_CS_SIZE 0x30
|
||||
#define GPMC_BCH_SIZE 0x10
|
||||
|
||||
#define GPMC_MEM_START 0x00000000
|
||||
#define GPMC_MEM_END 0x3FFFFFFF
|
||||
#define BOOT_ROM_SPACE 0x100000 /* 1MB */
|
||||
|
||||
#define GPMC_CHUNK_SHIFT 24 /* 16 MB */
|
||||
#define GPMC_SECTION_SHIFT 28 /* 128 MB */
|
||||
|
|
@ -107,6 +106,9 @@
|
|||
|
||||
#define GPMC_HAS_WR_ACCESS 0x1
|
||||
#define GPMC_HAS_WR_DATA_MUX_BUS 0x2
|
||||
#define GPMC_HAS_MUX_AAD 0x4
|
||||
|
||||
#define GPMC_NR_WAITPINS 4
|
||||
|
||||
/* XXX: Only NAND irq has been considered,currently these are the only ones used
|
||||
*/
|
||||
|
|
@ -153,6 +155,7 @@ static struct resource gpmc_cs_mem[GPMC_CS_NUM];
|
|||
static DEFINE_SPINLOCK(gpmc_mem_lock);
|
||||
/* Define chip-selects as reserved by default until probe completes */
|
||||
static unsigned int gpmc_cs_map = ((1 << GPMC_CS_NUM) - 1);
|
||||
static unsigned int gpmc_nr_waitpins;
|
||||
static struct device *gpmc_dev;
|
||||
static int gpmc_irq;
|
||||
static resource_size_t phys_base, mem_size;
|
||||
|
|
@ -181,7 +184,7 @@ void gpmc_cs_write_reg(int cs, int idx, u32 val)
|
|||
__raw_writel(val, reg_addr);
|
||||
}
|
||||
|
||||
u32 gpmc_cs_read_reg(int cs, int idx)
|
||||
static u32 gpmc_cs_read_reg(int cs, int idx)
|
||||
{
|
||||
void __iomem *reg_addr;
|
||||
|
||||
|
|
@ -190,7 +193,7 @@ u32 gpmc_cs_read_reg(int cs, int idx)
|
|||
}
|
||||
|
||||
/* TODO: Add support for gpmc_fck to clock framework and use it */
|
||||
unsigned long gpmc_get_fclk_period(void)
|
||||
static unsigned long gpmc_get_fclk_period(void)
|
||||
{
|
||||
unsigned long rate = clk_get_rate(gpmc_l3_clk);
|
||||
|
||||
|
|
@ -205,7 +208,7 @@ unsigned long gpmc_get_fclk_period(void)
|
|||
return rate;
|
||||
}
|
||||
|
||||
unsigned int gpmc_ns_to_ticks(unsigned int time_ns)
|
||||
static unsigned int gpmc_ns_to_ticks(unsigned int time_ns)
|
||||
{
|
||||
unsigned long tick_ps;
|
||||
|
||||
|
|
@ -215,7 +218,7 @@ unsigned int gpmc_ns_to_ticks(unsigned int time_ns)
|
|||
return (time_ns * 1000 + tick_ps - 1) / tick_ps;
|
||||
}
|
||||
|
||||
unsigned int gpmc_ps_to_ticks(unsigned int time_ps)
|
||||
static unsigned int gpmc_ps_to_ticks(unsigned int time_ps)
|
||||
{
|
||||
unsigned long tick_ps;
|
||||
|
||||
|
|
@ -230,13 +233,6 @@ unsigned int gpmc_ticks_to_ns(unsigned int ticks)
|
|||
return ticks * gpmc_get_fclk_period() / 1000;
|
||||
}
|
||||
|
||||
unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns)
|
||||
{
|
||||
unsigned long ticks = gpmc_ns_to_ticks(time_ns);
|
||||
|
||||
return ticks * gpmc_get_fclk_period() / 1000;
|
||||
}
|
||||
|
||||
static unsigned int gpmc_ticks_to_ps(unsigned int ticks)
|
||||
{
|
||||
return ticks * gpmc_get_fclk_period();
|
||||
|
|
@ -405,11 +401,18 @@ int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void gpmc_cs_enable_mem(int cs, u32 base, u32 size)
|
||||
static int gpmc_cs_enable_mem(int cs, u32 base, u32 size)
|
||||
{
|
||||
u32 l;
|
||||
u32 mask;
|
||||
|
||||
/*
|
||||
* Ensure that base address is aligned on a
|
||||
* boundary equal to or greater than size.
|
||||
*/
|
||||
if (base & (size - 1))
|
||||
return -EINVAL;
|
||||
|
||||
mask = (1 << GPMC_SECTION_SHIFT) - size;
|
||||
l = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7);
|
||||
l &= ~0x3f;
|
||||
|
|
@ -418,6 +421,8 @@ static void gpmc_cs_enable_mem(int cs, u32 base, u32 size)
|
|||
l |= ((mask >> GPMC_CHUNK_SHIFT) & 0x0f) << 8;
|
||||
l |= GPMC_CONFIG7_CSVALID;
|
||||
gpmc_cs_write_reg(cs, GPMC_CS_CONFIG7, l);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void gpmc_cs_disable_mem(int cs)
|
||||
|
|
@ -448,22 +453,14 @@ static int gpmc_cs_mem_enabled(int cs)
|
|||
return l & GPMC_CONFIG7_CSVALID;
|
||||
}
|
||||
|
||||
int gpmc_cs_set_reserved(int cs, int reserved)
|
||||
static void gpmc_cs_set_reserved(int cs, int reserved)
|
||||
{
|
||||
if (cs > GPMC_CS_NUM)
|
||||
return -ENODEV;
|
||||
|
||||
gpmc_cs_map &= ~(1 << cs);
|
||||
gpmc_cs_map |= (reserved ? 1 : 0) << cs;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int gpmc_cs_reserved(int cs)
|
||||
static bool gpmc_cs_reserved(int cs)
|
||||
{
|
||||
if (cs > GPMC_CS_NUM)
|
||||
return -ENODEV;
|
||||
|
||||
return gpmc_cs_map & (1 << cs);
|
||||
}
|
||||
|
||||
|
|
@ -510,6 +507,39 @@ static int gpmc_cs_delete_mem(int cs)
|
|||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
* gpmc_cs_remap - remaps a chip-select physical base address
|
||||
* @cs: chip-select to remap
|
||||
* @base: physical base address to re-map chip-select to
|
||||
*
|
||||
* Re-maps a chip-select to a new physical base address specified by
|
||||
* "base". Returns 0 on success and appropriate negative error code
|
||||
* on failure.
|
||||
*/
|
||||
static int gpmc_cs_remap(int cs, u32 base)
|
||||
{
|
||||
int ret;
|
||||
u32 old_base, size;
|
||||
|
||||
if (cs > GPMC_CS_NUM)
|
||||
return -ENODEV;
|
||||
gpmc_cs_get_memconf(cs, &old_base, &size);
|
||||
if (base == old_base)
|
||||
return 0;
|
||||
gpmc_cs_disable_mem(cs);
|
||||
ret = gpmc_cs_delete_mem(cs);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
ret = gpmc_cs_insert_mem(cs, base, size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
ret = gpmc_cs_enable_mem(cs, base, size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int gpmc_cs_request(int cs, unsigned long size, unsigned long *base)
|
||||
{
|
||||
struct resource *res = &gpmc_cs_mem[cs];
|
||||
|
|
@ -535,7 +565,12 @@ int gpmc_cs_request(int cs, unsigned long size, unsigned long *base)
|
|||
if (r < 0)
|
||||
goto out;
|
||||
|
||||
gpmc_cs_enable_mem(cs, res->start, resource_size(res));
|
||||
r = gpmc_cs_enable_mem(cs, res->start, resource_size(res));
|
||||
if (r < 0) {
|
||||
release_resource(res);
|
||||
goto out;
|
||||
}
|
||||
|
||||
*base = res->start;
|
||||
gpmc_cs_set_reserved(cs, 1);
|
||||
out:
|
||||
|
|
@ -561,16 +596,14 @@ void gpmc_cs_free(int cs)
|
|||
EXPORT_SYMBOL(gpmc_cs_free);
|
||||
|
||||
/**
|
||||
* gpmc_cs_configure - write request to configure gpmc
|
||||
* @cs: chip select number
|
||||
* gpmc_configure - write request to configure gpmc
|
||||
* @cmd: command type
|
||||
* @wval: value to write
|
||||
* @return status of the operation
|
||||
*/
|
||||
int gpmc_cs_configure(int cs, int cmd, int wval)
|
||||
int gpmc_configure(int cmd, int wval)
|
||||
{
|
||||
int err = 0;
|
||||
u32 regval = 0;
|
||||
u32 regval;
|
||||
|
||||
switch (cmd) {
|
||||
case GPMC_ENABLE_IRQ:
|
||||
|
|
@ -590,43 +623,14 @@ int gpmc_cs_configure(int cs, int cmd, int wval)
|
|||
gpmc_write_reg(GPMC_CONFIG, regval);
|
||||
break;
|
||||
|
||||
case GPMC_CONFIG_RDY_BSY:
|
||||
regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
|
||||
if (wval)
|
||||
regval |= WR_RD_PIN_MONITORING;
|
||||
else
|
||||
regval &= ~WR_RD_PIN_MONITORING;
|
||||
gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval);
|
||||
break;
|
||||
|
||||
case GPMC_CONFIG_DEV_SIZE:
|
||||
regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
|
||||
|
||||
/* clear 2 target bits */
|
||||
regval &= ~GPMC_CONFIG1_DEVICESIZE(3);
|
||||
|
||||
/* set the proper value */
|
||||
regval |= GPMC_CONFIG1_DEVICESIZE(wval);
|
||||
|
||||
gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval);
|
||||
break;
|
||||
|
||||
case GPMC_CONFIG_DEV_TYPE:
|
||||
regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
|
||||
regval |= GPMC_CONFIG1_DEVICETYPE(wval);
|
||||
if (wval == GPMC_DEVICETYPE_NOR)
|
||||
regval |= GPMC_CONFIG1_MUXADDDATA;
|
||||
gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval);
|
||||
break;
|
||||
|
||||
default:
|
||||
printk(KERN_ERR "gpmc_configure_cs: Not supported\n");
|
||||
err = -EINVAL;
|
||||
pr_err("%s: command not supported\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(gpmc_cs_configure);
|
||||
EXPORT_SYMBOL(gpmc_configure);
|
||||
|
||||
void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs)
|
||||
{
|
||||
|
|
@ -716,7 +720,7 @@ static int gpmc_setup_irq(void)
|
|||
return -EINVAL;
|
||||
|
||||
gpmc_irq_start = irq_alloc_descs(-1, 0, GPMC_NR_IRQ, 0);
|
||||
if (IS_ERR_VALUE(gpmc_irq_start)) {
|
||||
if (gpmc_irq_start < 0) {
|
||||
pr_err("irq_alloc_descs failed\n");
|
||||
return gpmc_irq_start;
|
||||
}
|
||||
|
|
@ -781,16 +785,16 @@ static void gpmc_mem_exit(void)
|
|||
|
||||
}
|
||||
|
||||
static int gpmc_mem_init(void)
|
||||
static void gpmc_mem_init(void)
|
||||
{
|
||||
int cs, rc;
|
||||
unsigned long boot_rom_space = 0;
|
||||
int cs;
|
||||
|
||||
/* never allocate the first page, to facilitate bug detection;
|
||||
* even if we didn't boot from ROM.
|
||||
/*
|
||||
* The first 1MB of GPMC address space is typically mapped to
|
||||
* the internal ROM. Never allocate the first page, to
|
||||
* facilitate bug detection; even if we didn't boot from ROM.
|
||||
*/
|
||||
boot_rom_space = BOOT_ROM_SPACE;
|
||||
gpmc_mem_root.start = GPMC_MEM_START + boot_rom_space;
|
||||
gpmc_mem_root.start = SZ_1M;
|
||||
gpmc_mem_root.end = GPMC_MEM_END;
|
||||
|
||||
/* Reserve all regions that has been set up by bootloader */
|
||||
|
|
@ -800,16 +804,12 @@ static int gpmc_mem_init(void)
|
|||
if (!gpmc_cs_mem_enabled(cs))
|
||||
continue;
|
||||
gpmc_cs_get_memconf(cs, &base, &size);
|
||||
rc = gpmc_cs_insert_mem(cs, base, size);
|
||||
if (IS_ERR_VALUE(rc)) {
|
||||
while (--cs >= 0)
|
||||
if (gpmc_cs_mem_enabled(cs))
|
||||
gpmc_cs_delete_mem(cs);
|
||||
return rc;
|
||||
if (gpmc_cs_insert_mem(cs, base, size)) {
|
||||
pr_warn("%s: disabling cs %d mapped at 0x%x-0x%x\n",
|
||||
__func__, cs, base, base + size);
|
||||
gpmc_cs_disable_mem(cs);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u32 gpmc_round_ps_to_sync_clk(u32 time_ps, u32 sync_clk)
|
||||
|
|
@ -825,9 +825,9 @@ static u32 gpmc_round_ps_to_sync_clk(u32 time_ps, u32 sync_clk)
|
|||
|
||||
/* XXX: can the cycles be avoided ? */
|
||||
static int gpmc_calc_sync_read_timings(struct gpmc_timings *gpmc_t,
|
||||
struct gpmc_device_timings *dev_t)
|
||||
struct gpmc_device_timings *dev_t,
|
||||
bool mux)
|
||||
{
|
||||
bool mux = dev_t->mux;
|
||||
u32 temp;
|
||||
|
||||
/* adv_rd_off */
|
||||
|
|
@ -880,9 +880,9 @@ static int gpmc_calc_sync_read_timings(struct gpmc_timings *gpmc_t,
|
|||
}
|
||||
|
||||
static int gpmc_calc_sync_write_timings(struct gpmc_timings *gpmc_t,
|
||||
struct gpmc_device_timings *dev_t)
|
||||
struct gpmc_device_timings *dev_t,
|
||||
bool mux)
|
||||
{
|
||||
bool mux = dev_t->mux;
|
||||
u32 temp;
|
||||
|
||||
/* adv_wr_off */
|
||||
|
|
@ -942,9 +942,9 @@ static int gpmc_calc_sync_write_timings(struct gpmc_timings *gpmc_t,
|
|||
}
|
||||
|
||||
static int gpmc_calc_async_read_timings(struct gpmc_timings *gpmc_t,
|
||||
struct gpmc_device_timings *dev_t)
|
||||
struct gpmc_device_timings *dev_t,
|
||||
bool mux)
|
||||
{
|
||||
bool mux = dev_t->mux;
|
||||
u32 temp;
|
||||
|
||||
/* adv_rd_off */
|
||||
|
|
@ -982,9 +982,9 @@ static int gpmc_calc_async_read_timings(struct gpmc_timings *gpmc_t,
|
|||
}
|
||||
|
||||
static int gpmc_calc_async_write_timings(struct gpmc_timings *gpmc_t,
|
||||
struct gpmc_device_timings *dev_t)
|
||||
struct gpmc_device_timings *dev_t,
|
||||
bool mux)
|
||||
{
|
||||
bool mux = dev_t->mux;
|
||||
u32 temp;
|
||||
|
||||
/* adv_wr_off */
|
||||
|
|
@ -1054,7 +1054,8 @@ static int gpmc_calc_sync_common_timings(struct gpmc_timings *gpmc_t,
|
|||
}
|
||||
|
||||
static int gpmc_calc_common_timings(struct gpmc_timings *gpmc_t,
|
||||
struct gpmc_device_timings *dev_t)
|
||||
struct gpmc_device_timings *dev_t,
|
||||
bool sync)
|
||||
{
|
||||
u32 temp;
|
||||
|
||||
|
|
@ -1068,7 +1069,7 @@ static int gpmc_calc_common_timings(struct gpmc_timings *gpmc_t,
|
|||
gpmc_t->cs_on + dev_t->t_ce_avd);
|
||||
gpmc_t->adv_on = gpmc_round_ps_to_ticks(temp);
|
||||
|
||||
if (dev_t->sync_write || dev_t->sync_read)
|
||||
if (sync)
|
||||
gpmc_calc_sync_common_timings(gpmc_t, dev_t);
|
||||
|
||||
return 0;
|
||||
|
|
@ -1103,21 +1104,29 @@ static void gpmc_convert_ps_to_ns(struct gpmc_timings *t)
|
|||
}
|
||||
|
||||
int gpmc_calc_timings(struct gpmc_timings *gpmc_t,
|
||||
struct gpmc_device_timings *dev_t)
|
||||
struct gpmc_settings *gpmc_s,
|
||||
struct gpmc_device_timings *dev_t)
|
||||
{
|
||||
bool mux = false, sync = false;
|
||||
|
||||
if (gpmc_s) {
|
||||
mux = gpmc_s->mux_add_data ? true : false;
|
||||
sync = (gpmc_s->sync_read || gpmc_s->sync_write);
|
||||
}
|
||||
|
||||
memset(gpmc_t, 0, sizeof(*gpmc_t));
|
||||
|
||||
gpmc_calc_common_timings(gpmc_t, dev_t);
|
||||
gpmc_calc_common_timings(gpmc_t, dev_t, sync);
|
||||
|
||||
if (dev_t->sync_read)
|
||||
gpmc_calc_sync_read_timings(gpmc_t, dev_t);
|
||||
if (gpmc_s && gpmc_s->sync_read)
|
||||
gpmc_calc_sync_read_timings(gpmc_t, dev_t, mux);
|
||||
else
|
||||
gpmc_calc_async_read_timings(gpmc_t, dev_t);
|
||||
gpmc_calc_async_read_timings(gpmc_t, dev_t, mux);
|
||||
|
||||
if (dev_t->sync_write)
|
||||
gpmc_calc_sync_write_timings(gpmc_t, dev_t);
|
||||
if (gpmc_s && gpmc_s->sync_write)
|
||||
gpmc_calc_sync_write_timings(gpmc_t, dev_t, mux);
|
||||
else
|
||||
gpmc_calc_async_write_timings(gpmc_t, dev_t);
|
||||
gpmc_calc_async_write_timings(gpmc_t, dev_t, mux);
|
||||
|
||||
/* TODO: remove, see function definition */
|
||||
gpmc_convert_ps_to_ns(gpmc_t);
|
||||
|
|
@ -1125,6 +1134,90 @@ int gpmc_calc_timings(struct gpmc_timings *gpmc_t,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* gpmc_cs_program_settings - programs non-timing related settings
|
||||
* @cs: GPMC chip-select to program
|
||||
* @p: pointer to GPMC settings structure
|
||||
*
|
||||
* Programs non-timing related settings for a GPMC chip-select, such as
|
||||
* bus-width, burst configuration, etc. Function should be called once
|
||||
* for each chip-select that is being used and must be called before
|
||||
* calling gpmc_cs_set_timings() as timing parameters in the CONFIG1
|
||||
* register will be initialised to zero by this function. Returns 0 on
|
||||
* success and appropriate negative error code on failure.
|
||||
*/
|
||||
int gpmc_cs_program_settings(int cs, struct gpmc_settings *p)
|
||||
{
|
||||
u32 config1;
|
||||
|
||||
if ((!p->device_width) || (p->device_width > GPMC_DEVWIDTH_16BIT)) {
|
||||
pr_err("%s: invalid width %d!", __func__, p->device_width);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Address-data multiplexing not supported for NAND devices */
|
||||
if (p->device_nand && p->mux_add_data) {
|
||||
pr_err("%s: invalid configuration!\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ((p->mux_add_data > GPMC_MUX_AD) ||
|
||||
((p->mux_add_data == GPMC_MUX_AAD) &&
|
||||
!(gpmc_capability & GPMC_HAS_MUX_AAD))) {
|
||||
pr_err("%s: invalid multiplex configuration!\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Page/burst mode supports lengths of 4, 8 and 16 bytes */
|
||||
if (p->burst_read || p->burst_write) {
|
||||
switch (p->burst_len) {
|
||||
case GPMC_BURST_4:
|
||||
case GPMC_BURST_8:
|
||||
case GPMC_BURST_16:
|
||||
break;
|
||||
default:
|
||||
pr_err("%s: invalid page/burst-length (%d)\n",
|
||||
__func__, p->burst_len);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
if ((p->wait_on_read || p->wait_on_write) &&
|
||||
(p->wait_pin > gpmc_nr_waitpins)) {
|
||||
pr_err("%s: invalid wait-pin (%d)\n", __func__, p->wait_pin);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
config1 = GPMC_CONFIG1_DEVICESIZE((p->device_width - 1));
|
||||
|
||||
if (p->sync_read)
|
||||
config1 |= GPMC_CONFIG1_READTYPE_SYNC;
|
||||
if (p->sync_write)
|
||||
config1 |= GPMC_CONFIG1_WRITETYPE_SYNC;
|
||||
if (p->wait_on_read)
|
||||
config1 |= GPMC_CONFIG1_WAIT_READ_MON;
|
||||
if (p->wait_on_write)
|
||||
config1 |= GPMC_CONFIG1_WAIT_WRITE_MON;
|
||||
if (p->wait_on_read || p->wait_on_write)
|
||||
config1 |= GPMC_CONFIG1_WAIT_PIN_SEL(p->wait_pin);
|
||||
if (p->device_nand)
|
||||
config1 |= GPMC_CONFIG1_DEVICETYPE(GPMC_DEVICETYPE_NAND);
|
||||
if (p->mux_add_data)
|
||||
config1 |= GPMC_CONFIG1_MUXTYPE(p->mux_add_data);
|
||||
if (p->burst_read)
|
||||
config1 |= GPMC_CONFIG1_READMULTIPLE_SUPP;
|
||||
if (p->burst_write)
|
||||
config1 |= GPMC_CONFIG1_WRITEMULTIPLE_SUPP;
|
||||
if (p->burst_read || p->burst_write) {
|
||||
config1 |= GPMC_CONFIG1_PAGE_LEN(p->burst_len >> 3);
|
||||
config1 |= p->burst_wrap ? GPMC_CONFIG1_WRAPBURST_SUPP : 0;
|
||||
}
|
||||
|
||||
gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, config1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
static struct of_device_id gpmc_dt_ids[] = {
|
||||
{ .compatible = "ti,omap2420-gpmc" },
|
||||
|
|
@ -1136,70 +1229,110 @@ static struct of_device_id gpmc_dt_ids[] = {
|
|||
};
|
||||
MODULE_DEVICE_TABLE(of, gpmc_dt_ids);
|
||||
|
||||
/**
|
||||
* gpmc_read_settings_dt - read gpmc settings from device-tree
|
||||
* @np: pointer to device-tree node for a gpmc child device
|
||||
* @p: pointer to gpmc settings structure
|
||||
*
|
||||
* Reads the GPMC settings for a GPMC child device from device-tree and
|
||||
* stores them in the GPMC settings structure passed. The GPMC settings
|
||||
* structure is initialised to zero by this function and so any
|
||||
* previously stored settings will be cleared.
|
||||
*/
|
||||
void gpmc_read_settings_dt(struct device_node *np, struct gpmc_settings *p)
|
||||
{
|
||||
memset(p, 0, sizeof(struct gpmc_settings));
|
||||
|
||||
p->sync_read = of_property_read_bool(np, "gpmc,sync-read");
|
||||
p->sync_write = of_property_read_bool(np, "gpmc,sync-write");
|
||||
p->device_nand = of_property_read_bool(np, "gpmc,device-nand");
|
||||
of_property_read_u32(np, "gpmc,device-width", &p->device_width);
|
||||
of_property_read_u32(np, "gpmc,mux-add-data", &p->mux_add_data);
|
||||
|
||||
if (!of_property_read_u32(np, "gpmc,burst-length", &p->burst_len)) {
|
||||
p->burst_wrap = of_property_read_bool(np, "gpmc,burst-wrap");
|
||||
p->burst_read = of_property_read_bool(np, "gpmc,burst-read");
|
||||
p->burst_write = of_property_read_bool(np, "gpmc,burst-write");
|
||||
if (!p->burst_read && !p->burst_write)
|
||||
pr_warn("%s: page/burst-length set but not used!\n",
|
||||
__func__);
|
||||
}
|
||||
|
||||
if (!of_property_read_u32(np, "gpmc,wait-pin", &p->wait_pin)) {
|
||||
p->wait_on_read = of_property_read_bool(np,
|
||||
"gpmc,wait-on-read");
|
||||
p->wait_on_write = of_property_read_bool(np,
|
||||
"gpmc,wait-on-write");
|
||||
if (!p->wait_on_read && !p->wait_on_write)
|
||||
pr_warn("%s: read/write wait monitoring not enabled!\n",
|
||||
__func__);
|
||||
}
|
||||
}
|
||||
|
||||
static void __maybe_unused gpmc_read_timings_dt(struct device_node *np,
|
||||
struct gpmc_timings *gpmc_t)
|
||||
{
|
||||
u32 val;
|
||||
struct gpmc_bool_timings *p;
|
||||
|
||||
if (!np || !gpmc_t)
|
||||
return;
|
||||
|
||||
memset(gpmc_t, 0, sizeof(*gpmc_t));
|
||||
|
||||
/* minimum clock period for syncronous mode */
|
||||
if (!of_property_read_u32(np, "gpmc,sync-clk", &val))
|
||||
gpmc_t->sync_clk = val;
|
||||
of_property_read_u32(np, "gpmc,sync-clk-ps", &gpmc_t->sync_clk);
|
||||
|
||||
/* chip select timtings */
|
||||
if (!of_property_read_u32(np, "gpmc,cs-on", &val))
|
||||
gpmc_t->cs_on = val;
|
||||
|
||||
if (!of_property_read_u32(np, "gpmc,cs-rd-off", &val))
|
||||
gpmc_t->cs_rd_off = val;
|
||||
|
||||
if (!of_property_read_u32(np, "gpmc,cs-wr-off", &val))
|
||||
gpmc_t->cs_wr_off = val;
|
||||
of_property_read_u32(np, "gpmc,cs-on-ns", &gpmc_t->cs_on);
|
||||
of_property_read_u32(np, "gpmc,cs-rd-off-ns", &gpmc_t->cs_rd_off);
|
||||
of_property_read_u32(np, "gpmc,cs-wr-off-ns", &gpmc_t->cs_wr_off);
|
||||
|
||||
/* ADV signal timings */
|
||||
if (!of_property_read_u32(np, "gpmc,adv-on", &val))
|
||||
gpmc_t->adv_on = val;
|
||||
|
||||
if (!of_property_read_u32(np, "gpmc,adv-rd-off", &val))
|
||||
gpmc_t->adv_rd_off = val;
|
||||
|
||||
if (!of_property_read_u32(np, "gpmc,adv-wr-off", &val))
|
||||
gpmc_t->adv_wr_off = val;
|
||||
of_property_read_u32(np, "gpmc,adv-on-ns", &gpmc_t->adv_on);
|
||||
of_property_read_u32(np, "gpmc,adv-rd-off-ns", &gpmc_t->adv_rd_off);
|
||||
of_property_read_u32(np, "gpmc,adv-wr-off-ns", &gpmc_t->adv_wr_off);
|
||||
|
||||
/* WE signal timings */
|
||||
if (!of_property_read_u32(np, "gpmc,we-on", &val))
|
||||
gpmc_t->we_on = val;
|
||||
|
||||
if (!of_property_read_u32(np, "gpmc,we-off", &val))
|
||||
gpmc_t->we_off = val;
|
||||
of_property_read_u32(np, "gpmc,we-on-ns", &gpmc_t->we_on);
|
||||
of_property_read_u32(np, "gpmc,we-off-ns", &gpmc_t->we_off);
|
||||
|
||||
/* OE signal timings */
|
||||
if (!of_property_read_u32(np, "gpmc,oe-on", &val))
|
||||
gpmc_t->oe_on = val;
|
||||
|
||||
if (!of_property_read_u32(np, "gpmc,oe-off", &val))
|
||||
gpmc_t->oe_off = val;
|
||||
of_property_read_u32(np, "gpmc,oe-on-ns", &gpmc_t->oe_on);
|
||||
of_property_read_u32(np, "gpmc,oe-off-ns", &gpmc_t->oe_off);
|
||||
|
||||
/* access and cycle timings */
|
||||
if (!of_property_read_u32(np, "gpmc,page-burst-access", &val))
|
||||
gpmc_t->page_burst_access = val;
|
||||
of_property_read_u32(np, "gpmc,page-burst-access-ns",
|
||||
&gpmc_t->page_burst_access);
|
||||
of_property_read_u32(np, "gpmc,access-ns", &gpmc_t->access);
|
||||
of_property_read_u32(np, "gpmc,rd-cycle-ns", &gpmc_t->rd_cycle);
|
||||
of_property_read_u32(np, "gpmc,wr-cycle-ns", &gpmc_t->wr_cycle);
|
||||
of_property_read_u32(np, "gpmc,bus-turnaround-ns",
|
||||
&gpmc_t->bus_turnaround);
|
||||
of_property_read_u32(np, "gpmc,cycle2cycle-delay-ns",
|
||||
&gpmc_t->cycle2cycle_delay);
|
||||
of_property_read_u32(np, "gpmc,wait-monitoring-ns",
|
||||
&gpmc_t->wait_monitoring);
|
||||
of_property_read_u32(np, "gpmc,clk-activation-ns",
|
||||
&gpmc_t->clk_activation);
|
||||
|
||||
if (!of_property_read_u32(np, "gpmc,access", &val))
|
||||
gpmc_t->access = val;
|
||||
/* only applicable to OMAP3+ */
|
||||
of_property_read_u32(np, "gpmc,wr-access-ns", &gpmc_t->wr_access);
|
||||
of_property_read_u32(np, "gpmc,wr-data-mux-bus-ns",
|
||||
&gpmc_t->wr_data_mux_bus);
|
||||
|
||||
if (!of_property_read_u32(np, "gpmc,rd-cycle", &val))
|
||||
gpmc_t->rd_cycle = val;
|
||||
/* bool timing parameters */
|
||||
p = &gpmc_t->bool_timings;
|
||||
|
||||
if (!of_property_read_u32(np, "gpmc,wr-cycle", &val))
|
||||
gpmc_t->wr_cycle = val;
|
||||
|
||||
/* only for OMAP3430 */
|
||||
if (!of_property_read_u32(np, "gpmc,wr-access", &val))
|
||||
gpmc_t->wr_access = val;
|
||||
|
||||
if (!of_property_read_u32(np, "gpmc,wr-data-mux-bus", &val))
|
||||
gpmc_t->wr_data_mux_bus = val;
|
||||
p->cycle2cyclediffcsen =
|
||||
of_property_read_bool(np, "gpmc,cycle2cycle-diffcsen");
|
||||
p->cycle2cyclesamecsen =
|
||||
of_property_read_bool(np, "gpmc,cycle2cycle-samecsen");
|
||||
p->we_extra_delay = of_property_read_bool(np, "gpmc,we-extra-delay");
|
||||
p->oe_extra_delay = of_property_read_bool(np, "gpmc,oe-extra-delay");
|
||||
p->adv_extra_delay = of_property_read_bool(np, "gpmc,adv-extra-delay");
|
||||
p->cs_extra_delay = of_property_read_bool(np, "gpmc,cs-extra-delay");
|
||||
p->time_para_granularity =
|
||||
of_property_read_bool(np, "gpmc,time-para-granularity");
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MTD_NAND
|
||||
|
|
@ -1295,6 +1428,81 @@ static int gpmc_probe_onenand_child(struct platform_device *pdev,
|
|||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* gpmc_probe_generic_child - configures the gpmc for a child device
|
||||
* @pdev: pointer to gpmc platform device
|
||||
* @child: pointer to device-tree node for child device
|
||||
*
|
||||
* Allocates and configures a GPMC chip-select for a child device.
|
||||
* Returns 0 on success and appropriate negative error code on failure.
|
||||
*/
|
||||
static int gpmc_probe_generic_child(struct platform_device *pdev,
|
||||
struct device_node *child)
|
||||
{
|
||||
struct gpmc_settings gpmc_s;
|
||||
struct gpmc_timings gpmc_t;
|
||||
struct resource res;
|
||||
unsigned long base;
|
||||
int ret, cs;
|
||||
|
||||
if (of_property_read_u32(child, "reg", &cs) < 0) {
|
||||
dev_err(&pdev->dev, "%s has no 'reg' property\n",
|
||||
child->full_name);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (of_address_to_resource(child, 0, &res) < 0) {
|
||||
dev_err(&pdev->dev, "%s has malformed 'reg' property\n",
|
||||
child->full_name);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
ret = gpmc_cs_request(cs, resource_size(&res), &base);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "cannot request GPMC CS %d\n", cs);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* FIXME: gpmc_cs_request() will map the CS to an arbitary
|
||||
* location in the gpmc address space. When booting with
|
||||
* device-tree we want the NOR flash to be mapped to the
|
||||
* location specified in the device-tree blob. So remap the
|
||||
* CS to this location. Once DT migration is complete should
|
||||
* just make gpmc_cs_request() map a specific address.
|
||||
*/
|
||||
ret = gpmc_cs_remap(cs, res.start);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "cannot remap GPMC CS %d to 0x%x\n",
|
||||
cs, res.start);
|
||||
goto err;
|
||||
}
|
||||
|
||||
gpmc_read_settings_dt(child, &gpmc_s);
|
||||
|
||||
ret = of_property_read_u32(child, "bank-width", &gpmc_s.device_width);
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
ret = gpmc_cs_program_settings(cs, &gpmc_s);
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
gpmc_read_timings_dt(child, &gpmc_t);
|
||||
gpmc_cs_set_timings(cs, &gpmc_t);
|
||||
|
||||
if (of_platform_device_create(child, NULL, &pdev->dev))
|
||||
return 0;
|
||||
|
||||
dev_err(&pdev->dev, "failed to create gpmc child %s\n", child->name);
|
||||
ret = -ENODEV;
|
||||
|
||||
err:
|
||||
gpmc_cs_free(cs);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int gpmc_probe_dt(struct platform_device *pdev)
|
||||
{
|
||||
int ret;
|
||||
|
|
@ -1305,6 +1513,13 @@ static int gpmc_probe_dt(struct platform_device *pdev)
|
|||
if (!of_id)
|
||||
return 0;
|
||||
|
||||
ret = of_property_read_u32(pdev->dev.of_node, "gpmc,num-waitpins",
|
||||
&gpmc_nr_waitpins);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: number of wait pins not found!\n", __func__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
for_each_node_by_name(child, "nand") {
|
||||
ret = gpmc_probe_nand_child(pdev, child);
|
||||
if (ret < 0) {
|
||||
|
|
@ -1320,6 +1535,23 @@ static int gpmc_probe_dt(struct platform_device *pdev)
|
|||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
for_each_node_by_name(child, "nor") {
|
||||
ret = gpmc_probe_generic_child(pdev, child);
|
||||
if (ret < 0) {
|
||||
of_node_put(child);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
for_each_node_by_name(child, "ethernet") {
|
||||
ret = gpmc_probe_generic_child(pdev, child);
|
||||
if (ret < 0) {
|
||||
of_node_put(child);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
|
|
@ -1364,25 +1596,37 @@ static int gpmc_probe(struct platform_device *pdev)
|
|||
gpmc_dev = &pdev->dev;
|
||||
|
||||
l = gpmc_read_reg(GPMC_REVISION);
|
||||
|
||||
/*
|
||||
* FIXME: Once device-tree migration is complete the below flags
|
||||
* should be populated based upon the device-tree compatible
|
||||
* string. For now just use the IP revision. OMAP3+ devices have
|
||||
* the wr_access and wr_data_mux_bus register fields. OMAP4+
|
||||
* devices support the addr-addr-data multiplex protocol.
|
||||
*
|
||||
* GPMC IP revisions:
|
||||
* - OMAP24xx = 2.0
|
||||
* - OMAP3xxx = 5.0
|
||||
* - OMAP44xx/54xx/AM335x = 6.0
|
||||
*/
|
||||
if (GPMC_REVISION_MAJOR(l) > 0x4)
|
||||
gpmc_capability = GPMC_HAS_WR_ACCESS | GPMC_HAS_WR_DATA_MUX_BUS;
|
||||
if (GPMC_REVISION_MAJOR(l) > 0x5)
|
||||
gpmc_capability |= GPMC_HAS_MUX_AAD;
|
||||
dev_info(gpmc_dev, "GPMC revision %d.%d\n", GPMC_REVISION_MAJOR(l),
|
||||
GPMC_REVISION_MINOR(l));
|
||||
|
||||
rc = gpmc_mem_init();
|
||||
if (IS_ERR_VALUE(rc)) {
|
||||
clk_disable_unprepare(gpmc_l3_clk);
|
||||
clk_put(gpmc_l3_clk);
|
||||
dev_err(gpmc_dev, "failed to reserve memory\n");
|
||||
return rc;
|
||||
}
|
||||
gpmc_mem_init();
|
||||
|
||||
if (IS_ERR_VALUE(gpmc_setup_irq()))
|
||||
if (gpmc_setup_irq() < 0)
|
||||
dev_warn(gpmc_dev, "gpmc_setup_irq failed\n");
|
||||
|
||||
/* Now the GPMC is initialised, unreserve the chip-selects */
|
||||
gpmc_cs_map = 0;
|
||||
|
||||
if (!pdev->dev.of_node)
|
||||
gpmc_nr_waitpins = GPMC_NR_WAITPINS;
|
||||
|
||||
rc = gpmc_probe_dt(pdev);
|
||||
if (rc < 0) {
|
||||
clk_disable_unprepare(gpmc_l3_clk);
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
#define GPMC_CONFIG1_DEVICESIZE_16 GPMC_CONFIG1_DEVICESIZE(1)
|
||||
#define GPMC_CONFIG1_DEVICETYPE(val) ((val & 3) << 10)
|
||||
#define GPMC_CONFIG1_DEVICETYPE_NOR GPMC_CONFIG1_DEVICETYPE(0)
|
||||
#define GPMC_CONFIG1_MUXADDDATA (1 << 9)
|
||||
#define GPMC_CONFIG1_MUXTYPE(val) ((val & 3) << 8)
|
||||
#define GPMC_CONFIG1_TIME_PARA_GRAN (1 << 4)
|
||||
#define GPMC_CONFIG1_FCLK_DIV(val) (val & 3)
|
||||
#define GPMC_CONFIG1_FCLK_DIV2 (GPMC_CONFIG1_FCLK_DIV(1))
|
||||
|
|
@ -73,6 +73,13 @@
|
|||
#define GPMC_IRQ_FIFOEVENTENABLE 0x01
|
||||
#define GPMC_IRQ_COUNT_EVENT 0x02
|
||||
|
||||
#define GPMC_BURST_4 4 /* 4 word burst */
|
||||
#define GPMC_BURST_8 8 /* 8 word burst */
|
||||
#define GPMC_BURST_16 16 /* 16 word burst */
|
||||
#define GPMC_DEVWIDTH_8BIT 1 /* 8-bit device width */
|
||||
#define GPMC_DEVWIDTH_16BIT 2 /* 16-bit device width */
|
||||
#define GPMC_MUX_AAD 1 /* Addr-Addr-Data multiplex */
|
||||
#define GPMC_MUX_AD 2 /* Addr-Data multiplex */
|
||||
|
||||
/* bool type time settings */
|
||||
struct gpmc_bool_timings {
|
||||
|
|
@ -178,10 +185,6 @@ struct gpmc_device_timings {
|
|||
u8 cyc_wpl; /* write deassertion time in cycles */
|
||||
u32 cyc_iaa; /* initial access time in cycles */
|
||||
|
||||
bool mux; /* address & data muxed */
|
||||
bool sync_write;/* synchronous write */
|
||||
bool sync_read; /* synchronous read */
|
||||
|
||||
/* extra delays */
|
||||
bool ce_xdelay;
|
||||
bool avd_xdelay;
|
||||
|
|
@ -189,28 +192,40 @@ struct gpmc_device_timings {
|
|||
bool we_xdelay;
|
||||
};
|
||||
|
||||
struct gpmc_settings {
|
||||
bool burst_wrap; /* enables wrap bursting */
|
||||
bool burst_read; /* enables read page/burst mode */
|
||||
bool burst_write; /* enables write page/burst mode */
|
||||
bool device_nand; /* device is NAND */
|
||||
bool sync_read; /* enables synchronous reads */
|
||||
bool sync_write; /* enables synchronous writes */
|
||||
bool wait_on_read; /* monitor wait on reads */
|
||||
bool wait_on_write; /* monitor wait on writes */
|
||||
u32 burst_len; /* page/burst length */
|
||||
u32 device_width; /* device bus width (8 or 16 bit) */
|
||||
u32 mux_add_data; /* multiplex address & data */
|
||||
u32 wait_pin; /* wait-pin to be used */
|
||||
};
|
||||
|
||||
extern int gpmc_calc_timings(struct gpmc_timings *gpmc_t,
|
||||
struct gpmc_device_timings *dev_t);
|
||||
struct gpmc_settings *gpmc_s,
|
||||
struct gpmc_device_timings *dev_t);
|
||||
|
||||
extern void gpmc_update_nand_reg(struct gpmc_nand_regs *reg, int cs);
|
||||
extern int gpmc_get_client_irq(unsigned irq_config);
|
||||
|
||||
extern unsigned int gpmc_ns_to_ticks(unsigned int time_ns);
|
||||
extern unsigned int gpmc_ps_to_ticks(unsigned int time_ps);
|
||||
extern unsigned int gpmc_ticks_to_ns(unsigned int ticks);
|
||||
extern unsigned int gpmc_round_ns_to_ticks(unsigned int time_ns);
|
||||
extern unsigned long gpmc_get_fclk_period(void);
|
||||
|
||||
extern void gpmc_cs_write_reg(int cs, int idx, u32 val);
|
||||
extern u32 gpmc_cs_read_reg(int cs, int idx);
|
||||
extern int gpmc_calc_divider(unsigned int sync_clk);
|
||||
extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t);
|
||||
extern int gpmc_cs_program_settings(int cs, struct gpmc_settings *p);
|
||||
extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base);
|
||||
extern void gpmc_cs_free(int cs);
|
||||
extern int gpmc_cs_set_reserved(int cs, int reserved);
|
||||
extern int gpmc_cs_reserved(int cs);
|
||||
extern void omap3_gpmc_save_context(void);
|
||||
extern void omap3_gpmc_restore_context(void);
|
||||
extern int gpmc_cs_configure(int cs, int cmd, int wval);
|
||||
extern int gpmc_configure(int cmd, int wval);
|
||||
extern void gpmc_read_settings_dt(struct device_node *np,
|
||||
struct gpmc_settings *p);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
|
|||
int oh_cnt, i, ret = 0;
|
||||
|
||||
oh_cnt = of_property_count_strings(node, "ti,hwmods");
|
||||
if (!oh_cnt || IS_ERR_VALUE(oh_cnt)) {
|
||||
if (oh_cnt <= 0) {
|
||||
dev_dbg(&pdev->dev, "No 'hwmods' to build omap_device\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
|
@ -815,20 +815,17 @@ struct device *omap_device_get_by_hwmod_name(const char *oh_name)
|
|||
}
|
||||
|
||||
oh = omap_hwmod_lookup(oh_name);
|
||||
if (IS_ERR_OR_NULL(oh)) {
|
||||
if (!oh) {
|
||||
WARN(1, "%s: no hwmod for %s\n", __func__,
|
||||
oh_name);
|
||||
return ERR_PTR(oh ? PTR_ERR(oh) : -ENODEV);
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
if (IS_ERR_OR_NULL(oh->od)) {
|
||||
if (!oh->od) {
|
||||
WARN(1, "%s: no omap_device for %s\n", __func__,
|
||||
oh_name);
|
||||
return ERR_PTR(oh->od ? PTR_ERR(oh->od) : -ENODEV);
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
if (IS_ERR_OR_NULL(oh->od->pdev))
|
||||
return ERR_PTR(oh->od->pdev ? PTR_ERR(oh->od->pdev) : -ENODEV);
|
||||
|
||||
return &oh->od->pdev->dev;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1662,7 +1662,7 @@ static int _deassert_hardreset(struct omap_hwmod *oh, const char *name)
|
|||
return -ENOSYS;
|
||||
|
||||
ret = _lookup_hardreset(oh, name, &ohri);
|
||||
if (IS_ERR_VALUE(ret))
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (oh->clkdm) {
|
||||
|
|
@ -2412,7 +2412,7 @@ static int __init _init(struct omap_hwmod *oh, void *data)
|
|||
_init_mpu_rt_base(oh, NULL);
|
||||
|
||||
r = _init_clocks(oh, NULL);
|
||||
if (IS_ERR_VALUE(r)) {
|
||||
if (r < 0) {
|
||||
WARN(1, "omap_hwmod: %s: couldn't init clocks\n", oh->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue