2013-09-27 01:22:09 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the coreboot project.
|
|
|
|
*
|
2015-05-15 20:15:34 +02:00
|
|
|
* Copyright 2015 Google Inc.
|
2013-09-27 01:22:09 +02:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
|
2015-05-15 20:15:34 +02:00
|
|
|
#include <boot_device.h>
|
2015-05-16 06:39:23 +02:00
|
|
|
#include <endian.h>
|
|
|
|
#include <stdlib.h>
|
2013-09-27 01:22:09 +02:00
|
|
|
|
2015-05-15 20:15:34 +02:00
|
|
|
/* The ROM is memory mapped just below 4GiB. Form a pointer for the base. */
|
2015-08-04 20:14:17 +02:00
|
|
|
#define rom_base ((void *)(uintptr_t)(0x100000000ULL-CONFIG_ROM_SIZE))
|
2013-09-27 01:22:09 +02:00
|
|
|
|
2015-05-15 20:15:34 +02:00
|
|
|
static const struct mem_region_device boot_dev =
|
2016-06-22 21:09:08 +02:00
|
|
|
MEM_REGION_DEV_RO_INIT(rom_base, CONFIG_ROM_SIZE);
|
2015-05-15 20:15:34 +02:00
|
|
|
|
|
|
|
const struct region_device *boot_device_ro(void)
|
2013-09-27 01:22:09 +02:00
|
|
|
{
|
2015-05-15 20:15:34 +02:00
|
|
|
return &boot_dev.rdev;
|
2013-09-27 01:22:09 +02:00
|
|
|
}
|