1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0 2c66ec88fSEmmanuel Vadot%YAML 1.2 3c66ec88fSEmmanuel Vadot--- 4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/sram/sram.yaml# 5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6c66ec88fSEmmanuel Vadot 7c66ec88fSEmmanuel Vadottitle: Generic on-chip SRAM 8c66ec88fSEmmanuel Vadot 9c66ec88fSEmmanuel Vadotmaintainers: 10c66ec88fSEmmanuel Vadot - Rob Herring <robh@kernel.org> 11c66ec88fSEmmanuel Vadot 12c66ec88fSEmmanuel Vadotdescription: |+ 13c66ec88fSEmmanuel Vadot Simple IO memory regions to be managed by the genalloc API. 14c66ec88fSEmmanuel Vadot 15c66ec88fSEmmanuel Vadot Each child of the sram node specifies a region of reserved memory. Each 16c66ec88fSEmmanuel Vadot child node should use a 'reg' property to specify a specific range of 17c66ec88fSEmmanuel Vadot reserved memory. 18c66ec88fSEmmanuel Vadot 19c66ec88fSEmmanuel Vadot Following the generic-names recommended practice, node names should 20c66ec88fSEmmanuel Vadot reflect the purpose of the node. Unit address (@<address>) should be 21c66ec88fSEmmanuel Vadot appended to the name. 22c66ec88fSEmmanuel Vadot 23c66ec88fSEmmanuel Vadotproperties: 24c66ec88fSEmmanuel Vadot $nodename: 25c66ec88fSEmmanuel Vadot pattern: "^sram(@.*)?" 26c66ec88fSEmmanuel Vadot 27c66ec88fSEmmanuel Vadot compatible: 28c66ec88fSEmmanuel Vadot contains: 29c66ec88fSEmmanuel Vadot enum: 30c66ec88fSEmmanuel Vadot - mmio-sram 315956d97fSEmmanuel Vadot - amlogic,meson-gxbb-sram 325956d97fSEmmanuel Vadot - arm,juno-sram-ns 33c66ec88fSEmmanuel Vadot - atmel,sama5d2-securam 34e67e8565SEmmanuel Vadot - nvidia,tegra186-sysram 35e67e8565SEmmanuel Vadot - nvidia,tegra194-sysram 36e67e8565SEmmanuel Vadot - nvidia,tegra234-sysram 378cc087a1SEmmanuel Vadot - qcom,rpm-msg-ram 38c66ec88fSEmmanuel Vadot - rockchip,rk3288-pmu-sram 39c66ec88fSEmmanuel Vadot 40c66ec88fSEmmanuel Vadot reg: 41c66ec88fSEmmanuel Vadot maxItems: 1 42c66ec88fSEmmanuel Vadot 43c66ec88fSEmmanuel Vadot clocks: 445def4c47SEmmanuel Vadot maxItems: 1 45c66ec88fSEmmanuel Vadot description: 46c66ec88fSEmmanuel Vadot A list of phandle and clock specifier pair that controls the single 47c66ec88fSEmmanuel Vadot SRAM clock. 48c66ec88fSEmmanuel Vadot 49c66ec88fSEmmanuel Vadot "#address-cells": 50c66ec88fSEmmanuel Vadot const: 1 51c66ec88fSEmmanuel Vadot 52c66ec88fSEmmanuel Vadot "#size-cells": 53c66ec88fSEmmanuel Vadot const: 1 54c66ec88fSEmmanuel Vadot 55c66ec88fSEmmanuel Vadot ranges: 565def4c47SEmmanuel Vadot maxItems: 1 57c66ec88fSEmmanuel Vadot description: 58c66ec88fSEmmanuel Vadot Should translate from local addresses within the sram to bus addresses. 59c66ec88fSEmmanuel Vadot 60c66ec88fSEmmanuel Vadot no-memory-wc: 61c66ec88fSEmmanuel Vadot description: 62c66ec88fSEmmanuel Vadot The flag indicating, that SRAM memory region has not to be remapped 63c66ec88fSEmmanuel Vadot as write combining. WC is used by default. 64c66ec88fSEmmanuel Vadot type: boolean 65c66ec88fSEmmanuel Vadot 66c66ec88fSEmmanuel VadotpatternProperties: 678cc087a1SEmmanuel Vadot "^([a-z0-9]*-)?sram(-section)?@[a-f0-9]+$": 68c66ec88fSEmmanuel Vadot type: object 69c66ec88fSEmmanuel Vadot description: 70c66ec88fSEmmanuel Vadot Each child of the sram node specifies a region of reserved memory. 71c66ec88fSEmmanuel Vadot properties: 72c66ec88fSEmmanuel Vadot compatible: 73c66ec88fSEmmanuel Vadot description: 74c66ec88fSEmmanuel Vadot Should contain a vendor specific string in the form 75c66ec88fSEmmanuel Vadot <vendor>,[<device>-]<usage> 76c66ec88fSEmmanuel Vadot contains: 77c66ec88fSEmmanuel Vadot enum: 78c66ec88fSEmmanuel Vadot - allwinner,sun4i-a10-sram-a3-a4 79c66ec88fSEmmanuel Vadot - allwinner,sun4i-a10-sram-c1 80c66ec88fSEmmanuel Vadot - allwinner,sun4i-a10-sram-d 81c66ec88fSEmmanuel Vadot - allwinner,sun9i-a80-smp-sram 82c66ec88fSEmmanuel Vadot - allwinner,sun50i-a64-sram-c 835def4c47SEmmanuel Vadot - amlogic,meson8-ao-arc-sram 845def4c47SEmmanuel Vadot - amlogic,meson8b-ao-arc-sram 85c66ec88fSEmmanuel Vadot - amlogic,meson8-smp-sram 86c66ec88fSEmmanuel Vadot - amlogic,meson8b-smp-sram 87c66ec88fSEmmanuel Vadot - amlogic,meson-gxbb-scp-shmem 88c66ec88fSEmmanuel Vadot - amlogic,meson-axg-scp-shmem 895956d97fSEmmanuel Vadot - arm,juno-scp-shmem 905956d97fSEmmanuel Vadot - arm,scmi-shmem 915956d97fSEmmanuel Vadot - arm,scp-shmem 92c66ec88fSEmmanuel Vadot - renesas,smp-sram 93c66ec88fSEmmanuel Vadot - rockchip,rk3066-smp-sram 94c66ec88fSEmmanuel Vadot - samsung,exynos4210-sysram 95c66ec88fSEmmanuel Vadot - samsung,exynos4210-sysram-ns 96c66ec88fSEmmanuel Vadot - socionext,milbeaut-smp-sram 97*f126890aSEmmanuel Vadot - stericsson,u8500-esram 98c66ec88fSEmmanuel Vadot 99c66ec88fSEmmanuel Vadot reg: 100c66ec88fSEmmanuel Vadot description: 101c66ec88fSEmmanuel Vadot IO mem address range, relative to the SRAM range. 102c66ec88fSEmmanuel Vadot maxItems: 1 103c66ec88fSEmmanuel Vadot 104c66ec88fSEmmanuel Vadot pool: 105c66ec88fSEmmanuel Vadot description: 106c66ec88fSEmmanuel Vadot Indicates that the particular reserved SRAM area is addressable 107c66ec88fSEmmanuel Vadot and in use by another device or devices. 108c66ec88fSEmmanuel Vadot type: boolean 109c66ec88fSEmmanuel Vadot 110c66ec88fSEmmanuel Vadot export: 111c66ec88fSEmmanuel Vadot description: 112c66ec88fSEmmanuel Vadot Indicates that the reserved SRAM area may be accessed outside 113c66ec88fSEmmanuel Vadot of the kernel, e.g. by bootloader or userspace. 114c66ec88fSEmmanuel Vadot type: boolean 115c66ec88fSEmmanuel Vadot 116c66ec88fSEmmanuel Vadot protect-exec: 117c66ec88fSEmmanuel Vadot description: | 118c66ec88fSEmmanuel Vadot Same as 'pool' above but with the additional constraint that code 119c66ec88fSEmmanuel Vadot will be run from the region and that the memory is maintained as 120c66ec88fSEmmanuel Vadot read-only, executable during code execution. NOTE: This region must 121c66ec88fSEmmanuel Vadot be page aligned on start and end in order to properly allow 122c66ec88fSEmmanuel Vadot manipulation of the page attributes. 123c66ec88fSEmmanuel Vadot type: boolean 124c66ec88fSEmmanuel Vadot 125c66ec88fSEmmanuel Vadot label: 126c66ec88fSEmmanuel Vadot description: 127c66ec88fSEmmanuel Vadot The name for the reserved partition, if omitted, the label is taken 128c66ec88fSEmmanuel Vadot from the node name excluding the unit address. 129c66ec88fSEmmanuel Vadot 130c66ec88fSEmmanuel Vadot required: 131c66ec88fSEmmanuel Vadot - reg 132c66ec88fSEmmanuel Vadot 133c66ec88fSEmmanuel Vadot additionalProperties: false 134c66ec88fSEmmanuel Vadot 135c66ec88fSEmmanuel Vadotrequired: 136c66ec88fSEmmanuel Vadot - compatible 137c66ec88fSEmmanuel Vadot - reg 138c66ec88fSEmmanuel Vadot 139c66ec88fSEmmanuel Vadotif: 140c9ccf3a3SEmmanuel Vadot not: 141c66ec88fSEmmanuel Vadot properties: 142c66ec88fSEmmanuel Vadot compatible: 143c66ec88fSEmmanuel Vadot contains: 1448cc087a1SEmmanuel Vadot enum: 1458cc087a1SEmmanuel Vadot - qcom,rpm-msg-ram 1468cc087a1SEmmanuel Vadot - rockchip,rk3288-pmu-sram 147c9ccf3a3SEmmanuel Vadotthen: 148c66ec88fSEmmanuel Vadot required: 149c66ec88fSEmmanuel Vadot - "#address-cells" 150c66ec88fSEmmanuel Vadot - "#size-cells" 151c66ec88fSEmmanuel Vadot - ranges 152c66ec88fSEmmanuel Vadot 153c66ec88fSEmmanuel VadotadditionalProperties: false 154c66ec88fSEmmanuel Vadot 155c66ec88fSEmmanuel Vadotexamples: 156c66ec88fSEmmanuel Vadot - | 157c66ec88fSEmmanuel Vadot sram@5c000000 { 158c66ec88fSEmmanuel Vadot compatible = "mmio-sram"; 159c66ec88fSEmmanuel Vadot reg = <0x5c000000 0x40000>; /* 256 KiB SRAM at address 0x5c000000 */ 160c66ec88fSEmmanuel Vadot 161c66ec88fSEmmanuel Vadot #address-cells = <1>; 162c66ec88fSEmmanuel Vadot #size-cells = <1>; 163c66ec88fSEmmanuel Vadot ranges = <0 0x5c000000 0x40000>; 164c66ec88fSEmmanuel Vadot 165c66ec88fSEmmanuel Vadot smp-sram@100 { 166c66ec88fSEmmanuel Vadot reg = <0x100 0x50>; 167c66ec88fSEmmanuel Vadot }; 168c66ec88fSEmmanuel Vadot 169c66ec88fSEmmanuel Vadot device-sram@1000 { 170c66ec88fSEmmanuel Vadot reg = <0x1000 0x1000>; 171c66ec88fSEmmanuel Vadot pool; 172c66ec88fSEmmanuel Vadot }; 173c66ec88fSEmmanuel Vadot 174c66ec88fSEmmanuel Vadot exported-sram@20000 { 175c66ec88fSEmmanuel Vadot reg = <0x20000 0x20000>; 176c66ec88fSEmmanuel Vadot export; 177c66ec88fSEmmanuel Vadot }; 178c66ec88fSEmmanuel Vadot }; 179c66ec88fSEmmanuel Vadot 180c66ec88fSEmmanuel Vadot - | 181c66ec88fSEmmanuel Vadot // Samsung SMP-capable Exynos SoCs use part of the SYSRAM for the bringup 182c66ec88fSEmmanuel Vadot // of the secondary cores. Once the core gets powered up it executes the 183c66ec88fSEmmanuel Vadot // code that is residing at some specific location of the SYSRAM. 184c66ec88fSEmmanuel Vadot // 185c66ec88fSEmmanuel Vadot // Therefore reserved section sub-nodes have to be added to the mmio-sram 186c66ec88fSEmmanuel Vadot // declaration. These nodes are of two types depending upon secure or 187c66ec88fSEmmanuel Vadot // non-secure execution environment. 188c66ec88fSEmmanuel Vadot sram@2020000 { 189c66ec88fSEmmanuel Vadot compatible = "mmio-sram"; 190c66ec88fSEmmanuel Vadot reg = <0x02020000 0x54000>; 191c66ec88fSEmmanuel Vadot #address-cells = <1>; 192c66ec88fSEmmanuel Vadot #size-cells = <1>; 193c66ec88fSEmmanuel Vadot ranges = <0 0x02020000 0x54000>; 194c66ec88fSEmmanuel Vadot 195c66ec88fSEmmanuel Vadot smp-sram@0 { 196c66ec88fSEmmanuel Vadot compatible = "samsung,exynos4210-sysram"; 197c66ec88fSEmmanuel Vadot reg = <0x0 0x1000>; 198c66ec88fSEmmanuel Vadot }; 199c66ec88fSEmmanuel Vadot 200c66ec88fSEmmanuel Vadot smp-sram@53000 { 201c66ec88fSEmmanuel Vadot compatible = "samsung,exynos4210-sysram-ns"; 202c66ec88fSEmmanuel Vadot reg = <0x53000 0x1000>; 203c66ec88fSEmmanuel Vadot }; 204c66ec88fSEmmanuel Vadot }; 205c66ec88fSEmmanuel Vadot 206c66ec88fSEmmanuel Vadot - | 207c66ec88fSEmmanuel Vadot // Amlogic's SMP-capable SoCs use part of the sram for the bringup of the cores. 208c66ec88fSEmmanuel Vadot // Once the core gets powered up it executes the code that is residing at a 209c66ec88fSEmmanuel Vadot // specific location. 210c66ec88fSEmmanuel Vadot // 211c66ec88fSEmmanuel Vadot // Therefore a reserved section sub-node has to be added to the mmio-sram 212c66ec88fSEmmanuel Vadot // declaration. 213c66ec88fSEmmanuel Vadot sram@d9000000 { 214c66ec88fSEmmanuel Vadot compatible = "mmio-sram"; 215c66ec88fSEmmanuel Vadot reg = <0xd9000000 0x20000>; 216c66ec88fSEmmanuel Vadot #address-cells = <1>; 217c66ec88fSEmmanuel Vadot #size-cells = <1>; 218c66ec88fSEmmanuel Vadot ranges = <0 0xd9000000 0x20000>; 219c66ec88fSEmmanuel Vadot 220c66ec88fSEmmanuel Vadot smp-sram@1ff80 { 221c66ec88fSEmmanuel Vadot compatible = "amlogic,meson8b-smp-sram"; 222c66ec88fSEmmanuel Vadot reg = <0x1ff80 0x8>; 223c66ec88fSEmmanuel Vadot }; 224c66ec88fSEmmanuel Vadot }; 225c66ec88fSEmmanuel Vadot 226c66ec88fSEmmanuel Vadot - | 227c66ec88fSEmmanuel Vadot sram@e63c0000 { 228c66ec88fSEmmanuel Vadot compatible = "mmio-sram"; 229c66ec88fSEmmanuel Vadot reg = <0xe63c0000 0x1000>; 230c66ec88fSEmmanuel Vadot #address-cells = <1>; 231c66ec88fSEmmanuel Vadot #size-cells = <1>; 232c66ec88fSEmmanuel Vadot ranges = <0 0xe63c0000 0x1000>; 233c66ec88fSEmmanuel Vadot 234c66ec88fSEmmanuel Vadot smp-sram@0 { 235c66ec88fSEmmanuel Vadot compatible = "renesas,smp-sram"; 236c66ec88fSEmmanuel Vadot reg = <0 0x10>; 237c66ec88fSEmmanuel Vadot }; 238c66ec88fSEmmanuel Vadot }; 239c66ec88fSEmmanuel Vadot 240c66ec88fSEmmanuel Vadot - | 241c66ec88fSEmmanuel Vadot sram@10080000 { 242c66ec88fSEmmanuel Vadot compatible = "mmio-sram"; 243c66ec88fSEmmanuel Vadot reg = <0x10080000 0x10000>; 244c66ec88fSEmmanuel Vadot #address-cells = <1>; 245c66ec88fSEmmanuel Vadot #size-cells = <1>; 246c66ec88fSEmmanuel Vadot ranges; 247c66ec88fSEmmanuel Vadot 248c66ec88fSEmmanuel Vadot smp-sram@10080000 { 249c66ec88fSEmmanuel Vadot compatible = "rockchip,rk3066-smp-sram"; 250c66ec88fSEmmanuel Vadot reg = <0x10080000 0x50>; 251c66ec88fSEmmanuel Vadot }; 252c66ec88fSEmmanuel Vadot }; 253c66ec88fSEmmanuel Vadot 254c66ec88fSEmmanuel Vadot - | 255c66ec88fSEmmanuel Vadot // Rockchip's rk3288 SoC uses the sram of pmu to store the function of 256c66ec88fSEmmanuel Vadot // resume from maskrom(the 1st level loader). This is a common use of 257c66ec88fSEmmanuel Vadot // the "pmu-sram" because it keeps power even in low power states 258c66ec88fSEmmanuel Vadot // in the system. 259c66ec88fSEmmanuel Vadot sram@ff720000 { 260c66ec88fSEmmanuel Vadot compatible = "rockchip,rk3288-pmu-sram", "mmio-sram"; 261c66ec88fSEmmanuel Vadot reg = <0xff720000 0x1000>; 262c66ec88fSEmmanuel Vadot }; 263c66ec88fSEmmanuel Vadot 264c66ec88fSEmmanuel Vadot - | 265c66ec88fSEmmanuel Vadot // Allwinner's A80 SoC uses part of the secure sram for hotplugging of the 266c66ec88fSEmmanuel Vadot // primary core (cpu0). Once the core gets powered up it checks if a magic 267c66ec88fSEmmanuel Vadot // value is set at a specific location. If it is then the BROM will jump 268c66ec88fSEmmanuel Vadot // to the software entry address, instead of executing a standard boot. 269c66ec88fSEmmanuel Vadot // 270c66ec88fSEmmanuel Vadot // Also there are no "secure-only" properties. The implementation should 271c66ec88fSEmmanuel Vadot // check if this SRAM is usable first. 272c66ec88fSEmmanuel Vadot sram@20000 { 273c66ec88fSEmmanuel Vadot // 256 KiB secure SRAM at 0x20000 274c66ec88fSEmmanuel Vadot compatible = "mmio-sram"; 275c66ec88fSEmmanuel Vadot reg = <0x00020000 0x40000>; 276c66ec88fSEmmanuel Vadot #address-cells = <1>; 277c66ec88fSEmmanuel Vadot #size-cells = <1>; 278c66ec88fSEmmanuel Vadot ranges = <0 0x00020000 0x40000>; 279c66ec88fSEmmanuel Vadot 280c66ec88fSEmmanuel Vadot smp-sram@1000 { 281c66ec88fSEmmanuel Vadot // This is checked by BROM to determine if 282c66ec88fSEmmanuel Vadot // cpu0 should jump to SMP entry vector 283c66ec88fSEmmanuel Vadot compatible = "allwinner,sun9i-a80-smp-sram"; 284c66ec88fSEmmanuel Vadot reg = <0x1000 0x8>; 285c66ec88fSEmmanuel Vadot }; 286c66ec88fSEmmanuel Vadot }; 287c66ec88fSEmmanuel Vadot 288c66ec88fSEmmanuel Vadot - | 289c66ec88fSEmmanuel Vadot sram@0 { 290c66ec88fSEmmanuel Vadot compatible = "mmio-sram"; 291c66ec88fSEmmanuel Vadot reg = <0x0 0x10000>; 292c66ec88fSEmmanuel Vadot #address-cells = <1>; 293c66ec88fSEmmanuel Vadot #size-cells = <1>; 294c66ec88fSEmmanuel Vadot ranges = <0 0x0 0x10000>; 295c66ec88fSEmmanuel Vadot 296c66ec88fSEmmanuel Vadot smp-sram@f100 { 297c66ec88fSEmmanuel Vadot compatible = "socionext,milbeaut-smp-sram"; 298c66ec88fSEmmanuel Vadot reg = <0xf100 0x20>; 299c66ec88fSEmmanuel Vadot }; 300c66ec88fSEmmanuel Vadot }; 301