Passing u-boot parameters to kernel

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Passing u-boot parameters to kernel

14,060 次查看
jemish_1990
Contributor V

Hi All,

I have very basic question. I want to pass few u-boot parameters (other then bootargs) to kernel.

We are using kernel 3.14.28. I have used ATAG mechanism in kernel 2.6.37 but seems that things have got changed.

Any examples or reference code related to kernel 3.14.28 will be appreciated.

Thanks,

Jemish

标签 (1)
0 项奖励
回复
5 回复数

9,275 次查看
BiyongSUN
NXP Employee
NXP Employee

you can use chosen in DT

linux/Documentation/devicetree/usage-model.txt

178 2.3 Runtime configuration

179 -------------------------

180 In most cases, a DT will be the sole method of communicating data from

181 firmware to the kernel, so also gets used to pass in runtime and

182 configuration data like the kernel parameters string and the location

183 of an initrd image.

184

185 Most of this data is contained in the /chosen node, and when booting

186 Linux it will look something like this:

187

188         chosen {

189                 bootargs = "console=ttyS0,115200 loglevel=8";

190                 initrd-start = <0xc8000000>;

191                 initrd-end = <0xc8200000>;

192         };

193

194 The bootargs property contains the kernel arguments

0 项奖励
回复

9,275 次查看
eric_kang
Contributor II

Hi Biyong Sun,

I have a question for the Communication between Kernel and U-boot.

I want to know how to send the just 1bit data between kernel and u-boot.

Could you tell me how to do that?

Actually I have to perform the below action in kernel and u-boot.
1) In kernel, set or clear a 1-bit flag in some space.

2) In U-boot, U-boot perform some action base on the 1-bit falg

    2-1) Perform A action when the 1-bit flag is "0".

    2-2) Perform B action when the 1-bit flag is "1".

Best Regards,

Eric.

0 项奖励
回复

9,275 次查看
jemish_1990
Contributor V

Hi,

One more thing while reading kernel Documentation I come to know that we can either pass tag list or flattened device-tree block.

In this case how can we pass u-boot parameters to kernel.

Thanks,

Jemish

0 项奖励
回复

9,275 次查看
martinolejar-b4
NXP Employee
NXP Employee

Hi Jemish,

You can pass the u-boot parameters by command "setenv bootargs <your argumets>" from u-boot terminal. After boot the kernel you can read it by "cat /proc/cmdline". The official images for i.MX6/7 support device tree and bootargs in default for all new kernels.

Martin

9,275 次查看
jemish_1990
Contributor V

Hi Martin,

Thanks for your quick response!

Is bootargs only way to pass u-boot parameters to kernel or is there any other option ?

Because in case of ATAG mechanism I am able to pass u-boot parameters without adding it in bootargs?

Thanks,

Jemish

0 项奖励
回复