Environment of u-boot won't save in sd cart when boot from external sd card


(Weiqi Chen) #1

I testd, and with a switch on board, I can boot uboot from internal emmc and external sd card ( cold start-up ). It would be nice that it load/save environment in external sd card when it boot from external media. For example, u-boot can detect the status of the boot switch on board to do that.


(ZB) #2

Could you please show your operation steps or logs?


(Weiqi Chen) #3

I cross-compiled the u-boot from github. I did modify u-boot environment in code, and only modify uboot environment and uboot pompt.

I lost all local modification because I replase my disk to ssd, and reinstall new system. So here I can’t provide git diff result.

(I need to double check, it seem that the uboot in my sd card was erase before… Finally, compiled uboot again)

Here is the output of printenv in uboot

Boot from emmc

BPI-EMMC> printenv
arch=arm
baudrate=115200
board=bpi-r2
board_name=mt7623_evb
boot0=setenv mmc 0; run bootcmd
boot1=setenv mmc 1; run bootcmd
boot2=run bootcmd
boot3=setenv mmc 0; run bootfallback
boot4=setenv mmc 1; run bootfallback
bootargs=board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
bootcmd=mmc init $mmc; run loadbootenv; run uenvcmd
bootdelay=3
bootenv=uEnv.txt
bootfallback=mmc init $mmc; run loadbootenv; run ufallbackcmd
bootfile=iverson_uImage
bootmenu_0=1. Boot from internal emmc.=run boot0
bootmenu_1=2. Boot from external sd-card.=run boot1
bootmenu_2=3. Boot from default medium.=run boot2
bootmenu_3=4. Fallback boot from internam emmc.=run boot3
bootmenu_4=5. Fallback boot from external sd-card.=run boot4
bpi=bananapi
bpiver=1
chip=MT7623N
cpu=armv7
debug=7
device=mmc
ethact=mtk_eth
ethaddr=00:0C:E7:11:22:33
ipaddr=10.10.10.254
kernel=uImage
loadaddr=0x84000000
loadbootenv=fatload ${device} ${partition} ${scriptaddr} ${board}/${service}/${bootenv} ||fatload ${device} ${partition} ${scriptaddr} ${bootenv}; env import -t ${scriptaddr} ${filesize};
mmc=1
partition=0:1
scriptaddr=0x83000000
serverip=10.10.10.3
service=linux
soc=mt7623
stderr=serial
stdin=serial
stdout=serial
vendor=mediatek

Environment size: 1392/4092 bytes

Boot from SD

BPI-SD> printenv
arch=arm
baudrate=115200
board=bpi-r2
board_name=mt7623_evb
boot0=setenv mmc 0; run bootcmd
boot1=setenv mmc 1; run bootcmd
boot2=run bootcmd
boot3=setenv mmc 0; run bootfallback
boot4=setenv mmc 1; run bootfallback
bootargs=board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
bootcmd=mmc init $mmc; run loadbootenv; run uenvcmd
bootdelay=3
bootenv=uEnv.txt
bootfallback=mmc init $mmc; run loadbootenv; run ufallbackcmd
bootfile=iverson_uImage
bootmenu_0=1. Boot from internal emmc.=run boot0
bootmenu_1=2. Boot from external sd-card.=run boot1
bootmenu_2=3. Boot from default medium.=run boot2
bootmenu_3=4. Fallback boot from internam emmc.=run boot3
bootmenu_4=5. Fallback boot from external sd-card.=run boot4
bpi=bananapi
bpiver=1
chip=MT7623N
cpu=armv7
debug=7
device=mmc
ethact=mtk_eth
ethaddr=00:0C:E7:11:22:33
ipaddr=10.10.10.254
kernel=uImage
loadaddr=0x84000000
loadbootenv=fatload ${device} ${partition} ${scriptaddr} ${board}/${service}/${bootenv} ||fatload ${device} ${partition} ${scriptaddr} ${bootenv}; env import -t ${scriptaddr} ${filesize};
mmc=1
partition=0:1
scriptaddr=0x83000000
serverip=10.10.10.3
service=linux
soc=mt7623
stderr=serial
stdin=serial
stdout=serial
vendor=mediatek

Environment size: 1392/4092 bytes

Whether it is boot from emmc or sd, emmc always be mmc 0 , SD card always be mmc 1. It always save uboot environment to emmc when you type env save

BPI-SD> mmc init 0
BPI: SD/eMMC SD=1 eMMC=0 id = 0 (drivers/mmc/mediatek/mtk_mmc.c)
__mmc_init ret = 0
ret2 = 1
ret2 = 1
BPI: g_mtk_mmc_block.dev = 0
<= [mmc1 block 0] =>
[0x00000000] 00 00 00 00 00 00 00 00
[0x00000008] 00 00 00 00 00 00 00 00
[0x00000010] 00 00 00 00 00 00 00 00
[0x00000018] 00 00 00 00 00 00 00 00
[0x00000020] 00 00 00 00 00 00 00 00
[0x00000028] 00 00 00 00 00 00 00 00
[0x00000030] 00 00 00 00 00 00 00 00
[0x00000038] 00 00 00 00 00 00 00 00
[0x00000040] 00 00 00 00 00 00 00 00
[0x00000048] 00 00 00 00 00 00 00 00
[0x00000050] 00 00 00 00 00 00 00 00
[0x00000058] 00 00 00 00 00 00 00 00
[0x00000060] 00 00 00 00 00 00 00 00
[0x00000068] 00 00 00 00 00 00 00 00
[0x00000070] 00 00 00 00 00 00 00 00
[0x00000078] 00 00 00 00 00 00 00 00
[0x00000080] 00 00 00 00 00 00 00 00
[0x00000088] 00 00 00 00 00 00 00 00
[0x00000090] 00 00 00 00 00 00 00 00
[0x00000098] 00 00 00 00 00 00 00 00
[0x000000a0] 00 00 00 00 00 00 00 00
[0x000000a8] 00 00 00 00 00 00 00 00
[0x000000b0] 00 00 00 00 00 00 00 00
[0x000000b8] 00 00 00 00 00 00 00 00
[0x000000c0] 00 00 00 00 00 00 00 00
[0x000000c8] 00 00 00 00 00 00 00 00
[0x000000d0] 00 00 00 00 00 00 00 00
[0x000000d8] 00 00 00 00 00 00 00 00
[0x000000e0] 00 00 00 00 00 00 00 00
[0x000000e8] 00 00 00 00 00 00 00 00
[0x000000f0] 00 00 00 00 00 00 00 00
[0x000000f8] 00 00 00 00 00 00 00 00
[0x00000100] 00 00 00 00 00 00 00 00
[0x00000108] 00 00 00 00 00 00 00 00
[0x00000110] 00 00 00 00 00 00 00 00
[0x00000118] 00 00 00 00 00 00 00 00
[0x00000120] 00 00 00 00 00 00 00 00
[0x00000128] 00 00 00 00 00 00 00 00
[0x00000130] 00 00 00 00 00 00 00 00
[0x00000138] 00 00 00 00 00 00 00 00
[0x00000140] 00 00 00 00 00 00 00 00
[0x00000148] 00 00 00 00 00 00 00 00
[0x00000150] 00 00 00 00 00 00 00 00
[0x00000158] 00 00 00 00 00 00 00 00
[0x00000160] 00 00 00 00 00 00 00 00
[0x00000168] 00 00 00 00 00 00 00 00
[0x00000170] 00 00 00 00 00 00 00 00
[0x00000178] 00 00 00 00 00 00 00 00
[0x00000180] 00 00 00 00 00 00 00 00
[0x00000188] 00 00 00 00 00 00 00 00
[0x00000190] 00 00 00 00 00 00 00 00
[0x00000198] 00 00 00 00 00 00 00 00
[0x000001a0] 00 00 00 00 00 00 00 00
[0x000001a8] 00 00 00 00 00 00 00 00
[0x000001b0] 00 00 00 00 00 00 00 00
[0x000001b8] 56 d0 00 57 00 00 00 00
[0x000001c0] 01 80 83 03 10 7f 00 20
[0x000001c8] 03 00 00 00 08 00 00 00
[0x000001d0] 01 80 83 03 d0 ff 00 20
[0x000001d8] 0b 00 00 e0 dd 00 00 00
[0x000001e0] 00 00 00 00 00 00 00 00
[0x000001e8] 00 00 00 00 00 00 00 00
[0x000001f0] 00 00 00 00 00 00 00 00
[0x000001f8] 00 00 00 00 00 00 55 aa

Partition Map for MMC device 0  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	204800    	524288    	5700d056-01	83
  2	729088    	14540800  	5700d056-02	83
mmc0 is available
BPI-SD> mmc init 1
BPI: SD/eMMC SD=1 eMMC=0 id = 1 (drivers/mmc/mediatek/mtk_mmc.c)
__mmc_init ret = 0
ret2 = 1
ret2 = 1
BPI: g_mtk_mmc_block.dev = 1
<= [mmc1 block 0] =>
[0x00000000] 53 44 4d 4d 43 5f 42 4f
[0x00000008] 4f 54 00 00 01 00 00 00
[0x00000010] 00 02 00 00 ff ff ff ff
[0x00000018] ff ff ff ff ff ff ff ff
[0x00000020] ff ff ff ff ff ff ff ff
[0x00000028] ff ff ff ff ff ff ff ff
[0x00000030] ff ff ff ff ff ff ff ff
[0x00000038] ff ff ff ff ff ff ff ff
[0x00000040] ff ff ff ff ff ff ff ff
[0x00000048] ff ff ff ff ff ff ff ff
[0x00000050] ff ff ff ff ff ff ff ff
[0x00000058] ff ff ff ff ff ff ff ff
[0x00000060] ff ff ff ff ff ff ff ff
[0x00000068] ff ff ff ff ff ff ff ff
[0x00000070] ff ff ff ff ff ff ff ff
[0x00000078] ff ff ff ff ff ff ff ff
[0x00000080] ff ff ff ff ff ff ff ff
[0x00000088] ff ff ff ff ff ff ff ff
[0x00000090] ff ff ff ff ff ff ff ff
[0x00000098] ff ff ff ff ff ff ff ff
[0x000000a0] ff ff ff ff ff ff ff ff
[0x000000a8] ff ff ff ff ff ff ff ff
[0x000000b0] ff ff ff ff ff ff ff ff
[0x000000b8] ff ff ff ff ff ff ff ff
[0x000000c0] ff ff ff ff ff ff ff ff
[0x000000c8] ff ff ff ff ff ff ff ff
[0x000000d0] ff ff ff ff ff ff ff ff
[0x000000d8] ff ff ff ff ff ff ff ff
[0x000000e0] ff ff ff ff ff ff ff ff
[0x000000e8] ff ff ff ff ff ff ff ff
[0x000000f0] ff ff ff ff ff ff ff ff
[0x000000f8] ff ff ff ff ff ff ff ff
[0x00000100] ff ff ff ff ff ff ff ff
[0x00000108] ff ff ff ff ff ff ff ff
[0x00000110] ff ff ff ff ff ff ff ff
[0x00000118] ff ff ff ff ff ff ff ff
[0x00000120] ff ff ff ff ff ff ff ff
[0x00000128] ff ff ff ff ff ff ff ff
[0x00000130] ff ff ff ff ff ff ff ff
[0x00000138] ff ff ff ff ff ff ff ff
[0x00000140] ff ff ff ff ff ff ff ff
[0x00000148] ff ff ff ff ff ff ff ff
[0x00000150] ff ff ff ff ff ff ff ff
[0x00000158] ff ff ff ff ff ff ff ff
[0x00000160] ff ff ff ff ff ff ff ff
[0x00000168] ff ff ff ff ff ff ff ff
[0x00000170] ff ff ff ff ff ff ff ff
[0x00000178] ff ff ff ff ff ff ff ff
[0x00000180] ff ff ff ff ff ff ff ff
[0x00000188] ff ff ff ff ff ff ff ff
[0x00000190] ff ff ff ff ff ff ff ff
[0x00000198] ff ff ff ff ff ff ff ff
[0x000001a0] ff ff ff ff ff ff ff ff
[0x000001a8] ff ff ff ff ff ff ff ff
[0x000001b0] ff ff ff ff ff ff ff ff
[0x000001b8] 58 1d 96 37 00 00 00 00
[0x000001c0] 01 80 83 03 10 7f 00 20
[0x000001c8] 03 00 00 00 08 00 00 00
[0x000001d0] 01 80 83 03 d0 2f 00 20
[0x000001d8] 0b 00 00 ac cf 01 00 00
[0x000001e0] 00 00 00 00 00 00 00 00
[0x000001e8] 00 00 00 00 00 00 00 00
[0x000001f0] 00 00 00 00 00 00 00 00
[0x000001f8] 00 00 00 00 00 00 55 aa

Partition Map for MMC device 1  --   Partition Type: DOS

Part	Start Sector	Num Sectors	UUID		Type
  1	204800    	524288    	37961d58-01	83
  2	729088    	30387200  	37961d58-02	83
mmc1 is available

save command

BPI-SD> save env
saveenv - save environment variables to persistent storage

Usage:
saveenv 
BPI-SD> save
Saving Environment to MMC...
dev_num = 0
Writing to MMC(0)... offset=1536 
size=4096 
mmc->write_bl_len=512
done
BPI-SD> 
``

(Weiqi Chen) #4

uEnv.txt and My storages:

$ cat /boot/firmware/uEnv.txt 
bpi=bananapi
board=bpi-r2
chip=mt7623n
#
kernel=uImage
initrd=uInitrd
dtb=mt7623n-bpi-r2.dtb
#
target=4.14.19-bpi-r2
fallback=4.4.70-bpi-r2-2
root=PARTUUID="37961d58-02" rootfstype=ext4 rootwait
#
kaddr=0x84000000
rdaddr=0x86000000
dtaddr=0x88000000
#
console=earlyprintk console=tty1 console=ttyS0,115200 fbcon=map:0
bootopts=vmalloc=496M debug=7 initcall_debug=0
abootargs=setenv bootargs board=${board} console=${console} root=${root} service=${service} ${bootopts}
ahello=echo Banana Pi ${board} chip: $chip Service: $service
## load kernel
aload_kernel_cmd=fatload $device $partition $kaddr ${board}/${service}/${kernel}
aload_kernel=if run aload_kernel_cmd ; then echo Kernel loaded. ; else exit; fi
## load initrd
aload_initrd_cmd=fatload $device $partition $rdaddr ${board}/${service}/${initrd}
aload_initrd=if run aload_initrd_cmd; then echo Initrd loaded. ; else set rdaddr - ; fi
## load device tree
aload_device_tree_cmd=fatload $device $partition $rdaddr ${board}/${service}/${dtb}
aload_device_tree=if run aload_device_tree_cmd; then echo Device Tree loaded. ; else set dtaddr - ; fi
##bootm
abootm=bootm $kaddr $rdaddr $dtaddr
#
uenvcmd=setenv service ${target}; run ahello abootargs aload_kernel aload_initrd aload_device_tree abootm
ufallbackcmd=setenv service ${fallback}; run ahello abootargs aload_kernel aload_initrd aload_device_tree abootm
########################################################
########################################################
########################################################
########################################################

$ lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mmcblk0      179:0    0 14.9G  0 disk 
├─mmcblk0p1  179:1    0  256M  0 part /boot/firmware
└─mmcblk0p2  179:2    0 14.5G  0 part /
mmcblk1      179:8    0  7.3G  0 disk 
├─mmcblk1p1  179:9    0  256M  0 part 
└─mmcblk1p2  179:10   0    7G  0 part 
mmcblk1boot0 179:16   0    4M  1 disk 
mmcblk1boot1 179:24   0    4M  1 disk 
mmcblk1rpmb  179:32   0  512K  0 disk 


(Weiqi Chen) #5

How I compiled u-boot and flash to sd card

u-boot source code diff


--- a/u-boot-mt/Makefile
+++ b/u-boot-mt/Makefile
@@ -206,7 +206,7 @@ CROSS_COMPILE ?=
 endif
 
 CROSS_COMPILE_PATH = /opt/buildroot-gcc463_arm/usr/bin
-CROSS_COMPILE = $(CROSS_COMPILE_PATH)/arm-buildroot-linux-uclibcgnueabi-
+CROSS_COMPILE = arm-none-eabi-
 
 # SHELL used by kbuild
 CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
--- a/u-boot-mt/include/configs/mt7623_evb.h
+++ b/u-boot-mt/include/configs/mt7623_evb.h
@@ -479,7 +479,7 @@
  **********************************************************************************************/
 /* Shell */
 #define CONFIG_SYS_MAXARGS                         32
-#define CONFIG_SYS_PROMPT                          "BPI-IoT> "
+#define CONFIG_SYS_PROMPT                          "BPI-SD> "
 #define CONFIG_COMMAND_HISTORY
 
 /* Commands */

.config

