blob: 9843365979e848fa53cc4c5baf24488e774d3e37 [file] [log] [blame]
/*
* Copyright 2016 Google Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* 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; either version 2 of
* the License, or (at your option) any later version.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include <stdint.h>
#include "base/init_funcs.h"
#include "base/list.h"
#include "boot/magenta.h"
#include "drivers/blockdev/uefi.h"
#include "drivers/board/board.h"
#include "drivers/board/board_helpers.h"
#include "drivers/display/framebuffer.h"
#include "drivers/framebuffer/uefi.h"
#include "drivers/keyboard/keyboard.h"
#include "drivers/layout/coreboot.h"
#include "drivers/power/uefi.h"
#include "drivers/storage/fwdb.h"
// Force these to acceptable values for now.
PUB_STAT(flag_write_protect, 1)
PUB_STAT(flag_recovery, 0)
PUB_STAT(flag_developer_mode, 1)
PUB_STAT(flag_lid_open, 1)
PUB_STAT(flag_power, 0)
PUB_ARR(trusted_keyboards, (KeyboardOps *)NULL)
PUB_ARR(untrusted_keyboards, (KeyboardOps *)NULL)
PUB_DYN(_uefi_ro_storage, new_fwdb_ro_storage("uefi_ro_image"))
PUB_DYN(_uefi_rw_a_storage, new_fwdb_ro_storage("uefi_rw_a_image"))
PUB_DYN(_uefi_rw_b_storage, new_fwdb_ro_storage("uefi_rw_b_image"))
PUB_STAT(power, &uefi_power_ops)
PRIV_DYN(framebuffer, new_uefi_framebuffer())
PUB_DYN(display, &new_fb_display(get_framebuffer(), NULL)->ops)
FrameBufferOps *magenta_framebuffer(void)
{
return get_framebuffer();
}
static int board_setup(void)
{
UefiBlockDevCtrlr *fixed = new_uefi_blockdev_ctrlr(0);
UefiBlockDevCtrlr *removable = new_uefi_blockdev_ctrlr(1);
list_insert_after(&fixed->ctrlr.list_node,
&fixed_block_dev_controllers);
list_insert_after(&removable->ctrlr.list_node,
&removable_block_dev_controllers);
return 0;
}
INIT_FUNC(board_setup);