20170925_jeffrey - silenceuncrio/diary GitHub Wiki

0835

review

0900

工作電腦因為 window 更新自動重開機了

先用 VirtualBox 把 m300 這虛擬機器 叫起來

再用 docker 把 m300 這 container 叫起來

➜  ~ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                          PO
RTS               NAMES
2f192722794e        m300                "/bin/bash"         4 months ago        Exited (1) About a minute ago
                  fervent_keller
➜  ~ docker start 2f192722794e
2f192722794e
➜  ~ docker attach 2f192722794e
root@2f192722794e:~#
root@2f192722794e:~# su build
build@2f192722794e:/root$ cd /var/m300/
build@2f192722794e:/var/m300$ ls
M30x-ReleaseNotes.txt           README-IMXBSP  conf                  pre-commit.hook  scripts
M30x-ReleaseNotes_Azuretec.txt  README.md      downloads             proenv.sh        setup-environment
M30x-ReleaseNotes_Planet.txt    build.sh       fsl-setup-release.sh  proscend         sources
README                          build_small    meta-proscend         prosrc-bin.sh

將 emmc 所需的 compile 環境初始化

source proenv m300e proscend-m300e

重新 compile 一份 u-boot-imx

bitbake u-boot-imx -c clean
bitbake u-boot-imx -c compile -vf

u-boot-imx 的 工作目錄 - build_small/tmp/work/m300e-poky-linux-gnueabi/u-boot-imx/2015.04-r0/git

得到 mx6ul_14x14_evk_config/u-boot.imx

0915

u-boot.imx 另存成 u-boot-m300e.imx-emmc

放到 D:\m300\tools\L4.1.15_1.0.0_ga-mfg-tools\mfgtools\Profiles\Linux\OS Firmware\firmware

修改 D:\m300\tools\L4.1.15_1.0.0_ga-mfg-tools\mfgtools\Profiles\Linux\OS Firmware\ucl2.xml

  <LIST name="SDCard" desc="Choose SD Card as media">

  <CMD state="BootStrap" type="boot" 
    body="BootStrap" file ="firmware/u-boot-m300e.imx-emmc">Loading U-boot</CMD>
  <CMD state="BootStrap" type="load" 
    file="firmware/zImage" address="0x80800000"
    loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE">Loading Kernel.</CMD>
  <CMD state="BootStrap" type="load" 
    file="firmware/%initramfs%" address="0x83800000"
    loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE">Loading Initramfs.</CMD>
  <CMD state="BootStrap" type="load" 
    file="firmware/zImage-imx6ul-14x14-ddr3-arm2.dtb" address="0x83000000"
    loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" >Loading device tree.</CMD>
  <CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>

  <CMD state="Updater" type="push" 
    body="$ ls /dev "> Partitioning...</CMD>

  <!-- create partition -->
  <CMD state="Updater" type="push" 
    body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>
  <CMD state="Updater" type="push" 
    body="$ tar xf $FILE "> Partitioning...</CMD>
  <CMD state="Updater" type="push" 
    body="$ sh mksdcard.sh /dev/mmcblk%mmc%"> Partitioning...</CMD>

  <CMD state="Updater" type="push" 
    body="$ echo Update Complete!">Done</CMD>

  </LIST>

  <CMD state="BootStrap" type="boot" 
    body="BootStrap" file ="firmware/u-boot-m300.imx-nand">Loading U-boot</CMD>

改成

  <CMD state="BootStrap" type="boot" 
    body="BootStrap" file ="firmware/u-boot-m300e.imx-emmc">Loading U-boot</CMD>

0925

馬上用 MfgTool 試試

U-Boot 2015.04imx_v2015.04_4.1.15_1.2.0_ga+gede7538 (Sep 25 2017 - 01:12:24)

CPU:   Freescale i.MX6UL rev1.2 at 396 MHz
CPU:   Temperature 43 C
Reset cause: POR
Board: MX6UL 14x14 EVK
I2C:   ready
DRAM:  512 MiB
force_idle_bus: sda=0 scl=0 sda.gp=0x1d scl.gp=0x1c
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

Display: TFT43AB (480x272)
Video: 480x272x24
In:    serial
Out:   serial
Err:   serial
MMC: no card present
Net:   FEC1
Error: FEC1 address not set.

Boot from USB for mfgtools
Use default environment for                              mfgtools
Run bootcmd_mfg: run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};
Hit any key to stop autoboot:  0
Kernel image @ 0x80800000 [ 0x000000 - 0x552a48 ]
## Loading init Ramdisk from Legacy Image at 83800000 ...
   Image Name:   fsl-image-mfgtool-initramfs-imx6
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7542315 Bytes = 7.2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 83000000
   Booting using the fdt blob at 0x83000000
   Using Device Tree in place at 83000000, end 8300b866
Modify /soc/aips-bus@02000000/bee@02044000:status disabled
ft_system_setup for mx6

Starting kernel ...

UTP: received command '$ ls /dev '
UTP: executing "ls /dev "
autofs           mem                 ram2    tty14  tty31  tty49  tty9
console          memory_bandwidth    ram3    tty15  tty32  tty5   ttymxc0
cpu_dma_latency  network_latency     ram4    tty16  tty33  tty50  ttymxc1
dri              network_throughput  ram5    tty17  tty34  tty51  ubi_ctrl
full             null                ram6    tty18  tty35  tty52  urandom
fuse             pps0                ram7    tty19  tty36  tty53  utp
hwrng            pps1                ram8    tty2   tty37  tty54  vcs
i2c-0            ptmx                ram9    tty20  tty38  tty55  vcs1
input            ptp0                random  tty21  tty39  tty56  vcsa
kmsg             ptp1                rfkill  tty22  tty4   tty57  vcsa1
loop-control     pxp_device          rtc0    tty23  tty40  tty58  video0
loop0            ram0                snd     tty24  tty41  tty59  watchdog
loop1            ram1                tty     tty25  tty42  tty6   watchdog0
loop2            ram10               tty0    tty26  tty43  tty60  zero
loop3            ram11               tty1    tty27  tty44  tty61
loop4            ram12               tty10   tty28  tty45  tty62
loop5            ram13               tty11   tty29  tty46  tty63
loop6            ram14               tty12   tty3   tty47  tty7
loop7            ram15               tty13   tty30  tty48  tty8
UTP: sending Success to kernel for command $ ls /dev .
utp_poll: pass returned.
UTP: received command 'send'
UTP: sending Success to kernel for command send.
UTP: received command '$ tar xf $FILE '
UTP: executing "tar xf $FILE "
UTP: sending Success to kernel for command $ tar xf $FILE .
utp_poll: pass returned.
UTP: received command '$ sh mksdcard.sh /dev/mmcblk1'
UTP: executing "sh mksdcard.sh /dev/mmcblk1"
“wait for /dev/mmcblk1 appear”
“wait for /dev/mmcblk1 appear”
“wait for /dev/mmcblk1 appear”
“wait for /dev/mmcblk1 appear”
...

雖然跟上禮拜五有點不同

但還是得到相同的結果

1020

如果是用之前的板子放一片 SD 卡的話



U-Boot 2015.04imx_v2015.04_4.1.15_1.2.0_ga+gede7538 (Sep 25 2017 - 01:12:24)

CPU:   Freescale i.MX6UL rev1.1 at 396 MHz
CPU:   Temperature 44 C
Reset cause: POR
Board: MX6UL 14x14 EVK
I2C:   ready
DRAM:  512 MiB
force_idle_bus: sda=0 scl=0 sda.gp=0x1d scl.gp=0x1c
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

Display: TFT43AB (480x272)
Video: 480x272x24
In:    serial
Out:   serial
Err:   serial
switch to partitions #0, OK
mmc1 is current device
Net:   FEC1
Error: FEC1 address not set.

Boot from USB for mfgtools
Use default environment for                              mfgtools
Run bootcmd_mfg: run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};
Hit any key to stop autoboot:  0
Kernel image @ 0x80800000 [ 0x000000 - 0x552a48 ]
## Loading init Ramdisk from Legacy Image at 83800000 ...
   Image Name:   fsl-image-mfgtool-initramfs-imx6
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7542315 Bytes = 7.2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 83000000
   Booting using the fdt blob at 0x83000000
   Using Device Tree in place at 83000000, end 8300b866
Modify /soc/aips-bus@02000000/bee@02044000:status disabled
ft_system_setup for mx6

Starting kernel ...

mmc 顯示如下

switch to partitions #0, OK
mmc1 is current device

若是安富麗的 demo board 的話

U-Boot 2015.04-14360-gc23d370 (Feb 25 2016 - 18:08:54)

CPU:   Freescale i.MX6UL rev1.0 at 396 MHz
CPU:   Temperature 33 C
Reset cause: POR
Board: MX6UL 14x14 EVK
I2C:   ready
DRAM:  512 MiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

Display: TFT43AB (480x272)
Video: 480x272x24
In:    serial
Out:   serial
Err:   serial
switch to partitions #0, OK
mmc1(part 0) is current device
Net:   FEC1
Error: FEC1 address not set.

