On Arduino Uno-Q, the eMMC boot1 partition is factory provisioned
with device-specific information such as the WiFi MAC address
and the Bluetooth BD address. This partition can serve as an
alternative to additional non-volatile memory, such as a
dedicated EEPROM.

The eMMC boot partitions are typically good candidates, as they
are relatively small, read-only by default (and can be enforced
as hardware read-only), and are not affected by board reflashing
procedures, which generally target the eMMC user or GP partitions.

Describe the corresponding nvmem-layout for the WiFi and Bluetooth
addresses, and point the WiFi and Bluetooth nodes to the appropriate
NVMEM cells to retrieve them.

Signed-off-by: Loic Poulain <[email protected]>
Reviewed-by: Konrad Dybcio <[email protected]>
---
 arch/arm64/boot/dts/qcom/qrb2210-arduino-imola.dts | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/qrb2210-arduino-imola.dts 
b/arch/arm64/boot/dts/qcom/qrb2210-arduino-imola.dts
index 
bf088fa9807f040f0c8f405f9111b01790b09377..6ed91cccae2fbf0723629a4db12d2724312d50b2
 100644
--- a/arch/arm64/boot/dts/qcom/qrb2210-arduino-imola.dts
+++ b/arch/arm64/boot/dts/qcom/qrb2210-arduino-imola.dts
@@ -409,7 +409,35 @@ &sdhc_1 {
        no-sdio;
        no-sd;
 
+       #address-cells = <1>;
+       #size-cells = <0>;
+
        status = "okay";
+
+       card@0 {
+               compatible = "mmc-card";
+               reg = <0>;
+
+               partitions-boot1 {
+                       nvmem-layout {
+                               compatible = "fixed-layout";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               wifi_mac_addr: mac-addr@4400 {
+                                       compatible = "mac-base";
+                                       reg = <0x4400 0x6>;
+                                       #nvmem-cell-cells = <1>;
+                               };
+
+                               bd_addr: bd-addr@5400 {
+                                       compatible = "mac-base";
+                                       reg = <0x5400 0x6>;
+                                       #nvmem-cell-cells = <1>;
+                               };
+                       };
+               };
+       };
 };
 
 &spi5 {
@@ -512,6 +540,9 @@ bluetooth {
                vddch0-supply = <&pm4125_l22>;
                enable-gpios = <&tlmm 87 GPIO_ACTIVE_HIGH>;
                max-speed = <3000000>;
+
+               nvmem-cells = <&bd_addr 0>;
+               nvmem-cell-names = "local-bd-address";
        };
 };
 
@@ -557,6 +588,9 @@ &wifi {
        qcom,ath10k-calibration-variant = "ArduinoImola";
        firmware-name = "qcm2290";
 
+       nvmem-cells = <&wifi_mac_addr 0>;
+       nvmem-cell-names = "mac-address";
+
        status = "okay";
 };
 

-- 
2.34.1


Reply via email to