simone.c 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * arch/arm/mach-ep93xx/simone.c
  3. * Simplemachines Sim.One support.
  4. *
  5. * Copyright (C) 2010 Ryan Mallon <ryan@bluewatersys.com>
  6. *
  7. * Based on the 2.6.24.7 support:
  8. * Copyright (C) 2009 Simplemachines
  9. * MMC support by Peter Ivanov <ivanovp@gmail.com>, 2007
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or (at
  14. * your option) any later version.
  15. *
  16. */
  17. #include <linux/kernel.h>
  18. #include <linux/init.h>
  19. #include <linux/platform_device.h>
  20. #include <linux/mtd/physmap.h>
  21. #include <linux/gpio.h>
  22. #include <linux/i2c.h>
  23. #include <linux/i2c-gpio.h>
  24. #include <mach/hardware.h>
  25. #include <mach/fb.h>
  26. #include <asm/mach-types.h>
  27. #include <asm/mach/arch.h>
  28. static struct physmap_flash_data simone_flash_data = {
  29. .width = 2,
  30. };
  31. static struct resource simone_flash_resource = {
  32. .start = EP93XX_CS6_PHYS_BASE,
  33. .end = EP93XX_CS6_PHYS_BASE + SZ_8M - 1,
  34. .flags = IORESOURCE_MEM,
  35. };
  36. static struct platform_device simone_flash = {
  37. .name = "physmap-flash",
  38. .id = 0,
  39. .num_resources = 1,
  40. .resource = &simone_flash_resource,
  41. .dev = {
  42. .platform_data = &simone_flash_data,
  43. },
  44. };
  45. static struct ep93xx_eth_data simone_eth_data = {
  46. .phy_id = 1,
  47. };
  48. static struct ep93xxfb_mach_info simone_fb_info = {
  49. .num_modes = EP93XXFB_USE_MODEDB,
  50. .bpp = 16,
  51. .flags = EP93XXFB_USE_SDCSN0 | EP93XXFB_PCLK_FALLING,
  52. };
  53. static struct i2c_gpio_platform_data simone_i2c_gpio_data = {
  54. .sda_pin = EP93XX_GPIO_LINE_EEDAT,
  55. .sda_is_open_drain = 0,
  56. .scl_pin = EP93XX_GPIO_LINE_EECLK,
  57. .scl_is_open_drain = 0,
  58. .udelay = 0,
  59. .timeout = 0,
  60. };
  61. static struct i2c_board_info __initdata simone_i2c_board_info[] = {
  62. {
  63. I2C_BOARD_INFO("ds1337", 0x68),
  64. },
  65. };
  66. static void __init simone_init_machine(void)
  67. {
  68. ep93xx_init_devices();
  69. platform_device_register(&simone_flash);
  70. ep93xx_register_eth(&simone_eth_data, 1);
  71. ep93xx_register_fb(&simone_fb_info);
  72. ep93xx_register_i2c(&simone_i2c_gpio_data, simone_i2c_board_info,
  73. ARRAY_SIZE(simone_i2c_board_info));
  74. }
  75. MACHINE_START(SIM_ONE, "Simplemachines Sim.One Board")
  76. /* Maintainer: Ryan Mallon <ryan@bluewatersys.com> */
  77. .phys_io = EP93XX_APB_PHYS_BASE,
  78. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  79. .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
  80. .map_io = ep93xx_map_io,
  81. .init_irq = ep93xx_init_irq,
  82. .timer = &ep93xx_timer,
  83. .init_machine = simone_init_machine,
  84. MACHINE_END