Skip to content

Commit

Permalink
Merge branch 'build-v2.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
ikwzm committed Apr 4, 2022
2 parents 7f39eb0 + d9dc4fa commit fd74c45
Show file tree
Hide file tree
Showing 65 changed files with 6,545 additions and 616 deletions.
7 changes: 4 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ This Repository provides a Linux Boot Image(U-boot, Kernel, Root-fs) for FPGA-So
+ Customized boot by uEnv.txt
+ Customized boot by boot.scr
+ Enable bootmenu
* Linux Kernel Version 5.10.69
* Linux Kernel Version 5.10.109
+ Available in both Xilinx-Zynq-7000 and Altera-SoC in a single image
+ Enable Device Tree Overlay
+ Enable FPGA Manager
+ Enable FPGA Bridge
+ Enable FPGA Reagion
+ Patch for issue #3(USB-HOST does not work with PYNQ-Z1)
* Debian11(bullseye) Root File System
* Debian11.3(bullseye) Root File System
+ Installed build-essential
+ Installed device-tree-compiler
+ Installed ruby ruby-msgpack ruby-serialport
Expand All @@ -56,6 +56,7 @@ Install
+ [DE10-Nano](doc/install/de10-nano.md)
* [Install Device Drivers and Services](doc/install/device-drivers.md)
* [Upgrade to v1.3.0 from v1.0.x/v1.1.x/v1.2.x](doc/install/upgrade-v1.3.0.md)
* [Upgrade to v2.1.0 from v2.0.x](doc/install/upgrade-v2.1.0.md)

Tutorial
------------------------------------------------------------------------------------
Expand All @@ -75,7 +76,7 @@ Build
* [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 U-boot for DE10-Nano](doc/build/u-boot-de10-nano.md)
* [Build Linux Kernel](doc/build/linux-kernel-5.10.69.md)
* [Build Linux Kernel](doc/build/linux-kernel-5.10.109.md)
* [Build Debian11 RootFS](doc/build/debian11-rootfs.md)
* [Build Device Drivers and Services Package](doc/build/device-drivers.md)

4 changes: 2 additions & 2 deletions debian11-rootfs-vanilla.tgz
Git LFS file not shown
7 changes: 4 additions & 3 deletions doc/build/debian11-rootfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ shell$ sudo debootstrap --arch=armhf --foreign $distro $
shell$ sudo cp /usr/bin/qemu-arm-static $PWD/$targetdir/usr/bin
shell$ sudo cp /etc/resolv.conf $PWD/$targetdir/etc
shell$ sudo cp scripts/build-debian11-rootfs-with-qemu.sh $PWD/$targetdir
shell$ sudo cp linux-image-5.10.69-armv7-fpga_5.10.69-armv7-fpga-0_armhf.deb $PWD/$targetdir
shell$ sudo cp linux-image-5.10.109-armv7-fpga_5.10.109-armv7-fpga-1_armhf.deb $PWD/$targetdir
````

#### Build Debian RootFS second-step with QEMU
Expand Down Expand Up @@ -63,6 +63,7 @@ EOT

```console
debian11-rootfs# apt-get update -y
debian11-rootfs# apt-get upgrade -y
```

##### Install applications
Expand Down Expand Up @@ -193,7 +194,7 @@ debian11-rootfs# apt-get install -y haveged

```console
debian11-rootfs# mkdir /mnt/boot
debian11-rootfs# dpkg -i linux-image-5.10.69-armv7-fpga_5.10.69-armv7-fpga-0_armhf.deb
debian11-rootfs# dpkg -i linux-image-5.10.109-armv7-fpga_5.10.109-armv7-fpga-1_armhf.deb
```

