Skip to content

Commit

Permalink
Merge branch 'build-v0.9.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
ikwzm committed Jun 7, 2019
2 parents 678284c + 13c8696 commit 1fbdbdb
Show file tree
Hide file tree
Showing 63 changed files with 6,137 additions and 630 deletions.
4 changes: 2 additions & 2 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.14.34
* Linux Kernel Version v4.14.123
+ Available in both Xilinx-Zynq-7000 and Altera-SoC in a single image
+ Enable Device Tree Overlay
+ Enable FPGA Manager
Expand Down Expand Up @@ -77,7 +77,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.14.34.md)
* [Build Linux Kernel](doc/build/linux-kernel-4.14.123.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 debian9-rootfs-vanilla.tgz
Git LFS file not shown
9 changes: 5 additions & 4 deletions doc/build/debian9-rootfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ shell$ sudo debootstrap --arch=armhf --foreign $distro $
shell$ sudo cp /usr/bin/qemu-arm-static $targetdir/usr/bin
shell$ sudo cp /etc/resolv.conf $targetdir/etc
shell$ sudo cp scripts/build-debian9-rootfs-with-qemu.sh $targetdir
shell$ sudo cp linux-image-4.14.34-armv7-fpga_4.14.34-armv7-fpga-1_armhf.deb $targetdir
shell$ sudo cp linux-image-4.14.123-armv7-fpga_4.14.123-armv7-fpga-1_armhf.deb $targetdir
````

#### Build debian9-rootfs with QEMU
Expand Down Expand Up @@ -164,6 +164,7 @@ debian9-rootfs# apt-get install firmware-ralink
debian9-rootfs# apt-get install -y build-essential
debian9-rootfs# apt-get install -y git
debian9-rootfs# apt-get install -y u-boot-tools
debian9-rootfs# apt-get install -y libssl-dev
debian9-rootfs# apt-get install -y socat
debian9-rootfs# apt-get install -y ruby ruby-msgpack ruby-serialport
debian9-rootfs# gem install rake
Expand All @@ -175,7 +176,7 @@ debian9-rootfs# pip3 install msgpack-rpc-python
##### Install Device Tree Compiler (supported symbol version)

```console
debian9-rootfs# apt-get install -y flex bison
debian9-rootfs# apt-get install -y flex bison pkg-config
debian9-rootfs# cd root
debian9-rootfs# mkdir src
debian9-rootfs# cd src
Expand All @@ -197,7 +198,7 @@ debian9-rootfs# apt-get install -y avahi-daemon

```console
debian9-rootfs# mkdir /mnt/boot
debian9-rootfs# dpkg -i linux-image-4.14.34-armv7-fpga_4.14.34-armv7-fpga-1_armhf.deb
debian9-rootfs# dpkg -i linux-image-4.14.123-armv7-fpga_4.14.123-armv7-fpga-1_armhf.deb
```

##### Clean Cache
Expand All @@ -218,7 +219,7 @@ debian9-rootfs# dpkg -l > dpkg-list.txt
debian9-rootfs# exit
shell$ sudo rm -f $targetdir/usr/bin/qemu-arm-static
shell$ sudo rm -f $targetdir/build-debian9-rootfs-with-qemu.sh
shell$ sudo rm -f $targetdir/linux-image-4.14.34-armv7-fpga_4.14.34-armv7-fpga-1_armhf.deb
shell$ sudo rm -f $targetdir/linux-image-4.14.123-armv7-fpga_4.14.123-armv7-fpga-1_armhf.deb
shell$ sudo mv $targetdir/dpkg-list.txt files/dpkg-list.txt
```

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

#### dtbocfg-4.14.34-armv7-fpga_0.0.6-1_armhf.deb
#### dtbocfg-4.14.123-armv7-fpga_0.0.6-1_armhf.deb

##### Download repository

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

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

#### udmabuf-4.14.34-armv7-fpga_1.2.3-1_armhf.deb
#### udmabuf-4.14.123-armv7-fpga_1.4.1-1_armhf.deb

##### Download repository

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

##### Cross Compile for linux-4.14.34-armv7-fpga
##### Cross Compile for linux-4.14.123-armv7-fpga

```console
shell$ sudo debian/rules arch=arm deb_arch=armhf kernel_release=4.14.34-armv7-fpga kernel_src_dir=../../linux-4.14.34-armv7-fpga binary
shell$ sudo debian/rules arch=arm deb_arch=armhf kernel_release=4.14.123-armv7-fpga kernel_src_dir=../../linux-4.14.123-armv7-fpga binary
:
:
:
shell$ file ../udmabuf-4.14.34-armv7-fpga_1.2.3-1_armhf.deb
../udmabuf-4.14.34-armv7-fpga_1.2.3-1_armhf.deb: Debian binary package (format 2.0)
shell$ file ../udmabuf-4.14.123-armv7-fpga_1.4.1-1_armhf.deb
../udmabuf-4.14.123-armv7-fpga_1.4.1-1_armhf.deb: Debian binary package (format 2.0)
```

#### fclkcfg-4.14.34-armv7-fpga_1.1.0-1_armhf.deb
#### fclkcfg-4.14.123-armv7-fpga_1.1.0-1_armhf.deb

##### Download repository

Expand All @@ -48,18 +48,18 @@ shell$ git clone --recursive --depth=1 -b v1.1.0 git://github.com/ikwzm/fclkcfg-
shell$ cd fclkcfg-kmod-dpkg
```

##### Cross Compile for linux-4.14.34-armv7-fpga
##### Cross Compile for linux-4.14.123-armv7-fpga

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

#### zptty-4.14.34-armv7-fpga_1.0.0-1_armhf.deb
#### zptty-4.14.123-armv7-fpga_1.0.0-1_armhf.deb

##### Download repository

Expand All @@ -68,15 +68,15 @@ shell$ git clone --recursive --depth=1 -b v1.0.0 git://github.com/ikwzm/zptty-km
shell$ cd zptty-kmod-dpkg
```

##### Cross Compile for linux-4.14.34-armv7-fpga
##### Cross Compile for linux-4.14.123-armv7-fpga

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

#### dtbocfg-ctrl_0.0.5-1_all.deb
Expand Down
121 changes: 121 additions & 0 deletions doc/build/linux-kernel-4.14.123.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
### 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

```console
shell$ git clone --depth 1 -b v4.14.123 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.14.123-armv7-fpga
```

##### Checkout v4.14.123

```console
shell$ cd linux-4.14.123-armv7-fpga
shell$ git checkout -b linux-4.14.123-armv7-fpga refs/tags/v4.14.123
```

#### Patch for armv7-fpga

##### Patch for armv7-fpga

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

```console
shell$ patch -p1 < ../files/linux-4.14.123-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-4.14.123-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 v4.14.123-armv7-fpga -m "release v4.14.123-armv7-fpga"
shell$ echo 0 > .version
```

#### Setup for Build

````console
shell$ cd linux-4.14.123-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_sockit.dtb
````

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

```console
shell$ cp arch/arm/boot/zImage ../target/zynq-zybo/boot/vmlinuz-4.14.123-armv7-fpga
shell$ cp arch/arm/boot/dts/zynq-zybo.dtb ../target/zynq-zybo/boot/devicetree-4.14.123-zynq-zybo.dtb
shell$ ./scripts/dtc/dtc -I dtb -O dts -o ../target/zynq-zybo/boot/devicetree-4.14.123-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-4.14.123-armv7-fpga
shell$ cp arch/arm/boot/dts/zynq-zybo-z7.dtb ../target/zynq-zybo-z7/boot/devicetree-4.14.123-zynq-zybo-z7.dtb
shell$ ./scripts/dtc/dtc -I dtb -O dts --symbols -o ../target/zynq-zybo-z7/boot/devicetree-4.14.123-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-4.14.123-armv7-fpga
shell$ cp arch/arm/boot/dts/zynq-pynqz1.dtb ../target/zynq-pynqz1/boot/devicetree-4.14.123-zynq-pynqz1.dtb
shell$ ./scripts/dtc/dtc -I dtb -O dts -o ../target/zynq-pynqz1/boot/devicetree-4.14.123-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-4.14.123-armv7-fpga
shell$ cp arch/arm/boot/dts/socfpga_cyclone5_de0_sockit.dtb ../target/de0-nano-soc/boot/devicetree-4.14.123-socfpga.dtb
shell$ ./scripts/dtc/dtc -I dtb -O dts -o ../target/de0-nano-soc/boot/devicetree-4.14.123-socfpga.dts arch/arm/boot/dts/socfpga_cyclone5_de0_sockit.dtb
```

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

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



54 changes: 27 additions & 27 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 v0.8.2 git://github.com/ikwzm/FPGA-SoC-Linux
shell$ git clone --depth=1 --branch v0.9.0 git://github.com/ikwzm/FPGA-SoC-Linux
shell$ cd FPGA-SoC-Linux
shell$ git lfs pull
```
Expand All @@ -12,23 +12,23 @@ shell$ git lfs pull

* target/de0-nano-soc/
+ boot/
- DE0_NANO_SOC.rbf : FPGA configuration file (Raw Binary Format)
- uEnv.txt : U-Boot environment variables for linux boot
- vmlinuz-4.14.34-armv7-fpga : Linux Kernel Image (use Git LFS)
- devicetree-4.14.34-socfpga.dtb : Linux Device Tree Blob
- devicetree-4.14.34-socfpga.dts : Linux Device Tree Source
- DE0_NANO_SOC.rbf : FPGA configuration file (Raw Binary Format)
- uEnv.txt : U-Boot environment variables for linux boot
- vmlinuz-4.14.123-armv7-fpga : Linux Kernel Image (use Git LFS)
- devicetree-4.14.123-socfpga.dtb : Linux Device Tree Blob
- devicetree-4.14.123-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.14.34-armv7-fpga_4.14.34-armv7-fpga-1_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-4.14.34-armv7-fpga_4.14.34-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-4.14.34-armv7-fpga_0.0.6-1_armhf.deb : dtbocfg Kernel Module (use Git LFS)
* fclkcfg-4.14.34-armv7-fpga_1.1.0-1_armhf.deb : fclkcfg Kernel Module (use Git LFS)
* udmabuf-4.14.34-armv7-fpga_1.2.3-1_armhf.deb : udmabuf Kernel Module (use Git LFS)
* zptty-4.14.34-armv7-fpga_1.0.0-1_armhf.deb : zptty Kernel Module (use Git LFS)
- 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.14.123-armv7-fpga_4.14.123-armv7-fpga-1_armhf.deb : Linux Image Package (use Git LFS)
* linux-headers-4.14.123-armv7-fpga_4.14.123-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-4.14.123-armv7-fpga_0.0.6-1_armhf.deb : dtbocfg Kernel Module (use Git LFS)
* fclkcfg-4.14.123-armv7-fpga_1.1.0-1_armhf.deb : fclkcfg Kernel Module (use Git LFS)
* udmabuf-4.14.123-armv7-fpga_1.4.1-1_armhf.deb : udmabuf Kernel Module (use Git LFS)
* zptty-4.14.123-armv7-fpga_1.0.0-1_armhf.deb : zptty Kernel Module (use Git LFS)

#### Format SD-Card

Expand All @@ -42,16 +42,16 @@ shell# mount /dev/sdc2 /mnt/usb2
shell# cp target/de0-nano-soc/boot/* /mnt/usb1
shell# dd if=target/de0-nano-soc/u-boot/u-boot-spl.sfp of=/dev/sdc3 bs=64k seek=0
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.14.34-armv7-fpga_4.14.34-armv7-fpga-2_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-4.14.34-armv7-fpga_4.14.34-armv7-fpga-2_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.14.34-armv7-fpga_0.0.6-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fclkcfg-4.14.34-armv7-fpga_1.1.0-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp udmabuf-4.14.34-armv7-fpga_1.2.3-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp zptty-4.14.34-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# tar xfz debian9-rootfs-vanilla.tgz -C /mnt/usb2
shell# mkdir /mnt/usb2/home/fpga/debian
shell# cp linux-image-4.14.123-armv7-fpga_4.14.123-armv7-fpga-2_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp linux-headers-4.14.123-armv7-fpga_4.14.123-armv7-fpga-2_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.14.123-armv7-fpga_0.0.6-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp fclkcfg-4.14.123-armv7-fpga_1.1.0-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp udmabuf-4.14.123-armv7-fpga_1.4.1-1_armhf.deb /mnt/usb2/home/fpga/debian
shell# cp zptty-4.14.123-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
Loading

0 comments on commit 1fbdbdb

Please sign in to comment.