adds 3.6 files, patches and config
[oweals/openwrt.git] / target / linux / lantiq / patches-3.6 / 0104-MIPS-lantiq-xway-split-ltq_reset_once-into-2-subfunc.patch
1 From 8fc2eacbe332fbf6bfd09425fb141bb47d843a78 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Mon, 22 Oct 2012 09:32:46 +0200
4 Subject: [PATCH 104/113] MIPS: lantiq: xway: split ltq_reset_once into 2
5  subfunctions
6
7 We need to call the reset functions from within the phy reset code and dont
8 want to duplicate the access code for the reset registers.
9
10 Signed-off-by: John Crispin <blogic@openwrt.org>
11 ---
12  arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h |    3 +++
13  arch/mips/lantiq/xway/reset.c                       |   14 ++++++++++++--
14  2 files changed, 15 insertions(+), 2 deletions(-)
15
16 diff --git a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
17 index 6a2df70..6b9f5be 100644
18 --- a/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
19 +++ b/arch/mips/include/asm/mach-lantiq/xway/lantiq_soc.h
20 @@ -87,5 +87,8 @@ extern __iomem void *ltq_cgu_membase;
21  extern void ltq_pmu_enable(unsigned int module);
22  extern void ltq_pmu_disable(unsigned int module);
23  
24 +/* allow drivers to reset clock domains and ip cores */
25 +void ltq_reset_once(unsigned int module, ulong u);
26 +
27  #endif /* CONFIG_SOC_TYPE_XWAY */
28  #endif /* _LTQ_XWAY_H__ */
29 diff --git a/arch/mips/lantiq/xway/reset.c b/arch/mips/lantiq/xway/reset.c
30 index a89d1a3..1b77f82 100644
31 --- a/arch/mips/lantiq/xway/reset.c
32 +++ b/arch/mips/lantiq/xway/reset.c
33 @@ -55,12 +55,22 @@ unsigned char ltq_boot_select(void)
34         return (val >> RCU_BOOT_SEL_SHIFT) & RCU_BOOT_SEL_MASK;
35  }
36  
37 +static void ltq_reset_enter(unsigned int module)
38 +{
39 +       ltq_rcu_w32(ltq_rcu_r32(RCU_RST_REQ) | module, RCU_RST_REQ);
40 +}
41 +
42 +static void ltq_reset_leave(unsigned int module)
43 +{
44 +       ltq_rcu_w32(ltq_rcu_r32(RCU_RST_REQ) & ~module, RCU_RST_REQ);
45 +}
46 +
47  /* reset a io domain for u micro seconds */
48  void ltq_reset_once(unsigned int module, ulong u)
49  {
50 -       ltq_rcu_w32(ltq_rcu_r32(RCU_RST_REQ) | module, RCU_RST_REQ);
51 +       ltq_reset_enter(RCU_RST_REQ);
52         udelay(u);
53 -       ltq_rcu_w32(ltq_rcu_r32(RCU_RST_REQ) & ~module, RCU_RST_REQ);
54 +       ltq_reset_leave(RCU_RST_REQ);
55  }
56  
57  static void ltq_machine_restart(char *command)
58 -- 
59 1.7.10.4
60