Skip to content

Commit d0defec

Browse files
committed
[add] dual boot (it corresponds to boot of both ZYBO and DE0-Nano-SoC in one SD-Card)
1 parent 8e2faf1 commit d0defec

File tree

4 files changed

+177
-0
lines changed

4 files changed

+177
-0
lines changed

Readme.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,90 @@ shell# umount mnt/usb1
136136
shell# umount mnt/usb2
137137
````
138138

139+
### Dual Boot (ZYBO and DE0-Nano-SoC)
140+
141+
It corresponds to boot of both ZYBO and DE0-Nano-SoC in one SD-Card.
142+
143+
#### Downlowd from github
144+
145+
```
146+
shell$ git clone git://github.com/ikwzm/FPGA-SoC-Linux
147+
shell$ cd FPGA-SoC-Linux
148+
shell$ git lfs pull origin master
149+
```
150+
#### Build boot files
151+
152+
```
153+
shell$ cd target/zynq-zybo-de0-nano-soc/
154+
shell$ make
155+
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "linux boot script" -d boot/boot.script boot/boot.scr
156+
Image Name: linux-4.6.6 boot script
157+
Created: Mon Aug 15 15:30:45 2016
158+
Image Type: ARM Linux Script (uncompressed)
159+
Data Size: 1212 Bytes = 1.18 kB = 0.00 MB
160+
Load Address: 00000000
161+
Entry Point: 00000000
162+
Contents:
163+
Image 0: 1204 Bytes = 1.18 kB = 0.00 MB
164+
cp ../zynq-zybo/boot/zImage-4.4.7-armv7-fpga boot/zImage-4.4.7-armv7-fpga
165+
cp ../zynq-zybo/boot/boot.bin boot/boot.bin
166+
cp ../zynq-zybo/boot/design_1_wrapper.bit boot/design_1_wrapper.bit
167+
cp ../zynq-zybo/boot/devicetree-4.4.7-zynq-zybo.dtb boot/devicetree-4.4.7-zynq-zybo.dtb
168+
cp ../zynq-zybo/boot/devicetree-4.4.7-zynq-zybo.dtb boot/devicetree-4.4.7-zynq-zybo.dts
169+
cp ../zynq-zybo/boot/u-boot.img boot/u-boot.img
170+
cp ../de0-nano-soc//boot/devicetree-4.4.7-socfpga.dtb boot/devicetree-4.4.7-socfpga.dtb
171+
cp ../de0-nano-soc//boot/devicetree-4.4.7-socfpga.dts boot/devicetree-4.4.7-socfpga.dts
172+
cp ../de0-nano-soc//boot/DE0_NANO_SOC.rbf boot/DE0_NANO_SOC.rbf
173+
cp ../de0-nano-soc//u-boot/u-boot-spl.sfp u-boot/u-boot-spl.sfp
174+
cp ../de0-nano-soc//u-boot/u-boot.img u-boot/u-boot.img
175+
```
176+
177+
#### File Description
178+
179+
* tareget/zynq-zybo/
180+
+ boot/
181+
- boot.bin : Stage 1 Boot Loader (for ZYBO U-boot-spl)
182+
- design_1_wrapper.bit : FPGA configuration file (Xilinx Bitstream Format)
183+
- u-boot.img : Stage 2 Boot Loader (for ZYBO U-boot image)
184+
- uEnv.txt : U-Boot environment variables for set kernel version
185+
- boot.script : U-Boot boot script (source)
186+
- boot.scr : U-Boot boot script (binary)
187+
- zImage-4.4.7-armv7-fpga : Linux Kernel Image
188+
- devicetree-4.4.7-zynq-zybo.dtb : Linux Device Tree Blob (for ZYBO)
189+
- devicetree-4.4.7-zynq-zybo.dts : Linux Device Tree Source (for ZYBO)
190+
- devicetree-4.4.7-socfpga.dtb : Linux Device Tree Blob (for DE0-Nano-SoC)
191+
- devicetree-4.4.7-socfpga.dts : Linux Device Tree Source (for DE0-Nano-SoC)
192+
+ u-boot/
193+
- u-boot-spl.sfp : Stage 1 Boot Loader (for DE0-Nano-SoC U-boot-spl)
194+
- u-boot.img : Stage 2 Boot Loader (for DE0-Nano-SoC U-boot image)
195+
* debian8-rootfs-vanilla.tgz : Debian8 Root File System (use Git LFS)
196+
* fpga-soc-linux-drivers-4.4.7-armv7-fpga_0.0.2-1_armhf.deb : Device Drivers Package (use Git LFS)
197+
198+
#### Format SD-Card
199+
200+
````
201+
shell# fdisk /dev/sdc
202+
:
203+
:
204+
:
205+
shell# mkfs-vfat /dev/sdc1
206+
shell# mkfs.ext3 /dev/sdc2
207+
````
208+
209+
#### Write to SD-Card
210+
211+
````
212+
shell# mount /dev/sdc1 /mnt/usb1
213+
shell# mount /dev/sdc2 /mnt/usb2
214+
shell# cp target/zynq-zybo-de0-nano-soc/boot/* /mnt/usb1
215+
shell# dd if=target/zynq-zybo-de0-nano-soc/u-boot/u-boot-spl.sfp of=/dev/sdc3 bs=64k seek=0
216+
shell# dd if=target/zynq-zybo-de0-nano-soc/u-boot/u-boot.img of=/dev/sdc3 bs=64k seek=4
217+
shell# tar xfz debian8-rootfs-vanilla.tgz -C /mnt/usb2
218+
shell# cp fpga-soc-linux-drivers-4.4.7-armv7-fpga_0.0.2-1_armhf.deb /mnt/usb2/home/fpga
219+
shell# umount mnt/usb1
220+
shell# umount mnt/usb2
221+
````
222+
139223
### Install Device Drivers
140224

