dm6467evm.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * Copyright (C) 2009 Texas Instruments Incorporated
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. */
  18. #include <common.h>
  19. #include <netdev.h>
  20. #include <asm/io.h>
  21. #include <nand.h>
  22. #include <asm/arch/nand_defs.h>
  23. DECLARE_GLOBAL_DATA_PTR;
  24. #define REV_DM6467EVM 0
  25. #define REV_DM6467TEVM 1
  26. /*
  27. * get_board_rev() - setup to pass kernel board revision information
  28. * Returns:
  29. * bit[0-3] System clock frequency
  30. * 0000b - 27 MHz
  31. * 0001b - 33 MHz
  32. */
  33. u32 get_board_rev(void)
  34. {
  35. #ifdef CONFIG_DAVINCI_DM6467TEVM
  36. return REV_DM6467TEVM;
  37. #else
  38. return REV_DM6467EVM;
  39. #endif
  40. }
  41. int board_init(void)
  42. {
  43. gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_DM6467_EVM;
  44. gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
  45. lpsc_on(DAVINCI_DM646X_LPSC_TIMER0);
  46. lpsc_on(DAVINCI_DM646X_LPSC_UART0);
  47. lpsc_on(DAVINCI_DM646X_LPSC_I2C);
  48. lpsc_on(DAVINCI_DM646X_LPSC_EMAC);
  49. /* Enable GIO3.3V cells used for EMAC */
  50. REG(VDD3P3V_PWDN) = 0x80000c0;
  51. /* Select UART function on UART0 */
  52. REG(PINMUX0) &= ~(0x0000003f << 18);
  53. REG(PINMUX1) &= ~(0x00000003);
  54. return 0;
  55. }
  56. #if defined(CONFIG_DRIVER_TI_EMAC)
  57. int board_eth_init(bd_t *bis)
  58. {
  59. if (!davinci_emac_initialize()) {
  60. printf("Error: Ethernet init failed!\n");
  61. return -1;
  62. }
  63. return 0;
  64. }
  65. #endif /* CONFIG_DRIVER_TI_EMAC */
  66. #ifdef CONFIG_NAND_DAVINCI
  67. int board_nand_init(struct nand_chip *nand)
  68. {
  69. davinci_nand_init(nand);
  70. return 0;
  71. }
  72. #endif