blob: 11584116541f4a222184a383a1575e3436ccf889 [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 <symbols.h>
Vadim Bendeburyab0f7102014-08-21 14:19:31 -070017#include <console/console.h>
18#include <device/device.h>
Ionela Voinescub9d96152014-12-12 13:53:22 +000019#include <boot/coreboot_tables.h>
Vadim Bendeburyab0f7102014-08-21 14:19:31 -070020
Vadim Bendebury23dddd52015-03-28 22:14:53 -070021#include <vendorcode/google/chromeos/chromeos.h>
22
Elyes HAOUASd129d432018-05-04 20:23:33 +020023static void mainboard_init(struct device *dev)
Vadim Bendebury23dddd52015-03-28 22:14:53 -070024{
25#if IS_ENABLED(CONFIG_CHROMEOS)
26 /* Copy WIFI calibration data into CBMEM. */
27 cbmem_add_vpd_calibration_data();
28#endif
29}
30
Elyes HAOUASd129d432018-05-04 20:23:33 +020031static void mainboard_enable(struct device *dev)
Vadim Bendeburyab0f7102014-08-21 14:19:31 -070032{
Vadim Bendebury2d510d02014-09-29 12:43:40 -070033 printk(BIOS_INFO, "Enable Pistachio device...\n");
Vadim Bendebury23dddd52015-03-28 22:14:53 -070034 dev->ops->init = &mainboard_init;
Vadim Bendeburyab0f7102014-08-21 14:19:31 -070035}
36
37struct chip_operations mainboard_ops = {
38 .enable_dev = mainboard_enable,
39};
40
Ionela Voinescub9d96152014-12-12 13:53:22 +000041void lb_board(struct lb_header *header)
42{
43 struct lb_range *dma;
44
45 dma = (struct lb_range *)lb_new_record(header);
46 dma->tag = LB_TAB_DMA;
47 dma->size = sizeof(*dma);
48 dma->range_start = (uintptr_t)_dma_coherent;
Julius Werner7e0dea62019-02-20 18:39:22 -080049 dma->range_size = REGION_SIZE(dma_coherent);
Vadim Bendebury23dddd52015-03-28 22:14:53 -070050
51#if IS_ENABLED(CONFIG_CHROMEOS)
Jonathan Neuschäfer482d16f2017-11-20 02:09:19 +010052 /* Retrieve the switch interface MAC addresses. */
Vadim Bendebury23dddd52015-03-28 22:14:53 -070053 lb_table_add_macs_from_vpd(header);
54#endif
Ionela Voinescub9d96152014-12-12 13:53:22 +000055}