blob: c29ff9dff71ac147d5f072563cac29b3c73717da [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>
Julien Viard de Galbert0e755d42018-03-07 15:48:54 +010023#include "bmcinfo.h"
Julien Viard de Galbert4f136402018-02-16 14:40:53 +010024
Julien Viard de Galbert4f136402018-02-16 14:40:53 +010025void mainboard_config_gpios(void);
26void mainboard_memory_init_params(FSPM_UPD *mupd);
27
28/*
29* Configure GPIO depend on platform
30*/
31void mainboard_config_gpios(void)
32{
33 size_t num;
Julien Viard de Galbertf729cd02018-03-29 11:31:17 +020034 const struct pad_config *table;
Julien Viard de Galbert4f136402018-02-16 14:40:53 +010035
Julien Viard de Galbert0e755d42018-03-07 15:48:54 +010036 printk(BIOS_SPEW, "Board Serial: %s.\n", bmcinfo_serial());
Julien Viard de Galbert4f136402018-02-16 14:40:53 +010037 /* Configure pads prior to SiliconInit() in case there's any
38 * dependencies during hardware initialization.
39 */
Julien Viard de Galbert5a2c7962018-02-13 23:19:08 +010040 table = tagada_gpio_config;
41 num = ARRAY_SIZE(tagada_gpio_config);
Julien Viard de Galbert4f136402018-02-16 14:40:53 +010042
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 Galbertf729cd02018-03-29 11:31:17 +020050 gpio_configure_pads(table, num);
Julien Viard de Galbert4f136402018-02-16 14:40:53 +010051}
52
53void mainboard_memory_init_params(FSPM_UPD *mupd)
54{
Julien Viard de Galbert0e755d42018-03-07 15:48:54 +010055 mupd->FspmConfig.PcdFspDebugPrintErrorLevel =
56 bmcinfo_fsp_verbosity_level();
Julien Viard de Galbert4f136402018-02-16 14:40:53 +010057
Julien Viard de Galbertd5a192852018-02-13 22:05:26 +010058 // 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 Galbert4f136402018-02-16 14:40:53 +010062}