Path: blob/master/arch/powerpc/platforms/86xx/sbc8641d.c
10818 views
/*1* SBC8641D board specific routines2*3* Copyright 2008 Wind River Systems Inc.4*5* By Paul Gortmaker (see MAINTAINERS for contact information)6*7* Based largely on the 8641 HPCN support by Freescale Semiconductor Inc.8*9* This program is free software; you can redistribute it and/or modify it10* under the terms of the GNU General Public License as published by the11* Free Software Foundation; either version 2 of the License, or (at your12* option) any later version.13*/1415#include <linux/stddef.h>16#include <linux/kernel.h>17#include <linux/pci.h>18#include <linux/kdev_t.h>19#include <linux/delay.h>20#include <linux/seq_file.h>21#include <linux/of_platform.h>2223#include <asm/system.h>24#include <asm/time.h>25#include <asm/machdep.h>26#include <asm/pci-bridge.h>27#include <asm/prom.h>28#include <mm/mmu_decl.h>29#include <asm/udbg.h>3031#include <asm/mpic.h>3233#include <sysdev/fsl_pci.h>34#include <sysdev/fsl_soc.h>3536#include "mpc86xx.h"3738static void __init39sbc8641_setup_arch(void)40{41#ifdef CONFIG_PCI42struct device_node *np;43#endif4445if (ppc_md.progress)46ppc_md.progress("sbc8641_setup_arch()", 0);4748#ifdef CONFIG_PCI49for_each_compatible_node(np, "pci", "fsl,mpc8641-pcie")50fsl_add_bridge(np, 0);51#endif5253printk("SBC8641 board from Wind River\n");5455#ifdef CONFIG_SMP56mpc86xx_smp_init();57#endif58}596061static void62sbc8641_show_cpuinfo(struct seq_file *m)63{64uint svid = mfspr(SPRN_SVR);6566seq_printf(m, "Vendor\t\t: Wind River Systems\n");6768seq_printf(m, "SVR\t\t: 0x%x\n", svid);69}707172/*73* Called very early, device-tree isn't unflattened74*/75static int __init sbc8641_probe(void)76{77unsigned long root = of_get_flat_dt_root();7879if (of_flat_dt_is_compatible(root, "wind,sbc8641"))80return 1; /* Looks good */8182return 0;83}8485static long __init86mpc86xx_time_init(void)87{88unsigned int temp;8990/* Set the time base to zero */91mtspr(SPRN_TBWL, 0);92mtspr(SPRN_TBWU, 0);9394temp = mfspr(SPRN_HID0);95temp |= HID0_TBEN;96mtspr(SPRN_HID0, temp);97asm volatile("isync");9899return 0;100}101102static __initdata struct of_device_id of_bus_ids[] = {103{ .compatible = "simple-bus", },104{ .compatible = "gianfar", },105{},106};107108static int __init declare_of_platform_devices(void)109{110of_platform_bus_probe(NULL, of_bus_ids, NULL);111112return 0;113}114machine_device_initcall(sbc8641, declare_of_platform_devices);115116define_machine(sbc8641) {117.name = "SBC8641D",118.probe = sbc8641_probe,119.setup_arch = sbc8641_setup_arch,120.init_IRQ = mpc86xx_init_irq,121.show_cpuinfo = sbc8641_show_cpuinfo,122.get_irq = mpic_get_irq,123.restart = fsl_rstcr_restart,124.time_init = mpc86xx_time_init,125.calibrate_decr = generic_calibrate_decr,126.progress = udbg_progress,127#ifdef CONFIG_PCI128.pcibios_fixup_bus = fsl_pcibios_fixup_bus,129#endif130};131132133