Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 68314725 authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by Ralf Baechle
Browse files

[MIPS] TXx9: Cleanup watchdog



Unify registration of txx9wdt platform device.

Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent a49297e8
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/platform_device.h>
#include <asm/bootinfo.h>
#include <asm/time.h>
#include <asm/reboot.h>
@@ -208,6 +209,17 @@ static void __noreturn txx9_machine_halt(void)
	}
}

/* Watchdog support */
void __init txx9_wdt_init(unsigned long base)
{
	struct resource res = {
		.start	= base,
		.end	= base + 0x100 - 1,
		.flags	= IORESOURCE_MEM,
	};
	platform_device_register_simple("txx9wdt", -1, &res, 1);
}

/* wrappers */
void __init plat_mem_setup(void)
{
+6 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#include <asm/txx9/generic.h>
#include <asm/txx9/tx4927.h>

void __init tx4927_wdr_init(void)
static void __init tx4927_wdr_init(void)
{
	/* clear WatchDogReset (W1C) */
	tx4927_ccfg_set(TX4927_CCFG_WDRST);
@@ -29,6 +29,11 @@ void __init tx4927_wdr_init(void)
	tx4927_ccfg_set(TX4927_CCFG_WR);
}

void __init tx4927_wdt_init(void)
{
	txx9_wdt_init(TX4927_TMR_REG(2) & 0xfffffffffULL);
}

static struct resource tx4927_sdram_resource[4];

void __init tx4927_setup(void)
+6 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#include <asm/txx9/generic.h>
#include <asm/txx9/tx4938.h>

void __init tx4938_wdr_init(void)
static void __init tx4938_wdr_init(void)
{
	/* clear WatchDogReset (W1C) */
	tx4938_ccfg_set(TX4938_CCFG_WDRST);
@@ -29,6 +29,11 @@ void __init tx4938_wdr_init(void)
	tx4938_ccfg_set(TX4938_CCFG_WR);
}

void __init tx4938_wdt_init(void)
{
	txx9_wdt_init(TX4938_TMR_REG(2) & 0xfffffffffULL);
}

static struct resource tx4938_sdram_resource[4];
static struct resource tx4938_sram_resource;

+3 −17
Original line number Diff line number Diff line
@@ -308,30 +308,16 @@ static int __init jmr3927_rtc_init(void)
	return IS_ERR(dev) ? PTR_ERR(dev) : 0;
}

/* Watchdog support */

static int __init txx9_wdt_init(unsigned long base)
{
	struct resource res = {
		.start	= base,
		.end	= base + 0x100 - 1,
		.flags	= IORESOURCE_MEM,
	};
	struct platform_device *dev =
		platform_device_register_simple("txx9wdt", -1, &res, 1);
	return IS_ERR(dev) ? PTR_ERR(dev) : 0;
}

static int __init jmr3927_wdt_init(void)
static void __init tx3927_wdt_init(void)
{
	return txx9_wdt_init(TX3927_TMR_REG(2));
	txx9_wdt_init(TX3927_TMR_REG(2));
}

static void __init jmr3927_device_init(void)
{
	__swizzle_addr_b = jmr3927_swizzle_addr_b;
	jmr3927_rtc_init();
	jmr3927_wdt_init();
	tx3927_wdt_init();
}

struct txx9_board_vec jmr3927_vec __initdata = {
+1 −20
Original line number Diff line number Diff line
@@ -328,30 +328,11 @@ static int __init rbtx4927_ne_init(void)
	return IS_ERR(dev) ? PTR_ERR(dev) : 0;
}

/* Watchdog support */

static int __init txx9_wdt_init(unsigned long base)
{
	struct resource res = {
		.start	= base,
		.end	= base + 0x100 - 1,
		.flags	= IORESOURCE_MEM,
	};
	struct platform_device *dev =
		platform_device_register_simple("txx9wdt", -1, &res, 1);
	return IS_ERR(dev) ? PTR_ERR(dev) : 0;
}

static int __init rbtx4927_wdt_init(void)
{
	return txx9_wdt_init(TX4927_TMR_REG(2) & 0xfffffffffULL);
}

static void __init rbtx4927_device_init(void)
{
	toshiba_rbtx4927_rtc_init();
	rbtx4927_ne_init();
	rbtx4927_wdt_init();
	tx4927_wdt_init();
}

struct txx9_board_vec rbtx4927_vec __initdata = {
Loading