How to store file/folder in EMMC flash of LS1046ARDB Kit and how to access it on next power on?
Please refer to the following procedure to write file to MMC card in Linux.
Partition the mmc card with fdisk
$ fdisk /dev/mmcblk0
$ fdisk -l /dev/mmcblk0
$ mkfs.ext2 /dev/mmcblk0p1
$ mount /dev/mmcblk0p1 /mnt/
$ cp -r test_file /mnt/
Please note you could use scp command to copy your file to the target board.
Please refer to the following to access file in MMC under u-boot.
=> ext2load <interface> [<dev[:part]> [<addr> [<filename> [bytes [pos]]]]]
For example:
=> ext2load mmc 0:1 0xa0000000 test_file
Thank you for the reply. But I couldn't access mmcblk0. No such file or directory was coming when i gave fdisk /dev/mmcblk0 command.
Please run "fdisk -l" on your target board.
You need to use RCW with emmc enabled.
Please specify rcw_qspi as the following to enable emmc in RCW file in configs/board/ls1043ardb/manifest in flex-builder.
rcw_qspi=$FBOUTDIR/firmware/rcw/ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1600_qspiboot_emmc.bin.swapped
Then run the following command "flex-builder -c atf -m ls1046ardb", you will regenerate flexbuild_lsdk2004/build/firmware/atf/ls1046ardb/bl2_qspi.pbl and fip_uboot.bin.
Please deploy them to bl2_qspi.pbl at 0x00000000, bl2_qspi.pbl at 0x100000 on QSPI flash.
Then go to u-boot prompt to check whether it is is possible to get MMC information as the following.
> mmcinfo
Device: FSL_SDHC
Manufacturer ID: fe
OEM: 14e
Name: P1XXX
Bus Speed: 52000000
Mode : MMC High Speed (52MHz)
Rd Block Len: 512
MMC version 4.5
High Capacity: Yes
Capacity: 3.6 GiB
Bus Width: 4-bit
Erase Group Size: 512 KiB
HC WP Group Size: 4 MiB
User Capacity: 3.6 GiB
Boot Capacity: 2 MiB ENH
RPMB Capacity: 128 KiB ENH
Please check whether you could get the following message in Linux Kernel booting up log.
mmcblk0: mmc0:0001 P1XXXX 3.60 GiB
[ 3.685716] NET: Registered protocol family 10
[ 3.690555] mmcblk0boot0: mmc0:0001 P1XXXX partition 1 2.00 MiB
[ 3.695092] Segment Routing with IPv6
[ 3.700942] mmcblk0boot1: mmc0:0001 P1XXXX partition 2 2.00 MiB
[ 3.704255] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 3.710211] mmcblk0rpmb: mmc0:0001 P1XXXX partition 3 128 KiB, chardev (235:0)
[ 3.716269] NET: Registered protocol family 17
Thanks,
Yiping
In file flexbuild_lsdk2004/configs/board/ls1046ardb/manifest, please modify rcw_qspi as the following.
rcw_qspi=$FBOUTDIR/firmware/rcw/ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1600_qspiboot_emmc.bin
Then rebuild atf with the following command
$ flex-builder -c atf -m ls1046ardb
You will get bl2_qspi.pbl and fip_uboot.bin in build/firmware/atf/ls1046ardb/ .
Please refer to the following command to deploy these two files to QSPI flash bank4.
Please go to QSPI vBank 0 and execute the following commands.
=> sf probe 0:1
=> tftp 0xa0000000 bl2_qspi.pbl
=> sf erase 0x0 +$filesize && sf write 0xa0000000 0x0 $filesize
=> tftp 0xa0000000 fip_uboot.bin
=> sf erase 0x100000 +$filesize && sf write 0xa0000000 0x100000 $filesize
Then execute the following command to go to bank4.
=> cpld reset altbank
I tried this but still issue remains the same. No mmc card present is coming
I have verified my previously procedure, it works.
I attached my images for you.
Please refer to the following u-boot log.
=> cpld reset altbank
NOTICE: UDIMM 18ASF1G72AZ-2G3B1
NOTICE: 8 GB DDR4, 64-bit, CL=15, ECC on, CS0+CS1
NOTICE: BL2: v1.5(release):LSDK-20.04
NOTICE: BL2: Built : 14:07:13, Nov 19 2020
NOTICE: BL31: v1.5(release):LSDK-20.04
NOTICE: BL31: Built : 14:07:40, Nov 19 2020
NOTICE: Welcome to LS1046 BL31 Phase
U-Boot 2019.10-dirty (Nov 06 2020 - 10:15:29 +0800)
SoC: LS1046AE Rev1.0 (0x87070010)
Clock Configuration:
CPU0(A72):1600 MHz CPU1(A72):1600 MHz CPU2(A72):1600 MHz
CPU3(A72):1600 MHz
Bus: 600 MHz DDR: 2100 MT/s FMAN: 700 MHz
Reset Configuration Word (RCW):
00000000: 0c150010 0e000000 00000000 00000000
00000010: 11335559 40005012 40025000 c1000000
00000020: 00000000 00000000 00000000 00238800
00000030: 20124000 00003000 00000096 00000001
Model: LS1046A RDB Board
Board: LS1046ARDB, boot from QSPI vBank 4
CPLD: V2.3
PCBA: V2.0
SERDES Reference Clocks:
SD1_CLK1 = 156.25MHZ, SD1_CLK2 = 100.00MHZ
DRAM: 7.9 GiB (DDR4, 64-bit, CL=15, ECC on)
DDR Chip-Select Interleaving Mode: CS0+CS1
SEC0: RNG instantiated
Using SERDES1 Protocol: 4403 (0x1133)
Using SERDES2 Protocol: 21849 (0x5559)
NAND: 512 MiB
MMC: FSL_SDHC: 0
Loading Environment from SPI Flash... SF: Detected s25fl512s with page size 256 Bytes, erase size 256 KiB, total 64 MiB
OK
EEPROM: NXID v1
In: serial
Out: serial
Err: serial
Net: SF: Detected s25fl512s with page size 256 Bytes, erase size 256 KiB, total 64 MiB
Fman1: Uploading microcode version 106.4.18
PCIe0: pcie@3400000 Root Complex: no link
PCIe1: pcie@3500000 Root Complex: no link
PCIe2: pcie@3600000 Root Complex: x1 gen1
e1000: 68:05:ca:0f:31:83
FM1@DTSEC3, FM1@DTSEC4, FM1@DTSEC5, FM1@DTSEC6, FM1@TGEC1, FM1@TGEC2, e1000#0 [PRIME]
Warning: e1000#0 MAC addresses don't match:
Address in SROM is 68:05:ca:0f:31:83
Address in environment is 00:e0:0c:00:69:06
If your problem remains, please provide u-boot log on your target board.
Have you noticed that the images which you are using is built on Apr 9 2020?
You could use images which I sent to you.
OTICE: 16 GB DDR4, 64-bit, CL=15, ECC on, CS0+CS1
NOTICE: BL2: v1.5(release):LSDK-20.04
NOTICE: BL2: Built : 05:19:45, Apr 9 2020
NOTICE: BL2: Booting BL31
NOTICE: BL31: v1.5(release):LSDK-20.04
NOTICE: BL31: Built : 05:26:59, Apr 9 2020
NOTICE: Welcome to LS1046 BL31 Phase
U-Boot 2019.10-g3cd9bc3993 (Apr 09 2020 - 05:25:58 +0800)
I have used the files sent by you .But it is not getting updated.Even for the files which i have created also same issue.Is there anything wrong with the way i am flashing it to the qspi?
First please go to QSPI vBank0
Then execute the following commands.
=> sf probe 0:1
=> tftp 0xa0000000 bl2_qspi.pbl
=> sf erase 0x0 +$filesize && sf write 0xa0000000 0x0 $filesize
=> tftp 0xa0000000 fip_uboot.bin
=> sf erase 0x100000 +$filesize && sf write 0xa0000000 0x100000 $filesize
Then execute the following command to go to bank4.
=> cpld reset altbank
Note: you could get vbank information from u-boot console log.
If your problem remains, please capture your console log to me to do more investigation.
Thank you so much for the reply. It worked. I was doing from bank4 .So it was not getting updated. I could write files to emmc flash also. "sync" command i gave after cp -r to write to emmc flash. How to erase files in emmc and how to format emmc flash ?
You could format emmc in Linux as the following.
$ fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 7.5 GiB, 8001683456 bytes, 15628288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x5a5f34b3
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 2048 15628287 15626240 7.5G 83 Linux
$ mkfs.ext2 /dev/mmcblk0p1
Thank you for the reply. But if i want to delete a single folder without formatting emmc what is the command i should use?
Under Linux, execute the following command
$ mount -t ext2 /dev/mmcblk0p1 /mnt
go to /mnt folder to remove the specified folder.
$ umount /mnt