Loading arch/powerpc/boot/dts/prpmc2800.dts +6 −0 Original line number Diff line number Diff line Loading @@ -207,6 +207,12 @@ mpsc@9000 { interrupt-parent = <&/mv64x60/pic>; }; wdt@b410 { /* watchdog timer */ compatible = "marvell,mv64x60-wdt"; reg = <b410 8>; timeout = <a>; /* wdt timeout in seconds */ }; i2c@c000 { device_type = "i2c"; compatible = "marvell,mv64x60-i2c"; Loading arch/powerpc/sysdev/mv64x60_dev.c +64 −0 Original line number Diff line number Diff line Loading @@ -390,6 +390,61 @@ static int __init mv64x60_i2c_device_setup(struct device_node *np, int id) return err; } /* * Create mv64x60_wdt platform devices */ static int __init mv64x60_wdt_device_setup(struct device_node *np, int id) { struct resource r; struct platform_device *pdev; struct mv64x60_wdt_pdata pdata; const unsigned int *prop; int err; err = of_address_to_resource(np, 0, &r); if (err) return err; memset(&pdata, 0, sizeof(pdata)); prop = of_get_property(np, "timeout", NULL); if (!prop) return -ENODEV; pdata.timeout = *prop; np = of_get_parent(np); if (!np) return -ENODEV; prop = of_get_property(np, "clock-frequency", NULL); of_node_put(np); if (!prop) return -ENODEV; pdata.bus_clk = *prop / 1000000; /* wdt driver wants freq in MHz */ pdev = platform_device_alloc(MV64x60_WDT_NAME, id); if (!pdev) return -ENOMEM; err = platform_device_add_resources(pdev, &r, 1); if (err) goto error; err = platform_device_add_data(pdev, &pdata, sizeof(pdata)); if (err) goto error; err = platform_device_add(pdev); if (err) goto error; return 0; error: platform_device_put(pdev); return err; } static int __init mv64x60_device_setup(void) { struct device_node *np = NULL; Loading @@ -414,6 +469,15 @@ static int __init mv64x60_device_setup(void) if ((err = mv64x60_i2c_device_setup(np, id))) goto error; /* support up to one watchdog timer */ np = of_find_compatible_node(np, NULL, "marvell,mv64x60-wdt"); if (np) { if ((err = mv64x60_wdt_device_setup(np, id))) goto error; of_node_put(np); } return 0; error: Loading drivers/char/watchdog/mv64x60_wdt.c +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ #include <linux/watchdog.h> #include <linux/platform_device.h> #include <asm/mv64x60.h> #include <linux/mv643xx.h> #include <asm/uaccess.h> #include <asm/io.h> Loading include/asm-ppc/mv64x60.h +0 −8 Original line number Diff line number Diff line Loading @@ -120,14 +120,6 @@ extern spinlock_t mv64x60_lock; #define MV64x60_64BIT_WIN_COUNT 24 /* Watchdog Platform Device, Driver Data */ #define MV64x60_WDT_NAME "mv64x60_wdt" struct mv64x60_wdt_pdata { int timeout; /* watchdog expiry in seconds, default 10 */ int bus_clk; /* bus clock in MHz, default 133 */ }; /* * Define a structure that's used to pass in config information to the * core routines. Loading include/linux/mv643xx.h +8 −0 Original line number Diff line number Diff line Loading @@ -1302,4 +1302,12 @@ struct mv643xx_eth_platform_data { u8 mac_addr[6]; /* mac address if non-zero*/ }; /* Watchdog Platform Device, Driver Data */ #define MV64x60_WDT_NAME "mv64x60_wdt" struct mv64x60_wdt_pdata { int timeout; /* watchdog expiry in seconds, default 10 */ int bus_clk; /* bus clock in MHz, default 133 */ }; #endif /* __ASM_MV643XX_H */ Loading
arch/powerpc/boot/dts/prpmc2800.dts +6 −0 Original line number Diff line number Diff line Loading @@ -207,6 +207,12 @@ mpsc@9000 { interrupt-parent = <&/mv64x60/pic>; }; wdt@b410 { /* watchdog timer */ compatible = "marvell,mv64x60-wdt"; reg = <b410 8>; timeout = <a>; /* wdt timeout in seconds */ }; i2c@c000 { device_type = "i2c"; compatible = "marvell,mv64x60-i2c"; Loading
arch/powerpc/sysdev/mv64x60_dev.c +64 −0 Original line number Diff line number Diff line Loading @@ -390,6 +390,61 @@ static int __init mv64x60_i2c_device_setup(struct device_node *np, int id) return err; } /* * Create mv64x60_wdt platform devices */ static int __init mv64x60_wdt_device_setup(struct device_node *np, int id) { struct resource r; struct platform_device *pdev; struct mv64x60_wdt_pdata pdata; const unsigned int *prop; int err; err = of_address_to_resource(np, 0, &r); if (err) return err; memset(&pdata, 0, sizeof(pdata)); prop = of_get_property(np, "timeout", NULL); if (!prop) return -ENODEV; pdata.timeout = *prop; np = of_get_parent(np); if (!np) return -ENODEV; prop = of_get_property(np, "clock-frequency", NULL); of_node_put(np); if (!prop) return -ENODEV; pdata.bus_clk = *prop / 1000000; /* wdt driver wants freq in MHz */ pdev = platform_device_alloc(MV64x60_WDT_NAME, id); if (!pdev) return -ENOMEM; err = platform_device_add_resources(pdev, &r, 1); if (err) goto error; err = platform_device_add_data(pdev, &pdata, sizeof(pdata)); if (err) goto error; err = platform_device_add(pdev); if (err) goto error; return 0; error: platform_device_put(pdev); return err; } static int __init mv64x60_device_setup(void) { struct device_node *np = NULL; Loading @@ -414,6 +469,15 @@ static int __init mv64x60_device_setup(void) if ((err = mv64x60_i2c_device_setup(np, id))) goto error; /* support up to one watchdog timer */ np = of_find_compatible_node(np, NULL, "marvell,mv64x60-wdt"); if (np) { if ((err = mv64x60_wdt_device_setup(np, id))) goto error; of_node_put(np); } return 0; error: Loading
drivers/char/watchdog/mv64x60_wdt.c +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ #include <linux/watchdog.h> #include <linux/platform_device.h> #include <asm/mv64x60.h> #include <linux/mv643xx.h> #include <asm/uaccess.h> #include <asm/io.h> Loading
include/asm-ppc/mv64x60.h +0 −8 Original line number Diff line number Diff line Loading @@ -120,14 +120,6 @@ extern spinlock_t mv64x60_lock; #define MV64x60_64BIT_WIN_COUNT 24 /* Watchdog Platform Device, Driver Data */ #define MV64x60_WDT_NAME "mv64x60_wdt" struct mv64x60_wdt_pdata { int timeout; /* watchdog expiry in seconds, default 10 */ int bus_clk; /* bus clock in MHz, default 133 */ }; /* * Define a structure that's used to pass in config information to the * core routines. Loading
include/linux/mv643xx.h +8 −0 Original line number Diff line number Diff line Loading @@ -1302,4 +1302,12 @@ struct mv643xx_eth_platform_data { u8 mac_addr[6]; /* mac address if non-zero*/ }; /* Watchdog Platform Device, Driver Data */ #define MV64x60_WDT_NAME "mv64x60_wdt" struct mv64x60_wdt_pdata { int timeout; /* watchdog expiry in seconds, default 10 */ int bus_clk; /* bus clock in MHz, default 133 */ }; #endif /* __ASM_MV643XX_H */