Skip to contentSkip to conversation

board: stemmy: Read persistent radio addresses

PATCH New Linus Walleij 1 participant 1 message Nov 24

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 board: stemmy: Read persistent radio addresses

Samsung stores persistent Wi-Fi and Bluetooth addresses in several locations depending on the device and firmware. The eMMC partition numbers also differ between devices.

Locate the EFS and DATAFS partitions by name. Search the known Samsung Wi-Fi address files in priority order and support both Bluetooth EFS layouts. Accept colon-separated and compact addresses, including Codina's
bt_macaddr: record, while rejecting known firmware placeholders.

Pass valid addresses to the operating system through the radio device tree nodes from ft_board_setup().

---
Changes in v2:
- The code was overly cautious, use exact EFS and DATAFS names and
drop both partition lookup fallbacks.
- Clarify that fs_read() closes the filesystem even on failure.
- Use log_warning() and log_info() for radio address messages.
- Link to v1: https://patch.msgid.link/[email protected]

---
 MAINTAINERS                     |   1 +
 board/ste/stemmy/Makefile       |   2 +-
 board/ste/stemmy/stemmy-radio.c | 287 ++++++++++++++++++++++++++++++++++++++++
 board/ste/stemmy/stemmy-radio.h |   8 ++
 board/ste/stemmy/stemmy.c       |   4 +
 5 files changed, 301 insertions(+), 1 deletion(-)
MAINTAINERS +1 -0
index 6edf740a9ceb..ceb474751906 100644
@@ -772,6 +772,7 @@ R:	Linus Walleij <[email protected]>
 S:	Maintained
 F:	arch/arm/dts/ste-*
 F:	arch/arm/mach-u8500/
+F:	board/ste/stemmy/
 F:	drivers/gpio/nmk_gpio.c
 F:	drivers/pinctrl/pinctrl-nomadik.c
 F:	drivers/phy/phy-ab8500-usb.c
board/ste/stemmy/Makefile +1 -1
index 1245099bc918..f4e97c9d9972 100644
@@ -1,2 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
-obj-y	:= stemmy.o
+obj-y	:= stemmy.o stemmy-radio.o
board/ste/stemmy/stemmy-radio.c new file +287 -0

287 lines not on this page · raw message

board/ste/stemmy/stemmy-radio.h new file +8 -0
new file mode 100644
index 000000000000..3c3ce03669b8
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#ifndef __STEMMY_RADIO_H
+#define __STEMMY_RADIO_H
+
+void stemmy_radio_fixup(void *fdt);
+
+#endif
board/ste/stemmy/stemmy.c +4 -0
index 8526deeb29bc..97957e12d5b0 100644
@@ -12,6 +12,8 @@
 #include <asm/setup.h>
 #include <asm/system.h>
 
+#include "stemmy-radio.h"
+
 DECLARE_GLOBAL_DATA_PTR;
 
 /* Parse atags provided by Samsung bootloader to get available memory */
@@ -545,5 +547,7 @@ int ft_board_setup(void *fdt, struct bd_info *bd)
 		skomer_kyle_patch_display(fdt);
 	}
 
+	stemmy_radio_fixup(fdt);
+
 	return 0;
 }

---
base-commit: f2e99724255470a12119f696a0c579fd873cbef9
change-id: 20261110-ux500-efs-cb818375e8f6

Best regards,

Signature · 1 line
Linus Walleij <[email protected]>