diff -Naurb u-boot-2004-08-24/MAINTAINERS u-boot-nios2/MAINTAINERS --- u-boot-2004-08-24/MAINTAINERS 2004-07-11 18:37:59.000000000 -0400 +++ u-boot-nios2/MAINTAINERS 2004-08-24 06:07:20.000000000 -0400 @@ -429,6 +429,18 @@ DK1C20 Nios-32 ######################################################################### +# Nios-II Systems: # +# # +# Maintainer Name, Email Address # +# Board CPU # +######################################################################### + +Scott McNutt + + PCI5441 Nios-II + PK1C20 Nios-II + +######################################################################### # MicroBlaze Systems: # # # # Maintainer Name, Email Address # diff -Naurb u-boot-2004-08-24/MAKEALL u-boot-nios2/MAKEALL --- u-boot-2004-08-24/MAKEALL 2004-08-01 18:48:16.000000000 -0400 +++ u-boot-nios2/MAKEALL 2004-08-24 06:20:27.000000000 -0400 @@ -188,6 +188,12 @@ " ######################################################################### +## Nios-II Systems +######################################################################### + +LIST_nios2="PCI5441 PK1C20" + +######################################################################### ## MicroBlaze Systems ######################################################################### @@ -219,7 +225,7 @@ arm|SA|ARM7|ARM9|pxa|ixp| \ microblaze| \ mips| \ - nios| \ + nios|nios2| \ x86|I486) for target in `eval echo '$LIST_'${arg}` do diff -Naurb u-boot-2004-08-24/Makefile u-boot-nios2/Makefile --- u-boot-2004-08-24/Makefile 2004-08-04 17:56:49.000000000 -0400 +++ u-boot-nios2/Makefile 2004-08-24 06:01:57.000000000 -0400 @@ -72,6 +72,9 @@ ifeq ($(ARCH),nios) CROSS_COMPILE = nios-elf- endif +ifeq ($(ARCH),nios2) +CROSS_COMPILE = nios2-elf- +endif ifeq ($(ARCH),m68k) CROSS_COMPILE = m68k-elf- endif @@ -1443,6 +1446,15 @@ } @./mkconfig -a ADNPESC1 nios nios adnpesc1 ssv +######################################################################### +## Nios-II +######################################################################### + +PK1C20_config : unconfig + @./mkconfig PK1C20 nios2 nios2 pk1c20 psyent + +PCI5441_config : unconfig + @./mkconfig PCI5441 nios2 nios2 pci5441 psyent #======================================================================== # MicroBlaze diff -Naurb u-boot-2004-08-24/nios2_config.mk u-boot-nios2/nios2_config.mk --- u-boot-2004-08-24/nios2_config.mk 1969-12-31 19:00:00.000000000 -0500 +++ u-boot-nios2/nios2_config.mk 2004-08-24 05:56:44.000000000 -0400 @@ -0,0 +1,26 @@ +# +# (C) Copyright 2004 +# Psyent Corporation +# Scott McNutt +# +# 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 +# + +PLATFORM_CPPFLAGS += -DCONFIG_NIOS2 -D__NIOS2__ +PLATFORM_CPPFLAGS += -ffixed-r15 diff -Naurb u-boot-2004-08-24/README u-boot-nios2/README --- u-boot-2004-08-24/README 2004-08-02 19:22:59.000000000 -0400 +++ u-boot-nios2/README 2004-08-24 06:24:52.000000000 -0400 @@ -139,6 +139,7 @@ - mpc8260 Files specific to Motorola MPC8260 CPUs - mpc85xx Files specific to Motorola MPC85xx CPUs - nios Files specific to Altera NIOS CPUs + - nios2 Files specific to Altera Nios-II CPUs - ppc4xx Files specific to IBM PowerPC 4xx CPUs - pxa Files specific to Intel XScale PXA CPUs - s3c44b0 Files specific to Samsung S3C44B0 CPUs @@ -244,6 +245,10 @@ ---------------------- CONFIG_MICROBLAZE + Nios-2 based CPUs: + ---------------------- + CONFIG_NIOS2 + - Board Type: Define exactly one of @@ -304,6 +309,11 @@ CONFIG_SUZAKU + Nios-2 based boards: + ------------------------ + + CONFIG_PCI5441 CONFIG_PK1C20 + - CPU Module Type: (if CONFIG_COGENT is defined) Define exactly one of diff -Naurb u-boot-2004-08-24/CREDITS u-boot-nios2/CREDITS --- u-boot-2004-08-24/CREDITS 2004-07-11 15:17:20.000000000 -0400 +++ u-boot-nios2/CREDITS 2004-08-24 06:06:07.000000000 -0400 @@ -286,7 +286,10 @@ N: Scott McNutt E: smcnutt@psyent.com -D: Support for Altera Nios-32 CPU, for Nios Cyclone Development Kit (DK-1C20) +D: Support for Altera Nios-32 CPU +D: Support for Altera Nios-II CPU +D: Support for Nios Cyclone Development Kit (DK-1C20) +W: http://www.psyent.com N: Rolf Offermanns E: rof@sysgo.de diff -Naurb u-boot-2004-08-24/examples/Makefile u-boot-nios2/examples/Makefile --- u-boot-2004-08-24/examples/Makefile 2004-07-10 17:45:58.000000000 -0400 +++ u-boot-nios2/examples/Makefile 2004-08-24 06:43:02.000000000 -0400 @@ -41,6 +41,10 @@ LOAD_ADDR = 0x00800000 -L $(gcclibdir)/m32 -T nios.lds endif +ifeq ($(ARCH),nios2) +LOAD_ADDR = 0x00800000 -L $(gcclibdir) -T nios2.lds +endif + ifeq ($(ARCH),m68k) LOAD_ADDR = 0x20000 -L $(clibdir) endif diff -Naurb u-boot-2004-08-24/examples/nios2.lds u-boot-nios2/examples/nios2.lds --- u-boot-2004-08-24/examples/nios2.lds 1969-12-31 19:00:00.000000000 -0500 +++ u-boot-nios2/examples/nios2.lds 2004-08-24 06:43:40.000000000 -0400 @@ -0,0 +1,133 @@ +/* + * (C) Copyright 2004, Psyent Corporation + * Scott McNutt + * + * 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 + */ + + +OUTPUT_FORMAT("elf32-littlenios2") +OUTPUT_ARCH(nios2) +ENTRY(_start) + +SECTIONS +{ + .text : + { + *(.text) + *(.text.*) + *(.gnu.linkonce.t*) + *(.rodata) + *(.rodata.*) + *(.gnu.linkonce.r*) + } + . = ALIGN (4); + _etext = .; + PROVIDE (etext = .); + + /* INIT DATA sections - "Small" data (see the gcc -G option) + * is always gp-relative. Here we make all init data sections + * adjacent to simplify the startup code -- and provide + * the global pointer for gp-relative access. + */ + _data = .; + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + } + + . = ALIGN(16); + _gp = .; /* Global pointer addr */ + PROVIDE (gp = .); + + .sdata : + { + *(.sdata) + *(.sdata.*) + *(.gnu.linkonce.s.*) + } + . = ALIGN(4); + + _edata = .; + PROVIDE (edata = .); + + /* UNINIT DATA - Small uninitialized data is first so it's + * adjacent to sdata and can be referenced via gp. The normal + * bss follows. We keep it adjacent to simplify init code. + */ + __bss_start = .; + .sbss : + { + *(.sbss) + *(.sbss.*) + *(.gnu.linkonce.sb.*) + *(.scommon) + } + . = ALIGN(4); + .bss : + { + *(.bss) + *(.bss.*) + *(.dynbss) + *(COMMON) + *(.scommon) + } + . = ALIGN(4); + _end = .; + PROVIDE (end = .); + + /* CMD TABLE - uboot command sections + */ + __uboot_cmd_start = .; + .u_boot_cmd : + { + *(.u_boot_cmd) + } + . = ALIGN(4); + __u_boot_cmd_end = .; + + /* DEBUG -- symbol table, string table, etc. etc. + */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } +} diff -Naurb u-boot-2004-08-24/examples/stubs.c u-boot-nios2/examples/stubs.c --- u-boot-2004-08-24/examples/stubs.c 2004-07-10 19:48:42.000000000 -0400 +++ u-boot-nios2/examples/stubs.c 2004-08-24 06:46:53.000000000 -0400 @@ -82,6 +82,21 @@ " jmp %%g0\n" \ " nop \n" \ : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x) : "r0"); +#elif defined(CONFIG_NIOS2) +/* + * r15 holds the pointer to the global_data, r8 is call-clobbered + */ +#define EXPORT_FUNC(x) \ + asm volatile ( \ +" .globl " #x "\n" \ +#x ":\n" \ +" movhi r8, %%hi(%0)\n" \ +" ori r8, r0, %%lo(%0)\n" \ +" add r8, r0, r15\n" \ +" ldw r8, 0(r8)\n" \ +" ldw r8, %1(r8)\n" \ +" jmp r8\n" \ + : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r15"); #elif defined(CONFIG_M68K) /* * d7 holds the pointer to the global_data, a0 is a call-clobbered