Re: [iwinfo PATCH 1/2] iwinfo: add support for indoor only chan restriction

2021-11-20 Thread Ansuel Smith
>
> Hi Ansuel,
>
> below are a few comments from someone (me) who is not very familiar
> with the whole topic. So please keep this in mind.
>
> On Thu, Nov 18, 2021 at 5:42 PM Ansuel Smith  wrote:
> >
> > Some country permit a specific channel to be used only indoor.
> country -> countries
> indoor -> indoors
>
> > Introduce a new restriction_flags entry to declare different restrition
> restrition -> restrictions
>
> [...]
> > +   if 
> > (freqs[NL80211_FREQUENCY_ATTR_INDOOR_ONLY])
> > +   e->restricted_flags |= 
> > IWINFO_FREQ_NO_OUTDOOR;
> Is there a reason why _INDOOR_ONLY has to be translated to _NO_OUTDOOR?
> Or in other words: why not simply IWINFO_FREQ_INDOOR_ONLY
>

It seems more descriptive to declare and i think in a normal freq list it
is declared as no outdoor instead of indoor only.

>
> Best regards,
> Martin

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 1/4] realtek: fix RTL8231 gpio count

2021-11-20 Thread Sander Vanheule
The RTL8231's gpio_chip.ngpio was set to 36, which is the largest valid
GPIO index. Fix the allowed number of GPIOs by setting ngpio to 37, the
actual line count.

Reported-by: INAGAKI Hiroshi 
Signed-off-by: Sander Vanheule 
---
 target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c 
b/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c
index f4f5621e0c1b..f06c2d81df79 100644
--- a/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c
+++ b/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c
@@ -312,7 +312,7 @@ static int rtl8231_gpio_probe(struct platform_device *pdev)
 
gpios->dev = dev;
gpios->gc.base = 160;
-   gpios->gc.ngpio = 36;
+   gpios->gc.ngpio = 37;
gpios->gc.label = "rtl8231";
gpios->gc.parent = dev;
gpios->gc.owner = THIS_MODULE;
-- 
2.33.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 3/4] realtek: always require SMI bus ID for RTL8231

2021-11-20 Thread Sander Vanheule
The SMI bus ID for RTL8231 currently defaults to 0, and can be
overridden from the devicetree. However, there is no value check on the
DT-provided value, aside from masking which would only cause value
wrap-around.

Change the driver to always require the "indirect-access-bus-id"
property, as there is no real reason to use 0 as default, and perform a
sanity check on the value when probing. This allows the other parts of
the driver to be simplified a bit.

Signed-off-by: Sander Vanheule 
---
 .../files-5.10/drivers/gpio/gpio-rtl8231.c| 33 +--
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c 
b/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c
index 013dc238389b..d7643083da46 100644
--- a/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c
+++ b/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c
@@ -14,11 +14,13 @@
 
 #define USEC_TIMEOUT 5000
 
