Commit 1117cbf2 authored by Thomas Chou's avatar Thomas Chou Committed by Scott McNutt

nios: remove nios-32 arch

The nios-32 arch is obsolete and broken. So it is removed.
Signed-off-by: default avatarThomas Chou <[email protected]>
parent 6803336c
......@@ -841,22 +841,6 @@ Stefan Roese <[email protected]>
vct_xxx MIPS32 4Kc
#########################################################################
# Nios-32 Systems: #
# #
# Maintainer Name, Email Address #
# Board CPU #
#########################################################################
Stephan Linz <[email protected]>
DK1S10 Nios-32
ADNPESC1 Nios-32
Scott McNutt <[email protected]>
DK1C20 Nios-32
#########################################################################
# Nios-II Systems: #
# #
......
......@@ -810,21 +810,6 @@ LIST_x86=" \
${LIST_I486} \
"
#########################################################################
## NIOS Systems
#########################################################################
LIST_nios=" \
ADNPESC1 \
ADNPESC1_base_32 \
ADNPESC1_DNPEVA2_base_32\
DK1C20 \
DK1C20_standard_32 \
DK1S10 \
DK1S10_standard_32 \
DK1S10_mtx_ldk_20 \
"
#########################################################################
## Nios-II Systems
#########################################################################
......@@ -1017,7 +1002,7 @@ do
|coldfire \
|microblaze \
|mips|mips_el \
|nios|nios2 \
|nios2 \
|ppc|powerpc|5xx|5xxx|512x|8xx|8220|824x|8260|83xx|85xx|86xx|4xx|7xx|74xx|TSEC \
|sh|sh2|sh3|sh4 \
|sparc \
......
......@@ -3462,68 +3462,6 @@ purple_config : unconfig
#========================================================================
# Nios
#========================================================================
#########################################################################
## Nios32
#########################################################################
ADNPESC1_DNPEVA2_base_32_config \
ADNPESC1_base_32_config \
ADNPESC1_config: unconfig
@mkdir -p $(obj)include
@[ -z "$(findstring _DNPEVA2,[email protected])" ] || \
{ echo "#define CONFIG_DNPEVA2 1" >>$(obj)include/config.h ; \
$(XECHO) "... DNP/EVA2 configuration" ; \
}
@[ -z "$(findstring _base_32,[email protected])" ] || \
{ echo "#define CONFIG_NIOS_BASE_32 1" >>$(obj)include/config.h ; \
$(XECHO) "... NIOS 'base_32' configuration" ; \
}
@[ -z "$(findstring ADNPESC1_config,[email protected])" ] || \
{ echo "#define CONFIG_NIOS_BASE_32 1" >>$(obj)include/config.h ; \
$(XECHO) "... NIOS 'base_32' configuration (DEFAULT)" ; \
}
@$(MKCONFIG) -a ADNPESC1 nios nios adnpesc1 ssv
DK1C20_safe_32_config \
DK1C20_standard_32_config \
DK1C20_config: unconfig
@mkdir -p $(obj)include
@[ -z "$(findstring _safe_32,[email protected])" ] || \
{ echo "#define CONFIG_NIOS_SAFE_32 1" >>$(obj)include/config.h ; \
$(XECHO) "... NIOS 'safe_32' configuration" ; \
}
@[ -z "$(findstring _standard_32,[email protected])" ] || \
{ echo "#define CONFIG_NIOS_STANDARD_32 1" >>$(obj)include/config.h ; \
$(XECHO) "... NIOS 'standard_32' configuration" ; \
}
@[ -z "$(findstring DK1C20_config,[email protected])" ] || \
{ echo "#define CONFIG_NIOS_STANDARD_32 1" >>$(obj)include/config.h ; \
$(XECHO) "... NIOS 'standard_32' configuration (DEFAULT)" ; \
}
@$(MKCONFIG) -a DK1C20 nios nios dk1c20 altera
DK1S10_safe_32_config \
DK1S10_standard_32_config \
DK1S10_mtx_ldk_20_config \
DK1S10_config: unconfig
@mkdir -p $(obj)include
@[ -z "$(findstring _safe_32,[email protected])" ] || \
{ echo "#define CONFIG_NIOS_SAFE_32 1" >>$(obj)include/config.h ; \
$(XECHO) "... NIOS 'safe_32' configuration" ; \
}
@[ -z "$(findstring _standard_32,[email protected])" ] || \
{ echo "#define CONFIG_NIOS_STANDARD_32 1" >>$(obj)include/config.h ; \
$(XECHO) "... NIOS 'standard_32' configuration" ; \
}
@[ -z "$(findstring _mtx_ldk_20,[email protected])" ] || \
{ echo "#define CONFIG_NIOS_MTX_LDK_20 1" >>$(obj)include/config.h ; \
$(XECHO) "... NIOS 'mtx_ldk_20' configuration" ; \
}
@[ -z "$(findstring DK1S10_config,[email protected])" ] || \
{ echo "#define CONFIG_NIOS_STANDARD_32 1" >>$(obj)include/config.h ; \
$(XECHO) "... NIOS 'standard_32' configuration (DEFAULT)" ; \
}
@$(MKCONFIG) -a DK1S10 nios nios dk1s10 altera
#########################################################################
## Nios-II
......
......@@ -177,9 +177,6 @@ Directory Hierarchy:
/mips Files generic to MIPS architecture
/cpu CPU specific files
/lib Architecture specific library files
/nios Files generic to Altera NIOS architecture
/cpu CPU specific files
/lib Architecture specific library files
/nios2 Files generic to Altera NIOS2 architecture
/cpu CPU specific files
/lib Architecture specific library files
......@@ -3337,8 +3334,8 @@ details; basically, the header defines the following image properties:
Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, LynxOS,
INTEGRITY).
* Target CPU Architecture (Provisions for Alpha, ARM, AVR32, Intel x86,
IA64, MIPS, NIOS, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
Currently supported: ARM, AVR32, Intel x86, MIPS, NIOS, PowerPC).
IA64, MIPS, Nios II, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
Currently supported: ARM, AVR32, Intel x86, MIPS, Nios II, PowerPC).
* Compression Type (uncompressed, gzip, bzip2)
* Load Address
* Entry Point
......
#
# (C) Copyright 2003
# Psyent Corporation <www.psyent.com>
# Scott McNutt <[email protected]>
#
# 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
#
CROSS_COMPILE ?= nios-elf-
STANDALONE_LOAD_ADDR = 0x00800000 -L $(gcclibdir)/m32
PLATFORM_CPPFLAGS += -m32 -DCONFIG_NIOS -D__NIOS__ -ffixed-g7 -gstabs
#
# (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, [email protected]
#
# 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
#
include $(TOPDIR)/config.mk
LIB = $(obj)lib$(CPU).a
START = start.o
SOBJS = traps.o
COBJS = cpu.o interrupts.o serial.o asmi.o spi.o
SRCS := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS))
START := $(addprefix $(obj),$(START))
all: $(obj).depend $(START) $(LIB)
$(LIB): $(OBJS)
$(AR) $(ARFLAGS) [email protected] $(OBJS)
#########################################################################
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
sinclude $(obj).depend
#########################################################################
This diff is collapsed.
#
# (C) Copyright 2000
# Wolfgang Denk, DENX Software Engineering, [email protected]
#
# 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_RELFLAGS +=
/*
* (C) Copyright 2003, Psyent Corporation <www.psyent.com>
* Scott McNutt <[email protected]>
*
* 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
*/
#include <common.h>
#include <nios.h>
int checkcpu (void)
{
unsigned val;
unsigned rev_major;
unsigned rev_minor;
short nregs, hi_limit, lo_limit;
/* Get cpu version info */
val = rdctl (CTL_CPU_ID);
puts ("CPU: ");
printf ("%s", (val & 0x00008000) ? "Nios-16 " : "Nios-32 ");
rev_major = (val>>12) & 0x07;
rev_minor = (val>>4) & 0x0ff;
printf ("Rev. %d.%d (0x%04x)", rev_major, rev_minor,
val & 0xffff);
if (rev_major == 0x08)
printf (" [OpenCore (R) Plus]");
printf ("\n");
/* Check register file */
val = rdctl (CTL_WVALID);
lo_limit = val & 0x01f;
hi_limit = (val>>5) & 0x1f;
nregs = (hi_limit + 2) * 16;
printf ("Reg file size: %d LO_LIMIT/HI_LIMIT: %d/%d\n",
nregs, lo_limit, hi_limit);
return (0);
}
int do_reset (void)
{
/* trap 0 does the trick ... at least with the OCI debug
* present -- haven't tested without it yet (stm).
*/
disable_interrupts ();
ipri (1);
asm volatile ("trap 0\n");
/* No return ;-) */
return(0);
}
#if defined(CONFIG_WATCHDOG)
void watchdog_reset (void)
{
}
#endif /* CONFIG_WATCHDOG */
/*
* (C) Copyright 2000-2002
* Wolfgang Denk, DENX Software Engineering, [email protected]
*
* (C) Copyright 2003, Psyent Corporation <www.psyent.com>
* Scott McNutt <[email protected]>
*
* 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
*/
#include <nios.h>
#include <nios-io.h>
#include <asm/ptrace.h>
#include <common.h>
#include <command.h>
#include <watchdog.h>
#ifdef CONFIG_STATUS_LED
#include <status_led.h>
#endif
/****************************************************************************/
struct irq_action {
interrupt_handler_t *handler;
void *arg;
int count;
};
static struct irq_action irq_vecs[64];
/*************************************************************************/
volatile ulong timestamp = 0;
void reset_timer (void)
{
timestamp = 0;
}
ulong get_timer (ulong base)
{
WATCHDOG_RESET ();
return (timestamp - base);
}
void set_timer (ulong t)
{
timestamp = t;
}
/* The board must handle this interrupt if a timer is not
* provided.
*/
#if defined(CONFIG_SYS_NIOS_TMRBASE)
void timer_interrupt (struct pt_regs *regs)
{
/* Interrupt is cleared by writing anything to the
* status register.
*/
nios_timer_t *tmr = (nios_timer_t *)CONFIG_SYS_NIOS_TMRBASE;
tmr->status = 0;
timestamp += CONFIG_SYS_NIOS_TMRMS;
#ifdef CONFIG_STATUS_LED
status_led_tick(timestamp);
#endif
}
#endif
/*************************************************************************/
int disable_interrupts (void)
{
int val = 0;
/* Writing anything to CLR_IE disables interrupts */
val = rdctl (CTL_STATUS);
wrctl (CTL_CLR_IE, 0);
return (val & STATUS_IE);
}
void enable_interrupts( void )
{
/* Writing anything SET_IE enables interrupts */
wrctl (CTL_SET_IE, 0);
}
void external_interrupt (struct pt_regs *regs)
{
unsigned vec;
vec = (regs->status & STATUS_IPRI) >> 9; /* ipri */
irq_vecs[vec].count++;
if (irq_vecs[vec].handler != NULL) {
(*irq_vecs[vec].handler)(irq_vecs[vec].arg);
} else {
/* A sad side-effect of masking a bogus interrupt is
* that lower priority interrupts will also be disabled.
* This is probably not what we want ... so hang insted.
*/
printf ("Unhandled interrupt: 0x%x\n", vec);
disable_interrupts ();
hang ();
}
}
/*************************************************************************/
int interrupt_init (void)
{
int vec;
#if defined(CONFIG_SYS_NIOS_TMRBASE)
nios_timer_t *tmr = (nios_timer_t *)CONFIG_SYS_NIOS_TMRBASE;
tmr->control &= ~NIOS_TIMER_ITO;
tmr->control |= NIOS_TIMER_STOP;
#if defined(CONFIG_SYS_NIOS_TMRCNT)
tmr->periodl = CONFIG_SYS_NIOS_TMRCNT & 0xffff;
tmr->periodh = (CONFIG_SYS_NIOS_TMRCNT >> 16) & 0xffff;
#endif
#endif
for (vec=0; vec<64; vec++ ) {
irq_vecs[vec].handler = NULL;
irq_vecs[vec].arg = NULL;
irq_vecs[vec].count = 0;
}
/* Need timus interruptus -- start the lopri timer */
#if defined(CONFIG_SYS_NIOS_TMRBASE)
tmr->control |= ( NIOS_TIMER_ITO |
NIOS_TIMER_CONT |
NIOS_TIMER_START );
ipri (CONFIG_SYS_NIOS_TMRIRQ + 1);
#endif
enable_interrupts ();
return (0);
}
void irq_install_handler (int vec, interrupt_handler_t *handler, void *arg)
{
struct irq_action *irqa = irq_vecs;
int i = vec;
int flag;
if (irqa[i].handler != NULL) {
printf ("Interrupt vector %d: handler 0x%x "
"replacing 0x%x\n",
vec, (uint)handler, (uint)irqa[i].handler);
}
flag = disable_interrupts ();
irqa[i].handler = handler;
irqa[i].arg = arg;
if (flag )
enable_interrupts ();
}
/*************************************************************************/
#if defined(CONFIG_CMD_IRQ)
int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
int vec;
printf ("\nInterrupt-Information:\n");
printf ("Nr Routine Arg Count\n");
for (vec=0; vec<64; vec++) {
if (irq_vecs[vec].handler != NULL) {
printf ("%02d %08lx %08lx %d\n",
vec,
(ulong)irq_vecs[vec].handler<<1,
(ulong)irq_vecs[vec].arg,
irq_vecs[vec].count);
}
}
return (0);
}
#endif
/*
* (C) Copyright 2003, Psyent Corporation <www.psyent.com>
* Scott McNutt <[email protected]>
*
* 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
*/
#include <common.h>
#include <watchdog.h>
#include <nios-io.h>
DECLARE_GLOBAL_DATA_PTR;
/*------------------------------------------------------------------
* JTAG acts as the serial port
*-----------------------------------------------------------------*/
#if defined(CONFIG_CONSOLE_JTAG)
static nios_jtag_t *jtag = (nios_jtag_t *)CONFIG_SYS_NIOS_CONSOLE;
void serial_setbrg( void ){ return; }
int serial_init( void ) { return(0);}
void serial_putc (char c)
{
while ((jtag->txcntl & NIOS_JTAG_TRDY) != 0)
WATCHDOG_RESET ();
jtag->txcntl = NIOS_JTAG_TRDY | (unsigned char)c;
}
void serial_puts (const char *s)
{
while (*s != 0)
serial_putc (*s++);
}
int serial_tstc (void)
{
return (jtag->rxcntl & NIOS_JTAG_RRDY);
}
int serial_getc (void)
{
int c;
while (serial_tstc() == 0)
WATCHDOG_RESET ();
c = jtag->rxcntl & 0x0ff;
jtag->rxcntl = 0;
return (c);
}
/*------------------------------------------------------------------
* UART the serial port
*-----------------------------------------------------------------*/
#else
static nios_uart_t *uart = (nios_uart_t *)CONFIG_SYS_NIOS_CONSOLE;
#if defined(CONFIG_SYS_NIOS_FIXEDBAUD)
/* Everything's already setup for fixed-baud PTF
* assignment
*/
void serial_setbrg (void){ return; }
int serial_init (void) { return (0);}
#else
void serial_setbrg (void)
{
unsigned div;
div = (CONFIG_SYS_CLK_FREQ/gd->baudrate)-1;
uart->divisor = div;
return;
}
int serial_init (void)
{
serial_setbrg ();
return (0);
}
#endif /* CONFIG_SYS_NIOS_FIXEDBAUD */
/*-----------------------------------------------------------------------
* UART CONSOLE
*---------------------------------------------------------------------*/
void serial_putc (char c)
{
if (c == '\n')
serial_putc ('\r');
while ((uart->status & NIOS_UART_TRDY) == 0)
WATCHDOG_RESET ();
uart->txdata = (unsigned char)c;
}
void serial_puts (const char *s)
{
while (*s != 0) {
serial_putc (*s++);
}
}
int serial_tstc (void)
{
return (uart->status & NIOS_UART_RRDY);
}
int serial_getc (void)
{
while (serial_tstc () == 0)
WATCHDOG_RESET ();
return( uart->rxdata & 0x00ff );
}
#endif /* CONFIG_JTAG_CONSOLE */
/*
* (C) Copyright 2004, Li-Pro.Net <www.li-pro.net>
* Stephan Linz <[email protected]>
*
* 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
*/
#include <common.h>
#include <linux/ctype.h>
#if defined(CONFIG_NIOS_SPI)
#include <nios-io.h>
#include <spi.h>
#if !defined(CONFIG_SYS_NIOS_SPIBASE)
#error "*** CONFIG_SYS_NIOS_SPIBASE not defined ***"
#endif
#if !defined(CONFIG_SYS_NIOS_SPIBITS)
#error "*** CONFIG_SYS_NIOS_SPIBITS not defined ***"
#endif
#if (CONFIG_SYS_NIOS_SPIBITS != 8) && (CONFIG_SYS_NIOS_SPIBITS != 16)
#error "*** CONFIG_SYS_NIOS_SPIBITS should be either 8 or 16 ***"
#endif
static nios_spi_t *spi = (nios_spi_t *)CONFIG_SYS_NIOS_SPIBASE;
/* Warning:
* You cannot enable DEBUG for early system initalization, i. e. when
* this driver is used to read environment parameters like "baudrate"
* from EEPROM which are used to initialize the serial port which is