View Single Post
Old 03-11-2019, 12:19 PM   #34
tonyyng
Enthusiast
tonyyng began at the beginning.
 
Posts: 46
Karma: 10
Join Date: Jan 2019
Device: none
I can't figure out how loadu works. I tried an experiment with it.

I know the kernel image is stored on the nand at 0x80000 and is copied to memory at 0x31000000. Using uboot commands, I confirmed this:
Code:
eBR-1A # nandv 80000
000h: 27 05 19 56 f4 91 0f 3f 4c 11 3c 57 00 17 a3 40
010h: 30 00 80 00 30 00 80 00 f4 67 23 80 05 02 02 00
eBR-1A # md 31000000
31000000: 56190527 3f0f91f4 573c114c 40a31700    '..V...?L.<W...@
31000010: 00800030 00800030 802367f4 00020205    0...0....g#.....
Then I used mw to change a few bytes and nandw to write them
Code:
eBR-1A # mw.b 31000000 0 8
eBR-1A # md 31000000
31000000: 00000000 00000000 573c114c 40a31700    ........L.<W...@
31000010: 00800030 00800030 802367f4 00020205    0...0....g#.....
<snip>
eBR-1A # nandw 80000 8 31000000
eBR-1A # nandv 80000
000h: 00 00 00 00 00 00 00 00 4c 11 3c 57 00 17 a3 40
010h: 30 00 80 00 30 00 80 00 f4 67 23 80 05 02 02 00
Then guessing at the loadu steps:
Code:
eBR-1A # loadu 80000
IspHandle......................PHPDC_IE_SUSP
IspHandle......................PHPDC_IE_VBUS
IspHandle......................PHPDC_MODE_SOFTCT
IspHandle......................PHPDC_IE_RESM
IspHandle......................PHPDC_IE_SUSP
IspHandle......................PHPDC_IE_RESM
IspHandle........................PHPDC_IE_RST
IspHandle......................PHPDC_IE_SUSP
IspHandle......................PHPDC_IE_RESM
IspHandle........................PHPDC_IE_RST
[isp_WaitForConfigure] download into 0x00080000

In Linux:
tony@tony-Vostro-2520:~/dnw-linux-master/src/dnw$ ./dnw -a 0x80000 ~/kobo-update-1.8/uImage-eb600em
load address: 0x00080000
Writing data...
100%    0x0017A38A bytes (1512 K)
speed: 0.244567M/S

+phgPdc_Remove
-phPdc_Remove
[isp_WaitForConfigure]---
Download O.K.
NFAddress=0x00000000
<Uboot> BaseBlock=0x00000000, BaseAddr=0x00000000
<Uboot> BlockSize=  00000004, ByteLength=0x00080000
From 0x00000000 to 0x00020000
Target write size = 0x00020000
Erase Block] from [0x00000000] to [0x00000000] total [0x00000001]
Erase addr ] from [0x00000000] to [0x0001ffff]
Erase finished
From 0x00020000 to 0xfffffff6
Target write size = 0xfffdfff6
Erase Block] from [0x00000001] to [0x00007fff] total [0x00007fff]
Erase addr ] from [0x00020000] to [0xffffffff]
Erase finished
Program finished
eBR-1A # nandv 80000
000h: 00 00 00 00 00 00 00 00 4c 11 3c 57 00 17 a3 40
010h: 30 00 80 00 30 00 80 00 f4 67 23 80 05 02 02 00

eBR-1A # md 80000
00080000: 00000000 00000000 00000000 00000000    ................
00080010: 00000000 00000000 00000000 00000000    ................
00080020: 00000000 00000000 00000000 00000000    ................
00080030: 00000000 00000000 00000000 00000000    ................
I don't get it. It doesn't appear to update the nand or memory at 0x80000.

Here's the output from using loadum and nandw for the kernel image:
Code:
eBR-1A # loadum 31000000
IspHandle......................PHPDC_IE_SUSP
IspHandle......................PHPDC_IE_VBUS
IspHandle......................PHPDC_MODE_SOFTCT
IspHandle......................PHPDC_IE_RESM
IspHandle......................PHPDC_IE_SUSP
IspHandle......................PHPDC_IE_RESM
IspHandle........................PHPDC_IE_RST
IspHandle......................PHPDC_IE_SUSP
IspHandle......................PHPDC_IE_RESM
IspHandle........................PHPDC_IE_RST
[isp_WaitForConfigure] download into 0x31000000
+phgPdc_Remove
-phPdc_Remove
[isp_WaitForConfigure]---
Download O.K.
NFAddress=0x31000000
Program finished
eBR-1A # nandw 80000 200000 31000000
From 0x00080000 to 0x00280000
Target write size = 0x00200000
Erase Block] from [0x00000004] to [0x00000013] total [0x00000010]
Erase addr ] from [0x00080000] to [0x0027ffff]
Erase finished
eBR-1A # nandv 80000
000h: 27 05 19 56 f4 91 0f 3f 4c 11 3c 57 00 17 a3 40
010h: 30 00 80 00 30 00 80 00 f4 67 23 80 05 02 02 00
Notice the difference in the Erase addr messages:
loadu: Erase addr ] from [0x00000000] to [0x0001ffff]
loadu: Erase addr ] from [0x00020000] to [0xffffffff]

nandw: Erase addr ] from [0x00080000] to [0x0027ffff]


This output from the loadu approach doesn't look right. The base address and the ByteLength are incorrect.

NFAddress=0x00000000
<Uboot> BaseBlock=0x00000000, BaseAddr=0x00000000
<Uboot> BlockSize= 00000004, ByteLength=0x00080000

Perhaps the dnw communication with loadu isn't correct?
tonyyng is offline   Reply With Quote