##### Clean Cache
Expand All @@ -214,7 +215,7 @@ debian11-rootfs# dpkg -l > dpkg-list.txt
debian11-rootfs# exit
shell$ sudo rm -f $PWD/$targetdir/usr/bin/qemu-arm-static
shell$ sudo rm -f $PWD/$targetdir/build-debian11-rootfs-with-qemu.sh
shell$ sudo rm -f $PWD/$targetdir/linux-image-5.10.69-armv7-fpga_5.10.69-armv7-fpga-0_armhf.deb
shell$ sudo rm -f $PWD/$targetdir/linux-image-5.10.109-armv7-fpga_5.10.109-armv7-fpga-1_armhf.deb
shell$ sudo mv $PWD/$targetdir/dpkg-list.txt files/debian11-dpkg-list.txt
```

Expand Down
60 changes: 30 additions & 30 deletions doc/build/device-drivers.md
Original file line number Diff line number Diff line change
@@ -1,101 +1,101 @@
### Build Device Drivers and Services Package

#### dtbocfg-5.10.69-armv7-fpga_0.0.8-1_armhf.deb
#### dtbocfg-5.10.109-armv7-fpga_0.0.9-1_armhf.deb

##### Download repository

```console
shell$ git clone --recursive --depth=1 -b v0.0.9 git://github.com/ikwzm/dtbocfg-kmod-dpkg
shell$ git clone --recursive --depth=1 -b v0.0.9 https://github.com/ikwzm/dtbocfg-kmod-dpkg
shell$ cd dtbocfg-kmod-dpkg
```
##### Cross Compile for linux-5.10.69-armv7-fpga
##### Cross Compile for linux-5.10.109-armv7-fpga

```console
shell$ sudo debian/rules arch=arm deb_arch=armhf kernel_release=5.10.69-armv7-fpga kernel_src_dir=$PWD/../linux-5.10.69-armv7-fpga binary
shell$ sudo debian/rules arch=arm deb_arch=armhf kernel_release=5.10.109-armv7-fpga kernel_src_dir=$PWD/../linux-5.10.109-armv7-fpga binary
:
:
:
shell$ file ../dtbocfg-5.10.69-armv7-fpga_0.0.9-1_armhf.deb
../dtbocfg-5.10.69-armv7-fpga_0.0.9-1_armhf.deb: Debian binary package (format 2.0)
shell$ file ../dtbocfg-5.10.109-armv7-fpga_0.0.9-1_armhf.deb
../dtbocfg-5.10.109-armv7-fpga_0.0.9-1_armhf.deb: Debian binary package (format 2.0)
```

#### u-dma-buf-5.10.69-armv7-fpga_3.2.4-0_armhf.deb
#### u-dma-buf-5.10.109-armv7-fpga_3.2.5-0_armhf.deb

##### Download repository

```console
shell$ git clone --recursive --depth=1 -b v3.2.4 git://github.com/ikwzm/u-dma-buf-kmod-dpkg
shell$ git clone --recursive --depth=1 -b v3.2.5 https://github.com/ikwzm/u-dma-buf-kmod-dpkg
shell$ cd u-dma-buf-kmod-dpkg
```

##### Cross Compile for linux-5.10.69-armv7-fpga
##### Cross Compile for linux-5.10.109-armv7-fpga

```console
shell$ sudo debian/rules arch=arm deb_arch=armhf kernel_release=5.10.69-armv7-fpga kernel_src_dir=$PWD/../linux-5.10.69-armv7-fpga binary
shell$ sudo debian/rules arch=arm deb_arch=armhf kernel_release=5.10.109-armv7-fpga kernel_src_dir=$PWD/../linux-5.10.109-armv7-fpga binary
:
:
:
shell$ file ../u-dma-buf-5.10.69-armv7-fpga_3.2.4-0_armhf.deb
../u-dma-buf-5.10.69-armv7-fpga_3.2.4-0_armhf.deb: Debian binary package (format 2.0)
shell$ file ../u-dma-buf-5.10.109-armv7-fpga_3.2.5-0_armhf.deb
../u-dma-buf-5.10.109-armv7-fpga_3.2.4-0_armhf.deb: Debian binary package (format 2.0)
```

#### fclkcfg-5.10.69-armv7-fpga_1.7.2-1_armhf.deb
#### fclkcfg-5.10.109-armv7-fpga_1.7.2-1_armhf.deb

##### Download repository

```console
shell$ git clone --recursive --depth=1 -b v1.7.2 git://github.com/ikwzm/fclkcfg-kmod-dpkg
shell$ git clone --recursive --depth=1 -b v1.7.2 https://github.com/ikwzm/fclkcfg-kmod-dpkg
shell$ cd fclkcfg-kmod-dpkg
```

##### Cross Compile for linux-5.10.69-armv7-fpga
##### Cross Compile for linux-5.10.109-armv7-fpga

```console
shell$ sudo debian/rules arch=arm deb_arch=armhf kernel_release=5.10.69-armv7-fpga kernel_src_dir=$PWD/../linux-5.10.69-armv7-fpga binary
shell$ sudo debian/rules arch=arm deb_arch=armhf kernel_release=5.10.109-armv7-fpga kernel_src_dir=$PWD/../linux-5.10.109-armv7-fpga binary
:
:
:
shell$ file ../fclkcfg-5.10.69-armv7-fpga_1.7.2-1_armhf.deb
../fclkcfg-5.10.69-armv7-fpga_1.7.2-1_armhf.deb: Debian binary package (format 2.0)
shell$ file ../fclkcfg-5.10.109-armv7-fpga_1.7.2-1_armhf.deb
../fclkcfg-5.10.109-armv7-fpga_1.7.2-1_armhf.deb: Debian binary package (format 2.0)
```

#### zptty-5.10.69-armv7-fpga_1.0.0-1_armhf.deb
#### zptty-5.10.109-armv7-fpga_1.1.0-1_armhf.deb

##### Download repository

```console
shell$ git clone --recursive --depth=1 -b v1.0.0 git://github.com/ikwzm/zptty-kmod-dpkg
shell$ git clone --recursive --depth=1 -b v1.1.0 https://github.com/ikwzm/zptty-kmod-dpkg
shell$ cd zptty-kmod-dpkg
```

##### Cross Compile for linux-5.10.69-armv7-fpga
##### Cross Compile for linux-5.10.109-armv7-fpga

```console
shell$ sudo debian/rules arch=arm deb_arch=armhf kernel_release=5.10.69-armv7-fpga kernel_src_dir=$PWD/../linux-5.10.69-armv7-fpga binary
shell$ sudo debian/rules arch=arm deb_arch=armhf kernel_release=5.10.109-armv7-fpga kernel_src_dir=$PWD/../linux-5.10.109-armv7-fpga binary
:
:
:
shell$ file ../zptty-5.10.69-armv7-fpga_1.0.0-1_armhf.deb
../zptty-5.10.69-armv7-fpga_1.0.0-1_armhf.deb: Debian binary package (format 2.0)
shell$ file ../zptty-5.10.109-armv7-fpga_1.1.0-1_armhf.deb
.../zptty-5.10.109-armv7-fpga_1.1.0-1_armhf.deb: Debian binary package (format 2.0)
```

#### zynq-afi-5.10.69-armv7-fpga_0.0.1-0_armhf.deb
#### zynq-afi-5.10.109-armv7-fpga_0.0.1-0_armhf.deb

##### Download repository

```console
shell$ git clone --recursive --depth=1 -b v0.0.1 git://github.com/ikwzm/zynq-afi-kmod-dpkg
shell$ git clone --recursive --depth=1 -b v0.0.1 https://github.com/ikwzm/zynq-afi-kmod-dpkg
shell$ cd zynq-afi-kmod-dpkg
```
##### Cross Compile for linux-5.10.69-armv7-fpga
##### Cross Compile for linux-5.10.109-armv7-fpga

```console
shell$ sudo debian/rules arch=arm deb_arch=armhf kernel_release=5.10.69-armv7-fpga kernel_src_dir=$PWD/../linux-5.10.69-armv7-fpga binary
shell$ sudo debian/rules arch=arm deb_arch=armhf kernel_release=5.10.109-armv7-fpga kernel_src_dir=$PWD/../linux-5.10.109-armv7-fpga binary
:
:
:
shell$ file ../zynq-afi-5.10.69-armv7-fpga_0.0.1-0_armhf.deb
../zynq-afi-5.10.69-armv7-fpga_0.0.1-0_armhf.deb: Debian binary package (format 2.0)
shell$ file ../zynq-afi-5.10.109-armv7-fpga_0.0.1-0_armhf.deb
../zynq-afi-5.10.109-armv7-fpga_0.0.1-0_armhf.deb: Debian binary package (format 2.0)
```

#### dtbocfg-ctrl_0.0.5-1_all.deb
Expand Down
120 changes: 120 additions & 0 deletions doc/build/linux-kernel-5.10.109.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
### Build Linux Kernel

There are two ways

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

#### Download Linux Kernel Source

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

```console
shell$ git clone --depth 1 -b v5.10.109 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.10.109-armv7-fpga
```

##### Checkout v5.10.109

```console
shell$ cd linux-5.10.109-armv7-fpga
shell$ git checkout -b linux-5.10.109-armv7-fpga refs/tags/v5.10.109
```

#### Patch for armv7-fpga

##### Patch for armv7-fpga

```console
shell$ patch -p1 < ../files/linux-5.10.109-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 commit -m "patch for armv7-fpga"
```

##### Patch for usb chipidea driver

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

##### Patch for build debian package script

```console
shell$ patch -p1 < ../files/linux-5.10.109-armv7-fpga-patch-builddeb.diff
shell$ git add --update
shell$ git commit -m "patch for scripts/package/builddeb to add tools/include and postinst script to header package"
```

##### Create tag and .version

```console
shell$ git tag -a v5.10.109-armv7-fpga -m "release v5.10.109-armv7-fpga"
shell$ echo 1 > .version
```

#### Setup for Build

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

#### Build Linux Kernel and device tree

````console
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_nano_soc.dtb
````

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

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

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

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


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

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

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

```console
shell$ cp arch/arm/boot/zImage ../target/de0-nano-soc/boot/vmlinuz-5.10.109-armv7-fpga
shell$ cp arch/arm/boot/dts/socfpga_cyclone5_de0_nano_soc.dtb ../target/de0-nano-soc/boot/devicetree-5.10.109-socfpga.dtb
shell$ ./scripts/dtc/dtc -I dtb -O dts -o ../target/de0-nano-soc/boot/devicetree-5.10.109-socfpga.dts arch/arm/boot/dts/socfpga_cyclone5_de0_nano_soc.dtb
```

#### Copy zImage and devicetree to tareget/de10-nano/boot/

```console
shell$ cp arch/arm/boot/zImage ../target/de10-nano/boot/vmlinuz-5.10.109-armv7-fpga
shell$ cp arch/arm/boot/dts/socfpga_cyclone5_de0_nano_soc.dtb ../target/de10-nano/boot/devicetree-5.10.109-socfpga.dtb
shell$ ./scripts/dtc/dtc -I dtb -O dts --symbols -o ../target/de10-nano/boot/devicetree-5.10.109-socfpga.dts arch/arm/boot/dts/socfpga_cyclone5_de0_nano_soc.dtb
```



38 changes: 19 additions & 19 deletions doc/install/de0-nano-soc.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
**Note: Downloading the entire repository takes time, so download the source code from https://github.com/ikwzm/FPGA-SoC-Linux/releases.**

```console
shell$ wget https://github.com/ikwzm/FPGA-SoC-Linux/archive/refs/tags/v2.0.1.tar.gz
shell$ tar xfz v2.0.1.tar.gz
shell$ cd FPGA-SoC-Linux-v2.0.1
shell$ wget https://github.com/ikwzm/FPGA-SoC-Linux/archive/refs/tags/v2.1.0.tar.gz
shell$ tar xfz v2.1.0.tar.gz
shell$ cd FPGA-SoC-Linux-v2.1.0
```

#### File Description
Expand All @@ -16,21 +16,21 @@ shell$ cd FPGA-SoC-Linux-v2.0.1
+ boot/
- DE0_NANO_SOC.rbf : FPGA configuration file (Raw Binary Format)
- uEnv.txt : U-Boot environment variables for linux boot
- vmlinuz-5.10.69-armv7-fpga : Linux Kernel Image (use Git LFS)
- devicetree-5.10.69-socfpga.dtb : Linux Device Tree Blob
- devicetree-5.10.69-socfpga.dts : Linux Device Tree Source
- vmlinuz-5.10.109-armv7-fpga : Linux Kernel Image (use Git LFS)
- devicetree-5.10.109-socfpga.dtb : Linux Device Tree Blob
- devicetree-5.10.109-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
* debian10-rootfs-vanilla.tgz : Debian10 Root File System (use Git LFS)
* linux-image-5.10.69-armv7-fpga_5.10.69-armv7-fpga-0_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-5.10.69-armv7-fpga_5.10.69-armv7-fpga-0_armhf.deb : Linux Headers Package (use Git LFS)
* debian11-rootfs-vanilla.tgz : Debian11 Root File System (use Git LFS)
* linux-image-5.10.109-armv7-fpga_5.10.109-armv7-fpga-1_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-5.10.109-armv7-fpga_5.10.109-armv7-fpga-1_armhf.deb : Linux Headers Package (use Git LFS)
* dtbocfg-ctrl_0.0.5-1_all.deb : dtbocfg Control Pakcage (use Git LFS)
* dtbocfg-5.10.69-armv7-fpga_0.0.9-1_armhf.deb : dtbocfg Kernel Module (use Git LFS)
* fclkcfg-5.10.69-armv7-fpga_1.7.2-1_armhf.deb : fclkcfg Kernel Module (use Git LFS)
* u-dma-buf-5.10.69-armv7-fpga_3.2.4-0_armhf.deb : u-dma-buf Kernel Module (use Git LFS)
* zptty-5.10.69-armv7-fpga_1.0.0-1_armhf.deb : zptty Kernel Module (use Git LFS)
* dtbocfg-5.10.109-armv7-fpga_0.0.9-1_armhf.deb : dtbocfg Kernel Module (use Git LFS)
* fclkcfg-5.10.109-armv7-fpga_1.7.2-1_armhf.deb : fclkcfg Kernel Module (use Git LFS)
* u-dma-buf-5.10.109-armv7-fpga_3.2.5-0_armhf.deb : u-dma-buf Kernel Module (use Git LFS)
* zptty-5.10.109-armv7-fpga_1.1.0-1_armhf.deb : zptty Kernel Module (use Git LFS)

#### Format SD-Card

Expand All @@ -46,13 +46,13 @@ 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 debian11-rootfs-vanilla.tgz -C /mnt/usb2
shell# mkdir /mnt/usb2/home/fpga/debian
shell# cp linux-image-5.10.69-armv7-fpga_5.10.69-armv7-fpga-0_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-5.10.69-armv7-fpga_5.10.69-armv7-fpga-0_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-image-5.10.109-armv7-fpga_5.10.109-armv7-fpga-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-5.10.109-armv7-fpga_5.10.109-armv7-fpga-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp dtbocfg-ctrl_0.0.5-1_all.deb /mnt/usb2/home/fpga/debian
shell$ cp dtbocfg-5.10.69-armv7-fpga_0.0.9-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fclkcfg-5.10.69-armv7-fpga_1.7.2-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp u-dma-buf-5.10.69-armv7-fpga_3.2.4-0_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp zptty-5.10.69-armv7-fpga_1.0.0-1_armhf.deb /mnt/usb2/home/fpga/debian
shell$ cp dtbocfg-5.10.109-armv7-fpga_0.0.9-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fclkcfg-5.10.109-armv7-fpga_1.7.2-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp u-dma-buf-5.10.109-armv7-fpga_3.2.5-0_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp zptty-5.10.109-armv7-fpga_1.1.0-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp -r target/de0-nano-soc/examples /mnt/usb2/home/fpga
shell# umount /mnt/usb1
shell# umount /mnt/usb2
Expand Down
Loading

0 comments on commit fd74c45

Please sign in to comment.