Adding OpenWrt support for ws-ap3825i

may be use bitmask,
i use this in avr controllers

PORTD |= ( 1 << PD1 ) | ( 1 << PD5 ); // set 1
PORTD &= ~( ( 1 << PD4 ) | ( 1 << PD6 ) ); //set 0

Bufer1 |= (~ 0b00101111);
Bufer2 |= (~ 0b11111000);

if yor show me how send command to this registers on system i test it
i is lern openwrt building

This is ordinarily done by the kernel, just have to tweak the device tree just right.

1 Like

Apologies for the delay, folks.

Unfortunately, it looks like the GPIO platform for the mpc85xx hasn't been ported to chardev (CONFIG_GPIO_CDEV). This would create e.g. /dev/gpiochip480). This ultimately means that it's not going to be (I don't think) possible to use in-kernel bit-banged SPI to drive the LV164A.

I know for sure the OpenWrt maintainers will not accept an out-of-kernel solution (they universally prefer to upstream what can be upstreamed), so it looks like LEDs will not be available with the initial OpenWrt port.

I am going to submit a PR for my port of the AP3825i today sans LED support; I'll let folks know how it goes.

2 Likes

it's great,
it is 1 step,
maybe next time it fix,
happy new year friends

how to use eth0 and eth1 as local switch?
how configure it in system,
thank you

I assume your device is not meant to be a router either, just a dumb AP, right?

This is what I do for that:

# /etc/config/network
:
:
config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'
	list ports 'eth1'

config interface 'lan'
	option device 'br-lan'
	option proto 'dhcp'

config interface 'wan'        
	option proto 'dhcpv6'
                      
config interface 'wan6'
	option proto 'dhcpv6'
  • move /etc/config/dhcp to /etc/config/.dhcp, then touch /etc/config/dhcp
  • move /etc/config/firewall to /etc/config/.firewall, then touch /etc/config/firewall
  • reboot
1 Like

i set this on my board
local network connected on LAN2 (eth2)

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'
	list ports 'eth1'

config interface 'lan'
	option device 'br-lan'
	option proto 'dhcp'

config interface 'wan'        
	option proto 'dhcpv6'
                      
config interface 'wan6'
	option proto 'dhcpv6'

board receive ip on dhcp and good work on LAN2 port and Wireless (work as local switch)

but port LAN1(eth1) is bug

[  450.195900] fsl-gianfar soc@ffe00000:ethernet@b1000 eth1: Link is Up - 1Gbps/Full - flow control off
[  450.205066] br-lan: port 2(eth1) entered blocking state
[  450.210442] br-lan: port 2(eth1) entered forwarding state
[  452.275640] fsl-gianfar soc@ffe00000:ethernet@b1000 eth1: Link is Down
[  452.282643] br-lan: port 2(eth1) entered disabled state

my pc connected to LAN1 (eth0)
but my pc dont receive ip, if i set manual ip on my pc i dont ping other ip on local network

192.168.101.3- it my pc

Ethernet adapter Ethernet:
   Connection-specific DNS Suffix  . :
   IPv4 Address. . . . . . . . . . . : 192.168.101.3
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.101.1


>ping 192.168.101.4

Pinging 192.168.101.4 with 32 bytes of data:
Reply from 192.168.101.3: Destination host unreachable.

Ping statistics for 192.168.101.4:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),

if i connect local network in LAN1(eth1)
board dont receive ip and don't work normally

it problem on 6 board in my home
how fix this problem?

but if i use eth1 as WAN(stock configuration after flash openwrt), board receive ip over dhcp on this por but internet not work
problem in my board (eth1 is crashed) or software?
thank you

Oh yes! Sorry, I just fixed this.

The device tree was incorrect. ethernet@b1000 is not hooked up, but ethernet@b2000 is. That's why LAN1 isn't working for you, even if the link negotiates and comes up.

I have fixed them and uploaded the build result here: https://downloads.laboratoryb.org/releases/snapshot/targets/mpc85xx/p1020/

Edit: I don't actually know if the address is wrong -- I think it might be the interrupt vector actually. U-boot insists on giving the MAC address of LAN1 to b1000 and LAN2 to b0000, so I'm tweaking the interrupt vector on /soc@ffe00000/mdio@24000/ethernet-phy@2 to see if it will fix things.

1 Like

thank you :+1:
i go testing this