#
# Automatically generated by make menuconfig: don't edit
#
MT7623=y
# MT7622 is not set
# FPGA is not set
ASIC=y
MT7623_ASIC_BOARD=y
# ON_BOARD_NAND_FLASH_COMPONENT is not set
# ON_BOARD_SPI_FLASH_COMPONENT is not set
ON_BOARD_EMMC_COMPONENT=y
# OFF_BOARD_SD_CARD_COMPONENT is not set
PDMA_NEW=y
RX_SCATTER_GATTER_DMA=y
CONFIG_USE_GE1=y
# CONFIG_USE_GE2 is not set
GE_MII_FORCE_100=y
# GE_RVMII_FORCE_100 is not set
# GE_MII_AN is not set
# GE_RGMII_FORCE_1000 is not set
# GE_RGMII_AN is not set
# CONFIG_GE1_TRGMII_FORCE_2600 is not set
MAC_TO_100SW_MODE=y
None=y
# FW_UPGRADE_BY_USB is not set
# FW_UPGRADE_BY_SDXC is not set
# FW_UPGRADE_BY_WEBUI is not set
# DUAL_IMAGE_SUPPORT is not set

flashing to sd card

#!/bin/bash

target=/dev/mmcblk0

gunzip -c BPI-R2-HEAD440-0k.img.gz | \
	    sudo dd of=$target bs=440 seek=0 count=1

gunzip -c BPI-R2-HEAD1-512b.img.gz | \
	    sudo dd of=$target bs=512 seek=1 

gunzip -c BPI-R2-preloader-2k.img.gz | \
	    sudo dd of=$target bs=1k seek=2

sudo dd if=u-boot-sd.bin bs=1k seek=320 of=$target

(Weiqi Chen) #6
BPI-SD> set env_in_sd 1
BPI-SD> printenv
arch=arm
baudrate=115200
board=bpi-r2
board_name=mt7623_evb
boot0=setenv mmc 0; run bootcmd
boot1=setenv mmc 1; run bootcmd
boot2=run bootcmd
boot3=setenv mmc 0; run bootfallback
boot4=setenv mmc 1; run bootfallback
bootargs=board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
bootcmd=mmc init $mmc; run loadbootenv; run uenvcmd
bootdelay=3
bootenv=uEnv.txt
bootfallback=mmc init $mmc; run loadbootenv; run ufallbackcmd
bootfile=iverson_uImage
bootmenu_0=1. Boot from internal emmc.=run boot0
bootmenu_1=2. Boot from external sd-card.=run boot1
bootmenu_2=3. Boot from default medium.=run boot2
bootmenu_3=4. Fallback boot from internam emmc.=run boot3
bootmenu_4=5. Fallback boot from external sd-card.=run boot4
bpi=bananapi
bpiver=1
chip=MT7623N
cpu=armv7
debug=7
device=mmc
env_in_sd=1
ethact=mtk_eth
ethaddr=00:0C:E7:11:22:33
ipaddr=10.10.10.254
kernel=uImage
loadaddr=0x84000000
loadbootenv=fatload ${device} ${partition} ${scriptaddr} ${board}/${service}/${bootenv} ||fatload ${device} ${partition} ${scriptaddr} ${bootenv}; env import -t ${scriptaddr} ${filesize};
mmc=1
partition=0:1
scriptaddr=0x83000000
serverip=10.10.10.3
service=linux
soc=mt7623
stderr=serial
stdin=serial
stdout=serial
vendor=mediatek

Environment size: 1406/4092 bytes
BPI-SD> save
Saving Environment to MMC...
dev_num = 0
Writing to MMC(0)... offset=1536 
size=4096 
mmc->write_bl_len=512
done
BPI-SD>

Turn off BPI, switch the boot switch to emmc

BPI-EMMC> printenv
arch=arm
baudrate=115200
board=bpi-r2
board_name=mt7623_evb
boot0=setenv mmc 0; run bootcmd
boot1=setenv mmc 1; run bootcmd
boot2=run bootcmd
boot3=setenv mmc 0; run bootfallback
boot4=setenv mmc 1; run bootfallback
bootargs=board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
bootcmd=mmc init $mmc; run loadbootenv; run uenvcmd
bootdelay=3
bootenv=uEnv.txt
bootfallback=mmc init $mmc; run loadbootenv; run ufallbackcmd
bootfile=iverson_uImage
bootmenu_0=1. Boot from internal emmc.=run boot0
bootmenu_1=2. Boot from external sd-card.=run boot1
bootmenu_2=3. Boot from default medium.=run boot2
bootmenu_3=4. Fallback boot from internam emmc.=run boot3
bootmenu_4=5. Fallback boot from external sd-card.=run boot4
bpi=bananapi
bpiver=1
chip=MT7623N
cpu=armv7
debug=7
device=mmc
env_in_sd=1
ethact=mtk_eth
ethaddr=00:0C:E7:11:22:33
ipaddr=10.10.10.254
kernel=uImage
loadaddr=0x84000000
loadbootenv=fatload ${device} ${partition} ${scriptaddr} ${board}/${service}/${bootenv} ||fatload ${device} ${partition} ${scriptaddr} ${bootenv}; env import -t ${scriptaddr} ${filesize};
mmc=1
partition=0:1
scriptaddr=0x83000000
serverip=10.10.10.3
service=linux
soc=mt7623
stderr=serial
stdin=serial
stdout=serial
vendor=mediatek

Environment size: 1406/4092 bytes
BPI-EMMC> 

have that env_in_sd=1.


(Frank W.) #7

do i understand you right, that environment is stored always on emmc? where is the boot-switch? i know a uboot-key (button on right side next to sd-card-slot, but on top)


(Weiqi Chen) #8

that environment is stored always on emmc?

Yes

where is the boot-switch? i know a uboot-key (button on right side next to sd-card-slot, but on top)

the switch at the left side

PCB VERSION v1.2


(Frank W.) #9

ok, that switch does not exist in PCB v1.1

but uboot should store its environment from where it is loaded…if loaded from sd-card it should write it there and if loaded from emmc on emmc


(Weiqi Chen) #10

Is anyone can do a test ?? just use an empty sd card to test it.


(gary) #11

Thanks for your information, we will check this.


#12

hello weiqi_chen

I did some quick test and it works but only for first time. My board is a v1.1 but I think it does not matter here. I build the current LEDE image from garywang’s git. So no modifications from my side here. I put the image on a fresh µSD and boot from it.

I have marked some lines in dobble quotes on some relevant lines on which you should also look on your boot:

Here my outputs:

booting from fresh µSD

[USBD] USB PRB0 LineState: 0

[USBD] USB cable/ No Cable inserted!

[PLFM] Keep stay in USB Mode
Platform initialization is ok
wait for frequency meter finish, CLK26CALI = 0x81
mt_pll_post_init: mt_get_cpu_freq = 1040000Khz
wait for frequency meter finish, CLK26CALI = 0x90
mt_pll_post_init: mt_get_bus_freq = 273000Khz
wait for frequency meter finish, CLK26CALI = 0x81
mt_pll_post_init: mt_get_mem_freq = 133250Khz
[PWRAP] pwrap_init_preloader
[PWRAP] pwrap_init
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=0,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=1,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=2,rdata=800
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=3 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=4 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=5 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=6 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=7 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=8 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=9 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=10,rdata=1001
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=11,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=12,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=13,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=14,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=15,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=16,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=17,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=18,rdata=2003
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=19,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=20,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=21,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=22,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=23,rdata=6A97
[PWRAP] _pwrap_init_reg_clock
[PMIC_WRAP]wrap_init pass,the return value=0.
[pmic6323_init] Preloader Start..................
[pmic6323_init] PMIC CHIP Code = 0x2023
INT_MISC_CON: 1  TOP_RST_MISC: 0
pl pmic powerkey Release
[pmic6323_init] powerKey = 0
[pmic6323_init] is USB in = 0xB004
[pmic6323_init] Reg[0x11A]=0x1B
pmic setup LED
[pmic6323_init] Done...................
mt7623 disable long press reset ->>>>>
mt7623 disable long press reset <<<<<-
mt7623 VPA supplied by 1.0V to MT7530 ->
mt7623 VPA supplied by 1.0V to MT7530 <-
mt7623 enables RG_VGP1_EN for LCM ->
mt7623 enables RG_VGP1_EN for LCM <-
MT7623 E2 setting =>
MT7623 E2 setting <=
[PLFM] Init I2C: OK(0)
[PLFM] Init PWRAP: OK(0)
[PLFM] Init PMIC: OK(0)
[PLFM] chip[CA00]

[BLDR] [Support SD/eMMC] Build Time: 20180108-204436
==== Dump RGU Reg ========
RGU MODE:     4D
RGU LENGTH:   FFE0
RGU STA:      0
RGU INTERVAL: FFF
RGU SWSYSRST: 0
==== Dump RGU Reg End ====
RGU: g_rgu_satus:0
 mtk_wdt_mode_config  mode value=10, tmp:22000010
PL P ON
WDT does not trigger reboot
RGU mtk_wdt_init:MTK_WDT_DEBUG_CTL(590200F3)
kpd read addr: 0x0040: data:0x4001
Enter mtk_kpd_gpio_set! 
kpd debug column : 0, 0, 0, 0, 0, 0, 0, 0
kpd debug row : 0, 0, 0, 0, 0, 0, 0, 0
after set KP enable: KP_SEL = 0x0 !
MTK_PMIC_RST_KEY is used for this project!
[RTC] get_frequency_meter: input=0x0, ouput=5
[RTC] get_frequency_meter: input=0x0, ouput=3967
[RTC] get_frequency_meter: input=0x0, ouput=5
[RTC] get_frequency_meter: input=0x0, ouput=0
[RTC] get_frequency_meter: input=0x0, ouput=0
[RTC] bbpu = 0xD, con = 0x427
[RTC] powerkey1 = 0xA357, powerkey2 = 0x67D2
Writeif_unlock
[RTC] RTC_SPAR0=0x40 
rtc_2sec_reboot_check cali=1792
rtc_2sec_stat_clear
[RTC] irqsta = 0x0, pdn1 = 0x0, pdn2 = 0x201, spar0 = 0x40, spar1 = 0x800
[RTC] new_spare0 = 0x0, new_spare1 = 0x1, new_spare2 = 0x1, new_spare3 = 0x1
[RTC] bbpu = 0xD, con = 0x426, cali = 0x700
pl pmic powerkey Release
[PLFM] Power key boot!
[RTC] rtc_bbpu_power_on done
[EMI] mcp_dram_num:0,discrete_dram_num:1,enable_combo_dis:0
[EMI] PCDDR3
[Check]mt_get_mdl_number 0x0
[EMI] eMMC/NAND ID = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
[EMI] MDL number = 0
[EMI] emi_set eMMC/NAND ID = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
[EMI][Vcore]0x21E=0x48,0x220=0x48
[EMI][Vmem]0x554=0x0
wait for frequency meter finish, CLK26CALI = 0x81
[EMI] PCDDR3 DRAM Clock = 1600012 KHz, MEMPLL MODE = 2 
[EMI] PCDDR3 RXTDN Calibration:
Start REXTDN SW calibration...
drvp=0xB,drvn=0x9
[EMI] pinmux = 4
===============================================================================

        dramc_write_leveling_swcal
===============================================================================
delay  byte0  byte1  byte2  byte3
-----------------------------
0    0    0    0    0    
1    0    0    0    1    
2    0    0    0    1    
3    0    1    0    1    
4    0    1    1    1    
5    0    1    1    1    
6    0    1    1    1    
7    0    1    1    1    
8    1    1    1    1    
9    1    1    1    1    
10    1    1    1    1    
11    1    1    1    1    
12    1    1    1    1    
13    1    1    1    1    
14    1    1    1    1    
15    1    1    1    1    
pass bytecount = 4
byte_i    status    best delay
0    2    8
1    2    3
2    2    4
3    2    1
========================================
[write leveling]DQS: 0x1438, DQM: 0x1438
[write leveling after remap]DQ byte0 reg: 0x200 val: 0x88883333
[write leveling after remap]DQ byte1 reg: 0x204 val: 0x33338888
[write leveling after remap]DQ byte2 reg: 0x208 val: 0x44441111
[write leveling after remap]DQ byte3 reg: 0x20C val: 0x11114444
=============================================
X-axis: DQS Gating Window Delay (Fine Scale)
Y-axis: DQS Gating Window Delay (Coarse Scale)
=============================================
          0    8   16   24   32   40   48   56   64   72   80   88   96  104  112  120
      --------------------------------------------------------------------------------
0000:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0001:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0002:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0003:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0004:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0005:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0006:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0007:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0008:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0009:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000E:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000F:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0010:|    0    0    0    0    0    0    0    0    0    0    0    0    0    1    1    1
0011:|    0    0    0    0    0    0    0    0    1    1    1    1    1    1    1    1
0012:|    0    0    0    1    1    1    1    1    1    1    1    1    1    0    0    0
0013:|    1    1    1    1    1    1    1    1    0    0    0    0    0    0    0    0
0014:|    1    1    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0015:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0016:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0017:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0018:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0019:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001E:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001F:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
Rank 0 coarse tune value selection : 18, 18
18
64
rank 0 coarse = 18
rank 0 fine = 64
00:|    0    0    0    0    0    0    0    0    1    1    1    0
opt_dle value:13
==================================================================
                RX      DQS perbit delay software calibration 
==================================================================
1.0-31 bit dq delay value
==================================================================
bit|     0  1  2  3  4  5  6  7  8  9
--------------------------------------
0 |    0 0 0 0 0 0 0 0 0 0 
10 |    0 0 0 0 0 0 0 0 0 0 
20 |    0 0 0 0 0 0 0 0 0 0 
30 |    0 0 
--------------------------------------
==================================================================
2.dqs window
x=pass dqs delay value (min~max)center 
y=0-7bit DQ of every group
input delay:DQS0 =48 DQS1 = 40 DQS2 =52 DQS3 = 43
==================================================================
bit     DQS0     bit      DQS1     bit     DQS2     bit     DQS3
0  (19~68)43  8  (9~58)33  16  (22~67)44  24  (17~60)38
1  (19~68)43  9  (9~61)35  17  (21~69)45  25  (17~61)39
2  (19~68)43  10  (10~63)36  18  (23~71)47  26  (18~63)40
3  (18~67)42  11  (13~63)38  19  (21~69)45  27  (19~61)40
4  (22~74)48  12  (17~63)40  20  (24~76)50  28  (21~66)43
5  (21~67)44  13  (16~60)38  21  (23~68)45  29  (20~62)41
6  (21~68)44  14  (11~60)35  22  (26~72)49  30  (17~62)39
7  (25~72)48  15  (15~63)39  23  (31~74)52  31  (20~64)42
==================================================================
3.dq delay value last
==================================================================
bit|    0  1  2  3  4  5  6  7  8   9
--------------------------------------
0 |    5 5 5 6 0 4 4 0 7 5 
10 |    4 2 0 2 5 1 8 7 5 7 
20 |    2 7 3 0 5 4 3 3 0 2 
30 |    4 1 
==================================================================
*DQIDLY1 = 0x6050505
*DQIDLY2 = 0x40400
*DQIDLY3 = 0x2040507
*DQIDLY4 = 0x1050200
*DQIDLY5 = 0x7050708
*DQIDLY6 = 0x30702
*DQIDLY7 = 0x3030405
*DQIDLY8 = 0x1040200
*DRAMC_R0DELDLY = 0x2B342830

[MEM]CONA:F3A2,conf1:F07486A3
DM4BitMux = 1 
DQSO 0 in TX per-bit = 1 <= DQSO 0 in WL = 8  
DQSO 1 in TX per-bit = 0 <= DQSO 1 in WL = 3  
[Warning] DQSO 2 in TX per-bit = 8 > DQSO 2 in WL = 4  
[Warning] DQSO 3 in TX per-bit = 9 > DQSO 3 in WL = 1  
Tx DQM dly  = 0x2068
Tx DQM dly bit4 = 0x0
DRAMC_DQODLY1=78986776h
DRAMC_DQODLY2=69669799h
DRAMC_DQODLY3=103123h
DRAMC_DQODLY4=32201013h
Tx DQ dly bit4 = 0x0
Tx DQS dly = 0x9838
Tx DQS dly bit4 = 0x0
TX Byte0: DQ - 16, DQS - 17. win_sum= 32
TX Byte1: DQ - 20, DQS - 12. win_sum= 31
TX Byte2: DQ - 9, DQS - 22. win_sum= 30
TX Byte3: DQ - 8, DQS - 22. win_sum= 29
DRAMC calibration takes 651954528 CPU cycles

[EMI] DRAMC calibration passed

[MEM] complex R/W mem test pass
0:dram_rank_size:80000000
[Dram_Buffer] dram size:-2147483648 
[Dram_Buffer] structure size: 1725560 
[Dram_Buffer] MAX_TEE_DRAM_SIZE: 0 
"Load u-boot from SD Card..."
[PLFM] Init Boot Device: OK(0)

