Michał Kopeć | cce6dfb | 2023-09-23 14:48:25 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #include <console/console.h> |
| 4 | #include <device/device.h> |
| 5 | #include <drivers/intel/gma/int15.h> |
| 6 | #include <gpio.h> |
| 7 | #include <mainboard/gpio.h> |
| 8 | #include <soc/gpio.h> |
| 9 | #include <soc/ramstage.h> |
| 10 | |
| 11 | static void print_board_id(void) |
| 12 | { |
| 13 | gpio_t id_gpios[] = { |
| 14 | GPP_G14, |
| 15 | GPP_G13, |
| 16 | GPP_G12, |
| 17 | }; |
| 18 | |
| 19 | printk(BIOS_INFO, "Board ID: "); |
| 20 | |
| 21 | switch (gpio_base2_value(id_gpios, ARRAY_SIZE(id_gpios))) { |
| 22 | case 0: |
| 23 | printk(BIOS_INFO, "ThinkCentre M900 Tiny\n"); |
| 24 | break; |
| 25 | case 2: |
| 26 | case 3: |
| 27 | case 4: |
| 28 | printk(BIOS_INFO, "ThinkCentre M700 Tiny\n"); |
| 29 | break; |
| 30 | default: |
| 31 | printk(BIOS_INFO, "Unknown!\n"); |
| 32 | break; |
| 33 | } |
| 34 | |
| 35 | printk(BIOS_INFO, "Serial header %spopulated\n", !gpio_get(GPP_A22) ? "" : "un"); |
| 36 | |
| 37 | printk(BIOS_INFO, "PS/2 header %spopulated\n", !gpio_get(GPP_D14) ? "" : "un"); |
| 38 | |
| 39 | printk(BIOS_INFO, "USB header %spopulated\n", !gpio_get(GPP_C19) ? "" : "un"); |
| 40 | |
| 41 | printk(BIOS_INFO, "DisplayPort header %spopulated\n", !gpio_get(GPP_B15) ? "" : "un"); |
| 42 | |
| 43 | printk(BIOS_INFO, "PCIe / SATA header %spopulated\n", !gpio_get(GPP_B21) ? "" : "un"); |
| 44 | } |
| 45 | |
| 46 | static void mainboard_enable(struct device *dev) |
| 47 | { |
| 48 | mainboard_configure_gpios(); |
| 49 | print_board_id(); |
| 50 | } |
| 51 | |
| 52 | struct chip_operations mainboard_ops = { |
| 53 | .enable_dev = mainboard_enable, |
| 54 | }; |