Skip to content

Commit

Permalink
Merge branch 'TrackingUpstreamMain' into ThirdTryTahoma-v1
Browse files Browse the repository at this point in the history
Updating to track upstream
  • Loading branch information
TahomaSoft committed Apr 12, 2024
2 parents fb81535 + ae192c0 commit e9b60c8
Show file tree
Hide file tree
Showing 175 changed files with 2,180 additions and 24,353 deletions.
1 change: 1 addition & 0 deletions package/boot/uboot-envtools/files/mediatek_filogic
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ comfast,cf-e393ax)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x80000"
;;
cetron,ct3003|\
edgecore,eap111|\
netgear,wax220|\
zbtlink,zbt-z8102ax|\
zbtlink,zbt-z8103ax)
Expand Down
4 changes: 4 additions & 0 deletions package/kernel/leds-gca230718/src/leds-gca230718.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ static int gca230718_set_brightness(struct led_classdev *led_cdev, enum led_brig
return 0;
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,3,0)
static int gca230718_probe(struct i2c_client *client)
#else
static int gca230718_probe(struct i2c_client *client, const struct i2c_device_id *id)
#endif
{
int status = 0;
struct gca230718_private* gca230718_privateData;
Expand Down
24 changes: 19 additions & 5 deletions package/network/services/lldpd/files/lldpd.init
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,18 @@ write_lldpd_conf()
local lldp_mgmt_ip
config_get lldp_mgmt_ip 'config' 'lldp_mgmt_ip'

# Configurable capabilities in lldpd >= v1.0.15
local lldp_syscapabilities
config_get lldp_syscapabilities 'config' 'lldp_syscapabilities'

# Configurable capabilities in lldpd >= v1.0.15
local lldp_capability_advertisements
config_get_bool lldp_capability_advertisements 'config' 'lldp_capability_advertisements' 0

# Broadcast management address in lldpd >= 0.7.15
local lldp_mgmt_addr_advertisements
config_get_bool lldp_mgmt_addr_advertisements 'config' 'lldp_mgmt_addr_advertisements' 0

if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ]; then
local lldpmed_fast_start
config_get_bool lldpmed_fast_start 'config' 'lldpmed_fast_start' 0
Expand Down Expand Up @@ -149,6 +158,7 @@ write_lldpd_conf()
[ -n "$lldp_hostname" ] && echo "configure system hostname" "\"$lldp_hostname\"" >> "$LLDPD_CONF"
[ -n "$lldp_mgmt_ip" ] && echo "configure system ip management pattern" "\"$lldp_mgmt_ip\"" >> "$LLDPD_CONF"
[ -n "$lldp_syscapabilities" ] && echo "configure system capabilities enabled $lldp_syscapabilities" >> "$LLDPD_CONF"

if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ] && [ "$lldpmed_fast_start" -gt 0 ]; then
if [ "$lldpmed_fast_start_tx_interval" -gt 0 ]; then
echo "configure med fast-start tx-interval $lldpmed_fast_start_tx_interval" >> "$LLDPD_CONF"
Expand All @@ -174,6 +184,8 @@ write_lldpd_conf()
[ -n "$lldp_platform" ] && echo "configure system platform" "\"$lldp_platform\"" >> "$LLDPD_CONF"
[ -n "$lldp_tx_interval" ] && echo "configure lldp tx-interval $lldp_tx_interval" >> "$LLDPD_CONF"
[ "$lldp_tx_hold" -gt 0 ] && echo "configure lldp tx-hold $lldp_tx_hold" >> "$LLDPD_CONF"
[ "$lldp_capability_advertisements" -gt 0 ] && echo "configure lldp capabilities-advertisements" >> "$LLDPD_CONF"
[ "$lldp_mgmt_addr_advertisements" -gt 0 ] && echo "configure lldp management-addresses-advertisements" >> "$LLDPD_CONF"

# Since lldpd's sysconfdir is /tmp, we'll symlink /etc/lldpd.d to /tmp/$LLDPD_CONFS_DIR
[ -e "$LLDPD_CONFS_DIR" ] || ln -s /etc/lldpd.d "$LLDPD_CONFS_DIR"
Expand Down Expand Up @@ -349,34 +361,36 @@ reload_service() {
return 0
fi

$LLDPCLI -u "$LLDPSOCKET" 2>&1 /dev/null <<-EOF
$LLDPCLI -u "$LLDPSOCKET" >/dev/null 2>&1 <<-EOF
pause
unconfigure lldp custom-tlv
unconfigure lldp capabilities-advertisements
unconfigure lldp management-addresses-advertisements
unconfigure system interface pattern
unconfigure system description
unconfigure system hostname
unconfigure system ip management pattern
unconfigure system platform
EOF
if [ "$CONFIG_LLDPD_WITH_LLDPMED" = "y" ]; then
$LLDPCLI -u "$LLDPSOCKET" 2>&1 /dev/null <<-EOF
$LLDPCLI -u "$LLDPSOCKET" >/dev/null 2>&1 <<-EOF
unconfigure med fast-start
EOF

fi
# Rewrite lldpd.conf
# If something changed it should be included by the lldpcli call
write_lldpd_conf
$LLDPCLI -u "$LLDPSOCKET" -c "$LLDPD_CONF" -c "$LLDPD_CONFS_DIR" 2>&1 /dev/null
$LLDPCLI -u "$LLDPSOCKET" -c "$LLDPD_CONF" -c "$LLDPD_CONFS_DIR" >/dev/null 2>&1
# Broadcast update over the wire
$LLDPCLI -u "$LLDPSOCKET" 2>&1 /dev/null <<-EOF
$LLDPCLI -u "$LLDPSOCKET" >/dev/null 2>&1 <<-EOF
resume
update
EOF
return 0
}

