Path: blob/master/arch/powerpc/platforms/85xx/twr_p102x.c
26481 views
// SPDX-License-Identifier: GPL-2.0-or-later1/*2* Copyright 2010-2011, 2013 Freescale Semiconductor, Inc.3*4* Author: Michael Johnston <[email protected]>5*6* Description:7* TWR-P102x Board Setup8*/910#include <linux/kernel.h>11#include <linux/init.h>12#include <linux/errno.h>13#include <linux/fsl/guts.h>14#include <linux/pci.h>15#include <linux/of.h>16#include <linux/of_address.h>1718#include <asm/pci-bridge.h>19#include <asm/udbg.h>20#include <asm/mpic.h>21#include <soc/fsl/qe/qe.h>2223#include <sysdev/fsl_soc.h>24#include <sysdev/fsl_pci.h>25#include "smp.h"2627#include "mpc85xx.h"2829static void __init twr_p1025_pic_init(void)30{31struct mpic *mpic;3233mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN |34MPIC_SINGLE_DEST_CPU,350, 256, " OpenPIC ");3637BUG_ON(mpic == NULL);38mpic_init(mpic);39}4041/* ************************************************************************42*43* Setup the architecture44*45*/46static void __init twr_p1025_setup_arch(void)47{48if (ppc_md.progress)49ppc_md.progress("twr_p1025_setup_arch()", 0);5051mpc85xx_smp_init();5253fsl_pci_assign_primary();5455#ifdef CONFIG_QUICC_ENGINE56mpc85xx_qe_par_io_init();5758#if IS_ENABLED(CONFIG_UCC_GETH) || IS_ENABLED(CONFIG_SERIAL_QE)59if (machine_is(twr_p1025)) {60struct ccsr_guts __iomem *guts;61struct device_node *np;6263np = of_find_compatible_node(NULL, NULL, "fsl,p1021-guts");64if (np) {65guts = of_iomap(np, 0);66if (!guts)67pr_err("twr_p1025: could not map global utilities register\n");68else {69/* P1025 has pins muxed for QE and other functions. To70* enable QE UEC mode, we need to set bit QE0 for UCC171* in Eth mode, QE0 and QE3 for UCC5 in Eth mode, QE972* and QE12 for QE MII management signals in PMUXCR73* register.74* Set QE mux bits in PMUXCR */75setbits32(&guts->pmuxcr, MPC85xx_PMUXCR_QE(0) |76MPC85xx_PMUXCR_QE(3) |77MPC85xx_PMUXCR_QE(9) |78MPC85xx_PMUXCR_QE(12));79iounmap(guts);8081#if IS_ENABLED(CONFIG_SERIAL_QE)82/* On P1025TWR board, the UCC7 acted as UART port.83* However, The UCC7's CTS pin is low level in default,84* it will impact the transmission in full duplex85* communication. So disable the Flow control pin PA18.86* The UCC7 UART just can use RXD and TXD pins.87*/88par_io_config_pin(0, 18, 0, 0, 0, 0);89#endif90/* Drive PB29 to CPLD low - CPLD will then change91* muxing from LBC to QE */92par_io_config_pin(1, 29, 1, 0, 0, 0);93par_io_data_set(1, 29, 0);94}95of_node_put(np);96}97}98#endif99#endif /* CONFIG_QUICC_ENGINE */100101pr_info("TWR-P1025 board from Freescale Semiconductor\n");102}103104machine_arch_initcall(twr_p1025, mpc85xx_common_publish_devices);105106define_machine(twr_p1025) {107.name = "TWR-P1025",108.compatible = "fsl,TWR-P1025",109.setup_arch = twr_p1025_setup_arch,110.init_IRQ = twr_p1025_pic_init,111#ifdef CONFIG_PCI112.pcibios_fixup_bus = fsl_pcibios_fixup_bus,113#endif114.get_irq = mpic_get_irq,115.progress = udbg_progress,116};117118119