Merge tag 'efi-2023-04-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2023-04-rc4

Documentation:

* man-page for panic command

UEFI:

* Correct parameter check for SetVariable()

Other:

 * Provide unit test for crc8
diff --git a/arch/arm/dts/r8a77980-condor-u-boot.dts b/arch/arm/dts/r8a77980-condor-u-boot.dts
index 576a74e..530abdb 100644
--- a/arch/arm/dts/r8a77980-condor-u-boot.dts
+++ b/arch/arm/dts/r8a77980-condor-u-boot.dts
@@ -12,6 +12,23 @@
 	aliases {
 		spi0 = &rpc;
 	};
+
+	sysinfo {
+		compatible = "renesas,rcar-sysinfo";
+		i2c-eeprom = <&sysinfo_eeprom>;
+		u-boot,dm-pre-reloc;
+	};
+};
+
+&i2c0 {
+	u-boot,dm-pre-reloc;
+
+	sysinfo_eeprom: eeprom@50 {
+		compatible = "rohm,br24t01", "atmel,24c01";
+		reg = <0x50>;
+		pagesize = <8>;
+		u-boot,dm-pre-reloc;
+	};
 };
 
 &rpc {
diff --git a/arch/arm/dts/r8a77995-draak-u-boot.dts b/arch/arm/dts/r8a77995-draak-u-boot.dts
index 0ea2570..260bc5d 100644
--- a/arch/arm/dts/r8a77995-draak-u-boot.dts
+++ b/arch/arm/dts/r8a77995-draak-u-boot.dts
@@ -8,6 +8,25 @@
 #include "r8a77995-draak.dts"
 #include "r8a77995-u-boot.dtsi"
 
+/ {
+	sysinfo {
+		compatible = "renesas,rcar-sysinfo";
+		i2c-eeprom = <&sysinfo_eeprom>;
+		u-boot,dm-pre-reloc;
+	};
+};
+
+&i2c0 {
+	u-boot,dm-pre-reloc;
+
+	sysinfo_eeprom: eeprom@50 {
+		compatible = "rohm,br24t01", "atmel,24c01";
+		reg = <0x50>;
+		pagesize = <8>;
+		u-boot,dm-pre-reloc;
+	};
+};
+
 &rpc {
 	reg = <0 0xee200000 0 0x100>, <0 0x08000000 0 0x04000000>;
 	status = "disabled";
diff --git a/common/Kconfig b/common/Kconfig
index e3a5e1b..0afc01b 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1106,15 +1106,3 @@
 
 config IO_TRACE
 	bool
-
-config USB_HUB_DEBOUNCE_TIMEOUT
-	int "Timeout in milliseconds for USB HUB connection"
-	depends on USB
-	default 1000
-	help
-	  Value in milliseconds of the USB connection timeout, the max delay to
-	  wait the hub port status to be connected steadily after being powered
-	  off and powered on in the usb hub driver.
-	  This define allows to increase the HUB_DEBOUNCE_TIMEOUT default
-	  value = 1s because some usb device needs around 1.5s to be initialized
-	  and a 2s value should solve detection issue on problematic USB keys.
diff --git a/common/Makefile b/common/Makefile
index 252e965..a50302d 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -24,7 +24,7 @@
 obj-$(CONFIG_PHYLIB) += miiphyutil.o
 
 obj-$(CONFIG_USB_HOST) += usb.o usb_hub.o
-obj-$(CONFIG_USB_GADGET) += usb.o usb_hub.o
+obj-$(CONFIG_USB_GADGET) += usb.o
 obj-$(CONFIG_USB_STORAGE) += usb_storage.o
 obj-$(CONFIG_USB_ONBOARD_HUB) += usb_onboard_hub.o
 
diff --git a/configs/r8a77980_condor_defconfig b/configs/r8a77980_condor_defconfig
index 0c3493c..e1b3dc5 100644
--- a/configs/r8a77980_condor_defconfig
+++ b/configs/r8a77980_condor_defconfig
@@ -33,6 +33,7 @@
 CONFIG_SYS_MAXARGS=64
 CONFIG_SYS_PBSIZE=2068
 CONFIG_CMD_BOOTZ=y
+CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=10
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -64,6 +65,9 @@
 CONFIG_RCAR_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_RCAR_I2C=y
+CONFIG_MISC=y
+CONFIG_I2C_EEPROM=y
+CONFIG_SYS_I2C_EEPROM_ADDR=0x50
 CONFIG_MMC_IO_VOLTAGE=y
 CONFIG_MMC_UHS_SUPPORT=y
 CONFIG_MMC_HS200_SUPPORT=y
@@ -84,6 +88,7 @@
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_RENESAS_RPC_SPI=y
+CONFIG_SYSINFO=y
 CONFIG_TEE=y
 CONFIG_OPTEE=y
 CONFIG_USB=y
diff --git a/configs/r8a77995_draak_defconfig b/configs/r8a77995_draak_defconfig
index 4ddb66a..a09b33e 100644
--- a/configs/r8a77995_draak_defconfig
+++ b/configs/r8a77995_draak_defconfig
@@ -33,6 +33,7 @@
 CONFIG_SYS_MAXARGS=64
 CONFIG_SYS_PBSIZE=2068
 CONFIG_CMD_BOOTZ=y
+CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=10
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -65,6 +66,9 @@
 CONFIG_RCAR_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_RCAR_I2C=y
+CONFIG_MISC=y
+CONFIG_I2C_EEPROM=y
+CONFIG_SYS_I2C_EEPROM_ADDR=0x50
 CONFIG_MMC_IO_VOLTAGE=y
 CONFIG_MMC_UHS_SUPPORT=y
 CONFIG_MMC_HS200_SUPPORT=y
@@ -94,6 +98,7 @@
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_RENESAS_RPC_SPI=y
+CONFIG_SYSINFO=y
 CONFIG_TEE=y
 CONFIG_OPTEE=y
 CONFIG_USB=y
diff --git a/drivers/clk/renesas/Kconfig b/drivers/clk/renesas/Kconfig
index 1686410..d58e897 100644
--- a/drivers/clk/renesas/Kconfig
+++ b/drivers/clk/renesas/Kconfig
@@ -49,6 +49,7 @@
 	def_bool y if RCAR_GEN3
 	depends on CLK_RENESAS
 	select CLK_RCAR_CPG_LIB
+	select DM_RESET
 	help
 	  Enable this to support the clocks on Renesas RCar Gen3 SoC.
 
diff --git a/drivers/mmc/renesas-sdhi.c b/drivers/mmc/renesas-sdhi.c
index 4a1acce..34119f9 100644
--- a/drivers/mmc/renesas-sdhi.c
+++ b/drivers/mmc/renesas-sdhi.c
@@ -977,34 +977,50 @@
 
 	/* optional SDnH clock */
 	ret = clk_get_by_name(dev, "clkh", &priv->clkh);
-	if (ret < 0)
+	if (ret < 0) {
 		dev_dbg(dev, "failed to get clkh\n");
+	} else {
+		ret = clk_set_rate(&priv->clkh, 800000000);
+		if (ret < 0) {
+			dev_err(dev, "failed to set rate for SDnH clock (%d)\n", ret);
+			goto err_clk;
+		}
+	}
 
 	/* set to max rate */
 	ret = clk_set_rate(&priv->clk, 200000000);
 	if (ret < 0) {
-		dev_err(dev, "failed to set rate for host clock\n");
-		clk_free(&priv->clk);
-		return ret;
+		dev_err(dev, "failed to set rate for SDn clock (%d)\n", ret);
+		goto err_clkh;
 	}
 
 	ret = clk_enable(&priv->clk);
 	if (ret) {
-		dev_err(dev, "failed to enable host clock\n");
-		return ret;
+		dev_err(dev, "failed to enable SDn clock (%d)\n", ret);
+		goto err_clkh;
 	}
 
 	priv->quirks = quirks;
 	ret = tmio_sd_probe(dev, quirks);
+	if (ret)
+		goto err_tmio_probe;
 
 	renesas_sdhi_filter_caps(dev);
 
 #if CONFIG_IS_ENABLED(MMC_UHS_SUPPORT) || \
     CONFIG_IS_ENABLED(MMC_HS200_SUPPORT) || \
     CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)
-	if (!ret && (priv->caps & TMIO_SD_CAP_RCAR_UHS))
+	if (priv->caps & TMIO_SD_CAP_RCAR_UHS)
 		renesas_sdhi_reset_tuning(priv);
 #endif
+	return 0;
+
+err_tmio_probe:
+	clk_disable(&priv->clk);
+err_clkh:
+	clk_free(&priv->clkh);
+err_clk:
+	clk_free(&priv->clk);
 	return ret;
 }
 
