summaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/octeon/cvmx-bootmem.h
diff options
context:
space:
mode:
authorSteven J. Hill <steven.hill@cavium.com>2017-08-29 17:40:31 +0200
committerRalf Baechle <ralf@linux-mips.org>2017-09-04 21:19:03 +0200
commit9438a86a07f74670ad730ee5799a8006ae668ab9 (patch)
tree89f7a191619efaf4a197efedd10af431c1d20ba4 /arch/mips/include/asm/octeon/cvmx-bootmem.h
parentMIPS: lantiq: Remove the arch/mips/lantiq/xway/reset.c implementation (diff)
downloadlinux-9438a86a07f74670ad730ee5799a8006ae668ab9.tar.xz
linux-9438a86a07f74670ad730ee5799a8006ae668ab9.zip
MIPS: Octeon: Add support for accessing the boot vector.
Used by the Octeon watchdog driver to get the address of the firmware boot vector. Signed-off-by: Steven J. Hill <steven.hill@cavium.com> Acked-by: David Daney <david.daney@cavium.com> Cc: linux-mips@linux-mips.org Cc: linux-watchdog@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/17206/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include/asm/octeon/cvmx-bootmem.h')
-rw-r--r--arch/mips/include/asm/octeon/cvmx-bootmem.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/mips/include/asm/octeon/cvmx-bootmem.h b/arch/mips/include/asm/octeon/cvmx-bootmem.h
index 374562507d0b..72d2e403a6e4 100644
--- a/arch/mips/include/asm/octeon/cvmx-bootmem.h
+++ b/arch/mips/include/asm/octeon/cvmx-bootmem.h
@@ -255,6 +255,34 @@ extern void *cvmx_bootmem_alloc_named_range(uint64_t size, uint64_t min_addr,
uint64_t max_addr, uint64_t align,
char *name);
+/**
+ * Allocate if needed a block of memory from a specific range of the
+ * free list that was passed to the application by the bootloader, and
+ * assign it a name in the global named block table. (part of the
+ * cvmx_bootmem_descriptor_t structure) Named blocks can later be
+ * freed. If the requested name block is already allocated, return
+ * the pointer to block of memory. If request cannot be satisfied
+ * within the address range specified, NULL is returned
+ *
+ * @param size Size in bytes of block to allocate
+ * @param min_addr minimum address of range
+ * @param max_addr maximum address of range
+ * @param align Alignment of memory to be allocated. (must be a power of 2)
+ * @param name name of block - must be less than CVMX_BOOTMEM_NAME_LEN bytes
+ * @param init Initialization function
+ *
+ * The initialization function is optional, if omitted the named block
+ * is initialized to all zeros when it is created, i.e. once.
+ *
+ * @return pointer to block of memory, NULL on error
+ */
+void *cvmx_bootmem_alloc_named_range_once(uint64_t size,
+ uint64_t min_addr,
+ uint64_t max_addr,
+ uint64_t align,
+ char *name,
+ void (*init) (void *));
+
extern int cvmx_bootmem_free_named(char *name);
/**