Skip to content

Commit

Permalink
Merge branch 'build-v0.6.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
ikwzm committed Jan 10, 2018
2 parents 102d9c9 + 8683b06 commit d42ebd2
Show file tree
Hide file tree
Showing 53 changed files with 6,106 additions and 553 deletions.
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This Repository provides a Linux Boot Image(U-boot, Kernel, Root-fs) for FPGA-So
+ Build for ZYBO, ZYBO-Z7, PYNQ-Z1 and DE0-Nano-SoC
+ Customized boot by uEnv.txt
+ Customized boot by boot.scr
* Linux Kernel Version v4.12.14
* Linux Kernel Version v4.14.13
+ Available in both Xilinx-Zynq-7000 and Altera-SoC in a single image
+ Enable Device Tree Overlay
+ Enable FPGA Manager
Expand Down Expand Up @@ -68,7 +68,7 @@ Build
* [Build U-boot for ZYBO-Z7](doc/build/u-boot-zynq-zybo-z7.md)
* [Build U-boot for PYNQ-Z1](doc/build/u-boot-zynq-pynqz1.md)
* [Build U-boot for DE0-Nano-SoC](doc/build/u-boot-de0-nano-soc.md)
* [Build Linux Kernel](doc/build/linux-kernel-4.12.14.md)
* [Build Linux Kernel](doc/build/linux-kernel-4.14.13.md)
* [Build Debian9 RootFS](doc/build/debian9-rootfs.md)
* [Build Device Drivers and Services Package](doc/build/device-drivers.md)

4 changes: 2 additions & 2 deletions doc/build/device-drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ shell$ git clone https://github.com/ikwzm/PTTY_AXI4

```
shell$ git archive --remote dtbocfg --prefix=dtbocfg/ --format=tar v0.0.3 | tar xf - -C drivers
shell$ git archive --remote fclkcfg --prefix=fclkcfg/ --format=tar v0.0.2 | tar xf - -C drivers
shell$ git archive --remote udmabuf --prefix=udmabuf/ --format=tar v0.8.0 | tar xf - -C drivers
shell$ git archive --remote fclkcfg --prefix=fclkcfg/ --format=tar v0.0.3 | tar xf - -C drivers
shell$ git archive --remote udmabuf --prefix=udmabuf/ --format=tar v0.9.0 | tar xf - -C drivers
shell$ cd PTTY_AXI4; git checkout v1.0.0; cp -r src/drivers/zptty ../drivers; cd ..
```

Expand Down
103 changes: 103 additions & 0 deletions doc/build/linux-kernel-4.14.13.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
### Build Linux Kernel

There are two ways

1. run scripts/build-linux-kernel.sh (easy)
2. run this chapter step-by-step (annoying)

#### Download Linux Kernel Source

##### Clone from linux-stable.git

```
shell$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.14.13-armv7-fpga
```

##### Checkout v4.14.13

```
shell$ cd linux-4.14.13-armv7-fpga
shell$ git checkout -b linux-4.14.13-armv7-fpga refs/tags/v4.14.13
```

#### Patch for armv7-fpga

##### Patch for armv7-fpga

```
shell$ patch -p0 < ../files/linux-4.14.13-armv7-fpga.diff
shell$ git add --update
shell$ git add arch/arm/configs/armv7_fpga_defconfig
shell$ git add arch/arm/boot/dts/zynq-pynqz1.dts
shell$ git add arch/arm/boot/dts/zynq-zybo-z7.dts
shell$ git commit -m "patch for armv7-fpga"
```

##### Patch for usb chipidea driver

```
shell$ patch -p0 < ../files/linux-4.14.13-armv7-fpga-patch-usb-chipidea.diff
shell$ git add --update
shell$ git commit -m "patch for usb chipidea driver for issue #3"
```

##### Create tag and .version

```
shell$ git tag -a v4.14.13-armv7-fpga -m "release v4.14.13-armv7-fpga"
shell$ echo 0 > .version
```

#### Setup for Build

````
shell$ cd linux-4.14.13-armv7-fpga
shell$ export ARCH=arm
shell$ export CROSS_COMPILE=arm-linux-gnueabihf-
shell$ make armv7_fpga_defconfig
````

#### Build Linux Kernel and device tree

