blob: a800173ffddd270448b3a63a17a6190ac619033b [file] [log] [blame]
Aaron Durbindf3a1092013-03-13 12:41:44 -05001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2013 Google, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied wacbmem_entryanty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <console/console.h>
20#include <cbmem.h>
21#include <stdlib.h>
22
Kyösti Mälkkide53bdf2014-12-31 19:13:12 +020023#ifndef __PRE_RAM__
24
Vadim Bendebury8b143c52014-05-14 10:12:55 -070025static const struct cbmem_id_to_name cbmem_ids[] = { CBMEM_ID_TO_NAME_TABLE };
Aaron Durbindf3a1092013-03-13 12:41:44 -050026
27void cbmem_print_entry(int n, u32 id, u64 base, u64 size)
28{
29 int i;
30 const char *name;
31
32 name = NULL;
33 for (i = 0; i < ARRAY_SIZE(cbmem_ids); i++) {
34 if (cbmem_ids[i].id == id) {
35 name = cbmem_ids[i].name;
36 break;
37 }
38 }
39
40 if (name == NULL)
41 printk(BIOS_DEBUG, "%08x ", id);
42 else
43 printk(BIOS_DEBUG, "%s", name);
44 printk(BIOS_DEBUG, "%2d. ", n);
45 printk(BIOS_DEBUG, "%08llx ", base);
46 printk(BIOS_DEBUG, "%08llx\n", size);
47}
Kyösti Mälkkide53bdf2014-12-31 19:13:12 +020048
49#endif /* !__PRE_RAM__ */