misc.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * misc setup functions for MPC83xx
  3. *
  4. * Maintainer: Kumar Gala <galak@kernel.crashing.org>
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2 of the License, or (at your
  9. * option) any later version.
  10. */
  11. #include <linux/config.h>
  12. #include <linux/stddef.h>
  13. #include <linux/kernel.h>
  14. #include <asm/io.h>
  15. #include <asm/hw_irq.h>
  16. #include <sysdev/fsl_soc.h>
  17. #include "mpc83xx.h"
  18. void mpc83xx_restart(char *cmd)
  19. {
  20. #define RST_OFFSET 0x00000900
  21. #define RST_PROT_REG 0x00000018
  22. #define RST_CTRL_REG 0x0000001c
  23. __be32 __iomem *reg;
  24. /* map reset register space */
  25. reg = ioremap(get_immrbase() + 0x900, 0xff);
  26. local_irq_disable();
  27. /* enable software reset "RSTE" */
  28. out_be32(reg + (RST_PROT_REG >> 2), 0x52535445);
  29. /* set software hard reset */
  30. out_be32(reg + (RST_CTRL_REG >> 2), 0x2);
  31. for (;;) ;
  32. }
  33. long __init mpc83xx_time_init(void)
  34. {
  35. #define SPCR_OFFSET 0x00000110
  36. #define SPCR_TBEN 0x00400000
  37. __be32 __iomem *spcr = ioremap(get_immrbase() + SPCR_OFFSET, 4);
  38. __be32 tmp;
  39. tmp = in_be32(spcr);
  40. out_be32(spcr, tmp | SPCR_TBEN);
  41. iounmap(spcr);
  42. return 0;
  43. }