+#define RTL8231_SMI_BUS_ID_MAX 0x1F
+
 struct rtl8231_gpios {
struct gpio_chip gc;
struct device *dev;
u32 id;
-   int smi_bus_id;
+   u32 smi_bus_id;
u16 reg_shadow[0x20];
u32 reg_cached;
int ext_gpio_indrt_access;
@@ -30,13 +32,11 @@ extern struct rtl83xx_soc_info soc_info;
 static u32 rtl8231_read(struct rtl8231_gpios *gpios, u32 reg)
 {
u32 t = 0, n = 0;
-   u8 bus_id = gpios->smi_bus_id;
 
reg &= 0x1f;
-   bus_id &= 0x1f;
 
/* Calculate read register address */
-   t = (bus_id << 2) | (reg << 7);
+   t = (gpios->smi_bus_id << 2) | (reg << 7);
 
/* Set execution bit: cleared when operation completed */
t |= 1;
@@ -52,7 +52,8 @@ static u32 rtl8231_read(struct rtl8231_gpios *gpios, u32 reg)
if (n >= USEC_TIMEOUT)
return 0x8000;

-   pr_debug("%s: %x, %x, %x\n", __func__, bus_id, reg, (t & 0x) >> 
16);
+   pr_debug("%s: %x, %x, %x\n", __func__, gpios->smi_bus_id,
+   reg, (t & 0x) >> 16);
 
return (t & 0x) >> 16;
 }
@@ -60,13 +61,11 @@ static u32 rtl8231_read(struct rtl8231_gpios *gpios, u32 
reg)
 static int rtl8231_write(struct rtl8231_gpios *gpios, u32 reg, u32 data)
 {
u32 t = 0, n = 0;
-   u8 bus_id = gpios->smi_bus_id;
 
-   pr_debug("%s: %x, %x, %x\n", __func__, bus_id, reg, data);
+   pr_debug("%s: %x, %x, %x\n", __func__, gpios->smi_bus_id, reg, data);
reg &= 0x1f;
-   bus_id &= 0x1f;
 
-   t = (bus_id << 2) | (reg << 7) | (data << 16);
+   t = (gpios->smi_bus_id << 2) | (reg << 7) | (data << 16);
/* Set write bit */
t |= 2;
 
@@ -278,7 +277,6 @@ static int rtl8231_gpio_probe(struct platform_device *pdev)
struct device_node *np = dev->of_node;
struct rtl8231_gpios *gpios;
int err;
-   u32 indirect_bus_id;
 
pr_info("Probing RTL8231 GPIOs\n");
 
@@ -300,13 +298,14 @@ static int rtl8231_gpio_probe(struct platform_device 
*pdev)
gpios->ext_gpio_indrt_access = RTL839X_EXT_GPIO_INDRT_ACCESS;
}
 
-   /*
-* We use a default MDIO bus ID for the 8231 of 0, which can be 
overriden
-* by the indirect-access-bus-id property in the dts.
-*/
-   gpios->smi_bus_id = 0;
-   of_property_read_u32(np, "indirect-access-bus-id", _bus_id);
-   gpios->smi_bus_id = indirect_bus_id;
+   err = of_property_read_u32(np, "indirect-access-bus-id", 
>smi_bus_id);
+   if (!err && gpios->smi_bus_id > RTL8231_SMI_BUS_ID_MAX)
+   err = -EINVAL;
+
+   if (err) {
+   dev_err(dev, "invalid or missing indirect-access-bus-id\n");
+   return err;
+   }
 
rtl8231_init(gpios);
 
-- 
2.33.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 4/4] realtek: add RTL8231 chip detection

2021-11-20 Thread Sander Vanheule
When initialising the driver, check if the RTL8231 chip is actually
present at the specified address. If the READY_CODE value does not match
the expected value, return -ENXIO to fail probing.

This should help users to figure out which address an RTL8231 is
configured to use, if measuring pull-up/-down resistors is not an
option.

On an unsuccesful probe, the driver will log:
[0.795364] Probing RTL8231 GPIOs
[0.798978] rtl8231_init called, MDIO bus ID: 30
[0.804194] rtl8231-gpio rtl8231-gpio: no device found at bus address 30

When a device is found, only the first two lines will be logged:
[0.453698] Probing RTL8231 GPIOs
[0.457312] rtl8231_init called, MDIO bus ID: 31

Signed-off-by: Sander Vanheule 
---
 .../files-5.10/drivers/gpio/gpio-rtl8231.c| 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c 
b/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c
index d7643083da46..7a1d6aa136ad 100644
--- a/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c
+++ b/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c
@@ -8,6 +8,9 @@
 
 /* RTL8231 registers for LED control */
 #define RTL8231_LED_FUNC0  0x
+#define RTL8231_LED_FUNC1  0x0001
+#define RTL8231_READY_MASK 0x03f0
+#define RTL8231_READY_VALUE0x0370
 #define RTL8231_GPIO_PIN_SEL(gpio) ((0x0002) + ((gpio) >> 4))
 #define RTL8231_GPIO_DIR(gpio) ((0x0005) + ((gpio) >> 4))
 #define RTL8231_GPIO_DATA(gpio)((0x001C) + ((gpio) >> 
4))
@@ -238,6 +241,8 @@ void rtl8231_gpio_set(struct gpio_chip *gc, unsigned int 
offset, int value)
 
 int rtl8231_init(struct rtl8231_gpios *gpios)
 {
+   u32 ret;
+
pr_info("%s called, MDIO bus ID: %d\n", __func__, gpios->smi_bus_id);
 
gpios->reg_cached = 0;
@@ -251,6 +256,10 @@ int rtl8231_init(struct rtl8231_gpios *gpios)
sw_w32_mask(3, 1, RTL838X_DMY_REG5);
}
 
