Patrick Rudolph | 6308e0e | 2018-03-27 16:06:34 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2014 Vladimir Serbinenko |
| 5 | * Copyright (C) 2018 Patrick Rudolph <siro@das-labor.org> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License as |
| 9 | * published by the Free Software Foundation; version 2 of |
| 10 | * the License. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | */ |
| 17 | #include <device/device.h> |
| 18 | #include <drivers/intel/gma/int15.h> |
| 19 | #include <southbridge/intel/bd82x6x/pch.h> |
Patrick Rudolph | fe98e90 | 2018-03-27 16:17:12 +0200 | [diff] [blame] | 20 | #include <smbios.h> |
| 21 | |
| 22 | #if IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLES) |
| 23 | static int mainboard_smbios_data(struct device *dev, int *handle, |
| 24 | unsigned long *current) |
| 25 | { |
| 26 | int len = 0; |
| 27 | |
| 28 | // add IPMI Device Information |
| 29 | len += smbios_write_type38( |
| 30 | current, handle, |
| 31 | SMBIOS_BMC_INTERFACE_KCS, |
| 32 | 0x20, // IPMI Version |
| 33 | 0x20, // I2C address |
| 34 | 0xff, // no NV storage |
| 35 | 0, // IO port interface address |
| 36 | 0, |
| 37 | 0); // no IRQ |
| 38 | |
| 39 | return len; |
| 40 | } |
| 41 | #endif |
Patrick Rudolph | 6308e0e | 2018-03-27 16:06:34 +0200 | [diff] [blame] | 42 | |
| 43 | static void mainboard_enable(struct device *dev) |
| 44 | { |
| 45 | install_intel_vga_int15_handler(GMA_INT15_ACTIVE_LFP_NONE, |
| 46 | GMA_INT15_PANEL_FIT_DEFAULT, |
| 47 | GMA_INT15_BOOT_DISPLAY_DEFAULT, 0); |
Patrick Rudolph | fe98e90 | 2018-03-27 16:17:12 +0200 | [diff] [blame] | 48 | #if IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLES) |
| 49 | dev->ops->get_smbios_data = mainboard_smbios_data; |
| 50 | #endif |
Patrick Rudolph | 6308e0e | 2018-03-27 16:06:34 +0200 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | struct chip_operations mainboard_ops = { |
| 54 | .enable_dev = mainboard_enable, |
| 55 | }; |