dm644x.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. * See file CREDITS for list of people who contributed to this
  9. * project.
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24. */
  25. #include <common.h>
  26. #include <asm/arch/hardware.h>
  27. #define PINMUX0_EMACEN (1 << 31)
  28. #define PINMUX0_AECS5 (1 << 11)
  29. #define PINMUX0_AECS4 (1 << 10)
  30. #define PINMUX1_I2C (1 << 7)
  31. #define PINMUX1_UART1 (1 << 1)
  32. #define PINMUX1_UART0 (1 << 0)
  33. void davinci_enable_uart0(void)
  34. {
  35. lpsc_on(DAVINCI_LPSC_UART0);
  36. /* Bringup UART0 out of reset */
  37. REG(UART0_PWREMU_MGMT) = 0x00006001;
  38. /* Enable UART0 MUX lines */
  39. REG(PINMUX1) |= PINMUX1_UART0;
  40. }
  41. #ifdef CONFIG_DRIVER_TI_EMAC
  42. void davinci_enable_emac(void)
  43. {
  44. lpsc_on(DAVINCI_LPSC_EMAC);
  45. lpsc_on(DAVINCI_LPSC_EMAC_WRAPPER);
  46. lpsc_on(DAVINCI_LPSC_MDIO);
  47. /* Enable GIO3.3V cells used for EMAC */
  48. REG(VDD3P3V_PWDN) = 0;
  49. /* Enable EMAC. */
  50. REG(PINMUX0) |= PINMUX0_EMACEN;
  51. }
  52. #endif
  53. #ifdef CONFIG_DRIVER_DAVINCI_I2C
  54. void davinci_enable_i2c(void)
  55. {
  56. lpsc_on(DAVINCI_LPSC_I2C);
  57. /* Enable I2C pin Mux */
  58. REG(PINMUX1) |= PINMUX1_I2C;
  59. }
  60. #endif
  61. void davinci_errata_workarounds(void)
  62. {
  63. /*
  64. * Workaround for TMS320DM6446 errata 1.3.22:
  65. * PSC: PTSTAT Register Does Not Clear After Warm/Maximum Reset
  66. * Revision(s) Affected: 1.3 and earlier
  67. */
  68. REG(PSC_SILVER_BULLET) = 0;
  69. /*
  70. * Set the PR_OLD_COUNT bits in the Bus Burst Priority Register (PBBPR)
  71. * as suggested in TMS320DM6446 errata 2.1.2:
  72. *
  73. * On DM6446 Silicon Revision 2.1 and earlier, under certain conditions
  74. * low priority modules can occupy the bus and prevent high priority
  75. * modules like the VPSS from getting the required DDR2 throughput.
  76. * A hex value of 0x20 should provide a good ARM (cache enabled)
  77. * performance and still allow good utilization by the VPSS or other
  78. * modules.
  79. */
  80. REG(VBPR) = 0x20;
  81. }