````
shell$ export DTC_FLAGS=--symbols
shell$ make deb-pkg
shell$ make zynq-zybo.dtb
shell$ make zynq-zybo-z7.dtb
shell$ make zynq-pynqz1.dtb
shell$ make socfpga_cyclone5_de0_sockit.dtb
````

#### Copy zImage and devicetree to target/zybo-zynq/boot/

```
shell$ cp arch/arm/boot/zImage ../target/zynq-zybo/boot/zImage-4.14.13-armv7-fpga
shell$ cp arch/arm/boot/dts/zynq-zybo.dtb ../target/zynq-zybo/boot/devicetree-4.14.13-zynq-zybo.dtb
shell$ dtc -I dtb -O dts -o ../target/zynq-zybo/boot/devicetree-4.14.13-zynq-zybo.dts arch/arm/boot/dts/zynq-zybo.dtb
```

#### Copy zImage and devicetree to tareget/zybo-zynq-z7/boot/

```
shell$ cp arch/arm/boot/zImage ../target/zynq-zybo-z7/boot/zImage-4.14.13-armv7-fpga
shell$ cp arch/arm/boot/dts/zynq-zybo-z7.dtb ../target/zynq-zybo-z7/boot/devicetree-4.14.13-zynq-zybo-z7.dtb
shell$ dtc -I dtb -O dts --symbols -o ../target/zynq-zybo-z7/boot/devicetree-4.14.13-zynq-zybo-z7.dts arch/arm/boot/dts/zynq-zybo-z7.dtb
```


#### Copy zImage and devicetree to target/zybo-pynqz1/boot/

```
shell$ cp arch/arm/boot/zImage ../target/zynq-pynqz1/boot/zImage-4.14.13-armv7-fpga
shell$ cp arch/arm/boot/dts/zynq-pynqz1.dtb ../target/zynq-pynqz1/boot/devicetree-4.14.13-zynq-pynqz1.dtb
shell$ dtc -I dtb -O dts -o ../target/zynq-pynqz1/boot/devicetree-4.14.13-zynq-pynqz1.dts arch/arm/boot/dts/zynq-pynqz1.dtb
```

#### Copy zImage and devicetree to target/de0-nano-soc/boot/

```
shell$ cp arch/arm/boot/zImage ../target/de0-nano-soc/boot/zImage-4.14.13-armv7-fpga
shell$ cp arch/arm/boot/dts/socfpga_cyclone5_de0_sockit.dtb ../target/de0-nano-soc/boot/devicetree-4.14.13-socfpga.dtb
shell$ dtc -I dtb -O dts -o ../target/de0-nano-soc/boot/devicetree-4.14.13-socfpga.dts arch/arm/boot/dts/socfpga_cyclone5_de0_sockit.dtb
```

20 changes: 10 additions & 10 deletions doc/install/de0-nano-soc.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```
shell$ git clone git://github.com/ikwzm/FPGA-SoC-Linux
shell$ cd FPGA-SoC-Linux
shell$ git checkout v0.5.4
shell$ git checkout v0.6.0
shell$ git lfs pull
```

Expand All @@ -15,17 +15,17 @@ shell$ git lfs pull
+ boot/
- DE0_NANO_SOC.rbf : FPGA configuration file (Raw Binary Format)
- uEnv.txt : U-Boot environment variables for linux boot
- vmlinuz-4.12.14-armv7-fpga : Linux Kernel Image (use Git LFS)
- devicetree-4.12.14-socfpga.dtb : Linux Device Tree Blob
- devicetree-4.12.14-socfpga.dts : Linux Device Tree Source
- vmlinuz-4.14.13-armv7-fpga : Linux Kernel Image (use Git LFS)
- devicetree-4.14.13-socfpga.dtb : Linux Device Tree Blob
- devicetree-4.14.13-socfpga.dts : Linux Device Tree Source
+ u-boot/
- u-boot-spl.sfp : Stage 1 Boot Loader(U-boot-spl)
- u-boot.img : Stage 2 Boot Loader(U-boot)
+ examples/ : Example Programs
* debian9-rootfs-vanilla.tgz : Debian9 Root File System (use Git LFS)
* linux-image-4.12.14-armv7-fpga_4.12.14-armv7-fpga-3_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-4.12.14-armv7-fpga_4.12.14-armv7-fpga-3_armhf.deb : Linux Headers Package (use Git LFS)
* fpga-soc-linux-drivers-4.12.14-armv7-fpga_0.0.9-1_armhf.deb : Device Drivers Package (use Git LFS)
* linux-image-4.14.13-armv7-fpga_4.14.13-armv7-fpga-1_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-4.14.13-armv7-fpga_4.14.13-armv7-fpga-1_armhf.deb : Linux Headers Package (use Git LFS)
* fpga-soc-linux-drivers-4.14.13-armv7-fpga_0.1.0-1_armhf.deb : Device Drivers Package (use Git LFS)
* fpga-soc-linux-services_0.0.9-1_armhf.deb : Device Services Package (use Git LFS)