[PART] blksz: 512B
[PART] [0x0000000000000000-0x000000000003FFFF] "PRELOADER" (512 blocks) 
[PART] [0x0000000000000000-0x000000000003FFFF] "MBR" (512 blocks) 
[PART] [0x0000000000040000-0x00000000000BFFFF] "UBOOT" (1024 blocks) 
[PART] [0x00000000000C0000-0x00000000000FFFFF] "CONFIG" (512 blocks) 
[PART] [0x0000000000100000-0x000000000013FFFF] "FACTORY" (512 blocks) 
[PART] [0x0000000000140000-0x000000000213FFFF] "BOOTIMG" (65536 blocks) 
[PART] [0x0000000002140000-0x000000000413FFFF] "RECOVERY" (65536 blocks) 
[PART] [0x0000000004140000-0x000000004413FFFF] "ROOTFS" (2097152 blocks) 
[PART] [0x0000000044140000-0x000001FFC413FFFF] "USER" (-4194304 blocks) 
[platform_vusb_on] PASS
[TOOL] PMIC not dectect usb cable!
[TOOL] <UART> listen  ended, receive size:0!
[TOOL] <UART> wait sync time 150ms->5ms
[TOOL] <UART> receieved data: ()

Device APC domain init setup:

 bootloader load uboot ,the address of uboot is 81E00000 
[PART]partition name UBOOT 
[PART]partition start block 0x200 
[PART]partition size 0x80000 
[PART]partition blks 0x400 
[PART]partition flags 0x0 
[PART]partition name 0x8 
[bean] part->startblk(0x200) bdev->blksz(0x200) part->part_id(8) hdr(0xFFB50000)
[BlkDev.c 101 ]partition block size 0x200 ,blks:0xED8000
[BlkDev.c 101 ]partition block erase size 0x200 

[PART] load "UBOOT" from 0x0000000000050000 (dev) to 0x81E00000 (mem) [SUCCESS]
[PART] load speed: 5744KB/s, 300000 bytes, 51ms
[BT_SD_PG] device info 0x8590 0x8A00 0xCB01 0x102
0:dram_rank_size:80000000
[PLFM] md_type[0] = 0 
[PLFM] md_type[1] = 0 

[PLFM] boot reason: 0
[PLFM] boot mode: 0
[PLFM] META COM0: 0
[PLFM] <0xFFB7CC10>: 0x0
[PLFM] boot time: 1903ms
[PLFM] DDR reserve mode: enable = 0, success = 0

[BLDR] jump to 0x81E00000
[BLDR] <0x81E00000>=0xEA00000F
[BLDR] <0x81E00004>=0xE59FF014


U-Boot 2014.04-rc1 (Feb 25 2018 - 21:36:32)

g_nr_bank = 1.
g_total_rank_size = 0x80000000
DRAM:  2 GiB
WARNING: Caches not enabled
MMC:     emmc: 0,  sdcard: 1
"booting from SD card"
dev_num = 1
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
bootargs = board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
Net:   Eth0
Uip activated
Hit any key to stop autoboot:  0 
"BPI-R2> printenv "
arch=arm
baudrate=115200
board=bpi-r2
board_name=bpi_r2
boot0=tftpboot; bootm
boot1=tftpboot;run boot_wr_img;run boot_rd_img;bootm
boot10=mmc init; run boot_normal; bootm
boot2=run boot_rd_img;run rescue;bootm
boot3=tftpboot ${loadaddr} u-boot-mtk.bin;run wr_uboot
boot4=loadb;run boot_wr_img;run boot_rd_img;bootm
boot5=loadb;run wr_uboot
boot6=usb start;run boot_wr_img;bootm
boot7=http_upgrade 10.10.10.1;run boot_wr_img;run boot_rd_img;bootm
boot8=mmc init; fatload mmc 0:1 ${loadaddr} CONFIG_UPGFILE;run boot_wr_img; bootm
boot9=mmc init; fatload mmc 0:1 ${loadaddr} ${bpi}/${board}/${service}/${kernel}; bootm
boot_normal=if run checksd; then echo Boot from SD ; setenv partition 1:1; else echo Boot from eMMC ; mmc init 0 ; setenv partition 0:1 ; fi; if run loadbootenv; then echo Loaded environment frm
boot_rd_img=mmc device 0;mmc read ${loadaddr} 0xA00 1;image_blks 512;mmc read ${loadaddr} 0xA00 ${img_blks}
boot_rd_sec_img=mmc device 0;mmc read ${loadaddr} 0x10A00 1;image_blks 512;mmc read ${loadaddr} 0x10A00 ${img_blks}
boot_wr_img=image_check; if test ${img_result} = good; then image_blks 512 ${filesize};mmc device 0;mmc write ${loadaddr} 0xA00 ${img_blks}; fi
boot_wr_sec_img=image_check; if test ${img_result} = good; then image_blks 512 ${filesize};mmc device 0;mmc write ${loadaddr} 0x10A00 ${img_blks}; fi
bootargs=board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
bootcmd=run getbootdevice; mmc dev ${bootdevice}; mmc read ${kerneladdr} 1000 6000; run configBootargs; bootm ${kerneladdr};
bootdelay=3
bootemmc=false
bootenv=uEnv.txt
bootfile=uImage
bootmenu_delay=30
bpi=bananapi
bpiver=1
checksd=fatinfo ${device} 1:1
chip=MT7623N
configBootargs=run getbootdevice; setenv bootargs earlyprintk block2mtd.block2mtd=/dev/mmcblk${bootdevice},65536,RootFs,5 mtdparts=RootFs:512k(mbr)ro,512k(uboot)ro,512k(config)ro,512k(factory)r2
cpu=armv7
debug=7
device=mmc
duimage_backup=mmc device 0;mmc read ${loadaddr} 0x10A00 1;image_check; if test ${img_result} = bad;then run boot_rd_img; serious_image_check; if test ${img_result} = good; then backup_message;i
duimage_recovery=serious_image_check; if test ${img_result} = bad; then run boot_rd_sec_img;serious_image_check; if test ${img_result} = good; then reco_message; run boot_wr_img; fi; fi
ethact=Eth0
ethaddr=00:0C:E7:11:22:33
getbootdevice=setenv bootdevice 1; if test ${bootemmc} = true; then setenv bootdevice 0; fi;
"ipaddr=10.10.10.254"
kernel=uImage
kerneladdr=0x84000000
loadaddr=0x84000000
loadbootenv=fatload ${device} ${partition} ${scriptaddr} ${bpi}/${board}/${service}/${bootenv} || fatload ${device} ${partition} ${scriptaddr} ${bootenv}
partition=1:1
root=/dev/mmcblk0p2
scriptaddr=0x83000000
serverip=10.10.10.1
service=linux
soc=mt7623
stderr=serial
stdin=serial
stdout=serial
vendor=bananapi
wr_uboot=uboot_check;if test ${uboot_result} = good; then mmc device 0;mmc write ${loadaddr} 0x200 0x200;reset; fi

Environment size: 3373/16380 bytes
"BPI-R2> setenv ipaddr 99.99.99.99"
"BPI-R2> saveenv"
Saving Environment to MMC...
dev_num = 1
Writing to MMC(1)... 
offset=1048576 
size=16384 
done
"BPI-R2> printenv"
arch=arm
baudrate=115200
board=bpi-r2
board_name=bpi_r2
boot0=tftpboot; bootm
boot1=tftpboot;run boot_wr_img;run boot_rd_img;bootm
boot10=mmc init; run boot_normal; bootm
boot2=run boot_rd_img;run rescue;bootm
boot3=tftpboot ${loadaddr} u-boot-mtk.bin;run wr_uboot
boot4=loadb;run boot_wr_img;run boot_rd_img;bootm
boot5=loadb;run wr_uboot
boot6=usb start;run boot_wr_img;bootm
boot7=http_upgrade 10.10.10.1;run boot_wr_img;run boot_rd_img;bootm
boot8=mmc init; fatload mmc 0:1 ${loadaddr} CONFIG_UPGFILE;run boot_wr_img; bootm
boot9=mmc init; fatload mmc 0:1 ${loadaddr} ${bpi}/${board}/${service}/${kernel}; bootm
boot_normal=if run checksd; then echo Boot from SD ; setenv partition 1:1; else echo Boot from eMMC ; mmc init 0 ; setenv partition 0:1 ; fi; if run loadbootenv; then echo Loaded environment frm
boot_rd_img=mmc device 0;mmc read ${loadaddr} 0xA00 1;image_blks 512;mmc read ${loadaddr} 0xA00 ${img_blks}
boot_rd_sec_img=mmc device 0;mmc read ${loadaddr} 0x10A00 1;image_blks 512;mmc read ${loadaddr} 0x10A00 ${img_blks}
boot_wr_img=image_check; if test ${img_result} = good; then image_blks 512 ${filesize};mmc device 0;mmc write ${loadaddr} 0xA00 ${img_blks}; fi
boot_wr_sec_img=image_check; if test ${img_result} = good; then image_blks 512 ${filesize};mmc device 0;mmc write ${loadaddr} 0x10A00 ${img_blks}; fi
bootargs=board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
bootcmd=run getbootdevice; mmc dev ${bootdevice}; mmc read ${kerneladdr} 1000 6000; run configBootargs; bootm ${kerneladdr};
bootdelay=3
bootemmc=false
bootenv=uEnv.txt
bootfile=uImage
bootmenu_delay=30
bpi=bananapi
bpiver=1
checksd=fatinfo ${device} 1:1
chip=MT7623N
configBootargs=run getbootdevice; setenv bootargs earlyprintk block2mtd.block2mtd=/dev/mmcblk${bootdevice},65536,RootFs,5 mtdparts=RootFs:512k(mbr)ro,512k(uboot)ro,512k(config)ro,512k(factory)r2
cpu=armv7
debug=7
device=mmc
duimage_backup=mmc device 0;mmc read ${loadaddr} 0x10A00 1;image_check; if test ${img_result} = bad;then run boot_rd_img; serious_image_check; if test ${img_result} = good; then backup_message;i
duimage_recovery=serious_image_check; if test ${img_result} = bad; then run boot_rd_sec_img;serious_image_check; if test ${img_result} = good; then reco_message; run boot_wr_img; fi; fi
ethact=Eth0
ethaddr=00:0C:E7:11:22:33
getbootdevice=setenv bootdevice 1; if test ${bootemmc} = true; then setenv bootdevice 0; fi;
"ipaddr=99.99.99.99"
kernel=uImage
kerneladdr=0x84000000
loadaddr=0x84000000
loadbootenv=fatload ${device} ${partition} ${scriptaddr} ${bpi}/${board}/${service}/${bootenv} || fatload ${device} ${partition} ${scriptaddr} ${bootenv}
partition=1:1
root=/dev/mmcblk0p2
scriptaddr=0x83000000
serverip=10.10.10.1
service=linux
soc=mt7623
stderr=serial
stdin=serial
stdout=serial
vendor=bananapi
wr_uboot=uboot_check;if test ${uboot_result} = good; then mmc device 0;mmc write ${loadaddr} 0x200 0x200;reset; fi

Environment size: 3372/16380 bytes
"BPI-R2> reset"
resetting ...
UB WDT_HW_Reset
 mtk_wdt_mode LK config  mode value=10
 mtk_wdt_mode_config LK  mode value=51, tmp:22000051

booting twice with µSD to be sure that settings are stored

[USBD] USB PRB0 LineState: 0

[USBD] USB cable/ No Cable inserted!

[PLFM] Keep stay in USB Mode
Platform initialization is ok
wait for frequency meter finish, CLK26CALI = 0x81
mt_pll_post_init: mt_get_cpu_freq = 1040000Khz
wait for frequency meter finish, CLK26CALI = 0x90
mt_pll_post_init: mt_get_bus_freq = 273000Khz
wait for frequency meter finish, CLK26CALI = 0x81
mt_pll_post_init: mt_get_mem_freq = 133250Khz
[PWRAP] pwrap_init_preloader
[PWRAP] pwrap_init
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=0,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=1,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=2,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=3 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=4 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=5 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=6 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=7 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=8 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=9 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=10 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=11,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=12,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=13,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=14,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=15,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=16,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=17,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=18,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=19,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=20,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=21,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=22,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=23,rdata=6A97
[PWRAP] _pwrap_init_reg_clock
[PMIC_WRAP]wrap_init pass,the return value=0.
[pmic6323_init] Preloader Start..................
[pmic6323_init] PMIC CHIP Code = 0x2023
INT_MISC_CON: 1  TOP_RST_MISC: 1
pl pmic powerkey Release
[pmic6323_init] powerKey = 0
[pmic6323_init] is USB in = 0xB004
[pmic6323_init] Reg[0x11A]=0x9B
pmic setup LED
[pmic6323_init] Done...................
mt7623 disable long press reset ->>>>>
mt7623 disable long press reset <<<<<-
mt7623 VPA supplied by 1.0V to MT7530 ->
mt7623 VPA supplied by 1.0V to MT7530 <-
mt7623 enables RG_VGP1_EN for LCM ->
mt7623 enables RG_VGP1_EN for LCM <-
MT7623 E2 setting =>
MT7623 E2 setting <=
[PLFM] Init I2C: OK(0)
[PLFM] Init PWRAP: OK(0)
[PLFM] Init PMIC: OK(0)
[PLFM] chip[CA00]

[BLDR] [Support SD/eMMC] Build Time: 20180108-204436
==== Dump RGU Reg ========
RGU MODE:     51
RGU LENGTH:   FFE0
RGU STA:      80000000
RGU INTERVAL: FFF
RGU SWSYSRST: 0
==== Dump RGU Reg End ====
RGU: g_rgu_satus:1
 mtk_wdt_mode_config  mode value=10, tmp:22000010
PL RGU RST: ??
SW reset with bypass power key flag
Find bypass powerkey flag
RGU mtk_wdt_init:MTK_WDT_DEBUG_CTL(590200F3)
kpd read addr: 0x0040: data:0x4004
Enter mtk_kpd_gpio_set! 
kpd debug column : 0, 0, 0, 0, 0, 0, 0, 0
kpd debug row : 0, 0, 0, 0, 0, 0, 0, 0
after set KP enable: KP_SEL = 0x0 !
MTK_PMIC_RST_KEY is used for this project!
[RTC] get_frequency_meter: input=0x0, ouput=5
[RTC] get_frequency_meter: input=0x0, ouput=3967
[RTC] get_frequency_meter: input=0x0, ouput=5
[RTC] get_frequency_meter: input=0x0, ouput=0
[RTC] get_frequency_meter: input=0x0, ouput=0
[RTC] bbpu = 0xD, con = 0x426
[RTC] powerkey1 = 0xA357, powerkey2 = 0x67D2
Writeif_unlock
[RTC] RTC_SPAR0=0x40 
rtc_2sec_reboot_check cali=1536
[RTC] irqsta = 0x0, pdn1 = 0x0, pdn2 = 0x201, spar0 = 0x40, spar1 = 0x800
[RTC] new_spare0 = 0x0, new_spare1 = 0x1, new_spare2 = 0x1, new_spare3 = 0x1
[RTC] bbpu = 0xD, con = 0x426, cali = 0x600
SW reset with bypass power key flag
SW reset with bypass power key flag
[PLFM] WDT reboot bypass power key!
[RTC] rtc_bbpu_power_on done
[EMI] mcp_dram_num:0,discrete_dram_num:1,enable_combo_dis:0
[EMI] PCDDR3
[Check]mt_get_mdl_number 0x0
[EMI] eMMC/NAND ID = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
[EMI] MDL number = 0
[EMI] emi_set eMMC/NAND ID = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
[EMI][Vcore]0x21E=0x48,0x220=0x48
[EMI][Vmem]0x554=0x0
wait for frequency meter finish, CLK26CALI = 0x81
[EMI] PCDDR3 DRAM Clock = 1600012 KHz, MEMPLL MODE = 2 
[EMI] PCDDR3 RXTDN Calibration:
Start REXTDN SW calibration...
drvp=0xB,drvn=0x9
[EMI] pinmux = 4
===============================================================================

        dramc_write_leveling_swcal
===============================================================================
delay  byte0  byte1  byte2  byte3
-----------------------------
0    0    0    0    0    
1    0    0    0    1    
2    0    0    0    1    
3    0    1    0    1    
4    0    1    1    1    
5    0    1    1    1    
6    0    1    1    1    
7    0    1    1    1    
8    1    1    1    1    
9    1    1    1    1    
10    1    1    1    1    
11    1    1    1    1    
12    1    1    1    1    
13    1    1    1    1    
14    1    1    1    1    
15    1    1    1    1    
pass bytecount = 4
byte_i    status    best delay
0    2    8
1    2    3
2    2    4
3    2    1
========================================
[write leveling]DQS: 0x1438, DQM: 0x1438
[write leveling after remap]DQ byte0 reg: 0x200 val: 0x88883333
[write leveling after remap]DQ byte1 reg: 0x204 val: 0x33338888
[write leveling after remap]DQ byte2 reg: 0x208 val: 0x44441111
[write leveling after remap]DQ byte3 reg: 0x20C val: 0x11114444
=============================================
X-axis: DQS Gating Window Delay (Fine Scale)
Y-axis: DQS Gating Window Delay (Coarse Scale)
=============================================
          0    8   16   24   32   40   48   56   64   72   80   88   96  104  112  120
      --------------------------------------------------------------------------------
