blob: 16c9c9cbbb7fa48967219dcd3d4a0a7fe4a0c66d [file] [log] [blame]
Kim Phillips38f66f92008-01-24 20:47:11 -06001/*
2 * arch/powerpc/platforms/83xx/mpc837x_rdb.c
3 *
4 * Copyright (C) 2007 Freescale Semicondutor, Inc. All rights reserved.
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 Vorontsov89f37292009-07-25 01:42:30 +040020#include <sysdev/fsl_soc.h>
John Rigby76fe1ff2008-06-26 11:07:57 -060021#include <sysdev/fsl_pci.h>
Kim Phillips38f66f92008-01-24 20:47:11 -060022
23#include "mpc83xx.h"
24
Anton Vorontsov89f37292009-07-25 01:42:30 +040025static 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 Phillips38f66f92008-01-24 20:47:11 -060046/* ************************************************************************
47 *
48 * Setup the architecture
49 *
50 */
51static void __init mpc837x_rdb_setup_arch(void)
52{
Kim Phillips38f66f92008-01-24 20:47:11 -060053 if (ppc_md.progress)
54 ppc_md.progress("mpc837x_rdb_setup_arch()", 0);
55
Dmitry Eremin-Solenikovbede4802011-11-17 18:48:48 +040056 mpc83xx_setup_pci();
Kim Phillips38f66f92008-01-24 20:47:11 -060057 mpc837x_usb_cfg();
Anton Vorontsov89f37292009-07-25 01:42:30 +040058 mpc837x_rdb_sd_cfg();
Kim Phillips38f66f92008-01-24 20:47:11 -060059}
60
Dmitry Eremin-Solenikov7669d582011-11-17 18:48:47 +040061machine_device_initcall(mpc837x_rdb, mpc83xx_declare_of_platform_devices);
Kim Phillips38f66f92008-01-24 20:47:11 -060062
Grant Likelya4f740c2010-10-30 11:49:09 -040063static const char *board[] __initdata = {
64 "fsl,mpc8377rdb",
65 "fsl,mpc8378rdb",
66 "fsl,mpc8379rdb",
67 "fsl,mpc8377wlan",
68 NULL
69};
70
Kim Phillips38f66f92008-01-24 20:47:11 -060071/*
72 * Called very early, MMU is off, device-tree isn't unflattened
73 */
74static int __init mpc837x_rdb_probe(void)
75{
Grant Likelya4f740c2010-10-30 11:49:09 -040076 return of_flat_dt_match(of_get_flat_dt_root(), board);
Kim Phillips38f66f92008-01-24 20:47:11 -060077}
78
79define_machine(mpc837x_rdb) {
Anton Vorontsovfda4bd92009-07-25 01:42:17 +040080 .name = "MPC837x RDB/WLAN",
Kim Phillips38f66f92008-01-24 20:47:11 -060081 .probe = mpc837x_rdb_probe,
82 .setup_arch = mpc837x_rdb_setup_arch,
Dmitry Eremin-Solenikovd4fb5eb2011-07-22 23:55:42 +040083 .init_IRQ = mpc83xx_ipic_init_IRQ,
Kim Phillips38f66f92008-01-24 20:47:11 -060084 .get_irq = ipic_get_irq,
85 .restart = mpc83xx_restart,
86 .time_init = mpc83xx_time_init,
87 .calibrate_decr = generic_calibrate_decr,
88 .progress = udbg_progress,
89};