#### Format SD-Card
Expand All @@ -49,9 +49,9 @@ shell# dd if=target/de0-nano-soc/u-boot/u-boot-spl.sfp of=/dev/sdc3 bs=64k seek=
shell# dd if=target/de0-nano-soc/u-boot/u-boot.img of=/dev/sdc3 bs=64k seek=4
shell# tar xfz debian9-rootfs-vanilla.tgz -C /mnt/usb2
shell# mkdir /mnt/usb2/home/fpga/debian
shell# cp linux-image-4.12.14-armv7-fpga_4.12.14-armv7-fpga-3_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-4.12.14-armv7-fpga_4.12.14-armv7-fpga-3_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-drivers-4.12.14-armv7-fpga_0.0.9-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-image-4.14.13-armv7-fpga_4.14.13-armv7-fpga-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-4.14.13-armv7-fpga_4.14.13-armv7-fpga-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-drivers-4.14.13-armv7-fpga_0.1.0-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-services_0.0.9-1_armhf.deb /mnt/usb2/home/fpga/debian
shell$ cp -r target/de0-nano-soc/examples /mnt/usb2/home/fpga
shell# umount mnt/usb1
Expand Down
33 changes: 22 additions & 11 deletions doc/install/device-drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,32 @@ Password:
root@debian-fpga:~#
```

#### Install Device Drivers and Services Package
#### Install Kernel Image Package

```
fpga@debian-fpga:~$ cd /home/fpga/debian
fpga@debian-fpga:~$ sudo dpkg -i fpga-soc-linux-drivers-4.12.14-armv7-fpga_0.0.9-1_armhf.deb
Selecting previously unselected package fpga-soc-linux-drivers-4.12.14-armv7-fpga.
(Reading database ... 39197 files and directories currently installed.)
Preparing to unpack fpga-soc-linux-drivers-4.12.14-armv7-fpga_0.0.9-1_armhf.deb ...
Unpacking fpga-soc-linux-drivers-4.12.14-armv7-fpga (0.0.9-1) ...
Setting up fpga-soc-linux-drivers-4.12.14-armv7-fpga (0.0.9-1) ...
fpga@debian-fpga:~/debian$ sudo dpkg -i linux-image-4.14.13-armv7-fpga_4.14.13-armv7-fpga-1_armhf.deb
(Reading database ... 61992 files and directories currently installed.)
Preparing to unpack linux-image-4.14.13-armv7-fpga_4.14.13-armv7-fpga-1_armhf.deb ...
Unpacking linux-image-4.14.13-armv7-fpga (4.14.13-armv7-fpga-1) ...
Setting up linux-image-4.14.13-armv7-fpga (4.14.13-armv7-fpga-1) ...
```

#### Install Device Drivers and Services Package

```
fpga@debian-fpga:~$ cd /home/fpga/debian
fpga@debian-fpga:~$ sudo dpkg -i fpga-soc-linux-services_0.0.9-1_armhf.deb
fpga@debian-fpga:~/debian$ sudo dpkg -i fpga-soc-linux-drivers-4.14.13-armv7-fpga_0.1.0-1_armhf.deb
Selecting previously unselected package fpga-soc-linux-drivers-4.14.13-armv7-fpga.
(Reading database ... 62097 files and directories currently installed.)
Preparing to unpack fpga-soc-linux-drivers-4.14.13-armv7-fpga_0.1.0-1_armhf.deb ...
Unpacking fpga-soc-linux-drivers-4.14.13-armv7-fpga (0.1.0-1) ...
Setting up fpga-soc-linux-drivers-4.14.13-armv7-fpga (0.1.0-1) ...
```

```
fpga@debian-fpga:~/debian$ cd /home/fpga/debian
fpga@debian-fpga:~/debian$ sudo dpkg -i fpga-soc-linux-services_0.0.9-1_armhf.deb
Selecting previously unselected package fpga-soc-linux-services.
(Reading database ... 42746 files and directories currently installed.)
Preparing to unpack fpga-soc-linux-services_0.0.9-1_armhf.deb ...
Expand Down Expand Up @@ -66,7 +77,7 @@ dtbocfg 16384 0
```

```
fpga@debian-fpga:~$ sudo systemctl status device-tree-overlay.service
fpga@debian-fpga:~/debian$ sudo systemctl status device-tree-overlay.service
● device-tree-overlay.service - Device Tree Overlay Service.
Loaded: loaded (/etc/systemd/system/device-tree-overlay.service; enabled)
Active: active (exited) since Tue 2017-02-21 23:03:05 JST; 1min 19s ago
Expand All @@ -78,7 +89,7 @@ Feb 21 23:03:05 debian-fpga systemd[1]: Started Device Tree Overlay Service..
```

```
fpga@debian-fpga:~$ sudo systemctl status udmabuf.service
fpga@debian-fpga:~/debian$ sudo systemctl status udmabuf.service
● udmabuf.service - User space mappable DMA Buffer Service.
Loaded: loaded (/etc/systemd/system/udmabuf.service; enabled)
Active: active (exited) since Tue 2017-02-21 23:03:06 JST; 4min 26s ago
Expand All @@ -91,7 +102,7 @@ Hint: Some lines were ellipsized, use -l to show in full.
```

```
fpga@debian-fpga:~$ sudo systemctl status zptty.service
fpga@debian-fpga:~/debian$ sudo systemctl status zptty.service
● zptty.service - Pseudo TTY Driver for communication with FPGA.
Loaded: loaded (/etc/systemd/system/zptty.service; enabled)
Active: active (exited) since Tue 2017-02-21 23:03:06 JST; 5min ago
Expand Down
20 changes: 10 additions & 10 deletions doc/install/zynq-pynqz1.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```
shell$ git clone git://github.com/ikwzm/FPGA-SoC-Linux
shell$ cd FPGA-SoC-Linux
shell$ git checkout v0.5.4
shell$ git checkout v0.6.0
shell$ git lfs pull
```

