Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Generic PowerPC 44x 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 ppc44x_of_bus[] __initconst = {
0024     { .compatible = "ibm,plb4", },
0025     { .compatible = "ibm,opb", },
0026     { .compatible = "ibm,ebc", },
0027     { .compatible = "simple-bus", },
0028     {},
0029 };
0030 
0031 static int __init ppc44x_device_probe(void)
0032 {
0033     of_platform_bus_probe(NULL, ppc44x_of_bus, NULL);
0034 
0035     return 0;
0036 }
0037 machine_device_initcall(ppc44x_simple, ppc44x_device_probe);
0038 
0039 /* This is the list of boards that can be supported by this simple
0040  * platform code.  This does _not_ mean the boards are compatible,
0041  * as they most certainly are not from a device tree perspective.
0042  * However, their differences are handled by the device tree and the
0043  * drivers and therefore they don't need custom board support files.
0044  *
0045  * Again, if your board needs to do things differently then create a
0046  * board.c file for it rather than adding it to this list.
0047  */
0048 static char *board[] __initdata = {
0049     "amcc,arches",
0050     "amcc,bamboo",
0051     "apm,bluestone",
0052     "amcc,glacier",
0053     "ibm,ebony",
0054     "amcc,eiger",
0055     "amcc,katmai",
0056     "amcc,rainier",
0057     "amcc,redwood",
0058     "amcc,sequoia",
0059     "amcc,taishan",
0060     "amcc,yosemite",
0061     "mosaixtech,icon"
0062 };
0063 
0064 static int __init ppc44x_probe(void)
0065 {
0066     int i = 0;
0067 
0068     for (i = 0; i < ARRAY_SIZE(board); i++) {
0069         if (of_machine_is_compatible(board[i])) {
0070             pci_set_flags(PCI_REASSIGN_ALL_RSRC);
0071             return 1;
0072         }
0073     }
0074 
0075     return 0;
0076 }
0077 
0078 define_machine(ppc44x_simple) {
0079     .name = "PowerPC 44x Platform",
0080     .probe = ppc44x_probe,
0081     .progress = udbg_progress,
0082     .init_IRQ = uic_init_tree,
0083     .get_irq = uic_get_irq,
0084     .restart = ppc4xx_reset_system,
0085     .calibrate_decr = generic_calibrate_decr,
0086 };