On 24/02/2023 20.08, Sven Peter wrote: > Hi, > > > On Fri, Feb 24, 2023, at 12:04, Sasha Finkelstein wrote: >> On Fri, 24 Feb 2023 at 11:55, Mark Kettenis <mark.kettenis@xxxxxxxxx> wrote: >> >>> What is the motivation for including the firmware name in the device >>> tree rather than constructing it in the driver like what is done for >>> the broadcom wireless? >> There is no way to identify the device subtype before the firmware is >> uploaded, and so i need some way of figuring out which firmware to use. > > Some Broadcom bluetooth boards use the compatible of the root node (see > btbcm_get_board_name in drivers/bluetooth/btbcm.c) which would be "apple,jXXX" > for Apple Silicon. I believe the Broadcom WiFi driver has similar logic as well > which marcan had to extend to instead of "brcm,board-type" because different > WiFi boards can me matched to different Apple Silicon boards. I don't think > that's the case for this touchscreen though. The reason why the brcmfmac stuff needs to construct the firmware name itself is that parts of it come from the OTP contents, so there is no way to know from the bootloader what the right firmware is. That is not the case here, so it makes perfect sense to specify the firmware with `firmware-name` (which is a standard DT property). As for the layout, both bare names and paths are in common use: qcom/sm8450-qrd.dts: firmware-name = "qcom/sm8450/slpi.mbn"; ti/k3-am64-main.dtsi: firmware-name = "am64-main-r5f0_0-fw"; ... but the bare names in particular, judging by some Google searches, are *actually* mapped to bare files in /lib/firmware anyway. So the firmware-name property contains the firmware path in the linux-firmware standard hierarchy, in every case. I already did the same thing for the touchpad on M2s (which requires analogous Z2 firmware passed to it, just in a different format): dts/apple/t8112-j413.dts: firmware-name = "apple/tpmtfw-j413.bin"; Why is having a directory a problem for OpenBSD? Regardless of how firmware is handled behind the scenes, it seems logical to organize it by vendor somehow. It seems to me that gratuitously diverging from the standard firmware hierarchy is only going to cause trouble for OpenBSD. Obviously it's fine to store it somewhere other than /lib/firmware or use a completely unrelated mechanism other than files, but why does the *organization* of the firmware have to diverge? There can only be one DT binding, so we need to agree on a way of specifying firmwares that works cross-OS, and I don't see why "apple/foo.bin" couldn't be made to work for everyone in some way or another. - Hector