修改GM8126的打印输出波特率

       GM8126平台要下载的代码文件有nsbootburninu-bootlinux。前三个其实都是引导程序。CPU出厂前已经固化了一段程序在里面,称为romcode。系统上电后首先执行这段代码,他只要是读取启动脚的信号判断是在哪启动,而且将一小部分代码复制到内部sram中。因为芯片内部只有32KSRAM,而且而且要留一部分做堆栈,所以复制到SRAM中的代码限制为28K,这部分代码其实就是nsboot。整个启动流程是:

1)  romcode启动,复制nsbootSRAM.

2)  nsboot运行,主要做了初始化串口,初始化DDR,初始化NAND或者SPI FLASH的工作,然后读取系统启动表,按地址将burninu-bootlinux复制到DDR2中。

3) 接着是按顺序运行burninu-bootlinux

      不过在调试时发现,可以不需要u-boot,正常启动的时候burnin直接引导linux。可能留着u-boot的原因是出于调试考虑吧,毕竟u-boot功能强大,调试的时候直接挂载NFS是最方便的了。

      官方给出的所有程序的打印输出都是用38400波特率的,输出的时候感觉很慢,超级终端中看着不顺畅,于是想改成115200输出的,由于这几个代码都是各自独立初始化串口的,每段代码都各自把串口重新初始化一遍,所以就得把这四个部分都做修改,下面说下步骤:

    1.  nsboot

修改nsboot目录下的serial.c文件,在serial_init()函数里面,将

       UART16550_WRITE(UART_DIV_L, 0x3);        // 38400

改为

       UART16550_WRITE(UART_DIV_L, 0x1);        // 115200

      为什么改成0x1?为了这个我翻了GM8126的手册,里面具体没有具体的波特率计算公式,真是服了。那只能找burnin里面的串口那部分的设置参考了,在

GM8126_SDK-V1.1\StartCell_Drivers\source\GM8126_NonOS\fLib\source\include\cpe.h里面有这段屏蔽的代码:

/*  System Clock=13.5MHZ, DLL= UART clock/(16 * baud), DLL= CPE_UARTx_BASE + 0x00

    such as PLL3_N=39, PLL3_CLK=SYS_CLK*PLL3_N

    UART_CLOCK / 16 / 115200 = 8.9 ==> UART_CLOCK / 9 = 1828125

 */

/*

#define CPE_BAUD_921600                 (UART_CLOCK / 13516800)

#define CPE_BAUD_460800                 (UART_CLOCK / 6758400)

#define CPE_BAUD_230400                 (UART_CLOCK / 3379200)

 

#define CPE_BAUD_115200                 (UART_CLOCK / 1828125)

#define CPE_BAUD_57600                  (UART_CLOCK / 914062)

#define CPE_BAUD_38400                             (UART_CLOCK / 609375)

#define CPE_BAUD_19200                  (UART_CLOCK / 304688)

#define CPE_BAUD_14400                  (UART_CLOCK / 228516)

#define CPE_BAUD_9600                   (UART_CLOCK / 152344)

#define CPE_BAUD_4800                   (UART_CLOCK / 76172)

#define CPE_BAUD_2400                   (UART_CLOCK / 38086)

#define CPE_BAUD_1200                   (UART_CLOCK / 19043)

*/

 

    根据之前波特率为38400时的值为0x3,那么可以知道UART_CLOCK=3*609375=1828125,所以CPE_BAUD_115200 = UART_CLOCK / 1828125 = 1.

 

    2. burnin

burnin的波特率只需要改一个宏定义就可以了:

GM8126_SDK-V1.1\StartCell_Drivers\source\GM8126_NonOS\fLib\source\include\cpe.h中的

       #define DEFAULT_HOST_BAUD               CPE_BAUD_38400

改为

       #define DEFAULT_HOST_BAUD               CPE_BAUD_115200

 

    3.u-boot

u-boot因为没用到,而且它可以通过命令行配置,所以不需要改代码了。

 

    4.  linux

    因为没有用到u-boot做引导,所以linux的启动参数需要修改配置文件来修改:

首先进入到linux目录下,make menuconfig,找到 Boot options,进入后将编辑下启动命令,将波特率改为115200,然后退出重新编译下内核就OK了。

 

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
GM8136 数据手册 The MPEG4/JPEG codec includes the hardware engines to accelerate the computation-intensive tasks, such as the motion estimation, DCT/IDCT, quantization/inverse quantization, and motion compensation. By initializing the control registers of this codec, MPEG4/JPEG codec will automatically perform the motion estimation calculation task for 16x16 or 8x8 block. MPEG4/JPEG codec will also automatically perform the DCT/quantization, IDCT/inverse quantization, AC/DC prediction, zigzag scan, and VLC/VLD calculation task for a macro-block. Therefore, CPU loading can be released from the timing critical tasks in the video encoding process. The features of the MPEG4/JPEG engine include:  Compliant with MPEG4 (ISO/IEC 14496-2) simple profile L0 ~ L3 standards with resolutions of subQCIF, QCIF, CIF, VGA, D1, and 720p with steps of 16 units  Compliant with JPEG (ISO/IEC 10918-1) baseline standard  Includes hardware engines for motion estimation/motion compensation, DCT/IDCT, quantization/inverse quantization, AC/DC prediction, and coding/decoding with variable length  Uses local memory controller to control local memory shared by CPU, MPEG4/JPEG codec, and DMA master  Uses DMA controller to control data transfers between system memory and local memory  Supports automatic power-down mechanism to reduce power consumption  Motion estimation search range: -16 ~ +15.5 (Optionally -32 ~ +31) with half-pixel accuracy  Supports short video header (H.263 baseline)  Supports H.263/MPEG/JPEG quantization methods

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值