gonzales napisał/a:Znaczy się to już dla mnie koniec zabawy z tym sprzętem? A może to i całkowity koniec tego rotera?
Głowa do góry! Troszkę to trwało ale się udało.
Zostawiam info poniżej dla potomnych, bo ten sprzęt trafił do mnie i udało się go postawić na nogi.
Pierwsza sprawa, czytamy komunikaty po poleceniach...
...
Could not open mtd device: /dev/mtd0
Can't open device for writing!
Te partycje są zbyt istotne i dlatego zapis jest domyślnie zablokowany, trzeba zainstalować 'mtd-rw' i je odblokować:
opkg install kmod-mtd-rw
insmod mtd-rw i_want_a_brick=1
[ 529.987557] mtd-rw: mtd0: setting writeable flag
[ 529.992203] mtd-rw: mtd1: setting writeable flag
[ 529.996821] mtd-rw: mtd2: setting writeable flag
Po tej operacji można już normalnie wgrać ...ubi-preloader.bin i ...ubi-bl31-uboot.fip (zakładając że sprzęt został wystartowany z ...ubi-initramfs-recovery.itb), oczywiście po uprzednim wykonaniu backup (o ile ktokolwiek planuje jeszcze powrót do firmware producenta).
I teraz do rzeczy, jeżeli na konsoli widzicie to co poniżej, to sprzęt jest soczyście uceglony. Te komunikaty pochodzą z bootromu czyli permanentnie wgranego programu do głównego SOC (coś w rodzaju programu ładującego). Z tej sytuacji są tylko dwa wyjścia i oba wymagają trochę więcej wysiłku. Demontaż kości flash (SPI-NAND) i jej przeprogramowanie na zewnątrz lub JTAG.
F0: 102B 0000
F6: 3800 00A0
F3: 4000 0036
F5: 480A 0031
F5: 480A 0031
00: 1005 0000
F6: 3800 00A0
F3: 4000 0036
F5: 480A 0031
F5: 480A 0031
01: 102A 0001
02: 1005 0000
BP: 0000 00C0 [0001]
T0: 0000 0365 [000F]
System halt!
Dla tej platformy na szczęście są dostępne skrypty do OpenOCD i mamy wyprowadzone gniazdo więc jak ktoś ma adapter JTAG, Raspberry Pi albo jakiegoś innego cudaka wspieranego przez OpenOCD (np. coś na FTDI lub CH34x), to ta droga będzie (względnie) łatwiejsza. Raczej nie obejdzie się bez lutowania (chyba że ktoś ma specjalne dociskowe klipsy ale swoje kosztują), bo gniazdo (standardowe 20-pinowe JTAG dla ARM) ma wyprowadzenia w rastrze 1,27 mm
Tak to wyglądało u mnie (wlutowałem sobie adapter 1,27 na 2,54 mm żeby nie robić bałaganu z kablami):


