tree: drop last paragraph of GPL copyright header
[coreboot.git] / src / arch / mips / tables.c
blobe2e137c1bc6de413b7958ace9e14273bc5791037
1 /*
2 * This file is part of the coreboot project.
4 * Based on src/arch/armv7/tables.c:
5 * Copyright (C) 2003 Eric Biederman
6 * Copyright (C) 2005 Steve Magnani
7 * Copyright (C) 2008-2009 coresystems GmbH
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
19 #include <console/console.h>
20 #include <cpu/cpu.h>
21 #include <boot/tables.h>
22 #include <boot/coreboot_tables.h>
23 #include <string.h>
24 #include <cbmem.h>
25 #include <lib.h>
27 #define MAX_COREBOOT_TABLE_SIZE (8 * 1024)
29 void write_tables(void)
31 unsigned long table_pointer, new_table_pointer;
33 post_code(0x9d);
35 table_pointer = (unsigned long)cbmem_add(CBMEM_ID_CBTABLE,
36 MAX_COREBOOT_TABLE_SIZE);
37 if (!table_pointer) {
38 printk(BIOS_ERR, "Could not add CBMEM for coreboot table.\n");
39 return;
42 new_table_pointer = write_coreboot_table(0UL, 0UL, table_pointer,
43 table_pointer);
45 if (new_table_pointer > (table_pointer + MAX_COREBOOT_TABLE_SIZE))
46 printk(BIOS_ERR, "coreboot table didn't fit (%lx/%x bytes)\n",
47 new_table_pointer - table_pointer,
48 MAX_COREBOOT_TABLE_SIZE);
50 printk(BIOS_DEBUG, "coreboot table: %ld bytes.\n",
51 new_table_pointer - table_pointer);
53 post_code(0x9e);
55 /* Print CBMEM sections */
56 cbmem_list();