|
本帖最后由 ITdesk 于 2019-4-8 11:54 编辑
前言
前篇:Linksys ea6350刷入openwrt https://www.right.com.cn/forum/thread-532598-1-1.html
前篇我讲到因为之前刷ea6350的时候,openwrt没有适配,那时候的中转固件有问题,后面openwrt适配了以后,重新写入虽然可以正常使用,但很不完美,想过拆机刷uboot,但因为种种原因没办法实现,具体见前篇,这两天想sysupgrade 结果报错了
报错代码
- Saving config files...
- Commencing upgrade. Closing all shell sessions.
- Watchdog handover: fd=3
- - watchdog -
- killall: telnetd: no process killed
- Sending TERM to remaining processes ... uhttpd nlbwmon sh sleep ntpd dnsmasq ubusd logd rpcd netifd odhcpd
- Sending KILL to remaining processes ...
- Switching to ramdisk...
- [ 570.562465] UBIFS (ubi0:1): background thread "ubifs_bgt0_1" stops
- [ 570.652418] UBIFS (ubi0:1): un-mount UBI device 0
- Performing system upgrade...
- ash: /usr/sbin_printenv: not found
- ash: fw_setenv: not found
- cannot find target partition
- sysupgrade aborted with return code: 256
复制代码
后面有了一个想法,起因我是刷了有问题的中转固件导致那么我把他刷会出厂固件再刷openwrt是否就解决这个问题
因为前篇的关系,硬件上无法动手,那么只能从uboot开刀了,之前没有试过,还是比较大难度的,一个个来吧
uboot支持的命令
- (EA6350v3) # help
- ? - alias for 'help'
- base - print or set address offset
- bootipq - bootipq from flash device
- bootm - boot application image from memory
- bootp - boot image via network using BOOTP/TFTP protocol
- chpart - change active partition
- cmp - memory compare
- cp - memory copy
- crc32 - checksum calculation
- devinfo - device specific info handling commands
- dhcp - boot image via network using DHCP/TFTP protocol
- dumpipq_data- dumpipq_data crashdump collection from memory
- echo - echo args to console
- env - environment handling commands
- exit - exit script
- false - do nothing, unsuccessfully
- fdt - flattened device tree utility commands
- fuseipq - fuse QFPROM registers from memory
- go - start application at address 'addr'
- help - print command description/usage
- i2c - I2C sub-system
- imxtract- extract a part of a multi-image
- loadb - load binary file over serial line (kermit mode)
- loady - load binary file over serial line (ymodem mode)
- loop - infinite loop on address range
- md - memory display
- mfg - mfg misc commands
- mii - MII utility commands
- mm - memory modify (auto-incrementing address)
- mmc - MMC sub system
- mmcinfo - display MMC info
- mtdparts- define flash/nand partitions
- mtest - simple RAM read/write test
- mw - memory write (fill)
- nand - NAND sub-system
- nboot - boot from NAND device
- nm - memory modify (constant address)
- pci - list and access PCI Configuration Space
- ping - send ICMP ECHO_REQUEST to network host
- printenv- print environment variables
- reset - Perform RESET of the CPU
- run - run commands in an environment variable
- saveenv - save environment variables to persistent storage
- setenv - set environment variables
- sf - SPI flash sub-system
- showvar - print local hushshell variables
- smeminfo- print SMEM FLASH information
- source - run script from memory
- test - minimal test like /bin/sh
- tftpboot- boot image via network using TFTP protocol
- tftpput - TFTP put command, for uploading files to a server
- true - do nothing, successfully
- uartrd - uartrd read from second UART
- uartwr - uartwr to second UART
- ubi - ubi commands
- upgrade - device specific image upgrade handling command
- usb - USB sub-system
- usbboot - boot from USB device
- version - print monitor, compiler and linker version
复制代码
Uboot系统变量
- (EA6350v3) # pr
- altkern=2800000
- auto_recovery=yes
- baudrate=115200
- boot_count=1
- boot_part=2
- boot_part_ready=3
- boot_ver=0.6.0
- bootcmd=if test $boot_part = 1; then run bootpart1; else run bootpart2; fi
- bootdelay=2
- bootpart1=set bootargs $partbootargs && nand read $loadaddr $prikern $kernsize && bootm $loadaddr
- bootpart2=set bootargs $partbootargs2 && nand read $loadaddr $altkern $kernsize && bootm $loadaddr
- ethact=eth0
- ethaddr=60:38:E0:88:8F:6F
- flash_type=0
- flashimg=tftpboot $loadaddr $image && nand erase $prikern $imgsize && nand write $loadaddr $prikern $filesize
- flashimg2=tftpboot $loadaddr $image && nand erase $altkern $imgsize && nand write $loadaddr $altkern $filesize
- hw_mac_addr=60:38:E0:88:8F:6F
- image=civic.img
- imgsize=0x2800000
- ipaddr=192.168.1.1
- kernsize=300000
- loadaddr=0x82000000
- machid=8010100
- netmask=255.255.255.0
- partbootargs=init=/sbin/init rootfstype=squashfs ubi.mtd=11,2048 ubi.block=0,0 root=/dev/ubiblock0_0 rootwait ro
- partbootargs2=init=/sbin/init rootfstype=squashfs ubi.mtd=13,2048 ubi.block=0,0 root=/dev/ubiblock0_0 rootwait ro
- prikern=0
- serverip=192.168.1.100
- stderr=serial
- stdin=serial
- stdout=serial
- sw_version=0.6.0
- Environment size: 1203/131068 bytes
复制代码
bootipq的信息
- (EA6350v3) # bootipq
- do_bootipq@581: call do_boot_unsignedimg()...
- do_boot_unsignedimg@454: rootfs_offset=0x300000, rootfs_size=0x2500000
- do_boot_unsignedimg@522: runcmd 'nand device 1 && set mtdids nand1=nand1 && set mtdparts mtdparts=nand1:0x2500000@0x300000(fs),${msmparts} && nand read 0x84000000 0 300000
- '
- NAND read: device 1 offset 0x0, size 0x300000
- 3145728 bytes read: OK
- Config not availabale
- do_boot_unsignedimg@536: ret -1, runcmd 'nand device 1 && set mtdids nand1=nand1 && set mtdparts mtdparts=nand1:0x2500000@0x300000(fs),${msmparts} && nand read 0x84000000 0 300000
- '
- do_bootipq: boot failed in 2, try the alternate one...
- do_boot_unsignedimg@454: rootfs_offset=0x2b00000, rootfs_size=0x2500000
- do_boot_unsignedimg@522: runcmd 'nand device 1 && set mtdids nand1=nand1 && set mtdparts mtdparts=nand1:0x2500000@0x2b00000(fs),${msmparts} && nand read 0x84000000 2800000 300000
- '
- NAND read: device 1 offset 0x2800000, size 0x300000
- 3145728 bytes read: OK
- Config not availabale
- do_boot_unsignedimg@536: ret -1, runcmd 'nand device 1 && set mtdids nand1=nand1 && set mtdparts mtdparts=nand1:0x2500000@0x2b00000(fs),${msmparts} && nand read 0x84000000 2800000 300000
- '
复制代码
开机Uboot信息
- U-Boot 2012.07 [Barrier Breaker r48529,r48529] (Jul 21 2016 - 09:43:37)
- Boot version: v0.6.0 -- IPQ4018.ILQ.1.1.6-CSU1 for the EA6350v3 board
- smem ram ptable found: ver: 1 len: 3
- DRAM: 256 MiB
- get_board_param - machid : 0x8010100
- NAND: spi_nand: spi_nand_flash_probe SF NAND ID 0:ef:aa:21
- SF: Detected W25N01GV with page size 2 KiB, total 128 MiB
- SF: Detected MX25L1605D with page size 4 KiB, total 2 MiB
- ipq_spi: page_size: 0x100, sector_size: 0x1000, size: 0x200000
- 130 MiB
- MMC:
- In: serial
- Out: serial
- Err: serial
- machid: 8010100
- flash_type: 0
- Net: In ART, mac0=0xFFFFFFFFFFFF, mac1=0xFFFFFFFFFFFF, mac2=0x6038, mac3=0x603 (mac地址我删掉了几位)
- get_eth_mac_address@1407: the base hw_mac_addr='60:38:E0:' is valid!
- MAC0 addr:60:38:e
- PHY ID1: 0x4d
- PHY ID2: 0xd0b1
- ipq40xx_qca8075_phy_init: reconfig ethernet LEDs behavior ...
- ipq40xx_ess_sw_init done
- eth0
- board_ledbtn_init: machid 0x8010100 - LEDs/Buttons GPIO initialization...
- board_read2sync_bootpart_vars@866: boot_count hunted is 1 and sync it!
- main_loop: sw_version 0.6.0
- Info - uboot-1.0
- LEDs blinking...
- Hit any key to stop autoboot: 0
复制代码
继续苦逼的翻nand 的命令
- <font color="#ff0000">Nand info 显示可用的NAND设备</font>
- Device 1: nand1, sector size 128 KiB
- Page size 2048 b
- OOB size 64 b
- Erase size 131072 b
- Device 2: nand2, sector size 4 KiB
- Page size 256 b
- OOB size 0 b
- Erase size 4096 b
- <font color="#ff0000">Nand device 显示或设置当前设备</font>
- Device 1: nand1, sector size 128 KiB
- Page size 2048 b
- OOB size 64 b
- Erase size 131072 b
复制代码
nand 坏块
- (EA6350v3) # nand bad
- Device 1 bad blocks:
复制代码
问题也随之而来
1.出现了两个nand,哪一个才是我想要的??
2.如何格式化128M的nand,我指的的用nand erase 而不是nand scrub,因为我对0x100这些还是不怎么理解,原厂固件大小是27,787,264 字节
3.nand的坏块要如何处理,网上讲的跳过或者替换,标记是怎么实现的,比如如何确定坏块的位置
请各位大大支一下招,非常感谢
|
|