cpu.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * arch/arm/mach-ks8695/cpu.c
  3. *
  4. * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
  5. * Copyright (C) 2006 Simtec Electronics
  6. *
  7. * KS8695 CPU support
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  22. */
  23. #include <linux/kernel.h>
  24. #include <linux/module.h>
  25. #include <linux/init.h>
  26. #include <linux/io.h>
  27. #include <mach/hardware.h>
  28. #include <asm/mach/arch.h>
  29. #include <asm/mach/map.h>
  30. #include <mach/regs-sys.h>
  31. #include <mach/regs-misc.h>
  32. static struct __initdata map_desc ks8695_io_desc[] = {
  33. {
  34. .virtual = (unsigned long)KS8695_IO_VA,
  35. .pfn = __phys_to_pfn(KS8695_IO_PA),
  36. .length = KS8695_IO_SIZE,
  37. .type = MT_DEVICE,
  38. }
  39. };
  40. static void __init ks8695_processor_info(void)
  41. {
  42. unsigned long id, rev;
  43. id = __raw_readl(KS8695_MISC_VA + KS8695_DID);
  44. rev = __raw_readl(KS8695_MISC_VA + KS8695_RID);
  45. printk("KS8695 ID=%04lx SubID=%02lx Revision=%02lx\n", (id & DID_ID), (rev & RID_SUBID), (rev & RID_REVISION));
  46. }
  47. static unsigned int sysclk[8] = { 125000000, 100000000, 62500000, 50000000, 41700000, 33300000, 31300000, 25000000 };
  48. static unsigned int cpuclk[8] = { 166000000, 166000000, 83000000, 83000000, 55300000, 55300000, 41500000, 41500000 };
  49. static void __init ks8695_clock_info(void)
  50. {
  51. unsigned int scdc = __raw_readl(KS8695_SYS_VA + KS8695_CLKCON) & CLKCON_SCDC;
  52. printk("Clocks: System %u MHz, CPU %u MHz\n",
  53. sysclk[scdc] / 1000000, cpuclk[scdc] / 1000000);
  54. }
  55. void __init ks8695_map_io(void)
  56. {
  57. iotable_init(ks8695_io_desc, ARRAY_SIZE(ks8695_io_desc));
  58. ks8695_processor_info();
  59. ks8695_clock_info();
  60. }