Both drivers implement the phylink tx_lpi methods but never fill
phylink_config.lpi_interfaces, so phylink decides at creation time
that the MAC does not support EEE and locks userspace out of enabling
it. On mt753x that has been the state since the conversion to phylink
managed EEE; on mtk_eth_soc since EEE was added there, which was
already in managed form.
Both fixes are in net:
https://git.kernel.org/netdev/net/c/3c18e3c9a54ehttps://git.kernel.org/netdev/net/c/d876c9cb2d16
The mtk_eth_soc fix is taken as upstream applied it. The mt7530 one is
adapted: upstream guards the block with an extra priv->id != ID_EN7528
arm, and that symbol only exists once econet's local EN7528 patch adds
it, so the generic backport drops the arm and the patch header records
that. The mtk_eth_soc fix lands ahead of three patches that touch the
same part of mtk_add_mac and the same capability enum, so 737-10,
795-05 and the mt7987 platform patch are refreshed for it; 795-05 also
loses a declaration hunk that this fix makes redundant. Seven more
mtk_eth_soc patches (702, hack 730, 732-00, 732-03, 737-09, 738-01 and
795-04) are refreshed for hunk offsets only.
The mtk_eth_soc fix fills lpi_interfaces only on SoCs carrying a new
MTK_GMAC_EEE capability, and only MT7981 sets it: the LPI wake-up times
the driver programs are borrowed from MT7531 and have been measured on
MT7981 alone, so the other SoCs keep EEE unreachable until someone
confirms them.
The econet EN7528 patch is rebased on top of the mt7530 fix: both
rewrite the same block in mt753x_phylink_get_caps(), and generic
applies first, so the EN7528 guard now sits on the reworked condition.
The behavior for EN7528 is unchanged: its LPI capabilities stay empty
and phylink keeps EEE disabled there.
Tested on an MT7981B board with an MT7531 switch: ethtool sees EEE on
every port where it saw nothing before, enabling it negotiates EEE
against a partner that advertises it, and a port whose partner does
not advertise settles at "enabled - inactive".
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Link: https://github.com/openwrt/openwrt/pull/24863
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
econet carries this patch verbatim from airoha, where its MAINTAINERS
hunk header is right. Three econet patches that add nine lines to
MAINTAINERS apply before it, so the header has been off by that much
since the copy was made.
econet is source-only and therefore absent from the target list CI
builds its matrix from, so the per-target patch check never runs for it
and this stayed invisible.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Link: https://github.com/openwrt/openwrt/pull/25148
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
The LAN LEDs of the EN7528 boards are wired to the LED pins of the GPHYs
sitting behind the switch ports, but were described as plain GPIOs, so
they were left under software control and stayed dark.
Add the LED nodes to the GPHYs of the SoC .dtsi, mux the LED pins to the
matching phyN_ledM function of the pin controller, and replace the
gpio-leds nodes of the LAN LEDs with references to the PHY LEDs. The
LEDs are then driven by the PHY itself, without any CPU involvement.
The JioFiber boards have both LED pins of every GPHY wired up, giving a
bicolour LED per socket. The H660GM-A boards only have the LED1 pins
wired, as the LED0 pins are used as GPIOs for the other LEDs and for the
WPS button; the amber LEDs of the generic variant stay plain GPIOs.
Add board.d/01_leds to hook the LEDs up to the netdev trigger, which the
PHY driver offloads to the hardware.
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25098
Signed-off-by: Robert Marko <robimarko@gmail.com>
The EcoNet EN7528 embeds four Gigabit Ethernet PHYs (PHY ID 0x03a29491)
behind its built-in MT7530 switch. Without a driver of their own they
fall back to the generic PHY driver, which cannot drive the LED pins of
the PHYs.
Backport the upstream driver support and enable MEDIATEK_GE_SOC_PHY.
The PHYs use the same LED register layout as the other SoC PHYs handled
by that driver, but their LED controller powers up with its external
control disabled, so the driver enables it from config_init.
Backported from upstream commit
https://github.com/torvalds/linux/commit/b6e2649fff15a17689851b30e5415a3aae2b516e
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25098
Signed-off-by: Robert Marko <robimarko@gmail.com>
Backport the EN7528 pin controller, accepted upstream for v7.4:
pinctrl: airoha: limit GPIO interrupts to interrupt-capable pins
dt-bindings: pinctrl: Add EcoNet EN7528 pin controller
pinctrl: airoha: add support of en7528 SoC
The AN7563 driver from v7.3 comes along because the first of those
touches it, and a not yet upstream fix for the GPIO direction bits is
added on top. That one clears both bits of the two bit GPIO_CTRL field
instead of only the LSB, so a bootloader leaving the reserved value
behind no longer keeps the pin from driving.
Only GPIO0-GPIO15 are wired to the interrupt controller, and
gpiod_to_irq() now fails for the others rather than handing out an
interrupt that can never fire. Split the buttons accordingly: those
below GPIO16 become interrupt driven gpio-keys, the rest stay in a
gpio-keys-polled node.
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25013
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
The EN7528 pin controller support that follows needs the Airoha pinctrl
driver in its v7.3 shape: moved out of drivers/pinctrl/mediatek into its
own directory and split into shared code plus per-SoC drivers.
The airoha target already carries that whole chain for 6.18, so copy the
patches from there.
No functional change.
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25013
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
The JioFiber JCOW407 is an ISP provided GPON ONT and home router, based
on the EcoNet EN7528. The JCOW407-IN is the same board with a
second-source SPI NAND, Winbond W25M02G in place of the Micron
MT29F2G01, and is covered by the same image.
Both share their flash layout, MAC pool, WiFi EEPROM offsets, PCIe
topology, switch and USB with the JioFiber JCOW414 and reuse
en7528_jiofiber.dtsi. The LEDs and buttons are wired differently: the
RGB status LED is on GPIO 2/3/4 rather than 27/25/23, WPS is on GPIO 1
rather than GPIO 4, and the two colours of each LAN jack are swapped,
green on the odd pin and amber on the even one.
Specifications
==============
* SoC: EcoNet EN7528
* RAM: 512MiB DDR3
* Flash: 256MiB SPI NAND (Winbond W25M02G or Micron MT29F2G01)
* WiFi 2.4GHz: MT7603E 2T2R, on PCIe port 0
* WiFi 5GHz: MT7663 2T2R 802.11ac, on PCIe port 1
* Ethernet: 4x 10/100/1000
* LEDs: 1x RGB status (3 GPIOs), plus green and amber per LAN jack
* Buttons: Reset, WPS
* USB: 2x USB ports
* UART: 4-pin header, GND 3.3V RX TX, 115200 8n1
* Other: 1x FXS phone jack, 1 GPON port
Notes
=====
* OpenWrt has to live in the first image slot (tclinux). Which slot the
vendor firmware boots from varies between units. The bootloader
picks the slot from a single ASCII byte at flash offset 0x0DFC0000,
'0' selects tclinux and '1' selects tclinux_slave. If your device is
booting from the second slot, the flag has to be moved after flashing;
see "Switching slots" below.
* The green LAN LEDs are described but stay dark until pinctrl support
lands. This bootloader leaves GPIO 31/33/35/37 muxed to the GPHY LED
function, so writing the GPIO output has no effect. Muxing them back
to GPIO makes all four work as ordinary GPIOs. The amber LEDs are
unaffected, their pins come up in GPIO mode already, as do all eight
on the JCOW414.
* The rootfs is a UBI volume on an mtd-concat of tclinux_rootfs and the
7.25MiB region at 0x0D680000 that the vendor partition table does not
cover, giving 43.25MiB.
Installation
============
Both methods need serial console access. Power the device on, press a
key within one second to stop the bootloader, and log in with
telecomadmin / nE7jA%5m.
Booting an initramfs image over TFTP
------------------------------------
The bootloader runs a TFTP server that only validates the file name
after the transfer has finished, so any name other than tcboot.bin or
tclinux.bin lands in RAM without touching the flash.
1. Connect ethernet and give the PC the address 192.168.1.2
2. Upload the image:
tftp 192.168.1.1 -m binary -v -c put \
openwrt-econet-en7528-jiofiber_jcow407-initramfs-kernel.bin
The bootloader answers "Invalid filename, upload failed" after
reporting "start = 0x80020000". That is expected, the image is in
RAM at that point.
3. bldr> jump 80020000
Booting an initramfs image over XMODEM
--------------------------------------
1. Get the image length in hex:
printf '%X\n' "$(stat -c%s \
openwrt-econet-en7528-jiofiber_jcow407-initramfs-kernel.bin)"
2. bldr> xmdm 80020000 <file length hex>
3. Once "CCCC" appears, start the transfer from the terminal, e.g. with
picocom --send-cmd "lsx -vv" -b 115200 /dev/ttyUSB0 and ctrl+a ctrl+s
4. bldr> jump 80020000
Installing permanently
----------------------
1. Load openwrt-econet-en7528-jiofiber_jcow407-squashfs-tclinux.trx into
RAM with either method above
2. Write it to the first slot:
bldr> flash 80000 80020000 <file length hex>
3. Move the boot flag to the first slot as described below, then
power-cycle
Switching slots
---------------
From OpenWrt:
en75_chboot # show the active slot
en75_chboot openwrt # first slot, OpenWrt
en75_chboot factory # second slot, vendor
From the vendor firmware:
sys bootflag read # show the active slot
sys bootflag swap # switch to the other slot
From the bootloader, writing the byte directly:
bldr> memwl a1000000 30 # 30='0' tclinux, 31='1' tclinux_slave
bldr> memrl a1000000 # read it back to confirm the staged byte
bldr> flash dfc0000 a1000000 1
Power-cycle afterwards.
Reverting to stock is "en75_chboot factory" followed by a power cycle,
or the same bootloader sequence with 31 instead of 30.
MAC addresses
=============
MAC addresses are stored in the bootloader partition at offset 0x3fe48
and are assigned exactly as the vendor firmware assigns them:
offset 0 vendor WAN/PON
offset 1 LAN, br-lan and eth0
offset 2 WLAN 2.4GHz
offset 3 WLAN 5GHz
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24798
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The JioFiber JCOW414 is an ISP provided GPON ONT and home router, based
on the EcoNet EN7528.
The JioFiber JCO4032 is a different form factor built on the same
internals and is covered by the same image. Flash layout, bootloader
build, PCIe topology, WiFi EEPROM offsets, MAC pool, LEDs and USB were
all verified to be identical on both.
The parts that are common to every EN7528 board Jio ships live in
en7528_jiofiber.dtsi, leaving the board files to describe only their
LEDs and buttons.
Specifications
==============
* SoC: EcoNet EN7528
* RAM: 512MiB DDR3
* Flash: 256MiB SPI NAND (Micron MT29F2G01)
* WiFi 2.4GHz: MT7603E 2T2R, on PCIe port 0
* WiFi 5GHz: MT7663 2T2R 802.11ac, on PCIe port 1
* Ethernet: 4x 10/100/1000
* LEDs: 1x RGB status (3 GPIOs), plus green and amber per LAN jack
* Buttons: Reset, WPS
* USB: 2x USB ports
* UART: 4-pin header, GND TX RX 3.3V reading from the triangle marking
towards the PCB edge, 115200 8n1
* Other: 1x FXS phone jack, 1 GPON port
Notes
=====
* OpenWrt has to live in the first image slot (tclinux). Which slot the
vendor firmware boots from varies between units. The bootloader
picks the slot from a single ASCII byte at flash offset 0x0DFC0000,
'0' selects tclinux and '1' selects tclinux_slave. If your device is
booting from the second slot, the flag has to be moved after flashing;
see "Switching slots" below.
* The rootfs is a UBI volume on an mtd-concat of tclinux_rootfs and the
7.25MiB region at 0x0D680000 that the vendor partition table does not
cover, giving 43.25MiB.
Installation
============
Both methods need serial console access. Power the device on, press a
key within one second to stop the bootloader, and log in with
telecomadmin / nE7jA%5m.
Booting an initramfs image over TFTP
------------------------------------
The bootloader runs a TFTP server that only validates the file name
after the transfer has finished, so any name other than tcboot.bin or
tclinux.bin lands in RAM without touching the flash.
1. Connect ethernet and give the PC the address 192.168.1.2
2. Upload the image:
tftp 192.168.1.1 -m binary -v -c put \
openwrt-econet-en7528-jiofiber_jcow414-initramfs-kernel.bin
The bootloader answers "Invalid filename, upload failed" after
reporting "start = 0x80020000". That is expected, the image is in
RAM at that point.
3. bldr> jump 80020000
Booting an initramfs image over XMODEM
--------------------------------------
1. Get the image length in hex:
printf '%X\n' "$(stat -c%s \
openwrt-econet-en7528-jiofiber_jcow414-initramfs-kernel.bin)"
2. bldr> xmdm 80020000 <file length hex>
3. Once "CCCC" appears, start the transfer from the terminal, e.g. with
picocom --send-cmd "lsx -vv" -b 115200 /dev/ttyUSB0 and ctrl+a ctrl+s
4. bldr> jump 80020000
Installing permanently
----------------------
1. Load openwrt-econet-en7528-jiofiber_jcow414-squashfs-tclinux.trx into
RAM with either method above
2. Write it to the first slot:
bldr> flash 80000 80020000 <file length hex>
3. Move the boot flag to the first slot as described below, then
power-cycle
Switching slots
---------------
From OpenWrt:
en75_chboot # show the active slot
en75_chboot openwrt # first slot, OpenWrt
en75_chboot factory # second slot, vendor
From the vendor firmware:
sys bootflag read # show the active slot
sys bootflag swap # switch to the other slot
From the bootloader, writing the byte directly:
bldr> memwl a1000000 30 # 30='0' tclinux, 31='1' tclinux_slave
bldr> memrl a1000000 # read it back to confirm the staged byte
bldr> flash dfc0000 a1000000 1
Power-cycle afterwards.
Reverting to stock is "en75_chboot factory" followed by a power cycle,
or the same bootloader sequence with 31 instead of 30.
MAC addresses
=============
MAC addresses are stored in the bootloader partition at offset 0x3fe48
and are assigned exactly as the vendor firmware assigns them:
offset 0 vendor WAN/PON
offset 1 LAN, br-lan and eth0
offset 2 WLAN 2.4GHz
offset 3 WLAN 5GHz
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24798
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The tclinux TRX generator hardcodes the address that the bootloader
decompresses the kernel to, and TRX_MODEL is a plain global rather than
a per-device variable, so the last device to set it wins for every
device in the target. The free bootbase jump stub is also emitted as a
big endian instruction, which is wrong on little endian subtargets.
Add a --loadaddr option to tclinux-trx.sh, export TRX_MODEL and
TRX_LOADADDR per device and reset both in Device/Default, and pick the
jump stub encoding from CONFIG_BIG_ENDIAN. Behaviour is unchanged for
the existing devices.
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24798
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
EcoNet PCIe support has landed in upstream and should be tagged
into v7.3. This replaces the custom patch with the final version.
A fair amount of other patches have hit pcie-mediatek.c so
most of them were also backported with minimal tweaks.
Hopefully this should be easier to maintain, as the original
out-of-tree PCIe patch is most likely to bump up against new merge
conflicts in basically every kernel version.
Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/24504
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The HeYangTek HYF1GQ4UDACAE is a 1 Gbit (128 MiB) SLC SPI-NAND with
2048 + 64 byte pages and on-die 4-bit / 512-byte ECC (JEDEC ID 0xc9),
found among others on some Keenetic KN-3411 (Buddy 6) units.
The driver is accepted upstream and sits in the MTD tree heading for
Linux 7.3, so it goes to backport-6.18 as the upstream commit
a837468386 ("mtd: spinand: add support for HeYangTek HYF1GQ4UDACAE").
The Etron and Dosilicon spinand patches are refreshed because the
backport applies before them and touches the same spinand-objs line.
Other SPI-NAND patches in the MediaTek, Airoha, EcoNet and Qualcommax
targets are refreshed for the shifted core offsets.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Link: https://github.com/openwrt/openwrt/pull/23742
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The per-partition branch of w_init() tested econet,enable-remap on the parent
nand node (np) instead of the partition being iterated (part_np). That branch
only runs when np does not carry the property, so the test was always false and
the loop skipped every partition. As a result econet,enable-remap on a
partition node was a silent no-op: no partition ever registered a remap range,
and "enable-remap set for ..." was never printed.
Read the property from part_np so per-partition enable-remap works as
documented. Boards that place the property on a partition now register that
range; boards that place it on the nand node are unaffected.
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24399
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Move the DASAN H660GM-A root filesystem from a raw squashfs in the tclinux
partition to UBI, following the layout already used by the en751221
ChinaMobile GS3101.
tclinux is split into an explicit 4MB tclinux_kernel partition holding the
raw LZMA kernel and a tclinux_rootfs partition covering the remainder. The
latter is concatenated with the unused "unknown" partition into a single UBI
volume, giving 153MB on the Airtel variant and 41MB on the Generic one. The
two regions are not adjacent, so this needs mtd virtual concat, which is
enabled for the subtarget.
The TRX plus UBI image recipe is identical to the one the GS3101 uses, so
factor it out into a Device/tclinux-ubi template instead of duplicating it.
The .trx is written linearly into tclinux by the vendor installer, so an
oversized image would run past its end into tclinux_slave and destroy the
vendor firmware in the alternate slot. FACTORY_SIZE guards against this and
is set to the size of the partition the .trx is written into.
Existing installations have to be reflashed with the .trx rather than
sysupgraded, since the ubi MTD only appears once the new device tree is
running.
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24398
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The EN7528 integrates an MT7530 Gigabit switch, memory-mapped in the SoC
register space like the built-in switches of the MediaTek MT7988 and
Airoha EN7581/AN7583 SoCs. Its chip revision register reads 0x7530, so
unlike those three it is a genuine MT7530 core rather than an MT7531
derivative.
Until now the out-of-tree econet-eth driver programmed it as a flat
"dumb switch" that simply bridged the four LAN ports together and
exposed them as a single eth0. Hand it to the upstream mt7530 DSA
driver instead, so the ports come up as managed user ports lan1-lan4.
- Add an ID_EN7528 variant to the mt7530 driver, bound through the MMIO
glue with the "econet,en7528-switch" compatible. It reuses
mt7988_setup() and the indirect PHY accessors, but selects the CPU
port through the MT7530-style MFC register rather than the MT7531 CFC
one, and describes the CPU port as a fixed 1000FDX link to the SoC
MAC. The LAN GPHYs advertise EEE, but negotiating it drops frames
with some link partners, so the LPI capabilities are left empty and
phylink keeps EEE off.
- The frame engine and the switch are adjacent but separate blocks. The
ethernet node used to describe a single 64K window covering both,
which overlaps the switch node and makes the two drivers fight over
the region. Size it to the frame engine alone (0x8000) and give the
switch its own node, so both keep an exclusive claim:
1fb50000-1fb57fff : 1fb50000.ethernet
1fb58000-1fb5ffff : 1fb58000.switch
The GSW reset moves to the switch node with it.
- econet-eth acts as the DSA conduit. It derives from the size of its
own register resource whether the window still covers the switch, and
when it does not, skips the dumb-switch setup and the switch
source-MAC write. The econet-eth driver now carries this support, so
bump PKG_SOURCE_VERSION to pull it in. EN751221 and EN751627 keep
the full window and are unaffected.
- Enable the switch on the DASAN H660GM-A. The two variants share a
board, but their sockets are not numbered the same way: LAN1 is
switch port 1 on the Airtel unit and port 4 on the generic one, so
the port labels are assigned per board .dts.
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24199
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The ChinaMobile GS3101 has:
256MB RAM
256MB flash (TC58CVG1S3H)
1x MT7603 802.11 b/g/n - DISABLED
1x optical port
On-die MT7530 switch with:
- 1x gigabit ethernet port
- 3x 100Mb ethernet ports
1x USB 2.0 port
1x telephone VoIP port
3 controllable LEDs
1 GPIO button (reset), 1 WPS button (not detected in GPIOs)
UART header inside (solder required) 115200 baud
12v power (5.5mm x 2.1mm barrel connector)
Installation instructions: You will need a USB stick
1. Reformat the USB stick as VFAT with MBR partition table. This is important,
if it is GPT then it will silently fail to load.
2. Download openwrt-econet-en751221-chinamobile_gs3101-squashfs-tclinux.trx and
store it in the USB stick.
3. Start the device with the vendor OS
4. Connect a cable and request an IP address - it will issue in 192.168.1.0/24
5. Use telnet to connect to the modem on 192.168.1.1
6. Login as root@2024 / system
7. Plugin the USB stick
8. cp /mnt/usb1_1/openwrt-econet-en751221-chinamobile_gs3101-squashfs-tclinux.trx /tmp/openwrt.trx
9. mtd -r -f write /tmp/openwrt.trx tclinux
10. You will lose your shell, look at the power light on the device, it should
begin blinking and then go back to solid. You should NOT see any red light.
11. re-request an IP address
12. ssh root@192.168.1.1
13. You should be on OpenWrt now
MAC address matches that of vendor OS but it is not the address on the label
of the device. It is in a compressed xml file in the 'romfile' partition.
WAN is this mac, LAN is mac+1 and 2.4Ghz WLAN is mac+2, there is no 5Ghz WLAN.
Wifi Note: Of the devices tested, there were numerous upon which starting the
wlan chip caused the CPU to hang. In the interest of avoiding bricked boards,
the wlan is disabled in the DT.
Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/23533
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The TRX header contains a checksum of the full kernel and rootfs length. Vendor
OS uses a raw squashfs on the NAND and relies on the BMT to resolve bad block
issues. OpenWrt typically uses UBI on NAND and places the root squashfs inside
of that. Since UBI changes over time, checksumming over it would cause a boot
failure later on. However, vendor TRX installers typically the entire file as
uploaded, without regard for the declared kernel and rootfs lengths.
Make --rootfs optional so that a UBI rootfs can be appended but excluded from
the checksum.
Secondly, this script previously prepended padding to the rootfs in order to
move the beginning of the rootfs 4MB away from the TRX header (the max kernel
size). That prepended padding was included in the rootfs length/checksum.
There is a bug https://econet-linux.pkt.wiki/en/bootloader#a-length-bug in some
versions of the bootloader which causes the bootloader to always use the length
of the first kernel, even if it is booting the second. The impact of this is if
the second slot kernel is larger than the first, it will fail to boot. Smaller
is okay because LZMA will stop when it is done.
Move padding from rootfs to kernel and include it in the length/checksum of the
kernel so that the kernel will always register as being 4MB-minus-TRX-header in
length. Therefore if A/B upgrading is used in the future, this bug will not
occur even if an upgrade with a larger kernel is installed into slot B.
Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/23533
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The EN751221 clock/reset bindings and driver, along with the PCI bridge
window fix, have all been accepted upstream. Replace the downstream
patches with the exact versions merged upstream and add the kernel
version tag:
910: dt-bindings: clock, reset: Add econet EN751221 (v7.1, 35af99f7482673)
911: clk: airoha: Add econet EN751221 clock/reset support (v7.1, d8b034525fd954)
913: PCI: Prevent assignment to unsupported bridge windows (v7.1, 92427ab4378faa)
Refresh the patches as a result.
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23879
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Fix patch compatibility for kernel 6.18 on econet and refresh with
`make target/linux/refresh V=s`. The shared airoha clk/spi/uart and the
econet-local timer, nand and phy patches are rebased onto the 6.18
upstream code.
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23755
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
The EN751627 EcoNet subtarget consists of the EN7516 DSL SoC and the
(rare) EN7527 xPON SoC.
We currently support pci / wifi, usb and flash, but the EN751221 eth
driver is not portable to this family right now.
Zyxel EX3301-T0 is a wifi router based on the EN7516, it is a DSL SoC
but lacks the DSL port.
Installation instructions:
1. Serial access is required, stop the Zyxel bootloader.
2. Use ATENv3 https://github.com/cjdelisle/ATENv3 to unlock bootloader
3. "ATLD x" on the prompt to start a TFTP server
4. Connect ethernet cable from any lan (yellow) port on modem to a
device.
5. On your device, configure network to 192.168.1.2/30
6. On your device, send TRX file to 192.168.1.1 with name x, i.e.
tftp -p -l ./econet/tclinux -r x 192.168.1.1
7. On modem, you should see a line like this:
"Total 8022324 (0x7A6934) bytes received" note the hex value
8. "ATGU" to enter econet bootloader
9. "flash 80000 80020000 <the hex number without 0x>"
For example: flash 80000 80020000 7A6934
10. "reboot 1" -- start the system
If it boots back into the factory OS, you need to switch OS, from the
ZHAL prompt:
1. "ATCB" -- load data from flash
2. "ATCF 0" -- switch to OS 0
3. "ATBT 1" -- enable flash write
4. "ATSB" -- save data
5. "ATSR 1" -- reboot system
Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/22945
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This patch adds support for Huawei HG2821T-U, EPON ONU and home router,
often comes with ISP service.
Specifications
==============
* SoC: Econet EN7526GT
* RAM: 512MiB DDR3L (MT41K256M16TW-107)
* Flash: 256MiB SPI NAND (TC58CVG1S3HRAIG)
* WiFi 2.4GHz: MT7592N
* WiFi 5GHz: MT7612EN
* Ethernet: builtin switch
* LED: Power, Internet, WiFi, USB
* Buttons: Reset
* UART: Serial console (115200 8n1)
* USB: 1 x USB2
* Other: Phone jack, XPON fiber port
!!! BACKUP YOUR ROM !!!
=======================
Please always have your FULL flash image backup before flashing
anything. The vendor firmware varies a lot depending on your ISP and
location. You will have a hard time finding the right regional firmware
if you don't have a backup.
Notes
=====
* Due to the target `econet` being incomplete, WiFi, DSA switch, and
many other features are not supported yet. Do not flash the image unless
you know the consquences or `econet` is declared stable.
* This device, and apparently many other devices of this platform, use
a dual-image layout. OpenWRT (with `econet` target) only uses slot A.
Slot B is not used by OpenWRT, and is applicable for dual-booting to
vendor firmware.
* If you do not use vendor firmware anymore, you can erase and reuse
anything after `configuration_b`, which gives you ~110 MiB free space.
Again, backup your flash first.
Installation
============
Within shell
------------
Note that acquiring the shell access to the vendor firmware can be a bit
tricky depending on the firmware variation. If you can't play with the
vendor firmware, boot to OpenWrt using debricking method below.
0. (Optional) Back up your flash, and / or move the vendor firmware to
slot B
1. Build and then locate the `kernel.bin` and `rootfs.bin` image files
2. Upload `kernel.bin` and `rootfs.bin` to the device (via HTTP or USB
stick), then type:
```
mtd write -f -e KernelA kernel.bin KernelA
mtd erase RootfsA
mtd write -f -r -e AppA rootfs.bin AppA
```
From bootloader
---------------
1. Build and then locate the `kernel.bin` and `rootfs.bin` image files
2. Switch device on and press a key within 3 seconds
3. Upload `kernel.bin` via TFTP as described below
4. Once the transfer has completed successfully, bootloader will give
you the file length in "Total %d (0x%X) bytes received", then type
`flash 200000 80020000 <file length hex>`
5. Upload `rootfs.bin` then flash with
`flash 600000 80020000 <file length hex>`
6. Restart the device to boot into OpenWRT
> [!IMPORTANT]
> Do not try `httpd` in the bootloader. It writes to the wrong address
and will corrupt the flash.
Debricking
==========
1. Build and then locate the `initramfs-kernel.bin` image files
2. Switch device on and press a key within 3 seconds
3. Connect to device via ethernet, set the IP address to `192.168.1.X`,
then upload the image via TFTP
`tftp 192.168.1.1 -m binary -v -c put initramfs-kernel.bin`
The file name can be anything except `tcboot.bin` or `tclinux.bin`,
they will corrupt the flash.
4. Type `jump 80020000` to boot the kernel from memory
Dual boot
=========
Use `en75_chboot` tool to switch between vendor firmware and OpenWrt. If
you are soft-locked, you can also switch the flag in the bootloader:
1. Switch device on and press a key within 3 seconds
2. Select the kernel that you wish to use:
- `memwl 80020000 30ffffff` for `KernelA` (OpenWrt)
- `memwl 80020000 31ffffff` for `KernelB` (Factory)
3. Select the rootfs, which should be the same as the kernel:
- `memwl 80020004 30ffffff` for `RootfsA` (OpenWrt)
- `memwl 80020004 31ffffff` for `RootfsB` (Factory)
3. Commit the data to flash: `flash 1e0000 80020000 8`
4. Restart the device to boot into the selected OS
MAC addresses
=============
`//configuration_a/factory.conf` contains MAC addresses, along with
other pre-configured settings. OpenWrt uses `brmac`, `internetmac`,
`APMAC`, and `APMAC_5G`, while `tr069mac`, `voipmac`, `priprotocolmac`,
and `PONMac` are not used for now.
Signed-off-by: David Yang <mmyangfl@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23131
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Extend the EN7528 PCIe driver to EN751221 with a specific PHY
tuning ritual. Also enable wifi drivers on SmartFiber XP8421-B,
TpLink Archer VR1200V v2 and Zyxel PMG5617GA.
Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/22208
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Add USB host support for EN7528 SoC:
- New phy-en7528-usb driver with U2 slew rate calibration and U3
RX impedance tuning, based on GPL vendor code and the Airoha
AN7581 USB PHY driver
- xHCI LTSSM timing quirk for TD 6.5 compliance (patch 915)
- USB PHY and xHCI DTS nodes with IPPC register mapping
- VBUS power via regulator-fixed for DASAN H660GM-A
- Enable USB, xHCI, PHY, and regulator kernel configs
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22498
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The 2.4 GHz and 5 GHz WiFi eeprom cell references were assigned to the
wrong PCIe slots. Swap them so slot0 (2.4 GHz) uses the eeprom at
0x1c0000 and slot1 (5 GHz) uses the eeprom at 0x40000. Fix the eeprom
cell lengths to match the sizes expected by their respective drivers.
Fixes: be24a13ad5 ("econet: en7528: add PCIe and WiFi support")
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22195
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The DASAN H660GM-A GPON ONT exists in two hardware variants, one
distributed by ISPs and one sold directly by the manufacturer [1].
Split the single DTS into a shared dtsi and per-variant DTS files
with the correct GPIO mappings, flash layout, and LED definitions.
Variant comparison:
Feature | Airtel | Generic
---------------+---------------------------+-------------------------
Supplied by | Airtel Xstream Fiber | Retail
Flash | Micron MT29F2G01ABAGD | Micron MT29F1G01ABAFD
| 256 MB | 128 MB
Known P/N | DPW-G-P-66GMAZ-A3 | DPW:G-P-660GMAY-G0
| (some units unlabelled) | DPW:G-P-660GMAY-G3
WPS LED | Yes | No
WLAN button | No | Yes
USB LED | No | Yes
LAN LEDs | Green only | Green + Amber
[1] https://dasanns.com/en/solution/detail.php?mode=view&cat_no=32&offset=&idx=122
Tested-by: Arif Rahman Hakim <arif2785id@gmail.com>
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22095
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Add PCIe controller and PHY support for EN7528 SoC. This includes
a new PCIe PHY driver, EN7528-specific startup in the MediaTek PCIe
controller, and a fix for bogus prefetch window reads on bridges
that do not implement the registers.
Enable WiFi for the DASAN H660GM-A board with MT7603 (2.4 GHz) and
MT7615/MT7663 (5 GHz).
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21326
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>