1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 2010-2011, 2013 Freescale Semiconductor, Inc.
5 * Author: Roy Zang <tie-fei.zang@freescale.com>
8 * P1023 RDB Board Setup
11 #include <linux/kernel.h>
12 #include <linux/init.h>
13 #include <linux/errno.h>
14 #include <linux/pci.h>
15 #include <linux/delay.h>
16 #include <linux/module.h>
17 #include <linux/fsl_devices.h>
18 #include <linux/of_platform.h>
19 #include <linux/of_device.h>
22 #include <asm/machdep.h>
23 #include <asm/pci-bridge.h>
24 #include <mm/mmu_decl.h>
30 #include <sysdev/fsl_soc.h>
31 #include <sysdev/fsl_pci.h>
35 /* ************************************************************************
37 * Setup the architecture
40 static void __init
mpc85xx_rdb_setup_arch(void)
42 struct device_node
*np
;
45 ppc_md
.progress("p1023_rdb_setup_arch()", 0);
48 np
= of_find_node_by_name(NULL
, "bcsr");
50 static u8 __iomem
*bcsr_regs
;
52 bcsr_regs
= of_iomap(np
, 0);
57 "BCSR: Failed to map bcsr register space\n");
60 #define BCSR15_I2C_BUS0_SEG_CLR 0x07
61 #define BCSR15_I2C_BUS0_SEG2 0x02
63 * Note: Accessing exclusively i2c devices.
65 * The i2c controller selects initially ID EEPROM in the u-boot;
66 * but if menu configuration selects RTC support in the kernel,
67 * the i2c controller switches to select RTC chip in the kernel.
69 #ifdef CONFIG_RTC_CLASS
70 /* Enable RTC chip on the segment #2 of i2c */
71 clrbits8(&bcsr_regs
[15], BCSR15_I2C_BUS0_SEG_CLR
);
72 setbits8(&bcsr_regs
[15], BCSR15_I2C_BUS0_SEG2
);
81 fsl_pci_assign_primary();
84 machine_arch_initcall(p1023_rdb
, mpc85xx_common_publish_devices
);
86 static void __init
mpc85xx_rdb_pic_init(void)
88 struct mpic
*mpic
= mpic_alloc(NULL
, 0, MPIC_BIG_ENDIAN
|
97 static int __init
p1023_rdb_probe(void)
99 return of_machine_is_compatible("fsl,P1023RDB");
103 define_machine(p1023_rdb
) {
105 .probe
= p1023_rdb_probe
,
106 .setup_arch
= mpc85xx_rdb_setup_arch
,
107 .init_IRQ
= mpc85xx_rdb_pic_init
,
108 .get_irq
= mpic_get_irq
,
109 .calibrate_decr
= generic_calibrate_decr
,
110 .progress
= udbg_progress
,
112 .pcibios_fixup_bus
= fsl_pcibios_fixup_bus
,
113 .pcibios_fixup_phb
= fsl_pcibios_fixup_phb
,