FC2カウンター FPGAの部屋 複数のAXI4 バスを持つIPの作製
fc2ブログ

FPGAやCPLDの話題やFPGA用のツールの話題などです。 マニアックです。 日記も書きます。

FPGAの部屋

FPGAの部屋の有用と思われるコンテンツのまとめサイトを作りました。Xilinx ISEの初心者の方には、FPGAリテラシーおよびチュートリアルのページをお勧めいたします。

AXI4 Master IP にAXI4 Lite Slave を追加10(ハードウェア完成)

このブログ記事のトップは、”AXI4 Master IP にAXI4 Lite Slave を追加1(インプリメント)”
前の記事は、”AXI4 Master IP にAXI4 Lite Slave を追加9(バグフィックス)

前回の記事でバグをフックスしたので、今回はインプリメントし、SDKでBOOT.bin を生成して、SDカードにコピーしてZedBoardで確かめてみた。

まずはISEでインプリメントを行った。
AXI4M_and_Lite_Slave_92_130420.png

LUT使用率は26%だ。
ここから、ハードウェア・デザインをエクスポートして、SDKを立ち上げた。

SDKでは、Linux起動用のBOOT.bin を生成して、SDカードにコピーした
SDKでリモートデバッグを開始した。AXI_Lite_test_linux.elf はZedBoard の電源をOFFすると消えてしまうので、もう一度ファイルを作成した。

Debug Configuration を使用して、AXI_Lite_test_linux.elf のデバックを開始した。

・デバックを進めて、カメラ・インターフェイスIPとビットマップ・ディスプレイ・コントローラIPのレジスタをRead した。
AXI4M_and_Lite_Slave_88_130419.png

カメラ・インターフェイスIPとビットマップ・ディスプレイ・コントローラIPのレジスタの値が 0x1a000000 になった。これは正しい。

・最初にビットマップ・ディスプレイ・コントローラIPのレジスタに、今回のフレームバッファのアドレスの 0x19000000 をWrite した。
AXI4M_and_Lite_Slave_89_130419.png

VGAモニタの画面にペンギンが表示された。
#VGAモニタのホコリはご愛嬌ということでご勘弁を。。。
AXI4M_and_Lite_Slave_93_130420.jpg

ちゃんとフレームバッファにアドレスを使っているようだ。

・次に、カメラ・インターフェイスIPのレジスタに、今回のフレームバッファのアドレスの 0x19000000 をWrite した。
AXI4M_and_Lite_Slave_90_130419.png

今度は、カメラの画像がVGAモニタに表示された。成功だ。。。
AXI4M_and_Lite_Slave_94_130420.jpg

・次に、カメラ・インターフェイスIPとビットマップ・ディスプレイ・コントローラIPのレジスタの値をRead した。
AXI4M_and_Lite_Slave_91_130419.png

2つのレジスタの値は、0x19000000 だった。これは正しい値だ。

AXI4 Master バス・インターフェースとAXI4 Lite Slave バス・インターフェースの2つのAXIバスを持つカスタムIPのハードウェアは完成した。
次は、dmesg のフレームバッファの情報を取得して、Sysfs に書かれているカメラ・インターフェイスIPとビットマップ・ディスプレイ・コントローラIPのレジスタのアドレスに書き込むCプログラムを作成する。

ISEのMAPリポートを貼っておきます。

Release 14.4 Map P.49d (nt64)
Xilinx Mapping Report File for Design 'system_top'

Design Information
------------------
Command Line   : map -intstyle ise -p xc7z020-clg484-1 -w -logic_opt off -ol
high -t 1 -xt 0 -register_duplication off -r 4 -mt off -ir off -pr off -lc off
-power off -o system_top_map.ncd system_top.ngd system_top.pcf 
Target Device  : xc7z020
Target Package : clg484
Target Speed   : -1
Mapper Version : zynq -- $Revision: 1.55 $
Mapped Date    : FRI 19 APR 6:41:49 2013

Design Summary
--------------
Number of errors:      0
Number of warnings:  276
Slice Logic Utilization:
  Number of Slice Registers:                18,637 out of 106,400   17%
    Number used as Flip Flops:              18,543
    Number used as Latches:                      4
    Number used as Latch-thrus:                  0
    Number used as AND/OR logics:               90
  Number of Slice LUTs:                     14,268 out of  53,200   26%
    Number used as logic:                   10,455 out of  53,200   19%
      Number using O6 output only:           7,151
      Number using O5 output only:             334
      Number using O5 and O6:                2,970
      Number used as ROM:                        0
    Number used as Memory:                   2,579 out of  17,400   14%
      Number used as Dual Port RAM:            498
        Number using O6 output only:           114
        Number using O5 output only:            14
        Number using O5 and O6:                370
      Number used as Single Port RAM:            0
      Number used as Shift Register:         2,081
        Number using O6 output only:         1,233
        Number using O5 output only:             8
        Number using O5 and O6:                840
    Number used exclusively as route-thrus:  1,234
      Number with same-slice register load:    994
      Number with same-slice carry load:       239
      Number with other load:                    1

Slice Logic Distribution:
  Number of occupied Slices:                 7,161 out of  13,300   53%
  Number of LUT Flip Flop pairs used:       21,697
    Number with an unused Flip Flop:         5,567 out of  21,697   25%
    Number with an unused LUT:               7,429 out of  21,697   34%
    Number of fully used LUT-FF pairs:       8,701 out of  21,697   40%
    Number of unique control sets:           1,012
    Number of slice register sites lost
      to control set restrictions:           4,368 out of 106,400    4%

  A LUT Flip Flop pair for this architecture represents one LUT paired with
  one Flip Flop within a slice.  A control set is a unique combination of
  clock, reset, set, and enable signals for a registered element.
  The Slice Logic Distribution report is not meaningful if the design is
  over-mapped for a non-slice resource or if Placement fails.
  OVERMAPPING of BRAM resources should be ignored if the design is
  over-mapped for a non-BRAM resource or if placement fails.

IO Utilization:
  Number of bonded IOBs:                        55 out of     200   27%
    Number of LOCed IOBs:                       55 out of      55  100%
  Number of bonded IOPAD:                      130 out of     130  100%
    IOB Flip Flops:                             16

