blob: d6a128209e06f5200c3bda02c98afec048189568 [file] [log] [blame]
Julien Viard de Galbert4f136402018-02-16 14:40:53 +01001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2017 Intel Corp.
Julien Viard de Galbert5a2c7962018-02-13 23:19:08 +01005 * Copyright (C) 2017 - 2018 Online SAS.
Julien Viard de Galbert4f136402018-02-16 14:40:53 +01006 *
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 Galbert4f136402018-02-16 14:40:53 +010018#include "gpio.h"
Julien Viard de Galbert4f136402018-02-16 14:40:53 +010019#include <console/console.h>
20#include <fsp/api.h>
21#include <fsp/soc_binding.h>
22#include <string.h>
23
Julien Viard de Galbert4f136402018-02-16 14:40:53 +010024void mainboard_config_gpios(void);
25void mainboard_memory_init_params(FSPM_UPD *mupd);
26
27/*
28* Configure GPIO depend on platform
29*/
30void mainboard_config_gpios(void)
31{
32 size_t num;
33 const struct pad_config *table;
Julien Viard de Galbert4f136402018-02-16 14:40:53 +010034
35 /* Configure pads prior to SiliconInit() in case there's any
36 * dependencies during hardware initialization.
37 */
Julien Viard de Galbert5a2c7962018-02-13 23:19:08 +010038 table = tagada_gpio_config;
39 num = ARRAY_SIZE(tagada_gpio_config);
Julien Viard de Galbert4f136402018-02-16 14:40:53 +010040
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
51void mainboard_memory_init_params(FSPM_UPD *mupd)
52{
Julien Viard de Galbertd5a192852018-02-13 22:05:26 +010053 mupd->FspmConfig.PcdFspDebugPrintErrorLevel = 3; // Verbose
Julien Viard de Galbert4f136402018-02-16 14:40:53 +010054
Julien Viard de Galbertd5a192852018-02-13 22:05:26 +010055 // 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 Galbert4f136402018-02-16 14:40:53 +010059}