w90p910.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * linux/arch/arm/mach-w90x900/w90p910.c
  3. *
  4. * Based on linux/arch/arm/plat-s3c24xx/s3c244x.c by Ben Dooks
  5. *
  6. * Copyright (c) 2008 Nuvoton technology corporation
  7. * All rights reserved.
  8. *
  9. * Wan ZongShun <mcuos.com@gmail.com>
  10. *
  11. * W90P910 cpu support
  12. *
  13. * This program is free software; you can redistribute it and/or modify
  14. * it under the terms of the GNU General Public License as published by
  15. * the Free Software Foundation; either version 2 of the License, or
  16. * (at your option) any later version.
  17. *
  18. */
  19. #include <linux/kernel.h>
  20. #include <linux/types.h>
  21. #include <linux/interrupt.h>
  22. #include <linux/list.h>
  23. #include <linux/timer.h>
  24. #include <linux/init.h>
  25. #include <linux/platform_device.h>
  26. #include <linux/io.h>
  27. #include <linux/serial_8250.h>
  28. #include <asm/mach/arch.h>
  29. #include <asm/mach/map.h>
  30. #include <asm/mach/irq.h>
  31. #include <asm/irq.h>
  32. #include <mach/hardware.h>
  33. #include <mach/regs-serial.h>
  34. #include "cpu.h"
  35. /* Initial IO mappings */
  36. static struct map_desc w90p910_iodesc[] __initdata = {
  37. IODESC_ENT(IRQ),
  38. IODESC_ENT(GCR),
  39. IODESC_ENT(UART),
  40. IODESC_ENT(TIMER),
  41. IODESC_ENT(EBI),
  42. /*IODESC_ENT(LCD),*/
  43. };
  44. /* Initial serial platform data */
  45. struct plat_serial8250_port w90p910_uart_data[] = {
  46. W90X900_8250PORT(UART0),
  47. };
  48. struct platform_device w90p910_serial_device = {
  49. .name = "serial8250",
  50. .id = PLAT8250_DEV_PLATFORM,
  51. .dev = {
  52. .platform_data = w90p910_uart_data,
  53. },
  54. };
  55. /*Init W90P910 evb io*/
  56. void __init w90p910_map_io(struct map_desc *mach_desc, int mach_size)
  57. {
  58. unsigned long idcode = 0x0;
  59. iotable_init(w90p910_iodesc, ARRAY_SIZE(w90p910_iodesc));
  60. idcode = __raw_readl(W90X900PDID);
  61. if (idcode != W90P910_CPUID)
  62. printk(KERN_ERR "CPU type 0x%08lx is not W90P910\n", idcode);
  63. }
  64. /*Init W90P910 clock*/
  65. void __init w90p910_init_clocks(int xtal)
  66. {
  67. }
  68. static int __init w90p910_init_cpu(void)
  69. {
  70. return 0;
  71. }
  72. static int __init w90x900_arch_init(void)
  73. {
  74. return w90p910_init_cpu();
  75. }
  76. arch_initcall(w90x900_arch_init);