diff mbox

[Xen-devel,02/10] xen/arm: Implement hip04-d01 board reboot

Message ID 1415009522-6344-3-git-send-email-frediano.ziglio@huawei.com
State New
Headers show

Commit Message

Frediano Ziglio Nov. 3, 2014, 10:11 a.m. UTC
Signed-off-by: Frediano Ziglio <frediano.ziglio@huawei.com>
---
 xen/arch/arm/platforms/hip04.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

Comments

Julien Grall Nov. 3, 2014, 1:40 p.m. UTC | #1
Hi Frediano,

I would fold this patch in #1.

Regards,

On 11/03/2014 10:11 AM, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <frediano.ziglio@huawei.com>
> ---
>  xen/arch/arm/platforms/hip04.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/arm/platforms/hip04.c b/xen/arch/arm/platforms/hip04.c
> index bf38c23..62d2034 100644
> --- a/xen/arch/arm/platforms/hip04.c
> +++ b/xen/arch/arm/platforms/hip04.c
> @@ -27,6 +27,7 @@
>  #include <xen/vmap.h>
>  #include <asm/io.h>
>  #include <asm/gic.h>
> +#include <xen/delay.h>
>  
>  #define CORE_RESET_BIT(x)            (1 << x)
>  #define NEON_RESET_BIT(x)            (1 << (x + 4))
> @@ -53,13 +54,21 @@ struct hip04_secondary_cpu_data {
>      u32 relocation_size;
>  };
>  
> -static void __iomem *relocation, *sysctrl, *fabric;
> +static void __iomem *relocation, *sysctrl, *fabric, *gb2;
>  static int hip04_cpu_table[HIP04_MAX_CLUSTERS][HIP04_MAX_CPUS_PER_CLUSTER];
>  static struct hip04_secondary_cpu_data hip04_boot;
>  
>  static void hip04_reset(void)
>  {
> -    /* TODO */
> +    unsigned long data;
> +
> +    if ( !gb2 )
> +        return;
> +
> +    data = readl_relaxed(gb2);
> +    writel_relaxed(data & ~0x4000000u, gb2);
> +
> +    mdelay(10);
>  }
>  
>  static void hip04_set_snoop_filter(unsigned int cluster, unsigned int on)
> @@ -186,6 +195,11 @@ static int __init hip04_smp_init(void)
>      if ( !fabric )
>          goto err;
>  
> +    msg = "Error mapping GB2\n";
> +    gb2 = ioremap_nocache(0xe4002000, 0x1000);
> +    if ( !gb2 )
> +        goto err;
> +
>      msg = "Error initializing SMP table\n";
>      if ( !hip04_cpu_table_init() )
>          goto err;
>
diff mbox

Patch

diff --git a/xen/arch/arm/platforms/hip04.c b/xen/arch/arm/platforms/hip04.c
index bf38c23..62d2034 100644
--- a/xen/arch/arm/platforms/hip04.c
+++ b/xen/arch/arm/platforms/hip04.c
@@ -27,6 +27,7 @@ 
 #include <xen/vmap.h>
 #include <asm/io.h>
 #include <asm/gic.h>
+#include <xen/delay.h>
 
 #define CORE_RESET_BIT(x)            (1 << x)
 #define NEON_RESET_BIT(x)            (1 << (x + 4))
@@ -53,13 +54,21 @@  struct hip04_secondary_cpu_data {
     u32 relocation_size;
 };
 
-static void __iomem *relocation, *sysctrl, *fabric;
+static void __iomem *relocation, *sysctrl, *fabric, *gb2;
 static int hip04_cpu_table[HIP04_MAX_CLUSTERS][HIP04_MAX_CPUS_PER_CLUSTER];
 static struct hip04_secondary_cpu_data hip04_boot;
 
 static void hip04_reset(void)
 {
-    /* TODO */
+    unsigned long data;
+
+    if ( !gb2 )
+        return;
+
+    data = readl_relaxed(gb2);
+    writel_relaxed(data & ~0x4000000u, gb2);
+
+    mdelay(10);
 }
 
 static void hip04_set_snoop_filter(unsigned int cluster, unsigned int on)
@@ -186,6 +195,11 @@  static int __init hip04_smp_init(void)
     if ( !fabric )
         goto err;
 
+    msg = "Error mapping GB2\n";
+    gb2 = ioremap_nocache(0xe4002000, 0x1000);
+    if ( !gb2 )
+        goto err;
+
     msg = "Error initializing SMP table\n";
     if ( !hip04_cpu_table_init() )
         goto err;