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 34*e67e8565SEmmanuel Vadot - nvidia,tegra186-sysram 35*e67e8565SEmmanuel Vadot - nvidia,tegra194-sysram 36*e67e8565SEmmanuel 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 97c66ec88fSEmmanuel Vadot 98c66ec88fSEmmanuel Vadot reg: 99c66ec88fSEmmanuel Vadot description: 100c66ec88fSEmmanuel Vadot IO mem address range, relative to the SRAM range. 101c66ec88fSEmmanuel Vadot maxItems: 1 102c66ec88fSEmmanuel Vadot 103c66ec88fSEmmanuel Vadot pool: 104c66ec88fSEmmanuel Vadot description: 105c66ec88fSEmmanuel Vadot Indicates that the particular reserved SRAM area is addressable 106c66ec88fSEmmanuel Vadot and in use by another device or devices. 107c66ec88fSEmmanuel Vadot type: boolean 108c66ec88fSEmmanuel Vadot 109c66ec88fSEmmanuel Vadot export: 110c66ec88fSEmmanuel Vadot description: 111c66ec88fSEmmanuel Vadot Indicates that the reserved SRAM area may be accessed outside 112c66ec88fSEmmanuel Vadot of the kernel, e.g. by bootloader or userspace. 113c66ec88fSEmmanuel Vadot type: boolean 114c66ec88fSEmmanuel Vadot 115c66ec88fSEmmanuel Vadot protect-exec: 116c66ec88fSEmmanuel Vadot description: | 117c66ec88fSEmmanuel Vadot Same as 'pool' above but with the additional constraint that code 118c66ec88fSEmmanuel Vadot will be run from the region and that the memory is maintained as 119c66ec88fSEmmanuel Vadot read-only, executable during code execution. NOTE: This region must 120c66ec88fSEmmanuel Vadot be page aligned on start and end in order to properly allow 121c66ec88fSEmmanuel Vadot manipulation of the page attributes. 122c66ec88fSEmmanuel Vadot type: boolean 123c66ec88fSEmmanuel Vadot 124c66ec88fSEmmanuel Vadot label: 125c66ec88fSEmmanuel Vadot description: 126c66ec88fSEmmanuel Vadot The name for the reserved partition, if omitted, the label is taken 127c66ec88fSEmmanuel Vadot from the node name excluding the unit address. 128c66ec88fSEmmanuel Vadot 129c66ec88fSEmmanuel Vadot required: 130c66ec88fSEmmanuel Vadot - reg 131c66ec88fSEmmanuel Vadot 132c66ec88fSEmmanuel Vadot additionalProperties: false 133c66ec88fSEmmanuel Vadot 134c66ec88fSEmmanuel Vadotrequired: 135c66ec88fSEmmanuel Vadot - compatible 136c66ec88fSEmmanuel Vadot - reg 137c66ec88fSEmmanuel Vadot 138c66ec88fSEmmanuel Vadotif: 139c66ec88fSEmmanuel Vadot properties: 140c66ec88fSEmmanuel Vadot compatible: 141c66ec88fSEmmanuel Vadot contains: 1428cc087a1SEmmanuel Vadot enum: 1438cc087a1SEmmanuel Vadot - qcom,rpm-msg-ram 1448cc087a1SEmmanuel Vadot - rockchip,rk3288-pmu-sram 145c66ec88fSEmmanuel Vadot 146c66ec88fSEmmanuel Vadotelse: 147c66ec88fSEmmanuel Vadot required: 148c66ec88fSEmmanuel Vadot - "#address-cells" 149c66ec88fSEmmanuel Vadot - "#size-cells" 150c66ec88fSEmmanuel Vadot - ranges 151c66ec88fSEmmanuel Vadot 152c66ec88fSEmmanuel VadotadditionalProperties: false 153c66ec88fSEmmanuel Vadot 154c66ec88fSEmmanuel Vadotexamples: 155c66ec88fSEmmanuel Vadot - | 156c66ec88fSEmmanuel Vadot sram@5c000000 { 157c66ec88fSEmmanuel Vadot compatible = "mmio-sram"; 158c66ec88fSEmmanuel Vadot reg = <0x5c000000 0x40000>; /* 256 KiB SRAM at address 0x5c000000 */ 159c66ec88fSEmmanuel Vadot 160c66ec88fSEmmanuel Vadot #address-cells = <1>; 161c66ec88fSEmmanuel Vadot #size-cells = <1>; 162c66ec88fSEmmanuel Vadot ranges = <0 0x5c000000 0x40000>; 163c66ec88fSEmmanuel Vadot 164c66ec88fSEmmanuel Vadot smp-sram@100 { 165c66ec88fSEmmanuel Vadot reg = <0x100 0x50>; 166c66ec88fSEmmanuel Vadot }; 167c66ec88fSEmmanuel Vadot 168c66ec88fSEmmanuel Vadot device-sram@1000 { 169c66ec88fSEmmanuel Vadot reg = <0x1000 0x1000>; 170c66ec88fSEmmanuel Vadot pool; 171c66ec88fSEmmanuel Vadot }; 172c66ec88fSEmmanuel Vadot 173c66ec88fSEmmanuel Vadot exported-sram@20000 { 174c66ec88fSEmmanuel Vadot reg = <0x20000 0x20000>; 175c66ec88fSEmmanuel Vadot export; 176c66ec88fSEmmanuel Vadot }; 177c66ec88fSEmmanuel Vadot }; 178c66ec88fSEmmanuel Vadot 179c66ec88fSEmmanuel Vadot - | 180c66ec88fSEmmanuel Vadot // Samsung SMP-capable Exynos SoCs use part of the SYSRAM for the bringup 181c66ec88fSEmmanuel Vadot // of the secondary cores. Once the core gets powered up it executes the 182c66ec88fSEmmanuel Vadot // code that is residing at some specific location of the SYSRAM. 183c66ec88fSEmmanuel Vadot // 184c66ec88fSEmmanuel Vadot // Therefore reserved section sub-nodes have to be added to the mmio-sram 185c66ec88fSEmmanuel Vadot // declaration. These nodes are of two types depending upon secure or 186c66ec88fSEmmanuel Vadot // non-secure execution environment. 187c66ec88fSEmmanuel Vadot sram@2020000 { 188c66ec88fSEmmanuel Vadot compatible = "mmio-sram"; 189c66ec88fSEmmanuel Vadot reg = <0x02020000 0x54000>; 190c66ec88fSEmmanuel Vadot #address-cells = <1>; 191c66ec88fSEmmanuel Vadot #size-cells = <1>; 192c66ec88fSEmmanuel Vadot ranges = <0 0x02020000 0x54000>; 193c66ec88fSEmmanuel Vadot 194c66ec88fSEmmanuel Vadot smp-sram@0 { 195c66ec88fSEmmanuel Vadot compatible = "samsung,exynos4210-sysram"; 196c66ec88fSEmmanuel Vadot reg = <0x0 0x1000>; 197c66ec88fSEmmanuel Vadot }; 198c66ec88fSEmmanuel Vadot 199c66ec88fSEmmanuel Vadot smp-sram@53000 { 200c66ec88fSEmmanuel Vadot compatible = "samsung,exynos4210-sysram-ns"; 201c66ec88fSEmmanuel Vadot reg = <0x53000 0x1000>; 202c66ec88fSEmmanuel Vadot }; 203c66ec88fSEmmanuel Vadot }; 204c66ec88fSEmmanuel Vadot 205c66ec88fSEmmanuel Vadot - | 206c66ec88fSEmmanuel Vadot // Amlogic's SMP-capable SoCs use part of the sram for the bringup of the cores. 207c66ec88fSEmmanuel Vadot // Once the core gets powered up it executes the code that is residing at a 208c66ec88fSEmmanuel Vadot // specific location. 209c66ec88fSEmmanuel Vadot // 210c66ec88fSEmmanuel Vadot // Therefore a reserved section sub-node has to be added to the mmio-sram 211c66ec88fSEmmanuel Vadot // declaration. 212c66ec88fSEmmanuel Vadot sram@d9000000 { 213c66ec88fSEmmanuel Vadot compatible = "mmio-sram"; 214c66ec88fSEmmanuel Vadot reg = <0xd9000000 0x20000>; 215c66ec88fSEmmanuel Vadot #address-cells = <1>; 216c66ec88fSEmmanuel Vadot #size-cells = <1>; 217c66ec88fSEmmanuel Vadot ranges = <0 0xd9000000 0x20000>; 218c66ec88fSEmmanuel Vadot 219c66ec88fSEmmanuel Vadot smp-sram@1ff80 { 220c66ec88fSEmmanuel Vadot compatible = "amlogic,meson8b-smp-sram"; 221c66ec88fSEmmanuel Vadot reg = <0x1ff80 0x8>; 222c66ec88fSEmmanuel Vadot }; 223c66ec88fSEmmanuel Vadot }; 224c66ec88fSEmmanuel Vadot 225c66ec88fSEmmanuel Vadot - | 226c66ec88fSEmmanuel Vadot sram@e63c0000 { 227c66ec88fSEmmanuel Vadot compatible = "mmio-sram"; 228c66ec88fSEmmanuel Vadot reg = <0xe63c0000 0x1000>; 229c66ec88fSEmmanuel Vadot #address-cells = <1>; 230c66ec88fSEmmanuel Vadot #size-cells = <1>; 231c66ec88fSEmmanuel Vadot ranges = <0 0xe63c0000 0x1000>; 232c66ec88fSEmmanuel Vadot 233c66ec88fSEmmanuel Vadot smp-sram@0 { 234c66ec88fSEmmanuel Vadot compatible = "renesas,smp-sram"; 235c66ec88fSEmmanuel Vadot reg = <0 0x10>; 236c66ec88fSEmmanuel Vadot }; 237c66ec88fSEmmanuel Vadot }; 238c66ec88fSEmmanuel Vadot 239c66ec88fSEmmanuel Vadot - | 240c66ec88fSEmmanuel Vadot sram@10080000 { 241c66ec88fSEmmanuel Vadot compatible = "mmio-sram"; 242c66ec88fSEmmanuel Vadot reg = <0x10080000 0x10000>; 243c66ec88fSEmmanuel Vadot #address-cells = <1>; 244c66ec88fSEmmanuel Vadot #size-cells = <1>; 245c66ec88fSEmmanuel Vadot ranges; 246c66ec88fSEmmanuel Vadot 247c66ec88fSEmmanuel Vadot smp-sram@10080000 { 248c66ec88fSEmmanuel Vadot compatible = "rockchip,rk3066-smp-sram"; 249c66ec88fSEmmanuel Vadot reg = <0x10080000 0x50>; 250c66ec88fSEmmanuel Vadot }; 251c66ec88fSEmmanuel Vadot }; 252c66ec88fSEmmanuel Vadot 253c66ec88fSEmmanuel Vadot - | 254c66ec88fSEmmanuel Vadot // Rockchip's rk3288 SoC uses the sram of pmu to store the function of 255c66ec88fSEmmanuel Vadot // resume from maskrom(the 1st level loader). This is a common use of 256c66ec88fSEmmanuel Vadot // the "pmu-sram" because it keeps power even in low power states 257c66ec88fSEmmanuel Vadot // in the system. 258c66ec88fSEmmanuel Vadot sram@ff720000 { 259c66ec88fSEmmanuel Vadot compatible = "rockchip,rk3288-pmu-sram", "mmio-sram"; 260c66ec88fSEmmanuel Vadot reg = <0xff720000 0x1000>; 261c66ec88fSEmmanuel Vadot }; 262c66ec88fSEmmanuel Vadot 263c66ec88fSEmmanuel Vadot - | 264c66ec88fSEmmanuel Vadot // Allwinner's A80 SoC uses part of the secure sram for hotplugging of the 265c66ec88fSEmmanuel Vadot // primary core (cpu0). Once the core gets powered up it checks if a magic 266c66ec88fSEmmanuel Vadot // value is set at a specific location. If it is then the BROM will jump 267c66ec88fSEmmanuel Vadot // to the software entry address, instead of executing a standard boot. 268c66ec88fSEmmanuel Vadot // 269c66ec88fSEmmanuel Vadot // Also there are no "secure-only" properties. The implementation should 270c66ec88fSEmmanuel Vadot // check if this SRAM is usable first. 271c66ec88fSEmmanuel Vadot sram@20000 { 272c66ec88fSEmmanuel Vadot // 256 KiB secure SRAM at 0x20000 273c66ec88fSEmmanuel Vadot compatible = "mmio-sram"; 274c66ec88fSEmmanuel Vadot reg = <0x00020000 0x40000>; 275c66ec88fSEmmanuel Vadot #address-cells = <1>; 276c66ec88fSEmmanuel Vadot #size-cells = <1>; 277c66ec88fSEmmanuel Vadot ranges = <0 0x00020000 0x40000>; 278c66ec88fSEmmanuel Vadot 279c66ec88fSEmmanuel Vadot smp-sram@1000 { 280c66ec88fSEmmanuel Vadot // This is checked by BROM to determine if 281c66ec88fSEmmanuel Vadot // cpu0 should jump to SMP entry vector 282c66ec88fSEmmanuel Vadot compatible = "allwinner,sun9i-a80-smp-sram"; 283c66ec88fSEmmanuel Vadot reg = <0x1000 0x8>; 284c66ec88fSEmmanuel Vadot }; 285c66ec88fSEmmanuel Vadot }; 286c66ec88fSEmmanuel Vadot 287c66ec88fSEmmanuel Vadot - | 288c66ec88fSEmmanuel Vadot sram@0 { 289c66ec88fSEmmanuel Vadot compatible = "mmio-sram"; 290c66ec88fSEmmanuel Vadot reg = <0x0 0x10000>; 291c66ec88fSEmmanuel Vadot #address-cells = <1>; 292c66ec88fSEmmanuel Vadot #size-cells = <1>; 293c66ec88fSEmmanuel Vadot ranges = <0 0x0 0x10000>; 294c66ec88fSEmmanuel Vadot 295c66ec88fSEmmanuel Vadot smp-sram@f100 { 296c66ec88fSEmmanuel Vadot compatible = "socionext,milbeaut-smp-sram"; 297c66ec88fSEmmanuel Vadot reg = <0xf100 0x20>; 298c66ec88fSEmmanuel Vadot }; 299c66ec88fSEmmanuel Vadot }; 300