Quantcast

Booting Zynq/Gnuradio

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Booting Zynq/Gnuradio

Jan Schiefer-2
Hi everybody,

I was thrilled to find Jonathon's writeup, and I have been trying to get
the same setup working here. Some things I learned along the way:

- OpenEmbedded is very very cool!
- bitbake doesn't work on eCryptfs file systems, as its path length
restrictions are not acceptable. One needs to build somewhere else (or at
least put the TMP and SSTATE-CACHE directories elsewhere).
- On my system (Ubuntu 12.04 64-bit), there was no binary called gmake,
which caused problems when generating the bit file with the Xilinx tool
chain. Solved this by linking /usr/bin/make to /usr/bin/gmake

Now, many many CPU cycles later, I am at the point of booting it. Well,
almost. What happens is that Das U-Boot is looking for an initial ramdisk:

U-Boot 2013.01 (Aug 17 2013 - 06:32:40)

DRAM:  512 MiB
WARNING: Caches not enabled
MMC:   zynq_sdhci: 0
SF: Detected S25FL256S with page size 64 KiB, total 32 MiB
In:    serial
Out:   serial
Err:   serial
Net:   Gem.e000b000
Hit any key to stop autoboot:  0
Copying Linux from SD to RAM...
Device: zynq_sdhci
Manufacturer ID: 1b
OEM: 534d
Name: 00000
Tran Speed: 50000000
Rd Block Len: 512
SD version 2.0
High Capacity: Yes
Capacity: 3.7 GiB
Bus Width: 4-bit
reading uImage
2855496 bytes read in 415 ms (6.6 MiB/s)
reading devicetree.dtb
21734 bytes read in 19 ms (1.1 MiB/s)
reading uramdisk.image.gz
** Unable to read file uramdisk.image.gz **
zynq-uboot>

Why? Because the environment says so:
sdboot=echo Copying Linux from SD to RAM... && mmcinfo && fatload mmc 0
0x3000000 ${kernel_image} && fatload mmc 0 0x2A00000 ${devicetree_image}
&& fatload mmc 0 0x2000000 ${ramdisk_image} && bootm 0x3000000 - 0x2A00000

That doesn't seem quite right, I am assuming this should use the rootfs in
the rootfs partition, shouldn't it?

So my question is, am I missing something, or is the zynq Wiki page
missing a little section on how to set up the U-Boot environment variables
in the flash?

Again, thanks for the great work, this is exciting stuff!

Regards,
   Jan, ac7td




_______________________________________________
Discuss-gnuradio mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Booting Zynq/Gnuradio

Philip Balister
On 08/20/2013 04:32 AM, Jan Schiefer wrote:

> Hi everybody,
>
> I was thrilled to find Jonathon's writeup, and I have been trying to get
> the same setup working here. Some things I learned along the way:
>
> - OpenEmbedded is very very cool!
> - bitbake doesn't work on eCryptfs file systems, as its path length
> restrictions are not acceptable. One needs to build somewhere else (or at
> least put the TMP and SSTATE-CACHE directories elsewhere).
> - On my system (Ubuntu 12.04 64-bit), there was no binary called gmake,
> which caused problems when generating the bit file with the Xilinx tool
> chain. Solved this by linking /usr/bin/make to /usr/bin/gmake
>
> Now, many many CPU cycles later, I am at the point of booting it. Well,
> almost. What happens is that Das U-Boot is looking for an initial ramdisk:
>
> U-Boot 2013.01 (Aug 17 2013 - 06:32:40)
>
> DRAM:  512 MiB
> WARNING: Caches not enabled
> MMC:   zynq_sdhci: 0
> SF: Detected S25FL256S with page size 64 KiB, total 32 MiB
> In:    serial
> Out:   serial
> Err:   serial
> Net:   Gem.e000b000
> Hit any key to stop autoboot:  0
> Copying Linux from SD to RAM...
> Device: zynq_sdhci
> Manufacturer ID: 1b
> OEM: 534d
> Name: 00000
> Tran Speed: 50000000
> Rd Block Len: 512
> SD version 2.0
> High Capacity: Yes
> Capacity: 3.7 GiB
> Bus Width: 4-bit
> reading uImage
> 2855496 bytes read in 415 ms (6.6 MiB/s)
> reading devicetree.dtb
> 21734 bytes read in 19 ms (1.1 MiB/s)
> reading uramdisk.image.gz
> ** Unable to read file uramdisk.image.gz **
> zynq-uboot>
>
> Why? Because the environment says so:
> sdboot=echo Copying Linux from SD to RAM... && mmcinfo && fatload mmc 0
> 0x3000000 ${kernel_image} && fatload mmc 0 0x2A00000 ${devicetree_image}
> && fatload mmc 0 0x2000000 ${ramdisk_image} && bootm 0x3000000 - 0x2A00000
>
> That doesn't seem quite right, I am assuming this should use the rootfs in
> the rootfs partition, shouldn't it?
>
> So my question is, am I missing something, or is the zynq Wiki page
> missing a little section on how to set up the U-Boot environment variables
> in the flash?