Normal Boot
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc1(part 0) is current device
switch to partitions #0, OK
mmc1(part 0) is current device
reading boot.scr
** Unable to read file boot.scr **
reading zImage
6037592 bytes read in 150 ms (38.4 MiB/s)
Booting from mmc ...
reading imx6ul-14x14-evk.dtb
34342 bytes read in 18 ms (1.8 MiB/s)
Kernel image @ 0x80800000 [ 0x000000 - 0x5c2058 ]
## Flattened Device Tree blob at 83000000
   Booting using the fdt blob at 0x83000000
   Using Device Tree in place at 83000000, end 8300b625

Starting kernel ...

mmc 顯示如下

switch to partitions #0, OK
mmc1(part 0) is current device

1030

參考 NXP 論壇的 MMC: no card present custom IMX6 UL Board

這裡說到要上一個 patch - [PATCH] u-boot: add pf3000 support on imx6ul-14x14-evk board

不過這個 patch 是為了 NXP 的 evk

應該不是我現在遇到的問題

1300

把上禮拜玩的 MfgTool 另存成 D:\m300\tools\L4.1.15_1.0.0_ga-mfg-tools\mfgtools_test1

另外再解壓縮一份官方的到 D:\m300\tools\L4.1.15_1.0.0_ga-mfg-tools\mfgtools_test2

修改 ucl2.xml - 只燒錄 uboot

<UCL>
  <CFG>
    <STATE name="BootStrap" dev="MX6SL" vid="15A2" pid="0063"/>
    <STATE name="BootStrap" dev="MX6D" vid="15A2" pid="0061"/>
    <STATE name="BootStrap" dev="MX6Q" vid="15A2" pid="0054"/>
    <STATE name="BootStrap" dev="MX6SX" vid="15A2" pid="0071"/>
    <STATE name="BootStrap" dev="MX6UL" vid="15A2" pid="007D"/>
    <STATE name="BootStrap" dev="MX7D" vid="15A2" pid="0076"/>
    <STATE name="Updater"   dev="MSC" vid="066F" pid="37FF"/>
  </CFG>

  

  <LIST name="SDCard" desc="Choose SD Card as media">
	<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-imx6ul%6uluboot%_sd.imx" ifdev="MX6UL">Loading U-boot</CMD>
		
	<CMD state="BootStrap" type="load" file="firmware/zImage" address="0x80800000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Kernel.</CMD>

	<CMD state="BootStrap" type="load" file="firmware/%initramfs%" address="0x83800000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Initramfs.</CMD>

	<CMD state="BootStrap" type="load" file="firmware/zImage-imx6ul-%6uldtb%%ldo%.dtb" address="0x83000000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6UL">Loading device tree.</CMD>


	<CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>


	<!-- create partition -->
	<CMD state="Updater" type="push" body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>
	<CMD state="Updater" type="push" body="$ tar xf $FILE "> Partitioning...</CMD>
	<CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk%mmc%"> Partitioning...</CMD>

	<!-- burn uboot -->
	<CMD state="Updater" type="push" body="send" file="files/u-boot-imx6q%plus%%board%_sd.imx" ifdev="MX6Q">Sending u-boot.bin</CMD>
	<CMD state="Updater" type="push" body="send" file="files/u-boot-imx6dl%board%_sd.imx" ifdev="MX6D">Sending u-boot.bin</CMD>
	<CMD state="Updater" type="push" body="send" file="files/u-boot-imx6slevk_sd.imx" ifdev="MX6SL">Sending u-boot.bin</CMD>
	<CMD state="Updater" type="push" body="send" file="files/u-boot-imx6sx%sxuboot%_sd.imx" ifdev="MX6SX">Sending u-boot.bin</CMD>
	<CMD state="Updater" type="push" body="send" file="files/u-boot-imx7d%7duboot%_sd.imx" ifdev="MX7D">Sending u-boot.bin</CMD>
	<CMD state="Updater" type="push" body="send" file="files/u-boot-imx6ul%6uluboot%_sd.imx" ifdev="MX6UL">Sending u-boot.bin</CMD>

	<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=384 conv=fsync count=129">clear u-boot arg</CMD>
	<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc% bs=1k seek=1 conv=fsync">write u-boot.bin to sd card</CMD>

	<CMD state="Updater" type="push" body="$ while [ ! -e /dev/mmcblk%mmc%p1 ]; do sleep 1; echo \"waiting...\"; done ">Waiting for the partition ready</CMD>
	<CMD state="Updater" type="push" body="$ mkfs.vfat /dev/mmcblk%mmc%p1">Formatting rootfs partition</CMD>
	<CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk%mmc%p1"/>
	<CMD state="Updater" type="push" body="$ mount -t vfat /dev/mmcblk%mmc%p1 /mnt/mmcblk%mmc%p1"/>



	<CMD state="Updater" type="push" body="$ umount /mnt/mmcblk%mmc%p1">Unmounting vfat partition</CMD>

	<CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>
  </LIST>

</UCL>

執行 mfgtool2-yocto-mx-evk-sdcard-sd2.vbs

從 console 可以看到燒錄成功了

U-Boot 2015.04-imx_v2015.04_4.1.15_1.0.0_ga+g384e1c1 (Mar 13 2016 - 17:39:55)

CPU:   Freescale i.MX6UL rev1.2 at 396 MHz
CPU:   Temperature 44 C
Reset cause: POR
Board: MX6UL 14x14 EVK
I2C:   ready
DRAM:  512 MiB
force_idle_bus: sda=0 scl=0 sda.gp=0x1d scl.gp=0x1c
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

Display: TFT43AB (480x272)
Video: 480x272x24
In:    serial
Out:   serial
Err:   serial
MMC: no card present
Net:   FEC1
Error: FEC1 address not set.

Boot from USB for mfgtools
Use default environment for                              mfgtools
Run bootcmd_mfg: run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};
Hit any key to stop autoboot:  0
Kernel image @ 0x80800000 [ 0x000000 - 0x552a48 ]
## Loading init Ramdisk from Legacy Image at 83800000 ...
   Image Name:   fsl-image-mfgtool-initramfs-imx6
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7565864 Bytes = 7.2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 83000000
   Booting using the fdt blob at 0x83000000
   Using Device Tree in place at 83000000, end 8300b7c9