0000:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0001:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0002:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0003:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0004:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0005:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0006:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0007:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0008:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0009:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000E:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000F:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0010:|    0    0    0    0    0    0    0    0    0    0    0    0    0    1    1    1
0011:|    0    0    0    0    0    0    0    0    1    1    1    1    1    1    1    1
0012:|    0    0    0    1    1    1    1    1    1    1    1    1    1    0    0    0
0013:|    1    1    1    1    1    1    1    1    0    0    0    0    0    0    0    0
0014:|    1    1    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0015:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0016:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0017:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0018:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0019:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001E:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001F:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
Rank 0 coarse tune value selection : 18, 18
18
64
rank 0 coarse = 18
rank 0 fine = 64
00:|    0    0    0    0    0    0    0    0    1    1    1    0
opt_dle value:13
==================================================================
                RX      DQS perbit delay software calibration 
==================================================================
1.0-31 bit dq delay value
==================================================================
bit|     0  1  2  3  4  5  6  7  8  9
--------------------------------------
0 |    0 0 0 0 0 0 0 0 0 0 
10 |    0 0 0 0 0 0 0 0 0 0 
20 |    0 0 0 0 0 0 0 0 0 0 
30 |    0 0 
--------------------------------------
==================================================================
2.dqs window
x=pass dqs delay value (min~max)center 
y=0-7bit DQ of every group
input delay:DQS0 =48 DQS1 = 40 DQS2 =52 DQS3 = 43
==================================================================
bit     DQS0     bit      DQS1     bit     DQS2     bit     DQS3
0  (19~68)43  8  (9~58)33  16  (22~68)45  24  (17~60)38
1  (19~68)43  9  (9~61)35  17  (21~68)44  25  (17~61)39
2  (19~68)43  10  (9~63)36  18  (23~72)47  26  (18~63)40
3  (18~66)42  11  (13~63)38  19  (21~68)44  27  (19~61)40
4  (22~72)47  12  (17~63)40  20  (24~75)49  28  (21~66)43
5  (21~67)44  13  (16~58)37  21  (23~68)45  29  (20~62)41
6  (21~67)44  14  (11~60)35  22  (26~70)48  30  (17~61)39
7  (25~72)48  15  (15~63)39  23  (31~73)52  31  (20~63)41
==================================================================
3.dq delay value last
==================================================================
bit|    0  1  2  3  4  5  6  7  8   9
--------------------------------------
0 |    5 5 5 6 1 4 4 0 7 5 
10 |    4 2 0 3 5 1 7 8 5 8 
20 |    3 7 4 0 5 4 3 3 0 2 
30 |    4 2 
==================================================================
*DQIDLY1 = 0x6050505
*DQIDLY2 = 0x40401
*DQIDLY3 = 0x2040507
*DQIDLY4 = 0x1050300
*DQIDLY5 = 0x8050807
*DQIDLY6 = 0x40703
*DQIDLY7 = 0x3030405
*DQIDLY8 = 0x2040200
*DRAMC_R0DELDLY = 0x2B342830

[MEM]CONA:F3A2,conf1:F07486A3
DM4BitMux = 1 
DQSO 0 in TX per-bit = 1 <= DQSO 0 in WL = 8  
DQSO 1 in TX per-bit = 0 <= DQSO 1 in WL = 3  
[Warning] DQSO 2 in TX per-bit = 9 > DQSO 2 in WL = 4  
[Warning] DQSO 3 in TX per-bit = 8 > DQSO 3 in WL = 1  
Tx DQM dly  = 0x1168
Tx DQM dly bit4 = 0x0
DRAMC_DQODLY1=77986777h
DRAMC_DQODLY2=69669799h
DRAMC_DQODLY3=11212013h
DRAMC_DQODLY4=20102024h
Tx DQ dly bit4 = 0x0
Tx DQS dly = 0x8938
Tx DQS dly bit4 = 0x0
TX Byte0: DQ - 16, DQS - 17. win_sum= 32
TX Byte1: DQ - 20, DQS - 12. win_sum= 31
TX Byte2: DQ - 9, DQS - 22. win_sum= 30
TX Byte3: DQ - 8, DQS - 22. win_sum= 29
DRAMC calibration takes 652123404 CPU cycles

[EMI] DRAMC calibration passed

[MEM] complex R/W mem test pass
0:dram_rank_size:80000000
[Dram_Buffer] dram size:-2147483648 
[Dram_Buffer] structure size: 1725560 
[Dram_Buffer] MAX_TEE_DRAM_SIZE: 0 
"Load u-boot from SD Card..."
[PLFM] Init Boot Device: OK(0)

[PART] blksz: 512B
[PART] [0x0000000000000000-0x000000000003FFFF] "PRELOADER" (512 blocks) 
[PART] [0x0000000000000000-0x000000000003FFFF] "MBR" (512 blocks) 
[PART] [0x0000000000040000-0x00000000000BFFFF] "UBOOT" (1024 blocks) 
[PART] [0x00000000000C0000-0x00000000000FFFFF] "CONFIG" (512 blocks) 
[PART] [0x0000000000100000-0x000000000013FFFF] "FACTORY" (512 blocks) 
[PART] [0x0000000000140000-0x000000000213FFFF] "BOOTIMG" (65536 blocks) 
[PART] [0x0000000002140000-0x000000000413FFFF] "RECOVERY" (65536 blocks) 
[PART] [0x0000000004140000-0x000000004413FFFF] "ROOTFS" (2097152 blocks) 
[PART] [0x0000000044140000-0x000001FFC413FFFF] "USER" (-4194304 blocks) 
[platform_vusb_on] PASS
[TOOL] PMIC not dectect usb cable!
[TOOL] <UART> listen  ended, receive size:0!
[TOOL] <UART> wait sync time 150ms->5ms
[TOOL] <UART> receieved data: ()

Device APC domain init setup:

 bootloader load uboot ,the address of uboot is 81E00000 
[PART]partition name UBOOT 
[PART]partition start block 0x200 
[PART]partition size 0x80000 
[PART]partition blks 0x400 
[PART]partition flags 0x0 
[PART]partition name 0x8 
[bean] part->startblk(0x200) bdev->blksz(0x200) part->part_id(8) hdr(0xFFB50000)
[BlkDev.c 101 ]partition block size 0x200 ,blks:0xED8000
[BlkDev.c 101 ]partition block erase size 0x200 

[PART] load "UBOOT" from 0x0000000000050000 (dev) to 0x81E00000 (mem) [SUCCESS]
[PART] load speed: 5744KB/s, 300000 bytes, 51ms
[BT_SD_PG] device info 0x8590 0x8A00 0xCB01 0x102
0:dram_rank_size:80000000
[PLFM] md_type[0] = 0 
[PLFM] md_type[1] = 0 

[PLFM] boot reason: 4
[PLFM] boot mode: 0
[PLFM] META COM0: 0
[PLFM] <0xFFB7CC10>: 0x0
[PLFM] boot time: 1911ms
[PLFM] DDR reserve mode: enable = 0, success = 0

[BLDR] jump to 0x81E00000
[BLDR] <0x81E00000>=0xEA00000F
[BLDR] <0x81E00004>=0xE59FF014


U-Boot 2014.04-rc1 (Feb 25 2018 - 21:36:32)

g_nr_bank = 1.
g_total_rank_size = 0x80000000
DRAM:  2 GiB
WARNING: Caches not enabled
MMC:     emmc: 0,  sdcard: 1
"booting from SD card"
dev_num = 1
In:    serial
Out:   serial
Err:   serial
bootargs = board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
Net:   Eth0
Uip activated
Hit any key to stop autoboot:  0 
"BPI-R2> printenv"
arch=arm
baudrate=115200
board=bpi-r2
board_name=bpi_r2
boot0=tftpboot; bootm
boot1=tftpboot;run boot_wr_img;run boot_rd_img;bootm
boot10=mmc init; run boot_normal; bootm
boot2=run boot_rd_img;run rescue;bootm
boot3=tftpboot ${loadaddr} u-boot-mtk.bin;run wr_uboot
boot4=loadb;run boot_wr_img;run boot_rd_img;bootm
boot5=loadb;run wr_uboot
boot6=usb start;run boot_wr_img;bootm
boot7=http_upgrade 10.10.10.1;run boot_wr_img;run boot_rd_img;bootm
boot8=mmc init; fatload mmc 0:1 ${loadaddr} CONFIG_UPGFILE;run boot_wr_img; bootm
boot9=mmc init; fatload mmc 0:1 ${loadaddr} ${bpi}/${board}/${service}/${kernel}; bootm
boot_normal=if run checksd; then echo Boot from SD ; setenv partition 1:1; else echo Boot from eMMC ; mmc init 0 ; setenv partition 0:1 ; fi; if run loadbootenv; then echo Loaded environment frm
boot_rd_img=mmc device 0;mmc read ${loadaddr} 0xA00 1;image_blks 512;mmc read ${loadaddr} 0xA00 ${img_blks}
boot_rd_sec_img=mmc device 0;mmc read ${loadaddr} 0x10A00 1;image_blks 512;mmc read ${loadaddr} 0x10A00 ${img_blks}
boot_wr_img=image_check; if test ${img_result} = good; then image_blks 512 ${filesize};mmc device 0;mmc write ${loadaddr} 0xA00 ${img_blks}; fi
boot_wr_sec_img=image_check; if test ${img_result} = good; then image_blks 512 ${filesize};mmc device 0;mmc write ${loadaddr} 0x10A00 ${img_blks}; fi
bootargs=board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
bootcmd=run getbootdevice; mmc dev ${bootdevice}; mmc read ${kerneladdr} 1000 6000; run configBootargs; bootm ${kerneladdr};
bootdelay=3
bootemmc=false
bootenv=uEnv.txt
bootfile=uImage
bootmenu_delay=30
bpi=bananapi
bpiver=1
checksd=fatinfo ${device} 1:1
chip=MT7623N
configBootargs=run getbootdevice; setenv bootargs earlyprintk block2mtd.block2mtd=/dev/mmcblk${bootdevice},65536,RootFs,5 mtdparts=RootFs:512k(mbr)ro,512k(uboot)ro,512k(config)ro,512k(factory)r2
cpu=armv7
debug=7
device=mmc
duimage_backup=mmc device 0;mmc read ${loadaddr} 0x10A00 1;image_check; if test ${img_result} = bad;then run boot_rd_img; serious_image_check; if test ${img_result} = good; then backup_message;i
duimage_recovery=serious_image_check; if test ${img_result} = bad; then run boot_rd_sec_img;serious_image_check; if test ${img_result} = good; then reco_message; run boot_wr_img; fi; fi
ethact=Eth0
ethaddr=00:0C:E7:11:22:33
getbootdevice=setenv bootdevice 1; if test ${bootemmc} = true; then setenv bootdevice 0; fi;
"ipaddr=99.99.99.99"
kernel=uImage
kerneladdr=0x84000000
loadaddr=0x84000000
loadbootenv=fatload ${device} ${partition} ${scriptaddr} ${bpi}/${board}/${service}/${bootenv} || fatload ${device} ${partition} ${scriptaddr} ${bootenv}
partition=1:1
root=/dev/mmcblk0p2
scriptaddr=0x83000000
serverip=10.10.10.1
service=linux
soc=mt7623
stderr=serial
stdin=serial
stdout=serial
vendor=bananapi
wr_uboot=uboot_check;if test ${uboot_result} = good; then mmc device 0;mmc write ${loadaddr} 0x200 0x200;reset; fi

Environment size: 3372/16380 bytes
BPI-R2>

#13

Now pull out µSD and reset board with reset button to boot with eMMC

[USBD] USB PRB0 LineState: 0

[USBD] USB cable/ No Cable inserted!

[PLFM] Keep stay in USB Mode
Platform initialization is ok
wait for frequency meter finish, CLK26CALI = 0x81
mt_pll_post_init: mt_get_cpu_freq = 1040000Khz
wait for frequency meter finish, CLK26CALI = 0x90
mt_pll_post_init: mt_get_bus_freq = 273000Khz
wait for frequency meter finish, CLK26CALI = 0x81
mt_pll_post_init: mt_get_mem_freq = 133250Khz
[PWRAP] pwrap_init_preloader
[PWRAP] pwrap_init
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=0,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=1,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=2,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=3 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=4 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=5 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=6 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=7 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=8 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=9 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=10 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=11,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=12,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=13,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=14,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=15,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=16,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=17,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=18,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=19,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=20,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=21,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=22,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=23,rdata=6A97
[PWRAP] _pwrap_init_reg_clock
[PMIC_WRAP]wrap_init pass,the return value=0.
[pmic6323_init] Preloader Start..................
[pmic6323_init] PMIC CHIP Code = 0x2023
INT_MISC_CON: 1  TOP_RST_MISC: 1
pl pmic powerkey Release
[pmic6323_init] powerKey = 0
[pmic6323_init] is USB in = 0xB004
[pmic6323_init] Reg[0x11A]=0x1B
pmic setup LED
[pmic6323_init] Done...................
mt7623 disable long press reset ->>>>>
mt7623 disable long press reset <<<<<-
mt7623 VPA supplied by 1.0V to MT7530 ->
mt7623 VPA supplied by 1.0V to MT7530 <-
mt7623 enables RG_VGP1_EN for LCM ->
mt7623 enables RG_VGP1_EN for LCM <-
MT7623 E2 setting =>
MT7623 E2 setting <=
[PLFM] Init I2C: OK(0)
[PLFM] Init PWRAP: OK(0)
[PLFM] Init PMIC: OK(0)
[PLFM] chip[CA00]

[BLDR] [Support SD/eMMC] Build Time: 20180108-211852
==== Dump RGU Reg ========
RGU MODE:     4D
RGU LENGTH:   FFE0
RGU STA:      0
RGU INTERVAL: FFF
RGU SWSYSRST: 0
==== Dump RGU Reg End ====
RGU: g_rgu_satus:0
 mtk_wdt_mode_config  mode value=10, tmp:22000010
PL P ON
WDT does not trigger reboot
RGU mtk_wdt_init:MTK_WDT_DEBUG_CTL(590200F3)
kpd read addr: 0x0040: data:0x4001
Enter mtk_kpd_gpio_set! 
kpd debug column : 0, 0, 0, 0, 0, 0, 0, 0
kpd debug row : 0, 0, 0, 0, 0, 0, 0, 0
after set KP enable: KP_SEL = 0x0 !
MTK_PMIC_RST_KEY is used for this project!
[RTC] get_frequency_meter: input=0x0, ouput=5
[RTC] get_frequency_meter: input=0x0, ouput=3967
[RTC] get_frequency_meter: input=0x0, ouput=5
[RTC] get_frequency_meter: input=0x0, ouput=0
[RTC] get_frequency_meter: input=0x0, ouput=0
[RTC] bbpu = 0xD, con = 0x426
[RTC] powerkey1 = 0xA357, powerkey2 = 0x67D2
Writeif_unlock
[RTC] RTC_SPAR0=0x40 
rtc_2sec_reboot_check cali=1536
[RTC] irqsta = 0x0, pdn1 = 0x0, pdn2 = 0x201, spar0 = 0x40, spar1 = 0x800
[RTC] new_spare0 = 0x0, new_spare1 = 0x1, new_spare2 = 0x1, new_spare3 = 0x1
[RTC] bbpu = 0xD, con = 0x426, cali = 0x600
pl pmic powerkey Release
[PLFM] Power key boot!
[RTC] rtc_bbpu_power_on done
[EMI] mcp_dram_num:0,discrete_dram_num:1,enable_combo_dis:0
[EMI] PCDDR3
[Check]mt_get_mdl_number 0x0
[EMI] eMMC/NAND ID = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
[EMI] MDL number = 0
[EMI] emi_set eMMC/NAND ID = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
[EMI][Vcore]0x21E=0x48,0x220=0x48
[EMI][Vmem]0x554=0x0
wait for frequency meter finish, CLK26CALI = 0x81
[EMI] PCDDR3 DRAM Clock = 1600012 KHz, MEMPLL MODE = 2 
[EMI] PCDDR3 RXTDN Calibration:
Start REXTDN SW calibration...
drvp=0xB,drvn=0x9
[EMI] pinmux = 4
===============================================================================

        dramc_write_leveling_swcal
