UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Participant coreyhahn
Participant
278 Views
Registered: ‎09-13-2018

noob Question: How to insert a boot script between two boot items in petalinux

Jump to solution

So I have a boot script, it runs at S99 in rc5.d.  But that is too late.

The script initializes a clock generator with i2c commands and I need the clock generator up before usb3 is initialized.

How do I first figure out where i2c and usb3 are initialized, and secondly insert my i2c/clockgen script inbetween them.

Hunting through init.d scripts I cannot find anything resembling "init_i2c" and "init_usb3".   Where do i start?  Is this in the kernel?

Thanks in advance.

Corey

0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
218 Views
Registered: ‎04-24-2017

Re: noob Question: How to insert a boot script between two boot items in petalinux

Jump to solution

Hi @coreyhahn

Yes you can run scripts in u-boot using source commands. Refer http://www.denx.de/wiki/view/DULG/UBootScripts

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
4 Replies
Participant coreyhahn
Participant
259 Views
Registered: ‎09-13-2018

Re: noob Question: How to insert a boot script between two boot items in petalinux

Jump to solution

Related to this, is it possible to run a script in uboot?

0 Kudos
Moderator
Moderator
219 Views
Registered: ‎04-24-2017

Re: noob Question: How to insert a boot script between two boot items in petalinux

Jump to solution

Hi @coreyhahn

Yes you can run scripts in u-boot using source commands. Refer http://www.denx.de/wiki/view/DULG/UBootScripts

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Participant coreyhahn
Participant
202 Views
Registered: ‎09-13-2018

Re: noob Question: How to insert a boot script between two boot items in petalinux

Jump to solution

Excellent!  Is there a way to then have the script run at boot every time before the Linux kernel image starts instead of downloaded and run manually?

0 Kudos
Participant coreyhahn
Participant
190 Views
Registered: ‎09-13-2018

Re: noob Question: How to insert a boot script between two boot items in petalinux

Jump to solution

platform-auto.h, used in U-BOOT has a #define CONFIG_PREBOOT that contains a small script run just before boot of the kernel.  I2C is up and running in UBOOT so I just stuck my config script inside this #define by modifying platform-top.h.  this file looks to be also used in UBOOT.

 

#undef CONFIG_PREBOOT	
#define CONFIG_PREBOOT "My new script; Default Preboot script stuff:"

 

0 Kudos