mb/google/rex: Remove depedency on board id for early GPIO config

This adds a default early GPIO table in the case of us not being
able to identify a valid board ID.

Primarily, this is useful in the case of EC issues to ensure
that debug interfaces (e.g. UART) are always up and available.

BUG=b:238165977
TEST=Boots and no errors on simics

Signed-off-by: Tarun Tuli <taruntuli@google.com>
Change-Id: I135dc6c29bc23195afe5c78eb79992691652d9e4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66394
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
diff --git a/src/mainboard/google/rex/variants/rex0/gpio.c b/src/mainboard/google/rex/variants/rex0/gpio.c
index 8ed1127..6775951 100644
--- a/src/mainboard/google/rex/variants/rex0/gpio.c
+++ b/src/mainboard/google/rex/variants/rex0/gpio.c
@@ -362,8 +362,6 @@
 
 /* Early pad configuration in bootblock */
 static const struct pad_config early_gpio_table_id0[] = {
-	/* TODO: Verify all early config in place */
-
 	/* GPP_B18 : [] ==> SOC_I2C_TPM_SDA */
 	PAD_CFG_NF(GPP_B18, NONE, DEEP, NF2),
 	/* GPP_B19 : [] ==> SOC_I2C_TPM_SCL */
@@ -390,6 +388,19 @@
 	PAD_CFG_GPI_GPIO_DRIVER_LOCK(GPP_H10, NONE, LOCK_CONFIG),
 };
 
+/* Default/Minimal early pad configuration if we can't find board_id */
+static const struct pad_config default_early_gpio_table[] = {
+	/* GPP_B18 : [] ==> SOC_I2C_TPM_SDA */
+	PAD_CFG_NF(GPP_B18, NONE, DEEP, NF2),
+	/* GPP_B19 : [] ==> SOC_I2C_TPM_SCL */
+	PAD_CFG_NF(GPP_B19, NONE, DEEP, NF2),
+
+	/* GPP_H08 : [] ==> UART_DBG_TX_SOC_RX_R */
+	PAD_CFG_NF(GPP_H08, NONE, DEEP, NF1),
+	/* GPP_H09 : [] ==> UART_SOC_TX_DBG_RX_R */
+	PAD_CFG_NF(GPP_H09, NONE, DEEP, NF1),
+};
+
 static const struct pad_config romstage_gpio_table_id0[] = {
 	/* A20  : [] ==> SSD_PERST_L */
 	PAD_CFG_GPO(GPP_A20, 0, DEEP),
@@ -421,9 +432,9 @@
 
 	case BOARD_ID_UNKNOWN:
 	default:
-		printk(BIOS_ERR, "board_id() not found.  Unable to load early gpio table.\n");
-		*num = 0;
-		return NULL;
+		printk(BIOS_ERR, "board_id() not found.  Loading default early gpio table.\n");
+		*num = ARRAY_SIZE(default_early_gpio_table);
+		return default_early_gpio_table;
 	}
 }