processor-ns9360.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * arch/arm/mach-ns9xxx/processor-ns9360.c
  3. *
  4. * Copyright (C) 2007 by Digi International Inc.
  5. * All rights reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License version 2 as published by
  9. * the Free Software Foundation.
  10. */
  11. #include <linux/io.h>
  12. #include <linux/kernel.h>
  13. #include <asm/page.h>
  14. #include <asm/mach/map.h>
  15. #include <mach/processor-ns9360.h>
  16. #include <mach/regs-sys-ns9360.h>
  17. void ns9360_reset(char mode)
  18. {
  19. u32 reg;
  20. reg = __raw_readl(SYS_PLL) >> 16;
  21. REGSET(reg, SYS_PLL, SWC, YES);
  22. __raw_writel(reg, SYS_PLL);
  23. }
  24. #define CRYSTAL 29491200 /* Hz */
  25. unsigned long ns9360_systemclock(void)
  26. {
  27. u32 pll = __raw_readl(SYS_PLL);
  28. return CRYSTAL * (REGGETIM(pll, SYS_PLL, ND) + 1)
  29. >> REGGETIM(pll, SYS_PLL, FS);
  30. }
  31. static struct map_desc ns9360_io_desc[] __initdata = {
  32. { /* BBus */
  33. .virtual = io_p2v(0x90000000),
  34. .pfn = __phys_to_pfn(0x90000000),
  35. .length = 0x00700000,
  36. .type = MT_DEVICE,
  37. }, { /* AHB */
  38. .virtual = io_p2v(0xa0100000),
  39. .pfn = __phys_to_pfn(0xa0100000),
  40. .length = 0x00900000,
  41. .type = MT_DEVICE,
  42. },
  43. };
  44. void __init ns9360_map_io(void)
  45. {
  46. iotable_init(ns9360_io_desc, ARRAY_SIZE(ns9360_io_desc));
  47. }