aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>2007-06-21 10:14:20 -0400
committerPaul Mackerras <paulus@samba.org>2007-06-28 05:18:08 -0400
commit32d7331852a07d1f94c6d1b817c7c45648aa0fe7 (patch)
treef9e7e2bae43e6dd18174029aa3d5019d21f0e7b9
parente4eb8cf0ae5e6e2d7531a3fc7088f7f638795ca6 (diff)
[POWERPC] PS3: Preallocate bootmem memory for the PS3 FLASH ROM storage driver
Preallocate 256 KiB of bootmem memory for the PS3 FLASH ROM storage driver. This can be disabled by passing `ps3flash=off' on the kernel command line. Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/platforms/ps3/setup.c31
-rw-r--r--include/asm-powerpc/ps3.h1
2 files changed, 31 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c
index 6b6eca17472c..aa05288de64e 100644
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -107,7 +107,8 @@ static void ps3_panic(char *str)
107 while(1); 107 while(1);
108} 108}
109 109
110#if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE) 110#if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE) || \
111 defined(CONFIG_PS3_FLASH) || defined(CONFIG_PS3_FLASH_MODULE)
111static void prealloc(struct ps3_prealloc *p) 112static void prealloc(struct ps3_prealloc *p)
112{ 113{
113 if (!p->size) 114 if (!p->size)
@@ -123,7 +124,9 @@ static void prealloc(struct ps3_prealloc *p)
123 printk(KERN_INFO "%s: %lu bytes at %p\n", p->name, p->size, 124 printk(KERN_INFO "%s: %lu bytes at %p\n", p->name, p->size,
124 p->address); 125 p->address);
125} 126}
127#endif
126 128
129#if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE)
127struct ps3_prealloc ps3fb_videomemory = { 130struct ps3_prealloc ps3fb_videomemory = {
128 .name = "ps3fb videomemory", 131 .name = "ps3fb videomemory",
129 .size = CONFIG_FB_PS3_DEFAULT_SIZE_M*1024*1024, 132 .size = CONFIG_FB_PS3_DEFAULT_SIZE_M*1024*1024,
@@ -146,6 +149,30 @@ early_param("ps3fb", early_parse_ps3fb);
146#define prealloc_ps3fb_videomemory() do { } while (0) 149#define prealloc_ps3fb_videomemory() do { } while (0)
147#endif 150#endif
148 151
152#if defined(CONFIG_PS3_FLASH) || defined(CONFIG_PS3_FLASH_MODULE)
153struct ps3_prealloc ps3flash_bounce_buffer = {
154 .name = "ps3flash bounce buffer",
155 .size = 256*1024,
156 .align = 256*1024
157};
158EXPORT_SYMBOL_GPL(ps3flash_bounce_buffer);
159#define prealloc_ps3flash_bounce_buffer() prealloc(&ps3flash_bounce_buffer)
160
161static int __init early_parse_ps3flash(char *p)
162{
163 if (!p)
164 return 1;
165
166 if (!strcmp(p, "off"))
167 ps3flash_bounce_buffer.size = 0;
168
169 return 0;
170}
171early_param("ps3flash", early_parse_ps3flash);
172#else
173#define prealloc_ps3flash_bounce_buffer() do { } while (0)
174#endif
175
149static int ps3_set_dabr(u64 dabr) 176static int ps3_set_dabr(u64 dabr)
150{ 177{
151 enum {DABR_USER = 1, DABR_KERNEL = 2,}; 178 enum {DABR_USER = 1, DABR_KERNEL = 2,};
@@ -175,6 +202,8 @@ static void __init ps3_setup_arch(void)
175#endif 202#endif
176 203
177 prealloc_ps3fb_videomemory(); 204 prealloc_ps3fb_videomemory();
205 prealloc_ps3flash_bounce_buffer();
206
178 ppc_md.power_save = ps3_power_save; 207 ppc_md.power_save = ps3_power_save;
179 208
180 DBG(" <- %s:%d\n", __func__, __LINE__); 209 DBG(" <- %s:%d\n", __func__, __LINE__);
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h
index a35aea2db9c5..a6f3f5ee7ca7 100644
--- a/include/asm-powerpc/ps3.h
+++ b/include/asm-powerpc/ps3.h
@@ -427,6 +427,7 @@ struct ps3_prealloc {
427}; 427};
428 428
429extern struct ps3_prealloc ps3fb_videomemory; 429extern struct ps3_prealloc ps3fb_videomemory;
430extern struct ps3_prealloc ps3flash_bounce_buffer;
430 431
431 432
432#endif 433#endif