2 * Copyright (C) 2016 Intel Corporation.
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
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.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23 #include <libpayload.h>
26 #include "base/init_funcs.h"
27 #include "drivers/gpio/sysinfo.h"
28 #include "drivers/flash/memmapped.h"
29 #include "drivers/tpm/tpm.h"
30 #include "drivers/bus/usb/usb.h"
31 #include "drivers/power/pch.h"
32 #include "drivers/tpm/lpc.h"
33 #include "drivers/storage/sdhci.h"
35 #define EMMC_SD_CLOCK_MIN 400000
36 #define EMMC_CLOCK_MAX 200000000
38 /* Flash memory map size includes the 4K descriptor which is not accessible */
39 #define FLASH_MEM_MAP_SIZE 0x6FF000
40 #define FLASH_MEM_MAP_BASE ((uintptr_t)(0x100000000ULL - FLASH_MEM_MAP_SIZE))
43 static int board_setup(void)
45 sysinfo_install_flags(NULL);
47 /* W25Q128FV SPI Flash */
48 flash_set_ops(&new_mem_mapped_flash(FLASH_MEM_MAP_BASE, FLASH_MEM_MAP_SIZE)->ops);
51 tpm_set_ops(&new_lpc_tpm((void *)(uintptr_t)0xfed40000)->ops);
54 emmc = new_pci_sdhci_host(PCI_DEV(0, 0x1c, 0), 0,
55 EMMC_SD_CLOCK_MIN, EMMC_CLOCK_MAX);
56 list_insert_after(&emmc->mmc_ctrlr.ctrlr.list_node,
57 &fixed_block_dev_controllers);
60 power_set_ops(&apollolake_power_ops);
65 INIT_FUNC(board_setup);