board-da850-evm.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * TI DA850/OMAP-L138 EVM board
  3. *
  4. * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
  5. *
  6. * Derived from: arch/arm/mach-davinci/board-da830-evm.c
  7. * Original Copyrights follow:
  8. *
  9. * 2007, 2009 (c) MontaVista Software, Inc. This file is licensed under
  10. * the terms of the GNU General Public License version 2. This program
  11. * is licensed "as is" without any warranty of any kind, whether express
  12. * or implied.
  13. */
  14. #include <linux/kernel.h>
  15. #include <linux/module.h>
  16. #include <linux/init.h>
  17. #include <linux/console.h>
  18. #include <linux/i2c.h>
  19. #include <linux/i2c/at24.h>
  20. #include <asm/mach-types.h>
  21. #include <asm/mach/arch.h>
  22. #include <mach/common.h>
  23. #include <mach/irqs.h>
  24. #include <mach/cp_intc.h>
  25. #include <mach/da8xx.h>
  26. static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
  27. .bus_freq = 100, /* kHz */
  28. .bus_delay = 0, /* usec */
  29. };
  30. static struct davinci_uart_config da850_evm_uart_config __initdata = {
  31. .enabled_uarts = 0x7,
  32. };
  33. static __init void da850_evm_init(void)
  34. {
  35. int ret;
  36. ret = da8xx_register_edma();
  37. if (ret)
  38. pr_warning("da850_evm_init: edma registration failed: %d\n",
  39. ret);
  40. ret = da8xx_pinmux_setup(da850_i2c0_pins);
  41. if (ret)
  42. pr_warning("da850_evm_init: i2c0 mux setup failed: %d\n",
  43. ret);
  44. ret = da8xx_register_i2c(0, &da850_evm_i2c_0_pdata);
  45. if (ret)
  46. pr_warning("da850_evm_init: i2c0 registration failed: %d\n",
  47. ret);
  48. ret = da8xx_register_watchdog();
  49. if (ret)
  50. pr_warning("da830_evm_init: watchdog registration failed: %d\n",
  51. ret);
  52. davinci_serial_init(&da850_evm_uart_config);
  53. /*
  54. * shut down uart 0 and 1; they are not used on the board and
  55. * accessing them causes endless "too much work in irq53" messages
  56. * with arago fs
  57. */
  58. __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
  59. __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30);
  60. }
  61. #ifdef CONFIG_SERIAL_8250_CONSOLE
  62. static int __init da850_evm_console_init(void)
  63. {
  64. return add_preferred_console("ttyS", 2, "115200");
  65. }
  66. console_initcall(da850_evm_console_init);
  67. #endif
  68. static __init void da850_evm_irq_init(void)
  69. {
  70. struct davinci_soc_info *soc_info = &davinci_soc_info;
  71. cp_intc_init((void __iomem *)DA8XX_CP_INTC_VIRT, DA850_N_CP_INTC_IRQ,
  72. soc_info->intc_irq_prios);
  73. }
  74. static void __init da850_evm_map_io(void)
  75. {
  76. da850_init();
  77. }
  78. MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138 EVM")
  79. .phys_io = IO_PHYS,
  80. .io_pg_offst = (__IO_ADDRESS(IO_PHYS) >> 18) & 0xfffc,
  81. .boot_params = (DA8XX_DDR_BASE + 0x100),
  82. .map_io = da850_evm_map_io,
  83. .init_irq = da850_evm_irq_init,
  84. .timer = &davinci_timer,
  85. .init_machine = da850_evm_init,
  86. MACHINE_END