Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * Sam440ep board specific routines based off bamboo.c code
0004  * original copyrights below
0005  *
0006  * Wade Farnsworth <wfarnsworth@mvista.com>
0007  * Copyright 2004 MontaVista Software Inc.
0008  *
0009  * Rewritten and ported to the merged powerpc tree:
0010  * Josh Boyer <jwboyer@linux.vnet.ibm.com>
0011  * Copyright 2007 IBM Corporation
0012  *
0013  * Modified from bamboo.c for sam440ep:
0014  * Copyright 2008 Giuseppe Coviello <gicoviello@gmail.com>
0015  */
0016 #include <linux/init.h>
0017 #include <linux/of_platform.h>
0018 
0019 #include <asm/machdep.h>
0020 #include <asm/udbg.h>
0021 #include <asm/time.h>
0022 #include <asm/uic.h>
0023 #include <asm/pci-bridge.h>
0024 #include <asm/ppc4xx.h>
0025 #include <linux/i2c.h>
0026 
0027 static const struct of_device_id sam440ep_of_bus[] __initconst = {
0028     { .compatible = "ibm,plb4", },
0029     { .compatible = "ibm,opb", },
0030     { .compatible = "ibm,ebc", },
0031     {},
0032 };
0033 
0034 static int __init sam440ep_device_probe(void)
0035 {
0036     of_platform_bus_probe(NULL, sam440ep_of_bus, NULL);
0037 
0038     return 0;
0039 }
0040 machine_device_initcall(sam440ep, sam440ep_device_probe);
0041 
0042 static int __init sam440ep_probe(void)
0043 {
0044     if (!of_machine_is_compatible("acube,sam440ep"))
0045         return 0;
0046 
0047     pci_set_flags(PCI_REASSIGN_ALL_RSRC);
0048 
0049     return 1;
0050 }
0051 
0052 define_machine(sam440ep) {
0053     .name           = "Sam440ep",
0054     .probe          = sam440ep_probe,
0055     .progress       = udbg_progress,
0056     .init_IRQ       = uic_init_tree,
0057     .get_irq        = uic_get_irq,
0058     .restart        = ppc4xx_reset_system,
0059     .calibrate_decr     = generic_calibrate_decr,
0060 };
0061 
0062 static struct i2c_board_info sam440ep_rtc_info = {
0063     .type = "m41st85",
0064     .addr = 0x68,
0065     .irq = -1,
0066 };
0067 
0068 static int __init sam440ep_setup_rtc(void)
0069 {
0070     return i2c_register_board_info(0, &sam440ep_rtc_info, 1);
0071 }
0072 machine_device_initcall(sam440ep, sam440ep_setup_rtc);