Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Generic PowerPC 40x platform support
0004  *
0005  * Copyright 2008 IBM Corporation
0006  *
0007  * This implements simple platform support for PowerPC 44x chips.  This is
0008  * mostly used for eval boards or other simple and "generic" 44x boards.  If
0009  * your board has custom functions or hardware, then you will likely want to
0010  * implement your own board.c file to accommodate it.
0011  */
0012 
0013 #include <asm/machdep.h>
0014 #include <asm/pci-bridge.h>
0015 #include <asm/ppc4xx.h>
0016 #include <asm/time.h>
0017 #include <asm/udbg.h>
0018 #include <asm/uic.h>
0019 
0020 #include <linux/init.h>
0021 #include <linux/of_platform.h>
0022 
0023 static const struct of_device_id ppc40x_of_bus[] __initconst = {
0024     { .compatible = "ibm,plb3", },
0025     { .compatible = "ibm,plb4", },
0026     { .compatible = "ibm,opb", },
0027     { .compatible = "ibm,ebc", },
0028     { .compatible = "simple-bus", },
0029     {},
0030 };
0031 
0032 static int __init ppc40x_device_probe(void)
0033 {
0034     of_platform_bus_probe(NULL, ppc40x_of_bus, NULL);
0035 
0036     return 0;
0037 }
0038 machine_device_initcall(ppc40x_simple, ppc40x_device_probe);
0039 
0040 /* This is the list of boards that can be supported by this simple
0041  * platform code.  This does _not_ mean the boards are compatible,
0042  * as they most certainly are not from a device tree perspective.
0043  * However, their differences are handled by the device tree and the
0044  * drivers and therefore they don't need custom board support files.
0045  *
0046  * Again, if your board needs to do things differently then create a
0047  * board.c file for it rather than adding it to this list.
0048  */
0049 static const char * const board[] __initconst = {
0050     "amcc,acadia",
0051     "amcc,haleakala",
0052     "amcc,kilauea",
0053     "amcc,makalu",
0054     "apm,klondike",
0055     "est,hotfoot",
0056     "plathome,obs600",
0057     NULL
0058 };
0059 
0060 static int __init ppc40x_probe(void)
0061 {
0062     if (of_device_compatible_match(of_root, board)) {
0063         pci_set_flags(PCI_REASSIGN_ALL_RSRC);
0064         return 1;
0065     }
0066 
0067     return 0;
0068 }
0069 
0070 define_machine(ppc40x_simple) {
0071     .name = "PowerPC 40x Platform",
0072     .probe = ppc40x_probe,
0073     .progress = udbg_progress,
0074     .init_IRQ = uic_init_tree,
0075     .get_irq = uic_get_irq,
0076     .restart = ppc4xx_reset_system,
0077     .calibrate_decr = generic_calibrate_decr,
0078 };