diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-02-12 22:43:25 -0800 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-02-12 22:43:25 -0800 |
commit | d9bc125caf592b7d081021f32ce5b717efdf70c8 (patch) | |
tree | 263b7066ba22ddce21db610c0300f6eaac6f2064 /arch/powerpc/platforms/ps3/setup.c | |
parent | 43d78ef2ba5bec26d0315859e8324bfc0be23766 (diff) | |
parent | ec2f9d1331f658433411c58077871e1eef4ee1b4 (diff) |
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Conflicts:
net/sunrpc/auth_gss/gss_krb5_crypto.c
net/sunrpc/auth_gss/gss_spkm3_token.c
net/sunrpc/clnt.c
Merge with mainline and fix conflicts.
Diffstat (limited to 'arch/powerpc/platforms/ps3/setup.c')
-rw-r--r-- | arch/powerpc/platforms/ps3/setup.c | 61 |
1 files changed, 58 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c index d8b5cadbe80..13d669a8eca 100644 --- a/arch/powerpc/platforms/ps3/setup.c +++ b/arch/powerpc/platforms/ps3/setup.c @@ -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> @@ -41,10 +42,18 @@ #define DBG(fmt...) do{if(0)printk(fmt);}while(0) #endif -static void ps3_show_cpuinfo(struct seq_file *m) +int ps3_get_firmware_version(union ps3_firmware_version *v) { - seq_printf(m, "machine\t\t: %s\n", ppc_md.name); + int result = lv1_get_version_info(&v->raw); + + if (result) { + v->raw = 0; + return -1; + } + + return result; } +EXPORT_SYMBOL_GPL(ps3_get_firmware_version); static void ps3_power_save(void) { @@ -72,10 +81,56 @@ 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; + DBG(" -> %s:%d\n", __func__, __LINE__); + ps3_get_firmware_version(&v); + printk(KERN_INFO "PS3 firmware version %u.%u.%u\n", v.major, v.minor, + v.rev); + ps3_spu_set_platform(); ps3_map_htab(); @@ -87,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__); @@ -156,7 +212,6 @@ define_machine(ps3) { .name = "PS3", .probe = ps3_probe, .setup_arch = ps3_setup_arch, - .show_cpuinfo = ps3_show_cpuinfo, .init_IRQ = ps3_init_IRQ, .panic = ps3_panic, .get_boot_time = ps3_get_boot_time, |