日期:2014-05-16  浏览次数:20700 次

OpenRisc-4-ORSoC跑linux实验

引言

光说不练假把式,本小节就用官方的FPGA开发板跑一下linux。

 

4.1,  实验准备

1》  orsoc的工具链环境(gcc,gdbjtag),搭建过程见上一篇blog:

http://blog.csdn.net/rill_zhen/article/details/8443882

2》  ep4ce22FPGA开发板(€:149)

3》  micro-USB连接线

 

4.2,  实验步骤

0》连线。将板子左上方的那个USB口与PC相连。

1》  烧写RTL综合后的电路逻辑文件(也可自己用quartus综合)

$ cd /home/openrisc

$ jtag ./program_fpga.jtag

2》开启gdbdebuggerOR processor间的代理服务

$ /opt/or_debug_proxy/bin/or_debug_proxy –r 55555

3》  (再开一个终端)打开一个串口终端

picocom –b 115200–p n –d 8 –f xon /dev/ttyUSB2

4》  (再开一个终端)开启gdb来下载vmlinux镜像

$ cd ~/soc-design/linux

$ make ARCH=openrisc defconfig

$ make ARCH=openrisc

$ or32-elf-gdb

(gdb) target remote :55555

(gdb) file ./vmlinux

Answer ‘y’

(gdb) load

(gdb) spr npc 0x100

(gdb) c

5》此时,看picocom那个终端,可以看到linux的启动过程:如下图:

6》此时链接网线,设置网卡(eth8)参数,就可以和PC通过网络通信了。

 

 

 

4.3 参考文档

Running_SW_on_FPGA_board.txt:

 

 

===========================================================
Running Software on Hardware
===========================================================

This FPGA development board has been developed specifically 
to fit a OpenRISC processor design, with the smallest form-factor 
and lowest cost.

The board is called: ordb2a-ep4ce22 (OpenRisc Development Board 2A)

More detailed information can be found at