Commit 32d73318 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Paul Mackerras

[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: default avatarGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: default avatarGeoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent e4eb8cf0
...@@ -107,7 +107,8 @@ static void ps3_panic(char *str) ...@@ -107,7 +107,8 @@ static void ps3_panic(char *str)
while(1); while(1);
} }
#if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE) #if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE) || \
defined(CONFIG_PS3_FLASH) || defined(CONFIG_PS3_FLASH_MODULE)
static void prealloc(struct ps3_prealloc *p) static void prealloc(struct ps3_prealloc *p)
{ {
if (!p->size) if (!p->size)
...@@ -123,7 +124,9 @@ static void prealloc(struct ps3_prealloc *p) ...@@ -123,7 +124,9 @@ static void prealloc(struct ps3_prealloc *p)
printk(KERN_INFO "%s: %lu bytes at %p\n", p->name, p->size, printk(KERN_INFO "%s: %lu bytes at %p\n", p->name, p->size,
p->address); p->address);
} }
#endif
#if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE)
struct ps3_prealloc ps3fb_videomemory = { struct ps3_prealloc ps3fb_videomemory = {
.name = "ps3fb videomemory", .name = "ps3fb videomemory",
.size = CONFIG_FB_PS3_DEFAULT_SIZE_M*1024*1024, .size = CONFIG_FB_PS3_DEFAULT_SIZE_M*1024*1024,
...@@ -146,6 +149,30 @@ early_param("ps3fb", early_parse_ps3fb); ...@@ -146,6 +149,30 @@ early_param("ps3fb", early_parse_ps3fb);
#define prealloc_ps3fb_videomemory() do { } while (0) #define prealloc_ps3fb_videomemory() do { } while (0)
#endif #endif
#if defined(CONFIG_PS3_FLASH) || defined(CONFIG_PS3_FLASH_MODULE)
struct ps3_prealloc ps3flash_bounce_buffer = {
.name = "ps3flash bounce buffer",
.size = 256*1024,
.align = 256*1024
};
EXPORT_SYMBOL_GPL(ps3flash_bounce_buffer);
#define prealloc_ps3flash_bounce_buffer() prealloc(&ps3flash_bounce_buffer)
static int __init early_parse_ps3flash(char *p)
{
if (!p)
return 1;
if (!strcmp(p, "off"))
ps3flash_bounce_buffer.size = 0;
return 0;
}
early_param("ps3flash", early_parse_ps3flash);
#else
#define prealloc_ps3flash_bounce_buffer() do { } while (0)
#endif
static int ps3_set_dabr(u64 dabr) static int ps3_set_dabr(u64 dabr)
{ {
enum {DABR_USER = 1, DABR_KERNEL = 2,}; enum {DABR_USER = 1, DABR_KERNEL = 2,};
...@@ -175,6 +202,8 @@ static void __init ps3_setup_arch(void) ...@@ -175,6 +202,8 @@ static void __init ps3_setup_arch(void)
#endif #endif
prealloc_ps3fb_videomemory(); prealloc_ps3fb_videomemory();
prealloc_ps3flash_bounce_buffer();
ppc_md.power_save = ps3_power_save; ppc_md.power_save = ps3_power_save;
DBG(" <- %s:%d\n", __func__, __LINE__); DBG(" <- %s:%d\n", __func__, __LINE__);
......
...@@ -427,6 +427,7 @@ struct ps3_prealloc { ...@@ -427,6 +427,7 @@ struct ps3_prealloc {
}; };
extern struct ps3_prealloc ps3fb_videomemory; extern struct ps3_prealloc ps3fb_videomemory;
extern struct ps3_prealloc ps3flash_bounce_buffer;
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment