README.md 4.14 KB
Newer Older
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
1 2
# meta-ezynq
***
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
3 4 5
This layer provides an unofficial support for Xilinx Zynq architecture 
as well as evaluation boards.

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
6
*ezynq-u-boot* creates u-boot image (SPL + u-boot) without any extra proprietary tools required.
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
7 8
It does not support secure boot functionality and loading the FPGA (PL) part 
with a bitstream - it is planned to do under the control of the operating system - 
9 10
if needed this feature can be implemented using u-boot.

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
11 12
***
## Supported boards/machines
13
Boards supported by this layer:
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
14

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
15
* **Elphel393**
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
16 17 18
* **MicroZed**
* **Zedboard** (not tested)
* **ZC706** (not tested)
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
19

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
20
## Dependencies
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
21 22
This layer depends on:

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
23 24 25 26 27
* URI: *git://git.openembedded.org/bitbake*
* URI: *git://git.openembedded.org/openembedded-core*, layers: meta 
* URI: *git://github.com/MentorEmbedded/meta-sourcery.git*, layers: meta-sourcery (for external toolchains only)
* URI: *git://github.com/Xilinx/u-boot-xlnx.git*, branch=master-next
* URI: *git://git.code.sf.net/p/elphel/ezynq*
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
28

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
29
## Build instructions
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
30 31
The following instructions require a Poky installation (or equivalent).

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
32
Initialize a build using the *oe-init-build-env* script in Poky. Once
33
initialized configure *bblayers.conf* by adding the *meta-ezynq* layer:
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
34 35 36

	meta-ezynq \

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
37
To build a specific target BSP configure the associated machine in *local.conf*:
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
38

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
39
	MACHINE ?= "microzed"
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
40 41 42

Build U-Boot:

43 44 45 46 47
	$ bitbake u-boot-ezynq
or:
	$ bitbake virtual/bootloader
or:
	$ bitbake u-boot
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
48 49

Once complete the images for the target machine will be available in the output
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
50
directory *tmp/deploy/images*.
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
51 52 53

Images generated:

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
54
* **boot.bin**+**u-boot.img** (fsbl is not required to boot)
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
55

56
Extra output at *build/tmp/work/.../ezynq-u-boot/${PV}\_${PR}/git/u-boot-xlnx/*:
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
57

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
58 59 60
* **u-boot.html** - configuration settings overview
* **u-boot.map** - the bootloader's memory map
* **u-boot** - ELF file
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
61

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
62
## Booting
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
63

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
64 65 66
### SD Card Boot
**Note:** This boot flow generates a bootable **boot.bin**.

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
67
1. Copy **boot.bin** and **u-boot.img**(if generated) onto the SD Card.
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
68 69 70 71
* (might not work) Copy the following to the SD card (ensure to rename the files where appropriate):
    *  **uImage** - kernel
    *  **uramdisk.image.gz** (core-image-minimal-<machine name>.ext2.gz.u-boot) - RootFS
    *  **devicetree.dtb** (uImage-<machine name>.dtb) - Device Tree Blob
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
72 73
* Insert SD Card, connect UART to Terminal program and boot board (Ensure the
board is configured for SD Boot).
74
* To get to u-boot command line press any key withing 1 second.
75 76 77 78 79

## Develop (add new machine/board)

1. Configure the new board in *build/conf/local.conf*:

80
        MACHINE ?= "{new-board}"
81

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
82
2. Create *conf/machine/<new-board>.conf* - use *microzed.conf* as a reference.
83

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
84
3. Edit *{new-board}.conf* - add:
85

86
        UBOOT_MACHINE = "{new-config-name}_config"
87
 
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
88
     where *{new-config-name}* is from *boards.cfg* in [u-boot-xlnx](https://github.com/Xilinx/u-boot-xlnx) plus *"_config"*-ending
89

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
90
4. Run
91 92 93

        bitbake ezynq-u-boot -c patch -f

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
94
    The command clones git repositories and add ezynq files to u-boot-xlnx.
95

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
96
    **Note:** Ezynq can be cloned and generate **boot.bin** apart from poky - please see [Ezynq's documentation](http://wiki.elphel.com/index.php?title=Ezynq).
97

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
98
5. Edit ezynq files located at *build/tmp/work/.../ezynq-u-boot/${PV}_${PR}/git/u-boot-xlnx/*:
99

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
100
    * *boards.cfg* - add {new-config-name} if it's not in the list.
101

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
102
    * create a new *include/configs/{new-config-name}.h* - use zynq_microzed.h as a reference)
103

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
104
    * *{new-config-name}.h* needs to include the following files:
105 106 107 108 109

            #include <configs/ezynq/ezynq_MT41K256M16RE125.h>  /* should be before zed_ezynq.h as it overwrites DDR3L with DDR3 */
            #include <configs/ezynq/ezynq_XC7Z010_1CLG400.h>
            #include <configs/ezynq/zed_ezynq.h>

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
110
    * edit the included header files according to the new board configuration.
111

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
112
    **WARNING:** After the step 5 **don't** run *bitbake ezynq-u-boot -c clean* - deletes everything in *build/tmp/work/.../ezynq-u-boot/${PV}_${PR}/*
113

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
114
6. Run
115

116
        bitbake u-boot-ezynq
117

118
    **Note:** **u-boot.bin** (not the final boot.bin) size cannot exceed **192KB**
Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
119 120 121 122 123

## Trademark notices

Xilinx® and Zynq® are registered trademarks of Xilinx.

Oleg Dzhimiev's avatar
Oleg Dzhimiev committed
124
Ezynq project is not endorsed by or affiliated with Xilinx Inc.