Vadim Bendebury | ab0f710 | 2014-08-21 14:19:31 -0700 | [diff] [blame] | 1 | /* |
| 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 Bendebury | ab0f710 | 2014-08-21 14:19:31 -0700 | [diff] [blame] | 15 | */ |
Ionela Voinescu | b9d9615 | 2014-12-12 13:53:22 +0000 | [diff] [blame] | 16 | #include <symbols.h> |
Vadim Bendebury | ab0f710 | 2014-08-21 14:19:31 -0700 | [diff] [blame] | 17 | #include <console/console.h> |
| 18 | #include <device/device.h> |
Ionela Voinescu | b9d9615 | 2014-12-12 13:53:22 +0000 | [diff] [blame] | 19 | #include <boot/coreboot_tables.h> |
Vadim Bendebury | ab0f710 | 2014-08-21 14:19:31 -0700 | [diff] [blame] | 20 | |
Vadim Bendebury | 23dddd5 | 2015-03-28 22:14:53 -0700 | [diff] [blame] | 21 | #include <vendorcode/google/chromeos/chromeos.h> |
| 22 | |
Elyes HAOUAS | d129d43 | 2018-05-04 20:23:33 +0200 | [diff] [blame] | 23 | static void mainboard_init(struct device *dev) |
Vadim Bendebury | 23dddd5 | 2015-03-28 22:14:53 -0700 | [diff] [blame] | 24 | { |
| 25 | #if IS_ENABLED(CONFIG_CHROMEOS) |
| 26 | /* Copy WIFI calibration data into CBMEM. */ |
| 27 | cbmem_add_vpd_calibration_data(); |
| 28 | #endif |
| 29 | } |
| 30 | |
Elyes HAOUAS | d129d43 | 2018-05-04 20:23:33 +0200 | [diff] [blame] | 31 | static void mainboard_enable(struct device *dev) |
Vadim Bendebury | ab0f710 | 2014-08-21 14:19:31 -0700 | [diff] [blame] | 32 | { |
Vadim Bendebury | 2d510d0 | 2014-09-29 12:43:40 -0700 | [diff] [blame] | 33 | printk(BIOS_INFO, "Enable Pistachio device...\n"); |
Vadim Bendebury | 23dddd5 | 2015-03-28 22:14:53 -0700 | [diff] [blame] | 34 | dev->ops->init = &mainboard_init; |
Vadim Bendebury | ab0f710 | 2014-08-21 14:19:31 -0700 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | struct chip_operations mainboard_ops = { |
| 38 | .enable_dev = mainboard_enable, |
| 39 | }; |
| 40 | |
Ionela Voinescu | b9d9615 | 2014-12-12 13:53:22 +0000 | [diff] [blame] | 41 | void 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 Werner | 7e0dea6 | 2019-02-20 18:39:22 -0800 | [diff] [blame] | 49 | dma->range_size = REGION_SIZE(dma_coherent); |
Vadim Bendebury | 23dddd5 | 2015-03-28 22:14:53 -0700 | [diff] [blame] | 50 | |
| 51 | #if IS_ENABLED(CONFIG_CHROMEOS) |
Jonathan Neuschäfer | 482d16f | 2017-11-20 02:09:19 +0100 | [diff] [blame] | 52 | /* Retrieve the switch interface MAC addresses. */ |
Vadim Bendebury | 23dddd5 | 2015-03-28 22:14:53 -0700 | [diff] [blame] | 53 | lb_table_add_macs_from_vpd(header); |
| 54 | #endif |
Ionela Voinescu | b9d9615 | 2014-12-12 13:53:22 +0000 | [diff] [blame] | 55 | } |