+   ret = rtl8231_read(gpios, RTL8231_LED_FUNC1);
+   if ((ret & 0x8000) || ((ret & RTL8231_READY_MASK) != 
RTL8231_READY_VALUE))
+   return -ENXIO;
+
/* Select GPIO functionality and force input direction for pins 0-36 */
rtl8231_write(gpios, RTL8231_GPIO_PIN_SEL(0), 0x);
rtl8231_write(gpios, RTL8231_GPIO_DIR(0), 0x);
@@ -307,7 +316,11 @@ static int rtl8231_gpio_probe(struct platform_device *pdev)
return err;
}
 
-   rtl8231_init(gpios);
+   err = rtl8231_init(gpios);
+   if (err) {
+   dev_err(dev, "no device found at bus address %d\n", 
gpios->smi_bus_id);
+   return err;
+   }
 
gpios->dev = dev;
gpios->gc.base = -1;
-- 
2.33.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 2/4] realtek: use automatic GPIO numbering for RTL8231

2021-11-20 Thread Sander Vanheule
Set the gpio_chip.base to -1 to use automatic GPIO line indexing.
Setting base to 0 or a positive number is deprecated and should not be
used.

Signed-off-by: Sander Vanheule 
---
 target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c 
b/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c
index f06c2d81df79..013dc238389b 100644
--- a/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c
+++ b/target/linux/realtek/files-5.10/drivers/gpio/gpio-rtl8231.c
@@ -311,7 +311,7 @@ static int rtl8231_gpio_probe(struct platform_device *pdev)
rtl8231_init(gpios);
 
gpios->dev = dev;
-   gpios->gc.base = 160;
+   gpios->gc.base = -1;
gpios->gc.ngpio = 37;
gpios->gc.label = "rtl8231";
gpios->gc.parent = dev;
-- 
2.33.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 0/4] realtek: RTL8231 refinements

2021-11-20 Thread Sander Vanheule
The RTL8231 driver is currently not setting the maximum number of GPIOs
correctly, so this needs to be fixed. [1/4]

While we're at it, add some other small improvements to the driver:
- Use automatic gpio base numbering [2/4]
- Require the SMI bus ID to be specified in the devicetree [3/4]
- Verify chip presence when probing, and fail if it cannot be found [4/4]

Main changes since v1:
- Add chip detection patch

These patches were tested on my GS110TPP.

Sander Vanheule (4):
  realtek: fix RTL8231 gpio count
  realtek: use automatic GPIO numbering for RTL8231
  realtek: always require SMI bus ID for RTL8231
  realtek: add RTL8231 chip detection

 .../files-5.10/drivers/gpio/gpio-rtl8231.c| 52 ---
 1 file changed, 32 insertions(+), 20 deletions(-)

-- 
2.33.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[openwrt] Patch notification: 1 patch updated

2021-11-20 Thread Patchwork
Hello,

The following patch (submitted by you) has been updated in Patchwork:

 * openwrt: archs38: update kernel version to 5.10
 - 
http://patchwork.ozlabs.org/project/openwrt/patch/mailman.11468.1635857123.1923571.openwrt-de...@lists.openwrt.org/
 - for: OpenWrt development
was: New
now: Accepted

This email is a notification only - you do not need to respond.

Happy patchworking.

--

This is an automated mail sent by the Patchwork system at
patchwork.ozlabs.org. To stop receiving these notifications, edit
your mail settings at:
  http://patchwork.ozlabs.org/mail/

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH 3/3] realtek: add support for Panasonic Switch-M8eG PN28080K

2021-11-20 Thread INAGAKI Hiroshi

Hi Sander,

On 2021/11/14 17:52, Sander Vanheule wrote:

Hi Hiroshi,

On Sun, 2021-11-14 at 14:32 +0900, INAGAKI Hiroshi wrote:

Hi Sander,

Thank you for your review.

On 2021/11/13 7:46, Sander Vanheule wrote:

Hi Hiroshi,

On Sun, 2021-10-03 at 15:53 +0900, INAGAKI Hiroshi wrote:

Panasonic M8eG PN28080K is a 8 + 1 port gigabit switch, based on
RTL8380M.

Specification:

- SoC   : Realtek RTL8380M
- RAM   : DDR3 128 MiB (Winbond W631GG8KB-15)
- Flash : SPI-NOR 32 MiB (Macronix MX25L25635FMI-10G)
- Ethernet  : 10/100/1000 Mbps x8 + 1
    - port 1-8: TP, RTL8218B (SoC)
    - port 9  : SFP, RTL8380M (SoC)
- LEDs/Keys : 7x / 1x
- UART  : RS-232 port on the front panel (connector: RJ-45)
    - 3:TX, 4:GND, 5:GND, 6:RX (pin number: RJ-45)
    - 9600n8