Skrypty do OpenOCD, U-Boot startujący z RAM i instrukcja krok po kroku są dostępne tutaj:
https://github.com/mtk-openwrt/openocd- … ain/mt7622
Jak już wystartujecie U-Boot z RAM to działa sieć i można po prostu uruchomić obraz initramfs, a dalej to już wiadomo co i jak.
F0: 102B 0000
F6: 3800 00A0
F3: 4000 0036
F5: 480A 0031
F5: 480A 0031
00: 1005 0000
F6: 3800 00A0
F3: 4000 0036
F5: 480A 0031
F5: 480A 0031
01: 102A 0001
02: 1005 0000
BP: 0000 00C0 [0001]
T0: 0000 0365 [000F]
System halt!
NOTICE: BL2: v2.4(release):516c195bf-dirty
NOTICE: BL2: Built : 18:53:46, Feb 2 2021
INFO: BL2: Doing platform setup
INFO: PMIC: MediaTek MT6380 E3
INFO: EMI: DRAMC calibration done
INFO: EMI: Rank size auto detect
INFO: EMI: Rank size: 0x20000000
INFO: EMI: complex R/W mem test passed
INFO: BL2: Loading image id 3
INFO: Loading image id=3 at address 0x43001000
INFO: Image id=3 loaded: 0x43001000 - 0x4300c0dd
INFO: BL2: Loading image id 5
INFO: Loading image id=5 at address 0x41e00000
INFO: Image id=5 loaded: 0x41e00000 - 0x41e8b739
NOTICE: BL2: Booting BL31
INFO: Entry point address = 0x43001000
INFO: SPSR = 0x3cd
INFO: Secondary bootloader is AArch64
NOTICE: BL31: v2.4(release):638b6e19e
NOTICE: BL31: Built : 10:17:31, Feb 25 2021
INFO: ARM GICv2 driver initialized
INFO: BL31: Initializing runtime services
INFO: BL31: Preparing for EL3 exit to normal world
INFO: Entry point address = 0x41e00000
INFO: SPSR = 0x3c9
serial_mtk serial@11002000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19
U-Boot 2021.04-rc3-gdc001ffc7d-dirty (Mar 05 2021 - 17:10:16 +0800)
CPU: MediaTek MT7622
Model: mt7622-rfb
DRAM: 256 MiB
WDT: Started with servicing (60s timeout)
MMC: mmc@11230000: 0, mmc@11240000: 1
In: serial@11002000
Out: serial@11002000
Err: serial@11002000
Net:
Warning: ethernet@1b100000 (eth0) using random MAC address - 96:e0:b6:82:61:6f
eth0: ethernet@1b100000
MT7622> tftpboot 0x40080000 ubi-initramfs-recovery.itb
Using ethernet@1b100000 device
TFTP from server 192.168.1.2; our IP address is 192.168.1.1
Filename 'ubi-initramfs-recovery.itb'.
Load address: 0x40080000
Loading: *#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
##################################
17.4 MiB/s
done
Bytes transferred = 8126464 (7c0000 hex)
MT7622> bootm 0x40080000
## Loading kernel from FIT Image at 40080000 ...
Using 'config-1' configuration
Trying 'kernel-1' kernel subimage
Description: ARM64 OpenWrt Linux-5.15.80
Type: Kernel Image
Compression: lzma compressed
Data Start: 0x400800e8
Data Size: 3969754 Bytes = 3.8 MiB
Architecture: AArch64
OS: Linux
Load Address: 0x44000000
Entry Point: 0x44000000
Hash algo: crc32
Hash value: a1fcf2f8
Hash algo: sha1
Hash value: 8625de67e550d54b0f95704b23c7161f718fb612
Verifying Hash Integrity ... crc32+ sha1+ OK
## Loading ramdisk from FIT Image at 40080000 ...
Using 'config-1' configuration
Trying 'initrd-1' ramdisk subimage
Description: ARM64 OpenWrt linksys_e8450-ubi initrd
Type: RAMDisk Image
Compression: Unknown Compression
Data Start: 0x40449500
Data Size: 4024232 Bytes = 3.8 MiB
Architecture: AArch64
OS: Linux
Load Address: unavailable
Entry Point: unavailable
Hash algo: crc32
Hash value: 33d88ec4
Hash algo: sha1
Hash value: e26b0c7f1f6ddcea3f0d76a272a579fa050263c2
Verifying Hash Integrity ... crc32+ sha1+ OK
WARNING: 'compression' nodes for ramdisks are deprecated, please fix your .its file!
## Loading fdt from FIT Image at 40080000 ...
Using 'config-1' configuration
Trying 'fdt-1' fdt subimage
Description: ARM64 OpenWrt linksys_e8450-ubi device tree blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x4081fdb8
Data Size: 30472 Bytes = 29.8 KiB
Architecture: AArch64
Hash algo: crc32
Hash value: bbb6bcd1
Hash algo: sha1
Hash value: b52da0b1b2b7aa75174ddd3d6eb25901d6f72c2c
Verifying Hash Integrity ... crc32+ sha1+ OK
Booting using the fdt blob at 0x4081fdb8
Uncompressing Kernel Image
Loading Ramdisk to 4f425000, end 4f7fb7a8 ... OK
Loading Device Tree to 000000004f41a000, end 000000004f424707 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 5.15.80 (builder@buildhost) (aarch64-openwrt-linux-musl-gcc (OpenWrt GCC 11.3.0 r21429-57a8ea6d74) 11.3.0, GNU ld (GNU Binutils) 2.37) #0 SMP Thu Dec 8 11:10:21 2022
[ 0.000000] Machine model: Linksys E8450 (UBI)
...
No to tyle, do następnego!