Passing u-boot parameters to kernel

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing u-boot parameters to kernel

4,970 Views
Contributor IV

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

Labels (1)
0 Kudos
5 Replies

185 Views
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 Kudos

185 Views
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 Kudos

185 Views
Contributor IV

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 Kudos

185 Views
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

185 Views
Contributor IV

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 Kudos