diff options
author | Arnd Bergmann <arnd@arndb.de> | 2014-05-23 12:19:11 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2014-05-23 15:56:09 -0400 |
commit | 650052b141fd5640176e54dd443e5ff13ed2b77f (patch) | |
tree | 2d567d2949c6c5ac66eff9f61a29d3a40fd90385 /drivers/power | |
parent | 9706c077d8f786268b2c48c368547c3bd8262bfb (diff) | |
parent | 61d45495779c54d40a447d6d9a14d6f7863780b2 (diff) |
Merge branch 'axxia/soc' into next/soc
Patches from Anders Berg applied individually:
Here is version 4 of platform support for AXM5516 SoC.
The clk driver is now applied to clk-next. The rest should be ready for
arm-soc. Haven't got any response from the power/reset maintainers... I hope
this driver can be taken via arm-soc as well.
The AXM55xx family consists of devices that may contain up to 16 ARM Cortex-A15
cores (in a 4x4 cluster configuration). The cores within each cluster share an
L2 cache, and the clusters are connected to each other via a CCN-504 cache
coherent interconnect.
This machine requires CONFIG_ARM_LPAE enabled as all peripherals are located
above 4GB in the memory map.
* axxia/soc:
ARM: dts: axxia: Add reset controller
power: reset: Add Axxia system reset driver
ARM: axxia: Adding defconfig for AXM55xx
ARM: dts: Device tree for AXM55xx.
ARM: Add platform support for LSI AXM55xx SoC
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/reset/Kconfig | 8 | ||||
-rw-r--r-- | drivers/power/reset/Makefile | 1 | ||||
-rw-r--r-- | drivers/power/reset/axxia-reset.c | 88 |
3 files changed, 97 insertions, 0 deletions
diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig index fa0e4e057b99..49b46e6ca959 100644 --- a/drivers/power/reset/Kconfig +++ b/drivers/power/reset/Kconfig | |||
@@ -12,6 +12,14 @@ config POWER_RESET_AS3722 | |||
12 | help | 12 | help |
13 | This driver supports turning off board via a ams AS3722 power-off. | 13 | This driver supports turning off board via a ams AS3722 power-off. |
14 | 14 | ||
15 | config POWER_RESET_AXXIA | ||
16 | bool "LSI Axxia reset driver" | ||
17 | depends on POWER_RESET && ARCH_AXXIA | ||
18 | help | ||
19 | This driver supports restart for Axxia SoC. | ||
20 | |||
21 | Say Y if you have an Axxia family SoC. | ||
22 | |||
15 | config POWER_RESET_GPIO | 23 | config POWER_RESET_GPIO |
16 | bool "GPIO power-off driver" | 24 | bool "GPIO power-off driver" |
17 | depends on OF_GPIO && POWER_RESET | 25 | depends on OF_GPIO && POWER_RESET |
diff --git a/drivers/power/reset/Makefile b/drivers/power/reset/Makefile index a5b4a77d1a41..16c0516e5a19 100644 --- a/drivers/power/reset/Makefile +++ b/drivers/power/reset/Makefile | |||
@@ -1,4 +1,5 @@ | |||
1 | obj-$(CONFIG_POWER_RESET_AS3722) += as3722-poweroff.o | 1 | obj-$(CONFIG_POWER_RESET_AS3722) += as3722-poweroff.o |
2 | obj-$(CONFIG_POWER_RESET_AXXIA) += axxia-reset.o | ||
2 | obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o | 3 | obj-$(CONFIG_POWER_RESET_GPIO) += gpio-poweroff.o |
3 | obj-$(CONFIG_POWER_RESET_MSM) += msm-poweroff.o | 4 | obj-$(CONFIG_POWER_RESET_MSM) += msm-poweroff.o |
4 | obj-$(CONFIG_POWER_RESET_QNAP) += qnap-poweroff.o | 5 | obj-$(CONFIG_POWER_RESET_QNAP) += qnap-poweroff.o |
diff --git a/drivers/power/reset/axxia-reset.c b/drivers/power/reset/axxia-reset.c new file mode 100644 index 000000000000..3b1f8d601784 --- /dev/null +++ b/drivers/power/reset/axxia-reset.c | |||
@@ -0,0 +1,88 @@ | |||
1 | /* | ||
2 | * Reset driver for Axxia devices | ||
3 | * | ||
4 | * Copyright (C) 2014 LSI | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 and | ||
8 | * only version 2 as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | */ | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/err.h> | ||
18 | #include <linux/io.h> | ||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/mfd/syscon.h> | ||
21 | #include <linux/module.h> | ||
22 | #include <linux/of.h> | ||
23 | #include <linux/platform_device.h> | ||
24 | #include <linux/reboot.h> | ||
25 | #include <linux/regmap.h> | ||
26 | |||
27 | #include <asm/system_misc.h> | ||
28 | |||
29 | |||
30 | #define SC_CRIT_WRITE_KEY 0x1000 | ||
31 | #define SC_LATCH_ON_RESET 0x1004 | ||
32 | #define SC_RESET_CONTROL 0x1008 | ||
33 | #define RSTCTL_RST_ZERO (1<<3) | ||
34 | #define RSTCTL_RST_FAB (1<<2) | ||
35 | #define RSTCTL_RST_CHIP (1<<1) | ||
36 | #define RSTCTL_RST_SYS (1<<0) | ||
37 | #define SC_EFUSE_INT_STATUS 0x180c | ||
38 | #define EFUSE_READ_DONE (1<<31) | ||
39 | |||
40 | static struct regmap *syscon; | ||
41 | |||
42 | static void do_axxia_restart(enum reboot_mode reboot_mode, const char *cmd) | ||
43 | { | ||
44 | /* Access Key (0xab) */ | ||
45 | regmap_write(syscon, SC_CRIT_WRITE_KEY, 0xab); | ||
46 | /* Select internal boot from 0xffff0000 */ | ||
47 | regmap_write(syscon, SC_LATCH_ON_RESET, 0x00000040); | ||
48 | /* Assert ResetReadDone (to avoid hanging in boot ROM) */ | ||
49 | regmap_write(syscon, SC_EFUSE_INT_STATUS, EFUSE_READ_DONE); | ||
50 | /* Assert chip reset */ | ||
51 | regmap_update_bits(syscon, SC_RESET_CONTROL, | ||
52 | RSTCTL_RST_CHIP, RSTCTL_RST_CHIP); | ||
53 | } | ||
54 | |||
55 | static int axxia_reset_probe(struct platform_device *pdev) | ||
56 | { | ||
57 | struct device *dev = &pdev->dev; | ||
58 | |||
59 | syscon = syscon_regmap_lookup_by_phandle(dev->of_node, "syscon"); | ||
60 | if (IS_ERR(syscon)) { | ||
61 | pr_err("%s: syscon lookup failed\n", dev->of_node->name); | ||
62 | return PTR_ERR(syscon); | ||
63 | } | ||
64 | |||
65 | arm_pm_restart = do_axxia_restart; | ||
66 | |||
67 | return 0; | ||
68 | } | ||
69 | |||
70 | static const struct of_device_id of_axxia_reset_match[] = { | ||
71 | { .compatible = "lsi,axm55xx-reset", }, | ||
72 | {}, | ||
73 | }; | ||
74 | MODULE_DEVICE_TABLE(of, of_axxia_reset_match); | ||
75 | |||
76 | static struct platform_driver axxia_reset_driver = { | ||
77 | .probe = axxia_reset_probe, | ||
78 | .driver = { | ||
79 | .name = "axxia-reset", | ||
80 | .of_match_table = of_match_ptr(of_axxia_reset_match), | ||
81 | }, | ||
82 | }; | ||
83 | |||
84 | static int __init axxia_reset_init(void) | ||
85 | { | ||
86 | return platform_driver_register(&axxia_reset_driver); | ||
87 | } | ||
88 | device_initcall(axxia_reset_init); | ||