初识
约 2262 字大约 8 分钟
初识
从淘宝上找到一块 12 块钱的 linux 开发板,还带 WiFi 功能,拿回来玩一玩,计划学习 uboot,linux 设备树,适配 cat1.bis(合宙家) 的 usbnet 以及 PPP 拨号等功能。 拿到 开发板
后,记录开机 log 如下。
flash & RAM 大小
存储 | size | 型号 |
---|---|---|
FLASH | 16 MB | W25Q128BV |
RAM | 64 MB | W9751G6KB-25 |
flash 分区
[ 1.548000] Creating 5 MTD partitions on "raspi":
[ 1.560000] 0x000000000000-0x000001000000 : "ALL"
[ 1.568000] 0x000000000000-0x000000030000 : "Bootloader"
[ 1.580000] 0x000000030000-0x000000040000 : "Config"
[ 1.592000] 0x000000040000-0x000000050000 : "Factory"
[ 1.604000] 0x000000050000-0x000001000000 : "firmware"
[ 1.616000] 0x000000184448-0x000001000000 : "rootfs"
[ 1.628000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[ 1.652000] mtd: partition "rootfs_data" created automatically, ofs=0x7a0000, len=0x860000
[ 1.668000] 0x0000007a0000-0x000001000000 : "rootfs_data"
分区 ID | 分区位置 | 容量 | 作用 |
---|---|---|---|
Bootloader | 0x000000000000-0x000000030000 | 192KB | |
Config | 0x000000030000-0x000000040000 | 64KB | |
Factory | 0x000000040000-0x000000050000 | 64KB | |
firmware | 0x000000050000-0x000001000000 | 15.6875MB | |
rootfs | 0x000000184448-0x000001000000 | 14.48333MB | |
rootfs_data | 0x0000007a0000-0x000001000000 | 8.375MB |
上面的分区中缺少从 0x50000
到 0x184448
之间的分 区信息,这块应该是 linux kernel 分区
![](https://raw.githubusercontent.com/tueo/cloudimg/main/img/20240827170203.png)
Uboot 版本
linux 版本
Flash 扩容
SPI 总线寻址地址格式分为 3Byte 和 4Byte 两种,3Byte 最大寻址 16MB。后面如果想要扩容到 32MB, 需要调整 SPI CS1。
开机 LOG
U-Boot 1.1.3 (Jul 15 2015 - 16:56:10)
Board: Ralink APSoC DRAM: 64 MB
relocate_code Pointer at: 83fb4000
flash manufacture id: ef, device id 40 18
find flash: W25Q128BV
*** Warning - bad CRC, using default environment
============================================
Ralink UBoot Version: 4.3.0.0
--------------------------------------------
ASIC 7628_MP (Port5<->None)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: SPI Flash
Date:Jul 15 2015 Time:16:56:10
============================================
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768
##### The CPU freq = 575 MHZ ####
estimate memory size =64 Mbytes
RESET MT7628 PHY!!!!!!
Please choose the operation:
1: Load system code to SDRAM via TFTP.
2: Load system code then write to Flash via TFTP.
3: Boot system code via Flash (default).
4: Entr boot command line interface.
7: Load Boot Loader code then write to Flash via Serial.
9: Load Boot Loader code then write to Flash via TFTP.
You choosed 3
0
3: System Boot system code via Flash.
## Booting image at bc050000 ...
Image Name: OpenWrt Linux-3.10.14
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1262600 Bytes = 1.2 MB
Load Address: 80000000
Entry Point: 80000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 64
Starting kernel ...
LINUX started...
THIS IS ASIC
SDK 5.0.S.0
[ 0.000000] Linux version 3.10.14 (root@wills-virtual-machine) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 unknown) ) #7 Tue Sep 19 11:29:40 CST 2017
[ 0.000000]
[ 0.000000] The CPU feqenuce set to 575 MHz
[ 0.000000] CPU0 revision is: 00019655 (MIPS 24KEc)
[ 0.000000] Software DMA cache coherency
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 04000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00000000-0x03ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000-0x03ffffff]
[ 0.000000] Primary instruction cache 64kB, 4-way, VIPT, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
[ 0.000000] Kernel command line: console=ttyS1,57600n8 root=/dev/mtdblock5 rootfstype=squashfs,jffs2
[ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Writing ErrCtl register=00018b0f
[ 0.000000] Readback ErrCtl register=00018b0f
[ 0.000000] Memory: 61084k/65536k available (2744k kernel code, 4452k reserved, 685k data, 216k init, 0k highmem)
[ 0.000000] NR_IRQS:128
[ 0.000000] console [ttyS1] enabled
[ 0.096000] Calibrating delay loop... 382.46 BogoMIPS (lpj=764928)
[ 0.128000] pid_max: default: 32768 minimum: 301
[ 0.132000] Mount-cache hash table entries: 512
[ 0.136000] NET: Registered protocol family 16
[ 0.140000] RALINK_GPIOMODE = 54050404
[ 0.144000] RALINK_GPIOMODE = 54040404
[ 0.244000] ***** Xtal 25MHz *****
[ 0.248000] start PCIe register access
[ 0.748000] RALINK_RSTCTRL = 2400000
[ 0.752000] RALINK_CLKCFG1 = fdbfffc0
[ 0.756000]
[ 0.756000] *************** MT7628 PCIe RC mode *************
[ 1.256000] PCIE0 no card, disable it(RST&CLK)
[ 1.284000] bio: create slab <bio-0> at 0
[ 1.288000] usbcore: registered new interface driver usbfs
[ 1.292000] usbcore: registered new interface driver hub
[ 1.296000] usbcore: registered new device driver usb
[ 1.300000] Switching to clocksource MIPS
[ 1.304000] NET: Registered protocol family 2
[ 1.316000] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[ 1.328000] TCP bind hash table entries: 512 (order: -1, 2048 bytes)
[ 1.340000] TCP: Hash tables configured (established 512 bind 512)
[ 1.352000] TCP: reno registered
[ 1.360000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 1.372000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 1.384000] NET: Registered protocol family 1
[ 1.392000] MTK/Ralink EHCI/OHCI init.
[ 1.404000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 1.416000] jffs2: version 2.2. (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 1.436000] msgmni has been set to 119
[ 1.444000] io scheduler noop registered (default)
[ 1.460000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 1.472000] serial8250: ttyS0 at MMIO 0x10000d00 (irq = 21) is a 16550A
[ 1.488000] serial8250: ttyS1 at MMIO 0x10000c00 (irq = 20) is a 16550A
[ 1.500000] Ralink gpio driver initialized
[ 1.512000] flash manufacture id: ef, device id 40 18
[ 1.520000] W25Q128BV(ef 40180000) (16384 Kbytes)
[ 1.532000] mtd .name = raspi, .size = 0x01000000 (16M) .erasesize = 0x00010000 (64K) .numeraseregions = 0
[ 1.548000] Creating 5 MTD partitions on "raspi":
[ 1.560000] 0x000000000000-0x000001000000 : "ALL"
[ 1.568000] 0x000000000000-0x000000030000 : "Bootloader"
[ 1.580000] 0x000000030000-0x000000040000 : "Config"
[ 1.592000] 0x000000040000-0x000000050000 : "Factory"
[ 1.604000] 0x000000050000-0x000001000000 : "firmware"
[ 1.616000] 0x000000184448-0x000001000000 : "rootfs"
[ 1.628000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[ 1.652000] mtd: partition "rootfs_data" created automatically, ofs=0x7a0000, len=0x860000
[ 1.668000] 0x0000007a0000-0x000001000000 : "rootfs_data"
[ 1.680000] GMAC1_MAC_ADRH -- : 0x00001234
[ 1.688000] GMAC1_MAC_ADRL -- : 0x56789000
[ 1.696000] Ralink APSoC Ethernet Driver Initilization. v3.1 512 rx/tx descriptors allocated, mtu = 1500!
[ 1.716000] GMAC1_MAC_ADRH -- : 0x00001234
[ 1.724000] GMAC1_MAC_ADRL -- : 0x56789000
[ 1.736000] PROC INIT OK!
[ 1.740000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.752000] ehci-pci: EHCI PCI platform driver
[ 1.760000] ehci-platform: EHCI generic platform driver
[ 1.792000] ******MT7628 mtk phy
[ 1.800000] *****run project phy.
[ 1.812000] FM_OUT value: u4FmOut = 0(0x00000000)
[ 1.828000] FM_OUT value: u4FmOut = 140(0x0000008C)
[ 1.836000] FM detection done! loop = 1
[ 1.852000] SR calibration value u1SrCalVal = 6
[ 1.860000] *********Execute mt7628_phy_init!!
[ 1.868000] ehci-platform ehci-platform: EHCI Host Controller
[ 1.880000] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[ 1.896000] ehci-platform ehci-platform: irq 18, io mem 0x101c0000
[ 1.920000] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[ 1.932000] hub 1-0:1.0: USB hub found
[ 1.940000] hub 1-0:1.0: 1 port detected
[ 1.948000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.980000] *********Execute mt7628_phy_init!!
[ 1.988000] ohci-platform ohci-platform: Generic Platform OHCI Controller
[ 2.000000] ohci-platform ohci-platform: new USB bus registered, assigned bus number 2
[ 2.016000] ohci-platform ohci-platform: irq 18, io mem 0x101c1000
[ 2.088000] hub 2-0:1.0: USB hub found
[ 2.096000] hub 2-0:1.0: 1 port detected
[ 2.104000] gre: GRE over IPv4 demultiplexor driver
[ 2.112000] TCP: cubic registered
[ 2.120000] NET: Registered protocol family 10
[ 2.128000] NET: Registered protocol family 17
[ 2.140000] 8021q: 802.1Q VLAN Support v1.8
[ 2.148000] registered taskstats version 1
[ 2.164000] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[ 2.180000] Freeing unused kernel memory: 216K (8035a000 - 80390000)
procd: Console is alive
[ 3.968000] SCSI subsystem initialized
[ 3.984000] usbcore: registered new interface driver usb-storage
procd: - preinit -
[ 4.740000] 12:34:56:78:FFFFFF90: 0
[ 4.748000] Raeth v3.1 (Tasklet,SkbRecycle)
[ 4.756000]
[ 4.756000] phy_tx_ring = 0x03054000, tx_ring = 0xa3054000
[ 4.772000]
[ 4.772000] phy_rx_ring0 = 0x03056000, rx_ring0 = 0xa3056000
[ 4.800000] GMAC1_MAC_ADRH -- : 0x00001234
[ 4.808000] GMAC1_MAC_ADRL -- : 0x56789000
[ 4.816000] RT305x_ESW: Link Status Changed
/etc/preinit: line 1: mktemp: not found
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[ 8.556000] jffs2: notice: (248) jffs2_build_xattr_subsystem: complete building xattr subsystem, 3 of xdatum (0 unchecked, 2 orphan) and 29 of xref (0 dead, 20 orphan) found.
[ 8.588000] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
[ 8.604000] block: unable to load configuration (fstab: Entry not found)
[ 8.616000] block: attempting to load /tmp/jffs_cfg/etc/config/fstab
[ 8.632000] block: extroot: not configured
jffs2 is ready
No jffs2 marker was found
[ 8.708000] jffs2: notice: (245) jffs2_build_xattr_subsystem: complete building xattr subsystem, 3 of xdatum (0 unchecked, 2 orphan) and 29 of xref (0 dead, 20 orphan) found.
[ 9.016000] block: attempting to load /tmp/jffs_cfg/upper/etc/config/fstab
[ 9.028000] block: unable to load configuration (fstab: Entry not found)
[ 9.044000] block: attempting to load /tmp/jffs_cfg/etc/config/fstab
[ 9.060000] block: extroot: not configured
switching to overlay
[ 9.080000] ra2880stop()...Done
[ 9.088000] Free TX/RX Ring Memory!
procd: - early -
procd: - ubus -
procd: - init -
Please press Enter to activate this console.
[ 11.128000] NTFS driver 2.1.30 [Flags: R/O MODULE].
[ 11.148000] l2tp_core: L2TP core driver, V2.0
[ 11.228000] l2tp_netlink: L2TP netlink interface
[ 11.240000] fuse init (API version 7.22)
[ 11.256000] exFAT: Version 1.2.9
[ 11.264000] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 11.276000] Type=Linux
[ 11.352000] nf_conntrack version 0.5.0 (957 buckets, 3828 max)
[ 11.368000] Ralink APSoC Hardware Watchdog Timer
[ 11.380000] rdm_major = 253
[ 11.480000] xt_time: kernel timezone is -0000
[ 11.496000] PPP generic driver version 2.4.2
[ 11.508000] NET: Registered protocol family 24
[ 11.520000] l2tp_ppp: PPPoL2TP kernel driver, V2.0
[ 16.500000] 12:34:56:78:FFFFFF90: 0
[ 16.508000] Raeth v3.1 (Tasklet,SkbRecycle)
[ 16.516000]
[ 16.516000] phy_tx_ring = 0x032b2000, tx_ring = 0xa32b2000
[ 16.532000]
[ 16.532000] phy_rx_ring0 = 0x032b4000, rx_ring0 = 0xa32b4000
[ 16.560000] GMAC1_MAC_ADRH -- : 0x00001234
[ 16.572000] GMAC1_MAC_ADRL -- : 0x56789000
[ 16.580000] RT305x_ESW: Link Status Changed
[ 16.604000] device eth0.1 entered promiscuous mode
[ 16.616000] device eth0 entered promiscuous mode
[ 16.692000] br-lan: port 1(eth0.1) entered forwarding state
[ 16.700000] br-lan: port 1(eth0.1) entered forwarding state
[ 18.328000]
[ 18.328000] === pAd = c0781000, size = 1522664 ===
[ 18.328000]
[ 18.348000] <-- RTMPAllocTxRxRingMemory, Status=0, ErrorValue=0x
[ 18.360000] <-- RTMPAllocAdapterBlock, Status=0
[ 18.372000] RtmpChipOpsHook(492): Not support for HIF_MT yet!
[ 18.380000] mt7628_init()-->
[ 18.388000] mt7628_init(FW(8a00), HW(8a01), CHIPID(7628))
[ 18.400000] e2.bin mt7628_init(1117)::(2), pChipCap->fw_len(63056)
[ 18.412000] mt_bcn_buf_init(218): Not support for HIF_MT yet!
[ 18.420000] <--mt7628_init()
[ 18.440000] TX_BCN DESC a339c000 size = 320
[ 18.448000] RX[0] DESC a339e000 size = 2048
[ 18.460000] RX[1] DESC a339f000 size = 1024
[ 18.524000] E2pAccessMode=2
[ 18.528000] cfg_mode=9
[ 18.536000] cfg_mode=9
[ 18.540000] wmode_band_equal(): Band Equal!
[ 18.552000] APSDCapable[0]=1
[ 18.556000] APSDCapable[1]=1
[ 18.564000] APSDCapable[2]=1
[ 18.568000] APSDCapable[3]=1
[ 18.576000] APSDCapable[4]=1
[ 18.580000] APSDCapable[5]=1
[ 18.584000] APSDCapable[6]=1
[ 18.592000] APSDCapable[7]=1
[ 18.596000] APSDCapable[8]=1
[ 18.604000] APSDCapable[9]=1
[ 18.608000] APSDCapable[10]=1
[ 18.616000] APSDCapable[11]=1
[ 18.620000] APSDCapable[12]=1
[ 18.628000] APSDCapable[13]=1
[ 18.632000] APSDCapable[14]=1
[ 18.636000] APSDCapable[15]=1
[ 18.644000] default ApCliAPSDCapable[0]=1
[ 18.652000] default ApCliAPSDCapable[1]=1
[ 18.704000] br-lan: port 1(eth0.1) entered forwarding state
[ 18.872000] Key1Str is Invalid key length(0) or Type(0)
[ 18.884000] Key2Str is Invalid key length(0) or Type(0)
[ 18.892000] Key3Str is Invalid key length(0) or Type(0)
[ 18.904000] Key4Str is Invalid key length(0) or Type(0)
[ 18.968000] RTMPSetDefaultChannel() : default channel to 1
[ 18.980000] load fw image from fw_header_image
[ 18.988000] AndesMTLoadFwMethod1(2174)::pChipCap->fw_len(63056)
[ 19.000000] FW Version:_e2_mp
[ 19.004000] FW Build Date:20150211175503
[ 19.012000] CmdAddressLenReq:(ret = 0)
[ 19.024000] CmdFwStartReq: override = 1, address = 1048576
[ 19.032000] CmdStartDLRsp: WiFI FW Download Success
[ 19.360000] MtAsicDMASchedulerInit(): DMA Scheduler Mode=0(LMAC)
[ 19.372000] efuse_probe: efuse = 10000012
[ 19.380000] RtmpChipOpsEepromHook::e2p_type=2, inf_Type=4
[ 19.392000] RtmpEepromGetDefault::e2p_dafault=2
[ 19.400000] RtmpChipOpsEepromHook: E2P type(2), E2pAccessMode = 2, E2P default = 2
[ 19.416000] NVM is FLASH mode
[ 19.420000] 1. Phy Mode = 14
[ 19.612000] Country Region from e2p = ffff
[ 19.620000] tssi_1_target_pwr_g_band = 39
[ 19.628000] 2. Phy Mode = 14
[ 19.632000] 3. Phy Mode = 14
[ 19.640000] NICInitPwrPinCfg(11): Not support for HIF_MT yet!
[ 19.648000] NICInitializeAsic(651): Not support rtmp_mac_sys_reset () for HIF_MT yet!
[ 19.664000] mt_mac_init()-->
[ 19.672000] MtAsicInitMac()-->
[ 19.680000] mt7628_init_mac_cr()-->
[ 19.684000] MtAsicSetMacMaxLen(1241): Set the Max RxPktLen=1024!
[ 19.696000] <--mt_mac_init()
[ 19.704000] WTBL Segment 1 info:
[ 19.708000] MemBaseAddr/FID:0x28000/0
[ 19.716000] EntrySize/Cnt:32/128
[ 19.724000] WTBL Segment 2 info:
[ 19.732000] MemBaseAddr/FID:0x40000/0
[ 19.736000] EntrySize/Cnt:64/128
[ 19.744000] WTBL Segment 3 info:
[ 19.752000] MemBaseAddr/FID:0x42000/64
[ 19.760000] EntrySize/Cnt:64/128
[ 19.764000] WTBL Segment 4 info:
[ 19.772000] MemBaseAddr/FID:0x44000/128
[ 19.780000] EntrySize/Cnt:32/128
[ 19.788000] AntCfgInit(2876): Not support for HIF_MT yet!
[ 19.944000] CmdSlotTimeSet:(ret = 0)
[ 20.016000] MCS Set = ff 00 00 00 01
[ 20.020000] MtAsicSetChBusyStat(826): Not support for HIF_MT yet!
[ 24.952000] [PMF]ap_pmf_init:: apidx=0, MFPC=0, MFPR=0, SHA256=0
[ 24.964000] [PMF]RTMPMakeRsnIeCap: RSNIE Capability MFPC=0, MFPR=0
[ 24.976000] MtAsicSetRalinkBurstMode(2919): Not support for HIF_MT yet!
[ 24.988000] MtAsicSetPiggyBack(763): Not support for HIF_MT yet!
[ 25.024000] MtAsicSetTxPreamble(2898): Not support for HIF_MT yet!
[ 25.040000] MtAsicAddSharedKeyEntry(1308): Not support for HIF_MT yet!
[ 25.052000] MtAsicSetPreTbtt(): bss_idx=0, PreTBTT timeout = 0xf0
[ 25.064000] Main bssid = 12:34:56:78:90:00
[ 25.072000] <==== rt28xx_init, Status=0
[ 25.084000] mt7628_set_ed_cca: TURN OFF EDCCA mac 0x10618 = 0xd7083f0f
[ 25.100000] WiFi Startup Cost (ra0): 6.660s
[ 25.704000] device ra0 entered promiscuous mode
[ 25.712000] br-lan: port 2(ra0) entered forwarding state
[ 25.724000] br-lan: port 2(ra0) entered forwarding state
[ 27.728000] br-lan: port 2(ra0) entered forwarding state
procd: - init complete -
[ 39.696000] device eth0.2 entered promiscuous mode
[ 39.704000] br-lan: port 3(eth0.2) entered forwarding state
[ 39.716000] br-lan: port 3(eth0.2) entered forwarding state
procd: Instance log::instance2 s in a crash loop 6 crashes, 0 seconds since last crash
[ 41.720000] br-lan: port 3(eth0.2) entered forwarding state
[ 67.668000] Started WatchDog Timer.