===============================================================================
delay  byte0  byte1  byte2  byte3
-----------------------------
0    0    0    0    0    
1    0    0    0    1    
2    0    0    0    1    
3    0    1    0    1    
4    0    1    1    1    
5    0    1    1    1    
6    0    1    1    1    
7    0    1    1    1    
8    1    1    1    1    
9    1    1    1    1    
10    1    1    1    1    
11    1    1    1    1    
12    1    1    1    1    
13    1    1    1    1    
14    1    1    1    1    
15    1    1    1    1    
pass bytecount = 4
byte_i    status    best delay
0    2    8
1    2    3
2    2    4
3    2    1
========================================
[write leveling]DQS: 0x1438, DQM: 0x1438
[write leveling after remap]DQ byte0 reg: 0x200 val: 0x88883333
[write leveling after remap]DQ byte1 reg: 0x204 val: 0x33338888
[write leveling after remap]DQ byte2 reg: 0x208 val: 0x44441111
[write leveling after remap]DQ byte3 reg: 0x20C val: 0x11114444
=============================================
X-axis: DQS Gating Window Delay (Fine Scale)
Y-axis: DQS Gating Window Delay (Coarse Scale)
=============================================
          0    8   16   24   32   40   48   56   64   72   80   88   96  104  112  120
      --------------------------------------------------------------------------------
0000:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0001:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0002:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0003:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0004:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0005:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0006:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0007:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0008:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0009:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000E:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000F:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0010:|    0    0    0    0    0    0    0    0    0    0    0    0    0    1    1    1
0011:|    0    0    0    0    0    0    0    0    1    1    1    1    1    1    1    1
0012:|    0    0    0    1    1    1    1    1    1    1    1    1    1    0    0    0
0013:|    1    1    1    1    1    1    1    1    0    0    0    0    0    0    0    0
0014:|    1    1    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0015:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0016:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0017:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0018:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0019:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001E:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001F:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
Rank 0 coarse tune value selection : 18, 18
18
64
rank 0 coarse = 18
rank 0 fine = 64
00:|    0    0    0    0    0    0    0    0    1    1    1    0
opt_dle value:13
==================================================================
                RX      DQS perbit delay software calibration 
==================================================================
1.0-31 bit dq delay value
==================================================================
bit|     0  1  2  3  4  5  6  7  8  9
--------------------------------------
0 |    0 0 0 0 0 0 0 0 0 0 
10 |    0 0 0 0 0 0 0 0 0 0 
20 |    0 0 0 0 0 0 0 0 0 0 
30 |    0 0 
--------------------------------------
==================================================================
2.dqs window
x=pass dqs delay value (min~max)center 
y=0-7bit DQ of every group
input delay:DQS0 =48 DQS1 = 40 DQS2 =52 DQS3 = 44
==================================================================
bit     DQS0     bit      DQS1     bit     DQS2     bit     DQS3
0  (19~68)43  8  (9~58)33  16  (22~68)45  24  (17~58)37
1  (19~68)43  9  (9~61)35  17  (21~69)45  25  (17~61)39
2  (19~67)43  10  (9~63)36  18  (23~71)47  26  (19~63)41
3  (18~66)42  11  (13~63)38  19  (21~68)44  27  (19~60)39
4  (22~72)47  12  (17~63)40  20  (24~76)50  28  (21~67)44
5  (21~67)44  13  (16~60)38  21  (23~68)45  29  (20~61)40
6  (21~67)44  14  (11~60)35  22  (26~70)48  30  (17~62)39
7  (25~72)48  15  (15~63)39  23  (31~74)52  31  (20~63)41
==================================================================
3.dq delay value last
==================================================================
bit|    0  1  2  3  4  5  6  7  8   9
--------------------------------------
0 |    5 5 5 6 1 4 4 0 7 5 
10 |    4 2 0 2 5 1 7 7 5 8 
20 |    2 7 4 0 7 5 3 5 0 4 
30 |    5 3 
==================================================================
*DQIDLY1 = 0x6050505
*DQIDLY2 = 0x40401
*DQIDLY3 = 0x2040507
*DQIDLY4 = 0x1050200
*DQIDLY5 = 0x8050707
*DQIDLY6 = 0x40702
*DQIDLY7 = 0x5030507
*DQIDLY8 = 0x3050400
*DRAMC_R0DELDLY = 0x2C342830

[MEM]CONA:F3A2,conf1:F07486A3
DM4BitMux = 1 
DQSO 0 in TX per-bit = 1 <= DQSO 0 in WL = 8  
DQSO 1 in TX per-bit = 0 <= DQSO 1 in WL = 3  
[Warning] DQSO 2 in TX per-bit = 9 > DQSO 2 in WL = 4  
[Warning] DQSO 3 in TX per-bit = 8 > DQSO 3 in WL = 1  
Tx DQM dly  = 0x1168
Tx DQM dly bit4 = 0x0
DRAMC_DQODLY1=78986776h
DRAMC_DQODLY2=69669799h
DRAMC_DQODLY3=1202013h
DRAMC_DQODLY4=20102024h
Tx DQ dly bit4 = 0x0
Tx DQS dly = 0x8938
Tx DQS dly bit4 = 0x0
TX Byte0: DQ - 16, DQS - 17. win_sum= 32
TX Byte1: DQ - 20, DQS - 12. win_sum= 31
TX Byte2: DQ - 8, DQS - 22. win_sum= 29
TX Byte3: DQ - 8, DQS - 22. win_sum= 29
DRAMC calibration takes 651960809 CPU cycles

[EMI] DRAMC calibration passed

[MEM] complex R/W mem test pass
0:dram_rank_size:80000000
[Dram_Buffer] dram size:-2147483648 
[Dram_Buffer] structure size: 1725560 
[Dram_Buffer] MAX_TEE_DRAM_SIZE: 0 
"Load u-boot from eMMC..."
[PLFM] Init Boot Device: OK(0)

[PART] blksz: 512B
[PART] [0x0000000000000000-0x000000000003FFFF] "PRELOADER" (512 blocks) 
[PART] [0x0000000000000000-0x000000000003FFFF] "MBR" (512 blocks) 
[PART] [0x0000000000040000-0x00000000000BFFFF] "UBOOT" (1024 blocks) 
[PART] [0x00000000000C0000-0x00000000000FFFFF] "CONFIG" (512 blocks) 
[PART] [0x0000000000100000-0x000000000013FFFF] "FACTORY" (512 blocks) 
[PART] [0x0000000000140000-0x000000000213FFFF] "BOOTIMG" (65536 blocks) 
[PART] [0x0000000002140000-0x000000000413FFFF] "RECOVERY" (65536 blocks) 
[PART] [0x0000000004140000-0x000000004413FFFF] "ROOTFS" (2097152 blocks) 
[PART] [0x0000000044140000-0x000001FFC413FFFF] "USER" (-4194304 blocks) 
[platform_vusb_on] PASS
[TOOL] PMIC not dectect usb cable!
[TOOL] <UART> listen  ended, receive size:0!
[TOOL] <UART> wait sync time 150ms->5ms
[TOOL] <UART> receieved data: ()

Device APC domain init setup:

 bootloader load uboot ,the address of uboot is 81E00000 
[PART]partition name UBOOT 
[PART]partition start block 0x200 
[PART]partition size 0x80000 
[PART]partition blks 0x400 
[PART]partition flags 0x0 
[PART]partition name 0x8 
[bean] part->startblk(0x200) bdev->blksz(0x200) part->part_id(8) hdr(0xFFB50000)
[BlkDev.c 101 ]partition block size 0x200 ,blks:0xE90000
[BlkDev.c 101 ]partition block erase size 0x200 

[PART] load "UBOOT" from 0x0000000000050000 (dev) to 0x81E00000 (mem) [SUCCESS]
[PART] load speed: 10462KB/s, 300000 bytes, 28ms
[BT_SD_PG] device info 0x8590 0x8A00 0xCB01 0x102
0:dram_rank_size:80000000
[PLFM] md_type[0] = 0 
[PLFM] md_type[1] = 0 

[PLFM] boot reason: 0
[PLFM] boot mode: 0
[PLFM] META COM0: 0
[PLFM] <0xFFB7CC10>: 0x0
[PLFM] boot time: 2027ms
[PLFM] DDR reserve mode: enable = 0, success = 0

[BLDR] jump to 0x81E00000
[BLDR] <0x81E00000>=0xEA00000F
[BLDR] <0x81E00004>=0xE59FF014


U-Boot 2014.04-rc1 (Feb 25 2018 - 21:36:32)

g_nr_bank = 1.
g_total_rank_size = 0x80000000
DRAM:  2 GiB
WARNING: Caches not enabled
MMC:     emmc: 0,  sdcard: 1
"booting from eMMC"
dev_num = 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
bootargs = board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
Net:   Eth0
Uip activated
Hit any key to stop autoboot:  0 
"BPI-R2> printenv"
arch=arm
baudrate=115200
board=bpi-r2
board_name=bpi_r2
boot0=tftpboot; bootm
boot1=tftpboot;run boot_wr_img;run boot_rd_img;bootm
boot10=mmc init; run boot_normal; bootm
boot2=run boot_rd_img;run rescue;bootm
boot3=tftpboot ${loadaddr} u-boot-mtk.bin;run wr_uboot
boot4=loadb;run boot_wr_img;run boot_rd_img;bootm
boot5=loadb;run wr_uboot
boot6=usb start;run boot_wr_img;bootm
boot7=http_upgrade 10.10.10.1;run boot_wr_img;run boot_rd_img;bootm
boot8=mmc init; fatload mmc 0:1 ${loadaddr} CONFIG_UPGFILE;run boot_wr_img; bootm
boot9=mmc init; fatload mmc 0:1 ${loadaddr} ${bpi}/${board}/${service}/${kernel}; bootm
boot_normal=if run checksd; then echo Boot from SD ; setenv partition 1:1; else echo Boot from eMMC ; mmc init 0 ; setenv partition 0:1 ; fi; if run loadbootenv; then echo Loaded environment frm
boot_rd_img=mmc device 0;mmc read ${loadaddr} 0xA00 1;image_blks 512;mmc read ${loadaddr} 0xA00 ${img_blks}
boot_rd_sec_img=mmc device 0;mmc read ${loadaddr} 0x10A00 1;image_blks 512;mmc read ${loadaddr} 0x10A00 ${img_blks}
boot_wr_img=image_check; if test ${img_result} = good; then image_blks 512 ${filesize};mmc device 0;mmc write ${loadaddr} 0xA00 ${img_blks}; fi
boot_wr_sec_img=image_check; if test ${img_result} = good; then image_blks 512 ${filesize};mmc device 0;mmc write ${loadaddr} 0x10A00 ${img_blks}; fi
bootargs=board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
bootcmd=run getbootdevice; mmc dev ${bootdevice}; mmc read ${kerneladdr} 1000 6000; run configBootargs; bootm ${kerneladdr};
bootdelay=3
bootemmc=true
bootenv=uEnv.txt
bootfile=uImage
bootmenu_delay=30
bpi=bananapi
bpiver=1
checksd=fatinfo ${device} 1:1
chip=MT7623N
configBootargs=run getbootdevice; setenv bootargs earlyprintk block2mtd.block2mtd=/dev/mmcblk${bootdevice},65536,RootFs,5 mtdparts=RootFs:512k(mbr)ro,512k(uboot)ro,512k(config)ro,512k(factory)r2
cpu=armv7
debug=7
device=mmc
duimage_backup=mmc device 0;mmc read ${loadaddr} 0x10A00 1;image_check; if test ${img_result} = bad;then run boot_rd_img; serious_image_check; if test ${img_result} = good; then backup_message;i
duimage_recovery=serious_image_check; if test ${img_result} = bad; then run boot_rd_sec_img;serious_image_check; if test ${img_result} = good; then reco_message; run boot_wr_img; fi; fi
ethact=Eth0
ethaddr=00:0C:E7:11:22:33
getbootdevice=setenv bootdevice 1; if test ${bootemmc} = true; then setenv bootdevice 0; fi;
"ipaddr=10.10.10.254"
kernel=uImage
kerneladdr=0x84000000
loadaddr=0x84000000
loadbootenv=fatload ${device} ${partition} ${scriptaddr} ${bpi}/${board}/${service}/${bootenv} || fatload ${device} ${partition} ${scriptaddr} ${bootenv}
partition=1:1
root=/dev/mmcblk0p2
scriptaddr=0x83000000
serverip=10.10.10.1
service=linux
soc=mt7623
stderr=serial
stdin=serial
stdout=serial
vendor=bananapi
wr_uboot=uboot_check;if test ${uboot_result} = good; then mmc device 0;mmc write ${loadaddr} 0x200 0x200;reset; fi

Environment size: 3372/16380 bytes
BPI-R2>

Now push µSD back and reset borad to verify only in µSD stored settings

[USBD] USB PRB0 LineState: 0

[USBD] USB cable/ No Cable inserted!

[PLFM] Keep stay in USB Mode
Platform initialization is ok
wait for frequency meter finish, CLK26CALI = 0x81
mt_pll_post_init: mt_get_cpu_freq = 1040000Khz
wait for frequency meter finish, CLK26CALI = 0x90
mt_pll_post_init: mt_get_bus_freq = 273000Khz
wait for frequency meter finish, CLK26CALI = 0x81
mt_pll_post_init: mt_get_mem_freq = 133250Khz
[PWRAP] pwrap_init_preloader
[PWRAP] pwrap_init
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=0,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=1,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=2,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=3 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=4 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=5 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=6 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=7 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=8 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=9 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=10 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=11,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=12,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=13,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=14,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=15,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=16,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=17,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=18,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=19,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=20,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=21,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=22,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=23,rdata=6A97
[PWRAP] _pwrap_init_reg_clock
[PMIC_WRAP]wrap_init pass,the return value=0.
[pmic6323_init] Preloader Start..................
[pmic6323_init] PMIC CHIP Code = 0x2023
INT_MISC_CON: 1  TOP_RST_MISC: 1
pl pmic powerkey Release
[pmic6323_init] powerKey = 0
[pmic6323_init] is USB in = 0xB004
[pmic6323_init] Reg[0x11A]=0x1B
pmic setup LED
[pmic6323_init] Done...................
mt7623 disable long press reset ->>>>>
mt7623 disable long press reset <<<<<-
mt7623 VPA supplied by 1.0V to MT7530 ->
mt7623 VPA supplied by 1.0V to MT7530 <-
mt7623 enables RG_VGP1_EN for LCM ->
mt7623 enables RG_VGP1_EN for LCM <-
MT7623 E2 setting =>
MT7623 E2 setting <=
[PLFM] Init I2C: OK(0)
[PLFM] Init PWRAP: OK(0)
[PLFM] Init PMIC: OK(0)
[PLFM] chip[CA00]

[BLDR] [Support SD/eMMC] Build Time: 20180108-204436
==== Dump RGU Reg ========
RGU MODE:     4D
RGU LENGTH:   FFE0
RGU STA:      0
RGU INTERVAL: FFF
RGU SWSYSRST: 0
==== Dump RGU Reg End ====
RGU: g_rgu_satus:0
 mtk_wdt_mode_config  mode value=10, tmp:22000010
PL P ON
WDT does not trigger reboot
RGU mtk_wdt_init:MTK_WDT_DEBUG_CTL(590200F3)
kpd read addr: 0x0040: data:0x4001
Enter mtk_kpd_gpio_set! 
kpd debug column : 0, 0, 0, 0, 0, 0, 0, 0
kpd debug row : 0, 0, 0, 0, 0, 0, 0, 0
after set KP enable: KP_SEL = 0x0 !
MTK_PMIC_RST_KEY is used for this project!
[RTC] get_frequency_meter: input=0x0, ouput=5
[RTC] get_frequency_meter: input=0x0, ouput=3967
[RTC] get_frequency_meter: input=0x0, ouput=5
[RTC] get_frequency_meter: input=0x0, ouput=0
[RTC] get_frequency_meter: input=0x0, ouput=0
[RTC] bbpu = 0xD, con = 0x426
[RTC] powerkey1 = 0xA357, powerkey2 = 0x67D2
Writeif_unlock
[RTC] RTC_SPAR0=0x40 
rtc_2sec_reboot_check cali=1536
[RTC] irqsta = 0x0, pdn1 = 0x0, pdn2 = 0x201, spar0 = 0x40, spar1 = 0x800
[RTC] new_spare0 = 0x0, new_spare1 = 0x1, new_spare2 = 0x1, new_spare3 = 0x1
[RTC] bbpu = 0xD, con = 0x426, cali = 0x600
pl pmic powerkey Release
[PLFM] Power key boot!
[RTC] rtc_bbpu_power_on done
[EMI] mcp_dram_num:0,discrete_dram_num:1,enable_combo_dis:0
[EMI] PCDDR3
[Check]mt_get_mdl_number 0x0
[EMI] eMMC/NAND ID = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
[EMI] MDL number = 0
[EMI] emi_set eMMC/NAND ID = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
[EMI][Vcore]0x21E=0x48,0x220=0x48
[EMI][Vmem]0x554=0x0
wait for frequency meter finish, CLK26CALI = 0x81
[EMI] PCDDR3 DRAM Clock = 1599912 KHz, MEMPLL MODE = 2 
[EMI] PCDDR3 RXTDN Calibration:
Start REXTDN SW calibration...
drvp=0xB,drvn=0x9
[EMI] pinmux = 4
===============================================================================

        dramc_write_leveling_swcal
