LoginSignup
1
1

More than 5 years have passed since last update.

Xillybus and ROS on Ubuntu14.04 on Zybo Part 2 : Linuxカーネルのビルド~uEnv.txt作成

Posted at

Contents

Linuxカーネルのビルド:Ubuntu

Linuxカーネルのソースコードを取得します。

$ cd ~/work_dir
$ git clone -b master-next https://github.com/DigilentInc/Linux-Digilent-Dev.git
$ cd Linux-Digilent-Dev/

Zybo用のデフォルトコンフィギュレーションをします。

$ make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi- xilinx_zynq_defconfig

ここで、LinuxカーネルにXillybusのデバイスドライバを導入するために~/work_dir/Linux-Digilent-Dev/.configを編集します。

# .config
# 1503行目あたり。"xilly"で検索してもいい。
- # CONFIG_XILLYBUS is not set
+ CONFIG_XILLYBUS=y

ビルドします。ビルドにはある程度時間がかかります。

$ make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi-

ビルドを開始すると、いくつか質問されます。yと入力してください。

Xillybus over PCIe (XILLYBUS_PCIE) [N/m/y/?] (NEW) y
Xillybus over Device Tree (XILLYBUS_OF) [N/m/y/?] (NEW) y

ビルドに成功すると~/work_dir/Linux-Digilent-Dev/arch/arm/boot/zImageが生成されます。

uImageを作成します。

$ make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi- UIMAGE_LOADADDR=0x8000 uImage

ビルドに成功すると~/work_dir/Linux-Digilent-Dev/arch/arm/boot/uImageが生成されます。

uImageを~/work_dir/にコピーしておきます。

$ cd ~/work_dir/
$ cp Linux-Digilent-Dev/arch/arm/boot/uImage .
$ ls
BOOT.bin  Linux-Digilent-Dev  u-boot-Digilent-Dev  uImage

Contentsにもどる

デバイスツリーファイル(dtb)の作成:Ubuntu

dtbの作成に使用するdtsファイルは/work_dir/Linux-Digilent-Dev/arch/arm/boot/dts/zynq-zybo.dtsです。

この際、zynq-zybo.dtsを編集します。

~/work_dirにファイルをコピーしましょう。

$ cd ~/work_dir
$ cp Linux-Digilent-Dev/arch/arm/boot/dts/zynq-zybo.dts .
$ ls
BOOT.bin  Linux-Digilent-Dev  u-boot-Digilent-Dev  uImage  zynq-zybo.dts

zynq-zybo.dtsの編集内容は以下の通りです。

/*41行目あたり*/
    chosen {
-       bootargs = "console=ttyPS0,115200 root=/dev/ram rw earlyprintk";
+       bootargs = "console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait devtmpfs.mount=1";
        linux,stdout-path = "/amba@0/serial@e0001000";
    } ;
+   xillinux {
+       board = "zybo";
+       audio = "ssm2603";
+   } ;
    cpus {
            #address-cells = <1>;
            #size-cells = <0>;
            ps7_cortexa9_0: cpu@0 {
                bus-handle = <&ps7_axi_interconnect_0>;
                clock-latency = <1000>;
                clocks = <&clkc 3>;
                compatible = "arm,cortex-a9";
                device_type = "cpu";
                interrupt-handle = <&ps7_scugic_0>;
-               operating-points = <666667 1000000 333334 1000000 222223 1000000>;
+               operating-points = <650000 1000000>;
                reg = <0x0>;
        } ;
:
:
:
/*329行目あたり*/
        ps7_xadc: ps7-xadc@f8007100 {
            clocks = <&clkc 12>;
            compatible = "xlnx,zynq-xadc-1.00.a";
            interrupt-parent = <&ps7_scugic_0>;
            interrupts = <0 7 4>;
            reg = <0xf8007100 0x20>;
        } ;
+       xillyvga@50001000 {
+           compatible = "xillybus,xillyvga-1.00.a";
+           reg = < 0x50001000 0x1000 >;
+       } ;
+       xillybus@50000000 {
+           compatible = "xillybus,xillybus-1.00.a";
+           reg = < 0x50000000 0x1000 >;
+           interrupts = < 0 59 1 >;
+           interrupt-parent = <&ps7_scugic_0>;
+           dma-coherent;
+       } ;
+       xillybus_lite@50002000 {
+           compatible = "xillybus,xillybus_lite_of-1.00.a";
+           reg = < 0x50002000 0x1000 >;
+           interrupts = < 0 58 1 >;
+           interrupt-parent = <&ps7_scugic_0>;
+       } ;
    } ;
} ;

編集が完了したら、ビルドします。

$ cd ~/work_dir/Linux-Digilent-Dev
$ ./scripts/dtc/dtc -I dts -O dtb -o ../devicetree.dtb ../zynq-zybo.dts

ビルドに成功すると~/work_dirdevicetree.dtbができています。

Contentsにもどる

uEnv.txt作成:Ubuntu

uEnv.txtを作成します。

$ cd ~/work_dir
$ cat <<EOT>> uEnv.txt
uenvcmd=fatload mmc 0 0x03000000 uImage && fatload mmc 0 0x02A00000 devicetree.dtb && bootm 0x03000000 - 0x02A00000
EOT

Contentsにもどる

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1