Commit 0fcbffc4 authored by Arnd Bergmann's avatar Arnd Bergmann

Merge tag 'berlin-simple-mfd-4.2-1' of...

Merge tag 'berlin-simple-mfd-4.2-1' of git://git.infradead.org/users/hesselba/linux-berlin into next/drivers

Merge "Berlin simple-mfd for v4.2" from Sebastian Hesselbarth:
- based on arm-soc drivers/simple-mfd branch
- rework of chip/system ctrl nodes to simple-mfd probing for
  clk, pinctrl, and reset
- add adc node

* tag 'berlin-simple-mfd-4.2-1' of git://git.infradead.org/users/hesselba/linux-berlin:
  ARM: berlin: add an ADC node for the BG2Q
  ARM: berlin: remove useless chip and system ctrl compatibles
  clk: berlin: drop direct of_iomap of nodes reg property
  ARM: berlin: move BG2Q clock node
  ARM: berlin: move BG2CD clock node
  ARM: berlin: move BG2 clock node
  clk: berlin: prepare simple-mfd conversion
  pinctrl: berlin: drop SoC stub provided regmap
  ARM: berlin: move pinctrl to simple-mfd nodes
  pinctrl: berlin: prepare to use regmap provided by syscon
  reset: berlin: drop arch_initcall initialization
  ARM: berlin: move reset to simple-mfd nodes
  reset: berlin: convert to a platform driver
  ARM: berlin: prepare simple-mfd/syscon conversion of sys/chip ctrl nodes
  ARM: berlin: select MFD_SYSCON by default