we have a problem on sysupgrade file squashfs-sysupgrade.bin

it is my log

root@OpenWrt:/# sysupgrade -v /tmp/openwrt-mpc85xx-p1020-extreme-networks_ws-ap3
825i-squashfs-sysupgrade.bin
Cannot save config while running from ramdisk.
Sat Jan  1 14:44:37 UTC 2022 upgrade: Commencing upgrade. Closing all shell sessions.
Watchdog handover: fd=3
- watchdog -
Watchdog does not have CARDRESET support
Sat Jan  1 14:44:38 UTC 2022 upgrade: Sending TERM to remaining processes ...
Sat Jan  1 14:44:42 UTC 2022 upgrade: Sending KILL to remaining processes ...
[  145.189847] sh (4198): drop_caches: 3
Sat Jan  1 14:44:48 UTC 2022 upgrade: Switching to ramdisk...
Sat Jan  1 14:44:49 UTC 2022 upgrade: Performing system upgrade...
[  146.622998] sh (4198): drop_caches: 3
Unlocking firmware ...

Writing from <stdin> to firmware ...
Appending jffs2 data from /tmp/sysupgrade.tgz to firmware..
.File /tmp/sysupgrade.tgz does not exist
Sat Jan  1 14:45:36 UTC 2022 upgrade: Upgrade completed
Sat Jan  1 14:45:37 UTC 2022 upgrade: Rebooting system...
umount: can't unmount /dev: Resource busy
umount:[  194.214955] reboot: Restarting system
▒

U-Boot 2010.12.6 (Feb 26 2015 - 19:39:21) (primary)

Power LED ON
CPU0:  P1020E, Version: 1.1, (0x80ec0011)
Core:  E500, Version: 5.1, (0x80212051)
Clock Configuration:
       CPU0:800  MHz, CPU1:800  MHz,
       CCB:400  MHz,
       DDR:333.333 MHz (666.667 MT/s data rate) (Asynchronous), LBC:25   MHz
L1:    D-cache 32 kB enabled
       I-cache 32 kB enabled
Board: P1020RDB CPLD: V15.15 PCBA: V15.0
rom_loc: nor upper bank
SD/MMC : 4-bit Mode
eSPI : Enabled
I2C:   ready
SPI:   ready
DRAM:  Configuring DDR for 666.667 MT/s data rate
DDR: 256 MiB (DDR3, 32-bit, CL=6, ECC off)
Testing DRAM from 0x00010000 to 0x000fffff
DRAM test phase 1:
DRAM test phase 2:
DRAM test passed.
FLASH: 64 MiB
L2:    256 KB enabled
MMC:  FSL_ESDHC: 0
PCIe1: Root Complex of mini PCIe SLOT, x1, regs @ 0xffe0a000
  01:00.0     - 168c:003c - Network controller
PCIe1: Bus 00 - 01
PCIe2: Root Complex of PCIe SLOT, x1, regs @ 0xffe09000
  03:00.0     - 168c:0033 - Network controller
