1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
6 #include <linux/seq_file.h>
8 #include <linux/delay.h>
9 #include <linux/root_dev.h>
10 #include <linux/clk.h>
11 #include <linux/clocksource.h>
12 #include <linux/console.h>
13 #include <linux/module.h>
14 #include <linux/cpu.h>
15 #include <linux/of_clk.h>
16 #include <linux/of_fdt.h>
18 #include <linux/cache.h>
19 #include <uapi/linux/mount.h>
20 #include <asm/sections.h>
21 #include <asm/arcregs.h>
22 #include <asm/asserts.h>
24 #include <asm/setup.h>
27 #include <asm/unwind.h>
28 #include <asm/mach_desc.h>
30 #include <asm/dsp-impl.h>
32 #define FIX_PTR(x) __asm__ __volatile__(";" : "+r"(x))
34 unsigned int intr_to_DE_cnt
;
36 /* Part of U-boot ABI: see head.S */
37 int __initdata uboot_tag
;
38 int __initdata uboot_magic
;
39 char __initdata
*uboot_arg
;
41 const struct machine_desc
*machine_desc
;
43 struct task_struct
*_current_task
[NR_CPUS
]; /* For stack switching */
45 struct cpuinfo_arc cpuinfo_arc700
[NR_CPUS
];
47 static const struct id_to_str arc_legacy_rel
[] = {
48 /* ID.ARCVER, Release */
49 #ifdef CONFIG_ISA_ARCOMPACT
60 static const struct id_to_str arc_cpu_rel
[] = {
61 /* UARCH.MAJOR, Release */
67 static void read_decode_ccm_bcr(struct cpuinfo_arc
*cpu
)
69 if (is_isa_arcompact()) {
70 struct bcr_iccm_arcompact iccm
;
71 struct bcr_dccm_arcompact dccm
;
73 READ_BCR(ARC_REG_ICCM_BUILD
, iccm
);
75 cpu
->iccm
.sz
= 4096 << iccm
.sz
; /* 8K to 512K */
76 cpu
->iccm
.base_addr
= iccm
.base
<< 16;
79 READ_BCR(ARC_REG_DCCM_BUILD
, dccm
);
82 cpu
->dccm
.sz
= 2048 << dccm
.sz
; /* 2K to 256K */
84 base
= read_aux_reg(ARC_REG_DCCM_BASE_BUILD
);
85 cpu
->dccm
.base_addr
= base
& ~0xF;
88 struct bcr_iccm_arcv2 iccm
;
89 struct bcr_dccm_arcv2 dccm
;
92 READ_BCR(ARC_REG_ICCM_BUILD
, iccm
);
94 cpu
->iccm
.sz
= 256 << iccm
.sz00
; /* 512B to 16M */
95 if (iccm
.sz00
== 0xF && iccm
.sz01
> 0)
96 cpu
->iccm
.sz
<<= iccm
.sz01
;
98 region
= read_aux_reg(ARC_REG_AUX_ICCM
);
99 cpu
->iccm
.base_addr
= region
& 0xF0000000;
102 READ_BCR(ARC_REG_DCCM_BUILD
, dccm
);
104 cpu
->dccm
.sz
= 256 << dccm
.sz0
;
105 if (dccm
.sz0
== 0xF && dccm
.sz1
> 0)
106 cpu
->dccm
.sz
<<= dccm
.sz1
;
108 region
= read_aux_reg(ARC_REG_AUX_DCCM
);
109 cpu
->dccm
.base_addr
= region
& 0xF0000000;
114 static void decode_arc_core(struct cpuinfo_arc
*cpu
)
116 struct bcr_uarch_build_arcv2 uarch
;
117 const struct id_to_str
*tbl
;
120 * Up until (including) the first core4 release (0x54) things were
121 * simple: AUX IDENTITY.ARCVER was sufficient to identify arc family
122 * and release: 0x50 to 0x53 was HS38, 0x54 was HS48 (dual issue)
125 if (cpu
->core
.family
< 0x54) { /* includes arc700 */
127 for (tbl
= &arc_legacy_rel
[0]; tbl
->id
!= 0; tbl
++) {
128 if (cpu
->core
.family
== tbl
->id
) {
129 cpu
->release
= tbl
->str
;
134 if (is_isa_arcompact())
135 cpu
->name
= "ARC700";
139 cpu
->name
= cpu
->release
= "Unknown";
145 * However the subsequent HS release (same 0x54) allow HS38 or HS48
146 * configurations and encode this info in a different BCR.
147 * The BCR was introduced in 0x54 so can't be read unconditionally.
150 READ_BCR(ARC_REG_MICRO_ARCH_BCR
, uarch
);
152 if (uarch
.prod
== 4) {
160 for (tbl
= &arc_cpu_rel
[0]; tbl
->id
!= 0xFF; tbl
++) {
161 if (uarch
.maj
== tbl
->id
) {
162 cpu
->release
= tbl
->str
;
168 static void read_arc_build_cfg_regs(void)
170 struct bcr_timer timer
;
171 struct bcr_generic bcr
;
172 struct cpuinfo_arc
*cpu
= &cpuinfo_arc700
[smp_processor_id()];
173 struct bcr_isa_arcv2 isa
;
174 struct bcr_actionpoint ap
;
178 READ_BCR(AUX_IDENTITY
, cpu
->core
);
179 decode_arc_core(cpu
);
181 READ_BCR(ARC_REG_TIMERS_BCR
, timer
);
182 cpu
->extn
.timer0
= timer
.t0
;
183 cpu
->extn
.timer1
= timer
.t1
;
184 cpu
->extn
.rtc
= timer
.rtc
;
186 cpu
->vec_base
= read_aux_reg(AUX_INTR_VEC_BASE
);
188 READ_BCR(ARC_REG_MUL_BCR
, cpu
->extn_mpy
);
190 /* Read CCM BCRs for boot reporting even if not enabled in Kconfig */
191 read_decode_ccm_bcr(cpu
);
193 read_decode_mmu_bcr();
194 read_decode_cache_bcr();
196 if (is_isa_arcompact()) {
197 struct bcr_fp_arcompact sp
, dp
;
198 struct bcr_bpu_arcompact bpu
;
200 READ_BCR(ARC_REG_FP_BCR
, sp
);
201 READ_BCR(ARC_REG_DPFP_BCR
, dp
);
202 cpu
->extn
.fpu_sp
= sp
.ver
? 1 : 0;
203 cpu
->extn
.fpu_dp
= dp
.ver
? 1 : 0;
205 READ_BCR(ARC_REG_BPU_BCR
, bpu
);
206 cpu
->bpu
.ver
= bpu
.ver
;
207 cpu
->bpu
.full
= bpu
.fam
? 1 : 0;
209 cpu
->bpu
.num_cache
= 256 << (bpu
.ent
- 1);
210 cpu
->bpu
.num_pred
= 256 << (bpu
.ent
- 1);
213 struct bcr_fp_arcv2 spdp
;
214 struct bcr_bpu_arcv2 bpu
;
216 READ_BCR(ARC_REG_FP_V2_BCR
, spdp
);
217 cpu
->extn
.fpu_sp
= spdp
.sp
? 1 : 0;
218 cpu
->extn
.fpu_dp
= spdp
.dp
? 1 : 0;
220 READ_BCR(ARC_REG_BPU_BCR
, bpu
);
221 cpu
->bpu
.ver
= bpu
.ver
;
222 cpu
->bpu
.full
= bpu
.ft
;
223 cpu
->bpu
.num_cache
= 256 << bpu
.bce
;
224 cpu
->bpu
.num_pred
= 2048 << bpu
.pte
;
225 cpu
->bpu
.ret_stk
= 4 << bpu
.rse
;
227 /* if dual issue hardware, is it enabled ? */
228 if (cpu
->extn
.dual
) {
229 unsigned int exec_ctrl
;
231 READ_BCR(AUX_EXEC_CTRL
, exec_ctrl
);
232 cpu
->extn
.dual_enb
= !(exec_ctrl
& 1);
236 READ_BCR(ARC_REG_AP_BCR
, ap
);
238 cpu
->extn
.ap_num
= 2 << ap
.num
;
239 cpu
->extn
.ap_full
= !ap
.min
;
242 READ_BCR(ARC_REG_SMART_BCR
, bcr
);
243 cpu
->extn
.smart
= bcr
.ver
? 1 : 0;
245 READ_BCR(ARC_REG_RTT_BCR
, bcr
);
246 cpu
->extn
.rtt
= bcr
.ver
? 1 : 0;
248 READ_BCR(ARC_REG_ISA_CFG_BCR
, isa
);
250 /* some hacks for lack of feature BCR info in old ARC700 cores */
251 if (is_isa_arcompact()) {
252 if (!isa
.ver
) /* ISA BCR absent, use Kconfig info */
253 cpu
->isa
.atomic
= IS_ENABLED(CONFIG_ARC_HAS_LLSC
);
255 /* ARC700_BUILD only has 2 bits of isa info */
256 struct bcr_generic bcr
= *(struct bcr_generic
*)&isa
;
257 cpu
->isa
.atomic
= bcr
.info
& 1;
260 cpu
->isa
.be
= IS_ENABLED(CONFIG_CPU_BIG_ENDIAN
);
262 /* there's no direct way to distinguish 750 vs. 770 */
263 if (unlikely(cpu
->core
.family
< 0x34 || cpu
->mmu
.ver
< 3))
264 cpu
->name
= "ARC750";
270 static char *arc_cpu_mumbojumbo(int cpu_id
, char *buf
, int len
)
272 struct cpuinfo_arc
*cpu
= &cpuinfo_arc700
[cpu_id
];
273 struct bcr_identity
*core
= &cpu
->core
;
279 n
+= scnprintf(buf
+ n
, len
- n
,
280 "\nIDENTITY\t: ARCVER [%#02x] ARCNUM [%#02x] CHIPID [%#4x]\n",
281 core
->family
, core
->cpu_id
, core
->chip_id
);
283 n
+= scnprintf(buf
+ n
, len
- n
, "processor [%d]\t: %s %s (%s ISA) %s%s%s\n",
284 cpu_id
, cpu
->name
, cpu
->release
,
285 is_isa_arcompact() ? "ARCompact" : "ARCv2",
286 IS_AVAIL1(cpu
->isa
.be
, "[Big-Endian]"),
287 IS_AVAIL3(cpu
->extn
.dual
, cpu
->extn
.dual_enb
, " Dual-Issue "));
289 n
+= scnprintf(buf
+ n
, len
- n
, "Timers\t\t: %s%s%s%s%s%s\nISA Extn\t: ",
290 IS_AVAIL1(cpu
->extn
.timer0
, "Timer0 "),
291 IS_AVAIL1(cpu
->extn
.timer1
, "Timer1 "),
292 IS_AVAIL2(cpu
->extn
.rtc
, "RTC [UP 64-bit] ", CONFIG_ARC_TIMERS_64BIT
),
293 IS_AVAIL2(cpu
->extn
.gfrc
, "GFRC [SMP 64-bit] ", CONFIG_ARC_TIMERS_64BIT
));
295 if (cpu
->extn_mpy
.ver
) {
296 if (is_isa_arcompact()) {
297 scnprintf(mpy_opt
, 16, "mpy");
300 int opt
= 2; /* stock MPY/MPYH */
302 if (cpu
->extn_mpy
.dsp
) /* OPT 7-9 */
303 opt
= cpu
->extn_mpy
.dsp
+ 6;
305 scnprintf(mpy_opt
, 16, "mpy[opt %d] ", opt
);
309 n
+= scnprintf(buf
+ n
, len
- n
, "%s%s%s%s%s%s%s%s\n",
310 IS_AVAIL2(cpu
->isa
.atomic
, "atomic ", CONFIG_ARC_HAS_LLSC
),
311 IS_AVAIL2(cpu
->isa
.ldd
, "ll64 ", CONFIG_ARC_HAS_LL64
),
312 IS_AVAIL2(cpu
->isa
.unalign
, "unalign ", CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS
),
313 IS_AVAIL1(cpu
->extn_mpy
.ver
, mpy_opt
),
314 IS_AVAIL1(cpu
->isa
.div_rem
, "div_rem "));
317 n
+= scnprintf(buf
+ n
, len
- n
,
318 "BPU\t\t: %s%s match, cache:%d, Predict Table:%d Return stk: %d",
319 IS_AVAIL1(cpu
->bpu
.full
, "full"),
320 IS_AVAIL1(!cpu
->bpu
.full
, "partial"),
321 cpu
->bpu
.num_cache
, cpu
->bpu
.num_pred
, cpu
->bpu
.ret_stk
);
323 if (is_isa_arcv2()) {
326 READ_BCR(ARC_REG_LPB_BUILD
, lpb
);
329 ctl
= read_aux_reg(ARC_REG_LPB_CTRL
);
331 n
+= scnprintf(buf
+ n
, len
- n
, " Loop Buffer:%d %s",
333 IS_DISABLED_RUN(!ctl
));
336 n
+= scnprintf(buf
+ n
, len
- n
, "\n");
342 static char *arc_extn_mumbojumbo(int cpu_id
, char *buf
, int len
)
345 struct cpuinfo_arc
*cpu
= &cpuinfo_arc700
[cpu_id
];
349 n
+= scnprintf(buf
+ n
, len
- n
, "Vector Table\t: %#x\n", cpu
->vec_base
);
351 if (cpu
->extn
.fpu_sp
|| cpu
->extn
.fpu_dp
)
352 n
+= scnprintf(buf
+ n
, len
- n
, "FPU\t\t: %s%s\n",
353 IS_AVAIL1(cpu
->extn
.fpu_sp
, "SP "),
354 IS_AVAIL1(cpu
->extn
.fpu_dp
, "DP "));
356 if (cpu
->extn
.ap_num
| cpu
->extn
.smart
| cpu
->extn
.rtt
) {
357 n
+= scnprintf(buf
+ n
, len
- n
, "DEBUG\t\t: %s%s",
358 IS_AVAIL1(cpu
->extn
.smart
, "smaRT "),
359 IS_AVAIL1(cpu
->extn
.rtt
, "RTT "));
360 if (cpu
->extn
.ap_num
) {
361 n
+= scnprintf(buf
+ n
, len
- n
, "ActionPoint %d/%s",
363 cpu
->extn
.ap_full
? "full":"min");
365 n
+= scnprintf(buf
+ n
, len
- n
, "\n");
368 if (cpu
->dccm
.sz
|| cpu
->iccm
.sz
)
369 n
+= scnprintf(buf
+ n
, len
- n
, "Extn [CCM]\t: DCCM @ %x, %d KB / ICCM: @ %x, %d KB\n",
370 cpu
->dccm
.base_addr
, TO_KB(cpu
->dccm
.sz
),
371 cpu
->iccm
.base_addr
, TO_KB(cpu
->iccm
.sz
));
373 if (is_isa_arcv2()) {
375 /* Error Protection: ECC/Parity */
377 READ_BCR(ARC_REG_ERP_BUILD
, erp
);
381 READ_BCR(ARC_REG_ERP_CTRL
, ctl
);
383 /* inverted bits: 0 means enabled */
384 n
+= scnprintf(buf
+ n
, len
- n
, "Extn [ECC]\t: %s%s%s%s%s%s\n",
385 IS_AVAIL3(erp
.ic
, !ctl
.dpi
, "IC "),
386 IS_AVAIL3(erp
.dc
, !ctl
.dpd
, "DC "),
387 IS_AVAIL3(erp
.mmu
, !ctl
.mpd
, "MMU "));
394 void chk_opt_strict(char *opt_name
, bool hw_exists
, bool opt_ena
)
396 if (hw_exists
&& !opt_ena
)
397 pr_warn(" ! Enable %s for working apps\n", opt_name
);
398 else if (!hw_exists
&& opt_ena
)
399 panic("Disable %s, hardware NOT present\n", opt_name
);
402 void chk_opt_weak(char *opt_name
, bool hw_exists
, bool opt_ena
)
404 if (!hw_exists
&& opt_ena
)
405 panic("Disable %s, hardware NOT present\n", opt_name
);
408 static void arc_chk_core_config(void)
410 struct cpuinfo_arc
*cpu
= &cpuinfo_arc700
[smp_processor_id()];
413 if (!cpu
->extn
.timer0
)
414 panic("Timer0 is not present!\n");
416 if (!cpu
->extn
.timer1
)
417 panic("Timer1 is not present!\n");
419 #ifdef CONFIG_ARC_HAS_DCCM
421 * DCCM can be arbit placed in hardware.
422 * Make sure it's placement/sz matches what Linux is built with
424 if ((unsigned int)__arc_dccm_base
!= cpu
->dccm
.base_addr
)
425 panic("Linux built with incorrect DCCM Base address\n");
427 if (CONFIG_ARC_DCCM_SZ
!= cpu
->dccm
.sz
)
428 panic("Linux built with incorrect DCCM Size\n");
431 #ifdef CONFIG_ARC_HAS_ICCM
432 if (CONFIG_ARC_ICCM_SZ
!= cpu
->iccm
.sz
)
433 panic("Linux built with incorrect ICCM Size\n");
437 * FP hardware/software config sanity
438 * -If hardware present, kernel needs to save/restore FPU state
439 * -If not, it will crash trying to save/restore the non-existant regs
442 if (is_isa_arcompact()) {
443 /* only DPDP checked since SP has no arch visible regs */
444 present
= cpu
->extn
.fpu_dp
;
445 CHK_OPT_STRICT(CONFIG_ARC_FPU_SAVE_RESTORE
, present
);
447 /* Accumulator Low:High pair (r58:59) present if DSP MPY or FPU */
448 present
= cpu
->extn_mpy
.dsp
| cpu
->extn
.fpu_sp
| cpu
->extn
.fpu_dp
;
449 CHK_OPT_STRICT(CONFIG_ARC_HAS_ACCL_REGS
, present
);
456 * Initialize and setup the processor core
457 * This is called by all the CPUs thus should not do special case stuff
458 * such as only for boot CPU etc
461 void setup_processor(void)
464 int cpu_id
= smp_processor_id();
466 read_arc_build_cfg_regs();
469 pr_info("%s", arc_cpu_mumbojumbo(cpu_id
, str
, sizeof(str
)));
474 pr_info("%s", arc_extn_mumbojumbo(cpu_id
, str
, sizeof(str
)));
475 pr_info("%s", arc_platform_smp_cpuinfo());
477 arc_chk_core_config();
480 static inline bool uboot_arg_invalid(unsigned long addr
)
483 * Check that it is a untranslated address (although MMU is not enabled
484 * yet, it being a high address ensures this is not by fluke)
486 if (addr
< PAGE_OFFSET
)
489 /* Check that address doesn't clobber resident kernel image */
490 return addr
>= (unsigned long)_stext
&& addr
<= (unsigned long)_end
;
493 #define IGNORE_ARGS "Ignore U-boot args: "
495 /* uboot_tag values for U-boot - kernel ABI revision 0; see head.S */
496 #define UBOOT_TAG_NONE 0
497 #define UBOOT_TAG_CMDLINE 1
498 #define UBOOT_TAG_DTB 2
499 /* We always pass 0 as magic from U-boot */
500 #define UBOOT_MAGIC_VALUE 0
502 void __init
handle_uboot_args(void)
504 bool use_embedded_dtb
= true;
505 bool append_cmdline
= false;
507 /* check that we know this tag */
508 if (uboot_tag
!= UBOOT_TAG_NONE
&&
509 uboot_tag
!= UBOOT_TAG_CMDLINE
&&
510 uboot_tag
!= UBOOT_TAG_DTB
) {
511 pr_warn(IGNORE_ARGS
"invalid uboot tag: '%08x'\n", uboot_tag
);
512 goto ignore_uboot_args
;
515 if (uboot_magic
!= UBOOT_MAGIC_VALUE
) {
516 pr_warn(IGNORE_ARGS
"non zero uboot magic\n");
517 goto ignore_uboot_args
;
520 if (uboot_tag
!= UBOOT_TAG_NONE
&&
521 uboot_arg_invalid((unsigned long)uboot_arg
)) {
522 pr_warn(IGNORE_ARGS
"invalid uboot arg: '%px'\n", uboot_arg
);
523 goto ignore_uboot_args
;
526 /* see if U-boot passed an external Device Tree blob */
527 if (uboot_tag
== UBOOT_TAG_DTB
) {
528 machine_desc
= setup_machine_fdt((void *)uboot_arg
);
530 /* external Device Tree blob is invalid - use embedded one */
531 use_embedded_dtb
= !machine_desc
;
534 if (uboot_tag
== UBOOT_TAG_CMDLINE
)
535 append_cmdline
= true;
539 if (use_embedded_dtb
) {
540 machine_desc
= setup_machine_fdt(__dtb_start
);
542 panic("Embedded DT invalid\n");
546 * NOTE: @boot_command_line is populated by setup_machine_fdt() so this
547 * append processing can only happen after.
549 if (append_cmdline
) {
550 /* Ensure a whitespace between the 2 cmdlines */
551 strlcat(boot_command_line
, " ", COMMAND_LINE_SIZE
);
552 strlcat(boot_command_line
, uboot_arg
, COMMAND_LINE_SIZE
);
556 void __init
setup_arch(char **cmdline_p
)
560 /* Save unparsed command line copy for /proc/cmdline */
561 *cmdline_p
= boot_command_line
;
563 /* To force early parsing of things like mem=xxx */
566 /* Platform/board specific: e.g. early console registration */
567 if (machine_desc
->init_early
)
568 machine_desc
->init_early();
575 /* copy flat DT out of .init and then unflatten it */
576 unflatten_and_copy_device_tree();
578 /* Can be issue if someone passes cmd line arg "ro"
579 * But that is unlikely so keeping it as it is
581 root_mountflags
&= ~MS_RDONLY
;
587 * Called from start_kernel() - boot CPU only
589 void __init
time_init(void)
595 static int __init
customize_machine(void)
597 if (machine_desc
->init_machine
)
598 machine_desc
->init_machine();
602 arch_initcall(customize_machine
);
604 static int __init
init_late_machine(void)
606 if (machine_desc
->init_late
)
607 machine_desc
->init_late();
611 late_initcall(init_late_machine
);
613 * Get CPU information for use by the procfs.
616 #define cpu_to_ptr(c) ((void *)(0xFFFF0000 | (unsigned int)(c)))
617 #define ptr_to_cpu(p) (~0xFFFF0000UL & (unsigned int)(p))
619 static int show_cpuinfo(struct seq_file
*m
, void *v
)
622 int cpu_id
= ptr_to_cpu(v
);
623 struct device
*cpu_dev
= get_cpu_device(cpu_id
);
625 unsigned long freq
= 0;
627 if (!cpu_online(cpu_id
)) {
628 seq_printf(m
, "processor [%d]\t: Offline\n", cpu_id
);
632 str
= (char *)__get_free_page(GFP_KERNEL
);
636 seq_printf(m
, arc_cpu_mumbojumbo(cpu_id
, str
, PAGE_SIZE
));
638 cpu_clk
= clk_get(cpu_dev
, NULL
);
639 if (IS_ERR(cpu_clk
)) {
640 seq_printf(m
, "CPU speed \t: Cannot get clock for processor [%d]\n",
643 freq
= clk_get_rate(cpu_clk
);
646 seq_printf(m
, "CPU speed\t: %lu.%02lu Mhz\n",
647 freq
/ 1000000, (freq
/ 10000) % 100);
649 seq_printf(m
, "Bogo MIPS\t: %lu.%02lu\n",
650 loops_per_jiffy
/ (500000 / HZ
),
651 (loops_per_jiffy
/ (5000 / HZ
)) % 100);
653 seq_printf(m
, arc_mmu_mumbojumbo(cpu_id
, str
, PAGE_SIZE
));
654 seq_printf(m
, arc_cache_mumbojumbo(cpu_id
, str
, PAGE_SIZE
));
655 seq_printf(m
, arc_extn_mumbojumbo(cpu_id
, str
, PAGE_SIZE
));
656 seq_printf(m
, arc_platform_smp_cpuinfo());
658 free_page((unsigned long)str
);
665 static void *c_start(struct seq_file
*m
, loff_t
*pos
)
668 * Callback returns cpu-id to iterator for show routine, NULL to stop.
669 * However since NULL is also a valid cpu-id (0), we use a round-about
670 * way to pass it w/o having to kmalloc/free a 2 byte string.
671 * Encode cpu-id as 0xFFcccc, which is decoded by show routine.
673 return *pos
< nr_cpu_ids
? cpu_to_ptr(*pos
) : NULL
;
676 static void *c_next(struct seq_file
*m
, void *v
, loff_t
*pos
)
679 return c_start(m
, pos
);
682 static void c_stop(struct seq_file
*m
, void *v
)
686 const struct seq_operations cpuinfo_op
= {
693 static DEFINE_PER_CPU(struct cpu
, cpu_topology
);
695 static int __init
topology_init(void)
699 for_each_present_cpu(cpu
)
700 register_cpu(&per_cpu(cpu_topology
, cpu
), cpu
);
705 subsys_initcall(topology_init
);