I assume you figured out you need to modify the bootm command so it does
not look for the ramdisk?  The default config from Xilinx is somewhat
obsessed with booting from a ramdisk :) I'm looking into some ways of
modifying the bootloader behavior without rebuilding it all the time.

What zynq hardware are you using?

Philip

>
> Again, thanks for the great work, this is exciting stuff!
>
> Regards,
>    Jan, ac7td
>
>
>
>
> _______________________________________________
> Discuss-gnuradio mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
>

_______________________________________________
Discuss-gnuradio mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Booting Zynq/Gnuradio

Jan Schiefer-2
> On 08/20/2013 04:32 AM, Jan Schiefer wrote:
>>
>> Now, many many CPU cycles later, I am at the point of booting it. Well,
>> almost. What happens is that Das U-Boot is looking for an initial
>> ramdisk:
>>
>> U-Boot 2013.01 (Aug 17 2013 - 06:32:40)
>>
>> DRAM:  512 MiB
>> WARNING: Caches not enabled
>> MMC:   zynq_sdhci: 0
>> SF: Detected S25FL256S with page size 64 KiB, total 32 MiB
>> In:    serial
>> Out:   serial
>> Err:   serial
>> Net:   Gem.e000b000
>> Hit any key to stop autoboot:  0
>> Copying Linux from SD to RAM...
>> Device: zynq_sdhci
>> Manufacturer ID: 1b
>> OEM: 534d
>> Name: 00000
>> Tran Speed: 50000000
>> Rd Block Len: 512
>> SD version 2.0
>> High Capacity: Yes
>> Capacity: 3.7 GiB
>> Bus Width: 4-bit
>> reading uImage
>> 2855496 bytes read in 415 ms (6.6 MiB/s)
>> reading devicetree.dtb
>> 21734 bytes read in 19 ms (1.1 MiB/s)
>> reading uramdisk.image.gz
>> ** Unable to read file uramdisk.image.gz **
>> zynq-uboot>
>>
>> Why? Because the environment says so:
>> sdboot=echo Copying Linux from SD to RAM... && mmcinfo && fatload mmc 0
>> 0x3000000 ${kernel_image} && fatload mmc 0 0x2A00000 ${devicetree_image}
>> && fatload mmc 0 0x2000000 ${ramdisk_image} && bootm 0x3000000 -
>> 0x2A00000
>>
>> That doesn't seem quite right, I am assuming this should use the rootfs
>> in
>> the rootfs partition, shouldn't it?
>>
>> So my question is, am I missing something, or is the zynq Wiki page
>> missing a little section on how to set up the U-Boot environment
>> variables
>> in the flash?
>
> I assume you figured out you need to modify the bootm command so it does
> not look for the ramdisk?  The default config from Xilinx is somewhat
> obsessed with booting from a ramdisk :) I'm looking into some ways of
> modifying the bootloader behavior without rebuilding it all the time.
>
> What zynq hardware are you using?
>
> Philip
>

This is on a Zedboard. I did figure out that I need to change mboot
parameters, but I haven't studied the whole setup enough to know what all
else needs to change. So I thought I'd ask :-).

When you write about modifications, are you referring to more advanced
ways to load bitfiles rather than sticking them in the boot image?

Regards,
   Jan


_______________________________________________
Discuss-gnuradio mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Booting Zynq/Gnuradio

Jan Schiefer-2
In reply to this post by Jan Schiefer-2
HI Ivan,

> I've been working through the wiki as well.  In my setup I had to also
> replace the FSBL with the default Xilinx one to get the system to boot
> (ZC702 eval board).  If you stop u-boot from autobooting you can go in and
> change the environment variables (printenv, setenv) and when you have
> everything setup you can 'saveenv' and the state will be saved to flash.
>
> Now the system boots smoothly.  Since I had some issues with the booting
> process I'm not sure if the system.bit file is loaded properly.  To make
> sure, I load the bit file using /dev/xdevcfg (have to mknod, convert .bit
> to .bin, etc.).  Then I insmod the user_peripheral.ko (had to copy it into
> /lib/modules/ for insmod to find it).

I was wondering how one would load a bit file after booting, so this
definitely a good tip. I will try that out once I get a little further
along.

Meanwhile I'll figure out the right boot environment variables for my
Zedboard next.

Thanks,
   Jan


_______________________________________________
Discuss-gnuradio mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Booting Zynq/Gnuradio

Ivan C.
In reply to this post by Jan Schiefer-2
On Tue, Aug 20, 2013 at 11:19 AM, Jan Schiefer <[hidden email]> wrote:

