Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48072
b: refs/heads/master
c: fbdb3e5
h: refs/heads/master
v: v3
  • Loading branch information
Geert Uytterhoeven authored and Linus Torvalds committed Feb 12, 2007
1 parent 808f52c commit 0d6376d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dcfe2666ffd6316b764801db82092bc62db56e6f
refs/heads/master: fbdb3e5be36619c4acf415d870eceab4cbce2850
42 changes: 42 additions & 0 deletions trunk/arch/powerpc/platforms/ps3/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/root_dev.h>
#include <linux/console.h>
#include <linux/kexec.h>
#include <linux/bootmem.h>

#include <asm/machdep.h>
#include <asm/firmware.h>
Expand Down Expand Up @@ -80,6 +81,46 @@ static void ps3_panic(char *str)
for (;;) ;
}


static void prealloc(struct ps3_prealloc *p)
{
if (!p->size)
return;

p->address = __alloc_bootmem(p->size, p->align, __pa(MAX_DMA_ADDRESS));
if (!p->address) {
printk(KERN_ERR "%s: Cannot allocate %s\n", __FUNCTION__,
p->name);
return;
}

printk(KERN_INFO "%s: %lu bytes at %p\n", p->name, p->size,
p->address);
}

#ifdef CONFIG_FB_PS3
struct ps3_prealloc ps3fb_videomemory = {
.name = "ps3fb videomemory",
.size = CONFIG_FB_PS3_DEFAULT_SIZE_M*1024*1024,
.align = 1024*1024 /* the GPU requires 1 MiB alignment */
};
#define prealloc_ps3fb_videomemory() prealloc(&ps3fb_videomemory)

static int __init early_parse_ps3fb(char *p)
{
if (!p)
return 1;

ps3fb_videomemory.size = _ALIGN_UP(memparse(p, &p),
ps3fb_videomemory.align);
return 0;
}
early_param("ps3fb", early_parse_ps3fb);
#else
#define prealloc_ps3fb_videomemory() do { } while (0)
#endif


static void __init ps3_setup_arch(void)
{
union ps3_firmware_version v;
Expand All @@ -101,6 +142,7 @@ static void __init ps3_setup_arch(void)
conswitchp = &dummy_con;
#endif

prealloc_ps3fb_videomemory();
ppc_md.power_save = ps3_power_save;

DBG(" <- %s:%d\n", __func__, __LINE__);
Expand Down
9 changes: 9 additions & 0 deletions trunk/include/asm-powerpc/ps3.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,4 +388,13 @@ struct ps3_vuart_port_device {

int ps3_vuart_port_device_register(struct ps3_vuart_port_device *dev);

struct ps3_prealloc {
const char *name;
void *address;
unsigned long size;
unsigned long align;
};

extern struct ps3_prealloc ps3fb_videomemory;

#endif

0 comments on commit 0d6376d

Please sign in to comment.