===============================================================================
delay  byte0  byte1  byte2  byte3
-----------------------------
0    0    0    0    0    
1    0    0    0    1    
2    0    0    0    1    
3    0    1    0    1    
4    0    1    1    1    
5    0    1    1    1    
6    0    1    1    1    
7    0    1    1    1    
8    1    1    1    1    
9    1    1    1    1    
10    1    1    1    1    
11    1    1    1    1    
12    1    1    1    1    
13    1    1    1    1    
14    1    1    1    1    
15    1    1    1    1    
pass bytecount = 4
byte_i    status    best delay
0    2    8
1    2    3
2    2    4
3    2    1
========================================
[write leveling]DQS: 0x1438, DQM: 0x1438
[write leveling after remap]DQ byte0 reg: 0x200 val: 0x88883333
[write leveling after remap]DQ byte1 reg: 0x204 val: 0x33338888
[write leveling after remap]DQ byte2 reg: 0x208 val: 0x44441111
[write leveling after remap]DQ byte3 reg: 0x20C val: 0x11114444
=============================================
X-axis: DQS Gating Window Delay (Fine Scale)
Y-axis: DQS Gating Window Delay (Coarse Scale)
=============================================
          0    8   16   24   32   40   48   56   64   72   80   88   96  104  112  120
      --------------------------------------------------------------------------------
0000:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0001:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0002:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0003:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0004:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0005:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0006:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0007:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0008:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0009:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000E:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000F:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0010:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    1    1
0011:|    0    0    0    0    0    0    0    0    1    1    1    1    1    1    1    1
0012:|    0    0    0    1    1    1    1    1    1    1    1    1    1    0    0    0
0013:|    1    1    1    1    1    1    1    1    0    0    0    0    0    0    0    0
0014:|    1    1    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0015:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0016:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0017:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0018:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0019:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001E:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001F:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
Rank 0 coarse tune value selection : 18, 18
18
64
rank 0 coarse = 18
rank 0 fine = 64
00:|    0    0    0    0    0    0    0    0    1    1    1    0
opt_dle value:13
==================================================================
                RX      DQS perbit delay software calibration 
==================================================================
1.0-31 bit dq delay value
==================================================================
bit|     0  1  2  3  4  5  6  7  8  9
--------------------------------------
0 |    0 0 0 0 0 0 0 0 0 0 
10 |    0 0 0 0 0 0 0 0 0 0 
20 |    0 0 0 0 0 0 0 0 0 0 
30 |    0 0 
--------------------------------------
==================================================================
2.dqs window
x=pass dqs delay value (min~max)center 
y=0-7bit DQ of every group
input delay:DQS0 =48 DQS1 = 40 DQS2 =52 DQS3 = 43
==================================================================
bit     DQS0     bit      DQS1     bit     DQS2     bit     DQS3
0  (19~68)43  8  (9~58)33  16  (22~68)45  24  (17~60)38
1  (19~68)43  9  (9~61)35  17  (21~69)45  25  (17~60)38
2  (19~68)43  10  (9~63)36  18  (23~72)47  26  (18~63)40
3  (18~67)42  11  (13~64)38  19  (21~68)44  27  (19~61)40
4  (22~72)47  12  (17~63)40  20  (24~76)50  28  (21~66)43
5  (21~67)44  13  (16~60)38  21  (23~69)46  29  (20~62)41
6  (21~67)44  14  (11~60)35  22  (26~70)48  30  (17~62)39
7  (25~72)48  15  (15~63)39  23  (31~74)52  31  (20~63)41
==================================================================
3.dq delay value last
==================================================================
bit|    0  1  2  3  4  5  6  7  8   9
--------------------------------------
0 |    5 5 5 6 1 4 4 0 7 5 
10 |    4 2 0 2 5 1 7 7 5 8 
20 |    2 6 4 0 5 5 3 3 0 2 
30 |    4 2 
==================================================================
*DQIDLY1 = 0x6050505
*DQIDLY2 = 0x40401
*DQIDLY3 = 0x2040507
*DQIDLY4 = 0x1050200
*DQIDLY5 = 0x8050707
*DQIDLY6 = 0x40602
*DQIDLY7 = 0x3030505
*DQIDLY8 = 0x2040200
*DRAMC_R0DELDLY = 0x2B342830

[MEM]CONA:F3A2,conf1:F07486A3
DM4BitMux = 1 
DQSO 0 in TX per-bit = 1 <= DQSO 0 in WL = 8  
DQSO 1 in TX per-bit = 0 <= DQSO 1 in WL = 3  
[Warning] DQSO 2 in TX per-bit = 9 > DQSO 2 in WL = 4  
[Warning] DQSO 3 in TX per-bit = 8 > DQSO 3 in WL = 1  
Tx DQM dly  = 0x1168
Tx DQM dly bit4 = 0x0
DRAMC_DQODLY1=78986776h
DRAMC_DQODLY2=69669789h
DRAMC_DQODLY3=11212013h
DRAMC_DQODLY4=20102024h
Tx DQ dly bit4 = 0x0
Tx DQS dly = 0x8938
Tx DQS dly bit4 = 0x0
TX Byte0: DQ - 16, DQS - 17. win_sum= 32
TX Byte1: DQ - 20, DQS - 12. win_sum= 31
TX Byte2: DQ - 9, DQS - 22. win_sum= 30
TX Byte3: DQ - 8, DQS - 22. win_sum= 29
DRAMC calibration takes 652129126 CPU cycles

[EMI] DRAMC calibration passed

[MEM] complex R/W mem test pass
0:dram_rank_size:80000000
[Dram_Buffer] dram size:-2147483648 
[Dram_Buffer] structure size: 1725560 
[Dram_Buffer] MAX_TEE_DRAM_SIZE: 0 
"Load u-boot from SD Card..."
[PLFM] Init Boot Device: OK(0)

[PART] blksz: 512B
[PART] [0x0000000000000000-0x000000000003FFFF] "PRELOADER" (512 blocks) 
[PART] [0x0000000000000000-0x000000000003FFFF] "MBR" (512 blocks) 
[PART] [0x0000000000040000-0x00000000000BFFFF] "UBOOT" (1024 blocks) 
[PART] [0x00000000000C0000-0x00000000000FFFFF] "CONFIG" (512 blocks) 
[PART] [0x0000000000100000-0x000000000013FFFF] "FACTORY" (512 blocks) 
[PART] [0x0000000000140000-0x000000000213FFFF] "BOOTIMG" (65536 blocks) 
[PART] [0x0000000002140000-0x000000000413FFFF] "RECOVERY" (65536 blocks) 
[PART] [0x0000000004140000-0x000000004413FFFF] "ROOTFS" (2097152 blocks) 
[PART] [0x0000000044140000-0x000001FFC413FFFF] "USER" (-4194304 blocks) 
[platform_vusb_on] PASS
[TOOL] PMIC not dectect usb cable!
[TOOL] <UART> listen  ended, receive size:0!
[TOOL] <UART> wait sync time 150ms->5ms
[TOOL] <UART> receieved data: ()

Device APC domain init setup:

 bootloader load uboot ,the address of uboot is 81E00000 
[PART]partition name UBOOT 
[PART]partition start block 0x200 
[PART]partition size 0x80000 
[PART]partition blks 0x400 
[PART]partition flags 0x0 
[PART]partition name 0x8 
[bean] part->startblk(0x200) bdev->blksz(0x200) part->part_id(8) hdr(0xFFB50000)
[BlkDev.c 101 ]partition block size 0x200 ,blks:0xED8000
[BlkDev.c 101 ]partition block erase size 0x200 

[PART] load "UBOOT" from 0x0000000000050000 (dev) to 0x81E00000 (mem) [SUCCESS]
[PART] load speed: 5744KB/s, 300000 bytes, 51ms
[BT_SD_PG] device info 0x8590 0x8A00 0xCB01 0x102
0:dram_rank_size:80000000
[PLFM] md_type[0] = 0 
[PLFM] md_type[1] = 0 

[PLFM] boot reason: 0
[PLFM] boot mode: 0
[PLFM] META COM0: 0
[PLFM] <0xFFB7CC10>: 0x0
[PLFM] boot time: 1902ms
[PLFM] DDR reserve mode: enable = 0, success = 0

[BLDR] jump to 0x81E00000
[BLDR] <0x81E00000>=0xEA00000F
[BLDR] <0x81E00004>=0xE59FF014


U-Boot 2014.04-rc1 (Feb 25 2018 - 21:36:32)

g_nr_bank = 1.
g_total_rank_size = 0x80000000
DRAM:  2 GiB
WARNING: Caches not enabled
MMC:     emmc: 0,  sdcard: 1
"booting from eMMC"
dev_num = 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
bootargs = board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
Net:   Eth0
Uip activated
Hit any key to stop autoboot:  0 
"BPI-R2> printenv "
arch=arm
baudrate=115200
board=bpi-r2
board_name=bpi_r2
boot0=tftpboot; bootm
boot1=tftpboot;run boot_wr_img;run boot_rd_img;bootm
boot10=mmc init; run boot_normal; bootm
boot2=run boot_rd_img;run rescue;bootm
boot3=tftpboot ${loadaddr} u-boot-mtk.bin;run wr_uboot
boot4=loadb;run boot_wr_img;run boot_rd_img;bootm
boot5=loadb;run wr_uboot
boot6=usb start;run boot_wr_img;bootm
boot7=http_upgrade 10.10.10.1;run boot_wr_img;run boot_rd_img;bootm
boot8=mmc init; fatload mmc 0:1 ${loadaddr} CONFIG_UPGFILE;run boot_wr_img; bootm
boot9=mmc init; fatload mmc 0:1 ${loadaddr} ${bpi}/${board}/${service}/${kernel}; bootm
boot_normal=if run checksd; then echo Boot from SD ; setenv partition 1:1; else echo Boot from eMMC ; mmc init 0 ; setenv partition 0:1 ; fi; if run loadbootenv; then echo Loaded environment frm
boot_rd_img=mmc device 0;mmc read ${loadaddr} 0xA00 1;image_blks 512;mmc read ${loadaddr} 0xA00 ${img_blks}
boot_rd_sec_img=mmc device 0;mmc read ${loadaddr} 0x10A00 1;image_blks 512;mmc read ${loadaddr} 0x10A00 ${img_blks}
boot_wr_img=image_check; if test ${img_result} = good; then image_blks 512 ${filesize};mmc device 0;mmc write ${loadaddr} 0xA00 ${img_blks}; fi
boot_wr_sec_img=image_check; if test ${img_result} = good; then image_blks 512 ${filesize};mmc device 0;mmc write ${loadaddr} 0x10A00 ${img_blks}; fi
bootargs=board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
bootcmd=run getbootdevice; mmc dev ${bootdevice}; mmc read ${kerneladdr} 1000 6000; run configBootargs; bootm ${kerneladdr};
bootdelay=3
bootemmc=true
bootenv=uEnv.txt
bootfile=uImage
bootmenu_delay=30
bpi=bananapi
bpiver=1
checksd=fatinfo ${device} 1:1
chip=MT7623N
configBootargs=run getbootdevice; setenv bootargs earlyprintk block2mtd.block2mtd=/dev/mmcblk${bootdevice},65536,RootFs,5 mtdparts=RootFs:512k(mbr)ro,512k(uboot)ro,512k(config)ro,512k(factory)r2
cpu=armv7
debug=7
device=mmc
duimage_backup=mmc device 0;mmc read ${loadaddr} 0x10A00 1;image_check; if test ${img_result} = bad;then run boot_rd_img; serious_image_check; if test ${img_result} = good; then backup_message;i
duimage_recovery=serious_image_check; if test ${img_result} = bad; then run boot_rd_sec_img;serious_image_check; if test ${img_result} = good; then reco_message; run boot_wr_img; fi; fi
ethact=Eth0
ethaddr=00:0C:E7:11:22:33
getbootdevice=setenv bootdevice 1; if test ${bootemmc} = true; then setenv bootdevice 0; fi;
"ipaddr=10.10.10.254"
kernel=uImage
kerneladdr=0x84000000
loadaddr=0x84000000
loadbootenv=fatload ${device} ${partition} ${scriptaddr} ${bpi}/${board}/${service}/${bootenv} || fatload ${device} ${partition} ${scriptaddr} ${bootenv}
partition=1:1
root=/dev/mmcblk0p2
scriptaddr=0x83000000
serverip=10.10.10.1
service=linux
soc=mt7623
stderr=serial
stdin=serial
stdout=serial
vendor=bananapi
wr_uboot=uboot_check;if test ${uboot_result} = good; then mmc device 0;mmc write ${loadaddr} 0x200 0x200;reset; fi

Environment size: 3372/16380 bytes
BPI-R2>

The last boot shows that the U-Boot is loaded from µSD but the environment is from eMMC? :thinking: May be some one else can also try this…


(gary) #14

I see the log “*** Warning - bad CRC, using default environment”, maybe that’s the reason why ip setting is back to default, but I’m not sure why this problem happens, will check it later.


(Weiqi Chen) #15

which software you used to log the console output to a file? It there any software in linux can do that?


(Frank W.) #16

you can use “minicom -C logfile”


(Weiqi Chen) #17

The full logs

Boot from emmc

 [USBD] USB PRB0 LineState: 0

[USBD] USB cable/ No Cable inserted!

[PLFM] Keep stay in USB Mode
Platform initialization is ok
wait for frequency meter finish, CLK26CALI = 0x81
mt_pll_post_init: mt_get_cpu_freq = 1040000Khz
wait for frequency meter finish, CLK26CALI = 0x90
mt_pll_post_init: mt_get_bus_freq = 273000Khz
wait for frequency meter finish, CLK26CALI = 0x81
mt_pll_post_init: mt_get_mem_freq = 133250Khz
[PWRAP] pwrap_init_preloader
[PWRAP] pwrap_init
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=0,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=1,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=2,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=3 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=4 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=5 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=6 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=7 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=8 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=9 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=10 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=11,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=12,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=13,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=14,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=15,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=16,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=17,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=18,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=19,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=20,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=21,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=22,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=23,rdata=6A97
[PWRAP] _pwrap_init_reg_clock
[PMIC_WRAP]wrap_init pass,the return value=0.
[pmic6323_init] Preloader Start..................
[pmic6323_init] PMIC CHIP Code = 0x2023
INT_MISC_CON: 0  TOP_RST_MISC: 0
pl pmic powerkey Release
[pmic6323_init] powerKey = 0
[pmic6323_init] is USB in = 0xB004
[pmic6323_init] Reg[0x11A]=0x1B
pmic setup LED
[pmic6323_init] Done...................
mt7623 disable long press reset ->>>>>
mt7623 disable long press reset <<<<<-
mt7623 VPA supplied by 1.0V to MT7530 ->
mt7623 VPA supplied by 1.0V to MT7530 <-
mt7623 enables RG_VGP1_EN for LCM ->
mt7623 enables RG_VGP1_EN for LCM <-
MT7623 E2 setting =>
MT7623 E2 setting <=
[PLFM] Init I2C: OK(0)
[PLFM] Init PWRAP: OK(0)
[PLFM] Init PMIC: OK(0)
[PLFM] chip[CA00]

[BLDR] [Support SD/eMMC] Build Time: 20170905-120917
==== Dump RGU Reg ========
RGU MODE:     4D
RGU LENGTH:   FFE0
RGU STA:      0
RGU INTERVAL: FFF
RGU SWSYSRST: 0
==== Dump RGU Reg End ====
RGU: g_rgu_satus:0
 mtk_wdt_mode_config  mode value=10, tmp:22000010
