Hi Team,
My processor RZG2N
Package using: VLP3.0.5
For building my arm trusted firmware, I have used build scripts.
I have followed the steps mentioned in the following site exactly.
https://github.com/renesas-rz/rzg2_bsp_scripts/tree/master/build_scripts
I have successfully configured the board using this command: ./build.sh s
Then I have used ./build.sh t command for building,
Then following error is appeared,
vishnu@vishnu-Latitude-3520:~/rzg2_bsp_scripts/build_scripts$ ./build.sh tcd rzg_trusted-firmware-aPATH=/opt/linaro/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin:$PATH ; export CROSS_COMPILE=aarch64-linux-gnu-make distclean REALCLEANmake -j 16 bl2 bl31 rzg PLAT=rzg LSI=G2N SPD=none RCAR_LOSSY_ENABLE=1 RCAR_RPC_HYPERFLASH_LOCKED=0 RCAR_SA6_TYPE=1 RZG_DRAM_ECC_FULL=0 LOG_LEVEL=40 MBEDTLS_DIR=../mbedtls make: *** No rule to make target '../mbedtls/library/constant_time.c', needed by '/home/vishnu/rzg2_bsp_scripts/build_scripts/rzg_trusted-firmware-a/build/rzg/release/libmbedtls/constant_time.o'. Stop.make: *** Waiting for unfinished jobs....
Please help me with this, I am getting Init DRAM error in my BL2, so i have changed the boot_init_dram_config.c file in arm trusted firmware for changing my ram configuration. So I need to build it and use the bl2 and bl31 srecord files for transferring to EMMC.
Please help me with this situation.
Thanks in advance,
Kartha.
Did you download mbedtls and put it in the same directory as rzg_trusted-firmware-a ?
https://github.com/renesas-rz/rzg2_bsp_scripts/blob/master/build_scripts/Repository%20Installs.txt
---------------------------------------------------mbed---------------------------------------------------NOTES: mbed code is needed to build Trusted Firmware-A in BSP v1.0.5+
Clone repository and check out branch: $ git clone github.com/.../mbedtls.git $ cd mbedtls $ git checkout mbedtls-2.16.3 $ cd ..
├── build_scripts │ ├── mbedtls/ <<<<<< download │ ├── renesas-u-boot-cip/ <<<<<< download │ ├── rzg2_flash_writer/ <<<<<< download │ ├── rzg_trusted-firmware-a/ <<<<<< download │ ├── rz_linux-cip/ <<<<<< download │ ├── build.sh │ ├── build_xxxx.sh │ ├── build_xxxx.sh │ ├── README.html │ └── README.md
Hi Chris,
I managed to add all the missing files in mbedtls and successfully build the aft.
And now its able to boot BL2 also with out RAM issue.
But When I entered Uboot the processor is stuck at DRAM: line
here is the log:
>INFO: ARM GICv2 driver initializedNOTICE: BL2: RZ/G2 Initial Program Loader(CA57) Rev.3.0.3NOTICE: BL2: PRR is RZ/G2N Ver.1.1NOTICE: BL2: Board is HiHope RZ/G2N Rev.2.0NOTICE: BL2: Boot device is eMMC(50MHz x8)NOTICE: BL2: DDR3200(rev.0.41)NOTICE: BL2: [COLD_BOOT]NOTICE: BL2: DRAM Split is OFFNOTICE: BL2: QoS is default setting(rev.0.09)NOTICE: BL2: DRAM refresh interval 1.95 usecNOTICE: BL2: Periodic Write DQ TrainingNOTICE: BL2: DRAM don't have ECC configurationNOTICE: BL2: CH0: 400000000 - 4ffffffff, 4 GiBNOTICE: BL2: Lossy Decomp areasNOTICE: Entry 0: DCMPAREACRAx:0x80000540 DCMPAREACRBx:0x570NOTICE: Entry 1: DCMPAREACRAx:0x40000000 DCMPAREACRBx:0x0NOTICE: Entry 2: DCMPAREACRAx:0x20000000 DCMPAREACRBx:0x0NOTICE: BL2: FDT at 0xe631fa70NOTICE: BL2: v2.7(release):v2.5/rzg2l-1.00-2008-gac8a2c2f2-dirtyNOTICE: BL2: Built : 16:59:56, Jan 4 2024NOTICE: BL2: Normal bootINFO: BL2: Doing platform setupINFO: BL2: Loading image id 3NOTICE: BL2: eMMC boot from partition 1NOTICE: BL2: Load dst=0xe631f300 src=(p:1)0x30000(384) len=0x200(1)NOTICE: BL2: Load dst=0x43f00000 src=(p:1)0x30400(386) len=0x1800(12)WARNING: r-car ignoring the BL31 size from certificate,using RCAR_TRUSTED_SRAM_SIZE insteadINFO: Loading image id=3 at address 0x44000000NOTICE: rcar_file_len: len: 0x0003e000NOTICE: BL2: Load dst=0x44000000 src=(p:1)0x40000(512) len=0x3e000(496)INFO: Image id=3 loaded: 0x44000000 - 0x4403e000INFO: BL2: Loading image id 5INFO: Loading image id=5 at address 0x50000000NOTICE: rcar_file_len: len: 0x00100000NOTICE: BL2: Load dst=0x50000000 src=(p:2)0x0(0) len=0x100000(2048)INFO: Image id=5 loaded: 0x50000000 - 0x50100000NOTICE: BL2: Booting BL31INFO: Entry point address = 0x44000000INFO: SPSR = 0x3cdVERBOSE: Argument #0 = 0xe631f560VERBOSE: Argument #1 = 0x0VERBOSE: Argument #2 = 0x0VERBOSE: Argument #3 = 0x0VERBOSE: Argument #4 = 0x0VERBOSE: Argument #5 = 0x0VERBOSE: Argument #6 = 0x0VERBOSE: Argument #7 = 0x0U-Boot 2021.10 (Sep 20 2023 - 02:21:30 +0000)CPU: Renesas Electronics R8A774B1 rev 1.1Model: HopeRun HiHope RZ/G2N with sub boardDRAM:
I Think the Uboot is now copied from EMMC to DDR and started execution (correct me if I am wrong)..
And its stuck in the same DDR.
Whether I have change the RAM configuration in uboot also, If so which file I can change it?
Using Build Script I could able to build Uboot also, at first an error poped up:
PATH=/opt/linaro/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin:/opt/linaro/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin ; export CROSS_COMPILE=aarch64-linux-gnu-cd renesas-u-boot-cip
ERROR: Default configuration file configs/r8a774b1_hihope-rzg2n_defconfig does not exist
Then I have added this file (r8a774b1_hihope-rzg2n_defconfig ) with content as blow:
CONFIG_ARM=yCONFIG_ARCH_CPU_INIT=yCONFIG_ARCH_RMOBILE=yCONFIG_SYS_TEXT_BASE=0x50000000CONFIG_ENV_SIZE=0x20000CONFIG_ENV_OFFSET=0xFFFE0000CONFIG_DM_GPIO=yCONFIG_DEFAULT_DEVICE_TREE="r8a774b1-hihope-rzg2n-u-boot"CONFIG_RCAR_GEN3=yCONFIG_TARGET_HIHOPE_RZG2=y# CONFIG_SPL is not setCONFIG_FIT=yCONFIG_SUPPORT_RAW_INITRD=yCONFIG_DEFAULT_FDT_FILE="r8a774b1-hihope-rzg2n.dtb"# CONFIG_BOARD_EARLY_INIT_F is not setCONFIG_BOARD_LATE_INIT=yCONFIG_HUSH_PARSER=yCONFIG_CMD_BOOTZ=yCONFIG_CMD_GPIO=yCONFIG_CMD_I2C=yCONFIG_CMD_MMC=yCONFIG_CMD_PART=yCONFIG_CMD_SPI=yCONFIG_CMD_USB=yCONFIG_CMD_DHCP=yCONFIG_CMD_MII=yCONFIG_CMD_PING=yCONFIG_CMD_EXT2=yCONFIG_CMD_EXT4=yCONFIG_CMD_EXT4_WRITE=yCONFIG_CMD_FAT=yCONFIG_CMD_FS_GENERIC=yCONFIG_CMD_ECC=yCONFIG_OF_CONTROL=yCONFIG_OF_LIST="r8a774a1-hihope-rzg2m-u-boot r8a774b1-hihope-rzg2n-u-boot r8a774e1-hihope-rzg2h-u-boot"CONFIG_MULTI_DTB_FIT_LZO=yCONFIG_MULTI_DTB_FIT_USER_DEFINED_AREA=yCONFIG_ENV_OVERWRITE=yCONFIG_ENV_IS_IN_MMC=yCONFIG_SYS_RELOC_GD_ENV_ADDR=yCONFIG_SYS_MMC_ENV_DEV=1CONFIG_SYS_MMC_ENV_PART=2CONFIG_VERSION_VARIABLE=yCONFIG_REGMAP=yCONFIG_SYSCON=yCONFIG_CLK=yCONFIG_CLK_RENESAS=yCONFIG_GPIO_HOG=yCONFIG_RCAR_GPIO=yCONFIG_DM_PCA953X=yCONFIG_DM_I2C=yCONFIG_SYS_I2C_RCAR_I2C=yCONFIG_SYS_I2C_RCAR_IIC=yCONFIG_MMC_IO_VOLTAGE=yCONFIG_MMC_UHS_SUPPORT=yCONFIG_MMC_HS400_SUPPORT=yCONFIG_RENESAS_SDHI=yCONFIG_DM_SPI_FLASH=yCONFIG_SPI_FLASH_WINBOND=yCONFIG_BITBANGMII=yCONFIG_PHY_REALTEK=yCONFIG_DM_ETH=yCONFIG_RENESAS_RAVB=yCONFIG_DM_REGULATOR=yCONFIG_DM_REGULATOR_FIXED=yCONFIG_DM_REGULATOR_GPIO=yCONFIG_SCIF_CONSOLE=yCONFIG_SPI=yCONFIG_DM_SPI=yCONFIG_RENESAS_RPC_SPI=yCONFIG_TEE=yCONFIG_OPTEE=yCONFIG_USB=yCONFIG_USB_XHCI_HCD=yCONFIG_USB_EHCI_HCD=yCONFIG_USB_EHCI_GENERIC=yCONFIG_USB_STORAGE=yCONFIG_OF_LIBFDT_OVERLAY=yCONFIG_WDT=yCONFIG_WDT_RENESAS=yCONFIG_CMD_WDT=yCONFIG_USB_GADGET=yCONFIG_USB_RENESAS_USBHS=yCONFIG_USB_GADGET_DOWNLOAD=yCONFIG_USB_FUNCTION_MASS_STORAGE=yCONFIG_CMD_USB_MASS_STORAGE=y
After that u boot is build and u-boot.srec file is created and I used that for loading to boot partition 2 in EMMC.
Then following log is coming and processor is stuck
INFO: ARM GICv2 driver initializedNOTICE: BL2: RZ/G2 Initial Program Loader(CA57) Rev.3.0.3NOTICE: BL2: PRR is RZ/G2N Ver.1.1NOTICE: BL2: Board is HiHope RZ/G2N Rev.2.0NOTICE: BL2: Boot device is eMMC(50MHz x8)NOTICE: BL2: DDR3200(rev.0.41)NOTICE: BL2: [COLD_BOOT]NOTICE: BL2: DRAM Split is OFFNOTICE: BL2: QoS is default setting(rev.0.09)NOTICE: BL2: DRAM refresh interval 1.95 usecNOTICE: BL2: Periodic Write DQ TrainingNOTICE: BL2: DRAM don't have ECC configurationNOTICE: BL2: CH0: 400000000 - 4ffffffff, 4 GiBNOTICE: BL2: Lossy Decomp areasNOTICE: Entry 0: DCMPAREACRAx:0x80000540 DCMPAREACRBx:0x570NOTICE: Entry 1: DCMPAREACRAx:0x40000000 DCMPAREACRBx:0x0NOTICE: Entry 2: DCMPAREACRAx:0x20000000 DCMPAREACRBx:0x0NOTICE: BL2: FDT at 0xe631fa70NOTICE: BL2: v2.7(release):v2.5/rzg2l-1.00-2008-gac8a2c2f2-dirtyNOTICE: BL2: Built : 16:59:56, Jan 4 2024NOTICE: BL2: Normal bootINFO: BL2: Doing platform setupINFO: BL2: Loading image id 3NOTICE: BL2: eMMC boot from partition 1NOTICE: BL2: Load dst=0xe631f300 src=(p:1)0x30000(384) len=0x200(1)NOTICE: BL2: Load dst=0x43f00000 src=(p:1)0x30400(386) len=0x1800(12)WARNING: r-car ignoring the BL31 size from certificate,using RCAR_TRUSTED_SRAM_SIZE insteadINFO: Loading image id=3 at address 0x44000000NOTICE: rcar_file_len: len: 0x0003e000NOTICE: BL2: Load dst=0x44000000 src=(p:1)0x40000(512) len=0x3e000(496)INFO: Image id=3 loaded: 0x44000000 - 0x4403e000INFO: BL2: Loading image id 5INFO: Loading image id=5 at address 0x50000000NOTICE: rcar_file_len: len: 0x00100000NOTICE: BL2: Load dst=0x50000000 src=(p:2)0x0(0) len=0x100000(2048)INFO: Image id=5 loaded: 0x50000000 - 0x50100000NOTICE: BL2: Booting BL31INFO: Entry point address = 0x44000000INFO: SPSR = 0x3cdVERBOSE: Argument #0 = 0xe631f560VERBOSE: Argument #1 = 0x0VERBOSE: Argument #2 = 0x0VERBOSE: Argument #3 = 0x0VERBOSE: Argument #4 = 0x0VERBOSE: Argument #5 = 0x0VERBOSE: Argument #6 = 0x0VERBOSE: Argument #7 = 0x0
Please help me solve this issue.
Thanks and regards,
https://github.com/renesas-rz/renesas-u-boot-cip/blob/d909e2230e02e0a6251dd61e9e1f4527f6745ac1/arch/arm/dts/r8a774b1-hihope-rzg2n.dts#L22
It would be wise to create your custom dts based on that though.
I Saw this place Chris,
But I don't know how to add the size here
can you please tell me how to do that.
Or show me an example.
Hi,
I have changed the dts file like this:
/ { model = "HopeRun HiHope RZ/G2N main board based on r8a774b1"; compatible = "hoperun,hihope-rzg2n", "renesas,r8a774b1";
memory@48000000 { device_type = "memory"; /* first 128MB is reserved for secure area. */ reg = <0x0 0x48000000 0x0 0x78000000>; // No change here };
memory@480000000 { device_type = "memory"; reg = <0x4 0x80000000 0x00000001 0x00000000>; // Changed here = 4GB };};
But Still the code is stuck at the same place.
Please check this and let me know a workaround.
Thanks and regards.
Kartha
The Device Tree for the RZ/G2N HiHope board was already set for 4GB.
You did not need to change it.
memory@48000000 { device_type = "memory"; /* first 128MB is reserved for secure area. */ reg = <0x0 0x48000000 0x0 0x78000000>; };
memory@480000000 { device_type = "memory"; reg = <0x4 0x80000000 0x0 0x80000000>; };};
128MB + 0x78000000 + 0x800000 = 0X100000000 (4GB)
reg = <0x0 0x48000000 0x0 0x78000000>;
This is the first 2GB of Legacy (DDR0 shadow A) (skipping over the first 128MB)
You can only map 2GB of that area. The other 2GB you have to map to the extended area
This is the 2nd half of the DDR mapped to the upper address region (DDR0)
reg = <0x4 0x80000000 0x0 0x80000000>;
I have gone through the writings.
The RAM I bought Have some problem with Rev. A, and I can only access 2 BG of data even though the RAM is 4 GB in size.
So I have some doubts,
Chris said:The only thing you have to change in u-boot for DDR is the size of the DDR in the Device Tree file.
The only thing you have to change in u-boot for DDR is the size of the DDR in the Device Tree file.
memory@48000000 { device_type = "memory"; /* first 128MB is reserved for secure area. */ reg = <0x0 0x48000000 0x0 0x38000000>; };
memory@480000000 { device_type = "memory"; reg = <0x4 0x80000000 0x00000000 0x40000000>; };};
I don't know whether this is correct or not.
Please clarify my doubts, If this RAM is not going to work with the board I need to look for another solution as soon as possible.
This is 2GB of DDR.
/{ model = "HopeRun HiHope RZ/G2N main board based on r8a774b1"; compatible = "hoperun,hihope-rzg2n", "renesas,r8a774b1"; memory@48000000 { device_type = "memory"; /* first 128MB is reserved for secure area. */ reg = <0x0 0x48000000 0x0 0x78000000>; }; };
Hi Chris
Thanks for the reply.
I have given this in my dts file (r8a774b1-hihope-rzg2n.dts)
but still stuck at DDR:
and the content of my defconfig file is shown below
I think this is correct.
This is how my dts file looks like
// SPDX-License-Identifier: GPL-2.0/* * Device Tree Source for the HiHope RZ/G2N main board Rev.3.0/4.0 * * Copyright (C) 2020 Renesas Electronics Corp. */
/dts-v1/;#include "r8a774b1.dtsi"#include "hihope-rev4.dtsi"
// memory@480000000 {// device_type = "memory";// reg = <0x4 0x80000000 0x0 0x40000000>;// };};
&du { clocks = <&cpg CPG_MOD 724>, <&cpg CPG_MOD 723>, <&cpg CPG_MOD 721>, <&versaclock5 1>, <&x302_clk>, <&versaclock5 2>; clock-names = "du.0", "du.1", "du.3", "dclkin.0", "dclkin.1", "dclkin.3";};
&sdhi3 { mmc-hs400-1_8v;};
Any Idea or workaround.
Thanks for the help
Regards,
At this point, you need to start debugging the code. You need to find the line of code that it is crashing on. Then, you can understand how to fix it.
Just changing the device tree is not going to help you.
Ok I will try that way and let you know.
I have successfully solve the issue.
The problem was with ATF, in ram configuration structure.
Now I am in u-boot shell.
I have an SD card loaded with kernel dtb and rootfs is correct partitions, which is working with my EVK board.
The same one when loaded with in the custom board and set the bootargs and bootcommand to correct location, this error is showing.
INFO: ARM GICv2 driver initializedNOTICE: BL2: RZ/G2 Initial Program Loader(CA57) Rev.3.0.3NOTICE: BL2: PRR is RZ/G2N Ver.1.1NOTICE: BL2: Board is HiHope RZ/G2N Rev.2.0NOTICE: BL2: Boot device is eMMC(50MHz x8)NOTICE: BL2: DDR3200(rev.0.41)NOTICE: BL2: [COLD_BOOT]NOTICE: BL2: DRAM Split is OFFNOTICE: BL2: QoS is default setting(rev.0.09)NOTICE: BL2: DRAM refresh interval 1.95 usecNOTICE: BL2: Periodic Write DQ TrainingNOTICE: BL2: DRAM don't have ECC configurationNOTICE: BL2: CH0: 400000000 - 4ffffffff, 4 GiBNOTICE: BL2: Lossy Decomp areasNOTICE: Entry 0: DCMPAREACRAx:0x80000540 DCMPAREACRBx:0x570NOTICE: Entry 1: DCMPAREACRAx:0x40000000 DCMPAREACRBx:0x0NOTICE: Entry 2: DCMPAREACRAx:0x20000000 DCMPAREACRBx:0x0NOTICE: BL2: FDT at 0xe631fa70NOTICE: BL2: v2.7(release):v2.5/rzg2l-1.00-2008-gac8a2c2f2-dirtyNOTICE: BL2: Built : 17:59:40, Jan 9 2024NOTICE: BL2: Normal bootINFO: BL2: Doing platform setupINFO: BL2: Loading image id 3NOTICE: BL2: eMMC boot from partition 1NOTICE: BL2: Load dst=0xe631f300 src=(p:1)0x30000(384) len=0x200(1)NOTICE: BL2: Load dst=0x43f00000 src=(p:1)0x30400(386) len=0x1800(12)WARNING: r-car ignoring the BL31 size from certificate,using RCAR_TRUSTED_SRAM_SIZE insteadINFO: Loading image id=3 at address 0x44000000NOTICE: rcar_file_len: len: 0x0003e000NOTICE: BL2: Load dst=0x44000000 src=(p:1)0x40000(512) len=0x3e000(496)INFO: Image id=3 loaded: 0x44000000 - 0x4403e000INFO: BL2: Loading image id 5INFO: Loading image id=5 at address 0x50000000NOTICE: rcar_file_len: len: 0x00100000NOTICE: BL2: Load dst=0x50000000 src=(p:2)0x0(0) len=0x100000(2048)INFO: Image id=5 loaded: 0x50000000 - 0x50100000NOTICE: BL2: Booting BL31INFO: Entry point address = 0x44000000INFO: SPSR = 0x3cdVERBOSE: Argument #0 = 0xe631f560VERBOSE: Argument #1 = 0x0VERBOSE: Argument #2 = 0x0VERBOSE: Argument #3 = 0x0VERBOSE: Argument #4 = 0x0VERBOSE: Argument #5 = 0x0VERBOSE: Argument #6 = 0x0VERBOSE: Argument #7 = 0x0
U-Boot 2021.10-gfe9d08bec2-dirty (Jan 10 2024 - 10:46:42 +0530)
CPU: Renesas Electronics R8A774B1 rev 1.1Model: HopeRun HiHope RZ/G2N with sub boardDRAM: 3.9 GiBpca953x gpio@20: Error reading output registerpca953x gpio@20: Error reading output registerpca953x gpio@20: Error reading output registerpca953x gpio@20: Error reading output registerWDT: watchdog@00000000e6020000WDT: Started with servicing (60s timeout)MMC: mmc@ee100000: 0, mmc@ee160000: 1Loading Environment from MMC... OKIn: serial@e6e88000Out: serial@e6e88000Err: serial@e6e88000U-boot WDT started!Net: Error: ethernet@e6800000 address not set.No ethernet found.
Hit any key to stop autoboot: 0 19843584 bytes read in 828 ms (22.9 MiB/s)59483 bytes read in 5 ms (11.3 MiB/s)Moving Image from 0x48080000 to 0x48200000, end=49560000## Loading ramdisk from FIT Image at 48000000 ...Bad FIT ramdisk image format! (err=-42)Ramdisk image is corrupt or invalid
The commands I have used to set the boot device as SD card is shown below
setenv bootargs root=/dev/mmcblk1p3setenv bootcmd "fatload mmc 0:1 0x48080000 Image; fatload mmc 0:1 0x48000000 Image-r8a774b1-hihope-rzg2n-ex.dtb; booti 0x48080000 – 0x48000000"saveenv
Please let me know a workaround chris.
Kartha said:booti 0x48080000 – 0x48000000
Check the character in between the two addresses.
There's a difference if an hyphen or a dash is used.
I have changed it Chris,
Now i stuck in another place
U-Boot 2021.10-gfe9d08bec2-dirty (Jan 10 2024 - 14:41:28 +0530)
Hit any key to stop autoboot: 0 19843584 bytes read in 828 ms (22.9 MiB/s)59483 bytes read in 5 ms (11.3 MiB/s)Moving Image from 0x48080000 to 0x48200000, end=49560000## Flattened Device Tree blob at 48000000 Booting using the fdt blob at 0x48000000 Using Device Tree in place at 0000000048000000, end 000000004801185aOverlap found: 0x480000000..0x4ffffffff / 0x480000000..0x4ffffffff
Starting kernel ...
The processor is stuck here..
Please help
Hello Team, I'm also facing similar issue on RZG2N with single channel 2GB DDR. How to fix it? Any suggestions/updates?
bdinfo in u-boot: what is the output?
How much RAM does it report?
It resolved. issue was in peripheral initialization. DDR config was correct.