Skip to content

Commit

Permalink
Merge branch 'build-v1.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
ikwzm committed Jun 26, 2020
2 parents 6e9977c + f8131d4 commit 73206d4
Show file tree
Hide file tree
Showing 66 changed files with 7,772 additions and 1,707 deletions.
9 changes: 4 additions & 5 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ 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 v4.19.57
* Linux Kernel Version v5.4.47
+ Available in both Xilinx-Zynq-7000 and Altera-SoC in a single image
+ Enable Device Tree Overlay
+ Enable FPGA Manager
Expand All @@ -39,7 +39,7 @@ This Repository provides a Linux Boot Image(U-boot, Kernel, Root-fs) for FPGA-So
* FPGA Device Drivers and Services
+ [dtbocfg (Device Tree Blob Overlay Configuration File System)](https://github.com/ikwzm/dtbocfg)
+ [fclkcfg (FPGA Clock Configuration Device Driver)](https://github.com/ikwzm/fclkcfg)
+ [udmabuf (User space mappable DMA Buffer)](https://github.com/ikwzm/udmabuf)
+ [u-dma-buf (User space mappable DMA Buffer)](https://github.com/ikwzm/udmabuf)
+ [zptty (Pseudo TeleTYpewriter for FPGA Device)](https://github.com/ikwzm/PTTY_AXI4)

Install
Expand All @@ -53,8 +53,7 @@ Install
+ [DE10-Nano](doc/install/de10-nano.md)
+ [Dual Boot(ZYBO and DE0-Nano-SoC)](doc/install/zynq-zybo-de0-nano-soc.md)
* [Install Device Drivers and Services](doc/install/device-drivers.md)
* [Upgrade to v0.5.4 from v0.5.3](doc/install/upgrade-v0.5.4.md)
* [Upgrade to v0.8.1 from previous version](doc/install/upgrade-v0.8.1.md)
* [Upgrade to v1.1.0 from v1.0.x](doc/install/upgrade-v1.1.0.md)

Tutorial
------------------------------------------------------------------------------------
Expand All @@ -74,7 +73,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-4.19.57.md)
* [Build Linux Kernel](doc/build/linux-kernel-5.4.47.md)
* [Build Debian10 RootFS](doc/build/debian10-rootfs.md)
* [Build Device Drivers and Services Package](doc/build/device-drivers.md)

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

There are two ways

1. run scripts/build-linux-kernel-5.4.47.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.4.47 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.4.47-armv7-fpga
```

##### Checkout v5.4.47

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

#### Patch for armv7-fpga

##### Patch for armv7-fpga

```console
shell$ patch -p1 < ../files/linux-5.4.47-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.4.47-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.4.47-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"
```

##### Patch for drivers/drivers/tty/serial/xilinx_uartps.c

```console
shell$ patch -p1 < ../files/linux-5.4.47-armv7-fpga-xilinx_uartps.diff
shell$ git add --update
shell$ git commit -m "[fix] the problem that only the first port that xilinx_uartps.c found was the console."
```

##### Create tag and .version

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

#### Setup for Build

````console
shell$ cd linux-5.4.47-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.4.47-armv7-fpga
shell$ cp arch/arm/boot/dts/zynq-zybo.dtb ../target/zynq-zybo/boot/devicetree-5.4.47-zynq-zybo.dtb
shell$ ./scripts/dtc/dtc -I dtb -O dts -o ../target/zynq-zybo/boot/devicetree-5.4.47-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.4.47-armv7-fpga
shell$ cp arch/arm/boot/dts/zynq-zybo-z7.dtb ../target/zynq-zybo-z7/boot/devicetree-5.4.47-zynq-zybo-z7.dtb
shell$ ./scripts/dtc/dtc -I dtb -O dts --symbols -o ../target/zynq-zybo-z7/boot/devicetree-5.4.47-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.4.47-armv7-fpga
shell$ cp arch/arm/boot/dts/zynq-pynqz1.dtb ../target/zynq-pynqz1/boot/devicetree-5.4.47-zynq-pynqz1.dtb
shell$ ./scripts/dtc/dtc -I dtb -O dts -o ../target/zynq-pynqz1/boot/devicetree-5.4.47-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.4.47-armv7-fpga
shell$ cp arch/arm/boot/dts/socfpga_cyclone5_de0_nano_soc.dtb ../target/de0-nano-soc/boot/devicetree-5.4.47-socfpga.dtb
shell$ ./scripts/dtc/dtc -I dtb -O dts -o ../target/de0-nano-soc/boot/devicetree-5.4.47-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.4.47-armv7-fpga
shell$ cp arch/arm/boot/dts/socfpga_cyclone5_de0_nano_soc.dtb ../target/de10-nano/boot/devicetree-5.4.47-socfpga.dtb
shell$ ./scripts/dtc/dtc -I dtb -O dts --symbols -o ../target/de10-nano/boot/devicetree-5.4.47-socfpga.dts arch/arm/boot/dts/socfpga_cyclone5_de0_nano_soc.dtb
```



32 changes: 16 additions & 16 deletions doc/install/de0-nano-soc.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#### Downlowd from github

```console
shell$ git clone --depth=1 --branch v1.0.1 git://github.com/ikwzm/FPGA-SoC-Linux
shell$ git clone --depth=1 --branch v1.1.0 git://github.com/ikwzm/FPGA-SoC-Linux
shell$ cd FPGA-SoC-Linux
shell$ git lfs pull
```
Expand All @@ -14,21 +14,21 @@ 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.19.57-armv7-fpga : Linux Kernel Image (use Git LFS)
- devicetree-4.19.57-socfpga.dtb : Linux Device Tree Blob
- devicetree-4.19.57-socfpga.dts : Linux Device Tree Source
- vmlinuz-5.4.47-armv7-fpga : Linux Kernel Image (use Git LFS)
- devicetree-5.4.47-socfpga.dtb : Linux Device Tree Blob
- devicetree-5.4.47-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-4.19.57-armv7-fpga_4.19.57-armv7-fpga-0_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-4.19.57-armv7-fpga_4.19.57-armv7-fpga-0_armhf.deb : Linux Headers Package (use Git LFS)
* linux-image-5.4.47-armv7-fpga_5.4.47-armv7-fpga-0_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-5.4.47-armv7-fpga_5.4.47-armv7-fpga-0_armhf.deb : Linux Headers Package (use Git LFS)
* dtbocfg-ctrl_0.0.5-1_all.deb : dtbocfg Control Pakcage (use Git LFS)
* dtbocfg-4.19.57-armv7-fpga_0.0.8-1_armhf.deb : dtbocfg Kernel Module (use Git LFS)
* fclkcfg-4.19.57-armv7-fpga_1.2.0-1_armhf.deb : fclkcfg Kernel Module (use Git LFS)
* udmabuf-4.19.57-armv7-fpga_1.4.2-0_armhf.deb : udmabuf Kernel Module (use Git LFS)
* zptty-4.19.57-armv7-fpga_1.0.0-1_armhf.deb : zptty Kernel Module (use Git LFS)
* dtbocfg-5.4.47-armv7-fpga_0.0.8-1_armhf.deb : dtbocfg Kernel Module (use Git LFS)
* fclkcfg-5.4.47-armv7-fpga_1.2.0-1_armhf.deb : fclkcfg Kernel Module (use Git LFS)
* u-dma-buf-5.4.47-armv7-fpga_3.0.1-0_armhf.deb : u-dma-buf Kernel Module (use Git LFS)
* zptty-5.4.47-armv7-fpga_1.0.0-1_armhf.deb : zptty Kernel Module (use Git LFS)

#### Format SD-Card

Expand All @@ -44,13 +44,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 debian10-rootfs-vanilla.tgz -C /mnt/usb2
shell# mkdir /mnt/usb2/home/fpga/debian
shell# cp linux-image-4.19.57-armv7-fpga_4.19.57-armv7-fpga-0_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-4.19.57-armv7-fpga_4.19.57-armv7-fpga-0_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-image-5.4.47-armv7-fpga_5.4.47-armv7-fpga-0_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-5.4.47-armv7-fpga_5.4.47-armv7-fpga-0_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-4.19.57-armv7-fpga_0.0.8-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fclkcfg-4.19.57-armv7-fpga_1.2.0-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp udmabuf-4.19.57-armv7-fpga_1.4.2-0_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp zptty-4.19.57-armv7-fpga_1.0.0-1_armhf.deb /mnt/usb2/home/fpga/debian
shell$ cp dtbocfg-5.4.47-armv7-fpga_0.0.8-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fclkcfg-5.4.47-armv7-fpga_1.2.0-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp u-dma-buf-5.4.47-armv7-fpga_3.0.1-0_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp zptty-5.4.47-armv7-fpga_1.0.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
32 changes: 16 additions & 16 deletions doc/install/de10-nano.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#### Downlowd from github

```console
shell$ git clone --depth=1 --branch v1.0.1 git://github.com/ikwzm/FPGA-SoC-Linux
shell$ git clone --depth=1 --branch v1.1.0 git://github.com/ikwzm/FPGA-SoC-Linux
shell$ cd FPGA-SoC-Linux
shell$ git lfs pull
```
Expand All @@ -13,20 +13,20 @@ shell$ git lfs pull
* target/de10-nano/
+ boot/
- uEnv.txt : U-Boot environment variables for linux boot
- vmlinuz-4.19.57-armv7-fpga : Linux Kernel Image (use Git LFS)
- devicetree-4.19.57-socfpga.dtb : Linux Device Tree Blob
- devicetree-4.19.57-socfpga.dts : Linux Device Tree Source
- vmlinuz-5.4.47-armv7-fpga : Linux Kernel Image (use Git LFS)
- devicetree-5.4.47-socfpga.dtb : Linux Device Tree Blob
- devicetree-5.4.47-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)
* debian10-rootfs-vanilla.tgz : Debian10 Root File System (use Git LFS)
* linux-image-4.19.57-armv7-fpga_4.19.57-armv7-fpga-0_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-4.19.57-armv7-fpga_4.19.57-armv7-fpga-0_armhf.deb : Linux Headers Package (use Git LFS)
* linux-image-5.4.47-armv7-fpga_5.4.47-armv7-fpga-0_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-5.4.47-armv7-fpga_5.4.47-armv7-fpga-0_armhf.deb : Linux Headers Package (use Git LFS)
* dtbocfg-ctrl_0.0.5-1_all.deb : dtbocfg Control Pakcage (use Git LFS)
* dtbocfg-4.19.57-armv7-fpga_0.0.8-1_armhf.deb : dtbocfg Kernel Module (use Git LFS)
* fclkcfg-4.19.57-armv7-fpga_1.2.0-1_armhf.deb : fclkcfg Kernel Module (use Git LFS)
* udmabuf-4.19.57-armv7-fpga_1.4.2-0_armhf.deb : udmabuf Kernel Module (use Git LFS)
* zptty-4.19.57-armv7-fpga_1.0.0-1_armhf.deb : zptty Kernel Module (use Git LFS)
* dtbocfg-5.4.47-armv7-fpga_0.0.8-1_armhf.deb : dtbocfg Kernel Module (use Git LFS)
* fclkcfg-5.4.47-armv7-fpga_1.2.0-1_armhf.deb : fclkcfg Kernel Module (use Git LFS)
* u-dma-buf-5.4.47-armv7-fpga_3.0.1-0_armhf.deb : u-dma-buf Kernel Module (use Git LFS)
* zptty-5.4.47-armv7-fpga_1.0.0-1_armhf.deb : zptty Kernel Module (use Git LFS)

#### Format SD-Card

Expand All @@ -42,13 +42,13 @@ shell# dd if=target/de10-nano/u-boot/u-boot-spl.sfp of=/dev/sdc3 bs=64k seek=0
shell# dd if=target/de10-nano/u-boot/u-boot.img of=/dev/sdc3 bs=64k seek=4
shell# tar xfz debian10-rootfs-vanilla.tgz -C /mnt/usb2
shell# mkdir /mnt/usb2/home/fpga/debian
shell# cp linux-image-4.19.57-armv7-fpga_4.19.57-armv7-fpga-0_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-4.19.57-armv7-fpga_4.19.57-armv7-fpga-0_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-image-5.4.47-armv7-fpga_5.4.47-armv7-fpga-0_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-5.4.47-armv7-fpga_5.4.47-armv7-fpga-0_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-4.19.57-armv7-fpga_0.0.8-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fclkcfg-4.19.57-armv7-fpga_1.2.0-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp udmabuf-4.19.57-armv7-fpga_1.4.2-0_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp zptty-4.19.57-armv7-fpga_1.0.0-1_armhf.deb /mnt/usb2/home/fpga/debian
shell$ cp dtbocfg-5.4.47-armv7-fpga_0.0.8-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fclkcfg-5.4.47-armv7-fpga_1.2.0-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp u-dma-buf-5.4.47-armv7-fpga_3.0.1-0_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp zptty-5.4.47-armv7-fpga_1.0.0-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# umount mnt/usb1
shell# umount mnt/usb2
````
Expand Down
Loading

0 comments on commit 73206d4

Please sign in to comment.