misc.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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/stddef.h>
  12. #include <linux/kernel.h>
  13. #include <asm/io.h>
  14. #include <asm/hw_irq.h>
  15. #include <sysdev/fsl_soc.h>
  16. #include "mpc83xx.h"
  17. void mpc83xx_restart(char *cmd)
  18. {
  19. #define RST_OFFSET 0x00000900
  20. #define RST_PROT_REG 0x00000018
  21. #define RST_CTRL_REG 0x0000001c
  22. __be32 __iomem *reg;
  23. /* map reset register space */
  24. reg = ioremap(get_immrbase() + 0x900, 0xff);
  25. local_irq_disable();
  26. /* enable software reset "RSTE" */
  27. out_be32(reg + (RST_PROT_REG >> 2), 0x52535445);
  28. /* set software hard reset */
  29. out_be32(reg + (RST_CTRL_REG >> 2), 0x2);
  30. for (;;) ;
  31. }
  32. long __init mpc83xx_time_init(void)
  33. {
  34. #define SPCR_OFFSET 0x00000110
  35. #define SPCR_TBEN 0x00400000
  36. __be32 __iomem *spcr = ioremap(get_immrbase() + SPCR_OFFSET, 4);
  37. __be32 tmp;
  38. tmp = in_be32(spcr);
  39. out_be32(spcr, tmp | SPCR_TBEN);
  40. iounmap(spcr);
  41. return 0;
  42. }