Skip to content

Commit

Permalink
Merge branch 'build-v2020.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ikwzm committed Jun 22, 2020
2 parents cdc1844 + 998eec2 commit 829f3d7
Show file tree
Hide file tree
Showing 43 changed files with 3,828 additions and 2,364 deletions.
10 changes: 6 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ This Repository provides a Linux Boot Image(U-boot, Kernel, Root-fs) for Zynq MP
+ PMU Firmware(Platform Management Unit Firmware)
+ BL31(ARM Trusted Firmware Boot Loader stage 3-1)
+ U-Boot xilinx-v2019.2 (customized)
* Linux Kernel Version v4.19.0
+ [linux-xlnx](/~https://github.com/Xilinx/linux-xlnx) tag=xilinx-v2019.2
* Linux Kernel Version v5.4.0
+ [linux-xlnx](/~https://github.com/Xilinx/linux-xlnx) tag=xilinx-v2020.1
+ Enable Device Tree Overlay with Configuration File System
+ Enable FPGA Manager
+ Enable FPGA Bridge
+ Enable FPGA Reagion
+ Enable ATWILC3000 Linux Driver for Ultra96-V2
+ Enable Xilinx APF Accelerator driver
+ Enable Xilinx APF DMA engines support
* Debian10(buster) Root File System
+ Installed build-essential
+ Installed device-tree-compiler
Expand All @@ -35,7 +37,7 @@ This Repository provides a Linux Boot Image(U-boot, Kernel, Root-fs) for Zynq MP
+ Installed Other package list -> [files/debian10-dpkg-list.txt](files/debian10-dpkg-list.txt)
* FPGA Device Drivers and Services
+ [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)

Install
------------------------------------------------------------------------------------
Expand All @@ -51,7 +53,7 @@ Build
* [Build Boot Loader for UltraZed-EG-IOCC](target/UltraZed-EG-IOCC/build-v2019.2/Readme.md)
* [Build Boot Loader for Ultra96](target/Ultra96/build-v2019.2/Readme.md)
* [Build Boot Loader for Ultra96-V2](target/Ultra96-V2/build-v2019.2/Readme.md)
* [Build Linux Kernel](doc/build/linux-xlnx-v2019.2-zynqmp-fpga.md)
* [Build Linux Kernel](doc/build/linux-xlnx-v2020.1-zynqmp-fpga.md)
* [Build Debian10 RootFS](doc/build/debian10-rootfs.md)
* [Build Device Drivers](doc/build/device-drivers.md)

Expand Down
43 changes: 11 additions & 32 deletions doc/build/device-drivers.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,28 @@
Build Device Drivers and Services Package
====================================================================================

udmabuf-4.19.0-xlnx-v2019.2-zynqmp-fpga_1.4.6-0_arm64.deb
u-dma-buf-5.4.0-xlnx-v2020.1-zynqmp-fpga_3.0.1-0_arm64.deb
------------------------------------------------------------------------------------

### Download repository

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

### Cross Compile for linux-xlnx-v2019.2-zynqmp-fpga

```console
shell$ sudo debian/rules arch=arm64 deb_arch=arm64 kernel_release=4.19.0-xlnx-v2019.2-zynqmp-fpga kernel_src_dir=../../linux-xlnx-v2019.2-zynqmp-fpga binary
:
:
:
shell$ file ../udmabuf-4.19.0-xlnx-v2019.2-zynqmp-fpga_1.4.6-0_arm64.deb
../udmabuf-4.19.0-xlnx-v2019.2-zynqmp-fpga_1.4.6-0_arm64.deb: Debian binary package (format 2.0)
```

u-dma-buf-4.19.0-xlnx-v2019.2-zynqmp-fpga_2.1.3-0_arm64.deb
------------------------------------------------------------------------------------

### Download repository

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

### Cross Compile for linux-xlnx-v2019.2-zynqmp-fpga
### Cross Compile for linux-xlnx-v2020.1-zynqmp-fpga

```console
shell$ sudo debian/rules arch=arm64 deb_arch=arm64 kernel_release=4.19.0-xlnx-v2019.2-zynqmp-fpga kernel_src_dir=../../linux-xlnx-v2019.2-zynqmp-fpga binary
shell$ sudo debian/rules arch=arm64 deb_arch=arm64 kernel_release=5.4.0-xlnx-v2020.1-zynqmp-fpga kernel_src_dir=../../linux-xlnx-v2020.1-zynqmp-fpga binary
:
:
:
shell$ file ../u-dma-buf-4.19.0-xlnx-v2019.2-zynqmp-fpga_2.1.3-0_arm64.deb
../u-dma-buf-4.19.0-xlnx-v2019.2-zynqmp-fpga_2.1.3-0_arm64.deb: Debian binary package (format 2.0)
shell$ file ../u-dma-buf-5.4.0-xlnx-v2020.1-zynqmp-fpga_3.0.0-1_arm64.deb
../u-dma-buf-5.4.0-xlnx-v2020.1-zynqmp-fpga_3.0.1-0_arm64.deb: Debian binary package (format 2.0)
```

fclkcfg-4.19.0-xlnx-v2019.2-zynqmp-fpga_1.3.0-1_arm64.deb
fclkcfg-5.4.0-xlnx-v2020.1-zynqmp-fpga_1.3.0-1_arm64.deb
------------------------------------------------------------------------------------

### Download repository
Expand All @@ -53,15 +32,15 @@ shell$ git clone --recursive --depth=1 -b v1.3.0 git://github.com/ikwzm/fclkcfg-
shell$ cd fclkcfg-kmod-dpkg
```

### Cross Compile for linux-xlnx-v2019.2-zynqmp-fpga
### Cross Compile for linux-xlnx-v2020.1-zynqmp-fpga

```console
shell$ sudo debian/rules arch=arm64 deb_arch=arm64 kernel_release=4.19.0-xlnx-v2019.2-zynqmp-fpga kernel_src_dir=../../linux-xlnx-v2019.2-zynqmp-fpga binary
shell$ sudo debian/rules arch=arm64 deb_arch=arm64 kernel_release=5.4.0-xlnx-v2020.1-zynqmp-fpga kernel_src_dir=../../linux-xlnx-v2020.1-zynqmp-fpga binary
:
:
:
shell$ file ../fclkcfg-4.19.0-xlnx-v2019.2-zynqmp-fpga_1.3.0-1_arm64.deb
../fclkcfg-4.19.0-xlnx-v2019.2-zynqmp-fpga_1.3.0-1_arm64.deb: Debian binary package (format 2.0)
shell$ file ../fclkcfg-5.4.0-xlnx-v2020.1-zynqmp-fpga_1.3.0-1_arm64.deb
../fclkcfg-5.4.0-xlnx-v2020.1-zynqmp-fpga_1.3.0-1_arm64.deb: Debian binary package (format 2.0)
```


126 changes: 126 additions & 0 deletions doc/build/linux-xlnx-v2020.1-zynqmp-fpga.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# Build Linux Kernel

There are two ways

1. run scripts/build-linux-xlnx-v2020.1-zynqmp-fpga.sh (easy)
2. run this chapter step-by-step (annoying)

## Download ATWILC3000 Linux Driver for Ultra96-V2

```console
shell$ git clone /~https://github.com/Avnet/u96v2-wilc-driver.git
```
## Download Linux Kernel Source

### Clone from linux-xlnx.git

```console
shell$ git clone --depth 1 -b xilinx-v2020.1 /~https://github.com/Xilinx/linux-xlnx.git linux-xlnx-v2020.1-zynqmp-fpga
```

### Make Branch linux-xlnx-v2020.1-zynqmp-fpga

```console
shell$ cd linux-xlnx-v2020.1-zynqmp-fpga
shell$ git checkout -b linux-xlnx-v2020.1-zynqmp-fpga refs/tags/xilinx-v2020.1
```

## Patch for linux-xlnx-v2020.1-zynqmp-fpga

```console
shell$ patch -p1 < ../files/linux-xlnx-v2020.1-zynqmp-fpga.diff
shell$ git add --update
shell$ git add arch/arm64/boot/dts/xilinx/zynqmp-uz3eg-iocc.dts
shell$ git commit -m "[patch] for linux-xlnx-v2020.1-zynqmp-fpga."
```

## Patch for linux-xlnx-v2020.1-builddeb

```console
shell$ patch -p1 < ../files/linux-xlnx-v2020.1-builddeb.diff
shell$ git add --update
shell$ git commit -m "[update] 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-xlnx-v2020.1-zynqmp-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."
```

## Add ATWILC3000 Linux Driver for Ultra96-V2

```console
shell$ cp -r ../u96v2-wilc-driver/wilc drivers/staging/wilc3000/
shell$ patch -p1 < ../files/linux-xlnx-v2020.1-zynqmp-fpga-wilc3000.diff
shell$ git add --update
shell$ git add drivers/staging/wilc3000
shell$ git commit -m "[add] drivers/staging/wilc3000"
```

## Patch for Ultra96-V2

```console
shell$ patch -p1 < ../files/linux-xlnx-v2020.1-zynqmp-fpga-ultra96v2.diff
shell$ git add --update
shell$ git add arch/arm64/boot/dts/xilinx/avnet-ultra96v2-rev1.dts
shell$ git commit -m "[add] devicetree for Ultra96-V2."
```

## Patch for Xilinx APF Driver

```console
shell$ patch -p1 < ../files/linux-xlnx-v2020.1-zynqmp-fpga-apf.diff
shell$ git add --update
shell$ git commit -m "[add] Xilinx APF driver."
```

## Create tag and .version

```console
shell$ git tag -a xilinx-v2020.1-zynqmp-fpga-1 -m "release xilinx-v2020.1-zynqmp-fpga-1"
shell$ echo 1 > .version
```

## Setup for Build

```console
shell$ cd linux-xlnx-v2020.1-zynqmp-fpga
shell$ export ARCH=arm64
shell$ export CROSS_COMPILE=aarch64-linux-gnu-
shell$ make xilinx_zynqmp_defconfig
```

## Build Linux Kernel and device tree

```console
shell$ export DTC_FLAGS=--symbols
shell$ make deb-pkg
```

## Build kernel image and devicetree to target/UltraZed-EG-IOCC/boot/

```console
shell$ cp arch/arm64/boot/Image ../target/UltraZed-EG-IOCC/boot/image-5.4.0-xlnx-v2020.1-zynqmp-fpga
shell$ cp arch/arm64/boot/dts/xilinx/zynqmp-uz3eg-iocc.dtb ../target/UltraZed-EG-IOCC/boot/devicetree-5.4.0-xlnx-v2020.1-zynqmp-fpga-uz3eg-iocc.dtb
shell$ ./scripts/dtc/dtc -I dtb -O dts --symbols -o ../target/UltraZed-EG-IOCC/boot/devicetree-5.4.0-xlnx-v2020.1-zynqmp-fpga-uz3eg-iocc.dts ../target/UltraZed-EG-IOCC/boot/devicetree-5.4.0-xlnx-v2020.1-zynqmp-fpga-uz3eg-iocc.dtb
```

## Build kernel image and devicetree to target/Ultra96/boot/

```console
shell$ cp arch/arm64/boot/Image ../target/Ultra96/boot/image-5.4.0-xlnx-v2020.1-zynqmp-fpga
shell$ cp arch/arm64/boot/dts/xilinx/avnet-ultra96-rev1.dtb ../target/Ultra96/boot/devicetree-5.4.0-xlnx-v2020.1-zynqmp-fpga-ultra96.dtb
shell$ ./scripts/dtc/dtc -I dtb -O dts --symbols -o ../target/Ultra96/boot/devicetree-5.4.0-xlnx-v2020.1-zynqmp-fpga-ultra96.dts ../target/Ultra96/boot/devicetree-5.4.0-xlnx-v2020.1-zynqmp-fpga-ultra96.dtb
```

## Build kernel image and devicetree to target/Ultra96-V2/boot/

```console
shell$ cp arch/arm64/boot/Image ../target/Ultra96-V2/boot/image-5.4.0-xlnx-v2020.1-zynqmp-fpga
shell$ cp arch/arm64/boot/dts/xilinx/avnet-ultra96v2-rev1.dtb ../target/Ultra96-V2/boot/devicetree-5.4.0-xlnx-v2020.1-zynqmp-fpga-ultra96v2.dtb
shell$ ./scripts/dtc/dtc -I dtb -O dts --symbols -o ../target/Ultra96-V2/boot/devicetree-5.4.0-xlnx-v2020.1-zynqmp-fpga-ultra96v2.dts ../target/Ultra96-V2/boot/devicetree-5.4.0-xlnx-v2020.1-zynqmp-fpga-ultra96v2.dtb
```

Loading

0 comments on commit 829f3d7

Please sign in to comment.