summaryrefslogtreecommitdiff
path: root/src/mainboard/scaleway/tagada/romstage.c
blob: 9fbbc3821e23876826d910d969830bd2b4439449 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* This file is part of the coreboot project. */
/* SPDX-License-Identifier: GPL-2.0-or-later */

#include "gpio.h"
#include <console/console.h>
#include <fsp/api.h>
#include <fsp/soc_binding.h>
#include "bmcinfo.h"

void mainboard_config_gpios(void);
void mainboard_memory_init_params(FSPM_UPD *mupd);

/*
* Configure GPIO depend on platform
*/
void mainboard_config_gpios(void)
{
	size_t num;
	const struct pad_config *table;

	printk(BIOS_SPEW, "Board Serial: %s.\n", bmcinfo_serial());
	/* Configure pads prior to SiliconInit() in case there's any
	* dependencies during hardware initialization.
	*/
	table = tagada_gpio_config;
	num = ARRAY_SIZE(tagada_gpio_config);

	if ((!table) || (!num)) {
		printk(BIOS_ERR, "ERROR: No valid GPIO table found!\n");
		return;
	}

	printk(BIOS_INFO, "GPIO table: 0x%x, entry num:  0x%x!\n",
	       (uint32_t)table, (uint32_t)num);
	gpio_configure_pads(table, num);
}

void mainboard_memory_init_params(FSPM_UPD *mupd)
{
	mupd->FspmConfig.PcdFspDebugPrintErrorLevel =
		bmcinfo_fsp_verbosity_level();

	// Enable Rmt and Fast Boot by default, RMT will be run only on first
	// boot or when dimms change
	mupd->FspmConfig.PcdMrcRmtSupport = 1;
	mupd->FspmConfig.PcdFastBoot = 1;
}