Attention is currently required from: Dinesh Gehlot, Eran Mitrani, Jakub "Kuba" Czapiga, Kapil Porwal, Subrata Banik, Tarun.
Derek Huang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86675?usp=email )
Change subject: mb/google/rex/deku: Convert TCSS port number to EC port number ......................................................................
mb/google/rex/deku: Convert TCSS port number to EC port number
Deku design has a non-sequential mapping between CPU physical Type-C ports and EC Typec-C ports. This patch implement variant_retimer_get_index_for_typec function to convert TCSS port number to EC port number.
BUG=b:399032094 TEST=Check the Type-C port and EC port mapping in coreboot log
deku-rev1 ~ # cbmem -c |grep "USB Type-C" [INFO ] USB Type-C 0 mapped to EC port 0 [INFO ] USB Type-C 1 mapped to EC port 2 [INFO ] USB Type-C 2 mapped to EC port 1 [INFO ] USB Type-C 3 mapped to EC port 3
Change-Id: Ic0e153472783dd0aabb440cb885a49f440875657 Signed-off-by: Derek Huang derekhuang@google.com --- M src/mainboard/google/rex/variants/deku/Makefile.mk A src/mainboard/google/rex/variants/deku/variant.c 2 files changed, 25 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/75/86675/1
diff --git a/src/mainboard/google/rex/variants/deku/Makefile.mk b/src/mainboard/google/rex/variants/deku/Makefile.mk index 090dd5b..f9db814 100644 --- a/src/mainboard/google/rex/variants/deku/Makefile.mk +++ b/src/mainboard/google/rex/variants/deku/Makefile.mk @@ -3,4 +3,4 @@ bootblock-y += gpio.c romstage-y += gpio.c ramstage-y += gpio.c -ramstage-y += ramstage.c +ramstage-y += ramstage.c variant.c diff --git a/src/mainboard/google/rex/variants/deku/variant.c b/src/mainboard/google/rex/variants/deku/variant.c new file mode 100644 index 0000000..9fafa03 --- /dev/null +++ b/src/mainboard/google/rex/variants/deku/variant.c @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <baseboard/variants.h> + +#define TYPE_C_PORT_NUMS 4 + +/* + * ------------------------------ + * | CPU TCSS port | EC port | + * | 0 | 0 | + * | 1 | 2 | + * | 2 | 1 | + * | 3 | 3 | + * ------------------------------ + */ +const uint8_t ec_port_mapping[] = {0, 2, 1, 3}; + +int variant_retimer_get_index_for_typec(uint8_t typec_port) +{ + if (typec_port >= TYPE_C_PORT_NUMS) + return -1; + + return ec_port_mapping[typec_port]; +}