Re: Wii: bwi driver fails to attach for device id 0x044b on NetBSD 11.0-BETA

deltaresero <[email protected]> Sun, 19 Oct 2025 21:22:47 -0300
Newsgroups gmane.os.netbsd.ports.powerpc
Message-ID <[email protected]>
Hello Jared,

I checked out the master/trunk branch but was unable to build kernel from t=
he src repository https://github.com/NetBSD/src.git as the build system fai=
led during the host tool compilation phase.

I thought cross compiling it on Linux might have been just as simple as run=
ning:
$ ./build.sh -m evbppc -U tools kernel=3DWII
but I kept getting repeated "incompatible pointer type" errors in the texin=
fo tool's makeinfo/cmds.c file.

Given the local build failure, I tested your changes using the daily binary=
 snapshot:
https://nycdn.netbsd.org/pub/NetBSD-daily/HEAD/20251019171412Z/evbppc/binar=
y/gzimg/wii.img.gz

This appears to fix the issue as the system successfully recognizes and ini=
tializes the Wi-Fi chip.

On first boot with the new kernel, the system correctly logged that it need=
ed the firmware: bwi0: firmware_open failed on v3/ucode5.fw. I then followe=
d the standard procedure for injecting firmware onto the SD card. On a seco=
nd machine, I downloaded the v3.tbz file, moved it over to the FAT32 partit=
ion of the SD card, logged into NetBSD and ran:
# cp /boot/v3.tbz .
# mkdir -p /libdata/firmware/bwi
# tar -C /libdata/firmware/bwi -jxvf v3.tbz
# reboot

On the subsequent boot, bwi0 initialized successfully, with the following r=
elated messages:
bwi0: firmware rev0x0127, patch level 0x000e
bwi0: base tssi measure failed

The warning regarding "base tssi measure failed" did not appear to prevent =
normal operation. After the driver successfully attached, I was able to con=
figure and activate the interface.
# wpa_passphrase myssid mypassword >>/etc/wpa_supplicant.conf
# echo 'wpa_supplicant=3DYES' >>/etc/rc.conf
# service wpa_supplicant start

ifconfig -a now lists the bwi0 interface with an assigned address, and I wa=
s able to successfully ping external hosts.=20
Thank you so much for fixing this!

Best regards,
DeltaResero



---- On Sat, 18 Oct 2025 22:17:09 -0300 Jared McNeill <[email protected]=
a> wrote ---

 > I checked in a patch that should help. Can you give it a shot?=20
 > =20
 > revision 1.44=20
 > date: 2025-10-18 22:15:45 -0300;  author: jmcneill;  state: Exp;  lines:=
 +10 -3;  commitid: vHCZXTlZiGEnk7fG;=20
 > bwi: Retry SDIO common regwin probe a few times before giving up.=20
 > =20
 > It seems that on some systems, we need to read the SDIO common regwin ID=
=20
 > register more than once to properly identify it. Try a couple of times=
=20
 > before giving up.=20
 > =20
 > This makes bwi(4) attach on my red Wii.=20
 > =20
 > =20
 > On Fri, 10 Oct 2025, Jared McNeill wrote:=20
 > =20
 > > Actually, don't waste your time with that patch, on second thought it =
won't=20
 > > work. I'll do some more digging.=20
 > >=20
 > >=20
 > > On Fri, 10 Oct 2025, Jared McNeill wrote:=20
 > >=20
 > >> Hi!=20
 > >>=20
 > >> That's interesting, I haven't been able to reproduce this myself with=
 any=20
 > >> of the NA units that I have, but after seeing your message I went bac=
k and=20
 > >> looked at Jun Ebihara's dmesg from=20
 > >> https://mail-index.netbsd.org/port-powerpc/2025/06/16/msg003701.html =
and=20
 > >> the same error is there.=20
 > >>=20
 > >> Maybe a different wifi chip in some revisions of the device?=20
 > >>=20
 > >> For a quick test, can you build a kernel with the following hack to s=
ee if=20
 > >> it helps?=20
 > >>=20
 > >> --- sys/dev/sdmmc/if_bwi_sdio.c 19 Jan 2025 00:29:29 -0000      1.1=
=20
 > >> +++ sys/dev/sdmmc/if_bwi_sdio.c 10 Oct 2025 16:19:01 -0000=20
 > >> @@ -178,7 +178,7 @@ bwi_sdio_attach(device_t parent, device_=20
 > >>        sc->sc_reg_write_4 =3D bwi_sdio_reg_write_4;=20
 > >>        sc->sc_reg_read_4 =3D bwi_sdio_reg_read_4;=20
 > >>        sc->sc_pci_revid =3D 0;   /* XXX can this come from CIS? */=20
 > >> -       sc->sc_pci_did =3D cis->product;=20
 > >> +       sc->sc_pci_did =3D 0x4318;=20
 > >>        sc->sc_pci_subvid =3D cis->manufacturer;=20
 > >>        sc->sc_pci_subdid =3D cis->product;=20
 > >>=20
 > >>=20
 > >> On Sun, 5 Oct 2025, deltaresero wrote:=20
 > >>=20
 > >>> Hello,=20
 > >>>=20
 > >>> I'm running NetBSD 11.0-BETA (WII) on a Nintendo Wii (build from Oct=
 5,=20
 > >>> 2025).=20
 > >>>=20
 > >>> uname -a:=20
 > >>> NetBSD wii 11.0_BETA NetBSD 11.0_BETA (WII) #0 Fri Oct 3 16:09:55 UT=
C 2025=20
 > >>> mk [email protected]:/usr/src/sys/arch/evbppc/compile/WII evb=
ppc=20
 > >>>=20
 > >>> dmesg | grep -i bwi -n=20
 > >>> 74:[     1.209984] bwi0 at sdmmc1 function 1: broadcom Wireless=20
 > >>> 75:[     1.209984] bwi0: autoconfiguration error: no BBP id for devi=
ce id=20
 > >>> 0x044b=20
 > >>>=20
 > >>> I followed Jared McNeill=E2=80=99s instructions for adding Wii WLAN =
support to=20
 > >>> -current (see:=20
 > >>> https://mail-index.netbsd.org/port-powerpc/2025/01/19/msg003669.html=
) and=20
 > >>> installed the v3 firmware per bwi(4). The driver detects the device =
but=20
 > >>> reports =E2=80=9Cno BBP id for device id 0x044b=E2=80=9D and, as exp=
ected, I only see the=20
 > >>> loopback adapter lo0. I suspect this may be a hardware revision not=
=20
 > >>> present in the driver's table. If that=E2=80=99s the case, is it pos=
sible to add=20
 > >>> support for this device?=20
 > >>>=20
 > >>> Thanks,=20
 > >>> DeltaResero=20
 > >>>=20
 > >