diff options
Diffstat (limited to 'arch/nios2/include')
24 files changed, 0 insertions, 974 deletions
diff --git a/arch/nios2/include/asm/bitops.h b/arch/nios2/include/asm/bitops.h deleted file mode 100644 index e77ab83202..0000000000 --- a/arch/nios2/include/asm/bitops.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - * - * - */ - -#ifndef _ASM_BITOPS_H_ -#define _ASM_BITOPS_H_ - -#include <asm-generic/bitops/__ffs.h> -#include <asm-generic/bitops/__fls.h> -#include <asm-generic/bitops/ffs.h> -#include <asm-generic/bitops/fls.h> -#include <asm-generic/bitops/ffz.h> -#include <asm-generic/bitops/hweight.h> -#include <asm-generic/bitops/fls64.h> -#include <asm-generic/bitops/find.h> -#include <asm-generic/bitops/ops.h> - -#define set_bit(x, y) __set_bit(x, y) -#define clear_bit(x, y) __clear_bit(x, y) -#define change_bit(x, y) __change_bit(x, y) -#define test_and_set_bit(x, y) __test_and_set_bit(x, y) -#define test_and_clear_bit(x, y) __test_and_clear_bit(x, y) -#define test_and_change_bit(x, y) __test_and_change_bit(x, y) - -#endif /* _ASM_BITOPS_H_ */ diff --git a/arch/nios2/include/asm/bitsperlong.h b/arch/nios2/include/asm/bitsperlong.h deleted file mode 100644 index 6dc0bb0c13..0000000000 --- a/arch/nios2/include/asm/bitsperlong.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/bitsperlong.h> diff --git a/arch/nios2/include/asm/byteorder.h b/arch/nios2/include/asm/byteorder.h deleted file mode 100644 index 9558416d57..0000000000 --- a/arch/nios2/include/asm/byteorder.h +++ /dev/null @@ -1 +0,0 @@ -#include <linux/byteorder/little_endian.h> diff --git a/arch/nios2/include/asm/cache.h b/arch/nios2/include/asm/cache.h deleted file mode 100644 index d9de8f999a..0000000000 --- a/arch/nios2/include/asm/cache.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2003 Microtronix Datacom Ltd. - * Copyright (C) 2000-2002 Greg Ungerer <gerg@snapgear.com> - * - * Ported from m68knommu. - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - */ - -#ifndef _ASM_NIOS2_CACHEFLUSH_H -#define _ASM_NIOS2_CACHEFLUSH_H - -void flush_cache_all(void); -void flush_dcache_all(void); -void flush_icache_all(void); -void flush_icache_range(unsigned long start, unsigned long end); -void flush_dcache_range(unsigned long start, unsigned long end); - -#endif /* _ASM_NIOS2_CACHEFLUSH_H */ diff --git a/arch/nios2/include/asm/common.h b/arch/nios2/include/asm/common.h deleted file mode 100644 index 027dca2d56..0000000000 --- a/arch/nios2/include/asm/common.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _ASM_COMMON_H -#define __ASM_COMMON_H - -#endif /* _ASM_COMMON_H */ diff --git a/arch/nios2/include/asm/dma-mapping.h b/arch/nios2/include/asm/dma-mapping.h deleted file mode 100644 index 5ecc1ed21e..0000000000 --- a/arch/nios2/include/asm/dma-mapping.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef __ASM_NIOS2_DMA_MAPPING_H -#define __ASM_NIOS2_DMA_MAPPING_H - -#include <common.h> -#include <xfuncs.h> - -#include <asm/cache.h> - -/* dma_alloc_coherent() return cache-line aligned allocation which is mapped - * to uncached io region. - * - * IO_REGION_BASE should be defined in board config header file - * 0x80000000 for nommu, 0xe0000000 for mmu - */ - -#if (DCACHE_SIZE != 0) -static inline void *dma_alloc_coherent(size_t len, dma_addr_t *handle) -{ - void *addr = malloc(len + DCACHE_LINE_SIZE); - if (!addr) - return 0; - flush_dcache_range((unsigned long)addr,(unsigned long)addr + len + DCACHE_LINE_SIZE); - if (handle) - *handle = ((dma_addr_t)addr + (DCACHE_LINE_SIZE - 1)) & - ~(DCACHE_LINE_SIZE - 1) & ~(IO_REGION_BASE); - return (void *)(*handle | IO_REGION_BASE); -} -#else -static inline void *dma_alloc_coherent(size_t len, dma_addr_t *handle) -{ - void *addr = malloc(len); - if (!addr) - return 0; - if (handle) - *handle = (dma_addr_t)addr; - return (void *)(*handle | IO_REGION_BASE); -} -#endif - -#if (DCACHE_SIZE != 0) -#define dma_alloc dma_alloc -static inline void *dma_alloc(size_t size) -{ - return xmemalign(DCACHE_LINE_SIZE, ALIGN(size, DCACHE_LINE_SIZE)); -} -#endif - -#endif /* __ASM_NIOS2_DMA_MAPPING_H */ diff --git a/arch/nios2/include/asm/dma.h b/arch/nios2/include/asm/dma.h deleted file mode 100644 index 8f709d2dbf..0000000000 --- a/arch/nios2/include/asm/dma.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (C) 2012 by Marc Kleine-Budde <mkl@pengutronix.de> - * - * This file is released under the GPLv2 - * - */ - -#include <asm/dma-mapping.h> diff --git a/arch/nios2/include/asm/early_printf.h b/arch/nios2/include/asm/early_printf.h deleted file mode 100644 index e483e345fe..0000000000 --- a/arch/nios2/include/asm/early_printf.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _EARLY_PRINTF_ -#define _EARLY_PRINTF_ - -#include <asm/nios2-io.h> - -void early_putc(char ch); -void early_puts(const char *s); -int early_printf(const char *fmt, ...); - -#endif /* _EARLY_PRINTF_ */ diff --git a/arch/nios2/include/asm/elf.h b/arch/nios2/include/asm/elf.h deleted file mode 100644 index 6060e1ee6e..0000000000 --- a/arch/nios2/include/asm/elf.h +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (C) 2011 Tobias Klauser <tklauser@distanz.ch> - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive - * for more details. - */ - -#ifndef _ASM_NIOS2_ELF_H -#define _ASM_NIOS2_ELF_H - -/* Relocation types */ -#define R_NIOS2_NONE 0 -#define R_NIOS2_S16 1 -#define R_NIOS2_U16 2 -#define R_NIOS2_PCREL16 3 -#define R_NIOS2_CALL26 4 -#define R_NIOS2_IMM5 5 -#define R_NIOS2_CACHE_OPX 6 -#define R_NIOS2_IMM6 7 -#define R_NIOS2_IMM8 8 -#define R_NIOS2_HI16 9 -#define R_NIOS2_LO16 10 -#define R_NIOS2_HIADJ16 11 -#define R_NIOS2_BFD_RELOC_32 12 -#define R_NIOS2_BFD_RELOC_16 13 -#define R_NIOS2_BFD_RELOC_8 14 -#define R_NIOS2_GPREL 15 -#define R_NIOS2_GNU_VTINHERIT 16 -#define R_NIOS2_GNU_VTENTRY 17 -#define R_NIOS2_UJMP 18 -#define R_NIOS2_CJMP 19 -#define R_NIOS2_CALLR 20 -#define R_NIOS2_ALIGN 21 -/* Keep this the last entry. */ -#define R_NIOS2_NUM 22 - -#include <asm/ptrace.h> - -typedef unsigned long elf_greg_t; - -#define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t)) -typedef elf_greg_t elf_gregset_t[ELF_NGREG]; - -typedef unsigned long elf_fpregset_t; - -/* - * This is used to ensure we don't load something for the wrong architecture. - */ -#define elf_check_arch(x) ((x)->e_machine == EM_ALTERA_NIOS2) - -/* - * These are used to set parameters in the core dumps. - */ -#define ELF_CLASS ELFCLASS32 -#define ELF_DATA ELFDATA2LSB -#define ELF_ARCH EM_ALTERA_NIOS2 - -#define ELF_PLAT_INIT(_r, load_addr) - -#define USE_ELF_CORE_DUMP -#define ELF_EXEC_PAGESIZE 4096 - -/* This is the location that an ET_DYN program is loaded if exec'ed. Typical - use of this is to invoke "./ld.so someprog" to test out a new version of - the loader. We need to make sure that it is out of the way of the program - that it will "exec", and that there is sufficient room for the brk. */ - -#define ELF_ET_DYN_BASE 0xD0000000UL - -/* regs is struct pt_regs, pr_reg is elf_gregset_t (which is - now struct_user_regs, they are different) */ - -#ifdef CONFIG_MMU -#define ELF_CORE_COPY_REGS(pr_reg, regs) \ - do { \ - pr_reg[0] = regs->r8; \ - pr_reg[1] = regs->r9; \ - pr_reg[2] = regs->r10; \ - pr_reg[3] = regs->r11; \ - pr_reg[4] = regs->r12; \ - pr_reg[5] = regs->r13; \ - pr_reg[6] = regs->r14; \ - pr_reg[7] = regs->r15; \ - pr_reg[8] = regs->r1; \ - pr_reg[9] = regs->r2; \ - pr_reg[10] = regs->r3; \ - pr_reg[11] = regs->r4; \ - pr_reg[12] = regs->r5; \ - pr_reg[13] = regs->r6; \ - pr_reg[14] = regs->r7 \ - pr_reg[15] = regs->orig_r2; \ - pr_reg[16] = regs->ra; \ - pr_reg[17] = regs->fp; \ - pr_reg[18] = regs->sp; \ - pr_reg[19] = regs->gp; \ - pr_reg[20] = regs->estatus; \ - pr_reg[21] = regs->ea; \ - pr_reg[22] = regs->orig_r7; \ - { \ - struct switch_stack *sw = ((struct switch_stack *)regs) - 1; \ - pr_reg[23] = sw->r16; \ - pr_reg[24] = sw->r17; \ - pr_reg[25] = sw->r18; \ - pr_reg[26] = sw->r19; \ - pr_reg[27] = sw->r20; \ - pr_reg[28] = sw->r21; \ - pr_reg[29] = sw->r22; \ - pr_reg[30] = sw->r23; \ - pr_reg[31] = sw->fp; \ - pr_reg[32] = sw->gp; \ - pr_reg[33] = sw->ra; \ - } \ - } while (0) -#else -#define ELF_CORE_COPY_REGS(pr_reg, regs) \ - do { \ - pr_reg[0] = regs->r1; \ - pr_reg[1] = regs->r2; \ - pr_reg[2] = regs->r3; \ - pr_reg[3] = regs->r4; \ - pr_reg[4] = regs->r5; \ - pr_reg[5] = regs->r6; \ - pr_reg[6] = regs->r7; \ - pr_reg[7] = regs->r8; \ - pr_reg[8] = regs->r9; \ - pr_reg[9] = regs->r10; \ - pr_reg[10] = regs->r11; \ - pr_reg[11] = regs->r12; \ - pr_reg[12] = regs->r13; \ - pr_reg[13] = regs->r14; \ - pr_reg[14] = regs->r15; \ - pr_reg[23] = regs->sp; \ - pr_reg[26] = regs->estatus; \ - { \ - struct switch_stack *sw = ((struct switch_stack *)regs) - 1; \ - pr_reg[15] = sw->r16; \ - pr_reg[16] = sw->r17; \ - pr_reg[17] = sw->r18; \ - pr_reg[18] = sw->r19; \ - pr_reg[19] = sw->r20; \ - pr_reg[20] = sw->r21; \ - pr_reg[21] = sw->r22; \ - pr_reg[22] = sw->r23; \ - pr_reg[24] = sw->fp; \ - pr_reg[25] = sw->gp; \ - } \ - } while (0) - -#endif /* CONFIG_MMU */ - -/* This yields a mask that user programs can use to figure out what - instruction set this cpu supports. */ - -#define ELF_HWCAP (0) - -/* This yields a string that ld.so will use to load implementation - specific libraries for optimization. This is more specific in - intent than poking at uname or /proc/cpuinfo. */ - -#define ELF_PLATFORM (NULL) - -#define SET_PERSONALITY(ex) set_personality(PER_LINUX_32BIT) - -#endif diff --git a/arch/nios2/include/asm/int-ll64.h b/arch/nios2/include/asm/int-ll64.h deleted file mode 100644 index f394147c07..0000000000 --- a/arch/nios2/include/asm/int-ll64.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * asm-generic/int-ll64.h - * - * Integer declarations for architectures which use "long long" - * for 64-bit types. - */ - -#ifndef _ASM_GENERIC_INT_LL64_H -#define _ASM_GENERIC_INT_LL64_H - -#include <asm/bitsperlong.h> - -#ifndef __ASSEMBLY__ -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#ifdef __GNUC__ -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#else -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -#endif /* __ASSEMBLY__ */ - -#ifdef __KERNEL__ - -#ifndef __ASSEMBLY__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#define S8_C(x) x -#define U8_C(x) x ## U -#define S16_C(x) x -#define U16_C(x) x ## U -#define S32_C(x) x -#define U32_C(x) x ## U -#define S64_C(x) x ## LL -#define U64_C(x) x ## ULL - -#else /* __ASSEMBLY__ */ - -#define S8_C(x) x -#define U8_C(x) x -#define S16_C(x) x -#define U16_C(x) x -#define S32_C(x) x -#define U32_C(x) x -#define S64_C(x) x -#define U64_C(x) x - -#endif /* __ASSEMBLY__ */ - -#endif /* __KERNEL__ */ - -#endif /* _ASM_GENERIC_INT_LL64_H */ diff --git a/arch/nios2/include/asm/io.h b/arch/nios2/include/asm/io.h deleted file mode 100644 index 59eea73ac2..0000000000 --- a/arch/nios2/include/asm/io.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * (C) Copyright 2004, Psyent Corporation <www.psyent.com> - * Scott McNutt <smcnutt@psyent.com> - * - * 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. - * - */ - -#ifndef __ASM_NIOS2_IO_H_ -#define __ASM_NIOS2_IO_H_ - -#include <asm/byteorder.h> - -#define IO_SPACE_LIMIT 0 - -#define __raw_writeb(v, a) (*(volatile unsigned char *)(a) = (v)) -#define __raw_writew(v, a) (*(volatile unsigned short *)(a) = (v)) -#define __raw_writel(v, a) (*(volatile unsigned int *)(a) = (v)) - -#define __raw_readb(a) (*(volatile unsigned char *)(a)) -#define __raw_readw(a) (*(volatile unsigned short *)(a)) -#define __raw_readl(a) (*(volatile unsigned int *)(a)) - -#define readb(addr)\ - ({unsigned char val;\ - asm volatile("ldbio %0, 0(%1)" : "=r"(val) : "r" (addr)); val; }) -#define readw(addr)\ - ({unsigned short val;\ - asm volatile("ldhio %0, 0(%1)" : "=r"(val) : "r" (addr)); val; }) -#define readl(addr)\ - ({unsigned int val;\ - asm volatile("ldwio %0, 0(%1)" : "=r"(val) : "r" (addr)); val; }) - -#define writeb(val, addr)\ - asm volatile("stbio %0, 0(%1)" : : "r" (val), "r" (addr)) -#define writew(val, addr)\ - asm volatile ("sthio %0, 0(%1)" : : "r" (val), "r" (addr)) -#define writel(val, addr)\ - asm volatile("stwio %0, 0(%1)" : : "r" (val), "r" (addr)) - -#endif /* __ASM_NIOS2_IO_H_ */ diff --git a/arch/nios2/include/asm/mmu.h b/arch/nios2/include/asm/mmu.h deleted file mode 100644 index 95af871420..0000000000 --- a/arch/nios2/include/asm/mmu.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ASM_MMU_H -#define __ASM_MMU_H - -#define MAP_ARCH_DEFAULT MAP_UNCACHED - -#endif /* __ASM_MMU_H */ diff --git a/arch/nios2/include/asm/nios2-io.h b/arch/nios2/include/asm/nios2-io.h deleted file mode 100644 index cc8a9453e3..0000000000 --- a/arch/nios2/include/asm/nios2-io.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * (C) Copyright 2004, Psyent Corporation <www.psyent.com> - * Scott McNutt <smcnutt@psyent.com> - * - * 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. - * - */ - -/************************************************************************* - * Altera Nios2 Standard Peripherals - ************************************************************************/ - -#ifndef __NIOS2IO_H__ -#define __NIOS2IO_H__ - -/*------------------------------------------------------------------------ - * UART (http://www.altera.com/literature/ds/ds_nios_uart.pdf) - *----------------------------------------------------------------------*/ -struct nios_uart { - unsigned rxdata; /* Rx data reg */ - unsigned txdata; /* Tx data reg */ - unsigned status; /* Status reg */ - unsigned control; /* Control reg */ - unsigned divisor; /* Baud rate divisor reg */ - unsigned endofpacket; /* End-of-packet reg */ -}; - -/* status register */ -#define NIOS_UART_PE (1 << 0) /* parity error */ -#define NIOS_UART_FE (1 << 1) /* frame error */ -#define NIOS_UART_BRK (1 << 2) /* break detect */ -#define NIOS_UART_ROE (1 << 3) /* rx overrun */ -#define NIOS_UART_TOE (1 << 4) /* tx overrun */ -#define NIOS_UART_TMT (1 << 5) /* tx empty */ -#define NIOS_UART_TRDY (1 << 6) /* tx ready */ -#define NIOS_UART_RRDY (1 << 7) /* rx ready */ -#define NIOS_UART_E (1 << 8) /* exception */ -#define NIOS_UART_DCTS (1 << 10) /* cts change */ -#define NIOS_UART_CTS (1 << 11) /* cts */ -#define NIOS_UART_EOP (1 << 12) /* eop detected */ - -/* control register */ -#define NIOS_UART_IPE (1 << 0) /* parity error int ena*/ -#define NIOS_UART_IFE (1 << 1) /* frame error int ena */ -#define NIOS_UART_IBRK (1 << 2) /* break detect int ena */ -#define NIOS_UART_IROE (1 << 3) /* rx overrun int ena */ -#define NIOS_UART_ITOE (1 << 4) /* tx overrun int ena */ -#define NIOS_UART_ITMT (1 << 5) /* tx empty int ena */ -#define NIOS_UART_ITRDY (1 << 6) /* tx ready int ena */ -#define NIOS_UART_IRRDY (1 << 7) /* rx ready int ena */ -#define NIOS_UART_IE (1 << 8) /* exception int ena */ -#define NIOS_UART_TBRK (1 << 9) /* transmit break */ -#define NIOS_UART_IDCTS (1 << 10) /* cts change int ena */ -#define NIOS_UART_RTS (1 << 11) /* rts */ -#define NIOS_UART_IEOP (1 << 12) /* eop detected int ena */ - - -/*------------------------------------------------------------------------ - * TIMER (http://www.altera.com/literature/ds/ds_nios_timer.pdf) - *----------------------------------------------------------------------*/ -struct nios_timer { - unsigned status; /* Timer status reg */ - unsigned control; /* Timer control reg */ - unsigned periodl; /* Timeout period low */ - unsigned periodh; /* Timeout period high */ - unsigned snapl; /* Snapshot low */ - unsigned snaph; /* Snapshot high */ -}; - -struct nios_timer_64 { - unsigned status; /* Timer status reg */ - unsigned control; /* Timer control reg */ - unsigned period0; /* Timeout period low */ - unsigned period1; /* Timeout period high */ - unsigned period2; /* Timeout period low */ - unsigned period3; /* Timeout period high */ - unsigned snap0; /* Snapshot low */ - unsigned snap1; /* Snapshot high */ - unsigned snap2; /* Snapshot low */ - unsigned snap3; /* Snapshot high */ -}; - -/* status register */ -#define NIOS_TIMER_TO (1 << 0) /* Timeout */ -#define NIOS_TIMER_RUN (1 << 1) /* Timer running */ - -/* control register */ -#define NIOS_TIMER_ITO (1 << 0) /* Timeout int ena */ -#define NIOS_TIMER_CONT (1 << 1) /* Continuous mode */ -#define NIOS_TIMER_START (1 << 2) /* Start timer */ -#define NIOS_TIMER_STOP (1 << 3) /* Stop timer */ - - -/*------------------------------------------------------------------------ - * PIO (http://www.altera.com/literature/ds/ds_nios_pio.pdf) - *----------------------------------------------------------------------*/ -struct nios_pio { - unsigned int data; /* Data value at each PIO in/out */ - unsigned int direction; /* Data direct. for each PIO bit */ - unsigned int interruptmask; /* Per-bit IRQ enable/disable */ - unsigned int edgecapture; /* Per-bit sync. edge detect & hold */ -}; - -/* direction register */ -#define NIOS_PIO_OUT (1) /* PIO bit is output */ -#define NIOS_PIO_IN (0) /* PIO bit is input */ - - -/*------------------------------------------------------------------------ - * SPI (http://www.altera.com/literature/ds/ds_nios_spi.pdf) - *----------------------------------------------------------------------*/ -struct nios_spi { - unsigned rxdata; /* Rx data reg */ - unsigned txdata; /* Tx data reg */ - unsigned status; /* Status reg */ - unsigned control; /* Control reg */ - unsigned reserved; /* (master only) */ - unsigned slaveselect; /* SPI slave select mask (master only) */ -}; - -/* status register */ -#define NIOS_SPI_ROE (1 << 3) /* rx overrun */ -#define NIOS_SPI_TOE (1 << 4) /* tx overrun */ -#define NIOS_SPI_TMT (1 << 5) /* tx empty */ -#define NIOS_SPI_TRDY (1 << 6) /* tx ready */ -#define NIOS_SPI_RRDY (1 << 7) /* rx ready */ -#define NIOS_SPI_E (1 << 8) /* exception */ - -/* control register */ -#define NIOS_SPI_IROE (1 << 3) /* rx overrun int ena */ -#define NIOS_SPI_ITOE (1 << 4) /* tx overrun int ena */ -#define NIOS_SPI_ITRDY (1 << 6) /* tx ready int ena */ -#define NIOS_SPI_IRRDY (1 << 7) /* rx ready int ena */ -#define NIOS_SPI_IE (1 << 8) /* exception int ena */ -#define NIOS_SPI_SSO (1 << 10) /* override SS_n output */ - -/*------------------------------------------------------------------------ - * JTAG UART - *----------------------------------------------------------------------*/ -struct nios_jtag { - unsigned data; /* Data register */ - unsigned control; /* Control register */ -}; - -/* data register */ -#define NIOS_JTAG_RVALID (1<<15) /* Read valid */ -#define NIOS_JTAG_DATA(d) ((d)&0x0ff) /* Read data */ -#define NIOS_JTAG_RAVAIL(d) ((d)>>16) /* Read space avail */ - -/* control register */ -#define NIOS_JTAG_RE (1 << 0) /* read intr enable */ -#define NIOS_JTAG_WE (1 << 1) /* write intr enable */ -#define NIOS_JTAG_RI (1 << 8) /* read intr pending */ -#define NIOS_JTAG_WI (1 << 9) /* write intr pending*/ -#define NIOS_JTAG_AC (1 << 10) /* activity indicator */ -#define NIOS_JTAG_RRDY (1 << 12) /* read available */ -#define NIOS_JTAG_WSPACE(d) ((d)>>16) /* Write space avail */ - -/*------------------------------------------------------------------------ - * SYSTEM ID - *----------------------------------------------------------------------*/ -struct nios_sysid { - unsigned id; /* The system build id*/ - unsigned timestamp; /* Timestamp */ -}; - -#endif /* __NIOS2IO_H__ */ diff --git a/arch/nios2/include/asm/nios2.h b/arch/nios2/include/asm/nios2.h deleted file mode 100644 index a2d8e22140..0000000000 --- a/arch/nios2/include/asm/nios2.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * (C) Copyright 2004, Psyent Corporation <www.psyent.com> - * Scott McNutt <smcnutt@psyent.com> - * - * 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. - * - */ - -#ifndef __NIOS2_H__ -#define __NIOS2_H__ - -/*------------------------------------------------------------------------ - * Control registers -- use with wrctl() & rdctl() - *----------------------------------------------------------------------*/ -#define CTL_STATUS 0 /* Processor status reg */ -#define CTL_ESTATUS 1 /* Exception status reg */ -#define CTL_BSTATUS 2 /* Break status reg */ -#define CTL_IENABLE 3 /* Interrut enable reg */ -#define CTL_IPENDING 4 /* Interrut pending reg */ - -/*------------------------------------------------------------------------ - * Access to control regs - *----------------------------------------------------------------------*/ -#define _str_(x) #x - -#define rdctl(reg)\ - ({unsigned int val;\ - asm volatile("rdctl %0, ctl" _str_(reg)\ - : "=r" (val)); val; }) - -#define wrctl(reg, val)\ - asm volatile("wrctl ctl" _str_(reg) ",%0"\ - : : "r" (val)) - -/*------------------------------------------------------------------------ - * Control reg bit masks - *----------------------------------------------------------------------*/ -#define STATUS_IE (1<<0) /* Interrupt enable */ -#define STATUS_U (1<<1) /* User-mode */ - -/*------------------------------------------------------------------------ - * Bit-31 Cache bypass -- only valid for data access. When data cache - * is not implemented, bit 31 is ignored for compatibility. - *----------------------------------------------------------------------*/ -#define CACHE_BYPASS(a) ((a) | 0x80000000) -#define CACHE_NO_BYPASS(a) ((a) & ~0x80000000) - -#endif /* __NIOS2_H__ */ diff --git a/arch/nios2/include/asm/opcodes.h b/arch/nios2/include/asm/opcodes.h deleted file mode 100644 index 21792dc7ec..0000000000 --- a/arch/nios2/include/asm/opcodes.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * (C) Copyright 2004, Psyent Corporation <www.psyent.com> - * Scott McNutt <smcnutt@psyent.com> - * - * 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. - * - */ - -#ifndef __ASM_NIOS2_OPCODES_H_ -#define __ASM_NIOS2_OPCODES_H_ - -#define OPCODE_OP(inst) ((inst) & 0x3f) -#define OPCODE_OPX(inst) (((inst)>>11) & 0x3f) -#define OPCODE_RA(inst) (((inst)>>27) & 01f) -#define OPCODE_RB(inst) (((inst)>>22) & 01f) -#define OPCODE_RC(inst) (((inst)>>17) & 01f) - -/* I-TYPE (immediate) and J-TYPE (jump) opcodes - */ -#define OPCODE_CALL 0x00 -#define OPCODE_LDBU 0x03 -#define OPCODE_ADDI 0x04 -#define OPCODE_STB 0x05 -#define OPCODE_BR 0x06 -#define OPCODE_LDB 0x07 -#define OPCODE_CMPGEI 0x08 -#define OPCODE_LDHU 0x0B -#define OPCODE_ANDI 0x0C -#define OPCODE_STH 0x0D -#define OPCODE_BGE 0x0E -#define OPCODE_LDH 0x0F -#define OPCODE_CMPLTI 0x10 -#define OPCODE_XORI 0x1C -#define OPCODE_ORI 0x14 -#define OPCODE_STW 0x15 -#define OPCODE_BLT 0x16 -#define OPCODE_LDW 0x17 -#define OPCODE_CMPNEI 0x18 -#define OPCODE_BNE 0x1E -#define OPCODE_CMPEQI 0x20 -#define OPCODE_LDBUIO 0x23 -#define OPCODE_MULI 0x24 -#define OPCODE_STBIO 0x25 -#define OPCODE_BEQ 0x26 -#define OPCODE_LDBIO 0x27 -#define OPCODE_CMPGEUI 0x28 -#define OPCODE_ANDHI 0x2C -#define OPCODE_STHIO 0x2D -#define OPCODE_BGEU 0x2E -#define OPCODE_LDHIO 0x2F -#define OPCODE_CMPLTUI 0x30 -#define OPCODE_CUSTOM 0x32 -#define OPCODE_INITD 0x33 -#define OPCODE_ORHI 0x34 -#define OPCODE_STWIO 0x35 -#define OPCODE_BLTU 0x36 -#define OPCODE_LDWIO 0x37 -#define OPCODE_RTYPE 0x3A -#define OPCODE_LDHUIO 0x2B -#define OPCODE_FLUSHD 0x3B -#define OPCODE_XORHI 0x3C - -/* R-Type (register) OPX field encodings - */ -#define OPCODE_ERET 0x01 -#define OPCODE_ROLI 0x02 -#define OPCODE_ROL 0x03 -#define OPCODE_FLUSHP 0x04 -#define OPCODE_RET 0x05 -#define OPCODE_NOR 0x06 -#define OPCODE_MULXUU 0x07 -#define OPCODE_CMPGE 0x08 -#define OPCODE_BRET 0x09 -#define OPCODE_ROR 0x0B -#define OPCODE_FLUSHI 0x0C -#define OPCODE_JMP 0x0D -#define OPCODE_AND 0x0E - -#define OPCODE_CMPLT 0x10 -#define OPCODE_SLLI 0x12 -#define OPCODE_SLL 0x13 -#define OPCODE_OR 0x16 -#define OPCODE_MULXSU 0x17 -#define OPCODE_CMPNE 0x18 -#define OPCODE_SRLI 0x1A -#define OPCODE_SRL 0x1B -#define OPCODE_NEXTPC 0x1C -#define OPCODE_CALLR 0x1D -#define OPCODE_XOR 0x1E -#define OPCODE_MULXSS 0x1F - -#define OPCODE_CMPEQ 0x20 -#define OPCODE_CMPLTU 0x30 -#define OPCODE_ADD 0x31 -#define OPCODE_DIVU 0x24 -#define OPCODE_DIV 0x25 -#define OPCODE_RDCTL 0x26 -#define OPCODE_MUL 0x27 -#define OPCODE_CMPGEU 0x28 -#define OPCODE_TRAP 0x2D -#define OPCODE_WRCTL 0x2E - -#define OPCODE_BREAK 0x34 -#define OPCODE_SYNC 0x36 -#define OPCODE_INITI 0x29 -#define OPCODE_SUB 0x39 -#define OPCODE_SRAI 0x3A -#define OPCODE_SRA 0x3B - -/*Full instruction encodings for R-Type, without the R's ;-) - * - * TODO: BREAK, BRET, ERET, RET, SYNC (as needed) - */ -#define OPC_TRAP 0x003b683a - -#endif /* __ASM_NIOS2_OPCODES_H_ */ diff --git a/arch/nios2/include/asm/posix_types.h b/arch/nios2/include/asm/posix_types.h deleted file mode 100644 index 22cae6230c..0000000000 --- a/arch/nios2/include/asm/posix_types.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/posix_types.h> diff --git a/arch/nios2/include/asm/ptrace.h b/arch/nios2/include/asm/ptrace.h deleted file mode 100644 index b0b47cbe09..0000000000 --- a/arch/nios2/include/asm/ptrace.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * (C) Copyright 2004, Psyent Corporation <www.psyent.com> - * Scott McNutt <smcnutt@psyent.com> - * - * 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. - * - */ - -#ifndef __ASM_NIOS2_PTRACE_H_ -#define __ASM_NIOS2_PTRACE_H_ - -struct pt_regs { - unsigned reg[32]; - unsigned status; -}; - - -#endif /* __ASM_NIOS2_PTRACE_H_ */ diff --git a/arch/nios2/include/asm/sections.h b/arch/nios2/include/asm/sections.h deleted file mode 100644 index 2b8c516038..0000000000 --- a/arch/nios2/include/asm/sections.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/sections.h> diff --git a/arch/nios2/include/asm/spi.h b/arch/nios2/include/asm/spi.h deleted file mode 100644 index 6c5740c340..0000000000 --- a/arch/nios2/include/asm/spi.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef __ALTERA_SPI_H_ -#define __ALTERA_SPI_H_ - -#include <spi/spi.h> - -struct spi_altera_master { - int num_chipselect; - int spi_mode; - int databits; - int speed; - int bus_num; -}; - -struct altera_spi { - struct spi_master master; - int databits; - int speed; - int mode; - void __iomem *regs; -}; - -#endif /*__ALTERA_SPI_H_*/ diff --git a/arch/nios2/include/asm/string.h b/arch/nios2/include/asm/string.h deleted file mode 100644 index 28acf0fc0a..0000000000 --- a/arch/nios2/include/asm/string.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * (C) Copyright 2004, Psyent Corporation <www.psyent.com> - * Scott McNutt <smcnutt@psyent.com> - * - * 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. - * - */ -#ifndef __ASM_NIOS2_STRING_H_ -#define __ASM_NIOS2_STRING_H_ -/* -#undef __HAVE_ARCH_STRRCHR -extern char *strrchr(const char * s, int c); - -#undef __HAVE_ARCH_STRCHR -extern char *strchr(const char * s, int c); -*/ -#undef __HAVE_ARCH_MEMCPY -extern void *memcpy(void *, const void *, __kernel_size_t); - -#undef __HAVE_ARCH_MEMMOVE -extern void *memmove(void *, const void *, __kernel_size_t); - -#undef __HAVE_ARCH_MEMCHR -extern void *memchr(const void *, int, __kernel_size_t); - -#undef __HAVE_ARCH_MEMSET -extern void *memset(void *, int, __kernel_size_t); - -#undef __HAVE_ARCH_MEMZERO -extern void memzero(void *ptr, __kernel_size_t n); - -#endif /* __ASM_NIOS2_STRING_H_ */ diff --git a/arch/nios2/include/asm/swab.h b/arch/nios2/include/asm/swab.h deleted file mode 100644 index b07e1d51f1..0000000000 --- a/arch/nios2/include/asm/swab.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _ASM_SWAB_H -#define _ASM_SWAB_H - -#endif /* _ASM_SWAB_H */ diff --git a/arch/nios2/include/asm/system.h b/arch/nios2/include/asm/system.h deleted file mode 100644 index 0f870d8456..0000000000 --- a/arch/nios2/include/asm/system.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * (C) Copyright 2004, Psyent Corporation <www.psyent.com> - * Scott McNutt <smcnutt@psyent.com> - * - * 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. - * - */ -#ifndef __ASM_NIOS2_SYSTEM_H_ -#define __ASM_NIOS2_SYSTEM_H_ - -#define local_irq_enable() __asm__ __volatile__ ( \ - "rdctl r8, status\n" \ - "ori r8, r8, 1\n" \ - "wrctl status, r8\n" \ - : : : "r8") - -#define local_irq_disable() __asm__ __volatile__ ( \ - "rdctl r8, status\n" \ - "andi r8, r8, 0xfffe\n" \ - "wrctl status, r8\n" \ - : : : "r8") - -#define local_save_flags(x) __asm__ __volatile__ ( \ - "rdctl r8, status\n" \ - "mov %0, r8\n" \ - : "=r" (x) : : "r8", "memory") - -#define local_irq_restore(x) __asm__ __volatile__ ( \ - "mov r8, %0\n" \ - "wrctl status, r8\n" \ - : : "r" (x) : "r8", "memory") - -/* For spinlocks etc */ -#define local_irq_save(x) do { local_save_flags(x); local_irq_disable(); } \ - while (0) - -#define irqs_disabled() \ -({ \ - unsigned long flags; \ - local_save_flags(flags); \ - ((flags & NIOS2_STATUS_PIE_MSK) == 0x0); \ -}) - -/* indirect call to go beyond 256MB limitation of toolchain */ -#define nios2_callr(addr) __asm__ __volatile__ ( \ - "callr %0" \ - : : "r" (addr)) - -#endif /* __ASM_NIOS2_SYSTEM_H */ diff --git a/arch/nios2/include/asm/types.h b/arch/nios2/include/asm/types.h deleted file mode 100644 index 0067ea83c1..0000000000 --- a/arch/nios2/include/asm/types.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ASM_TYPES_H -#define __ASM_TYPES_H - -#include <asm/int-ll64.h> - -#endif diff --git a/arch/nios2/include/asm/unaligned.h b/arch/nios2/include/asm/unaligned.h deleted file mode 100644 index 7615e8a85d..0000000000 --- a/arch/nios2/include/asm/unaligned.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _ASM_NIOS_UNALIGNED_H -#define _ASM_NIOS_UNALIGNED_H - -#include <linux/unaligned/le_byteshift.h> -#include <linux/unaligned/be_byteshift.h> -#include <linux/unaligned/generic.h> - -/* - * Select endianness - */ - -#define get_unaligned __get_unaligned_le -#define put_unaligned __put_unaligned_le - -#endif /* _ASM_NIOS_UNALIGNED_H */ |