Bootloader 的封存

Note: Qualcomm with Device Tree Blob

Posted in Qualcomm with tags , , on 2017 年 08 月 31 日 by Kun-Yi

see https://github.com/xiaolu/mkbootimg_tools/blob/master/dtbtool.txt

簡單講就是修改 Android Boot image 的 header 在加上 QCDT (Qualcomm Configuration Data Table)

然後在Bootloader 期間收集版上的硬體資訊去比較 PLATFORM/SOC/PMIC/REVISION 找到最接近的DTBs

  1) LK bootloader will obtain platform id/variant/subtype/soc rev/major ver/minor ver
     /pmic0/pmic1/pmic2/pmic3 info either from early bootloaders or via other means
  2) LK bootloader will check entries #10 for non-zero
     value (set to zero for standard boot.img).  If the
     value is non-zero, refer to page section after
     the "second stage" in the boot.img layout
  3) Check QCDT magic
  4) Check QCDT version (optional LK to handle multiple
     QCDT version)
  5) LK scans through the QCDT table to look for matching
     entry.  Search order is:
     1) msm ID exact match
     2) Platform type exact match
     3) subtype ID exact match
     4) HLOS subtype exact match
     5) Pmic0 model ID exact match
     6) Pmic1 model ID exact match
     7) Pmic2 model ID exact match
     8) Pmic3 model ID exact match
     9) foundry ID, look for exact match, if not found choose
    device tree with foundry-id(0x0)
     10) select the highest soc rev in QCDT that is
        equal to or lower than the runtime detected soc rev
     11) select the highest major&minor ver in QCDT that is
        equal to or lower than the runtime detected major ver
     12) select the highest pmic0 major&minor in QCDT that is
        equal to or lower than the runtime detected pmic0
     13) select the highest pmic1 major&minor in QCDT that is
        equal to or lower than the runtime detected pmic1
     14) select the highest pmic2 major&minor in QCDT that is
        equal to or lower than the runtime detected pmic2
     15) select the highest pmic3 major&minor in QCDT that is
        equal to or lower than the runtime detected pmic3
  6) Load the matching DTB blob to the tags addr
7) LK pass the correct DTB to the kernel

Ref.

廣告

Announce U-Boot for Kontron SAMX6I

Posted in ARM, uboot with tags , , , , on 2016 年 07 月 07 日 by Kun-Yi

bToday I have push an u-boot for support Kontron sAMX6i  iMX6Q

The version just verify on IMX6Q with 1GB configuration for booting success original Linux system

you can following the  below instructions to build up your binary to replace default bootloader

git clone https://github.com/KunYi/uboot-samx6i
cd uboot-samx6i
# setup cross compiler environments, use Yocto toolchains
source ~/yocto/toolchain/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
make distclean
make samx6i_defconfig
make -j8

Okay,  you can get u-boot.imx now, I use the below method to replace original bootloader

  1. connect UART1 to host computer and run minicom for operation u-boot commands
  2. format Micro SD for FAT, the put u-boot.imx file on the micro sdcard
  3. plug the Micro SD into slot of carrier board
  4. power on system and press any key on host to interrupt booting
  5. run the below commands for upgrade bootloader
  • mmc dev 1
  • fatload mmc 1:0 0x10800000 u-boot.imx
  • sf probe
  • sf erase 0 0xc0000
  • sf write 0x10800000 0x400 $filesize
  • reset

all complete, should be reboot from new bootloader now