1 /*
2  * xen/arch/arm/platforms/rcar2.c
3  *
4  * Renesas R-Car Gen2 specific settings
5  *
6  * Iurii Konovalenko <iurii.konovalenko@globallogic.com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  */
18 
19 #include <xen/mm.h>
20 #include <xen/vmap.h>
21 #include <asm/platform.h>
22 #include <asm/io.h>
23 
24 #define RCAR2_RAM_ADDR                         0xE63C0000
25 #define RCAR2_RAM_SIZE                         0x1000
26 #define RCAR2_SMP_START_OFFSET                 0xFFC
27 
rcar2_smp_init(void)28 static int __init rcar2_smp_init(void)
29 {
30     void __iomem *pram;
31 
32     /* map ICRAM */
33     pram = ioremap_nocache(RCAR2_RAM_ADDR, RCAR2_RAM_SIZE);
34     if( !pram )
35     {
36         dprintk( XENLOG_ERR, "Unable to map RCAR2 ICRAM\n");
37         return -ENOMEM;
38     }
39 
40     /* setup reset vectors */
41     writel(__pa(init_secondary), pram + RCAR2_SMP_START_OFFSET);
42     iounmap(pram);
43 
44     sev();
45 
46     return 0;
47 }
48 
49 static const char *const rcar2_dt_compat[] __initconst =
50 {
51     "renesas,lager",
52     NULL
53 };
54 
55 PLATFORM_START(rcar2, "Renesas R-Car Gen2")
56     .compatible = rcar2_dt_compat,
57     .cpu_up = cpu_up_send_sgi,
58     .smp_init = rcar2_smp_init,
59 PLATFORM_END
60 
61 /*
62  * Local variables:
63  * mode: C
64  * c-file-style: "BSD"
65  * c-basic-offset: 4
66  * indent-tabs-mode: nil
67  * End:
68  */
69