mach-w90p910evb.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * linux/arch/arm/mach-w90x900/mach-w90p910evb.c
  3. *
  4. * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche
  5. *
  6. * Copyright (C) 2008 Nuvoton technology corporation
  7. * All rights reserved.
  8. *
  9. * Wan ZongShun <mcuos.com@gmail.com>
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License as
  13. * published by the Free Software Foundation; either version 2 of
  14. * the License, or (at your option) any later version.
  15. *
  16. */
  17. #include <linux/kernel.h>
  18. #include <linux/types.h>
  19. #include <linux/interrupt.h>
  20. #include <linux/list.h>
  21. #include <linux/timer.h>
  22. #include <linux/init.h>
  23. #include <linux/platform_device.h>
  24. #include <linux/mtd/physmap.h>
  25. #include <asm/mach/arch.h>
  26. #include <asm/mach/map.h>
  27. #include <asm/mach/irq.h>
  28. #include <asm/mach-types.h>
  29. #include <mach/regs-serial.h>
  30. #include <mach/map.h>
  31. #include "cpu.h"
  32. /*w90p910 evb norflash driver data */
  33. #define W90P910_FLASH_BASE 0xA0000000
  34. #define W90P910_FLASH_SIZE 0x400000
  35. static struct mtd_partition w90p910_flash_partitions[] = {
  36. {
  37. .name = "NOR Partition 1 for kernel (960K)",
  38. .size = 0xF0000,
  39. .offset = 0x10000,
  40. },
  41. {
  42. .name = "NOR Partition 2 for image (1M)",
  43. .size = 0x100000,
  44. .offset = 0x100000,
  45. },
  46. {
  47. .name = "NOR Partition 3 for user (2M)",
  48. .size = 0x200000,
  49. .offset = 0x00200000,
  50. }
  51. };
  52. static struct physmap_flash_data w90p910_flash_data = {
  53. .width = 2,
  54. .parts = w90p910_flash_partitions,
  55. .nr_parts = ARRAY_SIZE(w90p910_flash_partitions),
  56. };
  57. static struct resource w90p910_flash_resources[] = {
  58. {
  59. .start = W90P910_FLASH_BASE,
  60. .end = W90P910_FLASH_BASE + W90P910_FLASH_SIZE - 1,
  61. .flags = IORESOURCE_MEM,
  62. }
  63. };
  64. static struct platform_device w90p910_flash_device = {
  65. .name = "physmap-flash",
  66. .id = 0,
  67. .dev = {
  68. .platform_data = &w90p910_flash_data,
  69. },
  70. .resource = w90p910_flash_resources,
  71. .num_resources = ARRAY_SIZE(w90p910_flash_resources),
  72. };
  73. static struct map_desc w90p910_iodesc[] __initdata = {
  74. };
  75. /*Here should be your evb resourse,such as LCD*/
  76. static struct platform_device *w90p910evb_dev[] __initdata = {
  77. &w90p910_serial_device,
  78. &w90p910_flash_device,
  79. };
  80. static void __init w90p910evb_map_io(void)
  81. {
  82. w90p910_map_io(w90p910_iodesc, ARRAY_SIZE(w90p910_iodesc));
  83. w90p910_init_clocks(0);
  84. }
  85. static void __init w90p910evb_init(void)
  86. {
  87. platform_add_devices(w90p910evb_dev, ARRAY_SIZE(w90p910evb_dev));
  88. }
  89. MACHINE_START(W90P910EVB, "W90P910EVB")
  90. /* Maintainer: Wan ZongShun */
  91. .phys_io = W90X900_PA_UART,
  92. .io_pg_offst = (((u32)W90X900_VA_UART) >> 18) & 0xfffc,
  93. .boot_params = 0,
  94. .map_io = w90p910evb_map_io,
  95. .init_irq = w90x900_init_irq,
  96. .init_machine = w90p910evb_init,
  97. .timer = &w90x900_timer,
  98. MACHINE_END