141225
#### Boot ZYBO or DE0-Nano-SoC and login fpga or root user
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
VERSION=4.4.7
2+
XILINX_TARGET_PATH=../zynq-zybo
3+
ALTERA_TARGET_PATH=../de0-nano-soc/
4+
5+
TARGET = boot/boot.scr \
6+
boot/zImage-$(VERSION)-armv7-fpga \
7+
boot/boot.bin \
8+
boot/design_1_wrapper.bit \
9+
boot/devicetree-$(VERSION)-zynq-zybo.dtb \
10+
boot/devicetree-$(VERSION)-zynq-zybo.dts \
11+
boot/u-boot.img \
12+
boot/devicetree-$(VERSION)-socfpga.dtb \
13+
boot/devicetree-$(VERSION)-socfpga.dts \
14+
boot/DE0_NANO_SOC.rbf \
15+
u-boot/u-boot-spl.sfp \
16+
u-boot/u-boot.img \
17+
$(END_LIST)
18+
19+
COPY = cp
20+
REMOVE = rm
21+
22+
target : $(TARGET)
23+
24+
clean :
25+
-$(REMOVE) $(TARGET)
26+
27+
boot/boot.scr : boot/boot.script
28+
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "linux boot script" -d boot/boot.script boot/boot.scr
29+
30+
boot/zImage-$(VERSION)-armv7-fpga : $(XILINX_TARGET_PATH)/boot/zImage-$(VERSION)-armv7-fpga
31+
$(COPY) $< $@
32+
33+
boot/boot.bin : $(XILINX_TARGET_PATH)/boot/boot.bin
34+
$(COPY) $< $@
35+
36+
boot/design_1_wrapper.bit : $(XILINX_TARGET_PATH)/boot/design_1_wrapper.bit
37+
$(COPY) $< $@
38+
39+
boot/devicetree-$(VERSION)-zynq-zybo.dtb : $(XILINX_TARGET_PATH)/boot/devicetree-$(VERSION)-zynq-zybo.dtb
40+
$(COPY) $< $@
41+
42+
boot/devicetree-$(VERSION)-zynq-zybo.dts : $(XILINX_TARGET_PATH)/boot/devicetree-$(VERSION)-zynq-zybo.dtb
43+
$(COPY) $< $@
44+
45+
boot/u-boot.img : $(XILINX_TARGET_PATH)/boot/u-boot.img
46+
$(COPY) $< $@
47+
48+
boot/devicetree-$(VERSION)-socfpga.dtb : $(ALTERA_TARGET_PATH)/boot/devicetree-$(VERSION)-socfpga.dtb
49+
$(COPY) $< $@
50+
51+
boot/devicetree-$(VERSION)-socfpga.dts : $(ALTERA_TARGET_PATH)/boot/devicetree-$(VERSION)-socfpga.dts
52+
$(COPY) $< $@
53+
54+
boot/DE0_NANO_SOC.rbf : $(ALTERA_TARGET_PATH)/boot/DE0_NANO_SOC.rbf
55+
$(COPY) $< $@
56+
57+
u-boot/u-boot-spl.sfp : $(ALTERA_TARGET_PATH)/u-boot/u-boot-spl.sfp
58+
$(COPY) $< $@
59+
60+
u-boot/u-boot.img : $(ALTERA_TARGET_PATH)/u-boot/u-boot.img
61+
$(COPY) $< $@
62+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
if test $config = "zynq-zybo"; then
2+
echo "Configuration for " $config
3+
boot_image=zImage-$kernel_version-armv7-fpga
4+
fdt_image=devicetree-$kernel_version-zynq-zybo.dtb
5+
fpga_image=design_1_wrapper.bit
6+
if fatload mmc 0 0x03000000 $fpga_image; then
7+
fpga loadb 0 0x03000000 $filesize
8+
mw.l 0xF8000008 0xDF0D
9+
mw.l 0xF8000170 0x00100A00
10+
mw.l 0xF8000004 0x767B
11+
fi
12+
fatload mmc 0 0x03000000 $boot_image
13+
fatload mmc 0 0x02A00000 $fdt_image
14+
setenv bootargs console=ttyPS0,115200 root=/dev/mmcblk0p2 rw rootwait uio_pdrv_genirq.of_id=generic-uio
15+
bootz 0x03000000 - 0x02A00000
16+
fi
17+
if test $config = "socfpga_cyclone5_de0_nano_soc"; then
18+
echo "Configuration for " $config
19+
boot_image=zImage-$kernel_version-armv7-fpga
20+
fdt_image=devicetree-$kernel_version-socfpga.dtb
21+
fpga_image=DE0_NANO_SOC.rbf
22+
if fatload mmc 0 $fpgadata $fpga_image; then
23+
fpga load 0 $fpgadata $filesize
24+
bridge enable
25+
fi
26+
fatload mmc 0 $loadaddr $boot_image
27+
fatload mmc 0 $fdt_addr $fdt_image
28+
setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait uio_pdrv_genirq.of_id=generic-uio
29+
bootz $loadaddr - $fdt_addr
30+
fi
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
kernel_version=4.4.7

0 commit comments

Comments
 (0)