Not much (at all) out there on people actually getting this to work with OpenWrt. After many an hour hunting and trying different configurations primarily with kernel and setpci parameters in grub.conf finally got it working. I wanted to document it here to help anyone wanting to make use of an old Mac Mini of this vintage.
Note, to make any decent use of a mac mini 2014 or similar, you would want 1 or 2 thunderbolt-to-1gb-ethernet dongles to use alongside the built-in 1gbe. Forget Wifi, not only is its BCRM chipset not supported on OpenWrt it also doesn't have AP functionality in hardware. So it is basically limited to being a small server. I haven't decided on the exact use for mine as yet, but it could become a dmz server host.
There is a major issue to be solved in which the straight OpenWrt firmware image on SD card will not work. The SDHCI MMC module goes into a hard loop on bootup. To solve it I had to do this:
- Download the latest generic x86/64 combined efi (ext4) image and flash to an SD card.
- Mount up the boot partition (/dev/sdb1 onto /mnt when mounted off my linux server) and cd into the /mnt/boot/grub directory. Do mkdir x86_64-efi and cd into it.
- You need to copy a grub setpci.mod file from the linux system's /boot/grub/x86_64-efi/ into the directory on the SD card. No guarantee this will work everywhere but it worked for me thankfully.
- Update grub.cfg like this:
menuentry "OpenWrt" {
insmod setpci
setpci -s 00:1c.3 0x50.B=0x41
linux [various parameters after which you append] sdhci.debug_quirks=0x40 sdhci.debug_quirks2=0x4
setpci -s 00:1c.3 0x50.B=0x41
}
- Unmount the SD card and you are ready to boot your mini
- Hold down the option key (or alt key on non-mac keyboard) at power-up to select the SD image
- Happiness.
The key here is the setpci commands as well as the quirks. Honestly, I don't know if setpci is needed both before and after booting the linux kernel but it works for me. The 00:1c.3 setpci parameter was arrived at partially by examining internet posts from over the years of people solving similar SDHCI boot issues but randomly trying a 3 instead of 2 and then everything actually worked. (my rationale was that the SD card reader was on secondary PCI bridge #3 on this model - as determined by lspci from a succeeded bootup).