From b78d4f270ce22a18c7893ace52b81c7d0e30f9bd Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 22 Dec 2022 22:13:10 +0100 Subject: [PATCH 01/11] ARM: renesas: Enable LTO on R-Car3 ULCB Enable LTO (link time optimization) to improve optimization and reduce code size by cca. 31 kiB. Signed-off-by: Marek Vasut --- configs/rcar3_ulcb_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/rcar3_ulcb_defconfig b/configs/rcar3_ulcb_defconfig index 43361a286f..076bc2d335 100644 --- a/configs/rcar3_ulcb_defconfig +++ b/configs/rcar3_ulcb_defconfig @@ -13,6 +13,7 @@ CONFIG_SPL_TEXT_BASE=0xe6338000 CONFIG_RCAR_GEN3=y CONFIG_TARGET_ULCB=y CONFIG_SYS_LOAD_ADDR=0x58000000 +CONFIG_LTO=y CONFIG_REMAKE_ELF=y CONFIG_SYS_MONITOR_LEN=1048576 CONFIG_FIT=y From 68e1926668c8df03848516ae33f8107f4b43ebe6 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 22 Dec 2022 22:13:11 +0100 Subject: [PATCH 02/11] ARM: renesas: Enable LTO on R-Car3 Eagle Enable LTO (link time optimization) to improve optimization and reduce code size by cca. 32 kiB. Signed-off-by: Marek Vasut --- configs/r8a77970_eagle_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/r8a77970_eagle_defconfig b/configs/r8a77970_eagle_defconfig index fac4ab66f7..62192ad389 100644 --- a/configs/r8a77970_eagle_defconfig +++ b/configs/r8a77970_eagle_defconfig @@ -14,6 +14,7 @@ CONFIG_SPL_TEXT_BASE=0xe6318000 CONFIG_RCAR_GEN3=y CONFIG_TARGET_EAGLE=y CONFIG_SYS_LOAD_ADDR=0x58000000 +CONFIG_LTO=y CONFIG_REMAKE_ELF=y CONFIG_SYS_MONITOR_LEN=1048576 CONFIG_FIT=y From 0d408d32d5af405fe699cd8af3fee3b77b2288fe Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 22 Dec 2022 22:13:12 +0100 Subject: [PATCH 03/11] ARM: renesas: Enable LTO on R-Car3 Condor Enable LTO (link time optimization) to improve optimization and reduce code size by cca. 32 kiB. Signed-off-by: Marek Vasut --- configs/r8a77980_condor_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/r8a77980_condor_defconfig b/configs/r8a77980_condor_defconfig index 1983c8a2db..b316a99827 100644 --- a/configs/r8a77980_condor_defconfig +++ b/configs/r8a77980_condor_defconfig @@ -14,6 +14,7 @@ CONFIG_SPL_TEXT_BASE=0xe6318000 CONFIG_RCAR_GEN3=y CONFIG_TARGET_CONDOR=y CONFIG_SYS_LOAD_ADDR=0x58000000 +CONFIG_LTO=y CONFIG_REMAKE_ELF=y CONFIG_SYS_MONITOR_LEN=1048576 CONFIG_FIT=y From 92f00cc26c49df1f87367efe8bf9949781dc25cf Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 22 Dec 2022 22:13:13 +0100 Subject: [PATCH 04/11] ARM: renesas: Enable LTO on R-Car3 Ebisu Enable LTO (link time optimization) to improve optimization and reduce code size by cca. 34 kiB. Signed-off-by: Marek Vasut --- configs/r8a77990_ebisu_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/r8a77990_ebisu_defconfig b/configs/r8a77990_ebisu_defconfig index fe2a38da99..00337e07ee 100644 --- a/configs/r8a77990_ebisu_defconfig +++ b/configs/r8a77990_ebisu_defconfig @@ -13,6 +13,7 @@ CONFIG_SPL_TEXT_BASE=0xe6318000 CONFIG_RCAR_GEN3=y CONFIG_TARGET_EBISU=y CONFIG_SYS_LOAD_ADDR=0x58000000 +CONFIG_LTO=y CONFIG_REMAKE_ELF=y CONFIG_SYS_MONITOR_LEN=1048576 CONFIG_FIT=y From 735e6babbcf6b08481b3058e3cec93cb3de371b1 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 22 Dec 2022 22:13:14 +0100 Subject: [PATCH 05/11] ARM: renesas: Enable LTO on R-Car3 Draak Enable LTO (link time optimization) to improve optimization and reduce code size by cca. 29 kiB. Signed-off-by: Marek Vasut --- configs/r8a77995_draak_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/r8a77995_draak_defconfig b/configs/r8a77995_draak_defconfig index 9ac70cba65..e6517ea34c 100644 --- a/configs/r8a77995_draak_defconfig +++ b/configs/r8a77995_draak_defconfig @@ -13,6 +13,7 @@ CONFIG_SPL_TEXT_BASE=0xe6318000 CONFIG_RCAR_GEN3=y CONFIG_TARGET_DRAAK=y CONFIG_SYS_LOAD_ADDR=0x58000000 +CONFIG_LTO=y CONFIG_REMAKE_ELF=y CONFIG_SYS_MONITOR_LEN=1048576 CONFIG_FIT=y From 81616cec1eb727464b96295db1a469490ba68822 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 22 Dec 2022 22:13:15 +0100 Subject: [PATCH 06/11] ARM: renesas: Enable LTO on R-Car3 Falcon Enable LTO (link time optimization) to improve optimization and reduce code size by cca. 30 kiB. Signed-off-by: Marek Vasut --- configs/r8a779a0_falcon_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/r8a779a0_falcon_defconfig b/configs/r8a779a0_falcon_defconfig index 8cf2921327..28fef6f16a 100644 --- a/configs/r8a779a0_falcon_defconfig +++ b/configs/r8a779a0_falcon_defconfig @@ -16,6 +16,7 @@ CONFIG_SYS_CLK_FREQ=16666666 # CONFIG_PSCI_RESET is not set CONFIG_ARMV8_PSCI=y CONFIG_SYS_LOAD_ADDR=0x58000000 +CONFIG_LTO=y CONFIG_REMAKE_ELF=y CONFIG_SYS_MONITOR_LEN=1048576 CONFIG_FIT=y From 2d09040fbaf83ef923fe8be4be6564d9a58e525f Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 22 Dec 2022 22:07:08 +0100 Subject: [PATCH 07/11] ARM: renesas: condor: Set CONFIG_TEXT_BASE=0x0 on R-Car Gen3 Condor Since R-Car Gen3 already enables position independent build, also set CONFIG_TEXT_BASE=0x0 to finalize the switch. This is possible since 534f0fbd65 ("arm64: Fix relocation of env_addr if POSITION_INDEPENDENT=y") fixed current env_get_char() crash with CONFIG_TEXT_BASE=0x0 . This change permits us to start U-Boot from any location in DRAM instead of specific TEXT_BASE. Signed-off-by: Marek Vasut --- configs/r8a77980_condor_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/r8a77980_condor_defconfig b/configs/r8a77980_condor_defconfig index b316a99827..819877d6ad 100644 --- a/configs/r8a77980_condor_defconfig +++ b/configs/r8a77980_condor_defconfig @@ -2,7 +2,7 @@ CONFIG_ARM=y CONFIG_COUNTER_FREQUENCY=16666666 CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_RMOBILE=y -CONFIG_TEXT_BASE=0x50000000 +CONFIG_TEXT_BASE=0x0 CONFIG_SYS_MALLOC_LEN=0x4000000 CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_ENV_SIZE=0x40000 From 0abcc23392db37752a402119fbb55c6b213bc3c5 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 22 Dec 2022 22:06:46 +0100 Subject: [PATCH 08/11] ARM: renesas: ulcb: Set CONFIG_TEXT_BASE=0x0 on R-Car Gen3 ULCB Since R-Car Gen3 already enables position independent build, also set CONFIG_TEXT_BASE=0x0 to finalize the switch. This is possible since 534f0fbd65 ("arm64: Fix relocation of env_addr if POSITION_INDEPENDENT=y") fixed current env_get_char() crash with CONFIG_TEXT_BASE=0x0 . This change permits us to start U-Boot from any location in DRAM instead of specific TEXT_BASE. Signed-off-by: Marek Vasut --- configs/rcar3_ulcb_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/rcar3_ulcb_defconfig b/configs/rcar3_ulcb_defconfig index 076bc2d335..1e964880f6 100644 --- a/configs/rcar3_ulcb_defconfig +++ b/configs/rcar3_ulcb_defconfig @@ -2,7 +2,7 @@ CONFIG_ARM=y CONFIG_COUNTER_FREQUENCY=16666666 CONFIG_ARCH_CPU_INIT=y CONFIG_ARCH_RMOBILE=y -CONFIG_TEXT_BASE=0x50000000 +CONFIG_TEXT_BASE=0x0 CONFIG_SYS_MALLOC_LEN=0x4000000 CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_ENV_SIZE=0x20000 From 3405cfa29d3173c4965b3c52f1616b7f24492164 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 22 Dec 2022 22:17:20 +0100 Subject: [PATCH 09/11] ARM: dts: renesas: condor: Enable SPI NOR fast-read This board requires SPI NOR fast-read, otherwise the SPI NOR access returns corrupted data. Enable the fast-read explicitly in DT as it has been disabled in the MTD subsystem by commit d008190920 ("mtd: spi-nor: Mask out fast read if not requested in DT") Signed-off-by: Marek Vasut --- arch/arm/dts/r8a77980-condor-u-boot.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/dts/r8a77980-condor-u-boot.dts b/arch/arm/dts/r8a77980-condor-u-boot.dts index 1b22c7f0b9..576a74e603 100644 --- a/arch/arm/dts/r8a77980-condor-u-boot.dts +++ b/arch/arm/dts/r8a77980-condor-u-boot.dts @@ -25,6 +25,7 @@ #address-cells = <1>; #size-cells = <1>; compatible = "s25fs512s", "jedec,spi-nor"; + m25p,fast-read; spi-max-frequency = <50000000>; spi-tx-bus-width = <1>; spi-rx-bus-width = <1>; From 0fe4366c9ac93a9cb4e4515a514ff3492ae47d9c Mon Sep 17 00:00:00 2001 From: Hai Pham Date: Thu, 22 Dec 2022 22:18:01 +0100 Subject: [PATCH 10/11] ARM: renesas: condor: switch eMMC bus to 1V8 The eMMC card has two supplies, VCC and VCCQ. The VCC supplies the NAND array and the VCCQ supplies the bus. On Condor, the VCC is connected to 3.3V rail, while the VCCQ is connected to 1.8V rail. Adjust the pinmux to match the bus, which is always operating in 1.8V mode. Based on Linux commit 69efe4bbeda50745 ("arm64: dts: renesas: condor: Switch eMMC bus to 1V8") from Wolfram Sang Signed-off-by: Hai Pham --- arch/arm/dts/r8a77980-condor.dts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/arm/dts/r8a77980-condor.dts b/arch/arm/dts/r8a77980-condor.dts index 3dde028e22..f0a0a51d73 100644 --- a/arch/arm/dts/r8a77980-condor.dts +++ b/arch/arm/dts/r8a77980-condor.dts @@ -212,7 +212,7 @@ &mmc0 { pinctrl-0 = <&mmc_pins>; - pinctrl-1 = <&mmc_pins_uhs>; + pinctrl-1 = <&mmc_pins>; pinctrl-names = "default", "state_uhs"; vmmc-supply = <&d3_3v>; @@ -253,12 +253,6 @@ }; mmc_pins: mmc { - groups = "mmc_data8", "mmc_ctrl", "mmc_ds"; - function = "mmc"; - power-source = <3300>; - }; - - mmc_pins_uhs: mmc_uhs { groups = "mmc_data8", "mmc_ctrl", "mmc_ds"; function = "mmc"; power-source = <1800>; From 4327df1d345e502f48a1a23b091ae39110481026 Mon Sep 17 00:00:00 2001 From: Andrey Dolnikov Date: Thu, 22 Dec 2022 22:18:25 +0100 Subject: [PATCH 11/11] configs: r8a77980: Condor: Enable MMC support by default This enables MMC support, which is available on Condor board, by default. Signed-off-by: Andrey Dolnikov Signed-off-by: Valentine Barshak Signed-off-by: Hai Pham --- configs/r8a77980_condor_defconfig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/configs/r8a77980_condor_defconfig b/configs/r8a77980_condor_defconfig index 819877d6ad..2e2bb55ba2 100644 --- a/configs/r8a77980_condor_defconfig +++ b/configs/r8a77980_condor_defconfig @@ -37,6 +37,7 @@ CONFIG_CMD_BOOTZ=y CONFIG_CMD_DFU=y CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y +CONFIG_CMD_MMC=y CONFIG_CMD_SPI=y CONFIG_CMD_USB=y CONFIG_CMD_DHCP=y @@ -64,7 +65,11 @@ CONFIG_DFU_SF=y CONFIG_RCAR_GPIO=y CONFIG_DM_I2C=y CONFIG_SYS_I2C_RCAR_I2C=y -# CONFIG_MMC is not set +CONFIG_DM_MMC=y +CONFIG_MMC_IO_VOLTAGE=y +CONFIG_MMC_UHS_SUPPORT=y +CONFIG_MMC_HS200_SUPPORT=y +CONFIG_RENESAS_SDHI=y CONFIG_MTD=y CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH_SPANSION=y