Adding support for Hak5 wifi pineapple MK5

I have a Hak5 wifi pineapple Mk5 that I am trying to re-purpose as a portable router, I have generally gotten most of the way and I have it booting 22.03.5, both of the wlan interfaces seem to be available, my issue is that the ethernet interface doesn't seem to come up.

Oddly OpenWRT seems to understand the existence of the eth port as the gpio LED that I assigned to the ethernet port lights up when I connect and ethernet cable and turns off when I unplug the ethernet cable.

Anyone able to provide some help on resolving this? Below is a copy of the boot log.

U-Boot 1.1.4  (Oct  2 2013)

AP121 (AR9331) U-Boot

DRAM:  64 MB
FLASH: Winbond W25Q128 (16 MB)
Using default environment

In:  serial
Out: serial
Err: serial
Net:   ag7240_enet_initialize...
: cfg1 0x5 cfg2 0x7114
eth0: <redacted mac address>
eth0 up
: cfg1 0xf cfg2 0x7214
eth1: <redacted mac address>
athrs26_reg_init_lan
eth1 up

Press any key to stop autoboot, Autobooting in : 0 

Booting image at: 0x9F020000

   Image name:   OpenWrt r20134-5f152
   Image type:   MIPS Linux Kernel Image (lzma compressed)
   Data size:    2253280 Bytes = 2.1 MB
   Load address: 0x80060000
   Entry point:  0x80060000

Uncompressing kernel image... OK!
Starting kernel...