PCIe2: Bus 02 - 03
In:    serial
Out:   serial
Err:   serial
Net:   eTSEC1, eTSEC3
### JFFS2 loading '/home/config/shadow'
rescan: First time in use
Scanning JFFS2 FS: .  Unknown node type: e008 len 48 offset 0xa003cc
Unknown node type: e009 len 28 offset 0xa003fc
Unknown node type: e009 len 28 offset 0xa00418
Unknown node type: e008 len 48 offset 0xa00998
Unknown node type: e009 len 28 offset 0xa009c8
Unknown node type: e009 len 28 offset 0xa009e4
Unknown node type: e008 len 48 offset 0xa00d8c
Unknown node type: e009 len 28 offset 0xa00dbc
Unknown node type: e009 len 28 offset 0xa00dd8
Unknown node type: e008 len 48 offset 0xa0103c
Unknown node type: e009 len 28 offset 0xa0106c
Unknown node type: e009 len 28 offset 0xa01088
Unknown node type: e008 len 48 offset 0xa012ec
Unknown node type: e009 len 28 offset 0xa0131c
Unknown node type: e009 len 28 offset 0xa01338
Unknown node type: e008 len 48 offset 0xa0159c
Unknown node type: e009 len 28 offset 0xa015cc
Unknown node type: e009 len 28 offset 0xa015e8
Unknown node type: e008 len 48 offset 0xa0184c
Unknown node type: e009 len 28 offset 0xa0187c
Unknown node type: e009 len 28 offset 0xa01898                                .  Unknown node type: e008 len 48 offset 0x3b42774
Unknown node type: e009 len 28 offset 0x3b427a4
Unknown node type: e009 len 28 offset 0x3b427c0                               ..  Unknown node type: e008 len 76 offset 0x3ba20e8
Unknown node type: e009 len 28 offset 0x3ba2134                               .  Unknown node type: e008 len 76 offset 0x3bc5b44
Unknown node type: e009 len 28 offset 0x3bc5b90
Unknown node type: e009 len 28 offset 0x3bc5bac
Unknown node type: e008 len 76 offset 0x3bc7df4
Unknown node type: e009 len 28 offset 0x3bc7e40
Unknown node type: e009 len 28 offset 0x3bc7e5c                               ...  Unknown node type: e008 len 76 offset 0x3c217bc
Unknown node type: e009 len 28 offset 0x3c21808
Unknown node type: e008 len 76 offset 0x3c22d38
Unknown node type: e009 len 28 offset 0x3c22d84
Unknown node type: e009 len 28 offset 0x3c22da0                               .  Unknown node type: e008 len 76 offset 0x3c2ff54
Unknown node type: e009 len 28 offset 0x3c2ffa0                               .  Unknown node type: e008 len 48 offset 0x3c4b420
Unknown node type: e009 len 28 offset 0x3c4b450
Unknown node type: e009 len 28 offset 0x3c4b46c
Unknown node type: e008 len 76 offset 0x3c4b488
Unknown node type: e009 len 28 offset 0x3c4b4d4
Unknown node type: e008 len 48 offset 0x3c4b4f0
Unknown node type: e009 len 28 offset 0x3c4b520
Unknown node type: e008 len 76 offset 0x3c4b53c
Unknown node type: e009 len 28 offset 0x3c4b588
Unknown node type: e008 len 76 offset 0x3c4b5a4
Unknown node type: e009 len 28 offset 0x3c4b5f0
Unknown node type: e008 len 76 offset 0x3c4b60c
Unknown node type: e009 len 28 offset 0x3c4b658
Unknown node type: e009 len 28 offset 0x3c4b674
Unknown node type: e008 len 76 offset 0x3c4b690
Unknown node type: e009 len 28 offset 0x3c4b6dc
Unknown node type: e008 len 76 offset 0x3c4b6f8
Unknown node type: e009 len 28 offset 0x3c4b744
Unknown node type: e008 len 76 offset 0x3c4b760
Unknown node type: e009 len 28 offset 0x3c4b7ac
Unknown node type: e009 len 28 offset 0x3c4b7c8
Unknown node type: e008 len 76 offset 0x3c4be24
Unknown node type: e009 len 28 offset 0x3c4be70
Unknown node type: e008 len 76 offset 0x3c4cfec
Unknown node type: e009 len 28 offset 0x3c4d038
Unknown node type: e008 len 76 offset 0x3c4da20
Unknown node type: e009 len 28 offset 0x3c4da6c
Unknown node type: e008 len 76 offset 0x3c4dd9c
Unknown node type: e009 len 28 offset 0x3c4dde8
Unknown node type: e008 len 76 offset 0x3c500ec
Unknown node type: e009 len 28 offset 0x3c50138
Unknown node type: e009 len 28 offset 0x3c50154
Unknown node type: e008 len 76 offset 0x3c503f8
Unknown node type: e009 len 28 offset 0x3c50444
Unknown node type: e009 len 28 offset 0x3c50460
Unknown node type: e008 len 76 offset 0x3c58880
Unknown node type: e009 len 28 offset 0x3c588cc                               .... done.
find_inode failed for name=home
load: Failed to find inode
### JFFS2 LOAD ERROR<0> for /home/config/shadow!
Hit 'd' for diagnostics, or any other key to stop autoboot:  0
## Booting kernel from FIT Image at 02000000 ...
   Using 'config-1' configuration
   Trying 'kernel-1' kernel subimage
     Description:  POWERPC OpenWrt Linux-5.10.88
     Type:         Kernel Image
     Compression:  lzma compressed
     Data Start:   0x020000ec
     Data Size:    2920290 Bytes = 2.8 MiB
     Architecture: PowerPC
     OS:           Linux
     Load Address: 0x00000000
     Entry Point:  0x00000000
     Hash algo:    crc32
     Hash value:   66fe711e
     Hash algo:    sha1
     Hash value:   50849dfba21f32b3f4c315ee977adbd1de2eb745
   Verifying Hash Integrity ... crc32+ sha1+ OK