Modify /soc/aips-bus@02000000/bee@02044000:status disabled
ft_system_setup for mx6

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.1.15-1.0.0-mfgtool+g3924425 (bamboo@shlinux12) (gcc version 5.2.0 (GCC) ) #1 SMP PREEMPT Sun Mar 13 17:19:17 CST 2016
CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: Freescale i.MX6 UltraLite 14x14 EVK Board
cma: Reserved 320 MiB at 0x8c000000
Memory policy: Data cache writealloc
PERCPU: Embedded 12 pages/cpu @8bb32000 s16768 r8192 d24192 u49152
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: console=ttymxc0,115200 rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.file=/fat g_mass_storage.ro=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber= clk_ignore_unused
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 173408K/524288K available (6895K kernel code, 319K rwdata, 2412K rodata, 388K init, 423K bss, 23200K reserved, 327680K cma-reserved, 0K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xa0800000 - 0xff000000   (1512 MB)
    lowmem  : 0x80000000 - 0xa0000000   ( 512 MB)
    pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)
    modules : 0x7f000000 - 0x7fe00000   (  14 MB)
      .text : 0x80008000 - 0x8091ef88   (9308 kB)
      .init : 0x8091f000 - 0x80980000   ( 388 kB)
      .data : 0x80980000 - 0x809cff00   ( 320 kB)
       .bss : 0x809d2000 - 0x80a3bf14   ( 424 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptible hierarchical RCU implementation.
        Additional per-CPU info printed with stalls.
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
NR_IRQS:16 nr_irqs:16 16
mxc_clocksource_init 24000000
Switching to timer-based delay loop, resolution 41ns
sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
clocksource mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
/cpus/cpu@0 missing clock-frequency property
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x80008280 - 0x800082f0
Brought up 1 CPUs
SMP: Total of 1 processors activated (48.00 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
device-tree: Duplicate name in lcdif@021c8000, renamed to "display#1"
VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 8 bytes.
imx6ul-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver
mxs-dma 1804000.dma-apbh: initialized
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c i2c-0: IMX I2C adapter registered
i2c i2c-0: can't use DMA
i2c i2c-1: IMX I2C adapter registered
i2c i2c-1: can't use DMA
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>
PTP clock support registered
Advanced Linux Sound Architecture Driver Initialized.
Switched to clocksource mxc_timer1
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 7392K (83800000 - 83f38000)
imx rpmsg driver is registered.
Bus freq driver module loaded
futex hash table entries: 256 (order: 2, 16384 bytes)
VFS: Disk quotas dquot_6.6.0
VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
jffs2: version 2.2. (NAND) c 2001-2006 Red Hat, Inc.
fuse init (API version 7.23)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
imx-weim 21b8000.weim: Driver registered.
backlight supply power not found, using dummy regulator
21c8000.lcdif supply lcd not found, using dummy regulator
mxsfb 21c8000.lcdif: failed to find mxc display driver
Console: switching to colour frame buffer device 60x34
mxsfb 21c8000.lcdif: initialized
imx-sdma 20ec000.sdma: no event needs to be remapped
imx-sdma 20ec000.sdma: loaded firmware 3.3
imx-sdma 20ec000.sdma: initialized
2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 19, base_baud = 5000000) is a IMX
console [ttymxc0] enabled
21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 235, base_baud = 5000000) is a IMX
imx sema4 driver is registered.
[drm] Initialized drm 1.1.0 20060810
[drm] Initialized vivante 1.0.0 20120216 on minor 0
brd: module loaded
loop: module loaded
fsl-quadspi 21e0000.qspi: unrecognized JEDEC id bytes: ff, ff, ff
fsl-quadspi 21e0000.qspi: Freescale QuadSPI probe failed
20b4000.ethernet supply phy not found, using dummy regulator
pps pps0: new PPS source ptp0
fec 20b4000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00
fec 20b4000.ethernet (unnamed net_device) (uninitialized): Using random MAC address: 22:53:5a:a1:de:c4
libphy: fec_enet_mii_bus: probed
fec 20b4000.ethernet eth0: registered PHC device 0
2188000.ethernet supply phy not found, using dummy regulator
pps pps1: new PPS source ptp1
fec 2188000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00
fec 2188000.ethernet (unnamed net_device) (uninitialized): Using random MAC address: 9a:ce:ec:ff:ad:2c
fec 2188000.ethernet eth1: registered PHC device 1
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-mxc: Freescale On-Chip EHCI Host driver
usbcore: registered new interface driver usb-storage
2184800.usbmisc supply vbus-wakeup not found, using dummy regulator
2184000.usb supply vbus not found, using dummy regulator
2184200.usb supply vbus not found, using dummy regulator
ci_hdrc ci_hdrc.1: EHCI Host Controller
ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Mass Storage Function, version: 2009/09/11
LUN: removable file: (no medium)
LUN: removable read only file: /fat
Number of LUNs=1
Number of LUNs=1
g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11
g_mass_storage gadget: g_mass_storage ready
mousedev: PS/2 mouse device common for all mice
input: 20cc000.snvs:snvs-powerkey as /devices/platform/soc/2000000.aips-bus/20cc000.snvs/20cc000.snvs:snvs-powerkey/input/input0
input: iMX6UL TouchScreen Controller as /devices/platform/soc/2000000.aips-bus/2040000.tsc/input/input1
snvs_rtc 20cc000.snvs:snvs-rtc-lp: rtc core: registered 20cc000.snvs:snvs-r as rtc0
i2c /dev entries driver
IR NEC protocol handler initialized
IR RC5(x/sz) protocol handler initialized
IR RC6 protocol handler initialized
IR JVC protocol handler initialized
IR Sony protocol handler initialized
IR SANYO protocol handler initialized
IR Sharp protocol handler initialized
IR MCE Keyboard/mouse protocol handler initialized
IR XMP protocol handler initialized
pxp-v4l2 pxp_v4l2: initialized
imx2-wdt 20bc000.wdog: use WDOG_B to reboot.
imx2-wdt 20bc000.wdog: timeout 60 sec (nowayout=0)
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
/soc/aips-bus@02100000/usdhc@02190000: voltage-ranges unspecified
sdhci-esdhc-imx 2190000.usdhc: Got CD GPIO
sdhci-esdhc-imx 2190000.usdhc: No vqmmc regulator found
g_mass_storage gadget: high-speed config #1: Linux File-Backed Storage
mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc] using ADMA
/soc/aips-bus@02100000/usdhc@02194000: voltage-ranges unspecified
sdhci-esdhc-imx 2194000.usdhc: No vmmc regulator found
sdhci-esdhc-imx 2194000.usdhc: No vqmmc regulator found
mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
usb 1-1: new high-speed USB device number 2 using ci_hdrc
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
Key type dns_resolver registered
cpu cpu0: dev_pm_opp_get_opp_count: device OPP not found (-19)
Registering SWP/SWPB emulation handler
snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01 00:00:00 UTC (0)
can-3v3: disabling
clk: Not disabling unused clocks
ALSA device list:
  No soundcards found.
Freeing unused kernel memory: 388K (8091f000 - 80980000)
Starting UTP
uuc 0.5 [built Mar 12 2016 19:04:20]
UTP: Waiting for device to appear
UTP: file/device node /dev/utp already exists
cpu_id is 0
UTP: received command 'send'
UTP: sending Success to kernel for command send.
UTP: received command '$ tar xf $mmc1: MAN_BKOPS_EN bit is not set
FILE '
UTP: executing "tar xf $FILE "
UTP: sending Success to kernel for command $ tar xf $FILE .
mmc1: new DDR MMC card at address 0001
mmcblk1: mmc1:0001 Q2J54A 3.58 GiB
mmcblk1boot0: mmc1:0001 Q2J54A partition 1 16.0 MiB
mmcblk1boot1: mmc1:0001 Q2J54A partition 2 16.0 MiB
mmcblk1rpmb: mmc1:0001 Q2J54A partition 3 512 KiB
 mmcblk1: p1 p2
utp_poll: pass returned.
UTP: received command '$ sh mksdcard.sh /dev/mmcblk1'
UTP: executing "sh mksdcard.sh /dev/mmcblk1"
1+0 records in
1+0 records out
1024 bytes (1.0 kB) copied, 0.0919393 s, 11.1 kB/s
Checking that no-one is using thirandom: sfdisk urandom read with 13 bits of entropy available
s disk right now ... OK

Disk /dev/mmcblk1: 3.6 GiB, 385037 mmcblk1: p1 p2
1072 bytes, 7520256 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

>>> Created a new DOS disklabel with disk identifier 0x5cc486b3.
Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 500 MiB.
/dev/mmcblk1p2: Created a new partition 2 of type 'Linux' and of size 3 GiB.
/dev/mmcblk1p3:
New situation:

Device         Boot   Start     End Sectors  Size Id Type
/dev/mmcblk1p1        20480 1044479 1024000  500M  c W95 FAT32 (LBA)
/dev/mmcblk1p2      1228800 7520255 6291456   utp_poll: pass returned.
 3G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
UTP: sending Success to kernel for command $ sh mksdcard.sh /dev/mmcblk1.
UTP: received command 'send'
UTP: sending Success to kernel for command send.
UTP: received command '$ dd if=/dev/zero of=/dev/mmcblk1 bs=1k seek=384 conv=fsync count=129'
UTP: executing "dd if=/dev/zero of=/dev/mmcblk1 bs=1k seek=384 conv=fsync count=129"
129+0 records in
129+0 records out
132096 bytes (132 kB) copied, 0.0324423 s, 4.1 MB/s
UTP: sending Success to kernel for command $ dd if=/dev/zero of=/dev/mmcblk1 bs=1k seek=384 conv=fsync count=129.
utp_poll: pass returned.
UTP: received command '$ dd if=$FILE of=/dev/mmcblk1 bs=1k seek=1 conv=fsync'
UTP: executing "dd if=$FILE of=/dev/mmcblk1 bs=1k seek=1 conv=fsync"
355+0 records in
355+0 records out
363520 bytes (364 kB) copied, 0.0937812 s, 3.9 MB/s
UTP: sending Success to kernel for command $ dd if=$FILE of=/dev/mmcblk1 bs=1k seek=1 conv=fsync.
utp_poll: pass returned.
UTP: received command '$ while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo "waiting..."; done '
UTP: executing "while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo "waiting..."; done "
UTP: sending Success to kernel for command $ while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo "waiting..."; done .
utp_poll: pass returned.
UTP: received command '$ mkfs.vfat /dev/mmcblk1p1'
UTP: executing "mkfs.vfat /dev/mmcblk1p1"
mkfs.fat 3.0.28 (2015-05-16)
UTP: sending Success to kernel for command $ mkfs.vfat /dev/mmcblk1p1.
utp_poll: pass returned.
UTP: received command '$ mkdir -p /mnt/mmcblk1p1'
UTP: executing "mkdir -p /mnt/mmcblk1p1"
UTP: sending Success to kernel for command $ mkdir -p /mnt/mmcblk1p1.
utp_poll: pass returned.
UTP: received command '$ mount -t vfat /dev/mmcblk1p1 /mnt/mmcblk1p1'
UTP: executing "mount -t vfat /dev/mmcblk1p1 /mnt/mmcblk1p1"
UTP: sending Success to kernel for command $ mount -t vfat /dev/mmcblk1p1 /mnt/mmcblk1p1.
utp_poll: pass returned.
UTP: received command '$ umount /mnt/mmcblk1p1'
UTP: executing "umount /mnt/mmcblk1p1"
UTP: sending Success to kernel for command $ umount /mnt/mmcblk1p1.
utp_poll: pass returned.
UTP: received command '$ echo Update Complete!'
UTP: executing "echo Update Complete!"
Update Complete!
UTP: sending Success to kernel for command $ echo Update Complete!.
utp_poll: pass returned.

不過切換 BOOT MODEInternal Boot 還是無法從 emmc 開機

1315

修改 ucl2.xml - 執行 ls /dev

	<CMD state="Updater" type="push" body="$ ls /dev"> ls /dev</CMD>

終於看到 /dev/mmcblk1

