blob: 8031201a49c2ce2db0b7a8a65cd1a7365d4f21f2 [file] [log] [blame]
Bin Mengf17cea62015-04-24 18:10:04 +08001/*
2 * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
Simon Glass07e922a2015-04-28 20:25:10 -06008#include <asm/sfi.h>
Bin Mengf17cea62015-04-24 18:10:04 +08009#include <asm/tables.h>
10
11u8 table_compute_checksum(void *v, int len)
12{
13 u8 *bytes = v;
14 u8 checksum = 0;
15 int i;
16
17 for (i = 0; i < len; i++)
18 checksum -= bytes[i];
19
20 return checksum;
21}
22
23void write_tables(void)
24{
25 u32 __maybe_unused rom_table_end = ROM_TABLE_ADDR;
26
Bin Meng7b730902015-04-28 18:37:03 +080027#ifdef CONFIG_GENERATE_PIRQ_TABLE
Bin Mengf17cea62015-04-24 18:10:04 +080028 rom_table_end = write_pirq_routing_table(rom_table_end);
29 rom_table_end = ALIGN(rom_table_end, 1024);
30#endif
Simon Glass07e922a2015-04-28 20:25:10 -060031#ifdef CONFIG_GENERATE_SFI_TABLE
32 rom_table_end = write_sfi_table(rom_table_end);
33 rom_table_end = ALIGN(rom_table_end, 1024);
34#endif
Bin Mengf17cea62015-04-24 18:10:04 +080035}