This document contains explanation of some bytes that are stored in the first 4K block of spi flash boot device.
printf '\x00\x00\x00\x00' | dd conv=notrunc bs=1 of=hws.bin seek=80
The listing below is an output of the following commands:
# dd if=/dev/mtdblock0 of=hws bs=4K count=1 # hexdump -ve '"%08_ax " 1/4 "%08x" "\n"' hws
My comments are prepended with '#' sign.
# address # data # size of (commands+padding+crc), 32-bit unsigned integer 00000000 00000600 # # this is an address(?) that one can also find in the file # 'toolchain/image-tool/hw_setting.main.txt.d' # However in that file it's prefixed with tag 'b' (branch or bypass?) # but here it is just left alone # # see also an output of sysparser.pl: # `` # muti_bypass_mode_val = ffff # muti_bypass_addr_val = 8000400 # `` # # image-tool reads the text file 'hw_setting.main.txt.d' and translates # it to the binary file 'hw_setting.main.d'. # 00000004 0000ffff 00000008 08000400 # # These are 4 offsets of multi-hws parts (me do not knows what the purpose # of _multi_ hws) # see sysparser.pl, function fun_uboot # # They are offsets for multi_f00, multi_f01, multi_f02, multi_end data from # the beginning of the image # 0x5C4 = 1476 = 1456 (size of multi_main) - 8 bytes (strip bypass) + 28 bytes # where 28 bytes = 8 bytes (put back bypass) + 4 bytes (size field at the # beginning of image) + 4x4 bytes (these addresses: f00, f01, f02, end) # # f00, f01, f02 are actually empty in this build # but the 'end' section contains one write and one poll instructions, # see 'hw_setting.image.end.d' # 0000000c 000005c4 00000010 000005c4 00000014 000005c4 00000018 000005c4 # # see explanation of command codes in # 'sn9866_series_datasheet_standard_160930.pdf' on the last pages # # see explanation of some registers in # 'sn9866_series_datasheet_with_registers_v1_04.pdf' # # # This is a block of registers located in ITCM memory. # See Documentation/arm/tcm.txt for the explanation of what is ITCM. # # # I do not know anything about the following two registers # 0000001c 00000077 # cmd: write 00000020 ffff6094 # arg: register 00000024 00000000 # arg: value 00000028 00000077 0000002c ffff609c 00000030 00000000 # # jmp address # in RAM (VIRTUAL) memory # see 'toolchain/image-tool/sysparser.pl:579' # 00000034 00000077 00000038 ffff6090 0000003c 01d00000 # # load address # in PHYSICAL memory # see 'bootloader/u-boot-2011-09/src/common/cmd_update.c' # see 'toolchain/image-tool/sysparser.pl:579' # SB_FWIMG_REGISTER <-- put here IMAGE_BEGIN_ADDR # # Note that the jump address is just a load address plus 4 (bytes) # (we need to skip size field in the u-boot image) # 00000040 00000077 00000044 ffff601c 00000048 11cffffc # # u-boot address # in SERIAL FLASH # 0000004c 00000077 00000050 ffff60f8 00000054 00003000 # # u-boot size # this is a total size of the u-boot partition on SERIAL FLASH # 00000058 00000077 0000005c ffff6020 00000060 0007b000 # # **Documented** registers: # 00000064 00000077 00000068 98100008 0000006c 00000001 00000070 00000077 00000074 98100000 00000078 00000001 0000007c 00000077 00000080 90900038 00000084 00000006 00000088 00000077 0000008c 90900034 00000090 00000006 00000094 00000077 00000098 90600000 0000009c 8b000500 000000a0 00000077 000000a4 98000000 000000a8 ece180a0 000000ac 00000077 000000b0 98000004 000000b4 80840222 000000b8 00000077 000000bc 9800001c 000000c0 80000014 000000c4 0000006e 000000c8 00100000 000000cc 00000077 000000d0 90300000 000000d4 00000400 000000d8 0000007a 000000dc 90300004 000000e0 00000001 000000e4 00000077 000000e8 90300008 000000ec 020139c2 000000f0 00000077 000000f4 9030000c 000000f8 00c800a1 000000fc 00000077 00000100 90300010 00000104 00040a00 00000108 00000077 0000010c 90300014 00000110 18050202 00000114 00000077 00000118 90300018 0000011c 13060413 00000120 00000077 00000124 9030001c 00000128 00050204 0000012c 00000077 00000130 90300020 00000134 03036dd0 00000138 00000077 0000013c 90300024 00000140 00070600 00000144 00000077 00000148 90300028 0000014c 020d0101 00000150 00000077 00000154 9030002c 00000158 00000006 0000015c 00000077 00000160 90300030 00000164 00002b01 00000168 00000077 0000016c 90300034 00000170 00000c39 00000174 00000077 00000178 90300038 0000017c 00020002 00000180 00000077 00000184 9030003c 00000188 00c80008 0000018c 00000077 00000190 90300040 00000194 0000002f 00000198 00000077 0000019c 90300044 000001a0 03000001 000001a4 00000077 000001a8 90300048 000001ac 00000003 000001b0 0000007a 000001b4 9030004c 000001b8 00000004 000001bc 00000077 000001c0 9030005c 000001c4 000c5200 000001c8 00000077 000001cc 90300060 000001d0 00000002 000001d4 0000007a 000001d8 90300064 000001dc 00000001 000001e0 00000077 000001e4 90300068 000001e8 01000000 000001ec 00000077 000001f0 9030006c 000001f4 00000001 000001f8 0000007a 000001fc 90300070 00000200 00000002 00000204 00000077 00000208 90300078 0000020c 0a010101 00000210 00000077 00000214 9030007c 00000218 0101ffff 0000021c 00000077 00000220 90300080 00000224 01010101 00000228 00000077 0000022c 90300084 00000230 00010301 00000234 00000077 00000238 90300088 0000023c 00000100 00000240 00000077 00000244 9030008c 00000248 00010000 0000024c 0000007a 00000250 90300090 00000254 0000000a 00000258 00000077 0000025c 903000b8 00000260 03000000 00000264 00000077 00000268 903000bc 0000026c 00000003 00000270 00000077 00000274 903000c0 00000278 00000200 0000027c 0000007a 00000280 903000c4 00000284 00000001 00000288 00000077 0000028c 903000c8 00000290 0f0f0000 00000294 00000077 00000298 903000cc 0000029c 0f0f0f0f 000002a0 00000077 000002a4 903000d0 000002a8 0f0f0f0f 000002ac 00000077 000002b0 903000d4 000002b4 0f0f0f0f 000002b8 00000077 000002bc 903000d8 000002c0 03000303 000002c4 00000077 000002c8 903000dc 000002cc 03030003 000002d0 00000077 000002d4 903000e0 000002d8 00030300 000002dc 00000077 000002e0 903000e4 000002e4 03000303 000002e8 00000077 000002ec 903000e8 000002f0 03030003 000002f4 00000077 000002f8 903000ec 000002fc 00030300 00000300 00000077 00000304 903000f0 00000308 03000303 0000030c 00000077 00000310 903000f4 00000314 03030003 00000318 00000077 0000031c 903000f8 00000320 010f0300 00000324 00000077 00000328 903000fc 0000032c 00010f00 00000330 00000077 00000334 90300100 00000338 0f00010f 0000033c 00000077 00000340 90300104 00000344 010f0001 00000348 00000077 0000034c 90300108 00000350 00010f00 00000354 00000077 00000358 9030010c 0000035c 0f00010f 00000360 00000077 00000364 90300110 00000368 010f0001 0000036c 00000077 00000370 90300114 00000374 00010f00 00000378 00000077 0000037c 90300118 00000380 0000010f 00000384 0000007a 00000388 9030011c 0000038c 00000001 00000390 00000077 00000394 90300120 00000398 00000700 0000039c 00000077 000003a0 90300124 000003a4 00187200 000003a8 00000077 000003ac 90300128 000003b0 02000200 000003b4 00000077 000003b8 9030012c 000003bc 02000200 000003c0 00000077 000003c4 90300130 000003c8 00001872 000003cc 00000077 000003d0 90300134 000003d4 00007a3a 000003d8 00000077 000003dc 90300138 000003e0 01020405 000003e4 00000077 000003e8 9030013c 000003ec 0f0f0103 000003f0 00000077 000003f4 90300140 000003f8 03030f0f 000003fc 00000077 00000400 90300144 00000404 00030300 00000408 00000077 0000040c 90300148 00000410 0f00010f 00000414 00000077 00000418 9030014c 0000041c 00000001 00000420 0000007a 00000424 90300150 00000428 00000010 0000042c 00000077 00000430 90300200 00000434 04120412 00000438 00000077 0000043c 90300204 00000440 04140414 00000444 00000077 00000448 90300208 0000044c 60010060 00000450 00000077 00000454 9030020c 00000458 00000044 0000045c 00000077 00000460 90300210 00000464 00750024 00000468 00000077 0000046c 90300214 00000470 40284028 00000474 0000007a 00000478 90300218 0000047c 0000000a 00000480 00000077 00000484 90300240 00000488 04120412 0000048c 00000077 00000490 90300244 00000494 04140414 00000498 00000077 0000049c 90300248 000004a0 60010060 000004a4 00000077 000004a8 9030024c 000004ac 00000044 000004b0 00000077 000004b4 90300250 000004b8 00750024 000004bc 00000077 000004c0 90300254 000004c4 40284028 000004c8 0000007a 000004cc 90300258 000004d0 0000000a 000004d4 00000077 000004d8 90300280 000004dc 04120412 000004e0 00000077 000004e4 90300284 000004e8 04140414 000004ec 00000077 000004f0 90300288 000004f4 60010060 000004f8 00000077 000004fc 9030028c 00000500 00000044 00000504 00000077 00000508 90300290 0000050c 00750024 00000510 00000077 00000514 90300294 00000518 40284028 0000051c 0000007a 00000520 90300298 00000524 0000000a 00000528 00000077 0000052c 903002c0 00000530 04120412 00000534 00000077 00000538 903002c4 0000053c 04140414 00000540 00000077 00000544 903002c8 00000548 60010060 0000054c 00000077 00000550 903002cc 00000554 00000044 00000558 00000077 0000055c 903002d0 00000560 00750024 00000564 00000077 00000568 903002d4 0000056c 40284028 00000570 0000007a 00000574 903002d8 00000578 0000000a 0000057c 00000077 00000580 90300300 00000584 00004005 00000588 0000007a 0000058c 90300304 00000590 00000001 00000594 00000077 00000598 90300308 0000059c 00020002 000005a0 00000077 000005a4 9030030c 000005a8 00020002 000005ac 00000077 000005b0 90300310 000005b4 00020002 000005b8 0000007a 000005bc 90300314 000005c0 00000003 000005c4 00000077 000005c8 90300000 000005cc 00000401 000005d0 00000070 000005d4 90300090 000005d8 00000008 000005dc 00000008 000005e0 00100000 # padding: 000005e4 ffffffff 000005e8 ffffffff 000005ec ffffffff 000005f0 ffffffff 000005f4 ffffffff 000005f8 ffffffff 000005fc ffffffff # # crc16/modbus of (settings+padding) # (!) the size field at the beginnig is not included # 00000600 00005de1 # # empty space - erased bytes # to the end of hws 4K block # 00000604 ffffffff * 00000ffc ffffffff