dm6467evm.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Copyright (C) 2009 Texas Instruments Incorporated
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <netdev.h>
  8. #include <asm/io.h>
  9. #include <nand.h>
  10. #include <asm/arch/hardware.h>
  11. #include <asm/ti-common/davinci_nand.h>
  12. DECLARE_GLOBAL_DATA_PTR;
  13. #define REV_DM6467EVM 0
  14. #define REV_DM6467TEVM 1
  15. /*
  16. * get_board_rev() - setup to pass kernel board revision information
  17. * Returns:
  18. * bit[0-3] System clock frequency
  19. * 0000b - 27 MHz
  20. * 0001b - 33 MHz
  21. */
  22. u32 get_board_rev(void)
  23. {
  24. #ifdef CONFIG_DAVINCI_DM6467TEVM
  25. return REV_DM6467TEVM;
  26. #else
  27. return REV_DM6467EVM;
  28. #endif
  29. }
  30. int board_init(void)
  31. {
  32. gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_DM6467_EVM;
  33. gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
  34. lpsc_on(DAVINCI_DM646X_LPSC_TIMER0);
  35. lpsc_on(DAVINCI_DM646X_LPSC_UART0);
  36. lpsc_on(DAVINCI_DM646X_LPSC_I2C);
  37. lpsc_on(DAVINCI_DM646X_LPSC_EMAC);
  38. /* Enable GIO3.3V cells used for EMAC */
  39. REG(VDD3P3V_PWDN) = 0x80000c0;
  40. /* Select UART function on UART0 */
  41. REG(PINMUX0) &= ~(0x0000003f << 18);
  42. REG(PINMUX1) &= ~(0x00000003);
  43. return 0;
  44. }
  45. #if defined(CONFIG_DRIVER_TI_EMAC)
  46. int board_eth_init(bd_t *bis)
  47. {
  48. if (!davinci_emac_initialize()) {
  49. printf("Error: Ethernet init failed!\n");
  50. return -1;
  51. }
  52. return 0;
  53. }
  54. #endif /* CONFIG_DRIVER_TI_EMAC */
  55. #ifdef CONFIG_NAND_DAVINCI
  56. int board_nand_init(struct nand_chip *nand)
  57. {
  58. davinci_nand_init(nand);
  59. return 0;
  60. }
  61. #endif