Expand All @@ -16,14 +16,14 @@ shell$ git lfs pull
- boot.bin : Stage 1 Boot Loader(U-boot-spl)
- u-boot.img : Stage 2 Boot Loader(U-boot)
- uEnv.txt : U-Boot environment variables for linux boot
- vmlinuz-4.12.14-armv7-fpga : Linux Kernel Image (use Git LFS)
- devicetree-4.12.14-zynq-pynqz1.dtb : Linux Device Tree Blob
- devicetree-4.12.14-zynq-pynqz1.dts : Linux Device Tree Source
- vmlinuz-4.14.13-armv7-fpga : Linux Kernel Image (use Git LFS)
- devicetree-4.14.13-zynq-pynqz1.dtb : Linux Device Tree Blob
- devicetree-4.14.13-zynq-pynqz1.dts : Linux Device Tree Source
+ examples/ : Example Programs
* debian9-rootfs-vanilla.tgz : Debian9 Root File System (use Git LFS)
* linux-image-4.12.14-armv7-fpga_4.12.14-armv7-fpga-3_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-4.12.14-armv7-fpga_4.12.14-armv7-fpga-3_armhf.deb : Linux Headers Package (use Git LFS)
* fpga-soc-linux-drivers-4.12.14-armv7-fpga_0.0.9-1_armhf.deb : Device Drivers Package (use Git LFS)
* linux-image-4.14.13-armv7-fpga_4.14.13-armv7-fpga-1_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-4.14.13-armv7-fpga_4.14.13-armv7-fpga-1_armhf.deb : Linux Headers Package (use Git LFS)
* fpga-soc-linux-drivers-4.14.13-armv7-fpga_0.1.0-1_armhf.deb : Device Drivers Package (use Git LFS)
* fpga-soc-linux-services_0.0.9-1_armhf.deb : Device Services Package (use Git LFS)