UTP: received command '$ ls /dev'
UTP: executing "ls /dev"
autofs           loop6               ram1    tty0   tty27  tty45  tty63
bus              loop7               ram10   tty1   tty28  tty46  tty7
console          mem                 ram11   tty10  tty29  tty47  tty8
cpu_dma_latency  memory_bandwidth    ram12   tty11  tty3   tty48  tty9
dri              mmcblk1             ram13   tty12  tty30  tty49  ttymxc0
fb0              mmcblk1boot0        ram14   tty13  tty31  tty5   ttymxc1
full             mmcblk1boot1        ram15   tty14  tty32  tty50  ubi_ctrl
fuse             mmcblk1p1           ram2    tty15  tty33  tty51  urandom
hwrng            mmcblk1p2           ram3    tty16  tty34  tty52  utp
i2c-0            mmcblk1rpmb         ram4    tty17  tty35  tty53  vcs
i2c-1            network_latency     ram5    tty18  tty36  tty54  vcs1
input            network_throughput  ram6    tty19  tty37  tty55  vcsa
kmsg             null                ram7    tty2   tty38  tty56  vcsa1
loop-control     pps0                ram8    tty20  tty39  tty57  video0
loop0            pps1                ram9    tty21  tty4   tty58  watchdog
loop1            ptmx                random  tty22  tty40  tty59  watchdog0
loop2            ptp0                rfkill  tty23  tty41  tty6   zero
loop3            ptp1                rtc0    tty24  tty42  tty60
loop4            pxp_device          snd     tty25  tty43  tty61
loop5            ram0                tty     tty26  tty44  tty62
UTP: sending Success to kernel for command $ ls /dev.
utp_poll: pass returned.

1320

試著燒一個早上 build 出來的 u-boot - mx6ul_14x14_evk_config/u-boot.imx

修改 ucl2.xml - 燒錄 u-boot.imx

<UCL>
  <CFG>
    <STATE name="BootStrap" dev="MX6SL" vid="15A2" pid="0063"/>
    <STATE name="BootStrap" dev="MX6D" vid="15A2" pid="0061"/>
    <STATE name="BootStrap" dev="MX6Q" vid="15A2" pid="0054"/>
    <STATE name="BootStrap" dev="MX6SX" vid="15A2" pid="0071"/>
    <STATE name="BootStrap" dev="MX6UL" vid="15A2" pid="007D"/>
    <STATE name="BootStrap" dev="MX7D" vid="15A2" pid="0076"/>
    <STATE name="Updater"   dev="MSC" vid="066F" pid="37FF"/>
  </CFG>

  <LIST name="SDCard" desc="Choose SD Card as media">
	<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-imx6ul%6uluboot%_sd.imx" ifdev="MX6UL">Loading U-boot</CMD>
		
	<CMD state="BootStrap" type="load" file="firmware/zImage" address="0x80800000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Kernel.</CMD>

	<CMD state="BootStrap" type="load" file="firmware/%initramfs%" address="0x83800000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Initramfs.</CMD>

	<CMD state="BootStrap" type="load" file="firmware/zImage-imx6ul-%6uldtb%%ldo%.dtb" address="0x83000000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6UL">Loading device tree.</CMD>


	<CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>



	<!-- create partition -->
	<CMD state="Updater" type="push" body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>
	<CMD state="Updater" type="push" body="$ tar xf $FILE "> Partitioning...</CMD>
	<CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk%mmc%"> Partitioning...</CMD>

	<!-- burn uboot -->
	<CMD state="Updater" type="push" body="send" file="files/u-boot.imx">Sending u-boot.bin</CMD>

	<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=384 conv=fsync count=129">clear u-boot arg</CMD>
	<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc% bs=1k seek=1 conv=fsync">write u-boot.bin to sd card</CMD>

	<CMD state="Updater" type="push" body="$ while [ ! -e /dev/mmcblk%mmc%p1 ]; do sleep 1; echo \"waiting...\"; done ">Waiting for the partition ready</CMD>
	<CMD state="Updater" type="push" body="$ mkfs.vfat /dev/mmcblk%mmc%p1">Formatting rootfs partition</CMD>
	<CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk%mmc%p1"/>
	<CMD state="Updater" type="push" body="$ mount -t vfat /dev/mmcblk%mmc%p1 /mnt/mmcblk%mmc%p1"/>

	<CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>

  </LIST>

</UCL>

相對應的 console 顯示如下

U-Boot 2015.04-imx_v2015.04_4.1.15_1.0.0_ga+g384e1c1 (Mar 13 2016 - 17:39:55)

CPU:   Freescale i.MX6UL rev1.2 at 396 MHz
CPU:   Temperature 48 C
Reset cause: POR
Board: MX6UL 14x14 EVK
I2C:   ready
DRAM:  512 MiB
force_idle_bus: sda=0 scl=0 sda.gp=0x1d scl.gp=0x1c
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

Display: TFT43AB (480x272)
Video: 480x272x24
In:    serial
Out:   serial
Err:   serial
MMC: no card present
Net:   FEC1
Error: FEC1 address not set.

Boot from USB for mfgtools
Use default environment for                              mfgtools
Run bootcmd_mfg: run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};
Hit any key to stop autoboot:  0
Kernel image @ 0x80800000 [ 0x000000 - 0x552a48 ]
## Loading init Ramdisk from Legacy Image at 83800000 ...
   Image Name:   fsl-image-mfgtool-initramfs-imx6
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7565864 Bytes = 7.2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 83000000
   Booting using the fdt blob at 0x83000000
   Using Device Tree in place at 83000000, end 8300b7c9
Modify /soc/aips-bus@02000000/bee@02044000:status disabled
ft_system_setup for mx6

Starting kernel ...

Booting Linux on physical CPU 0x0
Linux version 4.1.15-1.0.0-mfgtool+g3924425 (bamboo@shlinux12) (gcc version 5.2.0 (GCC) ) #1 SMP PREEMPT Sun Mar 13 17:19:17 CST 2016
CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: Freescale i.MX6 UltraLite 14x14 EVK Board
cma: Reserved 320 MiB at 0x8c000000
Memory policy: Data cache writealloc
PERCPU: Embedded 12 pages/cpu @8bb32000 s16768 r8192 d24192 u49152
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: console=ttymxc0,115200 rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.file=/fat g_mass_storage.ro=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber= clk_ignore_unused
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 173408K/524288K available (6895K kernel code, 319K rwdata, 2412K rodata, 388K init, 423K bss, 23200K reserved, 327680K cma-reserved, 0K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xa0800000 - 0xff000000   (1512 MB)
    lowmem  : 0x80000000 - 0xa0000000   ( 512 MB)
    pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)
    modules : 0x7f000000 - 0x7fe00000   (  14 MB)
      .text : 0x80008000 - 0x8091ef88   (9308 kB)
      .init : 0x8091f000 - 0x80980000   ( 388 kB)
      .data : 0x80980000 - 0x809cff00   ( 320 kB)
       .bss : 0x809d2000 - 0x80a3bf14   ( 424 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Preemptible hierarchical RCU implementation.
        Additional per-CPU info printed with stalls.
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=1.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
NR_IRQS:16 nr_irqs:16 16
mxc_clocksource_init 24000000
Switching to timer-based delay loop, resolution 41ns
sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
clocksource mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
/cpus/cpu@0 missing clock-frequency property
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x80008280 - 0x800082f0
Brought up 1 CPUs
SMP: Total of 1 processors activated (48.00 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
device-tree: Duplicate name in lcdif@021c8000, renamed to "display#1"
VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 8 bytes.
imx6ul-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver
mxs-dma 1804000.dma-apbh: initialized
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c i2c-0: IMX I2C adapter registered
i2c i2c-0: can't use DMA
i2c i2c-1: IMX I2C adapter registered
i2c i2c-1: can't use DMA
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <[email protected]>
PTP clock support registered
Advanced Linux Sound Architecture Driver Initialized.
Switched to clocksource mxc_timer1
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 7392K (83800000 - 83f38000)
imx rpmsg driver is registered.
Bus freq driver module loaded
futex hash table entries: 256 (order: 2, 16384 bytes)
VFS: Disk quotas dquot_6.6.0
VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
jffs2: version 2.2. (NAND) c 2001-2006 Red Hat, Inc.
fuse init (API version 7.23)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
imx-weim 21b8000.weim: Driver registered.
backlight supply power not found, using dummy regulator
21c8000.lcdif supply lcd not found, using dummy regulator
mxsfb 21c8000.lcdif: failed to find mxc display driver
Console: switching to colour frame buffer device 60x34
mxsfb 21c8000.lcdif: initialized
imx-sdma 20ec000.sdma: no event needs to be remapped
imx-sdma 20ec000.sdma: loaded firmware 3.3
imx-sdma 20ec000.sdma: initialized
2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 19, base_baud = 5000000) is a IMX
console [ttymxc0] enabled
21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 235, base_baud = 5000000) is a IMX
imx sema4 driver is registered.
[drm] Initialized drm 1.1.0 20060810
[drm] Initialized vivante 1.0.0 20120216 on minor 0
brd: module loaded
loop: module loaded
fsl-quadspi 21e0000.qspi: unrecognized JEDEC id bytes: ff, ff, ff
fsl-quadspi 21e0000.qspi: Freescale QuadSPI probe failed
20b4000.ethernet supply phy not found, using dummy regulator
pps pps0: new PPS source ptp0
fec 20b4000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00
fec 20b4000.ethernet (unnamed net_device) (uninitialized): Using random MAC address: 22:6f:69:2e:ae:41
libphy: fec_enet_mii_bus: probed
fec 20b4000.ethernet eth0: registered PHC device 0
2188000.ethernet supply phy not found, using dummy regulator
pps pps1: new PPS source ptp1
fec 2188000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00
fec 2188000.ethernet (unnamed net_device) (uninitialized): Using random MAC address: d6:97:53:44:83:41
fec 2188000.ethernet eth1: registered PHC device 1
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-mxc: Freescale On-Chip EHCI Host driver
usbcore: registered new interface driver usb-storage
2184800.usbmisc supply vbus-wakeup not found, using dummy regulator
2184000.usb supply vbus not found, using dummy regulator
2184200.usb supply vbus not found, using dummy regulator
ci_hdrc ci_hdrc.1: EHCI Host Controller
ci_hdrc ci_hdrc.1: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.1: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Mass Storage Function, version: 2009/09/11
LUN: removable file: (no medium)
LUN: removable read only file: /fat
Number of LUNs=1
Number of LUNs=1
g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11
g_mass_storage gadget: g_mass_storage ready
mousedev: PS/2 mouse device common for all mice
input: 20cc000.snvs:snvs-powerkey as /devices/platform/soc/2000000.aips-bus/20cc000.snvs/20cc000.snvs:snvs-powerkey/input/input0
input: iMX6UL TouchScreen Controller as /devices/platform/soc/2000000.aips-bus/2040000.tsc/input/input1
snvs_rtc 20cc000.snvs:snvs-rtc-lp: rtc core: registered 20cc000.snvs:snvs-r as rtc0
i2c /dev entries driver
IR NEC protocol handler initialized
IR RC5(x/sz) protocol handler initialized
IR RC6 protocol handler initialized
IR JVC protocol handler initialized
IR Sony protocol handler initialized
IR SANYO protocol handler initialized
IR Sharp protocol handler initialized
IR MCE Keyboard/mouse protocol handler initialized
IR XMP protocol handler initialized
pxp-v4l2 pxp_v4l2: initialized
imx2-wdt 20bc000.wdog: use WDOG_B to reboot.
imx2-wdt 20bc000.wdog: timeout 60 sec (nowayout=0)
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
/soc/aips-bus@02100000/usdhc@02190000: voltage-ranges unspecified
sdhci-esdhc-imx 2190000.usdhc: Got CD GPIO
sdhci-esdhc-imx 2190000.usdhc: No vqmmc regulator found
mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc] using ADMA
g_mass_storage gadget: high-speed config #1: Linux File-Backed Storage
/soc/aips-bus@02100000/usdhc@02194000: voltage-ranges unspecified
sdhci-esdhc-imx 2194000.usdhc: No vmmc regulator found
sdhci-esdhc-imx 2194000.usdhc: No vqmmc regulator found
mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA
usb 1-1: new high-speed USB device number 2 using ci_hdrc
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
Key type dns_resolver registered
cpu cpu0: dev_pm_opp_get_opp_count: device OPP not found (-19)
Registering SWP/SWPB emulation handler
snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01 00:00:00 UTC (0)
can-3v3: disabling
clk: Not disabling unused clocks
ALSA device list:
  No soundcards found.
