tosa.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /*
  2. * Support for Sharp SL-C6000x PDAs
  3. * Model: (Tosa)
  4. *
  5. * Copyright (c) 2005 Dirk Opfer
  6. *
  7. * Based on code written by Sharp/Lineo for 2.4 kernels
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. *
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/device.h>
  17. #include <linux/major.h>
  18. #include <linux/fs.h>
  19. #include <linux/interrupt.h>
  20. #include <linux/mmc/host.h>
  21. #include <asm/setup.h>
  22. #include <asm/memory.h>
  23. #include <asm/mach-types.h>
  24. #include <asm/hardware.h>
  25. #include <asm/irq.h>
  26. #include <asm/arch/irda.h>
  27. #include <asm/arch/mmc.h>
  28. #include <asm/arch/udc.h>
  29. #include <asm/mach/arch.h>
  30. #include <asm/mach/map.h>
  31. #include <asm/mach/irq.h>
  32. #include <asm/arch/pxa-regs.h>
  33. #include <asm/arch/irq.h>
  34. #include <asm/arch/tosa.h>
  35. #include <asm/hardware/scoop.h>
  36. #include <asm/mach/sharpsl_param.h>
  37. #include "generic.h"
  38. /*
  39. * SCOOP Device
  40. */
  41. static struct resource tosa_scoop_resources[] = {
  42. [0] = {
  43. .start = TOSA_CF_PHYS,
  44. .end = TOSA_CF_PHYS + 0xfff,
  45. .flags = IORESOURCE_MEM,
  46. },
  47. };
  48. static struct scoop_config tosa_scoop_setup = {
  49. .io_dir = TOSA_SCOOP_IO_DIR,
  50. .io_out = TOSA_SCOOP_IO_OUT,
  51. };
  52. struct platform_device tosascoop_device = {
  53. .name = "sharp-scoop",
  54. .id = 0,
  55. .dev = {
  56. .platform_data = &tosa_scoop_setup,
  57. },
  58. .num_resources = ARRAY_SIZE(tosa_scoop_resources),
  59. .resource = tosa_scoop_resources,
  60. };
  61. /*
  62. * SCOOP Device Jacket
  63. */
  64. static struct resource tosa_scoop_jc_resources[] = {
  65. [0] = {
  66. .start = TOSA_SCOOP_PHYS + 0x40,
  67. .end = TOSA_SCOOP_PHYS + 0xfff,
  68. .flags = IORESOURCE_MEM,
  69. },
  70. };
  71. static struct scoop_config tosa_scoop_jc_setup = {
  72. .io_dir = TOSA_SCOOP_JC_IO_DIR,
  73. .io_out = TOSA_SCOOP_JC_IO_OUT,
  74. };
  75. struct platform_device tosascoop_jc_device = {
  76. .name = "sharp-scoop",
  77. .id = 1,
  78. .dev = {
  79. .platform_data = &tosa_scoop_jc_setup,
  80. .parent = &tosascoop_device.dev,
  81. },
  82. .num_resources = ARRAY_SIZE(tosa_scoop_jc_resources),
  83. .resource = tosa_scoop_jc_resources,
  84. };
  85. static struct scoop_pcmcia_dev tosa_pcmcia_scoop[] = {
  86. {
  87. .dev = &tosascoop_device.dev,
  88. .irq = TOSA_IRQ_GPIO_CF_IRQ,
  89. .cd_irq = TOSA_IRQ_GPIO_CF_CD,
  90. .cd_irq_str = "PCMCIA0 CD",
  91. },{
  92. .dev = &tosascoop_jc_device.dev,
  93. .irq = TOSA_IRQ_GPIO_JC_CF_IRQ,
  94. .cd_irq = -1,
  95. },
  96. };
  97. static struct platform_device *devices[] __initdata = {
  98. &tosascoop_device,
  99. &tosascoop_jc_device,
  100. };
  101. static void __init tosa_init(void)
  102. {
  103. pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_IN);
  104. pxa_gpio_mode(TOSA_GPIO_TC6393_INT | GPIO_IN);
  105. /* setup sleep mode values */
  106. PWER = 0x00000002;
  107. PFER = 0x00000000;
  108. PRER = 0x00000002;
  109. PGSR0 = 0x00000000;
  110. PGSR1 = 0x00FF0002;
  111. PGSR2 = 0x00014000;
  112. PCFR |= PCFR_OPDE;
  113. // enable batt_fault
  114. PMCR = 0x01;
  115. platform_add_devices(devices, ARRAY_SIZE(devices));
  116. scoop_num = 2;
  117. scoop_devs = &tosa_pcmcia_scoop[0];
  118. }
  119. static void __init fixup_tosa(struct machine_desc *desc,
  120. struct tag *tags, char **cmdline, struct meminfo *mi)
  121. {
  122. sharpsl_save_param();
  123. mi->nr_banks=1;
  124. mi->bank[0].start = 0xa0000000;
  125. mi->bank[0].node = 0;
  126. mi->bank[0].size = (64*1024*1024);
  127. }
  128. MACHINE_START(TOSA, "SHARP Tosa")
  129. .phys_ram = 0xa0000000,
  130. .phys_io = 0x40000000,
  131. .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
  132. .fixup = fixup_tosa,
  133. .map_io = pxa_map_io,
  134. .init_irq = pxa_init_irq,
  135. .init_machine = tosa_init,
  136. .timer = &pxa_timer,
  137. MACHINE_END