parents e532ffea 5be23611
...@@ -56,7 +56,7 @@ soc { ...@@ -56,7 +56,7 @@ soc {
sdhci0: sdhci@ab0000 { sdhci0: sdhci@ab0000 {
compatible = "mrvl,pxav3-mmc"; compatible = "mrvl,pxav3-mmc";
reg = <0xab0000 0x200>; reg = <0xab0000 0x200>;
clocks = <&chip CLKID_SDIO0XIN>, <&chip CLKID_SDIO0>; clocks = <&chip_clk CLKID_SDIO0XIN>, <&chip_clk CLKID_SDIO0>;
clock-names = "io", "core"; clock-names = "io", "core";
interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled"; status = "disabled";
...@@ -65,7 +65,7 @@ sdhci0: sdhci@ab0000 { ...@@ -65,7 +65,7 @@ sdhci0: sdhci@ab0000 {
sdhci1: sdhci@ab0800 { sdhci1: sdhci@ab0800 {
compatible = "mrvl,pxav3-mmc"; compatible = "mrvl,pxav3-mmc";
reg = <0xab0800 0x200>; reg = <0xab0800 0x200>;
clocks = <&chip CLKID_SDIO1XIN>, <&chip CLKID_SDIO1>; clocks = <&chip_clk CLKID_SDIO1XIN>, <&chip_clk CLKID_SDIO1>;
clock-names = "io", "core"; clock-names = "io", "core";
interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled"; status = "disabled";
...@@ -75,7 +75,7 @@ sdhci2: sdhci@ab1000 { ...@@ -75,7 +75,7 @@ sdhci2: sdhci@ab1000 {
compatible = "mrvl,pxav3-mmc"; compatible = "mrvl,pxav3-mmc";
reg = <0xab1000 0x200>; reg = <0xab1000 0x200>;
interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&chip CLKID_NFC_ECC>, <&chip CLKID_NFC>; clocks = <&chip_clk CLKID_NFC_ECC>, <&chip_clk CLKID_NFC>;
clock-names = "io", "core"; clock-names = "io", "core";
pinctrl-0 = <&emmc_pmux>; pinctrl-0 = <&emmc_pmux>;
pinctrl-names = "default"; pinctrl-names = "default";
...@@ -105,13 +105,13 @@ local-timer@ad0600 { ...@@ -105,13 +105,13 @@ local-timer@ad0600 {
compatible = "arm,cortex-a9-twd-timer"; compatible = "arm,cortex-a9-twd-timer";
reg = <0xad0600 0x20>; reg = <0xad0600 0x20>;
interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_HIGH)>; interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_HIGH)>;
clocks = <&chip CLKID_TWD>; clocks = <&chip_clk CLKID_TWD>;
}; };
eth1: ethernet@b90000 { eth1: ethernet@b90000 {
compatible = "marvell,pxa168-eth"; compatible = "marvell,pxa168-eth";
reg = <0xb90000 0x10000>; reg = <0xb90000 0x10000>;
clocks = <&chip CLKID_GETH1>; clocks = <&chip_clk CLKID_GETH1>;
interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
/* set by bootloader */ /* set by bootloader */
local-mac-address = [00 00 00 00 00 00]; local-mac-address = [00 00 00 00 00 00];
...@@ -134,7 +134,7 @@ cpu-ctrl@dd0000 { ...@@ -134,7 +134,7 @@ cpu-ctrl@dd0000 {
eth0: ethernet@e50000 { eth0: ethernet@e50000 {
compatible = "marvell,pxa168-eth"; compatible = "marvell,pxa168-eth";
reg = <0xe50000 0x10000>; reg = <0xe50000 0x10000>;
clocks = <&chip CLKID_GETH0>; clocks = <&chip_clk CLKID_GETH0>;
interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
/* set by bootloader */ /* set by bootloader */
local-mac-address = [00 00 00 00 00 00]; local-mac-address = [00 00 00 00 00 00];
...@@ -233,7 +233,7 @@ timer0: timer@2c00 { ...@@ -233,7 +233,7 @@ timer0: timer@2c00 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c00 0x14>; reg = <0x2c00 0x14>;
interrupts = <8>; interrupts = <8>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "okay"; status = "okay";
}; };
...@@ -242,7 +242,7 @@ timer1: timer@2c14 { ...@@ -242,7 +242,7 @@ timer1: timer@2c14 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c14 0x14>; reg = <0x2c14 0x14>;
interrupts = <9>; interrupts = <9>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "okay"; status = "okay";
}; };
...@@ -251,7 +251,7 @@ timer2: timer@2c28 { ...@@ -251,7 +251,7 @@ timer2: timer@2c28 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c28 0x14>; reg = <0x2c28 0x14>;
interrupts = <10>; interrupts = <10>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -260,7 +260,7 @@ timer3: timer@2c3c { ...@@ -260,7 +260,7 @@ timer3: timer@2c3c {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c3c 0x14>; reg = <0x2c3c 0x14>;
interrupts = <11>; interrupts = <11>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -269,7 +269,7 @@ timer4: timer@2c50 { ...@@ -269,7 +269,7 @@ timer4: timer@2c50 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c50 0x14>; reg = <0x2c50 0x14>;
interrupts = <12>; interrupts = <12>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -278,7 +278,7 @@ timer5: timer@2c64 { ...@@ -278,7 +278,7 @@ timer5: timer@2c64 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c64 0x14>; reg = <0x2c64 0x14>;
interrupts = <13>; interrupts = <13>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -287,7 +287,7 @@ timer6: timer@2c78 { ...@@ -287,7 +287,7 @@ timer6: timer@2c78 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c78 0x14>; reg = <0x2c78 0x14>;
interrupts = <14>; interrupts = <14>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -296,7 +296,7 @@ timer7: timer@2c8c { ...@@ -296,7 +296,7 @@ timer7: timer@2c8c {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c8c 0x14>; reg = <0x2c8c 0x14>;
interrupts = <15>; interrupts = <15>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -315,7 +315,7 @@ ahci: sata@e90000 { ...@@ -315,7 +315,7 @@ ahci: sata@e90000 {
compatible = "marvell,berlin2-ahci", "generic-ahci"; compatible = "marvell,berlin2-ahci", "generic-ahci";
reg = <0xe90000 0x1000>; reg = <0xe90000 0x1000>;
interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&chip CLKID_SATA>; clocks = <&chip_clk CLKID_SATA>;
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
...@@ -335,7 +335,7 @@ sata1: sata-port@1 { ...@@ -335,7 +335,7 @@ sata1: sata-port@1 {
sata_phy: phy@e900a0 { sata_phy: phy@e900a0 {
compatible = "marvell,berlin2-sata-phy"; compatible = "marvell,berlin2-sata-phy";
reg = <0xe900a0 0x200>; reg = <0xe900a0 0x200>;
clocks = <&chip CLKID_SATA>; clocks = <&chip_clk CLKID_SATA>;
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
#phy-cells = <1>; #phy-cells = <1>;
...@@ -351,16 +351,28 @@ sata-phy@1 { ...@@ -351,16 +351,28 @@ sata-phy@1 {
}; };
chip: chip-control@ea0000 { chip: chip-control@ea0000 {
compatible = "marvell,berlin2-chip-ctrl"; compatible = "simple-mfd", "syscon";
#clock-cells = <1>;
#reset-cells = <2>;
reg = <0xea0000 0x400>; reg = <0xea0000 0x400>;
clocks = <&refclk>;
clock-names = "refclk";
emmc_pmux: emmc-pmux { chip_clk: clock {
groups = "G26"; compatible = "marvell,berlin2-clk";
function = "emmc"; #clock-cells = <1>;
clocks = <&refclk>;
clock-names = "refclk";
};
soc_pinctrl: pin-controller {
compatible = "marvell,berlin2-soc-pinctrl";
emmc_pmux: emmc-pmux {
groups = "G26";
function = "emmc";
};
};
chip_rst: reset {
compatible = "marvell,berlin2-reset";
#reset-cells = <2>;
}; };
}; };
...@@ -442,22 +454,24 @@ uart2: serial@b000 { ...@@ -442,22 +454,24 @@ uart2: serial@b000 {
}; };
sysctrl: system-controller@d000 { sysctrl: system-controller@d000 {
compatible = "marvell,berlin2-system-ctrl"; compatible = "simple-mfd", "syscon";
reg = <0xd000 0x100>; reg = <0xd000 0x100>;
uart0_pmux: uart0-pmux { sys_pinctrl: pin-controller {
groups = "GSM4"; compatible = "marvell,berlin2-system-pinctrl";
function = "uart0"; uart0_pmux: uart0-pmux {
}; groups = "GSM4";
function = "uart0";
uart1_pmux: uart1-pmux { };
groups = "GSM5";
function = "uart1"; uart1_pmux: uart1-pmux {
}; groups = "GSM5";
function = "uart1";
uart2_pmux: uart2-pmux { };
groups = "GSM3"; uart2_pmux: uart2-pmux {
function = "uart2"; groups = "GSM3";
function = "uart2";
};
}; };
}; };
......
...@@ -53,7 +53,7 @@ pmu { ...@@ -53,7 +53,7 @@ pmu {
sdhci0: sdhci@ab0000 { sdhci0: sdhci@ab0000 {
compatible = "mrvl,pxav3-mmc"; compatible = "mrvl,pxav3-mmc";
reg = <0xab0000 0x200>; reg = <0xab0000 0x200>;
clocks = <&chip CLKID_SDIO0XIN>, <&chip CLKID_SDIO0>; clocks = <&chip_clk CLKID_SDIO0XIN>, <&chip_clk CLKID_SDIO0>;
clock-names = "io", "core"; clock-names = "io", "core";
interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled"; status = "disabled";
...@@ -77,14 +77,14 @@ local-timer@ad0600 { ...@@ -77,14 +77,14 @@ local-timer@ad0600 {
compatible = "arm,cortex-a9-twd-timer"; compatible = "arm,cortex-a9-twd-timer";
reg = <0xad0600 0x20>; reg = <0xad0600 0x20>;
interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_HIGH)>; interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_HIGH)>;
clocks = <&chip CLKID_TWD>; clocks = <&chip_clk CLKID_TWD>;
}; };
usb_phy0: usb-phy@b74000 { usb_phy0: usb-phy@b74000 {
compatible = "marvell,berlin2cd-usb-phy"; compatible = "marvell,berlin2cd-usb-phy";
reg = <0xb74000 0x128>; reg = <0xb74000 0x128>;
#phy-cells = <0>; #phy-cells = <0>;
resets = <&chip 0x178 23>; resets = <&chip_rst 0x178 23>;
status = "disabled"; status = "disabled";
}; };
...@@ -92,14 +92,14 @@ usb_phy1: usb-phy@b78000 { ...@@ -92,14 +92,14 @@ usb_phy1: usb-phy@b78000 {
compatible = "marvell,berlin2cd-usb-phy"; compatible = "marvell,berlin2cd-usb-phy";
reg = <0xb78000 0x128>; reg = <0xb78000 0x128>;
#phy-cells = <0>; #phy-cells = <0>;
resets = <&chip 0x178 24>; resets = <&chip_rst 0x178 24>;
status = "disabled"; status = "disabled";
}; };
eth1: ethernet@b90000 { eth1: ethernet@b90000 {
compatible = "marvell,pxa168-eth"; compatible = "marvell,pxa168-eth";
reg = <0xb90000 0x10000>; reg = <0xb90000 0x10000>;
clocks = <&chip CLKID_GETH1>; clocks = <&chip_clk CLKID_GETH1>;
interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
/* set by bootloader */ /* set by bootloader */
local-mac-address = [00 00 00 00 00 00]; local-mac-address = [00 00 00 00 00 00];
...@@ -117,7 +117,7 @@ ethphy1: ethernet-phy@0 { ...@@ -117,7 +117,7 @@ ethphy1: ethernet-phy@0 {
eth0: ethernet@e50000 { eth0: ethernet@e50000 {
compatible = "marvell,pxa168-eth"; compatible = "marvell,pxa168-eth";
reg = <0xe50000 0x10000>; reg = <0xe50000 0x10000>;
clocks = <&chip CLKID_GETH0>; clocks = <&chip_clk CLKID_GETH0>;
interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
/* set by bootloader */ /* set by bootloader */
local-mac-address = [00 00 00 00 00 00]; local-mac-address = [00 00 00 00 00 00];
...@@ -216,7 +216,7 @@ timer0: timer@2c00 { ...@@ -216,7 +216,7 @@ timer0: timer@2c00 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c00 0x14>; reg = <0x2c00 0x14>;
interrupts = <8>; interrupts = <8>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "okay"; status = "okay";
}; };
...@@ -225,7 +225,7 @@ timer1: timer@2c14 { ...@@ -225,7 +225,7 @@ timer1: timer@2c14 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c14 0x14>; reg = <0x2c14 0x14>;
interrupts = <9>; interrupts = <9>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "okay"; status = "okay";
}; };
...@@ -234,7 +234,7 @@ timer2: timer@2c28 { ...@@ -234,7 +234,7 @@ timer2: timer@2c28 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c28 0x14>; reg = <0x2c28 0x14>;
interrupts = <10>; interrupts = <10>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -243,7 +243,7 @@ timer3: timer@2c3c { ...@@ -243,7 +243,7 @@ timer3: timer@2c3c {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c3c 0x14>; reg = <0x2c3c 0x14>;
interrupts = <11>; interrupts = <11>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -252,7 +252,7 @@ timer4: timer@2c50 { ...@@ -252,7 +252,7 @@ timer4: timer@2c50 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c50 0x14>; reg = <0x2c50 0x14>;
interrupts = <12>; interrupts = <12>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -261,7 +261,7 @@ timer5: timer@2c64 { ...@@ -261,7 +261,7 @@ timer5: timer@2c64 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c64 0x14>; reg = <0x2c64 0x14>;
interrupts = <13>; interrupts = <13>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -270,7 +270,7 @@ timer6: timer@2c78 { ...@@ -270,7 +270,7 @@ timer6: timer@2c78 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c78 0x14>; reg = <0x2c78 0x14>;
interrupts = <14>; interrupts = <14>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -279,7 +279,7 @@ timer7: timer@2c8c { ...@@ -279,7 +279,7 @@ timer7: timer@2c8c {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c8c 0x14>; reg = <0x2c8c 0x14>;
interrupts = <15>; interrupts = <15>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -295,16 +295,28 @@ aic: interrupt-controller@3000 { ...@@ -295,16 +295,28 @@ aic: interrupt-controller@3000 {
}; };
chip: chip-control@ea0000 { chip: chip-control@ea0000 {
compatible = "marvell,berlin2cd-chip-ctrl"; compatible = "simple-mfd", "syscon";
#clock-cells = <1>;
#reset-cells = <2>;
reg = <0xea0000 0x400>; reg = <0xea0000 0x400>;
clocks = <&refclk>;
clock-names = "refclk";
uart0_pmux: uart0-pmux { chip_clk: clock {
groups = "G6"; compatible = "marvell,berlin2-clk";
function = "uart0"; #clock-cells = <1>;
clocks = <&refclk>;
clock-names = "refclk";
};
soc_pinctrl: pin-controller {
compatible = "marvell,berlin2cd-soc-pinctrl";
uart0_pmux: uart0-pmux {
groups = "G6";
function = "uart0";
};
};
chip_rst: reset {
compatible = "marvell,berlin2-reset";
#reset-cells = <2>;
}; };
}; };
...@@ -312,7 +324,7 @@ usb0: usb@ed0000 { ...@@ -312,7 +324,7 @@ usb0: usb@ed0000 {
compatible = "chipidea,usb2"; compatible = "chipidea,usb2";
reg = <0xed0000 0x200>; reg = <0xed0000 0x200>;
interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&chip CLKID_USB0>; clocks = <&chip_clk CLKID_USB0>;
phys = <&usb_phy0>; phys = <&usb_phy0>;
phy-names = "usb-phy"; phy-names = "usb-phy";
status = "disabled"; status = "disabled";
...@@ -322,7 +334,7 @@ usb1: usb@ee0000 { ...@@ -322,7 +334,7 @@ usb1: usb@ee0000 {
compatible = "chipidea,usb2"; compatible = "chipidea,usb2";
reg = <0xee0000 0x200>; reg = <0xee0000 0x200>;
interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&chip CLKID_USB1>; clocks = <&chip_clk CLKID_USB1>;
phys = <&usb_phy1>; phys = <&usb_phy1>;
phy-names = "usb-phy"; phy-names = "usb-phy";
status = "disabled"; status = "disabled";
...@@ -389,8 +401,12 @@ uart1: serial@a000 { ...@@ -389,8 +401,12 @@ uart1: serial@a000 {
}; };
sysctrl: system-controller@d000 { sysctrl: system-controller@d000 {
compatible = "marvell,berlin2cd-system-ctrl"; compatible = "simple-mfd", "syscon";
reg = <0xd000 0x100>; reg = <0xd000 0x100>;
sys_pinctrl: pin-controller {
compatible = "marvell,berlin2cd-system-pinctrl";
};
}; };
sic: interrupt-controller@e000 { sic: interrupt-controller@e000 {
......
...@@ -74,7 +74,7 @@ pmu { ...@@ -74,7 +74,7 @@ pmu {
sdhci0: sdhci@ab0000 { sdhci0: sdhci@ab0000 {
compatible = "mrvl,pxav3-mmc"; compatible = "mrvl,pxav3-mmc";
reg = <0xab0000 0x200>; reg = <0xab0000 0x200>;
clocks = <&chip CLKID_SDIO1XIN>; clocks = <&chip_clk CLKID_SDIO1XIN>;
interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled"; status = "disabled";
}; };
...@@ -82,7 +82,7 @@ sdhci0: sdhci@ab0000 { ...@@ -82,7 +82,7 @@ sdhci0: sdhci@ab0000 {
sdhci1: sdhci@ab0800 { sdhci1: sdhci@ab0800 {
compatible = "mrvl,pxav3-mmc"; compatible = "mrvl,pxav3-mmc";
reg = <0xab0800 0x200>; reg = <0xab0800 0x200>;
clocks = <&chip CLKID_SDIO1XIN>; clocks = <&chip_clk CLKID_SDIO1XIN>;
interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled"; status = "disabled";
}; };
...@@ -91,7 +91,7 @@ sdhci2: sdhci@ab1000 { ...@@ -91,7 +91,7 @@ sdhci2: sdhci@ab1000 {
compatible = "mrvl,pxav3-mmc"; compatible = "mrvl,pxav3-mmc";
reg = <0xab1000 0x200>; reg = <0xab1000 0x200>;
interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&chip CLKID_NFC_ECC>, <&chip CLKID_NFC>; clocks = <&chip_clk CLKID_NFC_ECC>, <&chip_clk CLKID_NFC>;
clock-names = "io", "core"; clock-names = "io", "core";
status = "disabled"; status = "disabled";
}; };
...@@ -112,7 +112,7 @@ scu: snoop-control-unit@ad0000 { ...@@ -112,7 +112,7 @@ scu: snoop-control-unit@ad0000 {
local-timer@ad0600 { local-timer@ad0600 {
compatible = "arm,cortex-a9-twd-timer"; compatible = "arm,cortex-a9-twd-timer";
reg = <0xad0600 0x20>; reg = <0xad0600 0x20>;
clocks = <&chip CLKID_TWD>; clocks = <&chip_clk CLKID_TWD>;
interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
}; };
...@@ -127,7 +127,7 @@ usb_phy2: phy@a2f400 { ...@@ -127,7 +127,7 @@ usb_phy2: phy@a2f400 {
compatible = "marvell,berlin2-usb-phy"; compatible = "marvell,berlin2-usb-phy";
reg = <0xa2f400 0x128>; reg = <0xa2f400 0x128>;
#phy-cells = <0>; #phy-cells = <0>;
resets = <&chip 0x104 14>; resets = <&chip_rst 0x104 14>;
status = "disabled"; status = "disabled";
}; };
...@@ -135,7 +135,7 @@ usb2: usb@a30000 { ...@@ -135,7 +135,7 @@ usb2: usb@a30000 {
compatible = "chipidea,usb2"; compatible = "chipidea,usb2";
reg = <0xa30000 0x10000>; reg = <0xa30000 0x10000>;
interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&chip CLKID_USB2>; clocks = <&chip_clk CLKID_USB2>;
phys = <&usb_phy2>; phys = <&usb_phy2>;
phy-names = "usb-phy"; phy-names = "usb-phy";
status = "disabled"; status = "disabled";
...@@ -145,7 +145,7 @@ usb_phy0: phy@b74000 { ...@@ -145,7 +145,7 @@ usb_phy0: phy@b74000 {
compatible = "marvell,berlin2-usb-phy"; compatible = "marvell,berlin2-usb-phy";
reg = <0xb74000 0x128>; reg = <0xb74000 0x128>;
#phy-cells = <0>; #phy-cells = <0>;
resets = <&chip 0x104 12>; resets = <&chip_rst 0x104 12>;
status = "disabled"; status = "disabled";
}; };
...@@ -153,14 +153,14 @@ usb_phy1: phy@b78000 { ...@@ -153,14 +153,14 @@ usb_phy1: phy@b78000 {
compatible = "marvell,berlin2-usb-phy"; compatible = "marvell,berlin2-usb-phy";
reg = <0xb78000 0x128>; reg = <0xb78000 0x128>;
#phy-cells = <0>; #phy-cells = <0>;
resets = <&chip 0x104 13>; resets = <&chip_rst 0x104 13>;
status = "disabled"; status = "disabled";
}; };
eth0: ethernet@b90000 { eth0: ethernet@b90000 {
compatible = "marvell,pxa168-eth"; compatible = "marvell,pxa168-eth";
reg = <0xb90000 0x10000>; reg = <0xb90000 0x10000>;
clocks = <&chip CLKID_GETH0>; clocks = <&chip_clk CLKID_GETH0>;
interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
/* set by bootloader */ /* set by bootloader */
local-mac-address = [00 00 00 00 00 00]; local-mac-address = [00 00 00 00 00 00];
...@@ -267,7 +267,7 @@ i2c0: i2c@1400 { ...@@ -267,7 +267,7 @@ i2c0: i2c@1400 {
reg = <0x1400 0x100>; reg = <0x1400 0x100>;
interrupt-parent = <&aic>; interrupt-parent = <&aic>;
interrupts = <4>; interrupts = <4>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
pinctrl-0 = <&twsi0_pmux>; pinctrl-0 = <&twsi0_pmux>;
pinctrl-names = "default"; pinctrl-names = "default";
status = "disabled"; status = "disabled";
...@@ -280,7 +280,7 @@ i2c1: i2c@1800 { ...@@ -280,7 +280,7 @@ i2c1: i2c@1800 {
reg = <0x1800 0x100>; reg = <0x1800 0x100>;
interrupt-parent = <&aic>; interrupt-parent = <&aic>;
interrupts = <5>; interrupts = <5>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
pinctrl-0 = <&twsi1_pmux>; pinctrl-0 = <&twsi1_pmux>;
pinctrl-names = "default"; pinctrl-names = "default";
status = "disabled"; status = "disabled";
...@@ -289,7 +289,7 @@ i2c1: i2c@1800 { ...@@ -289,7 +289,7 @@ i2c1: i2c@1800 {
timer0: timer@2c00 { timer0: timer@2c00 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c00 0x14>; reg = <0x2c00 0x14>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
interrupts = <8>; interrupts = <8>;
}; };
...@@ -297,14 +297,14 @@ timer0: timer@2c00 { ...@@ -297,14 +297,14 @@ timer0: timer@2c00 {
timer1: timer@2c14 { timer1: timer@2c14 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c14 0x14>; reg = <0x2c14 0x14>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
}; };
timer2: timer@2c28 { timer2: timer@2c28 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c28 0x14>; reg = <0x2c28 0x14>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -312,7 +312,7 @@ timer2: timer@2c28 { ...@@ -312,7 +312,7 @@ timer2: timer@2c28 {
timer3: timer@2c3c { timer3: timer@2c3c {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c3c 0x14>; reg = <0x2c3c 0x14>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -320,7 +320,7 @@ timer3: timer@2c3c { ...@@ -320,7 +320,7 @@ timer3: timer@2c3c {
timer4: timer@2c50 { timer4: timer@2c50 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c50 0x14>; reg = <0x2c50 0x14>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -328,7 +328,7 @@ timer4: timer@2c50 { ...@@ -328,7 +328,7 @@ timer4: timer@2c50 {
timer5: timer@2c64 { timer5: timer@2c64 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c64 0x14>; reg = <0x2c64 0x14>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -336,7 +336,7 @@ timer5: timer@2c64 { ...@@ -336,7 +336,7 @@ timer5: timer@2c64 {
timer6: timer@2c78 { timer6: timer@2c78 {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c78 0x14>; reg = <0x2c78 0x14>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -344,7 +344,7 @@ timer6: timer@2c78 { ...@@ -344,7 +344,7 @@ timer6: timer@2c78 {
timer7: timer@2c8c { timer7: timer@2c8c {
compatible = "snps,dw-apb-timer"; compatible = "snps,dw-apb-timer";
reg = <0x2c8c 0x14>; reg = <0x2c8c 0x14>;
clocks = <&chip CLKID_CFG>; clocks = <&chip_clk CLKID_CFG>;
clock-names = "timer"; clock-names = "timer";
status = "disabled"; status = "disabled";
}; };
...@@ -360,21 +360,33 @@ aic: interrupt-controller@3800 { ...@@ -360,21 +360,33 @@ aic: interrupt-controller@3800 {
}; };
chip: chip-control@ea0000 { chip: chip-control@ea0000 {
compatible = "marvell,berlin2q-chip-ctrl"; compatible = "simple-mfd", "syscon";
#clock-cells = <1>;
#reset-cells = <2>;
reg = <0xea0000 0x400>, <0xdd0170 0x10>; reg = <0xea0000 0x400>, <0xdd0170 0x10>;
clocks = <&refclk>;
clock-names = "refclk";
twsi0_pmux: twsi0-pmux { chip_clk: clock {
groups = "G6"; compatible = "marvell,berlin2q-clk";
function = "twsi0"; #clock-cells = <1>;
clocks = <&refclk>;
clock-names = "refclk";
}; };
twsi1_pmux: twsi1-pmux { soc_pinctrl: pin-controller {
groups = "G7"; compatible = "marvell,berlin2q-soc-pinctrl";
function = "twsi1";
twsi0_pmux: twsi0-pmux {
groups = "G6";
function = "twsi0";
};
twsi1_pmux: twsi1-pmux {
groups = "G7";
function = "twsi1";
};
};
chip_rst: reset {
compatible = "marvell,berlin2-reset";
#reset-cells = <2>;
}; };
}; };
...@@ -382,7 +394,7 @@ ahci: sata@e90000 { ...@@ -382,7 +394,7 @@ ahci: sata@e90000 {
compatible = "marvell,berlin2q-ahci", "generic-ahci"; compatible = "marvell,berlin2q-ahci", "generic-ahci";
reg = <0xe90000 0x1000>; reg = <0xe90000 0x1000>;
interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&chip CLKID_SATA>; clocks = <&chip_clk CLKID_SATA>;
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
...@@ -402,7 +414,7 @@ sata1: sata-port@1 { ...@@ -402,7 +414,7 @@ sata1: sata-port@1 {
sata_phy: phy@e900a0 { sata_phy: phy@e900a0 {
compatible = "marvell,berlin2q-sata-phy"; compatible = "marvell,berlin2q-sata-phy";
reg = <0xe900a0 0x200>; reg = <0xe900a0 0x200>;
clocks = <&chip CLKID_SATA>; clocks = <&chip_clk CLKID_SATA>;
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
#phy-cells = <1>; #phy-cells = <1>;
...@@ -421,7 +433,7 @@ usb0: usb@ed0000 { ...@@ -421,7 +433,7 @@ usb0: usb@ed0000 {
compatible = "chipidea,usb2"; compatible = "chipidea,usb2";
reg = <0xed0000 0x10000>; reg = <0xed0000 0x10000>;
interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&chip CLKID_USB0>; clocks = <&chip_clk CLKID_USB0>;
phys = <&usb_phy0>; phys = <&usb_phy0>;
phy-names = "usb-phy"; phy-names = "usb-phy";
status = "disabled"; status = "disabled";
...@@ -431,7 +443,7 @@ usb1: usb@ee0000 { ...@@ -431,7 +443,7 @@ usb1: usb@ee0000 {
compatible = "chipidea,usb2"; compatible = "chipidea,usb2";
reg = <0xee0000 0x10000>; reg = <0xee0000 0x10000>;
interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&chip CLKID_USB1>; clocks = <&chip_clk CLKID_USB1>;
phys = <&usb_phy1>; phys = <&usb_phy1>;
phy-names = "usb-phy"; phy-names = "usb-phy";
status = "disabled"; status = "disabled";
...@@ -526,27 +538,37 @@ porte: gpio-port@4 { ...@@ -526,27 +538,37 @@ porte: gpio-port@4 {
}; };
sysctrl: pin-controller@d000 { sysctrl: pin-controller@d000 {
compatible = "marvell,berlin2q-system-ctrl"; compatible = "simple-mfd", "syscon";
reg = <0xd000 0x100>; reg = <0xd000 0x100>;
uart0_pmux: uart0-pmux { sys_pinctrl: pin-controller {
groups = "GSM12"; compatible = "marvell,berlin2q-system-pinctrl";
function = "uart0";
};
uart1_pmux: uart1-pmux { uart0_pmux: uart0-pmux {
groups = "GSM14"; groups = "GSM12";
function = "uart1"; function = "uart0";
}; };
uart1_pmux: uart1-pmux {
groups = "GSM14";
function = "uart1";
};
twsi2_pmux: twsi2-pmux {
groups = "GSM13";
function = "twsi2";
};
twsi2_pmux: twsi2-pmux { twsi3_pmux: twsi3-pmux {
groups = "GSM13"; groups = "GSM14";
function = "twsi2"; function = "twsi3";
};
}; };
twsi3_pmux: twsi3-pmux { adc: adc {
groups = "GSM14"; compatible = "marvell,berlin2-adc";
function = "twsi3"; interrupts = <12>, <14>;
interrupt-names = "adc", "tsen";
}; };
}; };
......
...@@ -6,6 +6,7 @@ menuconfig ARCH_BERLIN ...@@ -6,6 +6,7 @@ menuconfig ARCH_BERLIN
select DW_APB_ICTL select DW_APB_ICTL
select DW_APB_TIMER_OF select DW_APB_TIMER_OF
select GENERIC_IRQ_CHIP select GENERIC_IRQ_CHIP
select MFD_SYSCON
select PINCTRL select PINCTRL
if ARCH_BERLIN if ARCH_BERLIN
......
...@@ -502,12 +502,13 @@ static const struct berlin2_gate_data bg2_gates[] __initconst = { ...@@ -502,12 +502,13 @@ static const struct berlin2_gate_data bg2_gates[] __initconst = {
static void __init berlin2_clock_setup(struct device_node *np) static void __init berlin2_clock_setup(struct device_node *np)
{ {
struct device_node *parent_np = of_get_parent(np);
const char *parent_names[9]; const char *parent_names[9];
struct clk *clk; struct clk *clk;
u8 avpll_flags = 0; u8 avpll_flags = 0;
int n; int n;
gbase = of_iomap(np, 0); gbase = of_iomap(parent_np, 0);
if (!gbase) if (!gbase)
return; return;
...@@ -685,7 +686,5 @@ static void __init berlin2_clock_setup(struct device_node *np) ...@@ -685,7 +686,5 @@ static void __init berlin2_clock_setup(struct device_node *np)
bg2_fail: bg2_fail:
iounmap(gbase); iounmap(gbase);
} }
CLK_OF_DECLARE(berlin2_clock, "marvell,berlin2-chip-ctrl", CLK_OF_DECLARE(berlin2_clk, "marvell,berlin2-clk",
berlin2_clock_setup);
CLK_OF_DECLARE(berlin2cd_clock, "marvell,berlin2cd-chip-ctrl",
berlin2_clock_setup); berlin2_clock_setup);
...@@ -290,18 +290,19 @@ static const struct berlin2_gate_data bg2q_gates[] __initconst = { ...@@ -290,18 +290,19 @@ static const struct berlin2_gate_data bg2q_gates[] __initconst = {
static void __init berlin2q_clock_setup(struct device_node *np) static void __init berlin2q_clock_setup(struct device_node *np)
{ {
struct device_node *parent_np = of_get_parent(np);
const char *parent_names[9]; const char *parent_names[9];
struct clk *clk; struct clk *clk;
int n; int n;
gbase = of_iomap(np, 0); gbase = of_iomap(parent_np, 0);
if (!gbase) { if (!gbase) {
pr_err("%s: Unable to map global base\n", np->full_name); pr_err("%s: Unable to map global base\n", np->full_name);
return; return;
} }
/* BG2Q CPU PLL is not part of global registers */ /* BG2Q CPU PLL is not part of global registers */
cpupll_base = of_iomap(np, 1); cpupll_base = of_iomap(parent_np, 1);
if (!cpupll_base) { if (!cpupll_base) {
pr_err("%s: Unable to map cpupll base\n", np->full_name); pr_err("%s: Unable to map cpupll base\n", np->full_name);
iounmap(gbase); iounmap(gbase);
...@@ -384,5 +385,5 @@ static void __init berlin2q_clock_setup(struct device_node *np) ...@@ -384,5 +385,5 @@ static void __init berlin2q_clock_setup(struct device_node *np)
iounmap(cpupll_base); iounmap(cpupll_base);
iounmap(gbase); iounmap(gbase);
} }
CLK_OF_DECLARE(berlin2q_clock, "marvell,berlin2q-chip-ctrl", CLK_OF_DECLARE(berlin2q_clk, "marvell,berlin2q-clk",
berlin2q_clock_setup); berlin2q_clock_setup);
...@@ -218,11 +218,11 @@ static const struct berlin_pinctrl_desc berlin2_sysmgr_pinctrl_data = { ...@@ -218,11 +218,11 @@ static const struct berlin_pinctrl_desc berlin2_sysmgr_pinctrl_data = {
static const struct of_device_id berlin2_pinctrl_match[] = { static const struct of_device_id berlin2_pinctrl_match[] = {
{ {
.compatible = "marvell,berlin2-chip-ctrl", .compatible = "marvell,berlin2-soc-pinctrl",
.data = &berlin2_soc_pinctrl_data .data = &berlin2_soc_pinctrl_data
}, },
{ {
.compatible = "marvell,berlin2-system-ctrl", .compatible = "marvell,berlin2-system-pinctrl",
.data = &berlin2_sysmgr_pinctrl_data .data = &berlin2_sysmgr_pinctrl_data
}, },
{} {}
...@@ -233,28 +233,6 @@ static int berlin2_pinctrl_probe(struct platform_device *pdev) ...@@ -233,28 +233,6 @@ static int berlin2_pinctrl_probe(struct platform_device *pdev)
{ {
const struct of_device_id *match = const struct of_device_id *match =
of_match_device(berlin2_pinctrl_match, &pdev->dev); of_match_device(berlin2_pinctrl_match, &pdev->dev);
struct regmap_config *rmconfig;
struct regmap *regmap;
struct resource *res;
void __iomem *base;
rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
if (!rmconfig)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base))
return PTR_ERR(base);
rmconfig->reg_bits = 32,
rmconfig->val_bits = 32,
rmconfig->reg_stride = 4,
rmconfig->max_register = resource_size(res);
regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
return berlin_pinctrl_probe(pdev, match->data); return berlin_pinctrl_probe(pdev, match->data);
} }
......
...@@ -161,11 +161,11 @@ static const struct berlin_pinctrl_desc berlin2cd_sysmgr_pinctrl_data = { ...@@ -161,11 +161,11 @@ static const struct berlin_pinctrl_desc berlin2cd_sysmgr_pinctrl_data = {
static const struct of_device_id berlin2cd_pinctrl_match[] = { static const struct of_device_id berlin2cd_pinctrl_match[] = {
{ {
.compatible = "marvell,berlin2cd-chip-ctrl", .compatible = "marvell,berlin2cd-soc-pinctrl",
.data = &berlin2cd_soc_pinctrl_data .data = &berlin2cd_soc_pinctrl_data
}, },
{ {
.compatible = "marvell,berlin2cd-system-ctrl", .compatible = "marvell,berlin2cd-system-pinctrl",
.data = &berlin2cd_sysmgr_pinctrl_data .data = &berlin2cd_sysmgr_pinctrl_data
}, },
{} {}
...@@ -176,28 +176,6 @@ static int berlin2cd_pinctrl_probe(struct platform_device *pdev) ...@@ -176,28 +176,6 @@ static int berlin2cd_pinctrl_probe(struct platform_device *pdev)
{ {
const struct of_device_id *match = const struct of_device_id *match =
of_match_device(berlin2cd_pinctrl_match, &pdev->dev); of_match_device(berlin2cd_pinctrl_match, &pdev->dev);
struct regmap_config *rmconfig;
struct regmap *regmap;
struct resource *res;
void __iomem *base;
rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
if (!rmconfig)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base))
return PTR_ERR(base);
rmconfig->reg_bits = 32,
rmconfig->val_bits = 32,
rmconfig->reg_stride = 4,
rmconfig->max_register = resource_size(res);
regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
return berlin_pinctrl_probe(pdev, match->data); return berlin_pinctrl_probe(pdev, match->data);
} }
......
...@@ -380,11 +380,11 @@ static const struct berlin_pinctrl_desc berlin2q_sysmgr_pinctrl_data = { ...@@ -380,11 +380,11 @@ static const struct berlin_pinctrl_desc berlin2q_sysmgr_pinctrl_data = {
static const struct of_device_id berlin2q_pinctrl_match[] = { static const struct of_device_id berlin2q_pinctrl_match[] = {
{ {
.compatible = "marvell,berlin2q-chip-ctrl", .compatible = "marvell,berlin2q-soc-pinctrl",
.data = &berlin2q_soc_pinctrl_data, .data = &berlin2q_soc_pinctrl_data,
}, },
{ {
.compatible = "marvell,berlin2q-system-ctrl", .compatible = "marvell,berlin2q-system-pinctrl",
.data = &berlin2q_sysmgr_pinctrl_data, .data = &berlin2q_sysmgr_pinctrl_data,
}, },
{} {}
...@@ -395,28 +395,6 @@ static int berlin2q_pinctrl_probe(struct platform_device *pdev) ...@@ -395,28 +395,6 @@ static int berlin2q_pinctrl_probe(struct platform_device *pdev)
{ {
const struct of_device_id *match = const struct of_device_id *match =
of_match_device(berlin2q_pinctrl_match, &pdev->dev); of_match_device(berlin2q_pinctrl_match, &pdev->dev);
struct regmap_config *rmconfig;
struct regmap *regmap;
struct resource *res;
void __iomem *base;
rmconfig = devm_kzalloc(&pdev->dev, sizeof(*rmconfig), GFP_KERNEL);
if (!rmconfig)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base))
return PTR_ERR(base);
rmconfig->reg_bits = 32,
rmconfig->val_bits = 32,
rmconfig->reg_stride = 4,
rmconfig->max_register = resource_size(res);
regmap = devm_regmap_init_mmio(&pdev->dev, base, rmconfig);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
return berlin_pinctrl_probe(pdev, match->data); return berlin_pinctrl_probe(pdev, match->data);
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
*/ */
#include <linux/io.h> #include <linux/io.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
...@@ -295,13 +296,15 @@ int berlin_pinctrl_probe(struct platform_device *pdev, ...@@ -295,13 +296,15 @@ int berlin_pinctrl_probe(struct platform_device *pdev,
const struct berlin_pinctrl_desc *desc) const struct berlin_pinctrl_desc *desc)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct device_node *parent_np = of_get_parent(dev->of_node);
struct berlin_pinctrl *pctrl; struct berlin_pinctrl *pctrl;
struct regmap *regmap; struct regmap *regmap;
int ret; int ret;
regmap = dev_get_regmap(&pdev->dev, NULL); regmap = syscon_node_to_regmap(parent_np);
if (!regmap) of_node_put(parent_np);
return -ENODEV; if (IS_ERR(regmap))
return PTR_ERR(regmap);
pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL); pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL);
if (!pctrl) if (!pctrl)
......
...@@ -11,10 +11,12 @@ ...@@ -11,10 +11,12 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/mfd/syscon.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/reset-controller.h> #include <linux/reset-controller.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/types.h> #include <linux/types.h>
...@@ -25,8 +27,7 @@ ...@@ -25,8 +27,7 @@
container_of((p), struct berlin_reset_priv, rcdev) container_of((p), struct berlin_reset_priv, rcdev)
struct berlin_reset_priv { struct berlin_reset_priv {
void __iomem *base; struct regmap *regmap;
unsigned int size;
struct reset_controller_dev rcdev; struct reset_controller_dev rcdev;
}; };
...@@ -37,7 +38,7 @@ static int berlin_reset_reset(struct reset_controller_dev *rcdev, ...@@ -37,7 +38,7 @@ static int berlin_reset_reset(struct reset_controller_dev *rcdev,
int offset = id >> 8; int offset = id >> 8;
int mask = BIT(id & 0x1f); int mask = BIT(id & 0x1f);
writel(mask, priv->base + offset); regmap_write(priv->regmap, offset, mask);
/* let the reset be effective */ /* let the reset be effective */
udelay(10); udelay(10);
...@@ -52,7 +53,6 @@ static struct reset_control_ops berlin_reset_ops = { ...@@ -52,7 +53,6 @@ static struct reset_control_ops berlin_reset_ops = {
static int berlin_reset_xlate(struct reset_controller_dev *rcdev, static int berlin_reset_xlate(struct reset_controller_dev *rcdev,
const struct of_phandle_args *reset_spec) const struct of_phandle_args *reset_spec)
{ {
struct berlin_reset_priv *priv = to_berlin_reset_priv(rcdev);
unsigned offset, bit; unsigned offset, bit;
if (WARN_ON(reset_spec->args_count != rcdev->of_reset_n_cells)) if (WARN_ON(reset_spec->args_count != rcdev->of_reset_n_cells))
...@@ -61,71 +61,53 @@ static int berlin_reset_xlate(struct reset_controller_dev *rcdev, ...@@ -61,71 +61,53 @@ static int berlin_reset_xlate(struct reset_controller_dev *rcdev,
offset = reset_spec->args[0]; offset = reset_spec->args[0];
bit = reset_spec->args[1]; bit = reset_spec->args[1];
if (offset >= priv->size)
return -EINVAL;
if (bit >= BERLIN_MAX_RESETS) if (bit >= BERLIN_MAX_RESETS)
return -EINVAL; return -EINVAL;
return (offset << 8) | bit; return (offset << 8) | bit;
} }
static int __berlin_reset_init(struct device_node *np) static int berlin2_reset_probe(struct platform_device *pdev)
{ {
struct device_node *parent_np = of_get_parent(pdev->dev.of_node);
struct berlin_reset_priv *priv; struct berlin_reset_priv *priv;
struct resource res;
resource_size_t size;
int ret;
priv = kzalloc(sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
ret = of_address_to_resource(np, 0, &res); priv->regmap = syscon_node_to_regmap(parent_np);
if (ret) of_node_put(parent_np);
goto err; if (IS_ERR(priv->regmap))
return PTR_ERR(priv->regmap);
size = resource_size(&res);
priv->base = ioremap(res.start, size);
if (!priv->base) {
ret = -ENOMEM;
goto err;
}
priv->size = size;
priv->rcdev.owner = THIS_MODULE; priv->rcdev.owner = THIS_MODULE;
priv->rcdev.ops = &berlin_reset_ops; priv->rcdev.ops = &berlin_reset_ops;
priv->rcdev.of_node = np; priv->rcdev.of_node = pdev->dev.of_node;
priv->rcdev.of_reset_n_cells = 2; priv->rcdev.of_reset_n_cells = 2;
priv->rcdev.of_xlate = berlin_reset_xlate; priv->rcdev.of_xlate = berlin_reset_xlate;
reset_controller_register(&priv->rcdev); reset_controller_register(&priv->rcdev);
return 0; return 0;
err:
kfree(priv);
return ret;
} }
static const struct of_device_id berlin_reset_of_match[] __initconst = { static const struct of_device_id berlin_reset_dt_match[] = {
{ .compatible = "marvell,berlin2-chip-ctrl" }, { .compatible = "marvell,berlin2-reset" },
{ .compatible = "marvell,berlin2cd-chip-ctrl" },
{ .compatible = "marvell,berlin2q-chip-ctrl" },
{ }, { },
}; };
MODULE_DEVICE_TABLE(of, berlin_reset_dt_match);
static struct platform_driver berlin_reset_driver = {
.probe = berlin2_reset_probe,
.driver = {
.name = "berlin2-reset",
.of_match_table = berlin_reset_dt_match,
},
};
module_platform_driver(berlin_reset_driver);
static int __init berlin_reset_init(void) MODULE_AUTHOR("Antoine Tenart <antoine.tenart@free-electrons.com>");
{ MODULE_AUTHOR("Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>");
struct device_node *np; MODULE_DESCRIPTION("Marvell Berlin reset driver");
int ret; MODULE_LICENSE("GPL");
for_each_matching_node(np, berlin_reset_of_match) {
ret = __berlin_reset_init(np);
if (ret)
return ret;
}
return 0;
}
arch_initcall(berlin_reset_init);
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