1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#include <linux/init.h>
21#include <linux/of_platform.h>
22
23#include <asm/machdep.h>
24#include <asm/prom.h>
25#include <asm/udbg.h>
26#include <asm/time.h>
27#include <asm/uic.h>
28#include <asm/pci-bridge.h>
29#include <asm/ppc4xx.h>
30#include <linux/i2c.h>
31
32static const struct of_device_id sam440ep_of_bus[] __initconst = {
33 { .compatible = "ibm,plb4", },
34 { .compatible = "ibm,opb", },
35 { .compatible = "ibm,ebc", },
36 {},
37};
38
39static int __init sam440ep_device_probe(void)
40{
41 of_platform_bus_probe(NULL, sam440ep_of_bus, NULL);
42
43 return 0;
44}
45machine_device_initcall(sam440ep, sam440ep_device_probe);
46
47static int __init sam440ep_probe(void)
48{
49 unsigned long root = of_get_flat_dt_root();
50
51 if (!of_flat_dt_is_compatible(root, "acube,sam440ep"))
52 return 0;
53
54 pci_set_flags(PCI_REASSIGN_ALL_RSRC);
55
56 return 1;
57}
58
59define_machine(sam440ep) {
60 .name = "Sam440ep",
61 .probe = sam440ep_probe,
62 .progress = udbg_progress,
63 .init_IRQ = uic_init_tree,
64 .get_irq = uic_get_irq,
65 .restart = ppc4xx_reset_system,
66 .calibrate_decr = generic_calibrate_decr,
67};
68
69static struct i2c_board_info sam440ep_rtc_info = {
70 .type = "m41st85",
71 .addr = 0x68,
72 .irq = -1,
73};
74
75static int sam440ep_setup_rtc(void)
76{
77 return i2c_register_board_info(0, &sam440ep_rtc_info, 1);
78}
79machine_device_initcall(sam440ep, sam440ep_setup_rtc);
80