cregit-Linux how code gets into the kernel

Release 4.14 arch/powerpc/platforms/ps3/setup.c

/*
 *  PS3 platform setup routines.
 *
 *  Copyright (C) 2006 Sony Computer Entertainment Inc.
 *  Copyright 2006 Sony Corp.
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/root_dev.h>
#include <linux/console.h>
#include <linux/export.h>
#include <linux/bootmem.h>

#include <asm/machdep.h>
#include <asm/firmware.h>
#include <asm/time.h>
#include <asm/iommu.h>
#include <asm/udbg.h>
#include <asm/prom.h>
#include <asm/lv1call.h>
#include <asm/ps3gpu.h>

#include "platform.h"

#if defined(DEBUG)

#define DBG udbg_printf
#else

#define DBG pr_debug
#endif

/* mutex synchronizing GPU accesses and video mode changes */

DEFINE_MUTEX(ps3_gpu_mutex);

EXPORT_SYMBOL_GPL(ps3_gpu_mutex);


static union ps3_firmware_version ps3_firmware_version;


void ps3_get_firmware_version(union ps3_firmware_version *v) { *v = ps3_firmware_version; }

Contributors

PersonTokensPropCommitsCommitProp
Geoff Levand960.00%150.00%
Masakazu Mokuno640.00%150.00%
Total15100.00%2100.00%

EXPORT_SYMBOL_GPL(ps3_get_firmware_version);
int ps3_compare_firmware_version(u16 major, u16 minor, u16 rev) { union ps3_firmware_version x; x.pad = 0; x.major = major; x.minor = minor; x.rev = rev; return (ps3_firmware_version.raw > x.raw) - (ps3_firmware_version.raw < x.raw); }

Contributors

PersonTokensPropCommitsCommitProp
Masakazu Mokuno5587.30%266.67%
Geoff Levand812.70%133.33%
Total63100.00%3100.00%

EXPORT_SYMBOL_GPL(ps3_compare_firmware_version);
static void ps3_power_save(void) { /* * lv1_pause() puts the PPE thread into inactive state until an * irq on an unmasked plug exists. MSR[EE] has no effect. * flags: 0 = wake on DEC interrupt, 1 = ignore DEC interrupt. */ lv1_pause(0); }

Contributors

PersonTokensPropCommitsCommitProp
Geoff Levand14100.00%1100.00%
Total14100.00%1100.00%


static void __noreturn ps3_restart(char *cmd) { DBG("%s:%d cmd '%s'\n", __func__, __LINE__, cmd); smp_send_stop(); ps3_sys_manager_restart(); /* never returns */ }

Contributors

PersonTokensPropCommitsCommitProp
Geoff Levand2896.55%150.00%
Daniel Axtens13.45%150.00%
Total29100.00%2100.00%


static void ps3_power_off(void) { DBG("%s:%d\n", __func__, __LINE__); smp_send_stop(); ps3_sys_manager_power_off(); /* never returns */ }

Contributors

PersonTokensPropCommitsCommitProp
Geoff Levand24100.00%1100.00%
Total24100.00%1100.00%


static void __noreturn ps3_halt(void) { DBG("%s:%d\n", __func__, __LINE__); smp_send_stop(); ps3_sys_manager_halt(); /* never returns */ }

Contributors

PersonTokensPropCommitsCommitProp
Geert Uytterhoeven2496.00%150.00%
Daniel Axtens14.00%150.00%
Total25100.00%2100.00%

#if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE) || \ defined(CONFIG_PS3_FLASH) || defined(CONFIG_PS3_FLASH_MODULE)
static void __init prealloc(struct ps3_prealloc *p) { if (!p->size) return; p->address = memblock_virt_alloc(p->size, p->align); printk(KERN_INFO "%s: %lu bytes at %p\n", p->name, p->size, p->address); }

Contributors

PersonTokensPropCommitsCommitProp
Geert Uytterhoeven5196.23%133.33%
Michael Ellerman11.89%133.33%
Stephen Rothwell11.89%133.33%
Total53100.00%3100.00%

#endif #if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE) 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 */ }; EXPORT_SYMBOL_GPL(ps3fb_videomemory); #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; }

Contributors

PersonTokensPropCommitsCommitProp
Geert Uytterhoeven41100.00%1100.00%
Total41100.00%1100.00%

early_param("ps3fb", early_parse_ps3fb); #else #define prealloc_ps3fb_videomemory() do { } while (0) #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; }

Contributors

PersonTokensPropCommitsCommitProp
Geert Uytterhoeven38100.00%1100.00%
Total38100.00%1100.00%

