Commit 3c76a8a9 authored by Jason Cooper's avatar Jason Cooper

Merge tag 'tags/mvebu_fixes_for_v3.9_round3' into mvebu/dt

pulling in mvebu branches which changes armada*.dts? files for LPAE changes

mvebu fixes for v3.9 round 3

 - Kirkwood
    - a couple of small fixes for the Iomega ix2-200 board (ether and led)
 - mvebu
    - allow GPIO button to work on Mirabox when running SMP
parents 513a7917 600468d0
...@@ -556,7 +556,6 @@ config ARCH_IXP4XX ...@@ -556,7 +556,6 @@ config ARCH_IXP4XX
config ARCH_DOVE config ARCH_DOVE
bool "Marvell Dove" bool "Marvell Dove"
select ARCH_REQUIRE_GPIOLIB select ARCH_REQUIRE_GPIOLIB
select COMMON_CLK_DOVE
select CPU_V7 select CPU_V7
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select MIGHT_HAVE_PCI select MIGHT_HAVE_PCI
......
...@@ -91,7 +91,7 @@ ethernet@d0074000 { ...@@ -91,7 +91,7 @@ ethernet@d0074000 {
}; };
mvsdio@d00d4000 { mvsdio@d00d4000 {
pinctrl-0 = <&sdio_pins2>; pinctrl-0 = <&sdio_pins3>;
pinctrl-names = "default"; pinctrl-names = "default";
status = "okay"; status = "okay";
/* /*
......
...@@ -64,6 +64,14 @@ mvsdio@d00d4000 { ...@@ -64,6 +64,14 @@ mvsdio@d00d4000 {
status = "okay"; status = "okay";
/* No CD or WP GPIOs */ /* No CD or WP GPIOs */
}; };
usb@d0050000 {
status = "okay";
};
usb@d0051000 {
status = "okay";
};
}; };
gpio-keys { gpio-keys {
......
...@@ -31,7 +31,6 @@ cpu@0 { ...@@ -31,7 +31,6 @@ cpu@0 {
mpic: interrupt-controller@d0020000 { mpic: interrupt-controller@d0020000 {
compatible = "marvell,mpic"; compatible = "marvell,mpic";
#interrupt-cells = <1>; #interrupt-cells = <1>;
#address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
interrupt-controller; interrupt-controller;
}; };
...@@ -54,7 +53,7 @@ serial@d0012000 { ...@@ -54,7 +53,7 @@ serial@d0012000 {
reg = <0xd0012000 0x100>; reg = <0xd0012000 0x100>;
reg-shift = <2>; reg-shift = <2>;
interrupts = <41>; interrupts = <41>;
reg-io-width = <4>; reg-io-width = <1>;
status = "disabled"; status = "disabled";
}; };
serial@d0012100 { serial@d0012100 {
...@@ -62,7 +61,7 @@ serial@d0012100 { ...@@ -62,7 +61,7 @@ serial@d0012100 {
reg = <0xd0012100 0x100>; reg = <0xd0012100 0x100>;
reg-shift = <2>; reg-shift = <2>;
interrupts = <42>; interrupts = <42>;
reg-io-width = <4>; reg-io-width = <1>;
status = "disabled"; status = "disabled";
}; };
......
...@@ -59,6 +59,12 @@ sdio_pins2: sdio-pins2 { ...@@ -59,6 +59,12 @@ sdio_pins2: sdio-pins2 {
"mpp50", "mpp51", "mpp52"; "mpp50", "mpp51", "mpp52";
marvell,function = "sd0"; marvell,function = "sd0";
}; };
sdio_pins3: sdio-pins3 {
marvell,pins = "mpp48", "mpp49", "mpp50",
"mpp51", "mpp52", "mpp53";
marvell,function = "sd0";
};
}; };
gpio0: gpio@d0018100 { gpio0: gpio@d0018100 {
......
...@@ -46,7 +46,7 @@ serial@d0012200 { ...@@ -46,7 +46,7 @@ serial@d0012200 {
reg = <0xd0012200 0x100>; reg = <0xd0012200 0x100>;
reg-shift = <2>; reg-shift = <2>;
interrupts = <43>; interrupts = <43>;
reg-io-width = <4>; reg-io-width = <1>;
status = "disabled"; status = "disabled";
}; };
serial@d0012300 { serial@d0012300 {
...@@ -54,7 +54,7 @@ serial@d0012300 { ...@@ -54,7 +54,7 @@ serial@d0012300 {
reg = <0xd0012300 0x100>; reg = <0xd0012300 0x100>;
reg-shift = <2>; reg-shift = <2>;
interrupts = <44>; interrupts = <44>;
reg-io-width = <4>; reg-io-width = <1>;
status = "disabled"; status = "disabled";
}; };
......
...@@ -202,6 +202,11 @@ sata0: sata@a0000 { ...@@ -202,6 +202,11 @@ sata0: sata@a0000 {
status = "disabled"; status = "disabled";
}; };
rtc@d8500 {
compatible = "marvell,orion-rtc";
reg = <0xd8500 0x20>;
};
crypto: crypto@30000 { crypto: crypto@30000 {
compatible = "marvell,orion-crypto"; compatible = "marvell,orion-crypto";
reg = <0x30000 0x10000>, reg = <0x30000 0x10000>,
......
...@@ -42,12 +42,10 @@ orange-usb { ...@@ -42,12 +42,10 @@ orange-usb {
ocp@f1000000 { ocp@f1000000 {
serial@12000 { serial@12000 {
clock-frequency = <166666667>;
status = "okay"; status = "okay";
}; };
serial@12100 { serial@12100 {
clock-frequency = <166666667>;
status = "okay"; status = "okay";
}; };
}; };
......
...@@ -50,7 +50,6 @@ lm75: lm75@48 { ...@@ -50,7 +50,6 @@ lm75: lm75@48 {
}; };
}; };
serial@12000 { serial@12000 {
clock-frequency = <200000000>;
status = "okay"; status = "okay";
}; };
}; };
......
...@@ -37,7 +37,6 @@ pmx_led_orange: pmx-led-orange { ...@@ -37,7 +37,6 @@ pmx_led_orange: pmx-led-orange {
}; };
}; };
serial@12000 { serial@12000 {
clock-frequency = <200000000>;
status = "ok"; status = "ok";
}; };
......
...@@ -38,7 +38,6 @@ pmx_led_wifi_ap: pmx-led-wifi-ap { ...@@ -38,7 +38,6 @@ pmx_led_wifi_ap: pmx-led-wifi-ap {
}; };
}; };
serial@12000 { serial@12000 {
clock-frequency = <200000000>;
status = "ok"; status = "ok";
}; };
......
...@@ -73,11 +73,11 @@ pmx_led_orange: pmx-led_orange { ...@@ -73,11 +73,11 @@ pmx_led_orange: pmx-led_orange {
}; };
}; };
serial@12000 { serial@12000 {
clock-frequency = <200000000>;
status = "ok"; status = "ok";
}; };
nand@3000000 { nand@3000000 {
chip-delay = <40>;
status = "okay"; status = "okay";
partition@0 { partition@0 {
......
...@@ -51,7 +51,6 @@ pmx_button_usb_copy: pmx-button-usb-copy { ...@@ -51,7 +51,6 @@ pmx_button_usb_copy: pmx-button-usb-copy {
}; };
}; };
serial@12000 { serial@12000 {
clock-frequency = <200000000>;
status = "okay"; status = "okay";
}; };
......
...@@ -78,7 +78,6 @@ lm63: lm63@4c { ...@@ -78,7 +78,6 @@ lm63: lm63@4c {
}; };
}; };
serial@12000 { serial@12000 {
clock-frequency = <200000000>;
status = "ok"; status = "ok";
}; };
......
...@@ -96,11 +96,11 @@ pmx_led_health_brt_ctrl_2: pmx-led-health-brt-ctrl-2 { ...@@ -96,11 +96,11 @@ pmx_led_health_brt_ctrl_2: pmx-led-health-brt-ctrl-2 {
marvell,function = "gpio"; marvell,function = "gpio";
}; };
pmx_led_rebuild_brt_ctrl_1: pmx-led-rebuild-brt-ctrl-1 { pmx_led_rebuild_brt_ctrl_1: pmx-led-rebuild-brt-ctrl-1 {
marvell,pins = "mpp44"; marvell,pins = "mpp46";
marvell,function = "gpio"; marvell,function = "gpio";
}; };
pmx_led_rebuild_brt_ctrl_2: pmx-led-rebuild-brt-ctrl-2 { pmx_led_rebuild_brt_ctrl_2: pmx-led-rebuild-brt-ctrl-2 {
marvell,pins = "mpp45"; marvell,pins = "mpp47";
marvell,function = "gpio"; marvell,function = "gpio";
}; };
...@@ -115,7 +115,6 @@ lm63: lm63@4c { ...@@ -115,7 +115,6 @@ lm63: lm63@4c {
}; };
serial@12000 { serial@12000 {
clock-frequency = <200000000>;
status = "ok"; status = "ok";
}; };
...@@ -158,14 +157,14 @@ power_led { ...@@ -158,14 +157,14 @@ power_led {
gpios = <&gpio0 16 0>; gpios = <&gpio0 16 0>;
linux,default-trigger = "default-on"; linux,default-trigger = "default-on";
}; };
health_led1 { rebuild_led {
label = "status:white:rebuild_led";
gpios = <&gpio1 4 0>;
};
health_led {
label = "status:red:health_led"; label = "status:red:health_led";
gpios = <&gpio1 5 0>; gpios = <&gpio1 5 0>;
}; };
health_led2 {
label = "status:white:health_led";
gpios = <&gpio1 4 0>;
};
backup_led { backup_led {
label = "status:blue:backup_led"; label = "status:blue:backup_led";
gpios = <&gpio0 15 0>; gpios = <&gpio0 15 0>;
......
...@@ -34,7 +34,6 @@ pmx_i2c_gpio_scl: pmx-gpio-scl { ...@@ -34,7 +34,6 @@ pmx_i2c_gpio_scl: pmx-gpio-scl {
}; };
serial@12000 { serial@12000 {
clock-frequency = <200000000>;
status = "ok"; status = "ok";
}; };
......
...@@ -13,7 +13,6 @@ memory { ...@@ -13,7 +13,6 @@ memory {
ocp@f1000000 { ocp@f1000000 {
serial@12000 { serial@12000 {
clock-frequency = <166666667>;
status = "okay"; status = "okay";
}; };
}; };
......
...@@ -13,7 +13,6 @@ memory { ...@@ -13,7 +13,6 @@ memory {
ocp@f1000000 { ocp@f1000000 {
serial@12000 { serial@12000 {
clock-frequency = <200000000>;
status = "okay"; status = "okay";
}; };
}; };
......
...@@ -90,7 +90,6 @@ eeprom@57 { ...@@ -90,7 +90,6 @@ eeprom@57 {
}; };
serial@12000 { serial@12000 {
clock-frequency = <200000000>;
status = "ok"; status = "ok";
}; };
......
...@@ -23,7 +23,6 @@ pmx_ns2_sata1: pmx-ns2-sata1 { ...@@ -23,7 +23,6 @@ pmx_ns2_sata1: pmx-ns2-sata1 {
}; };
serial@12000 { serial@12000 {
clock-frequency = <166666667>;
status = "okay"; status = "okay";
}; };
......
...@@ -117,7 +117,6 @@ pmx_pwr_off: pmx-pwr-off { ...@@ -117,7 +117,6 @@ pmx_pwr_off: pmx-pwr-off {
}; };
serial@12000 { serial@12000 {
clock-frequency = <200000000>;
status = "ok"; status = "ok";
}; };
......
...@@ -18,12 +18,10 @@ chosen { ...@@ -18,12 +18,10 @@ chosen {
ocp@f1000000 { ocp@f1000000 {
serial@12000 { serial@12000 {
clock-frequency = <200000000>;
status = "ok"; status = "ok";
}; };
serial@12100 { serial@12100 {
clock-frequency = <200000000>;
status = "ok"; status = "ok";
}; };
......
...@@ -108,7 +108,6 @@ pmx_led_wifi_yellow: pmx-led-wifi-yellow { ...@@ -108,7 +108,6 @@ pmx_led_wifi_yellow: pmx-led-wifi-yellow {
}; };
serial@12000 { serial@12000 {
clock-frequency = <200000000>;
status = "ok"; status = "ok";
}; };
......
...@@ -38,6 +38,7 @@ gpio0: gpio@10100 { ...@@ -38,6 +38,7 @@ gpio0: gpio@10100 {
interrupt-controller; interrupt-controller;
#interrupt-cells = <2>; #interrupt-cells = <2>;
interrupts = <35>, <36>, <37>, <38>; interrupts = <35>, <36>, <37>, <38>;
clocks = <&gate_clk 7>;
}; };
gpio1: gpio@10140 { gpio1: gpio@10140 {
...@@ -49,6 +50,7 @@ gpio1: gpio@10140 { ...@@ -49,6 +50,7 @@ gpio1: gpio@10140 {
interrupt-controller; interrupt-controller;
#interrupt-cells = <2>; #interrupt-cells = <2>;
interrupts = <39>, <40>, <41>; interrupts = <39>, <40>, <41>;
clocks = <&gate_clk 7>;
}; };
serial@12000 { serial@12000 {
...@@ -57,7 +59,6 @@ serial@12000 { ...@@ -57,7 +59,6 @@ serial@12000 {
reg-shift = <2>; reg-shift = <2>;
interrupts = <33>; interrupts = <33>;
clocks = <&gate_clk 7>; clocks = <&gate_clk 7>;
/* set clock-frequency in board dts */
status = "disabled"; status = "disabled";
}; };
...@@ -67,7 +68,6 @@ serial@12100 { ...@@ -67,7 +68,6 @@ serial@12100 {
reg-shift = <2>; reg-shift = <2>;
interrupts = <34>; interrupts = <34>;
clocks = <&gate_clk 7>; clocks = <&gate_clk 7>;
/* set clock-frequency in board dts */
status = "disabled"; status = "disabled";
}; };
...@@ -75,6 +75,7 @@ rtc@10300 { ...@@ -75,6 +75,7 @@ rtc@10300 {
compatible = "marvell,kirkwood-rtc", "marvell,orion-rtc"; compatible = "marvell,kirkwood-rtc", "marvell,orion-rtc";
reg = <0x10300 0x20>; reg = <0x10300 0x20>;
interrupts = <53>; interrupts = <53>;
clocks = <&gate_clk 7>;
}; };
spi@10600 { spi@10600 {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
/ { / {
model = "LaCie Ethernet Disk mini V2"; model = "LaCie Ethernet Disk mini V2";
compatible = "lacie,ethernet-disk-mini-v2", "marvell-orion5x-88f5182", "marvell,orion5x"; compatible = "lacie,ethernet-disk-mini-v2", "marvell,orion5x-88f5182", "marvell,orion5x";
memory { memory {
reg = <0x00000000 0x4000000>; /* 64 MB */ reg = <0x00000000 0x4000000>; /* 64 MB */
......
...@@ -13,6 +13,9 @@ / { ...@@ -13,6 +13,9 @@ / {
compatible = "marvell,orion5x"; compatible = "marvell,orion5x";
interrupt-parent = <&intc>; interrupt-parent = <&intc>;
aliases {
gpio0 = &gpio0;
};
intc: interrupt-controller { intc: interrupt-controller {
compatible = "marvell,orion-intc", "marvell,intc"; compatible = "marvell,orion-intc", "marvell,intc";
interrupt-controller; interrupt-controller;
...@@ -32,7 +35,9 @@ gpio0: gpio@10100 { ...@@ -32,7 +35,9 @@ gpio0: gpio@10100 {
#gpio-cells = <2>; #gpio-cells = <2>;
gpio-controller; gpio-controller;
reg = <0x10100 0x40>; reg = <0x10100 0x40>;
ngpio = <32>; ngpios = <32>;
interrupt-controller;
#interrupt-cells = <2>;
interrupts = <6>, <7>, <8>, <9>; interrupts = <6>, <7>, <8>, <9>;
}; };
...@@ -124,7 +129,7 @@ crypto@90000 { ...@@ -124,7 +129,7 @@ crypto@90000 {
reg = <0x90000 0x10000>, reg = <0x90000 0x10000>,
<0xf2200000 0x800>; <0xf2200000 0x800>;
reg-names = "regs", "sram"; reg-names = "regs", "sram";
interrupts = <22>; interrupts = <28>;
status = "okay"; status = "okay";
}; };
}; };
......
...@@ -41,16 +41,12 @@ static void __init kirkwood_legacy_clk_init(void) ...@@ -41,16 +41,12 @@ static void __init kirkwood_legacy_clk_init(void)
struct device_node *np = of_find_compatible_node( struct device_node *np = of_find_compatible_node(
NULL, NULL, "marvell,kirkwood-gating-clock"); NULL, NULL, "marvell,kirkwood-gating-clock");
struct of_phandle_args clkspec; struct of_phandle_args clkspec;
struct clk *clk;
clkspec.np = np; clkspec.np = np;
clkspec.args_count = 1; clkspec.args_count = 1;
clkspec.args[0] = CGC_BIT_GE0;
orion_clkdev_add(NULL, "mv643xx_eth_port.0",
of_clk_get_from_provider(&clkspec));
clkspec.args[0] = CGC_BIT_PEX0; clkspec.args[0] = CGC_BIT_PEX0;
orion_clkdev_add("0", "pcie", orion_clkdev_add("0", "pcie",
of_clk_get_from_provider(&clkspec)); of_clk_get_from_provider(&clkspec));
...@@ -59,9 +55,24 @@ static void __init kirkwood_legacy_clk_init(void) ...@@ -59,9 +55,24 @@ static void __init kirkwood_legacy_clk_init(void)
orion_clkdev_add("1", "pcie", orion_clkdev_add("1", "pcie",
of_clk_get_from_provider(&clkspec)); of_clk_get_from_provider(&clkspec));
clkspec.args[0] = CGC_BIT_GE1; clkspec.args[0] = CGC_BIT_SDIO;
orion_clkdev_add(NULL, "mv643xx_eth_port.1", orion_clkdev_add(NULL, "mvsdio",
of_clk_get_from_provider(&clkspec)); of_clk_get_from_provider(&clkspec));
/*
* The ethernet interfaces forget the MAC address assigned by
* u-boot if the clocks are turned off. Until proper DT support
* is available we always enable them for now.
*/
clkspec.args[0] = CGC_BIT_GE0;
clk = of_clk_get_from_provider(&clkspec);
orion_clkdev_add(NULL, "mv643xx_eth_port.0", clk);
clk_prepare_enable(clk);
clkspec.args[0] = CGC_BIT_GE1;
clk = of_clk_get_from_provider(&clkspec);
orion_clkdev_add(NULL, "mv643xx_eth_port.1", clk);
clk_prepare_enable(clk);
} }
static void __init kirkwood_of_clk_init(void) static void __init kirkwood_of_clk_init(void)
......
...@@ -20,10 +20,15 @@ static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = { ...@@ -20,10 +20,15 @@ static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = {
.duplex = DUPLEX_FULL, .duplex = DUPLEX_FULL,
}; };
static struct mv643xx_eth_platform_data iomega_ix2_200_ge01_data = {
.phy_addr = MV643XX_ETH_PHY_ADDR(11),
};
void __init iomega_ix2_200_init(void) void __init iomega_ix2_200_init(void)
{ {
/* /*
* Basic setup. Needs to be called early. * Basic setup. Needs to be called early.
*/ */
kirkwood_ge01_init(&iomega_ix2_200_ge00_data); kirkwood_ge00_init(&iomega_ix2_200_ge00_data);
kirkwood_ge01_init(&iomega_ix2_200_ge01_data);
} }
...@@ -53,6 +53,8 @@ static struct mv_sata_platform_data guruplug_sata_data = { ...@@ -53,6 +53,8 @@ static struct mv_sata_platform_data guruplug_sata_data = {
static struct mvsdio_platform_data guruplug_mvsdio_data = { static struct mvsdio_platform_data guruplug_mvsdio_data = {
/* unfortunately the CD signal has not been connected */ /* unfortunately the CD signal has not been connected */
.gpio_card_detect = -1,
.gpio_write_protect = -1,
}; };
static struct gpio_led guruplug_led_pins[] = { static struct gpio_led guruplug_led_pins[] = {
......
...@@ -55,6 +55,7 @@ static struct mv_sata_platform_data openrd_sata_data = { ...@@ -55,6 +55,7 @@ static struct mv_sata_platform_data openrd_sata_data = {
static struct mvsdio_platform_data openrd_mvsdio_data = { static struct mvsdio_platform_data openrd_mvsdio_data = {
.gpio_card_detect = 29, /* MPP29 used as SD card detect */ .gpio_card_detect = 29, /* MPP29 used as SD card detect */
.gpio_write_protect = -1,
}; };
static unsigned int openrd_mpp_config[] __initdata = { static unsigned int openrd_mpp_config[] __initdata = {
......
...@@ -69,6 +69,7 @@ static struct mv_sata_platform_data rd88f6281_sata_data = { ...@@ -69,6 +69,7 @@ static struct mv_sata_platform_data rd88f6281_sata_data = {
static struct mvsdio_platform_data rd88f6281_mvsdio_data = { static struct mvsdio_platform_data rd88f6281_mvsdio_data = {
.gpio_card_detect = 28, .gpio_card_detect = 28,
.gpio_write_protect = -1,
}; };
static unsigned int rd88f6281_mpp_config[] __initdata = { static unsigned int rd88f6281_mpp_config[] __initdata = {
......
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
#define ARMADA_370_XP_MAX_PER_CPU_IRQS (28) #define ARMADA_370_XP_MAX_PER_CPU_IRQS (28)
#define ARMADA_370_XP_TIMER0_PER_CPU_IRQ (5)
#define ACTIVE_DOORBELLS (8) #define ACTIVE_DOORBELLS (8)
static DEFINE_RAW_SPINLOCK(irq_controller_lock); static DEFINE_RAW_SPINLOCK(irq_controller_lock);
...@@ -59,36 +61,26 @@ static struct irq_domain *armada_370_xp_mpic_domain; ...@@ -59,36 +61,26 @@ static struct irq_domain *armada_370_xp_mpic_domain;
*/ */
static void armada_370_xp_irq_mask(struct irq_data *d) static void armada_370_xp_irq_mask(struct irq_data *d)
{ {
#ifdef CONFIG_SMP
irq_hw_number_t hwirq = irqd_to_hwirq(d); irq_hw_number_t hwirq = irqd_to_hwirq(d);
if (hwirq > ARMADA_370_XP_MAX_PER_CPU_IRQS) if (hwirq != ARMADA_370_XP_TIMER0_PER_CPU_IRQ)
writel(hwirq, main_int_base + writel(hwirq, main_int_base +
ARMADA_370_XP_INT_CLEAR_ENABLE_OFFS); ARMADA_370_XP_INT_CLEAR_ENABLE_OFFS);
else else
writel(hwirq, per_cpu_int_base + writel(hwirq, per_cpu_int_base +
ARMADA_370_XP_INT_SET_MASK_OFFS); ARMADA_370_XP_INT_SET_MASK_OFFS);
#else
writel(irqd_to_hwirq(d),
per_cpu_int_base + ARMADA_370_XP_INT_SET_MASK_OFFS);
#endif
} }
static void armada_370_xp_irq_unmask(struct irq_data *d) static void armada_370_xp_irq_unmask(struct irq_data *d)
{ {
#ifdef CONFIG_SMP
irq_hw_number_t hwirq = irqd_to_hwirq(d); irq_hw_number_t hwirq = irqd_to_hwirq(d);
if (hwirq > ARMADA_370_XP_MAX_PER_CPU_IRQS) if (hwirq != ARMADA_370_XP_TIMER0_PER_CPU_IRQ)
writel(hwirq, main_int_base + writel(hwirq, main_int_base +
ARMADA_370_XP_INT_SET_ENABLE_OFFS); ARMADA_370_XP_INT_SET_ENABLE_OFFS);
else else
writel(hwirq, per_cpu_int_base + writel(hwirq, per_cpu_int_base +
ARMADA_370_XP_INT_CLEAR_MASK_OFFS); ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
#else
writel(irqd_to_hwirq(d),
per_cpu_int_base + ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
#endif
} }
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
...@@ -144,10 +136,14 @@ static int armada_370_xp_mpic_irq_map(struct irq_domain *h, ...@@ -144,10 +136,14 @@ static int armada_370_xp_mpic_irq_map(struct irq_domain *h,
unsigned int virq, irq_hw_number_t hw) unsigned int virq, irq_hw_number_t hw)
{ {
armada_370_xp_irq_mask(irq_get_irq_data(virq)); armada_370_xp_irq_mask(irq_get_irq_data(virq));
writel(hw, main_int_base + ARMADA_370_XP_INT_SET_ENABLE_OFFS); if (hw != ARMADA_370_XP_TIMER0_PER_CPU_IRQ)
writel(hw, per_cpu_int_base +
ARMADA_370_XP_INT_CLEAR_MASK_OFFS);
else
writel(hw, main_int_base + ARMADA_370_XP_INT_SET_ENABLE_OFFS);
irq_set_status_flags(virq, IRQ_LEVEL); irq_set_status_flags(virq, IRQ_LEVEL);
if (hw < ARMADA_370_XP_MAX_PER_CPU_IRQS) { if (hw == ARMADA_370_XP_TIMER0_PER_CPU_IRQ) {
irq_set_percpu_devid(virq); irq_set_percpu_devid(virq);
irq_set_chip_and_handler(virq, &armada_370_xp_irq_chip, irq_set_chip_and_handler(virq, &armada_370_xp_irq_chip,
handle_percpu_devid_irq); handle_percpu_devid_irq);
......
...@@ -157,9 +157,12 @@ void __init orion_setup_cpu_mbus_target(const struct orion_addr_map_cfg *cfg, ...@@ -157,9 +157,12 @@ void __init orion_setup_cpu_mbus_target(const struct orion_addr_map_cfg *cfg,
u32 size = readl(ddr_window_cpu_base + DDR_SIZE_CS_OFF(i)); u32 size = readl(ddr_window_cpu_base + DDR_SIZE_CS_OFF(i));
/* /*
* Chip select enabled? * We only take care of entries for which the chip
* select is enabled, and that don't have high base
* address bits set (devices can only access the first
* 32 bits of the memory).
*/ */
if (size & 1) { if ((size & 1) && !(base & 0xF)) {
struct mbus_dram_window *w; struct mbus_dram_window *w;
w = &orion_mbus_dram_info.cs[cs++]; w = &orion_mbus_dram_info.cs[cs++];
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/of_irq.h> #include <linux/of_irq.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/clk.h>
#include <linux/pinctrl/consumer.h> #include <linux/pinctrl/consumer.h>
/* /*
...@@ -496,6 +497,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev) ...@@ -496,6 +497,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
struct resource *res; struct resource *res;
struct irq_chip_generic *gc; struct irq_chip_generic *gc;
struct irq_chip_type *ct; struct irq_chip_type *ct;
struct clk *clk;
unsigned int ngpios; unsigned int ngpios;
int soc_variant; int soc_variant;
int i, cpu, id; int i, cpu, id;
...@@ -529,6 +531,11 @@ static int mvebu_gpio_probe(struct platform_device *pdev) ...@@ -529,6 +531,11 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
return id; return id;
} }
clk = devm_clk_get(&pdev->dev, NULL);
/* Not all SoCs require a clock.*/
if (!IS_ERR(clk))
clk_prepare_enable(clk);
mvchip->soc_variant = soc_variant; mvchip->soc_variant = soc_variant;
mvchip->chip.label = dev_name(&pdev->dev); mvchip->chip.label = dev_name(&pdev->dev);
mvchip->chip.dev = &pdev->dev; mvchip->chip.dev = &pdev->dev;
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/clk.h>
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -41,6 +42,7 @@ struct rtc_plat_data { ...@@ -41,6 +42,7 @@ struct rtc_plat_data {
struct rtc_device *rtc; struct rtc_device *rtc;
void __iomem *ioaddr; void __iomem *ioaddr;
int irq; int irq;
struct clk *clk;
}; };
static int mv_rtc_set_time(struct device *dev, struct rtc_time *tm) static int mv_rtc_set_time(struct device *dev, struct rtc_time *tm)
...@@ -221,6 +223,7 @@ static int mv_rtc_probe(struct platform_device *pdev) ...@@ -221,6 +223,7 @@ static int mv_rtc_probe(struct platform_device *pdev)
struct rtc_plat_data *pdata; struct rtc_plat_data *pdata;
resource_size_t size; resource_size_t size;
u32 rtc_time; u32 rtc_time;
int ret = 0;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) if (!res)
...@@ -239,11 +242,17 @@ static int mv_rtc_probe(struct platform_device *pdev) ...@@ -239,11 +242,17 @@ static int mv_rtc_probe(struct platform_device *pdev)
if (!pdata->ioaddr) if (!pdata->ioaddr)
return -ENOMEM; return -ENOMEM;
pdata->clk = devm_clk_get(&pdev->dev, NULL);
/* Not all SoCs require a clock.*/
if (!IS_ERR(pdata->clk))
clk_prepare_enable(pdata->clk);
/* make sure the 24 hours mode is enabled */ /* make sure the 24 hours mode is enabled */
rtc_time = readl(pdata->ioaddr + RTC_TIME_REG_OFFS); rtc_time = readl(pdata->ioaddr + RTC_TIME_REG_OFFS);
if (rtc_time & RTC_HOURS_12H_MODE) { if (rtc_time & RTC_HOURS_12H_MODE) {
dev_err(&pdev->dev, "24 Hours mode not supported.\n"); dev_err(&pdev->dev, "24 Hours mode not supported.\n");
return -EINVAL; ret = -EINVAL;
goto out;
} }
/* make sure it is actually functional */ /* make sure it is actually functional */
...@@ -252,7 +261,8 @@ static int mv_rtc_probe(struct platform_device *pdev) ...@@ -252,7 +261,8 @@ static int mv_rtc_probe(struct platform_device *pdev)
rtc_time = readl(pdata->ioaddr + RTC_TIME_REG_OFFS); rtc_time = readl(pdata->ioaddr + RTC_TIME_REG_OFFS);
if (rtc_time == 0x01000000) { if (rtc_time == 0x01000000) {
dev_err(&pdev->dev, "internal RTC not ticking\n"); dev_err(&pdev->dev, "internal RTC not ticking\n");
return -ENODEV; ret = -ENODEV;
goto out;
} }
} }
...@@ -268,8 +278,10 @@ static int mv_rtc_probe(struct platform_device *pdev) ...@@ -268,8 +278,10 @@ static int mv_rtc_probe(struct platform_device *pdev)
} else } else
pdata->rtc = rtc_device_register(pdev->name, &pdev->dev, pdata->rtc = rtc_device_register(pdev->name, &pdev->dev,
&mv_rtc_ops, THIS_MODULE); &mv_rtc_ops, THIS_MODULE);
if (IS_ERR(pdata->rtc)) if (IS_ERR(pdata->rtc)) {
return PTR_ERR(pdata->rtc); ret = PTR_ERR(pdata->rtc);
goto out;
}
if (pdata->irq >= 0) { if (pdata->irq >= 0) {
writel(0, pdata->ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS); writel(0, pdata->ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS);
...@@ -282,6 +294,11 @@ static int mv_rtc_probe(struct platform_device *pdev) ...@@ -282,6 +294,11 @@ static int mv_rtc_probe(struct platform_device *pdev)
} }
return 0; return 0;
out:
if (!IS_ERR(pdata->clk))
clk_disable_unprepare(pdata->clk);
return ret;
} }
static int __exit mv_rtc_remove(struct platform_device *pdev) static int __exit mv_rtc_remove(struct platform_device *pdev)
...@@ -292,6 +309,9 @@ static int __exit mv_rtc_remove(struct platform_device *pdev) ...@@ -292,6 +309,9 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
device_init_wakeup(&pdev->dev, 0); device_init_wakeup(&pdev->dev, 0);
rtc_device_unregister(pdata->rtc); rtc_device_unregister(pdata->rtc);
if (!IS_ERR(pdata->clk))
clk_disable_unprepare(pdata->clk);
return 0; return 0;
} }
......
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