Specific Feature Utilization:
  Number of RAMB36E1/FIFO36E1s:                 33 out of     140   23%
    Number using RAMB36E1 only:                 33
    Number using FIFO36E1 only:                  0
  Number of RAMB18E1/FIFO18E1s:                  2 out of     280    1%
    Number using RAMB18E1 only:                  2
    Number using FIFO18E1 only:                  0
  Number of BUFG/BUFGCTRLs:                      9 out of      32   28%
    Number used as BUFGs:                        9
    Number used as BUFGCTRLs:                    0
  Number of IDELAYE2/IDELAYE2_FINEDELAYs:        0 out of     200    0%
  Number of ILOGICE2/ILOGICE3/ISERDESE2s:        0 out of     200    0%
  Number of ODELAYE2/ODELAYE2_FINEDELAYs:        0
  Number of OLOGICE2/OLOGICE3/OSERDESE2s:       16 out of     200    8%
    Number used as OLOGICE2s:                   16
    Number used as OLOGICE3s:                    0
    Number used as OSERDESE2s:                   0
  Number of PHASER_IN/PHASER_IN_PHYs:            0 out of      16    0%
  Number of PHASER_OUT/PHASER_OUT_PHYs:          0 out of      16    0%
  Number of BSCANs:                              1 out of       4   25%
  Number of BUFHCEs:                             0 out of      72    0%
  Number of BUFRs:                               0 out of      16    0%
  Number of CAPTUREs:                            0 out of       1    0%
  Number of DNA_PORTs:                           0 out of       1    0%
  Number of DSP48E1s:                            0 out of     220    0%
  Number of EFUSE_USRs:                          0 out of       1    0%
  Number of FRAME_ECCs:                          0 out of       1    0%
  Number of ICAPs:                               0 out of       2    0%
  Number of IDELAYCTRLs:                         0 out of       4    0%
  Number of IN_FIFOs:                            0 out of      16    0%
  Number of MMCME2_ADVs:                         3 out of       4   75%
  Number of OUT_FIFOs:                           0 out of      16    0%
  Number of PHASER_REFs:                         0 out of       4    0%
  Number of PHY_CONTROLs:                        0 out of       4    0%
  Number of PLLE2_ADVs:                          0 out of       4    0%
  Number of PS7s:                                1 out of       1  100%
  Number of STARTUPs:                            0 out of       1    0%
  Number of XADCs:                               0 out of       1    0%

Average Fanout of Non-Clock Nets:                3.15

Peak Memory Usage:  1349 MB
Total REAL time to MAP completion:  16 mins 
Total CPU time to MAP completion:   15 mins 32 secs


(2013/04/21:追加)
ビットマップ・ディスプレイ・コントローラIPのAXI4 Lite Slave トランザクションを下に示す。正常になった。
AXI4M_and_Lite_Slave_95_130421.png
  1. 2013年04月20日 06:11 |
  2. 複数のAXI4 バスを持つIPの作製
  3. | トラックバック:0
  4. | コメント:0

AXI4 Master IP にAXI4 Lite Slave を追加9(バグフィックス)

このブログ記事のトップは、”AXI4 Master IP にAXI4 Lite Slave を追加1(インプリメント)”
前の記事は、”AXI4 Master IP にAXI4 Lite Slave を追加8(ChipScopeデバッグ)

下に示すのは、前回のブログ記事の最後の図にあるべき姿を書き加えたものだ。
AXI4M_and_Lite_Slave_85_130419.png

つまり、AXI_BVALID が 1 にならないために、AXI_BREADY が 0 になることが出来ない。つまり、AXIバスのトランザクションが終了できないため、デッドロックしてしまった。こうなった原因は、AXI4 Lite Slave バス用のVerilog HDL ファイルのWrite 用ステートマシンにあった。下にそのステートマシンを示す。


    // AXI4 Lite Slave Write Transaction State Machine
    always @(posedge aclk) begin
        if (reset) begin
            wrt_cs <= IDLE_WR;
            awready <= 1'b1;
            bvalid <= 1'b0;
        end else begin
            case (wrt_cs)
                IDLE_WR :
                    if (s_axi_lite_awvalid & ~s_axi_lite_wvalid) begin    // Write Transaction Start
                        wrt_cs <= DATA_WRITE_HOLD;
                        awready <= 1'b0;
                    end else if (s_axi_lite_awvalid & s_axi_lite_wvalid) begin    // Write Transaction Start with data
                        wrt_cs <= BREADY_ASSERT;
                        awready <= 1'b0;
                    end
                DATA_WRITE_HOLD :
                    if (s_axi_lite_wvalid) begin    // Write data just valid
                        wrt_cs <= BREADY_ASSERT;
                        bvalid <= 1'b1;
                    end
                BREADY_ASSERT :
                    if (s_axi_lite_bready) begin    // The write transaction was terminated.
                        wrt_cs <= IDLE_WR;
                        bvalid <= 1'b0;
                        awready <= 1'b1;
                    end
            endcase
        end
    end


IDLE_WRステートの // Write Transaction Start with data のところで、”bvalid <= 1'b1;”を書くのを忘れてしまった。下に修正したステートマシンを示す。


    // AXI4 Lite Slave Write Transaction State Machine
    always @(posedge aclk) begin
        if (reset) begin
            wrt_cs <= IDLE_WR;
            awready <= 1'b1;
            bvalid <= 1'b0;
        end else begin
            case (wrt_cs)
                IDLE_WR :
                    if (s_axi_lite_awvalid & ~s_axi_lite_wvalid) begin    // Write Transaction Start
                        wrt_cs <= DATA_WRITE_HOLD;
                        awready <= 1'b0;
                    end else if (s_axi_lite_awvalid & s_axi_lite_wvalid) begin    // Write Transaction Start with data
                        wrt_cs <= BREADY_ASSERT;
                        awready <= 1'b0;
                        bvalid <= 1'b1;
                    end
                DATA_WRITE_HOLD :
                    if (s_axi_lite_wvalid) begin    // Write data just valid
                        wrt_cs <= BREADY_ASSERT;
                        bvalid <= 1'b1;
                    end
                BREADY_ASSERT :
                    if (s_axi_lite_bready) begin    // The write transaction was terminated.
                        wrt_cs <= IDLE_WR;
                        bvalid <= 1'b0;
                        awready <= 1'b1;
                    end
            endcase
        end
    end


これで、AXI_BVALID が 1 にアサートされて正常に動作するはずだ。(まだ試していないです)
シミュレーションを行った”ビットマップ・ディスプレイ・コントローラIPにAXI4 Lite Slave バスを追加1(シミュレーション)”のシミュレーション波形を見ても、AWVALID とWVALID が同時にアサートされた場合のシミュレーション波形が存在しない。シミュレーションのシナリオが足りなかった。下にシミュレーション波形を示す。
AXI4M_and_Lite_Slave_17_130405.png


次に、Readしたデータ (RDATA) が 0 になっている問題だが、MPDファイルの RDATA の定義が下のように定義してしまっていた。