PL P ON
WDT does not trigger reboot
RGU mtk_wdt_init:MTK_WDT_DEBUG_CTL(590200F3)
kpd read addr: 0x0040: data:0x4001
Enter mtk_kpd_gpio_set! 
kpd debug column : 0, 0, 0, 0, 0, 0, 0, 0
kpd debug row : 0, 0, 0, 0, 0, 0, 0, 0
after set KP enable: KP_SEL = 0x0 !
MTK_PMIC_RST_KEY is used for this project!
[RTC] get_frequency_meter: input=0x0, ouput=5
[RTC] get_frequency_meter: input=0x0, ouput=3967
[RTC] get_frequency_meter: input=0x0, ouput=5
[RTC] get_frequency_meter: input=0x0, ouput=0
[RTC] get_frequency_meter: input=0x0, ouput=0
[RTC] bbpu = 0xD, con = 0x8427
rtc_first_boot_init
[RTC] get_frequency_meter: input=0x0, ouput=5
[RTC] get_frequency_meter: input=0x0, ouput=3968
[RTC] get_frequency_meter: input=0x0, ouput=5
[RTC] get_frequency_meter: input=0x0, ouput=0
[RTC] get_frequency_meter: input=0x0, ouput=0
rtc_2sec_stat_clear
rtc_2sec_reboot_check cali=256
rtc_2sec_stat_clear
[RTC] irqsta = 0x0, pdn1 = 0x0, pdn2 = 0x201, spar0 = 0xC0, spar1 = 0x800
[RTC] new_spare0 = 0x0, new_spare1 = 0x1, new_spare2 = 0x1, new_spare3 = 0x1
[RTC] bbpu = 0xD, con = 0x426, cali = 0x100
pl pmic powerkey Release
[PLFM] Power key boot!
[RTC] rtc_bbpu_power_on done
[EMI] mcp_dram_num:0,discrete_dram_num:1,enable_combo_dis:0
[EMI] PCDDR3
[Check]mt_get_mdl_number 0x0
[EMI] eMMC/NAND ID = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
[EMI] MDL number = 0
[EMI] emi_set eMMC/NAND ID = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
[EMI][Vcore]0x21E=0x48,0x220=0x48
[EMI][Vmem]0x554=0x0
wait for frequency meter finish, CLK26CALI = 0x81
[EMI] PCDDR3 DRAM Clock = 1600012 KHz, MEMPLL MODE = 2 
[EMI] PCDDR3 RXTDN Calibration:
Start REXTDN SW calibration...
drvp=0xB,drvn=0x8
[EMI] pinmux = 4
===============================================================================

        dramc_write_leveling_swcal
===============================================================================
delay  byte0  byte1  byte2  byte3
-----------------------------
0    0    1    1    1    
1    1    1    1    1    
2    1    1    1    1    
3    1    1    1    1    
4    1    1    1    1    
5    1    1    1    1    
6    1    1    1    1    
7    1    1    1    1    
8    1    1    1    1    
9    1    1    1    1    
10    1    1    1    1    
11    1    1    1    1    
12    1    1    1    1    
13    1    1    1    1    
14    1    1    1    1    
15    1    1    1    1    
pass bytecount = 4
byte_i    status    best delay
0    2    1
1    2    0
2    2    0
3    2    0
========================================
[write leveling]DQS: 0x1, DQM: 0x1
[write leveling after remap]DQ byte0 reg: 0x200 val: 0x11110000
[write leveling after remap]DQ byte1 reg: 0x204 val: 0x1111
[write leveling after remap]DQ byte2 reg: 0x208 val: 0x0
[write leveling after remap]DQ byte3 reg: 0x20C val: 0x0
=============================================
X-axis: DQS Gating Window Delay (Fine Scale)
Y-axis: DQS Gating Window Delay (Coarse Scale)
=============================================
          0    8   16   24   32   40   48   56   64   72   80   88   96  104  112  120
      --------------------------------------------------------------------------------
0000:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0001:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0002:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0003:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0004:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0005:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0006:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0007:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0008:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0009:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000E:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000F:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0010:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    1    1
0011:|    0    0    0    0    0    0    0    0    0    1    1    1    1    1    1    1
0012:|    0    0    0    1    1    1    1    1    1    1    1    1    0    0    0    0
0013:|    1    1    1    1    1    1    1    0    0    0    0    0    0    0    0    0
0014:|    1    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0015:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0016:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0017:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0018:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0019:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001E:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001F:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
Rank 0 coarse tune value selection : 18, 18
18
56
rank 0 coarse = 18
rank 0 fine = 56
00:|    0    0    0    0    0    0    0    0    1    1    1    0
opt_dle value:13
==================================================================
                RX      DQS perbit delay software calibration 
==================================================================
1.0-31 bit dq delay value
==================================================================
bit|     0  1  2  3  4  5  6  7  8  9
--------------------------------------
0 |    0 0 0 0 0 0 0 0 0 0 
10 |    0 0 0 0 0 0 0 0 0 0 
20 |    0 0 0 0 0 0 0 0 0 0 
30 |    0 0 
--------------------------------------
==================================================================
2.dqs window
x=pass dqs delay value (min~max)center 
y=0-7bit DQ of every group
input delay:DQS0 =49 DQS1 = 39 DQS2 =51 DQS3 = 43
==================================================================
bit     DQS0     bit      DQS1     bit     DQS2     bit     DQS3
0  (17~68)42  8  (7~58)32  16  (22~70)46  24  (17~61)39
1  (19~67)43  9  (7~61)34  17  (24~70)47  25  (16~58)37
2  (19~68)43  10  (13~62)37  18  (25~70)47  26  (19~62)40
3  (17~69)43  11  (12~63)37  19  (21~68)44  27  (19~60)39
4  (21~72)46  12  (15~62)38  20  (24~72)48  28  (22~64)43
5  (19~70)44  13  (15~62)38  21  (25~74)49  29  (21~65)43
6  (22~70)46  14  (13~60)36  22  (24~74)49  30  (17~65)41
7  (26~72)49  15  (16~62)39  23  (29~74)51  31  (19~65)42
==================================================================
3.dq delay value last
==================================================================
bit|    0  1  2  3  4  5  6  7  8   9
--------------------------------------
0 |    7 6 6 6 3 5 3 0 7 5 
10 |    2 2 1 1 3 0 5 4 4 7 
20 |    3 2 2 0 4 6 3 4 0 0 
30 |    2 1 
==================================================================
*DQIDLY1 = 0x6060607
*DQIDLY2 = 0x30503
*DQIDLY3 = 0x2020507
*DQIDLY4 = 0x30101
*DQIDLY5 = 0x7040405
*DQIDLY6 = 0x20203
*DQIDLY7 = 0x4030604
*DQIDLY8 = 0x1020000
*DRAMC_R0DELDLY = 0x2B332731

[MEM]CONA:F3A2,conf1:F07486A3
DM4BitMux = 1 
[Warning] DQSO 0 in TX per-bit = 3 > DQSO 0 in WL = 1  
DQSO 1 in TX per-bit = 0 <= DQSO 1 in WL = 0  
[Warning] DQSO 2 in TX per-bit = 7 > DQSO 2 in WL = 0  
[Warning] DQSO 3 in TX per-bit = 4 > DQSO 3 in WL = 0  
Tx DQM dly  = 0x1123
Tx DQM dly bit4 = 0x0
DRAMC_DQODLY1=3532324h
DRAMC_DQODLY2=24124354h
DRAMC_DQODLY3=1112113h
DRAMC_DQODLY4=11013112h
Tx DQ dly bit4 = 0x0
Tx DQS dly = 0x4703
Tx DQS dly bit4 = 0x0
TX Byte0: DQ - 14, DQS - 17. win_sum= 30
TX Byte1: DQ - 20, DQS - 14. win_sum= 33
TX Byte2: DQ - 10, DQS - 23. win_sum= 32
TX Byte3: DQ - 12, DQS - 19. win_sum= 30
DRAMC calibration takes 650615793 CPU cycles

[EMI] DRAMC calibration passed

[MEM] complex R/W mem test pass
0:dram_rank_size:80000000
[Dram_Buffer] dram size:-2147483648 
[Dram_Buffer] structure size: 1725560 
[Dram_Buffer] MAX_TEE_DRAM_SIZE: 0 
Load u-boot from eMMC...
[PLFM] Init Boot Device: OK(0)

[PART] blksz: 512B
[PART] [0x0000000000000000-0x000000000003FFFF] "PRELOADER" (512 blocks) 
[PART] [0x0000000000000000-0x000000000003FFFF] "MBR" (512 blocks) 
[PART] [0x0000000000040000-0x00000000000BFFFF] "UBOOT" (1024 blocks) 
[PART] [0x00000000000C0000-0x00000000000FFFFF] "CONFIG" (512 blocks) 
[PART] [0x0000000000100000-0x000000000013FFFF] "FACTORY" (512 blocks) 
[PART] [0x0000000000140000-0x000000000213FFFF] "BOOTIMG" (65536 blocks) 
[PART] [0x0000000002140000-0x000000000413FFFF] "RECOVERY" (65536 blocks) 
[PART] [0x0000000004140000-0x000000004413FFFF] "ROOTFS" (2097152 blocks) 
[PART] [0x0000000044140000-0x000001FFC413FFFF] "USER" (-4194304 blocks) 
[platform_vusb_on] PASS
[TOOL] PMIC not dectect usb cable!
[TOOL] <UART> listen  ended, receive size:0!
[TOOL] <UART> wait sync time 150ms->5ms
[TOOL] <UART> receieved data: ()

Device APC domain init setup:

 bootloader load uboot ,the address of uboot is 81E00000 
[PART]partition name UBOOT 
[PART]partition start block 0x200 
[PART]partition size 0x80000 
[PART]partition blks 0x400 
[PART]partition flags 0x0 
[PART]partition name 0x8 
[bean] part->startblk(0x200) bdev->blksz(0x200) part->part_id(8) hdr(0xFFB50000)
[BlkDev.c 101 ]partition block size 0x200 ,blks:0xE90000
[BlkDev.c 101 ]partition block erase size 0x200 

[PART] load "UBOOT" from 0x0000000000050000 (dev) to 0x81E00000 (mem) [SUCCESS]
[PART] load speed: 10850KB/s, 300000 bytes, 27ms
[BT_SD_PG] device info 0x8590 0x8A00 0xCB01 0x102
0:dram_rank_size:80000000
[PLFM] md_type[0] = 255 
[PLFM] md_type[1] = 255 

[PLFM] boot reason: 0
[PLFM] boot mode: 0
[PLFM] META COM0: 0
[PLFM] <0xFFB7CC10>: 0x0
[PLFM] boot time: 3145ms
[PLFM] DDR reserve mode: enable = 0, success = 0

[BLDR] jump to 0x81E00000
[BLDR] <0x81E00000>=0xEA00000F
[BLDR] <0x81E00004>=0xE59FF014


U-Boot 2014.04-rc1 (Jan 07 2018 - 17:44:45)

================== Iverson debug. ===========================
g_nr_bank = 1.
g_total_rank_size = 0x80000000
DRAM:  2 GiB
WARNING: Caches not enabled
dev_num = 0
***size=4096, offset=1536, blk_start=3, blk_cnt=8
In:    serial
Out:   serial
Err:   serial
dev_num = 0
***size=4096, offset=1536, blk_start=3, blk_cnt=8
bootargs = board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
Net:   mtk_eth
Uip activated
BPI-EMMC> printenv
arch=arm
baudrate=115200
board=bpi-r2
board_name=mt7623_evb
boot0=setenv mmc 0; run bootcmd
boot1=setenv mmc 1; run bootcmd
boot2=run bootcmd
boot3=setenv mmc 0; run bootfallback
boot4=setenv mmc 1; run bootfallback
bootargs=board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
bootcmd=mmc init $mmc; run loadbootenv; run uenvcmd
bootdelay=3
bootenv=uEnv.txt
bootfallback=mmc init $mmc; run loadbootenv; run ufallbackcmd
bootfile=iverson_uImage
bootmenu_0=1. Boot from internal emmc.=run boot0
bootmenu_1=2. Boot from external sd-card.=run boot1
bootmenu_2=3. Boot from default medium.=run boot2
bootmenu_3=4. Fallback boot from internam emmc.=run boot3
bootmenu_4=5. Fallback boot from external sd-card.=run boot4
bpi=bananapi
bpiver=1
chip=MT7623N
cpu=armv7
debug=7
device=mmc
env_in_sd=1
ethact=mtk_eth
ethaddr=00:0C:E7:11:22:33
ipaddr=10.10.10.254
kernel=uImage
loadaddr=0x84000000
loadbootenv=fatload ${device} ${partition} ${scriptaddr} ${board}/${service}/${bootenv} ||fatload ${device} ${partition} ${scriptaddr} ${bootenv}; env import -t ${scriptaddr} ${filesize};
mmc=1
partition=0:1
scriptaddr=0x83000000
serverip=10.10.10.3
service=linux
soc=mt7623
stderr=serial
stdin=serial
stdout=serial
vendor=mediatek

Environment size: 1406/4092 bytes
BPI-EMMC> save
Saving Environment to MMC...
dev_num = 0
Writing to MMC(0)... offset=1536 
size=4096 
mmc->write_bl_len=512
done

Boot from SD

 [USBD] USB PRB0 LineState: 0

[USBD] USB cable/ No Cable inserted!

[PLFM] Keep stay in USB Mode
Platform initialization is ok
wait for frequency meter finish, CLK26CALI = 0x81
mt_pll_post_init: mt_get_cpu_freq = 1040000Khz
wait for frequency meter finish, CLK26CALI = 0x90
mt_pll_post_init: mt_get_bus_freq = 273000Khz
wait for frequency meter finish, CLK26CALI = 0x81
mt_pll_post_init: mt_get_mem_freq = 133250Khz
[PWRAP] pwrap_init_preloader
[PWRAP] pwrap_init
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=0,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=1,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=2,rdata=2D52
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=3 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=4 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=5 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=6 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=7 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=8 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=9 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] pass,index=10 rdata=5AA5
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=11,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=12,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=13,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=14,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=15,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=16,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=17,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=18,rdata=B54B
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=19,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=20,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=21,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=22,rdata=6A97
[PWRAP] _pwrap_init_sistrobe [Read Test] fail,index=23,rdata=6A97
[PWRAP] _pwrap_init_reg_clock
[PMIC_WRAP]wrap_init pass,the return value=0.
[pmic6323_init] Preloader Start..................
[pmic6323_init] PMIC CHIP Code = 0x2023
INT_MISC_CON: 0  TOP_RST_MISC: 0
pl pmic powerkey Release
[pmic6323_init] powerKey = 0
[pmic6323_init] is USB in = 0xB004
[pmic6323_init] Reg[0x11A]=0x1B
pmic setup LED
[pmic6323_init] Done...................
mt7623 disable long press reset ->>>>>
mt7623 disable long press reset <<<<<-
mt7623 VPA supplied by 1.0V to MT7530 ->
mt7623 VPA supplied by 1.0V to MT7530 <-
mt7623 enables RG_VGP1_EN for LCM ->
mt7623 enables RG_VGP1_EN for LCM <-
MT7623 E2 setting =>
MT7623 E2 setting <=
[PLFM] Init I2C: OK(0)
[PLFM] Init PWRAP: OK(0)
[PLFM] Init PMIC: OK(0)
[PLFM] chip[CA00]

[BLDR] [Support SD/eMMC] Build Time: 20170114-170026
==== Dump RGU Reg ========
RGU MODE:     4D
RGU LENGTH:   FFE0
RGU STA:      0
RGU INTERVAL: FFF
RGU SWSYSRST: 0
==== Dump RGU Reg End ====
RGU: g_rgu_satus:0
 mtk_wdt_mode_config  mode value=10, tmp:22000010
PL P ON
WDT does not trigger reboot
RGU mtk_wdt_init:MTK_WDT_DEBUG_CTL(590200F3)
kpd read addr: 0x0040: data:0x4001
Enter mtk_kpd_gpio_set! 
kpd debug column : 0, 0, 0, 0, 0, 0, 0, 0
kpd debug row : 0, 0, 0, 0, 0, 0, 0, 0
after set KP enable: KP_SEL = 0x0 !
MTK_PMIC_RST_KEY is used for this project!
[RTC] get_frequency_meter: input=0x0, ouput=5
[RTC] get_frequency_meter: input=0x0, ouput=3967
[RTC] get_frequency_meter: input=0x0, ouput=5
[RTC] get_frequency_meter: input=0x0, ouput=0
[RTC] get_frequency_meter: input=0x0, ouput=0
[RTC] bbpu = 0xD, con = 0x8427
rtc_first_boot_init
[RTC] get_frequency_meter: input=0x0, ouput=5
[RTC] get_frequency_meter: input=0x0, ouput=3967
[RTC] get_frequency_meter: input=0x0, ouput=5
[RTC] get_frequency_meter: input=0x0, ouput=0
[RTC] get_frequency_meter: input=0x0, ouput=0
rtc_2sec_stat_clear
rtc_2sec_reboot_check cali=256
rtc_2sec_stat_clear
[RTC] irqsta = 0x0, pdn1 = 0x0, pdn2 = 0x201, spar0 = 0xC0, spar1 = 0x800
[RTC] new_spare0 = 0x0, new_spare1 = 0x1, new_spare2 = 0x1, new_spare3 = 0x1
[RTC] bbpu = 0xD, con = 0x426, cali = 0x100
pl pmic powerkey Release
[PLFM] Power key boot!
[RTC] rtc_bbpu_power_on done
[EMI] mcp_dram_num:0,discrete_dram_num:1,enable_combo_dis:0
[EMI] PCDDR3
[Check]mt_get_mdl_number 0x0
[EMI] eMMC/NAND ID = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
[EMI] MDL number = 0
[EMI] emi_set eMMC/NAND ID = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
[EMI][Vcore]0x21E=0x48,0x220=0x48
[EMI][Vmem]0x554=0x0
wait for frequency meter finish, CLK26CALI = 0x81
[EMI] PCDDR3 DRAM Clock = 1600012 KHz, MEMPLL MODE = 2 
[EMI] PCDDR3 RXTDN Calibration:
Start REXTDN SW calibration...
drvp=0xB,drvn=0x8
[EMI] pinmux = 4
===============================================================================

        dramc_write_leveling_swcal