> HI Ivan,
>
>> I've been working through the wiki as well.  In my setup I had to also
>> replace the FSBL with the default Xilinx one to get the system to boot
>> (ZC702 eval board).  If you stop u-boot from autobooting you can go in and
>> change the environment variables (printenv, setenv) and when you have
>> everything setup you can 'saveenv' and the state will be saved to flash.
>>
>> Now the system boots smoothly.  Since I had some issues with the booting
>> process I'm not sure if the system.bit file is loaded properly.  To make
>> sure, I load the bit file using /dev/xdevcfg (have to mknod, convert .bit
>> to .bin, etc.).  Then I insmod the user_peripheral.ko (had to copy it into
>> /lib/modules/ for insmod to find it).
>
> I was wondering how one would load a bit file after booting, so this
> definitely a good tip. I will try that out once I get a little further
> along.
>
> Meanwhile I'll figure out the right boot environment variables for my
> Zedboard next.
>
> Thanks,
>    Jan

Hi Jan,

Take a look at openembedded-core/build_zedboard/tmp-eglibc/work/zedboard_user_peripheral.../u-boot-xlnx/v2013.../include/configs/zynq_common.h

string search for /* Default environment */

After the system boots, I had to make a minor change to the fir filter
example.  On the ZC702, I was getting a segfault as udev wasn't
finding devcfg.

/sys/devices/amba.0/ lists f8007000.ps7-dev-cfg, modifying the call to
udev_enumerate_add_match_sysname to look for this device instead of
f8007000.devcfg and the example now works.  Thanks to Jon and company
for this work!

Regards,
Ivan

_______________________________________________
Discuss-gnuradio mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Booting Zynq/Gnuradio

Philip Balister
In reply to this post by Jan Schiefer-2
On 08/20/2013 11:12 AM, Jan Schiefer wrote:

>> On 08/20/2013 04:32 AM, Jan Schiefer wrote:
>>>
>>> Now, many many CPU cycles later, I am at the point of booting it. Well,
>>> almost. What happens is that Das U-Boot is looking for an initial
>>> ramdisk:
>>>
>>> U-Boot 2013.01 (Aug 17 2013 - 06:32:40)
>>>
>>> DRAM:  512 MiB
>>> WARNING: Caches not enabled
>>> MMC:   zynq_sdhci: 0
>>> SF: Detected S25FL256S with page size 64 KiB, total 32 MiB
>>> In:    serial
>>> Out:   serial
>>> Err:   serial
>>> Net:   Gem.e000b000
>>> Hit any key to stop autoboot:  0
>>> Copying Linux from SD to RAM...
>>> Device: zynq_sdhci
>>> Manufacturer ID: 1b
>>> OEM: 534d
>>> Name: 00000
>>> Tran Speed: 50000000
>>> Rd Block Len: 512
>>> SD version 2.0
>>> High Capacity: Yes
>>> Capacity: 3.7 GiB
>>> Bus Width: 4-bit
>>> reading uImage
>>> 2855496 bytes read in 415 ms (6.6 MiB/s)
>>> reading devicetree.dtb
>>> 21734 bytes read in 19 ms (1.1 MiB/s)
>>> reading uramdisk.image.gz
>>> ** Unable to read file uramdisk.image.gz **
>>> zynq-uboot>
>>>
>>> Why? Because the environment says so:
>>> sdboot=echo Copying Linux from SD to RAM... && mmcinfo && fatload mmc 0
>>> 0x3000000 ${kernel_image} && fatload mmc 0 0x2A00000 ${devicetree_image}
>>> && fatload mmc 0 0x2000000 ${ramdisk_image} && bootm 0x3000000 -
>>> 0x2A00000
>>>
>>> That doesn't seem quite right, I am assuming this should use the rootfs
>>> in
>>> the rootfs partition, shouldn't it?
>>>
>>> So my question is, am I missing something, or is the zynq Wiki page
>>> missing a little section on how to set up the U-Boot environment
>>> variables
>>> in the flash?
>>
>> I assume you figured out you need to modify the bootm command so it does
>> not look for the ramdisk?  The default config from Xilinx is somewhat
>> obsessed with booting from a ramdisk :) I'm looking into some ways of
>> modifying the bootloader behavior without rebuilding it all the time.
>>
>> What zynq hardware are you using?
>>
>> Philip
>>
>
> This is on a Zedboard. I did figure out that I need to change mboot
> parameters, but I haven't studied the whole setup enough to know what all
> else needs to change. So I thought I'd ask :-).
>
> When you write about modifications, are you referring to more advanced
> ways to load bitfiles rather than sticking them in the boot image?

Mods to fix the ramdisk issue.

You can load the bitfile from linux with cat foo.bin > /dev/xdevcfg

There is a magic promgen command to get the endianess correct though.
I'll take a look at the wiki page and see if we can document the magic
command there.

Philip[


>
> Regards,
>    Jan
>
>
>

_______________________________________________
Discuss-gnuradio mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Booting Zynq/Gnuradio

Jonathon Pendlum
In reply to this post by Jan Schiefer-2
Hey Jan and others,

Thanks for the kind words. I am glad that people are finding my work useful. :-)

Xilinx's meta-xilinx layer was recently updated which broke my u-boot patch to boot from the SD card. I am working on a fix right now.

Meanwhile, you can manually boot to the SD card using "bootm 0x3000000 - 0x2A00000"



Jon
Loading...