#### Format SD-Card
Expand All @@ -45,9 +45,9 @@ shell# mount /dev/sdc2 /mnt/usb2
shell# cp target/zynq-pynqz1/boot/* /mnt/usb1
shell# tar xfz debian9-rootfs-vanilla.tgz -C /mnt/usb2
shell# mkdir /mnt/usb2/home/fpga/debian
shell# cp linux-image-4.12.14-armv7-fpga_4.12.14-armv7-fpga-3_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-4.12.14-armv7-fpga_4.12.14-armv7-fpga-3_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-drivers-4.12.14-armv7-fpga_0.0.9-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-image-4.14.13-armv7-fpga_4.14.13-armv7-fpga-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-4.14.13-armv7-fpga_4.14.13-armv7-fpga-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-drivers-4.14.13-armv7-fpga_0.1.0-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-services_0.0.9-1_armhf.deb /mnt/usb2/home/fpga/debian
shell$ cp -r target/zynq-pynqz1/examples /mnt/usb2/home/fpga
shell# umount mnt/usb1
Expand Down
2 changes: 1 addition & 1 deletion doc/install/zynq-zybo-de0-nano-soc.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ It corresponds to boot of both ZYBO and DE0-Nano-SoC in one SD-Card.
```
shell$ git clone git://github.com/ikwzm/FPGA-SoC-Linux
shell$ cd FPGA-SoC-Linux
shell$ git checkout v0.5.4
shell$ git checkout v0.6.0
shell$ git lfs pull
```
#### Build boot files
Expand Down
20 changes: 10 additions & 10 deletions doc/install/zynq-zybo-z7.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```
shell$ git clone git://github.com/ikwzm/FPGA-SoC-Linux
shell$ cd FPGA-SoC-Linux
shell$ git checkout v0.5.4
shell$ git checkout v0.6.0
shell$ git lfs pull
```

Expand All @@ -16,13 +16,13 @@ shell$ git lfs pull
- boot.bin : Stage 1 Boot Loader(U-boot-spl)
- u-boot.img : Stage 2 Boot Loader(U-boot)
- uEnv.txt : U-Boot environment variables for linux boot
- vmlinuz-4.12.14-armv7-fpga : Linux Kernel Image (use Git LFS)
- devicetree-4.12.14-zynq-zybo-z7.dtb : Linux Device Tree Blob
- devicetree-4.12.14-zynq-zybo-z7.dts : Linux Device Tree Source
- vmlinuz-4.14.13-armv7-fpga : Linux Kernel Image (use Git LFS)
- devicetree-4.14.13-zynq-zybo-z7.dtb : Linux Device Tree Blob
- devicetree-4.14.13-zynq-zybo-z7.dts : Linux Device Tree Source
* debian9-rootfs-vanilla.tgz : Debian9 Root File System (use Git LFS)
* linux-image-4.12.14-armv7-fpga_4.12.14-armv7-fpga-3_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-4.12.14-armv7-fpga_4.12.14-armv7-fpga-3_armhf.deb : Linux Headers Package (use Git LFS)
* fpga-soc-linux-drivers-4.12.14-armv7-fpga_0.0.9-1_armhf.deb : Device Drivers Package (use Git LFS)
* linux-image-4.14.13-armv7-fpga_4.14.13-armv7-fpga-1_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-4.14.13-armv7-fpga_4.14.13-armv7-fpga-1_armhf.deb : Linux Headers Package (use Git LFS)
* fpga-soc-linux-drivers-4.14.13-armv7-fpga_0.1.0-1_armhf.deb : Device Drivers Package (use Git LFS)
* fpga-soc-linux-services_0.0.9-1_armhf.deb : Device Services Package (use Git LFS)

#### Format SD-Card
Expand All @@ -44,9 +44,9 @@ shell# mount /dev/sdc2 /mnt/usb2
shell# cp target/zynq-zybo-z7/boot/* /mnt/usb1
shell# tar xfz debian9-rootfs-vanilla.tgz -C /mnt/usb2
shell# mkdir /mnt/usb2/home/fpga/debian
shell# cp linux-image-4.12.14-armv7-fpga_4.12.14-armv7-fpga-3_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-4.12.14-armv7-fpga_4.12.14-armv7-fpga-3_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-drivers-4.12.14-armv7-fpga_0.0.9-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-image-4.14.13-armv7-fpga_4.14.13-armv7-fpga-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-4.14.13-armv7-fpga_4.14.13-armv7-fpga-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-drivers-4.14.13-armv7-fpga_0.1.0-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fpga-soc-linux-services_0.0.9-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# umount mnt/usb1
shell# umount mnt/usb2
Expand Down
Loading

0 comments on commit d42ebd2

Please sign in to comment.