PORT s_axi_lite_rdata = RDATA, DIR = O, VEC = [3-1:0], BUS = S_AXI_LITE, ENDIAN = LITTLE


バスの幅が間違ってた。そのために、XPSプロジェクトのPortタブで見ると、3ビット幅になってしまっている。
AXI4M_and_Lite_Slave_86_130419.png

これを、下のように修正した。

PORT s_axi_lite_rdata = RDATA, DIR = O, VEC = [C_S_AXI_LITE_DATA_WIDTH-1:0], BUS = S_AXI_LITE, ENDIAN = LITTLE


修正後、Project メニューからRescan User Repositories を実行した。
これで、RDATAのビット幅が正常な値の32ビット幅に戻った。
AXI4M_and_Lite_Slave_87_130419.png

シミュレーションがまだだが、先にインプリメントしてやってみることにする。

次のブログ記事は”AXI4 Master IP にAXI4 Lite Slave を追加10(ハードウェア完成)
  1. 2013年04月19日 05:12 |
  2. 複数のAXI4 バスを持つIPの作製
  3. | トラックバック:0
  4. | コメント:0

AXI4 Master IP にAXI4 Lite Slave を追加8(ChipScopeデバッグ)

このブログ記事のトップは、”AXI4 Master IP にAXI4 Lite Slave を追加1(インプリメント)”
前の記事は、”AXI4 Master IP にAXI4 Lite Slave を追加7(SDKリモートデバッグ)

前回、カメラ・インターフェイスIPとビットマップ・ディスプレイ・コントローラIPのAXI4 Lite Slave バスに接続されたレジスタにRead/Write を行った。Readで読めた値は 0x1A000000 のはずが 0x00000000 だった。Writeで値を書き込むとZedBoardのLinux が死んでしまった。今回は、ChipScope AXI Monitor IP を入れて、AXI4バスに何が怒っているかを検証する。

前回までは、Linuxを使用していたが、WebPACKライセンスなので、Windows7 のISEを使用する。そのためという訳でもないが、Linux のプロジェクトとWindows のプロジェクトを同じ状態に維持してきている。

・XPSを立ちあげて、chipscope axi monitor IP を2つ Add IP した。カメラ・インターフェイスIPのAXI4 Lite Slave に chipscope_axi_monitor_CamC_Slave を接続した。ビットマップ・ディスプレイ・コントローラIPのAXI4 Lite Slave に chipscope_axi_monitor_DispC_Slave を接続した。
AXI4M_and_Lite_Slave_67_130416.png

・Ports タブで、4つにポートを増やしたchipscope_icon_0 の control2 と control3 に、chipscope_axi_monitor_DispC_Slave と chipscope_axi_monitor_CamC_Slave のCONTROL ポートを接続した。
AXI4M_and_Lite_Slave_68_130416.png

・ISEに戻って、インプリメントを行った。インプリメント後に、EDKプロジェクトをクリックして、Expoort Hardware Design to SDK with Bitstream をダブルクリックし、SDKを立ち上げた。

・”AXI4 Master IP にAXI4 Lite Slave を追加6(Cテストプログラム)”の通りに、 AXI_Lite_test_linux プロジェクトとAXI_Lite_test_linux.c を生成した。
AXI4M_and_Lite_Slave_69_130417.png

BOOT.bin を生成して、SDカードに書き込み、ZedBoard に挿入して、電源ON でLinuxを立ち上げた。
AXI4M_and_Lite_Slave_71_130417.png

・起動メッセージのフレームバッファのアドレスを下に示す。

[ 0.960000] fbi->fix.smem_start = 0x19000000


Sysfs を確認した
/sys/devices/axi.0 ディレクトリを ls してみたところ、”46000000.mt9d111-inf-axi-master”と”47000000.bitmap-disp-cntrler-axi-master”が表示されていた。2つのIP の AXI4 Lite Slave インターフェースは、正常に認識されているようだ。
AXI4M_and_Lite_Slave_70_130417.png

・Linuxの起動毎に、フレームバッファのアドレスが変わることがあるので、AXI_Lite_test_linux.c にFB_PHYSICAL_ADDRESS を追加した。FB_PHYSICAL_ADDRESS にフレームバッファのアドレスを定義する。
AXI4M_and_Lite_Slave_72_130417.png

・ISEからChipScope Analyzer を起動した。
AXI4M_and_Lite_Slave_73_130417.png

・このままではポートの情報が無いので、CDCファイルをインポートする。ZedBoard_OOB_Design2\hw\xps_proj\implementation フォルダの chipscope_axi_monitor_dispc_wrapper, chipscope_axi_monitor_camc_wrapper, chipscope_axi_monitor_dispc_slave_wrapper, chipscope_axi_monitor_camc_slave_wrapper フォルダの下に .cdc ファイルがあるので、Importする。下に示すのは、最後の UNIT: 3 の chipscope_axi_monitor_camc_slave.cdc をインポートしているところだ。やり方については、”ZedBoard Linux のフレームバッファにカメラ画像を表示3(ChipScopeで観察3)”を参照のこと。
AXI4M_and_Lite_Slave_74_130417.png

・これで、ポートの情報がChipScope Analyzer に入った。
AXI4M_and_Lite_Slave_75_130417.png

・ビットマップ・ディスプレイ・コントローラIPのAXI4 Lite Slave バスのRead を観察するために、ARVALID = '1' でトリガを掛けた。カメラ・インターフェイスIPのAXI4 Lite Slave バスも同様にRead トランザクションを見るためにトリガを掛けた。
AXI4M_and_Lite_Slave_76_130417.png

・SDKでAXI_Lite_test_linux のDebug Configuration を作成した。”AXI4 Master IP にAXI4 Lite Slave を追加7(SDKリモートデバッグ)”を参照。
AXI4M_and_Lite_Slave_77_130417.png

・前の画面でDebug ボタンをクリックして、SDKのデバックモードに移行した。
AXI4M_and_Lite_Slave_78_130417.png

・カメラ・インターフェイスIPとビットマップ・ディスプレイ・コントローラIPのAXI4 Lite Slave バスに接続されているフレームバッファ・アドレス・レジスタのメモリマップを行ったところだ。
AXI4M_and_Lite_Slave_79_130417.png

・デバックを進めて、カメラ・インターフェイスIPとビットマップ・ディスプレイ・コントローラIPのAXI4 Lite Slave バスに接続されているフレームバッファ・アドレス・レジスタのRead を行った。
下の図に、ビットマップ・ディスプレイ・コントローラIPのAXI4 Lite Slave バスのRead トランザクションを示す。
AXI4M_and_Lite_Slave_80_130417.png

プロトコルに問題は無いが、RDATAが 0x00000000 になってしまっている。

