2 * Copyright 2010-2011 Freescale Semiconductor, Inc.
4 * Author: Roy Zang <tie-fei.zang@freescale.com>
7 * P1023 RDS Board Setup
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/errno.h>
18 #include <linux/pci.h>
19 #include <linux/delay.h>
20 #include <linux/module.h>
21 #include <linux/fsl_devices.h>
22 #include <linux/of_platform.h>
23 #include <linux/of_device.h>
26 #include <asm/machdep.h>
27 #include <asm/pci-bridge.h>
28 #include <mm/mmu_decl.h>
34 #include <sysdev/fsl_soc.h>
35 #include <sysdev/fsl_pci.h>
39 /* ************************************************************************
41 * Setup the architecture
44 static void __init
mpc85xx_rds_setup_arch(void)
46 struct device_node
*np
;
49 ppc_md
.progress("p1023_rds_setup_arch()", 0);
52 np
= of_find_node_by_name(NULL
, "bcsr");
54 static u8 __iomem
*bcsr_regs
;
56 bcsr_regs
= of_iomap(np
, 0);
61 "BCSR: Failed to map bcsr register space\n");
64 #define BCSR15_I2C_BUS0_SEG_CLR 0x07
65 #define BCSR15_I2C_BUS0_SEG2 0x02
67 * Note: Accessing exclusively i2c devices.
69 * The i2c controller selects initially ID EEPROM in the u-boot;
70 * but if menu configuration selects RTC support in the kernel,
71 * the i2c controller switches to select RTC chip in the kernel.
73 #ifdef CONFIG_RTC_CLASS
74 /* Enable RTC chip on the segment #2 of i2c */
75 clrbits8(&bcsr_regs
[15], BCSR15_I2C_BUS0_SEG_CLR
);
76 setbits8(&bcsr_regs
[15], BCSR15_I2C_BUS0_SEG2
);
84 for_each_compatible_node(np
, "pci", "fsl,p1023-pcie")
85 fsl_add_bridge(np
, 0);
91 machine_device_initcall(p1023_rds
, mpc85xx_common_publish_devices
);
93 static void __init
mpc85xx_rds_pic_init(void)
95 struct mpic
*mpic
= mpic_alloc(NULL
, 0, MPIC_BIG_ENDIAN
|
104 static int __init
p1023_rds_probe(void)
106 unsigned long root
= of_get_flat_dt_root();
108 return of_flat_dt_is_compatible(root
, "fsl,P1023RDS");
112 define_machine(p1023_rds
) {
114 .probe
= p1023_rds_probe
,
115 .setup_arch
= mpc85xx_rds_setup_arch
,
116 .init_IRQ
= mpc85xx_rds_pic_init
,
117 .get_irq
= mpic_get_irq
,
118 .restart
= fsl_rstcr_restart
,
119 .calibrate_decr
= generic_calibrate_decr
,
120 .progress
= udbg_progress
,
122 .pcibios_fixup_bus
= fsl_pcibios_fixup_bus
,