Path: blob/master/arch/powerpc/platforms/wsp/psr2.c
10818 views
/*1* Copyright 2008-2011, IBM Corporation2*3* This program is free software; you can redistribute it and/or4* modify it under the terms of the GNU General Public License5* as published by the Free Software Foundation; either version6* 2 of the License, or (at your option) any later version.7*/89#include <linux/delay.h>10#include <linux/init.h>11#include <linux/irq.h>12#include <linux/kernel.h>13#include <linux/mm.h>14#include <linux/of.h>15#include <linux/smp.h>1617#include <asm/machdep.h>18#include <asm/system.h>19#include <asm/time.h>20#include <asm/udbg.h>2122#include "ics.h"23#include "wsp.h"242526static void psr2_spin(void)27{28hard_irq_disable();29for (;;) ;30}3132static void psr2_restart(char *cmd)33{34psr2_spin();35}3637static int psr2_probe_devices(void)38{39struct device_node *np;4041/* Our RTC is a ds1500. It seems to be programatically compatible42* with the ds1511 for which we have a driver so let's use that43*/44np = of_find_compatible_node(NULL, NULL, "dallas,ds1500");45if (np != NULL) {46struct resource res;47if (of_address_to_resource(np, 0, &res) == 0)48platform_device_register_simple("ds1511", 0, &res, 1);49}50return 0;51}52machine_arch_initcall(psr2_md, psr2_probe_devices);5354static void __init psr2_setup_arch(void)55{56/* init to some ~sane value until calibrate_delay() runs */57loops_per_jiffy = 50000000;5859scom_init_wsp();6061/* Setup SMP callback */62#ifdef CONFIG_SMP63a2_setup_smp();64#endif65}6667static int __init psr2_probe(void)68{69unsigned long root = of_get_flat_dt_root();7071if (!of_flat_dt_is_compatible(root, "ibm,psr2"))72return 0;7374return 1;75}7677static void __init psr2_init_irq(void)78{79wsp_init_irq();80opb_pic_init();81}8283define_machine(psr2_md) {84.name = "PSR2 A2",85.probe = psr2_probe,86.setup_arch = psr2_setup_arch,87.restart = psr2_restart,88.power_off = psr2_spin,89.halt = psr2_spin,90.calibrate_decr = generic_calibrate_decr,91.init_IRQ = psr2_init_irq,92.progress = udbg_progress,93.power_save = book3e_idle,94};959697