15e2400e8SBin Meng /* 25e2400e8SBin Meng * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com> 35e2400e8SBin Meng * 45e2400e8SBin Meng * SPDX-License-Identifier: GPL-2.0+ 55e2400e8SBin Meng */ 65e2400e8SBin Meng 75e2400e8SBin Meng #include <common.h> 85e2400e8SBin Meng #include <asm/tables.h> 95e2400e8SBin Meng 105e2400e8SBin Meng u8 table_compute_checksum(void *v, int len) 115e2400e8SBin Meng { 125e2400e8SBin Meng u8 *bytes = v; 135e2400e8SBin Meng u8 checksum = 0; 145e2400e8SBin Meng int i; 155e2400e8SBin Meng 165e2400e8SBin Meng for (i = 0; i < len; i++) 175e2400e8SBin Meng checksum -= bytes[i]; 185e2400e8SBin Meng 195e2400e8SBin Meng return checksum; 205e2400e8SBin Meng } 215e2400e8SBin Meng 225e2400e8SBin Meng void write_tables(void) 235e2400e8SBin Meng { 245e2400e8SBin Meng u32 __maybe_unused rom_table_end = ROM_TABLE_ADDR; 255e2400e8SBin Meng 26*cc4c8acaSBin Meng #ifdef CONFIG_GENERATE_PIRQ_TABLE 275e2400e8SBin Meng rom_table_end = write_pirq_routing_table(rom_table_end); 285e2400e8SBin Meng rom_table_end = ALIGN(rom_table_end, 1024); 295e2400e8SBin Meng #endif 305e2400e8SBin Meng } 31