hiddenDangerAnalysis.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Emma Mobile EV2 processor support
  3. *
  4. * Copyright (C) 2012 Magnus Damm
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; version 2 of the License.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  18. */
  19. #include <linux/kernel.h>
  20. #include <linux/init.h>
  21. #include <linux/interrupt.h>
  22. #include <linux/irq.h>
  23. #include <linux/platform_device.h>
  24. #include <linux/platform_data/gpio-em.h>
  25. #include <linux/of_platform.h>
  26. #include <linux/delay.h>
  27. #include <linux/input.h>
  28. #include <linux/io.h>
  29. #include <linux/of_irq.h>
  30. #include <mach/hardware.h>
  31. #include <mach/common.h>
  32. #include <mach/emev2.h>
  33. #include <mach/irqs.h>
  34. #include <asm/mach-types.h>
  35. #include <asm/mach/arch.h>
  36. #include <asm/mach/map.h>
  37. #include <asm/mach/time.h>
  38. #include <asm/hardware/gic.h>
  39. static struct map_desc emev2_io_desc[] __initdata = {
  40. #ifdef CONFIG_SMP
  41. /* 128K entity map for 0xe0100000 (SMU) */
  42. {
  43. .virtual = 0xe0100000,
  44. .pfn = __phys_to_pfn(0xe0100000),
  45. .length = SZ_128K,
  46. .type = MT_DEVICE
  47. },
  48. /* 2M mapping for SCU + L2 controller */
  49. {
  50. .virtual = 0xf0000000,
  51. .pfn = __phys_to_pfn(0x1e000000),
  52. .length = SZ_2M,
  53. .type = MT_DEVICE
  54. },
  55. #endif
  56. };
  57. void __init emev2_map_io(void)
  58. {
  59. iotable_init(emev2_io_desc, ARRAY_SIZE(emev2_io_desc));
  60. }
  61. /* UART */
  62. static struct resource uart0_resources[] = {
  63. [0] = {
  64. .start = 0xe1020000,
  65. .end = 0xe1020037,
  66. .flags = IORESOURCE_MEM,
  67. },
  68. [1] = {
  69. .start = 40,
  70. .flags = IORESOURCE_IRQ,
  71. }
  72. };
  73. static struct platform_device uart0_device = {
  74. .name = "serial8250-em",
  75. .id = 0,
  76. .num_resources = ARRAY_SIZE(uart0_resources),
  77. .resource = uart0_resources,