|
This post was last edited by Heart of Canaan on 2024-12-30 16:31
I'm an amateur garbage guy myself, my level is extremely poor, my skills are none, I'm older, and I can't speak clearly. It is inevitable that there will be mistakes in the article, and the bigwigs are asked to correct them.
1. Brief introduction:
This batch of WIA3300-10 was eliminated by Telecom, and it didn't even give the power supply, the POE power supply, and all the power supply capacitors exploded. I replaced the capacitor.
Old and frail, hands trembling and eyes slanting, just look at it.
The red circle is the replaced capacitor.
The holes in place the fins are as clean as my wallet.
2. Analyze the original firmware and previous data.
The following information is emphatically referenced:
Siga Spruce wia3300-10, disassembled and adapted to Breed/openwrt firmware, has been completed without disassembly!! -Wireless router hardware transformation and fault repair-Enshan Wireless Forum
Siga Spruce WIA3300-10 OpenWrt 2024-03-31 Update 5.10 Kernel-OPENWRT Special Edition-Enshan Wireless Forum
Special thankshackpascal, Although this older guy doesn't post much, each one is a phenomenal blockbuster post.
Special thanks vb1980, he open-sourced the WIA3300-10 source code based on immort 5.10.
Analysis of the data revealed that:
- At present, breed is available, it is based on K2P modification, but it is not perfect, but it can be called up.
- At present, the LED support of unofficial firmware is not perfect, mainly due to the lack of GPIO_LED information.
- The dts file needs to be created, and the GPIO information, partition information, and network interface order need to be supplemented.
- ./target/linux/ramips/image/mt7621.mk
- ./target/linux/ramips/mt7621/base-files/etc/board.d/01_led need to add an LED behavior definition.
At this time, I was very optimistic, but I didn't know that every step was a pit. The configuration file is not exactly the same between different versions of OpenWRT, and the difference between 5.x and 6.x is quite large.
I started by adding the device information in the MT7621.mk.
This is plagiarized from D2, but it was a shameful failure, so the first half copied the definition of the VB1980 big guy, and the second half copied NEWIFI_D2. Even so, because the old eyes are dizzy, a "-" is missing, causing the wireless function to disappear............
This paragraph is the configuration file currently in use.,There are still some problems.,I hope the big guys can point it out.。
define Device/skspruce_wia3300-10
$(Device/dsa-migration)
IMAGE_SIZE := 32448k
DEVICE_VENDOR := Skspruce
DEVICE_MODEL := WIA3300-10
SUPPORTED_DEVICES += wia3300-10
DEVICE_PACKAGES := kmod-mt7615-firmware kmod-usb3 kmod-usb-ledtrig-usbport -uboot-envtools
endef
TARGET_DEVICES += skspruce_wia3300-10
Next, I was going to generate a .dts file, I needed to look for GPIO_LED information, and by analyzing the factory firmware, I found that the factory firmware did not seem to have the "LED configuration" option. Or maybe I'm not looking for the place. However, there is a configuration file in the original firmware, and I flipped through all the files containing "LED", and finally learned that the GPIO_LED configuration of the WIA3300-10 is as follows:
gpo_boot=23 - Boot LED (Red);
gpo_power=24 - Power LED (Green);
gpo_wan=3 - WAN LED (Green);
gpo_5g=22 - WiFi 5g LED(Blue)
gpo_2g=4- WiFi 2.4g LED (Green)
These lines of text took me 4 weeks. But I didn't know it at this time, I had already stepped into the pit with one foot.
At this time, I did not have the ability to verify the GPIO_LED in breed, so I could only verify it by repeatedly modifying, compiling, and flashing the firmware, but I didn't know that the "wia3300-10 breed" modified by K2P's breed had a big pitfall, which would cause the LED to behave as expected.
The dts file of K2P is not completely suitable for modifying the dts file of WIA3300-10, in fact, the most suitable for patchwork is newifi-d2 and youhua-wr1200js. The former provides a reference for bus device initialization, and the latter provides a reference for the network part. It took another 3 days to change llllw to wllll, and 2 days to change the partition.
This is the DTS file currently in use.,It's still imperfect.,I hope the bigwigs can correct it.。
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
compatible = "skspruce,wia3300-10", "mediatek,mt7621-soc";
model = "Skspruce WIA3300-10";
aliases {
led-boot = &led_power_boot;
led-failsafe = &led_power_boot;
led-running = &led_power_sys;
led-upgrade = &led_power_boot;
};
chosen {
bootargs = "console=ttyS0,115200";
};
leds {
compatible = "gpio-leds";
led_power_boot: power-red {
label = "power:red";
gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
};
led_power_sys: power-green {
label = "power:green";
gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
};
internet-green {
label = "internet:green";
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
};
wlan2g {
label = "wlan2g:green";
gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
};
wlan5g {
label = "wlan5g:blue";
gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset";
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
read-only;
};
partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
eeprom_factory_0: eeprom@0 {
reg = <0x0 0x4da8>;
};
macaddr_factory_4: macaddr@4 {
reg = <0x4 0x6>;
};
macaddr_factory_e000: macaddr@e000 {
reg = <0xe000 0x6>;
};
macaddr_factory_e006: macaddr@e006 {
reg = <0xe006 0x6>;
};
};
};
partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x50000 0x1fb0000>;
};
};
};
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
/* 5 GHz (phy1) does not take the address from calibration data,
but setting it manually here works */
nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>;
nvmem-cell-names = "eeprom", "mac-address";
};
};
&gmac0 {
nvmem-cells = <&macaddr_factory_e000>;
nvmem-cell-names = "mac-address";
};
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <ðphy0>;
nvmem-cells = <&macaddr_factory_e006>;
nvmem-cell-names = "mac-address";
};
ðphy0 {
/delete-property/ interrupts;
};
&switch0 {
ports {
port@1 {
status = "okay";
label = "lan1";
};
port@2{
status = "okay";
label = "lan2";
};
port@3{
status = "okay";
label = "lan3";
};
port@4{
status = "okay";
label = "lan4";
};
};
};
&state_default {
gpio {
groups = "i2c", "jtag","uart2", "uart3";
function = "gpio";
};
};
The behavior of LED lights can be influenced by breeds.
I put the led behavior profile in the ./target/linux/ramips/mt7621/base-files/etc/board.d/01_led file, as for why I put it here, the main reason is to facilitate the modification of the LED configuration on the uci interface (in fact, it is copied).
Current LED configuration
skspruce,wia3300-10)
ucidef_set_led_netdev "wan" "INTERNET" "internet:green" "wan" "link tx rx"
ucidef_set_led_netdev "wifi5g" "5G" "wlan5g:blue" "phy1-ap0" "link tx rx"
ucidef_set_led_netdev "wifi2g" "2G" "wlan2g:green" "phy0-ap0" "link tx rx"
;;
Some of my whimsical ideas: regarding the power_led and the boot_led, one of the two lights is red and the other is green, unified packaging, I considered configuring the power_led_red to blink in heartbeat to reflect the CPU load, boot_led_green to turn off after the system boot is complete, or to set it to reverse the heartbeat beat to reflect the energy consumption along with the red light.
However, it was only at this point that I had the knowledge to modify GPIO_LED level parameters in Breed. This was supposed to be done at the beginning.
Reference:【2022-07-26】AR/QCA/MTK Breed, Powerful Multi-threaded Bootloader-OPENWRT Special Edition-Enshan Wireless Forum
Enter the breed environment and command line telnet 192.168.1.1
Execute the command gpio list to get a bunch of information, refer to the previous GPIO_LED file, and sort out the useful ones:
PIO direction status name
3 out hi wlan5g
4 out hi internet
18 in hi reset
22 in hi
23 out hi wlan2g
24 out hi power
As you can see, the error is still quite obvious.
Use the gpio dir set 22 out command to modify the direction of the 22-port GPIO.
The final changes should look like this:
3 out hi
4 out hi
18 in hi
22 out hi
23 out hi
24 out hi
At this point, you should know how to compile your own firmware
Firmware Link: https://pan.baidu.com/s/1qnZqzFk2f70KN-JzqdcPUg?pwd=gvw9
Extraction code: GVW9
|
More resources are included in this post
You need login Can you download or view without an account?Sign up now
×
|