early_param("ps3flash", early_parse_ps3flash); #else #define prealloc_ps3flash_bounce_buffer() do { } while (0) #endif
static int ps3_set_dabr(unsigned long dabr, unsigned long dabrx) { /* Have to set at least one bit in the DABRX */ if (dabrx == 0 && dabr == 0) dabrx = DABRX_USER; /* hypervisor only allows us to set BTI, Kernel and user */ dabrx &= DABRX_BTI | DABRX_KERNEL | DABRX_USER; return lv1_set_dabr(dabr, dabrx) ? -1 : 0; }

Contributors

PersonTokensPropCommitsCommitProp
Michael Neuling2956.86%133.33%
Geoff Levand2039.22%133.33%
Stephen Rothwell23.92%133.33%
Total51100.00%3100.00%


static void __init ps3_setup_arch(void) { u64 tmp; DBG(" -> %s:%d\n", __func__, __LINE__); lv1_get_version_info(&ps3_firmware_version.raw, &tmp); printk(KERN_INFO "PS3 firmware version %u.%u.%u\n", ps3_firmware_version.major, ps3_firmware_version.minor, ps3_firmware_version.rev); ps3_spu_set_platform(); #ifdef CONFIG_SMP smp_init_ps3(); #endif #ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; #endif prealloc_ps3fb_videomemory(); prealloc_ps3flash_bounce_buffer(); ppc_md.power_save = ps3_power_save; ps3_os_area_init(); DBG(" <- %s:%d\n", __func__, __LINE__); }

Contributors

PersonTokensPropCommitsCommitProp
Geoff Levand8286.32%457.14%
Masakazu Mokuno77.37%114.29%
Geert Uytterhoeven66.32%228.57%
Total95100.00%7100.00%


static void __init ps3_progress(char *s, unsigned short hex) { printk("*** %04x : %s\n", hex, s ? s : ""); }

Contributors

PersonTokensPropCommitsCommitProp
Geoff Levand28100.00%1100.00%
Total28100.00%1100.00%


void __init ps3_early_mm_init(void) { unsigned long htab_size; ps3_mm_init(); ps3_mm_vas_create(&htab_size); ps3_hpte_init(htab_size); }

Contributors

PersonTokensPropCommitsCommitProp
Benjamin Herrenschmidt1765.38%150.00%
Geoff Levand934.62%150.00%
Total26100.00%2100.00%


static int __init ps3_probe(void) { DBG(" -> %s:%d\n", __func__, __LINE__); if (!of_machine_is_compatible("sony,ps3")) return 0; ps3_os_area_save_params(); pm_power_off = ps3_power_off; DBG(" <- %s:%d\n", __func__, __LINE__); return 1; }

Contributors

PersonTokensPropCommitsCommitProp
Geoff Levand3572.92%350.00%
Benjamin Herrenschmidt918.75%233.33%
Alexander Graf48.33%116.67%
Total48100.00%6100.00%

#if defined(CONFIG_KEXEC_CORE)
static void ps3_kexec_cpu_down(int crash_shutdown, int secondary) { int cpu = smp_processor_id(); DBG(" -> %s:%d: (%d)\n", __func__, __LINE__, cpu); ps3_smp_cleanup_cpu(cpu); ps3_shutdown_IRQ(cpu); DBG(" <- %s:%d\n", __func__, __LINE__); }

Contributors

PersonTokensPropCommitsCommitProp
Geoff Levand48100.00%2100.00%
Total48100.00%2100.00%

#endif define_machine(ps3) { .name = "PS3", .probe = ps3_probe, .setup_arch = ps3_setup_arch, .init_IRQ = ps3_init_IRQ, .get_boot_time = ps3_get_boot_time, .set_dabr = ps3_set_dabr, .calibrate_decr = ps3_calibrate_decr, .progress = ps3_progress, .restart = ps3_restart, .halt = ps3_halt, #if defined(CONFIG_KEXEC_CORE) .kexec_cpu_down = ps3_kexec_cpu_down, #endif };

Overall Contributors

PersonTokensPropCommitsCommitProp
Geoff Levand43847.61%931.03%
Geert Uytterhoeven33336.20%724.14%
Masakazu Mokuno788.48%26.90%
Michael Neuling293.15%13.45%
Benjamin Herrenschmidt262.83%26.90%
Alexander Graf40.43%13.45%
Stephen Rothwell40.43%310.34%
Paul Gortmaker30.33%13.45%
Thiago Jung Bauermann20.22%13.45%
Daniel Axtens20.22%13.45%
Michael Ellerman10.11%13.45%
Total920100.00%29100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.