X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=doc%2FREADME.nios;h=671e7277fa93cfc015ff0bb9de62ed5be980d260;hb=27f33e9f45ef7f9685cbdc65066a1828e85dde4f;hp=8765df73918b299a658623df992cfd63a29f8ffc;hpb=c935d3bd8b1c7f681ad58e64bd0548e1b26a7d2f;p=u-boot diff --git a/doc/README.nios b/doc/README.nios index 8765df7391..671e7277fa 100644 --- a/doc/README.nios +++ b/doc/README.nios @@ -1,7 +1,7 @@ U-Boot for Nios-32 - Last Update: November 30, 2003 + Last Update: February 1, 2004 ==================================================================== This file contains information regarding U-Boot and the Altera @@ -31,7 +31,7 @@ For those interested in contributing ... see HELP WANTED below. U-Boot has been successfully tested on the Nios Cyclone development board using both the 'safe' and 'standard 32' configurations with -Nios CPU revision 3.08 (CPU_ID = 0x3008). U-Boot can be used with +Nios CPU revision 3.1 (CPU_ID = 0x3018). U-Boot can be used with or without the GERMS monitor. The initial version of U-Boot for the Cyclone development kit is about 60 Kbyte and will fit in a single sector of on-board FLASH. Only the Nios 32-bit CPU is supported. @@ -55,8 +55,11 @@ sources (when altera silicon is not involved). This isn't really a problem as little, if any, of the Altera source contains features that are not already available in U-Boot. -The Nios port also does not use the long-winded peripheral -structure definitions from the Nios SDK. +1.3 Debugging via OCI +--------------------- +The Nios port supports debugging with gdb and/or nios-console +via the JTAG port. Stubs for debugging with gdb via the serial +port are not currently implemented. 2. CONFIGURATION OPTIONS/SETTINGS @@ -82,7 +85,11 @@ description). CONFIG_NIOS -- defined for all Nios-32 boards. -CFG_NIOS_CONSOLE -- the base address of the console UART. +CFG_NIOS_CONSOLE -- the base address of the console UART or the JTAG + stdio port. To enable a console via JTAG, define + CONFIG_CONSOLE_JTAG and set CGF_NIOS_CONSOLE to the base address + of the JTAG stdio port (normally OCI base + 0x00fa). Then + run nios-console with the -w option. (standard-32: nasys_uart_0 resp. na_uart1_base). CFG_NIOS_FIXEDBAUD -- defined if the console UART PTF fixed_baud @@ -103,6 +110,19 @@ CFG_NIOS_TMRIRQ -- the interrupt request (vector number) assigned to CFG_NIOS_TMRMS -- the period of the timer in milliseconds. +CFG_NIOS_TMRCNT -- the preloadable counter value for the timer if it has + no fixed period. + +CFG_NIOS_ASMIBASE -- the base address of the ASMI peripheral. + (standard-32: na_asmi_base). + +CFG_NIOS_SPIBASE -- the base address of the SPI master (!) peripheral. + (nasys_spi_0) + +CFG_NIOS_SPIBITS -- the amount of configured SPI data bits in PTF. + This value can be 8 or 16 only! (PTF: databits) + + 2.2 Differences in U-Boot Options/Settings ------------------------------------------- Some 'standard' U-Boot options/settings are treated differently in @@ -166,20 +186,109 @@ GERMS monitor (that is, avoid running code stored in flash memory): 3. Release CFG_NIOS_CPU_BUTTON_PIO, button number 0. -5. BRAIN DAMAGE +5. DEBUGGING WITH GDB +--------------------- + +Debug sessions using gdb are currently supported only via JTAG. The +stubs for debugging via a serial port are not implemented. To enable +the gdb JTAG stubs, simply reference _brkpt_hw_int and _brkpt_sw_int +at vector table offsets 3 and 4, respectively. For an example, see +board/altera/dk1c20/vectors.S. + +5.1 Vector Table Initialization and ROM Stubs +--------------------------------------------- +If CONFIG_ROM_STUBS is defined, the debug breakpoint and single step +entries in the vector table are restored to their initial values +immediately _after_ initializing the vector table. Defining this macro +is useful when ROM-based stubs are implemented. + +NOTE: The default GERMS monitor does NOT implement gdb stubs, nor does +it initialize the vector table. Therefore, when debugging U-Boot, you +should NOT set a software breakpoint prior to vector table initialization. + +5.2 Starting a Debug Session +---------------------------- +If you're not familiar with gdb, you follow these step-by-step instructions. +These instructions are NOT the only way to start a debug session, but they +cover most of the individual functions to get you started. + + 1. Start the JTAG gdb server. Open a Nios shell window and start + the server. When the server is started you must provide the base + address of the OCI core. For example, when using the Cyclone + development kit (DK1C20): + + $ nios-gdb-server --ocibase=0x00920800 --tcpport=2342 + + 2. Start gdb. Open a Nios shell window, change to the top-level + U-Boot directory and start gdb, specifying the u-boot elf file: + + $ nios-elf-gdb u-boot + + 3. Update target settings. From the file menu, select + "Target Settings ..." and select the following, then click 'Ok': + + Target: Remote/TCP + Port : 2342 (same as in step 1) + Display download dialog: checked + All other check boxes: unchecked + + 4. Connect to the target. Select menu: 'Run->Connect to target'. + You should see a dialog box indicating the you successfully connected + to the target. + + 5. Download U-Boot. Select menu: 'Run->Download'. + + 6. Open a gdb console window and set the source directory paths. + Select menu: 'View->Console'. In the console window, enter the + following commands, then close the console window: + + (gdb) directory common + (gdb) directory cpu/nios + (gdb) directory lib_nios + (gdb) directory board/altera/dk1c20 + + Note that the last command is for the DK1C20 board only. If you + are using another board, specify that board's directory. + + 7. Open the file board.c (using the file menu in the lower + left hand corner). Scroll to the board_init() routine and set + a breakpoint. + + 8. Run U-Boot. Just click on the run icon, or select menu: + 'Run->Run'. U-Boot should start running, then break at your + breakpoint. + + 9. Have fun & start learning more about gdb. + + +5.3 For advanced Users +---------------------- +A few notes for those more familiar with gdb. + + -Serial port stubs are not implemented. Sorry, but it's just not + worth _my_ effort. The JTAG stubs work great and are ridiculously + simple to implement. + + -If you need to debug the early startup code (prior to the vector + table initialization), use the nios-console debugger. + + - Connect, download & run -- there are some problems here. Connect + download and run seperately to avoid trouble. + +6. BRAIN DAMAGE ---------------- This section describes some of the unfortunate and avoidable aspects of working with the Nios CPU ... and some things you can do to reduce your pain. -5.1 GERMS doesn't work with Hyperterminal +6.1 GERMS doesn't work with Hyperterminal ------------------------------------------ GERMS doesn't do CR/LF mapping that is compatible with Hyperterminal (or minicom) -- geez. Regardless of you opion of Hyperterminal, this sad design decision is remedied by using U-Boot. -5.2 cygwin Incompatibility +6.2 cygwin Incompatibility --------------------------- The version of cygwin distributed with the nios GNUPro toolchain is out-of-date and incompatible with the latest cygwin distributions. @@ -192,7 +301,7 @@ topic). The solution ... well, you can wait for Altera ... or build as set of tools for linux. -5.3 No native gcc +6.3 No native gcc ------------------ I'm not sure how this one slipped through the cracks ... but it is a real pain. Basically, if you want to build anything for the native @@ -205,7 +314,7 @@ distro. Anybody who wants to use an already precompiled NIOS cross toolchain can it found in the CDK4NIOS project hosted by Source Forge at http://cdk4nios.sourceforge.net. -5.4 Can't build default U-Boot +6.4 Can't build default U-Boot ------------------------------- By default, when you build U-Boot you will be building some native tools along with the target elf, bin, and srec files. Without a @@ -222,15 +331,16 @@ environment.o: environment.c ../tools/envcrc -c -o $@ environment.c With: -environment.o: environment.c ../tools/envcrc +environment.o: environment.c $(CC) $(AFLAGS) -Wa,--no-warn \ -DENV_CRC=0 \ -c -o $@ environment.c -BTW, thats a 'zero' ... not the letter 'O'. +BTW, thats a 'zero' ... not the letter 'O'. And not that the +"../tools/envcrc" dependency is removed. -6. HELP WANTED +7. HELP WANTED --------------- There are plenty of areas where help is needed. Here's are some ideas @@ -238,8 +348,6 @@ for those interested in contributing: -CompactFlash. Port & test CF/FAT. --ASMI support. Use ASMI for environment, etc. - -Bedbug. Develop bedbug for Nios ... or at least provide a disassemble command.