Udostępniam kilka informacji od siebie, aby kolejna osoba która zakupi ten router nie borykała się z tymi samymi problemami co ja.
W kompilatorze wprowadziłem następujące zmiany w pliku "dtsi":
# nano target/linux/ramips/dts/U7628-01.dtsi
/*
* BSD LICENSE
*
* Copyright(c) 2017 Kristian Evensen <kristian.evensen@gmail.com>.
* Copyright(c) 2017 Piotr Dymacz <pepe2k@gmail.com>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Broadcom Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "mt7628an.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "unielec,u7628-01", "mediatek,mt7628an-soc";
chosen {
bootargs = "console=ttyS0,115200";
};
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
#size-cells = <0>;
poll-interval = <20>;
reset {
label = "reset";
gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
gpio-leds {
compatible = "gpio-leds";
wlan {
label = "u7628-01:green:wlan";
gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
};
wan {
label = "u7628-01:green:wan";
gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
};
lan1 {
label = "u7628-01:green:lan1";
gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
};
lan2 {
label = "u7628-01:green:lan2";
gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
};
lan3 {
label = "u7628-01:green:lan3";
gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
};
lan4 {
label = "u7628-01:green:lan4";
gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
};
};
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&pcie {
status = "okay";
};
ðernet {
mtd-mac-address = <&factory 0x28>;
};
&wmac {
status = "okay";
ralink,mtd-eeprom = <&factory 0x0>;
};
&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "gpio", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an", "refclk", "wdt", "wled_an";
ralink,function = "gpio";
};
};
};
Po kompilacji i uruchomieniu routera otrzymałem następujące zmiany:
Zmiany LED:
- usunięcie "usb" (nie zarządzała niczym, nie ma takiego LEDa)
- zmiana nazwy z "power" na "wlan"
# ls /sys/class/leds
mt76-phy0
u7628-01:green:lan1
u7628-01:green:lan2
u7628-01:green:lan3
u7628-01:green:lan4
u7628-01:green:wan
u7628-01:green:wlan
Zmiany GPIO:
- pojawia się "gpio11", ktore zarządza fizycznym GOLDPINem nr. 6 na płycie. Działa znakomicie jako wyjście oraz jako wejście. Zauważyłem, że nie podając stanu wejściowego GND lub 3V3 otrzytywany stan to naprzemian "0" lub "1".
# ls /sys/class/gpio
export
gpio11
gpiochip0
gpiochip32
gpiochip64
unexport
Takie zmiany wymagają ingerencji w pliku "system" w sekcji LEDów, poniżej cały ten plik w defaultowej konfiguracji już PO zmianach:
# nano /etc/config/system
config system
option hostname 'OpenWrt'
option timezone 'UTC'
option ttylogin '0'
option log_size '64'
option urandom_seed '0'
config timeserver 'ntp'
option enabled '1'
option enable_server '0'
list server '0.openwrt.pool.ntp.org'
list server '1.openwrt.pool.ntp.org'
list server '2.openwrt.pool.ntp.org'
list server '3.openwrt.pool.ntp.org'
config led 'led_lan1'
option name 'lan1'
option sysfs 'u7628-01:green:lan1'
option trigger 'switch0'
option port_mask '0x2'
option default '0'
config led 'led_lan2'
option name 'lan2'
option sysfs 'u7628-01:green:lan2'
option trigger 'switch0'
option port_mask '0x4'
option default '0'
config led 'led_lan3'
option name 'lan3'
option sysfs 'u7628-01:green:lan3'
option trigger 'switch0'
option port_mask '0x8'
option default '0'
config led 'led_lan4'
option name 'lan4'
option sysfs 'u7628-01:green:lan4'
option trigger 'switch0'
option port_mask '0x10'
option default '0'
config led 'led_wan'
option name 'wan'
option sysfs 'u7628-01:green:wan'
option trigger 'switch0'
option port_mask '0x01'
option default '0'
config led 'led_wifi_led'
option name 'wlan'
option sysfs 'u7628-01:green:wlan'
option trigger 'netdev'
option dev 'wlan0'
option default '0'
option mode 'link'
Mam jeszcze dwa pytania:
1. Chciałem podmienić ten plik "/etc/config/system", aby w defaultowej konfiguracji routera te LEDy działały prawidłowo.
Jaki plik muszę podmienić w kompilatorze, aby system skompilował się z tymi zmianami LEDów
# find . -name "system"
./build_dir/toolchain-mipsel_24kc_gcc-7.3.0_musl/gcc-7.3.0/libsanitizer/include/system
./build_dir/target-mipsel_24kc_musl/busybox-1.28.4/include/config/last/system
./build_dir/target-mipsel_24kc_musl/busybox-1.28.4/include/config/first/system
./build_dir/target-mipsel_24kc_musl/root.orig-ramips/etc/init.d/system
./build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/base-files/.pkgdir/base-files/etc/init.d/system
./build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/base-files/ipkg-mipsel_24kc/base-files/etc/init.d/system
./build_dir/target-mipsel_24kc_musl/root-ramips/etc/init.d/system
./staging_dir/target-mipsel_24kc_musl/root-ramips/etc/init.d/system
./package/base-files/files/etc/init.d/system
./package/system
2. Po kompilacji systemu, chciałem dalej korzystać z ImageBuildera - nie chcę bawić się w Developera, jeśli nie ma takiej potrzeby, a Image Builder jest dużo fajniejszym i prostszym narzędziem. Jak powinienem przygotować się do tego? Rozumiem, że w "make menuconfig" powiniem zaznaczyć, że chce zbudować ImageBuilder. Ale po zbudowaniu go w obecnym stanie nie będę chyba miał w nim dostępnych żadnych dodatkowych pakietów. Czy jeśli w pliku ".config" zamienie wszystkie:
# CONFIG_PACKAGE_xxxxxxxx is not set
na:
CONFIG_PACKAGE_xxxxxxxx=y
...i skompiluje to, to czy będzie mi służył taki ImageBuilder TYLKO do kolejnego dodawania i usuwania pakietów oraz nadpisywania plików?