・下の図に、カメラ・インターフェイスIPのAXI4 Lite Slave バスのRead トランザクションを示す。
AXI4M_and_Lite_Slave_81_130417.png

同様にプロトコルに問題は無いが、RDATAが 0x00000000 になってしまっている。

・デバックを進めて、カメラ・インターフェイスIPとビットマップ・ディスプレイ・コントローラIPのAXI4 Lite Slave バスに接続されているフレームバッファ・アドレス・レジスタのWrite を行った。
デバックモードのSDKは、次のブレークポイントまで行かずに、途中で止まってしまった。
AXI4M_and_Lite_Slave_82_130417.png

・下の図に、カメラ・インターフェイスIPのAXI4 Lite Slave バスのWrite トランザクションを示す。次の、ビットマップ・ディスプレイ・コントローラIPのAXI4 Lite Slave バスのWrite トランザクションは波形がキャプチャできずに、画面が真っ白のままだった。
AXI4M_and_Lite_Slave_83_130417.png

この波形を見て、Write トランザクションのバグがわかった。
さて、それでは問題です。このChipScope 波形のどこがまずいでしょうか?正解(たぶん)は明日発表します。

1つWrite トランザクションの画像を追加します。
AXI4M_and_Lite_Slave_84_130417.png

次のブログ記事は、”AXI4 Master IP にAXI4 Lite Slave を追加9(バグフィックス)
  1. 2013年04月18日 05:25 |
  2. 複数のAXI4 バスを持つIPの作製
  3. | トラックバック:0
  4. | コメント:0

AXI4 Master IP にAXI4 Lite Slave を追加7(SDKリモートデバッグ)

このブログ記事のトップは、”AXI4 Master IP にAXI4 Lite Slave を追加1(インプリメント)”
前の記事は、”AXI4 Master IP にAXI4 Lite Slave を追加6(Cテストプログラム)”

前回は、カメラ・インターフェイスIP とビットマップ・ディスプレイ・コントローラIP のAXI4 Lite Slave インターフェースに実装したレジスタのRead/Write を実行をテストするCのプログラムを作成した。
今回は、そのソフトウェアをVirtualBox 上に実装したUbuntu12.10 のSDKからZedBoardのディレクトリへダウンロードして、リモートデバッグを行う。

・SDKのAXI_Lite_test_linux プロジェクトを右クリックして、右クリックメニューからDebug As -> Debug Configurations... を選択した。
AXI4M_and_Lite_Slave_55_130415.png

・Debug Configurations ダイアログが開く。Remote ARM Linux Application の右クリックメニューからNew を選択した。
AXI4M_and_Lite_Slave_56_130415.png

・Properties ダイアログが開いて、AXI_Lite_test_linux Debug が出来た。Connection をすでに登録してあった192.168.3.130 に変更した。
AXI4M_and_Lite_Slave_57_130415.png

・Remote Absolute File Path for C/C++ Application のBrowse... ボタンをクリックした。
AXI4M_and_Lite_Slave_58_130415.png

・Select Remote C/CC+ Application File ダイアログが開く。ここで、Remote (ZedBoard) のディレクトリを指定して、デバックするファイルを作成する。/Apps ディレクトリを展開して、右クリックメニューからNew -> File を選択した。
AXI4M_and_Lite_Slave_59_130415.png

・New File ダイアログでNew file name にAXI_Lite_test_linux.elf と入力して、Finish ボタンをクリックした。
AXI4M_and_Lite_Slave_60_130415.png

・Select Remote C/CC+ Application File ダイアログの /Apps ディレクトリに、AXI_Lite_test_linux.elf が入った。OKボタンをクリックした。
AXI4M_and_Lite_Slave_61_130415.png

・Properties ダイアログに戻った。Remote Absolute File Path for C/C++ Application の項目には、/Apps/AXI_Lite_test_linux.elf が入力されている。Apply ボタンをクリックして、現在の設定を反映させた。
AXI4M_and_Lite_Slave_62_130415.png

・Debug ボタンをクリックした。
AXI4M_and_Lite_Slave_63_130415.png

・Debug persective に切り替えるというダイアログが表示された。Yes ボタンをクリックした。
AXI4M_and_Lite_Slave_64_130415.png

・SDKがデバックモードになって、AXI_lite_test_linux.c の main() の最初の行が表示された。2つのIPのレジスタを読み出し、書き込み、読み出しをしているが、それぞれの先頭部分にブレークポイントを設定した。
AXI4M_and_Lite_Slave_65_130415.png

・Resume アイコンをクリックして、ブレークポイントまでのコードを実行した。これで2つのIPのレジスタを読んでいることになるが、mt9d111_inf_reg_d, bm_disp_cnt_reg_d は、0x1A000000 のはずなのに、0と表示されていた。おかしい?
AXI4M_and_Lite_Slave_66_130415.png

・もう一度、Resume アイコンをクリックして、ブレークポイントまでのコードを実行すると、ブレークポイントまで行かないで止まってしまった。2つのIPのレジスタのWrite でおかしくなるようだ。Linux のターミナルをいじっても応答が無い。Linuxも停止してしまっていた。

AXI Lite Slave のプロトコルがおかしいかもしれないので、ChipScoep を入れて確かめてみることにした。

次のブログ記事は、”AXI4 Master IP にAXI4 Lite Slave を追加8(ChipScopeデバッグ)
  1. 2013年04月16日 04:47 |
  2. 複数のAXI4 バスを持つIPの作製
  3. | トラックバック:0
  4. | コメント:0

AXI4 Master IP にAXI4 Lite Slave を追加6(Cテストプログラム)

このブログ記事のトップは、”AXI4 Master IP にAXI4 Lite Slave を追加1(インプリメント)”
前の記事は、”AXI4 Master IP にAXI4 Lite Slave を追加5(Linuxを起動)

前回は、AXI Lite Slave インターフェースを追加したカメラ・インターフェイスIP とビットマップ・ディスプレイ・コントローラIP を入れたSDカードでLinuxをブートして、Sysfs に2つのIPのエントリがあることを確認した。今回は、SDKを立ちあげ、テストプログラムを作製して、AXI Lite Slave インターフェースの動作を調べる。

Ubuntu12.10 でISE14.4 を使用した。

・xsdk コマンドで、SDKを立ちあげ、File メニュー -> New -> Application Project を選択した。

・Project name に AXI_Lite_test_linux と入力した。Next > ボタンをクリックした。
AXI4M_and_Lite_Slave_50_130413.png

・Templates から、Linux Empty Application を選択し、Finish ボタンをクリックした。
AXI4M_and_Lite_Slave_51_130413.png

・ AXI_Lite_test_linux プロジェクトが生成された。

