diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2013-04-29 19:17:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:13 -0400 |
commit | 4984c6f5e56c3e68922fd979347ba7aff385783b (patch) | |
tree | 7931e0e6dbb71d837a24638cebc62a5dbb38798b /drivers/misc/Kconfig | |
parent | 9375db07adeaeea5f5ea7ca0463a8b371d71ddbb (diff) |
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 <p.zabel@pengutronix.de>
Reviewed-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Tested-by: Michal Simek <monstr@monstr.eu>
Cc: Dong Aisheng <dong.aisheng@linaro.org>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Huang Shijie <shijie8@gmail.com>
Cc: Javier Martin <javier.martin@vista-silicon.com>
Cc: Matt Porter <mporter@ti.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/Kconfig')
-rw-r--r-- | drivers/misc/Kconfig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index e29e7980a359..3659d00efdc5 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig | |||
@@ -518,6 +518,15 @@ config LATTICE_ECP3_CONFIG | |||
518 | 518 | ||
519 | If unsure, say N. | 519 | If unsure, say N. |
520 | 520 | ||
521 | config SRAM | ||
522 | bool "Generic on-chip SRAM driver" | ||
523 | depends on HAS_IOMEM | ||
524 | select GENERIC_ALLOCATOR | ||
525 | help | ||
526 | This driver allows you to declare a memory region to be managed by | ||
527 | the genalloc API. It is supposed to be used for small on-chip SRAM | ||
528 | areas found on many SoCs. | ||
529 | |||
521 | source "drivers/misc/c2port/Kconfig" | 530 | source "drivers/misc/c2port/Kconfig" |
522 | source "drivers/misc/eeprom/Kconfig" | 531 | source "drivers/misc/eeprom/Kconfig" |
523 | source "drivers/misc/cb710/Kconfig" | 532 | source "drivers/misc/cb710/Kconfig" |