diff --git a/drivers/pinctrl/renesas/sh_pfc.h b/drivers/pinctrl/renesas/sh_pfc.h
index 59d447e..0ab743e 100644
--- a/drivers/pinctrl/renesas/sh_pfc.h
+++ b/drivers/pinctrl/renesas/sh_pfc.h
@@ -309,21 +309,6 @@
 extern const struct sh_pfc_soc_info r8a77990_pinmux_info;
 extern const struct sh_pfc_soc_info r8a77995_pinmux_info;
 extern const struct sh_pfc_soc_info r8a779a0_pinmux_info;
-extern const struct sh_pfc_soc_info r8a779f0_pinmux_info;
-extern const struct sh_pfc_soc_info r8a779g0_pinmux_info;
-extern const struct sh_pfc_soc_info sh7203_pinmux_info;
-extern const struct sh_pfc_soc_info sh7264_pinmux_info;
-extern const struct sh_pfc_soc_info sh7269_pinmux_info;
-extern const struct sh_pfc_soc_info sh73a0_pinmux_info;
-extern const struct sh_pfc_soc_info sh7720_pinmux_info;
-extern const struct sh_pfc_soc_info sh7722_pinmux_info;
-extern const struct sh_pfc_soc_info sh7723_pinmux_info;
-extern const struct sh_pfc_soc_info sh7724_pinmux_info;
-extern const struct sh_pfc_soc_info sh7734_pinmux_info;
-extern const struct sh_pfc_soc_info sh7757_pinmux_info;
-extern const struct sh_pfc_soc_info sh7785_pinmux_info;
-extern const struct sh_pfc_soc_info sh7786_pinmux_info;
-extern const struct sh_pfc_soc_info shx3_pinmux_info;
 
 /* -----------------------------------------------------------------------------
  * Helper macros to create pin and port lists
diff --git a/drivers/sysinfo/rcar3.c b/drivers/sysinfo/rcar3.c
index c2f4ddf..7b12798 100644
--- a/drivers/sysinfo/rcar3.c
+++ b/drivers/sysinfo/rcar3.c
@@ -16,12 +16,14 @@
 #define BOARD_SALVATOR_X	0x0
 #define BOARD_KRIEK		0x1
 #define BOARD_STARTER_KIT	0x2
+#define BOARD_EAGLE		0x3
 #define BOARD_SALVATOR_XS	0x4
+#define BOARD_CONDOR		0x6
+#define BOARD_DRAAK		0x7
 #define BOARD_EBISU		0x8
 #define BOARD_STARTER_KIT_PRE	0xB
 #define BOARD_EBISU_4D		0xD
-#define BOARD_DRAAK		0xE
-#define BOARD_EAGLE		0xF
+#define BOARD_CONDOR_I		0x10
 
 /**
  * struct sysinfo_rcar_priv - sysinfo private data
@@ -65,6 +67,7 @@
 	const u8 board_rev = priv->val & BOARD_REV_MASK;
 	bool salvator_xs = false;
 	bool ebisu_4d = false;
+	bool condor_i = false;
 	char rev_major = '?';
 	char rev_minor = '?';
 
@@ -138,6 +141,18 @@
 			 "Renesas Kriek board rev %c.%c",
 			 rev_major, rev_minor);
 		return;
+	case BOARD_CONDOR_I:
+		condor_i = true;
+		fallthrough;
+	case BOARD_CONDOR:
+		if (!board_rev) { /* Only rev 0 is valid */
+			rev_major = '1';
+			rev_minor = '0';
+		}
+		snprintf(priv->boardmodel, sizeof(priv->boardmodel),
+			"Renesas Condor%s board rev %c.%c",
+			condor_i ? "-I" : "", rev_major, rev_minor);
+		return;
 	default:
 		snprintf(priv->boardmodel, sizeof(priv->boardmodel),
 			 "Renesas -Unknown- board rev ?.?");
diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index ebe6bf9..94fb32d 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -115,6 +115,17 @@
 	  power regulator. An example for such a hub is the Microchip
 	  USB2514B.
 
+config USB_HUB_DEBOUNCE_TIMEOUT
+	int "Timeout in milliseconds for USB HUB connection"
+	default 1000
+	help
+	  Value in milliseconds of the USB connection timeout, the max delay to
+	  wait the hub port status to be connected steadily after being powered
+	  off and powered on in the usb hub driver.
+	  This define allows to increase the HUB_DEBOUNCE_TIMEOUT default
+	  value = 1s because some usb device needs around 1.5s to be initialized
+	  and a 2s value should solve detection issue on problematic USB keys.
+
 if USB_KEYBOARD
 
 config USB_KEYBOARD_FN_KEYS