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 <arch/io.h> |
| 17 | #include <symbols.h> |
Vadim Bendebury | ab0f710 | 2014-08-21 14:19:31 -0700 | [diff] [blame] | 18 | #include <console/console.h> |
| 19 | #include <device/device.h> |
Ionela Voinescu | b9d9615 | 2014-12-12 13:53:22 +0000 | [diff] [blame] | 20 | #include <boot/coreboot_tables.h> |
Vadim Bendebury | ab0f710 | 2014-08-21 14:19:31 -0700 | [diff] [blame] | 21 | |
Vadim Bendebury | 23dddd5 | 2015-03-28 22:14:53 -0700 | [diff] [blame] | 22 | #include <vendorcode/google/chromeos/chromeos.h> |
| 23 | |
| 24 | static 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 Bendebury | ab0f710 | 2014-08-21 14:19:31 -0700 | [diff] [blame] | 32 | static void mainboard_enable(device_t dev) |
| 33 | { |
Vadim Bendebury | 2d510d0 | 2014-09-29 12:43:40 -0700 | [diff] [blame] | 34 | printk(BIOS_INFO, "Enable Pistachio device...\n"); |
Vadim Bendebury | 23dddd5 | 2015-03-28 22:14:53 -0700 | [diff] [blame] | 35 | dev->ops->init = &mainboard_init; |
Vadim Bendebury | ab0f710 | 2014-08-21 14:19:31 -0700 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | struct chip_operations mainboard_ops = { |
| 39 | .enable_dev = mainboard_enable, |
| 40 | }; |
| 41 | |
Ionela Voinescu | b9d9615 | 2014-12-12 13:53:22 +0000 | [diff] [blame] | 42 | void 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 Bendebury | 23dddd5 | 2015-03-28 22:14:53 -0700 | [diff] [blame] | 51 | |
| 52 | #if IS_ENABLED(CONFIG_CHROMEOS) |
| 53 | /* Retrieve the switch interface MAC addressses. */ |
| 54 | lb_table_add_macs_from_vpd(header); |
| 55 | #endif |
Ionela Voinescu | b9d9615 | 2014-12-12 13:53:22 +0000 | [diff] [blame] | 56 | } |