Commit dab71939 authored by Olof Johansson's avatar Olof Johansson

Merge tag 'ux500-devicetree-v3.14-1' of...

Merge tag 'ux500-devicetree-v3.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson into next/dt

From Linus Walleij:

Ux500 device tree patches for v3.14, take one:

- Fix up tc3589x bindings so this chip works again.

- Remove SSP platform devices, as we now boot from device tree
  exclusively.

- Delete surplus AB8500/DB8500 platform data, not obtained from
  the device tree.

- Add DMA config for the MSP devices.

- A series of 21 patches moving pin control config for the
  on-chip Nomadik pin controller from the board file
  to the device tree, step by step.

- Two patches to the STE DMA40 driver regarding the high-prio
  DMA channel so this can be moved to the device tree. Both have
  Vinod's ACK.

- Decommission of the non-device tree boot path for the timer
  initialization code.

- Deletion of the non-devicetree probe path from the MTU timer
  driver, as all platforms using it are now using device tree.
  This has Daniel Lezcano's ACK.

* tag 'ux500-devicetree-v3.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson: (39 commits)
  ARM: ux500: decomission custom SMP TWD timer init
  clksrc: delete nomadik MTU non-DT boot path
  ARM: ux500: decomission the non-DT MTU init sequence
  dma: ste_dma40: Parse flags property for new 'high priority channel' request
  dma: ste_dma40: Expand DT binding to accept 'high-priority channel' flag
  ARM: ux500: Remove checking for DT during timer init
  ARM: ux500: Clean-up legacy extern prototype
  ARM: ux500: Remove unused call to register AMBA devices
  ARM: ux500: Clean-up non-DT IRQ initialisation
  pinctrl: nomadik: decomission non-DT boot path
  pinctrl: nomadik: move platform data handling into driver
  ARM: ux500: get rid of unused header
  ARM: ux500: delete Nomadik pinctrl AUXDATA
  ARM: ux500: delete remnant pin config macros
  ARM: ux500: move snowball pin configs to device tree
  ARM: ux500: move snowball LED pin control to device tree
  ARM: ux500: convert Snowball SPI pin reference
  ARM: ux500: move snowball ethernet config to device tree
  ARM: ux500: move HREFv60plus pin configs to device tree
  ARM: ux500: move final HREFv60 LCD pins to device tree
  ...
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents dc1ccc48 089b5c95
...@@ -50,6 +50,9 @@ Each dmas request consists of 4 cells: ...@@ -50,6 +50,9 @@ Each dmas request consists of 4 cells:
0x00000008: Use fixed channel: 0x00000008: Use fixed channel:
Use automatic channel selection when unset Use automatic channel selection when unset
Use DMA request line number when set Use DMA request line number when set
0x00000010: Set channel as high priority:
Normal priority when unset
High priority when set
Example: Example:
......
...@@ -913,6 +913,10 @@ msp0: msp@80123000 { ...@@ -913,6 +913,10 @@ msp0: msp@80123000 {
interrupts = <0 31 IRQ_TYPE_LEVEL_HIGH>; interrupts = <0 31 IRQ_TYPE_LEVEL_HIGH>;
v-ape-supply = <&db8500_vape_reg>; v-ape-supply = <&db8500_vape_reg>;
dmas = <&dma 31 0 0x12>, /* Logical - DevToMem - HighPrio */
<&dma 31 0 0x10>; /* Logical - MemToDev - HighPrio */
dma-names = "rx", "tx";
clocks = <&prcc_kclk 1 3>, <&prcc_pclk 1 3>; clocks = <&prcc_kclk 1 3>, <&prcc_pclk 1 3>;
clock-names = "msp", "apb_pclk"; clock-names = "msp", "apb_pclk";
...@@ -925,6 +929,9 @@ msp1: msp@80124000 { ...@@ -925,6 +929,9 @@ msp1: msp@80124000 {
interrupts = <0 62 IRQ_TYPE_LEVEL_HIGH>; interrupts = <0 62 IRQ_TYPE_LEVEL_HIGH>;
v-ape-supply = <&db8500_vape_reg>; v-ape-supply = <&db8500_vape_reg>;
dmas = <&dma 30 0 0x10>; /* Logical - MemToDev - HighPrio */
dma-names = "tx";
clocks = <&prcc_kclk 1 4>, <&prcc_pclk 1 4>; clocks = <&prcc_kclk 1 4>, <&prcc_pclk 1 4>;
clock-names = "msp", "apb_pclk"; clock-names = "msp", "apb_pclk";
...@@ -938,6 +945,11 @@ msp2: msp@80117000 { ...@@ -938,6 +945,11 @@ msp2: msp@80117000 {
interrupts = <0 98 IRQ_TYPE_LEVEL_HIGH>; interrupts = <0 98 IRQ_TYPE_LEVEL_HIGH>;
v-ape-supply = <&db8500_vape_reg>; v-ape-supply = <&db8500_vape_reg>;
dmas = <&dma 14 0 0x12>, /* Logical - DevToMem - HighPrio */
<&dma 14 1 0x19>; /* Physical Chan 1 - MemToDev
HighPrio - Fixed */
dma-names = "rx", "tx";
clocks = <&prcc_kclk 2 3>, <&prcc_pclk 2 5>; clocks = <&prcc_kclk 2 3>, <&prcc_pclk 2 5>;
clock-names = "msp", "apb_pclk"; clock-names = "msp", "apb_pclk";
...@@ -950,6 +962,9 @@ msp3: msp@80125000 { ...@@ -950,6 +962,9 @@ msp3: msp@80125000 {
interrupts = <0 62 IRQ_TYPE_LEVEL_HIGH>; interrupts = <0 62 IRQ_TYPE_LEVEL_HIGH>;
v-ape-supply = <&db8500_vape_reg>; v-ape-supply = <&db8500_vape_reg>;
dmas = <&dma 30 0 0x12>; /* Logical - DevToMem - HighPrio */
dma-names = "rx";
clocks = <&prcc_kclk 1 10>, <&prcc_pclk 1 11>; clocks = <&prcc_kclk 1 10>, <&prcc_pclk 1 11>;
clock-names = "msp", "apb_pclk"; clock-names = "msp", "apb_pclk";
...@@ -987,6 +1002,23 @@ vmmci: regulator-gpio { ...@@ -987,6 +1002,23 @@ vmmci: regulator-gpio {
status = "disabled"; status = "disabled";
}; };
mcde@a0350000 {
compatible = "stericsson,mcde";
reg = <0xa0350000 0x1000>, /* MCDE */
<0xa0351000 0x1000>, /* DSI link 1 */
<0xa0352000 0x1000>, /* DSI link 2 */
<0xa0353000 0x1000>; /* DSI link 3 */
interrupts = <0 48 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&prcmu_clk PRCMU_MCDECLK>, /* Main MCDE clock */
<&prcmu_clk PRCMU_LCDCLK>, /* LCD clock */
<&prcmu_clk PRCMU_PLLDSI>, /* HDMI clock */
<&prcmu_clk PRCMU_DSI0CLK>, /* DSI 0 */
<&prcmu_clk PRCMU_DSI1CLK>, /* DSI 1 */
<&prcmu_clk PRCMU_DSI0ESCCLK>, /* TVout clock 0 */
<&prcmu_clk PRCMU_DSI1ESCCLK>, /* TVout clock 1 */
<&prcmu_clk PRCMU_DSI2ESCCLK>; /* TVout clock 2 */
};
cryp@a03cb000 { cryp@a03cb000 {
compatible = "stericsson,ux500-cryp"; compatible = "stericsson,ux500-cryp";
reg = <0xa03cb000 0x1000>; reg = <0xa03cb000 0x1000>;
......
This diff is collapsed.
...@@ -12,6 +12,28 @@ ...@@ -12,6 +12,28 @@
#include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/interrupt-controller/irq.h>
/ { / {
gpio_keys {
compatible = "gpio-keys";
#address-cells = <1>;
#size-cells = <0>;
vdd-supply = <&ab8500_ldo_aux1_reg>;
pinctrl-names = "default";
pinctrl-0 = <&prox_stuib_mode>, <&hall_stuib_mode>;
button@139 {
/* Proximity sensor */
gpios = <&gpio6 25 0x4>;
linux,code = <11>; /* SW_FRONT_PROXIMITY */
label = "SFH7741 Proximity Sensor";
};
button@145 {
/* Hall sensor */
gpios = <&gpio4 17 0x4>;
linux,code = <0>; /* SW_LID */
label = "HED54XXU11 Hall Effect Sensor";
};
};
soc { soc {
i2c@80004000 { i2c@80004000 {
stmpe1601: stmpe1601@40 { stmpe1601: stmpe1601@40 {
...@@ -74,5 +96,24 @@ bu21013_tp@5d { ...@@ -74,5 +96,24 @@ bu21013_tp@5d {
rohm,flip-y; rohm,flip-y;
}; };
}; };
pinctrl {
prox {
prox_stuib_mode: prox_stuib {
stuib_cfg {
ste,pins = "GPIO217_AH12";
ste,config = <&gpio_in_pu>;
};
};
};
hall {
hall_stuib_mode: stuib_tvk {
stuib_cfg {
ste,pins = "GPIO145_C13";
ste,config = <&gpio_in_pu>;
};
};
};
};
}; };
}; };
...@@ -14,27 +14,105 @@ ...@@ -14,27 +14,105 @@
#include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/interrupt-controller/irq.h>
/ { / {
gpio_keys {
compatible = "gpio-keys";
#address-cells = <1>;
#size-cells = <0>;
vdd-supply = <&ab8500_ldo_aux1_reg>;
pinctrl-names = "default";
pinctrl-0 = <&prox_tvk_mode>, <&hall_tvk_mode>;
button@139 {
/* Proximity sensor */
gpios = <&gpio6 25 0x4>;
linux,code = <11>; /* SW_FRONT_PROXIMITY */
label = "SFH7741 Proximity Sensor";
};
button@145 {
/* Hall sensor */
gpios = <&gpio4 17 0x4>;
linux,code = <0>; /* SW_LID */
label = "HED54XXU11 Hall Effect Sensor";
};
};
soc { soc {
/* Add Synaptics touch screen, TC35892 keypad etc here */ /* Add Synaptics touch screen, TC35893 keypad etc here */
i2c@80004000 { i2c@80004000 {
tc3589x@44 { tc35893@44 {
compatible = "tc3589x"; compatible = "toshiba,tc35893";
reg = <0x44>; reg = <0x44>;
interrupt-parent = <&gpio6>; interrupt-parent = <&gpio6>;
interrupts = <26 IRQ_TYPE_EDGE_RISING>; interrupts = <26 IRQ_TYPE_EDGE_RISING>;
pinctrl-names = "default";
pinctrl-0 = <&tc35893_tvk_mode>;
interrupt-controller; interrupt-controller;
#interrupt-cells = <2>; #interrupt-cells = <1>;
tc3589x_gpio { tc3589x_gpio {
compatible = "tc3589x-gpio"; compatible = "toshiba,tc3589x-gpio";
interrupts = <0 IRQ_TYPE_EDGE_RISING>; interrupts = <0>;
interrupt-controller; interrupt-controller;
#interrupt-cells = <2>; #interrupt-cells = <2>;
gpio-controller; gpio-controller;
#gpio-cells = <2>; #gpio-cells = <2>;
}; };
tc3589x_keypad {
compatible = "toshiba,tc3589x-keypad";
interrupts = <6>;
debounce-delay-ms = <4>;
keypad,num-columns = <8>;
keypad,num-rows = <8>;
linux,no-autorepeat;
linux,wakeup;
linux,keymap = <0x0301006b
0x04010066
0x06040072
0x040200d7
0x0303006a
0x0205000e
0x0607008b
0x0500001c
0x0403000b
0x03040034
0x05020067
0x0305006c
0x040500e7
0x0005009e
0x06020073
0x01030039
0x07060069
0x050500d9>;
};
};
};
pinctrl {
/* Pull up this GPIO pin */
tc35893 {
tc35893_tvk_mode: tc35893_tvk {
tvk_cfg {
ste,pins = "GPIO218_AH11";
ste,config = <&gpio_in_pu>;
};
};
};
prox {
prox_tvk_mode: prox_tvk {
tvk_cfg {
ste,pins = "GPIO217_AH12";
ste,config = <&gpio_in_pu>;
};
};
};
hall {
hall_tvk_mode: hall_tvk {
tvk_cfg {
ste,pins = "GPIO145_C13";
ste,config = <&gpio_in_pu>;
};
};
}; };
}; };
}; };
......
...@@ -11,37 +11,57 @@ ...@@ -11,37 +11,57 @@
#include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/interrupt-controller/irq.h>
#include "ste-dbx5x0.dtsi" #include "ste-dbx5x0.dtsi"
#include "ste-href-family-pinctrl.dtsi"
/ { / {
memory { memory {
reg = <0x00000000 0x20000000>; reg = <0x00000000 0x20000000>;
}; };
gpio_keys { soc {
compatible = "gpio-keys"; usb_per5@a03e0000 {
#address-cells = <1>; pinctrl-names = "default", "sleep";
#size-cells = <0>; pinctrl-0 = <&musb_default_mode>;
pinctrl-1 = <&musb_sleep_mode>;
button@1 {
linux,code = <11>;
label = "SFH7741 Proximity Sensor";
};
}; };
soc {
uart@80120000 { uart@80120000 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&uart0_default_mode>;
pinctrl-1 = <&uart0_sleep_mode>;
status = "okay"; status = "okay";
}; };
uart@80121000 { uart@80121000 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&uart1_default_mode>;
pinctrl-1 = <&uart1_sleep_mode>;
status = "okay"; status = "okay";
}; };
uart@80007000 { uart@80007000 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&uart2_default_mode>;
pinctrl-1 = <&uart2_sleep_mode>;
status = "okay"; status = "okay";
}; };
i2c@80004000 {
pinctrl-names = "default","sleep";
pinctrl-0 = <&i2c0_default_mode>;
pinctrl-1 = <&i2c0_sleep_mode>;
};
i2c@80122000 {
pinctrl-names = "default","sleep";
pinctrl-0 = <&i2c1_default_mode>;
pinctrl-1 = <&i2c1_sleep_mode>;
};
i2c@80128000 { i2c@80128000 {
pinctrl-names = "default","sleep";
pinctrl-0 = <&i2c2_default_mode>;
pinctrl-1 = <&i2c2_sleep_mode>;
lp5521@33 { lp5521@33 {
compatible = "national,lp5521"; compatible = "national,lp5521";
reg = <0x33>; reg = <0x33>;
...@@ -85,6 +105,12 @@ bh1780@29 { ...@@ -85,6 +105,12 @@ bh1780@29 {
}; };
}; };
i2c@80110000 {
pinctrl-names = "default","sleep";
pinctrl-0 = <&i2c3_default_mode>;
pinctrl-1 = <&i2c3_sleep_mode>;
};
// External Micro SD slot // External Micro SD slot
sdi0_per1@80126000 { sdi0_per1@80126000 {
arm,primecell-periphid = <0x10480180>; arm,primecell-periphid = <0x10480180>;
...@@ -94,6 +120,9 @@ sdi0_per1@80126000 { ...@@ -94,6 +120,9 @@ sdi0_per1@80126000 {
mmc-cap-mmc-highspeed; mmc-cap-mmc-highspeed;
vmmc-supply = <&ab8500_ldo_aux3_reg>; vmmc-supply = <&ab8500_ldo_aux3_reg>;
vqmmc-supply = <&vmmci>; vqmmc-supply = <&vmmci>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <&sdi0_default_mode>;
pinctrl-1 = <&sdi0_sleep_mode>;
cd-gpios = <&tc3589x_gpio 3 0x4>; cd-gpios = <&tc3589x_gpio 3 0x4>;
...@@ -105,6 +134,9 @@ sdi1_per2@80118000 { ...@@ -105,6 +134,9 @@ sdi1_per2@80118000 {
arm,primecell-periphid = <0x10480180>; arm,primecell-periphid = <0x10480180>;
max-frequency = <100000000>; max-frequency = <100000000>;
bus-width = <4>; bus-width = <4>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <&sdi1_default_mode>;
pinctrl-1 = <&sdi1_sleep_mode>;
status = "okay"; status = "okay";
}; };
...@@ -115,6 +147,9 @@ sdi2_per3@80005000 { ...@@ -115,6 +147,9 @@ sdi2_per3@80005000 {
max-frequency = <100000000>; max-frequency = <100000000>;
bus-width = <8>; bus-width = <8>;
mmc-cap-mmc-highspeed; mmc-cap-mmc-highspeed;
pinctrl-names = "default", "sleep";
pinctrl-0 = <&sdi2_default_mode>;
pinctrl-1 = <&sdi2_sleep_mode>;
status = "okay"; status = "okay";
}; };
...@@ -126,6 +161,9 @@ sdi4_per2@80114000 { ...@@ -126,6 +161,9 @@ sdi4_per2@80114000 {
bus-width = <8>; bus-width = <8>;
mmc-cap-mmc-highspeed; mmc-cap-mmc-highspeed;
vmmc-supply = <&ab8500_ldo_aux2_reg>; vmmc-supply = <&ab8500_ldo_aux2_reg>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <&sdi4_default_mode>;
pinctrl-1 = <&sdi4_sleep_mode>;
status = "okay"; status = "okay";
}; };
...@@ -137,7 +175,21 @@ sound { ...@@ -137,7 +175,21 @@ sound {
stericsson,audio-codec = <&codec>; stericsson,audio-codec = <&codec>;
}; };
msp0: msp@80123000 {
pinctrl-names = "default";
pinctrl-0 = <&msp0_default_mode>;
status = "okay";
};
msp1: msp@80124000 { msp1: msp@80124000 {
pinctrl-names = "default";
pinctrl-0 = <&msp1_default_mode>;
status = "okay";
};
msp2: msp@80117000 {
pinctrl-names = "default";
pinctrl-0 = <&msp2_default_mode>;
status = "okay"; status = "okay";
}; };
...@@ -198,5 +250,11 @@ ab8500_ldo_ana_reg: ab8500_ldo_ana { ...@@ -198,5 +250,11 @@ ab8500_ldo_ana_reg: ab8500_ldo_ana {
}; };
}; };
}; };
mcde@a0350000 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&lcd_default_mode>;
pinctrl-1 = <&lcd_sleep_mode>;
};
}; };
}; };
...@@ -28,18 +28,20 @@ tps61052@33 { ...@@ -28,18 +28,20 @@ tps61052@33 {
reg = <0x33>; reg = <0x33>;
}; };
tc3589x@42 { tc35892@42 {
compatible = "tc3589x"; compatible = "toshiba,tc35892";
reg = <0x42>; reg = <0x42>;
interrupt-parent = <&gpio6>; interrupt-parent = <&gpio6>;
interrupts = <25 IRQ_TYPE_EDGE_RISING>; interrupts = <25 IRQ_TYPE_EDGE_RISING>;
pinctrl-names = "default";
pinctrl-0 = <&tc35892_hrefprev60_mode>;
interrupt-controller; interrupt-controller;
#interrupt-cells = <2>; #interrupt-cells = <1>;
tc3589x_gpio: tc3589x_gpio { tc3589x_gpio: tc3589x_gpio {
compatible = "tc3589x-gpio"; compatible = "tc3589x-gpio";
interrupts = <0 IRQ_TYPE_EDGE_RISING>; interrupts = <0>;
interrupt-controller; interrupt-controller;
#interrupt-cells = <2>; #interrupt-cells = <2>;
...@@ -49,11 +51,74 @@ tc3589x_gpio: tc3589x_gpio { ...@@ -49,11 +51,74 @@ tc3589x_gpio: tc3589x_gpio {
}; };
}; };
ssp@80002000 {
/*
* On the first generation boards, this SSP/SPI port was connected
* to the AB8500.
*/
pinctrl-names = "default";
pinctrl-0 = <&ssp0_hrefprev60_mode>;
};
vmmci: regulator-gpio { vmmci: regulator-gpio {
gpios = <&tc3589x_gpio 18 0x4>; gpios = <&tc3589x_gpio 18 0x4>;
enable-gpio = <&tc3589x_gpio 17 0x4>; enable-gpio = <&tc3589x_gpio 17 0x4>;
status = "okay"; status = "okay";
}; };
pinctrl {
/* Set this up using hogs */
pinctrl-names = "default";
pinctrl-0 = <&ipgpio_hrefprev60_mode>;
ssp0 {
ssp0_hrefprev60_mode: ssp0_hrefprev60_default {
hrefprev60_mux {
ste,function = "ssp0";
ste,pins = "ssp0_a_1";
};
hrefprev60_cfg1 {
ste,pins = "GPIO145_C13"; /* RXD */
ste,config = <&in_pd>;
};
};
};
sdi0 {
/* This additional pin needed on early MOP500 and HREFs previous to v60 */
sdi0_default_mode: sdi0_default {
hrefprev60_mux {
ste,function = "mc0";
ste,pins = "mc0dat31dir_a_1";
};
hrefprev60_cfg1 {
ste,pins = "GPIO21_AB3"; /* DAT31DIR */
ste,config = <&out_hi>;
};
};
};
tc35892 {
tc35892_hrefprev60_mode: tc35892_hrefprev60 {
hrefprev60_cfg {
ste,pins = "GPIO217_AH12";
ste,config = <&gpio_in_pu>;
};
};
};
ipgpio {
ipgpio_hrefprev60_mode: ipgpio_hrefprev60 {
hrefprev60_mux {
ste,function = "ipgpio";
ste,pins = "ipgpio0_c_1", "ipgpio1_c_1";
};
hrefprev60_cfg1 {
ste,pins = "GPIO6_AF6", "GPIO7_AG5";
ste,config = <&in_pu>;
};
};
};
};
}; };
}; };
...@@ -16,12 +16,6 @@ / { ...@@ -16,12 +16,6 @@ / {
model = "ST-Ericsson HREF (v60+) platform with Device Tree"; model = "ST-Ericsson HREF (v60+) platform with Device Tree";
compatible = "st-ericsson,hrefv60+", "st-ericsson,u8500"; compatible = "st-ericsson,hrefv60+", "st-ericsson,u8500";
gpio_keys {
button@1 {
gpios = <&gpio5 25 0x4>;
};
};
soc { soc {
// External Micro SD slot // External Micro SD slot
sdi0_per1@80126000 { sdi0_per1@80126000 {
...@@ -66,5 +60,216 @@ sdi4_per2@80114000 { ...@@ -66,5 +60,216 @@ sdi4_per2@80114000 {
status = "okay"; status = "okay";
}; };
pinctrl {
/*
* Set this up using hogs, as time goes by and as seems fit, these
* can be moved over to being controlled by respective device.
*/
pinctrl-names = "default";
pinctrl-0 = <&ipgpio_hrefv60_mode>,
<&accel_hrefv60_mode>,
<&magneto_hrefv60_mode>,
<&etm_hrefv60_mode>,
<&nahj_hrefv60_mode>,
<&nfc_hrefv60_mode>,
<&force_hrefv60_mode>,
<&dipro_hrefv60_mode>,
<&vaudio_hf_hrefv60_mode>,
<&gbf_hrefv60_mode>,
<&hdtv_hrefv60_mode>,
<&touch_hrefv60_mode>;
sdi0 {
/* SD card detect GPIO pin, extend default state */
sdi0_default_mode: sdi0_default {
default_hrefv60_cfg1 {
ste,pins = "GPIO95_E8";
ste,config = <&gpio_in_pu>;
};
};
};
ipgpio {
/*
* XENON Flashgun on image processor GPIO (controlled from image
* processor firmware), mux in these image processor GPIO lines 0
* (XENON_FLASH_ID), 1 (XENON_READY) and there is an assistant
* LED on IP GPIO 4 (XENON_EN2) on altfunction C, that need bias
* from GPIO21 so pull up 0, 1 and drive 4 and GPIO21 low as output.
*/
ipgpio_hrefv60_mode: ipgpio_hrefv60 {
hrefv60_mux {
ste,function = "ipgpio";
ste,pins = "ipgpio0_c_1", "ipgpio1_c_1", "ipgpio4_c_1";
};
hrefv60_cfg1 {
ste,pins = "GPIO6_AF6", "GPIO7_AG5";
ste,config = <&in_pu>;
};
hrefv60_cfg2 {
ste,pins = "GPIO21_AB3";
ste,config = <&gpio_out_lo>;
};
hrefv60_cfg3 {
ste,pins = "GPIO64_F3";
ste,config = <&out_lo>;
};
};
};
accelerometer {
accel_hrefv60_mode: accel_hrefv60 {
/* Accelerometer interrupt lines 1 & 2 */
hrefv60_cfg1 {
ste,pins = "GPIO82_C1", "GPIO83_D3";
ste,config = <&gpio_in_pu>;
};
};
};
magnetometer {
magneto_hrefv60_mode: magneto_hrefv60 {
/* Magnetometer uses GPIO 31 and 32, pull these up/down respectively */
hrefv60_cfg1 {
ste,pins = "GPIO31_V3";
ste,config = <&gpio_in_pu>;
};
hrefv60_cfg2 {
ste,pins = "GPIO32_V2";
ste,config = <&gpio_in_pd>;
};
};
};
etm {
/*
* Drive D19-D23 for the ETM PTM trace interface low,
* (presumably pins are unconnected therefore grounded here,
* the "other alt C1" setting enables these pins)
*/
etm_hrefv60_mode: etm_hrefv60 {
hrefv60_cfg1 {
ste,pins =
"GPIO70_G5",
"GPIO71_G4",
"GPIO72_H4",
"GPIO73_H3",
"GPIO74_J3";
ste,config = <&gpio_out_lo>;
};
};
};
nahj {
nahj_hrefv60_mode: nahj_hrefv60 {
/* NAHJ CTRL on GPIO76 to low, CTRL_INV on GPIO216 to high */
hrefv60_cfg1 {
ste,pins = "GPIO76_J2";
ste,config = <&gpio_out_lo>;
};
hrefv60_cfg2 {
ste,pins = "GPIO216_AG12";
ste,config = <&gpio_out_hi>;
};
};
};
nfc {
nfc_hrefv60_mode: nfc_hrefv60 {
/* NFC ENA and RESET to low, pulldown IRQ line */
hrefv60_cfg1 {
ste,pins =
"GPIO77_H1", /* NFC_ENA */
"GPIO142_C11"; /* NFC_RESET */
ste,config = <&gpio_out_lo>;
};
hrefv60_cfg2 {
ste,pins = "GPIO144_B13"; /* NFC_IRQ */
ste,config = <&gpio_in_pd>;
};
};
};
force {
force_hrefv60_mode: force_hrefv60 {
hrefv60_cfg1 {
ste,pins = "GPIO91_B6"; /* FORCE_SENSING_INT */
ste,config = <&gpio_in_pu>;
};
hrefv60_cfg2 {
ste,pins =
"GPIO92_D6", /* FORCE_SENSING_RST */
"GPIO97_D9"; /* FORCE_SENSING_WU */
ste,config = <&gpio_out_lo>;
};
};
};
dipro {
dipro_hrefv60_mode: dipro_hrefv60 {
hrefv60_cfg1 {
ste,pins = "GPIO139_C9"; /* DIPRO_INT */
ste,config = <&gpio_in_pu>;
};
};
};
vaudio_hf {
vaudio_hf_hrefv60_mode: vaudio_hf_hrefv60 {
/* Audio Amplifier HF enable GPIO */
hrefv60_cfg1 {
ste,pins = "GPIO149_B14"; /* VAUDIO_HF_EN, enable MAX8968 */
ste,config = <&gpio_out_hi>;
};
};
};
gbf {
gbf_hrefv60_mode: gbf_hrefv60 {
/*
* GBF (GPS, Bluetooth, FM-radio) interface,
* pull low to reset state
*/
hrefv60_cfg1 {
ste,pins = "GPIO171_D23"; /* GBF_ENA_RESET */
ste,config = <&gpio_out_lo>;
};
};
};
hdtv {
hdtv_hrefv60_mode: hdtv_hrefv60 {
/* MSP : HDTV INTERFACE GPIO line */
hrefv60_cfg1 {
ste,pins = "GPIO192_AJ27";
ste,config = <&gpio_in_pd>;
};
};
};
touch {
touch_hrefv60_mode: touch_hrefv60 {
/*
* Touch screen uses GPIO 143 for RST1, GPIO 146 for RST2 and
* GPIO 67 for interrupts. Pull-up the IRQ line and drive both
* reset signals low.
*/
hrefv60_cfg1 {
ste,pins = "GPIO143_D12", "GPIO146_D13";
ste,config = <&gpio_out_lo>;
};
hrefv60_cfg2 {
ste,pins = "GPIO67_G2";
ste,config = <&gpio_in_pu>;
};
};
};
mcde {
lcd_hrefv60_mode: lcd_hrefv60 {
/*
* Display Interface 1 uses GPIO 65 for RST (reset).
* Display Interface 2 uses GPIO 66 for RST (reset).
* Drive DISP1 reset high (not reset), driver DISP2 reset low (reset)
*/
hrefv60_cfg1 {
ste,pins ="GPIO65_F1";
ste,config = <&gpio_out_hi>;
};
hrefv60_cfg2 {
ste,pins ="GPIO66_G3";
ste,config = <&gpio_out_lo>;
};
};
};
};
}; };
}; };
...@@ -31,17 +31,57 @@ out_lo: output_low { ...@@ -31,17 +31,57 @@ out_lo: output_low {
ste,output = <OUTPUT_LOW>; ste,output = <OUTPUT_LOW>;
}; };
gpio_in_pu: gpio_input_pull_up {
ste,gpio = <GPIOMODE_ENABLED>;
ste,input = <INPUT_PULLUP>;
};
gpio_in_pd: gpio_input_pull_down {
ste,gpio = <GPIOMODE_ENABLED>;
ste,input = <INPUT_PULLDOWN>;
};
gpio_out_lo: gpio_output_low { gpio_out_lo: gpio_output_low {
ste,gpio = <GPIOMODE_ENABLED>; ste,gpio = <GPIOMODE_ENABLED>;
ste,output = <OUTPUT_LOW>; ste,output = <OUTPUT_LOW>;
}; };
gpio_out_hi: gpio_output_high {
ste,gpio = <GPIOMODE_ENABLED>;
ste,output = <OUTPUT_HIGH>;
};
slpm_pdis: slpm_pdis {
ste,sleep = <SLPM_ENABLED>;
ste,sleep-wakeup = <SLPM_WAKEUP_DISABLE>;
ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
};
slpm_wkup_pdis: slpm_wkup_pdis {
ste,sleep = <SLPM_ENABLED>;
ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
};
slpm_wkup_pdis_en: slpm_wkup_pdis_en {
ste,sleep = <SLPM_ENABLED>;
ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
ste,sleep-pull-disable = <SLPM_PDIS_ENABLED>;
};
slpm_in_pu: slpm_in_pu { slpm_in_pu: slpm_in_pu {
ste,sleep = <SLPM_ENABLED>; ste,sleep = <SLPM_ENABLED>;
ste,sleep-input = <SLPM_INPUT_PULLUP>; ste,sleep-input = <SLPM_INPUT_PULLUP>;
ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>; ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
}; };
slpm_in_pdis: slpm_in_pdis {
ste,sleep = <SLPM_ENABLED>;
ste,sleep-input = <SLPM_DIR_INPUT>;
ste,sleep-wakeup = <SLPM_WAKEUP_DISABLE>;
ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
};
slpm_in_wkup_pdis: slpm_in_wkup_pdis { slpm_in_wkup_pdis: slpm_in_wkup_pdis {
ste,sleep = <SLPM_ENABLED>; ste,sleep = <SLPM_ENABLED>;
ste,sleep-input = <SLPM_DIR_INPUT>; ste,sleep-input = <SLPM_DIR_INPUT>;
...@@ -49,6 +89,20 @@ slpm_in_wkup_pdis: slpm_in_wkup_pdis { ...@@ -49,6 +89,20 @@ slpm_in_wkup_pdis: slpm_in_wkup_pdis {
ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>; ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
}; };
slpm_in_wkup_pdis_en: slpm_in_wkup_pdis_en {
ste,sleep = <SLPM_ENABLED>;
ste,sleep-input = <SLPM_DIR_INPUT>;
ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
ste,sleep-pull-disable = <SLPM_PDIS_ENABLED>;
};
slpm_in_pu_wkup_pdis_en: slpm_in_wkup_pdis_en {
ste,sleep = <SLPM_ENABLED>;
ste,sleep-input = <SLPM_INPUT_PULLUP>;
ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
ste,sleep-pull-disable = <SLPM_PDIS_ENABLED>;
};
slpm_out_lo: slpm_out_lo { slpm_out_lo: slpm_out_lo {
ste,sleep = <SLPM_ENABLED>; ste,sleep = <SLPM_ENABLED>;
ste,sleep-output = <SLPM_OUTPUT_LOW>; ste,sleep-output = <SLPM_OUTPUT_LOW>;
...@@ -68,6 +122,20 @@ slpm_out_hi_wkup_pdis: slpm_out_hi_wkup_pdis { ...@@ -68,6 +122,20 @@ slpm_out_hi_wkup_pdis: slpm_out_hi_wkup_pdis {
ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>; ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
}; };
slpm_out_lo_pdis: slpm_out_lo_pdis {
ste,sleep = <SLPM_ENABLED>;
ste,sleep-output = <SLPM_OUTPUT_LOW>;
ste,sleep-wakeup = <SLPM_WAKEUP_DISABLE>;
ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
};
slpm_out_lo_wkup_pdis: slpm_out_lo_wkup_pdis {
ste,sleep = <SLPM_ENABLED>;
ste,sleep-output = <SLPM_OUTPUT_LOW>;
ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
};
slpm_out_wkup_pdis: slpm_out_wkup_pdis { slpm_out_wkup_pdis: slpm_out_wkup_pdis {
ste,sleep = <SLPM_ENABLED>; ste,sleep = <SLPM_ENABLED>;
ste,sleep-output = <SLPM_DIR_OUTPUT>; ste,sleep-output = <SLPM_DIR_OUTPUT>;
...@@ -81,6 +149,18 @@ in_wkup_pdis: in_wkup_pdis { ...@@ -81,6 +149,18 @@ in_wkup_pdis: in_wkup_pdis {
ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>; ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
}; };
in_wkup_pdis_en: in_wkup_pdis_en {
ste,sleep-input = <SLPM_DIR_INPUT>;
ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
ste,sleep-pull-disable = <SLPM_PDIS_ENABLED>;
};
out_lo_wkup_pdis: out_lo_wkup_pdis {
ste,sleep-output = <SLPM_OUTPUT_LOW>;
ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
ste,sleep-pull-disable = <SLPM_PDIS_DISABLED>;
};
out_hi_wkup_pdis: out_hi_wkup_pdis { out_hi_wkup_pdis: out_hi_wkup_pdis {
ste,sleep-output = <SLPM_OUTPUT_HIGH>; ste,sleep-output = <SLPM_OUTPUT_HIGH>;
ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>; ste,sleep-wakeup = <SLPM_WAKEUP_ENABLE>;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
/dts-v1/; /dts-v1/;
#include "ste-dbx5x0.dtsi" #include "ste-dbx5x0.dtsi"
#include "ste-href-family-pinctrl.dtsi"
/ { / {
model = "Calao Systems Snowball platform with device tree"; model = "Calao Systems Snowball platform with device tree";
...@@ -75,6 +76,8 @@ button@5 { ...@@ -75,6 +76,8 @@ button@5 {
leds { leds {
compatible = "gpio-leds"; compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&gpioled_snowball_mode>;
used-led { used-led {
label = "user_led"; label = "user_led";
gpios = <&gpio4 14 0x4>; gpios = <&gpio4 14 0x4>;
...@@ -84,6 +87,11 @@ used-led { ...@@ -84,6 +87,11 @@ used-led {
}; };
soc { soc {
usb_per5@a03e0000 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&musb_default_mode>;
pinctrl-1 = <&musb_sleep_mode>;
};
sound { sound {
compatible = "stericsson,snd-soc-mop500"; compatible = "stericsson,snd-soc-mop500";
...@@ -92,7 +100,21 @@ sound { ...@@ -92,7 +100,21 @@ sound {
stericsson,audio-codec = <&codec>; stericsson,audio-codec = <&codec>;
}; };
msp0: msp@80123000 {
pinctrl-names = "default";
pinctrl-0 = <&msp0_default_mode>;
status = "okay";
};
msp1: msp@80124000 { msp1: msp@80124000 {
pinctrl-names = "default";
pinctrl-0 = <&msp1_default_mode>;
status = "okay";
};
msp2: msp@80117000 {
pinctrl-names = "default";
pinctrl-0 = <&msp2_default_mode>;
status = "okay"; status = "okay";
}; };
...@@ -110,6 +132,8 @@ ethernet@0 { ...@@ -110,6 +132,8 @@ ethernet@0 {
interrupt-parent = <&gpio4>; interrupt-parent = <&gpio4>;
vdd33a-supply = <&en_3v3_reg>; vdd33a-supply = <&en_3v3_reg>;
vddvario-supply = <&db8500_vape_reg>; vddvario-supply = <&db8500_vape_reg>;
pinctrl-names = "default";
pinctrl-0 = <&eth_snowball_mode>;
reg-shift = <1>; reg-shift = <1>;
reg-io-width = <2>; reg-io-width = <2>;
...@@ -136,6 +160,9 @@ sdi0_per1@80126000 { ...@@ -136,6 +160,9 @@ sdi0_per1@80126000 {
mmc-cap-mmc-highspeed; mmc-cap-mmc-highspeed;
vmmc-supply = <&ab8500_ldo_aux3_reg>; vmmc-supply = <&ab8500_ldo_aux3_reg>;
vqmmc-supply = <&vmmci>; vqmmc-supply = <&vmmci>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <&sdi0_default_mode>;
pinctrl-1 = <&sdi0_sleep_mode>;
cd-gpios = <&gpio6 26 0x4>; // 218 cd-gpios = <&gpio6 26 0x4>; // 218
cd-inverted; cd-inverted;
...@@ -143,6 +170,27 @@ sdi0_per1@80126000 { ...@@ -143,6 +170,27 @@ sdi0_per1@80126000 {
status = "okay"; status = "okay";
}; };
// WLAN SDIO channel
sdi1_per2@80118000 {
arm,primecell-periphid = <0x10480180>;
max-frequency = <100000000>;
bus-width = <4>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <&sdi1_default_mode>;
pinctrl-1 = <&sdi1_sleep_mode>;
status = "okay";
};
// Unused PoP eMMC - register and put it to sleep by default */
sdi2_per3@80005000 {
arm,primecell-periphid = <0x10480180>;
pinctrl-names = "default";
pinctrl-0 = <&sdi2_sleep_mode>;
status = "okay";
};
// On-board eMMC // On-board eMMC
sdi4_per2@80114000 { sdi4_per2@80114000 {
arm,primecell-periphid = <0x10480180>; arm,primecell-periphid = <0x10480180>;
...@@ -150,22 +198,63 @@ sdi4_per2@80114000 { ...@@ -150,22 +198,63 @@ sdi4_per2@80114000 {
bus-width = <8>; bus-width = <8>;
mmc-cap-mmc-highspeed; mmc-cap-mmc-highspeed;
vmmc-supply = <&ab8500_ldo_aux2_reg>; vmmc-supply = <&ab8500_ldo_aux2_reg>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <&sdi4_default_mode>;
pinctrl-1 = <&sdi4_sleep_mode>;
status = "okay"; status = "okay";
}; };
uart@80120000 { uart@80120000 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&uart0_default_mode>;
pinctrl-1 = <&uart0_sleep_mode>;
status = "okay"; status = "okay";
}; };
uart@80121000 { uart@80121000 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&uart1_default_mode>;
pinctrl-1 = <&uart1_sleep_mode>;
status = "okay"; status = "okay";
}; };
uart@80007000 { uart@80007000 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&uart2_default_mode>;
pinctrl-1 = <&uart2_sleep_mode>;
status = "okay"; status = "okay";
}; };
i2c@80004000 {
pinctrl-names = "default","sleep";
pinctrl-0 = <&i2c0_default_mode>;
pinctrl-1 = <&i2c0_sleep_mode>;
};
i2c@80122000 {
pinctrl-names = "default","sleep";
pinctrl-0 = <&i2c1_default_mode>;
pinctrl-1 = <&i2c1_sleep_mode>;
};
i2c@80128000 {
pinctrl-names = "default","sleep";
pinctrl-0 = <&i2c2_default_mode>;
pinctrl-1 = <&i2c2_sleep_mode>;
};
i2c@80110000 {
pinctrl-names = "default","sleep";
pinctrl-0 = <&i2c3_default_mode>;
pinctrl-1 = <&i2c3_sleep_mode>;
};
ssp@80002000 {
pinctrl-names = "default";
pinctrl-0 = <&ssp0_snowball_mode>;
};
cpufreq-cooling { cpufreq-cooling {
status = "okay"; status = "okay";
}; };
...@@ -266,5 +355,141 @@ ab8500_ldo_ana_reg: ab8500_ldo_ana { ...@@ -266,5 +355,141 @@ ab8500_ldo_ana_reg: ab8500_ldo_ana {
}; };
}; };
}; };
pinctrl {
/*
* Set this up using hogs, as time goes by and as seems fit, these
* can be moved over to being controlled by respective device.
*/
pinctrl-names = "default";
pinctrl-0 = <&accel_snowball_mode>,
<&magneto_snowball_mode>,
<&gbf_snowball_mode>,
<&wlan_snowball_mode>;
ethernet {
/*
* Mux in "SM" which is used for the
* SMSC911x Ethernet adapter
*/
eth_snowball_mode: eth_snowball {
snowball_mux {
ste,function = "sm";
ste,pins = "sm_b_1";
};
/* LAN IRQ pin */
snowball_cfg1 {
ste,pins = "GPIO140_B11";
ste,config = <&in_nopull>;
};
/* LAN reset pin */
snowball_cfg2 {
ste,pins = "GPIO141_C12";
ste,config = <&gpio_out_hi>;
};
};
};
sdi0 {
sdi0_default_mode: sdi0_default {
snowball_mux {
ste,function = "mc0";
ste,pins = "mc0dat31dir_a_1";
};
snowball_cfg1 {
ste,pins = "GPIO21_AB3"; /* DAT31DIR */
ste,config = <&out_hi>;
};
};
};
ssp0 {
ssp0_snowball_mode: ssp0_snowball_default {
snowball_mux {
ste,function = "ssp0";
ste,pins = "ssp0_a_1";
};
snowball_cfg1 {
ste,pins = "GPIO144_B13"; /* FRM */
ste,config = <&gpio_out_hi>;
};
snowball_cfg2 {
ste,pins = "GPIO145_C13"; /* RXD */
ste,config = <&in_pd>;
};
snowball_cfg3 {
ste,pins =
"GPIO146_D13", /* TXD */
"GPIO143_D12"; /* CLK */
ste,config = <&out_lo>;
};
};
};
gpio_led {
gpioled_snowball_mode: gpioled_default {
snowball_cfg1 {
ste,pins = "GPIO142_C11";
ste,config = <&gpio_out_hi>;
};
};
};
accelerometer {
accel_snowball_mode: accel_snowball {
/* Accelerometer lines */
snowball_cfg1 {
ste,pins =
"GPIO163_C20", /* ACCEL_IRQ1 */
"GPIO164_B21"; /* ACCEL_IRQ2 */
ste,config = <&gpio_in_pu>;
};
};
};
magnetometer {
magneto_snowball_mode: magneto_snowball {
snowball_cfg1 {
ste,pins = "GPIO165_C21"; /* MAG_DRDY */
ste,config = <&gpio_in_pu>;
};
};
};
gbf {
gbf_snowball_mode: gbf_snowball {
/*
* GBF (GPS, Bluetooth, FM-radio) interface,
* pull low to reset state
*/
snowball_cfg1 {
ste,pins = "GPIO171_D23"; /* GBF_ENA_RESET */
ste,config = <&gpio_out_lo>;
};
};
};
wlan {
wlan_snowball_mode: wlan_snowball {
/*
* Activate this mode with the WLAN chip.
* These are plain GPIO pins used by WLAN
*/
snowball_cfg1 {
ste,pins =
"GPIO161_D21", /* WLAN_PMU_EN */
"GPIO215_AH13"; /* WLAN_ENA */
ste,config = <&gpio_out_lo>;
};
snowball_cfg2 {
ste,pins = "GPIO216_AG12"; /* WLAN_IRQ */
ste,config = <&gpio_in_pu>;
};
};
};
};
mcde@a0350000 {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&lcd_default_mode>;
pinctrl-1 = <&lcd_sleep_mode>;
};
}; };
}; };
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
# Makefile for the linux kernel, U8500 machine. # Makefile for the linux kernel, U8500 machine.
# #
obj-y := cpu.o devices.o id.o timer.o pm.o obj-y := cpu.o id.o timer.o pm.o
obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o
obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o
obj-$(CONFIG_MACH_MOP500) += board-mop500.o board-mop500-sdi.o \ obj-$(CONFIG_MACH_MOP500) += board-mop500-sdi.o \
board-mop500-regulators.o \ board-mop500-regulators.o \
board-mop500-pins.o \ board-mop500-pins.o \
board-mop500-audio.o board-mop500-audio.o
......
...@@ -7,16 +7,13 @@ ...@@ -7,16 +7,13 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/platform_data/pinctrl-nomadik.h>
#include <linux/platform_data/dma-ste-dma40.h> #include <linux/platform_data/dma-ste-dma40.h>
#include "devices.h"
#include "irqs.h" #include "irqs.h"
#include <linux/platform_data/asoc-ux500-msp.h> #include <linux/platform_data/asoc-ux500-msp.h>
#include "ste-dma40-db8500.h" #include "ste-dma40-db8500.h"
#include "board-mop500.h" #include "board-mop500.h"
#include "devices-db8500.h"
static struct stedma40_chan_cfg msp0_dma_rx = { static struct stedma40_chan_cfg msp0_dma_rx = {
.high_priority = true, .high_priority = true,
......
This diff is collapsed.
...@@ -14,10 +14,8 @@ ...@@ -14,10 +14,8 @@
#include <linux/platform_data/dma-ste-dma40.h> #include <linux/platform_data/dma-ste-dma40.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include "devices.h"
#include "db8500-regs.h" #include "db8500-regs.h"
#include "devices-db8500.h"
#include "board-mop500.h" #include "board-mop500.h"
#include "ste-dma40-db8500.h" #include "ste-dma40-db8500.h"
......
/*
* Copyright (C) 2008-2012 ST-Ericsson
*
* Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
*
* 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/kernel.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/platform_data/db8500_thermal.h>
#include <linux/amba/bus.h>
#include <linux/amba/pl022.h>
#include <linux/mfd/abx500/ab8500.h>
#include <linux/regulator/ab8500.h>
#include <linux/regulator/fixed.h>
#include <linux/regulator/driver.h>
#include <linux/mfd/tps6105x.h>
#include <linux/platform_data/leds-lp55xx.h>
#include <linux/input.h>
#include <linux/delay.h>
#include <linux/leds.h>
#include <linux/pinctrl/consumer.h>
#include <linux/platform_data/pinctrl-nomadik.h>
#include <linux/platform_data/dma-ste-dma40.h>
#include <asm/mach-types.h>
#include "setup.h"
#include "devices.h"
#include "irqs.h"
#include "ste-dma40-db8500.h"
#include "db8500-regs.h"
#include "devices-db8500.h"
#include "board-mop500.h"
#include "board-mop500-regulators.h"
struct ab8500_platform_data ab8500_platdata = {
.irq_base = MOP500_AB8500_IRQ_BASE,
.regulator = &ab8500_regulator_plat_data,
};
#ifdef CONFIG_STE_DMA40
static struct stedma40_chan_cfg ssp0_dma_cfg_rx = {
.mode = STEDMA40_MODE_LOGICAL,
.dir = DMA_DEV_TO_MEM,
.dev_type = DB8500_DMA_DEV8_SSP0,
};
static struct stedma40_chan_cfg ssp0_dma_cfg_tx = {
.mode = STEDMA40_MODE_LOGICAL,
.dir = DMA_MEM_TO_DEV,
.dev_type = DB8500_DMA_DEV8_SSP0,
};
#endif
struct pl022_ssp_controller ssp0_plat = {
.bus_id = 0,
#ifdef CONFIG_STE_DMA40
.enable_dma = 1,
.dma_filter = stedma40_filter,
.dma_rx_param = &ssp0_dma_cfg_rx,
.dma_tx_param = &ssp0_dma_cfg_tx,
#else
.enable_dma = 0,
#endif
/* on this platform, gpio 31,142,144,214 &
* 224 are connected as chip selects
*/
.num_chipselect = 5,
};
...@@ -87,7 +87,6 @@ extern struct msp_i2s_platform_data msp0_platform_data; ...@@ -87,7 +87,6 @@ extern struct msp_i2s_platform_data msp0_platform_data;
extern struct msp_i2s_platform_data msp1_platform_data; extern struct msp_i2s_platform_data msp1_platform_data;
extern struct msp_i2s_platform_data msp2_platform_data; extern struct msp_i2s_platform_data msp2_platform_data;
extern struct msp_i2s_platform_data msp3_platform_data; extern struct msp_i2s_platform_data msp3_platform_data;
extern struct pl022_ssp_controller ssp0_plat;
void __init mop500_pinmaps_init(void); void __init mop500_pinmaps_init(void);
void __init snowball_pinmaps_init(void); void __init snowball_pinmaps_init(void);
......
...@@ -21,21 +21,32 @@ ...@@ -21,21 +21,32 @@
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/regulator/machine.h> #include <linux/regulator/machine.h>
#include <linux/platform_data/pinctrl-nomadik.h>
#include <linux/random.h> #include <linux/random.h>
#include <asm/pmu.h> #include <asm/pmu.h>
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include "setup.h" #include "setup.h"
#include "devices.h"
#include "irqs.h" #include "irqs.h"
#include "devices-db8500.h" #include "board-mop500-regulators.h"
#include "db8500-regs.h"
#include "board-mop500.h" #include "board-mop500.h"
#include "db8500-regs.h"
#include "id.h" #include "id.h"
struct ab8500_platform_data ab8500_platdata = {
.irq_base = MOP500_AB8500_IRQ_BASE,
.regulator = &ab8500_regulator_plat_data,
};
struct prcmu_pdata db8500_prcmu_pdata = {
.ab_platdata = &ab8500_platdata,
.ab_irq = IRQ_DB8500_AB8500,
.irq_base = IRQ_PRCMU_BASE,
.version_offset = DB8500_PRCMU_FW_VERSION_OFFSET,
.legacy_offset = DB8500_PRCMU_LEGACY_OFFSET,
};
/* minimum static i/o mapping required to boot U8500 platforms */ /* minimum static i/o mapping required to boot U8500 platforms */
static struct map_desc u8500_uart_io_desc[] __initdata = { static struct map_desc u8500_uart_io_desc[] __initdata = {
__IO_DEV_DESC(U8500_UART0_BASE, SZ_4K), __IO_DEV_DESC(U8500_UART0_BASE, SZ_4K),
...@@ -155,9 +166,6 @@ static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { ...@@ -155,9 +166,6 @@ static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
OF_DEV_AUXDATA("stericsson,ux500-hash", 0xa03c2000, "hash1", NULL), OF_DEV_AUXDATA("stericsson,ux500-hash", 0xa03c2000, "hash1", NULL),
OF_DEV_AUXDATA("stericsson,snd-soc-mop500", 0, "snd-soc-mop500.0", OF_DEV_AUXDATA("stericsson,snd-soc-mop500", 0, "snd-soc-mop500.0",
NULL), NULL),
/* Requires device name bindings. */
OF_DEV_AUXDATA("stericsson,db8500-pinctrl", U8500_PRCMU_BASE,
"pinctrl-db8500", NULL),
{}, {},
}; };
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <asm/mach/map.h> #include <asm/mach/map.h>
#include "setup.h" #include "setup.h"
#include "devices.h"
#include "board-mop500.h" #include "board-mop500.h"
#include "db8500-regs.h" #include "db8500-regs.h"
...@@ -64,12 +63,7 @@ void __init ux500_init_irq(void) ...@@ -64,12 +63,7 @@ void __init ux500_init_irq(void)
} else } else
ux500_unknown_soc(); ux500_unknown_soc();
#ifdef CONFIG_OF
if (of_have_populated_dt())
irqchip_init(); irqchip_init();
else
#endif
gic_init(0, 29, dist_base, cpu_base);
/* /*
* Init clocks here so that they are available for system timer * Init clocks here so that they are available for system timer
...@@ -79,16 +73,11 @@ void __init ux500_init_irq(void) ...@@ -79,16 +73,11 @@ void __init ux500_init_irq(void)
prcmu_early_init(U8500_PRCMU_BASE, SZ_8K - 1); prcmu_early_init(U8500_PRCMU_BASE, SZ_8K - 1);
ux500_pm_init(U8500_PRCMU_BASE, SZ_8K - 1); ux500_pm_init(U8500_PRCMU_BASE, SZ_8K - 1);
if (of_have_populated_dt())
u8500_of_clk_init(U8500_CLKRST1_BASE, u8500_of_clk_init(U8500_CLKRST1_BASE,
U8500_CLKRST2_BASE, U8500_CLKRST2_BASE,
U8500_CLKRST3_BASE, U8500_CLKRST3_BASE,
U8500_CLKRST5_BASE, U8500_CLKRST5_BASE,
U8500_CLKRST6_BASE); U8500_CLKRST6_BASE);
else
u8500_clk_init(U8500_CLKRST1_BASE, U8500_CLKRST2_BASE,
U8500_CLKRST3_BASE, U8500_CLKRST5_BASE,
U8500_CLKRST6_BASE);
} else if (cpu_is_u9540()) { } else if (cpu_is_u9540()) {
prcmu_early_init(U8500_PRCMU_BASE, SZ_8K - 1); prcmu_early_init(U8500_PRCMU_BASE, SZ_8K - 1);
ux500_pm_init(U8500_PRCMU_BASE, SZ_8K - 1); ux500_pm_init(U8500_PRCMU_BASE, SZ_8K - 1);
......
/*
* Copyright (C) ST-Ericsson SA 2010
*
* Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
* License terms: GNU General Public License (GPL) version 2
*/
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/amba/bus.h>
#include <linux/amba/pl022.h>
#include <linux/mfd/dbx500-prcmu.h>
#include "setup.h"
#include "irqs.h"
#include "db8500-regs.h"
#include "devices-db8500.h"
struct prcmu_pdata db8500_prcmu_pdata = {
.ab_platdata = &ab8500_platdata,
.ab_irq = IRQ_DB8500_AB8500,
.irq_base = IRQ_PRCMU_BASE,
.version_offset = DB8500_PRCMU_FW_VERSION_OFFSET,
.legacy_offset = DB8500_PRCMU_LEGACY_OFFSET,
};
/*
* Copyright (C) ST-Ericsson SA 2010
*
* Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
* License terms: GNU General Public License (GPL), version 2.
*/
#ifndef __DEVICES_DB8500_H
#define __DEVICES_DB8500_H
#include "irqs.h"
#include "db8500-regs.h"
struct platform_device;
extern struct ab8500_platform_data ab8500_platdata;
extern struct prcmu_pdata db8500_prcmu_pdata;
#endif
/*
* Copyright (C) ST-Ericsson SA 2010
*
* Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
* License terms: GNU General Public License (GPL) version 2
*/
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/amba/bus.h>
#include "setup.h"
#include "db8500-regs.h"
void __init amba_add_devices(struct amba_device *devs[], int num)
{
int i;
for (i = 0; i < num; i++) {
struct amba_device *d = devs[i];
amba_device_register(d, &iomem_resource);
}
}
/*
* Copyright (C) ST-Ericsson SA 2010
*
* License terms: GNU General Public License (GPL) version 2
*/
#ifndef __ASM_ARCH_DEVICES_H__
#define __ASM_ARCH_DEVICES_H__
struct platform_device;
struct amba_device;
extern struct amba_device ux500_pl031_device;
#endif
...@@ -19,17 +19,11 @@ ...@@ -19,17 +19,11 @@
void ux500_restart(enum reboot_mode mode, const char *cmd); void ux500_restart(enum reboot_mode mode, const char *cmd);
void __init ux500_map_io(void); void __init ux500_map_io(void);
extern void __init u8500_map_io(void);
extern struct device * __init u8500_init_devices(void);
extern void __init ux500_init_irq(void); extern void __init ux500_init_irq(void);
extern struct device *ux500_soc_device_init(const char *soc_id); extern struct device *ux500_soc_device_init(const char *soc_id);
struct amba_device;
extern void __init amba_add_devices(struct amba_device *devs[], int num);
extern void ux500_timer_init(void); extern void ux500_timer_init(void);
#define __IO_DEV_DESC(x, sz) { \ #define __IO_DEV_DESC(x, sz) { \
......
...@@ -10,40 +10,12 @@ ...@@ -10,40 +10,12 @@
#include <linux/clocksource.h> #include <linux/clocksource.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/platform_data/clocksource-nomadik-mtu.h>
#include <asm/smp_twd.h>
#include "setup.h" #include "setup.h"
#include "irqs.h"
#include "db8500-regs.h" #include "db8500-regs.h"
#include "id.h" #include "id.h"
#ifdef CONFIG_HAVE_ARM_TWD
static DEFINE_TWD_LOCAL_TIMER(u8500_twd_local_timer,
U8500_TWD_BASE, IRQ_LOCALTIMER);
static void __init ux500_twd_init(void)
{
struct twd_local_timer *twd_local_timer;
int err;
/* Use this to switch local timer base if changed in new ASICs */
twd_local_timer = &u8500_twd_local_timer;
if (of_have_populated_dt())
clocksource_of_init();
else {
err = twd_local_timer_register(twd_local_timer);
if (err)
pr_err("twd_local_timer_register failed %d\n", err);
}
}
#else
#define ux500_twd_init() do { } while(0)
#endif
const static struct of_device_id prcmu_timer_of_match[] __initconst = { const static struct of_device_id prcmu_timer_of_match[] __initconst = {
{ .compatible = "stericsson,db8500-prcmu-timer-4", }, { .compatible = "stericsson,db8500-prcmu-timer-4", },
{ }, { },
...@@ -51,24 +23,17 @@ const static struct of_device_id prcmu_timer_of_match[] __initconst = { ...@@ -51,24 +23,17 @@ const static struct of_device_id prcmu_timer_of_match[] __initconst = {
void __init ux500_timer_init(void) void __init ux500_timer_init(void)
{ {
void __iomem *mtu_timer_base;
void __iomem *prcmu_timer_base; void __iomem *prcmu_timer_base;
void __iomem *tmp_base; void __iomem *tmp_base;
struct device_node *np; struct device_node *np;
if (cpu_is_u8500_family() || cpu_is_ux540_family()) { if (cpu_is_u8500_family() || cpu_is_ux540_family())
mtu_timer_base = __io_address(U8500_MTU0_BASE);
prcmu_timer_base = __io_address(U8500_PRCMU_TIMER_4_BASE); prcmu_timer_base = __io_address(U8500_PRCMU_TIMER_4_BASE);
} else { else
ux500_unknown_soc(); ux500_unknown_soc();
}
/* TODO: Once MTU has been DT:ed place code above into else. */
if (of_have_populated_dt()) {
#ifdef CONFIG_OF
np = of_find_matching_node(NULL, prcmu_timer_of_match); np = of_find_matching_node(NULL, prcmu_timer_of_match);
if (!np) if (!np)
#endif
goto dt_fail; goto dt_fail;
tmp_base = of_iomap(np, 0); tmp_base = of_iomap(np, 0);
...@@ -76,29 +41,8 @@ void __init ux500_timer_init(void) ...@@ -76,29 +41,8 @@ void __init ux500_timer_init(void)
goto dt_fail; goto dt_fail;
prcmu_timer_base = tmp_base; prcmu_timer_base = tmp_base;
}
dt_fail: dt_fail:
/* Doing it the old fashioned way. */
/*
* Here we register the timerblocks active in the system.
* Localtimers (twd) is started when both cpu is up and running.
* MTU register a clocksource, clockevent and sched_clock.
* Since the MTU is located in the VAPE power domain
* it will be cleared in sleep which makes it unsuitable.
* We however need it as a timer tick (clockevent)
* during boot to calibrate delay until twd is started.
* RTC-RTT have problems as timer tick during boot since it is
* depending on delay which is not yet calibrated. RTC-RTT is in the
* always-on powerdomain and is used as clockevent instead of twd when
* sleeping.
* The PRCMU timer 4 register a clocksource and
* sched_clock with higher rating then MTU since is always-on.
*
*/
if (!of_have_populated_dt())
nmdk_timer_init(mtu_timer_base, IRQ_MTU0);
clksrc_dbx500_prcmu_init(prcmu_timer_base); clksrc_dbx500_prcmu_init(prcmu_timer_base);
ux500_twd_init(); clocksource_of_init();
} }
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/platform_data/clocksource-nomadik-mtu.h>
#include <linux/sched_clock.h> #include <linux/sched_clock.h>
#include <asm/mach/time.h> #include <asm/mach/time.h>
...@@ -103,7 +102,7 @@ static int nmdk_clkevt_next(unsigned long evt, struct clock_event_device *ev) ...@@ -103,7 +102,7 @@ static int nmdk_clkevt_next(unsigned long evt, struct clock_event_device *ev)
return 0; return 0;
} }
void nmdk_clkevt_reset(void) static void nmdk_clkevt_reset(void)
{ {
if (clkevt_periodic) { if (clkevt_periodic) {
/* Timer: configure load and background-load, and fire it up */ /* Timer: configure load and background-load, and fire it up */
...@@ -144,7 +143,7 @@ static void nmdk_clkevt_mode(enum clock_event_mode mode, ...@@ -144,7 +143,7 @@ static void nmdk_clkevt_mode(enum clock_event_mode mode,
} }
} }
void nmdk_clksrc_reset(void) static void nmdk_clksrc_reset(void)
{ {
/* Disable */ /* Disable */
writel(0, mtu_base + MTU_CR(0)); writel(0, mtu_base + MTU_CR(0));
...@@ -192,7 +191,7 @@ static struct irqaction nmdk_timer_irq = { ...@@ -192,7 +191,7 @@ static struct irqaction nmdk_timer_irq = {
.dev_id = &nmdk_clkevt, .dev_id = &nmdk_clkevt,
}; };
static void __init __nmdk_timer_init(void __iomem *base, int irq, static void __init nmdk_timer_init(void __iomem *base, int irq,
struct clk *pclk, struct clk *clk) struct clk *pclk, struct clk *clk)
{ {
unsigned long rate; unsigned long rate;
...@@ -245,18 +244,6 @@ static void __init __nmdk_timer_init(void __iomem *base, int irq, ...@@ -245,18 +244,6 @@ static void __init __nmdk_timer_init(void __iomem *base, int irq,
register_current_timer_delay(&mtu_delay_timer); register_current_timer_delay(&mtu_delay_timer);
} }
void __init nmdk_timer_init(void __iomem *base, int irq)
{
struct clk *clk0, *pclk0;
pclk0 = clk_get_sys("mtu0", "apb_pclk");
BUG_ON(IS_ERR(pclk0));
clk0 = clk_get_sys("mtu0", NULL);
BUG_ON(IS_ERR(clk0));
__nmdk_timer_init(base, irq, pclk0, clk0);
}
static void __init nmdk_timer_of_init(struct device_node *node) static void __init nmdk_timer_of_init(struct device_node *node)
{ {
struct clk *pclk; struct clk *pclk;
...@@ -280,7 +267,7 @@ static void __init nmdk_timer_of_init(struct device_node *node) ...@@ -280,7 +267,7 @@ static void __init nmdk_timer_of_init(struct device_node *node)
if (irq <= 0) if (irq <= 0)
panic("Can't parse IRQ"); panic("Can't parse IRQ");
__nmdk_timer_init(base, irq, pclk, clk); nmdk_timer_init(base, irq, pclk, clk);
} }
CLOCKSOURCE_OF_DECLARE(nomadik_mtu, "st,nomadik-mtu", CLOCKSOURCE_OF_DECLARE(nomadik_mtu, "st,nomadik-mtu",
nmdk_timer_of_init); nmdk_timer_of_init);
...@@ -2409,6 +2409,7 @@ static void d40_set_prio_realtime(struct d40_chan *d40c) ...@@ -2409,6 +2409,7 @@ static void d40_set_prio_realtime(struct d40_chan *d40c)
#define D40_DT_FLAGS_DIR(flags) ((flags >> 1) & 0x1) #define D40_DT_FLAGS_DIR(flags) ((flags >> 1) & 0x1)
#define D40_DT_FLAGS_BIG_ENDIAN(flags) ((flags >> 2) & 0x1) #define D40_DT_FLAGS_BIG_ENDIAN(flags) ((flags >> 2) & 0x1)
#define D40_DT_FLAGS_FIXED_CHAN(flags) ((flags >> 3) & 0x1) #define D40_DT_FLAGS_FIXED_CHAN(flags) ((flags >> 3) & 0x1)
#define D40_DT_FLAGS_HIGH_PRIO(flags) ((flags >> 4) & 0x1)
static struct dma_chan *d40_xlate(struct of_phandle_args *dma_spec, static struct dma_chan *d40_xlate(struct of_phandle_args *dma_spec,
struct of_dma *ofdma) struct of_dma *ofdma)
...@@ -2446,6 +2447,9 @@ static struct dma_chan *d40_xlate(struct of_phandle_args *dma_spec, ...@@ -2446,6 +2447,9 @@ static struct dma_chan *d40_xlate(struct of_phandle_args *dma_spec,
cfg.use_fixed_channel = true; cfg.use_fixed_channel = true;
} }
if (D40_DT_FLAGS_HIGH_PRIO(flags))
cfg.high_priority = true;
return dma_request_channel(cap, stedma40_filter, &cfg); return dma_request_channel(cap, stedma40_filter, &cfg);
} }
......
This diff is collapsed.
#ifndef PINCTRL_PINCTRL_NOMADIK_H #ifndef PINCTRL_PINCTRL_NOMADIK_H
#define PINCTRL_PINCTRL_NOMADIK_H #define PINCTRL_PINCTRL_NOMADIK_H
#include <linux/platform_data/pinctrl-nomadik.h>
/* Package definitions */ /* Package definitions */
#define PINCTRL_NMK_STN8815 0 #define PINCTRL_NMK_STN8815 0
#define PINCTRL_NMK_DB8500 1 #define PINCTRL_NMK_DB8500 1
#define PINCTRL_NMK_DB8540 2 #define PINCTRL_NMK_DB8540 2
/* Alternate functions: function C is set in hw by setting both A and B */
#define NMK_GPIO_ALT_GPIO 0
#define NMK_GPIO_ALT_A 1
#define NMK_GPIO_ALT_B 2
#define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B)
#define NMK_GPIO_ALT_CX_SHIFT 2
#define NMK_GPIO_ALT_C1 ((1<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
#define NMK_GPIO_ALT_C2 ((2<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
#define NMK_GPIO_ALT_C3 ((3<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
#define NMK_GPIO_ALT_C4 ((4<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
#define PRCM_GPIOCR_ALTCX(pin_num,\ #define PRCM_GPIOCR_ALTCX(pin_num,\
altc1_used, altc1_ri, altc1_cb,\ altc1_used, altc1_ri, altc1_cb,\
altc2_used, altc2_ri, altc2_cb,\ altc2_used, altc2_ri, altc2_cb,\
......
#ifndef __PLAT_MTU_H
#define __PLAT_MTU_H
void nmdk_timer_init(void __iomem *base, int irq);
void nmdk_clkevt_reset(void);
void nmdk_clksrc_reset(void);
#endif /* __PLAT_MTU_H */
/*
* Structures and registers for GPIO access in the Nomadik SoC
*
* Copyright (C) 2008 STMicroelectronics
* Author: Prafulla WADASKAR <prafulla.wadaskar@st.com>
* Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it>
*
* 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 __PLAT_NOMADIK_GPIO
#define __PLAT_NOMADIK_GPIO
/*
* pin configurations are represented by 32-bit integers:
*
* bit 0.. 8 - Pin Number (512 Pins Maximum)
* bit 9..10 - Alternate Function Selection
* bit 11..12 - Pull up/down state
* bit 13 - Sleep mode behaviour
* bit 14 - Direction
* bit 15 - Value (if output)
* bit 16..18 - SLPM pull up/down state
* bit 19..20 - SLPM direction
* bit 21..22 - SLPM Value (if output)
* bit 23..25 - PDIS value (if input)
* bit 26 - Gpio mode
* bit 27 - Sleep mode
*
* to facilitate the definition, the following macros are provided
*
* PIN_CFG_DEFAULT - default config (0):
* pull up/down = disabled
* sleep mode = input/wakeup
* direction = input
* value = low
* SLPM direction = same as normal
* SLPM pull = same as normal
* SLPM value = same as normal
*
* PIN_CFG - default config with alternate function
*/
typedef unsigned long pin_cfg_t;
#define PIN_NUM_MASK 0x1ff
#define PIN_NUM(x) ((x) & PIN_NUM_MASK)
#define PIN_ALT_SHIFT 9
#define PIN_ALT_MASK (0x3 << PIN_ALT_SHIFT)
#define PIN_ALT(x) (((x) & PIN_ALT_MASK) >> PIN_ALT_SHIFT)
#define PIN_GPIO (NMK_GPIO_ALT_GPIO << PIN_ALT_SHIFT)
#define PIN_ALT_A (NMK_GPIO_ALT_A << PIN_ALT_SHIFT)
#define PIN_ALT_B (NMK_GPIO_ALT_B << PIN_ALT_SHIFT)
#define PIN_ALT_C (NMK_GPIO_ALT_C << PIN_ALT_SHIFT)
#define PIN_PULL_SHIFT 11
#define PIN_PULL_MASK (0x3 << PIN_PULL_SHIFT)
#define PIN_PULL(x) (((x) & PIN_PULL_MASK) >> PIN_PULL_SHIFT)
#define PIN_PULL_NONE (NMK_GPIO_PULL_NONE << PIN_PULL_SHIFT)
#define PIN_PULL_UP (NMK_GPIO_PULL_UP << PIN_PULL_SHIFT)
#define PIN_PULL_DOWN (NMK_GPIO_PULL_DOWN << PIN_PULL_SHIFT)
#define PIN_SLPM_SHIFT 13
#define PIN_SLPM_MASK (0x1 << PIN_SLPM_SHIFT)
#define PIN_SLPM(x) (((x) & PIN_SLPM_MASK) >> PIN_SLPM_SHIFT)
#define PIN_SLPM_MAKE_INPUT (NMK_GPIO_SLPM_INPUT << PIN_SLPM_SHIFT)
#define PIN_SLPM_NOCHANGE (NMK_GPIO_SLPM_NOCHANGE << PIN_SLPM_SHIFT)
/* These two replace the above in DB8500v2+ */
#define PIN_SLPM_WAKEUP_ENABLE (NMK_GPIO_SLPM_WAKEUP_ENABLE << PIN_SLPM_SHIFT)
#define PIN_SLPM_WAKEUP_DISABLE (NMK_GPIO_SLPM_WAKEUP_DISABLE << PIN_SLPM_SHIFT)
#define PIN_SLPM_USE_MUX_SETTINGS_IN_SLEEP PIN_SLPM_WAKEUP_DISABLE
#define PIN_SLPM_GPIO PIN_SLPM_WAKEUP_ENABLE /* In SLPM, pin is a gpio */
#define PIN_SLPM_ALTFUNC PIN_SLPM_WAKEUP_DISABLE /* In SLPM, pin is altfunc */
#define PIN_DIR_SHIFT 14
#define PIN_DIR_MASK (0x1 << PIN_DIR_SHIFT)
#define PIN_DIR(x) (((x) & PIN_DIR_MASK) >> PIN_DIR_SHIFT)
#define PIN_DIR_INPUT (0 << PIN_DIR_SHIFT)
#define PIN_DIR_OUTPUT (1 << PIN_DIR_SHIFT)
#define PIN_VAL_SHIFT 15
#define PIN_VAL_MASK (0x1 << PIN_VAL_SHIFT)
#define PIN_VAL(x) (((x) & PIN_VAL_MASK) >> PIN_VAL_SHIFT)
#define PIN_VAL_LOW (0 << PIN_VAL_SHIFT)
#define PIN_VAL_HIGH (1 << PIN_VAL_SHIFT)
#define PIN_SLPM_PULL_SHIFT 16
#define PIN_SLPM_PULL_MASK (0x7 << PIN_SLPM_PULL_SHIFT)
#define PIN_SLPM_PULL(x) \
(((x) & PIN_SLPM_PULL_MASK) >> PIN_SLPM_PULL_SHIFT)
#define PIN_SLPM_PULL_NONE \
((1 + NMK_GPIO_PULL_NONE) << PIN_SLPM_PULL_SHIFT)
#define PIN_SLPM_PULL_UP \
((1 + NMK_GPIO_PULL_UP) << PIN_SLPM_PULL_SHIFT)
#define PIN_SLPM_PULL_DOWN \
((1 + NMK_GPIO_PULL_DOWN) << PIN_SLPM_PULL_SHIFT)
#define PIN_SLPM_DIR_SHIFT 19
#define PIN_SLPM_DIR_MASK (0x3 << PIN_SLPM_DIR_SHIFT)
#define PIN_SLPM_DIR(x) \
(((x) & PIN_SLPM_DIR_MASK) >> PIN_SLPM_DIR_SHIFT)
#define PIN_SLPM_DIR_INPUT ((1 + 0) << PIN_SLPM_DIR_SHIFT)
#define PIN_SLPM_DIR_OUTPUT ((1 + 1) << PIN_SLPM_DIR_SHIFT)
#define PIN_SLPM_VAL_SHIFT 21
#define PIN_SLPM_VAL_MASK (0x3 << PIN_SLPM_VAL_SHIFT)
#define PIN_SLPM_VAL(x) \
(((x) & PIN_SLPM_VAL_MASK) >> PIN_SLPM_VAL_SHIFT)
#define PIN_SLPM_VAL_LOW ((1 + 0) << PIN_SLPM_VAL_SHIFT)
#define PIN_SLPM_VAL_HIGH ((1 + 1) << PIN_SLPM_VAL_SHIFT)
#define PIN_SLPM_PDIS_SHIFT 23
#define PIN_SLPM_PDIS_MASK (0x3 << PIN_SLPM_PDIS_SHIFT)
#define PIN_SLPM_PDIS(x) \
(((x) & PIN_SLPM_PDIS_MASK) >> PIN_SLPM_PDIS_SHIFT)
#define PIN_SLPM_PDIS_NO_CHANGE (0 << PIN_SLPM_PDIS_SHIFT)
#define PIN_SLPM_PDIS_DISABLED (1 << PIN_SLPM_PDIS_SHIFT)
#define PIN_SLPM_PDIS_ENABLED (2 << PIN_SLPM_PDIS_SHIFT)
#define PIN_LOWEMI_SHIFT 25
#define PIN_LOWEMI_MASK (0x1 << PIN_LOWEMI_SHIFT)
#define PIN_LOWEMI(x) (((x) & PIN_LOWEMI_MASK) >> PIN_LOWEMI_SHIFT)
#define PIN_LOWEMI_DISABLED (0 << PIN_LOWEMI_SHIFT)
#define PIN_LOWEMI_ENABLED (1 << PIN_LOWEMI_SHIFT)
#define PIN_GPIOMODE_SHIFT 26
#define PIN_GPIOMODE_MASK (0x1 << PIN_GPIOMODE_SHIFT)
#define PIN_GPIOMODE(x) (((x) & PIN_GPIOMODE_MASK) >> PIN_GPIOMODE_SHIFT)
#define PIN_GPIOMODE_DISABLED (0 << PIN_GPIOMODE_SHIFT)
#define PIN_GPIOMODE_ENABLED (1 << PIN_GPIOMODE_SHIFT)
#define PIN_SLEEPMODE_SHIFT 27
#define PIN_SLEEPMODE_MASK (0x1 << PIN_SLEEPMODE_SHIFT)
#define PIN_SLEEPMODE(x) (((x) & PIN_SLEEPMODE_MASK) >> PIN_SLEEPMODE_SHIFT)
#define PIN_SLEEPMODE_DISABLED (0 << PIN_SLEEPMODE_SHIFT)
#define PIN_SLEEPMODE_ENABLED (1 << PIN_SLEEPMODE_SHIFT)
/* Shortcuts. Use these instead of separate DIR, PULL, and VAL. */
#define PIN_INPUT_PULLDOWN (PIN_DIR_INPUT | PIN_PULL_DOWN)
#define PIN_INPUT_PULLUP (PIN_DIR_INPUT | PIN_PULL_UP)
#define PIN_INPUT_NOPULL (PIN_DIR_INPUT | PIN_PULL_NONE)
#define PIN_OUTPUT_LOW (PIN_DIR_OUTPUT | PIN_VAL_LOW)
#define PIN_OUTPUT_HIGH (PIN_DIR_OUTPUT | PIN_VAL_HIGH)
#define PIN_SLPM_INPUT_PULLDOWN (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_DOWN)
#define PIN_SLPM_INPUT_PULLUP (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_UP)
#define PIN_SLPM_INPUT_NOPULL (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_NONE)
#define PIN_SLPM_OUTPUT_LOW (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_LOW)
#define PIN_SLPM_OUTPUT_HIGH (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_HIGH)
#define PIN_CFG_DEFAULT (0)
#define PIN_CFG(num, alt) \
(PIN_CFG_DEFAULT |\
(PIN_NUM(num) | PIN_##alt))
#define PIN_CFG_INPUT(num, alt, pull) \
(PIN_CFG_DEFAULT |\
(PIN_NUM(num) | PIN_##alt | PIN_INPUT_##pull))
#define PIN_CFG_OUTPUT(num, alt, val) \
(PIN_CFG_DEFAULT |\
(PIN_NUM(num) | PIN_##alt | PIN_OUTPUT_##val))
/*
* "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving
* the "gpio" namespace for generic and cross-machine functions
*/
#define GPIO_BLOCK_SHIFT 5
#define NMK_GPIO_PER_CHIP (1 << GPIO_BLOCK_SHIFT)
/* Register in the logic block */
#define NMK_GPIO_DAT 0x00
#define NMK_GPIO_DATS 0x04
#define NMK_GPIO_DATC 0x08
#define NMK_GPIO_PDIS 0x0c
#define NMK_GPIO_DIR 0x10
#define NMK_GPIO_DIRS 0x14
#define NMK_GPIO_DIRC 0x18
#define NMK_GPIO_SLPC 0x1c
#define NMK_GPIO_AFSLA 0x20
#define NMK_GPIO_AFSLB 0x24
#define NMK_GPIO_LOWEMI 0x28
#define NMK_GPIO_RIMSC 0x40
#define NMK_GPIO_FIMSC 0x44
#define NMK_GPIO_IS 0x48
#define NMK_GPIO_IC 0x4c
#define NMK_GPIO_RWIMSC 0x50
#define NMK_GPIO_FWIMSC 0x54
#define NMK_GPIO_WKS 0x58
/* These appear in DB8540 and later ASICs */
#define NMK_GPIO_EDGELEVEL 0x5C
#define NMK_GPIO_LEVEL 0x60
/* Alternate functions: function C is set in hw by setting both A and B */
#define NMK_GPIO_ALT_GPIO 0
#define NMK_GPIO_ALT_A 1
#define NMK_GPIO_ALT_B 2
#define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B)
#define NMK_GPIO_ALT_CX_SHIFT 2
#define NMK_GPIO_ALT_C1 ((1<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
#define NMK_GPIO_ALT_C2 ((2<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
#define NMK_GPIO_ALT_C3 ((3<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
#define NMK_GPIO_ALT_C4 ((4<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
/* Pull up/down values */
enum nmk_gpio_pull {
NMK_GPIO_PULL_NONE,
NMK_GPIO_PULL_UP,
NMK_GPIO_PULL_DOWN,
};
/* Sleep mode */
enum nmk_gpio_slpm {
NMK_GPIO_SLPM_INPUT,
NMK_GPIO_SLPM_WAKEUP_ENABLE = NMK_GPIO_SLPM_INPUT,
NMK_GPIO_SLPM_NOCHANGE,
NMK_GPIO_SLPM_WAKEUP_DISABLE = NMK_GPIO_SLPM_NOCHANGE,
};
/*
* Platform data to register a block: only the initial gpio/irq number.
*/
struct nmk_gpio_platform_data {
char *name;
int first_gpio;
int first_irq;
int num_gpio;
u32 (*get_secondary_status)(unsigned int bank);
void (*set_ioforce)(bool enable);
bool supports_sleepmode;
};
#endif /* __PLAT_NOMADIK_GPIO */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment