Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit a35f71a
Merge: 4d0e87a 0c40df8
Author: Husky <1556047610@qq.com>
Date:   Thu Jan 26 19:51:11 2023 +0800

    Merge remote-tracking branch 'upstream/master'

commit 0c40df8
Author: zfdx <47835976+zfdx123@users.noreply.github.com>
Date:   Thu Jan 26 19:50:31 2023 +0800

    ramips: MT7620 add Support HiWiFi R33(C312B B52) (coolsnowwolf#10812)

commit 4d0e87a
Merge: 6258479 ae14a83
Author: Husky <57535444+hyy-666@users.noreply.github.com>
Date:   Thu Jan 26 19:50:27 2023 +0800

    Merge branch 'coolsnowwolf:master' into master

commit ae14a83
Author: coolsnowwolf <coolsnowwolf@gmail.com>
Date:   Thu Jan 26 19:49:10 2023 +0800

    Revert "elfutils: fix gcc8 compile"

    This reverts commit 7df2cab.

commit 6258479
Merge: 824ad2f 7df2cab
Author: Husky <1556047610@qq.com>
Date:   Thu Jan 26 16:59:26 2023 +0800

    Merge remote-tracking branch 'upstream/master'

commit 7df2cab
Author: coolsnowwolf <31687149+coolsnowwolf@users.noreply.github.com>
Date:   Thu Jan 26 12:29:57 2023 +0800

    elfutils: fix gcc8 compile

commit 1f978b4
Author: coolsnowwolf <31687149+coolsnowwolf@users.noreply.github.com>
Date:   Thu Jan 26 12:27:19 2023 +0800

    linux-firmware: update to 20230117

commit 824ad2f
Merge: a2e67cb aa4e4da
Author: Husky <57535444+hyy-666@users.noreply.github.com>
Date:   Thu Jan 26 09:17:28 2023 +0800

    Merge branch 'coolsnowwolf:master' into master

commit aa4e4da
Author: coolsnowwolf <coolsnowwolf@gmail.com>
Date:   Wed Jan 25 20:49:18 2023 +0800

    ipq60xx: disable ath11k wireless temporarily

commit 6ed4335
Author: coolsnowwolf <coolsnowwolf@gmail.com>
Date:   Wed Jan 25 20:46:54 2023 +0800

    igb-intel: drop package

commit c875033
Author: coolsnowwolf <coolsnowwolf@gmail.com>
Date:   Wed Jan 25 20:38:08 2023 +0800

    rockchip: fix dts patch for Ariaboard Photonicat

commit 51ec2f4
Author: lovehackintosh <92633080+lovehackintosh@users.noreply.github.com>
Date:   Wed Jan 25 15:30:35 2023 +0800

    treewide: sync with upstream (coolsnowwolf#10750)

    * build: fix incomplete initramfs compression options

    Requires: tools/lz4, tools/lzop

    complete the wiring so that these options work:
    * `CONFIG_KERNEL_INITRAMFS_COMPRESSION_LZO`
    * `CONFIG_KERNEL_INITRAMFS_COMPRESSION_LZ4`

    Signed-off-by: Tony Butler <spudz76@gmail.com>
    [remove blocking dependencies for separate ramdisk, fix lzop options]
    Signed-off-by: Daniel Golle <daniel@makrotopia.org>

    * include: sync with upstream

    * toolchain/binutils: add support for version 2.40

    Release notes:
        https://sourceware.org/pipermail/binutils/2023-January/125671.html

    Signed-off-by: Linhui Liu <liulinhui36@gmail.com>

    * toolchain/gcc: switch to version 12 by default

    Also fix build error with gcc 12.

    * toolchain/nasm: update to 2.16.01

    ChangeLog:

     Version 2.16.01

           _This is a documentation update release only._

           (*) Fix the creation of the table of contents in the HTML version of
               the documentation.

     Version 2.16

           (*) Support for the `rdf' format has been discontinued and all the
               RDOFF utilities has been removed.

           (*) The `--reproducible' option now leaves the filename field in the
               COFF object format blank. This was always rather useless since
               it is only 18 characters long; as such debug formats have to
               carry their own filename information anyway.

           (*) Fix handling of MASM-syntax reserved memory (e.g. `dw ?') when
               used in structure definitions.

           (*) The preprocessor now supports functions, which can be less
               verbose and more convenient than the equivalent code implemented
               using directives. See section 4.4.

           (*) Fix the handling of `%00' in the preprocessor.

           (*) Fix incorrect handling of path names affecting error messages,
               dependency generation, and debug format output.

           (*) Support for the RDOFF output format and the RDOFF tools have
               been removed. The RDOFF tools had already been broken since at
               least NASM 2.14. For flat code the ELF output format
               recommended; for segmented code the `obj' (OMF) output format.

           (*) New facility: preprocessor functions. Preprocessor functions,
               which are expanded similarly to single-line macros, can greatly
               simplify code that in the past would have required a lengthy
               list of directives and intermediate macros. See section 4.4.

           (*) Single-line macros can now declare parameters (using a `&&'
               prefix) that creates a quoted string, but does _not_ requote an
               already quoted string. See section 4.2.1.

           (*) Instruction table updated per public information available as of
               November 2022.

           (*) All warnings in the preprocessor have now been assigned warning
               classes. See appendix A.

           (*) Fix the invalid use of `RELA'-type relocations instead of `REL'-
               type relocations when generating DWARF debug information for the
               `elf32' output format.

           (*) Fix the handling `at' in `istruc' when the structure contains
               local labels. See section 5.9.2.

           (*) When assembling with `--reproducible', don't encode the filename
               in the COFF header for the `coff', `win32' or `win64' output
               formats. The COFF header only has space for an 18-character
               filename, which makes this field rather useless in the first
               place. Debug output data, if enabled, is not affected.

           (*) Fix incorrect size calculation when using MASM syntax for non-
               byte reservations (e.g. `dw ?'.)

           (*) Allow forcing an instruction in 64-bit mode to have a (possibly
               redundant) REX prefix, using the syntax `{rex}' as a prefix.

           (*) Add a `{vex}' prefix to enforce VEX (AVX) encoding of an
               instruction, either using the 2- or 3-byte VEX prefixes.

           (*) The `CPU' directive has been augmented to allow control of
               generation of VEX (AVX) versus EVEX (AVX-512) instruction
               formats, see section 7.11.

           (*) Some recent instructions that previously have been only
               available using EVEX encodings are now also encodable using VEX
               (AVX) encodings. For backwards compatibility these encodings are
               not enabled by default, but can be generated either via an
               explicit `{vex}' prefix or by specifying either `CPU LATEVEX' or
               `CPU NOEVEX'; see section 7.11.

           (*) Document the already existing `%unimacro' directive. See section
               4.5.12.

           (*) Fix a code range generation bug in the DWARF debug format
               (incorrect information in the `DW_AT_high_pc' field) for the ELF
               output formats. This bug happened to cancel out with a bug in
               older versions of the GNU binutils linker, but breaks with other
               linkers and updated or other linkers that expect the spec to be
               followed.

           (*) Fix segment symbols with addends, e.g. `jmp _TEXT+10h:0' in
               output formats that support segment relocations, e.g. the `obj'
               format.

           (*) Fix various crashes and hangs on invalid input.

    Signed-off-by: Linhui Liu <liulinhui36@gmail.com>

    * toolchain: musl: Fix symbol loading in gdb

    Fix DT_DEBUG handling on MIPS in musl libc.
    With this change gdb will load the symbol files for shared libraries on MIPS too.

    This patch was taken from this thread: https://www.openwall.com/lists/musl/2022/01/09/4

    Signed-off-by: Hauke Mehrtens <hmehrtens@maxlinear.com>

    * tools: sync with upstream

    * build: fix issues with targets installed via feeds

    - fix including modules.mk when a target is being replaced
    - fix calling make targets from target/linux

    Signed-off-by: Felix Fietkau <nbd@nbd.name>

    * package: sync with upstream

    Signed-off-by: Tony Butler <spudz76@gmail.com>
    Signed-off-by: Daniel Golle <daniel@makrotopia.org>
    Signed-off-by: Linhui Liu <liulinhui36@gmail.com>
    Signed-off-by: Hauke Mehrtens <hmehrtens@maxlinear.com>
    Signed-off-by: Felix Fietkau <nbd@nbd.name>
    Co-authored-by: Tony Butler <spudz76@gmail.com>
    Co-authored-by: Hauke Mehrtens <hmehrtens@maxlinear.com>
    Co-authored-by: Felix Fietkau <nbd@nbd.name>

commit a2e67cb
Merge: 0a86320 44f20df
Author: Husky <1556047610@qq.com>
Date:   Wed Jan 25 09:20:41 2023 +0800

    Merge remote-tracking branch 'upstream/master'

commit 44f20df
Author: 蛋炒饭 <lxl6125@yeah.net>
Date:   Wed Jan 25 00:35:49 2023 +0800

    arm-trusted-firmware-sunxi: Use common trusted-firmware-a.mk (coolsnowwolf#10804)

    Make use of the definitions from trusted-firmware-a.mk to build the
    Trusted firmware arm. This fixes the build with binutils 2.39.

    Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

    Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
    Co-authored-by: Hauke Mehrtens <hauke@hauke-m.de>

commit 7e01fac
Author: lovehackintosh <92633080+lovehackintosh@users.noreply.github.com>
Date:   Wed Jan 25 00:35:11 2023 +0800

    kernel: bump to 5.4.230, 5.10.165, 5.15.90 (coolsnowwolf#10803)

    * kernel: bump 5.4 to 5.4.230

    * kernel: bump 5.10 to 5.10.165

    * kernel: bump 5.15 to 5.15.90

commit 0a86320
Merge: 952a96f 0a113ed
Author: Husky <1556047610@qq.com>
Date:   Tue Jan 24 22:34:27 2023 +0800

    Merge remote-tracking branch 'upstream/master'

commit 0a113ed
Author: lovehackintosh <92633080+lovehackintosh@users.noreply.github.com>
Date:   Tue Jan 24 22:02:12 2023 +0800

    kernel: bump 6.1 to 6.1.8 (coolsnowwolf#10802)

    Signed-off-by: Linhui Liu <liulinhui36@gmail.com>

commit 02d584f
Author: lovehackintosh <92633080+lovehackintosh@users.noreply.github.com>
Date:   Tue Jan 24 22:00:53 2023 +0800

    layerscape: sync with official source (coolsnowwolf#10801)

commit 9fe455c
Author: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com>
Date:   Sat Nov 26 23:21:06 2022 +0800

    rockchip: add support for Ariaboard Photonicat

    This commit add basic support for Photonicat Board.

    Flash into lede:
      Run first: dd if=openwrt-xxx.img of=/dev/mmcblk0
      Then brush the img file to sdcard and insert it,
      the system will boot from above.

    Note:
      Since rockchip does not release any code to power up their
      device, disabled emmc for now until we can remove rkbin.

commit 0dc779b
Author: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com>
Date:   Tue Mar 29 23:20:18 2022 +0800

    rfkill: enable for rockchip by default

    This is useful for 4G modem chips. For example,
    the Radxa E25 supports insert two modems.

commit 952a96f
Merge: 0af8234 b77ab3b
Author: Husky <1556047610@qq.com>
Date:   Tue Jan 24 08:00:14 2023 +0800

    Merge remote-tracking branch 'upstream/master'

commit b77ab3b
Author: Lollipop907 <34392880+Lollipop907@users.noreply.github.com>
Date:   Mon Jan 23 21:18:14 2023 +0800

    rockchip: set network for MPC1903 (coolsnowwolf#10794)

commit c9e74f8
Author: lovehackintosh <92633080+lovehackintosh@users.noreply.github.com>
Date:   Mon Jan 23 21:50:08 2023 +0800

    intel-microcode: update to 20221108 (coolsnowwolf#10797)

    Fixes: coolsnowwolf#10796

commit 89953ea
Author: coolsnowwolf <31687149+coolsnowwolf@users.noreply.github.com>
Date:   Mon Jan 23 13:02:42 2023 +0800

    ipset: update to 7.17

commit 0af8234
Merge: f51173f 034b35e
Author: Husky <1556047610@qq.com>
Date:   Mon Jan 23 09:36:48 2023 +0800

    Merge remote-tracking branch 'upstream/master'

commit 034b35e
Author: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com>
Date:   Thu Dec 22 23:07:40 2022 +0800

    uboot-rockchip: fixes spl mode for rk3568

    Give spl more privileges so that it can be used at least.
    Fixes: 8dbff7b ("uboot-rockchip: add rk3568 board support")

commit 8d54436
Author: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com>
Date:   Sat May 7 23:13:50 2022 +0800

    rockchip: cleanup device tree files

commit f51173f
Merge: 8630454 ae17e3b
Author: Husky <1556047610@qq.com>
Date:   Sat Jan 21 22:42:56 2023 +0800

    Merge remote-tracking branch 'upstream/master'

commit ae17e3b
Author: Lollipop907 <34392880+Lollipop907@users.noreply.github.com>
Date:   Sat Jan 21 14:06:15 2023 +0800

    Add support for Rocktech MPC1903 (coolsnowwolf#10779)

    * Update Makefile

    Add Support For Rocktech MPC1903

    * Add support for Rocktech MPC1903

    * Add support for Rocktech MPC1903

    * Update armv8.mk

    * Add support for Rocktech MPC1903

    * Add support for Rocktech MPC1903

    * Update armv8.mk

    * Update rk3399-mpc1903.dts

    * Add support for Rocktech MPC1903

    * Update rk3399-mpc1903.dts

    * Add support for Rocktech MPC1903

    * Add support for Rocktech MPC1903

    * Update armv8.mk

    * Delete mpc1903.bootscript

    * Add rk3399-mpc1903.dts

    * Add support for Rocktech MPC1903

commit 2014b59
Author: fishg <1423545+fishg@users.noreply.github.com>
Date:   Fri Jan 20 21:29:38 2023 +0800

    hv: CONFIG_HYPERV_UTILS depends config fix (coolsnowwolf#10790)

commit 8630454
Merge: 51dd910 37c47e9
Author: Husky <1556047610@qq.com>
Date:   Fri Jan 20 13:11:01 2023 +0800

    Merge remote-tracking branch 'upstream/master'

commit 37c47e9
Author: lovehackintosh <92633080+lovehackintosh@users.noreply.github.com>
Date:   Thu Jan 19 14:03:33 2023 +0800

    kernel: bump to 5.4.229, 5.10.164, 5.15.89, 6.1.7 (coolsnowwolf#10785)

    * kernel: bump 5.15 to 5.15.89

    * kernel: bump 6.1 to 6.1.7

    * kernel: bump 5.4 to 5.4.229

    * kernel: bump 5.10 to 5.10.164

commit dd6c384
Author: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com>
Date:   Tue Dec 27 23:09:56 2022 +0800

    rockchip: increase default cma size to 64MB

commit 6ea630b
Author: Hugo Chen <ttcf15@163.com>
Date:   Wed Jan 18 12:10:39 2023 +0800

    Update openwrt-ci.yml (coolsnowwolf#10780)

    更新chechout 版本,解决action报nodejs错误
    更新apt安装组件,解决libgcc32的问题。

commit ec753a9
Author: Daniel Golle <daniel@makrotopia.org>
Date:   Mon Jan 16 19:40:24 2023 +0000

    kernel: fix kernel panic in mtk_ppe

    The patch that adds support for hw flow-offloading counters on newer
    MediaTek SoCs tries to prints acct->packets and acct->bytes in debugfs,
    without checking that acct isn't null. This causes a kernel panic when
    trying to read /sys/kernel/debug/ppe0/entries on older MediaTek SoCs.
    Fix this by adding a check for acct.

    Fixes: 9721a42 ("kernel: support hw flow-offloading counters on newer MediaTek SoCs")
    Reported-by: Stijn Tintel <stijn@linux-ipv6.be>
    Signed-off-by: Daniel Golle <daniel@makrotopia.org>

commit 2b13399
Author: Daniel Golle <daniel@makrotopia.org>
Date:   Mon Jan 16 21:02:00 2023 +0000

    mediatek: filogic: fix sysupgrade on MMC on the BPi-R3

    A previous attempt to simplify things went wrong and now sysupgrade
    is broken on this device. Fix that.

    Fixes: de94587 ("mediatek: filogic: don't rely on image preset in flash or sysupgrade")
    Signed-off-by: Daniel Golle <daniel@makrotopia.org>

commit 5578002
Author: Daniel Golle <daniel@makrotopia.org>
Date:   Mon Jan 16 21:00:41 2023 +0000

    mediatek: mt7622: fix sysupgrade on MMC on BPi-R64

    A previous attempt to simplify things went wrong and now sysupgrade
    is broken on this device. Fix that.

    Fixes: d640cba ("mediatek: mt7622: don't rely on existing image for sysupgrade")
    Signed-off-by: Daniel Golle <daniel@makrotopia.org>

commit 9c56a06
Author: Daniel Golle <daniel@makrotopia.org>
Date:   Sun Jan 1 21:19:50 2023 +0800

    uboot-mediatek: update to U-Boot 2023.01

    Support for MT7981 and MT7986 has been merged, remove patches.
    Tested on a couple of MT7986, MT7622 and MT7623 boards.
    MIPS builds are untested.

    Signed-off-by: Daniel Golle <daniel@makrotopia.org>

commit 760b266
Author: Linhui Liu <liulinhui36@gmail.com>
Date:   Thu Jan 12 18:10:02 2023 +0800

    tools/mkimage: update to 2023.01

    Remove upstreamed patches:
    - 020-tools-mtk_image-split-gfh-header-verification-into-a.patch
    - 021-tools-mtk_image-split-the-code-of-generating-NAND-he.patch
    - 022-tools-mtk_image-add-support-for-nand-headers-used-by.patch

    Signed-off-by: Linhui Liu <liulinhui36@gmail.com>

commit d783ca6
Author: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com>
Date:   Sat Mar 26 23:38:26 2022 +0800

    kmod-usb-net-smsc95xx: fix 6.1 dependency

    Fixes: coolsnowwolf#10773

commit faef3eb
Author: Petr Štetiar <ynezz@true.cz>
Date:   Mon Apr 11 17:39:23 2022 +0200

    kernel: usb-net-asix: fix 5.15 dependency

    Upstream in commit 34a1dee6bc44 ("net: usb: asix: ax88772: add generic
    selftest support") in version 5.14 added dependency on generic selftest
    functionality and armvirt/64 when compiled with ALL_KMODS=y reports following:

     Package kmod-usb-net-asix is missing dependencies for the following libraries:
     mdio_devres.ko
     selftests.ko

    Signed-off-by: Petr Štetiar <ynezz@true.cz>

commit d34a06c
Author: Petr Štetiar <ynezz@true.cz>
Date:   Mon Apr 11 18:36:20 2022 +0200

    kernel: netdevices: add generic selftests module

    Upstream in commit 3e1e58d64c3d ("net: add generic selftest support") in
    version 5.13 added generic selftests module and usb-net-asix already
    depends on it, in version 5.18 via commit 1710b52d7c13 ("net: usb:
    smsc95xx: add generic selftest support") it will be used by
    usb-net-smsc95xx as well.

    Signed-off-by: Petr Štetiar <ynezz@true.cz>
  • Loading branch information
solarflows committed Jan 26, 2023
1 parent b421132 commit 838c80b
Show file tree
Hide file tree
Showing 7 changed files with 318 additions and 0 deletions.
9 changes: 9 additions & 0 deletions target/linux/generic/files/drivers/net/phy/rtl8367b.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ struct rtl8367b_initval {
u16 val;
};

u32 rtl_device_id;

#define RTL8367B_MIB_RXB_ID 0 /* IfInOctets */
#define RTL8367B_MIB_TXB_ID 28 /* IfOutOctets */

Expand Down Expand Up @@ -612,6 +614,10 @@ static int rtl8367b_write_initvals(struct rtl8366_smi *smi,
int err;
int i;

if (rtl_device_id == 0x0020) {
return 0;
}

for (i = 0; i < count; i++)
REG_WR(smi, initvals[i].reg, initvals[i].val);

Expand Down Expand Up @@ -1540,7 +1546,10 @@ static int rtl8367b_detect(struct rtl8366_smi *smi)
return ret;
}

rtl_device_id = chip_ver;

switch (chip_ver) {
case 0x0020:
case 0x1000:
chip_name = "8367RB";
break;
Expand Down
235 changes: 235 additions & 0 deletions target/linux/ramips/dts/mt7620a_hiwifi_r33.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
#include "mt7620a.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
compatible = "hiwifi,r33", "ralink,mt7620a-soc";
model = "HiWiFi R33";

chosen {
bootargs = "console=ttyS0,115200";
};

aliases {
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
led-upgrade = &led_system;
};

nand {
status = "okay";
#address-cells = <1>;
#size-cells = <1>;
compatible = "mtk,mt7620-nand";

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

partition@0 {
label = "u-boot";
reg = <0x0 0x80000>;
read-only;
};

partition@80000 {
label = "debug";
reg = <0x80000 0x80000>;
read-only;
};

factory: partition@100000 {
label = "factory";
reg = <0x100000 0x40000>;
read-only;
};

partition@140000 {
label = "kernel";
reg = <0x140000 0x400000>;
};

ubiconcat0: partition@540000 {
label = "ubiconcat0";
reg = <0x540000 0x1c80000>;
};

partition@21c0000 {
label = "bdinfo";
reg = <0x21c0000 0x80000>;
read-only;
};

ubiconcat1: partition@2240000 {
label = "ubiconcat1";
reg = <0x2240000 0x5d40000>;
};
};
};

ubi-concat {
compatible = "mtd-concat";
devices = <&ubiconcat0 &ubiconcat1>;

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

partition@0 {
label = "ubi";
reg = <0x0 0x79c0000>;
};
};
};

leds {
compatible = "gpio-leds";

wlan5g {
label = "blue:wlan5g";
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy0tpt";
};

led_system: system {
label = "blue:system";
gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
};

turbo {
label = "blue:turbo";
gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
};

wlan2g {
label = "blue:wlan2g";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};

internet {
label = "blue:internet";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
};

keys {
compatible = "gpio-keys";

reset {
label = "reset";
gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_RESTART>;
};
};

gpio_export {
compatible = "gpio-export";
#size-cells = <0>;

usbpower {
gpio-export,name = "usbpower";
gpio-export,output = <0>;
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
};
};

rtl8367rb {
compatible = "realtek,rtl8367b", "rtl8367b";
cpu_port = <6>;
realtek,extif1 = <1 0 1 1 1 1 1 1 2>;
mii-bus = <&mdio0>;
};
};

//在最新的openwrt master分支中sysc已经被剔除,此处进行备份标记
// &sysc {
// ralink,gpiomux = "i2c", "jtag";
// ralink,uartmux = "gpio";
// ralink,wdtmux = <1>;
// };

&gpio3 {
status = "okay";
};

&ehci {
status = "okay";
};

&ohci {
status = "okay";
};

&pcie {
status = "okay";
};

&ethernet {
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;

//mtd-mac-address = <&factory 0x4>;

nvmem-cells = <&macaddr_factory_4>;
nvmem-cell-names = "mac-address";

port@5 {
status = "okay";
mediatek,fixed-link = <1000 1 1 1>;
phy-handle = <&phy5>;
phy-mode = "rgmii";
};

mdio0: mdio-bus {
status = "okay";

phy5: ethernet-phy@5 {
reg = <5>;
phy-mode = "rgmii";
};
};
};

//5G WIFI
&pcie0 {
wifi@0,0 {
compatible = "pci14c3,7662";
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
// nvmem-cells = <&macaddr_factory_4>;
// nvmem-cell-names = "mac-address";
// mac-address-increment = <2>;
};
};

//2.4G WIFI
&wmac {
pinctrl-names = "default";
pinctrl-0 = <&pa_pins>;
ralink,mtd-eeprom = <&factory 0x0>;
// nvmem-cells = <&macaddr_factory_4>;
// nvmem-cell-names = "mac-address";
};

&state_default {
gpio {
groups = "uartf", "wled";
function = "gpio";
};
};

&factory {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;

macaddr_factory_4: macaddr@4 {
reg = <0x4 0x6>;
};
};
22 changes: 22 additions & 0 deletions target/linux/ramips/image/mt7620.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1338,3 +1338,25 @@ define Device/zyxel_keenetic-viva
SUPPORTED_DEVICES += kng_rc
endef
TARGET_DEVICES += zyxel_keenetic-viva


define Device/hiwifi_r33
SOC := mt7620a
DEVICE_VENDOR := HiWiFi
DEVICE_MODEL := R33
DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport \
kmod-switch-rtl8366-smi kmod-switch-rtl8367b kmod-mt76x2
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_SIZE := 4096k
UBINIZE_OPTS := -E 5
IMAGE_SIZE := 32768k
IMAGES += kernel.bin rootfs.bin factory.bin
IMAGE/kernel.bin := append-kernel | check-size $$$$(KERNEL_SIZE)
IMAGE/rootfs.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
check-size
SUPPORTED_DEVICES += r33
endef
TARGET_DEVICES += hiwifi_r33
3 changes: 3 additions & 0 deletions target/linux/ramips/mt7620/base-files/etc/board.d/01_leds
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ hiwifi,hc5761)
hiwifi,hc5861)
ucidef_set_led_switch "internet" "internet" "blue:internet" "switch0" "0x20"
;;
hiwifi,r33)
ucidef_set_led_netdev "internet" "internet" "blue:internet" "eth0.2" "link tx rx"
;;
hnet,c108)
ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0"
ucidef_set_led_netdev "modem" "modem" "green:modem" "wwan0"
Expand Down
13 changes: 13 additions & 0 deletions target/linux/ramips/mt7620/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,13 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "5:wan" "6@eth0"
;;
hiwifi,r33)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
ucidef_add_switch_attr "switch0" "enable" "false"
ucidef_add_switch "switch1" \
"1:lan" "2:lan" "0:wan" "6@eth0"
;;
iodata,wn-ac1167gr|\
iodata,wn-ac733gr3|\
iptime,a1004ns)
Expand Down Expand Up @@ -336,6 +343,12 @@ ramips_setup_macs()
[ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
hiwifi,r33)
lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
label_mac=$lan_mac
[ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
iodata,wn-ac1167gr|\
iodata,wn-ac733gr3)
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[ "$ACTION" == "add" ] || exit 0

PHYNBR=${DEVPATH##*/phy}

[ -n $PHYNBR ] || exit 0

. /lib/functions.sh
. /lib/functions/system.sh

board=$(board_name)

case "$board" in
hiwifi,hc5661)
label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
[ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \
echo -n "$label_mac" > /sys${DEVPATH}/macaddress
;;
hiwifi,hc5761|\
hiwifi,hc5861)
label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
[ "$PHYNBR" = "1" ] && [ -n "$label_mac" ] && \
echo -n "$label_mac" > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \
macaddr_unsetbit "$label_mac" 6 > /sys${DEVPATH}/macaddress
;;
hiwifi,r33)
label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
[ "$PHYNBR" = "1" ] && [ -n "$label_mac" ] && \
echo -n "$label_mac" > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \
macaddr_unsetbit "$label_mac" 6 > /sys${DEVPATH}/macaddress
;;
esac
3 changes: 3 additions & 0 deletions target/linux/ramips/mt7620/base-files/lib/upgrade/platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ platform_do_upgrade() {
dd if=/dev/mtd0 bs=64 count=1 2>/dev/null | grep -qi breed && CI_KERNPART_EXT="kernel_stock"
nand_do_upgrade "$1"
;;
hiwifi,r33)
nand_do_upgrade "$1"
;;
*)
default_do_upgrade "$1"
;;
Expand Down

0 comments on commit 838c80b

Please sign in to comment.