・ AXI_Lite_test_linux プロジェクトの src ディレクトリで右クリックして、New -> File を選択した。
AXI4M_and_Lite_Slave_52_130413.png

・File naem: にAXI_Lite_test_linux.c と入力した。Finish ボタンをクリックした。
AXI4M_and_Lite_Slave_53_130413.png

・空のAXI_Lite_test_linux.c が生成された。カメラ・インターフェイスIP とビットマップ・ディスプレイ・コントローラIP のレジスタに現在のZedBoard Linuxのフレームバッファの開始アドレスを dmesg から抜き出して設定するCプログラムを記述した。
AXI4M_and_Lite_Slave_54_130413.png

dmesg のフレームバッファの開始アドレスを下に示す。

[ 1.370000] fbi->fix.smem_start = 0x19800000


Cプログラムを下に示す。(”RPi Low-level peripherals”の 以前のvoid setup_io(); のコードを元に変更した)

// AXI_Lite_test_linux.c
//
// AXI Lite Slave interface check program for mt9d111_inf_axi_master IP and bitmap_disp_cntrler_axi_master IP.
//
// 2013/04/13
//

#define MT9D111_INF_BASEADDR            0x46000000
#define BITMAP_DISP_CNTRLER_BASEADDR    0x47000000

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
#include <fcntl.h>
#include <assert.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>

#include <unistd.h>

#define PAGE_SIZE (4*1024)
#define BLOCK_SIZE (4*1024)

// I/O access

volatile unsigned *setup_io(off_t addr);

volatile unsigned *mt9d111_inf_reg;
volatile unsigned *bm_disp_cnt_reg;

int main()
{
    volatile unsigned mt9d111_inf_reg_d, bm_disp_cnt_reg_d;

    mt9d111_inf_reg = setup_io((off_t)MT9D111_INF_BASEADDR);
    bm_disp_cnt_reg = setup_io((off_t)BITMAP_DISP_CNTRLER_BASEADDR);

    mt9d111_inf_reg_d = *mt9d111_inf_reg;
    bm_disp_cnt_reg_d = *bm_disp_cnt_reg;

    *mt9d111_inf_reg = 0x19800000;
    *bm_disp_cnt_reg = 0x19800000;

    mt9d111_inf_reg_d = *mt9d111_inf_reg;
    bm_disp_cnt_reg_d = *bm_disp_cnt_reg;

    return 0;
}

