mb/google/brya: Add GPIO stubs

Add stubbed out GPIO configuration and perform GPIO initialization
during bootblock and ramstage.

BUG=b:174266035
TEST=Build Test

Signed-off-by: Eric Lai <ericr_lai@compal.corp-partner.google.com>
Change-Id: Ia658ab4b466242cf8658abb239f19a9c0a03849a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48065
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Eric Lai 2020-11-26 12:58:10 +08:00 committed by Tim Wawrzynczak
parent 50886827b5
commit 5e053af7a6
8 changed files with 64 additions and 2 deletions

View File

@ -26,4 +26,8 @@ config MAINBOARD_PART_NUMBER
string
default "brya" if BOARD_GOOGLE_BRYA0
config VARIANT_DIR
string
default "brya0" if BOARD_GOOGLE_BRYA0
endif # BOARD_GOOGLE_BASEBOARD_BRYA

View File

@ -4,5 +4,10 @@ romstage-y += romstage.c
ramstage-y += mainboard.c
VARIANT_DIR:=$(call strip_quotes,$(CONFIG_VARIANT_DIR))
subdirs-y += variants/baseboard
subdirs-y += variants/$(VARIANT_DIR)
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include

View File

@ -1,8 +1,12 @@
/* 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);
}

View File

@ -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)

View File

@ -0,0 +1,3 @@
bootblock-y += gpio.c
ramstage-y += gpio.c

View File

@ -0,0 +1,27 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <baseboard/gpio.h>
#include <baseboard/variants.h>
#include <commonlib/helpers.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;
}

View File

@ -6,4 +6,11 @@
#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);
#endif /*__BASEBOARD_VARIANTS_H__ */

View File

@ -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__ */