Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * arch/powerpc/platforms/83xx/mpc837x_rdb.c
0004  *
0005  * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
0006  *
0007  * MPC837x RDB board specific routines
0008  */
0009 
0010 #include <linux/pci.h>
0011 #include <linux/of_platform.h>
0012 
0013 #include <asm/time.h>
0014 #include <asm/ipic.h>
0015 #include <asm/udbg.h>
0016 #include <sysdev/fsl_soc.h>
0017 #include <sysdev/fsl_pci.h>
0018 
0019 #include "mpc83xx.h"
0020 
0021 static void __init mpc837x_rdb_sd_cfg(void)
0022 {
0023     void __iomem *im;
0024 
0025     im = ioremap(get_immrbase(), 0x1000);
0026     if (!im) {
0027         WARN_ON(1);
0028         return;
0029     }
0030 
0031     /*
0032      * On RDB boards (in contrast to MDS) USBB pins are used for SD only,
0033      * so we can safely mux them away from the USB block.
0034      */
0035     clrsetbits_be32(im + MPC83XX_SICRL_OFFS, MPC837X_SICRL_USBB_MASK,
0036                          MPC837X_SICRL_SD);
0037     clrsetbits_be32(im + MPC83XX_SICRH_OFFS, MPC837X_SICRH_SPI_MASK,
0038                          MPC837X_SICRH_SD);
0039     iounmap(im);
0040 }
0041 
0042 /* ************************************************************************
0043  *
0044  * Setup the architecture
0045  *
0046  */
0047 static void __init mpc837x_rdb_setup_arch(void)
0048 {
0049     mpc83xx_setup_arch();
0050     mpc837x_usb_cfg();
0051     mpc837x_rdb_sd_cfg();
0052 }
0053 
0054 machine_device_initcall(mpc837x_rdb, mpc83xx_declare_of_platform_devices);
0055 
0056 static const char * const board[] __initconst = {
0057     "fsl,mpc8377rdb",
0058     "fsl,mpc8378rdb",
0059     "fsl,mpc8379rdb",
0060     "fsl,mpc8377wlan",
0061     NULL
0062 };
0063 
0064 /*
0065  * Called very early, MMU is off, device-tree isn't unflattened
0066  */
0067 static int __init mpc837x_rdb_probe(void)
0068 {
0069     return of_device_compatible_match(of_root, board);
0070 }
0071 
0072 define_machine(mpc837x_rdb) {
0073     .name           = "MPC837x RDB/WLAN",
0074     .probe          = mpc837x_rdb_probe,
0075     .setup_arch     = mpc837x_rdb_setup_arch,
0076     .discover_phbs      = mpc83xx_setup_pci,
0077     .init_IRQ       = mpc83xx_ipic_init_IRQ,
0078     .get_irq        = ipic_get_irq,
0079     .restart        = mpc83xx_restart,
0080     .time_init      = mpc83xx_time_init,
0081     .calibrate_decr     = generic_calibrate_decr,
0082     .progress       = udbg_progress,
0083 };