stop_service() {
rm -rf ${LLDPD_RUN} "$LLDPSOCKET" 2> /dev/null
rm -rf ${LLDPD_RUN} "$LLDPSOCKET" >/dev/null 2>&1
}

201 changes: 201 additions & 0 deletions target/linux/mediatek/dts/mt7981a-edgecore-eap111.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

/dts-v1/;

#include <dt-bindings/leds/common.h>
#include "mt7981.dtsi"

/ {
model = "Edgecore EAP111";
compatible = "edgecore,eap111", "mediatek,mt7981";

aliases {
serial0 = &uart0;
led-boot = &led_green;
led-failsafe = &led_green;
led-running = &led_green;
led-upgrade = &led_green;
};

chosen {
bootargs-override = "console=ttyS0,115200n8";
stdout-path = "serial0:115200n8";
};

gpio-keys {
compatible = "gpio-keys";

reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
};
};

leds {
compatible = "gpio-leds";

led_green: led-green {
gpios = <&pio 9 GPIO_ACTIVE_HIGH>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_INDICATOR;
};

led_orange: led-orange {
gpios = <&pio 34 GPIO_ACTIVE_HIGH>;
color = <LED_COLOR_ID_ORANGE>;
function = LED_FUNCTION_INDICATOR;
};

led_blue: led-blue {
gpios = <&pio 35 GPIO_ACTIVE_HIGH>;
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_INDICATOR;
};
};
};

&uart0 {
status = "okay";
};

&watchdog {
status = "okay";
};

&pio {
spi0_flash_pins: spi0-pins {
mux {
function = "spi";
groups = "spi0", "spi0_wp_hold";
};
};
};

&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_flash_pins>;
cs-gpios = <0>, <0>;
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;

flash@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "spi-nand";
reg = <0>;
spi-max-frequency = <52000000>;

spi-cal-enable;
spi-cal-mode = "read-data";
spi-cal-datalen = <7>;
spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>;
spi-cal-addrlen = <5>;
spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>;

spi-tx-bus-width = <4>;
spi-rx-bus-width = <4>;
mediatek,nmbm;
mediatek,bmt-max-ratio = <1>;
mediatek,bmt-max-reserved-blocks = <64>;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
label = "BL2";
reg = <0x00000 0x100000>;
read-only;
};

partition@100000 {
label = "u-boot-env";
reg = <0x100000 0x80000>;
};

partition@180000 {
label = "Factory";
reg = <0x180000 0x200000>;
read-only;

nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;

eeprom_factory: eeprom@0 {
reg = <0x0 0x1000>;
};

macaddr_wan: macaddr@2a {
reg = <0x2a 0x6>;
};

macaddr_lan: macaddr@24 {
reg = <0x24 0x6>;
};
};
};

partition@380000 {
label = "FIP";
reg = <0x380000 0x200000>;
read-only;
};

partition@580000 {
label = "ubi";
reg = <0x580000 0x4000000>;
compatible = "linux,ubi";
};
};
};
};

&mdio_bus {
reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>;
reset-delay-us = <10000>;
reset-post-delay-us = <10000>;

en8801sc: ethernet-phy@24 {
reg = <24>;
compatible = "ethernet-phy-id03a2.9471";
phy-mode = "sgmii";
};
};

&eth {
pinctrl-names = "default";
pinctrl-0 = <&mdio_pins>;
status = "okay";

gmac0: mac@0 {
compatible = "mediatek,eth-mac";
reg = <0>;
phy-mode = "sgmii";
phy-handle = <&en8801sc>;
managed = "in-band-status";
nvmem-cells = <&macaddr_lan>;
nvmem-cell-names = "mac-address";
};

gmac1: mac@1 {
compatible = "mediatek,eth-mac";
reg = <1>;
phy-mode = "gmii";
phy-handle = <&int_gbe_phy>;
nvmem-cells = <&macaddr_wan>;
nvmem-cell-names = "mac-address";
};
};

&wifi {
nvmem-cells = <&eeprom_factory>;
nvmem-cell-names = "eeprom";
status = "okay";
};
Loading

0 comments on commit e9b60c8

Please sign in to comment.