[    0.000000] Linux version 5.10.176 (user@NUC) (mips-openwrt-linux-musl-gcc (OpenWrt GCC 11.2.0 r20134-5f15225c1e) 11.2.0, GNU ld (GNU Binutils) 2.37) #0 Thu Apr 27 20:28:15 2023
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] MIPS: machine is Hak5 WiFi Pineapple MK5
[    0.000000] SoC: Atheros AR9330 rev 1
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16240
[    0.000000] Kernel command line: console=ttyATH0,115200 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 56132K/65536K available (5508K kernel code, 601K rwdata, 1208K rodata, 1188K init, 200K bss, 9404K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] CPU clock: 400.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000013] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.007683] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
[    0.092273] pid_max: default: 32768 minimum: 301
[    0.096955] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.103706] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.114405] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[    0.124129] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.132182] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.138885] pinctrl core: initialized pinctrl subsystem
[    0.146091] NET: Registered protocol family 16
[    0.237727] clocksource: Switched to clocksource MIPS
[    0.243101] NET: Registered protocol family 2
[    0.246274] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.253903] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.260968] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.268155] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.274866] TCP: Hash tables configured (established 1024 bind 1024)
[    0.281176] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.287194] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.294376] NET: Registered protocol family 1
[    0.298085] PCI: CLS 0 bytes, default 32
[    0.311433] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    0.323600] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.327875] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.341985] pinctrl-single 18040028.pinmux: 64 pins, size 8
[    0.346649] gpio-export gpio-export: 1 gpio(s) exported
[    0.352132] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.358284] 18020000.uart: ttyATH0 at MMIO 0x18020000 (irq = 9, base_baud = 1562500) is a AR933X UART
[    0.366103] printk: console [ttyATH0] enabled
[    0.366103] printk: console [ttyATH0] enabled
[    0.374552] printk: bootconsole [early0] disabled
[    0.374552] printk: bootconsole [early0] disabled
[    0.400737] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    0.404158] 3 fixed-partitions partitions found on MTD device spi0.0
[    0.410590] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    0.417053] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    0.424196] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    0.430303] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    0.437438] Creating 3 MTD partitions on "spi0.0":
[    0.441696] 0x000000000000-0x000000020000 : "u-boot"
[    0.453900] 0x000000020000-0x000000ff0000 : "firmware"
[    0.459608] 2 tplink-fw partitions found on MTD device firmware
[    0.464090] Creating 2 MTD partitions on "firmware":
[    0.469161] 0x000000000000-0x0000002263e0 : "kernel"
[    0.473981] mtd: partition "kernel" doesn't end on an erase/write block -- force read-only
[    0.486146] 0x0000002263e0-0x000000fd0000 : "rootfs"
[    0.489748] mtd: partition "rootfs" doesn't start on an erase/write block boundary -- force read-only
[    0.500364] mtd: setting mtd3 (rootfs) as root device
[    0.505311] 1 squashfs-split partitions found on MTD device rootfs
[    0.510228] 0x0000006b0000-0x000000fd0000 : "rootfs_data"
[    0.517033] 0x000000ff0000-0x000001000000 : "art"
[    0.591180] ag71xx 19000000.eth: invalid MAC address, using random address
[    0.928841] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    0.935300] i2c /dev entries driver
[    0.941472] NET: Registered protocol family 10
[    0.953351] Segment Routing with IPv6
[    0.955738] NET: Registered protocol family 17
[    0.960236] 8021q: 802.1Q VLAN Support v1.8
[    0.967044] ag71xx 19000000.eth: invalid MAC address, using random address
[    1.308844] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    1.315781] ag71xx 19000000.eth: invalid MAC address, using random address
[    1.658816] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    1.676669] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[    1.691543] Freeing unused kernel memory: 1188K
[    1.694617] This architecture does not have kernel memory protection.
[    1.701094] Run /sbin/init as init process
[    2.827271] init: Console is alive
[    2.830111] init: - watchdog -
[    5.404797] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    5.481016] usbcore: registered new interface driver usbfs
[    5.485144] usbcore: registered new interface driver hub
[    5.490616] usbcore: registered new device driver usb
[    5.515575] Button Hotplug driver version 0.4.1
[    5.530090] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    5.555862] ci_hdrc ci_hdrc.0: EHCI Host Controller
[    5.559453] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
[    5.587745] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
[    5.593089] hub 1-0:1.0: USB hub found
[    5.596631] hub 1-0:1.0: 1 port detected
[    5.602645] ag71xx 19000000.eth: invalid MAC address, using random address
[    5.624552] SCSI subsystem initialized
[    5.637310] fsl-ehci: Freescale EHCI Host controller driver
[    5.646322] ehci-platform: EHCI generic platform driver
[    5.662982] usbcore: registered new interface driver usb-storage
[    5.669678] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    5.686212] init: - preinit -
[    5.967666] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[    5.973971] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    6.468275] hub 1-1:1.0: USB hub found
[    6.567437] hub 1-1:1.0: 4 ports detected
[    6.706857] random: procd: uninitialized urandom read (4 bytes read)
[    6.713878] ag71xx 19000000.eth: invalid MAC address, using random address
[    7.109063] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    7.127996] usb 1-1.1: new high-speed USB device number 3 using ci_hdrc
[    7.389342] ag71xx 19000000.eth: invalid MAC address, using random address
[    7.561969] usb 1-1.4: new high-speed USB device number 4 using ci_hdrc
[    7.722181] usb-storage 1-1.4:1.0: USB Mass Storage device detected
[    7.740515] scsi host0: usb-storage 1-1.4:1.0
[    7.778950] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    7.797865] ag71xx 19000000.eth: invalid MAC address, using random address
[    7.914318] random: jshn: uninitialized urandom read (4 bytes read)
[    8.138946] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    8.176130] random: jshn: uninitialized urandom read (4 bytes read)
[    8.255952] random: jshn: uninitialized urandom read (4 bytes read)
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    8.819202] scsi 0:0:0:0: Direct-Access     Multi    Flash Reader     1.00 PQ: 0 ANSI: 0
[    9.458842] sd 0:0:0:0: [sda] 3862528 512-byte logical blocks: (1.98 GB/1.84 GiB)
[    9.465693] sd 0:0:0:0: [sda] Write Protect is off
[    9.470568] sd 0:0:0:0: [sda] No Caching mode page found
[    9.474982] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    9.488801]  sda: sda1 sda2
[    9.495720] sd 0:0:0:0: [sda] Attached SCSI removable disk
[    9.500778] ag71xx 19000000.eth: invalid MAC address, using random address
[    9.838862] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[   13.307766] jffs2: notice: (505) jffs2_build_xattr_subsystem: complete building xattr subsystem, 8 of xdatum (0 unchecked, 3 orphan) and 9 of xref (3 dead, 0 orphan) found.
[   13.324520] mount_root: switching to jffs2 overlay
[   13.339583] overlayfs: upper fs does not support tmpfile.
[   13.352999] urandom-seed: Seeding with /etc/urandom.seed
[   13.711355] procd: - early -
[   13.713351] procd: - watchdog -
[   14.540565] procd: - watchdog -
[   14.587206] procd: - ubus -
[   14.867514] random: ubusd: uninitialized urandom read (4 bytes read)
[   14.945251] random: ubusd: uninitialized urandom read (4 bytes read)
[   14.951114] random: ubusd: uninitialized urandom read (4 bytes read)
[   14.962921] procd: - init -
Please press Enter to activate this console.
[   15.886873] random: ubusd: uninitialized urandom read (4 bytes read)
[   15.892388] random: ubus: uninitialized urandom read (4 bytes read)
[   16.577225] random: jshn: uninitialized urandom read (4 bytes read)
[   17.000969] kmodloader: loading kernel modules from /etc/modules.d/*
[   17.931945] NET: Registered protocol family 38
[   17.998279] urngd: v1.0.2 started.
[   18.033525] Loading modules backported from Linux version v5.15.92-0-ge515b9902f5f
[   18.039731] Backport generated by backports.git v5.15.92-1-0-gdfe0f60c
[   18.189295] xt_time: kernel timezone is -0000
[   18.599810] nf_conntrack_rtsp v0.7 loading
[   18.680089] nf_nat_rtsp v0.7 loading
[   18.836533] PPP generic driver version 2.4.2                                                                    
[   18.859903] NET: Registered protocol family 24                                                                  
[   18.952465] random: crng init done                                                                              
[   18.954450] random: 24 urandom warning(s) missed due to ratelimiting                                            
[   19.140837] ieee80211 phy0: hwaddr <redacted mac address>, RTL8187vB (default) V1 + rtl8225z2, rfkill mask 2
[   19.296777] rtl8187: Customer ID is 0x46
[   19.308423] rtl8187: wireless switch is on
[   19.311486] usbcore: registered new interface driver rtl8187
[   19.328673] ag71xx 19000000.eth: invalid MAC address, using random address
[   19.614180] usbcore: registered new interface driver ath9k_htc
[   19.701765] ieee80211 phy1: Atheros AR9330 Rev:1 mem=0xb8100000, irq=2
[   19.730886] kmodloader: done loading kernel modules from /etc/modules.d/*
[   19.749012] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[   19.777936] ag71xx 19000000.eth: invalid MAC address, using random address
[   20.182133] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.



BusyBox v1.35.0 (2023-04-27 20:28:15 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 22.03.5, r20134-5f15225c1e
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/#

NVM, had to patch a driver and make a change to the DTS file, issues resolved now

1 Like

Can you make your driver patch and DTS file available in case someone else wants to go down the same road?

Sure thing, it is working, just got to figure out why a one of the network adapters is being assigned a software generated mac address instead of its hardware address, then I’ll submit them.

1 Like

I'm on exactly this road (with slightly different hardware: QCA9533), I usually dig up posts that are years old, not 23 hours! I'm very interested in your fix.

Alright I was a bit too quick to ask for help here, my problem was fixed with just a DTS change. Newer versions of the device tree don't support plain mtd-mac-address anymore like I had before:

&eth0 {
	status = "okay";
	phy-handle = <&swphy4>;
	mtd-mac-address = <&art 0x0>;
};
&eth1 {
	mtd-mac-address = <&art 0x6>;
};
&wmac {
	status = "okay";
	mtd-cal-data = <&art 0x1000>;
};

This has to be replaced with nvm-cells and a separate &art block:

&eth0 {
	status = "okay";

	phy-handle = <&swphy4>;

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

&eth1 {
	nvmem-cells = <&macaddr_art_6>;
	nvmem-cell-names = "mac-address";
};

&wmac {
	status = "okay";
	mtd-cal-data = <&art 0x1000>;
};

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

	macaddr_art_0: macaddr@0 {
		reg = <0x0 0x6>;
	};

	macaddr_art_6: macaddr@6 {
		reg = <0x6 0x6>;
	};
};