1 /*
2 * xen/arch/arm/platforms/midway.c
3 *
4 * Calxeda Midway specific settings
5 *
6 * Andre Przywara <andre.przywara@linaro.org>
7 * Copyright (c) 2013 Linaro Limited.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */
19
20 #include <xen/mm.h>
21 #include <xen/vmap.h>
22 #include <asm/platforms/midway.h>
23 #include <asm/platform.h>
24 #include <asm/io.h>
25
midway_reset(void)26 static void midway_reset(void)
27 {
28 void __iomem *pmu;
29
30 BUILD_BUG_ON((MW_SREG_PWR_REQ & PAGE_MASK) !=
31 (MW_SREG_A15_PWR_CTRL & PAGE_MASK));
32
33 pmu = ioremap_nocache(MW_SREG_PWR_REQ & PAGE_MASK, PAGE_SIZE);
34 if ( !pmu )
35 {
36 dprintk(XENLOG_ERR, "Unable to map PMU\n");
37 return;
38 }
39
40 writel(MW_PWR_HARD_RESET, pmu + (MW_SREG_PWR_REQ & ~PAGE_MASK));
41 writel(1, pmu + (MW_SREG_A15_PWR_CTRL & ~PAGE_MASK));
42 iounmap(pmu);
43 }
44
45 static const char * const midway_dt_compat[] __initconst =
46 {
47 "calxeda,ecx-2000",
48 NULL
49 };
50
51 PLATFORM_START(midway, "CALXEDA MIDWAY")
52 .compatible = midway_dt_compat,
53 .reset = midway_reset,
54 PLATFORM_END
55
56 /*
57 * Local variables:
58 * mode: C
59 * c-file-style: "BSD"
60 * c-basic-offset: 4
61 * indent-tabs-mode: nil
62 * End:
63 */
64