//
// Set up a memory regions to access GPIO
//
volatile unsigned *setup_io(off_t mapped_addr)
// void setup_io()
{
    int  mem_fd;
    char *gpio_mem, *gpio_map;

   /* open /dev/mem */
   if ((mem_fd = open("/dev/mem", O_RDWR|O_SYNC) ) < 0) {
      printf("can't open /dev/mem \n");
      exit (-1);
   }

   /* mmap GPIO */

   // Allocate MAP block
   if ((gpio_mem = malloc(BLOCK_SIZE + (PAGE_SIZE-1))) == NULL) {
      printf("allocation error \n");
      exit (-1);
   }

   // Make sure pointer is on 4K boundary
   if ((unsigned long)gpio_mem % PAGE_SIZE)
     gpio_mem += PAGE_SIZE - ((unsigned long)gpio_mem % PAGE_SIZE);

   // Now map it
   gpio_map = (unsigned char *)mmap(
      (caddr_t)gpio_mem,
      BLOCK_SIZE,
      PROT_READ|PROT_WRITE,
      MAP_SHARED|MAP_FIXED,
      mem_fd,
      mapped_addr
   );

   if ((long)gpio_map < 0) {
      printf("mmap error %d\n", (int)gpio_map);
      exit (-1);
   }

   // Always use volatile pointer!
   // gpio = (volatile unsigned *)gpio_map;
   return((volatile unsigned *)gpio_map);

// setup_io


次のブログ記事は、”AXI4 Master IP にAXI4 Lite Slave を追加7(SDKリモートデバッグ)
  1. 2013年04月15日 05:27 |
  2. 複数のAXI4 バスを持つIPの作製
  3. | トラックバック:0
  4. | コメント:0

AXI4 Master IP にAXI4 Lite Slave を追加5(Linuxを起動)

このブログ記事のトップは、”AXI4 Master IP にAXI4 Lite Slave を追加1(インプリメント)”
前の記事は、”AXI4 Master IP にAXI4 Lite Slave を追加4(FSBLとBOOT.binの生成)

SDカードにdevicetree_ramdisk.dtb と BOOT.bin が書けたので、SDカードをZedBoard に挿入して電源をONしてLinux を起動してみた。
Linuxが立ち上がった。ペンギン2頭を表示するフレームバッファのアドレスは下に示す通りに、0x19000000 にアサインされている。フレームバッファのアサインも問題ない。

[ 0.990000] fbi->fix.smem_start = 0x19000000


ちなみに、この表示部分は、”ZedBoard用Digilent Linuxの解析1(フレームバッファの領域確保)”で自分で、printk() でカーネルを書き換えて表示させた。

次に、Sysfs を確認した。
/sys/devices/axi.0 ディレクトリを ls してみたところ、”46000000.mt9d111-inf-axi-master”と”47000000.bitmap-disp-cntrler-axi-master”が表示されていた。2つのIP の AXI4 Lite Slave インターフェースは、正常に認識されているようだ。
AXI4M_and_Lite_Slave_49_130412.png

ちなみに、2つのIP の AXI4 Lite Slave インターフェースを増やす前の/sys/devices/axi.0 ディレクトリの内容は、”XPSプロジェクトにカスタムAX Slave Lite IPを追加してSysfsを見る”を参照のこと。

次は、2つのIP の AXI4 Lite Slave インターフェースが動作するかどうか?を確かめる。
最後に、ZedBoard Linuxの起動メッセージを下に貼っておく。

U-Boot 2012.04.01-00297-gc319bf9-dirty (Sep 13 2012 - 09:30:49)

DRAM: 512 MiB
WARNING: Caches not enabled
MMC: SDHCI: 0
Using default environment

In: serial
Out: serial
Err: serial
Net: zynq_gem
Hit any key to stop autoboot: 0
Copying Linux from SD to RAM...
Device: SDHCI
Manufacturer ID: 73
OEM: 4247
Name: NCard
Tran Speed: 25000000
Rd Block Len: 512
SD version 1.0
High Capacity: Yes
Capacity: 7.5 GiB
Bus Width: 1-bit
reading zImage

2450208 bytes read
reading devicetree_ramdisk.dtb

6578 bytes read
reading ramdisk8M.image.gz

3699284 bytes read
## Starting application at 0x00008000 ...
Uncompressing Linux... done, booting the kernel.
[ 0.000000] Booting Linux on physical CPU 0
[ 0.000000] Linux version 3.6.0-digilent-13.01 (masaaki@masaaki-VirtualBox) (gcc version 4.6.3 (Sourcery CodeBench Lite 2012.03-79) ) #6 SMP PREEMPT Fri Mar 8 19:52:15 JST 2013
[ 0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine: Xilinx Zynq Platform, model: Xilinx Zynq ZED
[ 0.000000] bootconsole [earlycon0] enabled
[ 0.000000] Memory policy: ECC disabled, Data cache writealloc
[ 0.000000] BUG: mapping for 0xe0001000 at 0xfe001000 out of vmalloc space
[ 0.000000] PERCPU: Embedded 7 pages/cpu @c1408000 s6976 r8192 d13504 u32768
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
[ 0.000000] Kernel command line: console=ttyPS0,115200 root=/dev/ram rw initrd=0x800000,8M earlyprintk rootfstype=ext4 rootwait devtmpfs.mount=0
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 512MB = 512MB total
[ 0.000000] Memory: 506768k/506768k available, 17520k reserved, 0K highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] vmalloc : 0xe0800000 - 0xfd000000 ( 456 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0423984 (4207 kB)
[ 0.000000] .init : 0xc0424000 - 0xc0449b40 ( 151 kB)
[ 0.000000] .data : 0xc044a000 - 0xc04828e0 ( 227 kB)
[ 0.000000] .bss : 0xc0482904 - 0xc04990b0 ( 90 kB)
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] Dump stacks of tasks blocking RCU-preempt GP.
[ 0.000000] RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[ 0.000000] NR_IRQS:512
[ 0.000000] Zynq clock init
[ 0.000000] xlnx,ps7-ttc-1.00.a #0 at 0xe0800000, irq=43
[ 0.000000] ------------[ cut here ]------------
[ 0.000000] WARNING: at arch/arm/kernel/smp_twd.c:389 time_init+0x20/0x30()
[ 0.000000] twd_local_timer_of_register failed (-19)
[ 0.000000] Modules linked in:
[ 0.000000] [] (unwind_backtrace+0x0/0xe0) from [] (warn_slowpath_common+0x4c/0x64)
[ 0.000000] [] (warn_slowpath_common+0x4c/0x64) from [] (warn_slowpath_fmt+0x2c/0x3c)
[ 0.000000] [] (warn_slowpath_fmt+0x2c/0x3c) from [] (time_init+0x20/0x30)
[ 0.000000] [] (time_init+0x20/0x30) from [] (start_kernel+0x1ac/0x2f0)
[ 0.000000] [] (start_kernel+0x1ac/0x2f0) from [<00008044>] (0x8044)
[ 0.000000] ---[ end trace 1b75b31a2719ed1c ]---
[ 0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms
[ 0.000000] Console: colour dummy device 80x30
[ 0.020000] Calibrating delay loop... 1332.01 BogoMIPS (lpj=6660096)
[ 0.110000] pid_max: default: 32768 minimum: 301
[ 0.110000] Mount-cache hash table entries: 512
[ 0.110000] CPU: Testing write buffer coherency: ok
[ 0.120000] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.120000] hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
[ 0.120000] Setting up static identity map for 0x2ed340 - 0x2ed374
[ 0.130000] L310 cache controller enabled
[ 0.130000] l2x0: 8 ways, CACHE_ID 0x410000c8, AUX_CTRL 0x72360000, Cache size: 524288 B
[ 0.200000] Map SLCR registers
[ 0.200000] CPU1: Booted secondary processor
[ 0.290000] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[ 0.290000] Brought up 2 CPUs
[ 0.290000] SMP: Total of 2 processors activated (2664.03 BogoMIPS).
[ 0.300000] devtmpfs: initialized
[ 0.300000] NET: Registered protocol family 16
[ 0.310000] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.320000] xgpiops e000a000.gpio: gpio at 0xe000a000 mapped to 0xe084a000
[ 0.320000] registering platform device 'pl330' id 0
[ 0.330000] registering platform device 'arm-pmu' id 0
[ 0.330000] registering platform device 'zynq-dvfs' id 0
[ 0.340000]
[ 0.340000] ###############################################
[ 0.340000] # #
[ 0.350000] # Board ZED Init #
[ 0.350000] # #
[ 0.360000] ###############################################
[ 0.360000]
[ 0.370000] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[ 0.380000] hw-breakpoint: maximum watchpoint size is 4 bytes.
[ 0.400000] xslcr xslcr.0: at 0xF8000000 mapped to 0xF8000000
[ 0.420000] bio: create slab at 0
[ 0.420000] SCSI subsystem initialized
[ 0.420000] usbcore: registered new interface driver usbfs
[ 0.420000] usbcore: registered new interface driver hub
[ 0.430000] usbcore: registered new device driver usb
[ 0.440000] Advanced Linux Sound Architecture Driver Version 1.0.25.
[ 0.440000] Switching to clocksource xttcpss_timer1
[ 0.460000] Clockevents: could not switch to one-shot mode:
[ 0.460000] Clockevents: could not switch to one-shot mode: dummy_timer is not functional.
[ 0.460000] Could not switch to high resolution mode on CPU 1
[ 0.460000] dummy_timer is not functional.
[ 0.470000] Could not switch to high resolution mode on CPU 0
[ 0.490000] NET: Registered protocol family 2
[ 0.490000] TCP established hash table entries: 16384 (order: 5, 131072 bytes)
[ 0.490000] TCP bind hash table entries: 16384 (order: 5, 131072 bytes)
[ 0.500000] TCP: Hash tables configured (established 16384 bind 16384)
[ 0.510000] TCP: reno registered
[ 0.510000] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.510000] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.520000] NET: Registered protocol family 1
[ 0.530000] Trying to unpack rootfs image as initramfs...
[ 0.530000] rootfs image is not initramfs (no cpio magic); looks like an initrd
[ 0.570000] Freeing initrd memory: 8192K
[ 0.570000] pl330 dev 0 probe success
[ 0.580000] msgmni has been set to 1005
[ 0.580000] io scheduler noop registered
[ 0.580000] io scheduler deadline registered
[ 0.590000] io scheduler cfq registered (default)
[ 0.590000] xuartps e0001000.uart: failed to get alias id, errno -19
[ 0.600000] e00rイconsole [ttyPS0] enabled, bootconsole disabled
[ 0.600000] console [ttyPS0] enabled, bootconsole disabled
[ 0.610000] xdevcfg f8007000.devcfg: ioremap f8007000 to e0852000 with size 1000
[ 0.620000] [drm] Initialized drm 1.1.0 20060810
[ 0.640000] brd: module loaded
[ 0.650000] loop: module loaded
[ 0.650000] xqspips e000d000.qspi: master is unqueued, this is deprecated
[ 0.660000] xqspips e000d000.qspi: at 0xE000D000 mapped to 0xE0854000, irq=51
[ 0.670000] libphy: XEMACPS mii bus: probed
[ 0.670000] xemacps e000b000.eth: Could not find MAC address in device tree, use default
[ 0.680000] xemacps e000b000.eth: pdev->id -1, baseaddr 0xe000b000, irq 54
[ 0.690000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.690000] xusbps-ehci xusbps-ehci.0: Xilinx PS USB EHCI Host Controller
[ 0.700000] xusbps-ehci xusbps-ehci.0: new USB bus registered, assigned bus number 1
[ 0.740000] xusbps-ehci xusbps-ehci.0: irq 53, io mem 0x00000000
[ 0.760000] xusbps-ehci xusbps-ehci.0: USB 2.0 started, EHCI 1.00
[ 0.760000] hub 1-0:1.0: USB hub found
[ 0.770000] hub 1-0:1.0: 1 port detected
[ 0.770000] Initializing USB Mass Storage driver...
[ 0.770000] usbcore: registered new interface driver usb-storage
[ 0.780000] USB Mass Storage support registered.
[ 0.790000] mousedev: PS/2 mouse device common for all mice
[ 0.790000] xwdtps f8005000.swdt: Xilinx Watchdog Timer at 0xe085c000 with timeout 10s
[ 0.800000] sdhci: Secure Digital Host Controller Interface driver
[ 0.810000] sdhci: Copyright(c) Pierre Ossman
[ 0.810000] sdhci-pltfm: SDHCI platform and OF driver helper
[ 0.820000] mmc0: Invalid maximum block size, assuming 512 bytes
[ 0.870000] mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA
[ 0.880000] usbcore: registered new interface driver usbhid
[ 0.880000] usbhid: USB HID core driver
[ 0.900000] adv7511-hdmi-snd adv7511_hdmi_snd.2: CODEC adv7511.2-0039 not registered
[ 0.900000] platform adv7511_hdmi_snd.2: Driver adv7511-hdmi-snd requests probe deferral
[ 0.910000] TCP: cubic registered
[ 0.920000] NET: Registered protocol family 17
[ 0.920000] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[ 0.930000] Registering SWP/SWPB emulation handler
[ 0.930000] registered taskstats version 1
[ 0.940000] adv7511-hdmi-snd adv7511_hdmi_snd.2: CODEC adv7511.2-0039 not registered
[ 0.950000] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
[ 0.950000] platform adv7511_hdmi_snd.2: Driver adv7511-hdmi-snd requests probe deferral
[ 0.960000] ALSA device list:
[ 0.960000] No soundcards found.
[ 0.970000] new mode: 1920x1080 2200x1125 148500
[ 0.970000] new mode: 720x480 858x525 27000
[ 0.970000] new mode: 1280x720 1650x750 74250
[ 0.970000] new mode: 720x576 864x625 27000
[ 0.970000] new mode: 1680x1050 1840x1080 119000
[ 0.970000] new mode: 1280x1024 1728x1067 132840
[ 0.970000] new mode: 1280x1024 1728x1066 128946
[ 0.970000] new mode: 1280x1024 1688x1066 108000
[ 0.970000] new mode: 1280x960 1800x1000 108000
[ 0.970000] new mode: 1280x800 1440x823 71000
[ 0.970000] new mode: 800x600 1056x628 40000
[ 0.970000] new mode: 800x600 1024x625 36000
[ 0.970000] new mode: 640x480 840x500 31500
[ 0.970000] new mode: 640x480 832x520 31500
[ 0.970000] new mode: 640x480 864x525 30240
[ 0.970000] new mode: 640x480 800x525 25200
[ 0.970000] new mode: 720x400 900x449 28320
[ 0.970000] new mode: 1280x1024 1688x1066 135000
[ 0.970000] new mode: 1024x768 1312x800 78800
[ 0.970000] new mode: 1024x768 1328x806 75000
[ 0.970000] new mode: 1024x768 1344x806 65000
[ 0.970000] new mode: 832x624 1152x667 57284
[ 0.970000] new mode: 800x600 1056x625 49500
[ 0.970000] new mode: 800x600 1040x666 50000
[ 0.970000] new mode: 848x480 1088x517 33750
[ 0.970000] new mode: 1152x864 1600x900 108000
[ 0.970000] new mode: 1280x768 1440x790 68250
[ 0.970000] new mode: 1280x768 1696x805 102250
[ 0.970000] new mode: 1280x800 1696x838 106500
[ 0.970000] new mode: 1360x768 1792x795 85500
[ 0.970000] new mode: 1400x1050 1560x1080 101000
[ 0.970000] new mode: 1400x1050 1896x1099 156000
[ 0.970000] new mode: 1440x900 1600x926 88750
[ 0.970000] new mode: 1440x900 1936x942 136750
[ 0.970000] new mode: 1024x576 1312x597 46970
[ 0.970000] new mode: 1366x768 1800x795 85885
[ 0.970000] new mode: 1600x900 2128x932 118963
[ 0.970000] new mode: 1680x945 2240x978 131481
[ 0.970000] new mode: 640x480 800x525 25175
[ 0.970000] new mode: 720x480 858x525 27000
[ 0.970000] new mode: 720x480 858x525 27000
[ 0.970000] new mode: 1280x720 1650x750 74250
[ 0.970000] new mode: 1920x1080 2200x1125 74250
[ 0.970000] new mode: 1920x1080 2200x1125 148500
[ 0.970000] new mode: 720x576 864x625 27000
[ 0.970000] new mode: 720x576 864x625 27000
[ 0.970000] new mode: 1280x720 1980x750 74250
[ 0.970000] new mode: 1920x1080 2640x1125 74250
[ 0.970000] new mode: 1440x576 1728x625 54000
[ 0.970000] new mode: 1920x1080 2640x1125 148500
[ 0.970000] new mode: 1920x1080 2200x1125 148500
[ 0.970000] new mode: 720x480 858x525 27000
[ 0.970000] new mode: 1280x720 1650x750 74250
[ 0.970000] new mode: 720x576 864x625 27000
[ 0.970000] new mode: 800x600 1056x628 40000
[ 0.970000] new mode: 800x600 1024x625 36000
[ 0.970000] new mode: 640x480 840x500 31500
[ 0.970000] new mode: 640x480 832x520 31500
[ 0.970000] new mode: 640x480 864x525 30240
[ 0.970000] new mode: 640x480 800x525 25200
[ 0.970000] new mode: 720x400 900x449 28320
[ 0.970000] new mode: 1280x1024 1688x1066 135000
[ 0.970000] new mode: 1024x768 1312x800 78800
[ 0.970000] new mode: 1024x768 1328x806 75000
[ 0.970000] new mode: 1024x768 1344x806 65000
[ 0.970000] new mode: 832x624 1152x667 57284
[ 0.970000] new mode: 800x600 1056x625 49500
[ 0.970000] new mode: 800x600 1040x666 50000
[ 0.970000] new mode: 640x480 800x525 25175
[ 0.970000] new mode: 720x480 858x525 27000
[ 0.970000] new mode: 720x480 858x525 27000
[ 0.970000] new mode: 1280x720 1650x750 74250
[ 0.970000] new mode: 1920x1080 2200x1125 74250
[ 0.970000] new mode: 1920x1080 2200x1125 148500
[ 0.970000] new mode: 720x576 864x625 27000
[ 0.970000] new mode: 720x576 864x625 27000
[ 0.970000] new mode: 1280x720 1980x750 74250
[ 0.970000] new mode: 1920x1080 2640x1125 74250
[ 0.970000] new mode: 1440x576 1728x625 54000
[ 0.970000] new mode: 1920x1080 2640x1125 148500
[ 0.980000] mmc0: new high speed SDHC card at address b368
[ 0.990000] fbi->screen_base = 0xe08d1000
[ 0.990000] fbi->fix.smem_start = 0x19000000
[ 0.990000] fbi->screen_size = 0x7e9000
[ 0.990000] mmcblk0: mmc0:b368 NCard 7.48 GiB
[ 0.990000] mmcblk0: p1
[ 1.000000] adv7511-hdmi-snd adv7511_hdmi_snd.2: CODEC adv7511.2-0039 not registered
[ 1.000000] platform adv7511_hdmi_snd.2: Driver adv7511-hdmi-snd requests probe deferral
[ 1.360000] RAMDISK: gzip image found at block 0
[ 1.360000] setting clock to: 148500
[ 1.360000] raw_edid: d8c03c80 7
[ 1.360000] Using YCbCr output
[ 1.400000] Console: switching to colour frame buffer device 240x67
[ 1.450000] fb0: frame buffer device
[ 1.450000] drm: registered panic notifier
[ 1.460000] [drm] Initialized analog_drm 1.0.0 20110530 on minor 0
[ 1.670000] EXT4-fs (ram0): warning: mounting unchecked fs, running e2fsck is recommended
[ 1.680000] EXT4-fs (ram0): mounted filesystem without journal. Opts: (null)
[ 1.690000] VFS: Mounted root (ext4 filesystem) on device 1:0.
[ 1.690000] Freeing init memory: 148K
Starting rcS...
++ Mounting filesystem
++ Setting up mdev
++ Configure static IP 192.168.3.130
++ Starting telnet daemon
++ Starting http daemon
++ Starting ftp daemon
++ Starting dropbear (ssh) daemon
++ Starting OLED Display
insmod: can't read '/lib/modules/3.6.0-digilent-13.01/pmodoled-gpio.ko': No such file or directory
++ Exporting LEDs & SWs
rcS Complete
zynq> [ 4.930000] xemacps e000b000.eth: Set clk to 24999999 Hz
[ 4.930000] xemacps e000b000.eth: link up (100/FULL)


