blob: 27fdd90af517737f06bafa997a1f3a64b142fc8d [file] [log] [blame]
Vadim Bendeburyab0f7102014-08-21 14:19:31 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2014 Imagination Technologies
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
9 * the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Vadim Bendeburyab0f7102014-08-21 14:19:31 -070015 */
Ionela Voinescub9d96152014-12-12 13:53:22 +000016#include <arch/io.h>
17#include <symbols.h>
Vadim Bendeburyab0f7102014-08-21 14:19:31 -070018#include <console/console.h>
19#include <device/device.h>
Ionela Voinescub9d96152014-12-12 13:53:22 +000020#include <boot/coreboot_tables.h>
Vadim Bendeburyab0f7102014-08-21 14:19:31 -070021
Vadim Bendebury23dddd52015-03-28 22:14:53 -070022#include <vendorcode/google/chromeos/chromeos.h>
23
24static void mainboard_init(device_t dev)
25{
26#if IS_ENABLED(CONFIG_CHROMEOS)
27 /* Copy WIFI calibration data into CBMEM. */
28 cbmem_add_vpd_calibration_data();
29#endif
30}
31
Vadim Bendeburyab0f7102014-08-21 14:19:31 -070032static void mainboard_enable(device_t dev)
33{
Vadim Bendebury2d510d02014-09-29 12:43:40 -070034 printk(BIOS_INFO, "Enable Pistachio device...\n");
Vadim Bendebury23dddd52015-03-28 22:14:53 -070035 dev->ops->init = &mainboard_init;
Vadim Bendeburyab0f7102014-08-21 14:19:31 -070036}
37
38struct chip_operations mainboard_ops = {
39 .enable_dev = mainboard_enable,
40};
41
Ionela Voinescub9d96152014-12-12 13:53:22 +000042void lb_board(struct lb_header *header)
43{
44 struct lb_range *dma;
45
46 dma = (struct lb_range *)lb_new_record(header);
47 dma->tag = LB_TAB_DMA;
48 dma->size = sizeof(*dma);
49 dma->range_start = (uintptr_t)_dma_coherent;
50 dma->range_size = _dma_coherent_size;
Vadim Bendebury23dddd52015-03-28 22:14:53 -070051
52#if IS_ENABLED(CONFIG_CHROMEOS)
Jonathan Neuschäfer482d16f2017-11-20 02:09:19 +010053 /* Retrieve the switch interface MAC addresses. */
Vadim Bendebury23dddd52015-03-28 22:14:53 -070054 lb_table_add_macs_from_vpd(header);
55#endif
Ionela Voinescub9d96152014-12-12 13:53:22 +000056}