[U-Boot] [PATCH 4/5 v2] nios2: add Altera NEEK board

Thomas Chou thomas at wytron.com.tw
Wed Mar 31 06:03:39 CEST 2010


This patch supports the Altera Nios2 Embedded Evaluation Kit using
the example FPGA design at http://nioswiki.com/Linux.

Signed-off-by: Thomas Chou <thomas at wytron.com.tw>
---
change CONFIG_SYS_HZ to	1000.

 MAINTAINERS                                   |    1 +
 MAKEALL                                       |    1 +
 Makefile                                      |    2 +-
 board/altera/nios2-generic/neek_ocm_spi_mmu.h |  406 +++++++++++++++++++++++++
 include/configs/NEEK.h                        |  367 ++++++++++++++++++++++
 5 files changed, 776 insertions(+), 1 deletions(-)
 create mode 100644 board/altera/nios2-generic/neek_ocm_spi_mmu.h
 create mode 100644 include/configs/NEEK.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 30ac451..9c0707d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -852,6 +852,7 @@ Scott McNutt <smcnutt at psyent.com>
 	EP1S40		Nios-II
 	EP2C35		Nios-II
 	EP3C120	Nios-II
+	NEEK		Nios-II
 
 #########################################################################
 # MicroBlaze Systems:							#
diff --git a/MAKEALL b/MAKEALL
index 886d608..694b20e 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -825,6 +825,7 @@ LIST_nios2="		\
 	PK1C20		\
 	EP2C35		\
 	EP3C120	\
+	NEEK		\
 "
 
 #########################################################################
diff --git a/Makefile b/Makefile
index 5b3c589..ab708a0 100644
--- a/Makefile
+++ b/Makefile
@@ -3534,7 +3534,7 @@ PCI5441_config : unconfig
 	@$(MKCONFIG)  PCI5441 nios2 nios2 pci5441 psyent
 
 # nios2 generic boards
-NIOS2_GENERIC = EP2C35 EP3C120
+NIOS2_GENERIC = EP2C35 EP3C120 NEEK
 
 $(NIOS2_GENERIC:%=%_config) : unconfig
 	@$(MKCONFIG) $(@:_config=) nios2 nios2 nios2-generic altera