===============================================================================
delay  byte0  byte1  byte2  byte3
-----------------------------
0    0    1    1    1    
1    1    1    1    1    
2    1    1    1    1    
3    1    1    1    1    
4    1    1    1    1    
5    1    1    1    1    
6    1    1    1    1    
7    1    1    1    1    
8    1    1    1    1    
9    1    1    1    1    
10    1    1    1    1    
11    1    1    1    1    
12    1    1    1    1    
13    1    1    1    1    
14    1    1    1    1    
15    1    1    1    1    
pass bytecount = 4
byte_i    status    best delay
0    2    1
1    2    0
2    2    0
3    2    0
========================================
[write leveling]DQS: 0x1, DQM: 0x1
[write leveling after remap]DQ byte0 reg: 0x200 val: 0x11110000
[write leveling after remap]DQ byte1 reg: 0x204 val: 0x1111
[write leveling after remap]DQ byte2 reg: 0x208 val: 0x0
[write leveling after remap]DQ byte3 reg: 0x20C val: 0x0
=============================================
X-axis: DQS Gating Window Delay (Fine Scale)
Y-axis: DQS Gating Window Delay (Coarse Scale)
=============================================
          0    8   16   24   32   40   48   56   64   72   80   88   96  104  112  120
      --------------------------------------------------------------------------------
0000:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0001:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0002:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0003:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0004:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0005:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0006:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0007:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0008:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0009:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000E:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000F:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0010:|    0    0    0    0    0    0    0    0    0    0    0    0    0    1    1    1
0011:|    0    0    0    0    0    0    0    0    1    1    1    1    1    1    1    1
0012:|    0    0    0    1    1    1    1    1    1    1    1    1    0    0    0    0
0013:|    1    1    1    1    1    1    1    0    0    0    0    0    0    0    0    0
0014:|    1    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0015:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0016:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0017:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0018:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0019:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001E:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001F:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
Rank 0 coarse tune value selection : 18, 18
18
56
rank 0 coarse = 18
rank 0 fine = 56
00:|    0    0    0    0    0    0    0    0    1    1    1    0
opt_dle value:13
==================================================================
                RX      DQS perbit delay software calibration 
==================================================================
1.0-31 bit dq delay value
==================================================================
bit|     0  1  2  3  4  5  6  7  8  9
--------------------------------------
0 |    0 0 0 0 0 0 0 0 0 0 
10 |    0 0 0 0 0 0 0 0 0 0 
20 |    0 0 0 0 0 0 0 0 0 0 
30 |    0 0 
--------------------------------------
==================================================================
2.dqs window
x=pass dqs delay value (min~max)center 
y=0-7bit DQ of every group
input delay:DQS0 =49 DQS1 = 39 DQS2 =51 DQS3 = 43
==================================================================
bit     DQS0     bit      DQS1     bit     DQS2     bit     DQS3
0  (17~67)42  8  (7~58)32  16  (22~70)46  24  (17~62)39
1  (19~67)43  9  (7~61)34  17  (24~70)47  25  (16~58)37
2  (19~67)43  10  (13~62)37  18  (25~70)47  26  (19~62)40
3  (17~69)43  11  (12~63)37  19  (21~68)44  27  (19~60)39
4  (21~72)46  12  (14~62)38  20  (25~72)48  28  (22~64)43
5  (19~70)44  13  (14~62)38  21  (25~73)49  29  (21~65)43
6  (22~70)46  14  (13~60)36  22  (24~74)49  30  (17~65)41
7  (26~72)49  15  (16~62)39  23  (29~74)51  31  (19~65)42
==================================================================
3.dq delay value last
==================================================================
bit|    0  1  2  3  4  5  6  7  8   9
--------------------------------------
0 |    7 6 6 6 3 5 3 0 7 5 
10 |    2 2 1 1 3 0 5 4 4 7 
20 |    3 2 2 0 4 6 3 4 0 0 
30 |    2 1 
==================================================================
*DQIDLY1 = 0x6060607
*DQIDLY2 = 0x30503
*DQIDLY3 = 0x2020507
*DQIDLY4 = 0x30101
*DQIDLY5 = 0x7040405
*DQIDLY6 = 0x20203
*DQIDLY7 = 0x4030604
*DQIDLY8 = 0x1020000
*DRAMC_R0DELDLY = 0x2B332731

[MEM]CONA:F3A2,conf1:F07486A3
DM4BitMux = 1 
[Warning] DQSO 0 in TX per-bit = 2 > DQSO 0 in WL = 1  
DQSO 1 in TX per-bit = 0 <= DQSO 1 in WL = 0  
[Warning] DQSO 2 in TX per-bit = 8 > DQSO 2 in WL = 0  
[Warning] DQSO 3 in TX per-bit = 4 > DQSO 3 in WL = 0  
Tx DQM dly  = 0x112
Tx DQM dly bit4 = 0x0
DRAMC_DQODLY1=2321113h
DRAMC_DQODLY2=12212133h
DRAMC_DQODLY3=1011011h
DRAMC_DQODLY4=1003133h
Tx DQ dly bit4 = 0x0
Tx DQS dly = 0x4802
Tx DQS dly bit4 = 0x0
TX Byte0: DQ - 14, DQS - 16. win_sum= 29
TX Byte1: DQ - 18, DQS - 15. win_sum= 32
TX Byte2: DQ - 9, DQS - 22. win_sum= 30
TX Byte3: DQ - 12, DQS - 20. win_sum= 31
DRAMC calibration takes 650324942 CPU cycles

[EMI] DRAMC calibration passed

[MEM] complex R/W mem test pass
0:dram_rank_size:80000000
[Dram_Buffer] dram size:-2147483648 
[Dram_Buffer] structure size: 1725560 
[Dram_Buffer] MAX_TEE_DRAM_SIZE: 0 
Boot from SD Card!!
[PLFM] Init Boot Device: OK(0)

[PART] blksz: 512B
[PART] [0x0000000000000000-0x000000000003FFFF] "PRELOADER" (512 blocks) 
[PART] [0x0000000000000000-0x000000000003FFFF] "MBR" (512 blocks) 
[PART] [0x0000000000040000-0x00000000000BFFFF] "UBOOT" (1024 blocks) 
[PART] [0x00000000000C0000-0x00000000000FFFFF] "CONFIG" (512 blocks) 
[PART] [0x0000000000100000-0x000000000013FFFF] "FACTORY" (512 blocks) 
[PART] [0x0000000000140000-0x000000000213FFFF] "BOOTIMG" (65536 blocks) 
[PART] [0x0000000002140000-0x000000000413FFFF] "RECOVERY" (65536 blocks) 
[PART] [0x0000000004140000-0x000000004413FFFF] "ROOTFS" (2097152 blocks) 
[PART] [0x0000000044140000-0x000001FFC413FFFF] "USER" (-4194304 blocks) 
[platform_vusb_on] PASS
[TOOL] PMIC not dectect usb cable!
[TOOL] <UART> listen  ended, receive size:0!
[TOOL] <UART> wait sync time 150ms->5ms
[TOOL] <UART> receieved data: ()

Device APC domain init setup:

 bootloader load uboot ,the address of uboot is 81E00000 
[PART]partition name UBOOT 
[PART]partition start block 0x200 
[PART]partition size 0x80000 
[PART]partition blks 0x400 
[PART]partition flags 0x0 
[PART]partition name 0x8 
[bean] part->startblk(0x200) bdev->blksz(0x200) part->part_id(8) hdr(0xFFB50000)
[BlkDev.c 101 ]partition block size 0x200 ,blks:0x1DACC00
[BlkDev.c 101 ]partition block erase size 0x200 

[PART] load "UBOOT" from 0x0000000000050000 (dev) to 0x81E00000 (mem) [SUCCESS]
[PART] load speed: 6103KB/s, 300000 bytes, 48ms
[BT_SD_PG] device info 0x8590 0x8A00 0xCB01 0x102
0:dram_rank_size:80000000
[PLFM] md_type[0] = 255 
[PLFM] md_type[1] = 255 

[PLFM] boot reason: 0
[PLFM] boot mode: 0
[PLFM] META COM0: 0
[PLFM] <0xFFB7CC10>: 0x0
[PLFM] boot time: 2928ms
[PLFM] DDR reserve mode: enable = 0, success = 0

[BLDR] jump to 0x81E00000
[BLDR] <0x81E00000>=0xEA00000F
[BLDR] <0x81E00004>=0xE59FF014


U-Boot 2014.04-rc1 (Feb 27 2018 - 21:51:55)

================== Iverson debug. ===========================
g_nr_bank = 1.
g_total_rank_size = 0x80000000
DRAM:  2 GiB
WARNING: Caches not enabled
dev_num = 0
***size=4096, offset=1536, blk_start=3, blk_cnt=8
In:    serial
Out:   serial
Err:   serial
dev_num = 0
***size=4096, offset=1536, blk_start=3, blk_cnt=8
bootargs = board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
Net:   mtk_eth
Uip activated
BPI-SD> printenv
arch=arm
baudrate=115200
board=bpi-r2
board_name=mt7623_evb
boot0=setenv mmc 0; run bootcmd
boot1=setenv mmc 1; run bootcmd
boot2=run bootcmd
boot3=setenv mmc 0; run bootfallback
boot4=setenv mmc 1; run bootfallback
bootargs=board=bpi-r2 earlyprintk console=tty1 fbcon=map:0 console=ttyS0,115200 vmalloc=496M debug=7 initcall_debug=0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait
bootcmd=mmc init $mmc; run loadbootenv; run uenvcmd
bootdelay=3
bootenv=uEnv.txt
bootfallback=mmc init $mmc; run loadbootenv; run ufallbackcmd
bootfile=iverson_uImage
bootmenu_0=1. Boot from internal emmc.=run boot0
bootmenu_1=2. Boot from external sd-card.=run boot1
bootmenu_2=3. Boot from default medium.=run boot2
bootmenu_3=4. Fallback boot from internam emmc.=run boot3
bootmenu_4=5. Fallback boot from external sd-card.=run boot4
bpi=bananapi
bpiver=1
chip=MT7623N
cpu=armv7
debug=7
device=mmc
env_in_sd=1
ethact=mtk_eth
ethaddr=00:0C:E7:11:22:33
ipaddr=10.10.10.254
kernel=uImage
loadaddr=0x84000000
loadbootenv=fatload ${device} ${partition} ${scriptaddr} ${board}/${service}/${bootenv} ||fatload ${device} ${partition} ${scriptaddr} ${bootenv}; env import -t ${scriptaddr} ${filesize};
mmc=1
partition=0:1
scriptaddr=0x83000000
serverip=10.10.10.3
service=linux
soc=mt7623
stderr=serial
stdin=serial
stdout=serial
vendor=mediatek

Environment size: 1406/4092 bytes
BPI-SD> save
Saving Environment to MMC...
dev_num = 0
Writing to MMC(0)... offset=1536 
size=4096 
mmc->write_bl_len=512
done

diff of two logs above

63c63
< [BLDR] [Support SD/eMMC] Build Time: 20170114-170026
---
> [BLDR] [Support SD/eMMC] Build Time: 20170905-120917
90c90
< [RTC] get_frequency_meter: input=0x0, ouput=3967
---
> [RTC] get_frequency_meter: input=0x0, ouput=3968
173,174c173,174
< 0010:|    0    0    0    0    0    0    0    0    0    0    0    0    0    1    1    1
< 0011:|    0    0    0    0    0    0    0    0    1    1    1    1    1    1    1    1
---
> 0010:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    1    1
> 0011:|    0    0    0    0    0    0    0    0    0    1    1    1    1    1    1    1
215c215
< 0  (17~67)42  8  (7~58)32  16  (22~70)46  24  (17~62)39
---
> 0  (17~68)42  8  (7~58)32  16  (22~70)46  24  (17~61)39
217c217
< 2  (19~67)43  10  (13~62)37  18  (25~70)47  26  (19~62)40
---
> 2  (19~68)43  10  (13~62)37  18  (25~70)47  26  (19~62)40
219,220c219,220
< 4  (21~72)46  12  (14~62)38  20  (25~72)48  28  (22~64)43
< 5  (19~70)44  13  (14~62)38  21  (25~73)49  29  (21~65)43
---
> 4  (21~72)46  12  (15~62)38  20  (24~72)48  28  (22~64)43
> 5  (19~70)44  13  (15~62)38  21  (25~74)49  29  (21~65)43
245c245
< [Warning] DQSO 0 in TX per-bit = 2 > DQSO 0 in WL = 1
---
> [Warning] DQSO 0 in TX per-bit = 3 > DQSO 0 in WL = 1
247c247
< [Warning] DQSO 2 in TX per-bit = 8 > DQSO 2 in WL = 0
---
> [Warning] DQSO 2 in TX per-bit = 7 > DQSO 2 in WL = 0
249c249
< Tx DQM dly  = 0x112
---
> Tx DQM dly  = 0x1123
251,254c251,254
< DRAMC_DQODLY1=2321113h
< DRAMC_DQODLY2=12212133h
< DRAMC_DQODLY3=1011011h
< DRAMC_DQODLY4=1003133h
---
> DRAMC_DQODLY1=3532324h
> DRAMC_DQODLY2=24124354h
> DRAMC_DQODLY3=1112113h
> DRAMC_DQODLY4=11013112h
256c256
< Tx DQS dly = 0x4802
---
> Tx DQS dly = 0x4703
258,262c258,262
< TX Byte0: DQ - 14, DQS - 16. win_sum= 29
< TX Byte1: DQ - 18, DQS - 15. win_sum= 32
< TX Byte2: DQ - 9, DQS - 22. win_sum= 30
< TX Byte3: DQ - 12, DQS - 20. win_sum= 31
< DRAMC calibration takes 650324942 CPU cycles
---
> TX Byte0: DQ - 14, DQS - 17. win_sum= 30
> TX Byte1: DQ - 20, DQS - 14. win_sum= 33
> TX Byte2: DQ - 10, DQS - 23. win_sum= 32
> TX Byte3: DQ - 12, DQS - 19. win_sum= 30
> DRAMC calibration takes 650615793 CPU cycles
271c271
< Boot from SD Card!!
---
> Load u-boot from eMMC...
300c300
< [BlkDev.c 101 ]partition block size 0x200 ,blks:0x1DACC00
---
> [BlkDev.c 101 ]partition block size 0x200 ,blks:0xE90000
304c304
< [PART] load speed: 6103KB/s, 300000 bytes, 48ms
---
> [PART] load speed: 10850KB/s, 300000 bytes, 27ms
314c314
< [PLFM] boot time: 2928ms
---
> [PLFM] boot time: 3145ms
322c322
< U-Boot 2014.04-rc1 (Feb 27 2018 - 21:51:55)
---
> U-Boot 2014.04-rc1 (Jan 07 2018 - 17:44:45)
339c339
< BPI-SD> printenv
---
> BPI-EMMC> printenv
385c385
< BPI-SD> save
---
> BPI-EMMC> save



(Frank W.) #18
  • device=mmc, mmc=1,partition=0:1 both times
  • both writes go to MMC(0)

@garywang i assume the CRC ist because it is a new µSD (maybe also emmc) without an saved environment @weiqi_chen i miss “MMC: emmc: 0, sdcard: 1” line in your logs (exist in logs from @tStone)


(Weiqi Chen) #19

I checked and found that there is no such log in my case…


(Frank W.) #20

strange…i have also not this info… @tstone, have you patched you uboot? to show that info or is it simply newer (time from version Feb 2018, @weiqi_chen have january 2018, i have Oct 2017 on my test-card)

made some strange experiences:

BPI-IoT> uboot_check                                                          
Bad Magic Number.                                                             
BPI-IoT> version                                                              
                                                                              
U-Boot 2014.04-rc1 (Oct 16 2017 - 19:33:23)                                   
arm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) 4.8.4          
GNU ld (GNU Binutils for Ubuntu) 2.24                                         
BPI-IoT> serious_image_check                                                  
serious check                                                                 
BPI-IoT> mmcinfo                                                              
No MMC device available                                                       
BPI-IoT> mmc ?                                                                
mmc-1 operation                                                               
No MMC device available                                                       
mmc - MMC sub-system                                                          
                                                                              
Usage:                                                                        
mmc init [dev] - init MMC sub system                                          
mmc device [dev] - show or set current device                                 
mmc read addr blk# cnt                                                        
mmc write addr blk# cnt                                                       
                                       
BPI-IoT> mmc device                                                           
No MMC device available                                                       
BPI-IoT>