haswell: Make `copy_spd` a weak function
Instead of using function pointers, we can use weak functions. So, drop the pointer from `romstage_params`, leaving `pei_data` as the only remaining member. This will be cleaned up in a follow-up commit. Change-Id: I3b17d21ea7a650734119a5cab4892fcb158b589d Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/43105 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
parent
517bc99db1
commit
6eea191511
|
@ -13,7 +13,7 @@
|
|||
#include "../../variant.h"
|
||||
|
||||
/* Copy SPD data for on-board memory */
|
||||
static void copy_spd(struct pei_data *peid)
|
||||
void copy_spd(struct pei_data *peid)
|
||||
{
|
||||
const int gpio_vector[] = {13, 9, 47, -1};
|
||||
int spd_index = get_gpios(gpio_vector);
|
||||
|
@ -84,6 +84,4 @@ void variant_romstage_entry(struct romstage_params *rp)
|
|||
|
||||
memcpy(rp->pei_data->usb2_ports, usb2_ports, sizeof(usb2_ports));
|
||||
memcpy(rp->pei_data->usb3_ports, usb3_ports, sizeof(usb3_ports));
|
||||
|
||||
rp->copy_spd = copy_spd;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "../../variant.h"
|
||||
|
||||
/* Copy SPD data for on-board memory */
|
||||
static void copy_spd(struct pei_data *peid)
|
||||
void copy_spd(struct pei_data *peid)
|
||||
{
|
||||
const int gpio_vector[] = {13, 9, 47, -1};
|
||||
int spd_index = get_gpios(gpio_vector);
|
||||
|
@ -78,6 +78,4 @@ void variant_romstage_entry(struct romstage_params *rp)
|
|||
|
||||
memcpy(rp->pei_data->usb2_ports, usb2_ports, sizeof(usb2_ports));
|
||||
memcpy(rp->pei_data->usb3_ports, usb3_ports, sizeof(usb3_ports));
|
||||
|
||||
rp->copy_spd = copy_spd;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "../../variant.h"
|
||||
|
||||
/* Copy SPD data for on-board memory */
|
||||
static void copy_spd(struct pei_data *peid)
|
||||
void copy_spd(struct pei_data *peid)
|
||||
{
|
||||
const int gpio_vector[] = {13, 9, 47, -1};
|
||||
int spd_index = get_gpios(gpio_vector);
|
||||
|
@ -95,6 +95,4 @@ void variant_romstage_entry(struct romstage_params *rp)
|
|||
|
||||
memcpy(rp->pei_data->usb2_ports, usb2_ports, sizeof(usb2_ports));
|
||||
memcpy(rp->pei_data->usb3_ports, usb3_ports, sizeof(usb3_ports));
|
||||
|
||||
rp->copy_spd = copy_spd;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "../../variant.h"
|
||||
|
||||
/* Copy SPD data for on-board memory */
|
||||
static void copy_spd(struct pei_data *peid)
|
||||
void copy_spd(struct pei_data *peid)
|
||||
{
|
||||
const int gpio_vector[] = {13, 9, 47, -1};
|
||||
int spd_index = get_gpios(gpio_vector);
|
||||
|
@ -82,6 +82,4 @@ void variant_romstage_entry(struct romstage_params *rp)
|
|||
|
||||
memcpy(rp->pei_data->usb2_ports, usb2_ports, sizeof(usb2_ports));
|
||||
memcpy(rp->pei_data->usb3_ports, usb3_ports, sizeof(usb3_ports));
|
||||
|
||||
rp->copy_spd = copy_spd;
|
||||
}
|
||||
|
|
|
@ -114,7 +114,6 @@ void mainboard_romstage_entry(void)
|
|||
|
||||
struct romstage_params romstage_params = {
|
||||
.pei_data = &pei_data,
|
||||
.copy_spd = NULL,
|
||||
};
|
||||
|
||||
/* Call into the real romstage main with this board's attributes. */
|
||||
|
|
|
@ -192,7 +192,6 @@ void intel_northbridge_haswell_finalize_smm(void);
|
|||
struct pei_data;
|
||||
struct romstage_params {
|
||||
struct pei_data *pei_data;
|
||||
void (*copy_spd)(struct pei_data *peid);
|
||||
};
|
||||
void romstage_common(const struct romstage_params *params);
|
||||
void mb_late_romstage_setup(void); /* optional */
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
|
||||
#include "pei_data.h"
|
||||
|
||||
/* Optional function to copy SPD data for on-board memory */
|
||||
void copy_spd(struct pei_data *peid);
|
||||
|
||||
void sdram_initialize(struct pei_data *pei_data);
|
||||
void setup_sdram_meminfo(struct pei_data *pei_data);
|
||||
int fixup_haswell_errata(void);
|
||||
|
|
|
@ -13,6 +13,11 @@
|
|||
#include <southbridge/intel/lynxpoint/pch.h>
|
||||
#include <southbridge/intel/lynxpoint/me.h>
|
||||
|
||||
/* Copy SPD data for on-board memory */
|
||||
void __weak copy_spd(struct pei_data *peid)
|
||||
{
|
||||
}
|
||||
|
||||
void __weak mb_late_romstage_setup(void)
|
||||
{
|
||||
}
|
||||
|
@ -53,8 +58,7 @@ void romstage_common(const struct romstage_params *params)
|
|||
|
||||
report_platform_info();
|
||||
|
||||
if (params->copy_spd != NULL)
|
||||
params->copy_spd(params->pei_data);
|
||||
copy_spd(params->pei_data);
|
||||
|
||||
sdram_initialize(params->pei_data);
|
||||
|
||||
|
|
Loading…
Reference in New Issue