| 1 |
|
| 2 |
|
| 3 |
#include <boot/coreboot_tables.h> |
| 4 |
#include <device/device.h> |
| 5 |
#include <gpio.h> |
| 6 |
#include <soc/clock.h> |
| 7 |
#include <soc/soc_services.h> |
| 8 |
#include <soc/usb.h> |
| 9 |
#include <soc/blsp.h> |
| 10 |
#include <symbols.h> |
| 11 |
|
| 12 |
#include <vendorcode/google/chromeos/chromeos.h> |
| 13 |
#include "mmu.h" |
| 14 |
|
| 15 |
#define USB_ENABLE_GPIO 51 |
| 16 |
|
| 17 |
static void setup_usb(void) |
| 18 |
{ |
| 19 |
usb_clock_config(); |
| 20 |
|
| 21 |
setup_usb_host1(); |
| 22 |
} |
| 23 |
|
| 24 |
static void mainboard_init(struct device *dev) |
| 25 |
{ |
| 26 |
|
| 27 |
dcache_mmu_disable(); |
| 28 |
start_tzbsp(); |
| 29 |
|
| 30 |
setup_mmu(DRAM_INITIALIZED); |
| 31 |
setup_usb(); |
| 32 |
|
| 33 |
|
| 34 |
if (CONFIG(CHROMEOS)) |
| 35 |
cbmem_add_vpd_calibration_data(); |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
} |
| 45 |
|
| 46 |
static void mainboard_enable(struct device *dev) |
| 47 |
{ |
| 48 |
dev->ops->init = &mainboard_init; |
| 49 |
} |
| 50 |
|
| 51 |
struct chip_operations mainboard_ops = { |
| 52 |
.enable_dev = mainboard_enable, |
| 53 |
}; |
| 54 |
|
| 55 |
void lb_board(struct lb_header *header) |
| 56 |
{ |
| 57 |
struct lb_range *dma; |
| 58 |
|
| 59 |
dma = (struct lb_range *)lb_new_record(header); |
| 60 |
dma->tag = LB_TAG_DMA; |
| 61 |
dma->size = sizeof(*dma); |
| 62 |
dma->range_start = (uintptr_t)_dma_coherent; |
| 63 |
dma->range_size = REGION_SIZE(dma_coherent); |
| 64 |
|
| 65 |
if (CONFIG(CHROMEOS)) { |
| 66 |
|
| 67 |
lb_table_add_macs_from_vpd(header); |
| 68 |
} |
| 69 |
} |