MIPSfpgaおよびAltera FPGAでLinuxを上げる

KDPV







MIPSfpga用にImagination Technologiesが提供するドキュメントは非常に優れており、Linuxの展開について詳しく説明しています。 ただし、これで使用されるチップで使用されるシステムは、ザイリンクス固有の周辺モジュールを使用して構築されます。 したがって、元の形式のアルテラFPGAを使用したデバッグボードでの繰り返しは不可能と思われます。 このソリューションは、プラットフォームに依存しない周辺機器を備えたMIPSfpga-plusチップシステムです。 この記事でLinuxを実行する方法について読んでください。







はじめに



すぐに、以下で説明するアクションの結果として得られた構成が理想からはほど遠いことに注意してください。 現時点では、外部メディアからのブートはなく、サポートされているデバイスの中で言及できるのはUARTとGPIOのみです。 したがって、MIPSfpga-plusシステムの開発に関するさらなる研究の前線は非常に広いようです。

さらに、読者は次のことを前提としています。









この場合、次の構成が使用されます。









Linuxカーネルの魔法を真剣に深く掘り下げるつもりなら、資料[ L7 ]、特にプレゼンテーション[ L8 ]および[ L9 ]を読むことを強くお勧めします。

上記の要件がすべて満たされたら、始めましょう!







FPGAの構成とプログラミング





カーネルお​​よびRAMディスクアセンブリ



Linuxマシンでさらにステップを実行することを想定しています。









RAMディスク設定









カーネルをメモリにロードして起動する





ブートログ
 Linux version 4.12.1+ (stas@ubuntu) (gcc version 4.9.2 (Codescape GNU Tools 2016.05-06 for MIPS MTI Linux) ) #1 Sat Jul 22 14:35:05 MSK 2017 CPU0 revision is: 00019e60 (MIPS M14KEc) MIPS: machine is terasic,de10lite Determined physical RAM map: memory: 04000000 @ 00000000 (usable) Initrd not found or empty - disabling initrd Primary instruction cache 4kB, VIPT, 2-way, linesize 16 bytes. Primary data cache 4kB, 2-way, VIPT, no aliases, linesize 16 bytes Zone ranges: Normal [mem 0x0000000000000000-0x0000000003ffffff] Movable zone start for each node Early memory node ranges node 0: [mem 0x0000000000000000-0x0000000003ffffff] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256 Kernel command line: console=ttyS0,115200 PID hash table entries: 256 (order: -2, 1024 bytes) Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) Memory: 60512K/65536K available (1830K kernel code, 99K rwdata, 320K rodata, 944K init, 185K bss, 5024K reserved, 0K cma-reserved) NR_IRQS:8 clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 38225208935 ns sched_clock: 32 bits at 50MHz, resolution 20ns, wraps every 42949672950ns Console: colour dummy device 80x25 Calibrating delay loop... 10.81 BogoMIPS (lpj=21632) pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) devtmpfs: initialized clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns futex hash table entries: 256 (order: -1, 3072 bytes) clocksource: Switched to clocksource MIPS random: fast init done workingset: timestamp_bits=30 max_order=14 bucket_order=0 Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled console [ttyS0] disabled b0400000.serial: ttyS0 at MMIO 0xb0401000 (irq = 0, base_baud = 3125000) is a 16550A console [ttyS0] enabled Freeing unused kernel memory: 944K This architecture does not have kernel memory protection. mount: mounting devpts on /dev/pts failed: No such device mount: mounting tmpfs on /dev/shm failed: Invalid argument mount: mounting tmpfs on /tmp failed: Invalid argument mount: mounting tmpfs on /run failed: Invalid argument Starting logging: OK Initializing random number generator... done. Starting network: ip: socket: Function not implemented ip: socket: Function not implemented FAIL Welcome to MIPSfpga mipsfpga login:
      
      





GPIOを使用する



Linuxの機能を使用して、使用可能な周辺機器を管理します(この記事の執筆時点では、これはGPIOですが、完全ではありません)。









次は何ですか



説明されている構成は、実際には、LinuxをMIPSfpga-plusシステムに移植する最初の段階にすぎません。 システムを実際のタスクに正常に使用できるようにするために必要な作業には、次のものがあります。









謝辞



著者は、教科書のデビッド・ハリスとサラ・ハリスの「デジタル回路とコンピューター・アーキテクチャー」[ L1 ]の翻訳者チームに感謝します。







参照資料



[L1]- デジタル回路とコンピューターアーキテクチャ

[L2] -MIPSfpgaの使用を開始する方法

[L3] -githubのMIPSfpga-plusプロジェクト

[L4] -MIPSfpgaおよびインサーキットデバッグ

[L5] -MIPSfpgaおよびSDRAM。 パート1

[L6] -MIPSfpgaおよびUART ;

[L7]- 自由電子。 無料のトレーニング資料と会議プレゼンテーション

[L8]- 自由電子。 組み込みLinuxシステム開発コース

[L9]- 自由電子。 Linuxカーネルお​​よびドライバー開発コース

[L10] -MIPSfpga-plusでの展開に必要なbuildrootおよびLinux用のパッチ








All Articles