blob: 2d8fa718d55e7416eeffc12e932717953c951d2e [file] [log] [blame]
Paul Mundtc9934872010-10-15 02:09:00 +09001/*
2 * SRAM pool for tiny memories not otherwise managed.
3 *
4 * Copyright (C) 2010 Paul Mundt
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#include <linux/init.h>
11#include <linux/kernel.h>
Paul Mundtf03c4862012-03-30 19:29:57 +090012#include <linux/errno.h>
Paul Mundtc9934872010-10-15 02:09:00 +090013#include <asm/sram.h>
14
15/*
16 * This provides a standard SRAM pool for tiny memories that can be
17 * added either by the CPU or the platform code. Typical SRAM sizes
18 * to be inserted in to the pool will generally be less than the page
19 * size, with anything more reasonably sized handled as a NUMA memory
20 * node.
21 */
22struct gen_pool *sram_pool;
23
24static int __init sram_pool_init(void)
25{
26 /*
27 * This is a global pool, we don't care about node locality.
28 */
29 sram_pool = gen_pool_create(1, -1);
30 if (unlikely(!sram_pool))
31 return -ENOMEM;
32
33 return 0;
34}
35core_initcall(sram_pool_init);