- Power : 100-240 VAC, 50/60 Hz, 0.5 A
    - Plug: IEC 60320-C13
- Stock OS  : VxWorks based

Flash instruction using initramfs image:

Looks quite convoluted. Kudos on working this out!

Thank you!


1.  Prepare the TFTP server with the IP address 192.168.1.111
2.  Rename the OpenWrt initramfs image to "0101A8C0.img" and place it to
  the TFTP directory
3.  Download the official upgrading firmware (ex: pn28080k_v3.rom)
  and place it to the TFTP directory
4.  Boot M8eG and interrupt the U-Boot with Ctrl + C keys
5.  Execute the following commands and boot with the OpenWrt initramfs
  image

  rtk network on
  tftpboot 0x8100
  bootm

6.  Backup mtdblock files to the computer by scp or anything and reboot
7.  Interrupt the U-Boot and execute the following commands to re-create
  filesystem in the flash

  ffsmount c:/
  ffsfmt c:/

  this step takes a long time, about ~ 4 mins

8.  Execute the following commands to put the official images to the
  filesystem

  updatert 

  example:

    updatert pn28080k_v3.rom

  this step takes about ~ 40 secs

9.  Set the environment variables of the U-Boot by the following commands

  setenv loadaddr 0xb4e0
  setenv bootcmd bootm
  saveenv

10: Download the OpenWrt initramfs image and boot with it

  tftpboot 0x8100 0101A8C0.img
  bootm

11: On the initramfs image, download the sysupgrade image and perform
  sysupgrade with it

  sysupgrade 

12: Wait ~ 120 seconds to complete flashing

Note:

- "Switch-M8eG" is a model name, and "PN28080K" is a model number.
    Switch-M8eG has an another (old) model number ("PN28080"), it's not a
    Realtek based hardware.

- Switch-M8eG has a "POWER" LED (Green), but it's not connected to any
    GPIO pin.

- The U-Boot checks the runtime images in the flash when booting and
    fails to execute anything in "bootcmd" variable if the images are not
    exsisting.

- A filesystem is formed in the flash (0x10-0x1DF) on the stock
    firmware and it includes the stock images, configuration files and
    checksum files. It's unknown format, can't be managed on the OpenWrt.
    To get the enough space for OpenWrt, move the filesystem to the head
    of "fs_reserved" partition by execution of "ffsfmt" and "updatert".

Back to the stock firmware:

1. Delete "loadaddr" variable and set "bootcmd" to the original value

     on U-Boot:

   setenv loadaddr
   setenv bootcmd 'bootm 0x8100'

     on OpenWrt:

   fw_setenv loadaddr
   fw_setenv bootcmd 'bootm 0x8100'

2. Perform reset or reboot

    on U-Boot:

  reset

    on OpenWrt:

  reboot

Signed-off-by: INAGAKI Hiroshi 
---

[...]


