diff options
Diffstat (limited to 'arch/arm/mach-mvebu/system-controller.c')
-rw-r--r-- | arch/arm/mach-mvebu/system-controller.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/arch/arm/mach-mvebu/system-controller.c b/arch/arm/mach-mvebu/system-controller.c index a7fb89a5b5d9..614ba6832ff3 100644 --- a/arch/arm/mach-mvebu/system-controller.c +++ b/arch/arm/mach-mvebu/system-controller.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * System controller support for Armada 370 and XP platforms. | 2 | * System controller support for Armada 370, 375 and XP platforms. |
3 | * | 3 | * |
4 | * Copyright (C) 2012 Marvell | 4 | * Copyright (C) 2012 Marvell |
5 | * | 5 | * |
@@ -11,7 +11,7 @@ | |||
11 | * License version 2. This program is licensed "as is" without any | 11 | * License version 2. This program is licensed "as is" without any |
12 | * warranty of any kind, whether express or implied. | 12 | * warranty of any kind, whether express or implied. |
13 | * | 13 | * |
14 | * The Armada 370 and Armada XP SoCs both have a range of | 14 | * The Armada 370, 375 and Armada XP SoCs have a range of |
15 | * miscellaneous registers, that do not belong to a particular device, | 15 | * miscellaneous registers, that do not belong to a particular device, |
16 | * but rather provide system-level features. This basic | 16 | * but rather provide system-level features. This basic |
17 | * system-controller driver provides a device tree binding for those | 17 | * system-controller driver provides a device tree binding for those |
@@ -47,6 +47,13 @@ static const struct mvebu_system_controller armada_370_xp_system_controller = { | |||
47 | .system_soft_reset = 0x1, | 47 | .system_soft_reset = 0x1, |
48 | }; | 48 | }; |
49 | 49 | ||
50 | static const struct mvebu_system_controller armada_375_system_controller = { | ||
51 | .rstoutn_mask_offset = 0x54, | ||
52 | .system_soft_reset_offset = 0x58, | ||
53 | .rstoutn_mask_reset_out_en = 0x1, | ||
54 | .system_soft_reset = 0x1, | ||
55 | }; | ||
56 | |||
50 | static const struct mvebu_system_controller orion_system_controller = { | 57 | static const struct mvebu_system_controller orion_system_controller = { |
51 | .rstoutn_mask_offset = 0x108, | 58 | .rstoutn_mask_offset = 0x108, |
52 | .system_soft_reset_offset = 0x10c, | 59 | .system_soft_reset_offset = 0x10c, |
@@ -54,13 +61,16 @@ static const struct mvebu_system_controller orion_system_controller = { | |||
54 | .system_soft_reset = 0x1, | 61 | .system_soft_reset = 0x1, |
55 | }; | 62 | }; |
56 | 63 | ||
57 | static struct of_device_id of_system_controller_table[] = { | 64 | static const struct of_device_id of_system_controller_table[] = { |
58 | { | 65 | { |
59 | .compatible = "marvell,orion-system-controller", | 66 | .compatible = "marvell,orion-system-controller", |
60 | .data = (void *) &orion_system_controller, | 67 | .data = (void *) &orion_system_controller, |
61 | }, { | 68 | }, { |
62 | .compatible = "marvell,armada-370-xp-system-controller", | 69 | .compatible = "marvell,armada-370-xp-system-controller", |
63 | .data = (void *) &armada_370_xp_system_controller, | 70 | .data = (void *) &armada_370_xp_system_controller, |
71 | }, { | ||
72 | .compatible = "marvell,armada-375-system-controller", | ||
73 | .data = (void *) &armada_375_system_controller, | ||
64 | }, | 74 | }, |
65 | { /* end of list */ }, | 75 | { /* end of list */ }, |
66 | }; | 76 | }; |
@@ -90,13 +100,12 @@ void mvebu_restart(enum reboot_mode mode, const char *cmd) | |||
90 | 100 | ||
91 | static int __init mvebu_system_controller_init(void) | 101 | static int __init mvebu_system_controller_init(void) |
92 | { | 102 | { |
103 | const struct of_device_id *match; | ||
93 | struct device_node *np; | 104 | struct device_node *np; |
94 | 105 | ||
95 | np = of_find_matching_node(NULL, of_system_controller_table); | 106 | np = of_find_matching_node_and_match(NULL, of_system_controller_table, |
107 | &match); | ||
96 | if (np) { | 108 | if (np) { |
97 | const struct of_device_id *match = | ||
98 | of_match_node(of_system_controller_table, np); | ||
99 | BUG_ON(!match); | ||
100 | system_controller_base = of_iomap(np, 0); | 109 | system_controller_base = of_iomap(np, 0); |
101 | mvebu_sc = (struct mvebu_system_controller *)match->data; | 110 | mvebu_sc = (struct mvebu_system_controller *)match->data; |
102 | of_node_put(np); | 111 | of_node_put(np); |