board-ams-delta.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*
  2. * linux/arch/arm/mach-omap1/board-ams-delta.c
  3. *
  4. * Modified from board-generic.c
  5. *
  6. * Board specific inits for the Amstrad E3 (codename Delta) videophone
  7. *
  8. * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/platform_device.h>
  17. #include <asm/hardware.h>
  18. #include <asm/mach-types.h>
  19. #include <asm/mach/arch.h>
  20. #include <asm/mach/map.h>
  21. #include <asm/arch/board-ams-delta.h>
  22. #include <asm/arch/gpio.h>
  23. #include <asm/arch/mux.h>
  24. #include <asm/arch/usb.h>
  25. #include <asm/arch/board.h>
  26. #include <asm/arch/common.h>
  27. static u8 ams_delta_latch1_reg;
  28. static u16 ams_delta_latch2_reg;
  29. void ams_delta_latch1_write(u8 mask, u8 value)
  30. {
  31. ams_delta_latch1_reg &= ~mask;
  32. ams_delta_latch1_reg |= value;
  33. *(volatile __u8 *) AMS_DELTA_LATCH1_VIRT = ams_delta_latch1_reg;
  34. }
  35. void ams_delta_latch2_write(u16 mask, u16 value)
  36. {
  37. ams_delta_latch2_reg &= ~mask;
  38. ams_delta_latch2_reg |= value;
  39. *(volatile __u16 *) AMS_DELTA_LATCH2_VIRT = ams_delta_latch2_reg;
  40. }
  41. static void __init ams_delta_init_irq(void)
  42. {
  43. omap1_init_common_hw();
  44. omap_init_irq();
  45. omap_gpio_init();
  46. }
  47. static struct map_desc ams_delta_io_desc[] __initdata = {
  48. // AMS_DELTA_LATCH1
  49. {
  50. .virtual = AMS_DELTA_LATCH1_VIRT,
  51. .pfn = __phys_to_pfn(AMS_DELTA_LATCH1_PHYS),
  52. .length = 0x01000000,
  53. .type = MT_DEVICE
  54. },
  55. // AMS_DELTA_LATCH2
  56. {
  57. .virtual = AMS_DELTA_LATCH2_VIRT,
  58. .pfn = __phys_to_pfn(AMS_DELTA_LATCH2_PHYS),
  59. .length = 0x01000000,
  60. .type = MT_DEVICE
  61. },
  62. // AMS_DELTA_MODEM
  63. {
  64. .virtual = AMS_DELTA_MODEM_VIRT,
  65. .pfn = __phys_to_pfn(AMS_DELTA_MODEM_PHYS),
  66. .length = 0x01000000,
  67. .type = MT_DEVICE
  68. }
  69. };
  70. static struct omap_uart_config ams_delta_uart_config __initdata = {
  71. .enabled_uarts = 1,
  72. };
  73. static struct omap_usb_config ams_delta_usb_config __initdata = {
  74. .register_host = 1,
  75. .hmc_mode = 16,
  76. .pins[0] = 2,
  77. };
  78. static struct omap_board_config_kernel ams_delta_config[] = {
  79. { OMAP_TAG_UART, &ams_delta_uart_config },
  80. { OMAP_TAG_USB, &ams_delta_usb_config },
  81. };
  82. static struct platform_device ams_delta_led_device = {
  83. .name = "ams-delta-led",
  84. .id = -1
  85. };
  86. static struct platform_device *ams_delta_devices[] __initdata = {
  87. &ams_delta_led_device,
  88. };
  89. static void __init ams_delta_init(void)
  90. {
  91. iotable_init(ams_delta_io_desc, ARRAY_SIZE(ams_delta_io_desc));
  92. omap_board_config = ams_delta_config;
  93. omap_board_config_size = ARRAY_SIZE(ams_delta_config);
  94. omap_serial_init();
  95. /* Clear latch2 (NAND, LCD, modem enable) */
  96. ams_delta_latch2_write(~0, 0);
  97. platform_add_devices(ams_delta_devices, ARRAY_SIZE(ams_delta_devices));
  98. }
  99. static void __init ams_delta_map_io(void)
  100. {
  101. omap1_map_common_io();
  102. }
  103. MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)")
  104. /* Maintainer: Jonathan McDowell <noodles@earth.li> */
  105. .phys_io = 0xfff00000,
  106. .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
  107. .boot_params = 0x10000100,
  108. .map_io = ams_delta_map_io,
  109. .init_irq = ams_delta_init_irq,
  110. .init_machine = ams_delta_init,
  111. .timer = &omap_timer,
  112. MACHINE_END
  113. EXPORT_SYMBOL(ams_delta_latch1_write);
  114. EXPORT_SYMBOL(ams_delta_latch2_write);