aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2008-03-05 04:00:28 -0500
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2008-07-02 05:05:01 -0400
commitb83d6ee17588f1a4fbfc8ef0451b0900a5ef5950 (patch)
treebde2ffd7f1ad14d8a6f15300a8e0d7b36224bbc9 /arch/avr32
parent7951f188a0b7f9b2f181c692efb0d31082bec346 (diff)
avr32: Add simple SRAM allocator
Add SRAM allocator for avr32, which is just a thin wrapper around genalloc. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32')
-rw-r--r--arch/avr32/Kconfig1
-rw-r--r--arch/avr32/mach-at32ap/at32ap700x.c26
2 files changed, 27 insertions, 0 deletions
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index a5793c13f50c..e8ee5fa017b6 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -88,6 +88,7 @@ config PLATFORM_AT32AP
88 select MMU 88 select MMU
89 select PERFORMANCE_COUNTERS 89 select PERFORMANCE_COUNTERS
90 select HAVE_GPIO_LIB 90 select HAVE_GPIO_LIB
91 select GENERIC_ALLOCATOR
91 92
92# 93#
93# CPU types 94# CPU types
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index 3ee5e7278790..07b21b121eef 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -20,6 +20,7 @@
20#include <asm/arch/at32ap700x.h> 20#include <asm/arch/at32ap700x.h>
21#include <asm/arch/board.h> 21#include <asm/arch/board.h>
22#include <asm/arch/portmux.h> 22#include <asm/arch/portmux.h>
23#include <asm/arch/sram.h>
23 24
24#include <video/atmel_lcdc.h> 25#include <video/atmel_lcdc.h>
25 26
@@ -2120,3 +2121,28 @@ void __init setup_platform(void)
2120 at32_init_pio(&pio3_device); 2121 at32_init_pio(&pio3_device);
2121 at32_init_pio(&pio4_device); 2122 at32_init_pio(&pio4_device);
2122} 2123}
2124
2125struct gen_pool *sram_pool;
2126
2127static int __init sram_init(void)
2128{
2129 struct gen_pool *pool;
2130
2131 /* 1KiB granularity */
2132 pool = gen_pool_create(10, -1);
2133 if (!pool)
2134 goto fail;
2135
2136 if (gen_pool_add(pool, 0x24000000, 0x8000, -1))
2137 goto err_pool_add;
2138
2139 sram_pool = pool;
2140 return 0;
2141
2142err_pool_add:
2143 gen_pool_destroy(pool);
2144fail:
2145 pr_err("Failed to create SRAM pool\n");
2146 return -ENOMEM;
2147}
2148core_initcall(sram_init);