次のブログ記事は、”AXI4 Master IP にAXI4 Lite Slave を追加6(Cテストプログラム)
  1. 2013年04月13日 04:27 |
  2. 複数のAXI4 バスを持つIPの作製
  3. | トラックバック:0
  4. | コメント:0

AXI4 Master IP にAXI4 Lite Slave を追加4(FSBLとBOOT.binの生成)

このブログ記事のトップは、”AXI4 Master IP にAXI4 Lite Slave を追加1(インプリメント)”
前の記事は、”AXI4 Master IP にAXI4 Lite Slave を追加3(DTSをコンパイル)

前回は、devicetree_ramdisk.dtb ファイルを生成した。今回は、FSBL (First Stage Bootloader) と BOOT.bin を生成する。
FSBLに関しては、簡単な説明が”カメラの表示回路及びソフトウェアをSDカードからブートする”にあるので、参照のこと。
BOOT.bin はブートイメージのことで、Linuxの起動の場合は、bootgenで作られたU-BootイメージとFSBL(first stage boot loader)を含み、FPGAをコンフィグレーションするビットストリームも入れる事ができる。

まずは、FSBLを生成する。

・SDKでFile メニュー -> New -> Application Project を選択した。
AXI4M_and_Lite_Slave_37_130411.png

・Project name: をFSBL に設定し、Board Support Package のラジオボタンをUse existing にした。Next > ボタンをクリックした。
AXI4M_and_Lite_Slave_38_130411.png

