cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
1,940 Views
Registered: ‎06-07-2018

Modifying U-Boot booting arguments and DHCP command for Petalinux

Hi,

I want to try the following things :

1. Modify the booting arguments of u-boot of my Petalinux project which is currently using the Xilinx Kernel. I want to modify it such that it runs dhcp during booting the u-boot itself to acquire an IP address for itself and the IP for TFTP server from our central IT infrastructure.

I know this is possible to do with x86_64 processors running a CentOS grub during the boot process, as thats what systems in our office use. The Wiki page for DHCP also says additional options for acquiring IP address for TFTP server can be added in the DHCP packet.

This has been mentioned in the following link :

https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol

2. As you guessed, along with modification of boot arguments to add DHCP in the boot process, I want to modify the DHCP command script to add the TFTP option (if possible for the Petalinux DHCP)

This should essentially look like this ,

1. U-boot starts booting

2. It calls DHCP in the process to obtain its own and TFTP server IP from central DHCP server

3. This DHCP command then along with obtaining its own IP also obtains TFTP server IP

Can anybody please help me with this? This would be really helpful.

Regards,

Keyshav

0 Kudos
6 Replies
Highlighted
Xilinx Employee
Xilinx Employee
1,911 Views
Registered: ‎04-15-2011

@keyshavmor2611 

DHCP and TFTP boot are supported by Petalinux.

Just search UG1144 with keyword "DHCP" and "TFTP" for how to enable them.

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Observer
Observer
1,898 Views
Registered: ‎06-07-2018

Hi Longley,
I understood and have already booted successfully over TFTP. My questions was specifically in context with the u-boot process.
Regards,
Keyshav
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
1,890 Views
Registered: ‎04-15-2011

Hi, @keyshavmor2611 

Yes, I am talking about u-boot.

I can see DHCP is enabled in u-boot in ZCU102 BSP. Settings in Petalinux will also apply to u-boot. Please let me know if I misunderstanding your questions.

 

U-Boot 2018.01 (Dec 06 2018 - 10:00:41 +0000) Xilinx ZynqMP ZCU102 rev1.0

I2C: ready
DRAM: 4 GiB
EL Level: EL2
Chip ID: zu9eg
MMC: mmc@ff170000: 0 (SD)
SF: Detected n25q512a with page size 512 Bytes, erase size 128 KiB, total 128 MiB
In: serial@ff000000
Out: serial@ff000000
Err: serial@ff000000
Model: ZynqMP ZCU102 Rev1.0
Board: Xilinx ZynqMP
Net: ZYNQ GEM: ff0e0000, phyaddr c, interface rgmii-id

Warning: ethernet@ff0e0000 MAC addresses don't match:
Address in ROM is cf:db:ec:b5:e5:f7
Address in environment is 00:0a:35:00:22:01
eth0: ethernet@ff0e0000
Hit any key to stop autoboot: 0
ZynqMP>
ZynqMP> dhcp
BOOTP broadcast 1
DHCP client bound to address 172.16.75.86 (156 ms)

 

 

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Highlighted
Moderator
Moderator
1,879 Views
Registered: ‎09-12-2007

Have a look at the CONFIG_EXTRA_ENV_SETTINGS. For example if you are usign zynq ultrascale:

https://github.com/Xilinx/u-boot-xlnx/blob/master/include/configs/xilinx_zynqmp.h

This used the modeboot env to know where to automatically boot from:

modeboot.PNG

 

In your case, if you want to do a tftpboot, you can set the modeboot to netboot (setenv modeboot=netboot; saveenv), and you could update the xilinx_zynqmp.h to do a dhcp, and setup your tftpserver

0 Kudos
Highlighted
Observer
Observer
1,871 Views
Registered: ‎06-07-2018

Hi Stephenm,

Thank You for the guidance. This helped me in figuring it out.

Regards,

Keyshav

0 Kudos
Highlighted
Moderator
Moderator
1,866 Views
Registered: ‎09-12-2007

Ok, great. Can you mark this as solved?

0 Kudos