From 4984c6f5e56c3e68922fd979347ba7aff385783b Mon Sep 17 00:00:00 2001 From: Philipp Zabel Date: Mon, 29 Apr 2013 16:17:12 -0700 Subject: misc: generic on-chip SRAM allocation driver This driver requests and remaps a memory region as configured in the device tree. It serves memory from this region via the genalloc API. It optionally enables the SRAM clock. Other drivers can retrieve the genalloc pool from a phandle pointing to this drivers' device node in the device tree. The allocation granularity is hard-coded to 32 bytes for now, to make the SRAM driver useful for the 6502 remoteproc driver. There is overhead for bigger SRAMs, where only a much coarser allocation granularity is needed: At 32 bytes minimum allocation size, a 256 KiB SRAM needs a 1 KiB bitmap to track allocations. [akpm@linux-foundation.org: fix Kconfig text, make sram_init static] Signed-off-by: Philipp Zabel Reviewed-by: Shawn Guo Acked-by: Grant Likely Tested-by: Michal Simek Cc: Dong Aisheng Cc: Fabio Estevam Cc: Greg Kroah-Hartman Cc: Huang Shijie Cc: Javier Martin Cc: Matt Porter Cc: Michal Simek Cc: Paul Gortmaker Cc: Rob Herring Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Documentation/devicetree/bindings/misc/sram.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/sram.txt (limited to 'Documentation') diff --git a/Documentation/devicetree/bindings/misc/sram.txt b/Documentation/devicetree/bindings/misc/sram.txt new file mode 100644 index 000000000000..4d0a00e453a8 --- /dev/null +++ b/Documentation/devicetree/bindings/misc/sram.txt @@ -0,0 +1,16 @@ +Generic on-chip SRAM + +Simple IO memory regions to be managed by the genalloc API. + +Required properties: + +- compatible : mmio-sram + +- reg : SRAM iomem address range + +Example: + +sram: sram@5c000000 { + compatible = "mmio-sram"; + reg = <0x5c000000 0x40000>; /* 256 KiB SRAM at address 0x5c000000 */ +}; -- cgit v1.2.3-70-g09d2