diff options
author | Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> | 2013-06-17 09:51:48 -0400 |
---|---|---|
committer | Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> | 2013-08-21 05:29:53 -0400 |
commit | 78b4d6e0fd2695da3019c86133444578d1ceeed3 (patch) | |
tree | 668a67466bff03be655d80db3dd35504c96f9542 /drivers/bus | |
parent | f6cec7cd0777fa18723fce9d398fa7e53b6ef00c (diff) |
drivers/bus: arm-cci: avoid parsing DT for cpu device nodes
Since the CPU device nodes can be retrieved using arch_of_get_cpu_node,
we can use it to avoid parsing the cpus node searching the cpu nodes and
mapping to logical index.
This patch removes parsing DT for cpu nodes by using of_get_cpu_node.
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
Diffstat (limited to 'drivers/bus')
-rw-r--r-- | drivers/bus/arm-cci.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c index 733288967d4d..200926699778 100644 --- a/drivers/bus/arm-cci.c +++ b/drivers/bus/arm-cci.c | |||
@@ -122,17 +122,8 @@ EXPORT_SYMBOL_GPL(cci_ace_get_port); | |||
122 | 122 | ||
123 | static void __init cci_ace_init_ports(void) | 123 | static void __init cci_ace_init_ports(void) |
124 | { | 124 | { |
125 | int port, ac, cpu; | 125 | int port, cpu; |
126 | u64 hwid; | 126 | struct device_node *cpun; |
127 | const u32 *cell; | ||
128 | struct device_node *cpun, *cpus; | ||
129 | |||
130 | cpus = of_find_node_by_path("/cpus"); | ||
131 | if (WARN(!cpus, "Missing cpus node, bailing out\n")) | ||
132 | return; | ||
133 | |||
134 | if (WARN_ON(of_property_read_u32(cpus, "#address-cells", &ac))) | ||
135 | ac = of_n_addr_cells(cpus); | ||
136 | 127 | ||
137 | /* | 128 | /* |
138 | * Port index look-up speeds up the function disabling ports by CPU, | 129 | * Port index look-up speeds up the function disabling ports by CPU, |
@@ -141,18 +132,13 @@ static void __init cci_ace_init_ports(void) | |||
141 | * The stashed index array is initialized for all possible CPUs | 132 | * The stashed index array is initialized for all possible CPUs |
142 | * at probe time. | 133 | * at probe time. |
143 | */ | 134 | */ |
144 | for_each_child_of_node(cpus, cpun) { | 135 | for_each_possible_cpu(cpu) { |
145 | if (of_node_cmp(cpun->type, "cpu")) | 136 | /* too early to use cpu->of_node */ |
146 | continue; | 137 | cpun = of_get_cpu_node(cpu, NULL); |
147 | cell = of_get_property(cpun, "reg", NULL); | ||
148 | if (WARN(!cell, "%s: missing reg property\n", cpun->full_name)) | ||
149 | continue; | ||
150 | |||
151 | hwid = of_read_number(cell, ac); | ||
152 | cpu = get_logical_index(hwid & MPIDR_HWID_BITMASK); | ||
153 | 138 | ||
154 | if (cpu < 0 || !cpu_possible(cpu)) | 139 | if (WARN(!cpun, "Missing cpu device node\n")) |
155 | continue; | 140 | continue; |
141 | |||
156 | port = __cci_ace_get_port(cpun, ACE_PORT); | 142 | port = __cci_ace_get_port(cpun, ACE_PORT); |
157 | if (port < 0) | 143 | if (port < 0) |
158 | continue; | 144 | continue; |