From 33b59c9170a66a7f6d9c26ccf664714ea81d218d Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Thu, 11 Feb 2021 13:42:20 +0100 Subject: haswell: Drop `mainboard_fill_pei_data` Use global variables to provide mainboard USB settings, and have the northbridge code copy it into the `pei_data` struct. For now. To minimize diffstat noise, this patch does not reindent the now-global mainboard USB configuration arrays. This is cleaned up in a follow-up. Change-Id: I273c7a6cd46734ae25b95fc11b5e188d63cac32e Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/50538 Reviewed-by: Arthur Heymans Reviewed-by: HAOUAS Elyes Tested-by: build bot (Jenkins) --- src/mainboard/google/beltino/romstage.c | 10 ++-------- src/mainboard/google/slippy/romstage.c | 5 ----- src/mainboard/google/slippy/variant.h | 2 -- src/mainboard/google/slippy/variants/falco/romstage.c | 10 ++-------- src/mainboard/google/slippy/variants/leon/romstage.c | 10 ++-------- src/mainboard/google/slippy/variants/peppy/romstage.c | 10 ++-------- src/mainboard/google/slippy/variants/wolf/romstage.c | 10 ++-------- 7 files changed, 10 insertions(+), 47 deletions(-) (limited to 'src/mainboard/google') diff --git a/src/mainboard/google/beltino/romstage.c b/src/mainboard/google/beltino/romstage.c index ee146301ec..f009f5abe1 100644 --- a/src/mainboard/google/beltino/romstage.c +++ b/src/mainboard/google/beltino/romstage.c @@ -46,9 +46,7 @@ void mb_get_spd_map(uint8_t spd_map[4]) spd_map[2] = 0xa4; } -void mainboard_fill_pei_data(struct pei_data *pei_data) -{ - struct usb2_port_setting usb2_ports[MAX_USB2_PORTS] = { + const struct usb2_port_setting mainboard_usb2_ports[MAX_USB2_PORTS] = { /* Length, Enable, OCn#, Location */ { 0x0064, 1, 0, /* P0: VP8 */ USB_PORT_MINI_PCIE }, @@ -68,14 +66,10 @@ void mainboard_fill_pei_data(struct pei_data *pei_data) USB_PORT_SKIP }, }; - struct usb3_port_setting usb3_ports[MAX_USB3_PORTS] = { + const struct usb3_port_setting mainboard_usb3_ports[MAX_USB3_PORTS] = { /* Enable, OCn# */ { 1, 0 }, /* P1; CN22 */ { 1, 1 }, /* P2; CN23 */ { 1, 2 }, /* P3; CN25 */ { 1, 2 }, /* P4; CN25 */ }; - - memcpy(pei_data->usb2_ports, usb2_ports, sizeof(usb2_ports)); - memcpy(pei_data->usb3_ports, usb3_ports, sizeof(usb3_ports)); -} diff --git a/src/mainboard/google/slippy/romstage.c b/src/mainboard/google/slippy/romstage.c index 7f08a58aca..fb32b48e8e 100644 --- a/src/mainboard/google/slippy/romstage.c +++ b/src/mainboard/google/slippy/romstage.c @@ -46,8 +46,3 @@ void mb_get_spd_map(uint8_t spd_map[4]) spd_map[0] = 0xff; spd_map[2] = 0xff; } - -void mainboard_fill_pei_data(struct pei_data *pei_data) -{ - variant_romstage_entry(pei_data); -} diff --git a/src/mainboard/google/slippy/variant.h b/src/mainboard/google/slippy/variant.h index 2263f9d099..bfcf855848 100644 --- a/src/mainboard/google/slippy/variant.h +++ b/src/mainboard/google/slippy/variant.h @@ -3,6 +3,4 @@ #ifndef VARIANT_H #define VARIANT_H -void variant_romstage_entry(struct pei_data *pei_data); - #endif diff --git a/src/mainboard/google/slippy/variants/falco/romstage.c b/src/mainboard/google/slippy/variants/falco/romstage.c index 516b26c9c5..de0ac76334 100644 --- a/src/mainboard/google/slippy/variants/falco/romstage.c +++ b/src/mainboard/google/slippy/variants/falco/romstage.c @@ -48,9 +48,7 @@ void copy_spd(struct pei_data *peid) } } -void variant_romstage_entry(struct pei_data *pei_data) -{ - struct usb2_port_setting usb2_ports[MAX_USB2_PORTS] = { + const struct usb2_port_setting mainboard_usb2_ports[MAX_USB2_PORTS] = { /* Length, Enable, OCn#, Location */ { 0x0064, 1, 0, /* P0: Port A, CN8 */ USB_PORT_BACK_PANEL }, @@ -70,14 +68,10 @@ void variant_romstage_entry(struct pei_data *pei_data) USB_PORT_INTERNAL }, }; - struct usb3_port_setting usb3_ports[MAX_USB3_PORTS] = { + const struct usb3_port_setting mainboard_usb3_ports[MAX_USB3_PORTS] = { /* Enable, OCn# */ { 1, 0 }, /* P1; Port A, CN8 */ { 1, 0 }, /* P2; Port B, CN9 */ { 0, USB_OC_PIN_SKIP }, /* P3; */ { 0, USB_OC_PIN_SKIP }, /* P4; */ }; - - memcpy(pei_data->usb2_ports, usb2_ports, sizeof(usb2_ports)); - memcpy(pei_data->usb3_ports, usb3_ports, sizeof(usb3_ports)); -} diff --git a/src/mainboard/google/slippy/variants/leon/romstage.c b/src/mainboard/google/slippy/variants/leon/romstage.c index e24dcb9808..daf0c16604 100644 --- a/src/mainboard/google/slippy/variants/leon/romstage.c +++ b/src/mainboard/google/slippy/variants/leon/romstage.c @@ -44,9 +44,7 @@ void copy_spd(struct pei_data *peid) spd_file + (spd_index * spd_len), spd_len); } -void variant_romstage_entry(struct pei_data *pei_data) -{ - struct usb2_port_setting usb2_ports[MAX_USB2_PORTS] = { + const struct usb2_port_setting mainboard_usb2_ports[MAX_USB2_PORTS] = { /* Length, Enable, OCn#, Location */ { 0x0040, 1, 0, /* P0: Port A, CN10 */ USB_PORT_BACK_PANEL }, @@ -66,14 +64,10 @@ void variant_romstage_entry(struct pei_data *pei_data) USB_PORT_SKIP }, }; - struct usb3_port_setting usb3_ports[MAX_USB3_PORTS] = { + const struct usb3_port_setting mainboard_usb3_ports[MAX_USB3_PORTS] = { /* Enable, OCn# */ { 1, 0 }, /* P1; Port A, CN10 */ { 1, 2 }, /* P2; Port B, CN11 */ { 0, USB_OC_PIN_SKIP }, /* P3; */ { 0, USB_OC_PIN_SKIP }, /* P4; */ }; - - memcpy(pei_data->usb2_ports, usb2_ports, sizeof(usb2_ports)); - memcpy(pei_data->usb3_ports, usb3_ports, sizeof(usb3_ports)); -} diff --git a/src/mainboard/google/slippy/variants/peppy/romstage.c b/src/mainboard/google/slippy/variants/peppy/romstage.c index 92e1e8dd5e..535c07b778 100644 --- a/src/mainboard/google/slippy/variants/peppy/romstage.c +++ b/src/mainboard/google/slippy/variants/peppy/romstage.c @@ -62,9 +62,7 @@ void copy_spd(struct pei_data *peid) } } -void variant_romstage_entry(struct pei_data *pei_data) -{ - struct usb2_port_setting usb2_ports[MAX_USB2_PORTS] = { + const struct usb2_port_setting mainboard_usb2_ports[MAX_USB2_PORTS] = { /* Length, Enable, OCn#, Location */ { 0x0150, 1, USB_OC_PIN_SKIP, /* P0: LTE */ USB_PORT_MINI_PCIE }, @@ -84,14 +82,10 @@ void variant_romstage_entry(struct pei_data *pei_data) USB_PORT_SKIP }, }; - struct usb3_port_setting usb3_ports[MAX_USB3_PORTS] = { + const struct usb3_port_setting mainboard_usb3_ports[MAX_USB3_PORTS] = { /* Enable, OCn# */ { 1, 0 }, /* P1; Port A, CN6 */ { 0, USB_OC_PIN_SKIP }, /* P2; */ { 0, USB_OC_PIN_SKIP }, /* P3; */ { 0, USB_OC_PIN_SKIP }, /* P4; */ }; - - memcpy(pei_data->usb2_ports, usb2_ports, sizeof(usb2_ports)); - memcpy(pei_data->usb3_ports, usb3_ports, sizeof(usb3_ports)); -} diff --git a/src/mainboard/google/slippy/variants/wolf/romstage.c b/src/mainboard/google/slippy/variants/wolf/romstage.c index a0b5055457..40ff9c2253 100644 --- a/src/mainboard/google/slippy/variants/wolf/romstage.c +++ b/src/mainboard/google/slippy/variants/wolf/romstage.c @@ -48,9 +48,7 @@ void copy_spd(struct pei_data *peid) } } -void variant_romstage_entry(struct pei_data *pei_data) -{ - struct usb2_port_setting usb2_ports[MAX_USB2_PORTS] = { + const struct usb2_port_setting mainboard_usb2_ports[MAX_USB2_PORTS] = { /* Length, Enable, OCn#, Location */ { 0x0040, 1, 0, /* P0: Port A, CN10 */ USB_PORT_BACK_PANEL }, @@ -70,14 +68,10 @@ void variant_romstage_entry(struct pei_data *pei_data) USB_PORT_SKIP }, }; - struct usb3_port_setting usb3_ports[MAX_USB3_PORTS] = { + const struct usb3_port_setting mainboard_usb3_ports[MAX_USB3_PORTS] = { /* Enable, OCn# */ { 1, 0 }, /* P1; Port A, CN10 */ { 1, 2 }, /* P2; Port B, CN11 */ { 0, USB_OC_PIN_SKIP }, /* P3; */ { 0, USB_OC_PIN_SKIP }, /* P4; */ }; - - memcpy(pei_data->usb2_ports, usb2_ports, sizeof(usb2_ports)); - memcpy(pei_data->usb3_ports, usb3_ports, sizeof(usb3_ports)); -} -- cgit v1.2.3