2 * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <asm/mpspec.h>
10 #include <asm/smbios.h>
11 #include <asm/tables.h>
12 #include <asm/acpi_table.h>
14 u8 table_compute_checksum(void *v, int len)
20 for (i = 0; i < len; i++)
26 void table_fill_string(char *dest, const char *src, size_t n, char pad)
31 strncpy(dest, src, n);
33 /* Fill the remaining bytes with pad */
35 start = len < n ? len : n;
36 for (i = start; i < n; i++)
40 void write_tables(void)
42 u32 __maybe_unused rom_table_end = ROM_TABLE_ADDR;
44 #ifdef CONFIG_GENERATE_PIRQ_TABLE
45 rom_table_end = write_pirq_routing_table(rom_table_end);
46 rom_table_end = ALIGN(rom_table_end, 1024);
48 #ifdef CONFIG_GENERATE_SFI_TABLE
49 rom_table_end = write_sfi_table(rom_table_end);
50 rom_table_end = ALIGN(rom_table_end, 1024);
52 #ifdef CONFIG_GENERATE_MP_TABLE
53 rom_table_end = write_mp_table(rom_table_end);
54 rom_table_end = ALIGN(rom_table_end, 1024);
56 #ifdef CONFIG_GENERATE_ACPI_TABLE
57 rom_table_end = write_acpi_tables(rom_table_end);
58 rom_table_end = ALIGN(rom_table_end, 1024);
60 #ifdef CONFIG_GENERATE_SMBIOS_TABLE
61 rom_table_end = write_smbios_table(rom_table_end);
62 rom_table_end = ALIGN(rom_table_end, 1024);