Path: blob/master/arch/powerpc/platforms/85xx/p1023_rdb.c
26481 views
// SPDX-License-Identifier: GPL-2.0-or-later1/*2* Copyright 2010-2011, 2013 Freescale Semiconductor, Inc.3*4* Author: Roy Zang <[email protected]>5*6* Description:7* P1023 RDB Board Setup8*/910#include <linux/kernel.h>11#include <linux/init.h>12#include <linux/errno.h>13#include <linux/pci.h>14#include <linux/delay.h>15#include <linux/module.h>16#include <linux/fsl_devices.h>17#include <linux/of.h>18#include <linux/of_address.h>1920#include <asm/time.h>21#include <asm/machdep.h>22#include <asm/pci-bridge.h>23#include <mm/mmu_decl.h>24#include <asm/udbg.h>25#include <asm/mpic.h>26#include "smp.h"2728#include <sysdev/fsl_soc.h>29#include <sysdev/fsl_pci.h>3031#include "mpc85xx.h"3233/* ************************************************************************34*35* Setup the architecture36*37*/38static void __init p1023_rdb_setup_arch(void)39{40struct device_node *np;4142if (ppc_md.progress)43ppc_md.progress("p1023_rdb_setup_arch()", 0);4445/* Map BCSR area */46np = of_find_node_by_name(NULL, "bcsr");47if (np != NULL) {48static u8 __iomem *bcsr_regs;4950bcsr_regs = of_iomap(np, 0);51of_node_put(np);5253if (!bcsr_regs) {54printk(KERN_ERR55"BCSR: Failed to map bcsr register space\n");56return;57} else {58#define BCSR15_I2C_BUS0_SEG_CLR 0x0759#define BCSR15_I2C_BUS0_SEG2 0x0260/*61* Note: Accessing exclusively i2c devices.62*63* The i2c controller selects initially ID EEPROM in the u-boot;64* but if menu configuration selects RTC support in the kernel,65* the i2c controller switches to select RTC chip in the kernel.66*/67#ifdef CONFIG_RTC_CLASS68/* Enable RTC chip on the segment #2 of i2c */69clrbits8(&bcsr_regs[15], BCSR15_I2C_BUS0_SEG_CLR);70setbits8(&bcsr_regs[15], BCSR15_I2C_BUS0_SEG2);71#endif7273iounmap(bcsr_regs);74}75}7677mpc85xx_smp_init();7879fsl_pci_assign_primary();80}8182machine_arch_initcall(p1023_rdb, mpc85xx_common_publish_devices);8384static void __init p1023_rdb_pic_init(void)85{86struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |87MPIC_SINGLE_DEST_CPU,880, 256, " OpenPIC ");8990BUG_ON(mpic == NULL);9192mpic_init(mpic);93}9495define_machine(p1023_rdb) {96.name = "P1023 RDB",97.compatible = "fsl,P1023RDB",98.setup_arch = p1023_rdb_setup_arch,99.init_IRQ = p1023_rdb_pic_init,100.get_irq = mpic_get_irq,101.progress = udbg_progress,102#ifdef CONFIG_PCI103.pcibios_fixup_bus = fsl_pcibios_fixup_bus,104.pcibios_fixup_phb = fsl_pcibios_fixup_phb,105#endif106};107108109