Kim Phillips | 38f66f9 | 2008-01-24 20:47:11 -0600 | [diff] [blame] | 1 | /* |
| 2 | * arch/powerpc/platforms/83xx/mpc837x_rdb.c |
| 3 | * |
Yang Li | 8a56e1e | 2012-11-01 18:53:42 +0000 | [diff] [blame] | 4 | * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved. |
Kim Phillips | 38f66f9 | 2008-01-24 20:47:11 -0600 | [diff] [blame] | 5 | * |
| 6 | * MPC837x RDB board specific routines |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public License as published by the |
| 10 | * Free Software Foundation; either version 2 of the License, or (at your |
| 11 | * option) any later version. |
| 12 | */ |
| 13 | |
| 14 | #include <linux/pci.h> |
| 15 | #include <linux/of_platform.h> |
| 16 | |
| 17 | #include <asm/time.h> |
| 18 | #include <asm/ipic.h> |
| 19 | #include <asm/udbg.h> |
Anton Vorontsov | 89f3729 | 2009-07-25 01:42:30 +0400 | [diff] [blame] | 20 | #include <sysdev/fsl_soc.h> |
John Rigby | 76fe1ff | 2008-06-26 11:07:57 -0600 | [diff] [blame] | 21 | #include <sysdev/fsl_pci.h> |
Kim Phillips | 38f66f9 | 2008-01-24 20:47:11 -0600 | [diff] [blame] | 22 | |
| 23 | #include "mpc83xx.h" |
| 24 | |
Anton Vorontsov | 89f3729 | 2009-07-25 01:42:30 +0400 | [diff] [blame] | 25 | static void mpc837x_rdb_sd_cfg(void) |
| 26 | { |
| 27 | void __iomem *im; |
| 28 | |
| 29 | im = ioremap(get_immrbase(), 0x1000); |
| 30 | if (!im) { |
| 31 | WARN_ON(1); |
| 32 | return; |
| 33 | } |
| 34 | |
| 35 | /* |
| 36 | * On RDB boards (in contrast to MDS) USBB pins are used for SD only, |
| 37 | * so we can safely mux them away from the USB block. |
| 38 | */ |
| 39 | clrsetbits_be32(im + MPC83XX_SICRL_OFFS, MPC837X_SICRL_USBB_MASK, |
| 40 | MPC837X_SICRL_SD); |
| 41 | clrsetbits_be32(im + MPC83XX_SICRH_OFFS, MPC837X_SICRH_SPI_MASK, |
| 42 | MPC837X_SICRH_SD); |
| 43 | iounmap(im); |
| 44 | } |
| 45 | |
Kim Phillips | 38f66f9 | 2008-01-24 20:47:11 -0600 | [diff] [blame] | 46 | /* ************************************************************************ |
| 47 | * |
| 48 | * Setup the architecture |
| 49 | * |
| 50 | */ |
| 51 | static void __init mpc837x_rdb_setup_arch(void) |
| 52 | { |
Kevin Hao | fff69fd | 2016-08-23 10:06:58 +0800 | [diff] [blame] | 53 | mpc83xx_setup_arch(); |
Kim Phillips | 38f66f9 | 2008-01-24 20:47:11 -0600 | [diff] [blame] | 54 | mpc837x_usb_cfg(); |
Anton Vorontsov | 89f3729 | 2009-07-25 01:42:30 +0400 | [diff] [blame] | 55 | mpc837x_rdb_sd_cfg(); |
Kim Phillips | 38f66f9 | 2008-01-24 20:47:11 -0600 | [diff] [blame] | 56 | } |
| 57 | |
Dmitry Eremin-Solenikov | 7669d58 | 2011-11-17 18:48:47 +0400 | [diff] [blame] | 58 | machine_device_initcall(mpc837x_rdb, mpc83xx_declare_of_platform_devices); |
Kim Phillips | 38f66f9 | 2008-01-24 20:47:11 -0600 | [diff] [blame] | 59 | |
Andi Kleen | 9597abe | 2012-10-04 17:11:37 -0700 | [diff] [blame] | 60 | static const char * const board[] __initconst = { |
Grant Likely | a4f740c | 2010-10-30 11:49:09 -0400 | [diff] [blame] | 61 | "fsl,mpc8377rdb", |
| 62 | "fsl,mpc8378rdb", |
| 63 | "fsl,mpc8379rdb", |
| 64 | "fsl,mpc8377wlan", |
| 65 | NULL |
| 66 | }; |
| 67 | |
Kim Phillips | 38f66f9 | 2008-01-24 20:47:11 -0600 | [diff] [blame] | 68 | /* |
| 69 | * Called very early, MMU is off, device-tree isn't unflattened |
| 70 | */ |
| 71 | static int __init mpc837x_rdb_probe(void) |
| 72 | { |
Benjamin Herrenschmidt | 5657138 | 2016-07-05 15:04:05 +1000 | [diff] [blame] | 73 | return of_device_compatible_match(of_root, board); |
Kim Phillips | 38f66f9 | 2008-01-24 20:47:11 -0600 | [diff] [blame] | 74 | } |
| 75 | |
| 76 | define_machine(mpc837x_rdb) { |
Anton Vorontsov | fda4bd9 | 2009-07-25 01:42:17 +0400 | [diff] [blame] | 77 | .name = "MPC837x RDB/WLAN", |
Kim Phillips | 38f66f9 | 2008-01-24 20:47:11 -0600 | [diff] [blame] | 78 | .probe = mpc837x_rdb_probe, |
| 79 | .setup_arch = mpc837x_rdb_setup_arch, |
Dmitry Eremin-Solenikov | d4fb5eb | 2011-07-22 23:55:42 +0400 | [diff] [blame] | 80 | .init_IRQ = mpc83xx_ipic_init_IRQ, |
Kim Phillips | 38f66f9 | 2008-01-24 20:47:11 -0600 | [diff] [blame] | 81 | .get_irq = ipic_get_irq, |
| 82 | .restart = mpc83xx_restart, |
| 83 | .time_init = mpc83xx_time_init, |
| 84 | .calibrate_decr = generic_calibrate_decr, |
| 85 | .progress = udbg_progress, |
| 86 | }; |