mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 17:51:43 +00:00
mvebu fixes for v3.9
The first four patches:89c58c1
rtc: rtc-mv: Add support for clk to avoid lockupsde88747
gpio: mvebu: Add clk support to prevent lockup7bf5b40
ARM: kirkwood: fix to retain gbe MAC addresses for DT kernels93fff4c
ARM: kirkwood: of_serial: fix clock gating by removing clock-frequency are Cc'd to stable since they were held over from the previous merge window. The rest are a small collection of fixes and a couple of devicetree conversion catchups. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQEcBAABAgAGBQJROmXfAAoJEAi3KVZQDZAeahAIAIWybkKuD/lKLRPU3FmS59gM gdcPxQcjFnldRRBQFXRfSQ4acFNEWZwDgHXs0gpKsUCoZ2w/tCbjba0sNb2vWsmc H4Nh8MU3CqHIuGDFSmsbDHX0BNrp6JvZLxiY7vtswTDqZt1K/UKb7obnnbAo8ygu OtbGItfYNTjMJ0B1Ar2eYCoA4V29SFzXB+ymWEHl4u9Vmwasr0uervjHhyq+3tU1 pCNPWc98N9r0VqniVbbTqVuwlwoc3IZmbiv1T9EGMw2PDbtcIJLwY7oxlSb0kW3e QIookCxlItX1A360TmGI4xKnSRR42ZinNmn2AuLetW8ydnRNDwkyrRJZ2VsbQLE= =mme/ -----END PGP SIGNATURE----- Merge tag 'mvebu_fixes_for_v3.9' of git://git.infradead.org/users/jcooper/linux into fixes mvebu fixes for v3.9 from Jason Cooper <jason@lakedaemon.net>: The first four patches:89c58c1
rtc: rtc-mv: Add support for clk to avoid lockupsde88747
gpio: mvebu: Add clk support to prevent lockup7bf5b40
ARM: kirkwood: fix to retain gbe MAC addresses for DT kernels93fff4c
ARM: kirkwood: of_serial: fix clock gating by removing clock-frequency are Cc'd to stable since they were held over from the previous merge window. The rest are a small collection of fixes and a couple of devicetree conversion catchups. * tag 'mvebu_fixes_for_v3.9' of git://git.infradead.org/users/jcooper/linux: arm: mach-orion5x: fix typo in compatible string of a .dts file arm: mvebu: fix address-cells in mpic DT node arm: plat-orion: fix address decoding when > 4GB is used arm: mvebu: Reduce reg-io-width with UARTs ARM: Dove: add RTC device node arm: mvebu: enable the USB ports on Armada 370 Reference Design board ARM: dove: drop "select COMMON_CLK_DOVE" rtc: rtc-mv: Add support for clk to avoid lockups gpio: mvebu: Add clk support to prevent lockup ARM: kirkwood: fix to retain gbe MAC addresses for DT kernels ARM: kirkwood: of_serial: fix clock gating by removing clock-frequency Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
commit
7546152348
@ -556,7 +556,6 @@ config ARCH_IXP4XX
|
||||
config ARCH_DOVE
|
||||
bool "Marvell Dove"
|
||||
select ARCH_REQUIRE_GPIOLIB
|
||||
select COMMON_CLK_DOVE
|
||||
select CPU_V7
|
||||
select GENERIC_CLOCKEVENTS
|
||||
select MIGHT_HAVE_PCI
|
||||
|
@ -64,5 +64,13 @@
|
||||
status = "okay";
|
||||
/* No CD or WP GPIOs */
|
||||
};
|
||||
|
||||
usb@d0050000 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
usb@d0051000 {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -31,7 +31,6 @@
|
||||
mpic: interrupt-controller@d0020000 {
|
||||
compatible = "marvell,mpic";
|
||||
#interrupt-cells = <1>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
interrupt-controller;
|
||||
};
|
||||
@ -54,7 +53,7 @@
|
||||
reg = <0xd0012000 0x100>;
|
||||
reg-shift = <2>;
|
||||
interrupts = <41>;
|
||||
reg-io-width = <4>;
|
||||
reg-io-width = <1>;
|
||||
status = "disabled";
|
||||
};
|
||||
serial@d0012100 {
|
||||
@ -62,7 +61,7 @@
|
||||
reg = <0xd0012100 0x100>;
|
||||
reg-shift = <2>;
|
||||
interrupts = <42>;
|
||||
reg-io-width = <4>;
|
||||
reg-io-width = <1>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
reg = <0xd0012200 0x100>;
|
||||
reg-shift = <2>;
|
||||
interrupts = <43>;
|
||||
reg-io-width = <4>;
|
||||
reg-io-width = <1>;
|
||||
status = "disabled";
|
||||
};
|
||||
serial@d0012300 {
|
||||
@ -54,7 +54,7 @@
|
||||
reg = <0xd0012300 0x100>;
|
||||
reg-shift = <2>;
|
||||
interrupts = <44>;
|
||||
reg-io-width = <4>;
|
||||
reg-io-width = <1>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
|
@ -197,6 +197,11 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
rtc@d8500 {
|
||||
compatible = "marvell,orion-rtc";
|
||||
reg = <0xd8500 0x20>;
|
||||
};
|
||||
|
||||
crypto: crypto@30000 {
|
||||
compatible = "marvell,orion-crypto";
|
||||
reg = <0x30000 0x10000>,
|
||||
|
@ -42,12 +42,10 @@
|
||||
|
||||
ocp@f1000000 {
|
||||
serial@12000 {
|
||||
clock-frequency = <166666667>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
serial@12100 {
|
||||
clock-frequency = <166666667>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
@ -50,7 +50,6 @@
|
||||
};
|
||||
};
|
||||
serial@12000 {
|
||||
clock-frequency = <200000000>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
@ -37,7 +37,6 @@
|
||||
};
|
||||
};
|
||||
serial@12000 {
|
||||
clock-frequency = <200000000>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
|
@ -38,7 +38,6 @@
|
||||
};
|
||||
};
|
||||
serial@12000 {
|
||||
clock-frequency = <200000000>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
|
@ -73,7 +73,6 @@
|
||||
};
|
||||
};
|
||||
serial@12000 {
|
||||
clock-frequency = <200000000>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
|
@ -51,7 +51,6 @@
|
||||
};
|
||||
};
|
||||
serial@12000 {
|
||||
clock-frequency = <200000000>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
@ -78,7 +78,6 @@
|
||||
};
|
||||
};
|
||||
serial@12000 {
|
||||
clock-frequency = <200000000>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
|
@ -115,7 +115,6 @@
|
||||
};
|
||||
|
||||
serial@12000 {
|
||||
clock-frequency = <200000000>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
|
@ -34,7 +34,6 @@
|
||||
};
|
||||
|
||||
serial@12000 {
|
||||
clock-frequency = <200000000>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
|
@ -13,7 +13,6 @@
|
||||
|
||||
ocp@f1000000 {
|
||||
serial@12000 {
|
||||
clock-frequency = <166666667>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
@ -13,7 +13,6 @@
|
||||
|
||||
ocp@f1000000 {
|
||||
serial@12000 {
|
||||
clock-frequency = <200000000>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
@ -90,7 +90,6 @@
|
||||
};
|
||||
|
||||
serial@12000 {
|
||||
clock-frequency = <200000000>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
|
@ -23,7 +23,6 @@
|
||||
};
|
||||
|
||||
serial@12000 {
|
||||
clock-frequency = <166666667>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
@ -117,7 +117,6 @@
|
||||
};
|
||||
|
||||
serial@12000 {
|
||||
clock-frequency = <200000000>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
|
@ -18,12 +18,10 @@
|
||||
|
||||
ocp@f1000000 {
|
||||
serial@12000 {
|
||||
clock-frequency = <200000000>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
serial@12100 {
|
||||
clock-frequency = <200000000>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
|
@ -108,7 +108,6 @@
|
||||
};
|
||||
|
||||
serial@12000 {
|
||||
clock-frequency = <200000000>;
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
|
@ -38,6 +38,7 @@
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
interrupts = <35>, <36>, <37>, <38>;
|
||||
clocks = <&gate_clk 7>;
|
||||
};
|
||||
|
||||
gpio1: gpio@10140 {
|
||||
@ -49,6 +50,7 @@
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
interrupts = <39>, <40>, <41>;
|
||||
clocks = <&gate_clk 7>;
|
||||
};
|
||||
|
||||
serial@12000 {
|
||||
@ -57,7 +59,6 @@
|
||||
reg-shift = <2>;
|
||||
interrupts = <33>;
|
||||
clocks = <&gate_clk 7>;
|
||||
/* set clock-frequency in board dts */
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@ -67,7 +68,6 @@
|
||||
reg-shift = <2>;
|
||||
interrupts = <34>;
|
||||
clocks = <&gate_clk 7>;
|
||||
/* set clock-frequency in board dts */
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@ -75,6 +75,7 @@
|
||||
compatible = "marvell,kirkwood-rtc", "marvell,orion-rtc";
|
||||
reg = <0x10300 0x20>;
|
||||
interrupts = <53>;
|
||||
clocks = <&gate_clk 7>;
|
||||
};
|
||||
|
||||
spi@10600 {
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
/ {
|
||||
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 {
|
||||
reg = <0x00000000 0x4000000>; /* 64 MB */
|
||||
|
@ -41,16 +41,12 @@ static void __init kirkwood_legacy_clk_init(void)
|
||||
|
||||
struct device_node *np = of_find_compatible_node(
|
||||
NULL, NULL, "marvell,kirkwood-gating-clock");
|
||||
|
||||
struct of_phandle_args clkspec;
|
||||
struct clk *clk;
|
||||
|
||||
clkspec.np = np;
|
||||
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;
|
||||
orion_clkdev_add("0", "pcie",
|
||||
of_clk_get_from_provider(&clkspec));
|
||||
@ -59,9 +55,24 @@ static void __init kirkwood_legacy_clk_init(void)
|
||||
orion_clkdev_add("1", "pcie",
|
||||
of_clk_get_from_provider(&clkspec));
|
||||
|
||||
clkspec.args[0] = CGC_BIT_GE1;
|
||||
orion_clkdev_add(NULL, "mv643xx_eth_port.1",
|
||||
clkspec.args[0] = CGC_BIT_SDIO;
|
||||
orion_clkdev_add(NULL, "mvsdio",
|
||||
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)
|
||||
|
@ -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));
|
||||
|
||||
/*
|
||||
* 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;
|
||||
|
||||
w = &orion_mbus_dram_info.cs[cs++];
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include <linux/io.h>
|
||||
#include <linux/of_irq.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
|
||||
/*
|
||||
@ -496,6 +497,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
|
||||
struct resource *res;
|
||||
struct irq_chip_generic *gc;
|
||||
struct irq_chip_type *ct;
|
||||
struct clk *clk;
|
||||
unsigned int ngpios;
|
||||
int soc_variant;
|
||||
int i, cpu, id;
|
||||
@ -529,6 +531,11 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
|
||||
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->chip.label = dev_name(&pdev->dev);
|
||||
mvchip->chip.dev = &pdev->dev;
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
@ -41,6 +42,7 @@ struct rtc_plat_data {
|
||||
struct rtc_device *rtc;
|
||||
void __iomem *ioaddr;
|
||||
int irq;
|
||||
struct clk *clk;
|
||||
};
|
||||
|
||||
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)
|
||||
struct rtc_plat_data *pdata;
|
||||
resource_size_t size;
|
||||
u32 rtc_time;
|
||||
int ret = 0;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!res)
|
||||
@ -239,11 +242,17 @@ static int mv_rtc_probe(struct platform_device *pdev)
|
||||
if (!pdata->ioaddr)
|
||||
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 */
|
||||
rtc_time = readl(pdata->ioaddr + RTC_TIME_REG_OFFS);
|
||||
if (rtc_time & RTC_HOURS_12H_MODE) {
|
||||
dev_err(&pdev->dev, "24 Hours mode not supported.\n");
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* make sure it is actually functional */
|
||||
@ -252,7 +261,8 @@ static int mv_rtc_probe(struct platform_device *pdev)
|
||||
rtc_time = readl(pdata->ioaddr + RTC_TIME_REG_OFFS);
|
||||
if (rtc_time == 0x01000000) {
|
||||
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)
|
||||
} else
|
||||
pdata->rtc = rtc_device_register(pdev->name, &pdev->dev,
|
||||
&mv_rtc_ops, THIS_MODULE);
|
||||
if (IS_ERR(pdata->rtc))
|
||||
return PTR_ERR(pdata->rtc);
|
||||
if (IS_ERR(pdata->rtc)) {
|
||||
ret = PTR_ERR(pdata->rtc);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (pdata->irq >= 0) {
|
||||
writel(0, pdata->ioaddr + RTC_ALARM_INTERRUPT_MASK_REG_OFFS);
|
||||
@ -282,6 +294,11 @@ static int mv_rtc_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
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)
|
||||
@ -292,6 +309,9 @@ static int __exit mv_rtc_remove(struct platform_device *pdev)
|
||||
device_init_wakeup(&pdev->dev, 0);
|
||||
|
||||
rtc_device_unregister(pdata->rtc);
|
||||
if (!IS_ERR(pdata->clk))
|
||||
clk_disable_unprepare(pdata->clk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user