From daad436bf76ad8acdf66326b1cc3769434cca97f Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Thu, 22 Oct 2009 14:23:26 +0200 Subject: [M68K] Move include/asm-m68k/{arch,proc}-* to arch/m68k/*/include/{mach,proc} Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD --- arch/m68k/Makefile | 28 +- arch/m68k/cpu/cpu.c | 4 +- arch/m68k/cpu/interrupts.c | 2 +- arch/m68k/include/asm/hardware.h | 2 +- arch/m68k/include/asm/ptrace.h | 2 +- arch/m68k/mach-mcfv4e/dma_utils.c | 6 +- arch/m68k/mach-mcfv4e/fec.c | 12 +- arch/m68k/mach-mcfv4e/fecbd.c | 12 +- arch/m68k/mach-mcfv4e/include/mach/clocks.h | 30 ++ arch/m68k/mach-mcfv4e/include/mach/debug_ll.h | 33 ++ arch/m68k/mach-mcfv4e/include/mach/hardware.h | 33 ++ arch/m68k/mach-mcfv4e/include/mach/mcf54xx-regs.h | 30 ++ arch/m68k/mach-mcfv4e/include/proc/dma_utils.h | 80 +++++ arch/m68k/mach-mcfv4e/include/proc/fec.h | 130 +++++++ arch/m68k/mach-mcfv4e/include/proc/fecbd.h | 115 +++++++ .../m68k/mach-mcfv4e/include/proc/mcdapi/MCD_dma.h | 379 +++++++++++++++++++++ .../include/proc/mcdapi/MCD_progCheck.h | 27 ++ .../include/proc/mcdapi/MCD_tasksInit.h | 66 ++++ arch/m68k/mach-mcfv4e/include/proc/net/eth.h | 70 ++++ arch/m68k/mach-mcfv4e/include/proc/net/nbuf.h | 88 +++++ arch/m68k/mach-mcfv4e/include/proc/net/net.h | 39 +++ arch/m68k/mach-mcfv4e/include/proc/net/queue.h | 54 +++ arch/m68k/mach-mcfv4e/include/proc/processor.h | 33 ++ arch/m68k/mach-mcfv4e/include/proc/ptrace.h | 119 +++++++ arch/m68k/mach-mcfv4e/mcdapi/MCD_dmaApi.c | 6 +- arch/m68k/mach-mcfv4e/mcdapi/MCD_tasks.c | 2 +- arch/m68k/mach-mcfv4e/mcdapi/MCD_tasksInit.c | 2 +- arch/m68k/mach-mcfv4e/mcf_clocksource.c | 6 +- arch/m68k/mach-mcfv4e/mcf_reset_cpu.c | 2 +- arch/m68k/mach-mcfv4e/multichannel_dma.c | 6 +- arch/m68k/mach-mcfv4e/net/nbuf.c | 6 +- arch/m68k/mach-mcfv4e/net/net.c | 16 +- arch/m68k/mach-mcfv4e/net/queue.c | 2 +- board/kp_ukd_r1_num/highlevel_init.c | 2 +- board/kp_ukd_r1_num/kp_ukd_r1_num.c | 6 +- board/kp_ukd_r1_num/lowlevel_init.c | 2 +- board/phycore_mcf54xx/highlevel_init.c | 2 +- board/phycore_mcf54xx/lowlevel_init.c | 2 +- board/phycore_mcf54xx/phyCore_MCF54xx.c | 4 +- include/asm-m68k/arch-mcfv4e/clocks.h | 30 -- include/asm-m68k/arch-mcfv4e/debug_ll.h | 33 -- include/asm-m68k/arch-mcfv4e/hardware.h | 33 -- include/asm-m68k/arch-mcfv4e/mcf54xx-regs.h | 30 -- include/asm-m68k/proc-mcfv4e/dma_utils.h | 80 ----- include/asm-m68k/proc-mcfv4e/fec.h | 130 ------- include/asm-m68k/proc-mcfv4e/fecbd.h | 115 ------- include/asm-m68k/proc-mcfv4e/mcdapi/MCD_dma.h | 379 --------------------- .../asm-m68k/proc-mcfv4e/mcdapi/MCD_progCheck.h | 27 -- .../asm-m68k/proc-mcfv4e/mcdapi/MCD_tasksInit.h | 66 ---- include/asm-m68k/proc-mcfv4e/net/eth.h | 70 ---- include/asm-m68k/proc-mcfv4e/net/nbuf.h | 88 ----- include/asm-m68k/proc-mcfv4e/net/net.h | 39 --- include/asm-m68k/proc-mcfv4e/net/queue.h | 54 --- include/asm-m68k/proc-mcfv4e/processor.h | 33 -- include/asm-m68k/proc-mcfv4e/ptrace.h | 119 ------- 55 files changed, 1383 insertions(+), 1403 deletions(-) create mode 100644 arch/m68k/mach-mcfv4e/include/mach/clocks.h create mode 100644 arch/m68k/mach-mcfv4e/include/mach/debug_ll.h create mode 100644 arch/m68k/mach-mcfv4e/include/mach/hardware.h create mode 100644 arch/m68k/mach-mcfv4e/include/mach/mcf54xx-regs.h create mode 100644 arch/m68k/mach-mcfv4e/include/proc/dma_utils.h create mode 100644 arch/m68k/mach-mcfv4e/include/proc/fec.h create mode 100644 arch/m68k/mach-mcfv4e/include/proc/fecbd.h create mode 100644 arch/m68k/mach-mcfv4e/include/proc/mcdapi/MCD_dma.h create mode 100644 arch/m68k/mach-mcfv4e/include/proc/mcdapi/MCD_progCheck.h create mode 100644 arch/m68k/mach-mcfv4e/include/proc/mcdapi/MCD_tasksInit.h create mode 100644 arch/m68k/mach-mcfv4e/include/proc/net/eth.h create mode 100644 arch/m68k/mach-mcfv4e/include/proc/net/nbuf.h create mode 100644 arch/m68k/mach-mcfv4e/include/proc/net/net.h create mode 100644 arch/m68k/mach-mcfv4e/include/proc/net/queue.h create mode 100644 arch/m68k/mach-mcfv4e/include/proc/processor.h create mode 100644 arch/m68k/mach-mcfv4e/include/proc/ptrace.h delete mode 100644 include/asm-m68k/arch-mcfv4e/clocks.h delete mode 100644 include/asm-m68k/arch-mcfv4e/debug_ll.h delete mode 100644 include/asm-m68k/arch-mcfv4e/hardware.h delete mode 100644 include/asm-m68k/arch-mcfv4e/mcf54xx-regs.h delete mode 100644 include/asm-m68k/proc-mcfv4e/dma_utils.h delete mode 100644 include/asm-m68k/proc-mcfv4e/fec.h delete mode 100644 include/asm-m68k/proc-mcfv4e/fecbd.h delete mode 100644 include/asm-m68k/proc-mcfv4e/mcdapi/MCD_dma.h delete mode 100644 include/asm-m68k/proc-mcfv4e/mcdapi/MCD_progCheck.h delete mode 100644 include/asm-m68k/proc-mcfv4e/mcdapi/MCD_tasksInit.h delete mode 100644 include/asm-m68k/proc-mcfv4e/net/eth.h delete mode 100644 include/asm-m68k/proc-mcfv4e/net/nbuf.h delete mode 100644 include/asm-m68k/proc-mcfv4e/net/net.h delete mode 100644 include/asm-m68k/proc-mcfv4e/net/queue.h delete mode 100644 include/asm-m68k/proc-mcfv4e/processor.h delete mode 100644 include/asm-m68k/proc-mcfv4e/ptrace.h diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile index d30b335d1d..0f2c4f324d 100644 --- a/arch/m68k/Makefile +++ b/arch/m68k/Makefile @@ -46,31 +46,13 @@ CFLAGS += -msoft-float -mcfv4e -gdwarf-2 -feliminate-unused-debug-types \ LDFLAGS_uboot :=-L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc # --verbose --stats -ifeq ($(incdir-y),) -incdir-y := $(machine-y) -endif -INCDIR := arch-$(incdir-y) - -# Update machine arch and proc symlinks if something which affects -# them changed. We use .arch to indicate when they were updated -# last, otherwise make uses the target directory mtime. +machdirs := $(patsubst %,arch/m68k/mach-%/,$(machine-y)) -include/asm-m68k/.arch: $(wildcard include/config/arch/*.h) include/config/auto.conf - @echo ' SYMLINK include/asm-m68k/arch -> include/asm-m68k/$(INCDIR)' -ifneq ($(KBUILD_SRC),) - $(Q)mkdir -p include/asm-m68k - $(Q)ln -fsn $(srctree)/include/asm-m68k/$(INCDIR) include/asm-m68k/arch -else - $(Q)ln -fsn $(INCDIR) include/asm-m68k/arch -endif - @echo ' SYMLINK include/asm-m68k/proc -> include/asm-m68k/proc-mcfv4e' -ifneq ($(KBUILD_SRC),) - $(Q)mkdir -p include/asm-m68k - $(Q)ln -fsn $(srctree)/include/asm-m68k/proc-mcfv4e include/asm-m68k/proc +ifeq ($(KBUILD_SRC),) +CPPFLAGS += $(patsubst %,-I%include,$(machdirs)) else - $(Q)ln -fsn proc-mcfv4e include/asm-m68k/proc +CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs)) endif - @touch $@ all: $(KBUILD_IMAGE) @@ -78,7 +60,6 @@ all: $(KBUILD_IMAGE) archprepare: maketools PHONY += maketools -maketools: include/asm-m68k/.arch ifneq ($(board-y),) @@ -100,4 +81,3 @@ lds-$(CONFIG_GENERIC_LINKER_SCRIPT) := arch/m68k/lib/u-boot.lds lds-$(CONFIG_BOARD_LINKER_SCRIPT) := $(BOARD)/u-boot.lds CLEAN_FILES += arch/m68k/lib/u-boot.lds -MRPROPER_FILES += include/asm-m68k/arch include/asm-m68k/proc diff --git a/arch/m68k/cpu/cpu.c b/arch/m68k/cpu/cpu.c index 5c48add8d9..c27d089018 100644 --- a/arch/m68k/cpu/cpu.c +++ b/arch/m68k/cpu/cpu.c @@ -24,8 +24,8 @@ #include #include #include -#include // FIXME -stup place -#include +#include // FIXME -stup place +#include static uint32_t CACR_shadow = MCF5XXX_CACR_BEC; diff --git a/arch/m68k/cpu/interrupts.c b/arch/m68k/cpu/interrupts.c index 16aac38ad5..9fc64a1248 100644 --- a/arch/m68k/cpu/interrupts.c +++ b/arch/m68k/cpu/interrupts.c @@ -23,7 +23,7 @@ */ #include #include -#include +#include #ifdef CONFIG_USE_IRQ void enable_interrupts(void) diff --git a/arch/m68k/include/asm/hardware.h b/arch/m68k/include/asm/hardware.h index 54cec0ee20..616a4feeb5 100644 --- a/arch/m68k/include/asm/hardware.h +++ b/arch/m68k/include/asm/hardware.h @@ -25,6 +25,6 @@ #ifndef __M68K_HARDWARE_H #define __M68K_HARDWARE_H -#include +#include #endif diff --git a/arch/m68k/include/asm/ptrace.h b/arch/m68k/include/asm/ptrace.h index fb0f3314d8..96ea849385 100644 --- a/arch/m68k/include/asm/ptrace.h +++ b/arch/m68k/include/asm/ptrace.h @@ -33,7 +33,7 @@ #define PTRACE_SETOPTIONS 21 -#include +#include #ifndef __ASSEMBLY__ diff --git a/arch/m68k/mach-mcfv4e/dma_utils.c b/arch/m68k/mach-mcfv4e/dma_utils.c index 15b520abc2..adeefea3b1 100644 --- a/arch/m68k/mach-mcfv4e/dma_utils.c +++ b/arch/m68k/mach-mcfv4e/dma_utils.c @@ -10,10 +10,10 @@ #include #include #include -#include -#include +#include +#include -#include +#include /* * This global keeps track of which initiators have been diff --git a/arch/m68k/mach-mcfv4e/fec.c b/arch/m68k/mach-mcfv4e/fec.c index 551f00f005..7619283f86 100644 --- a/arch/m68k/mach-mcfv4e/fec.c +++ b/arch/m68k/mach-mcfv4e/fec.c @@ -7,12 +7,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #define TRUE 1 diff --git a/arch/m68k/mach-mcfv4e/fecbd.c b/arch/m68k/mach-mcfv4e/fecbd.c index 26fb16d98d..a8e732b3ac 100644 --- a/arch/m68k/mach-mcfv4e/fecbd.c +++ b/arch/m68k/mach-mcfv4e/fecbd.c @@ -7,12 +7,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #define ASSERT(x) if (!(x)) hang(); diff --git a/arch/m68k/mach-mcfv4e/include/mach/clocks.h b/arch/m68k/mach-mcfv4e/include/mach/clocks.h new file mode 100644 index 0000000000..50124b1948 --- /dev/null +++ b/arch/m68k/mach-mcfv4e/include/mach/clocks.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2008 Carsten Schlote + * See file CREDITS for list of people who contributed to this project. + * + * This file is part of U-Boot V2. + * + * U-Boot V2 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 3 of the License, or + * (at your option) any later version. + * + * U-Boot V2 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 U-Boot V2. If not, see . + */ + +/** @file + * This File contains functions to query clock settings for the actual + * board. + */ +#ifndef __ASM_ARCH_CLOCKS_H +#define __ASM_ARCH_CLOCKS_H + +ulong mcfv4e_get_bus_clk(void); + +#endif /* __ASM_ARCH_CLOCKS_H */ diff --git a/arch/m68k/mach-mcfv4e/include/mach/debug_ll.h b/arch/m68k/mach-mcfv4e/include/mach/debug_ll.h new file mode 100644 index 0000000000..064961d925 --- /dev/null +++ b/arch/m68k/mach-mcfv4e/include/mach/debug_ll.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008 Carsten Schlote + * See file CREDITS for list of people who contributed to this project. + * + * This file is part of U-Boot V2. + * + * U-Boot V2 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 3 of the License, or + * (at your option) any later version. + * + * U-Boot V2 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 U-Boot V2. If not, see . + */ + +/** @file + * This File contains declaration for early output support + */ +#ifndef __INCLUDE_ARCH_DEBUG_LL_H__ +#define __INCLUDE_ARCH_DEBUG_LL_H__ + +extern __inline__ void putc( char ch ) +{ + //extern int early_console_putc( char ch); + early_console_putc(NULL,ch); +} + +#endif /* __INCLUDE_ARCH_DEBUG_LL_H__ */ diff --git a/arch/m68k/mach-mcfv4e/include/mach/hardware.h b/arch/m68k/mach-mcfv4e/include/mach/hardware.h new file mode 100644 index 0000000000..46dc08897f --- /dev/null +++ b/arch/m68k/mach-mcfv4e/include/mach/hardware.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008 Carsten Schlote + * See file CREDITS for list of people who contributed to this project. + * + * This file is part of U-Boot V2. + * + * U-Boot V2 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 3 of the License, or + * (at your option) any later version. + * + * U-Boot V2 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 U-Boot V2. If not, see . + */ + +/** @file + * This File contains declaration for early output support + */ +#ifndef __ASM_ARCH_HARDWARE_H__ +#define __ASM_ARCH_HARDWARE_H__ + +#include + +#ifdef CONFIG_ARCH_MCF54xx +#include "mcf54xx-regs.h" +#endif + +#endif /* __ASM_ARCH_HARDWARE_H__ */ diff --git a/arch/m68k/mach-mcfv4e/include/mach/mcf54xx-regs.h b/arch/m68k/mach-mcfv4e/include/mach/mcf54xx-regs.h new file mode 100644 index 0000000000..e1b17d55e4 --- /dev/null +++ b/arch/m68k/mach-mcfv4e/include/mach/mcf54xx-regs.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2008 Carsten Schlote + * See file CREDITS for list of people who contributed to this project. + * + * This file is part of U-Boot V2. + * + * U-Boot V2 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 3 of the License, or + * (at your option) any later version. + * + * U-Boot V2 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 U-Boot V2. If not, see . + */ + +/** @file + * This File contains declaration for early output support + */ +#ifndef __MCF54xx_REGS_H__ +#define __MCF54xx_REGS_H__ + +/* System Registers for V4E cores (MCF547x and MCF548x) */ +#include + +#endif /* __MCF54xx_REGS_H__ */ diff --git a/arch/m68k/mach-mcfv4e/include/proc/dma_utils.h b/arch/m68k/mach-mcfv4e/include/proc/dma_utils.h new file mode 100644 index 0000000000..4ebdd558c1 --- /dev/null +++ b/arch/m68k/mach-mcfv4e/include/proc/dma_utils.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2008 Carsten Schlote + * See file CREDITS for list of people who contributed to this project. + * + * This file is part of U-Boot V2. + * + * U-Boot V2 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 3 of the License, or + * (at your option) any later version. + * + * U-Boot V2 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 U-Boot V2. If not, see . + */ + +/** @file + * Declaration of support function used with the MultiChannel DMA + */ +#ifndef _DMA_UTILS_H_ +#define _DMA_UTILS_H_ + + +void dma_irq_enable(uint8_t, uint8_t); +void dma_irq_disable(void); +int dma_set_initiator(int); +uint32_t dma_get_initiator(int); +void dma_free_initiator(int); +int dma_set_channel(int, void (*)(void)); +int dma_get_channel(int); +void dma_free_channel(int); +int dma_interrupt_handler(void *, void *); + +/* + * Create identifiers for each initiator/requestor + */ +#define DMA_ALWAYS (0) +#define DMA_DSPI_RX (1) +#define DMA_DSPI_TX (2) +#define DMA_DREQ0 (3) +#define DMA_PSC0_RX (4) +#define DMA_PSC0_TX (5) +#define DMA_USBEP0 (6) +#define DMA_USBEP1 (7) +#define DMA_USBEP2 (8) +#define DMA_USBEP3 (9) +#define DMA_PCI_TX (10) +#define DMA_PCI_RX (11) +#define DMA_PSC1_RX (12) +#define DMA_PSC1_TX (13) +#define DMA_I2C_RX (14) +#define DMA_I2C_TX (15) +#define DMA_FEC0_RX (16) +#define DMA_FEC0_TX (17) +#define DMA_FEC1_RX (18) +#define DMA_FEC1_TX (19) +#define DMA_DREQ1 (20) +#define DMA_CTM0 (21) +#define DMA_CTM1 (22) +#define DMA_CTM2 (23) +#define DMA_CTM3 (24) +#define DMA_CTM4 (25) +#define DMA_CTM5 (26) +#define DMA_CTM6 (27) +#define DMA_CTM7 (28) +#define DMA_USBEP4 (29) +#define DMA_USBEP5 (30) +#define DMA_USBEP6 (31) +#define DMA_PSC2_RX (32) +#define DMA_PSC2_TX (33) +#define DMA_PSC3_RX (34) +#define DMA_PSC3_TX (35) +#define DMA_FEC_RX(x) ((x == 0) ? DMA_FEC0_RX : DMA_FEC1_RX) +#define DMA_FEC_TX(x) ((x == 0) ? DMA_FEC0_TX : DMA_FEC1_TX) + +#endif /* _DMA_UTILS_H_ */ diff --git a/arch/m68k/mach-mcfv4e/include/proc/fec.h b/arch/m68k/mach-mcfv4e/include/proc/fec.h new file mode 100644 index 0000000000..4c94774381 --- /dev/null +++ b/arch/m68k/mach-mcfv4e/include/proc/fec.h @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2008 Carsten Schlote + * See file CREDITS for list of people who contributed to this project. + * + * This file is part of U-Boot V2. + * + * U-Boot V2 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 3 of the License, or + * (at your option) any later version. + * + * U-Boot V2 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 U-Boot V2. If not, see . + */ + +/** @file + * Declaration for the Fast Ethernet Controller (FEC) + */ +#ifndef _FEC_H_ +#define _FEC_H_ + +// FIXME +#define NIF void + +/********************************************************************/ +/* MII Speed Settings */ +#define FEC_MII_10BASE_T 0 +#define FEC_MII_100BASE_TX 1 + +/* MII Duplex Settings */ +#define FEC_MII_HALF_DUPLEX 0 +#define FEC_MII_FULL_DUPLEX 1 + +/* Timeout for MII communications */ +#define FEC_MII_TIMEOUT 0x10000 + +/* External Interface Modes */ +#define FEC_MODE_7WIRE 0 +#define FEC_MODE_MII 1 +#define FEC_MODE_LOOPBACK 2 /* Internal Loopback */ + +/* + * FEC Event Log + */ +typedef struct { + int total; /* total count of errors */ + int hberr; /* heartbeat error */ + int babr; /* babbling receiver */ + int babt; /* babbling transmitter */ + int gra; /* graceful stop complete */ + int txf; /* transmit frame */ + int mii; /* MII */ + int lc; /* late collision */ + int rl; /* collision retry limit */ + int xfun; /* transmit FIFO underrrun */ + int xferr; /* transmit FIFO error */ + int rferr; /* receive FIFO error */ + int dtxf; /* DMA transmit frame */ + int drxf; /* DMA receive frame */ + int rfsw_inv; /* Invalid bit in RFSW */ + int rfsw_l; /* RFSW Last in Frame */ + int rfsw_m; /* RFSW Miss */ + int rfsw_bc; /* RFSW Broadcast */ + int rfsw_mc; /* RFSW Multicast */ + int rfsw_lg; /* RFSW Length Violation */ + int rfsw_no; /* RFSW Non-octet */ + int rfsw_cr; /* RFSW Bad CRC */ + int rfsw_ov; /* RFSW Overflow */ + int rfsw_tr; /* RFSW Truncated */ +} FEC_EVENT_LOG; + + +int fec_mii_write(uint8_t , uint8_t , uint8_t , uint16_t ); +int fec_mii_read(uint8_t , uint8_t , uint8_t , uint16_t *x); +void fec_mii_init(uint8_t, uint32_t); + +void fec_mib_init(uint8_t); +void fec_mib_dump(uint8_t); + +void fec_log_init(uint8_t); +void fec_log_dump(uint8_t); + +void fec_debug_dump(uint8_t); +void fec_duplex (uint8_t, uint8_t); + +uint8_t fec_hash_address(const uint8_t *); +void fec_set_address (uint8_t ch, const uint8_t *); + +void fec_reset (uint8_t); +void fec_init (uint8_t, uint8_t, const uint8_t *); + +void fec_rx_start(uint8_t, int8_t *); +void fec_rx_restart(uint8_t); +void fec_rx_stop (uint8_t); + +NBUF * fec_rx_frame(uint8_t ch, NIF *nif); + +void fec0_rx_frame(void); +void fec1_rx_frame(void); + +void fec_tx_start(uint8_t, int8_t *); +void fec_tx_restart(uint8_t); +void fec_tx_stop (uint8_t); + +void fec0_tx_frame(void); +void fec1_tx_frame(void); + +int fec_send(uint8_t, NIF *, uint8_t *, uint8_t *, uint16_t , NBUF *); +int fec0_send(NIF *, uint8_t *, uint8_t *, uint16_t , NBUF *); +int fec1_send(NIF *, uint8_t *, uint8_t *, uint16_t , NBUF *); + +void fec_irq_enable(uint8_t, uint8_t, uint8_t); +void fec_irq_disable(uint8_t); + +void fec_interrupt_handler(uint8_t); +int fec0_interrupt_handler(void *, void *); +int fec1_interrupt_handler(void *, void *); + +void fec_eth_setup(uint8_t, uint8_t, uint8_t, uint8_t, const uint8_t *); + +void fec_eth_reset(uint8_t); + +void fec_eth_stop(uint8_t); + +#endif /* _FEC_H_ */ diff --git a/arch/m68k/mach-mcfv4e/include/proc/fecbd.h b/arch/m68k/mach-mcfv4e/include/proc/fecbd.h new file mode 100644 index 0000000000..92195490c8 --- /dev/null +++ b/arch/m68k/mach-mcfv4e/include/proc/fecbd.h @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2008 Carsten Schlote + * See file CREDITS for list of people who contributed to this project. + * + * This file is part of U-Boot V2. + * + * U-Boot V2 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 3 of the License, or + * (at your option) any later version. + * + * U-Boot V2 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 U-Boot V2. If not, see . + */ + +/** @file + * Provide a simple buffer management driver + */ + +#ifndef _FECBD_H_ +#define _FECBD_H_ + +/********************************************************************/ + +#define Rx 1 +#define Tx 0 + +/* + * Buffer sizes in bytes + */ +#ifndef RX_BUF_SZ +#define RX_BUF_SZ NBUF_SZ +#endif +#ifndef TX_BUF_SZ +#define TX_BUF_SZ NBUF_SZ +#endif + +/* + * Number of Rx and Tx Buffers and Buffer Descriptors + */ +#ifndef NRXBD +#define NRXBD 10 +#endif +#ifndef NTXBD +#define NTXBD 4 +#endif + +/* + * Buffer Descriptor Format + */ +typedef struct +{ + uint16_t status; /* control and status */ + uint16_t length; /* transfer length */ + uint8_t *data; /* buffer address */ +} FECBD; + +/* + * Bit level definitions for status field of buffer descriptors + */ +#define TX_BD_R 0x8000 +#define TX_BD_TO1 0x4000 +#define TX_BD_W 0x2000 +#define TX_BD_TO2 0x1000 +#define TX_BD_INTERRUPT 0x1000 /* MCF547x/8x Only */ +#define TX_BD_L 0x0800 +#define TX_BD_TC 0x0400 +#define TX_BD_DEF 0x0200 /* MCF5272 Only */ +#define TX_BD_ABC 0x0200 +#define TX_BD_HB 0x0100 /* MCF5272 Only */ +#define TX_BD_LC 0x0080 /* MCF5272 Only */ +#define TX_BD_RL 0x0040 /* MCF5272 Only */ +#define TX_BD_UN 0x0002 /* MCF5272 Only */ +#define TX_BD_CSL 0x0001 /* MCF5272 Only */ + +#define RX_BD_E 0x8000 +#define RX_BD_R01 0x4000 +#define RX_BD_W 0x2000 +#define RX_BD_R02 0x1000 +#define RX_BD_INTERRUPT 0x1000 /* MCF547x/8x Only */ +#define RX_BD_L 0x0800 +#define RX_BD_M 0x0100 +#define RX_BD_BC 0x0080 +#define RX_BD_MC 0x0040 +#define RX_BD_LG 0x0020 +#define RX_BD_NO 0x0010 +#define RX_BD_CR 0x0004 +#define RX_BD_OV 0x0002 +#define RX_BD_TR 0x0001 +#define RX_BD_ERROR (RX_BD_NO | RX_BD_CR | RX_BD_OV | RX_BD_TR) + +/* + * Functions provided in fec_bd.c + */ +void +fecbd_init(uint8_t); + +uint32_t +fecbd_get_start(uint8_t, uint8_t); + +FECBD * +fecbd_rx_alloc(uint8_t); + +FECBD * +fecbd_tx_alloc(uint8_t); + +FECBD * +fecbd_tx_free(uint8_t); + +#endif /* _FECBD_H_ */ diff --git a/arch/m68k/mach-mcfv4e/include/proc/mcdapi/MCD_dma.h b/arch/m68k/mach-mcfv4e/include/proc/mcdapi/MCD_dma.h new file mode 100644 index 0000000000..09adf8272a --- /dev/null +++ b/arch/m68k/mach-mcfv4e/include/proc/mcdapi/MCD_dma.h @@ -0,0 +1,379 @@ +/* + * Copyright (c) 2008 Carsten Schlote + * See file CREDITS for list of people who contributed to this project. + * + * This file is part of U-Boot V2. + * + * U-Boot V2 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 3 of the License, or + * (at your option) any later version. + * + * U-Boot V2 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 U-Boot V2. If not, see . + */ + +/** @file + * Main header file for multi-channel DMA API. + */ +#ifndef _MCD_API_H +#define _MCD_API_H + +/* + * Turn Execution Unit tasks ON (#define) or OFF (#undef) + */ +#undef MCD_INCLUDE_EU + +/* + * Number of DMA channels + */ +#define NCHANNELS 16 + +/* + * Total number of variants + */ +#ifdef MCD_INCLUDE_EU +#define NUMOFVARIANTS 6 +#else +#define NUMOFVARIANTS 4 +#endif + +/* + * Define sizes of the various tables + */ +#define TASK_TABLE_SIZE (NCHANNELS*32) +#define VAR_TAB_SIZE (128) +#define CONTEXT_SAVE_SIZE (128) +#define FUNCDESC_TAB_SIZE (256) + +#ifdef MCD_INCLUDE_EU +#define FUNCDESC_TAB_NUM 16 +#else +#define FUNCDESC_TAB_NUM 1 +#endif + + +#ifndef DEFINESONLY + +/* + * Portability typedefs + */ +//typedef signed int s32; +//typedef unsigned int u32; +//typedef signed short s16; +//typedef unsigned short u16; +//typedef signed char s8; +//typedef unsigned char u8; +// +/* + * These structures represent the internal registers of the + * multi-channel DMA + */ +struct dmaRegs_s { + u32 taskbar; /* task table base address register */ + u32 currPtr; + u32 endPtr; + u32 varTablePtr; + u16 dma_rsvd0; + u16 ptdControl; /* ptd control */ + u32 intPending; /* interrupt pending register */ + u32 intMask; /* interrupt mask register */ + u16 taskControl[16]; /* task control registers */ + u8 priority[32]; /* priority registers */ + u32 initiatorMux; /* initiator mux control */ + u32 taskSize0; /* task size control register 0. */ + u32 taskSize1; /* task size control register 1. */ + u32 dma_rsvd1; /* reserved */ + u32 dma_rsvd2; /* reserved */ + u32 debugComp1; /* debug comparator 1 */ + u32 debugComp2; /* debug comparator 2 */ + u32 debugControl; /* debug control */ + u32 debugStatus; /* debug status */ + u32 ptdDebug; /* priority task decode debug */ + u32 dma_rsvd3[31]; /* reserved */ +}; +typedef volatile struct dmaRegs_s dmaRegs; + +#endif + +/* + * PTD contrl reg bits + */ +#define PTD_CTL_TSK_PRI 0x8000 +#define PTD_CTL_COMM_PREFETCH 0x0001 + +/* + * Task Control reg bits and field masks + */ +#define TASK_CTL_EN 0x8000 +#define TASK_CTL_VALID 0x4000 +#define TASK_CTL_ALWAYS 0x2000 +#define TASK_CTL_INIT_MASK 0x1f00 +#define TASK_CTL_ASTRT 0x0080 +#define TASK_CTL_HIPRITSKEN 0x0040 +#define TASK_CTL_HLDINITNUM 0x0020 +#define TASK_CTL_ASTSKNUM_MASK 0x000f + +/* + * Priority reg bits and field masks + */ +#define PRIORITY_HLD 0x80 +#define PRIORITY_PRI_MASK 0x07 + +/* + * Debug Control reg bits and field masks + */ +#define DBG_CTL_BLOCK_TASKS_MASK 0xffff0000 +#define DBG_CTL_AUTO_ARM 0x00008000 +#define DBG_CTL_BREAK 0x00004000 +#define DBG_CTL_COMP1_TYP_MASK 0x00003800 +#define DBG_CTL_COMP2_TYP_MASK 0x00000070 +#define DBG_CTL_EXT_BREAK 0x00000004 +#define DBG_CTL_INT_BREAK 0x00000002 + +/* + * PTD Debug reg selector addresses + * This reg must be written with a value to show the contents of + * one of the desired internal register. + */ +#define PTD_DBG_REQ 0x00 /* shows the state of 31 initiators */ +#define PTD_DBG_TSK_VLD_INIT 0x01 /* shows which 16 tasks are valid and + have initiators asserted */ + + +/* + * General return values + */ +#define MCD_OK 0 +#define MCD_ERROR -1 +#define MCD_TABLE_UNALIGNED -2 +#define MCD_CHANNEL_INVALID -3 + +/* + * MCD_initDma input flags + */ +#define MCD_RELOC_TASKS 0x00000001 +#define MCD_NO_RELOC_TASKS 0x00000000 +#define MCD_COMM_PREFETCH_EN 0x00000002 /* Commbus Prefetching - MCF547x/548x ONLY */ + +/* + * MCD_dmaStatus Status Values for each channel + */ +#define MCD_NO_DMA 1 /* No DMA has been requested since reset */ +#define MCD_IDLE 2 /* DMA active, but the initiator is currently inactive */ +#define MCD_RUNNING 3 /* DMA active, and the initiator is currently active */ +#define MCD_PAUSED 4 /* DMA active but it is currently paused */ +#define MCD_HALTED 5 /* the most recent DMA has been killed with MCD_killTask() */ +#define MCD_DONE 6 /* the most recent DMA has completed. */ + + +/* + * MCD_startDma parameter defines + */ + +/* + * Constants for the funcDesc parameter + */ +/* Byte swapping: */ +#define MCD_NO_BYTE_SWAP 0x00045670 /* to disable byte swapping. */ +#define MCD_BYTE_REVERSE 0x00076540 /* to reverse the bytes of each u32 of the DMAed data. */ +#define MCD_U16_REVERSE 0x00067450 /* to reverse the 16-bit halves of + each 32-bit data value being DMAed.*/ +#define MCD_U16_BYTE_REVERSE 0x00054760 /* to reverse the byte halves of each + 16-bit half of each 32-bit data value DMAed */ +#define MCD_NO_BIT_REV 0x00000000 /* do not reverse the bits of each byte DMAed. */ +#define MCD_BIT_REV 0x00088880 /* reverse the bits of each byte DMAed */ +/* CRCing: */ +#define MCD_CRC16 0xc0100000 /* to perform CRC-16 on DMAed data. */ +#define MCD_CRCCCITT 0xc0200000 /* to perform CRC-CCITT on DMAed data. */ +#define MCD_CRC32 0xc0300000 /* to perform CRC-32 on DMAed data. */ +#define MCD_CSUMINET 0xc0400000 /* to perform internet checksums on DMAed data.*/ +#define MCD_NO_CSUM 0xa0000000 /* to perform no checksumming. */ + +#define MCD_FUNC_NOEU1 (MCD_NO_BYTE_SWAP | MCD_NO_BIT_REV | MCD_NO_CSUM) +#define MCD_FUNC_NOEU2 (MCD_NO_BYTE_SWAP | MCD_NO_CSUM) + +/* + * Constants for the flags parameter + */ +#define MCD_TT_FLAGS_RL 0x00000001 /* Read line */ +#define MCD_TT_FLAGS_CW 0x00000002 /* Combine Writes */ +#define MCD_TT_FLAGS_SP 0x00000004 /* Speculative prefetch(XLB) MCF547x/548x ONLY */ +#define MCD_TT_FLAGS_MASK 0x000000ff +#define MCD_TT_FLAGS_DEF (MCD_TT_FLAGS_RL | MCD_TT_FLAGS_CW) + +#define MCD_SINGLE_DMA 0x00000100 /* Unchained DMA */ +#define MCD_CHAIN_DMA /* TBD */ +#define MCD_EU_DMA /* TBD */ +#define MCD_FECTX_DMA 0x00001000 /* FEC TX ring DMA */ +#define MCD_FECRX_DMA 0x00002000 /* FEC RX ring DMA */ + + +/* these flags are valid for MCD_startDma and the chained buffer descriptors */ +#define MCD_BUF_READY 0x80000000 /* indicates that this buffer is now under the DMA's control */ +#define MCD_WRAP 0x20000000 /* to tell the FEC Dmas to wrap to the first BD */ +#define MCD_INTERRUPT 0x10000000 /* to generate an interrupt after completion of the DMA. */ +#define MCD_END_FRAME 0x08000000 /* tell the DMA to end the frame when transferring + last byte of data in buffer */ +#define MCD_CRC_RESTART 0x40000000 /* to empty out the accumulated checksum + prior to performing the DMA. */ + +/* Defines for the FEC buffer descriptor control/status word*/ +#define MCD_FEC_BUF_READY 0x8000 +#define MCD_FEC_WRAP 0x2000 +#define MCD_FEC_INTERRUPT 0x1000 +#define MCD_FEC_END_FRAME 0x0800 + + +/* + * Defines for general intuitiveness + */ + +#define MCD_TRUE 1 +#define MCD_FALSE 0 + +/* + * Three different cases for destination and source. + */ +#define MINUS1 -1 +#define ZERO 0 +#define PLUS1 1 + +#ifndef DEFINESONLY + +/* Task Table Entry struct*/ +typedef struct { + u32 TDTstart; /* task descriptor table start */ + u32 TDTend; /* task descriptor table end */ + u32 varTab; /* variable table start */ + u32 FDTandFlags; /* function descriptor table start and flags */ + volatile u32 descAddrAndStatus; + volatile u32 modifiedVarTab; + u32 contextSaveSpace; /* context save space start */ + u32 literalBases; +} TaskTableEntry; + + +/* Chained buffer descriptor */ +typedef volatile struct MCD_bufDesc_struct MCD_bufDesc; +struct MCD_bufDesc_struct { + u32 flags; /* flags describing the DMA */ + u32 csumResult; /* checksum from checksumming performed since last checksum reset */ + s8 *srcAddr; /* the address to move data from */ + s8 *destAddr; /* the address to move data to */ + s8 *lastDestAddr; /* the last address written to */ + u32 dmaSize; /* the number of bytes to transfer independent of the transfer size */ + MCD_bufDesc *next; /* next buffer descriptor in chain */ + u32 info; /* private information about this descriptor; DMA does not affect it */ +}; + +/* Progress Query struct */ +typedef volatile struct MCD_XferProg_struct { + s8 *lastSrcAddr; /* the most-recent or last, post-increment source address */ + s8 *lastDestAddr; /* the most-recent or last, post-increment destination address */ + u32 dmaSize; /* the amount of data transferred for the current buffer */ + MCD_bufDesc *currBufDesc;/* pointer to the current buffer descriptor being DMAed */ +} MCD_XferProg; + + +/* FEC buffer descriptor */ +typedef volatile struct MCD_bufDescFec_struct { + u16 statCtrl; + u16 length; + u32 dataPointer; +} MCD_bufDescFec; + + +/*************************************************************************/ +/* + * API function Prototypes - see MCD_dmaApi.c for further notes + */ + +/* + * MCD_startDma starts a particular kind of DMA . + */ +int MCD_startDma ( + int channel, /* the channel on which to run the DMA */ + s8 *srcAddr, /* the address to move data from, or buffer-descriptor address */ + s16 srcIncr, /* the amount to increment the source address per transfer */ + s8 *destAddr, /* the address to move data to */ + s16 destIncr, /* the amount to increment the destination address per transfer */ + u32 dmaSize, /* the number of bytes to transfer independent of the transfer size */ + u32 xferSize, /* the number bytes in of each data movement (1, 2, or 4) */ + u32 initiator, /* what device initiates the DMA */ + int priority, /* priority of the DMA */ + u32 flags, /* flags describing the DMA */ + u32 funcDesc /* a description of byte swapping, bit swapping, and CRC actions */ +); + +/* + * MCD_initDma() initializes the DMA API by setting up a pointer to the DMA + * registers, relocating and creating the appropriate task structures, and + * setting up some global settings + */ +int MCD_initDma (dmaRegs *sDmaBarAddr, void *taskTableDest, u32 flags); + +/* + * MCD_dmaStatus() returns the status of the DMA on the requested channel. + */ +int MCD_dmaStatus (int channel); + +/* + * MCD_XferProgrQuery() returns progress of DMA on requested channel + */ +int MCD_XferProgrQuery (int channel, MCD_XferProg *progRep); + +/* + * MCD_killDma() halts the DMA on the requested channel, without any + * intention of resuming the DMA. + */ +int MCD_killDma (int channel); + +/* + * MCD_continDma() continues a DMA which as stopped due to encountering an + * unready buffer descriptor. + */ +int MCD_continDma (int channel); + +/* + * MCD_pauseDma() pauses the DMA on the given channel ( if any DMA is + * running on that channel). + */ +int MCD_pauseDma (int channel); + +/* + * MCD_resumeDma() resumes the DMA on a given channel (if any DMA is + * running on that channel). + */ +int MCD_resumeDma (int channel); + +/* + * MCD_csumQuery provides the checksum/CRC after performing a non-chained DMA + */ +int MCD_csumQuery (int channel, u32 *csum); + +/* + * MCD_getCodeSize provides the packed size required by the microcoded task + * and structures. + */ +int MCD_getCodeSize(void); + +/* + * MCD_getVersion provides a pointer to a version string and returns a + * version number. + */ +int MCD_getVersion(char **longVersion); + +/* macro for setting a location in the variable table */ +#define MCD_SET_VAR(taskTab,idx,value) ((u32 *)(taskTab)->varTab)[idx] = value + /* Note that MCD_SET_VAR() is invoked many times in firing up a DMA function, + so I'm avoiding surrounding it with "do {} while(0)" */ + +#endif /* DEFINESONLY */ + +#endif /* _MCD_API_H */ diff --git a/arch/m68k/mach-mcfv4e/include/proc/mcdapi/MCD_progCheck.h b/arch/m68k/mach-mcfv4e/include/proc/mcdapi/MCD_progCheck.h new file mode 100644 index 0000000000..f90600c7cd --- /dev/null +++ b/arch/m68k/mach-mcfv4e/include/proc/mcdapi/MCD_progCheck.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2008 Carsten Schlote + * See file CREDITS for list of people who contributed to this project. + * + * This file is part of U-Boot V2. + * + * U-Boot V2 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 3 of the License, or + * (at your option) any later version. + * + * U-Boot V2 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 U-Boot V2. If not, see . + */ + +/** @file + * This file is autogenerated. Do not change . + */ +#define CURRBD 4 +#define DCOUNT 6 +#define DESTPTR 5 +#define SRCPTR 7 diff --git a/arch/m68k/mach-mcfv4e/include/proc/mcdapi/MCD_tasksInit.h b/arch/m68k/mach-mcfv4e/include/proc/mcdapi/MCD_tasksInit.h new file mode 100644 index 0000000000..bc6ec91f98 --- /dev/null +++ b/arch/m68k/mach-mcfv4e/include/proc/mcdapi/MCD_tasksInit.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2008 Carsten Schlote + * See file CREDITS for list of people who contributed to this project. + * + * This file is part of U-Boot V2. + * + * U-Boot V2 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 3 of the License, or + * (at your option) any later version. + * + * U-Boot V2 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 U-Boot V2. If not, see . + */ + +/** @file + * Declaration for the MCD tasks. Do not edit. + */ +#ifndef MCD_TSK_INIT_H +#define MCD_TSK_INIT_H 1 + +/* + * Do not edit! + */ + +/* + * Task 0 + */ +void MCD_startDmaChainNoEu(int *currBD, short srcIncr, short destIncr, int xferSize, short xferSizeIncr, int *cSave, volatile TaskTableEntry *taskTable, int channel); + + +/* + * Task 1 + */ +void MCD_startDmaSingleNoEu(char *srcAddr, short srcIncr, char *destAddr, short destIncr, int dmaSize, short xferSizeIncr, int flags, int *currBD, int *cSave, volatile TaskTableEntry *taskTable, int channel); + + +/* + * Task 2 + */ +void MCD_startDmaChainEu(int *currBD, short srcIncr, short destIncr, int xferSize, short xferSizeIncr, int *cSave, volatile TaskTableEntry *taskTable, int channel); + + +/* + * Task 3 + */ +void MCD_startDmaSingleEu(char *srcAddr, short srcIncr, char *destAddr, short destIncr, int dmaSize, short xferSizeIncr, int flags, int *currBD, int *cSave, volatile TaskTableEntry *taskTable, int channel); + + +/* + * Task 4 + */ +void MCD_startDmaENetRcv(char *bDBase, char *currBD, char *rcvFifoPtr, volatile TaskTableEntry *taskTable, int channel); + + +/* + * Task 5 + */ +void MCD_startDmaENetXmit(char *bDBase, char *currBD, char *xmitFifoPtr, volatile TaskTableEntry *taskTable, int channel); + +#endif /* MCD_TSK_INIT_H */ diff --git a/arch/m68k/mach-mcfv4e/include/proc/net/eth.h b/arch/m68k/mach-mcfv4e/include/proc/net/eth.h new file mode 100644 index 0000000000..5240c0c945 --- /dev/null +++ b/arch/m68k/mach-mcfv4e/include/proc/net/eth.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2008 Carsten Schlote + * See file CREDITS for list of people who contributed to this project. + * + * This file is part of U-Boot V2. + * + * U-Boot V2 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 3 of the License, or + * (at your option) any later version. + * + * U-Boot V2 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 U-Boot V2. If not, see . + */ + +/** @file + * Declaration for for Ethernet Frames. + */ + +#ifndef _ETH_H +#define _ETH_H + + +/* Ethernet standard lengths in bytes*/ +#define ETH_ADDR_LEN (6) +#define ETH_TYPE_LEN (2) +#define ETH_CRC_LEN (4) +#define ETH_MAX_DATA (1500) +#define ETH_MIN_DATA (46) +#define ETH_HDR_LEN (ETH_ADDR_LEN * 2 + ETH_TYPE_LEN) + +/* Defined Ethernet Frame Types */ +#define ETH_FRM_IP (0x0800) +#define ETH_FRM_ARP (0x0806) +#define ETH_FRM_RARP (0x8035) +#define ETH_FRM_TEST (0xA5A5) + +/* Maximum and Minimum Ethernet Frame Sizes */ +#define ETH_MAX_FRM (ETH_HDR_LEN + ETH_MAX_DATA + ETH_CRC_LEN) +#define ETH_MIN_FRM (ETH_HDR_LEN + ETH_MIN_DATA + ETH_CRC_LEN) +#define ETH_MTU (ETH_HDR_LEN + ETH_MAX_DATA) + +/* Ethernet Addresses */ +typedef uint8_t ETH_ADDR[ETH_ADDR_LEN]; + +/* 16-bit Ethernet Frame Type, ie. Protocol */ +typedef uint16_t ETH_FRM_TYPE; + +/* Ethernet Frame Header definition */ +typedef struct +{ + ETH_ADDR dest; + ETH_ADDR src; + ETH_FRM_TYPE type; +} ETH_HDR; + +/* Ethernet Frame definition */ +typedef struct +{ + ETH_HDR head; + uint8_t* data; +} ETH_FRAME; + + +#endif /* _ETH_H */ diff --git a/arch/m68k/mach-mcfv4e/include/proc/net/nbuf.h b/arch/m68k/mach-mcfv4e/include/proc/net/nbuf.h new file mode 100644 index 0000000000..bc3a7a6924 --- /dev/null +++ b/arch/m68k/mach-mcfv4e/include/proc/net/nbuf.h @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2008 Carsten Schlote + * See file CREDITS for list of people who contributed to this project. + * + * This file is part of U-Boot V2. + * + * U-Boot V2 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 3 of the License, or + * (at your option) any later version. + * + * U-Boot V2 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 U-Boot V2. If not, see . + */ + +/** @file + * Definitions for network buffer management + */ + +#ifndef _MCFV4E_NBUF_H_ +#define _MCFV4E_NBUF_H_ + +/* + * Include the Queue structure definitions + */ +#include "queue.h" + +/* + * Number of network buffers to use + */ +#define NBUF_MAX 30 + +/* + * Size of each buffer in bytes + */ +#ifndef NBUF_SZ +#define NBUF_SZ 1520 +#endif + +/* + * Defines to identify all the buffer queues + * - FREE must always be defined as 0 + */ +#define NBUF_FREE 0 /* available buffers */ +#define NBUF_TX_RING 1 /* buffers in the Tx BD ring */ +#define NBUF_RX_RING 2 /* buffers in the Rx BD ring */ +#define NBUF_SCRATCH 3 /* misc */ +#define NBUF_MAXQ 4 /* total number of queueus */ + +/* + * Buffer Descriptor Format + * + * Fields: + * next Pointer to next node in the queue + * data Pointer to the data buffer + * offset Index into buffer + * length Remaining bytes in buffer from (data + offset) + */ +typedef struct +{ + QNODE node; + uint8_t *data; + uint16_t offset; + uint16_t length; +} NBUF; + +/* + * Functions to manipulate the network buffers. + */ +int nbuf_init(void); +void nbuf_flush(void); + +NBUF * nbuf_alloc (void); +void nbuf_free(NBUF *); + +NBUF *nbuf_remove(int); +void nbuf_add(int, NBUF *); + +void nbuf_reset(void); +void nbuf_debug_dump(void); + + +#endif /* _MCFV4E_NBUF_H_ */ diff --git a/arch/m68k/mach-mcfv4e/include/proc/net/net.h b/arch/m68k/mach-mcfv4e/include/proc/net/net.h new file mode 100644 index 0000000000..a2ccd76510 --- /dev/null +++ b/arch/m68k/mach-mcfv4e/include/proc/net/net.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2008 Carsten Schlote + * See file CREDITS for list of people who contributed to this project. + * + * This file is part of U-Boot V2. + * + * U-Boot V2 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 3 of the License, or + * (at your option) any later version. + * + * U-Boot V2 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 U-Boot V2. If not, see . + */ + +/** @file + * Network definitions and prototypes for dBUG. + */ + +#ifndef _MCFV4E_NET_H +#define _MCFV4E_NET_H + +/* + * Include information and prototypes for all protocols + */ +#include "eth.h" +#include "nbuf.h" + +int netif_init(int channel); +int netif_setup(int channel); +int netif_done(int channel); + +#endif /* _MCFV4E_NET_H */ + diff --git a/arch/m68k/mach-mcfv4e/include/proc/net/queue.h b/arch/m68k/mach-mcfv4e/include/proc/net/queue.h new file mode 100644 index 0000000000..c9da1c83a5 --- /dev/null +++ b/arch/m68k/mach-mcfv4e/include/proc/net/queue.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2008 Carsten Schlote + * See file CREDITS for list of people who contributed to this project. + * + * This file is part of U-Boot V2. + * + * U-Boot V2 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 3 of the License, or + * (at your option) any later version. + * + * U-Boot V2 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 U-Boot V2. If not, see . + */ + +/** @file + * Implement a first in, first out linked list + */ +#ifndef _QUEUE_H_ +#define _QUEUE_H_ + +/* + * Individual queue node + */ +typedef struct NODE +{ + struct NODE *next; +} QNODE; + +/* + * Queue Struture - linked list of qentry items + */ +typedef struct +{ + QNODE *head; + QNODE *tail; +} QUEUE; + +/* + * Functions provided by queue.c + */ +void queue_init(QUEUE *); +int queue_isempty(QUEUE *); +void queue_add(QUEUE *, QNODE *); +QNODE* queue_remove(QUEUE *); +QNODE* queue_peek(QUEUE *); +void queue_move(QUEUE *, QUEUE *); + +#endif /* _QUEUE_H_ */ diff --git a/arch/m68k/mach-mcfv4e/include/proc/processor.h b/arch/m68k/mach-mcfv4e/include/proc/processor.h new file mode 100644 index 0000000000..f49b65d97b --- /dev/null +++ b/arch/m68k/mach-mcfv4e/include/proc/processor.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2008 Carsten Schlote + * See file CREDITS for list of people who contributed to this project. + * + * This file is part of U-Boot V2. + * + * U-Boot V2 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 3 of the License, or + * (at your option) any later version. + * + * U-Boot V2 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 U-Boot V2. If not, see . + */ + +/** @file + * Coldfire V4e processor specific defines + */ + +/* Empty dummy FIXME */ + +/* interrupt management */ + +void mcf_interrupts_initialize (void); +int mcf_interrupts_register_handler (int vector, int (*handler)(void *, void *), void *hdev, void *harg); +void mcf_interrupts_remove_handler (int (*handler)(void *, void *)); +int mcf_execute_irq_handler (struct pt_regs *pt_regs,int); + diff --git a/arch/m68k/mach-mcfv4e/include/proc/ptrace.h b/arch/m68k/mach-mcfv4e/include/proc/ptrace.h new file mode 100644 index 0000000000..dd124291d6 --- /dev/null +++ b/arch/m68k/mach-mcfv4e/include/proc/ptrace.h @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2008 Carsten Schlote + * See file CREDITS for list of people who contributed to this project. + * + * This file is part of U-Boot V2. + * + * U-Boot V2 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 3 of the License, or + * (at your option) any later version. + * + * U-Boot V2 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 U-Boot V2. If not, see . + */ + +/** @file + * Declaration and defines for M68k register frames + */ +#ifndef __ASM_PROC_PTRACE_H +#define __ASM_PROC_PTRACE_H + +#define TRACE_FLAG 0x8000 +#define SVR_MODE 0x2000 +#define MODE_MASK 0x2000 +#define MASTER_FLAG 0x1000 +#define IRQ_MASK 0x0700 +#define CC_MASK 0x00FF + +#define CC_X_BIT 0x0010 +#define CC_N_BIT 0x0008 +#define CC_Z_BIT 0x0004 +#define CC_V_BIT 0x0002 +#define CC_C_BIT 0x0001 + +#define PCMASK 0x0 + +#ifndef __ASSEMBLY__ + +/* this struct defines the way the registers are stored on the + stack during a system call. */ + +struct pt_regs { + long uregs[37]; +}; +#define M68K_sp uregs[37] +#define M68K_sr uregs[36] +#define M68K_pc uregs[35] +#define M68K_fpiar uregs[34] +#define M68K_fpsr uregs[33] +#define M68K_fpcr uregs[32] + +#define M68K_fp7 uregs[30] +#define M68K_fp6 uregs[28] +#define M68K_fp5 uregs[26] +#define M68K_fp4 uregs[24] +#define M68K_fp3 uregs[22] +#define M68K_fp2 uregs[20] +#define M68K_fp1 uregs[18] +#define M68K_fp0 uregs[16] + +#define M68K_a7 uregs[15] +#define M68K_a6 uregs[14] +#define M68K_a5 uregs[13] +#define M68K_a4 uregs[12] +#define M68K_a3 uregs[11] +#define M68K_a2 uregs[10] +#define M68K_a1 uregs[ 9] +#define M68K_a0 uregs[ 8] +#define M68K_d7 uregs[ 7] +#define M68K_d6 uregs[ 6] +#define M68K_d5 uregs[ 5] +#define M68K_d4 uregs[ 4] +#define M68K_d3 uregs[ 3] +#define M68K_d2 uregs[ 2] +#define M68K_d1 uregs[ 1] +#define M68K_d0 uregs[ 0] + + +#ifdef __KERNEL__ + +#define user_mode(regs) \ + (((regs)->M68K_sr & SVR_MODE) == 0) + +#define processor_mode(regs) \ + ((regs)->M68K_sr & SVR_MODE) + +#define interrupts_enabled(regs) \ + (!((regs)->M68K_sr & IRQ_MASK)) + +#define condition_codes(regs) \ + ((regs)->M68K_sr & CC_MASK) + +/* Are the current registers suitable for user mode? + * (used to maintain security in signal handlers) + */ +static inline int valid_user_regs(struct pt_regs *regs) +{ + if ((regs->M68K_sr & SVR_MODE) == 0 && + (regs->M68K_sr & IRQ_MASK) == 7) + return 1; + + /* + * Force SR to something logical... + */ + regs->M68K_sr &= ~(CC_MASK); + + return 0; +} + +#endif /* __KERNEL__ */ + +#endif /* __ASSEMBLY__ */ + +#endif diff --git a/arch/m68k/mach-mcfv4e/mcdapi/MCD_dmaApi.c b/arch/m68k/mach-mcfv4e/mcdapi/MCD_dmaApi.c index b4d7f28470..60e2b6dd76 100644 --- a/arch/m68k/mach-mcfv4e/mcdapi/MCD_dmaApi.c +++ b/arch/m68k/mach-mcfv4e/mcdapi/MCD_dmaApi.c @@ -6,9 +6,9 @@ */ #include -#include -#include -#include +#include +#include +#include /* * This is an API-internal pointer to the DMA's registers diff --git a/arch/m68k/mach-mcfv4e/mcdapi/MCD_tasks.c b/arch/m68k/mach-mcfv4e/mcdapi/MCD_tasks.c index 3bfed232d7..812120dd7a 100644 --- a/arch/m68k/mach-mcfv4e/mcdapi/MCD_tasks.c +++ b/arch/m68k/mach-mcfv4e/mcdapi/MCD_tasks.c @@ -5,7 +5,7 @@ * Notes: */ #include -#include +#include u32 MCD_varTab0[]; u32 MCD_varTab1[]; diff --git a/arch/m68k/mach-mcfv4e/mcdapi/MCD_tasksInit.c b/arch/m68k/mach-mcfv4e/mcdapi/MCD_tasksInit.c index 14104f7185..8d82b471f9 100644 --- a/arch/m68k/mach-mcfv4e/mcdapi/MCD_tasksInit.c +++ b/arch/m68k/mach-mcfv4e/mcdapi/MCD_tasksInit.c @@ -11,7 +11,7 @@ */ #include -#include +#include extern dmaRegs *MCD_dmaBar; diff --git a/arch/m68k/mach-mcfv4e/mcf_clocksource.c b/arch/m68k/mach-mcfv4e/mcf_clocksource.c index 1278bf83ec..926a592158 100644 --- a/arch/m68k/mach-mcfv4e/mcf_clocksource.c +++ b/arch/m68k/mach-mcfv4e/mcf_clocksource.c @@ -24,9 +24,9 @@ #include #include #include -#include -#include -#include //FIXME - move to other file +#include +#include +#include //FIXME - move to other file #ifdef CONFIG_USE_IRQ diff --git a/arch/m68k/mach-mcfv4e/mcf_reset_cpu.c b/arch/m68k/mach-mcfv4e/mcf_reset_cpu.c index 5a3368f901..dc04a270d1 100644 --- a/arch/m68k/mach-mcfv4e/mcf_reset_cpu.c +++ b/arch/m68k/mach-mcfv4e/mcf_reset_cpu.c @@ -22,7 +22,7 @@ * Implements a watchdog triggered reset for V4e Coldfire cores */ #include -#include +#include /** * Reset the cpu by setting up the watchdog timer and let it time out diff --git a/arch/m68k/mach-mcfv4e/multichannel_dma.c b/arch/m68k/mach-mcfv4e/multichannel_dma.c index 11aceeb9b9..494fc68bde 100644 --- a/arch/m68k/mach-mcfv4e/multichannel_dma.c +++ b/arch/m68k/mach-mcfv4e/multichannel_dma.c @@ -25,9 +25,9 @@ */ #include #include -#include -#include -#include +#include +#include +#include static int mcdapi_init(void) diff --git a/arch/m68k/mach-mcfv4e/net/nbuf.c b/arch/m68k/mach-mcfv4e/net/nbuf.c index d7ae921bed..5dc6027e0e 100644 --- a/arch/m68k/mach-mcfv4e/net/nbuf.c +++ b/arch/m68k/mach-mcfv4e/net/nbuf.c @@ -26,10 +26,10 @@ #include #include -#include -#include +#include +#include -#include +#include #define ASSERT(x) diff --git a/arch/m68k/mach-mcfv4e/net/net.c b/arch/m68k/mach-mcfv4e/net/net.c index 76e28531b6..1bc089bdd3 100644 --- a/arch/m68k/mach-mcfv4e/net/net.c +++ b/arch/m68k/mach-mcfv4e/net/net.c @@ -26,14 +26,14 @@ #include #include -#include -#include -#include -#include -#include -#include - -#include //FIXME - move to other file +#include +#include +#include +#include +#include +#include + +#include //FIXME - move to other file int netif_init(int channel) { diff --git a/arch/m68k/mach-mcfv4e/net/queue.c b/arch/m68k/mach-mcfv4e/net/queue.c index 55f938af3e..e573fcfd58 100644 --- a/arch/m68k/mach-mcfv4e/net/queue.c +++ b/arch/m68k/mach-mcfv4e/net/queue.c @@ -25,7 +25,7 @@ * @todo Replace by u-boot standard list functions */ #include -#include +#include /** Initialize the specified queue to an empty state * diff --git a/board/kp_ukd_r1_num/highlevel_init.c b/board/kp_ukd_r1_num/highlevel_init.c index e3d9a16ce3..11b30f183c 100644 --- a/board/kp_ukd_r1_num/highlevel_init.c +++ b/board/kp_ukd_r1_num/highlevel_init.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include static void board_gpio_init(void) { diff --git a/board/kp_ukd_r1_num/kp_ukd_r1_num.c b/board/kp_ukd_r1_num/kp_ukd_r1_num.c index 7518286822..a9052e196c 100644 --- a/board/kp_ukd_r1_num/kp_ukd_r1_num.c +++ b/board/kp_ukd_r1_num/kp_ukd_r1_num.c @@ -24,9 +24,9 @@ #include #include #include -#include -//#include -#include +#include +//#include +#include #include #include diff --git a/board/kp_ukd_r1_num/lowlevel_init.c b/board/kp_ukd_r1_num/lowlevel_init.c index 56863afb0d..31b3bb9815 100644 --- a/board/kp_ukd_r1_num/lowlevel_init.c +++ b/board/kp_ukd_r1_num/lowlevel_init.c @@ -23,7 +23,7 @@ */ #include #include -#include +#include /** Initialize board specific very early inits * diff --git a/board/phycore_mcf54xx/highlevel_init.c b/board/phycore_mcf54xx/highlevel_init.c index e3d9a16ce3..11b30f183c 100644 --- a/board/phycore_mcf54xx/highlevel_init.c +++ b/board/phycore_mcf54xx/highlevel_init.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include static void board_gpio_init(void) { diff --git a/board/phycore_mcf54xx/lowlevel_init.c b/board/phycore_mcf54xx/lowlevel_init.c index a4da9ec6e6..89ac6ff8d9 100644 --- a/board/phycore_mcf54xx/lowlevel_init.c +++ b/board/phycore_mcf54xx/lowlevel_init.c @@ -23,7 +23,7 @@ */ #include #include -#include +#include /** Initialize board specific very early inits * diff --git a/board/phycore_mcf54xx/phyCore_MCF54xx.c b/board/phycore_mcf54xx/phyCore_MCF54xx.c index f8e96d3af3..6fe799328d 100644 --- a/board/phycore_mcf54xx/phyCore_MCF54xx.c +++ b/board/phycore_mcf54xx/phyCore_MCF54xx.c @@ -26,8 +26,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/include/asm-m68k/arch-mcfv4e/clocks.h b/include/asm-m68k/arch-mcfv4e/clocks.h deleted file mode 100644 index 50124b1948..0000000000 --- a/include/asm-m68k/arch-mcfv4e/clocks.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2008 Carsten Schlote - * See file CREDITS for list of people who contributed to this project. - * - * This file is part of U-Boot V2. - * - * U-Boot V2 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 3 of the License, or - * (at your option) any later version. - * - * U-Boot V2 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 U-Boot V2. If not, see . - */ - -/** @file - * This File contains functions to query clock settings for the actual - * board. - */ -#ifndef __ASM_ARCH_CLOCKS_H -#define __ASM_ARCH_CLOCKS_H - -ulong mcfv4e_get_bus_clk(void); - -#endif /* __ASM_ARCH_CLOCKS_H */ diff --git a/include/asm-m68k/arch-mcfv4e/debug_ll.h b/include/asm-m68k/arch-mcfv4e/debug_ll.h deleted file mode 100644 index 064961d925..0000000000 --- a/include/asm-m68k/arch-mcfv4e/debug_ll.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2008 Carsten Schlote - * See file CREDITS for list of people who contributed to this project. - * - * This file is part of U-Boot V2. - * - * U-Boot V2 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 3 of the License, or - * (at your option) any later version. - * - * U-Boot V2 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 U-Boot V2. If not, see . - */ - -/** @file - * This File contains declaration for early output support - */ -#ifndef __INCLUDE_ARCH_DEBUG_LL_H__ -#define __INCLUDE_ARCH_DEBUG_LL_H__ - -extern __inline__ void putc( char ch ) -{ - //extern int early_console_putc( char ch); - early_console_putc(NULL,ch); -} - -#endif /* __INCLUDE_ARCH_DEBUG_LL_H__ */ diff --git a/include/asm-m68k/arch-mcfv4e/hardware.h b/include/asm-m68k/arch-mcfv4e/hardware.h deleted file mode 100644 index 46dc08897f..0000000000 --- a/include/asm-m68k/arch-mcfv4e/hardware.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2008 Carsten Schlote - * See file CREDITS for list of people who contributed to this project. - * - * This file is part of U-Boot V2. - * - * U-Boot V2 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 3 of the License, or - * (at your option) any later version. - * - * U-Boot V2 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 U-Boot V2. If not, see . - */ - -/** @file - * This File contains declaration for early output support - */ -#ifndef __ASM_ARCH_HARDWARE_H__ -#define __ASM_ARCH_HARDWARE_H__ - -#include - -#ifdef CONFIG_ARCH_MCF54xx -#include "mcf54xx-regs.h" -#endif - -#endif /* __ASM_ARCH_HARDWARE_H__ */ diff --git a/include/asm-m68k/arch-mcfv4e/mcf54xx-regs.h b/include/asm-m68k/arch-mcfv4e/mcf54xx-regs.h deleted file mode 100644 index e1b17d55e4..0000000000 --- a/include/asm-m68k/arch-mcfv4e/mcf54xx-regs.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2008 Carsten Schlote - * See file CREDITS for list of people who contributed to this project. - * - * This file is part of U-Boot V2. - * - * U-Boot V2 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 3 of the License, or - * (at your option) any later version. - * - * U-Boot V2 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 U-Boot V2. If not, see . - */ - -/** @file - * This File contains declaration for early output support - */ -#ifndef __MCF54xx_REGS_H__ -#define __MCF54xx_REGS_H__ - -/* System Registers for V4E cores (MCF547x and MCF548x) */ -#include - -#endif /* __MCF54xx_REGS_H__ */ diff --git a/include/asm-m68k/proc-mcfv4e/dma_utils.h b/include/asm-m68k/proc-mcfv4e/dma_utils.h deleted file mode 100644 index 4ebdd558c1..0000000000 --- a/include/asm-m68k/proc-mcfv4e/dma_utils.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2008 Carsten Schlote - * See file CREDITS for list of people who contributed to this project. - * - * This file is part of U-Boot V2. - * - * U-Boot V2 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 3 of the License, or - * (at your option) any later version. - * - * U-Boot V2 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 U-Boot V2. If not, see . - */ - -/** @file - * Declaration of support function used with the MultiChannel DMA - */ -#ifndef _DMA_UTILS_H_ -#define _DMA_UTILS_H_ - - -void dma_irq_enable(uint8_t, uint8_t); -void dma_irq_disable(void); -int dma_set_initiator(int); -uint32_t dma_get_initiator(int); -void dma_free_initiator(int); -int dma_set_channel(int, void (*)(void)); -int dma_get_channel(int); -void dma_free_channel(int); -int dma_interrupt_handler(void *, void *); - -/* - * Create identifiers for each initiator/requestor - */ -#define DMA_ALWAYS (0) -#define DMA_DSPI_RX (1) -#define DMA_DSPI_TX (2) -#define DMA_DREQ0 (3) -#define DMA_PSC0_RX (4) -#define DMA_PSC0_TX (5) -#define DMA_USBEP0 (6) -#define DMA_USBEP1 (7) -#define DMA_USBEP2 (8) -#define DMA_USBEP3 (9) -#define DMA_PCI_TX (10) -#define DMA_PCI_RX (11) -#define DMA_PSC1_RX (12) -#define DMA_PSC1_TX (13) -#define DMA_I2C_RX (14) -#define DMA_I2C_TX (15) -#define DMA_FEC0_RX (16) -#define DMA_FEC0_TX (17) -#define DMA_FEC1_RX (18) -#define DMA_FEC1_TX (19) -#define DMA_DREQ1 (20) -#define DMA_CTM0 (21) -#define DMA_CTM1 (22) -#define DMA_CTM2 (23) -#define DMA_CTM3 (24) -#define DMA_CTM4 (25) -#define DMA_CTM5 (26) -#define DMA_CTM6 (27) -#define DMA_CTM7 (28) -#define DMA_USBEP4 (29) -#define DMA_USBEP5 (30) -#define DMA_USBEP6 (31) -#define DMA_PSC2_RX (32) -#define DMA_PSC2_TX (33) -#define DMA_PSC3_RX (34) -#define DMA_PSC3_TX (35) -#define DMA_FEC_RX(x) ((x == 0) ? DMA_FEC0_RX : DMA_FEC1_RX) -#define DMA_FEC_TX(x) ((x == 0) ? DMA_FEC0_TX : DMA_FEC1_TX) - -#endif /* _DMA_UTILS_H_ */ diff --git a/include/asm-m68k/proc-mcfv4e/fec.h b/include/asm-m68k/proc-mcfv4e/fec.h deleted file mode 100644 index 4c94774381..0000000000 --- a/include/asm-m68k/proc-mcfv4e/fec.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2008 Carsten Schlote - * See file CREDITS for list of people who contributed to this project. - * - * This file is part of U-Boot V2. - * - * U-Boot V2 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 3 of the License, or - * (at your option) any later version. - * - * U-Boot V2 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 U-Boot V2. If not, see . - */ - -/** @file - * Declaration for the Fast Ethernet Controller (FEC) - */ -#ifndef _FEC_H_ -#define _FEC_H_ - -// FIXME -#define NIF void - -/********************************************************************/ -/* MII Speed Settings */ -#define FEC_MII_10BASE_T 0 -#define FEC_MII_100BASE_TX 1 - -/* MII Duplex Settings */ -#define FEC_MII_HALF_DUPLEX 0 -#define FEC_MII_FULL_DUPLEX 1 - -/* Timeout for MII communications */ -#define FEC_MII_TIMEOUT 0x10000 - -/* External Interface Modes */ -#define FEC_MODE_7WIRE 0 -#define FEC_MODE_MII 1 -#define FEC_MODE_LOOPBACK 2 /* Internal Loopback */ - -/* - * FEC Event Log - */ -typedef struct { - int total; /* total count of errors */ - int hberr; /* heartbeat error */ - int babr; /* babbling receiver */ - int babt; /* babbling transmitter */ - int gra; /* graceful stop complete */ - int txf; /* transmit frame */ - int mii; /* MII */ - int lc; /* late collision */ - int rl; /* collision retry limit */ - int xfun; /* transmit FIFO underrrun */ - int xferr; /* transmit FIFO error */ - int rferr; /* receive FIFO error */ - int dtxf; /* DMA transmit frame */ - int drxf; /* DMA receive frame */ - int rfsw_inv; /* Invalid bit in RFSW */ - int rfsw_l; /* RFSW Last in Frame */ - int rfsw_m; /* RFSW Miss */ - int rfsw_bc; /* RFSW Broadcast */ - int rfsw_mc; /* RFSW Multicast */ - int rfsw_lg; /* RFSW Length Violation */ - int rfsw_no; /* RFSW Non-octet */ - int rfsw_cr; /* RFSW Bad CRC */ - int rfsw_ov; /* RFSW Overflow */ - int rfsw_tr; /* RFSW Truncated */ -} FEC_EVENT_LOG; - - -int fec_mii_write(uint8_t , uint8_t , uint8_t , uint16_t ); -int fec_mii_read(uint8_t , uint8_t , uint8_t , uint16_t *x); -void fec_mii_init(uint8_t, uint32_t); - -void fec_mib_init(uint8_t); -void fec_mib_dump(uint8_t); - -void fec_log_init(uint8_t); -void fec_log_dump(uint8_t); - -void fec_debug_dump(uint8_t); -void fec_duplex (uint8_t, uint8_t); - -uint8_t fec_hash_address(const uint8_t *); -void fec_set_address (uint8_t ch, const uint8_t *); - -void fec_reset (uint8_t); -void fec_init (uint8_t, uint8_t, const uint8_t *); - -void fec_rx_start(uint8_t, int8_t *); -void fec_rx_restart(uint8_t); -void fec_rx_stop (uint8_t); - -NBUF * fec_rx_frame(uint8_t ch, NIF *nif); - -void fec0_rx_frame(void); -void fec1_rx_frame(void); - -void fec_tx_start(uint8_t, int8_t *); -void fec_tx_restart(uint8_t); -void fec_tx_stop (uint8_t); - -void fec0_tx_frame(void); -void fec1_tx_frame(void); - -int fec_send(uint8_t, NIF *, uint8_t *, uint8_t *, uint16_t , NBUF *); -int fec0_send(NIF *, uint8_t *, uint8_t *, uint16_t , NBUF *); -int fec1_send(NIF *, uint8_t *, uint8_t *, uint16_t , NBUF *); - -void fec_irq_enable(uint8_t, uint8_t, uint8_t); -void fec_irq_disable(uint8_t); - -void fec_interrupt_handler(uint8_t); -int fec0_interrupt_handler(void *, void *); -int fec1_interrupt_handler(void *, void *); - -void fec_eth_setup(uint8_t, uint8_t, uint8_t, uint8_t, const uint8_t *); - -void fec_eth_reset(uint8_t); - -void fec_eth_stop(uint8_t); - -#endif /* _FEC_H_ */ diff --git a/include/asm-m68k/proc-mcfv4e/fecbd.h b/include/asm-m68k/proc-mcfv4e/fecbd.h deleted file mode 100644 index 92195490c8..0000000000 --- a/include/asm-m68k/proc-mcfv4e/fecbd.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2008 Carsten Schlote - * See file CREDITS for list of people who contributed to this project. - * - * This file is part of U-Boot V2. - * - * U-Boot V2 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 3 of the License, or - * (at your option) any later version. - * - * U-Boot V2 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 U-Boot V2. If not, see . - */ - -/** @file - * Provide a simple buffer management driver - */ - -#ifndef _FECBD_H_ -#define _FECBD_H_ - -/********************************************************************/ - -#define Rx 1 -#define Tx 0 - -/* - * Buffer sizes in bytes - */ -#ifndef RX_BUF_SZ -#define RX_BUF_SZ NBUF_SZ -#endif -#ifndef TX_BUF_SZ -#define TX_BUF_SZ NBUF_SZ -#endif - -/* - * Number of Rx and Tx Buffers and Buffer Descriptors - */ -#ifndef NRXBD -#define NRXBD 10 -#endif -#ifndef NTXBD -#define NTXBD 4 -#endif - -/* - * Buffer Descriptor Format - */ -typedef struct -{ - uint16_t status; /* control and status */ - uint16_t length; /* transfer length */ - uint8_t *data; /* buffer address */ -} FECBD; - -/* - * Bit level definitions for status field of buffer descriptors - */ -#define TX_BD_R 0x8000 -#define TX_BD_TO1 0x4000 -#define TX_BD_W 0x2000 -#define TX_BD_TO2 0x1000 -#define TX_BD_INTERRUPT 0x1000 /* MCF547x/8x Only */ -#define TX_BD_L 0x0800 -#define TX_BD_TC 0x0400 -#define TX_BD_DEF 0x0200 /* MCF5272 Only */ -#define TX_BD_ABC 0x0200 -#define TX_BD_HB 0x0100 /* MCF5272 Only */ -#define TX_BD_LC 0x0080 /* MCF5272 Only */ -#define TX_BD_RL 0x0040 /* MCF5272 Only */ -#define TX_BD_UN 0x0002 /* MCF5272 Only */ -#define TX_BD_CSL 0x0001 /* MCF5272 Only */ - -#define RX_BD_E 0x8000 -#define RX_BD_R01 0x4000 -#define RX_BD_W 0x2000 -#define RX_BD_R02 0x1000 -#define RX_BD_INTERRUPT 0x1000 /* MCF547x/8x Only */ -#define RX_BD_L 0x0800 -#define RX_BD_M 0x0100 -#define RX_BD_BC 0x0080 -#define RX_BD_MC 0x0040 -#define RX_BD_LG 0x0020 -#define RX_BD_NO 0x0010 -#define RX_BD_CR 0x0004 -#define RX_BD_OV 0x0002 -#define RX_BD_TR 0x0001 -#define RX_BD_ERROR (RX_BD_NO | RX_BD_CR | RX_BD_OV | RX_BD_TR) - -/* - * Functions provided in fec_bd.c - */ -void -fecbd_init(uint8_t); - -uint32_t -fecbd_get_start(uint8_t, uint8_t); - -FECBD * -fecbd_rx_alloc(uint8_t); - -FECBD * -fecbd_tx_alloc(uint8_t); - -FECBD * -fecbd_tx_free(uint8_t); - -#endif /* _FECBD_H_ */ diff --git a/include/asm-m68k/proc-mcfv4e/mcdapi/MCD_dma.h b/include/asm-m68k/proc-mcfv4e/mcdapi/MCD_dma.h deleted file mode 100644 index 09adf8272a..0000000000 --- a/include/asm-m68k/proc-mcfv4e/mcdapi/MCD_dma.h +++ /dev/null @@ -1,379 +0,0 @@ -/* - * Copyright (c) 2008 Carsten Schlote - * See file CREDITS for list of people who contributed to this project. - * - * This file is part of U-Boot V2. - * - * U-Boot V2 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 3 of the License, or - * (at your option) any later version. - * - * U-Boot V2 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 U-Boot V2. If not, see . - */ - -/** @file - * Main header file for multi-channel DMA API. - */ -#ifndef _MCD_API_H -#define _MCD_API_H - -/* - * Turn Execution Unit tasks ON (#define) or OFF (#undef) - */ -#undef MCD_INCLUDE_EU - -/* - * Number of DMA channels - */ -#define NCHANNELS 16 - -/* - * Total number of variants - */ -#ifdef MCD_INCLUDE_EU -#define NUMOFVARIANTS 6 -#else -#define NUMOFVARIANTS 4 -#endif - -/* - * Define sizes of the various tables - */ -#define TASK_TABLE_SIZE (NCHANNELS*32) -#define VAR_TAB_SIZE (128) -#define CONTEXT_SAVE_SIZE (128) -#define FUNCDESC_TAB_SIZE (256) - -#ifdef MCD_INCLUDE_EU -#define FUNCDESC_TAB_NUM 16 -#else -#define FUNCDESC_TAB_NUM 1 -#endif - - -#ifndef DEFINESONLY - -/* - * Portability typedefs - */ -//typedef signed int s32; -//typedef unsigned int u32; -//typedef signed short s16; -//typedef unsigned short u16; -//typedef signed char s8; -//typedef unsigned char u8; -// -/* - * These structures represent the internal registers of the - * multi-channel DMA - */ -struct dmaRegs_s { - u32 taskbar; /* task table base address register */ - u32 currPtr; - u32 endPtr; - u32 varTablePtr; - u16 dma_rsvd0; - u16 ptdControl; /* ptd control */ - u32 intPending; /* interrupt pending register */ - u32 intMask; /* interrupt mask register */ - u16 taskControl[16]; /* task control registers */ - u8 priority[32]; /* priority registers */ - u32 initiatorMux; /* initiator mux control */ - u32 taskSize0; /* task size control register 0. */ - u32 taskSize1; /* task size control register 1. */ - u32 dma_rsvd1; /* reserved */ - u32 dma_rsvd2; /* reserved */ - u32 debugComp1; /* debug comparator 1 */ - u32 debugComp2; /* debug comparator 2 */ - u32 debugControl; /* debug control */ - u32 debugStatus; /* debug status */ - u32 ptdDebug; /* priority task decode debug */ - u32 dma_rsvd3[31]; /* reserved */ -}; -typedef volatile struct dmaRegs_s dmaRegs; - -#endif - -/* - * PTD contrl reg bits - */ -#define PTD_CTL_TSK_PRI 0x8000 -#define PTD_CTL_COMM_PREFETCH 0x0001 - -/* - * Task Control reg bits and field masks - */ -#define TASK_CTL_EN 0x8000 -#define TASK_CTL_VALID 0x4000 -#define TASK_CTL_ALWAYS 0x2000 -#define TASK_CTL_INIT_MASK 0x1f00 -#define TASK_CTL_ASTRT 0x0080 -#define TASK_CTL_HIPRITSKEN 0x0040 -#define TASK_CTL_HLDINITNUM 0x0020 -#define TASK_CTL_ASTSKNUM_MASK 0x000f - -/* - * Priority reg bits and field masks - */ -#define PRIORITY_HLD 0x80 -#define PRIORITY_PRI_MASK 0x07 - -/* - * Debug Control reg bits and field masks - */ -#define DBG_CTL_BLOCK_TASKS_MASK 0xffff0000 -#define DBG_CTL_AUTO_ARM 0x00008000 -#define DBG_CTL_BREAK 0x00004000 -#define DBG_CTL_COMP1_TYP_MASK 0x00003800 -#define DBG_CTL_COMP2_TYP_MASK 0x00000070 -#define DBG_CTL_EXT_BREAK 0x00000004 -#define DBG_CTL_INT_BREAK 0x00000002 - -/* - * PTD Debug reg selector addresses - * This reg must be written with a value to show the contents of - * one of the desired internal register. - */ -#define PTD_DBG_REQ 0x00 /* shows the state of 31 initiators */ -#define PTD_DBG_TSK_VLD_INIT 0x01 /* shows which 16 tasks are valid and - have initiators asserted */ - - -/* - * General return values - */ -#define MCD_OK 0 -#define MCD_ERROR -1 -#define MCD_TABLE_UNALIGNED -2 -#define MCD_CHANNEL_INVALID -3 - -/* - * MCD_initDma input flags - */ -#define MCD_RELOC_TASKS 0x00000001 -#define MCD_NO_RELOC_TASKS 0x00000000 -#define MCD_COMM_PREFETCH_EN 0x00000002 /* Commbus Prefetching - MCF547x/548x ONLY */ - -/* - * MCD_dmaStatus Status Values for each channel - */ -#define MCD_NO_DMA 1 /* No DMA has been requested since reset */ -#define MCD_IDLE 2 /* DMA active, but the initiator is currently inactive */ -#define MCD_RUNNING 3 /* DMA active, and the initiator is currently active */ -#define MCD_PAUSED 4 /* DMA active but it is currently paused */ -#define MCD_HALTED 5 /* the most recent DMA has been killed with MCD_killTask() */ -#define MCD_DONE 6 /* the most recent DMA has completed. */ - - -/* - * MCD_startDma parameter defines - */ - -/* - * Constants for the funcDesc parameter - */ -/* Byte swapping: */ -#define MCD_NO_BYTE_SWAP 0x00045670 /* to disable byte swapping. */ -#define MCD_BYTE_REVERSE 0x00076540 /* to reverse the bytes of each u32 of the DMAed data. */ -#define MCD_U16_REVERSE 0x00067450 /* to reverse the 16-bit halves of - each 32-bit data value being DMAed.*/ -#define MCD_U16_BYTE_REVERSE 0x00054760 /* to reverse the byte halves of each - 16-bit half of each 32-bit data value DMAed */ -#define MCD_NO_BIT_REV 0x00000000 /* do not reverse the bits of each byte DMAed. */ -#define MCD_BIT_REV 0x00088880 /* reverse the bits of each byte DMAed */ -/* CRCing: */ -#define MCD_CRC16 0xc0100000 /* to perform CRC-16 on DMAed data. */ -#define MCD_CRCCCITT 0xc0200000 /* to perform CRC-CCITT on DMAed data. */ -#define MCD_CRC32 0xc0300000 /* to perform CRC-32 on DMAed data. */ -#define MCD_CSUMINET 0xc0400000 /* to perform internet checksums on DMAed data.*/ -#define MCD_NO_CSUM 0xa0000000 /* to perform no checksumming. */ - -#define MCD_FUNC_NOEU1 (MCD_NO_BYTE_SWAP | MCD_NO_BIT_REV | MCD_NO_CSUM) -#define MCD_FUNC_NOEU2 (MCD_NO_BYTE_SWAP | MCD_NO_CSUM) - -/* - * Constants for the flags parameter - */ -#define MCD_TT_FLAGS_RL 0x00000001 /* Read line */ -#define MCD_TT_FLAGS_CW 0x00000002 /* Combine Writes */ -#define MCD_TT_FLAGS_SP 0x00000004 /* Speculative prefetch(XLB) MCF547x/548x ONLY */ -#define MCD_TT_FLAGS_MASK 0x000000ff -#define MCD_TT_FLAGS_DEF (MCD_TT_FLAGS_RL | MCD_TT_FLAGS_CW) - -#define MCD_SINGLE_DMA 0x00000100 /* Unchained DMA */ -#define MCD_CHAIN_DMA /* TBD */ -#define MCD_EU_DMA /* TBD */ -#define MCD_FECTX_DMA 0x00001000 /* FEC TX ring DMA */ -#define MCD_FECRX_DMA 0x00002000 /* FEC RX ring DMA */ - - -/* these flags are valid for MCD_startDma and the chained buffer descriptors */ -#define MCD_BUF_READY 0x80000000 /* indicates that this buffer is now under the DMA's control */ -#define MCD_WRAP 0x20000000 /* to tell the FEC Dmas to wrap to the first BD */ -#define MCD_INTERRUPT 0x10000000 /* to generate an interrupt after completion of the DMA. */ -#define MCD_END_FRAME 0x08000000 /* tell the DMA to end the frame when transferring - last byte of data in buffer */ -#define MCD_CRC_RESTART 0x40000000 /* to empty out the accumulated checksum - prior to performing the DMA. */ - -/* Defines for the FEC buffer descriptor control/status word*/ -#define MCD_FEC_BUF_READY 0x8000 -#define MCD_FEC_WRAP 0x2000 -#define MCD_FEC_INTERRUPT 0x1000 -#define MCD_FEC_END_FRAME 0x0800 - - -/* - * Defines for general intuitiveness - */ - -#define MCD_TRUE 1 -#define MCD_FALSE 0 - -/* - * Three different cases for destination and source. - */ -#define MINUS1 -1 -#define ZERO 0 -#define PLUS1 1 - -#ifndef DEFINESONLY - -/* Task Table Entry struct*/ -typedef struct { - u32 TDTstart; /* task descriptor table start */ - u32 TDTend; /* task descriptor table end */ - u32 varTab; /* variable table start */ - u32 FDTandFlags; /* function descriptor table start and flags */ - volatile u32 descAddrAndStatus; - volatile u32 modifiedVarTab; - u32 contextSaveSpace; /* context save space start */ - u32 literalBases; -} TaskTableEntry; - - -/* Chained buffer descriptor */ -typedef volatile struct MCD_bufDesc_struct MCD_bufDesc; -struct MCD_bufDesc_struct { - u32 flags; /* flags describing the DMA */ - u32 csumResult; /* checksum from checksumming performed since last checksum reset */ - s8 *srcAddr; /* the address to move data from */ - s8 *destAddr; /* the address to move data to */ - s8 *lastDestAddr; /* the last address written to */ - u32 dmaSize; /* the number of bytes to transfer independent of the transfer size */ - MCD_bufDesc *next; /* next buffer descriptor in chain */ - u32 info; /* private information about this descriptor; DMA does not affect it */ -}; - -/* Progress Query struct */ -typedef volatile struct MCD_XferProg_struct { - s8 *lastSrcAddr; /* the most-recent or last, post-increment source address */ - s8 *lastDestAddr; /* the most-recent or last, post-increment destination address */ - u32 dmaSize; /* the amount of data transferred for the current buffer */ - MCD_bufDesc *currBufDesc;/* pointer to the current buffer descriptor being DMAed */ -} MCD_XferProg; - - -/* FEC buffer descriptor */ -typedef volatile struct MCD_bufDescFec_struct { - u16 statCtrl; - u16 length; - u32 dataPointer; -} MCD_bufDescFec; - - -/*************************************************************************/ -/* - * API function Prototypes - see MCD_dmaApi.c for further notes - */ - -/* - * MCD_startDma starts a particular kind of DMA . - */ -int MCD_startDma ( - int channel, /* the channel on which to run the DMA */ - s8 *srcAddr, /* the address to move data from, or buffer-descriptor address */ - s16 srcIncr, /* the amount to increment the source address per transfer */ - s8 *destAddr, /* the address to move data to */ - s16 destIncr, /* the amount to increment the destination address per transfer */ - u32 dmaSize, /* the number of bytes to transfer independent of the transfer size */ - u32 xferSize, /* the number bytes in of each data movement (1, 2, or 4) */ - u32 initiator, /* what device initiates the DMA */ - int priority, /* priority of the DMA */ - u32 flags, /* flags describing the DMA */ - u32 funcDesc /* a description of byte swapping, bit swapping, and CRC actions */ -); - -/* - * MCD_initDma() initializes the DMA API by setting up a pointer to the DMA - * registers, relocating and creating the appropriate task structures, and - * setting up some global settings - */ -int MCD_initDma (dmaRegs *sDmaBarAddr, void *taskTableDest, u32 flags); - -/* - * MCD_dmaStatus() returns the status of the DMA on the requested channel. - */ -int MCD_dmaStatus (int channel); - -/* - * MCD_XferProgrQuery() returns progress of DMA on requested channel - */ -int MCD_XferProgrQuery (int channel, MCD_XferProg *progRep); - -/* - * MCD_killDma() halts the DMA on the requested channel, without any - * intention of resuming the DMA. - */ -int MCD_killDma (int channel); - -/* - * MCD_continDma() continues a DMA which as stopped due to encountering an - * unready buffer descriptor. - */ -int MCD_continDma (int channel); - -/* - * MCD_pauseDma() pauses the DMA on the given channel ( if any DMA is - * running on that channel). - */ -int MCD_pauseDma (int channel); - -/* - * MCD_resumeDma() resumes the DMA on a given channel (if any DMA is - * running on that channel). - */ -int MCD_resumeDma (int channel); - -/* - * MCD_csumQuery provides the checksum/CRC after performing a non-chained DMA - */ -int MCD_csumQuery (int channel, u32 *csum); - -/* - * MCD_getCodeSize provides the packed size required by the microcoded task - * and structures. - */ -int MCD_getCodeSize(void); - -/* - * MCD_getVersion provides a pointer to a version string and returns a - * version number. - */ -int MCD_getVersion(char **longVersion); - -/* macro for setting a location in the variable table */ -#define MCD_SET_VAR(taskTab,idx,value) ((u32 *)(taskTab)->varTab)[idx] = value - /* Note that MCD_SET_VAR() is invoked many times in firing up a DMA function, - so I'm avoiding surrounding it with "do {} while(0)" */ - -#endif /* DEFINESONLY */ - -#endif /* _MCD_API_H */ diff --git a/include/asm-m68k/proc-mcfv4e/mcdapi/MCD_progCheck.h b/include/asm-m68k/proc-mcfv4e/mcdapi/MCD_progCheck.h deleted file mode 100644 index f90600c7cd..0000000000 --- a/include/asm-m68k/proc-mcfv4e/mcdapi/MCD_progCheck.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2008 Carsten Schlote - * See file CREDITS for list of people who contributed to this project. - * - * This file is part of U-Boot V2. - * - * U-Boot V2 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 3 of the License, or - * (at your option) any later version. - * - * U-Boot V2 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 U-Boot V2. If not, see . - */ - -/** @file - * This file is autogenerated. Do not change . - */ -#define CURRBD 4 -#define DCOUNT 6 -#define DESTPTR 5 -#define SRCPTR 7 diff --git a/include/asm-m68k/proc-mcfv4e/mcdapi/MCD_tasksInit.h b/include/asm-m68k/proc-mcfv4e/mcdapi/MCD_tasksInit.h deleted file mode 100644 index bc6ec91f98..0000000000 --- a/include/asm-m68k/proc-mcfv4e/mcdapi/MCD_tasksInit.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2008 Carsten Schlote - * See file CREDITS for list of people who contributed to this project. - * - * This file is part of U-Boot V2. - * - * U-Boot V2 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 3 of the License, or - * (at your option) any later version. - * - * U-Boot V2 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 U-Boot V2. If not, see . - */ - -/** @file - * Declaration for the MCD tasks. Do not edit. - */ -#ifndef MCD_TSK_INIT_H -#define MCD_TSK_INIT_H 1 - -/* - * Do not edit! - */ - -/* - * Task 0 - */ -void MCD_startDmaChainNoEu(int *currBD, short srcIncr, short destIncr, int xferSize, short xferSizeIncr, int *cSave, volatile TaskTableEntry *taskTable, int channel); - - -/* - * Task 1 - */ -void MCD_startDmaSingleNoEu(char *srcAddr, short srcIncr, char *destAddr, short destIncr, int dmaSize, short xferSizeIncr, int flags, int *currBD, int *cSave, volatile TaskTableEntry *taskTable, int channel); - - -/* - * Task 2 - */ -void MCD_startDmaChainEu(int *currBD, short srcIncr, short destIncr, int xferSize, short xferSizeIncr, int *cSave, volatile TaskTableEntry *taskTable, int channel); - - -/* - * Task 3 - */ -void MCD_startDmaSingleEu(char *srcAddr, short srcIncr, char *destAddr, short destIncr, int dmaSize, short xferSizeIncr, int flags, int *currBD, int *cSave, volatile TaskTableEntry *taskTable, int channel); - - -/* - * Task 4 - */ -void MCD_startDmaENetRcv(char *bDBase, char *currBD, char *rcvFifoPtr, volatile TaskTableEntry *taskTable, int channel); - - -/* - * Task 5 - */ -void MCD_startDmaENetXmit(char *bDBase, char *currBD, char *xmitFifoPtr, volatile TaskTableEntry *taskTable, int channel); - -#endif /* MCD_TSK_INIT_H */ diff --git a/include/asm-m68k/proc-mcfv4e/net/eth.h b/include/asm-m68k/proc-mcfv4e/net/eth.h deleted file mode 100644 index 5240c0c945..0000000000 --- a/include/asm-m68k/proc-mcfv4e/net/eth.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2008 Carsten Schlote - * See file CREDITS for list of people who contributed to this project. - * - * This file is part of U-Boot V2. - * - * U-Boot V2 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 3 of the License, or - * (at your option) any later version. - * - * U-Boot V2 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 U-Boot V2. If not, see . - */ - -/** @file - * Declaration for for Ethernet Frames. - */ - -#ifndef _ETH_H -#define _ETH_H - - -/* Ethernet standard lengths in bytes*/ -#define ETH_ADDR_LEN (6) -#define ETH_TYPE_LEN (2) -#define ETH_CRC_LEN (4) -#define ETH_MAX_DATA (1500) -#define ETH_MIN_DATA (46) -#define ETH_HDR_LEN (ETH_ADDR_LEN * 2 + ETH_TYPE_LEN) - -/* Defined Ethernet Frame Types */ -#define ETH_FRM_IP (0x0800) -#define ETH_FRM_ARP (0x0806) -#define ETH_FRM_RARP (0x8035) -#define ETH_FRM_TEST (0xA5A5) - -/* Maximum and Minimum Ethernet Frame Sizes */ -#define ETH_MAX_FRM (ETH_HDR_LEN + ETH_MAX_DATA + ETH_CRC_LEN) -#define ETH_MIN_FRM (ETH_HDR_LEN + ETH_MIN_DATA + ETH_CRC_LEN) -#define ETH_MTU (ETH_HDR_LEN + ETH_MAX_DATA) - -/* Ethernet Addresses */ -typedef uint8_t ETH_ADDR[ETH_ADDR_LEN]; - -/* 16-bit Ethernet Frame Type, ie. Protocol */ -typedef uint16_t ETH_FRM_TYPE; - -/* Ethernet Frame Header definition */ -typedef struct -{ - ETH_ADDR dest; - ETH_ADDR src; - ETH_FRM_TYPE type; -} ETH_HDR; - -/* Ethernet Frame definition */ -typedef struct -{ - ETH_HDR head; - uint8_t* data; -} ETH_FRAME; - - -#endif /* _ETH_H */ diff --git a/include/asm-m68k/proc-mcfv4e/net/nbuf.h b/include/asm-m68k/proc-mcfv4e/net/nbuf.h deleted file mode 100644 index bc3a7a6924..0000000000 --- a/include/asm-m68k/proc-mcfv4e/net/nbuf.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2008 Carsten Schlote - * See file CREDITS for list of people who contributed to this project. - * - * This file is part of U-Boot V2. - * - * U-Boot V2 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 3 of the License, or - * (at your option) any later version. - * - * U-Boot V2 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 U-Boot V2. If not, see . - */ - -/** @file - * Definitions for network buffer management - */ - -#ifndef _MCFV4E_NBUF_H_ -#define _MCFV4E_NBUF_H_ - -/* - * Include the Queue structure definitions - */ -#include "queue.h" - -/* - * Number of network buffers to use - */ -#define NBUF_MAX 30 - -/* - * Size of each buffer in bytes - */ -#ifndef NBUF_SZ -#define NBUF_SZ 1520 -#endif - -/* - * Defines to identify all the buffer queues - * - FREE must always be defined as 0 - */ -#define NBUF_FREE 0 /* available buffers */ -#define NBUF_TX_RING 1 /* buffers in the Tx BD ring */ -#define NBUF_RX_RING 2 /* buffers in the Rx BD ring */ -#define NBUF_SCRATCH 3 /* misc */ -#define NBUF_MAXQ 4 /* total number of queueus */ - -/* - * Buffer Descriptor Format - * - * Fields: - * next Pointer to next node in the queue - * data Pointer to the data buffer - * offset Index into buffer - * length Remaining bytes in buffer from (data + offset) - */ -typedef struct -{ - QNODE node; - uint8_t *data; - uint16_t offset; - uint16_t length; -} NBUF; - -/* - * Functions to manipulate the network buffers. - */ -int nbuf_init(void); -void nbuf_flush(void); - -NBUF * nbuf_alloc (void); -void nbuf_free(NBUF *); - -NBUF *nbuf_remove(int); -void nbuf_add(int, NBUF *); - -void nbuf_reset(void); -void nbuf_debug_dump(void); - - -#endif /* _MCFV4E_NBUF_H_ */ diff --git a/include/asm-m68k/proc-mcfv4e/net/net.h b/include/asm-m68k/proc-mcfv4e/net/net.h deleted file mode 100644 index a2ccd76510..0000000000 --- a/include/asm-m68k/proc-mcfv4e/net/net.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2008 Carsten Schlote - * See file CREDITS for list of people who contributed to this project. - * - * This file is part of U-Boot V2. - * - * U-Boot V2 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 3 of the License, or - * (at your option) any later version. - * - * U-Boot V2 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 U-Boot V2. If not, see . - */ - -/** @file - * Network definitions and prototypes for dBUG. - */ - -#ifndef _MCFV4E_NET_H -#define _MCFV4E_NET_H - -/* - * Include information and prototypes for all protocols - */ -#include "eth.h" -#include "nbuf.h" - -int netif_init(int channel); -int netif_setup(int channel); -int netif_done(int channel); - -#endif /* _MCFV4E_NET_H */ - diff --git a/include/asm-m68k/proc-mcfv4e/net/queue.h b/include/asm-m68k/proc-mcfv4e/net/queue.h deleted file mode 100644 index c9da1c83a5..0000000000 --- a/include/asm-m68k/proc-mcfv4e/net/queue.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2008 Carsten Schlote - * See file CREDITS for list of people who contributed to this project. - * - * This file is part of U-Boot V2. - * - * U-Boot V2 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 3 of the License, or - * (at your option) any later version. - * - * U-Boot V2 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 U-Boot V2. If not, see . - */ - -/** @file - * Implement a first in, first out linked list - */ -#ifndef _QUEUE_H_ -#define _QUEUE_H_ - -/* - * Individual queue node - */ -typedef struct NODE -{ - struct NODE *next; -} QNODE; - -/* - * Queue Struture - linked list of qentry items - */ -typedef struct -{ - QNODE *head; - QNODE *tail; -} QUEUE; - -/* - * Functions provided by queue.c - */ -void queue_init(QUEUE *); -int queue_isempty(QUEUE *); -void queue_add(QUEUE *, QNODE *); -QNODE* queue_remove(QUEUE *); -QNODE* queue_peek(QUEUE *); -void queue_move(QUEUE *, QUEUE *); - -#endif /* _QUEUE_H_ */ diff --git a/include/asm-m68k/proc-mcfv4e/processor.h b/include/asm-m68k/proc-mcfv4e/processor.h deleted file mode 100644 index f49b65d97b..0000000000 --- a/include/asm-m68k/proc-mcfv4e/processor.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2008 Carsten Schlote - * See file CREDITS for list of people who contributed to this project. - * - * This file is part of U-Boot V2. - * - * U-Boot V2 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 3 of the License, or - * (at your option) any later version. - * - * U-Boot V2 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 U-Boot V2. If not, see . - */ - -/** @file - * Coldfire V4e processor specific defines - */ - -/* Empty dummy FIXME */ - -/* interrupt management */ - -void mcf_interrupts_initialize (void); -int mcf_interrupts_register_handler (int vector, int (*handler)(void *, void *), void *hdev, void *harg); -void mcf_interrupts_remove_handler (int (*handler)(void *, void *)); -int mcf_execute_irq_handler (struct pt_regs *pt_regs,int); - diff --git a/include/asm-m68k/proc-mcfv4e/ptrace.h b/include/asm-m68k/proc-mcfv4e/ptrace.h deleted file mode 100644 index dd124291d6..0000000000 --- a/include/asm-m68k/proc-mcfv4e/ptrace.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2008 Carsten Schlote - * See file CREDITS for list of people who contributed to this project. - * - * This file is part of U-Boot V2. - * - * U-Boot V2 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 3 of the License, or - * (at your option) any later version. - * - * U-Boot V2 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 U-Boot V2. If not, see . - */ - -/** @file - * Declaration and defines for M68k register frames - */ -#ifndef __ASM_PROC_PTRACE_H -#define __ASM_PROC_PTRACE_H - -#define TRACE_FLAG 0x8000 -#define SVR_MODE 0x2000 -#define MODE_MASK 0x2000 -#define MASTER_FLAG 0x1000 -#define IRQ_MASK 0x0700 -#define CC_MASK 0x00FF - -#define CC_X_BIT 0x0010 -#define CC_N_BIT 0x0008 -#define CC_Z_BIT 0x0004 -#define CC_V_BIT 0x0002 -#define CC_C_BIT 0x0001 - -#define PCMASK 0x0 - -#ifndef __ASSEMBLY__ - -/* this struct defines the way the registers are stored on the - stack during a system call. */ - -struct pt_regs { - long uregs[37]; -}; -#define M68K_sp uregs[37] -#define M68K_sr uregs[36] -#define M68K_pc uregs[35] -#define M68K_fpiar uregs[34] -#define M68K_fpsr uregs[33] -#define M68K_fpcr uregs[32] - -#define M68K_fp7 uregs[30] -#define M68K_fp6 uregs[28] -#define M68K_fp5 uregs[26] -#define M68K_fp4 uregs[24] -#define M68K_fp3 uregs[22] -#define M68K_fp2 uregs[20] -#define M68K_fp1 uregs[18] -#define M68K_fp0 uregs[16] - -#define M68K_a7 uregs[15] -#define M68K_a6 uregs[14] -#define M68K_a5 uregs[13] -#define M68K_a4 uregs[12] -#define M68K_a3 uregs[11] -#define M68K_a2 uregs[10] -#define M68K_a1 uregs[ 9] -#define M68K_a0 uregs[ 8] -#define M68K_d7 uregs[ 7] -#define M68K_d6 uregs[ 6] -#define M68K_d5 uregs[ 5] -#define M68K_d4 uregs[ 4] -#define M68K_d3 uregs[ 3] -#define M68K_d2 uregs[ 2] -#define M68K_d1 uregs[ 1] -#define M68K_d0 uregs[ 0] - - -#ifdef __KERNEL__ - -#define user_mode(regs) \ - (((regs)->M68K_sr & SVR_MODE) == 0) - -#define processor_mode(regs) \ - ((regs)->M68K_sr & SVR_MODE) - -#define interrupts_enabled(regs) \ - (!((regs)->M68K_sr & IRQ_MASK)) - -#define condition_codes(regs) \ - ((regs)->M68K_sr & CC_MASK) - -/* Are the current registers suitable for user mode? - * (used to maintain security in signal handlers) - */ -static inline int valid_user_regs(struct pt_regs *regs) -{ - if ((regs->M68K_sr & SVR_MODE) == 0 && - (regs->M68K_sr & IRQ_MASK) == 7) - return 1; - - /* - * Force SR to something logical... - */ - regs->M68K_sr &= ~(CC_MASK); - - return 0; -} - -#endif /* __KERNEL__ */ - -#endif /* __ASSEMBLY__ */ - -#endif -- cgit v1.2.3