dm644x.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * SoC-specific code for tms320dm644x chips
  3. *
  4. * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
  5. * Copyright (C) 2008 Lyrtech <www.lyrtech.com>
  6. * Copyright (C) 2004 Texas Instruments.
  7. *
  8. * SPDX-License-Identifier: GPL-2.0+
  9. */
  10. #include <common.h>
  11. #include <asm/arch/hardware.h>
  12. #define PINMUX0_EMACEN (1 << 31)
  13. #define PINMUX0_AECS5 (1 << 11)
  14. #define PINMUX0_AECS4 (1 << 10)
  15. #define PINMUX1_I2C (1 << 7)
  16. #define PINMUX1_UART1 (1 << 1)
  17. #define PINMUX1_UART0 (1 << 0)
  18. void davinci_enable_uart0(void)
  19. {
  20. lpsc_on(DAVINCI_LPSC_UART0);
  21. /* Bringup UART0 out of reset */
  22. REG(UART0_PWREMU_MGMT) = 0x00006001;
  23. /* Enable UART0 MUX lines */
  24. REG(PINMUX1) |= PINMUX1_UART0;
  25. }
  26. #ifdef CONFIG_DRIVER_TI_EMAC
  27. void davinci_enable_emac(void)
  28. {
  29. lpsc_on(DAVINCI_LPSC_EMAC);
  30. lpsc_on(DAVINCI_LPSC_EMAC_WRAPPER);
  31. lpsc_on(DAVINCI_LPSC_MDIO);
  32. /* Enable GIO3.3V cells used for EMAC */
  33. REG(VDD3P3V_PWDN) = 0;
  34. /* Enable EMAC. */
  35. REG(PINMUX0) |= PINMUX0_EMACEN;
  36. }
  37. #endif
  38. #ifdef CONFIG_SYS_I2C_DAVINCI
  39. void davinci_enable_i2c(void)
  40. {
  41. lpsc_on(DAVINCI_LPSC_I2C);
  42. /* Enable I2C pin Mux */
  43. REG(PINMUX1) |= PINMUX1_I2C;
  44. }
  45. #endif
  46. void davinci_errata_workarounds(void)
  47. {
  48. /*
  49. * Workaround for TMS320DM6446 errata 1.3.22:
  50. * PSC: PTSTAT Register Does Not Clear After Warm/Maximum Reset
  51. * Revision(s) Affected: 1.3 and earlier
  52. */
  53. REG(PSC_SILVER_BULLET) = 0;
  54. /*
  55. * Set the PR_OLD_COUNT bits in the Bus Burst Priority Register (PBBPR)
  56. * as suggested in TMS320DM6446 errata 2.1.2:
  57. *
  58. * On DM6446 Silicon Revision 2.1 and earlier, under certain conditions
  59. * low priority modules can occupy the bus and prevent high priority
  60. * modules like the VPSS from getting the required DDR2 throughput.
  61. * A hex value of 0x20 should provide a good ARM (cache enabled)
  62. * performance and still allow good utilization by the VPSS or other
  63. * modules.
  64. */
  65. REG(VBPR) = 0x20;
  66. }