mpc837x_rdb.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * arch/powerpc/platforms/83xx/mpc837x_rdb.c
  3. *
  4. * Copyright (C) 2007 Freescale Semiconductor, 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. #include <linux/pci.h>
  14. #include <linux/of_platform.h>
  15. #include <asm/time.h>
  16. #include <asm/ipic.h>
  17. #include <asm/udbg.h>
  18. #include <sysdev/fsl_soc.h>
  19. #include <sysdev/fsl_pci.h>
  20. #include "mpc83xx.h"
  21. static void mpc837x_rdb_sd_cfg(void)
  22. {
  23. void __iomem *im;
  24. im = ioremap(get_immrbase(), 0x1000);
  25. if (!im) {
  26. WARN_ON(1);
  27. return;
  28. }
  29. /*
  30. * On RDB boards (in contrast to MDS) USBB pins are used for SD only,
  31. * so we can safely mux them away from the USB block.
  32. */
  33. clrsetbits_be32(im + MPC83XX_SICRL_OFFS, MPC837X_SICRL_USBB_MASK,
  34. MPC837X_SICRL_SD);
  35. clrsetbits_be32(im + MPC83XX_SICRH_OFFS, MPC837X_SICRH_SPI_MASK,
  36. MPC837X_SICRH_SD);
  37. iounmap(im);
  38. }
  39. /* ************************************************************************
  40. *
  41. * Setup the architecture
  42. *
  43. */
  44. static void __init mpc837x_rdb_setup_arch(void)
  45. {
  46. if (ppc_md.progress)
  47. ppc_md.progress("mpc837x_rdb_setup_arch()", 0);
  48. mpc83xx_setup_pci();
  49. mpc837x_usb_cfg();
  50. mpc837x_rdb_sd_cfg();
  51. }
  52. machine_device_initcall(mpc837x_rdb, mpc83xx_declare_of_platform_devices);
  53. static const char * const board[] __initconst = {
  54. "fsl,mpc8377rdb",
  55. "fsl,mpc8378rdb",
  56. "fsl,mpc8379rdb",
  57. "fsl,mpc8377wlan",
  58. NULL
  59. };
  60. /*
  61. * Called very early, MMU is off, device-tree isn't unflattened
  62. */
  63. static int __init mpc837x_rdb_probe(void)
  64. {
  65. return of_flat_dt_match(of_get_flat_dt_root(), board);
  66. }
  67. define_machine(mpc837x_rdb) {
  68. .name = "MPC837x RDB/WLAN",
  69. .probe = mpc837x_rdb_probe,
  70. .setup_arch = mpc837x_rdb_setup_arch,
  71. .init_IRQ = mpc83xx_ipic_init_IRQ,
  72. .get_irq = ipic_get_irq,
  73. .restart = mpc83xx_restart,
  74. .time_init = mpc83xx_time_init,
  75. .calibrate_decr = generic_calibrate_decr,
  76. .progress = udbg_progress,
  77. };