dm644x.c 1.8 KB

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