Freeing unused kernel memory: 388K (8091f000 - 80980000)
Starting UTP
uuc 0.5 [built Mar 12 2016 19:04:20]
UTP: Waiting for device to appear
UTP: file/device node /dev/utp already exists
cpu_id is 0
UTP: received command 'send'
UTP: sending Success to kernel for command send.
UTP: received command '$ tar xf $FILE '
UTP: executing "tar xf $FILE "
mmc1: MAN_BKOPS_EN bit is not set
UTP: sending Success to kernel for command $ tar xf $FILE .
mmc1: new DDR MMC card at address 0001
mmcblk1: mmc1:0001 Q2J54A 3.58 GiB
mmcblk1boot0: mmc1:0001 Q2J54A partition 1 16.0 MiB
mmcblk1boot1: mmc1:0001 Q2J54A partition 2 16.0 MiB
mmcblk1rpmb: mmc1:0001 Q2J54A partition 3 512 KiB
 mmcblk1: p1 p2
utp_poll: pass returned.
UTP: received command '$ sh mksdcard.sh /dev/mmcblk1'
UTP: executing "sh mksdcard.sh /dev/mmcblk1"
1+0 records in
1+0 records out
1024 bytes (1.0 kB) copied, 0.0434297 s, 23.6 kB/s
Checking that no-one is using thirandom: sfdisk urandom read with 13 bits of entropy available
s disk right now ... OK

Disk /dev/mmcblk1: 3.6 GiB, 385037 mmcblk1: p1 p2
1072 bytes, 7520256 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

>>> Created a new DOS disklabel with disk identifier 0x7a149131.
Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 500 MiB.
/dev/mmcblk1p2: Created a new partition 2 of type 'Linux' and of size 3 GiB.
/dev/mmcblk1p3:
New situation:

Device         Boot   Start     End Sectors  Size Id Type
/dev/mmcblk1p1        20480 1044479 1024000  500M  c W95 FAT32 (LBA)
/dev/mmcblk1p2      1228800 7520255 6291456    3G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
UTP: sending Success to kernel for command $ sh mksdcard.sh /dev/mmcblk1.
utp_poll: pass returned.
UTP: received command 'send'
UTP: sending Success to kernel for command send.
UTP: received command '$ dd if=/dev/zero of=/dev/mmcblk1 bs=1k seek=384 conv=fsync count=129'
UTP: executing "dd if=/dev/zero of=/dev/mmcblk1 bs=1k seek=384 conv=fsync count=129"
129+0 records in
129+0 records out
132096 bytes (132 kB) copied, 0.0333092 s, 4.0 MB/s
UTP: sending Success to kernel for command $ dd if=/dev/zero of=/dev/mmcblk1 bs=1k seek=384 conv=fsync count=129.
utp_poll: pass returned.
UTP: received command '$ dd if=$FILE of=/dev/mmcblk1 bs=1k seek=1 conv=fsync'
UTP: executing "dd if=$FILE of=/dev/mmcblk1 bs=1k seek=1 conv=fsync"
355+0 records in
355+0 records out
363520 bytes (364 kB) copied, 0.07058 s, 5.2 MB/s
UTP: sending Success to kernel for command $ dd if=$FILE of=/dev/mmcblk1 bs=1k seek=1 conv=fsync.
utp_poll: pass returned.
UTP: received command '$ while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo "waiting..."; done '
UTP: executing "while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo "waiting..."; done "
UTP: sending Success to kernel for command $ while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo "waiting..."; done .
utp_poll: pass returned.
UTP: received command '$ mkfs.vfat /dev/mmcblk1p1'
UTP: executing "mkfs.vfat /dev/mmcblk1p1"
mkfs.fat 3.0.28 (2015-05-16)
UTP: sending Success to kernel for command $ mkfs.vfat /dev/mmcblk1p1.
utp_poll: pass returned.
UTP: received command '$ mkdir -p /mnt/mmcblk1p1'
UTP: executing "mkdir -p /mnt/mmcblk1p1"
UTP: sending Success to kernel for command $ mkdir -p /mnt/mmcblk1p1.
utp_poll: pass returned.
UTP: received command '$ mount -t vfat /dev/mmcblk1p1 /mnt/mmcblk1p1'
UTP: executing "mount -t vfat /dev/mmcblk1p1 /mnt/mmcblk1p1"
UTP: sending Success to kernel for command $ mount -t vfat /dev/mmcblk1p1 /mnt/mmcblk1p1.
utp_poll: pass returned.
UTP: received command '$ echo Update Complete!'
UTP: executing "echo Update Complete!"
Update Complete!
UTP: sending Success to kernel for command $ echo Update Complete!.
utp_poll: pass returned.

尷尬的是還是無法從 emmc 開機

1340

從 NXP 的 Boot up sequence of i.MX6UL through eMMC

發現問問題的人的 BOOT_CFG1BOOT_CFG2 的值和我們不一樣

morris 表示他先問一下 安富利

1345

我先從既有的 log 先做一點有用的分析

來解析以下的步驟好了

	<!-- create partition -->
	<CMD state="Updater" type="push" body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>
	<CMD state="Updater" type="push" body="$ tar xf $FILE "> Partitioning...</CMD>
	<CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk%mmc%"> Partitioning...</CMD>

	<!-- burn uboot -->
	<CMD state="Updater" type="push" body="send" file="files/u-boot.imx">Sending u-boot.bin</CMD>

	<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=384 conv=fsync count=129">clear u-boot arg</CMD>
	<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc% bs=1k seek=1 conv=fsync">write u-boot.bin to sd card</CMD>

	<CMD state="Updater" type="push" body="$ while [ ! -e /dev/mmcblk%mmc%p1 ]; do sleep 1; echo \"waiting...\"; done ">Waiting for the partition ready</CMD>
	<CMD state="Updater" type="push" body="$ mkfs.vfat /dev/mmcblk%mmc%p1">Formatting rootfs partition</CMD>
	<CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk%mmc%p1"/>
	<CMD state="Updater" type="push" body="$ mount -t vfat /dev/mmcblk%mmc%p1 /mnt/mmcblk%mmc%p1"/>

	<CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>

先看 <CMD state="Updater" type="push" body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>

