acpi.c (29583dfcd2dd72c766422bd05c16f06c6b1fb356) acpi.c (538eafc6deae12fbac5f277b89aa139b812bca49)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * acpi.c - Architecture-Specific Low-Level ACPI Boot Support
4 *
5 * Author: Jianmin Lv <lvjianmin@loongson.cn>
6 * Huacai Chen <chenhuacai@loongson.cn>
7 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
8 */

--- 42 unchanged lines hidden (view full) ---

51void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
52{
53 if (!memblock_is_memory(phys))
54 return ioremap(phys, size);
55 else
56 return ioremap_cache(phys, size);
57}
58
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * acpi.c - Architecture-Specific Low-Level ACPI Boot Support
4 *
5 * Author: Jianmin Lv <lvjianmin@loongson.cn>
6 * Huacai Chen <chenhuacai@loongson.cn>
7 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
8 */

--- 42 unchanged lines hidden (view full) ---

51void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
52{
53 if (!memblock_is_memory(phys))
54 return ioremap(phys, size);
55 else
56 return ioremap_cache(phys, size);
57}
58
59void __init acpi_boot_table_init(void)
60{
61 /*
62 * If acpi_disabled, bail out
63 */
64 if (acpi_disabled)
65 return;
66
67 /*
68 * Initialize the ACPI boot-time table parser.
69 */
70 if (acpi_table_init()) {
71 disable_acpi();
72 return;
73 }
74}
75
76#ifdef CONFIG_SMP
77static int set_processor_mask(u32 id, u32 flags)
78{
79
80 int cpu, cpuid = id;
81
82 if (num_processors >= nr_cpu_ids) {
83 pr_warn(PREFIX "nr_cpus/possible_cpus limit of %i reached."

--- 67 unchanged lines hidden (view full) ---

151 acpi_parse_processor, MAX_CORE_PIC);
152
153 acpi_table_parse_madt(ACPI_MADT_TYPE_EIO_PIC,
154 acpi_parse_eio_master, MAX_IO_PICS);
155
156 loongson_sysconf.nr_cpus = num_processors;
157}
158
59#ifdef CONFIG_SMP
60static int set_processor_mask(u32 id, u32 flags)
61{
62
63 int cpu, cpuid = id;
64
65 if (num_processors >= nr_cpu_ids) {
66 pr_warn(PREFIX "nr_cpus/possible_cpus limit of %i reached."

--- 67 unchanged lines hidden (view full) ---

134 acpi_parse_processor, MAX_CORE_PIC);
135
136 acpi_table_parse_madt(ACPI_MADT_TYPE_EIO_PIC,
137 acpi_parse_eio_master, MAX_IO_PICS);
138
139 loongson_sysconf.nr_cpus = num_processors;
140}
141
159int __init acpi_boot_init(void)
142void __init acpi_boot_table_init(void)
160{
161 /*
162 * If acpi_disabled, bail out
163 */
164 if (acpi_disabled)
143{
144 /*
145 * If acpi_disabled, bail out
146 */
147 if (acpi_disabled)
165 return -1;
148 return;
166
149
150 /*
151 * Initialize the ACPI boot-time table parser.
152 */
153 if (acpi_table_init()) {
154 disable_acpi();
155 return;
156 }
157
167 loongson_sysconf.boot_cpu_id = read_csr_cpuid();
168
169 /*
170 * Process the Multiple APIC Description Table (MADT), if present
171 */
172 acpi_process_madt();
173
174 /* Do not enable ACPI SPCR console by default */
175 acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
158 loongson_sysconf.boot_cpu_id = read_csr_cpuid();
159
160 /*
161 * Process the Multiple APIC Description Table (MADT), if present
162 */
163 acpi_process_madt();
164
165 /* Do not enable ACPI SPCR console by default */
166 acpi_parse_spcr(earlycon_acpi_spcr_enable, false);
176
177 return 0;
178}
179
180#ifdef CONFIG_ACPI_NUMA
181
182static __init int setup_node(int pxm)
183{
184 return acpi_map_pxm_to_node(pxm);
185}

--- 125 unchanged lines hidden ---
167}
168
169#ifdef CONFIG_ACPI_NUMA
170
171static __init int setup_node(int pxm)
172{
173 return acpi_map_pxm_to_node(pxm);
174}

--- 125 unchanged lines hidden ---