The firmware sets local-bd-address, copy it when loading a new DT.

Signed-off-by: Fiona Klute <fiona.kl...@gmx.de>
---
This simple copy works with upstream Linux DT, and with the downstream
RPi one as long as BT has not been moved to mini-UART. The downstream
DT additionally defines /aliases/bluetooth, which is updated by the
matching overlays. A more generic (but also more complex) approach
would be to *try* using /aliases/bluetooth, and fall back to the fixed
path if it's undefined. If that's preferred I'm happy to update the
patch.

 board/raspberrypi/rpi/rpi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 6ca7cd74eff..47674b23be2 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -621,6 +621,9 @@ void  update_fdt_from_fw(void *fdt, void *fw_fdt)
 
        /* address of the PHY device as provided by the firmware  */
        copy_property(fdt, fw_fdt, "ethernet0/mdio@e14/ethernet-phy@1", "reg");
+
+       /* Bluetooth device address as provided by the firmware */
+       copy_property(fdt, fw_fdt, "/soc/serial@7e201000/bluetooth", 
"local-bd-address");
 }
 
 int ft_board_setup(void *blob, struct bd_info *bd)
-- 
2.47.2

Reply via email to