・Templates からZynq FSBL を選択し、Finish ボタンをクリックした。
AXI4M_and_Lite_Slave_39_130411.png

・FSBL プロジェクトが生成された。
AXI4M_and_Lite_Slave_40_130411.png

次に、BOOT.bin を生成する。

・SDK のXilinx Tools -> Creat Zynq Boot Image を選択した。
AXI4M_and_Lite_Slave_41_130411.png

・Create Zynq Boot Image ダイアログが立ち上がった。Add ボタンをクリックした。
AXI4M_and_Lite_Slave_42_130412.png

・u-boot.elf を選択した。
AXI4M_and_Lite_Slave_43_130412.png

・u-boot.elf が、Fileリストの最後に入った。すでに、FSBL.elf と system.bit は入っているので、Create Image ボタンをクリックした。
AXI4M_and_Lite_Slave_44_130412.png

・FSBL -> bootimage に、u-boot.bin が生成された。
AXI4M_and_Lite_Slave_45_130412.png

・ZedBoard_OOB_Design/hw/xps_proj/SDK/SDK_Export/FSBL/bootimage に u-boot.bin が生成されている。
AXI4M_and_Lite_Slave_46_130412.png

・この u-boot.bin をSDカードにコピーした。
AXI4M_and_Lite_Slave_47_130412.png

・u-boot.bin を BOOT.bin にリネームした。
AXI4M_and_Lite_Slave_48_130412.png

これで、SDカードの準備は終了した。後は、ZedBoard に挿入して、Linuxを起動してみる。

次のブログ記事は、”AXI4 Master IP にAXI4 Lite Slave を追加5(Linuxを起動)
  1. 2013年04月12日 05:12 |
  2. 複数のAXI4 バスを持つIPの作製
  3. | トラックバック:0
  4. | コメント:0
»