mb/google/poppy: Add variant callback for romstage GPIO configuration
This change adds variant callback to get GPIO configuration table in romstage and configures these GPIOs before memory training is performed. BUG=b:111860510 BRANCH=poppy Change-Id: I1eb51356fb3f4c0f4ff29b22dbcde6dbece303ad Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/27863 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
@ -17,8 +17,10 @@
|
|||||||
#include <baseboard/variants.h>
|
#include <baseboard/variants.h>
|
||||||
#include <cbfs.h>
|
#include <cbfs.h>
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
|
#include <soc/gpio.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <variant/gpio.h>
|
||||||
|
|
||||||
#include <fsp/soc_binding.h>
|
#include <fsp/soc_binding.h>
|
||||||
|
|
||||||
@ -147,6 +149,12 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||||||
FSP_M_CONFIG *mem_cfg = &mupd->FspmConfig;
|
FSP_M_CONFIG *mem_cfg = &mupd->FspmConfig;
|
||||||
struct memory_params p;
|
struct memory_params p;
|
||||||
|
|
||||||
|
const struct pad_config *pads;
|
||||||
|
size_t num;
|
||||||
|
|
||||||
|
pads = variant_romstage_gpio_table(&num);
|
||||||
|
gpio_configure_pads(pads, num);
|
||||||
|
|
||||||
memset(&p, 0, sizeof(p));
|
memset(&p, 0, sizeof(p));
|
||||||
variant_memory_params(&p);
|
variant_memory_params(&p);
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
bootblock-y += gpio.c
|
bootblock-y += gpio.c
|
||||||
|
|
||||||
romstage-y += memory.c
|
romstage-y += memory.c
|
||||||
|
romstage-y += gpio.c
|
||||||
|
|
||||||
ramstage-y += gpio.c
|
ramstage-y += gpio.c
|
||||||
ramstage-y += nhlt.c
|
ramstage-y += nhlt.c
|
||||||
|
@ -403,3 +403,9 @@ const struct cros_gpio * __weak variant_cros_gpios(size_t *num)
|
|||||||
*num = ARRAY_SIZE(cros_gpios);
|
*num = ARRAY_SIZE(cros_gpios);
|
||||||
return cros_gpios;
|
return cros_gpios;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const struct pad_config * __weak variant_romstage_gpio_table(size_t *num)
|
||||||
|
{
|
||||||
|
*num = 0;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
@ -27,6 +27,12 @@
|
|||||||
const struct pad_config *variant_gpio_table(size_t *num);
|
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_early_gpio_table(size_t *num);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Callback to get GPIOs to configure in romstage before memory training is
|
||||||
|
* performed.
|
||||||
|
*/
|
||||||
|
const struct pad_config *variant_romstage_gpio_table(size_t *num);
|
||||||
|
|
||||||
const struct cros_gpio *variant_cros_gpios(size_t *num);
|
const struct cros_gpio *variant_cros_gpios(size_t *num);
|
||||||
/* Config gpio by different sku id */
|
/* Config gpio by different sku id */
|
||||||
const struct pad_config *variant_sku_gpio_table(size_t *num);
|
const struct pad_config *variant_sku_gpio_table(size_t *num);
|
||||||
|
Reference in New Issue
Block a user