anchor.diff:      ${PN}-bcm43430 \
       ${PN}-bcm43455 \
       ${PN}-bcm43456 \
  +    ${PN}-bcm43436 \
  +    ${PN}-bcm43436s \
   "
   
   LICENSE:${PN}-bcm43430 = "Firmware-broadcom_bcm43xx-rpidistro"
  +LICENSE:${PN}-bcm43436 = "Firmware-broadcom_bcm43xx-rpidistro"
  +LICENSE:${PN}-bcm43436s = "Firmware-broadcom_bcm43xx-rpidistro"
   LICENSE:${PN}-bcm43455 = "Firmware-broadcom_bcm43xx-rpidistro"
   LICENSE:${PN}-bcm43456 = "Firmware-broadcom_bcm43xx-rpidistro"
   LICENSE:${PN}-broadcom-license = "Firmware-broadcom_bcm43xx-rpidistro"
  -FILES:${PN}-broadcom-license = "${nonarch_base_libdir}/firmware/LICENCE.broadcom_bcm43xx-rpidistro"
  -FILES:${PN}-bcm43430 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430*"
  -FILES:${PN}-bcm43455 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43455*"
  +FILES:${PN}-broadcom-license = "${nonarch_base_libdir}/firmware/LICENSE.broadcom_bcm43xx-rpidistro"
  +FILES:${PN}-bcm43430 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43430* ${nonarch_base_libdir}/firmware/cypress/cyfmac43430-sdio.bin"
  +FILES:${PN}-bcm43436 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43436-*"
  +FILES:${PN}-bcm43436s = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43436s*"
  +FILES:${PN}-bcm43455 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43455* ${nonarch_base_libdir}/firmware/cypress/cyfmac43455-sdio.*"
   FILES:${PN}-bcm43456 = "${nonarch_base_libdir}/firmware/brcm/brcmfmac43456*"
   RDEPENDS:${PN}-bcm43430 += "${PN}-broadcom-license"
  +RDEPENDS:${PN}-bcm43436 += "${PN}-broadcom-license"
  +RDEPENDS:${PN}-bcm43436s += "${PN}-broadcom-license"
   RDEPENDS:${PN}-bcm43455 += "${PN}-broadcom-license"
   RDEPENDS:${PN}-bcm43456 += "${PN}-broadcom-license"
   RCONFLICTS:${PN}-bcm43430 = "\
       linux-firmware-bcm43430 \
       linux-firmware-raspbian-bcm43430 \
   "
  +
   RREPLACES:${PN}-bcm43430 = "\
       linux-firmware-bcm43430 \
       linux-firmware-raspbian-bcm43430 \
   "
  +
  +RCONFLICTS:${PN}-bcm43436 = "\
  +    linux-firmware-bcm43436 \
  +    linux-firmware-raspbian-bcm43436 \
  +"
  +
  +RREPLACES:${PN}-bcm43436 = "\
  +    linux-firmware-bcm43436 \
  +    linux-firmware-raspbian-bcm43436 \
  +"
  +
  +RCONFLICTS:${PN}-bcm43436s = "\
  +    linux-firmware-bcm43436s \
  +    linux-firmware-raspbian-bcm43436s \
  +"
  +
  +RREPLACES:${PN}-bcm43436s = "\
  +    linux-firmware-bcm43436s \
  +    linux-firmware-raspbian-bcm43436s \
  +"
  +
   RCONFLICTS:${PN}-bcm43455 = "\
       linux-firmware-bcm43455 \
       linux-firmware-raspbian-bcm43455 \
  
positive.code: }
  
  do_install() {
      install -d ${D}${nonarch_base_libdir}/firmware/brcm
  
      cp ./LICENCE.broadcom_bcm43xx ${D}${nonarch_base_libdir}/firmware/LICENCE.broadcom_bcm43xx-rpidistro
  
      # Replace outdated linux-firmware files with updated ones from
      # raspbian firmware-nonfree. Raspbian adds blobs and nvram
      # definitions that are also necessary so copy those too.
      for fw in brcmfmac43430-sdio brcmfmac43455-sdio brcmfmac43456-sdio ; do
          install -m 0644 brcm/${fw}.* ${D}${nonarch_base_libdir}/firmware/brcm/
      done
      # add compat links. Fixes errors like
      # brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt failed with error -2
      ln -s brcmfmac43455-sdio.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt
      ln -s brcmfmac43455-sdio.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.txt
      ln -s brcmfmac43455-sdio.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt
      ln -s brcmfmac43430-sdio.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.txt
      ln -s brcmfmac43430-sdio.txt ${D}${nonarch_base_libdir}/firmware/brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.txt
  }
  
  PACKAGES = "\
  
negative.code: SECTION = "kernel"
  
  # In maintained upstream linux-firmware:
  # * brcmfmac43430-sdio falls under LICENSE.cypress
  # * brcmfmac43455-sdio falls under LICENSE.broadcom_bcm43xx
  # * brcmfmac43456-sdio falls under LICENSE.broadcom_bcm43xx
  #
  # It is likely[^1] that both of these should be under LICENSE.cypress.
  # Further, at this time the text of LICENSE.broadcom_bcm43xx is the same
  # in linux-firmware and RPi-Distro/firmware-nonfree, but this may
  # change.
  #
  