Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2017 Intel Corp. |
Julien Viard de Galbert | 5a2c796 | 2018-02-13 23:19:08 +0100 | [diff] [blame] | 5 | * Copyright (C) 2017 - 2018 Online SAS. |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
| 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 | |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 18 | #include "gpio.h" |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 19 | #include <console/console.h> |
| 20 | #include <fsp/api.h> |
| 21 | #include <fsp/soc_binding.h> |
| 22 | #include <string.h> |
Julien Viard de Galbert | 0e755d4 | 2018-03-07 15:48:54 +0100 | [diff] [blame] | 23 | #include "bmcinfo.h" |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 24 | |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 25 | void mainboard_config_gpios(void); |
| 26 | void mainboard_memory_init_params(FSPM_UPD *mupd); |
| 27 | |
| 28 | /* |
| 29 | * Configure GPIO depend on platform |
| 30 | */ |
| 31 | void mainboard_config_gpios(void) |
| 32 | { |
| 33 | size_t num; |
Julien Viard de Galbert | f729cd0 | 2018-03-29 11:31:17 +0200 | [diff] [blame^] | 34 | const struct pad_config *table; |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 35 | |
Julien Viard de Galbert | 0e755d4 | 2018-03-07 15:48:54 +0100 | [diff] [blame] | 36 | printk(BIOS_SPEW, "Board Serial: %s.\n", bmcinfo_serial()); |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 37 | /* Configure pads prior to SiliconInit() in case there's any |
| 38 | * dependencies during hardware initialization. |
| 39 | */ |
Julien Viard de Galbert | 5a2c796 | 2018-02-13 23:19:08 +0100 | [diff] [blame] | 40 | table = tagada_gpio_config; |
| 41 | num = ARRAY_SIZE(tagada_gpio_config); |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 42 | |
| 43 | if ((!table) || (!num)) { |
| 44 | printk(BIOS_ERR, "ERROR: No valid GPIO table found!\n"); |
| 45 | return; |
| 46 | } |
| 47 | |
| 48 | printk(BIOS_INFO, "GPIO table: 0x%x, entry num: 0x%x!\n", |
| 49 | (uint32_t)table, (uint32_t)num); |
Julien Viard de Galbert | f729cd0 | 2018-03-29 11:31:17 +0200 | [diff] [blame^] | 50 | gpio_configure_pads(table, num); |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | void mainboard_memory_init_params(FSPM_UPD *mupd) |
| 54 | { |
Julien Viard de Galbert | 0e755d4 | 2018-03-07 15:48:54 +0100 | [diff] [blame] | 55 | mupd->FspmConfig.PcdFspDebugPrintErrorLevel = |
| 56 | bmcinfo_fsp_verbosity_level(); |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 57 | |
Julien Viard de Galbert | d5a19285 | 2018-02-13 22:05:26 +0100 | [diff] [blame] | 58 | // Enable Rmt and Fast Boot by default, RMT will be run only on first |
| 59 | // boot or when dimms change |
| 60 | mupd->FspmConfig.PcdMrcRmtSupport = 1; |
| 61 | mupd->FspmConfig.PcdFastBoot = 1; |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 62 | } |