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> |
| 23 | |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 24 | void mainboard_config_gpios(void); |
| 25 | void mainboard_memory_init_params(FSPM_UPD *mupd); |
| 26 | |
| 27 | /* |
| 28 | * Configure GPIO depend on platform |
| 29 | */ |
| 30 | void mainboard_config_gpios(void) |
| 31 | { |
| 32 | size_t num; |
| 33 | const struct pad_config *table; |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 34 | |
| 35 | /* Configure pads prior to SiliconInit() in case there's any |
| 36 | * dependencies during hardware initialization. |
| 37 | */ |
Julien Viard de Galbert | 5a2c796 | 2018-02-13 23:19:08 +0100 | [diff] [blame^] | 38 | table = tagada_gpio_config; |
| 39 | num = ARRAY_SIZE(tagada_gpio_config); |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 40 | |
| 41 | if ((!table) || (!num)) { |
| 42 | printk(BIOS_ERR, "ERROR: No valid GPIO table found!\n"); |
| 43 | return; |
| 44 | } |
| 45 | |
| 46 | printk(BIOS_INFO, "GPIO table: 0x%x, entry num: 0x%x!\n", |
| 47 | (uint32_t)table, (uint32_t)num); |
| 48 | gpio_configure_pads(table, num); |
| 49 | } |
| 50 | |
| 51 | void mainboard_memory_init_params(FSPM_UPD *mupd) |
| 52 | { |
Julien Viard de Galbert | d5a19285 | 2018-02-13 22:05:26 +0100 | [diff] [blame] | 53 | mupd->FspmConfig.PcdFspDebugPrintErrorLevel = 3; // Verbose |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 54 | |
Julien Viard de Galbert | d5a19285 | 2018-02-13 22:05:26 +0100 | [diff] [blame] | 55 | // Enable Rmt and Fast Boot by default, RMT will be run only on first |
| 56 | // boot or when dimms change |
| 57 | mupd->FspmConfig.PcdMrcRmtSupport = 1; |
| 58 | mupd->FspmConfig.PcdFastBoot = 1; |
Julien Viard de Galbert | 4f13640 | 2018-02-16 14:40:53 +0100 | [diff] [blame] | 59 | } |