Ronald G. Minnich | 9831244 | 2016-02-12 22:37:48 +0000 | [diff] [blame] | 1 | /* |
| 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. |
| 16 | */ |
| 17 | |
| 18 | #include <console/console.h> |
| 19 | #include <cpu/cpu.h> |
Aaron Durbin | d4afa93 | 2016-04-19 17:25:59 -0500 | [diff] [blame] | 20 | #include <bootmem.h> |
Ronald G. Minnich | 9831244 | 2016-02-12 22:37:48 +0000 | [diff] [blame] | 21 | #include <boot/tables.h> |
| 22 | #include <boot/coreboot_tables.h> |
| 23 | #include <string.h> |
| 24 | #include <cbmem.h> |
| 25 | #include <lib.h> |
| 26 | |
Aaron Durbin | 5481c96 | 2016-04-19 20:37:51 -0500 | [diff] [blame^] | 27 | void arch_write_tables(uintptr_t coreboot_table) |
| 28 | { |
| 29 | } |
| 30 | |
Aaron Durbin | d4afa93 | 2016-04-19 17:25:59 -0500 | [diff] [blame] | 31 | void bootmem_arch_add_ranges(void) |
| 32 | { |
| 33 | } |
| 34 | |
Aaron Durbin | a0546da | 2016-04-19 15:17:08 -0500 | [diff] [blame] | 35 | #define MAX_COREBOOT_TABLE_SIZE CONFIG_COREBOOT_TABLE_SIZE |
Ronald G. Minnich | 9831244 | 2016-02-12 22:37:48 +0000 | [diff] [blame] | 36 | |
Aaron Durbin | f7dca0a | 2016-04-19 13:41:16 -0500 | [diff] [blame] | 37 | void write_tables(void) |
Ronald G. Minnich | 9831244 | 2016-02-12 22:37:48 +0000 | [diff] [blame] | 38 | { |
| 39 | unsigned long table_pointer, new_table_pointer; |
| 40 | |
| 41 | post_code(0x9d); |
| 42 | |
| 43 | table_pointer = (unsigned long)cbmem_add(CBMEM_ID_CBTABLE, |
| 44 | MAX_COREBOOT_TABLE_SIZE); |
| 45 | if (!table_pointer) { |
| 46 | printk(BIOS_ERR, "Could not add CBMEM for coreboot table.\n"); |
Aaron Durbin | f7dca0a | 2016-04-19 13:41:16 -0500 | [diff] [blame] | 47 | return; |
Ronald G. Minnich | 9831244 | 2016-02-12 22:37:48 +0000 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | new_table_pointer = write_coreboot_table(0UL, 0UL, |
| 51 | table_pointer, table_pointer); |
| 52 | |
| 53 | if (new_table_pointer > (table_pointer + MAX_COREBOOT_TABLE_SIZE)) { |
| 54 | printk(BIOS_ERR, "coreboot table didn't fit (%lx/%x bytes)\n", |
| 55 | new_table_pointer - table_pointer, |
| 56 | MAX_COREBOOT_TABLE_SIZE); |
| 57 | } |
| 58 | |
| 59 | printk(BIOS_DEBUG, "coreboot table: %ld bytes.\n", |
| 60 | new_table_pointer - table_pointer); |
| 61 | |
| 62 | post_code(0x9e); |
Ronald G. Minnich | 9831244 | 2016-02-12 22:37:48 +0000 | [diff] [blame] | 63 | } |
| 64 | |
| 65 | void lb_arch_add_records(struct lb_header *header) |
| 66 | { |
| 67 | } |