相對應的 console output

UTP: received command 'send'
UTP: sending Success to kernel for command send.

<CMD state="Updater" type="push" body="$ tar xf $FILE "> Partitioning...</CMD>

UTP: received command '$ tar xf $FILE '
UTP: executing "tar xf $FILE "
mmc1: MAN_BKOPS_EN bit is not set
UTP: sending Success to kernel for command $ tar xf $FILE .

下面的 console output 不知是怎麼觸發的

mmc1: new DDR MMC card at address 0001
mmcblk1: mmc1:0001 Q2J54A 3.58 GiB
mmcblk1boot0: mmc1:0001 Q2J54A partition 1 16.0 MiB
mmcblk1boot1: mmc1:0001 Q2J54A partition 2 16.0 MiB
mmcblk1rpmb: mmc1:0001 Q2J54A partition 3 512 KiB
 mmcblk1: p1 p2
utp_poll: pass returned.

<CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk%mmc%"> Partitioning...</CMD>

UTP: received command '$ sh mksdcard.sh /dev/mmcblk1'
UTP: executing "sh mksdcard.sh /dev/mmcblk1"
1+0 records in
1+0 records out
1024 bytes (1.0 kB) copied, 0.0434297 s, 23.6 kB/s
Checking that no-one is using thirandom: sfdisk urandom read with 13 bits of entropy available
s disk right now ... OK

Disk /dev/mmcblk1: 3.6 GiB, 385037 mmcblk1: p1 p2
1072 bytes, 7520256 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

>>> Created a new DOS disklabel with disk identifier 0x7a149131.
Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 500 MiB.
/dev/mmcblk1p2: Created a new partition 2 of type 'Linux' and of size 3 GiB.
/dev/mmcblk1p3:
New situation:

Device         Boot   Start     End Sectors  Size Id Type
/dev/mmcblk1p1        20480 1044479 1024000  500M  c W95 FAT32 (LBA)
/dev/mmcblk1p2      1228800 7520255 6291456    3G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
UTP: sending Success to kernel for command $ sh mksdcard.sh /dev/mmcblk1.
utp_poll: pass returned.

<CMD state="Updater" type="push" body="send" file="files/u-boot.imx">Sending u-boot.bin</CMD>

UTP: received command 'send'
UTP: sending Success to kernel for command send.

<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=384 conv=fsync count=129">clear u-boot arg</CMD>

UTP: received command '$ dd if=/dev/zero of=/dev/mmcblk1 bs=1k seek=384 conv=fsync count=129'
UTP: executing "dd if=/dev/zero of=/dev/mmcblk1 bs=1k seek=384 conv=fsync count=129"
129+0 records in
129+0 records out
132096 bytes (132 kB) copied, 0.0333092 s, 4.0 MB/s
UTP: sending Success to kernel for command $ dd if=/dev/zero of=/dev/mmcblk1 bs=1k seek=384 conv=fsync count=129.
utp_poll: pass returned.

<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc% bs=1k seek=1 conv=fsync">write u-boot.bin to sd card</CMD>

UTP: received command '$ dd if=$FILE of=/dev/mmcblk1 bs=1k seek=1 conv=fsync'
UTP: executing "dd if=$FILE of=/dev/mmcblk1 bs=1k seek=1 conv=fsync"
355+0 records in
355+0 records out
363520 bytes (364 kB) copied, 0.07058 s, 5.2 MB/s
UTP: sending Success to kernel for command $ dd if=$FILE of=/dev/mmcblk1 bs=1k seek=1 conv=fsync.
utp_poll: pass returned.

<CMD state="Updater" type="push" body="$ while [ ! -e /dev/mmcblk%mmc%p1 ]; do sleep 1; echo \"waiting...\"; done ">Waiting for the partition ready</CMD>

UTP: received command '$ while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo "waiting..."; done '
UTP: executing "while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo "waiting..."; done "
UTP: sending Success to kernel for command $ while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo "waiting..."; done .
utp_poll: pass returned.

<CMD state="Updater" type="push" body="$ mkfs.vfat /dev/mmcblk%mmc%p1">Formatting rootfs partition</CMD>

UTP: received command '$ mkfs.vfat /dev/mmcblk1p1'
UTP: executing "mkfs.vfat /dev/mmcblk1p1"
mkfs.fat 3.0.28 (2015-05-16)
UTP: sending Success to kernel for command $ mkfs.vfat /dev/mmcblk1p1.
utp_poll: pass returned.

<CMD state="Updater" type="push" body="$ mkdir -p /mnt/mmcblk%mmc%p1"/>

UTP: received command '$ mkdir -p /mnt/mmcblk1p1'
UTP: executing "mkdir -p /mnt/mmcblk1p1"
UTP: sending Success to kernel for command $ mkdir -p /mnt/mmcblk1p1.
utp_poll: pass returned.

<CMD state="Updater" type="push" body="$ mount -t vfat /dev/mmcblk%mmc%p1 /mnt/mmcblk%mmc%p1"/>

UTP: received command '$ mount -t vfat /dev/mmcblk1p1 /mnt/mmcblk1p1'
UTP: executing "mount -t vfat /dev/mmcblk1p1 /mnt/mmcblk1p1"
UTP: sending Success to kernel for command $ mount -t vfat /dev/mmcblk1p1 /mnt/mmcblk1p1.
utp_poll: pass returned.

<CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>

UTP: received command '$ echo Update Complete!'
UTP: executing "echo Update Complete!"
Update Complete!
UTP: sending Success to kernel for command $ echo Update Complete!.
utp_poll: pass returned.

1415

試著使用 ucl2.xml<LIST name="eMMC" desc="Choose eMMC as media"> 的部分

	<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-imx6ul%6uluboot%_emmc.imx" ifdev="MX6UL">Loading U-boot</CMD>
		
	<CMD state="BootStrap" type="load" file="firmware/zImage" address="0x80800000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Kernel.</CMD>

	<CMD state="BootStrap" type="load" file="firmware/%initramfs%" address="0x83800000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Initramfs.</CMD>

	<CMD state="BootStrap" type="load" file="firmware/zImage-imx6ul-%6uldtb%-emmc.dtb" address="0x83000000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6UL">Loading device tree.</CMD>

	<CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>


	<!-- create partition -->
	<CMD state="Updater" type="push" body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>
	<CMD state="Updater" type="push" body="$ tar xf $FILE "> Partitioning...</CMD>
	<CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk%mmc%"> Partitioning...</CMD>

	<!-- burn uboot -->
	<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=384 conv=fsync count=129">clear u-boot arg</CMD>

	<!-- access boot partition -->
	<CMD state="Updater" type="push" body="$ echo 0 > /sys/block/mmcblk%mmc%boot0/force_ro">access boot partition 1</CMD>
	<CMD state="Updater" type="push" body="send" file="files/u-boot-imx6ul%6uluboot%_emmc.imx" ifdev="MX6UL">Sending u-boot.bin</CMD>
	<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc%boot0 bs=512 seek=2">write U-Boot to sd card</CMD>
	<CMD state="Updater" type="push" body="$ echo 1 > /sys/block/mmcblk%mmc%boot0/force_ro"> re-enable read-only access </CMD>
	<CMD state="Updater" type="push" body="$ mmc bootpart enable 1 1 /dev/mmcblk%mmc%">enable boot partion 1 to boot</CMD>

	<!-- create fat partition -->
	<CMD state="Updater" type="push" body="$ while [ ! -e /dev/mmcblk%mmc%p1 ]; do sleep 1; echo \"waiting...\"; done ">Waiting for the partition ready</CMD>
	<CMD state="Updater" type="push" body="$ mkfs.vfat /dev/mmcblk%mmc%p1">Formatting rootfs partition</CMD>



	<CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>

mfgtool 啟動失敗

DLL version: 2.6.2
Monday, September 25, 2017 14:21:19   Start new logging
ModuleID[2] LevelID[1]: Boot command-- file D:\m300\tools\L4.1.15_1.0.0_ga-mfg-tools\mfgtools_test2\Profiles\linux\OS Firmware\firmware\u-boot-imx6ulevk_emmc.imx failed to open.errcode is 2
ModuleID[2] LevelID[1]: Parse ucl script failed, error code: 4

