Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 344153
b: refs/heads/master
c: 15753b6
h: refs/heads/master
i:
  344151: 73d5d11
v: v3
  • Loading branch information
John Crispin committed Nov 11, 2012
1 parent 9e5aa53 commit 4c17e8c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a15d129a352e5f6ab821b81bc3f692ecc952a815
refs/heads/master: 15753b6586710d788f36cfd5fbb98d0805b390ab
22 changes: 15 additions & 7 deletions trunk/arch/mips/lantiq/xway/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@
/* reset cause */
#define RCU_STAT_SHIFT 26
/* boot selection */
#define RCU_BOOT_SEL_SHIFT 26
#define RCU_BOOT_SEL_MASK 0x7
#define RCU_BOOT_SEL(x) ((x >> 18) & 0x7)
#define RCU_BOOT_SEL_XRX200(x) (((x >> 17) & 0xf) | ((x >> 8) & 0x10))

/* remapped base addr of the reset control unit */
static void __iomem *ltq_rcu_membase;
static struct device_node *ltq_rcu_np;

/* This function is used by the watchdog driver */
int ltq_reset_cause(void)
Expand All @@ -52,7 +53,11 @@ EXPORT_SYMBOL_GPL(ltq_reset_cause);
unsigned char ltq_boot_select(void)
{
u32 val = ltq_rcu_r32(RCU_RST_STAT);
return (val >> RCU_BOOT_SEL_SHIFT) & RCU_BOOT_SEL_MASK;

if (of_device_is_compatible(ltq_rcu_np, "lantiq,rcu-xrx200"))
return RCU_BOOT_SEL_XRX200(val);

return RCU_BOOT_SEL(val);
}

/* reset a io domain for u micro seconds */
Expand Down Expand Up @@ -85,14 +90,17 @@ static void ltq_machine_power_off(void)
static int __init mips_reboot_setup(void)
{
struct resource res;
struct device_node *np =
of_find_compatible_node(NULL, NULL, "lantiq,rcu-xway");

ltq_rcu_np = of_find_compatible_node(NULL, NULL, "lantiq,rcu-xway");
if (!ltq_rcu_np)
ltq_rcu_np = of_find_compatible_node(NULL, NULL,
"lantiq,rcu-xrx200");

/* check if all the reset register range is available */
if (!np)
if (!ltq_rcu_np)
panic("Failed to load reset resources from devicetree");

if (of_address_to_resource(np, 0, &res))
if (of_address_to_resource(ltq_rcu_np, 0, &res))
panic("Failed to get rcu memory range");

if (request_mem_region(res.start, resource_size(&res), res.name) < 0)
Expand Down

0 comments on commit 4c17e8c

Please sign in to comment.