|
本帖最后由 wackejohn 于 2023-12-14 15:29 编辑
如题,本人入了个企智通的501m v2,到手才知道openwrt只到AA版本。。。相当不甘心。。。首先尝试自己编译trunk,然后刷入,无果内核无法识别交换机。。。接着各种google,查到原来源码改成了device tree的方式。。。期间还怀疑需要刷uboot,在成功将设备搞砖后还好用openjtag救回。。。就在本人准备放弃,奔向wrt1900ac时,人品爆发了。。。
这里先贴个本人修改的dts文件:
- /*
- * Marvell RD88F6181 A Board descrition
- *
- * Andrew Lunn <[email]andrew@lunn.ch[/email]>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
- *
- * This file contains the definitions for the board with the A0 or
- * higher stepping of the SoC. The ethernet switch does not have a
- * "wan" port.
- */
- /dts-v1/;
- #include "kirkwood-rd88f6281.dtsi"
- / {
- model = "QiZhiTong 501M V2";
- compatible = "marvell,rd88f6281-a", "marvell,rd88f6281","marvell,kirkwood-88f6281", "marvell,kirkwood";
- chosen {
- bootargs = "console=ttyS0,9600n8 earlyprintk";
- };
- mbus {
- pcie-controller {
- status = "okay";
- pcie@1,0 {
- status = "okay";
- };
- pcie@2,0 {
- status = "okay";
- };
- };
- };
- ocp@f1000000 {
- pinctrl: pin-controller[url=home.php?mod=space&uid=3967]@10000[/url] {
- pinctrl-names = "default";
- pmx_sdio_cd: pmx-sdio-cd {
- marvell,pins = "mpp28";
- marvell,function = "gpio";
- };
- };
- serial@12000 {
- status = "okay";
- };
- sata@80000 {
- status = "okay";
- nr-ports = <1>;
- };
- mvsdio@90000 {
- pinctrl-0 = <&pmx_sdio &pmx_sdio_cd>;
- pinctrl-names = "default";
- status = "okay";
- cd-gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>;
- /* No WP GPIO */
- };
- };
-
- dsa@0 {
- compatible = "marvell,dsa";
- #address-cells = <2>;
- #size-cells = <0>;
-
- interrupts = <10>;
- dsa,ethernet = <ð0port>;
- dsa,mii-bus = <&mdio>;
- switch@0 {
- #address-cells = <1>;
- #size-cells = <0>;
- status = "okay";
- reg = <10 0>;
-
- port@0 {
- reg = <0>;
- label = "lan1";
- };
- port@1 {
- reg = <1>;
- label = "lan2";
- };
- port@2 {
- reg = <2>;
- label = "lan3";
- };
- port@3 {
- reg = <3>;
- label = "lan4";
- };
- port@4 {
- reg = <4>;
- label = "aux";
- };
- port@5 {
- reg = <5>;
- label = "cpu";
- };
- };
- };
- };
- &mdio {
- status = "okay";
- };
- ð0 {
- status = "okay";
-
- ethernet0-port@0 {
- speed = <1000>;
- duplex = <1>;
- };
- };
- ð1 {
- status = "okay";
-
- ethernet1-port@0 {
- compatible = "marvell,88e1116r";
- speed = <1000>;
- duplex = <1>;
- };
- };
复制代码
整个描述交换机段的关键貌似在“interrupts = <10>;”(无意中google到的关于dsa的文档,里面有关于各个参数的解释)
然后贴个openwrt启动记录:
- __ __ _ _
- | \/ | __ _ _ ____ _____| | |
- | |\/| |/ _` | '__\ \ / / _ \ | |
- | | | | (_| | | \ V / __/ | |
- |_| |_|\__,_|_| \_/ \___|_|_|
- _ _ ____ _
- | | | | | __ ) ___ ___ | |_
- | | | |___| _ \ / _ \ / _ \| __|
- | |_| |___| |_) | (_) | (_) | |_
- \___/ |____/ \___/ \___/ \__|
- ** MARVELL BOARD: MB-302 v1.0
- U-Boot 1.1.4 (Nov 11 2010 - 16:09:33) Marvell version: 3.4.27 T06
- U-Boot code: 00600000 -> 0067FFF0 BSS: -> 006CFAC0
- Soc: 88F6281 A1 (DDR2)
- CPU running @ 1200Mhz L2 running @ 400Mhz
- SysClock = 400Mhz , TClock = 200Mhz
- DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
- DRAM CS[0] base 0x00000000 size 256MB
- DRAM CS[1] base 0x10000000 size 256MB
- DRAM Total size 512MB 16bit width
- Addresses 8M - 0M are saved for the U-Boot usage.
- Mem malloc Initialization (8M - 7M): Done
- NAND:64 MB
- Flash: 0 kB
- CPU : Marvell Feroceon (Rev 1)
- Streaming disabled
- Write allocate disabled
- Module 0 is RGMII
- USB 0: host mode
- PEX 0: interface detected no Link.
- Net: egiga0 [PRIME], egiga1
- Hit 'Tab' key to switch the boot entry: 0
- SD found. Card desciption is:
- Manufacturer: 0x1c, OEM "SV"
- Product name: "USD ", revision 1.0
- Serial number: 21367872
- Manufacturing date: 6/2008
- CRC: 0x00, b0 = 0
- 1894174 bytes read
- ## Booting image at 00800000 ...
- Image Name: ARM OpenWrt Linux-4.3
- Created: 2015-11-29 13:35:30 UTC
- Image Type: ARM Linux Kernel Image (uncompressed)
- Data Size: 1894110 Bytes = 1.8 MB
- Load Address: 00008000
- Entry Point: 00008000
- Verifying Checksum ... OK
- OK
- Starting kernel ...
- [ 0.000000] Booting Linux on physical CPU 0x0
- [ 0.000000] Linux version 4.3.0 (Wacke@HOME-Server) (gcc version 5.2.0 (OpenWrt GCC 5.2.0 r47397) ) #44 Sun Nov 29 21:35:02 CST 2015
- [ 0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
- [ 0.000000] CPU: VIVT data cache, VIVT instruction cache
- [ 0.000000] Machine model: QiZhiTong 501M V2
- [ 0.000000] Memory policy: Data cache writeback
- [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
- [ 0.000000] Kernel command line: rootdelay=1 root=/dev/mmcblk0p1 noinitrd console=ttyS0,9600
- [ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
- [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
- [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
- [ 0.000000] Memory: 514224K/524288K available (3882K kernel code, 133K rwdata, 1072K rodata, 164K init, 192K bss, 10064K reserved, 0K cma-reserved)
- [ 0.000000] Virtual kernel memory layout:
- [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
- [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
- [ 0.000000] vmalloc : 0xe0800000 - 0xff000000 ( 488 MB)
- [ 0.000000] lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
- [ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
- [ 0.000000] .text : 0xc0008000 - 0xc04dedc4 (4956 kB)
- [ 0.000000] .init : 0xc04df000 - 0xc0508000 ( 164 kB)
- [ 0.000000] .data : 0xc0508000 - 0xc05295f0 ( 134 kB)
- [ 0.000000] .bss : 0xc05295f0 - 0xc0559888 ( 193 kB)
- [ 0.000000] NR_IRQS:16 nr_irqs:16 16
- [ 0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
- [ 0.000007] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
- [ 0.000135] Calibrating delay loop... 1191.11 BogoMIPS (lpj=5955584)
- [ 0.090081] pid_max: default: 32768 minimum: 301
- [ 0.090201] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
- [ 0.090217] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
- [ 0.090706] CPU: Testing write buffer coherency: ok
- [ 0.091016] Setting up static identity map for 0x81e0 - 0x821c
- [ 0.091279] mvebu-soc-id: MVEBU SoC ID=0x6281, Rev=0x3
- [ 0.095448] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
- [ 0.095569] pinctrl core: initialized pinctrl subsystem
- [ 0.096593] NET: Registered protocol family 16
- [ 0.096949] DMA: preallocated 256 KiB pool for atomic coherent allocations
- [ 0.097755] cpuidle: using governor ladder
- [ 0.098096] Feroceon L2: Enabling L2
- [ 0.098136] Feroceon L2: Cache support initialised.
- [ 0.098394] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
- [ 0.114022] SCSI subsystem initialized
- [ 0.114345] usbcore: registered new interface driver usbfs
- [ 0.114419] usbcore: registered new interface driver hub
- [ 0.114487] usbcore: registered new device driver usb
- [ 0.115374] clocksource: Switched to clocksource orion_clocksource
- [ 0.116324] NET: Registered protocol family 2
- [ 0.116843] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
- [ 0.116899] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
- [ 0.116949] TCP: Hash tables configured (established 4096 bind 4096)
- [ 0.117003] UDP hash table entries: 256 (order: 0, 4096 bytes)
- [ 0.117025] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
- [ 0.117176] NET: Registered protocol family 1
- [ 0.118006] futex hash table entries: 256 (order: -1, 3072 bytes)
- [ 0.121426] squashfs: version 4.0 (2009/01/31) Phillip Lougher
- [ 0.121446] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
- [ 0.122468] io scheduler noop registered
- [ 0.122487] io scheduler deadline registered (default)
- [ 0.123579] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
- [ 0.124133] irq: Cannot allocate irq_descs @ IRQ35, assuming pre-allocated
- [ 0.124472] irq: Cannot allocate irq_descs @ IRQ67, assuming pre-allocated
- [ 0.124743] mvebu-pcie mbus:pcie-controller: ignoring PCIe DT node, missing pcie-port property
- [ 0.125031] mvebu-pcie mbus:pcie-controller: PCI host bridge to bus 0000:00
- [ 0.125048] pci_bus 0000:00: root bus resource [io 0x1000-0xfffff]
- [ 0.125059] pci_bus 0000:00: root bus resource [mem 0xe0000000-0xefffffff]
- [ 0.125071] pci_bus 0000:00: root bus resource [bus 00-ff]
- [ 0.125317] PCI: bus0: Fast back to back transfers disabled
- [ 0.125331] pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
- [ 0.125491] PCI: bus1: Fast back to back transfers enabled
- [ 0.125535] pci 0000:00:01.0: PCI bridge to [bus 01]
- [ 0.157228] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
- [ 0.158198] console [ttyS0] disabled
- [ 0.158264] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 26, base_baud = 12500000) is a 16550A
- [ 5.542548] console [ttyS0] enabled
- [ 5.585398] nand: device found, Manufacturer ID: 0x20, Chip ID: 0x76
- [ 5.661500] nand: ST Micro NAND 64MiB 3,3V 8-bit
- [ 5.716808] nand: 64 MiB, SLC, erase size: 16 KiB, page size: 512, OOB size: 16
- [ 5.804409] Scanning device for bad blocks
- [ 6.069653] 3 ofpart partitions found on MTD device orion_nand
- [ 6.139489] Creating 3 MTD partitions on "orion_nand":
- [ 6.201049] 0x000000000000-0x000000100000 : "u-boot"
- [ 6.298879] 0x000000100000-0x000000300000 : "uImage"
- [ 6.359487] 0x000000300000-0x000000800000 : "rootfs"
- [ 6.420088] mtd: device 2 (rootfs) set to be root filesystem
- [ 6.488006] mtdsplit: squashfs has invalid size in "rootfs"
- [ 6.555804] libphy: Fixed MDIO Bus: probed
- [ 6.605134] libphy: orion_mdio_bus: probed
- [ 6.654296] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
- [ 6.736889] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:90:0b:1d:38:44
- [ 6.841700] mv643xx_eth_port mv643xx_eth_port.1 eth1: port 0 with MAC address 00:90:0b:1d:38:45
- [ 6.946023] sky2: driver version 1.30
- [ 6.989917] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
- [ 7.068084] ehci-pci: EHCI PCI platform driver
- [ 7.121365] ehci-platform: EHCI generic platform driver
- [ 7.184041] ehci-orion: EHCI orion driver
- [ 7.232167] orion-ehci f1050000.ehci: EHCI Host Controller
- [ 7.297884] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
- [ 7.389736] orion-ehci f1050000.ehci: irq 29, io mem 0xf1050000
- [ 7.475396] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
- [ 7.547945] hub 1-0:1.0: USB hub found
- [ 7.593020] hub 1-0:1.0: 1 port detected
- [ 7.640434] usbcore: registered new interface driver usb-storage
- [ 7.712919] mvsdio f1090000.mvsdio: Got CD GPIO
- [ 7.806046] NET: Registered protocol family 10
- [ 7.860614] NET: Registered protocol family 17
- [ 7.913912] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
- [ 8.065125] Distributed Switch Architecture driver version 0.1
- [ 8.138410] mv643xx_eth_port mv643xx_eth_port.0 eth0: [0]: detected a Marvell 88E6161 (A2) switch
- [ 8.272733] mmc0: host does not support reading read-only switch, assuming write-enable
- [ 8.368652] usb 1-1: new high-speed USB device number 2 using orion-ehci
- [ 8.449006] mmc0: new high speed SD card at address b368
- [ 8.513135] mmcblk0: mmc0:b368 USD 1.87 GiB
- [ 8.567656] mmcblk0: p1
- [ 8.656407] hub 1-1:1.0: USB hub found
- [ 8.701788] hub 1-1:1.0: 2 ports detected
- [ 8.752492] libphy: dsa slave smi: probed
- [ 8.807448] 8021q: 802.1Q VLAN Support v1.8
- [ 8.859445] hctosys: unable to open rtc device (rtc0)
- [ 8.921321] Waiting 1 sec before mounting root device...
- [ 9.985437] UBIFS error (pid: 1): cannot open "ubi0:rootfs", error -19
- [ 10.062128] EXT4-fs (mmcblk0p1): couldn't mount as ext3 due to feature incompatibilities
- [ 10.161716] EXT4-fs (mmcblk0p1): mounting ext2 file system using the ext4 subsystem
- [ 10.264191] EXT4-fs (mmcblk0p1): mounted filesystem without journal. Opts: (null)
- [ 10.353851] VFS: Mounted root (ext2 filesystem) readonly on device 179:1.
- [ 10.435640] Freeing unused kernel memory: 164K (c04df000 - c0508000)
- [ 10.708063] init: Console is alive
- [ 10.883786] sata_mv f1080000.sata: slots 32 ports 1
- [ 10.943870] scsi host0: sata_mv
- [ 10.981727] ata1: SATA max UDMA/133 irq 32
- [ 11.375394] ata1: SATA link down (SStatus 0 SControl F300)
- [ 11.749364] init: - preinit -
- 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
- [ 14.911926] mount_root: mounting /dev/root
- [ 14.961297] EXT4-fs (mmcblk0p1): warning: mounting unchecked fs, running e2fsck is recommended
- [ 15.068170] EXT4-fs (mmcblk0p1): re-mounted. Opts: (null)
- [ 15.138444] procd: - early -
- [ 16.147855] procd: - ubus -
- [ 17.186555] random: ubusd urandom read with 39 bits of entropy available
- [ 18.276341] procd: - init -
- Please press Enter to activate this console.
- [ 19.957191] ip6_tables: (C) 2000-2006 Netfilter Core Team
- [ 20.030055] Netfilter messages via NETLINK v0.30.
- [ 20.088316] ip_set: protocol 6
- [ 20.145433] i2c /dev entries driver
- [ 20.201591] ip_tables: (C) 2000-2006 Netfilter Core Team
- [ 20.271621] nf_conntrack version 0.5.0 (8037 buckets, 32148 max)
- [ 20.365110] xt_time: kernel timezone is -0000
- [ 20.424406] PPP generic driver version 2.4.2
- [ 20.477235] NET: Registered protocol family 24
- [ 22.991832] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
- [ 23.283284] dsa dsa@0 lan1: failed to reflect master change
- [ 23.350093] device lan1 entered promiscuous mode
- [ 23.405380] device eth0 entered promiscuous mode
- [ 23.471301] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
- [ 23.574603] dsa dsa@0 lan2: failed to reflect master change
- [ 23.641496] device lan2 entered promiscuous mode
- [ 23.732705] dsa dsa@0 lan3: failed to reflect master change
- [ 23.799449] device lan3 entered promiscuous mode
- [ 24.070903] dsa dsa@0 lan4: failed to reflect master change
- [ 24.137649] device lan4 entered promiscuous mode
- [ 24.261774] mv643xx_eth_port mv643xx_eth_port.1 eth1: link up, 1000 Mb/s, full duplex, flow control disabled
- [ 24.857551] dsa dsa@0 lan3: Link is Down
- [ 24.906678] dsa dsa@0 lan1: Link is Down
- [ 24.955718] dsa dsa@0 lan2: Link is Down
- [ 25.847481] dsa dsa@0 lan4: Link is Down
- [ 26.947819] dsa dsa@0 lan1: Link is Up - 1Gbps/Full - flow control off
- [ 27.028191] br-lan: port 1(lan1) entered forwarding state
- [ 27.092869] br-lan: port 1(lan1) entered forwarding state
- [ 27.158560] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
- [ 29.085384] br-lan: port 1(lan1) entered forwarding state
- [ 39.643523] mv643xx_eth_port mv643xx_eth_port.1 eth1: link up, 1000 Mb/s, full duplex, flow control disabled
- [ 41.237310] random: nonblocking pool is initialized
- [ 54.904799] mv643xx_eth_port mv643xx_eth_port.1 eth1: link up, 1000 Mb/s, full duplex, flow control disabled
- [ 70.168611] mv643xx_eth_port mv643xx_eth_port.1 eth1: link up, 1000 Mb/s, full duplex, flow control disabled
- [ 85.428171] mv643xx_eth_port mv643xx_eth_port.1 eth1: link up, 1000 Mb/s, full duplex, flow control disabled
- [ 100.688366] mv643xx_eth_port mv643xx_eth_port.1 eth1: link up, 1000 Mb/s, full duplex, flow control disabled
- [ 115.949138] mv643xx_eth_port mv643xx_eth_port.1 eth1: link up, 1000 Mb/s, full duplex, flow control disabled
复制代码
初步测试各端口正常,但是lan口的led灯依然只亮一个,希望有高手能继续完善该dst文件(比如机器有个rst键和开关机键,不知道怎么在dts文件定义),还有就是这个机器该如何划分vlan,是否支持类似eth0.1 eth0.2这类的虚拟接口?
本人编译版本下载链接:https://pan.baidu.com/s/1VEX9Qkh3h0aQEDC6-5R_Tw?pwd=n8ks 提取码: n8ks |
|