參考 sd 的部分修改一下

	<CMD state="BootStrap" type="boot" body="BootStrap" file ="firmware/u-boot-imx6ul%6uluboot%_sd.imx" ifdev="MX6UL">Loading U-boot</CMD>
		
	<CMD state="BootStrap" type="load" file="firmware/zImage" address="0x80800000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Kernel.</CMD>

	<CMD state="BootStrap" type="load" file="firmware/%initramfs%" address="0x83800000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6SL MX6SX MX7D MX6UL">Loading Initramfs.</CMD>

	<CMD state="BootStrap" type="load" file="firmware/zImage-imx6ul-%6uldtb%%ldo%.dtb" address="0x83000000"
		loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE" ifdev="MX6UL">Loading device tree.</CMD>

	<CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>


	<!-- create partition -->
	<CMD state="Updater" type="push" body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>
	<CMD state="Updater" type="push" body="$ tar xf $FILE "> Partitioning...</CMD>
	<CMD state="Updater" type="push" body="$ sh mksdcard.sh /dev/mmcblk%mmc%"> Partitioning...</CMD>

	<!-- burn uboot -->
	<CMD state="Updater" type="push" body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=384 conv=fsync count=129">clear u-boot arg</CMD>

	<!-- access boot partition -->
	<CMD state="Updater" type="push" body="$ echo 0 > /sys/block/mmcblk%mmc%boot0/force_ro">access boot partition 1</CMD>
	<CMD state="Updater" type="push" body="send" file="files/u-boot.imx" ifdev="MX6UL">Sending u-boot.bin</CMD>
	<CMD state="Updater" type="push" body="$ dd if=$FILE of=/dev/mmcblk%mmc%boot0 bs=512 seek=2">write U-Boot to sd card</CMD>
	<CMD state="Updater" type="push" body="$ echo 1 > /sys/block/mmcblk%mmc%boot0/force_ro"> re-enable read-only access </CMD>
	<CMD state="Updater" type="push" body="$ mmc bootpart enable 1 1 /dev/mmcblk%mmc%">enable boot partion 1 to boot</CMD>

	<!-- create fat partition -->
	<CMD state="Updater" type="push" body="$ while [ ! -e /dev/mmcblk%mmc%p1 ]; do sleep 1; echo \"waiting...\"; done ">Waiting for the partition ready</CMD>
	<CMD state="Updater" type="push" body="$ mkfs.vfat /dev/mmcblk%mmc%p1">Formatting rootfs partition</CMD>



	<CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>

抓一下相關的 console

UTP: received command 'send'
UTP: sending Success to kernel for command send.
UTP: received command '$ tar xf $FILE '
UTP:mmc1: MAN_BKOPS_EN bit is not set
 executing "tar xf $FILE "
UTP: sending Success to kernel for command $ tar xf $FILE .
mmc1: new DDR MMC card at address 0001
mmcblk1: mmc1:0001 M62704 3.53 GiB
mmcblk1boot0: mmc1:0001 M62704 partition 1 2.00 MiB
mmcblk1boot1: mmc1:0001 M62704 partition 2 2.00 MiB
mmcblk1rpmb: mmc1:0001 M62704 partition 3 512 KiB
 mmcblk1: p1 p2
utp_poll: pass returned.
UTP: received command '$ sh mksdcard.sh /dev/mmcblk1'
UTP: executing "sh mksdcard.sh /dev/mmcblk1"
1+0 records in
1+0 records out
1024 bytes (1.0 kB) copied, 0.0659897 s, 15.5 kB/s
Checking that no-one is using thirandom: sfdisk urandom read with 12 bits of entropy available
s disk right now ... OK

Disk /dev/mmcblk1: 3.5 GiB, 379165 mmcblk1: p1 p2
0816 bytes, 7405568 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

>>> Created a new DOS disklabel with disk identifier 0xe94c78ed.
Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 500 MiB.
/dev/mmcblk1p2: Created a new partition 2 of type 'Linux' and of size 3 GiB.
/dev/mmcblk1p3:
New situation:

Device         Boot   Start     End Sectors  Size Id Type
/dev/mmcblk1p1        20480 1044479 1024000  500M  c W95 FAT32 (LBA)
/dev/mmcblk1p2      1228800 7405567 6176768    3G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
UTP: sending Success to kernel for command $ sh mksdcard.sh /dev/mmcblk1.
utp_poll: pass returned.
UTP: received command '$ dd if=/dev/zero of=/dev/mmcblk1 bs=1k seek=384 conv=fsync count=129'
UTP: executing "dd if=/dev/zero of=/dev/mmcblk1 bs=1k seek=384 conv=fsync count=129"
129+0 records in
129+0 records out
132096 bytes (132 kB) copied, 0.0311713 s, 4.2 MB/s
UTP: sending Success to kernel for command $ dd if=/dev/zero of=/dev/mmcblk1 bs=1k seek=384 conv=fsync count=129.
utp_poll: pass returned.
UTP: received command '$ echo 0 > /sys/block/mmcblk1boot0/force_ro'
UTP: executing "echo 0 > /sys/block/mmcblk1boot0/force_ro"
UTP: sending Success to kernel for command $ echo 0 > /sys/block/mmcblk1boot0/force_ro.
utp_poll: pass returned.
UTP: received command 'send'
UTP: sending Success to kernel for command send.
UTP: received command '$ dd if=$FILE of=/dev/mmcblk1boot0 bs=512 seek=2'
UTP: executing "dd if=$FILE of=/dev/mmcblk1boot0 bs=512 seek=2"
710+0 records in
710+0 records out
363520 bytes (364 kB) copied, 0.152893 s, 2.4 MB/s
UTP: sending Success to kernel for command $ dd if=$FILE of=/dev/mmcblk1boot0 bs=512 seek=2.
utp_poll: pass returned.
UTP: received command '$ echo 1 > /sys/block/mmcblk1boot0/force_ro'
UTP: executing "echo 1 > /sys/block/mmcblk1boot0/force_ro"
UTP: sending Success to kernel for command $ echo 1 > /sys/block/mmcblk1boot0/force_ro.
utp_poll: pass returned.
UTP: received command '$ mmc bootpart enable 1 1 /dev/mmcblk1'
UTP: executing "mmc bootpart enable 1 1 /dev/mmcblk1"
UTP: sending Success to kernel for command $ mmc bootpart enable 1 1 /dev/mmcblk1.
utp_poll: pass returned.
UTP: received command '$ while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo "waiting..."; done '
UTP: executing "while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo "waiting..."; done "
UTP: sending Success to kernel for command $ while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo "waiting..."; done .
utp_poll: pass returned.
UTP: received command '$ mkfs.vfat /dev/mmcblk1p1'
UTP: executing "mkfs.vfat /dev/mmcblk1p1"
mkfs.fat 3.0.28 (2015-05-16)
UTP: sending Success to kernel for command $ mkfs.vfat /dev/mmcblk1p1.
utp_poll: pass returned.
UTP: received command '$ echo Update Complete!'
UTP: executing "echo Update Complete!"
Update Complete!
UTP: sending Success to kernel for command $ echo Update Complete!.
utp_poll: pass returned.

1435

竟然開起來了

U-Boot 2015.04imx_v2015.04_4.1.15_1.2.0_ga+gede7538 (Sep 25 2017 - 01:12:24)

CPU:   Freescale i.MX6UL rev1.1 at 396 MHz
CPU:   Temperature 40 C
Reset cause: POR
Board: MX6UL 14x14 EVK
I2C:   ready
DRAM:  512 MiB
force_idle_bus: sda=0 scl=0 sda.gp=0x1d scl.gp=0x1c
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

Display: TFT43AB (480x272)
Video: 480x272x24
In:    serial
Out:   serial
Err:   serial
MMC: no card present
Net:   FEC1
Error: FEC1 address not set.

Normal Boot
Hit any key to stop autoboot:  0
MMC: no card present
MMC: no card present
Card did not respond to voltage select!
Booting from net ...
FEC1 Waiting for PHY auto negotiation to complete......... TIMEOUT !
*** ERROR: `ethaddr' not set
FEC1 Waiting for PHY auto negotiation to complete......... TIMEOUT !
FEC1 Waiting for PHY auto negotiation to complete......... TIMEOUT !
*** ERROR: `ethaddr' not set
FEC1 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Bad Linux ARM zImage magic!
=>

先來看一下剛剛做了什麼不一樣的事情

只看 Jumping to OS image. 之後的部分

開得起來的 ucl2.xml

	<CMD state="Updater" type="push" 
    body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>
	<CMD state="Updater" type="push" 
    body="$ tar xf $FILE "> Partitioning...</CMD>
	<CMD state="Updater" type="push" 
    body="$ sh mksdcard.sh /dev/mmcblk%mmc%"> Partitioning...</CMD>

	<CMD state="Updater" type="push" 
    body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=384 conv=fsync count=129">clear u-boot arg</CMD>
	<CMD state="Updater" type="push" 
    body="$ echo 0 > /sys/block/mmcblk%mmc%boot0/force_ro">access boot partition 1</CMD>
	<CMD state="Updater" type="push" 
    body="send" file="files/u-boot.imx" ifdev="MX6UL">Sending u-boot.bin</CMD>
	<CMD state="Updater" type="push" 
    body="$ dd if=$FILE of=/dev/mmcblk%mmc%boot0 bs=512 seek=2">write U-Boot to sd card</CMD>
	<CMD state="Updater" type="push" 
    body="$ echo 1 > /sys/block/mmcblk%mmc%boot0/force_ro"> re-enable read-only access </CMD>
	<CMD state="Updater" type="push" 
    body="$ mmc bootpart enable 1 1 /dev/mmcblk%mmc%">enable boot partion 1 to boot</CMD>

開不起來的

  <CMD state="Updater" type="push" 
    body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>
  <CMD state="Updater" type="push" 
    body="$ tar xf $FILE "> Partitioning...</CMD>
  <CMD state="Updater" type="push" 
    body="$ sh mksdcard.sh /dev/mmcblk%mmc%"> Partitioning...</CMD>

  <CMD state="Updater" type="push" 
    body="send" file="files/u-boot.imx">Sending u-boot.bin</CMD>
  <CMD state="Updater" type="push" 
    body="$ dd if=/dev/zero of=/dev/mmcblk%mmc% bs=1k seek=384 conv=fsync count=129">clear u-boot arg</CMD>
  <CMD state="Updater" type="push" 
    body="$ dd if=$FILE of=/dev/mmcblk%mmc% bs=1k seek=1 conv=fsync">write u-boot.bin to sd card</CMD>

