修改UBOOT和LINUX调试串口(TI达芬奇芯片--DM6467)

2019-07-27 17:18发布

1.1 概述TI针对DM6467提供的UBOOT和内核默认都是串口0作为调试串口输出的,但现在我需要使用DM6467的UART0的modem功能,所以修改代码,改变调试串口为串口2。需要修改的主要有几部分内容:1. UBL 代码(这部分代码在刚上电的时候,初始化CPU和拷贝UBOOT到DDR,打印信息只有很少,所以不做修改)。2. UBOOT代码。3. linux内核驱动。      使用的代码及版本请参考:http://processors.wiki.ti.com/index.php/DaVinci_PSP_03.01_Beta_(r31)_Release_Notes
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
13条回答
白丁野老
2019-07-28 02:40
我的修改如下:
  1. 1 static void davinci_hd_psc_enable ( void )
  2. 2 {
  3. 3     unsigned int alwaysonpdnum = 0;
  4. 4
  5. 5     /* Note this function assumes that the Power Domains are alread on */
  6. 6     REG(PSC_ADDR+0xA00+4*14) |= 0x03; /* EMAC */
  7. 7     REG(PSC_ADDR+0xA00+4*15) |= 0x03; /* VDCE */
  8. 8     REG(PSC_ADDR+0xA00+4*16) |= 0x03; /* Video Port */
  9. 9     REG(PSC_ADDR+0xA00+4*17) |= 0x03; /* Video Port */
  10. 10     REG(PSC_ADDR+0xA00+4*20) |= 0x03; /* DDR2 */
  11. 11     REG(PSC_ADDR+0xA00+4*21) |= 0x03; /* EMIFA */
  12. 12     REG(PSC_ADDR+0xA00+4*26) |= 0x03; /* UART0 */
  13. 13     REG(PSC_ADDR+0xA00+4*27) |= 0x03; /* UART1 */
  14. 14     REG(PSC_ADDR+0xA00+4*28) |= 0x03; /* UART2 */
  15. 15     REG(PSC_ADDR+0xA00+4*31) |= 0x03; /* I2C */
  16. 16     REG(PSC_ADDR+0xA00+4*33) |= 0x03; /* GPIO */
  17. 17     REG(PSC_ADDR+0xA00+4*34) |= 0x03; /* TIMER0 */
  18. 18     REG(PSC_ADDR+0xA00+4*35) |= 0x03; /* TIMER1 */
  19. 19
  20. 20     /* Set PTCMD.GO to 0x1 to initiate the state transtion for Modules in
  21. 21      * the ALWAYSON Power Domain
  22. 22 */
  23. 23     REG(PSC_PTCMD) = (1<<alwaysonpdnum);
  24. 24
  25. 25     /* Wait for PTSTAT.GOSTAT0 to clear to 0x0 */
  26. 26     while(! (((REG(PSC_PTSTAT) >> alwaysonpdnum) & 0x00000001) == 0));
  27. 27
  28. 28     /* Enable GIO3.3V cells used for EMAC (???) */
  29. 29     REG(VDD3P3V_PWDN) = (1<<27);  //disable clkout0
  30. 30
  31. 31     /* Select UART function on UART0 */
  32. 32     REG(PINMUX0) &= ~(0x0000003f << 18);
  33. 34     REG(PINMUX1) = ((1<<4)|(1<<2)|(1<<0));
  34. 35
  35. 36     /* Enable USB */
  36. 37     REG(PINMUX0) &= ~(0x80000000);
  37. 38
  38. 39     /* Set the Bus Priority Register to appropriate value */
  39. 40     REG(VBPR) = 0x20;
  40. 41 }
复制代码

一周热门 更多>