Difference between revisions of "IoTGateway/BSP/Linux/iMX6/FAQ"
Line 109: | Line 109: | ||
== How To modify u-boot env in rootfs == | == How To modify u-boot env in rootfs == | ||
+ | |||
'''Just support for Winbond spi flash(JEDEC ID: 0xef:0x40:0x16)''' | '''Just support for Winbond spi flash(JEDEC ID: 0xef:0x40:0x16)''' | ||
+ | |||
*Download [[:File:imx6_fw_env.zip]] ,then run setup_env.sh | *Download [[:File:imx6_fw_env.zip]] ,then run setup_env.sh | ||
*Print env | *Print env | ||
Line 123: | Line 125: | ||
./fw_setenv [env_name] | ./fw_setenv [env_name] | ||
+ | |||
+ | |||
+ | == How To Get unique ID for iMX SOC == | ||
+ | *iMX6 | ||
+ | OTP Bank0 Word1 - containsthe first word of the UID. | ||
+ | |||
+ | OTP Bank0 Word2 - contains the second word of the UID. | ||
+ | |||
+ | We can refer to iMX6 DRM Chap46.5.10 | ||
+ | |||
+ | root@imx6dlebcrs03a1:~# cat /sys/fsl_otp/HW_OCOTP_CFG0 | ||
+ | 0xea9b8ea3 | ||
+ | root@imx6dlebcrs03a1:~# cat /sys/fsl_otp/HW_OCOTP_CFG1 | ||
+ | 0x200e11d4 | ||
+ | |||
+ | |||
+ | |||
+ | *iMX7 | ||
+ | cat /sys/fsl_otp/HW_OCOTP_TESTER0 | ||
+ | 0xac98b953 | ||
+ | cat /sys/fsl_otp/HW_OCOTP_TESTER1 | ||
+ | 0x67 | ||
+ | |||
+ | |||
+ | *iMX8M | ||
+ | root@imx8mqevk:/# cat /sys/bus/soc/devices/soc0/soc_uid | ||
+ | 180959D6F060954C | ||
== Other Features == | == Other Features == | ||
*see [[IoTGateway/Features/Linux|Linux Features]] | *see [[IoTGateway/Features/Linux|Linux Features]] |
Revision as of 08:03, 25 January 2019
Contents
- 1 Compiling
- 2 Boot Logo
- 3 SDcard image
- 4 How To Stress Test On a Linux
- 5 How to fix sata can't be detected issue
- 6 How To Create One LIV Disk Image of SD Card
- 7 How To fix "SF: Unsupported DataFlash ID 40" issue
- 8 How To modify u-boot env in rootfs
- 9 How To Get unique ID for iMX SOC
- 10 Other Features
Compiling
U-boot
Please refer to the following sections for details
Kernel
Please refer to the following sections for details
- Getting Started / Build Instructions / To build linux kernel (LBV3) (LBV5) (LBV6)
- Customization / Building & updating kernel/modules/dtb manually (LBV3) (LBV5) (LBV6)
Boot Logo
U-boot
Kernel
In Yocto Project, it is called "boot splashscreen", please refer to the each BSP's corresponding official Yocto website (list as below) for details
SDcard image
To build from prebuilt image, please refer to the following sections for details.
To build from BSP, please refer to the following sections for details.
How To Stress Test On a Linux
Perform the command as below:
stress -c 4 -i 4 -d 1 --hdd-bytes 512
How to fix sata can't be detected issue
find ahci_imx.c in kernel source code
drivers/ata/ahci_imx.c
Mark modification as below:
// else if(IS_RSB_4411) // { // sata_gen_phy_reg[0] = 0x059194f6; // sata_gen_phy_reg[1] = 0x059194f6; // sata_gen_phy_reg[2] = 0x059194f6; //}
This modification are sata si test value, but it may result in some sata disk can't be detected
How To Create One LIV Disk Image of SD Card
The LIV disk image of SD card is used to boot target device up and to install the entire system to on-baord eMMC.
- Prerequisites
- one free loop device
- prewritten script, mksd-linux.sh (extracted from mksd-linux.sh.gz)
- the built sdcard image (LBV3) (LBV5) (LBV6) (e.g. fsl-image-qt5-imx6qrsb4410a1.sdcard)
- 5GB more available disk space for LIV disk image (e.g. 4410A1LIV6000.img & 4410A1LIV6000.img.gz)
- Commands
$ LODEV=$(sudo losetup -f)
$ MKSD=mksd-linux.sh
$ gunzip -c mksd-linux.sh.gz > ${MKSD}
$ SDCARD=fsl-image-qt5-imx6qrsb4410a1.sdcard
$ LIV=4410A1LIV6000.img
$ cp ${SDCARD} ${LIV}
$ dd if=/dev/zero of=${LIV} bs=1M seek=3700 count=0
$ echo -e "d\n2\nn\np\n2\n24576\n\nw" | sudo fdisk -u ${LIV}
$ sudo losetup -o $((24576*512)) ${LODEV} ${LIV}
$ sudo e2fsck ${LODEV}
$ sudo resize2fs ${LODEV}
$ mkdir -p ~/mnt
$ sudo mount ${LODEV} ~/mnt
$ sudo mkdir ~/mnt/{mk_inand,image}
$ sudo cp ${MKSD} ~/mnt/mk_inand/
$ sudo chmod +x ~/mnt/mk_inand/${MKSD}
$ sudo cp ${SDCARD} ~/mnt/image/
$ sudo umount ~/mnt
$ sudo losetup -d ${LODEV}
$ gzip -c9 ${LIV} > ${LIV}.gz
How To fix "SF: Unsupported DataFlash ID 40" issue
Because we will change new spi flash on new version of the hardware, if you still use the old version u-boot, it can't be recognized.
We remove the compare spi flash id mechanism in the spi flash driver.
So we can use the patch file as belowand recompile it ,then replace the u-boot binary file in our image.
File:0001-Remove-compare-spi-flash-id-mechanism.patch
How To modify u-boot env in rootfs
Just support for Winbond spi flash(JEDEC ID: 0xef:0x40:0x16)
- Download File:imx6_fw_env.zip ,then run setup_env.sh
- Print env
./fw_printenv //print all env ./fw_printenv [env_name] //print specific env
- Set env
./fw_setenv [env_name] [value] //set new env
- Delete env
./fw_setenv [env_name]
How To Get unique ID for iMX SOC
- iMX6
OTP Bank0 Word1 - containsthe first word of the UID.
OTP Bank0 Word2 - contains the second word of the UID.
We can refer to iMX6 DRM Chap46.5.10
root@imx6dlebcrs03a1:~# cat /sys/fsl_otp/HW_OCOTP_CFG0 0xea9b8ea3 root@imx6dlebcrs03a1:~# cat /sys/fsl_otp/HW_OCOTP_CFG1 0x200e11d4
- iMX7
cat /sys/fsl_otp/HW_OCOTP_TESTER0 0xac98b953 cat /sys/fsl_otp/HW_OCOTP_TESTER1 0x67
- iMX8M
root@imx8mqevk:/# cat /sys/bus/soc/devices/soc0/soc_uid 180959D6F060954C
Other Features
- see Linux Features