## Flattened Device Tree from FIT Image at 02000000
   Using 'config-1' configuration
   Trying 'fdt-1' FDT blob subimage
     Description:  POWERPC OpenWrt extreme-networks_ws-ap3825i device tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x022c91a0
     Data Size:    11760 Bytes = 11.5 KiB
     Architecture: PowerPC
     Hash algo:    crc32
     Hash value:   6a9d3443
     Hash algo:    sha1
     Hash value:   bc48d30dcc50788e8e1282cf61d48ad9bc248bc4
   Verifying Hash Integrity ... crc32+ sha1+ OK
   Booting using the fdt blob at 0x22c91a0
   Uncompressing Kernel Image ... OK
WARNING: could not set reg FDT_ERR_NOSPACE.
ft_fixup_cpu: FDT_ERR_NOSPACE
ft_fixup_l2cache: FDT_ERR_NOTFOUND
WARNING: could not set reg FDT_ERR_NOSPACE.
WARNING: could not set bootargs FDT_ERR_NOSPACE.
WARNING: could not set linux,stdout-path FDT_ERR_NOSPACE.

Yes, you will need to do this:

setenv boot_openwrt "cp.b 0xEC000000 0x2000000 0x2000000; interrupts off; bootm start 0x2000000; bootm loados; bootm ramdisk; fdt resize; fdt boardsetup; fdt resize; fdt boardsetup; fdt chosen; fdt resize; bootm prep; bootm go;"
setenv bootcmd "run boot_openwrt"
saveenv
1 Like

istall, updated manual


-------
Setup
-------

setenv ipaddr 192.168.101.4
setenv serverip 192.168.101.144
setenv boot_openwrt "cp.b 0xEC000000 0x2000000 0x2000000; interrupts off; bootm start 0x2000000; bootm loados; bootm ramdisk; fdt resize; fdt boardsetup; fdt resize; fdt boardsetup; fdt chosen; fdt resize; bootm prep; bootm go;"
setenv bootcmd "run boot_openwrt"
saveenv

tftpboot 0x2000000 openwrt-mpc85xx-p1020-extreme-networks_ws-ap3825i-initramfs-kernel.bin

run boot_openwrt

Oh, and don't worry, I have a very chunky draft commit waiting for its pull request. I will make sure to ping you on GitHub when I submit it. :^)

1 Like

great :+1:

root@OpenWrt:/# opkg update & opkg install kmod-usb-storage
Unknown package 'kmod-usb-storage'.
Collected errors:
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.10.88-1-1d852e9351f934f2ea3b4fc175fd34bf) for kmod-scsi-core
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-scsi-core found, but incompatible with the architectures configured
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.10.88-1-1d852e9351f934f2ea3b4fc175fd34bf) for kmod-usb-storage
 * pkg_hash_fetch_best_installation_candidate: Packages for kmod-usb-storage found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package kmod-usb-storage.
root@OpenWrt:/#

how fix this message, i receive it, if i try install package
thank you

  1. You need &&, not &
  2. You can't yet use downloads.openwrt.org's packaging for modules, because I don't have the same kernel version magic (since I'm not e.g. building every board like OpenWrt maintainers do when I compile). You could use kmods found here, but they don't include kmod-usb-storage. You just have to update your feeds.conf file. When I do my last build for you folks to test, I will try to make sure to build all kmods for you.
1 Like

From the picture, AR9590 and QCA9890 are integrated on a single minipcie card? :face_with_monocle:

device have two minipcie card
Qualcomm Atheros QCA9880 802.11nac - radio0 (5 GHz)
Generic MAC80211 802.11an - radio1 (5 or 2.4 GHz)

1 Like

hi, my friend send me this file, please see it
http://web.mit.edu/freebsd/head/sys/boot/fdt/dts/powerpc/p1020rdb.dts
and see this file

No, there is one card on each side.

In other news, I have filed my pull request here: https://github.com/openwrt/openwrt/pull/4911

3 Likes

it is very good news, i go to learn about git and github technology :upside_down_face: