mb/google/rex: Add GPIO stubs
Add stubbed out GPIO configuration and perform GPIO initialization during bootblock, romstage and ramstage. BUG=b:224325352 TEST=util/abuild/abuild -p none -t google/rex -a -c max Signed-off-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Change-Id: I51426f9557dafc357fc54a971b6f76fac5323e0a Reviewed-on: https://review.coreboot.org/c/coreboot/+/64593 Reviewed-by: Tarun Tuli <taruntuli@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
@@ -31,4 +31,8 @@ config MAINBOARD_FAMILY
|
||||
config MAINBOARD_PART_NUMBER
|
||||
default "Rex" if BOARD_GOOGLE_REX0
|
||||
|
||||
config VARIANT_DIR
|
||||
string
|
||||
default "rex0" if BOARD_GOOGLE_REX0
|
||||
|
||||
endif # BOARD_GOOGLE_REX_COMMON
|
||||
|
@@ -4,7 +4,12 @@ romstage-y += romstage.c
|
||||
|
||||
ramstage-y += mainboard.c
|
||||
|
||||
VARIANT_DIR:=$(call strip_quotes,$(CONFIG_VARIANT_DIR))
|
||||
BASEBOARD_DIR:=$(call strip_quotes,$(CONFIG_BASEBOARD_DIR))
|
||||
|
||||
subdirs-y += variants/baseboard/$(BASEBOARD_DIR)
|
||||
subdirs-y += variants/$(VARIANT_DIR)
|
||||
|
||||
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include
|
||||
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/$(BASEBOARD_DIR)/include
|
||||
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include
|
||||
|
@@ -1,8 +1,13 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include <baseboard/variants.h>
|
||||
#include <bootblock_common.h>
|
||||
|
||||
void bootblock_mainboard_init(void)
|
||||
{
|
||||
/* TODO: Perform mainboard initialization */
|
||||
const struct pad_config *pads;
|
||||
size_t num;
|
||||
|
||||
pads = variant_early_gpio_table(&num);
|
||||
gpio_configure_pads(pads, num);
|
||||
}
|
||||
|
@@ -1,10 +1,14 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include <baseboard/variants.h>
|
||||
#include <device/device.h>
|
||||
|
||||
static void mainboard_init(void *chip_info)
|
||||
{
|
||||
/* TODO: Perform mainboard initialization */
|
||||
const struct pad_config *pads;
|
||||
size_t num;
|
||||
pads = variant_gpio_table(&num);
|
||||
gpio_configure_pads(pads, num);
|
||||
}
|
||||
|
||||
static void mainboard_enable(struct device *dev)
|
||||
|
@@ -1,9 +1,14 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include <baseboard/variants.h>
|
||||
#include <fsp/api.h>
|
||||
#include <soc/romstage.h>
|
||||
|
||||
void mainboard_memory_init_params(FSPM_UPD *memupd)
|
||||
{
|
||||
/* TODO : Fill FSP-M memory params */
|
||||
const struct pad_config *pads;
|
||||
size_t pads_num;
|
||||
|
||||
pads = variant_romstage_gpio_table(&pads_num);
|
||||
gpio_configure_pads(pads, pads_num);
|
||||
}
|
||||
|
@@ -6,4 +6,12 @@
|
||||
#include <soc/gpio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/* The next set of functions return the gpio table and fill in the number of entries for
|
||||
* each table.
|
||||
*/
|
||||
|
||||
const struct pad_config *variant_gpio_table(size_t *num);
|
||||
const struct pad_config *variant_early_gpio_table(size_t *num);
|
||||
const struct pad_config *variant_romstage_gpio_table(size_t *num);
|
||||
|
||||
#endif /*__BASEBOARD_VARIANTS_H__ */
|
||||
|
@@ -0,0 +1,5 @@
|
||||
bootblock-y += gpio.c
|
||||
|
||||
romstage-y += gpio.c
|
||||
|
||||
ramstage-y += gpio.c
|
34
src/mainboard/google/rex/variants/baseboard/rex/gpio.c
Normal file
34
src/mainboard/google/rex/variants/baseboard/rex/gpio.c
Normal file
@@ -0,0 +1,34 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#include <baseboard/gpio.h>
|
||||
#include <baseboard/variants.h>
|
||||
#include <soc/gpio.h>
|
||||
|
||||
/* Pad configuration in ramstage */
|
||||
static const struct pad_config gpio_table[] = {
|
||||
/* ToDo: Fill gpio configuration */
|
||||
};
|
||||
|
||||
/* Early pad configuration in bootblock */
|
||||
static const struct pad_config early_gpio_table[] = {
|
||||
/* ToDo: Fill early gpio configuration */
|
||||
};
|
||||
|
||||
const struct pad_config *__weak variant_gpio_table(size_t *num)
|
||||
{
|
||||
*num = ARRAY_SIZE(gpio_table);
|
||||
return gpio_table;
|
||||
}
|
||||
|
||||
const struct pad_config *__weak variant_early_gpio_table(size_t *num)
|
||||
{
|
||||
*num = ARRAY_SIZE(early_gpio_table);
|
||||
return early_gpio_table;
|
||||
}
|
||||
|
||||
/* Create the stub for romstage gpio, typically use for power sequence */
|
||||
const struct pad_config *__weak variant_romstage_gpio_table(size_t *num)
|
||||
{
|
||||
*num = 0;
|
||||
return NULL;
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#ifndef __MAINBOARD_GPIO_H__
|
||||
#define __MAINBOARD_GPIO_H__
|
||||
|
||||
#include <baseboard/gpio.h>
|
||||
|
||||
#endif /* __MAINBOARD_GPIO_H__ */
|
Reference in New Issue
Block a user