1505

目前懷疑是以下這個 command 造成的

	<CMD state="Updater" type="push" 
    body="$ mmc bootpart enable 1 1 /dev/mmcblk%mmc%">enable boot partion 1 to boot</CMD>

稍微修改一下 開不起來的 ucl2.xml - 只加上 mmc bootpart enable 1 1 /dev/mmcblk1

  <CMD state="Updater" type="push" 
    body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>
  <CMD state="Updater" type="push" 
    body="$ tar xf $FILE "> Partitioning...</CMD>
  <CMD state="Updater" type="push" 
    body="$ sh mksdcard.sh /dev/mmcblk1"> Partitioning...</CMD>

  <CMD state="Updater" type="push" 
    body="send" file="files/u-boot.imx">Sending u-boot.bin</CMD>
  <CMD state="Updater" type="push" 
    body="$ dd if=/dev/zero of=/dev/mmcblk1 bs=1k seek=384 conv=fsync count=129">clear u-boot arg</CMD>
  <CMD state="Updater" type="push" 
    body="$ dd if=$FILE of=/dev/mmcblk1 bs=1k seek=1 conv=fsync">write u-boot.bin to sd card</CMD>

  <CMD state="Updater" type="push" 
    body="$ mmc bootpart enable 1 1 /dev/mmcblk1">enable boot partion 1 to boot</CMD>

  <CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>

還是開不起來

1535

參考 Boot on eMMC

感覺關鍵點就是 force_ro

Boot partition access howto:
-To enable write access to /dev/mmcblkXbootY, disable the forced read-only access with:
echo 0 > /sys/block/mmcblkXbootY/force_ro
-To re-enable read-only access:
echo 1 > /sys/block/mmcblkXbootY/force_ro

1610

目前的結論

執行 D:\m300\tools\L4.1.15_1.0.0_ga-mfg-tools\mfgtools_test2\mfgtool2-yocto-mx-evk-sdcard-sd2.vbs

D:\m300\tools\L4.1.15_1.0.0_ga-mfg-tools\mfgtools_test2\Profiles\Linux\OS Firmware\ucl2.xml 內容如下

<UCL>
  <CFG>
    <STATE name="BootStrap" dev="MX6SL" vid="15A2" pid="0063"/>
    <STATE name="BootStrap" dev="MX6D" vid="15A2" pid="0061"/>
    <STATE name="BootStrap" dev="MX6Q" vid="15A2" pid="0054"/>
    <STATE name="BootStrap" dev="MX6SX" vid="15A2" pid="0071"/>
    <STATE name="BootStrap" dev="MX6UL" vid="15A2" pid="007D"/>
    <STATE name="BootStrap" dev="MX7D" vid="15A2" pid="0076"/>
    <STATE name="Updater"   dev="MSC" vid="066F" pid="37FF"/>
  </CFG>

  

  <LIST name="SDCard" desc="Choose SD Card as media">

  <CMD state="BootStrap" type="boot" 
    body="BootStrap" file ="firmware/u-boot-imx6ulevk_sd.imx">Loading U-boot</CMD>
  <CMD state="BootStrap" type="load" 
    file="firmware/zImage" address="0x80800000"
    loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE">Loading Kernel.</CMD>
  <CMD state="BootStrap" type="load" 
    file="firmware/fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot" address="0x83800000"
    loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE">Loading Initramfs.</CMD>
  <CMD state="BootStrap" type="load" 
    file="firmware/zImage-imx6ul-14x14-evk.dtb" address="0x83000000"
    loadSection="OTH" setSection="OTH" HasFlashHeader="FALSE">Loading device tree.</CMD>
  <CMD state="BootStrap" type="jump" > Jumping to OS image. </CMD>

  <CMD state="Updater" type="push" 
    body="send" file="mksdcard.sh.tar">Sending partition shell</CMD>
  <CMD state="Updater" type="push" 
    body="$ tar xf $FILE "> Partitioning...</CMD>
  <CMD state="Updater" type="push" 
    body="$ sh mksdcard.sh /dev/mmcblk1"> Partitioning...</CMD>

  <CMD state="Updater" type="push" 
    body="$ dd if=/dev/zero of=/dev/mmcblk1 bs=1k seek=384 conv=fsync count=129">clear u-boot arg</CMD>
  <CMD state="Updater" type="push" 
    body="$ echo 0 > /sys/block/mmcblk1boot0/force_ro">access boot partition 1</CMD>
  <CMD state="Updater" type="push" 
    body="send" file="files/u-boot.imx">Sending u-boot.bin</CMD>
  <CMD state="Updater" type="push" 
    body="$ dd if=$FILE of=/dev/mmcblk1boot0 bs=512 seek=2">write U-Boot to sd card</CMD>
  <CMD state="Updater" type="push" 
    body="$ echo 1 > /sys/block/mmcblk1boot0/force_ro"> re-enable read-only access </CMD>
  <CMD state="Updater" type="push" 
    body="$ mmc bootpart enable 1 1 /dev/mmcblk1">enable boot partion 1 to boot</CMD>

  <CMD state="Updater" type="push" body="$ echo Update Complete!">Done</CMD>

  </LIST>

</UCL>

所需的檔案有

  • Profiles\Linux\OS Firmware\mksdcard.sh.tar
  • Profiles\Linux\OS Firmware\firmware\fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot
  • Profiles\Linux\OS Firmware\firmware\u-boot-imx6ulevk_sd.imx
  • Profiles\Linux\OS Firmware\firmware\zImage
  • Profiles\Linux\OS Firmware\firmware\zImage-imx6ul-14x14-evk.dtb

燒錄完成後確定可以從 emmc 開機

1640

追加下述部分燒錄 kernel 與 device tree

  <CMD state="Updater" type="push" 
    body="$ while [ ! -e /dev/mmcblk1p1 ]; do sleep 1; echo \"waiting...\"; done ">Waiting for the partition ready</CMD>
  <CMD state="Updater" type="push" 
    body="$ mkfs.vfat /dev/mmcblk1p1">Formatting rootfs partition</CMD>
  <CMD state="Updater" type="push" 
    body="$ mkdir -p /mnt/mmcblk1p1"/>
  <CMD state="Updater" type="push" 
    body="$ mount -t vfat /dev/mmcblk1p1 /mnt/mmcblk1p1"/>
  <CMD state="Updater" type="push" 
    body="send" file="files/zImage">Sending kernel zImage</CMD>
  <CMD state="Updater" type="push" 
    body="$ cp $FILE /mnt/mmcblk1p1/zImage">write kernel image to sd card</CMD>
  <CMD state="Updater" type="push" 
    body="send" file="files/zImage-imx6ul-14x14-evk.dtb">Sending Device Tree file</CMD>
  <CMD state="Updater" type="push" 
    body="$ cp $FILE /mnt/mmcblk1p1/zImage-imx6ul-14x14-evk.dtb">write device tree to sd card</CMD>
  <CMD state="Updater" type="push" 
    body="$ umount /mnt/mmcblk1p1">Unmounting vfat partition</CMD>

不過從 emmc 開機顯示的錯誤如下

U-Boot 2015.04-imx_v2015.04_4.1.15_1.0.0_ga+g384e1c1 (Mar 13 2016 - 17:39:55)

CPU:   Freescale i.MX6UL rev1.2 at 396 MHz
CPU:   Temperature 43 C
Reset cause: POR
Board: MX6UL 14x14 EVK
I2C:   ready
DRAM:  512 MiB
force_idle_bus: sda=0 scl=0 sda.gp=0x1d scl.gp=0x1c
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

Display: TFT43AB (480x272)
Video: 480x272x24
In:    serial
Out:   serial
Err:   serial
MMC: no card present
Net:   FEC1
Error: FEC1 address not set.

Normal Boot
Hit any key to stop autoboot:  0
MMC: no card present
MMC: no card present
Card did not respond to voltage select!
Booting from net ...
FEC1 Waiting for PHY auto negotiation to complete......... TIMEOUT !
*** ERROR: `ethaddr' not set
FEC1 Waiting for PHY auto negotiation to complete......... TIMEOUT !
FEC1 Waiting for PHY auto negotiation to complete......... TIMEOUT !
*** ERROR: `ethaddr' not set
FEC1 Waiting for PHY auto negotiation to complete......... TIMEOUT !
Bad Linux ARM zImage magic!
=>

如果直接敲 run mmcboot 的話

=> run mmcboot
Booting from mmc ...
MMC: no card present
** Bad device mmc 1 **
Bad Linux ARM zImage magic!
=>

看來是下一個要突破的難關

有看到幾個人問差不多的問題

1700

做一下功課 看看怎麼幫我們家女兒報戶口

除了報戶口還有其他的需要辦理

我看我就一次做一樣就好了...

頂多就早上都請個兩個小時的假

08:00 就開始營業了

請假兩個小時從 08:30 到 10:30 的話看來綽綽有餘

就先搞定報戶口吧

⚠️ **GitHub.com Fallback** ⚠️