blob: eb08e6e84297e7046716be9675e02e1ccd70d891 [file] [log] [blame]
Ronald G. Minniche0e784a2014-11-26 19:25:47 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2003 Eric Biederman
5 * Copyright (C) 2005 Steve Magnani
6 * Copyright (C) 2008-2009 coresystems GmbH
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
Ronald G. Minniche0e784a2014-11-26 19:25:47 +000016 */
17
18#include <console/console.h>
19#include <cpu/cpu.h>
20#include <boot/tables.h>
21#include <boot/coreboot_tables.h>
22#include <string.h>
23#include <cbmem.h>
24#include <lib.h>
25
Aaron Durbina0546da2016-04-19 15:17:08 -050026#define MAX_COREBOOT_TABLE_SIZE CONFIG_COREBOOT_TABLE_SIZE
Ronald G. Minniche0e784a2014-11-26 19:25:47 +000027
Aaron Durbin0eb1f1c2016-04-19 13:42:27 -050028void write_tables(void)
Ronald G. Minniche0e784a2014-11-26 19:25:47 +000029{
30 unsigned long table_pointer, new_table_pointer;
31
Ronald G. Minniche0e784a2014-11-26 19:25:47 +000032 post_code(0x9d);
33
34 table_pointer = (unsigned long)cbmem_add(CBMEM_ID_CBTABLE,
35 MAX_COREBOOT_TABLE_SIZE);
36 if (!table_pointer) {
37 printk(BIOS_ERR, "Could not add CBMEM for coreboot table.\n");
Aaron Durbin0eb1f1c2016-04-19 13:42:27 -050038 return;
Ronald G. Minniche0e784a2014-11-26 19:25:47 +000039 }
40
41 new_table_pointer = write_coreboot_table(0UL, 0UL,
42 table_pointer, table_pointer);
43
44 if (new_table_pointer > (table_pointer + MAX_COREBOOT_TABLE_SIZE)) {
45 printk(BIOS_ERR, "coreboot table didn't fit (%lx/%x bytes)\n",
46 new_table_pointer - table_pointer, MAX_COREBOOT_TABLE_SIZE);
47 }
48
49 printk(BIOS_DEBUG, "coreboot table: %ld bytes.\n",
50 new_table_pointer - table_pointer);
51
52 post_code(0x9e);
Ronald G. Minniche0e784a2014-11-26 19:25:47 +000053}
Aaron Durbinf6ada1c2016-02-10 10:52:47 -060054
55void lb_arch_add_records(struct lb_header *header)
56{
57}