简体   繁体   English

如何在Linux内核和U-boot中设置SoC的寄存器值?

[英]How to set the SoC's register values in Linux kernel and U-boot?

I have been given all the register values like SRAM Window 0 Control Register,PCI Express Configuration Address Register and numerous other register values for Armada 370 SoC. 我得到了所有寄存器值,例如SRAM窗口0控制寄存器,PCI Express配置地址寄存器以及Armada 370 SoC的许多其他寄存器值。
Now for board bringup I have to set all these register values in U-boot and Linux kernel. 现在要进行板级启动,我必须在U-boot和Linux内核中设置所有这些寄存器值。
Is there a way to do this easily? 有没有一种方法可以轻松做到这一点?
For example, if I want to set the PCI Express Configuration Address Register, how do I start? 例如,如果要设置PCI Express配置地址寄存器,如何开始?
Any direction to good resource will be helpful. 任何指向良好资源的方向都会有所帮助。 Thanks. 谢谢。

1) In u-boot, look at /board subdirectory: there is your board-specific files should be located. 1)在u-boot中,查看/ board子目录:应该找到您的特定于主板的文件。 There is several Marvell platforms presented, but no armada 370, so looks like you should add it by yourself. 展示了几个Marvell平台,但没有armada 370,因此看起来您应该自己添加它。 Maybe, you already have proper distribution? 也许您已经有适当的分配了? Examining existing code, I guess you should use GT_REG_WRITE macro (defined in /board/Marvell/common/core.h). 检查现有代码,我想您应该使用GT_REG_WRITE宏(在/board/Marvell/common/core.h中定义)。 But it can differ for armada 370. 但舰队370可能会有所不同。

2) In linux kernel, there is a place for board specific code too: look in /arch subdirectory. 2)在linux内核中,也有一个特定于主板的代码的地方:在/ arch子目录中查找。 Armada 370 is based on ARM, so it should be placed into /arch/arm. Armada 370基于ARM,因此应将其放置在/ arch / arm中。 There is a block of common code for all of ARM platforms, and specific subdirectories named "mach-" and "plat-". 所有ARM平台都有一个通用代码块,以及名为“ mach-”和“ plat-”的特定子目录。 Your code should be arranged like there. 您的代码应按此处排列。 In "mach-" subdirectories look for "board-" files, they are contain code executed at linux kernel start. 在“ mach-”子目录中查找“ board-”文件,它们包含在Linux内核启动时执行的代码。

You should have a look into arch/arm/mach-mvebu ! 您应该看看arch / arm / mach-mvebu! (I am refering to the 3.16 kernel). (我指的是3.16内核)。

Free-Electrons have also worked a lot on this SoC Family. 自由电子在这个SoC系列上也做了很多工作。 You can have a look to their git here: https://github.com/MISL-EBU-System-SW/mainline-public/commits/3.16/cpuidle-v3 您可以在这里查看他们的git: https : //github.com/MISL-EBU-System-SW/mainline-public/commits/3.16/cpuidle-v3

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM