diff options
author | Harninder Rai <harninder.rai@freescale.com> | 2010-10-13 08:00:56 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2010-10-14 01:54:38 -0400 |
commit | 6db92cc9d07db9f713da8554b4bcdfc8e54ad386 (patch) | |
tree | cec19a7611a509c654125a967e06fba6de17f995 /arch/powerpc/include/asm | |
parent | 6341efe4b9bd1e1f9c0d0d6ec57fa77949c88bb1 (diff) |
powerpc/85xx: add cache-sram support
It adds cache-sram support in P1/P2 QorIQ platforms as under:
* A small abstraction over powerpc's remote heap allocator
* Exports mpc85xx_cache_sram_alloc()/free() APIs
* Supports only one contiguous SRAM window
* Drivers can do the following in Kconfig to use these APIs
"select FSL_85XX_CACHE_SRAM if MPC85xx"
* Required SRAM size and the offset where SRAM should be mapped must be
provided at kernel command line as :
cache-sram-size=<value>
cache-sram-offset=<offset>
Signed-off-by: Harninder Rai <harninder.rai@freescale.com>
Signed-off-by: Vivek Mahajan <vivek.mahajan@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r-- | arch/powerpc/include/asm/fsl_85xx_cache_sram.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/fsl_85xx_cache_sram.h b/arch/powerpc/include/asm/fsl_85xx_cache_sram.h new file mode 100644 index 000000000000..2af2bdc37b2e --- /dev/null +++ b/arch/powerpc/include/asm/fsl_85xx_cache_sram.h | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * Copyright 2009 Freescale Semiconductor, Inc. | ||
3 | * | ||
4 | * Cache SRAM handling for QorIQ platform | ||
5 | * | ||
6 | * Author: Vivek Mahajan <vivek.mahajan@freescale.com> | ||
7 | |||
8 | * This file is derived from the original work done | ||
9 | * by Sylvain Munaut for the Bestcomm SRAM allocator. | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify it | ||
12 | * under the terms of the GNU General Public License as published by the | ||
13 | * Free Software Foundation; either version 2 of the License, or (at your | ||
14 | * option) any later version. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, | ||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | * GNU General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | */ | ||
25 | |||
26 | #ifndef __ASM_POWERPC_FSL_85XX_CACHE_SRAM_H__ | ||
27 | #define __ASM_POWERPC_FSL_85XX_CACHE_SRAM_H__ | ||
28 | |||
29 | #include <asm/rheap.h> | ||
30 | #include <linux/spinlock.h> | ||
31 | |||
32 | /* | ||
33 | * Cache-SRAM | ||
34 | */ | ||
35 | |||
36 | struct mpc85xx_cache_sram { | ||
37 | phys_addr_t base_phys; | ||
38 | void *base_virt; | ||
39 | unsigned int size; | ||
40 | rh_info_t *rh; | ||
41 | spinlock_t lock; | ||
42 | }; | ||
43 | |||
44 | extern void mpc85xx_cache_sram_free(void *ptr); | ||
45 | extern void *mpc85xx_cache_sram_alloc(unsigned int size, | ||
46 | phys_addr_t *phys, unsigned int align); | ||
47 | |||
48 | #endif /* __AMS_POWERPC_FSL_85XX_CACHE_SRAM_H__ */ | ||