From ec2216edd465bcc7bd423ba2cae1058c22a8ef7e Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Fri, 5 Apr 2024 11:58:47 +0100 Subject: [PATCH 1011/1085] nvmem: raspberrypi: Enable nvmem otp driver through DT Signed-off-by: Dom Cobley --- arch/arm/boot/dts/broadcom/bcm2708-rpi.dtsi | 17 ++++++++++ .../arm/boot/dts/broadcom/bcm2711-rpi-ds.dtsi | 23 +++++++++++++ arch/arm/boot/dts/broadcom/bcm2712-rpi.dtsi | 32 +++++++++++++++++++ arch/arm/boot/dts/overlays/README | 6 ++++ 4 files changed, 78 insertions(+) --- a/arch/arm/boot/dts/broadcom/bcm2708-rpi.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm2708-rpi.dtsi @@ -19,11 +19,28 @@ hdmi = <&hdmi>,"status"; i2c2_iknowwhatimdoing = <&i2c2>,"status"; i2c2_baudrate = <&i2c2>,"clock-frequency:0"; + nvmem_cust_rw = <&nvmem_cust>,"rw?"; sd = <&sdhost>,"status"; sd_poll_once = <&sdhost>,"non-removable?"; }; }; +&soc { + nvmem_otp: nvmem_otp { + compatible = "raspberrypi,rpi-otp"; + firmware = <&firmware>; + reg = <0 192>; + status = "okay"; + }; + + nvmem_cust: nvmem_cust { + compatible = "raspberrypi,rpi-otp"; + firmware = <&firmware>; + reg = <1 8>; + status = "okay"; + }; +}; + &sdhost { pinctrl-names = "default"; pinctrl-0 = <&sdhost_gpio48>; --- a/arch/arm/boot/dts/broadcom/bcm2711-rpi-ds.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi-ds.dtsi @@ -10,6 +10,8 @@ eee = <&chosen>,"bootargs{on='',off='genet.eee=N'}"; hdmi = <&hdmi0>,"status", <&hdmi1>,"status"; + nvmem_cust_rw = <&nvmem_cust>,"rw?"; + nvmem_priv_rw = <&nvmem_priv>,"rw?"; pcie = <&pcie0>,"status"; sd = <&emmc2>,"status"; @@ -88,6 +90,27 @@ /* Add the physical <-> DMA mapping for the I/O space */ dma-ranges = <0xc0000000 0x0 0x00000000 0x40000000>, <0x7c000000 0x0 0xfc000000 0x03800000>; + + nvmem_otp: nvmem_otp { + compatible = "raspberrypi,rpi-otp"; + firmware = <&firmware>; + reg = <0 166>; + status = "okay"; + }; + + nvmem_cust: nvmem_cust { + compatible = "raspberrypi,rpi-otp"; + firmware = <&firmware>; + reg = <1 8>; + status = "okay"; + }; + + nvmem_priv: nvmem_priv { + compatible = "raspberrypi,rpi-otp"; + firmware = <&firmware>; + reg = <3 8>; + status = "okay"; + }; }; &scb { --- a/arch/arm/boot/dts/broadcom/bcm2712-rpi.dtsi +++ b/arch/arm/boot/dts/broadcom/bcm2712-rpi.dtsi @@ -45,6 +45,34 @@ trickle-charge-microvolt = <0>; }; + nvmem_otp: nvmem_otp { + compatible = "raspberrypi,rpi-otp"; + firmware = <&firmware>; + reg = <0 192>; + status = "okay"; + }; + + nvmem_cust: nvmem_cust { + compatible = "raspberrypi,rpi-otp"; + firmware = <&firmware>; + reg = <1 8>; + status = "okay"; + }; + + nvmem_mac: nvmem_mac { + compatible = "raspberrypi,rpi-otp"; + firmware = <&firmware>; + reg = <2 6>; + status = "okay"; + }; + + nvmem_priv: nvmem_priv { + compatible = "raspberrypi,rpi-otp"; + firmware = <&firmware>; + reg = <3 16>; + status = "okay"; + }; + /* Define these notional regulators for use by overlays, etc. */ vdd_3v3_reg: fixedregulator_3v3 { compatible = "regulator-fixed"; @@ -67,6 +95,10 @@ __overrides__ { arm_freq; axiperf = <&axiperf>,"status"; + + nvmem_cust_rw = <&nvmem_cust>,"rw?"; + nvmem_priv_rw = <&nvmem_priv>,"rw?"; + nvmem_mac_rw = <&nvmem_mac>,"rw?"; }; }; --- a/arch/arm/boot/dts/overlays/README +++ b/arch/arm/boot/dts/overlays/README @@ -300,6 +300,12 @@ Params: nvme Alias for "pciex1" (2712 only) + nvmem_cust_rw Allow read/write access to customer otp + + nvmem_mac_rw Allow read/write access to mac addresses otp + + nvmem_priv_rw Allow read/write access to customer private otp + pcie Set to "off" to disable the PCIe interface (default "on") (2711 only, but not applicable on CM4S)