Blame view

doc/README.nios2 3.1 KB
485e2d8ed   Thomas Chou   nios2: add README...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  Nios II is a 32-bit embedded-processor architecture designed
  specifically for the Altera family of FPGAs.
  
  Please refer to the link for more information on Nios II,
  https://www.altera.com/products/processors/overview.html
  
  Please refer to the link for Linux port and toolchains,
  http://rocketboards.org/foswiki/view/Documentation/NiosIILinuxUserManual
  
  The Nios II port of u-boot is controlled by device tree. Please check
  out doc/README.fdt-control.
  
  To add a new board/configuration (eg, mysystem) to u-boot, you will need
  three files.
  
  1. The device tree source which describes the hardware, dts file.
      arch/nios2/dts/mysystem.dts
  
  2. Default configuration of Kconfig, defconfig file.
      configs/mysystem_defconfig
  
  3. The legacy board header file.
      include/configs/mysystem.h
  
  The device tree source must be generated from your qsys/sopc design
  using the sopc2dts tool. Then modified to fit your configuration. Please
  find the sopc2dts download and usage at the wiki,
  http://www.alterawiki.com/wiki/Sopc2dts
  
  $ java -jar sopc2dts.jar --force-altr -i mysystem.sopcinfo -o mysystem.dts
  
  You will need to add additional properties to the dts. Please find an
9f301294d   Thomas Chou   nios2: change REA...
33
  example at, arch/nios2/dts/10m50_devboard.dts.
485e2d8ed   Thomas Chou   nios2: add README...
34
35
36
37
  
  1. Add "stdout-path=..." property with your serial path to the chosen
  node, like this,
  	chosen {
9f301294d   Thomas Chou   nios2: change REA...
38
  		stdout-path = &uart_0;
485e2d8ed   Thomas Chou   nios2: add README...
39
40
41
42
43
44
45
46
47
  	};
  
  2. If you use SPI/EPCS or I2C, you will need to add aliases to number
  the sequence of these devices, like this,
  	aliases {
  		spi0 = &epcs_controller;
  	};
  
  Next, you will need a default config file. You may start with
9f301294d   Thomas Chou   nios2: change REA...
48
  10m50_defconfig, modify the options and save it.
485e2d8ed   Thomas Chou   nios2: add README...
49

9f301294d   Thomas Chou   nios2: change REA...
50
  $ make 10m50_defconfig
485e2d8ed   Thomas Chou   nios2: add README...
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
  $ make menuconfig
  $ make savedefconfig
  $ cp defconfig configs/mysystem_defconfig
  
  You will need to change the names of board header file and device tree,
  and select the drivers with menuconfig.
  
  Nios II architecture  --->
    (mysystem) Board header file
  Device Tree Control  --->
    (mysystem) Default Device Tree for DT control
  
  There is a selection of "Provider of DTB for DT control" in the Device
  Tree Control menu.
  
  ( ) Separate DTB for DT control, will cat the dtb to end of u-boot
  binary, output u-boot-dtb.bin. This should be used for production.
  If you use boot copier, like EPCS boot copier, make sure the copier
  copies all the u-boot-dtb.bin, not just u-boot.bin.
  
  ( ) Embedded DTB for DT control, will include the dtb inside the u-boot
  binary. This is handy for development, eg, using gdb or nios2-download.
  
  The last thing, legacy board header file describes those config options
9f301294d   Thomas Chou   nios2: change REA...
75
  not covered in Kconfig yet. You may copy it from 10m50_devboard.h.
485e2d8ed   Thomas Chou   nios2: add README...
76

9f301294d   Thomas Chou   nios2: change REA...
77
  $ cp include/configs/10m50_devboard.h include/configs/mysystem.h
485e2d8ed   Thomas Chou   nios2: add README...
78
79
80
81
  
  Please change the SDRAM base and size to match your board. The base
  should be cached virtual address, for Nios II with MMU it is 0xCxxx_xxxx
  to 0xDxxx_xxxx.
9f301294d   Thomas Chou   nios2: change REA...
82
  #define CONFIG_SYS_SDRAM_BASE		0xc8000000
485e2d8ed   Thomas Chou   nios2: add README...
83
84
85
86
87
88
89
90
91
92
93
94
  #define CONFIG_SYS_SDRAM_SIZE		0x08000000
  
  You will need to change the environment variables location and setting,
  too. You may change other configs to fit your board.
  
  After all these changes, you may build and test.
  
  $ export CROSS_COMPILE=nios2-elf-  (or nios2-linux-gnu-)
  $ make mysystem_defconfig
  $ make
  
  Enjoy!