Patrick Georgi | 02363b5 | 2020-05-05 20:48:50 +0200 | [diff] [blame] | 1 | /* This file is part of the coreboot project. */ |
Patrick Georgi | ac95903 | 2020-05-05 22:49:26 +0200 | [diff] [blame^] | 2 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 3 | |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 4 | #include "gpio.h" |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 5 | #include <console/console.h> |
| 6 | #include <fsp/api.h> |
| 7 | #include <fsp/soc_binding.h> |
Julien Viard de Galbert | 0e755d4 | 2018-03-07 15:48:54 +0100 | [diff] [blame] | 8 | #include "bmcinfo.h" |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 9 | |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 10 | void mainboard_config_gpios(void); |
| 11 | void mainboard_memory_init_params(FSPM_UPD *mupd); |
| 12 | |
| 13 | /* |
| 14 | * Configure GPIO depend on platform |
| 15 | */ |
| 16 | void mainboard_config_gpios(void) |
| 17 | { |
| 18 | size_t num; |
Julien Viard de Galbert | f729cd0 | 2018-03-29 11:31:17 +0200 | [diff] [blame] | 19 | const struct pad_config *table; |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 20 | |
Julien Viard de Galbert | 0e755d4 | 2018-03-07 15:48:54 +0100 | [diff] [blame] | 21 | printk(BIOS_SPEW, "Board Serial: %s.\n", bmcinfo_serial()); |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 22 | /* Configure pads prior to SiliconInit() in case there's any |
| 23 | * dependencies during hardware initialization. |
| 24 | */ |
Julien Viard de Galbert | 5a2c796 | 2018-02-13 23:19:08 +0100 | [diff] [blame] | 25 | table = tagada_gpio_config; |
| 26 | num = ARRAY_SIZE(tagada_gpio_config); |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 27 | |
| 28 | if ((!table) || (!num)) { |
| 29 | printk(BIOS_ERR, "ERROR: No valid GPIO table found!\n"); |
| 30 | return; |
| 31 | } |
| 32 | |
| 33 | printk(BIOS_INFO, "GPIO table: 0x%x, entry num: 0x%x!\n", |
| 34 | (uint32_t)table, (uint32_t)num); |
Julien Viard de Galbert | f729cd0 | 2018-03-29 11:31:17 +0200 | [diff] [blame] | 35 | gpio_configure_pads(table, num); |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | void mainboard_memory_init_params(FSPM_UPD *mupd) |
| 39 | { |
Julien Viard de Galbert | 0e755d4 | 2018-03-07 15:48:54 +0100 | [diff] [blame] | 40 | mupd->FspmConfig.PcdFspDebugPrintErrorLevel = |
| 41 | bmcinfo_fsp_verbosity_level(); |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 42 | |
Julien Viard de Galbert | d5a19285 | 2018-02-13 22:05:26 +0100 | [diff] [blame] | 43 | // Enable Rmt and Fast Boot by default, RMT will be run only on first |
| 44 | // boot or when dimms change |
| 45 | mupd->FspmConfig.PcdMrcRmtSupport = 1; |
| 46 | mupd->FspmConfig.PcdFastBoot = 1; |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 47 | } |