Community
cancel
Showing results for 
Search instead for 
Did you mean: 

U-Boot and Cyclone II-DE2 boards

U-Boot and Cyclone II-DE2 boards



U-Boot is a versatile boot loader that can be used to boot any program. Nevertheless it has not too much support for nios2 processors. It has just a few boards and they are very olds. There are many modifications to do in order to have a fully functional system in DE2 boards, also known as Cyclone II which is the FPGA model (EP2C35) installed on the board.

Contents

 [hide

Ethernet controller DM9000A

U-boot has support for the Ethernet controller DM9000A. It is necessary to add to configuration file the followings lines:

#define CONFIG_DRIVER_DM9000 1

#define CONFIG_DM9000_BASE 0x80900090

#define DM9000_IO CONFIG_DM9000_BASE

#define DM9000_DATA (CONFIG_DM9000_BASE + 4)

#define CONFIG_ETHADDR 08:00:3e:26:0a:5b

#define CONFIG_NETMASK 255.255.255.0

#define CONFIG_IPADDR 192.168.1.1

#define CONFIG_SERVERIP 192.168.1.201

Flash AMD S29AL032D

The model S29AL032D 70TAI040, which means that it is a bottom sector device (04) among others things. It is not included in any configuration available for nios2 processors but others boards have support for this kind of memory flash. You can find enclosed the flash.c file, took and modified from other manufacture, to be copied to board/altera/selected_board (at your choice). The configuration file must define the following macros:

#define CONFIG_SYS_MAX_FLASH_SECT 19 /* Max # sects per bank */

#define CONFIG_SYS_MAX_FLASH_BANKS 1 /* Max # of flash banks */

#define CONFIG_SYS_FLASH_ERASE_TOUT 8000 /* Erase timeout (msec) */

#define CONFIG_SYS_FLASH_WRITE_TOUT 100 /* Write timeout (msec) */

#define CONFIG_SYS_FLASH_ADDR0 0xAAA

#define CONFIG_SYS_FLASH_ADDR1 0x555

#define CONFIG_SYS_FLASH_READ0 0x0 /* Manufacture's code */

#define CONFIG_SYS_FLASH_READ1 0x2 /* Device code */

#define CONFIG_SYS_FLASH_READ2 0x4 /* Sector protection */

#define CONFIG_SYS_FLASH_EMPTY_INFO

#define CONFIG_SYS_FLASH_WORD_SIZE unsigned char

#define CONFIG_SYS_FLASH_FORCE_LV800B 1

Add this file to the compiling process by modifying the Makefile inside the directory:

COBJS := $(BOARD).o $(COMOBJS) flash.o

(Erase any reference to common flash implementation in COMOBJS)

Note: CONFIG_SYS_FLASH_FORCE_LV800B is for board's versions that have 1Mb of flash memory. It is to force LV800B because they are detected as LV320B. If you change his value to 0, the driver will detect automatically the device ID.

SD card over SPI protocol

It is a driver to manage a SD card using the SPI core. U-boot will be able to read the fat partition to load programs from SD card. The system musts to have a SPI core with the following pins mapping:

SD_DAT0 -> MISO

SD_CMD -> MOSI

SD_DAT3 -> SLAVE_SEL

SD_CLK -> S_CLK

The macros to be defined in the configuration file are:

#define CONFIG_CMD_FAT

#define CONFIG_CMD_MMC

Those macros will add to u-boot the commands fatls, fatinfo, fatload and mmc. Also they will add to cp command the ability to read/write from/to SD memory but it is not implemented in the current driver. The file mmc_spi.c enclosed must be copied to cpu/nios2 and the makefile inside the directory should be modified as follows:

COBJS = cpu.o interrupts.o serial.o sysid.o traps.o epcs.o mmc_spi.o

The driver needs the header file mmc.h located at include/asm-nios2/arch-nios2/. If the directory does not exist you must create it.

Downloads


Version history
Revision #:
1 of 1
Last update:
‎06-26-2019 02:05 AM
Updated by:
 
Contributors