This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于AM335X片内SRAM用途的问题

Other Parts Discussed in Thread: AM3358

想请教一下,AM3358片内有64KSRAM,地址是0x402F0400,手册上讲这个Internal SRAM是专用RAM,请问这个“专用”是什么意思,是指第二级 bootloader:MLO(SPL)使用吗,能否将数据放在这个SRAM中进行放问啊?

  • 首先,芯片启动时候运行的ROM code是跑在这里的,启动Linux的时候MLO也是跑在这里的。可以在这里存在数据,但是这里的空间很小。

    建议你可以看下Linux的uboot介绍资源,对这个地方的时候有些描述:

    http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User%27s_Guide#Two_stage_U-Boot_design

    Two stage U-Boot design

    This section gives an overview of the two stage U-Boot approach adopted for AM335X.

    The size of the internal RAM in AM335X is 128KB out of which 18KB at the end is used by the ROM code. Also, 1 KB at the start (0x402f0000 - 0x402f0400) is secure and it cannot be accessed This places a limit of 109KB on the size of the U-Boot binary which the ROM code can transfer to the internal RAM and use as an initial stack before initialization of DRAM.

    Since it is not possible to squeeze in all the functionality that is normally expected from U-Boot in < 110KB (after setting aside some space for stack, heap etc) a two stage approach has been adopted. Initial stage initalize only the required boot devices (NAND, MMC, I2C etc); 2nd full stage initall all other devices (ethernet, timers, clocks etc). The 1st binary is generated MLO and the 2nd stage is generated as u-boot.img.

  • 您的意思是指,U-Boot,有部分启动文件是映射在Internal SRAM中的是吗,如果是裸机的话也是这样子吗?那如果把数据放在Internal SRAM中访问的时候会有问题吗???

  • 可以这么理解,UBOOT的话,包括了MLO和u-boot.img,MLO中做了DDR的初始化,这个是跑在internal的ram上的。u-boot.img是跑在DDR上的。

    数据放在里面访问不会有问题,但一定要注意那个空间大小,放的地方需要特别小心,避免有冲突的情况发生。

  • 能指导一下,如果这样子的话,把数据放在Internal SRAM中应该放在哪里,开始地址是哪里,有多大空间能够用,比方我要放一个8*8的double矩阵少,怎样避免冲突情况发生

  • 你是要裸跑测性能么?如果是的话,建议你参考我们的Starterware裸跑程序,这个软件包中有个boot的例程,照着这个历程去改就比较简单了,load的地址,数据段的分配,在cmd文件中都已经分配妥了。

    Starterware download link: http://processors.wiki.ti.com/index.php/StarterWare