diff --git a/board/altera/nios2-generic/neek_ocm_spi_mmu.h b/board/altera/nios2-generic/neek_ocm_spi_mmu.h
new file mode 100644
index 0000000..5e62059
--- /dev/null
+++ b/board/altera/nios2-generic/neek_ocm_spi_mmu.h
@@ -0,0 +1,406 @@
+#ifndef _ALTERA_CPU_H_
+#define _ALTERA_CPU_H_
+
+/*
+ * This file was automatically generated by the swinfo2header utility.
+ *
+ * Created from SOPC Builder system 'cycloneIII_embedded_evaluation_kit_standard_sopc' in
+ * file './cycloneIII_embedded_evaluation_kit_standard_sopc.sopcinfo'.
+ */
+
+/*
+ * This file contains macros for module 'cpu' and devices
+ * connected to the following masters:
+ *   instruction_master
+ *   tightly_coupled_instruction_master_0
+ *   data_master
+ *   tightly_coupled_data_master_0
+ *
+ * Do not #include this header file and another header file created for a
+ * different module or master group at the same time.
+ * Doing so may result in duplicate #defines.
+ * Instead, use the system header file which has #defines with unique names.
+ */
+
+/*
+ * Macros for module 'cpu', class 'altera_nios2'.
+ * The macros have no prefix.
+ */
+#define CPU_IMPLEMENTATION "fast"
+#define CPU_FREQ 100000000u
+#define ICACHE_LINE_SIZE 32
+#define ICACHE_LINE_SIZE_LOG2 5
+#define ICACHE_SIZE 8192
+#define DCACHE_LINE_SIZE 32
+#define DCACHE_LINE_SIZE_LOG2 5
+#define DCACHE_SIZE 4096
+#define INITDA_SUPPORTED
+#define FLUSHDA_SUPPORTED
+#define HAS_JMPI_INSTRUCTION
+#define MMU_PRESENT
+#define KERNEL_REGION_BASE 0xc0000000
+#define IO_REGION_BASE 0xe0000000
+#define KERNEL_MMU_REGION_BASE 0x80000000
+#define USER_REGION_BASE 0x0
+#define PROCESS_ID_NUM_BITS 10
+#define TLB_NUM_WAYS 16
+#define TLB_NUM_WAYS_LOG2 4
+#define TLB_PTR_SZ 8
+#define TLB_NUM_ENTRIES 256
+#define FAST_TLB_MISS_EXCEPTION_ADDR 0xc9000000
+#define EXCEPTION_ADDR 0xc0000020
+#define RESET_ADDR 0xc4000000
+#define BREAK_ADDR 0xc6000020
+#define HAS_DEBUG_STUB
+#define HAS_DEBUG_CORE 1
+#define HAS_ILLEGAL_INSTRUCTION_EXCEPTION
+#define HAS_ILLEGAL_MEMORY_ACCESS_EXCEPTION
+#define HAS_EXTRA_EXCEPTION_INFO
+#define CPU_ID_SIZE 1
+#define CPU_ID_VALUE 0x0
+#define HARDWARE_DIVIDE_PRESENT 0
+#define HARDWARE_MULTIPLY_PRESENT 1
+#define HARDWARE_MULX_PRESENT 0
+#define INST_ADDR_WIDTH 28
+#define DATA_ADDR_WIDTH 28
+
+/*
+ * Macros for device 'ddr_sdram', class 'altmemddr'
+ * The macros are prefixed with 'DDR_SDRAM_'.
+ * The prefix is the slave descriptor.
+ */
+#define DDR_SDRAM_COMPONENT_TYPE altmemddr
+#define DDR_SDRAM_COMPONENT_NAME ddr_sdram
+#define DDR_SDRAM_BASE 0x0
+#define DDR_SDRAM_SPAN 33554432
+
+/*
+ * Macros for device 'lcd_sgdma', class 'altera_avalon_sgdma'
+ * The macros are prefixed with 'LCD_SGDMA_'.
+ * The prefix is the slave descriptor.
+ */
+#define LCD_SGDMA_COMPONENT_TYPE altera_avalon_sgdma
+#define LCD_SGDMA_COMPONENT_NAME lcd_sgdma
+#define LCD_SGDMA_BASE 0x2000000
+#define LCD_SGDMA_SPAN 1024u
+#define LCD_SGDMA_IRQ 5
+#define LCD_SGDMA_READ_BLOCK_DATA_WIDTH 64
+#define LCD_SGDMA_WRITE_BLOCK_DATA_WIDTH 64
+#define LCD_SGDMA_STREAM_DATA_WIDTH 64
+#define LCD_SGDMA_ADDRESS_WIDTH 32
+#define LCD_SGDMA_HAS_READ_BLOCK 1
+#define LCD_SGDMA_HAS_WRITE_BLOCK 0
+#define LCD_SGDMA_READ_BURSTCOUNT_WIDTH 4
+#define LCD_SGDMA_WRITE_BURSTCOUNT_WIDTH 4
+#define LCD_SGDMA_BURST_TRANSFER 0
+#define LCD_SGDMA_ALWAYS_DO_MAX_BURST 1
+#define LCD_SGDMA_DESCRIPTOR_READ_BURST 0
+#define LCD_SGDMA_UNALIGNED_TRANSFER 0
+#define LCD_SGDMA_CONTROL_SLAVE_DATA_WIDTH 32
+#define LCD_SGDMA_CONTROL_SLAVE_ADDRESS_WIDTH 8
+#define LCD_SGDMA_DESC_DATA_WIDTH 32
+#define LCD_SGDMA_CHAIN_WRITEBACK_DATA_WIDTH 32
+#define LCD_SGDMA_STATUS_TOKEN_DATA_WIDTH 24
+#define LCD_SGDMA_BYTES_TO_TRANSFER_DATA_WIDTH 16
+#define LCD_SGDMA_BURST_DATA_WIDTH 8
+#define LCD_SGDMA_CONTROL_DATA_WIDTH 8
+#define LCD_SGDMA_ATLANTIC_CHANNEL_DATA_WIDTH 4
+#define LCD_SGDMA_COMMAND_FIFO_DATA_WIDTH 104
+#define LCD_SGDMA_SYMBOLS_PER_BEAT 8
+#define LCD_SGDMA_IN_ERROR_WIDTH 0
+#define LCD_SGDMA_OUT_ERROR_WIDTH 0
+
+/*
+ * Macros for device 'ddr_sdram', class 'altmemddr'
+ * Path to the device is from the master group 'lcd_sgdma_m_read'.
+ * The macros are prefixed with 'LCD_SGDMA_M_READ_DDR_SDRAM_'.
+ * The prefix is the master group descriptor and the slave descriptor.
+ */
+#define LCD_SGDMA_M_READ_DDR_SDRAM_COMPONENT_TYPE altmemddr
+#define LCD_SGDMA_M_READ_DDR_SDRAM_COMPONENT_NAME ddr_sdram
+#define LCD_SGDMA_M_READ_DDR_SDRAM_BASE 0x0
+#define LCD_SGDMA_M_READ_DDR_SDRAM_SPAN 33554432u
+
+/*
+ * Macros for device 'ext_flash', class 'altera_avalon_cfi_flash'
+ * The macros are prefixed with 'EXT_FLASH_'.
+ * The prefix is the slave descriptor.
+ */
+#define EXT_FLASH_COMPONENT_TYPE altera_avalon_cfi_flash
+#define EXT_FLASH_COMPONENT_NAME ext_flash
+#define EXT_FLASH_BASE 0x4000000
+#define EXT_FLASH_SPAN 16777216u
+#define EXT_FLASH_SETUP_VALUE 25
+#define EXT_FLASH_WAIT_VALUE 100
+#define EXT_FLASH_HOLD_VALUE 20
+#define EXT_FLASH_TIMING_UNITS "ns"
+#define EXT_FLASH_SIZE 16777216u
+
+/*
+ * Macros for device 'ssram', class 'altera_avalon_cy7c1380_ssram'
+ * The macros are prefixed with 'SSRAM_'.
+ * The prefix is the slave descriptor.
+ */
+#define SSRAM_COMPONENT_TYPE altera_avalon_cy7c1380_ssram
+#define SSRAM_COMPONENT_NAME ssram
+#define SSRAM_BASE 0x5000000
+#define SSRAM_SPAN 1048576u
+#define SSRAM_SRAM_MEMORY_SIZE 1
+#define SSRAM_SRAM_MEMORY_UNITS 1048576
+#define SSRAM_SSRAM_DATA_WIDTH 32
+#define SSRAM_SSRAM_READ_LATENCY 2
+
+/*
+ * Macros for device 'igor_mac', class 'eth_ocm'
+ * The macros are prefixed with 'IGOR_MAC_'.
+ * The prefix is the slave descriptor.
+ */
+#define IGOR_MAC_COMPONENT_TYPE eth_ocm
+#define IGOR_MAC_COMPONENT_NAME igor_mac
+#define IGOR_MAC_BASE 0x8000000
+#define IGOR_MAC_SPAN 4096u
+#define IGOR_MAC_IRQ 1
+
+/*
+ * Macros for device 'remote_update', class 'altera_avalon_remote_update_cycloneiii'
+ * The macros are prefixed with 'REMOTE_UPDATE_'.
+ * The prefix is the slave descriptor.
+ */
+#define REMOTE_UPDATE_COMPONENT_TYPE altera_avalon_remote_update_cycloneiii
+#define REMOTE_UPDATE_COMPONENT_NAME remote_update
+#define REMOTE_UPDATE_BASE 0x8001000
+#define REMOTE_UPDATE_SPAN 512u
+
+/*
+ * Macros for device 'pll', class 'altera_avalon_pll'
+ * The macros are prefixed with 'PLL_'.
+ * The prefix is the slave descriptor.
+ */
+#define PLL_COMPONENT_TYPE altera_avalon_pll
+#define PLL_COMPONENT_NAME pll
+#define PLL_BASE 0x8001200
+#define PLL_SPAN 64u
+#define PLL_ARESET "None"
+#define PLL_PFDENA "None"
+#define PLL_LOCKED "None"
+#define PLL_PLLENA "None"
+#define PLL_SCANCLK "None"
+#define PLL_SCANDATA "None"
+#define PLL_SCANREAD "None"
+#define PLL_SCANWRITE "None"
+#define PLL_SCANCLKENA "None"
+#define PLL_SCANACLR "None"
+#define PLL_SCANDATAOUT "None"
+#define PLL_SCANDONE "None"
+#define PLL_CONFIGUPDATE "None"
+#define PLL_PHASECOUNTERSELECT "None"
+#define PLL_PHASEDONE "None"
+#define PLL_PHASEUPDOWN "None"
+#define PLL_PHASESTEP "None"
+
+/*
+ * Macros for device 'sys_clk_timer', class 'altera_avalon_timer'
+ * The macros are prefixed with 'SYS_CLK_TIMER_'.
+ * The prefix is the slave descriptor.
+ */
+#define SYS_CLK_TIMER_COMPONENT_TYPE altera_avalon_timer
+#define SYS_CLK_TIMER_COMPONENT_NAME sys_clk_timer
+#define SYS_CLK_TIMER_BASE 0x8001240
+#define SYS_CLK_TIMER_SPAN 64u
+#define SYS_CLK_TIMER_IRQ 0
+#define SYS_CLK_TIMER_ALWAYS_RUN 0
+#define SYS_CLK_TIMER_FIXED_PERIOD 0
+#define SYS_CLK_TIMER_SNAPSHOT 1
+#define SYS_CLK_TIMER_PERIOD 10.0
+#define SYS_CLK_TIMER_PERIOD_UNITS "ms"
+#define SYS_CLK_TIMER_RESET_OUTPUT 0
+#define SYS_CLK_TIMER_TIMEOUT_PULSE_OUTPUT 0
+#define SYS_CLK_TIMER_FREQ 60000000u
+#define SYS_CLK_TIMER_LOAD_VALUE 599999ULL
+#define SYS_CLK_TIMER_COUNTER_SIZE 32
+#define SYS_CLK_TIMER_MULT 0.0010
+#define SYS_CLK_TIMER_TICKS_PER_SEC 100u
+
+/*
+ * Macros for device 'performance_counter', class 'altera_avalon_performance_counter'
+ * The macros are prefixed with 'PERFORMANCE_COUNTER_'.
+ * The prefix is the slave descriptor.
+ */
+#define PERFORMANCE_COUNTER_COMPONENT_TYPE altera_avalon_performance_counter
+#define PERFORMANCE_COUNTER_COMPONENT_NAME performance_counter
+#define PERFORMANCE_COUNTER_BASE 0x8001280
+#define PERFORMANCE_COUNTER_SPAN 64u
+#define PERFORMANCE_COUNTER_HOW_MANY_SECTIONS 1
+
+/*
+ * Macros for device 'touch_panel_spi', class 'altera_avalon_spi'
+ * The macros are prefixed with 'TOUCH_PANEL_SPI_'.
+ * The prefix is the slave descriptor.
+ */
+#define TOUCH_PANEL_SPI_COMPONENT_TYPE altera_avalon_spi
+#define TOUCH_PANEL_SPI_COMPONENT_NAME touch_panel_spi
+#define TOUCH_PANEL_SPI_BASE 0x80012c0
+#define TOUCH_PANEL_SPI_SPAN 64u
+#define TOUCH_PANEL_SPI_IRQ 3
+#define TOUCH_PANEL_SPI_DATABITS 8
+#define TOUCH_PANEL_SPI_DATAWIDTH 16
+#define TOUCH_PANEL_SPI_TARGETCLOCK 32000u
+#define TOUCH_PANEL_SPI_CLOCKUNITS "Hz"
+#define TOUCH_PANEL_SPI_CLOCKMULT 1
+#define TOUCH_PANEL_SPI_NUMSLAVES 1
+#define TOUCH_PANEL_SPI_ISMASTER 1
+#define TOUCH_PANEL_SPI_CLOCKPOLARITY 0
+#define TOUCH_PANEL_SPI_CLOCKPHASE 0
+#define TOUCH_PANEL_SPI_LSBFIRST 0
+#define TOUCH_PANEL_SPI_EXTRADELAY 0
+#define TOUCH_PANEL_SPI_TARGETSSDELAY "0.0"
+#define TOUCH_PANEL_SPI_DELAYUNITS "ns"
+#define TOUCH_PANEL_SPI_DELAYMULT "1.0E-9"
+#define TOUCH_PANEL_SPI_PREFIX "spi_"
+
+/*
+ * Macros for device 'mmc_spi', class 'altera_avalon_spi'
+ * The macros are prefixed with 'MMC_SPI_'.
+ * The prefix is the slave descriptor.
+ */
+#define MMC_SPI_COMPONENT_TYPE altera_avalon_spi
+#define MMC_SPI_COMPONENT_NAME mmc_spi
+#define MMC_SPI_BASE 0x8001300
+#define MMC_SPI_SPAN 64u
+#define MMC_SPI_IRQ 8
+#define MMC_SPI_DATABITS 8
+#define MMC_SPI_DATAWIDTH 16
+#define MMC_SPI_TARGETCLOCK 20000000u
+#define MMC_SPI_CLOCKUNITS "Hz"
+#define MMC_SPI_CLOCKMULT 1
+#define MMC_SPI_NUMSLAVES 1
+#define MMC_SPI_ISMASTER 1
+#define MMC_SPI_CLOCKPOLARITY 0
+#define MMC_SPI_CLOCKPHASE 0
+#define MMC_SPI_LSBFIRST 0
+#define MMC_SPI_EXTRADELAY 0
+#define MMC_SPI_TARGETSSDELAY "0.0"
+#define MMC_SPI_DELAYUNITS "ns"
+#define MMC_SPI_DELAYMULT "1.0E-9"
+#define MMC_SPI_PREFIX "spi_"
+
+/*
+ * Macros for device 'uart', class 'altera_avalon_uart'
+ * The macros are prefixed with 'UART_'.
+ * The prefix is the slave descriptor.
+ */
+#define UART_COMPONENT_TYPE altera_avalon_uart
+#define UART_COMPONENT_NAME uart
+#define UART_BASE 0x8001340
+#define UART_SPAN 64u
+#define UART_IRQ 6
+#define UART_BAUD 115200
+#define UART_DATA_BITS 8
+#define UART_FIXED_BAUD 1
+#define UART_PARITY 'N'
+#define UART_STOP_BITS 1
+#define UART_SYNC_REG_DEPTH 2
+#define UART_USE_CTS_RTS 0
+#define UART_USE_EOP_REGISTER 0
+#define UART_SIM_TRUE_BAUD 0
+#define UART_SIM_CHAR_STREAM ""
+#define UART_FREQ 66500000u
+
+/*
+ * Macros for device 'touch_panel_pen_irq_n', class 'altera_avalon_pio'
+ * The macros are prefixed with 'TOUCH_PANEL_PEN_IRQ_N_'.
+ * The prefix is the slave descriptor.
+ */
+#define TOUCH_PANEL_PEN_IRQ_N_COMPONENT_TYPE altera_avalon_pio
+#define TOUCH_PANEL_PEN_IRQ_N_COMPONENT_NAME touch_panel_pen_irq_n
+#define TOUCH_PANEL_PEN_IRQ_N_BASE 0x80013e0
+#define TOUCH_PANEL_PEN_IRQ_N_SPAN 32u
+#define TOUCH_PANEL_PEN_IRQ_N_IRQ 4
+#define TOUCH_PANEL_PEN_IRQ_N_DO_TEST_BENCH_WIRING 0
+#define TOUCH_PANEL_PEN_IRQ_N_DRIVEN_SIM_VALUE 0x0
+#define TOUCH_PANEL_PEN_IRQ_N_HAS_TRI 0
+#define TOUCH_PANEL_PEN_IRQ_N_HAS_OUT 0
+#define TOUCH_PANEL_PEN_IRQ_N_HAS_IN 1
+#define TOUCH_PANEL_PEN_IRQ_N_CAPTURE 1
+#define TOUCH_PANEL_PEN_IRQ_N_BIT_CLEARING_EDGE_REGISTER 0
+#define TOUCH_PANEL_PEN_IRQ_N_BIT_MODIFYING_OUTPUT_REGISTER 0
+#define TOUCH_PANEL_PEN_IRQ_N_DATA_WIDTH 1
+#define TOUCH_PANEL_PEN_IRQ_N_RESET_VALUE 0x0
+#define TOUCH_PANEL_PEN_IRQ_N_EDGE_TYPE "FALLING"
+#define TOUCH_PANEL_PEN_IRQ_N_IRQ_TYPE "EDGE"
+#define TOUCH_PANEL_PEN_IRQ_N_FREQ 60000000u
+
+/*
+ * Macros for device 'sysid', class 'altera_avalon_sysid'
+ * The macros are prefixed with 'SYSID_'.
+ * The prefix is the slave descriptor.
+ */
+#define SYSID_COMPONENT_TYPE altera_avalon_sysid
+#define SYSID_COMPONENT_NAME sysid
+#define SYSID_BASE 0x8001400
+#define SYSID_SPAN 16u
+#define SYSID_ID 1597074984u
+#define SYSID_TIMESTAMP 1254740213u
+
+/*
+ * Macros for device 'jtag_uart', class 'altera_avalon_jtag_uart'
+ * The macros are prefixed with 'JTAG_UART_'.
+ * The prefix is the slave descriptor.
+ */
+#define JTAG_UART_COMPONENT_TYPE altera_avalon_jtag_uart
+#define JTAG_UART_COMPONENT_NAME jtag_uart
+#define JTAG_UART_BASE 0x8001410
+#define JTAG_UART_SPAN 16u
+#define JTAG_UART_IRQ 7
+#define JTAG_UART_WRITE_DEPTH 64
+#define JTAG_UART_READ_DEPTH 64
+#define JTAG_UART_WRITE_THRESHOLD 8
+#define JTAG_UART_READ_THRESHOLD 8
+
+/*
+ * Macros for device 'ps2_0', class 'altera_up_avalon_ps2_classic'
+ * The macros are prefixed with 'PS2_0_'.
+ * The prefix is the slave descriptor.
+ */
+#define PS2_0_COMPONENT_TYPE altera_up_avalon_ps2_classic
+#define PS2_0_COMPONENT_NAME ps2_0
+#define PS2_0_BASE 0x8001420
+#define PS2_0_SPAN 8u
+#define PS2_0_IRQ 9
+
+/*
+ * Macros for device 'gpio_0', class 'gpio'
+ * The macros are prefixed with 'GPIO_0_'.
+ * The prefix is the slave descriptor.
+ */
+#define GPIO_0_COMPONENT_TYPE gpio
+#define GPIO_0_COMPONENT_NAME gpio_0
+#define GPIO_0_BASE 0x8001500
+#define GPIO_0_SPAN 128u
+
+/*
+ * Macros for device 'onchip_memory2_0', class 'altera_avalon_onchip_memory2'
+ * The macros are prefixed with 'ONCHIP_MEMORY2_0_'.
+ * The prefix is the slave descriptor.
+ */
+#define ONCHIP_MEMORY2_0_COMPONENT_TYPE altera_avalon_onchip_memory2
+#define ONCHIP_MEMORY2_0_COMPONENT_NAME onchip_memory2_0
+#define ONCHIP_MEMORY2_0_BASE 0x9000000
+#define ONCHIP_MEMORY2_0_SPAN 512u
+#define ONCHIP_MEMORY2_0_ALLOW_MRAM_SIM_CONTENTS_ONLY_FILE 0
+#define ONCHIP_MEMORY2_0_INIT_CONTENTS_FILE "onchip_memory2_0"
+#define ONCHIP_MEMORY2_0_NON_DEFAULT_INIT_FILE_ENABLED 0
+#define ONCHIP_MEMORY2_0_GUI_RAM_BLOCK_TYPE "Automatic"
+#define ONCHIP_MEMORY2_0_WRITABLE 1
+#define ONCHIP_MEMORY2_0_DUAL_PORT 1
+#define ONCHIP_MEMORY2_0_SIZE_VALUE 512u
+#define ONCHIP_MEMORY2_0_SIZE_MULTIPLE 1
+#define ONCHIP_MEMORY2_0_CONTENTS_INFO ""
+#define ONCHIP_MEMORY2_0_RAM_BLOCK_TYPE "Auto"
+#define ONCHIP_MEMORY2_0_INIT_MEM_CONTENT 1
+#define ONCHIP_MEMORY2_0_ALLOW_IN_SYSTEM_MEMORY_CONTENT_EDITOR 0
+#define ONCHIP_MEMORY2_0_INSTANCE_ID "NONE"
+#define ONCHIP_MEMORY2_0_READ_DURING_WRITE_MODE "DONT_CARE"
+
+
+#endif /* _ALTERA_CPU_H_ */
diff --git a/include/configs/NEEK.h b/include/configs/NEEK.h
new file mode 100644
index 0000000..f42701e
--- /dev/null
+++ b/include/configs/NEEK.h
@@ -0,0 +1,367 @@
+/*
+ * (C) Copyright 2005, Psyent Corporation <www.psyent.com>
+ * Scott McNutt <smcnutt at psyent.com>
+ * (C) Copyright 2010, Thomas Chou <thomas at wytron.com.tw>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * BOARD/CPU
+ */
+#include "../board/altera/nios2-generic/neek_ocm_spi_mmu.h"
+#define CONFIG_BOARD_NAME "NEEK"
+#define CONFIG_NEEK
+
+#define CONFIG_SYS_CLK_FREQ		CPU_FREQ
+#define CONFIG_SYS_RESET_ADDR		RESET_ADDR
+#define CONFIG_SYS_EXCEPTION_ADDR	EXCEPTION_ADDR
+#define CONFIG_BOARD_EARLY_INIT_F	/* enable early board-spec. init */
+#define CONFIG_BOARD_LATE_INIT		/* enable late board-spec. init */
+
+#ifndef KERNEL_REGION_BASE
+# define KERNEL_REGION_BASE		0		/* NOMMU */
+#endif
+
+#ifndef IO_REGION_BASE
+# define IO_REGION_BASE		0x80000000	/* NOMMU */
+#endif
+
+/*
+ * CACHE -- the following will support II/s and II/f. The II/s does not
+ * have dcache, so the cache instructions will behave as NOPs.
+ */
+#define CONFIG_SYS_ICACHE_SIZE		ICACHE_SIZE
+#define CONFIG_SYS_ICACHELINE_SIZE	ICACHE_LINE_SIZE
+#define CONFIG_SYS_DCACHE_SIZE		DCACHE_SIZE
+#define CONFIG_SYS_DCACHELINE_SIZE	DCACHE_LINE_SIZE
+
+/*
+ * MEMORY BASE ADDRESSES
+ */
+#define CONFIG_SYS_SDRAM_BASE		(DDR_SDRAM_BASE | KERNEL_REGION_BASE)
+#define CONFIG_SYS_SDRAM_SIZE		(DDR_SDRAM_SPAN)
+
+/*
+ * GPIO
+ */
+#define CONFIG_SYS_GPIO_BASE		(GPIO_0_BASE | IO_REGION_BASE)
+#ifdef CONFIG_SYS_GPIO_BASE
+# define CONFIG_SYS_GPIO_HBT 2		/* heartbeat status LED */
+#endif
+
+/*
+ * Flash Settings
+ */
+/* #define CONFIG_SYS_NO_FLASH */
+#define CONFIG_FLASH_CFI_DRIVER
+#define CONFIG_FLASH_CFI_MTD
+
+#define CONFIG_SYS_CFI_FLASH_STATUS_POLL /* fix amd flash issue */
+#define CONFIG_SYS_FLASH_BASE		(EXT_FLASH_BASE | IO_REGION_BASE)
+#define CONFIG_SYS_FLASH_CFI
+#define CONFIG_SYS_FLASH_PROTECTION
+#define CONFIG_SYS_MAX_FLASH_BANKS	1
+#define CONFIG_SYS_MAX_FLASH_SECT	512
+#define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
+
+/*
+ * SPI FLash,EPCS Settings
+ */
+/* #define CONFIG_CMD_SPI */
+/* #define CONFIG_CMD_SF */
+/* #define CONFIG_SPI_FLASH */
+/* #define CONFIG_ALTERA_SPI */
+
+#define CONFIG_ENV_SPI_MAX_HZ		30000000
+#define CONFIG_SF_DEFAULT_SPEED	30000000
+#define CONFIG_SPI_FLASH_STMICRO
+#define CONFIG_SYS_SPI_BASE		((EPCS_CONTROLLER_BASE + \
+					  EPCS_CONTROLLER_REGISTER_OFFSET) \
+					 | IO_REGION_BASE)
+
+/*
+ * NAND Flash
+ */
+/* #define CONFIG_CMD_NAND */
+/* #define CONFIG_NAND_PLAT */
+
+#define CONFIG_SYS_MAX_NAND_DEVICE	1
+#define CONFIG_SYS_NAND_BASE		(NAND_FLASH_BASE | IO_REGION_BASE)
+#define NIOS2_NAND_PLAT_CLE		2
+#define NIOS2_NAND_PLAT_ALE		3
+#define NAND_PLAT_WRITE_CMD(chip, cmd) \
+	writeb(cmd, (unsigned int)(this->IO_ADDR_W) + \
+	       (1 << NIOS2_NAND_PLAT_CLE))
+#define NAND_PLAT_WRITE_ADR(chip, cmd) \
+	writeb(cmd, (unsigned int)(this->IO_ADDR_W) + \
+	       (1 << NIOS2_NAND_PLAT_ALE))
+#define NAND_PLAT_INIT() {}
+#ifdef CONFIG_SYS_GPIO_NRB
+# define NAND_PLAT_DEV_READY(chip) \
+	readl(CONFIG_SYS_GPIO_BASE + ((CONFIG_SYS_GPIO_NRB) << 2))
+#endif
+
+/*
+ * SERIAL
+ */
+/* #define CONFIG_ALTERA_UART */
+#define CONFIG_ALTERA_JTAG_UART
+
+#if defined(CONFIG_ALTERA_JTAG_UART)
+#define CONFIG_SYS_NIOS_CONSOLE	(JTAG_UART_BASE | IO_REGION_BASE)
+#else
+#define CONFIG_SYS_NIOS_CONSOLE	(UART_BASE | IO_REGION_BASE)
+#endif
+
+#define CONFIG_ALTERA_JTAG_UART_BYPASS
+#define CONFIG_SYS_UART_FREQ		UART_FREQ
+#define CONFIG_BAUDRATE		UART_BAUD	/* Initial baudrate */
+#define CONFIG_SYS_BAUDRATE_TABLE	{UART_BAUD}
+#define CONFIG_SYS_CONSOLE_INFO_QUIET	1	/* Suppress console info */
+
+/*
+ * SYSID
+ */
+#define CONFIG_SYS_NIOS_SYSID_BASE	(SYSID_BASE | IO_REGION_BASE)
+
+/*
+ * TIMER
+ */
+#define CONFIG_SYS_NIOS_TMRBASE	(SYS_CLK_TIMER_BASE | IO_REGION_BASE)
+#define CONFIG_SYS_NIOS_TMRIRQ		SYS_CLK_TIMER_IRQ
+#define CONFIG_SYS_NIOS_TMRCNT		((SYS_CLK_TIMER_FREQ / \
+					  CONFIG_SYS_HZ) - 1)
+#define CONFIG_SYS_NIOS_TMRMS		1	/* Must be one */
+#define CONFIG_SYS_HZ			1000
+
+/*
+ * STATUS LED
+ */
+#define CONFIG_STATUS_LED			/* Enable status driver */
+#define CONFIG_GPIOLED				/* Enable gpioled driver */
+
+#define STATUS_LED_BIT		CONFIG_SYS_GPIO_HBT
+#define STATUS_LED_STATE	1		/* Blinking		*/
+#define STATUS_LED_PERIOD	(CONFIG_SYS_HZ / 2)	/* 500 mS */
+
+/*
+ * IDE support
+ */
+/* #define CONFIG_CMD_IDE */
+
+#define CONFIG_SYS_PIO_MODE		1
+#define CONFIG_SYS_IDE_MAXBUS		1	/* IDE bus */
+#define CONFIG_SYS_IDE_MAXDEVICE	1
+#define CONFIG_SYS_ATA_BASE_ADDR	(CF_IDE_BASE | IO_REGION_BASE)
+#define CONFIG_SYS_ATA_STRIDE		4	/* 1bit shift */
+#define CONFIG_SYS_ATA_DATA_OFFSET	0x0	/* data reg offset */
+#define CONFIG_SYS_ATA_REG_OFFSET	0x0	/* reg offset */
+#define CONFIG_SYS_ATA_ALT_OFFSET	0x20	/* alternate register offset */
+#define CONFIG_SYS_CF_CTL_BASE		(CF_CTL_BASE | IO_REGION_BASE)
+#define CONFIG_IDE_RESET
+
+/*
+ * ETHERNET
+ */
+/* #define CONFIG_SMC91111 */
+#define CONFIG_SMC91111_BASE	((ENET_BASE + ENET_LAN91C111_REGISTERS_OFFSET) \
+				 | IO_REGION_BASE) /* Base addr	*/
+#undef	CONFIG_SMC91111_EXT_PHY		/* Internal PHY	*/
+#define CONFIG_SMC_USE_32_BIT			/* 32-bit interface	*/
+
+/* #define CONFIG_DRIVER_DM9000 */
+#define CONFIG_DM9000_BASE		(DM9000_BASE | IO_REGION_BASE)
+#define DM9000_IO			CONFIG_DM9000_BASE
+#define DM9000_DATA			(CONFIG_DM9000_BASE + 4)
+#define CONFIG_DM9000_USE_16BIT	1
+#define CONFIG_DM9000_NO_SROM		1
+/* #define CONFIG_NET_RETRY_COUNT		20 */
+/* #define CONFIG_RESET_PHY_R		1 */
+
+/* #define CONFIG_ALTERA_TSE */
+/* #define CONFIG_MII		1 */
+/* #define CONFIG_CMD_MII */
+#define CONFIG_ETHPRIME "tse0"
+#undef	CONFIG_PCI
+
+#define CONFIG_SYS_NUM_TSE_MACS			1
+#define CONFIG_SYS_ALTERA_TSE_0_NAME		"tse0"
+#define CONFIG_SYS_ALTERA_TSE_0_BASE		(TSE_MAC_BASE | IO_REGION_BASE)
+#define CONFIG_SYS_ALTERA_TSE_0_SGDMA_RX_BASE	(SGDMA_RX_BASE | IO_REGION_BASE)
+#define CONFIG_SYS_ALTERA_TSE_0_SGDMA_TX_BASE	(SGDMA_TX_BASE | IO_REGION_BASE)
+#define CONFIG_SYS_ALTERA_TSE_0_SGDMA_RX_IRQ	SGDMA_RX_IRQ
+#define CONFIG_SYS_ALTERA_TSE_0_SGDMA_TX_IRQ	SGDMA_TX_IRQ
+#define CONFIG_SYS_ALTERA_TSE_0_HAS_DESC_MEM	0
+#define CONFIG_SYS_ALTERA_TSE_0_DESC_MEM_BASE	(DESCRIPTOR_MEMORY_BASE | \
+						 IO_REGION_BASE)
+#define CONFIG_SYS_ALTERA_TSE_0_DESC_MEM_SPAN	DESCRIPTOR_MEMORY_SPAN
+#define CONFIG_SYS_ALTERA_TSE_0_RXFIFO_DEPTH	TSE_MAC_RECEIVE_FIFO_DEPTH
+#define CONFIG_SYS_ALTERA_TSE_0_TXFIFO_DEPTH	TSE_MAC_TRANSMIT_FIFO_DEPTH
+#define CONFIG_SYS_ALTERA_TSE_0_PHY_ADDR	18
+
+/* TSE Supported modes */
+/* GMII/MII	= 0 */
+/* RGMII	= 1 */
+/* RGMII_ID	= 2 */
+/* RGMII_TXID	= 3 */
+/* RGMII_RXID	= 4 */
+/* SGMII	= 5 */
+#define CONFIG_SYS_ALTERA_TSE_0_FLAGS		0x0
+
+#define CONFIG_ETHOC
+#define CONFIG_SYS_ETHOC_BASE		(IGOR_MAC_BASE | IO_REGION_BASE)
+
+#define CONFIG_ETHADDR		08:00:3e:26:0a:5b
+#define CONFIG_NETMASK		255.255.255.0
+#define CONFIG_IPADDR		192.168.1.10
+#define CONFIG_SERVERIP	192.168.1.254
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+#undef CONFIG_CMD_BOOTD
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_IMLS
+#undef CONFIG_CMD_ITEST
+#undef CONFIG_CMD_NFS
+#undef CONFIG_CMD_SETGETDCR
+#undef CONFIG_CMD_XIMG
+
+#ifdef CONFIG_CMD_NET
+# define CONFIG_NET_MULTI
+# define CONFIG_CMD_DHCP
+# define CONFIG_CMD_PING
+#endif
+
+/* #define CONFIG_CMD_SAVES */
+/* #define CONFIG_CMD_JFFS2 */
+/* #define CONFIG_JFFS2_CMDLINE */
+/* #define CONFIG_CMD_FAT */
+/* #define CONFIG_DOS_PARTITION */
+/* #define CONFIG_CMD_UBI */
+/* #define CONFIG_CMD_UBIFS */
+/* #define CONFIG_RBTREE */
+#define CONFIG_MTD_DEVICE
+#define CONFIG_MTD_PARTITIONS
+#define CONFIG_CMD_MTDPARTS
+/* #define CONFIG_LZO */
+
+/*
+ * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above
+ * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the
+ * reset address, no? This will keep the environment in user region
+ * of flash. NOTE: the monitor length must be multiple of sector size
+ * (which is common practice).
+ */
+#define CONFIG_ENV_IS_IN_FLASH
+/* #define CONFIG_ENV_IS_IN_SPI_FLASH */
+/* #define CONFIG_ENV_IS_IN_NAND */
+
+#if defined(CONFIG_ENV_IS_IN_FLASH)
+# define CONFIG_ENV_SIZE		0x20000	/* 1 sector */
+# define CONFIG_ENV_OVERWRITE		/* Serial change Ok	*/
+/* save the env in unused space of NEEK, please refer to the user guide */
+# define CONFIG_ENV_ADDR		(CONFIG_SYS_FLASH_BASE + 0xfe0000)
+#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
+# define CONFIG_ENV_OFFSET		0x7e0000	/* last sector */
+# define CONFIG_ENV_SIZE		0x20000	/* 1 sector */
+# define CONFIG_ENV_SECT_SIZE		0x20000
+# define CONFIG_ENV_SPI_BUS		0
+# define CONFIG_ENV_SPI_CS		0
+# define CONFIG_ENV_SPI_MAX_HZ		30000000	/*30Mhz */
+#elif defined(CONFIG_ENV_IS_IN_NAND)
+# define CONFIG_ENV_OFFSET		0x40000
+# define CONFIG_ENV_SIZE		0x40000	/* 1 sector */
+#else
+# define CONFIG_ENV_IS_NOWHERE		1	/* if env in SDRAM */
+# define CONFIG_ENV_SIZE		0x20000
+#endif
+
+/*
+ * MEMORY ORGANIZATION
+ *	-Monitor at top of sdram.
+ *	-The heap is placed below the monitor
+ *	-Global data is placed below the heap.
+ *	-The stack is placed below global data (&grows down).
+ */
+#define CONFIG_MONITOR_IS_IN_RAM
+#ifdef CONFIG_CMD_UBI
+# define CONFIG_SYS_MONITOR_LEN	0x80000	/* Reserve 512k */
+#else
+# define CONFIG_SYS_MONITOR_LEN	0x40000	/* Reserve 256k */
+#endif
+#define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_SDRAM_BASE + \
+					 CONFIG_SYS_SDRAM_SIZE - \
+					 CONFIG_SYS_MONITOR_LEN)
+#define CONFIG_SYS_GBL_DATA_SIZE	256	/* Global data size rsvd */
+#ifdef CONFIG_CMD_UBI			/* UBI needs >512KB malloc */
+# define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 0x100000)
+#else
+# define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + 0x20000)
+#endif
+#define CONFIG_SYS_MALLOC_BASE		(CONFIG_SYS_MONITOR_BASE - \
+					 CONFIG_SYS_MALLOC_LEN)
+#define CONFIG_SYS_GBL_DATA_OFFSET	(CONFIG_SYS_MALLOC_BASE - \
+					 CONFIG_SYS_GBL_DATA_SIZE)
+#define CONFIG_SYS_INIT_SP		CONFIG_SYS_GBL_DATA_OFFSET
+
+/*
+ * MISC
+ */
+#define CONFIG_SYS_LONGHELP		/* Provide extended help */
+#define CONFIG_SYS_PROMPT		"==> "	/* Command prompt	*/
+#define CONFIG_SYS_CBSIZE		256	/* Console I/O buf size */
+#define CONFIG_SYS_MAXARGS		16	/* Max command args	*/
+#define CONFIG_SYS_BARGSIZE		CONFIG_SYS_CBSIZE /* Bootarg buf size */
+#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
+					sizeof(CONFIG_SYS_PROMPT) + \
+					 16)	/* Print buf size */
+#define CONFIG_SYS_LOAD_ADDR		CONFIG_SYS_SDRAM_BASE
+#define CONFIG_SYS_MEMTEST_START	CONFIG_SYS_SDRAM_BASE
+#define CONFIG_SYS_MEMTEST_END		(CONFIG_SYS_INIT_SP - 0x20000)
+
+#if defined(CONFIG_NAND_PLAT)
+# define MTD_ENV_SETTINGS \
+	"mtdids=nand0=nand0\0"						\
+	"mtdparts=mtdparts=nand0:-(data)\0"
+#elif defined(CONFIG_FLASH_CFI_DRIVER)
+# define MTD_ENV_SETTINGS \
+	"mtdids=nor0=boot\0"						\
+	"mtdparts=mtdparts=boot:128k(cat),1408k(sel),11776k(app),-(user)\0"
+#else
+# define MTD_ENV_SETTINGS
+#endif
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	MTD_ENV_SETTINGS
+
+#define CONFIG_CMDLINE_EDITING
+
+/* Use the HUSH parser */
+#define CONFIG_SYS_HUSH_PARSER
+#ifdef CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
+#endif
+
+#endif /* __CONFIG_H */
-- 
1.6.6.1



More information about the U-Boot mailing list