Path: blob/master/arch/powerpc/platforms/44x/ppc44x_simple.c
10820 views
/*1* Generic PowerPC 44x platform support2*3* Copyright 2008 IBM Corporation4*5* This program is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License as published by the7* Free Software Foundation; version 2 of the License.8*9* This implements simple platform support for PowerPC 44x chips. This is10* mostly used for eval boards or other simple and "generic" 44x boards. If11* your board has custom functions or hardware, then you will likely want to12* implement your own board.c file to accommodate it.13*/1415#include <asm/machdep.h>16#include <asm/pci-bridge.h>17#include <asm/ppc4xx.h>18#include <asm/prom.h>19#include <asm/time.h>20#include <asm/udbg.h>21#include <asm/uic.h>2223#include <linux/init.h>24#include <linux/of_platform.h>2526static __initdata struct of_device_id ppc44x_of_bus[] = {27{ .compatible = "ibm,plb4", },28{ .compatible = "ibm,opb", },29{ .compatible = "ibm,ebc", },30{ .compatible = "simple-bus", },31{},32};3334static int __init ppc44x_device_probe(void)35{36of_platform_bus_probe(NULL, ppc44x_of_bus, NULL);3738return 0;39}40machine_device_initcall(ppc44x_simple, ppc44x_device_probe);4142/* This is the list of boards that can be supported by this simple43* platform code. This does _not_ mean the boards are compatible,44* as they most certainly are not from a device tree perspective.45* However, their differences are handled by the device tree and the46* drivers and therefore they don't need custom board support files.47*48* Again, if your board needs to do things differently then create a49* board.c file for it rather than adding it to this list.50*/51static char *board[] __initdata = {52"amcc,arches",53"amcc,bamboo",54"amcc,bluestone",55"amcc,glacier",56"ibm,ebony",57"amcc,eiger",58"amcc,katmai",59"amcc,rainier",60"amcc,redwood",61"amcc,sequoia",62"amcc,taishan",63"amcc,yosemite",64"mosaixtech,icon"65};6667static int __init ppc44x_probe(void)68{69unsigned long root = of_get_flat_dt_root();70int i = 0;7172for (i = 0; i < ARRAY_SIZE(board); i++) {73if (of_flat_dt_is_compatible(root, board[i])) {74ppc_pci_set_flags(PPC_PCI_REASSIGN_ALL_RSRC);75return 1;76}77}7879return 0;80}8182define_machine(ppc44x_simple) {83.name = "PowerPC 44x Platform",84.probe = ppc44x_probe,85.progress = udbg_progress,86.init_IRQ = uic_init_tree,87.get_irq = uic_get_irq,88.restart = ppc4xx_reset_system,89.calibrate_decr = generic_calibrate_decr,90};919293