edb7211.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * Copyright (C) 2000, 2001 Blue Mug, Inc. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. */
  9. #include <linux/init.h>
  10. #include <linux/memblock.h>
  11. #include <linux/types.h>
  12. #include <linux/interrupt.h>
  13. #include <linux/platform_device.h>
  14. #include <asm/setup.h>
  15. #include <asm/mach/map.h>
  16. #include <asm/mach/arch.h>
  17. #include <asm/mach-types.h>
  18. #include <mach/hardware.h>
  19. #include "common.h"
  20. #define VIDEORAM_SIZE SZ_128K
  21. #define EDB7211_CS8900_BASE (CS2_PHYS_BASE + 0x300)
  22. #define EDB7211_CS8900_IRQ (IRQ_EINT3)
  23. static struct resource edb7211_cs8900_resource[] __initdata = {
  24. DEFINE_RES_MEM(EDB7211_CS8900_BASE, SZ_1K),
  25. DEFINE_RES_IRQ(EDB7211_CS8900_IRQ),
  26. };
  27. static struct map_desc edb7211_io_desc[] __initdata = {
  28. { /* Memory-mapped extra keyboard row */
  29. .virtual = IO_ADDRESS(EP7211_PHYS_EXTKBD),
  30. .pfn = __phys_to_pfn(EP7211_PHYS_EXTKBD),
  31. .length = SZ_1M,
  32. .type = MT_DEVICE,
  33. }, { /* Flash bank 0 */
  34. .virtual = IO_ADDRESS(EP7211_PHYS_FLASH1),
  35. .pfn = __phys_to_pfn(EP7211_PHYS_FLASH1),
  36. .length = SZ_8M,
  37. .type = MT_DEVICE,
  38. }, { /* Flash bank 1 */
  39. .virtual = IO_ADDRESS(EP7211_PHYS_FLASH2),
  40. .pfn = __phys_to_pfn(EP7211_PHYS_FLASH2),
  41. .length = SZ_8M,
  42. .type = MT_DEVICE,
  43. },
  44. };
  45. void __init edb7211_map_io(void)
  46. {
  47. clps711x_map_io();
  48. iotable_init(edb7211_io_desc, ARRAY_SIZE(edb7211_io_desc));
  49. }
  50. /* Reserve screen memory region at the start of main system memory. */
  51. static void __init edb7211_reserve(void)
  52. {
  53. memblock_reserve(PHYS_OFFSET, VIDEORAM_SIZE);
  54. }
  55. static void __init
  56. fixup_edb7211(struct tag *tags, char **cmdline, struct meminfo *mi)
  57. {
  58. /*
  59. * Bank start addresses are not present in the information
  60. * passed in from the boot loader. We could potentially
  61. * detect them, but instead we hard-code them.
  62. *
  63. * Banks sizes _are_ present in the param block, but we're
  64. * not using that information yet.
  65. */
  66. mi->bank[0].start = 0xc0000000;
  67. mi->bank[0].size = SZ_8M;
  68. mi->bank[1].start = 0xc1000000;
  69. mi->bank[1].size = SZ_8M;
  70. mi->nr_banks = 2;
  71. }
  72. static void __init edb7211_init(void)
  73. {
  74. platform_device_register_simple("video-clps711x", 0, NULL, 0);
  75. platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource,
  76. ARRAY_SIZE(edb7211_cs8900_resource));
  77. }
  78. MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
  79. /* Maintainer: Jon McClintock */
  80. .atag_offset = VIDEORAM_SIZE + 0x100,
  81. .nr_irqs = CLPS711X_NR_IRQS,
  82. .fixup = fixup_edb7211,
  83. .reserve = edb7211_reserve,
  84. .map_io = edb7211_map_io,
  85. .init_irq = clps711x_init_irq,
  86. .timer = &clps711x_timer,
  87. .init_machine = edb7211_init,
  88. .restart = clps711x_restart,
  89. MACHINE_END