diff --git a/target/linux/realtek/dts-5.10/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi
b/target/linux/realtek/dts-5.10/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi
new file mode 100644
index 00..d41213f1fd
--- /dev/null
+++ b/target/linux/realtek/dts-5.10/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi
@@ -0,0 +1,216 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include 
+#include 
+
+/ {
+   chosen {
+   bootargs = "console=ttyS0,9600";
+   };
+
+   memory@0 {
+   device_type = "memory";
+   reg = <0x0 0x800>;
+   };
+
+   leds: leds {
+   compatible = "gpio-leds";
+
+   any_collision {
+   label = "amber:any_col";

Should we start using 'function' and 'color' on 5.10 instead of (or in addition 
to)
'label'? The functions are non-standard, but the #DEFINE-s in led-common.h are 
only
strings anyway.

As you said in your additional email, the replacement breaks led-*
aliases.
I think it's possible to add "color"/"function" properties as a
preparation without replacement.


I'll add "color"/"function" properties in v2 patch[1].

[1]: 
https://github.com/musashino-build/openwrt/commit/f5f4667a51780d962f792ed5f02d9a68243c58e3



Speaking of following the dt-bindings... I'm aware that you've already 
discussed the
node
names with Adrian, but leds-gpio.yaml currently specifies that child node names 
shall

Re: [PATCH 2/5] mac80211: add patch for BCM43436 firmware

2021-11-20 Thread Stijn Tintel
On 20/11/2021 15:10, Rafał Miłecki wrote:
> On 20.11.2021 04:41, Stijn Tintel wrote:
>> This chip is used in the Raspberry Pi Zero 2.
>>
>> Signed-off-by: Stijn Tintel 
>
> This trivial patch could easily be upstreamed, please send it to
> linux-wireless@.

This is pointless without the firmware being available in
linux-firmware.git. Since I can't submit that firmware, I rather not
submit this patch either.

Stijn


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH 2/5] mac80211: add patch for BCM43436 firmware

2021-11-20 Thread Rafał Miłecki

On 20.11.2021 04:41, Stijn Tintel wrote:

This chip is used in the Raspberry Pi Zero 2.

Signed-off-by: Stijn Tintel 


This trivial patch could easily be upstreamed, please send it to
linux-wireless@.

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 0/2] Add support for TP-Link EAP225 v1

2021-11-20 Thread Sander Vanheule
This series adds support for the (not so popular) EAP225v1 2x2 802.11ac Wave-1
access point. This device is almost identical to the EAP245v1 from commit
b11ad4876440 ("ath79: support for TP-Link EAP245 v1"), with the main difference
being the 5GHz radio.

Support was requested by a few forum users, although only one came back to
inform me they were succesful in flashing OpenWrt.

Changes in v2:
- Split patch in two for the firmware-utils and openwrt repositories

-- 
2.33.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[PATCH v2 2/2] ath79: add support for TP-Link EAP225 v1

2021-11-20 Thread Sander Vanheule
TP-Link EAP225 v1 is an AC1200 (802.11ac Wave-1) ceiling mount access point.

Device specifications:
* SoC: QCA9563 @ 775MHz
* RAM: 128MiB DDR2
* Flash: 16MiB SPI-NOR
* Wireless 2.4GHz (SoC): b/g/n, 2x2
* Wireless 5Ghz (QCA9882): a/n/ac, 2x2
* Ethernet (AR8033): 1× 1GbE, 802.3at PoE

Flashing instructions:
* Ensure the device is upgraded to firmware v1.4.0
* Exploit the user management page in the web interface to start telnetd
  by changing the username to `;/usr/sbin/telnetd -l/bin/sh&`.
* Immediately change the malformed username back to something valid
  (e.g. 'admin') to make ssh work again.
* Use the root shell via telnet to make /tmp world writeable (chmod 777)
* Extract /usr/bin/uclited from the device via ssh and apply the binary
  patch listed below. The patch is required to prevent `uclited -u` in
  the last step from crashing.
* Copy the patched uclited binary back to the device at /tmp/uclited
  (via ssh)
* Upload the factory image to /tmp/upgrade.bin (via ssh)
* Run `chmod +x /tmp/uclited && /tmp/uclited -u` to install OpenWrt.

uclited patching:
--- xxd uclited
+++ xxd uclited-patched
@@ -53811,7 +53811,7 @@
 000d2330: 8c44  0320 f809   8fbc 0010  .D... ..
 000d2340: 8fa6 0a4c 02c0 2821 8f82 87c4    ...L..(!
-000d2350: 8c44  0c13 461c 27a7 0018 8fbc 0010  .DF.'...
+000d2350: 8c44  2402    8fbc 0010  .D..$...
 000d2360: 1040 001d  1821 8f99 8378 3c04 0058  .@.!...x<..X
 000d2370: 3c05 0056 2484 ad68 24a5 9f00 0320 f809  <..V$..h$ ..

To make sure the correct file is patched, the following MD5 checksums
should match the unpatched and patched files:
4bd74183c23859c897ed77e8566b84de  uclited
4107104024a2e0aeaf6395ed30adccae  uclited-patched

Debricking:
* Serial port can be soldered on unpopulated 4-pin header
  (1: TXD, 2: RXD, 3: GND, 4: VCC)
* Bridge unpopulated resistors running from pins 1 (TXD) and 2 (RXD).
  Do NOT bridge the pull-down for pin 2, running parallel to the
  header.
* Use 3.3V, 115200 baud, 8n1
* Interrupt bootloader by holding CTRL+B during boot
* tftp initramfs to flash via the LuCI web interface
setenv ipaddr 192.168.1.1 # default, change as required
setenv serverip 192.168.1.10 # default, change as required
tftp 0x8080 initramfs.bin
bootelf $fileaddr

Tested by forum user KernelMaker.

Link: https://forum.openwrt.org/t/eap225-v1-firmware/87116
Signed-off-by: Sander Vanheule 
---
 .../ath79/dts/qca9563_tplink_eap225-v1.dts| 44 +++
 .../generic/base-files/etc/board.d/02_network |  1 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata  |  1 +
 target/linux/ath79/image/generic-tp-link.mk   | 11 +
 4 files changed, 57 insertions(+)
 create mode 100644 target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts

diff --git a/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts 
b/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts
new file mode 100644
index ..7ffdf6f772c5
--- /dev/null
+++ b/target/linux/ath79/dts/qca9563_tplink_eap225-v1.dts
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca9563_tplink_eap2x5-1port.dtsi"
+
+/ {
+   compatible = "tplink,eap225-v1", "qca,qca9563";
+   model = "TP-Link EAP225 v1";
+
+   aliases {
+   led-boot = _status_green;
+   led-failsafe = _status_amber;
+   led-running = _status_green;
+   led-upgrade = _status_amber;
+   };
+
+   leds {
+   compatible = "gpio-leds";
+
+   led_status_green: status_green {
+   label = "green:status";
+   gpios = < 7 GPIO_ACTIVE_HIGH>;
+   default-state = "on";
+   };
+
+   led_status_amber: status_amber {
+   label = "amber:status";
+   gpios = < 9 GPIO_ACTIVE_HIGH>;
+   };
+
+   led_status_red: status_red {
+   label = "red:status";
+   gpios = < 1 GPIO_ACTIVE_HIGH>;
+   };
+   };
+
+   gpio-export {
+   compatible = "gpio-export";
+   led_enable {
+   gpio-export,name = "leds:enable";
+   gpio-export,output = <1>;
+   gpios = < 5 GPIO_ACTIVE_HIGH>;
+   };
+   };
+};
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network 
b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index 01e364a8fe73..58007412298f 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network
@@ -65,6 +65,7 @@ ath79_setup_interfaces()
tplink,cpe610-v2|\
tplink,cpe710-v1|\
tplink,eap225-outdoor-v1|\
+   tplink,eap225-v1|\
tplink,eap225-v3|\
tplink,eap245-v1|\

[firmware-utils PATCH v2 1/2] tplink-safeloader: add EAP225 v1 support

2021-11-20 Thread Sander Vanheule
Allow creating images compatible with TP-Link's EAP225v1 access point.

The original partition layout is as follows:
partition fs-uboot base 0x0 size 0x2
partition partition-table base 0x2 size 0x02000
partition default-mac base 0x3 size 0x01000
partition support-list base 0x31000 size 0x00100
partition product-info base 0x31100 size 0x00400
partition soft-version base 0x32000 size 0x00100
partition os-image base 0x4 size 0x18
partition file-system base 0x1c size 0xc0
partition user-config base 0xdc size 0x3
partition radio base 0xff size 0x1

For OpenWrt, the os-image and file-system partition are merged into one
firmware partition, to enable dynamic rootfs partition splits.

Signed-off-by: Sander Vanheule 
---
 src/tplink-safeloader.c | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/src/tplink-safeloader.c b/src/tplink-safeloader.c
index 60729f23f512..0565dcc83811 100644
--- a/src/tplink-safeloader.c
+++ b/src/tplink-safeloader.c
@@ -1532,6 +1532,32 @@ static struct device_info boards[] = {
.last_sysupgrade_partition = "file-system"
},
 
+   /** Firmware layout for the EAP225 v1 */
+   {
+   .id = "EAP225-V1",
+   .support_list =
+   "SupportList:\r\n"
+   "EAP225(TP-LINK|UN|AC1200-D):1.0\r\n",
+   .part_trail = PART_TRAIL_NONE,
+   .soft_ver = SOFT_VER_DEFAULT,
+
+   .partitions = {
+   {"fs-uboot", 0x0, 0x2},
+   {"partition-table", 0x2, 0x02000},
+   {"default-mac", 0x3, 0x01000},
+   {"support-list", 0x31000, 0x00100},
+   {"product-info", 0x31100, 0x00400},
+   {"soft-version", 0x32000, 0x00100},
+   {"firmware", 0x4, 0xd8},
+   {"user-config", 0xdc, 0x3},
+   {"radio", 0xff, 0x1},
+   {NULL, 0, 0}
+   },
+
+   .first_sysupgrade_partition = "os-image",
+   .last_sysupgrade_partition = "file-system"
+   },
+
/** Firmware layout for the EAP225 v3 */
{
.id = "EAP225-V3",
-- 
2.33.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel