diff options
Diffstat (limited to 'c/src/lib/libbsp')
89 files changed, 0 insertions, 16331 deletions
diff --git a/c/src/lib/libbsp/a29k/portsw/start/Makefile.in b/c/src/lib/libbsp/a29k/portsw/start/Makefile.in deleted file mode 100644 index f89c5a7e6f..0000000000 --- a/c/src/lib/libbsp/a29k/portsw/start/Makefile.in +++ /dev/null @@ -1,54 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -# C source names, if any, go here -- minus the .c -C_PIECES= -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES=crt0 register -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -PGM=${ARCH}/crt0.o ${ARCH}/register.o - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: ${ARCH} $(SRCS) $(OBJS) $(PGM) - $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib diff --git a/c/src/lib/libbsp/a29k/portsw/start/amd.ah b/c/src/lib/libbsp/a29k/portsw/start/amd.ah deleted file mode 100644 index 69f34f173e..0000000000 --- a/c/src/lib/libbsp/a29k/portsw/start/amd.ah +++ /dev/null @@ -1,517 +0,0 @@ -; /* @(#)amd.ah 1.1 96/05/23 08:56:58, TEI */ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Initialization values for registers after RESET -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; /* $Id$ */ -; -;* File information and includes. - - .file "amd.ah" - .ident "@(#)amd.ah 1.1 96/05/23 08:56:58, TEI" - - - -; -;* AMD PROCESSOR SPECIFIC VALUES... -; - -; -;* Processor revision levels... -; - -; PRL values: 31-28 27-24 -; Am29000 0 x -; Am29005 1 x -; Am29050 2 x -; Am29035 3 x -; Am29030 4 x -; Am29200 5 x -; Am29205 5 1x -; Am29240 6 0 -; Manx 7 0 -; Cougar 8 0 - - - .equ AM29000_PRL, 0x00 - - .equ AM29005_PRL, 0x10 - - .equ AM29050_PRL, 0x20 - - .equ AM29035_PRL, 0x30 - - .equ AM29030_PRL, 0x40 - - .equ AM29200_PRL, 0x50 - - .equ AM29205_PRL, 0x58 - - .equ AM29240_PRL, 0x60 - - .equ AM29040_PRL, 0x70 - - .equ MANX_PRL, 0x70 - - .equ COUGAR_PRL, 0x80 - -; -;* data structures sizes. -; - .equ CFGINFO_SIZE, 16*4 - - .equ PGMINFO_SIZE, 16*4 - - .equ VARARGS_SPACE, 16*4 - - .equ WINDOWSIZE, 0x80 -; -;* Am29027 Mode registers -; - - .equ Am29027Mode1, 0x0fc00820 - - .equ Am29027Mode2, 0x00001375 - - - -;* Processor Based Equates and Defines - - .equ SIG_SYNC, -1 - - .equ ENABLE, (SM) - - .equ DISABLE, (ENABLE | DI | DA) - - .equ DISABLE_FZ, (FZ | ENABLE | DI | DA) - - .equ CLR_TRAP, (FZ | DA) - - .equ InitOPS, (TD | SM | (3<<IMShift) | DI | DA) - - .equ InitCPS, (TD | SM | (0<<IMShift) | DI | DA) - - .equ InitCPS1, (TD | SM | (0<<IMShift) | DI ) - - .equ CPS_TMR, (SM | (0<<IMShift) | DI) - - .equ CPS_INT0, (TD | SM | (0<<IMShift)) - - .equ CPS_TMRINT0, (SM | (0<<IMShift)) - - .equ InitCFG, 0x0 - - .equ InitRBP, (B0|B1|B2|B3|B4|B5) - - .equ TMC_VALUE, 0xFFFFFF - - .equ TMR_VALUE, (IE | TMC_VALUE) - - - - - - -;* 29205 specific (internal) peripheral initialization constants. - -; Current Processor Status (CPS) Register. -; Old Processor Status Register (OPS). - - .equ DA, 0x00001 - .equ DI, 0x00002 - .equ IMShift,0x2 - .equ SM, 0x00010 - .equ PI, 0x00020 - .equ PD, 0x00040 - .equ WM, 0x00080 - .equ RE, 0x00100 - .equ LK, 0x00200 - .equ FZ, 0x00400 - .equ TU, 0x00800 - .equ TP, 0x01000 - .equ TE, 0x02000 - .equ IP, 0x04000 - .equ CA, 0x08000 - .equ MM, 0x10000 - .equ TD, 0x20000 - -; Configuration Register (CFG) - - .equ CD, 0x01 - .equ CP, 0x02 - .equ BO, 0x04 - .equ RV, 0x08 - .equ VF, 0x10 - .equ DW, 0x20 - .equ CO, 0x40 - .equ EE, 0x80 - .equ IDShift, 8 - .equ CFG_ID, 0x100 - .equ ILShift, 9 - .equ CFG_ILMask, 0x600 - .equ DDShift, 11 - .equ CFG_DD, 0x800 - .equ DLShift, 12 - .equ CFG_DLMask, 0x3000 - .equ PCEShift, 14 - .equ CFG_PCE, 0x4000 - .equ PMBShift, 16 - .equ D16, 0x8000 - .equ TBOShift, 23 - .equ PRLShift, 24 - -; Channel Control Register (CHC) - - .equ CV, 0x1 - .equ NN, 0x2 - .equ TRShift, 2 - .equ TF, 0x400 - .equ PER, 0x800 - .equ LA, 0x1000 - .equ ST, 0x2000 - .equ ML, 0x4000 - .equ LS, 0x8000 - .equ CRShift, 16 - .equ CNTLShift, 24 - .equ CEShift, 31 - .equ WBERShift, 31 - -; Register Bank Protect (RBP) - .equ B0, 0x1 - .equ B1, 0x2 - .equ B2, 0x4 - .equ B3, 0x8 - .equ B4, 0x10 - .equ B5, 0x20 - .equ B6, 0x40 - .equ B7, 0x80 - .equ B8, 0x100 - .equ B9, 0x200 - .equ B10, 0x400 - .equ B11, 0x800 - .equ B12, 0x1000 - .equ B13, 0x2000 - .equ B14, 0x4000 - .equ B15, 0x8000 - -; Timer Counter - - .equ TCVMask, 0xffffff - -; Timer Reload Register - - .equ IE, 0x1000000 - .equ IN, 0x2000000 - .equ OV, 0x4000000 - .equ TRVMAsk, 0xffffff - -; MMU Configuration - - .equ PSShift, 8 - .equ PS0Shift, 8 - .equ PS1Shift, 12 - -; LRU Recommendation (LRU) - .equ LRUMask, 0xff - -; Reason Vector (RSN) - .equ RSNMask, 0xff - -; Region Mapping Address (RMA0 | RMA1) - .equ PBAMask,0xffff - .equ VBAShift, 16 - -; Region Mapping Control (RMC0 | RMC1) - .equ TIDMask, 0xff - .equ RMC_UE, 0x100 - .equ RMC_UW, 0x200 - .equ RMC_UR, 0x400 - .equ RMC_SE, 0x800 - .equ RMC_SW, 0x1000 - .equ RMC_SR, 0x2000 - .equ RMC_VE, 0x4000 - .equ RMC_IO, 0x10000 - .equ RGSShift, 17 - .equ RMC_PGMShift, 22 - -; Instruction breakpoint Control (IBC0 | IBC1) - .equ BPIDMask, 0xff - .equ BTE, 0x100 - .equ BRM, 0x200 - .equ IBC_BSY, 0x400 - .equ BEN, 0x800 - .equ BHO, 0x1000 - -; Cache Data Register (CDR) - .equ CDR_US, 0x1 - .equ P, 0x2 - .equ CDR_V, 0x4 - .equ IATAGShift, 20 - -; Cache Interface Register (CIR) - .equ CPTRShift, 2 - .equ CIR_RW, 0x1000000 - .equ FSELShift, 28 - -; Indirect Pointer A, B, C (IPA, IPB, IPC) - .equ IPShift, 2 - -; ALU Status (ALU) - .equ FCMask, 0x1F - .equ BPShift, 5 - .equ C, 0x80 - .equ Z, 0x100 - .equ N, 0x200 - .equ ALU_V, 0x400 - .equ DF, 0x800 - -; Byte Pointer - .equ BPMask, 0x3 - -; Load/Store Count Remaining (CR) - .equ CRMask, 0xff - -; Floating Point Environment (FPE) - .equ NM, 0x1 - .equ RM, 0x2 - .equ VM, 0x4 - .equ UM, 0x8 - .equ XM, 0x10 - .equ DM, 0x20 - .equ FRMShift, 6 - .equ FF, 0x100 - .equ ACFShift, 9 - -; Integer Environment (INTE) - .equ MO, 0x1 - .equ DO, 0x2 - -; Floating Point Status (FPS) - .equ NS, 0x1 - .equ RS, 0x2 - .equ VS, 0x4 - .equ FPS_US, 0x8 - .equ XS, 0x10 - .equ DS, 0x20 - .equ NT, 0x100 - .equ RT, 0x200 - .equ VT, 0x400 - .equ UT, 0x800 - .equ XT, 0x1000 - .equ DT, 0x2000 - -; Exception Opcode (EXOP) - .equ IOPMask, 0xff - -; TLB Entry Word 0 -; .equ TIDMask, 0xff already defined above - .equ TLB_UE, 0x100 - .equ TLB_UW, 0x200 - .equ TLB_UR, 0x400 - .equ TLB_SE, 0x800 - .equ TLB_SW, 0x1000 - .equ TLB_SR, 0x2000 - .equ TLB_VE, 0x4000 - .equ VTAGShift, 15 - -; TLB Entry Word 1 - .equ TLB_IO, 0x1 - .equ U, 0x2 - .equ TLB_PGMShift, 6 - .equ RPNShift, 10 - -; Am29200 ROM Control bits. - .equ RMCT_DW0Shift, 29 - .equ RMCT_DW1Shift, 21 - .equ RMCT_DW2Shift, 13 - .equ RMCT_DW3Shift, 5 - -; Am29200 DRAM Control bits. - .equ DW3, (1<<18) - .equ DW2, (1<<22) - .equ DW1, (1<<26) - .equ DW0, (1<<30) - - ; Internal peripheral address assignments. - .equ RMCT, 0x80000000 - .equ RMCF, 0x80000004 - .equ DRCT, 0x80000008 - .equ DRCF, 0x8000000C - .equ DRM0, 0x80000010 - .equ DRM1, 0x80000014 - .equ DRM2, 0x80000018 - .equ DRM3, 0x8000001C - .equ PIACT0, 0x80000020 - .equ PIACT1, 0x80000020 - .equ ICT, 0x80000028 - .equ DMCT0, 0x80000030 - .equ DMAD0, 0x80000034 - .ifdef revA - .equ TAD0, 0x80000036 - .equ TCN0, 0x8000003A - .else - .equ TAD0, 0x80000070 ; default - .equ TCN0, 0x8000003C ; default - .endif - .equ DMCN0, 0x80000038 - .equ DMCT1, 0x80000040 - .equ DMAD1, 0x80000044 - .equ DMCN1, 0x80000048 - .equ SPCT, 0x80000080 - .equ SPST, 0x80000084 - .equ SPTH, 0x80000088 - .equ SPRB, 0x8000008C - .equ BAUD, 0x80000090 - .equ PPCT, 0x800000C0 - .equ PPST, 0x800000C1 - .equ PPDT, 0x800000C4 - .equ POCT, 0x800000D0 - .equ PIN, 0x800000D4 - .equ POUT, 0x800000D8 - .equ POEN, 0x800000DC - .equ VCT, 0x800000E0 - .equ TOP, 0x800000E4 - .equ SIDE, 0x800000E8 - .equ VDT, 0x800000EC - - ; Interrupt Controller Register bits. - .equ TXDI, (1<<5) - .equ RXDI, (1<<6) - .equ RXSI, (1<<7) - .equ PPI, (1<<11) - .equ DMA1I, (1<<13) - .equ DMA0I, (1<<14) - .equ IOPIMask, (0xFF<<16) - .equ VDI, (1<<27) - .equ ICT200_I, (TXDI|RXDI|RXSI|PPI|DMA1I|DMA0I|IOPIMask|VDI) - .equ ICT205_I, (TXDI|RXDI|RXSI|PPI|DMA1I|DMA0I|IOPIMask|VDI) - - ; Serial port Initialization bits - .equ NO_PARITY, 0 - - - ; SPST bits - .equ THREShift, 22 - -;* REGISTER Addresses - - .equ ROMCntlRegAddr, 0x80000000 - - .equ ROMCfgRegAddr, 0x80000004 - - .equ DRAMCntlRegAddr, 0x80000008 - - .equ DRAMCfgRegAddr, 0x8000000C - - .equ DRAMMap0RegAddr, 0x80000010 - - .equ DRAMMap1RegAddr, 0x80000014 - - .equ DRAMMap2RegAddr, 0x80000018 - - .equ DRAMMap3RegAddr, 0x8000001C - - .equ PIACntl0RegAddr, 0x80000020 - - .equ PIACntl1RegAddr, 0x80000024 - - .equ INTRCntlRegAddr, 0x80000028 - - .equ DMACntl0RegAddr, 0x80000030 - - .equ DMACntl1RegAddr, 0x80000040 - - .equ SERPortCntlRegAddr, 0x80000080 - - .equ SERPortStatRegAddr, 0x80000084 - - .equ SERPortTHLDRegAddr, 0x80000088 - - .equ SERPortRbufRegAddr, 0x8000008C - - .equ SERPortBaudRegAddr, 0x80000090 - - .equ PARPortCntlRegAddr, 0x800000C0 - - .equ PIOCntlRegAddr, 0x800000D0 - - .equ PIOInpRegAddr, 0x800000D4 - - .equ PIOOutRegAddr, 0x800000D8 - - .equ PIOOutEnaRegAddr, 0x800000DC - - .equ VCTCntlRegAddr, 0x800000E0 - -; -;* Control constants -; - -;* AM29030 Timer related constants. - - .equ TMR_IE, 0x01000000 - - .equ TMR_IN, 0x02000000 - - .equ TMR_OV, 0x04000000 - - .equ TMC_INITCNT, 1613 - -; -;* System initialization values. -; - - .equ __os_version, 0x0001 ; - - .equ STACKSize, 0x8000 ; - - .equ PGMExecMode, 0x0000 ; - - .equ TSTCK_OFST, 28 * 4 - - .equ CSTCK_OFST, 29 * 4 - - .equ TMSTCK_OFST, 30 * 4 - - .equ CMSTCK_OFST, 31 * 4 - - .equ CTXSW_OK, 0xA55A ; ctx switch ok - - .set NV_STARTOFST, 0x20 ; 32 bytes - - .set NV_BAUDOFST, 0x00 ; 00 bytes - - .set reg_cir, 29 - - .set reg_cdr, 30 - - .equ MSG_BUFSIZE, 0x1000 ; serial buffer size - - .equ ILLOPTRAP, 0 - - .equ UATRAP, 1 - - .equ PVTRAP, 5 - - .equ UITLBMISSTRAP, 8 - - .equ UDTLBMISSTRAP, 9 - - .equ TIMERTRAP, 14 - - .equ TRACETRAP, 15 - - .equ XLINXTRAP, 16 - - .equ SERIALTRAP, 17 - - .equ SLOWTMRTRAP, 18 - - .equ PORTTRAP, 19 - - .equ SVSCTRAP, 80 - - .equ SVSCTRAP1, 81 - - .equ V_CACHETRAP, 66 ; - - .equ V_SETSERVICE, 67 ; diff --git a/c/src/lib/libbsp/a29k/portsw/start/pswmacro.ah b/c/src/lib/libbsp/a29k/portsw/start/pswmacro.ah deleted file mode 100644 index a994719c58..0000000000 --- a/c/src/lib/libbsp/a29k/portsw/start/pswmacro.ah +++ /dev/null @@ -1,442 +0,0 @@ -; /* @(#)pswmacro.ah 1.1 96/05/23 08:56:58, TEI */ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; macros: Do_install and init_TLB -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; /* $Id$ */ - -;* File information and includes. - - .file "macro.ah" - .ident "@(#)pswmacro.ah 1.1 96/05/23 08:56:58, TEI" - - - .macro CONST32, RegName, RegValue - const RegName, RegValue - consth RegName, RegValue - .endm - - .macro CONSTX, RegName, RegValue - .if (RegValue) <= 0x0000ffff - const RegName, RegValue - .else - const RegName, RegValue - consth RegName, RegValue - .endif - .endm - - .macro PRODEV, RegName - srl RegName, RegName, 24 - .endm - -; -;* MACRO TO INSTALL VECTOR TABLE ENTRIES -; - -;* Assumes vector table address in v0 - - .macro _setvec, trapnum, trapaddr - mfsr v0, vab ; - const v2, trapnum ; - sll v1, v2, 2 ; - add v1, v1, v0 ; v0 has location of vector tab - - const v2, trapaddr ; - consth v2, trapaddr ; - store 0, 0, v2, v1 ; - nop ; - .endm - - .macro syscall, name - const tav, HIF_@name ; - asneq V_SYSCALL, gr1, gr1 ; - nop ; - nop ; - .endm - - - -;* MACRO TO INSTALL VECTOR TABLE ENTRIES - - .macro Do_Install, V_Number, V_Address - const lr4, V_Address - consth lr4, V_Address - const lr3, V_Number * 4 - consth lr3, V_Number * 4 - call lr0, V_Install - nop - .endm - - .macro Do_InstallX, V_Number, V_Address - const lr4, V_Address - consth lr4, V_Address - const lr3, V_Number * 4 - consth lr3, V_Number * 4 - call lr0, V_InstallX - nop - .endm - - - -; push a register onto the stack - .macro pushreg, reg, sp - sub sp, sp, 4 ; adjust stack pointer - store 0, 0, reg, sp ; push register - .endm - - .macro push, sp, reg - sub sp, sp, 4 - store 0, 0, reg, sp - .endm - -; pop the register from stack - .macro popreg, reg, sp - load 0, 0, reg, sp ; pop register - add sp, sp, 4 ; adjust stack pointer - .endm - .macro pop, reg, sp - load 0, 0, reg, sp - add sp, sp, 4 - .endm - -; push a special register onto stack - .macro pushspcl, spcl, tmpreg, sp - sub sp, sp, 4 ; adjust stack pointer - mfsr tmpreg, spcl ; get spcl reg - store 0, 0, tmpreg, sp ; push onto stack - .endm - - .macro pushsr, sp, reg, sreg - mfsr reg, sreg - sub sp, sp, 4 - store 0, 0, reg, sp - .endm - -; pop a special register from stack - .macro popspcl, spcl, tmpreg, sp - load 0, 0, tmpreg, sp ; pop from stack - add sp, sp, 4 ; adjust stack pointer - mtsr spcl, tmpreg ; set spcl reg - .endm - - .macro popsr, sreg, reg, sp - load 0, 0, reg, sp - add sp, sp, 4 - mtsr sreg, reg - .endm - -; -; save freeze mode registers on memory stack. -; - - .macro SaveFZState, tmp1, tmp2 - - ; save freeze mode registers. - - pushspcl pc0, tmp1, msp - pushspcl pc1, tmp1, msp - pushspcl alu, tmp1, msp - - pushspcl cha, tmp1, msp - pushspcl chd, tmp1, msp - pushspcl chc, tmp1, msp - - pushspcl ops, tmp1, msp - - ; turn freeze off - - const tmp2, FZ - mfsr tmp1, cps - andn tmp1, tmp1, tmp2 - mtsr cps, tmp1 - .endm - -; restore freeze mode registers from memory stack. - - .macro RestoreFZState, tmp1, tmp2 - - ; turn freeze on - - const tmp2, (FZ|DI|DA) - mfsr tmp1, cps - or tmp1, tmp1, tmp2 - mtsr cps, tmp1 - - ; restore freeze mode registers. - - popspcl ops, tmp1, msp - popspcl chc, tmp1, msp - popspcl chd, tmp1, msp - popspcl cha, tmp1, msp - popspcl alu, tmp1, msp - popspcl pc1, tmp1, msp - popspcl pc0, tmp1, msp - .endm - -; -;* -; - .equ WS, 512 ; window size - .equ RALLOC, 4 * 4 ; stack alloc for C - .equ SIGCTX_UM_SIZE, 40 * 4 ; - .equ SIGCTX_RFB, (38) * 4 ; user mode saved - .equ SIGCTX_SM_SIZE, 12 * 4 ; - .equ SIGCTX_SIG, (11)*4 + SIGCTX_UM_SIZE ; - .equ SIGCTX_GR1, (10)*4 + SIGCTX_UM_SIZE ; - .equ SIGCTX_RAB, (9)*4 + SIGCTX_UM_SIZE ; - .equ SIGCTX_PC0, (8)*4 + SIGCTX_UM_SIZE ; - .equ SIGCTX_PC1, (7)*4 + SIGCTX_UM_SIZE ; - .equ SIGCTX_PC2, (6)*4 + SIGCTX_UM_SIZE ; - .equ SIGCTX_CHC, (3)*4 + SIGCTX_UM_SIZE ; - .equ SIGCTX_OPS, (1)*4 + SIGCTX_UM_SIZE ; - .equ SIGCTX_TAV, (0)*4 + SIGCTX_UM_SIZE ; - - .macro sup_sv - add it2, trapreg, 0 ; transfer signal # - sub msp, msp, 4 ; - store 0, 0, it2, msp ; save signal number - sub msp, msp, 4 ; push gr1 - - store 0, 0, gr1, msp ; - sub msp, msp, 4 ; push rab - store 0, 0, rab, msp ; - const it0, WS ; Window size - - sub rab, rfb, it0 ; set rab = rfb-512 - pushsr msp, it0, PC0 ; save program counter0 - pushsr msp, it0, PC1 ; save program counter1 - pushsr msp, it0, PC2 ; save program counter2 - - pushsr msp, it0, CHA ; save channel address - pushsr msp, it0, CHD ; save channel data - pushsr msp, it0, CHC ; save channel control - pushsr msp, it0, ALU ; save alu - - pushsr msp, it0, OPS ; save ops - sub msp, msp, 4 ; - store 0, 0, tav, msp ; push tav - mtsrim chc, 0 ; no loadm/storem - - mfsr it0, ops ; get ops value - const it1, (TD | DI) ; disable interrupts - consth it1, (TD | DI) ; disable interrupts - or it0, it0, it1 ; set bits - - mtsr ops, it0 ; set new ops - const it0, sigcode ; signal handler - consth it0, sigcode ; signal handler - mtsr pc1, it0 ; store pc1 - - add it1, it0, 4 ; next addr - mtsr pc0, it1 ; store pc1 location - iret ; return - nop ; ALIGN - .endm - - .macro sig_return - mfsr it0, cps ; get processor status - const it1, FZ|DA ; Freeze + traps disable - or it0, it0, it1 ; to set FZ+DA - mtsr cps, it0 ; in freeze mode - - load 0, 0, tav, msp ; restore tav - add msp, msp, 4 ; - - popsr OPS,it0, msp ; - popsr ALU,it0, msp ; - popsr CHC,it0, msp ; - popsr CHD,it0, msp ; - - popsr CHA,it0, msp ; - popsr PC2,it0, msp ; - popsr PC1,it0, msp ; - popsr PC0,it0, msp ; - - load 0, 0, rab, msp ; - add msp, msp, 4 ; - load 0, 0, it0, msp ; - add gr1, it0, 0 ; pop rsp - - add msp, msp, 8 ; discount signal # - iret - .endm - - .macro repair_R_stack - add v0, msp, SIGCTX_GR1 ; interrupted gr1 - load 0, 0, v2, v0 ; - add v0, msp, SIGCTX_RFB ; - load 0, 0, v3, v0 ; interupted rfb - - const v1, WS ; - sub v1, v3, v1 ; rfb-512 - cpltu v0, v2, v1 ; test gr1 < rfb-512 - jmpf v0, $1 ; - - add gr1, rab, 0 ; - add v2, v1, 0 ; set LB = rfb-512 -$1: -;* if gr1 < rfb-512 yes LB = rfb-512 signalled during spill -;* if no, LB=gr1 interrupted cache < 126 registers - cpleu v0, v2, rfb ; test LB<=rfb - jmpf v0, $2 ; - nop ; - add v2, rfb, 0 ; -$2: - cpeq v0, v3, rfb ; fill rfb->'rfb - jmpt v0, $3 ; if rfb==rfb' - const tav, (0x80<<2) ; prepare for fill - or tav, tav, v2 ; - - mtsr IPA, tav ; IPA=LA<<2 - sub tav, v3, gr98 ; cache fill LA->rfb - srl tav, tav, 2 ; convert to words - sub tav, tav, 1 ; - - mtsr cr, tav ; - loadm 0, 0, gr0, v2 ; fill from LA->rfb -$3: - add rfb, v3, 0 ; move rfb upto 'rfb - sub rab, v1, 0 ; assign rab to rfb-512 - - add v0, msp, SIGCTX_GR1 ; - load 0, 0, v2, v0 ; v0 = interrupted gr1 - add gr1, v2, 0 ; move gr1 upto 'gr1 - nop ; - .endm - - .macro repair_regs - mtsrim cr, 29 - 1 ; to restore locals - loadm 0, 0, v0, msp ; - add msp, msp, 29*4 ; - popsr Q, tav, msp ; - - popsr IPC, tav, msp ; - popsr IPB, tav, msp ; - popsr IPA, tav, msp ; - pop FPStat3, msp ; floating point regs - - pop FPStat2, msp ; floating point regs - pop FPStat1, msp ; floating point regs - pop FPStat0, msp ; floating point regs - - add msp, msp, 3*4 ; R-stack repaired - .endm - -; -;*HIF related... -; - - - - -; send the message in bufaddr to Montip. - .macro SendMessageToMontip, bufaddr - const lr2, bufaddr -$1: - call lr0, _msg_send - consth lr2, bufaddr - cpeq gr96, gr96, 0 - jmpf gr96, $1 - const lr2, bufaddr - .endm - -; build a HIF_CALL message in bufaddr to send to montip. - .macro BuildHIFCALLMsg, bufaddr, tmp1, tmp2 - const tmp1, bufaddr - consth tmp1, bufaddr - const tmp2, HIF_CALL_MSGCODE - store 0, 0, tmp2, tmp1 ; msg code - add tmp1, tmp1, 4 - const tmp2, HIF_CALL_MSGLEN - store 0, 0, tmp2, tmp1 ; msg len - add tmp1, tmp1, 4 - store 0, 0, gr121, tmp1 ; service number - add tmp1, tmp1, 4 - store 0, 0, lr2, tmp1 ; lr2 - add tmp1, tmp1, 4 - store 0, 0, lr3, tmp1 ; lr3 - add tmp1, tmp1, 4 - store 0, 0, lr4, tmp1 ; lr4 - .endm - -; -;* -;* All the funky AMD style macros go in here...simply for -;* compatility -; -; - .macro IMPORT, symbol - .extern symbol - .endm - - .macro GLOBAL, symbol - .global symbol - .endm - - .macro USESECT, name, type - .sect name, type - .use name - .endm - - .macro SECTION, name, type - .sect name, type - .endm - - .macro FUNC, fname, lineno - .global fname -fname: - .endm - - .macro ENDFUNC, fname, lineno - .endm - -;*************************************LONG - .macro LONG, varname -varname: - .block 4 - .endm - -;*************************************UNSIGNED LONG - .macro ULONG, varname -varname: - .block 4 - .endm - -;*************************************SHORT - .macro SHORT, varname -varname: - .block 2 - .endm - -;*************************************CHAR - .macro CHAR, varname -varname: - .block 1 - .endm - -;*************************************LONGARRAY - .macro LONGARRAY, name, count -name: - .block count*4 - .endm - -;*************************************SHORTARRAY - - .macro SHORTARRAY, name, count -name: - .block count*2 - .endm - -;*************************************CHARARRAY - - .macro CHARARRAY, name, count -name: - .block count - .endm - - -;*************************************VOID_FPTR - - .macro VOID_FPTR, name -name: - .block 4 - .endm diff --git a/c/src/lib/libbsp/a29k/portsw/start/register.ah b/c/src/lib/libbsp/a29k/portsw/start/register.ah deleted file mode 100644 index 1dced5b043..0000000000 --- a/c/src/lib/libbsp/a29k/portsw/start/register.ah +++ /dev/null @@ -1,214 +0,0 @@ -; /* @(#)register.ah 1.1 96/05/23 08:56:57, TEI */ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; naming of various registers -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; /* $Id$ */ - -;* File information and includes. - - .file "register.ah" - .ident "@(#)register.ah 1.1 96/05/23 08:56:57, TEI\n" - -;* Register Stack pointer and frame pointer registers. - - .extern Rrsp, Rfp - - .reg regsp, %%Rrsp - .reg fp, %%Rfp - - - .extern RTrapReg - .extern Rtrapreg - - .reg TrapReg, %%RTrapReg - .reg trapreg, %%Rtrapreg - - -;* Operating system Interrupt handler registers (gr64-gr67) - - .extern ROSint0, ROSint1, ROSint2, ROSint3 - - .reg OSint0, %%ROSint0 - .reg OSint1, %%ROSint1 - .reg OSint2, %%ROSint2 - .reg OSint3, %%ROSint3 - - .reg it0, %%ROSint0 - .reg it1, %%ROSint1 - .reg it2, %%ROSint2 - .reg it3, %%ROSint3 - - - -;* Operating system temporary (or scratch) registers (gr68-gr79) - - .extern ROStmp0, ROStmp1, ROStmp2, ROStmp3 - .extern ROStmp4, ROStmp5, ROStmp6, ROStmp7 - .extern ROStmp8, ROStmp9, ROStmp10, ROStmp11 - - .reg OStmp0, %%ROStmp0 - .reg OStmp1, %%ROStmp1 - .reg OStmp2, %%ROStmp2 - .reg OStmp3, %%ROStmp3 - - .reg OStmp4, %%ROStmp4 - .reg OStmp5, %%ROStmp5 - .reg OStmp6, %%ROStmp6 - .reg OStmp7, %%ROStmp7 - - .reg OStmp8, %%ROStmp8 - .reg OStmp9, %%ROStmp9 - .reg OStmp10, %%ROStmp10 - .reg OStmp11, %%ROStmp11 - - - .reg kt0, %%ROStmp0 - .reg kt1, %%ROStmp1 - .reg kt2, %%ROStmp2 - .reg kt3, %%ROStmp3 - - .reg kt4, %%ROStmp4 - .reg kt5, %%ROStmp5 - .reg kt6, %%ROStmp6 - .reg kt7, %%ROStmp7 - - .reg kt8, %%ROStmp8 - .reg kt9, %%ROStmp9 - .reg kt10, %%ROStmp10 - .reg kt11, %%ROStmp11 - - - .reg TempReg0, %%ROSint0 - .reg TempReg1, %%ROSint1 - .reg TempReg2, %%ROSint2 - .reg TempReg3, %%ROSint3 - - .reg TempReg4, %%ROStmp0 - .reg TempReg5, %%ROStmp1 - .reg TempReg6, %%ROStmp2 - .reg TempReg7, %%ROStmp3 - - .reg TempReg8, %%ROStmp4 - .reg TempReg9, %%ROStmp5 - .reg TempReg10, %%ROStmp6 - .reg TempReg11, %%ROStmp7 - - .reg TempReg12, %%ROStmp8 - .reg TempReg13, %%ROStmp9 - .reg TempReg14, %%ROStmp10 - .reg TempReg15, %%ROStmp11 - - -;* Assigned static registers - - .extern RSpillAddrReg, RFillAddrReg, RSignalAddrReg - .extern Rpcb, Retc - .extern RTimerExt, RTimerUtil, RLEDReg, RERRReg - .extern Ret0, Ret1, Ret2, Ret3, Ret4, Ret5, Ret6, Ret7, Reta, Retb - .extern Retx, Rety, Retz - - - .reg SpillAddrReg, %%RSpillAddrReg - .reg FillAddrReg, %%RFillAddrReg - .reg SignalAddrReg, %%RSignalAddrReg - .reg pcb, %%Rpcb - - .reg etx, %%Retx - .reg ety, %%Rety - .reg etz, %%Retz - .reg eta, %%Reta - - .reg etb, %%Retb - .reg etc, %%Retc - .reg TimerExt, %%RTimerExt - .reg TimerUtil, %%RTimerUtil - - .reg LEDReg, %%RLEDReg - .reg ERRReg, %%RERRReg - - - .reg et0, %%Ret0 - .reg et1, %%Ret1 - .reg et2, %%Ret2 - .reg et3, %%Ret3 - - .reg et4, %%Ret4 - .reg et5, %%Ret5 - .reg et6, %%Ret6 - .reg et7, %%Ret7 - -; - .equ SCB1REG_NUM, 88 - .reg SCB1REG_PTR, %%Ret0 - -; The floating point trap handlers need a few static registers - - .extern RFPStat0, RFPStat1, RFPStat2, RFPStat3 - .extern Rheapptr, RHeapPtr, RArgvPtr - - .reg FPStat0, %%RFPStat0 - .reg FPStat1, %%RFPStat1 - .reg FPStat2, %%RFPStat2 - .reg FPStat3, %%RFPStat3 - - .reg heapptr, %%Rheapptr - .reg HeapPtr, %%RHeapPtr - .reg ArgvPtr, %%RArgvPtr - - .extern RXLINXReg, RVMBCReg, RUARTReg, RETHERReg - - .reg XLINXReg, %%RXLINXReg - .reg VMBCReg, %%RVMBCReg - .reg UARTReg, %%RUARTReg - .reg ETHERReg, %%RXLINXReg - -;* Compiler and programmer registers. (gr96-gr127) - - .extern Rv0, Rv1, Rv2, Rv3, Rv4, Rv5, Rv6, Rv7, Rv8, Rv9 - .extern Rv10, Rv11, Rv12, Rv13, Rv14, Rv15 - - .reg v0, %%Rv0 - .reg v1, %%Rv1 - .reg v2, %%Rv2 - .reg v3, %%Rv3 - - .reg v4, %%Rv4 - .reg v5, %%Rv5 - .reg v6, %%Rv6 - .reg v7, %%Rv7 - - .reg v8, %%Rv8 - .reg v9, %%Rv9 - .reg v10, %%Rv10 - .reg v11, %%Rv11 - - .reg v12, %%Rv12 - .reg v13, %%Rv13 - .reg v14, %%Rv14 - .reg v15, %%Rv15 - - .extern Rtv0, Rtv1, Rtv2, Rtv3, Rtv4 - - .reg tv0, %%Rtv0 - .reg tv1, %%Rtv1 - .reg tv2, %%Rtv2 - .reg tv3, %%Rtv3 - .reg tv4, %%Rtv4 - -; **************************************************************************** -; For uatrap -; register definitions -- since this trap handler must allow for -; nested traps and interrupts such as TLB miss, protection violation, -; or Data Access Exception, and these trap handlers use the shared -; Temp registers, we must maintain our own that are safe over user- -; mode loads and stores. The following must be assigned global -; registers which are not used in INTR[0-3], TRAP[0-1], TLB miss, -; TLB protection violation, or data exception trap handlers. - -; .reg cha_cpy, OStmp4 ; copy of CHA -; .reg chd_cpy, OStmp5 ; copy of CHD -; .reg chc_cpy, OStmp6 ; copy of CHC -; .reg LTemp0, OStmp7 ; local temp 0 -; .reg LTemp1, OStmp8 ; local temp 1 - -; **************************************************************************** diff --git a/c/src/lib/libbsp/i386/shared/irq/idt.c b/c/src/lib/libbsp/i386/shared/irq/idt.c deleted file mode 100644 index 5f44bd0d2b..0000000000 --- a/c/src/lib/libbsp/i386/shared/irq/idt.c +++ /dev/null @@ -1,288 +0,0 @@ -/* - * cpu.c - This file contains implementation of C function to - * Instanciate IDT entries. More detailled information can be found - * on Intel site and more precisely in the following book : - * - * Pentium Processor familly - * Developper's Manual - * - * Volume 3 : Architecture and Programming Manual - * - * Copyright (C) 1998 Eric Valette (valette@crf.canon.fr) - * Canon Centre Recherche France. - * - * The license and distribution terms for this file may be - * found in found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <libcpu/cpu.h> -#include <irq.h> - -static rtems_raw_irq_connect_data* raw_irq_table; -static rtems_raw_irq_connect_data default_raw_irq_entry; -static interrupt_gate_descriptor default_idt_entry; -static rtems_raw_irq_global_settings* local_settings; - -void create_interrupt_gate_descriptor (interrupt_gate_descriptor* idtEntry, - rtems_raw_irq_hdl hdl) -{ - idtEntry->low_offsets_bits = (((unsigned) hdl) & 0xffff); - idtEntry->segment_selector = i386_get_cs(); - idtEntry->fixed_value_bits = 0; - idtEntry->gate_type = 0xe; - idtEntry->privilege = 0; - idtEntry->present = 1; - idtEntry->high_offsets_bits = ((((unsigned) hdl) >> 16) & 0xffff); -} - -rtems_raw_irq_hdl get_hdl_from_vector(rtems_vector_offset index) -{ - rtems_raw_irq_hdl hdl; - interrupt_gate_descriptor* idt_entry_tbl; - unsigned limit; - - i386_get_info_from_IDTR (&idt_entry_tbl, &limit); - - /* Convert limit into number of entries */ - limit = (limit + 1) / sizeof(interrupt_gate_descriptor); - - if(index >= limit) { - return 0; - } - - * ((unsigned int*) &hdl) = (idt_entry_tbl[index].low_offsets_bits | - (idt_entry_tbl[index].high_offsets_bits << 16)); - return hdl; -} - -int i386_set_idt_entry (const rtems_raw_irq_connect_data* irq) -{ - interrupt_gate_descriptor* idt_entry_tbl; - unsigned limit; - unsigned int level; - - - i386_get_info_from_IDTR (&idt_entry_tbl, &limit); - - /* Convert limit into number of entries */ - limit = (limit + 1) / sizeof(interrupt_gate_descriptor); - - if (irq->idtIndex >= limit) { - return 0; - } - /* - * Check if default handler is actually connected. If not issue an error. - * You must first get the current handler via i386_get_current_idt_entry - * and then disconnect it using i386_delete_idt_entry. - * RATIONALE : to always have the same transition by forcing the user - * to get the previous handler before accepting to disconnect. - */ - if (get_hdl_from_vector(irq->idtIndex) != default_raw_irq_entry.hdl) { - return 0; - } - - _CPU_ISR_Disable(level); - - raw_irq_table [irq->idtIndex] = *irq; - create_interrupt_gate_descriptor (&idt_entry_tbl[irq->idtIndex], irq->hdl); - irq->on(irq); - - _CPU_ISR_Enable(level); - return 1; -} - -void _CPU_ISR_install_vector (unsigned vector, - void* hdl, - void** oldHdl) -{ - interrupt_gate_descriptor* idt_entry_tbl; - unsigned limit; - interrupt_gate_descriptor new; - unsigned int level; - - i386_get_info_from_IDTR (&idt_entry_tbl, &limit); - - /* Convert limit into number of entries */ - limit = (limit + 1) / sizeof(interrupt_gate_descriptor); - - if (vector >= limit) { - return; - } - _CPU_ISR_Disable(level) - * ((unsigned int *) oldHdl) = idt_entry_tbl[vector].low_offsets_bits | - (idt_entry_tbl[vector].high_offsets_bits << 16); - - create_interrupt_gate_descriptor(&new, hdl); - idt_entry_tbl[vector] = new; - - _CPU_ISR_Enable(level); -} - -int i386_get_current_idt_entry (rtems_raw_irq_connect_data* irq) -{ - interrupt_gate_descriptor* idt_entry_tbl; - unsigned limit; - - i386_get_info_from_IDTR (&idt_entry_tbl, &limit); - - /* Convert limit into number of entries */ - limit = (limit + 1) / sizeof(interrupt_gate_descriptor); - - if (irq->idtIndex >= limit) { - return 0; - } - raw_irq_table [irq->idtIndex].hdl = get_hdl_from_vector(irq->idtIndex); - - *irq = raw_irq_table [irq->idtIndex]; - - return 1; -} - -int i386_delete_idt_entry (const rtems_raw_irq_connect_data* irq) -{ - interrupt_gate_descriptor* idt_entry_tbl; - unsigned limit; - unsigned int level; - - i386_get_info_from_IDTR (&idt_entry_tbl, &limit); - - /* Convert limit into number of entries */ - limit = (limit + 1) / sizeof(interrupt_gate_descriptor); - - if (irq->idtIndex >= limit) { - return 0; - } - /* - * Check if handler passed is actually connected. If not issue an error. - * You must first get the current handler via i386_get_current_idt_entry - * and then disconnect it using i386_delete_idt_entry. - * RATIONALE : to always have the same transition by forcing the user - * to get the previous handler before accepting to disconnect. - */ - if (get_hdl_from_vector(irq->idtIndex) != irq->hdl){ - return 0; - } - _CPU_ISR_Disable(level); - - idt_entry_tbl[irq->idtIndex] = default_idt_entry; - - irq->off(irq); - - raw_irq_table[irq->idtIndex] = default_raw_irq_entry; - raw_irq_table[irq->idtIndex].idtIndex = irq->idtIndex; - - _CPU_ISR_Enable(level); - - return 1; -} - -/* - * Caution this function assumes the IDTR has been already set. - */ -int i386_init_idt (rtems_raw_irq_global_settings* config) -{ - unsigned limit; - unsigned i; - unsigned level; - interrupt_gate_descriptor* idt_entry_tbl; - - i386_get_info_from_IDTR (&idt_entry_tbl, &limit); - - /* Convert limit into number of entries */ - limit = (limit + 1) / sizeof(interrupt_gate_descriptor); - - if (config->idtSize != limit) { - return 0; - } - /* - * store various accelarators - */ - raw_irq_table = config->rawIrqHdlTbl; - local_settings = config; - default_raw_irq_entry = config->defaultRawEntry; - - _CPU_ISR_Disable(level); - - create_interrupt_gate_descriptor (&default_idt_entry, default_raw_irq_entry.hdl); - - for (i=0; i < limit; i++) { - interrupt_gate_descriptor new; - create_interrupt_gate_descriptor (&new, raw_irq_table[i].hdl); - idt_entry_tbl[i] = new; - if (raw_irq_table[i].hdl != default_raw_irq_entry.hdl) { - raw_irq_table[i].on(&raw_irq_table[i]); - } - else { - raw_irq_table[i].off(&raw_irq_table[i]); - } - } - _CPU_ISR_Enable(level); - - return 1; -} - -int i386_get_idt_config (rtems_raw_irq_global_settings** config) -{ - *config = local_settings; - return 1; -} - -/* - * Caution this function assumes the GDTR has been already set. - */ -int i386_set_gdt_entry (unsigned short segment_selector, unsigned base, - unsigned limit) -{ - unsigned gdt_limit; - unsigned short tmp_segment = 0; - unsigned int limit_adjusted; - segment_descriptors* gdt_entry_tbl; - - - i386_get_info_from_GDTR (&gdt_entry_tbl, &gdt_limit); - - if (segment_selector > limit) { - return 0; - } - /* - * set up limit first - */ - limit_adjusted = limit; - if ( limit > 4095 ) { - gdt_entry_tbl[segment_selector].granularity = 1; - limit_adjusted /= 4096; - } - gdt_entry_tbl[segment_selector].limit_15_0 = limit_adjusted & 0xffff; - gdt_entry_tbl[segment_selector].limit_19_16 = (limit_adjusted >> 16) & 0xf; - /* - * set up base - */ - gdt_entry_tbl[segment_selector].base_address_15_0 = base & 0xffff; - gdt_entry_tbl[segment_selector].base_address_23_16 = (base >> 16) & 0xff; - gdt_entry_tbl[segment_selector].base_address_31_24 = (base >> 24) & 0xff; - /* - * set up descriptor type (this may well becomes a parameter if needed) - */ - gdt_entry_tbl[segment_selector].type = 2; /* Data R/W */ - gdt_entry_tbl[segment_selector].descriptor_type = 1; /* Code or Data */ - gdt_entry_tbl[segment_selector].privilege = 0; /* ring 0 */ - gdt_entry_tbl[segment_selector].present = 1; /* not present */ - - /* - * Now, reload all segment registers so the limit takes effect. - */ - - asm volatile( "movw %%ds,%0 ; movw %0,%%ds - movw %%es,%0 ; movw %0,%%es - movw %%fs,%0 ; movw %0,%%fs - movw %%gs,%0 ; movw %0,%%gs - movw %%ss,%0 ; movw %0,%%ss" - : "=r" (tmp_segment) - : "0" (tmp_segment) - ); - - return 1; -} diff --git a/c/src/lib/libbsp/i960/cvme961/start/Makefile.in b/c/src/lib/libbsp/i960/cvme961/start/Makefile.in deleted file mode 100644 index 68dcd2196e..0000000000 --- a/c/src/lib/libbsp/i960/cvme961/start/Makefile.in +++ /dev/null @@ -1,54 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -# C source names, if any, go here -- minus the .c -C_PIECES= -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES=start -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -PGM=${ARCH}/start.o - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: ${ARCH} $(SRCS) $(OBJS) $(PGM) - $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib diff --git a/c/src/lib/libbsp/m68k/efi332/start/Makefile.in b/c/src/lib/libbsp/m68k/efi332/start/Makefile.in deleted file mode 100644 index 2373aeca0b..0000000000 --- a/c/src/lib/libbsp/m68k/efi332/start/Makefile.in +++ /dev/null @@ -1,49 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/start332.o - -# C source names, if any, go here -- minus the .c -C_PIECES=start332 -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -SRCS=$(C_FILES) $(H_FILES) -OBJS=$(C_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: ${ARCH} $(SRCS) $(OBJS) $(PGM) - $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib diff --git a/c/src/lib/libbsp/m68k/efi332/start/start.c b/c/src/lib/libbsp/m68k/efi332/start/start.c deleted file mode 100644 index 05f8d75ce9..0000000000 --- a/c/src/lib/libbsp/m68k/efi332/start/start.c +++ /dev/null @@ -1,192 +0,0 @@ -/* - * $Id - */ - -#include <efi332.h> -#include <sim.h> -#define __START_C__ -#include "bsp.h" - -m68k_isr_entry M68Kvec[256]; -m68k_isr_entry vectors[256]; -char * const __argv[]= {"main", ""}; -char * const __env[]= {""}; - -/* - * This prototype really should have the noreturn attribute but - * that causes a warning since it appears that the routine does - * return. - * - * void dumby_start () __attribute__ ((noreturn)); - */ - -void dumby_start (); -void dumby_start() { -void boot_card(); - - /* We need to by-pass the link instruction since the RAM chip- - select pins are not yet configured. */ - asm volatile ( ".global start ; - start:"); - - /* disable interrupts, load stack pointer */ - asm volatile ( "oriw #0x0700, %sr; - moveal #M68Kvec, %a0; - movec %a0, %vbr; - movel #_end, %d0; - addl " STACK_SIZE ",%d0; - movel %d0,%sp; - link %a6, #0" - ); - - /* include in ram_init.S */ - /* - * Initalize the SIM module. - * The stack pointer is not usable until the RAM chip select lines - * are configured. The following code must remain inline. - */ - - /* Module Configuration Register */ - /* see section(s) 3.1.3-3.1.6 of the SIM Reference Manual */ - *SIMCR = (unsigned short int) - (FRZSW | FRZBM | SAM(0,8,SHEN) | (MM*SIM_MM) | SAM(SIM_IARB,0,IARB)); - - /* Synthesizer Control Register */ - /* see section(s) 4.8 */ - /* end include in ram_init.S */ - *SYNCR = (unsigned short int) - ( SAM(EFI_W,15,W) | SAM(0x0,14,X) | SAM(EFI_Y,8,Y) | STSIM ); - while (! (*SYNCR & SLOCK)); /* protect from clock overshoot */ - /* include in ram_init.S */ - *SYNCR = (unsigned short int) - ( SAM(EFI_W,15,W) | SAM(EFI_X,14,X) | SAM(EFI_Y,8,Y) | STSIM ); - - /* System Protection Control Register */ - /* !!! can only write to once after reset !!! */ - /* see section 3.8.4 of the SIM Reference Manual */ - *SYPCR = (unsigned char)( SAM(0x3,4,SWT) | HME | BME ); - - /* Periodic Interrupr Control Register */ - /* see section 3.8.2 of the SIM Reference Manual */ - *PICR = (unsigned short int) - ( SAM(0,8,PIRQL) | SAM(EFI_PIV,0,PIV) ); - /* ^^^ zero disables interrupt, don't enable here or ram_init will - be wrong. It's enabled below. */ - - /* Periodic Interrupt Timer Register */ - /* see section 3.8.3 of the SIM Reference Manual */ - *PITR = (unsigned short int)( SAM(0x09,0,PITM) ); - /* 1.098mS interrupt */ - - /* Port C Data */ - /* load values before enabled */ - *PORTC = (unsigned char) 0x0; - - /* Chip-Select Base Address Register */ - /* see section 7 of the SIM Reference Manual */ - *CSBARBT = (unsigned short int) - (((0x000000 >> 8)&0xfff8) | BS_512K ); /* 512k bytes located at 0x0000 */ - *CSBAR0 = (unsigned short int) - (((0x000000 >> 8)&0xfff8) | BS_1M ); /* 1M bytes located at 0x0000 */ - *CSBAR1 = (unsigned short int) - (((0x080000 >> 8)&0xfff8) | BS_256K ); /* 256k bytes located at 0x80000 */ - *CSBAR2 = (unsigned short int) - (((0x080000 >> 8)&0xfff8) | BS_256K ); /* 256 bytes located at 0x80000 */ - *CSBAR3 = (unsigned short int) - (0xfff8 | BS_64K); /* AVEC interrupts */ - *CSBAR10 = (unsigned short int) - (((0x000000 >> 8)&0xfff8) | BS_512K ); /* 512k bytes located at 0x0000 */ - - /* Chip-Select Options Registers */ - /* see section 7 of the SIM Reference Manual */ - *CSORBT = (unsigned short int) - ( BothBytes | ReadWrite | SyncAS | WaitStates_13 | UserSupSpace ); - *CSOR0 = (unsigned short int) - ( BothBytes | ReadOnly | SyncAS | External | UserSupSpace ); - *CSOR1 = (unsigned short int) - ( LowerByte | ReadWrite | SyncAS | FastTerm | UserSupSpace ); - *CSOR2 = (unsigned short int) - ( UpperByte | ReadWrite | SyncAS | FastTerm | UserSupSpace ); - *CSOR3 = (unsigned short int) - ( BothBytes | ReadWrite | SyncAS | CPUSpace | IPLevel_any | AVEC ); - *CSOR10 = (unsigned short int) - ( BothBytes | ReadOnly | SyncAS | External | UserSupSpace ); - - /* Chip Select Pin Assignment Register 0 */ - /* see section 7 of the SIM Reference Manual */ - *CSPAR0 = (unsigned short int)( - SAM(DisOut,CS_5,0x3000) | /* PC2 */ - SAM(DisOut,CS_4,0x0c00) | /* PC1 */ - SAM(DisOut,CS_3,0x0300) | /* AVEC (internally) */ - SAM(CS16bit,CS_2,0x00c0)| /* RAM UDS */ - SAM(CS16bit,CS_1,0x0030)| /* RAM LDS */ - SAM(CS16bit,CS_0,0x000c)| /* W/!R */ - SAM(CS16bit,CSBOOT,0x0003) /* ROM DS */ - ); - - /* Chip Select Pin Assignment Register 1 */ - /* see section 7 of the SIM Reference Manual */ - *CSPAR1 = (unsigned short int)( - SAM(CS16bit,CS_10,0x300)| /* ECLK */ - SAM(DisOut,CS_9,0x0c0) | /* PC6 */ - SAM(DisOut,CS_8,0x030) | /* PC5 */ - SAM(DisOut,CS_7,0x00c) | /* PC4 */ - SAM(DisOut,CS_6,0x003) /* PC3 */ - ); - - /* Port E and F Data Register */ - /* see section 9 of the SIM Reference Manual */ - *PORTE0 = (unsigned char) 0; - *PORTF0 = (unsigned char) 0; - - /* Port E and F Data Direction Register */ - /* see section 9 of the SIM Reference Manual */ - *DDRE = (unsigned char) 0xff; - *DDRF = (unsigned char) 0xfd; - - /* Port E and F Pin Assignment Register */ - /* see section 9 of the SIM Reference Manual */ - *PEPAR = (unsigned char) 0; - *PFPAR = (unsigned char) 0; - - /* end of SIM initalization code */ - /* end include in ram_init.S */ - - - - /* - * Initialize RAM by copying the .data section out of ROM (if - * needed) and "zero-ing" the .bss section. - */ - { - register char *src = _endtext; - register char *dst = _sdata; - - if (_copy_data_from_rom) - /* ROM has data at end of text; copy it. */ - while (dst < _edata) - *dst++ = *src++; - - /* Zero bss */ - for (dst = __bss_start; dst< _end; dst++) - *dst = 0; - } - - /* - * Initalize the board. - */ - Spurious_Initialize(); - console_init(); - - /* - * Execute main with arguments argv and environment env - */ - /* main(1, __argv, __env); */ - - boot_card(); - - reboot(); -} - -void reboot() {asm("trap #15");} - diff --git a/c/src/lib/libbsp/m68k/efi68k/start/Makefile.in b/c/src/lib/libbsp/m68k/efi68k/start/Makefile.in deleted file mode 100644 index ddd45a4c24..0000000000 --- a/c/src/lib/libbsp/m68k/efi68k/start/Makefile.in +++ /dev/null @@ -1,49 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/start68k.o - -# C source names, if any, go here -- minus the .c -C_PIECES=start68k -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -SRCS=$(C_FILES) $(H_FILES) -OBJS=$(C_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: ${ARCH} $(SRCS) $(OBJS) $(PGM) - $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib diff --git a/c/src/lib/libbsp/m68k/efi68k/start/start.c b/c/src/lib/libbsp/m68k/efi68k/start/start.c deleted file mode 100644 index f63381c57f..0000000000 --- a/c/src/lib/libbsp/m68k/efi68k/start/start.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * $Id$ - */ - -#include <efi68k.h> -#define __START_C__ -#include "bsp.h" - -m68k_isr_entry M68Kvec[256]; -m68k_isr_entry vectors[256]; -char * const __argv[]= {"main", ""}; -char * const __env[]= {""}; - -/* - * This prototype really should have the noreturn attribute but - * that causes a warning since it appears that the routine does - * return. - * - * void dumby_start () __attribute__ ((noreturn)); - */ - -void dumby_start (); -void dumby_start() { -void boot_card(); - - /* We need to by-pass the link instruction since the RAM chip- - select pins are not yet configured. */ - asm volatile ( ".global start ; - start:"); - - /* disable interrupts, load stack pointer */ - asm volatile ( "oriw #0x0700, %sr; - movel #_end, %d0; - addl " STACK_SIZE ",%d0; - movel %d0,%sp; - link %a6, #0" - ); - /* - * Initialize RAM by copying the .data section out of ROM (if - * needed) and "zero-ing" the .bss section. - */ - { - register char *src = _endtext; - register char *dst = _sdata; - - if (_copy_data_from_rom) - /* ROM has data at end of text; copy it. */ - while (dst < _edata) - *dst++ = *src++; - - /* Zero bss */ - for (dst = __bss_start; dst< _end; dst++) - *dst = 0; - } - - /* - * Initalize the board. - */ - Spurious_Initialize(); - console_init(); - watch_dog_init(); - tcp_init(); - - /* - * Execute main with arguments argv and environment env - */ - /* main(1, __argv, __env); */ - boot_card(); - - reboot(); -} diff --git a/c/src/lib/libbsp/m68k/gen68302/start/Makefile.in b/c/src/lib/libbsp/m68k/gen68302/start/Makefile.in deleted file mode 100644 index d96348b19d..0000000000 --- a/c/src/lib/libbsp/m68k/gen68302/start/Makefile.in +++ /dev/null @@ -1,57 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGMS=${ARCH}/start302.o - -# C source names, if any, go here -- minus the .c -C_PIECES= -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES=start302 -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: ${ARCH} $(SRCS) $(OBJS) $(PGM) - $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib - -# Install the program(s), appending _g or _p as appropriate. -# for include files, just use $(INSTALL) diff --git a/c/src/lib/libbsp/m68k/gen68302/start/start302.s b/c/src/lib/libbsp/m68k/gen68302/start/start302.s deleted file mode 100644 index 2a7c652c87..0000000000 --- a/c/src/lib/libbsp/m68k/gen68302/start/start302.s +++ /dev/null @@ -1,267 +0,0 @@ -/* entry.s - * - * This file contains the entry point for the application. - * The name of this entry point is compiler dependent. - * It jumps to the BSP which is responsible for performing - * all initialization. - * - * COPYRIGHT (c) 1989-1998. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "asm.h" - - .set BAR, 0xF2 | Base Address Register location - .set SCR, 0xF4 | System Control Register location - .set BAR_VAL, 0x0f7f | BAR value - .set SCR_VAL, 0x00080f00 | SCR value - .set GIMR_VAL, 0x8780 |Global Interrupt Mode Register. (MUST BE WRITTEN). - .set BaseAddr,(BAR_VAL&0x0fff)<<12 | MC68302 internal base address - - .set oSYSRAM, 0x000 | 576 bytes of internal system RAM - - .set oGIMR, 0x812 - - .set oCS0_Base, 0x830 | 16 bits, Chip Sel 0 Base Reg - .set oCS0_Option, 0x832 | 16 bits, Chip Sel 0 Option Reg - .set oCS1_Base, 0x834 | 16 bits, Chip Sel 1 Base Reg - .set oCS1_Option, 0x836 | 16 bits, Chip Sel 1 Option Reg - .set oCS2_Base, 0x838 | 16 bits, Chip Sel 2 Base Reg - .set oCS2_Option, 0x83a | 16 bits, Chip Sel 2 Option Reg - .set oCS3_Base, 0x83c | 16 bits, Chip Sel 3 Base Reg - .set oCS3_Option, 0x83e | 16 bits, Chip Sel 3 Option Reg - - .set tmpSRAM_BASE, 0x400000 | start of temporary SRAM - .set FLASH_BASE, 0xc00000 | start of FLASH''s normal location - - -BEGIN_CODE - PUBLIC (M68Kvec) | Vector Table -SYM (M68Kvec): | standard location for vectors -V___ISSP: .long 0x00001000 |00 0 Reset: Initial SSP -V____IPC: .long SYM(start)-V___ISSP |04 1 Reset: Initial PC -V_BUSERR: .long Bad-V___ISSP |08 2 Bus Error -V_ADRERR: .long Bad-V___ISSP |0c 3 Address Error - .space 240 | reserve space for reset of vectors - -#if ( M68K_HAS_SEPARATE_STACKS == 1 ) -SYM (lowintstack): - .space 4092 | reserve for interrupt stack -SYM (hiintstack): - .space 4 | end of interrupt stack -#endif - - PUBLIC (start) | Default entry point for GNU -SYM (start): - move.w #0x2700,sr | Disable all interrupts - move.w #BAR_VAL,BAR | Set Base Address Register - move.l #SCR_VAL,SCR | Set System Control Register - lea BaseAddr,a5 - move.w #GIMR_VAL,a5@(oGIMR) | Set Global Interrupt Mode Register - -| -| Set up chip select registers for the remapping process. -| - -| -| 0 X x x x x -| 0 000 0 0-- - --- ---- ---- ---- -| x xxx x xxx x xx -| - move.w #0xc001,a5@(oCS0_Base) | Expand CS0 to full size (FLASH) - move.w #0x1f82,a5@(oCS0_Option) | 000000-03ffff, R, 0 WS - -| -| X x x x x x -| 0 100 0 0-- - --- ---- ---- ---- -| x xxx x xxx x xx -| - move.w #0xa801,a5@(oCS1_Base) | Set up and enable CS1 (SRAM) - move.w #0x1f80,a5@(oCS1_Option) | 400000-43ffff, RW, 0 WS - -| -| Copy the initial boot FLASH area to the temporary SRAM location. -| - moveq #0,d0 - movea.l d0,a0 | a0 -> start of FLASH - lea tmpSRAM_BASE,a1 | a1 -> start of tmp SRAM -| moveq #(endPreBoot-V___ISSP)/4,d0 | # longs to copy - moveq #127,d0 -cpy_flash: move.l (a0)+,(a1)+ | copy - subq.l #1,d0 - bne cpy_flash - -| -| Copy remap code to 68302''s internal system RAM. -| - movea.w #begRemap-V___ISSP,a0 | a0 -> remap code - lea a5@(oSYSRAM),a1 | a1 -> internal system RAM -| moveq #(endRemap-begRemap)/2-1,d0 | d0 = # words to copy - moveq #11,d0 -cpy_remap: move.w (a0)+,(a1)+ | copy - dbra d0,cpy_remap - -| -| Jump to the remap code in the 68302''s internal system RAM. -| - jmp a5@(oSYSRAM) | (effectively a jmp begRemap) - -| -| This remap code, when executed from the 68302''s internal system RAM -| will 1) remap CS1 so that SRAM is at 0 -| 2) remap CS0 so that FLASH is at FLASH_BASE -| and 3) jump to executable code in the remapped FLASH. -| -begRemap: move.w #0xa001,a5@(oCS1_Base) | Move CS1 (SRAM) - move.w #0xd801,a5@(oCS0_Base) | Move CS0 (FLASH) - lea FLASH_BASE,a0 - jmp a0@(endRemap-V___ISSP.w) | Jump back to FLASH -endRemap: -| -| Now set up the remaining chip select registers. -| - -| -| 4 0 x x x x -| 1 000 1 111 0 000 0--- ---- ---- -| x xxx x xxx x xx -| - move.w #0xb1e1,a5@(oCS2_Base) | Set up and enable CS2 (dpRAM) - move.w #0x1ff0,a5@(oCS2_Option) | 8f0000-8f07ff, RW, 0 WS - -| -| 8 X x x x x -| 1 000 0 0-- - --- ---- ---- ---- -| x xxx x xxx x xx -| - move.w #0xd001,a5@(oCS3_Base) | Set up and enable CS3 (IO) - move.w #0x1f80,a5@(oCS3_Option) | 800000-83ffff, RW, 0 WS - -endPreBoot: - - move.b #0x30,0x800001 | set status LED amber - - .set oPIOB_Ctrl, 0x824 - .set oPIOB_DDR, 0x826 - .set oPIOB_Data, 0x828 - - .set oPIOA_Ctrl, 0x81e - .set oPIOA_DDR, 0x820 - .set oPIOA_Data, 0x822 - - move.w #0x0ff8,a5@(oPIOB_Data) | Make output follow resistors. - move.w #0x00ff,a5@(oPIOB_DDR) | Set up PB7-PB0 for output. - move.w #0x0080,a5@(oPIOB_Ctrl) | Set up WDOG* as dedicated - | peripheral pins. - - move.w #0x1fff,a5@(oPIOA_Data) | Make output follow resistors. - move.w #0xea2a,a5@(oPIOA_DDR) | Set up PA15-PA0 for in/output. - move.w #0x0003,a5@(oPIOA_Ctrl) | Set up TXD2/RXD2 as dedicated - | peripheral pins. - -| -| Place "Bad" in all vectors from 010 thru 0ec. Vectors 0f0 and 0f4 -| are not set because they are the 68302''s BAR and SCR. -| - movea.w #0x010,a0 - moveq #(0x0f0-0x010)/4-1,d0 - move.l #Bad,d1 -cpy_Bad: move.l d1,(a0)+ - dbra d0,cpy_Bad - - .set vbase, 0x0200 - - lea vbase,a0 - moveq #31,d0 -cpy_Bad1: move.l d1,(a0)+ - dbra d0,cpy_Bad1 - -| -| Fill in special locations to configure OS -| - move.l #Bad,0x008 | Bus Error - move.l #Bad,0x00c | Address Error - move.l #Bad,0x024 | Trace -| move.l #KE_IRET,$0b4 | pSOS+ RET_I Call - -| move.l #_cnsl_isr,vbase+0x028 | SCC2 - move.l #timerisr,vbase+0x018 | Timer ISR - - | - | zero out uninitialized data area - | -zerobss: - moveal # SYM (end),a0 | find end of .bss - moveal # SYM (bss_start),a1 | find beginning of .bss - moveq #0,d0 - -loop: movel d0,a1@+ | to zero out uninitialized - cmpal a0,a1 - jlt loop | loop until _end reached - - movel # SYM (end),d0 | d0 = end of bss/start of heap - addl # SYM (heap_size),d0 | d0 = end of heap - movel d0, SYM (stack_start) | Save for brk() routine - addl # SYM (stack_size),d0 | make room for stack - andl #0xffffffc0,d0 | align it on 16 byte boundary - movw #0x3700,sr | SUPV MODE,INTERRUPTS OFF!!! - movel d0,a7 | set master stack pointer - movel d0,a6 | set base pointer - - /* - * RTEMS should maintain a separate interrupt stack on CPUs - * without one in hardware. This is currently not supported - * on versions of the m68k without a HW intr stack. - */ - -#if ( M68K_HAS_SEPARATE_STACKS == 1 ) - lea SYM (hiintstack),a0 | a0 = high end of intr stack - movec a0,isp | set interrupt stack -#endif - - move.l #0,a7@- | environp - move.l #0,a7@- | argv - move.l #0,a7@- | argc - jsr SYM (boot_card) - - nop -Bad: bra Bad - - nop -END_CODE - - -BEGIN_DATA - - PUBLIC (start_frame) -SYM (start_frame): - .space 4,0 - - PUBLIC (stack_start) -SYM (stack_start): - .space 4,0 -END_DATA - -BEGIN_BSS - - PUBLIC (environ) - .align 2 -SYM (environ): - .long 0 - - PUBLIC (heap_size) - .set SYM (heap_size),0x2000 - - PUBLIC (stack_size) - .set SYM (stack_size),0x1000 - - -END_DATA -END diff --git a/c/src/lib/libbsp/m68k/gen68340/start/Makefile.in b/c/src/lib/libbsp/m68k/gen68340/start/Makefile.in deleted file mode 100644 index ce91b95e3b..0000000000 --- a/c/src/lib/libbsp/m68k/gen68340/start/Makefile.in +++ /dev/null @@ -1,57 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGMS=${ARCH}/start340.o - -# C source names, if any, go here -- minus the .c -C_PIECES= -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES=start340 -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: ${ARCH} $(SRCS) $(OBJS) $(PGM) - $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib - -# Install the program(s), appending _g or _p as appropriate. -# for include files, just use $(INSTALL) diff --git a/c/src/lib/libbsp/m68k/gen68340/start/start340.s b/c/src/lib/libbsp/m68k/gen68340/start/start340.s deleted file mode 100644 index 58ea0c92d0..0000000000 --- a/c/src/lib/libbsp/m68k/gen68340/start/start340.s +++ /dev/null @@ -1,874 +0,0 @@ -/* - * This file contains the entry point for the application. - * The name of this entry point is compiler dependent. - * It jumps to the BSP which is responsible for performing - * all initialization. - * - * COPYRIGHT (c) 1989-1998. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * Based on the `gen68360' board support package, and covered by the - * original distribution terms. - * - * Geoffroy Montel - * France Telecom - CNET/DSM/TAM/CAT - * 4, rue du Clos Courtel - * 35512 CESSON-SEVIGNE - * FRANCE - * - * e-mail: g_montel@yahoo.com - * - * $Id$ - */ - -#include "asm.h" -#include <m68349.inc> - -#define _OLD_ASTECC 1 /* old addresses for AST68340 only, undefine for AST68349 */ - -BEGIN_CODE - /* - * Step 1: Decide on Reset Stack Pointer and Initial Program Counter - */ -Entry: - .long SYM(m340)+1024 | 0: Initial SSP - .long start | 1: Initial PC - .long SYM(_uhoh) | 2: Bus error - .long SYM(_uhoh) | 3: Address error - .long SYM(_uhoh) | 4: Illegal instruction - .long SYM(_uhoh) | 5: Zero division - .long SYM(_uhoh) | 6: CHK, CHK2 instruction - .long SYM(_uhoh) | 7: TRAPcc, TRAPV instructions - .long SYM(_uhoh) | 8: Privilege violation - .long SYM(_uhoh) | 9: Trace - .long SYM(_uhoh) | 10: Line 1010 emulator - .long SYM(_uhoh) | 11: Line 1111 emulator - .long SYM(_uhoh) | 12: Hardware breakpoint - .long SYM(_uhoh) | 13: Reserved for coprocessor violation - .long SYM(_uhoh) | 14: Format error - .long SYM(_uhoh) | 15: Uninitialized interrupt - .long SYM(_uhoh) | 16: Unassigned, reserved - .long SYM(_uhoh) | 17: - .long SYM(_uhoh) | 18: - .long SYM(_uhoh) | 19: - .long SYM(_uhoh) | 20: - .long SYM(_uhoh) | 21: - .long SYM(_uhoh) | 22: - .long SYM(_uhoh) | 23: - .long SYM(_spuriousInterrupt) | 24: Spurious interrupt - .long SYM(_uhoh) | 25: Level 1 interrupt autovector - .long SYM(_uhoh) | 26: Level 2 interrupt autovector - .long SYM(_uhoh) | 27: Level 3 interrupt autovector - .long SYM(_uhoh) | 28: Level 4 interrupt autovector - .long SYM(_uhoh) | 29: Level 5 interrupt autovector - .long SYM(_uhoh) | 30: Level 6 interrupt autovector - .long SYM(_uhoh) | 31: Level 7 interrupt autovector - .long SYM(_uhoh) | 32: Trap instruction (0-15) - .long SYM(_uhoh) | 33: - .long SYM(_uhoh) | 34: - .long SYM(_uhoh) | 35: - .long SYM(_uhoh) | 36: - .long SYM(_uhoh) | 37: - .long SYM(_uhoh) | 38: - .long SYM(_uhoh) | 39: - .long SYM(_uhoh) | 40: - .long SYM(_uhoh) | 41: - .long SYM(_uhoh) | 42: - .long SYM(_uhoh) | 43: - .long SYM(_uhoh) | 44: - .long SYM(_uhoh) | 45: - .long SYM(_uhoh) | 46: - .long SYM(_uhoh) | 47: - .long SYM(_uhoh) | 48: Reserved for coprocessor - .long SYM(_uhoh) | 49: - .long SYM(_uhoh) | 50: - .long SYM(_uhoh) | 51: - .long SYM(_uhoh) | 52: - .long SYM(_uhoh) | 53: - .long SYM(_uhoh) | 54: - .long SYM(_uhoh) | 55: - .long SYM(_uhoh) | 56: - .long SYM(_uhoh) | 57: - .long SYM(_uhoh) | 58: - .long SYM(_uhoh) | 59: Unassigned, reserved - .long SYM(_uhoh) | 60: - .long SYM(_uhoh) | 61: - .long SYM(_uhoh) | 62: - .long SYM(_uhoh) | 63: - .long SYM(_uhoh) | 64: User defined vectors (192) - .long SYM(_uhoh) | 65: - .long SYM(_uhoh) | 66: - .long SYM(_uhoh) | 67: - .long SYM(_uhoh) | 68: - .long SYM(_uhoh) | 69: - .long SYM(_uhoh) | 70: - .long SYM(_uhoh) | 71: - .long SYM(_uhoh) | 72: - .long SYM(_uhoh) | 73: - .long SYM(_uhoh) | 74: - .long SYM(_uhoh) | 75: - .long SYM(_uhoh) | 76: - .long SYM(_uhoh) | 77: - .long SYM(_uhoh) | 78: - .long SYM(_uhoh) | 79: - .long SYM(_uhoh) | 80: - .long SYM(_uhoh) | 81: - .long SYM(_uhoh) | 82: - .long SYM(_uhoh) | 83: - .long SYM(_uhoh) | 84: - .long SYM(_uhoh) | 85: - .long SYM(_uhoh) | 86: - .long SYM(_uhoh) | 87: - .long SYM(_uhoh) | 88: - .long SYM(_uhoh) | 89: - .long SYM(_uhoh) | 90: - .long SYM(_uhoh) | 91: - .long SYM(_uhoh) | 92: - .long SYM(_uhoh) | 93: - .long SYM(_uhoh) | 94: - .long SYM(_uhoh) | 95: - .long SYM(_uhoh) | 96: - .long SYM(_uhoh) | 97: - .long SYM(_uhoh) | 98: - .long SYM(_uhoh) | 99: - .long SYM(_uhoh) | 100: - .long SYM(_uhoh) | 101: - .long SYM(_uhoh) | 102: - .long SYM(_uhoh) | 103: - .long SYM(_uhoh) | 104: - .long SYM(_uhoh) | 105: - .long SYM(_uhoh) | 106: - .long SYM(_uhoh) | 107: - .long SYM(_uhoh) | 108: - .long SYM(_uhoh) | 109: - .long SYM(_uhoh) | 110: - .long SYM(_uhoh) | 111: - .long SYM(_uhoh) | 112: - .long SYM(_uhoh) | 113: - .long SYM(_uhoh) | 114: - .long SYM(_uhoh) | 115: - .long SYM(_uhoh) | 116: - .long SYM(_uhoh) | 117: - .long SYM(_uhoh) | 118: - .long SYM(_uhoh) | 119: - .long SYM(_uhoh) | 120: - .long SYM(_uhoh) | 121: - .long SYM(_uhoh) | 122: - .long SYM(_uhoh) | 123: - .long SYM(_uhoh) | 124: - .long SYM(_uhoh) | 125: - .long SYM(_uhoh) | 126: - .long SYM(_uhoh) | 127: - .long SYM(_uhoh) | 128: - .long SYM(_uhoh) | 129: - .long SYM(_uhoh) | 130: - .long SYM(_uhoh) | 131: - .long SYM(_uhoh) | 132: - .long SYM(_uhoh) | 133: - .long SYM(_uhoh) | 134: - .long SYM(_uhoh) | 135: - .long SYM(_uhoh) | 136: - .long SYM(_uhoh) | 137: - .long SYM(_uhoh) | 138: - .long SYM(_uhoh) | 139: - .long SYM(_uhoh) | 140: - .long SYM(_uhoh) | 141: - .long SYM(_uhoh) | 142: - .long SYM(_uhoh) | 143: - .long SYM(_uhoh) | 144: - .long SYM(_uhoh) | 145: - .long SYM(_uhoh) | 146: - .long SYM(_uhoh) | 147: - .long SYM(_uhoh) | 148: - .long SYM(_uhoh) | 149: - .long SYM(_uhoh) | 150: - .long SYM(_uhoh) | 151: - .long SYM(_uhoh) | 152: - .long SYM(_uhoh) | 153: - .long SYM(_uhoh) | 154: - .long SYM(_uhoh) | 155: - .long SYM(_uhoh) | 156: - .long SYM(_uhoh) | 157: - .long SYM(_uhoh) | 158: - .long SYM(_uhoh) | 159: - .long SYM(_uhoh) | 160: - .long SYM(_uhoh) | 161: - .long SYM(_uhoh) | 162: - .long SYM(_uhoh) | 163: - .long SYM(_uhoh) | 164: - .long SYM(_uhoh) | 165: - .long SYM(_uhoh) | 166: - .long SYM(_uhoh) | 167: - .long SYM(_uhoh) | 168: - .long SYM(_uhoh) | 169: - .long SYM(_uhoh) | 170: - .long SYM(_uhoh) | 171: - .long SYM(_uhoh) | 172: - .long SYM(_uhoh) | 173: - .long SYM(_uhoh) | 174: - .long SYM(_uhoh) | 175: - .long SYM(_uhoh) | 176: - .long SYM(_uhoh) | 177: - .long SYM(_uhoh) | 178: - .long SYM(_uhoh) | 179: - .long SYM(_uhoh) | 180: - .long SYM(_uhoh) | 181: - .long SYM(_uhoh) | 182: - .long SYM(_uhoh) | 183: - .long SYM(_uhoh) | 184: - .long SYM(_uhoh) | 185: - .long SYM(_uhoh) | 186: - .long SYM(_uhoh) | 187: - .long SYM(_uhoh) | 188: - .long SYM(_uhoh) | 189: - .long SYM(_uhoh) | 190: - .long SYM(_uhoh) | 191: - .long SYM(_uhoh) | 192: - .long SYM(_uhoh) | 193: - .long SYM(_uhoh) | 194: - .long SYM(_uhoh) | 195: - .long SYM(_uhoh) | 196: - .long SYM(_uhoh) | 197: - .long SYM(_uhoh) | 198: - .long SYM(_uhoh) | 199: - .long SYM(_uhoh) | 200: - .long SYM(_uhoh) | 201: - .long SYM(_uhoh) | 202: - .long SYM(_uhoh) | 203: - .long SYM(_uhoh) | 204: - .long SYM(_uhoh) | 205: - .long SYM(_uhoh) | 206: - .long SYM(_uhoh) | 207: - .long SYM(_uhoh) | 208: - .long SYM(_uhoh) | 209: - .long SYM(_uhoh) | 210: - .long SYM(_uhoh) | 211: - .long SYM(_uhoh) | 212: - .long SYM(_uhoh) | 213: - .long SYM(_uhoh) | 214: - .long SYM(_uhoh) | 215: - .long SYM(_uhoh) | 216: - .long SYM(_uhoh) | 217: - .long SYM(_uhoh) | 218: - .long SYM(_uhoh) | 219: - .long SYM(_uhoh) | 220: - .long SYM(_uhoh) | 221: - .long SYM(_uhoh) | 222: - .long SYM(_uhoh) | 223: - .long SYM(_uhoh) | 224: - .long SYM(_uhoh) | 225: - .long SYM(_uhoh) | 226: - .long SYM(_uhoh) | 227: - .long SYM(_uhoh) | 228: - .long SYM(_uhoh) | 229: - .long SYM(_uhoh) | 230: - .long SYM(_uhoh) | 231: - .long SYM(_uhoh) | 232: - .long SYM(_uhoh) | 233: - .long SYM(_uhoh) | 234: - .long SYM(_uhoh) | 235: - .long SYM(_uhoh) | 236: - .long SYM(_uhoh) | 237: - .long SYM(_uhoh) | 238: - .long SYM(_uhoh) | 239: - .long SYM(_uhoh) | 240: - .long SYM(_uhoh) | 241: - .long SYM(_uhoh) | 242: - .long SYM(_uhoh) | 243: - .long SYM(_uhoh) | 244: - .long SYM(_uhoh) | 245: - .long SYM(_uhoh) | 246: - .long SYM(_uhoh) | 247: - .long SYM(_uhoh) | 248: - .long SYM(_uhoh) | 249: - .long SYM(_uhoh) | 250: - .long SYM(_uhoh) | 251: - .long SYM(_uhoh) | 252: - .long SYM(_uhoh) | 253: - .long SYM(_uhoh) | 254: - .long SYM(_uhoh) | 255: - -/* - * Default trap handler - * With an oscilloscope you can see AS* stop - */ - PUBLIC (_uhoh) -SYM(_uhoh): nop | Leave spot for breakpoint -/* stop #0x2700 | Stop with interrupts disabled */ - move.w #0x2700,sr - move.w (a7),_boot_panic_registers+4 | SR - move.l 2(a7),_boot_panic_registers | PC - move.w 6(a7),_boot_panic_registers+6 | format & vector - movem.l d0-d7/a0-a7, _boot_panic_registers+8 - movec sfc, d0 - movem.l d0, _boot_panic_registers+72 - movec dfc, d0 - movem.l d0, _boot_panic_registers+76 - movec vbr, d0 - movem.l d0, _boot_panic_registers+80 - jmp SYM(_dbug_dumpanic) - bra.s _crt0_cold_start - -/* - * Log, but otherwise ignore, spurious interrupts - */ - PUBLIC (_spuriousInterrupt) -SYM(_spuriousInterrupt): - addql #1,SYM(_M68kSpuriousInterruptCount) - rte - -/* - * Place the low-order 3 octets of the board's ethernet address at - * a `well-known' fixed location relative to the startup location. - */ - .align 2 - .word 0 | Padding -ethernet_address_buffer: - .word 0x08F3 | Default address - .word 0xDEAD - .word 0xCAFE - -BEGIN_DATA - -/* equates */ - -.equ _CPU340, 0x0 -.equ _CPU349, 0x31 - -#ifdef _OLD_ASTECC /* old addresses for AST68340 only */ -.equ _EPLD_CS_BASE, 0x1 -.equ _PROM_Start, 0x01000000 /* CS0 */ -.equ _FLEX_Start, 0x08000000 /* CS2 */ -.equ _I2C_Start, 0x0c000000 /* CS3 */ - -.equ _BCCram_Start, 0x00000000 /* CS1 64 Kbytes */ -.equ _BCCram_Size, 0x00010000 /* CS1 64 Kbytes */ - -.equ _ExtRam_Start, 0x10000000 /* SRAM */ -.equ _ExtRam_Size, 0x00400000 /* 4 Mbytes */ - -.equ _FastRam_Start, 0x00000000 /* overlap /CS1 for the first 4 Kbytes */ -.equ _FastRam_Size, 0x00001000 /* 4 Kbytes */ - -#else /* new addresses for AST68349 and 68340 */ - -.equ _EPLD_CS_BASE, 0x5 -.equ _PROM_Start, 0x50000000 /* CS0 */ -.equ _FLEX_Start, 0x08000000 /* CS2 */ -.equ _I2C_Start, 0x0c000000 /* CS3 */ - -.equ _BCCram_Start, 0x00000000 /* CS1 64 Kbytes */ -.equ _BCCram_Size, 0x00010000 /* CS1 64 Kbytes */ - -.equ _ExtRam_Start, 0x80000000 /* DRAM */ -.equ _ExtRam_Size, 0x00400000 /* 4 Mbytes */ - -.equ _FastRam_Start, 0x00000000 /* overlap /CS1 for the first 4 Kbytes */ -.equ _FastRam_Size, 0x00001000 /* 4 Kbytes */ -#endif - -.equ _SPEED349, 0xD680 /* 24 Mhz */ -.equ _SPEED340, 0xD700 /* 25 Mhz */ -/* .equ _SPEED340, 0xCE00 16 Mhz */ - -#define crt0_boot_type d0 /* cold/warm start (must be D0) */ -#define crt0_temp d1 -#define crt0_cpu_type d2 -#define crt0_csswitch d3 -#define crt0_buswidth d4 -#define crt0_pdcs d5 -#define crt0_spare6 d6 -#define crt0_spare7 d7 -#define crt0_sim_base a0 -#define crt0_glue a1 -#define crt0_dram a2 -#define crt0_ptr3 a3 -#define crt0_ptr4 a4 -#define crt0_ptr5 a5 -#define crt0_ptr6 a6 - -/* -- PDCS buffer equates -- */ -.equ pdcs_mask, 0x1F /* DRAM configuration */ -.equ pdcs_sw12, 7 /* switch 12 */ -.equ pdcs_sw11, 6 /* switch 11 */ -.equ pdcs_sw14, 5 /* switch 14 */ - -.equ bit_cache, pdcs_sw12 /* enable cache if on */ -.equ bit_meminit, pdcs_sw11 /* init memory if on */ - -/* -- Initialization stack and vars -- */ - -_AsteccBusWidth: ds.b 1 -_AsteccCsSwitch: ds.b 1 -_AsteccCpuName: ds.l 1 - -.align 4 - -_crt0_init_stack: - ds.l 500 -_crt0_init_stktop: - -/* -- Initialization code -- */ -BEGIN_CODE - -.align 4 - dc.l _crt0_init_stktop /* reset SP */ - dc.l _crt0_cold_start /* reset PC */ - dc.l _crt0_warm_start - - .ascii "BOOT XHM68K/Spectra for ASTECC 68349 and 68340 boards" - dc.w 0 -.align 4 - -.globl start -start: - -_crt0_cold_start: - moveq.l #0,crt0_boot_type | signal cold reset - bra.s _crt0_common_start - -_crt0_warm_start: - moveq.l #1,crt0_boot_type | signal warm reset - -_crt0_common_start: - move.w #0x2700,sr | disable interrupts and switch to interrupt mode - movea.l #_crt0_init_stktop,sp | set up initialization stack - - move.l #Entry,crt0_temp | VBR initialization - movec.l crt0_temp,vbr | - moveq.l #0x07,crt0_temp - movec.l crt0_temp,dfc | prepare access in CPU space - move.l #(BASE_SIM+0x111),crt0_temp | mask CPU, RESERVED USER SPACES - moves.l crt0_temp,BASE_REG | base initialization (must be MOVES, PCC-130795) - - movea.l #BASE_SIM,crt0_sim_base - - /* -- disable Bus Monitor -- */ - move.b #0,SIM_SYPCR(crt0_sim_base) | system protection control register - - /* -- enable A31-A24 -- */ - clr.b SIM_PPRA1(crt0_sim_base) - - /* -- show cycles, user acces to SIM, 4 /CS & 4 /IT -- */ - move.w #0x427F,SIM_MCR(crt0_sim_base) - - /* -- enable /IRQ3, 5, 6, 7 -- */ - move.b #0xE8,SIM_PPRB(crt0_sim_base) - - /* -- enable autovector on /IRQ7 -- */ - move.b #0x80,SIM_AVR(crt0_sim_base) - - /* -- test CPU type -- */ - cmp.b #_CPU349,SIM_IDR(crt0_sim_base) - bne cpu_is_68340 - -/*-------------------------------------------------------------------------------------------*/ -cpu_is_68349: - - /* -- set cpu clock -- */ - move.w #_SPEED349,SIM_SYNCR(crt0_sim_base) | clock - -sync_wait349: - btst.b #3,(SIM_SYNCR+1)(crt0_sim_base) - beq sync_wait349 - - /* to allow access to the EPLD internal registers, it is necessary - to disable the global chip-select /CS0 (which decodes every external - cycles). To do that, we initialize the 68349 internal RAM, - copy a part of the initialization code in it, and jump there. - from that moment, /CS0 is not used, therefore it can be initialized - with its default value. Its width may be incorrect, but it will be - adjusted later. The goal is to avoid any conflict with - the accesses to the EPLD registers. - When this is done, we read the RESET parameters (boot prom width - and chip-select switch) and proceed with the initialization - when all is done, we jump back to the boot prom now - decoded with a properly configured /CS0 */ - - /*-------------------------------------*/ - /* -- configure internal SRAM banks -- */ - - move.l #0x00000000,QDMM_MCR(crt0_sim_base) - move.l #_FastRam_Start+0x0005,QDMM_QBAR0(crt0_sim_base) - move.l #_FastRam_Start+0x0405,QDMM_QBAR1(crt0_sim_base) - move.l #_FastRam_Start+0x0805,QDMM_QBAR2(crt0_sim_base) - move.l #_FastRam_Start+0x0c05,QDMM_QBAR3(crt0_sim_base) - - /*--------------------------------------------------------*/ - /* -- copy to address of the 68349 initialization code -- */ - - lea.l _copy_start(%pc),crt0_ptr3 - lea.l _copy_end(%pc),crt0_ptr4 - move.l crt0_ptr4,crt0_temp - sub.l crt0_ptr3,crt0_temp - add.l #3,crt0_temp | adjust to next long word - lsr.l #2,crt0_temp - - move.l #_FastRam_Start,crt0_ptr4 -_copy_loop: - move.l (crt0_ptr3)+,(crt0_ptr4)+ - subq.l #1,crt0_temp - bne.s _copy_loop - bra.l _FastRam_Start | jump to code in internal RAM - - /*------------------------------------*/ - /* -- start of initialization code -- */ - -_copy_start: - bra.l _begin_68349_init - - /*----------------------------------------------------------*/ - /* Astecc 68349 board : chip-select initialization values */ - -_table_csepld: - dc.b (_EPLD_CS_BASE&0x0F)+0x80 | 16 bits, 0ws - dc.b 0x80 | 16 bits, 0 ws - dc.b 0x90 | 16 bits, ext /dsack - dc.b 0x90 | 16 bits, ext /dsack - -_table_cs349: - dc.l 0x003FFFF4 | Mask CS0 (4Mbytes PROM, 32bits, 1WS) - dc.l (_PROM_Start&0xFFFFFF00)+0x00000003 | Base CS0 - dc.l 0x003FFFF1 | MASK CS1 (4Mbytes RAM, 16bits, 0WS) - dc.l (_BCCram_Start&0xFFFFFF00)+0x00000003 | Base CS1 - dc.l 0x000000FF | MASK CS2 (FLEX, ext DTACK, 256 bytes) - dc.l (_FLEX_Start&0xFFFFFF00)+0x00000003 | Base CS2 - dc.l 0x000000FF | Mask CS3 (I2C, ext DTACK, 256 bytes) - dc.l (_I2C_Start&0xFFFFFF00)+0x00000003 | Base CS3 - - /*-------------------------------------------------*/ -_begin_68349_init: - - /*-------------------------------------------------*/ - /* 68349 chip select initialization - - at this stage, the width of /CS0 may be incorrect - it will be corrected later - */ - -_cs68349_init: - lea.l SIM_MASKH0(crt0_sim_base),crt0_ptr4 - lea.l _table_cs349(%pc),crt0_ptr3 - - moveq.l #0x07,crt0_temp -_cs349_init2: - move.l (crt0_ptr3)+,(crt0_ptr4)+ - dbra crt0_temp,_cs349_init2 - - /*-----------------------------------------------*/ - /* -- prepare access to the internal registers --*/ - moveq.l #EPLD_SPACE,crt0_temp - movec.l crt0_temp,dfc - movec.l crt0_temp,sfc - move.l #GLUE_EPLD,crt0_glue - move.l #DRAM_EPLD,crt0_dram - - /*-------------------------------------------*/ - /* EPLD generated /CS[3..0] must be disabled */ - -_csepld_clear: - move.l crt0_glue,crt0_ptr4 - move.w #3,crt0_spare6 - clr.b crt0_temp - -_csepld_clear1: - moves.b crt0_temp,(crt0_ptr4)+ - dbra crt0_spare6,_csepld_clear1 - - /*---------------------------------------------------------*/ - /* -- get width of boot PROM, and active chip-select set --*/ - moves.b REG_BUSWIDTH(crt0_dram),crt0_csswitch - move.b crt0_csswitch,crt0_buswidth - - /* state of CS_SWITCH : sel == 0 => CPU chip_selects (/CS[3..0]) - : sel == 1 => EPLD chip_selects (/CS[3..0]) */ - and.b #1,crt0_csswitch - - /* bus width of /CS0 during reset bw[1..0] : 0 1 2 3 - bus width : 32 16 8 ext./dsackx */ - rol.b #2,crt0_buswidth - and.b #3,crt0_buswidth - - /*----------------------------------------------------*/ - /* -- configure chip select 0 with boot prom width -- */ - lea.l SIM_MASKH0(crt0_sim_base),crt0_ptr4 - lea.l _table_cs349(%pc),crt0_ptr3 - move.l (crt0_ptr3)+,crt0_temp - and.b #0xFC,crt0_temp | clear PS0 & PS1 - or.b crt0_buswidth,crt0_temp | set boot PROM bus width - move.l crt0_temp,(crt0_ptr4)+ - - /*------------------------*/ - /* -- read PDCS buffer -- */ - moves.b REG_PDCS(crt0_glue),crt0_pdcs -/* move.b #0x3F,crt0_pdcs pour test */ - - - /*---------------------------------------*/ - /* -- EPLD chip-select initialization -- */ - /*---------------------------------------*/ - btst.b #0,crt0_csswitch - beq _cs_init_end - - /*--------------------------------------------*/ - /* 68349 generated /CS[3..0] must be disabled */ - lea.l SIM_MASKH0(crt0_sim_base),crt0_ptr4 - lea.l _table_cs349(%pc),crt0_ptr3 - moveq.l #0x03,crt0_temp -_cs349_clear: - move.l (crt0_ptr3)+,(crt0_ptr4)+ - move.l (crt0_ptr3)+,crt0_spare6 - and.b #0xFE,crt0_spare6 | disable chip-select - move.l crt0_spare6,(crt0_ptr4)+ - dbra crt0_temp,_cs349_clear - - /*---------------------------------------------*/ - /* EPLD generated /CS[3..0] must be configured */ -_csepld_init: - move.l crt0_glue,crt0_ptr4 - lea.l _table_csepld(%pc),crt0_ptr3 - - move.b (crt0_ptr3)+,crt0_temp - or.b #0x20,crt0_temp | default width is 32 bits - tst.b crt0_buswidth | is boot PROM bus width 32 bits ? - beq _csepld1 | if not - and.b #0xDF,crt0_temp | set width to 16 bits -_csepld1: - moves.b crt0_temp,(crt0_ptr4)+ - - moveq.l #0x02,crt0_spare6 -_csepld2: - move.b (crt0_ptr3)+,crt0_temp - moves.b crt0_temp,(crt0_ptr4)+ - dbra crt0_spare6,_csepld2 - -_cs_init_end: - - /*--------------------------------------*/ - /* -- DRAM controller initialization -- */ -_dram_init: - move.w #15,crt0_temp - move.l #_ExtRam_Start,crt0_ptr3 - -_dram_init1: - clr.l (crt0_ptr3)+ | must access DRAM - dbra crt0_temp,_dram_init1 | prior to init refresh - -_dram_init2: - move.b #3,crt0_temp - moves.b crt0_temp,REG_WS(crt0_dram) | set 3 wait-states - - move.b #0x81,crt0_temp - moves.b crt0_temp,REG_REFRESH(crt0_dram) | refresh every 10µs - - move.b #0,crt0_temp - moves.b crt0_temp,REG_CONFIG(crt0_dram) | default size = 4Mbytes - - /*-----------------------*/ - /* -- configure cache -- */ -_init_cache: - move.l #0x000001E0,CACHE_MCR(crt0_sim_base) - btst.b #bit_cache,crt0_pdcs - bne _init_cache_end - or.l #0x00000001,CACHE_MCR(crt0_sim_base) - -_init_cache_end: - - /*-----------------------------*/ - /* -- timers initialization -- */ - - clr.b crt0_temp - moves.b crt0_temp,REG_TIMER1(crt0_glue) | disable timer 1 - moves.b crt0_temp,REG_TIMER2(crt0_glue) | disable timer 2 - - /*--------------------------*/ - /* -- I2C initialization -- */ - move.b #3,crt0_temp - moves.b crt0_temp,REG_I2C(crt0_glue) | tri-states I2C ports - - /*-----------------------------------------*/ - /* -- baudrate generator initialization -- */ - move.b #2,crt0_temp - moves.b crt0_temp,REG_BAUDRATE(crt0_glue) | baudrate = 38400 - - /*-------------------------------*/ - /* -- IO port initialization -- */ - clr.b crt0_temp - moves.b crt0_temp,REG_IO(crt0_glue) | set port as input - - /* -- */ - - move.l #68349,crt0_cpu_type - - - /* -- jump back to PROM -- */ - - jmp.l (_fill_test) | must be absolute long - -_copy_end: - -/*------------------------------------------------- - initialization code for the 68340 board - -------------------------------------------------*/ - - /* Astecc 68340 board : chip-select initialization values */ -_table_cs340: - dc.l 0x003FFFF0 /* Mask CS0 (4Mbytes PROM, 32bits, 0WS) */ - dc.l ((_PROM_Start&0xFFFFFF00)+0x00000003) /* Base CS0 */ - dc.l 0x0000FFFD /* MASK CS1 (RAMBCC340, 0WS, FTE) */ - dc.l ((_BCCram_Start&0xFFFFFF00)+0x00000003) /* Base CS1 */ - dc.l 0x000000FF /* MASK CS2 (FLEX, ext DTACK, 256 bytes) */ - dc.l ((_FLEX_Start&0xFFFFFF00)+0x00000003) /* Base CS2 */ - dc.l 0x000000FF /* Mask CS3 (I2C, ext DTACK, 256 bytes) */ - dc.l ((_I2C_Start&0xFFFFFF00)+0x00000003) /* Base CS3 */ - -cpu_is_68340: - - /* -- set cpu clock -- */ - move.w #_SPEED340,SIM_SYNCR(crt0_sim_base) | clock -sync_wait340: - btst.b #3,(SIM_SYNCR+1)(crt0_sim_base) - beq sync_wait340 - - /* -- chip select initialization -- */ - lea.l SIM_MASKH0(crt0_sim_base),crt0_ptr4 - lea.l _table_cs340(%pc),crt0_ptr3 - moveq.l #0x07,crt0_temp -_b_cs340: - move.l (crt0_ptr3)+,crt0_ptr5 - move.l crt0_ptr5,(crt0_ptr4)+ | pour test - dbra crt0_temp,_b_cs340 - - move.l #68340,crt0_cpu_type - move.b #0,crt0_csswitch | CPU - move.b #1,crt0_buswidth | 16 bits - - - /*------------------------------------------------- - fill RAM if COLDSTART - -------------------------------------------------*/ -_fill_test: - - tst.l crt0_boot_type - bne _dont_fill - - cmp.b #_CPU349,SIM_IDR(crt0_sim_base) - bne _fill - btst.b #bit_meminit,crt0_pdcs - bne _dont_fill - - /* fill main memory */ -_fill: - move.l #_crt0_init_stack,crt0_ptr3 | skip Astecc vars - move.l #_ExtRam_Start,crt0_temp - sub.l #_crt0_init_stack,crt0_temp - add.l #_ExtRam_Size,crt0_temp | get size - lsr.l #2,crt0_temp | ajust for long word -_fill_loop: - clr.l (crt0_ptr3)+ - subq.l #1,crt0_temp - bne _fill_loop - - cmp.b #_CPU349,SIM_IDR(crt0_sim_base) - bne _fill_bccram - - /* fill QDMM memory */ - movea.l #_FastRam_Start,crt0_ptr3 | get start - move.l #_FastRam_Size,crt0_temp | get size - lsr.l #2,crt0_temp | ajust for long word - -_QDMMfill_loop: - clr.l (crt0_ptr3)+ - subq.l #1,crt0_temp - bne _QDMMfill_loop - bra _dont_fill - - /* fill BCC memory */ -_fill_bccram: - movea.l #_BCCram_Start,crt0_ptr3 | get start - move.l #_BCCram_Size,crt0_temp | get size - lsr.l #2,crt0_temp | ajust for long word -_BCCfill_loop: - clr.l (crt0_ptr3)+ - subq.l #1,crt0_temp - bne _BCCfill_loop - - *-------------------------------------------------*/ -_dont_fill: - move.b crt0_csswitch,_AsteccCsSwitch - move.b crt0_buswidth,_AsteccBusWidth - move.l crt0_cpu_type,_AsteccCpuName - - jmp SYM(_Init68340) | Start C code (which never returns) - -/* - * Copy DATA segment, clear BSS segment, set up real stack, - * initialize heap, start C program. - * Assume that DATA and BSS sizes are multiples of 4. - */ - PUBLIC (_CopyDataClearBSSAndStart) -SYM(_CopyDataClearBSSAndStart): - lea copy_start,a0 | Get start of DATA in RAM - lea SYM(etext),a2 | Get start of DATA in ROM - cmpl a0,a2 | Are they the same? - beq.s NOCOPY | Yes, no copy necessary - lea copy_end,a1 | Get end of DATA in RAM - bra.s COPYLOOPTEST | Branch into copy loop -COPYLOOP: - movel a2@+,a0@+ | Copy word from ROM to RAM -COPYLOOPTEST: - cmpl a1,a0 | Done? - bcs.s COPYLOOP | No, skip -NOCOPY: - - lea clear_start,a0 | Get start of BSS - lea clear_end,a1 | Get end of BSS - clrl d0 | Value to set - bra.s ZEROLOOPTEST | Branch into clear loop -ZEROLOOP: - movel d0,a0@+ | Clear a word -ZEROLOOPTEST: - cmpl a1,a0 | Done? - bcs.s ZEROLOOP | No, skip - - movel #stack_init,a7 | set master stack pointer - movel d0,a7@- | environp - movel d0,a7@- | argv - movel d0,a7@- | argc - jsr SYM(boot_card) | Call C main - - PUBLIC (_mainDone) -SYM(_mainDone): - nop | Leave spot for breakpoint - movew #1,a7 | Force a double bus error - movel d0,a7@- | This should cause a RESET -/* stop #0x2700 | Stop with interrupts disabled */ - move.w #0x2700,sr - bra.s SYM(_mainDone) | Stuck forever - - .align 2 - PUBLIC (_HeapSize) -SYM (_HeapSize): - .long HeapSize - PUBLIC (_StackSize) -SYM (_StackSize): - .long StackSize -END_CODE - -BEGIN_DATA_DCL - .align 2 - PUBLIC (environ) -SYM (environ): - .long 0 - PUBLIC (_M68kSpuriousInterruptCount) -SYM (_M68kSpuriousInterruptCount): - .long 0 -END_DATA_DCL - -END - diff --git a/c/src/lib/libbsp/m68k/gen68340/start/startfor340only.s b/c/src/lib/libbsp/m68k/gen68340/start/startfor340only.s deleted file mode 100644 index 930694f02e..0000000000 --- a/c/src/lib/libbsp/m68k/gen68340/start/startfor340only.s +++ /dev/null @@ -1,499 +0,0 @@ -/* - * This file contains the entry point for the application. - * The name of this entry point is compiler dependent. - * It jumps to the BSP which is responsible for performing - * all initialization. - * - * COPYRIGHT (c) 1989-1998. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * Based on the `gen68360' board support package, and covered by the - * original distribution terms. - * - * Geoffroy Montel - * France Telecom - CNET/DSM/TAM/CAT - * 4, rue du Clos Courtel - * 35512 CESSON-SEVIGNE - * FRANCE - * - * e-mail: g_montel@yahoo.com - * - * $Id$ - */ - -#include "asm.h" -#include <m68340.inc> - -BEGIN_CODE - /* - * Step 1: Decide on Reset Stack Pointer and Initial Program Counter - */ -Entry: - .long SYM(m340)+1024 | 0: Initial SSP - .long start | 1: Initial PC - .long SYM(_uhoh) | 2: Bus error - .long SYM(_uhoh) | 3: Address error - .long SYM(_uhoh) | 4: Illegal instruction - .long SYM(_uhoh) | 5: Zero division - .long SYM(_uhoh) | 6: CHK, CHK2 instruction - .long SYM(_uhoh) | 7: TRAPcc, TRAPV instructions - .long SYM(_uhoh) | 8: Privilege violation - .long SYM(_uhoh) | 9: Trace - .long SYM(_uhoh) | 10: Line 1010 emulator - .long SYM(_uhoh) | 11: Line 1111 emulator - .long SYM(_uhoh) | 12: Hardware breakpoint - .long SYM(_uhoh) | 13: Reserved for coprocessor violation - .long SYM(_uhoh) | 14: Format error - .long SYM(_uhoh) | 15: Uninitialized interrupt - .long SYM(_uhoh) | 16: Unassigned, reserved - .long SYM(_uhoh) | 17: - .long SYM(_uhoh) | 18: - .long SYM(_uhoh) | 19: - .long SYM(_uhoh) | 20: - .long SYM(_uhoh) | 21: - .long SYM(_uhoh) | 22: - .long SYM(_uhoh) | 23: - .long SYM(_spuriousInterrupt) | 24: Spurious interrupt - .long SYM(_uhoh) | 25: Level 1 interrupt autovector - .long SYM(_uhoh) | 26: Level 2 interrupt autovector - .long SYM(_uhoh) | 27: Level 3 interrupt autovector - .long SYM(_uhoh) | 28: Level 4 interrupt autovector - .long SYM(_uhoh) | 29: Level 5 interrupt autovector - .long SYM(_uhoh) | 30: Level 6 interrupt autovector - .long SYM(_uhoh) | 31: Level 7 interrupt autovector - .long SYM(_uhoh) | 32: Trap instruction (0-15) - .long SYM(_uhoh) | 33: - .long SYM(_uhoh) | 34: - .long SYM(_uhoh) | 35: - .long SYM(_uhoh) | 36: - .long SYM(_uhoh) | 37: - .long SYM(_uhoh) | 38: - .long SYM(_uhoh) | 39: - .long SYM(_uhoh) | 40: - .long SYM(_uhoh) | 41: - .long SYM(_uhoh) | 42: - .long SYM(_uhoh) | 43: - .long SYM(_uhoh) | 44: - .long SYM(_uhoh) | 45: - .long SYM(_uhoh) | 46: - .long SYM(_uhoh) | 47: - .long SYM(_uhoh) | 48: Reserved for coprocessor - .long SYM(_uhoh) | 49: - .long SYM(_uhoh) | 50: - .long SYM(_uhoh) | 51: - .long SYM(_uhoh) | 52: - .long SYM(_uhoh) | 53: - .long SYM(_uhoh) | 54: - .long SYM(_uhoh) | 55: - .long SYM(_uhoh) | 56: - .long SYM(_uhoh) | 57: - .long SYM(_uhoh) | 58: - .long SYM(_uhoh) | 59: Unassigned, reserved - .long SYM(_uhoh) | 60: - .long SYM(_uhoh) | 61: - .long SYM(_uhoh) | 62: - .long SYM(_uhoh) | 63: - .long SYM(_uhoh) | 64: User defined vectors (192) - .long SYM(_uhoh) | 65: - .long SYM(_uhoh) | 66: - .long SYM(_uhoh) | 67: - .long SYM(_uhoh) | 68: - .long SYM(_uhoh) | 69: - .long SYM(_uhoh) | 70: - .long SYM(_uhoh) | 71: - .long SYM(_uhoh) | 72: - .long SYM(_uhoh) | 73: - .long SYM(_uhoh) | 74: - .long SYM(_uhoh) | 75: - .long SYM(_uhoh) | 76: - .long SYM(_uhoh) | 77: - .long SYM(_uhoh) | 78: - .long SYM(_uhoh) | 79: - .long SYM(_uhoh) | 80: - .long SYM(_uhoh) | 81: - .long SYM(_uhoh) | 82: - .long SYM(_uhoh) | 83: - .long SYM(_uhoh) | 84: - .long SYM(_uhoh) | 85: - .long SYM(_uhoh) | 86: - .long SYM(_uhoh) | 87: - .long SYM(_uhoh) | 88: - .long SYM(_uhoh) | 89: - .long SYM(_uhoh) | 90: - .long SYM(_uhoh) | 91: - .long SYM(_uhoh) | 92: - .long SYM(_uhoh) | 93: - .long SYM(_uhoh) | 94: - .long SYM(_uhoh) | 95: - .long SYM(_uhoh) | 96: - .long SYM(_uhoh) | 97: - .long SYM(_uhoh) | 98: - .long SYM(_uhoh) | 99: - .long SYM(_uhoh) | 100: - .long SYM(_uhoh) | 101: - .long SYM(_uhoh) | 102: - .long SYM(_uhoh) | 103: - .long SYM(_uhoh) | 104: - .long SYM(_uhoh) | 105: - .long SYM(_uhoh) | 106: - .long SYM(_uhoh) | 107: - .long SYM(_uhoh) | 108: - .long SYM(_uhoh) | 109: - .long SYM(_uhoh) | 110: - .long SYM(_uhoh) | 111: - .long SYM(_uhoh) | 112: - .long SYM(_uhoh) | 113: - .long SYM(_uhoh) | 114: - .long SYM(_uhoh) | 115: - .long SYM(_uhoh) | 116: - .long SYM(_uhoh) | 117: - .long SYM(_uhoh) | 118: - .long SYM(_uhoh) | 119: - .long SYM(_uhoh) | 120: - .long SYM(_uhoh) | 121: - .long SYM(_uhoh) | 122: - .long SYM(_uhoh) | 123: - .long SYM(_uhoh) | 124: - .long SYM(_uhoh) | 125: - .long SYM(_uhoh) | 126: - .long SYM(_uhoh) | 127: - .long SYM(_uhoh) | 128: - .long SYM(_uhoh) | 129: - .long SYM(_uhoh) | 130: - .long SYM(_uhoh) | 131: - .long SYM(_uhoh) | 132: - .long SYM(_uhoh) | 133: - .long SYM(_uhoh) | 134: - .long SYM(_uhoh) | 135: - .long SYM(_uhoh) | 136: - .long SYM(_uhoh) | 137: - .long SYM(_uhoh) | 138: - .long SYM(_uhoh) | 139: - .long SYM(_uhoh) | 140: - .long SYM(_uhoh) | 141: - .long SYM(_uhoh) | 142: - .long SYM(_uhoh) | 143: - .long SYM(_uhoh) | 144: - .long SYM(_uhoh) | 145: - .long SYM(_uhoh) | 146: - .long SYM(_uhoh) | 147: - .long SYM(_uhoh) | 148: - .long SYM(_uhoh) | 149: - .long SYM(_uhoh) | 150: - .long SYM(_uhoh) | 151: - .long SYM(_uhoh) | 152: - .long SYM(_uhoh) | 153: - .long SYM(_uhoh) | 154: - .long SYM(_uhoh) | 155: - .long SYM(_uhoh) | 156: - .long SYM(_uhoh) | 157: - .long SYM(_uhoh) | 158: - .long SYM(_uhoh) | 159: - .long SYM(_uhoh) | 160: - .long SYM(_uhoh) | 161: - .long SYM(_uhoh) | 162: - .long SYM(_uhoh) | 163: - .long SYM(_uhoh) | 164: - .long SYM(_uhoh) | 165: - .long SYM(_uhoh) | 166: - .long SYM(_uhoh) | 167: - .long SYM(_uhoh) | 168: - .long SYM(_uhoh) | 169: - .long SYM(_uhoh) | 170: - .long SYM(_uhoh) | 171: - .long SYM(_uhoh) | 172: - .long SYM(_uhoh) | 173: - .long SYM(_uhoh) | 174: - .long SYM(_uhoh) | 175: - .long SYM(_uhoh) | 176: - .long SYM(_uhoh) | 177: - .long SYM(_uhoh) | 178: - .long SYM(_uhoh) | 179: - .long SYM(_uhoh) | 180: - .long SYM(_uhoh) | 181: - .long SYM(_uhoh) | 182: - .long SYM(_uhoh) | 183: - .long SYM(_uhoh) | 184: - .long SYM(_uhoh) | 185: - .long SYM(_uhoh) | 186: - .long SYM(_uhoh) | 187: - .long SYM(_uhoh) | 188: - .long SYM(_uhoh) | 189: - .long SYM(_uhoh) | 190: - .long SYM(_uhoh) | 191: - .long SYM(_uhoh) | 192: - .long SYM(_uhoh) | 193: - .long SYM(_uhoh) | 194: - .long SYM(_uhoh) | 195: - .long SYM(_uhoh) | 196: - .long SYM(_uhoh) | 197: - .long SYM(_uhoh) | 198: - .long SYM(_uhoh) | 199: - .long SYM(_uhoh) | 200: - .long SYM(_uhoh) | 201: - .long SYM(_uhoh) | 202: - .long SYM(_uhoh) | 203: - .long SYM(_uhoh) | 204: - .long SYM(_uhoh) | 205: - .long SYM(_uhoh) | 206: - .long SYM(_uhoh) | 207: - .long SYM(_uhoh) | 208: - .long SYM(_uhoh) | 209: - .long SYM(_uhoh) | 210: - .long SYM(_uhoh) | 211: - .long SYM(_uhoh) | 212: - .long SYM(_uhoh) | 213: - .long SYM(_uhoh) | 214: - .long SYM(_uhoh) | 215: - .long SYM(_uhoh) | 216: - .long SYM(_uhoh) | 217: - .long SYM(_uhoh) | 218: - .long SYM(_uhoh) | 219: - .long SYM(_uhoh) | 220: - .long SYM(_uhoh) | 221: - .long SYM(_uhoh) | 222: - .long SYM(_uhoh) | 223: - .long SYM(_uhoh) | 224: - .long SYM(_uhoh) | 225: - .long SYM(_uhoh) | 226: - .long SYM(_uhoh) | 227: - .long SYM(_uhoh) | 228: - .long SYM(_uhoh) | 229: - .long SYM(_uhoh) | 230: - .long SYM(_uhoh) | 231: - .long SYM(_uhoh) | 232: - .long SYM(_uhoh) | 233: - .long SYM(_uhoh) | 234: - .long SYM(_uhoh) | 235: - .long SYM(_uhoh) | 236: - .long SYM(_uhoh) | 237: - .long SYM(_uhoh) | 238: - .long SYM(_uhoh) | 239: - .long SYM(_uhoh) | 240: - .long SYM(_uhoh) | 241: - .long SYM(_uhoh) | 242: - .long SYM(_uhoh) | 243: - .long SYM(_uhoh) | 244: - .long SYM(_uhoh) | 245: - .long SYM(_uhoh) | 246: - .long SYM(_uhoh) | 247: - .long SYM(_uhoh) | 248: - .long SYM(_uhoh) | 249: - .long SYM(_uhoh) | 250: - .long SYM(_uhoh) | 251: - .long SYM(_uhoh) | 252: - .long SYM(_uhoh) | 253: - .long SYM(_uhoh) | 254: - .long SYM(_uhoh) | 255: - -/* - * Default trap handler - * With an oscilloscope you can see AS* stop - */ - PUBLIC (_uhoh) -SYM(_uhoh): nop | Leave spot for breakpoint - stop #0x2700 | Stop with interrupts disabled - bra.s SYM(_uhoh) | Stuck forever - -/* - * Log, but otherwise ignore, spurious interrupts - */ - PUBLIC (_spuriousInterrupt) -SYM(_spuriousInterrupt): - addql #1,SYM(_M68kSpuriousInterruptCount) - rte - -/* - * Place the low-order 3 octets of the board's ethernet address at - * a `well-known' fixed location relative to the startup location. - */ - .align 2 - .word 0 | Padding -ethernet_address_buffer: - .word 0x08F3 | Default address - .word 0xDEAD - .word 0xCAFE - -/* -- equates -- */ -.equ _PROM_Start, 0x01000000 /* CS0 */ -.equ _BCCram_Start, 0x00000000 /* CS1 */ -.equ _FLEX_Start, 0x08000000 /* CS2 */ -.equ _I2C_Start, 0x02000000 /* CS3 */ -.equ _EXTram_Start, 0x10000000 /* CS4 */ -.equ _EXTram_Size, 0x000400000 /* 4 Mbytes */ -.equ _SPEED, 0xD780 /* 25 Mhz CPU349 */ -/* .equ _SPEED, 0xD700 25 Mhz */ -/* .equ _SPEED, 0xCE00 16 Mhz */ - -BEGIN_DATA - -_crt0_init_stack: - ds.l 0x1000 -_crt0_init_stktop: - - -BEGIN_CODE - dc.l _crt0_init_stktop /* reset SP */ - dc.l _crt0_cold_start /* reset PC */ - dc.l _crt0_warm_start - - .ascii "RTEMS" - dc.w 0 - -.align 2 - -_table_cs: - /* carte Astecc - 68340 */ - dc.l 0x003FFFF0 /* Mask CS0 (4Mbytes PROM, 32bits, 0WS) */ -/* dc.l 0x003FFFFD Mask CS0 (4Mbytes PROM, 16bits, 3WS) */ - dc.l ((_PROM_Start&0xFFFFFF00)+0x00000003) /* Base CS0 */ -/* dc.l 0x0000FFF1 MASK CS1 (RAMBCC340, 0WS, FTE) */ - dc.l 0x0000FFFD /* MASK CS1 (RAMBCC340, 0WS, FTE) */ -/* dc.l ((_BCCram_Start&0xFFFFFF00)+0x00000007) Base CS1 */ - dc.l ((_BCCram_Start&0xFFFFFF00)+0x00000003) /* Base CS1 */ - dc.l 0x000000FF /* MASK CS2 (FLEX, ext DTACK, 256 bytes) */ - dc.l ((_FLEX_Start&0xFFFFFF00)+0x00000003) /* Base CS2 */ - dc.l 0x000000FF /* Mask CS3 (I2C, ext DTACK, 256 bytes) */ - dc.l ((_I2C_Start&0xFFFFFF00)+0x00000003) /* Base CS3 */ - -/* - * Initial PC - */ -.globl start -start: - -_crt0_cold_start: - moveq.l #0,d0 /* signal cold reset */ - bra.s _crt0_common_start - -_crt0_warm_start: - moveq.l #1,d0 /* signal warm reset */ - -_crt0_common_start: - move.w #0x2700,sr /* disable interrupts and switch to interrupt mode */ - movea.l #_crt0_init_stktop,sp /* set up initialization stack */ - - lea Entry,a0 /* Get base of vector table */ - movec a0,vbr /* Set up the VBR */ - - moveq.l #0x07,d1 - movec.l d1,dfc /* prepare access in CPU space */ - move.l #(BASE_SIM+1),d1 - moves.l d1,BASE_REG /* base initialization (must be MOVES, PCC-130795) */ - moveq.l #0x05,d1 - movec.l d1,dfc - - movea.l #BASE_SIM,a0 - - /* -- disable Bus Monitor -- */ - move.b #0,SIM_SYPCR(a0) /* system protection control register */ - - /* -- set frequency to 25.16 Mhz -- */ - move.w #_SPEED,SIM_SYNCR(a0) /* clock */ - -sync_wait: - btst.b #3,(SIM_SYNCR+1)(a0) - beq sync_wait - - /* -- enable A31-A24 -- */ - clr.b SIM_PPRA1(a0) - - /* -- show cycles, user acces to SIM, 4 /CS & 4 /IT -- */ - move.w #0x427F,SIM_MCR(a0) - - /* -- chip select initialization -- */ - lea.l SIM_MASKH0(a0),a2 - lea.l _table_cs(%pc),a1 - - moveq.l #0x07,d1 - -_b_cs: - move.l (a1)+, (a2)+ - dbra d1,_b_cs - - /* fill RAM if COLDSTART */ - tst.l d0 - bne _dont_fill - - movea.l #_EXTram_Start,a0 /* get start */ - move.l #_EXTram_Size,d1 /* get size */ - lsr.l #2,d1 /* ajust for long word */ - -_fill_loop: - clr.l (a0)+ - subq.l #1,d1 - bne _fill_loop - -_dont_fill: - jmp SYM(_Init68340) | Start C code (which never returns) - -/* - * Copy DATA segment, clear BSS segment, set up real stack, - * initialize heap, start C program. - * Assume that DATA and BSS sizes are multiples of 4. - */ - PUBLIC (_CopyDataClearBSSAndStart) -SYM(_CopyDataClearBSSAndStart): - lea copy_start,a0 | Get start of DATA in RAM - lea SYM(etext),a2 | Get start of DATA in ROM - cmpl a0,a2 | Are they the same? - beq.s NOCOPY | Yes, no copy necessary - lea copy_end,a1 | Get end of DATA in RAM - bra.s COPYLOOPTEST | Branch into copy loop -COPYLOOP: - movel a2@+,a0@+ | Copy word from ROM to RAM -COPYLOOPTEST: - cmpl a1,a0 | Done? - bcs.s COPYLOOP | No, skip -NOCOPY: - - lea clear_start,a0 | Get start of BSS - lea clear_end,a1 | Get end of BSS - clrl d0 | Value to set - bra.s ZEROLOOPTEST | Branch into clear loop -ZEROLOOP: - movel d0,a0@+ | Clear a word -ZEROLOOPTEST: - cmpl a1,a0 | Done? - bcs.s ZEROLOOP | No, skip - - movel #stack_init,a7 | set master stack pointer - movel d0,a7@- | environp - movel d0,a7@- | argv - movel d0,a7@- | argc - jsr SYM(boot_card) | Call C main - - PUBLIC (_mainDone) -SYM(_mainDone): - nop | Leave spot for breakpoint - movew #1,a7 | Force a double bus error - movel d0,a7@- | This should cause a RESET - stop #0x2700 | Stop with interrupts disabled - bra.s SYM(_mainDone) | Stuck forever - - .align 2 - PUBLIC (_HeapSize) -SYM (_HeapSize): - .long HeapSize - PUBLIC (_StackSize) -SYM (_StackSize): - .long StackSize -END_CODE - -BEGIN_DATA_DCL - .align 2 - PUBLIC (environ) -SYM (environ): - .long 0 - PUBLIC (_M68kSpuriousInterruptCount) -SYM (_M68kSpuriousInterruptCount): - .long 0 -END_DATA_DCL - -END - diff --git a/c/src/lib/libbsp/m68k/gen68360/start/Makefile.in b/c/src/lib/libbsp/m68k/gen68360/start/Makefile.in deleted file mode 100644 index 4d339f46fc..0000000000 --- a/c/src/lib/libbsp/m68k/gen68360/start/Makefile.in +++ /dev/null @@ -1,57 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGMS=${ARCH}/start360.o - -# C source names, if any, go here -- minus the .c -C_PIECES= -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES=start360 -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: ${ARCH} $(SRCS) $(OBJS) $(PGM) - $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib - -# Install the program(s), appending _g or _p as appropriate. -# for include files, just use $(INSTALL) diff --git a/c/src/lib/libbsp/m68k/gen68360/start/start360.s b/c/src/lib/libbsp/m68k/gen68360/start/start360.s deleted file mode 100644 index 2c979e294f..0000000000 --- a/c/src/lib/libbsp/m68k/gen68360/start/start360.s +++ /dev/null @@ -1,432 +0,0 @@ -/* - * - * This file contains the entry point for the application. - * The name of this entry point is compiler dependent. - * It jumps to the BSP which is responsible for performing - * all initialization. - * - * COPYRIGHT (c) 1989-1998. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * Based on the `gen68302' board support package, and covered by the - * original distribution terms. - * - * W. Eric Norum - * Saskatchewan Accelerator Laboratory - * University of Saskatchewan - * Saskatoon, Saskatchewan, CANADA - * eric@skatter.usask.ca - * - * $Id$ - */ - -#include "asm.h" - -BEGIN_CODE - /* - * Step 1: Decide on Reset Stack Pointer and Initial Program Counter - */ -Entry: - .long SYM(m360)+1024 | 0: Initial SSP - .long start | 1: Initial PC - .long SYM(_uhoh) | 2: Bus error - .long SYM(_uhoh) | 3: Address error - .long SYM(_uhoh) | 4: Illegal instruction - .long SYM(_uhoh) | 5: Zero division - .long SYM(_uhoh) | 6: CHK, CHK2 instruction - .long SYM(_uhoh) | 7: TRAPcc, TRAPV instructions - .long SYM(_uhoh) | 8: Privilege violation - .long SYM(_uhoh) | 9: Trace - .long SYM(_uhoh) | 10: Line 1010 emulator - .long SYM(_uhoh) | 11: Line 1111 emulator - .long SYM(_uhoh) | 12: Hardware breakpoint - .long SYM(_uhoh) | 13: Reserved for coprocessor violation - .long SYM(_uhoh) | 14: Format error - .long SYM(_uhoh) | 15: Uninitialized interrupt - .long SYM(_uhoh) | 16: Unassigned, reserved - .long SYM(_uhoh) | 17: - .long SYM(_uhoh) | 18: - .long SYM(_uhoh) | 19: - .long SYM(_uhoh) | 20: - .long SYM(_uhoh) | 21: - .long SYM(_uhoh) | 22: - .long SYM(_uhoh) | 23: - .long SYM(_spuriousInterrupt) | 24: Spurious interrupt - .long SYM(_uhoh) | 25: Level 1 interrupt autovector - .long SYM(_uhoh) | 26: Level 2 interrupt autovector - .long SYM(_uhoh) | 27: Level 3 interrupt autovector - .long SYM(_uhoh) | 28: Level 4 interrupt autovector - .long SYM(_uhoh) | 29: Level 5 interrupt autovector - .long SYM(_uhoh) | 30: Level 6 interrupt autovector - .long SYM(_uhoh) | 31: Level 7 interrupt autovector - .long SYM(_uhoh) | 32: Trap instruction (0-15) - .long SYM(_uhoh) | 33: - .long SYM(_uhoh) | 34: - .long SYM(_uhoh) | 35: - .long SYM(_uhoh) | 36: - .long SYM(_uhoh) | 37: - .long SYM(_uhoh) | 38: - .long SYM(_uhoh) | 39: - .long SYM(_uhoh) | 40: - .long SYM(_uhoh) | 41: - .long SYM(_uhoh) | 42: - .long SYM(_uhoh) | 43: - .long SYM(_uhoh) | 44: - .long SYM(_uhoh) | 45: - .long SYM(_uhoh) | 46: - .long SYM(_uhoh) | 47: - .long SYM(_uhoh) | 48: Reserved for coprocessor - .long SYM(_uhoh) | 49: - .long SYM(_uhoh) | 50: - .long SYM(_uhoh) | 51: - .long SYM(_uhoh) | 52: - .long SYM(_uhoh) | 53: - .long SYM(_uhoh) | 54: - .long SYM(_uhoh) | 55: - .long SYM(_uhoh) | 56: - .long SYM(_uhoh) | 57: - .long SYM(_uhoh) | 58: - .long SYM(_uhoh) | 59: Unassigned, reserved - .long SYM(_uhoh) | 60: - .long SYM(_uhoh) | 61: - .long SYM(_uhoh) | 62: - .long SYM(_uhoh) | 63: - .long SYM(_uhoh) | 64: User defined vectors (192) - .long SYM(_uhoh) | 65: - .long SYM(_uhoh) | 66: - .long SYM(_uhoh) | 67: - .long SYM(_uhoh) | 68: - .long SYM(_uhoh) | 69: - .long SYM(_uhoh) | 70: - .long SYM(_uhoh) | 71: - .long SYM(_uhoh) | 72: - .long SYM(_uhoh) | 73: - .long SYM(_uhoh) | 74: - .long SYM(_uhoh) | 75: - .long SYM(_uhoh) | 76: - .long SYM(_uhoh) | 77: - .long SYM(_uhoh) | 78: - .long SYM(_uhoh) | 79: - .long SYM(_uhoh) | 80: - .long SYM(_uhoh) | 81: - .long SYM(_uhoh) | 82: - .long SYM(_uhoh) | 83: - .long SYM(_uhoh) | 84: - .long SYM(_uhoh) | 85: - .long SYM(_uhoh) | 86: - .long SYM(_uhoh) | 87: - .long SYM(_uhoh) | 88: - .long SYM(_uhoh) | 89: - .long SYM(_uhoh) | 90: - .long SYM(_uhoh) | 91: - .long SYM(_uhoh) | 92: - .long SYM(_uhoh) | 93: - .long SYM(_uhoh) | 94: - .long SYM(_uhoh) | 95: - .long SYM(_uhoh) | 96: - .long SYM(_uhoh) | 97: - .long SYM(_uhoh) | 98: - .long SYM(_uhoh) | 99: - .long SYM(_uhoh) | 100: - .long SYM(_uhoh) | 101: - .long SYM(_uhoh) | 102: - .long SYM(_uhoh) | 103: - .long SYM(_uhoh) | 104: - .long SYM(_uhoh) | 105: - .long SYM(_uhoh) | 106: - .long SYM(_uhoh) | 107: - .long SYM(_uhoh) | 108: - .long SYM(_uhoh) | 109: - .long SYM(_uhoh) | 110: - .long SYM(_uhoh) | 111: - .long SYM(_uhoh) | 112: - .long SYM(_uhoh) | 113: - .long SYM(_uhoh) | 114: - .long SYM(_uhoh) | 115: - .long SYM(_uhoh) | 116: - .long SYM(_uhoh) | 117: - .long SYM(_uhoh) | 118: - .long SYM(_uhoh) | 119: - .long SYM(_uhoh) | 120: - .long SYM(_uhoh) | 121: - .long SYM(_uhoh) | 122: - .long SYM(_uhoh) | 123: - .long SYM(_uhoh) | 124: - .long SYM(_uhoh) | 125: - .long SYM(_uhoh) | 126: - .long SYM(_uhoh) | 127: - .long SYM(_uhoh) | 128: - .long SYM(_uhoh) | 129: - .long SYM(_uhoh) | 130: - .long SYM(_uhoh) | 131: - .long SYM(_uhoh) | 132: - .long SYM(_uhoh) | 133: - .long SYM(_uhoh) | 134: - .long SYM(_uhoh) | 135: - .long SYM(_uhoh) | 136: - .long SYM(_uhoh) | 137: - .long SYM(_uhoh) | 138: - .long SYM(_uhoh) | 139: - .long SYM(_uhoh) | 140: - .long SYM(_uhoh) | 141: - .long SYM(_uhoh) | 142: - .long SYM(_uhoh) | 143: - .long SYM(_uhoh) | 144: - .long SYM(_uhoh) | 145: - .long SYM(_uhoh) | 146: - .long SYM(_uhoh) | 147: - .long SYM(_uhoh) | 148: - .long SYM(_uhoh) | 149: - .long SYM(_uhoh) | 150: - .long SYM(_uhoh) | 151: - .long SYM(_uhoh) | 152: - .long SYM(_uhoh) | 153: - .long SYM(_uhoh) | 154: - .long SYM(_uhoh) | 155: - .long SYM(_uhoh) | 156: - .long SYM(_uhoh) | 157: - .long SYM(_uhoh) | 158: - .long SYM(_uhoh) | 159: - .long SYM(_uhoh) | 160: - .long SYM(_uhoh) | 161: - .long SYM(_uhoh) | 162: - .long SYM(_uhoh) | 163: - .long SYM(_uhoh) | 164: - .long SYM(_uhoh) | 165: - .long SYM(_uhoh) | 166: - .long SYM(_uhoh) | 167: - .long SYM(_uhoh) | 168: - .long SYM(_uhoh) | 169: - .long SYM(_uhoh) | 170: - .long SYM(_uhoh) | 171: - .long SYM(_uhoh) | 172: - .long SYM(_uhoh) | 173: - .long SYM(_uhoh) | 174: - .long SYM(_uhoh) | 175: - .long SYM(_uhoh) | 176: - .long SYM(_uhoh) | 177: - .long SYM(_uhoh) | 178: - .long SYM(_uhoh) | 179: - .long SYM(_uhoh) | 180: - .long SYM(_uhoh) | 181: - .long SYM(_uhoh) | 182: - .long SYM(_uhoh) | 183: - .long SYM(_uhoh) | 184: - .long SYM(_uhoh) | 185: - .long SYM(_uhoh) | 186: - .long SYM(_uhoh) | 187: - .long SYM(_uhoh) | 188: - .long SYM(_uhoh) | 189: - .long SYM(_uhoh) | 190: - .long SYM(_uhoh) | 191: - .long SYM(_uhoh) | 192: - .long SYM(_uhoh) | 193: - .long SYM(_uhoh) | 194: - .long SYM(_uhoh) | 195: - .long SYM(_uhoh) | 196: - .long SYM(_uhoh) | 197: - .long SYM(_uhoh) | 198: - .long SYM(_uhoh) | 199: - .long SYM(_uhoh) | 200: - .long SYM(_uhoh) | 201: - .long SYM(_uhoh) | 202: - .long SYM(_uhoh) | 203: - .long SYM(_uhoh) | 204: - .long SYM(_uhoh) | 205: - .long SYM(_uhoh) | 206: - .long SYM(_uhoh) | 207: - .long SYM(_uhoh) | 208: - .long SYM(_uhoh) | 209: - .long SYM(_uhoh) | 210: - .long SYM(_uhoh) | 211: - .long SYM(_uhoh) | 212: - .long SYM(_uhoh) | 213: - .long SYM(_uhoh) | 214: - .long SYM(_uhoh) | 215: - .long SYM(_uhoh) | 216: - .long SYM(_uhoh) | 217: - .long SYM(_uhoh) | 218: - .long SYM(_uhoh) | 219: - .long SYM(_uhoh) | 220: - .long SYM(_uhoh) | 221: - .long SYM(_uhoh) | 222: - .long SYM(_uhoh) | 223: - .long SYM(_uhoh) | 224: - .long SYM(_uhoh) | 225: - .long SYM(_uhoh) | 226: - .long SYM(_uhoh) | 227: - .long SYM(_uhoh) | 228: - .long SYM(_uhoh) | 229: - .long SYM(_uhoh) | 230: - .long SYM(_uhoh) | 231: - .long SYM(_uhoh) | 232: - .long SYM(_uhoh) | 233: - .long SYM(_uhoh) | 234: - .long SYM(_uhoh) | 235: - .long SYM(_uhoh) | 236: - .long SYM(_uhoh) | 237: - .long SYM(_uhoh) | 238: - .long SYM(_uhoh) | 239: - .long SYM(_uhoh) | 240: - .long SYM(_uhoh) | 241: - .long SYM(_uhoh) | 242: - .long SYM(_uhoh) | 243: - .long SYM(_uhoh) | 244: - .long SYM(_uhoh) | 245: - .long SYM(_uhoh) | 246: - .long SYM(_uhoh) | 247: - .long SYM(_uhoh) | 248: - .long SYM(_uhoh) | 249: - .long SYM(_uhoh) | 250: - .long SYM(_uhoh) | 251: - .long SYM(_uhoh) | 252: - .long SYM(_uhoh) | 253: - .long SYM(_uhoh) | 254: - .long SYM(_uhoh) | 255: - -/* - * Default trap handler - * With an oscilloscope you can see AS* stop - */ - PUBLIC (_uhoh) -SYM(_uhoh): nop | Leave spot for breakpoint - stop #0x2700 | Stop with interrupts disabled - bra.s SYM(_uhoh) | Stuck forever - -/* - * Log, but otherwise ignore, spurious interrupts - */ - PUBLIC (_spuriousInterrupt) -SYM(_spuriousInterrupt): - addql #1,SYM(_M68kSpuriousInterruptCount) - rte - -/* - * Place the low-order 3 octets of the board's ethernet address at - * a `well-known' fixed location relative to the startup location. - */ - .align 2 - .word 0 | Padding -ethernet_address_buffer: - .word 0x08F3 | Default address - .word 0xDEAD - .word 0xCAFE - -/* - * Initial PC - */ -.globl start -start: - /* - * Step 2: Stay in Supervisor Mode - */ -#if ( M68K_HAS_SEPARATE_STACKS == 1 ) - oriw #0x3000,sr | Switch to Master Stack Pointer - lea SYM(m360)+1024-64,a7 | Put stack in dual-port ram - | a little below the interrupt stack -#endif - - /* - * Step 3: Write the VBR - */ - lea Entry,a0 | Get base of vector table - movec a0,vbr | Set up the VBR - - /* - * Step 4: Write the MBAR - */ - movec dfc,d1 | Save destination register - moveq #7,d0 | CPU-space funcction code - movec d0,dfc | Set destination function code register - movel #SYM(m360)+0x101,d0 | MBAR value (mask CPU space accesses) - movesl d0,0x3FF00 | Set MBAR - movec d1,dfc | Restore destination register - - /* - * Step 5: Verify a dual-port RAM location - */ - lea SYM(m360),a0 | Point a0 to first DPRAM location - moveb #0x33,d0 | Set the test value - moveb d0,a0@ | Set the memory location - cmpb a0@,d0 | Does it read back? - bne SYM(_uhoh) | If not, bad news! - notb d0 | Flip bits - moveb d0,a0@ | Set the memory location - cmpb a0@,d0 | Does it read back? - bne SYM(_uhoh) | If not, bad news! - - /* - * Remaining steps are handled by C code - */ - jmp SYM(_Init68360) | Start C code (which never returns) - -/* - * Copy DATA segment, clear BSS segment, set up real stack, - * initialize heap, start C program. - * Assume that DATA and BSS sizes are multiples of 4. - */ - PUBLIC (_CopyDataClearBSSAndStart) -SYM(_CopyDataClearBSSAndStart): - lea copy_start,a0 | Get start of DATA in RAM - lea SYM(etext),a2 | Get start of DATA in ROM - cmpl a0,a2 | Are they the same? - beq.s NOCOPY | Yes, no copy necessary - lea copy_end,a1 | Get end of DATA in RAM - bra.s COPYLOOPTEST | Branch into copy loop -COPYLOOP: - movel a2@+,a0@+ | Copy word from ROM to RAM -COPYLOOPTEST: - cmpl a1,a0 | Done? - bcs.s COPYLOOP | No, skip -NOCOPY: - - lea clear_start,a0 | Get start of BSS - lea clear_end,a1 | Get end of BSS - clrl d0 | Value to set - bra.s ZEROLOOPTEST | Branch into clear loop -ZEROLOOP: - movel d0,a0@+ | Clear a word -ZEROLOOPTEST: - cmpl a1,a0 | Done? - bcs.s ZEROLOOP | No, skip - - movel #stack_init,a7 | set master stack pointer - movel d0,a7@- | environp - movel d0,a7@- | argv - movel d0,a7@- | argc - jsr SYM(boot_card) | Call C main - - PUBLIC (_mainDone) -SYM(_mainDone): - nop | Leave spot for breakpoint - movew #1,a7 | Force a double bus error - movel d0,a7@- | This should cause a RESET - stop #0x2700 | Stop with interrupts disabled - bra.s SYM(_mainDone) | Stuck forever - - .align 2 - PUBLIC (_HeapSize) -SYM (_HeapSize): - .long HeapSize - PUBLIC (_StackSize) -SYM (_StackSize): - .long StackSize -END_CODE - -BEGIN_DATA_DCL - .align 2 - PUBLIC (environ) -SYM (environ): - .long 0 - PUBLIC (_M68kSpuriousInterruptCount) -SYM (_M68kSpuriousInterruptCount): - .long 0 -END_DATA_DCL - -END - diff --git a/c/src/lib/libbsp/m68k/ods68302/start/Makefile.in b/c/src/lib/libbsp/m68k/ods68302/start/Makefile.in deleted file mode 100644 index a6d3ba2c08..0000000000 --- a/c/src/lib/libbsp/m68k/ods68302/start/Makefile.in +++ /dev/null @@ -1,69 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/start302.o - -ifeq ($(RTEMS_DEBUGGER),yes) -RESET_SRC = debugreset -else -RESET_SRC = reset -CFLAGS += -DGDB_MONITOR_ACTIVE -endif - -# C source names, if any, go here -- minus the .c -C_PIECES=cpuboot -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES=$(RESET_SRC) -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(H_FILES) $(S_FILES) -OBJS=$(S_O_FILES) $(C_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -${PGM}: ${OBJS} - $(make-rel) - -all: ${ARCH} $(SRCS) $(OBJS) $(PGM) - $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib - -# Install the program(s), appending _g or _p as appropriate. -# for include files, just use $(INSTALL) - - diff --git a/c/src/lib/libbsp/m68k/ods68302/start/cpuboot.c b/c/src/lib/libbsp/m68k/ods68302/start/cpuboot.c deleted file mode 100644 index fd8a4146de..0000000000 --- a/c/src/lib/libbsp/m68k/ods68302/start/cpuboot.c +++ /dev/null @@ -1,133 +0,0 @@ -/*****************************************************************************/ -/* - Boot the CPU. - - Occurs in 3 phases for a 68302. - - Phase 1. - - Called as soon as able after reset. The BAR has been programed, and - a small stack exists in the DPRAM. All interrupts are masked, and - the processor is running in supervisor mode. No other hardware or - chip selects are active. - - This phase programs the chip select registers, the parallel ports - are set into default configurations, and basic registers cleared or - reset. The leds are programmed to show the end of phase 1. - - Phase 2. - - This is a piece of code which is copied to DPRAM and executed. It - should not do any more thann is currently present. The return to ROM - is managed by modifing the return address. Again leds show the status. - - Phase 3. - - This code executes with a valid C environment. That is the data - section has been intialised and the bss section set to 0. This phase - performs any special card initialisation and then calls boot card. - - $Id$ - -*/ -/*****************************************************************************/ - -#include <bsp.h> -#include <m68302.h> -#include <debugport.h> -#include <crc.h> - -/* - Open the address, reset all registers - */ - -void boot_phase_1() -{ - M302_SCR = SCR_DEFAULT; - - WRITE_OR(CSEL_ROM, ROM_SIZE, ROM_WAIT_STATES, OR_MASK_RW, OR_MASK_FC); - WRITE_BR(CSEL_ROM, RAM_BASE, BR_READ_ONLY, BR_FC_NULL, BR_ENABLED); - WRITE_OR(CSEL_RAM, RAM_SIZE, RAM_WAIT_STATES, OR_MASK_RW, OR_MASK_FC); - WRITE_BR(CSEL_RAM, ROM_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED); - -#if defined(CSEL_1) - WRITE_OR(CSEL_1, CSEL_1_SIZE, CSEL_1_WAIT_STATES, OR_MASK_RW, OR_MASK_FC); - WRITE_BR(CSEL_1, CSEL_1_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED); -#endif - -#if defined(CSEL_2) - WRITE_OR(CSEL_2, CSEL_2_SIZE, CSEL_2_WAIT_STATES, OR_MASK_RW, OR_MASK_FC); - WRITE_BR(CSEL_2, CSEL_2_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED); -#endif - - m302.reg.gimr = m302.reg.ipr = m302.reg.imr = m302.reg.isr = 0; - - m302.reg.simode = 0; - - m302.reg.pacnt = CARD_PA_CONFIGURATION; - m302.reg.paddr = CARD_PA_DEFAULT_DIRECTIONS; - m302.reg.padat = CARD_PA_DEFAULT_DATA; - - m302.reg.pbcnt = CARD_PB_CONFIGURATION; - m302.reg.pbddr = CARD_PB_DEFAULT_DIRECTIONS; - m302.reg.pbdat = CARD_PB_DEFAULT_DATA; - - m302.reg.wrr = WATCHDOG_TIMEOUT_PERIOD | WATCHDOG_ENABLE; - -#if defined(LED_CONTROL) - LED_CONTROL(LED_1_RED, LED_2_OFF, LED_3_OFF, LED_4_OFF, - LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF); -#endif -} - -/* - Swap the chip select mapping for ROM and RAM - */ - -void boot_phase_2(void) -{ - rtems_unsigned32 stack; - -#if defined(LED_CONTROL) - LED_CONTROL(LED_1_RED, LED_2_RED, LED_3_OFF, LED_4_OFF, - LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF); -#endif - - WRITE_BR(CSEL_ROM, ROM_BASE, BR_READ_ONLY, BR_FC_NULL, BR_ENABLED); - WRITE_BR(CSEL_RAM, RAM_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED); - -#if defined(LED_CONTROL) - LED_CONTROL(LED_1_GREEN, LED_2_RED, LED_3_OFF, LED_4_OFF, - LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF); -#endif - - /* seems to want 2, looked at assember code output */ - *(&stack + 2) |= ROM_BASE; -} - -/* - Any pre-main initialisation, the C environment is setup, how-ever C++ - static constructors have not been called, and RTEMS is not initialised. - */ - -void boot_card(); -void set_debug_traps(); -void breakpoint(); - -void boot_phase_3(void) -{ - if (GDB_RUN_MONITOR()) - { - set_debug_traps(); - breakpoint(); - } - - debug_port_banner(); - - /* FIXME : add RAM and ROM checks */ - - /* boot the bsp, what ever this means */ - boot_card(); - - WATCHDOG_TRIGGER(); -} diff --git a/c/src/lib/libbsp/m68k/ods68302/start/debugreset.S b/c/src/lib/libbsp/m68k/ods68302/start/debugreset.S deleted file mode 100644 index 74049191c4..0000000000 --- a/c/src/lib/libbsp/m68k/ods68302/start/debugreset.S +++ /dev/null @@ -1,107 +0,0 @@ -/* - * $Id$ - * - * Re-written the gen68302 start-up code. - * - * Uses gas syntax only, removed the OAR asm.h. - * - * Supplies a complete vector table in ROM. - * - * Manages all vectors with seperate handlers to trap unhandled - * execptions. - * - * Uses the target specific header file to get the runtime - * configuration - * - * COPYRIGHT (c) 1996 - * Objective Design Systems Pty Ltd (ODS) - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - */ - -| -| Entry from debugger -| - .sect .text - -| -| Start -| -| Entered from a hardware reset. -| - - .global start | Default entry point for GNU -start: - - move.w #0x2700,%sr | Disable all interrupts - - | - | zero out uninitialized data area - | - -zerobss: - moveal #end,%a0 | find end of .bss - moveal #bss_start,%a1 | find beginning of .bss - moveq #0,%d0 - -zerobss_loop: - - movel %d0,%a1@+ | to zero out uninitialized - cmpal %a0,%a1 - jlt zerobss_loop | loop until _end reached - - movel #end,%d0 | d0 = end of bss/start of heap - addl #heap_size,%d0 | d0 = end of heap - - movel %d0,stack_start | Save for brk() routine - addl #stack_size,%d0 | make room for stack - andl #0xffffffc0,%d0 | align it on 16 byte boundary - - movw #0x3700,%sr | SUPV MODE,INTERRUPTS OFF!!! - movel %d0,%a7 | set master stack pointer - movel %d0,%a6 | set base pointer - - jsr boot_phase_3 - -| -| Initialised data -| - - .sect .data - - .global start_frame - -start_frame: - .space 4,0 - - .global stack_start - -stack_start: - .space 4,0 - -| -| Uninitialised data -| - - .sect .bss - - .global environ - .align 2 - -environ: - .long 0 - - .global heap_size - .set heap_size,0x2000 - - .global stack_size - .set stack_size,0x1000 - - diff --git a/c/src/lib/libbsp/m68k/ods68302/start/reset.S b/c/src/lib/libbsp/m68k/ods68302/start/reset.S deleted file mode 100644 index 71d1071243..0000000000 --- a/c/src/lib/libbsp/m68k/ods68302/start/reset.S +++ /dev/null @@ -1,881 +0,0 @@ -/* - * $Id$ - * - * Re-written the gen68302 start-up code. - * - * Uses gas syntax only, removed the OAR asm.h. - * - * Supplies a complete vector table in ROM. - * - * Manages all vectors with seperate handlers to trap unhandled - * execptions. - * - * Uses the target specific header file to get the runtime - * configuration - * - * COPYRIGHT (c) 1996 - * Objective Design Systems Pty Ltd (ODS) - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - */ - -| -| some basic defined, this is that is required -| -#define MC68302_BAR 0x000000F2 -#define MC68302_BAR_FC_CFC 0x0000 -#define MC68302_SYS_RAM_SIZE 0x240 - -| -| Boot boot code in a special section, ld postions -| -| Initial stack pointer is in the dual ported RAM -| - .sect .text - - .global M68Kvec | Vector Table - -M68Kvec: | standard location for vectors - -| -| Make relative, can have the code positioned any where -| - -V___ISSP: .long MC68302_BASE + MC68302_SYS_RAM_SIZE -V____IPC: .long start - V___ISSP - -| -| Create the rest of the vector table to point to the unhandled expection -| handler -| -| Lots of macros, how-ever it creates a simple ROM vector table -| - -exception_handler = unhandled_exception - V___ISSP -#define MAKE_EXCEPTION_VECTOR(n) V___##n: .long (exception_handler + (n * 8)) - -MAKE_EXCEPTION_VECTOR(2) -MAKE_EXCEPTION_VECTOR(3) -MAKE_EXCEPTION_VECTOR(4) -MAKE_EXCEPTION_VECTOR(5) -MAKE_EXCEPTION_VECTOR(6) -MAKE_EXCEPTION_VECTOR(7) -MAKE_EXCEPTION_VECTOR(8) -MAKE_EXCEPTION_VECTOR(9) - -MAKE_EXCEPTION_VECTOR(10) -MAKE_EXCEPTION_VECTOR(11) -MAKE_EXCEPTION_VECTOR(12) -MAKE_EXCEPTION_VECTOR(13) -MAKE_EXCEPTION_VECTOR(14) -MAKE_EXCEPTION_VECTOR(15) -MAKE_EXCEPTION_VECTOR(16) -MAKE_EXCEPTION_VECTOR(17) -MAKE_EXCEPTION_VECTOR(18) -MAKE_EXCEPTION_VECTOR(19) - -MAKE_EXCEPTION_VECTOR(20) -MAKE_EXCEPTION_VECTOR(21) -MAKE_EXCEPTION_VECTOR(22) -MAKE_EXCEPTION_VECTOR(23) -MAKE_EXCEPTION_VECTOR(24) -MAKE_EXCEPTION_VECTOR(25) -MAKE_EXCEPTION_VECTOR(26) -MAKE_EXCEPTION_VECTOR(27) -MAKE_EXCEPTION_VECTOR(28) -MAKE_EXCEPTION_VECTOR(29) - -MAKE_EXCEPTION_VECTOR(30) -MAKE_EXCEPTION_VECTOR(31) -MAKE_EXCEPTION_VECTOR(32) -MAKE_EXCEPTION_VECTOR(33) -MAKE_EXCEPTION_VECTOR(34) -MAKE_EXCEPTION_VECTOR(35) -MAKE_EXCEPTION_VECTOR(36) -MAKE_EXCEPTION_VECTOR(37) -MAKE_EXCEPTION_VECTOR(38) -MAKE_EXCEPTION_VECTOR(39) - -MAKE_EXCEPTION_VECTOR(40) -MAKE_EXCEPTION_VECTOR(41) -MAKE_EXCEPTION_VECTOR(42) -MAKE_EXCEPTION_VECTOR(43) -MAKE_EXCEPTION_VECTOR(44) -MAKE_EXCEPTION_VECTOR(45) -MAKE_EXCEPTION_VECTOR(46) -MAKE_EXCEPTION_VECTOR(47) -MAKE_EXCEPTION_VECTOR(48) -MAKE_EXCEPTION_VECTOR(49) - -MAKE_EXCEPTION_VECTOR(50) -MAKE_EXCEPTION_VECTOR(51) -MAKE_EXCEPTION_VECTOR(52) -MAKE_EXCEPTION_VECTOR(53) -MAKE_EXCEPTION_VECTOR(54) -MAKE_EXCEPTION_VECTOR(55) -MAKE_EXCEPTION_VECTOR(56) -MAKE_EXCEPTION_VECTOR(57) -MAKE_EXCEPTION_VECTOR(58) -MAKE_EXCEPTION_VECTOR(59) - -MAKE_EXCEPTION_VECTOR(60) -MAKE_EXCEPTION_VECTOR(61) -MAKE_EXCEPTION_VECTOR(62) -MAKE_EXCEPTION_VECTOR(63) -MAKE_EXCEPTION_VECTOR(64) -MAKE_EXCEPTION_VECTOR(65) -MAKE_EXCEPTION_VECTOR(66) -MAKE_EXCEPTION_VECTOR(67) -MAKE_EXCEPTION_VECTOR(68) -MAKE_EXCEPTION_VECTOR(69) - -MAKE_EXCEPTION_VECTOR(70) -MAKE_EXCEPTION_VECTOR(71) -MAKE_EXCEPTION_VECTOR(72) -MAKE_EXCEPTION_VECTOR(73) -MAKE_EXCEPTION_VECTOR(74) -MAKE_EXCEPTION_VECTOR(75) -MAKE_EXCEPTION_VECTOR(76) -MAKE_EXCEPTION_VECTOR(77) -MAKE_EXCEPTION_VECTOR(78) -MAKE_EXCEPTION_VECTOR(79) - -MAKE_EXCEPTION_VECTOR(80) -MAKE_EXCEPTION_VECTOR(81) -MAKE_EXCEPTION_VECTOR(82) -MAKE_EXCEPTION_VECTOR(83) -MAKE_EXCEPTION_VECTOR(84) -MAKE_EXCEPTION_VECTOR(85) -MAKE_EXCEPTION_VECTOR(86) -MAKE_EXCEPTION_VECTOR(87) -MAKE_EXCEPTION_VECTOR(88) -MAKE_EXCEPTION_VECTOR(89) - -MAKE_EXCEPTION_VECTOR(90) -MAKE_EXCEPTION_VECTOR(91) -MAKE_EXCEPTION_VECTOR(92) -MAKE_EXCEPTION_VECTOR(93) -MAKE_EXCEPTION_VECTOR(94) -MAKE_EXCEPTION_VECTOR(95) -MAKE_EXCEPTION_VECTOR(96) -MAKE_EXCEPTION_VECTOR(97) -MAKE_EXCEPTION_VECTOR(98) -MAKE_EXCEPTION_VECTOR(99) - -MAKE_EXCEPTION_VECTOR(100) -MAKE_EXCEPTION_VECTOR(101) -MAKE_EXCEPTION_VECTOR(102) -MAKE_EXCEPTION_VECTOR(103) -MAKE_EXCEPTION_VECTOR(104) -MAKE_EXCEPTION_VECTOR(105) -MAKE_EXCEPTION_VECTOR(106) -MAKE_EXCEPTION_VECTOR(107) -MAKE_EXCEPTION_VECTOR(108) -MAKE_EXCEPTION_VECTOR(109) - -MAKE_EXCEPTION_VECTOR(110) -MAKE_EXCEPTION_VECTOR(111) -MAKE_EXCEPTION_VECTOR(112) -MAKE_EXCEPTION_VECTOR(113) -MAKE_EXCEPTION_VECTOR(114) -MAKE_EXCEPTION_VECTOR(115) -MAKE_EXCEPTION_VECTOR(116) -MAKE_EXCEPTION_VECTOR(117) -MAKE_EXCEPTION_VECTOR(118) -MAKE_EXCEPTION_VECTOR(119) - -MAKE_EXCEPTION_VECTOR(120) -MAKE_EXCEPTION_VECTOR(121) -MAKE_EXCEPTION_VECTOR(122) -MAKE_EXCEPTION_VECTOR(123) -MAKE_EXCEPTION_VECTOR(124) -MAKE_EXCEPTION_VECTOR(125) -MAKE_EXCEPTION_VECTOR(126) -MAKE_EXCEPTION_VECTOR(127) -MAKE_EXCEPTION_VECTOR(128) -MAKE_EXCEPTION_VECTOR(129) - -MAKE_EXCEPTION_VECTOR(130) -MAKE_EXCEPTION_VECTOR(131) -MAKE_EXCEPTION_VECTOR(132) -MAKE_EXCEPTION_VECTOR(133) -MAKE_EXCEPTION_VECTOR(134) -MAKE_EXCEPTION_VECTOR(135) -MAKE_EXCEPTION_VECTOR(136) -MAKE_EXCEPTION_VECTOR(137) -MAKE_EXCEPTION_VECTOR(138) -MAKE_EXCEPTION_VECTOR(139) - -MAKE_EXCEPTION_VECTOR(140) -MAKE_EXCEPTION_VECTOR(141) -MAKE_EXCEPTION_VECTOR(142) -MAKE_EXCEPTION_VECTOR(143) -MAKE_EXCEPTION_VECTOR(144) -MAKE_EXCEPTION_VECTOR(145) -MAKE_EXCEPTION_VECTOR(146) -MAKE_EXCEPTION_VECTOR(147) -MAKE_EXCEPTION_VECTOR(148) -MAKE_EXCEPTION_VECTOR(149) - -MAKE_EXCEPTION_VECTOR(150) -MAKE_EXCEPTION_VECTOR(151) -MAKE_EXCEPTION_VECTOR(152) -MAKE_EXCEPTION_VECTOR(153) -MAKE_EXCEPTION_VECTOR(154) -MAKE_EXCEPTION_VECTOR(155) -MAKE_EXCEPTION_VECTOR(156) -MAKE_EXCEPTION_VECTOR(157) -MAKE_EXCEPTION_VECTOR(158) -MAKE_EXCEPTION_VECTOR(159) - -MAKE_EXCEPTION_VECTOR(160) -MAKE_EXCEPTION_VECTOR(161) -MAKE_EXCEPTION_VECTOR(162) -MAKE_EXCEPTION_VECTOR(163) -MAKE_EXCEPTION_VECTOR(164) -MAKE_EXCEPTION_VECTOR(165) -MAKE_EXCEPTION_VECTOR(166) -MAKE_EXCEPTION_VECTOR(167) -MAKE_EXCEPTION_VECTOR(168) -MAKE_EXCEPTION_VECTOR(169) - -MAKE_EXCEPTION_VECTOR(170) -MAKE_EXCEPTION_VECTOR(171) -MAKE_EXCEPTION_VECTOR(172) -MAKE_EXCEPTION_VECTOR(173) -MAKE_EXCEPTION_VECTOR(174) -MAKE_EXCEPTION_VECTOR(175) -MAKE_EXCEPTION_VECTOR(176) -MAKE_EXCEPTION_VECTOR(177) -MAKE_EXCEPTION_VECTOR(178) -MAKE_EXCEPTION_VECTOR(179) - -MAKE_EXCEPTION_VECTOR(180) -MAKE_EXCEPTION_VECTOR(181) -MAKE_EXCEPTION_VECTOR(182) -MAKE_EXCEPTION_VECTOR(183) -MAKE_EXCEPTION_VECTOR(184) -MAKE_EXCEPTION_VECTOR(185) -MAKE_EXCEPTION_VECTOR(186) -MAKE_EXCEPTION_VECTOR(187) -MAKE_EXCEPTION_VECTOR(188) -MAKE_EXCEPTION_VECTOR(189) - -MAKE_EXCEPTION_VECTOR(190) -MAKE_EXCEPTION_VECTOR(191) -MAKE_EXCEPTION_VECTOR(192) -MAKE_EXCEPTION_VECTOR(193) -MAKE_EXCEPTION_VECTOR(194) -MAKE_EXCEPTION_VECTOR(195) -MAKE_EXCEPTION_VECTOR(196) -MAKE_EXCEPTION_VECTOR(197) -MAKE_EXCEPTION_VECTOR(198) -MAKE_EXCEPTION_VECTOR(199) - -MAKE_EXCEPTION_VECTOR(200) -MAKE_EXCEPTION_VECTOR(201) -MAKE_EXCEPTION_VECTOR(202) -MAKE_EXCEPTION_VECTOR(203) -MAKE_EXCEPTION_VECTOR(204) -MAKE_EXCEPTION_VECTOR(205) -MAKE_EXCEPTION_VECTOR(206) -MAKE_EXCEPTION_VECTOR(207) -MAKE_EXCEPTION_VECTOR(208) -MAKE_EXCEPTION_VECTOR(209) - -MAKE_EXCEPTION_VECTOR(210) -MAKE_EXCEPTION_VECTOR(211) -MAKE_EXCEPTION_VECTOR(212) -MAKE_EXCEPTION_VECTOR(213) -MAKE_EXCEPTION_VECTOR(214) -MAKE_EXCEPTION_VECTOR(215) -MAKE_EXCEPTION_VECTOR(216) -MAKE_EXCEPTION_VECTOR(217) -MAKE_EXCEPTION_VECTOR(218) -MAKE_EXCEPTION_VECTOR(219) - -MAKE_EXCEPTION_VECTOR(220) -MAKE_EXCEPTION_VECTOR(221) -MAKE_EXCEPTION_VECTOR(222) -MAKE_EXCEPTION_VECTOR(223) -MAKE_EXCEPTION_VECTOR(224) -MAKE_EXCEPTION_VECTOR(225) -MAKE_EXCEPTION_VECTOR(226) -MAKE_EXCEPTION_VECTOR(227) -MAKE_EXCEPTION_VECTOR(228) -MAKE_EXCEPTION_VECTOR(229) - -MAKE_EXCEPTION_VECTOR(230) -MAKE_EXCEPTION_VECTOR(231) -MAKE_EXCEPTION_VECTOR(232) -MAKE_EXCEPTION_VECTOR(233) -MAKE_EXCEPTION_VECTOR(234) -MAKE_EXCEPTION_VECTOR(235) -MAKE_EXCEPTION_VECTOR(236) -MAKE_EXCEPTION_VECTOR(237) -MAKE_EXCEPTION_VECTOR(238) -MAKE_EXCEPTION_VECTOR(239) - -MAKE_EXCEPTION_VECTOR(240) -MAKE_EXCEPTION_VECTOR(241) -MAKE_EXCEPTION_VECTOR(242) -MAKE_EXCEPTION_VECTOR(243) -MAKE_EXCEPTION_VECTOR(244) -MAKE_EXCEPTION_VECTOR(245) -MAKE_EXCEPTION_VECTOR(246) -MAKE_EXCEPTION_VECTOR(247) -MAKE_EXCEPTION_VECTOR(248) -MAKE_EXCEPTION_VECTOR(249) - -MAKE_EXCEPTION_VECTOR(250) -MAKE_EXCEPTION_VECTOR(251) -MAKE_EXCEPTION_VECTOR(252) -MAKE_EXCEPTION_VECTOR(253) -MAKE_EXCEPTION_VECTOR(254) -MAKE_EXCEPTION_VECTOR(255) - -| -| Start -| -| Entered from a hardware reset. -| - - .global start | Default entry point for GNU -start: - - move.w #0x2700,%sr | Disable all interrupts - - | - | Program the BAR, give us a stack !! - | - - moveq #0,%d0 - move.w #(MC68302_BASE >> 12),%d0 - or.w #(MC68302_BAR_FC_CFC << 12),%d0 - move.l #MC68302_BAR,%a0 - move.w %d0,%a0@(0) - - | - | watch for sign extended maths with the linker on (boot_phase_1-V___ISSP) - | manage the address with code, limited address of 2K at reset for CS0 - | - - move.l #boot_phase_1,%d0 - and.l #0x1FFF,%d0 - move.l %d0,%a0 - jsr %a0@(0) | programs all basic 302 registers - - | - | Map to the 68302 registers - | - - move.l #MC68302_BASE,%a5 - - | - | Make a vector table in RAM - | - - move.l #RAM_BASE,%a0 | a0 -> rom vector table - moveal #ROM_BASE,%a1 | d1 -> start of tmp SRAM - - move.l #255,%d0 - -copy_vec_table: - - move.l (%a0)+,%d1 - or.l #ROM_BASE,%d1 - move.l %d1,(%a1)+ - subq.l #1,%d0 - bne copy_vec_table - -#if defined(SYSTEM_TABLE_ANCHOR_OFFSET) - | - | Clear the system table - | - - move.l #SYSTEM_TABLE_ANCHOR_OFFSET,%a0 - move.l #0,(%a0) -#endif - - | - | Copy the chip select swap code to DPRAM and run it - | - - move.l #boot_phase_2,%d0 - and.l #(ROM_SIZE - 1),%d0 - move.l %d0,%a0 | a0 -> remap code - lea %a5@(0),%a1 | a1 -> internal system RAM - - move.l #boot_phase_3,%d0 - and.l #(ROM_SIZE - 1),%d0 - sub.l %a0,%d0 - -copy_remap: - move.b (%a0)+,(%a1)+ | copy - dbra %d0,copy_remap - - | - | Jump to the remap code in the 68302''s internal system RAM. - | - - jsr %a5@(0) | execute the swap code - - | - | Map to the 68302 registers - | - - move.l #MC68302_BASE,%a5 - - | - | Copy initialized data area from ROM to RAM - | - -copy_data: - moveal #etext,%a0 | find the end of .text - moveal #data_start,%a1 | find the beginning of .data - moveal #edata,%a2 | find the end of .data - -copy_data_loop: - - movel %a0@+,%a1@+ | copy the data - cmpal %a2,%a1 - jlt copy_data_loop | loop until edata reached - - | - | zero out uninitialized data area - | - -zerobss: - moveal #end,%a0 | find end of .bss - moveal #bss_start,%a1 | find beginning of .bss - moveq #0,%d0 - -zerobss_loop: - - movel %d0,%a1@+ | to zero out uninitialized - cmpal %a0,%a1 - jlt zerobss_loop | loop until _end reached - - movel #end,%d0 | d0 = end of bss/start of heap - addl #heap_size,%d0 | d0 = end of heap - - movel %d0,stack_start | Save for brk() routine - addl #stack_size,%d0 | make room for stack - andl #0xffffffc0,%d0 | align it on 16 byte boundary - - movw #0x3700,%sr | SUPV MODE,INTERRUPTS OFF!!! - movel %d0,%a7 | set master stack pointer - movel %d0,%a6 | set base pointer - - jsr boot_phase_3 - -| -| Create an unhandled exception jump table. The table has an entry for -| each vector in the vector table. The entry pushes the vector number onto -| the stack and then calls a common exception handler using PIC. -| -| The macros are to create the labels and format vectors. -| - -#define cat(x, y) x ## y -#define FORMAT_ID(n) (n << 2) -#define EXCEPTION_HANDLER(h, n) EH__##n: move.w cat(h, FORMAT_ID(n)),-(%sp) ; \ - bra common_exception_handler - -unhandled_exception: - -EXCEPTION_HANDLER(#, 0) -EXCEPTION_HANDLER(#, 1) -EXCEPTION_HANDLER(#, 2) -EXCEPTION_HANDLER(#, 3) -EXCEPTION_HANDLER(#, 4) -EXCEPTION_HANDLER(#, 5) -EXCEPTION_HANDLER(#, 6) -EXCEPTION_HANDLER(#, 7) -EXCEPTION_HANDLER(#, 8) -EXCEPTION_HANDLER(#, 9) - -EXCEPTION_HANDLER(#, 10) -EXCEPTION_HANDLER(#, 11) -EXCEPTION_HANDLER(#, 12) -EXCEPTION_HANDLER(#, 13) -EXCEPTION_HANDLER(#, 14) -EXCEPTION_HANDLER(#, 15) -EXCEPTION_HANDLER(#, 16) -EXCEPTION_HANDLER(#, 17) -EXCEPTION_HANDLER(#, 18) -EXCEPTION_HANDLER(#, 19) - -EXCEPTION_HANDLER(#, 20) -EXCEPTION_HANDLER(#, 21) -EXCEPTION_HANDLER(#, 22) -EXCEPTION_HANDLER(#, 23) -EXCEPTION_HANDLER(#, 24) -EXCEPTION_HANDLER(#, 25) -EXCEPTION_HANDLER(#, 26) -EXCEPTION_HANDLER(#, 27) -EXCEPTION_HANDLER(#, 28) -EXCEPTION_HANDLER(#, 29) - -EXCEPTION_HANDLER(#, 30) -EXCEPTION_HANDLER(#, 31) -EXCEPTION_HANDLER(#, 32) -EXCEPTION_HANDLER(#, 33) -EXCEPTION_HANDLER(#, 34) -EXCEPTION_HANDLER(#, 35) -EXCEPTION_HANDLER(#, 36) -EXCEPTION_HANDLER(#, 37) -EXCEPTION_HANDLER(#, 38) -EXCEPTION_HANDLER(#, 39) - -EXCEPTION_HANDLER(#, 40) -EXCEPTION_HANDLER(#, 41) -EXCEPTION_HANDLER(#, 42) -EXCEPTION_HANDLER(#, 43) -EXCEPTION_HANDLER(#, 44) -EXCEPTION_HANDLER(#, 45) -EXCEPTION_HANDLER(#, 46) -EXCEPTION_HANDLER(#, 47) -EXCEPTION_HANDLER(#, 48) -EXCEPTION_HANDLER(#, 49) - -EXCEPTION_HANDLER(#, 50) -EXCEPTION_HANDLER(#, 51) -EXCEPTION_HANDLER(#, 52) -EXCEPTION_HANDLER(#, 53) -EXCEPTION_HANDLER(#, 54) -EXCEPTION_HANDLER(#, 55) -EXCEPTION_HANDLER(#, 56) -EXCEPTION_HANDLER(#, 57) -EXCEPTION_HANDLER(#, 58) -EXCEPTION_HANDLER(#, 59) - -EXCEPTION_HANDLER(#, 60) -EXCEPTION_HANDLER(#, 61) -EXCEPTION_HANDLER(#, 62) -EXCEPTION_HANDLER(#, 63) -EXCEPTION_HANDLER(#, 64) -EXCEPTION_HANDLER(#, 65) -EXCEPTION_HANDLER(#, 66) -EXCEPTION_HANDLER(#, 67) -EXCEPTION_HANDLER(#, 68) -EXCEPTION_HANDLER(#, 69) - -EXCEPTION_HANDLER(#, 70) -EXCEPTION_HANDLER(#, 71) -EXCEPTION_HANDLER(#, 72) -EXCEPTION_HANDLER(#, 73) -EXCEPTION_HANDLER(#, 74) -EXCEPTION_HANDLER(#, 75) -EXCEPTION_HANDLER(#, 76) -EXCEPTION_HANDLER(#, 77) -EXCEPTION_HANDLER(#, 78) -EXCEPTION_HANDLER(#, 79) - -EXCEPTION_HANDLER(#, 80) -EXCEPTION_HANDLER(#, 81) -EXCEPTION_HANDLER(#, 82) -EXCEPTION_HANDLER(#, 83) -EXCEPTION_HANDLER(#, 84) -EXCEPTION_HANDLER(#, 85) -EXCEPTION_HANDLER(#, 86) -EXCEPTION_HANDLER(#, 87) -EXCEPTION_HANDLER(#, 88) -EXCEPTION_HANDLER(#, 89) - -EXCEPTION_HANDLER(#, 90) -EXCEPTION_HANDLER(#, 91) -EXCEPTION_HANDLER(#, 92) -EXCEPTION_HANDLER(#, 93) -EXCEPTION_HANDLER(#, 94) -EXCEPTION_HANDLER(#, 95) -EXCEPTION_HANDLER(#, 96) -EXCEPTION_HANDLER(#, 97) -EXCEPTION_HANDLER(#, 98) -EXCEPTION_HANDLER(#, 99) - -EXCEPTION_HANDLER(#, 100) -EXCEPTION_HANDLER(#, 101) -EXCEPTION_HANDLER(#, 102) -EXCEPTION_HANDLER(#, 103) -EXCEPTION_HANDLER(#, 104) -EXCEPTION_HANDLER(#, 105) -EXCEPTION_HANDLER(#, 106) -EXCEPTION_HANDLER(#, 107) -EXCEPTION_HANDLER(#, 108) -EXCEPTION_HANDLER(#, 109) - -EXCEPTION_HANDLER(#, 110) -EXCEPTION_HANDLER(#, 111) -EXCEPTION_HANDLER(#, 112) -EXCEPTION_HANDLER(#, 113) -EXCEPTION_HANDLER(#, 114) -EXCEPTION_HANDLER(#, 115) -EXCEPTION_HANDLER(#, 116) -EXCEPTION_HANDLER(#, 117) -EXCEPTION_HANDLER(#, 118) -EXCEPTION_HANDLER(#, 119) - -EXCEPTION_HANDLER(#, 120) -EXCEPTION_HANDLER(#, 121) -EXCEPTION_HANDLER(#, 122) -EXCEPTION_HANDLER(#, 123) -EXCEPTION_HANDLER(#, 124) -EXCEPTION_HANDLER(#, 125) -EXCEPTION_HANDLER(#, 126) -EXCEPTION_HANDLER(#, 127) -EXCEPTION_HANDLER(#, 128) -EXCEPTION_HANDLER(#, 129) - -EXCEPTION_HANDLER(#, 130) -EXCEPTION_HANDLER(#, 131) -EXCEPTION_HANDLER(#, 132) -EXCEPTION_HANDLER(#, 133) -EXCEPTION_HANDLER(#, 134) -EXCEPTION_HANDLER(#, 135) -EXCEPTION_HANDLER(#, 136) -EXCEPTION_HANDLER(#, 137) -EXCEPTION_HANDLER(#, 138) -EXCEPTION_HANDLER(#, 139) - -EXCEPTION_HANDLER(#, 140) -EXCEPTION_HANDLER(#, 141) -EXCEPTION_HANDLER(#, 142) -EXCEPTION_HANDLER(#, 143) -EXCEPTION_HANDLER(#, 144) -EXCEPTION_HANDLER(#, 145) -EXCEPTION_HANDLER(#, 146) -EXCEPTION_HANDLER(#, 147) -EXCEPTION_HANDLER(#, 148) -EXCEPTION_HANDLER(#, 149) - -EXCEPTION_HANDLER(#, 150) -EXCEPTION_HANDLER(#, 151) -EXCEPTION_HANDLER(#, 152) -EXCEPTION_HANDLER(#, 153) -EXCEPTION_HANDLER(#, 154) -EXCEPTION_HANDLER(#, 155) -EXCEPTION_HANDLER(#, 156) -EXCEPTION_HANDLER(#, 157) -EXCEPTION_HANDLER(#, 158) -EXCEPTION_HANDLER(#, 159) - -EXCEPTION_HANDLER(#, 160) -EXCEPTION_HANDLER(#, 161) -EXCEPTION_HANDLER(#, 162) -EXCEPTION_HANDLER(#, 163) -EXCEPTION_HANDLER(#, 164) -EXCEPTION_HANDLER(#, 165) -EXCEPTION_HANDLER(#, 166) -EXCEPTION_HANDLER(#, 167) -EXCEPTION_HANDLER(#, 168) -EXCEPTION_HANDLER(#, 169) - -EXCEPTION_HANDLER(#, 170) -EXCEPTION_HANDLER(#, 171) -EXCEPTION_HANDLER(#, 172) -EXCEPTION_HANDLER(#, 173) -EXCEPTION_HANDLER(#, 174) -EXCEPTION_HANDLER(#, 175) -EXCEPTION_HANDLER(#, 176) -EXCEPTION_HANDLER(#, 177) -EXCEPTION_HANDLER(#, 178) -EXCEPTION_HANDLER(#, 179) - -EXCEPTION_HANDLER(#, 180) -EXCEPTION_HANDLER(#, 181) -EXCEPTION_HANDLER(#, 182) -EXCEPTION_HANDLER(#, 183) -EXCEPTION_HANDLER(#, 184) -EXCEPTION_HANDLER(#, 185) -EXCEPTION_HANDLER(#, 186) -EXCEPTION_HANDLER(#, 187) -EXCEPTION_HANDLER(#, 188) -EXCEPTION_HANDLER(#, 189) - -EXCEPTION_HANDLER(#, 190) -EXCEPTION_HANDLER(#, 191) -EXCEPTION_HANDLER(#, 192) -EXCEPTION_HANDLER(#, 193) -EXCEPTION_HANDLER(#, 194) -EXCEPTION_HANDLER(#, 195) -EXCEPTION_HANDLER(#, 196) -EXCEPTION_HANDLER(#, 197) -EXCEPTION_HANDLER(#, 198) -EXCEPTION_HANDLER(#, 199) - -EXCEPTION_HANDLER(#, 200) -EXCEPTION_HANDLER(#, 201) -EXCEPTION_HANDLER(#, 202) -EXCEPTION_HANDLER(#, 203) -EXCEPTION_HANDLER(#, 204) -EXCEPTION_HANDLER(#, 205) -EXCEPTION_HANDLER(#, 206) -EXCEPTION_HANDLER(#, 207) -EXCEPTION_HANDLER(#, 208) -EXCEPTION_HANDLER(#, 209) - -EXCEPTION_HANDLER(#, 210) -EXCEPTION_HANDLER(#, 211) -EXCEPTION_HANDLER(#, 212) -EXCEPTION_HANDLER(#, 213) -EXCEPTION_HANDLER(#, 214) -EXCEPTION_HANDLER(#, 215) -EXCEPTION_HANDLER(#, 216) -EXCEPTION_HANDLER(#, 217) -EXCEPTION_HANDLER(#, 218) -EXCEPTION_HANDLER(#, 219) - -EXCEPTION_HANDLER(#, 220) -EXCEPTION_HANDLER(#, 221) -EXCEPTION_HANDLER(#, 222) -EXCEPTION_HANDLER(#, 223) -EXCEPTION_HANDLER(#, 224) -EXCEPTION_HANDLER(#, 225) -EXCEPTION_HANDLER(#, 226) -EXCEPTION_HANDLER(#, 227) -EXCEPTION_HANDLER(#, 228) -EXCEPTION_HANDLER(#, 229) - -EXCEPTION_HANDLER(#, 230) -EXCEPTION_HANDLER(#, 231) -EXCEPTION_HANDLER(#, 232) -EXCEPTION_HANDLER(#, 233) -EXCEPTION_HANDLER(#, 234) -EXCEPTION_HANDLER(#, 235) -EXCEPTION_HANDLER(#, 236) -EXCEPTION_HANDLER(#, 237) -EXCEPTION_HANDLER(#, 238) -EXCEPTION_HANDLER(#, 239) - -EXCEPTION_HANDLER(#, 240) -EXCEPTION_HANDLER(#, 241) -EXCEPTION_HANDLER(#, 242) -EXCEPTION_HANDLER(#, 243) -EXCEPTION_HANDLER(#, 244) -EXCEPTION_HANDLER(#, 245) -EXCEPTION_HANDLER(#, 246) -EXCEPTION_HANDLER(#, 247) -EXCEPTION_HANDLER(#, 248) -EXCEPTION_HANDLER(#, 249) - -EXCEPTION_HANDLER(#, 250) -EXCEPTION_HANDLER(#, 251) -EXCEPTION_HANDLER(#, 252) -EXCEPTION_HANDLER(#, 253) -EXCEPTION_HANDLER(#, 254) -EXCEPTION_HANDLER(#, 255) - - -common_exception_handler: - - | - | Need to put the format/vector above the PC and status register - | - - move.l %d0,-(%sp) | free a register - move.w 4(%sp),%d0 | get the format/vector id - - | - | If a bus error or address error then trash the extra - | data saved on the stack - | - - cmp.w #0x0008,%d0 - beq ceh_10 - - cmp.w #0x000C,%d0 - beq ceh_10 - - bra ceh_20 - -ceh_10: - - move.w %d0,12(%sp) | need to move the format/id - move.l (%sp)+,%d0 | recover d0 - addq #8,%sp | trash the stack - move.l %d0,-(%sp) | free a register, again - move.w 4(%sp),%d0 | get the format/vector id - -ceh_20: - - move.w 6(%sp),4(%sp) - move.w 8(%sp),6(%sp) - move.w 10(%sp),8(%sp) - move.w %d0,10(%sp) | put the format/vector id - move.l (%sp)+,%d0 - - | - | Save all the registers, pass control to a dump trace routine - | - - movem.l %d0-%d7/%a0-%a7,%sp@- - - | - | check to see if ROM is mapped to zero - | - - move.l #trace_exception,%d1 | get the linked address - and.l #(ROM_SIZE - 1),%d1 | obtain the offset into the ROM - lea.l %pc@(0),%a0 | were are we currently - move.l %a0,%d0 | need to use a data register - and.l #~(ROM_SIZE - 1),%d0 | keep the top part of the address - or.l %d1,%d0 | apply it to the trace exception offset - move.l %d0,%a0 | need an address register for jumping - jsr %a0@(0) - -ceh_30: - jmp ceh_30 -| -| The RAM based vector table -| - - .sect .vtable - - .global vector_table - -vector_table: - .space (256 * 4),0 - -| -| Initialised data -| - - .sect .data - - .global start_frame - -start_frame: - .space 4,0 - - .global stack_start - -stack_start: - .space 4,0 - -| -| Uninitialised data -| - - .sect .bss - - .global environ - .align 2 - -environ: - .long 0 - - .global heap_size - .set heap_size,0x2000 - - .global stack_size - .set stack_size,0x1000 - - diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/cpuboot.c b/c/src/lib/libbsp/m68k/ods68302/startup/cpuboot.c deleted file mode 100644 index fd8a4146de..0000000000 --- a/c/src/lib/libbsp/m68k/ods68302/startup/cpuboot.c +++ /dev/null @@ -1,133 +0,0 @@ -/*****************************************************************************/ -/* - Boot the CPU. - - Occurs in 3 phases for a 68302. - - Phase 1. - - Called as soon as able after reset. The BAR has been programed, and - a small stack exists in the DPRAM. All interrupts are masked, and - the processor is running in supervisor mode. No other hardware or - chip selects are active. - - This phase programs the chip select registers, the parallel ports - are set into default configurations, and basic registers cleared or - reset. The leds are programmed to show the end of phase 1. - - Phase 2. - - This is a piece of code which is copied to DPRAM and executed. It - should not do any more thann is currently present. The return to ROM - is managed by modifing the return address. Again leds show the status. - - Phase 3. - - This code executes with a valid C environment. That is the data - section has been intialised and the bss section set to 0. This phase - performs any special card initialisation and then calls boot card. - - $Id$ - -*/ -/*****************************************************************************/ - -#include <bsp.h> -#include <m68302.h> -#include <debugport.h> -#include <crc.h> - -/* - Open the address, reset all registers - */ - -void boot_phase_1() -{ - M302_SCR = SCR_DEFAULT; - - WRITE_OR(CSEL_ROM, ROM_SIZE, ROM_WAIT_STATES, OR_MASK_RW, OR_MASK_FC); - WRITE_BR(CSEL_ROM, RAM_BASE, BR_READ_ONLY, BR_FC_NULL, BR_ENABLED); - WRITE_OR(CSEL_RAM, RAM_SIZE, RAM_WAIT_STATES, OR_MASK_RW, OR_MASK_FC); - WRITE_BR(CSEL_RAM, ROM_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED); - -#if defined(CSEL_1) - WRITE_OR(CSEL_1, CSEL_1_SIZE, CSEL_1_WAIT_STATES, OR_MASK_RW, OR_MASK_FC); - WRITE_BR(CSEL_1, CSEL_1_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED); -#endif - -#if defined(CSEL_2) - WRITE_OR(CSEL_2, CSEL_2_SIZE, CSEL_2_WAIT_STATES, OR_MASK_RW, OR_MASK_FC); - WRITE_BR(CSEL_2, CSEL_2_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED); -#endif - - m302.reg.gimr = m302.reg.ipr = m302.reg.imr = m302.reg.isr = 0; - - m302.reg.simode = 0; - - m302.reg.pacnt = CARD_PA_CONFIGURATION; - m302.reg.paddr = CARD_PA_DEFAULT_DIRECTIONS; - m302.reg.padat = CARD_PA_DEFAULT_DATA; - - m302.reg.pbcnt = CARD_PB_CONFIGURATION; - m302.reg.pbddr = CARD_PB_DEFAULT_DIRECTIONS; - m302.reg.pbdat = CARD_PB_DEFAULT_DATA; - - m302.reg.wrr = WATCHDOG_TIMEOUT_PERIOD | WATCHDOG_ENABLE; - -#if defined(LED_CONTROL) - LED_CONTROL(LED_1_RED, LED_2_OFF, LED_3_OFF, LED_4_OFF, - LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF); -#endif -} - -/* - Swap the chip select mapping for ROM and RAM - */ - -void boot_phase_2(void) -{ - rtems_unsigned32 stack; - -#if defined(LED_CONTROL) - LED_CONTROL(LED_1_RED, LED_2_RED, LED_3_OFF, LED_4_OFF, - LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF); -#endif - - WRITE_BR(CSEL_ROM, ROM_BASE, BR_READ_ONLY, BR_FC_NULL, BR_ENABLED); - WRITE_BR(CSEL_RAM, RAM_BASE, BR_READ_WRITE, BR_FC_NULL, BR_ENABLED); - -#if defined(LED_CONTROL) - LED_CONTROL(LED_1_GREEN, LED_2_RED, LED_3_OFF, LED_4_OFF, - LED_5_OFF, LED_6_OFF, LED_7_OFF, LED_8_OFF); -#endif - - /* seems to want 2, looked at assember code output */ - *(&stack + 2) |= ROM_BASE; -} - -/* - Any pre-main initialisation, the C environment is setup, how-ever C++ - static constructors have not been called, and RTEMS is not initialised. - */ - -void boot_card(); -void set_debug_traps(); -void breakpoint(); - -void boot_phase_3(void) -{ - if (GDB_RUN_MONITOR()) - { - set_debug_traps(); - breakpoint(); - } - - debug_port_banner(); - - /* FIXME : add RAM and ROM checks */ - - /* boot the bsp, what ever this means */ - boot_card(); - - WATCHDOG_TRIGGER(); -} diff --git a/c/src/lib/libbsp/mips/README b/c/src/lib/libbsp/mips/README deleted file mode 100644 index 7f16e33d39..0000000000 --- a/c/src/lib/libbsp/mips/README +++ /dev/null @@ -1,7 +0,0 @@ -# -# $Id$ -# - -The MIPS bsp are now called p4600 and p4650, referring to which cpu they use. -The same bsp sub-directory can be used, the cpu is selected by the bsp -specific makefiles (p4600.cfg and p4650.cfg). diff --git a/c/src/lib/libbsp/mips/p4000/README b/c/src/lib/libbsp/mips/p4000/README deleted file mode 100644 index 361366d01d..0000000000 --- a/c/src/lib/libbsp/mips/p4000/README +++ /dev/null @@ -1,47 +0,0 @@ -# -# $Id$ -# -# @(#)README 08/20/96 1.2 -# - -BSP NAME: p4000 -BOARD: Algorithmics P4000 SBC -BUS: N/A -CPU FAMILY: mips -CPU: IDT 4650 -COPROCESSORS: N/A -MODE: 32 bit mode - -DEBUG MONITOR: IDT/SIM - -PERIPHERALS -=========== -TIMERS: 4650 internal - RESOLUTION: half of internal clock frequency -SERIAL PORTS: IDT/SIM controlled -REAL-TIME CLOCK: none -DMA: none -VIDEO: none -SCSI: none -NETWORKING: none - -DRIVER INFORMATION -================== -CLOCK DRIVER: 4650 internal -IOSUPP DRIVER: N/A -SHMSUPP: N/A -TIMER DRIVER: 4650 internal -TTY DRIVER: uses IDT/SIM - -STDIO -===== -PORT: Console port 0 -ELECTRICAL: RS-232 -BAUD: 9600 -BITS PER CHARACTER: 8 -PARITY: None -STOP BITS: 1 - -NOTES -===== - diff --git a/c/src/lib/libbsp/mips/p4000/bsp_specs b/c/src/lib/libbsp/mips/p4000/bsp_specs deleted file mode 100644 index 3f488f47b6..0000000000 --- a/c/src/lib/libbsp/mips/p4000/bsp_specs +++ /dev/null @@ -1,23 +0,0 @@ -%rename cpp old_cpp -%rename lib old_lib -%rename endfile old_endfile -%rename startfile old_startfile -%rename link old_link - -*cpp: -%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded) - -*lib: -%{!qrtems: %(old_lib)} %{qrtems: --start-group \ -%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \ --lc -lgcc --end-group \ -%{!qnolinkcmds: -T linkcmds%s}} - -*startfile: -%{!qrtems: %(old_startfile)} %{qrtems: \ -%{!qrtems_debug: idt_csu.o%s} \ -%{qrtems_debug: idt_csu_g.o%s}} - -*link: -%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start} - diff --git a/c/src/lib/libbsp/mips/p4000/console/console.c b/c/src/lib/libbsp/mips/p4000/console/console.c deleted file mode 100644 index c862c91cfa..0000000000 --- a/c/src/lib/libbsp/mips/p4000/console/console.c +++ /dev/null @@ -1,275 +0,0 @@ -/* - * This file contains the IDT 4650 console IO package. - * - * Author: Craig Lebakken <craigl@transition.com> - * - * COPYRIGHT (c) 1996 by Transition Networks Inc. - * - * To anyone who acknowledges that this file is provided "AS IS" - * without any express or implied warranty: - * permission to use, copy, modify, and distribute this file - * for any purpose is hereby granted without fee, provided that - * the above copyright notice and this notice appears in all - * copies, and that the name of Transition Networks not be used in - * advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * Transition Networks makes no representations about the suitability - * of this software for any purpose. - * - * Derived from c/src/lib/libbsp/no_cpu/no_bsp/console/console.c: - * - * COPYRIGHT (c) 1989-1998. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -/* - * Rather than deleting this, it is commented out to (hopefully) help - * the submitter send updates. - * - * static char _sccsid[] = "@(#)console.c 08/20/96 1.6\n"; - */ - - - -#include <bsp.h> -#include <rtems/libio.h> -#include <ctype.h> - -char idtsim_getchar( void ); -void idtsim_putchar( char c ); -void mips_leddisplay( char a, char b, char c, char d ); - - -/* console_initialize - * - * This routine initializes the console IO driver. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: - */ - -rtems_device_driver console_initialize( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *arg -) -{ - rtems_status_code status; - - status = rtems_io_register_name( - "/dev/console", - major, - (rtems_device_minor_number) 0 - ); - - if (status != RTEMS_SUCCESSFUL) - rtems_fatal_error_occurred(status); - - return RTEMS_SUCCESSFUL; -} - - -/* is_character_ready - * - * This routine returns TRUE if a character is available. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: - */ - -rtems_boolean is_character_ready( - char *ch -) -{ - *ch = '\0'; /* return NULL for no particular reason */ - return(TRUE); -} - -/* inbyte - * - * This routine reads a character from the SOURCE. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: - * character read from SOURCE - */ - -char inbyte( void ) -{ - /* - * If polling, wait until a character is available. - */ - - return idtsim_getchar(); -} - -/* outbyte - * - * This routine transmits a character out the SOURCE. It may support - * XON/XOFF flow control. - * - * Input parameters: - * ch - character to be transmitted - * - * Output parameters: NONE - */ - -void outbyte( - char ch -) -{ -#define NUM_LEDS 4 - static unsigned int cur_led = 0; - static unsigned char led_chars[NUM_LEDS]; - - /* - * If polling, wait for the transmitter to be ready. - * Check for flow control requests and process. - * Then output the character. - */ - - idtsim_putchar( ch ); - - /* print out first four alpha numeric characters in a line */ - if ( ch == '\n' ) - { - mips_leddisplay( led_chars[0], led_chars[1], led_chars[2], led_chars[3] ); - cur_led = 0; - } - else if ( isalnum( (unsigned char) ch ) && cur_led < NUM_LEDS ) - { - led_chars[cur_led++] = ch; - } - -} - - -#if 0 -static int console_fd = -1; -#endif - -/* - * Open entry point - */ - -rtems_device_driver console_open( - rtems_device_major_number major, - rtems_device_minor_number minor, - void * arg -) -{ -#if 0 - int console_fd = open("tty0", 2); /* open for read/write */ -#endif - return RTEMS_SUCCESSFUL; -} - -/* - * Close entry point - */ - -rtems_device_driver console_close( - rtems_device_major_number major, - rtems_device_minor_number minor, - void * arg -) -{ -#if 0 - if ( console_fd ) - close( console_fd ); -#endif - return RTEMS_SUCCESSFUL; -} - -/* - * read bytes from the serial port. We only have stdin. - */ - -rtems_device_driver console_read( - rtems_device_major_number major, - rtems_device_minor_number minor, - void * arg -) -{ - rtems_libio_rw_args_t *rw_args; - char *buffer; - int maximum; - int count = 0; - - rw_args = (rtems_libio_rw_args_t *) arg; - - buffer = rw_args->buffer; - maximum = rw_args->count; - - for (count = 0; count < maximum; count++) { - buffer[ count ] = inbyte(); - if (buffer[ count ] == '\n' || buffer[ count ] == '\r') { - buffer[ count++ ] = '\n'; - break; - } - } - - rw_args->bytes_moved = count; - return (count >= 0) ? RTEMS_SUCCESSFUL : RTEMS_UNSATISFIED; -} - -/* - * write bytes to the serial port. Stdout and stderr are the same. - */ - -rtems_device_driver console_write( - rtems_device_major_number major, - rtems_device_minor_number minor, - void * arg -) -{ - int count; - int maximum; - rtems_libio_rw_args_t *rw_args; - char *buffer; - - rw_args = (rtems_libio_rw_args_t *) arg; - - buffer = rw_args->buffer; - maximum = rw_args->count; - - for (count = 0; count < maximum; count++) { - if ( buffer[ count ] == '\n') { - outbyte('\r'); - } - outbyte( buffer[ count ] ); - } - - rw_args->bytes_moved = maximum; - return 0; -} - -/* - * IO Control entry point - */ - -rtems_device_driver console_control( - rtems_device_major_number major, - rtems_device_minor_number minor, - void * arg -) -{ - return RTEMS_SUCCESSFUL; -} diff --git a/c/src/lib/libbsp/mips/p4000/console/led.S b/c/src/lib/libbsp/mips/p4000/console/led.S deleted file mode 100644 index e62b82e041..0000000000 --- a/c/src/lib/libbsp/mips/p4000/console/led.S +++ /dev/null @@ -1,23 +0,0 @@ -/* - * $Id$ - */ - -#include <rtems/score/iregdef.h> -#include <rtems/score/idtmon.h> -#include <rtems/score/idtcpu.h> - - -FRAME(mips_leddisplay,sp,0,ra) - j ra - nop -ENDFRAME(mips_leddisplay) - -FRAME(sbddisplay,sp,0,ra) - j ra -ENDFRAME(sbddisplay) - - -FRAME(sbdblank,sp,0,ra) - j ra -ENDFRAME(sbdblank) - diff --git a/c/src/lib/libbsp/mips/p4000/include/bsp.h b/c/src/lib/libbsp/mips/p4000/include/bsp.h deleted file mode 100644 index da700b8dba..0000000000 --- a/c/src/lib/libbsp/mips/p4000/include/bsp.h +++ /dev/null @@ -1,118 +0,0 @@ -/* bsp.h - * - * This include file contains all board IO definitions. - * - * XXX : put yours in here - * - * COPYRIGHT (c) 1989-1998. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ -/* @(#)bsp.h 03/15/96 1.1 */ - -#ifndef __P4000_BSP_h -#define __P4000_BSP_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include <rtems.h> -#include <console.h> -#include <clockdrv.h> - -extern void WriteDisplay( char * string ); - -/* - * Define the time limits for RTEMS Test Suite test durations. - * Long test and short test duration limits are provided. These - * values are in seconds and need to be converted to ticks for the - * application. - * - */ - -#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */ -#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */ - -/* - * Stuff for Time Test 27 - */ - -#define MUST_WAIT_FOR_INTERRUPT 0 - -#define Install_tm27_vector( handler ) set_vector( (handler), 0, 1 ) - -#define Cause_tm27_intr() - -#define Clear_tm27_intr() - -#define Lower_tm27_intr() - -extern unsigned32 mips_get_timer( void ); - -#define CPU_CLOCK_RATE_MHZ (50) -#define CLOCKS_PER_MICROSECOND ( CPU_CLOCK_RATE_MHZ ) /* equivalent to CPU clock speed in MHz */ - -/* - * Simple spin delay in microsecond units for device drivers. - * This is very dependent on the clock speed of the target. - * - * NOTE: This macro generates a warning like "integer constant out - * of range" which is safe to ignore. In 64 bit mode, unsigned32 - * types are actually 64 bits long so that comparisons between - * unsigned32 types and pointers are valid. The warning is caused - * by code in the delay macro that is necessary for 64 bit mode. - */ - -#define delay( microseconds ) \ - { \ - unsigned32 _end_clock = mips_get_timer() + microseconds * CLOCKS_PER_MICROSECOND; \ - _end_clock %= 0x100000000; /* make sure result is 32 bits */ \ - \ - /* handle timer overflow, if necessary */ \ - while ( _end_clock < mips_get_timer() ); \ - \ - while ( _end_clock > mips_get_timer() ); \ - } - -/* Constants */ - -#define RAM_START 0 -#define RAM_END 0x100000 - -/* miscellaneous stuff assumed to exist */ - -extern rtems_configuration_table BSP_Configuration; - -/* - * Device Driver Table Entries - */ - -/* - * NOTE: Use the standard Console driver entry - */ - -/* - * NOTE: Use the standard Clock driver entry - */ - -/* miscellaneous stuff assumed to exist */ - -mips_isr_entry set_vector( /* returns old vector */ - rtems_isr_entry handler, /* isr routine */ - rtems_vector_number vector, /* vector number */ - int type /* RTEMS or RAW intr */ -); - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/c/src/lib/libbsp/mips/p4000/include/coverhd.h b/c/src/lib/libbsp/mips/p4000/include/coverhd.h deleted file mode 100644 index aca390463b..0000000000 --- a/c/src/lib/libbsp/mips/p4000/include/coverhd.h +++ /dev/null @@ -1,116 +0,0 @@ -/* coverhd.h - * - * This include file has defines to represent the overhead associated - * with calling a particular directive from C. These are used in the - * Timing Test Suite to ignore the overhead required to pass arguments - * to directives. On some CPUs and/or target boards, this overhead - * is significant and makes it difficult to distinguish internal - * RTEMS execution time from that used to call the directive. - * This file should be updated after running the C overhead timing - * test. Once this update has been performed, the RTEMS Time Test - * Suite should be rebuilt to account for these overhead times in the - * timing results. - * - * NOTE: If these are all zero, then the times reported include - * all calling overhead including passing of arguments. - * - * COPYRIGHT (c) 1989-1998. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ -/* @(#)coverhd.h 04/08/96 1.3 */ - -#ifndef __COVERHD_h -#define __COVERHD_h - -#ifdef __cplusplus -extern "C" { -#endif - -#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 5 -#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 4 -#define CALLING_OVERHEAD_TASK_CREATE 6 -#define CALLING_OVERHEAD_TASK_IDENT 4 -#define CALLING_OVERHEAD_TASK_START 5 -#define CALLING_OVERHEAD_TASK_RESTART 4 -#define CALLING_OVERHEAD_TASK_DELETE 4 -#define CALLING_OVERHEAD_TASK_SUSPEND 4 -#define CALLING_OVERHEAD_TASK_RESUME 4 -#define CALLING_OVERHEAD_TASK_SET_PRIORITY 5 -#define CALLING_OVERHEAD_TASK_MODE 4 -#define CALLING_OVERHEAD_TASK_GET_NOTE 5 -#define CALLING_OVERHEAD_TASK_SET_NOTE 5 -#define CALLING_OVERHEAD_TASK_WAKE_WHEN 9 -#define CALLING_OVERHEAD_TASK_WAKE_AFTER 4 -#define CALLING_OVERHEAD_INTERRUPT_CATCH 5 -#define CALLING_OVERHEAD_CLOCK_GET 9 -#define CALLING_OVERHEAD_CLOCK_SET 8 -#define CALLING_OVERHEAD_CLOCK_TICK 3 - -#define CALLING_OVERHEAD_TIMER_CREATE 4 -#define CALLING_OVERHEAD_TIMER_IDENT 4 -#define CALLING_OVERHEAD_TIMER_DELETE 4 -#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 6 -#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 10 -#define CALLING_OVERHEAD_TIMER_RESET 4 -#define CALLING_OVERHEAD_TIMER_CANCEL 4 -#define CALLING_OVERHEAD_SEMAPHORE_CREATE 5 -#define CALLING_OVERHEAD_SEMAPHORE_IDENT 4 -#define CALLING_OVERHEAD_SEMAPHORE_DELETE 4 -#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 5 -#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 4 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 5 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 4 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 4 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 4 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 4 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 5 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 5 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 4 - -#define CALLING_OVERHEAD_EVENT_SEND 4 -#define CALLING_OVERHEAD_EVENT_RECEIVE 5 -#define CALLING_OVERHEAD_SIGNAL_CATCH 5 -#define CALLING_OVERHEAD_SIGNAL_SEND 4 -#define CALLING_OVERHEAD_PARTITION_CREATE 6 -#define CALLING_OVERHEAD_PARTITION_IDENT 4 -#define CALLING_OVERHEAD_PARTITION_DELETE 4 -#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 4 -#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 4 -#define CALLING_OVERHEAD_REGION_CREATE 6 -#define CALLING_OVERHEAD_REGION_IDENT 4 -#define CALLING_OVERHEAD_REGION_DELETE 4 -#define CALLING_OVERHEAD_REGION_GET_SEGMENT 5 -#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 4 -#define CALLING_OVERHEAD_PORT_CREATE 6 -#define CALLING_OVERHEAD_PORT_IDENT 4 -#define CALLING_OVERHEAD_PORT_DELETE 4 -#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 4 -#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 4 - -#define CALLING_OVERHEAD_IO_INITIALIZE 5 -#define CALLING_OVERHEAD_IO_OPEN 5 -#define CALLING_OVERHEAD_IO_CLOSE 5 -#define CALLING_OVERHEAD_IO_READ 5 -#define CALLING_OVERHEAD_IO_WRITE 5 -#define CALLING_OVERHEAD_IO_CONTROL 5 -#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 4 -#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 4 -#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 4 -#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 4 -#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 4 -#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 4 -#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 3 - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/c/src/lib/libbsp/mips/p4000/liblnk/lnklib.S b/c/src/lib/libbsp/mips/p4000/liblnk/lnklib.S deleted file mode 100644 index ae2509ce3c..0000000000 --- a/c/src/lib/libbsp/mips/p4000/liblnk/lnklib.S +++ /dev/null @@ -1,62 +0,0 @@ -/* - * $Id$ - */ - -#include <rtems/score/iregdef.h> -#include <rtems/score/idtcpu.h> - -#define FRAME(name,frm_reg,offset,ret_reg) \ - .globl name; \ - .ent name; \ -name:; \ - .frame frm_reg,offset,ret_reg - -#define ENDFRAME(name) \ - .end name - -#define PROM_LINK(name,entry) \ - .globl name; \ - .ent name; \ -name: la $2,+entry; \ - j $2; \ - .end name - -#define PROM_ENTRY(x) (0xbfc00000+((x)*8)) - -#define PROM_RESET PROM_ENTRY(0) -#define PROM_NOT_IMP PROM_ENTRY(1) -#define PROM_RESTART PROM_ENTRY(2) -#define PROM_REINIT PROM_ENTRY(3) -#define PROM_GETCHAR PROM_ENTRY(11) -#define PROM_PUTCHAR PROM_ENTRY(12) -#define PROM_SHOWCHAR PROM_ENTRY(13) -#define PROM_PRINTF PROM_ENTRY(16) -#define PROM_RETURN PROM_ENTRY(17) - -#define PROM_RGETS PROM_ENTRY(25) -#define PROM_FLUSHCACHE PROM_ENTRY(28) -#define PROM_CLEARCACHE PROM_ENTRY(29) -#define PROM_SETJMP PROM_ENTRY(30) -#define PROM_LONGJMP PROM_ENTRY(31) - - .text - -PROM_LINK(idtsim_putchar, PROM_PUTCHAR) -PROM_LINK(idtsim_getchar, PROM_GETCHAR) -PROM_LINK(idtsim_showchar, PROM_SHOWCHAR) -PROM_LINK(idtsim__exit, PROM_RETURN) -PROM_LINK(idtsim_reinit, PROM_REINIT) -PROM_LINK(idtsim_restart, PROM_RESTART) -PROM_LINK(idtsim_reset, PROM_RESET) -PROM_LINK(idtsim_promexit, PROM_RETURN) -PROM_LINK(idtsim_setjmp, PROM_SETJMP) -PROM_LINK(idtsim_longjmp, PROM_LONGJMP) - -FRAME(idtsim_init_sbrk,sp,0,ra) - j ra -ENDFRAME(idtsim_init_sbrk) - -FRAME(idtsim_init_file,sp,0,ra) - j ra -ENDFRAME(idtsim_init_file) - diff --git a/c/src/lib/libbsp/mips/p4000/start/start.S b/c/src/lib/libbsp/mips/p4000/start/start.S deleted file mode 100644 index 8dc31c8999..0000000000 --- a/c/src/lib/libbsp/mips/p4000/start/start.S +++ /dev/null @@ -1,299 +0,0 @@ -/* - -Based upon IDT provided code with the following release: - -This source code has been made available to you by IDT on an AS-IS -basis. Anyone receiving this source is licensed under IDT copyrights -to use it in any way he or she deems fit, including copying it, -modifying it, compiling it, and redistributing it either with or -without modifications. No license under IDT patents or patent -applications is to be implied by the copyright license. - -Any user of this software should understand that IDT cannot provide -technical support for this software and will not be responsible for -any consequences resulting from the use of this software. - -Any person who transfers this source code or any derivative work must -include the IDT copyright notice, this paragraph, and the preceeding -two paragraphs in the transferred software. - -COPYRIGHT IDT CORPORATION 1996 -LICENSED MATERIAL - PROGRAM PROPERTY OF IDT - - $Id$ -*/ - -/************************************************************************* -** -** Copyright 1991-95 Integrated Device Technology, Inc. -** All Rights Reserved -** -** idt_csu.S -- IDT stand alone startup code -** -**************************************************************************/ -#include <rtems/score/iregdef.h> -#include <rtems/score/idtcpu.h> -#include <rtems/score/idtmon.h> - - -.extern _fbss,4 /* this is defined by the linker */ -.extern end,4 /* this is defined by the linker */ - -.lcomm sim_mem_cfg_struct,12 - - .text - - -#define TMP_STKSIZE 1024 - -/************************************************************************** -** -** start - Typicl standalone start up code required for R3000/R4000 -** -** -** 1) Initialize the STATUS Register -** a) Clear parity error bit -** b) Set co_processor 1 usable bit ON -** c) Clear all IntMask Enables -** d) Set kernel/disabled mode -** 2) Initialize Cause Register -** a) clear software interrupt bits -** 3) Determine FPU installed or not -** if not, clear CoProcessor 1 usable bit -** 4) Clear bss area -** 5) MUST allocate temporary stack until memory size determined -** It MUST be uncached to prevent overwriting when caches are cleared -** 6) Install exception handlers -** 7) Determine memory and cache sizes -** 8) Establish permanent stack (cached or uncached as defined by bss) -** 9) Flush Instruction and Data caches -** 10) If there is a Translation Lookaside Buffer, Clear the TLB -** 11) Execute initialization code if the IDT/c library is to be used -** -** 12) Jump to user's "main()" -** 13) Jump to promexit -** -** IDT/C 5.x defines _R3000, IDT/C 6.x defines _R4000 internally. -** This is used to mark code specific to R3xxx or R4xxx processors. -** IDT/C 6.x defines __mips to be the ISA level for which we're -** generating code. This is used to make sure the stack etc. is -** double word aligned, when using -mips3 (default) or -mips2, -** when compiling with IDT/C6.x -** -***************************************************************************/ - -FRAME(start,sp,0,ra) - - .set noreorder -#ifdef _R3000 - li v0,SR_PE|SR_CU1 /* reset parity error and set */ - /* cp1 usable */ -#endif -#ifdef _R4000 -#if __mips==3 || defined(R4650) - li v0,SR_CU1|SR_DE|SR_FR /* initally clear ERL, enable FPA 64bit regs*/ - /* 4650: Need fr to be set anyway */ -#else - li v0,SR_CU1|SR_DE /* initally clear ERL, enable FPA 32bit regs*/ -#endif mips3 -#endif - - mtc0 v0,C0_SR /* clr IntMsks/ kernel/disabled mode */ - nop - mtc0 zero,C0_CAUSE /* clear software interrupts */ - nop - -#ifdef _R4000 - li v0,CFG_C_NONCOHERENT # initialise default cache mode - mtc0 v0,C0_CONFIG -#endif - -/* -** check to see if an fpu is really plugged in -*/ - li t3,0xaaaa5555 /* put a's and 5's in t3 */ - mtc1 t3,fp0 /* try to write them into fp0 */ - mtc1 zero,fp1 /* try to write zero in fp */ - mfc1 t0,fp0 - mfc1 t1,fp1 - nop - bne t0,t3,1f /* branch if no match */ - nop - bne t1,zero,1f /* double check for positive id */ - nop - /* We have a FPU. clear fcsr */ - ctc1 zero, fcr31 - j 2f /* status register already correct */ - nop -1: -#ifdef _R3000 - li v0, SR_PE /* reset parity error/NO cp1 usable */ -#endif - -#ifdef _R4000 - li v0,SR_DE /* clear ERL and disable FPA */ -#endif - - mtc0 v0, C0_SR /* reset status register */ -2: - la gp, _gp - - la v0,_fbss /* clear bss before using it */ - la v1,end /* end of bss */ -3: sw zero,0(v0) - bltu v0,v1,3b - add v0,4 - - -/************************************************************************ -** -** Temporary Stack - needed to handle stack saves until -** memory size is determined and permanent stack set -** -** MUST be uncached to avoid confusion at cache -** switching during memory sizing -** -*************************************************************************/ -#if __mips==3 - /* For MIPS 3, we need to be sure that the stack is aligned on a - * double word boundary. - */ - andi t0, v0, 0x7 - beqz t0, 11f /* Last three bits Zero, already aligned */ - nop - add v0, 4 -11: -#endif - - or v0, K1BASE /* switch to uncached */ - add v1, v0, TMP_STKSIZE /* end of bss + length of tmp stack */ - sub v1, v1, (4*4) /* overhead */ - move sp, v1 /* set sp to top of stack */ -4: sw zero, 0(v0) - bltu v0, v1, 4b /* clear out temp stack */ - add v0, 4 - - jal init_exc_vecs /* install exception handlers */ - nop /* MUST do before memory probes */ - - la v0, 5f - li v1, K1BASE /* force into uncached space */ - or v0, v1 /* during memory/cache probes */ - j v0 - nop -5: - la a0, sim_mem_cfg_struct - jal sim_mem_cfg /* Make SIM call to get mem size */ - nop - la a0, sim_mem_cfg_struct - lw a0, 0(a0) /* Get memory size from struct */ -#ifdef _R3000 - jal config_Icache - nop - jal config_Dcache /* determine size of D & I caches */ - nop -#endif -#ifdef _R4000 - jal config_cache /* determine size of D & I caches */ - nop -#endif - - move v0, a0 /* mem_size */ - -#if __mips==3 - /* For MIPS 3, we need to be sure that the stack (and hence v0 - * here) is aligned on a double word boundary. - */ - andi t0, v0, 0x7 - beqz t0, 12f /* Last three bits Zero, already aligned */ - nop - subu v0, 4 /* mem_size was not aligned on doubleword bdry????*/ -12: -#endif - - - -/************************************************************************** -** -** Permanent Stack - now know top of memory, put permanent stack there -** -***************************************************************************/ - - la t2, _fbss /* cache mode as linked */ - and t2, 0xF0000000 /* isolate segment */ - la t1, 6f - j t1 /* back to original cache mode */ - nop -6: - or v0, t2 /* stack back to original cache mode */ - addiu v0,v0,-16 /* overhead */ - move sp, v0 /* now replace count w top of memory */ - move v1, v0 - subu v1, P_STACKSIZE /* clear requested stack size */ - -7: sw zero, 0(v1) /* clear P_STACKSIZE stack */ - bltu v1,v0,7b - add v1, 4 - .set reorder - -#ifdef _R3000 - jal flush_Icache - jal flush_Dcache /* flush Data & Instruction caches */ -#endif -#ifdef _R4000 - jal flush_cache_nowrite /* flush Data & Instruction caches */ -#endif - - - -/************************************************************************** -** -** If this chip supports a Translation Lookaside Buffer, clear it -** -***************************************************************************/ - - .set noreorder - mfc0 t1, C0_SR /* look at Status Register */ - nop - .set reorder -#ifdef _R3000 - li t2, SR_TS /* TLB Shutdown bit */ - and t1,t2 /* TLB Shutdown if 1 */ - bnez t1, 8f /* skip clearing if no TLB */ -#endif - -#ifndef R4650 - jal init_tlb /* clear the tlb */ -#endif - - -/************************************************************************ -** -** Initialization required if using IDT/c or libc.a, standard C Lib -** -** can SKIP if not necessary for application -** -************************************************************************/ -8: - - jal idtsim_init_sbrk - jal idtsim_init_file -/*********************** END I/O initialization **********************/ - - - jal main - - jal idtsim_promexit - -ENDFRAME(start) - - - .globl sim_mem_cfg -sim_mem_cfg: - .set noat - .set noreorder - li AT, (0xbfc00000+((55)*8)) - jr AT - nop - .set at - .set reorder diff --git a/c/src/lib/libbsp/mips/p4000/startup/bspclean.c b/c/src/lib/libbsp/mips/p4000/startup/bspclean.c deleted file mode 100644 index 5382c8491c..0000000000 --- a/c/src/lib/libbsp/mips/p4000/startup/bspclean.c +++ /dev/null @@ -1,38 +0,0 @@ -/* bsp_cleanup() - * - * This routine normally is part of start.s and usually returns - * control to a monitor. - * - * INPUT: NONE - * - * OUTPUT: NONE - * - * COPYRIGHT (c) 1989-1998. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* - * Rather than deleting this, it is commented out to (hopefully) help - * the submitter send updates. - * - * static char _sccsid[] = "@(#)bspclean.c 03/15/96 1.1\n"; - */ - - - -#include <rtems.h> -#include <bsp.h> - -void idtsim__exit(); - -void bsp_cleanup( void ) -{ - idtsim__exit(); -} diff --git a/c/src/lib/libbsp/mips/p4000/startup/bspstart.c b/c/src/lib/libbsp/mips/p4000/startup/bspstart.c deleted file mode 100644 index bdd0c3074d..0000000000 --- a/c/src/lib/libbsp/mips/p4000/startup/bspstart.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - * This routine starts the application. It includes application, - * board, and monitor specific initialization and configuration. - * The generic CPU dependent initialization has been performed - * before this routine is invoked. - * - * COPYRIGHT (c) 1989-1998. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* - * Rather than deleting this, it is commented out to (hopefully) help - * the submitter send updates. - * - * static char _sccsid[] = "@(#)bspstart.c 06/11/96 1.2\n"; - */ - - -#include <bsp.h> -#include <rtems/libio.h> - -#include <libcsupport.h> - -#include <string.h> - -/* - * The original table from the application and our copy of it with - * some changes. - */ - -extern rtems_configuration_table Configuration; - -rtems_configuration_table BSP_Configuration; - -rtems_cpu_table Cpu_table; - -char *rtems_progname; - -/* - * Use the shared implementations of the following routines - */ - -void bsp_postdriver_hook(void); -void bsp_libc_init( void *, unsigned32, int ); - -/* - * Function: bsp_pretasking_hook - * Created: 95/03/10 - * - * Description: - * BSP pretasking hook. Called just before drivers are initialized. - * Used to setup libc and install any BSP extensions. - * - * NOTES: - * Must not use libc (to do io) from here, since drivers are - * not yet initialized. - * - */ - -#define LIBC_HEAP_SIZE (64 * 1024) - -void bsp_pretasking_hook(void) -{ - extern int end; - rtems_unsigned32 heap_start; - - heap_start = (rtems_unsigned32) &end; - if (heap_start & (CPU_ALIGNMENT-1)) - heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1); - - bsp_libc_init((void *) heap_start, LIBC_HEAP_SIZE, 0); - -#ifdef RTEMS_DEBUG - rtems_debug_enable( RTEMS_DEBUG_ALL_MASK ); -#endif -} - -extern int end; /* defined by linker */ - -/* - * bsp_start - * - * This routine does the bulk of the system initialization. - */ - -void bsp_start( void ) -{ - /* - * Allocate the memory for the RTEMS Work Space. This can come from - * a variety of places: hard coded address, malloc'ed from outside - * RTEMS world (e.g. simulator or primitive memory manager), or (as - * typically done by stock BSPs) by subtracting the required amount - * of work space from the last physical address on the CPU board. - */ - - /* - * Need to "allocate" the memory for the RTEMS Workspace and - * tell the RTEMS configuration where it is. This memory is - * not malloc'ed. It is just "pulled from the air". - */ - - BSP_Configuration.work_space_start = - (void *)((unsigned64)((&end) + LIBC_HEAP_SIZE + 0x2000) & ~0x7); - - /* - * initialize the CPU table for this BSP - */ - - Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - Cpu_table.postdriver_hook = bsp_postdriver_hook; - Cpu_table.interrupt_stack_size = 4096; -} diff --git a/c/src/lib/libbsp/mips/p4000/startup/ghlinkcmds b/c/src/lib/libbsp/mips/p4000/startup/ghlinkcmds deleted file mode 100644 index 34cdbab802..0000000000 --- a/c/src/lib/libbsp/mips/p4000/startup/ghlinkcmds +++ /dev/null @@ -1,19 +0,0 @@ -# -# $Id$ -# - --map --sec -{ - .text 0x80010000 : - .data align(16) : - .rodata : - .fini : -# .sdata : - .symtab : - .strtab : - .debug : -# .sbss : - .bss align(8) : - .init 0xbfc00000 : -} diff --git a/c/src/lib/libbsp/mips/p4000/startup/idtmem.S b/c/src/lib/libbsp/mips/p4000/startup/idtmem.S deleted file mode 100644 index 70a7096877..0000000000 --- a/c/src/lib/libbsp/mips/p4000/startup/idtmem.S +++ /dev/null @@ -1,938 +0,0 @@ -/* - -Based upon IDT provided code with the following release: - -This source code has been made available to you by IDT on an AS-IS -basis. Anyone receiving this source is licensed under IDT copyrights -to use it in any way he or she deems fit, including copying it, -modifying it, compiling it, and redistributing it either with or -without modifications. No license under IDT patents or patent -applications is to be implied by the copyright license. - -Any user of this software should understand that IDT cannot provide -technical support for this software and will not be responsible for -any consequences resulting from the use of this software. - -Any person who transfers this source code or any derivative work must -include the IDT copyright notice, this paragraph, and the preceeding -two paragraphs in the transferred software. - -COPYRIGHT IDT CORPORATION 1996 -LICENSED MATERIAL - PROGRAM PROPERTY OF IDT - - $Id$ - -*/ - -/************************************************************************ -** -** idtmem.s - memory and cache functions -** -** Copyright 1991 Integrated Device Technology, Inc. -** All Rights Reserved -** -**************************************************************************/ - -/* - * 950313: Ketan fixed bugs in mfc0/mtc0 hazards, and removed hack - * to set mem_size. - */ - -#include <rtems/score/iregdef.h> -#include <rtems/score/idtcpu.h> -#include <rtems/score/idtmon.h> - - .data -mem_size: - .word 0 -dcache_size: - .word 0 -icache_size: -#if defined(CPU_R3000) - .word MINCACHE -#endif -#if defined(CPU_R4000) - .word 0 -#endif - -#if defined(CPU_R4000) - .data -scache_size: - .word 0 -icache_linesize: - .word 0 -dcache_linesize: - .word 0 -scache_linesize: - .word 0 -#endif - - - .text - -#if defined (CPU_R3000) -#define CONFIGFRM ((2*4)+4) - -/************************************************************************* -** -** Config_Dcache() -- determine size of Data cache -** -**************************************************************************/ - -FRAME(config_Dcache,sp, CONFIGFRM, ra) - .set noreorder - subu sp,CONFIGFRM - sw ra,CONFIGFRM-4(sp) /* save return address */ - sw s0,4*4(sp) /* save s0 in first regsave slot */ - mfc0 s0,C0_SR /* save SR */ - nop - mtc0 zero,C0_SR /* disable interrupts */ - .set reorder - jal _size_cache /* returns Data cache size in v0 */ - sw v0, dcache_size /* save it */ - and s0, ~SR_PE /* do not clear PE */ - .set noreorder - mtc0 s0,C0_SR /* restore SR */ - nop - .set reorder - lw s0, 4*4(sp) /* restore s0 */ - lw ra,CONFIGFRM-4(sp) /* restore ra */ - addu sp,CONFIGFRM /* pop stack */ - j ra -ENDFRAME(config_Dcache) - - -/************************************************************************* -** -** Config_Icache() -- determine size of Instruction cache -** MUST be run in uncached mode/handled in idt_csu.s -** -**************************************************************************/ - -FRAME(config_Icache,sp, CONFIGFRM, ra) - .set noreorder - subu sp,CONFIGFRM - sw ra,CONFIGFRM-4(sp) /* save return address */ - sw s0,4*4(sp) /* save s0 in first regsave slot */ - mfc0 s0,C0_SR /* save SR */ - nop - mtc0 zero, C0_SR /* disable interrupts */ - li v0,SR_SWC /* swap caches/disable ints */ - mtc0 v0,C0_SR - nop - .set reorder - jal _size_cache /* returns instruction cache size */ - .set noreorder - mtc0 zero,C0_SR /* swap back caches */ - nop - and s0,~SR_PE /* do not inadvertantly clear PE */ - mtc0 s0,C0_SR /* restore SR */ - nop - .set reorder - sw v0, icache_size /* save it AFTER caches back */ - lw s0,4*4(sp) /* restore s0 */ - lw ra,CONFIGFRM-4(sp) /* restore ra */ - addu sp,CONFIGFRM /* pop stack */ - j ra -ENDFRAME(config_Icache) - -/************************************************************************ -** -** _size_cache() -** returns cache size in v0 -** -************************************************************************/ - -FRAME(_size_cache,sp,0,ra) - .set noreorder - mfc0 t0,C0_SR /* save current sr */ - nop - and t0,~SR_PE /* do not inadvertently clear PE */ - or v0,t0,SR_ISC /* isolate cache */ - mtc0 v0,C0_SR - /* - * First check if there is a cache there at all - */ - move v0,zero - li v1,0xa5a5a5a5 /* distinctive pattern */ - sw v1,K0BASE /* try to write into cache */ - lw t1,K0BASE /* try to read from cache */ - nop - mfc0 t2,C0_SR - nop - .set reorder - and t2,SR_CM - bne t2,zero,3f /* cache miss, must be no cache */ - bne v1,t1,3f /* data not equal -> no cache */ - /* - * Clear cache size boundries to known state. - */ - li v0,MINCACHE -1: - sw zero,K0BASE(v0) - sll v0,1 - ble v0,MAXCACHE,1b - - li v0,-1 - sw v0,K0BASE(zero) /* store marker in cache */ - li v0,MINCACHE /* MIN cache size */ - -2: lw v1,K0BASE(v0) /* Look for marker */ - bne v1,zero,3f /* found marker */ - sll v0,1 /* cache size * 2 */ - ble v0,MAXCACHE,2b /* keep looking */ - move v0,zero /* must be no cache */ - .set noreorder -3: mtc0 t0,C0_SR /* restore sr */ - j ra - nop -ENDFRAME(_size_cache) - .set reorder - - -#define FLUSHFRM (2*4) - -/*************************************************************************** -** -** flush_Dcache() - flush entire Data cache -** -****************************************************************************/ -FRAME(flush_Dcache,sp,FLUSHFRM,ra) - lw t2, dcache_size - .set noreorder - mfc0 t3,C0_SR /* save SR */ - nop - and t3,~SR_PE /* dont inadvertently clear PE */ - beq t2,zero,_Dflush_done /* no D cache, get out! */ - nop - li v0, SR_ISC /* isolate cache */ - mtc0 v0, C0_SR - nop - .set reorder - li t0,K0BASE /* set loop registers */ - or t1,t0,t2 - -2: sb zero,0(t0) - sb zero,4(t0) - sb zero,8(t0) - sb zero,12(t0) - sb zero,16(t0) - sb zero,20(t0) - sb zero,24(t0) - addu t0,32 - sb zero,-4(t0) - bne t0,t1,2b - - .set noreorder -_Dflush_done: - mtc0 t3,C0_SR /* restore Status Register */ - .set reorder - j ra -ENDFRAME(flush_Dcache) - - -/*************************************************************************** -** -** flush_Icache() - flush entire Instruction cache -** -** NOTE: Icache can only be flushed/cleared when uncached -** Code forces into uncached memory regardless of calling mode -** -****************************************************************************/ -FRAME(flush_Icache,sp,FLUSHFRM,ra) - lw t1,icache_size - .set noreorder - mfc0 t3,C0_SR /* save SR */ - nop - la v0,1f - li v1,K1BASE - or v0,v1 - j v0 /* force into non-cached space */ - nop -1: - and t3,~SR_PE /* dont inadvertently clear PE */ - beq t1,zero,_Iflush_done /* no i-cache get out */ - nop - li v0,SR_ISC|SR_SWC /* disable intr, isolate and swap */ - mtc0 v0,C0_SR - li t0,K0BASE - .set reorder - or t1,t0,t1 - -1: sb zero,0(t0) - sb zero,4(t0) - sb zero,8(t0) - sb zero,12(t0) - sb zero,16(t0) - sb zero,20(t0) - sb zero,24(t0) - addu t0,32 - sb zero,-4(t0) - bne t0,t1,1b - .set noreorder -_Iflush_done: - mtc0 t3,C0_SR /* un-isolate, enable interrupts */ - .set reorder - j ra -ENDFRAME(flush_Icache) - -/************************************************************************** -** -** clear_Dcache(base_addr, byte_count) - flush portion of Data cache -** -** a0 = base address of portion to be cleared -** a1 = byte count of length -** -***************************************************************************/ -FRAME(clear_Dcache,sp,0,ra) - - lw t2, dcache_size /* Data cache size */ - .set noreorder - mfc0 t3,C0_SR /* save SR */ - nop - and t3,~SR_PE /* dont inadvertently clear PE */ - nop - nop - .set reorder - /* - * flush data cache - */ - - .set noreorder - nop - li v0,SR_ISC /* isolate data cache */ - mtc0 v0,C0_SR - .set reorder - bltu t2,a1,1f /* cache is smaller than region */ - move t2,a1 -1: addu t2,a0 /* ending address + 1 */ - move t0,a0 - -1: sb zero,0(t0) - sb zero,4(t0) - sb zero,8(t0) - sb zero,12(t0) - sb zero,16(t0) - sb zero,20(t0) - sb zero,24(t0) - addu t0,32 - sb zero,-4(t0) - bltu t0,t2,1b - - .set noreorder - mtc0 t3,C0_SR /* un-isolate, enable interrupts */ - nop - .set reorder - j ra -ENDFRAME(clear_Dcache) - - -/************************************************************************** -** -** clear_Icache(base_addr, byte_count) - flush portion of Instruction cache -** -** a0 = base address of portion to be cleared -** a1 = byte count of length -** -** NOTE: Icache can only be flushed/cleared when uncached -** Code forces into uncached memory regardless of calling mode -** -***************************************************************************/ -FRAME(clear_Icache,sp,0,ra) - - lw t1, icache_size /* Instruction cache size */ - /* - * flush text cache - */ - .set noreorder - mfc0 t3,C0_SR /* save SR */ - nop - la v0,1f - li v1,K1BASE - or v0,v1 - j v0 /* force into non-cached space */ - nop -1: - and t3,~SR_PE /* dont inadvertently clear PE */ - nop - nop - li v0,SR_ISC|SR_SWC /* disable intr, isolate and swap */ - mtc0 v0,C0_SR - .set reorder - bltu t1,a1,1f /* cache is smaller than region */ - move t1,a1 -1: addu t1,a0 /* ending address + 1 */ - move t0,a0 - - sb zero,0(t0) - sb zero,4(t0) - sb zero,8(t0) - sb zero,12(t0) - sb zero,16(t0) - sb zero,20(t0) - sb zero,24(t0) - addu t0,32 - sb zero,-4(t0) - bltu t0,t1,1b - .set noreorder - mtc0 t3,C0_SR /* un-isolate, enable interrupts */ - nop - nop - nop /* allow time for caches to swap */ - .set reorder - j ra -ENDFRAME(clear_Icache) - - -/************************************************************************** -** -** get_mem_conf - get memory configuration -** -***************************************************************************/ - - -FRAME(get_mem_conf,sp,0,ra) - - lw t6, mem_size - sw t6, 0(a0) - lw t7, icache_size - sw t7, 4(a0) - lw t8, dcache_size - sw t8, 8(a0) - j ra - -ENDFRAME(get_mem_conf) -#endif /* defined CPU_R3000 */ - -#if defined(CPU_R4000) -#define LEAF(label) FRAME(label,sp,0,ra) -#define XLEAF(label) \ - .globl label ; \ -label: -#define END(label) ENDFRAME(label) - -/* - * cacheop macro to automate cache operations - * first some helpers... - */ -#define _mincache(size, maxsize) \ - bltu size,maxsize,8f ; \ - move size,maxsize ; \ -8: - -#define _align(tmp, minaddr, maxaddr, linesize) \ - subu tmp,linesize,1 ; \ - not tmp ; \ - and minaddr,tmp ; \ - addu maxaddr,-1 ; \ - and maxaddr,tmp - -/* This is a bit of a hack really because it relies on minaddr=a0 */ -#define _doop1(op1) \ - cache op1,0(a0) - -#define _doop2(op1, op2) \ - cache op1,0(a0) ; \ - cache op2,0(a0) - -/* specials for cache initialisation */ -#define _doop1lw1(op1) \ - cache op1,0(a0) ; \ - lw zero,0(a0) ; \ - cache op1,0(a0) - -#define _doop121(op1,op2) \ - cache op1,0(a0) ; \ - nop; \ - cache op2,0(a0) ; \ - nop; \ - cache op1,0(a0) - -#define _oploopn(minaddr, maxaddr, linesize, tag, ops) \ - .set noreorder ; \ -7: _doop##tag##ops ; \ - bne minaddr,maxaddr,7b ; \ - addu minaddr,linesize ; \ - .set reorder - -/* finally the cache operation macros */ -#define icacheopn(kva, n, cache_size, cache_linesize, tag, ops) \ - _mincache(n, cache_size); \ - blez n,9f ; \ - addu n,kva ; \ - _align(t1, kva, n, cache_linesize) ; \ - _oploopn(kva, n, cache_linesize, tag, ops) ; \ -9: - -#define vcacheopn(kva, n, cache_size, cache_linesize, tag, ops) \ - blez n,9f ; \ - addu n,kva ; \ - _align(t1, kva, n, cache_linesize) ; \ - _oploopn(kva, n, cache_linesize, tag, ops) ; \ -9: - -#define icacheop(kva, n, cache_size, cache_linesize, op) \ - icacheopn(kva, n, cache_size, cache_linesize, 1, (op)) - -#define vcacheop(kva, n, cache_size, cache_linesize, op) \ - vcacheopn(kva, n, cache_size, cache_linesize, 1, (op)) - - .text - -/* - * static void _size_cache() R4000 - * - * Internal routine to determine cache sizes by looking at R4000 config - * register. Sizes are returned in registers, as follows: - * t2 icache size - * t3 dcache size - * t6 scache size - * t4 icache line size - * t5 dcache line size - * t7 scache line size - */ -LEAF(_size_cache) - mfc0 t0,C0_CONFIG - - and t1,t0,CFG_ICMASK - srl t1,CFG_ICSHIFT - li t2,0x1000 - sll t2,t1 - - and t1,t0,CFG_DCMASK - srl t1,CFG_DCSHIFT - li t3,0x1000 - sll t3,t1 - - li t4,32 - and t1,t0,CFG_IB - bnez t1,1f - li t4,16 -1: - - li t5,32 - and t1,t0,CFG_DB - bnez t1,1f - li t5,16 -1: - - move t6,zero # default to no scache - move t7,zero # - - and t1,t0,CFG_C_UNCACHED # test config register - bnez t1,1f # no scache if uncached/non-coherent - - li t6,0x100000 # assume 1Mb scache <<-NOTE - and t1,t0,CFG_SBMASK - srl t1,CFG_SBSHIFT - li t7,16 - sll t7,t1 -1: j ra -END(_size_cache) - - -/* - * void config_cache() R4000 - * - * Work out size of I, D & S caches, assuming they are already initialised. - */ -LEAF(config_cache) - lw t0,icache_size - bgtz t0,8f # already known? - move v0,ra - bal _size_cache - move ra,v0 - - sw t2,icache_size - sw t3,dcache_size - sw t6,scache_size - sw t4,icache_linesize - sw t5,dcache_linesize - sw t7,scache_linesize -8: j ra -END(config_cache) - - -/* - * void _init_cache() R4000 - */ -LEAF(_init_cache) - /* - * First work out the sizes - */ - move v0,ra - bal _size_cache - move ra,v0 - - /* - * The caches may be in an indeterminate state, - * so we force good parity into them by doing an - * invalidate, load/fill, invalidate for each line. - */ - - /* disable all i/u and cache exceptions */ - mfc0 v0,C0_SR - and v1,v0,~SR_IE - or v1,SR_DE - mtc0 v1,C0_SR - - mtc0 zero,C0_TAGLO - mtc0 zero,C0_TAGHI - - /* assume bottom of RAM will generate good parity for the cache */ - li a0,PHYS_TO_K0(0) - move a2,t2 # icache_size - move a3,t4 # icache_linesize - move a1,a2 - icacheopn(a0,a1,a2,a3,121,(Index_Store_Tag_I,Fill_I)) - - li a0,PHYS_TO_K0(0) - move a2,t3 # dcache_size - move a3,t5 # dcache_linesize - move a1,a2 - icacheopn(a0,a1,a2,a3,1lw1,(Index_Store_Tag_D)) - - /* assume unified I & D in scache <<-NOTE */ - blez t6,1f - li a0,PHYS_TO_K0(0) - move a2,t6 - move a3,t7 - move a1,a2 - icacheopn(a0,a1,a2,a3,1lw1,(Index_Store_Tag_SD)) - -1: mtc0 v0,C0_SR - j ra -END(_init_cache) - - -/* - * void flush_cache (void) R4000 - * - * Flush and invalidate all caches - */ -LEAF(flush_cache) - /* secondary cacheops do all the work if present */ - lw a2,scache_size - blez a2,1f - lw a3,scache_linesize - li a0,PHYS_TO_K0(0) - move a1,a2 - icacheop(a0,a1,a2,a3,Index_Writeback_Inv_SD) - b 2f - -1: - lw a2,icache_size - blez a2,2f - lw a3,icache_linesize - li a0,PHYS_TO_K0(0) - move a1,a2 - icacheop(a0,a1,a2,a3,Index_Invalidate_I) - - lw a2,dcache_size - lw a3,dcache_linesize - li a0,PHYS_TO_K0(0) - move a1,a2 - icacheop(a0,a1,a2,a3,Index_Writeback_Inv_D) - -2: j ra -END(flush_cache) - -/* - * void flush_cache_nowrite (void) R4000 - * - * Invalidate all caches - */ -LEAF(flush_cache_nowrite) - mfc0 v0,C0_SR - and v1,v0,~SR_IE - mtc0 v1,C0_SR - - mtc0 zero,C0_TAGLO - mtc0 zero,C0_TAGHI - - lw a2,icache_size - blez a2,2f - lw a3,icache_linesize - li a0,PHYS_TO_K0(0) - move a1,a2 - icacheop(a0,a1,a2,a3,Index_Invalidate_I) - - lw a2,dcache_size - lw a3,dcache_linesize - li a0,PHYS_TO_K0(0) - move a1,a2 - icacheop(a0,a1,a2,a3,Index_Store_Tag_D) - - lw a2,scache_size - blez a2,2f - lw a3,scache_linesize - li a0,PHYS_TO_K0(0) - move a1,a2 - icacheop(a0,a1,a2,a3,Index_Store_Tag_SD) - -2: mtc0 v0,C0_SR - j ra -END(flush_cache_nowrite) - -/* - * void clean_cache (unsigned kva, size_t n) R4000 - * - * Writeback and invalidate address range in all caches - */ -LEAF(clean_cache) -XLEAF(clear_cache) - - /* secondary cacheops do all the work (if fitted) */ - lw a2,scache_size - blez a2,1f - lw a3,scache_linesize - vcacheop(a0,a1,a2,a3,Hit_Writeback_Inv_SD) - b 2f - -1: lw a2,icache_size - blez a2,2f - lw a3,icache_linesize - /* save kva & n for subsequent loop */ - move t8,a0 - move t9,a1 - vcacheop(a0,a1,a2,a3,Hit_Invalidate_I) - - lw a2,dcache_size - lw a3,dcache_linesize - /* restore kva & n */ - move a0,t8 - move a1,t9 - vcacheop(a0,a1,a2,a3,Hit_Writeback_Inv_D) - -2: j ra -END(clean_cache) - -/* - * void clean_dcache (unsigned kva, size_t n) R4000 - * - * Writeback and invalidate address range in primary data cache - */ -LEAF(clean_dcache) - lw a2,dcache_size - blez a2,2f - lw a3,dcache_linesize - - vcacheop(a0,a1,a2,a3,Hit_Writeback_Inv_D) - -2: j ra -END(clean_dcache) - -/* - * void clean_dcache_indexed (unsigned kva, size_t n) R4000 - * - * Writeback and invalidate indexed range in primary data cache - */ -LEAF(clean_dcache_indexed) - lw a2,dcache_size - blez a2,2f - lw a3,dcache_linesize - -#ifdef CPU_ORION - srl a2,1 # do one set (half cache) at a time - move t8,a0 # save kva & n - move t9,a1 - icacheop(a0,a1,a2,a3,Index_Writeback_Inv_D) - - addu a0,t8,a2 # do next set - move a1,t9 # restore n -#endif - icacheop(a0,a1,a2,a3,Index_Writeback_Inv_D) - -2: j ra -END(clean_dcache_indexed) - -/* - * void clean_dcache_nowrite (unsigned kva, size_t n) R4000 - * - * Invalidate an address range in primary data cache - */ -LEAF(clean_dcache_nowrite) - lw a2,dcache_size - blez a2,2f - lw a3,dcache_linesize - - vcacheop(a0,a1,a2,a3,Hit_Invalidate_D) - -2: j ra -END(clean_dcache_nowrite) - -/* - * void clean_dcache_nowrite_indexed (unsigned kva, size_t n) R4000 - * - * Invalidate indexed range in primary data cache - */ -LEAF(clean_dcache_nowrite_indexed) - mfc0 v0,C0_SR - and v1,v0,~SR_IE - mtc0 v1,C0_SR - - mtc0 zero,C0_TAGLO - mtc0 zero,C0_TAGHI - - lw a2,dcache_size - blez a2,2f - lw a3,dcache_linesize - -#ifdef CPU_ORION - srl a2,1 # do one set (half cache) at a time - move t8,a0 # save kva & n - move t9,a1 - icacheop(a0,a1,a2,a3,Index_Store_Tag_D) - - addu a0,t8,a2 # do next set - move a1,t9 # restore n -#endif - icacheop(a0,a1,a2,a3,Index_Store_Tag_D) - -2: mtc0 v0,C0_SR - j ra -END(clean_dcache_nowrite_indexed) - -/* - * void clean_icache (unsigned kva, size_t n) R4000 - * - * Invalidate address range in primary instruction cache - */ -LEAF(clean_icache) - lw a2,icache_size - blez a2,2f - lw a3,icache_linesize - - vcacheop(a0,a1,a2,a3,Hit_Invalidate_I) - -2: j ra -END(clean_icache) - -/* - * void clean_icache_indexed (unsigned kva, size_t n) R4000 - * - * Invalidate indexed range in primary instruction cache - */ -LEAF(clean_icache_indexed) - lw a2,icache_size - blez a2,2f - lw a3,icache_linesize - -#ifdef CPU_ORION - srl a2,1 # do one set (half cache) at a time - move t8,a0 # save kva & n - move t9,a1 - icacheop(a0,a1,a2,a3,Index_Invalidate_I) - - addu a0,t8,a2 # do next set - move a1,t9 # restore n -#endif - icacheop(a0,a1,a2,a3,Index_Invalidate_I) - -2: j ra -END(clean_icache_indexed) - - - -/* - * void clean_scache (unsigned kva, size_t n) R4000 - * - * Writeback and invalidate address range in secondary cache - */ -LEAF(clean_scache) - lw a2,scache_size - blez a2,2f - lw a3,scache_linesize - vcacheop(a0,a1,a2,a3,Hit_Writeback_Inv_SD) - -2: j ra -END(clean_scache) - -/* - * void clean_scache_indexed (unsigned kva, size_t n) R4000 - * - * Writeback and invalidate indexed range in secondary cache - */ -LEAF(clean_scache_indexed) - lw a2,scache_size - blez a2,2f - lw a3,scache_linesize - - icacheop(a0,a1,a2,a3,Index_Writeback_Inv_SD) - -2: j ra -END(clean_scache_indexed) - -/* - * void clean_scache_nowrite (unsigned kva, size_t n) R4000 - * - * Invalidate an address range in secondary cache - */ -LEAF(clean_scache_nowrite) - lw a2,scache_size - blez a2,2f - lw a3,scache_linesize - - vcacheop(a0,a1,a2,a3,Hit_Invalidate_SD) - -2: j ra -END(clean_scache_nowrite) - -/* - * void clean_scache_nowrite_indexed (unsigned kva, size_t n) R4000 - * - * Invalidate indexed range in secondary cache - */ -LEAF(clean_scache_nowrite_indexed) - mfc0 v0,C0_SR - and v1,v0,~SR_IE - mtc0 v1,C0_SR - - mtc0 zero,C0_TAGLO - mtc0 zero,C0_TAGHI - - lw a2,scache_size - blez a2,2f - lw a3,scache_linesize - - icacheop(a0,a1,a2,a3,Index_Store_Tag_SD) - -2: mtc0 v0,C0_SR - j ra -END(clean_scache_nowrite_indexed) - -/************************************************************************** -** -** get_mem_conf - get memory configuration R4000 -** -***************************************************************************/ - - -FRAME(get_mem_conf,sp,0,ra) - - lw t6, mem_size - sw t6, 0(a0) - lw t7, icache_size - sw t7, 4(a0) - lw t8, dcache_size - sw t8, 8(a0) - lw t7, scache_size - sw t7, 12(a0) - j ra - -ENDFRAME(get_mem_conf) - -#endif /* defined(CPU_R4000) */ - -/* - * void set_mem_size (mem_size) - * - * config_memory()'s memory size gets written into mem_size here. - * Now we don't need to call config_cache() with memory size - New to IDTC6.0 - */ -FRAME(set_memory_size,sp,0,ra) - sw a0, mem_size - j ra -ENDFRAME(set_memory_size) - - diff --git a/c/src/lib/libbsp/mips/p4000/startup/idttlb.S b/c/src/lib/libbsp/mips/p4000/startup/idttlb.S deleted file mode 100644 index 4aad7b1416..0000000000 --- a/c/src/lib/libbsp/mips/p4000/startup/idttlb.S +++ /dev/null @@ -1,390 +0,0 @@ -/* - -Based upon IDT provided code with the following release: - -This source code has been made available to you by IDT on an AS-IS -basis. Anyone receiving this source is licensed under IDT copyrights -to use it in any way he or she deems fit, including copying it, -modifying it, compiling it, and redistributing it either with or -without modifications. No license under IDT patents or patent -applications is to be implied by the copyright license. - -Any user of this software should understand that IDT cannot provide -technical support for this software and will not be responsible for -any consequences resulting from the use of this software. - -Any person who transfers this source code or any derivative work must -include the IDT copyright notice, this paragraph, and the preceeding -two paragraphs in the transferred software. - -COPYRIGHT IDT CORPORATION 1996 -LICENSED MATERIAL - PROGRAM PROPERTY OF IDT - - $Id$ -*/ - - -/* -** idttlb.s - fetch the registers associated with and the contents -** of the tlb. -** -*/ -/* 950308: Ketan patched a few tlb functions that would not have worked.*/ -#include <rtems/score/iregdef.h> -#include <rtems/score/idtcpu.h> -#include <rtems/score/idtmon.h> - - - .text - -#if defined(CPU_R3000) -/* -** ret_tlblo -- returns the 'entrylo' contents for the TLB -** 'c' callable - as ret_tlblo(index) - where index is the -** tlb entry to return the lo value for - if called from assembly -** language then index should be in register a0. -*/ -FRAME(ret_tlblo,sp,0,ra) - .set noreorder - mfc0 t0,C0_SR # save sr - nop - and t0,~SR_PE # dont inadvertantly clear PE - mtc0 zero,C0_SR # clear interrupts - mfc0 t1,C0_TLBHI # save pid - sll a0,TLBINX_INXSHIFT # position index - mtc0 a0,C0_INX # write to index register - nop - tlbr # put tlb entry in entrylo and hi - nop - mfc0 v0,C0_TLBLO # get the requested entry lo - mtc0 t1,C0_TLBHI # restore pid - mtc0 t0,C0_SR # restore status register - j ra - nop - .set reorder -ENDFRAME(ret_tlblo) -#endif -#if defined(CPU_R4000) -/* -** ret_tlblo[01] -- returns the 'entrylo' contents for the TLB -** 'c' callable - as ret_tlblo(index) - where index is the -** tlb entry to return the lo value for - if called from assembly -** language then index should be in register a0. -*/ -FRAME(ret_tlblo0,sp,0,ra) - mfc0 t0,C0_SR # save sr - mtc0 zero,C0_SR # clear interrupts - mfc0 t1,C0_TLBHI # save pid - mtc0 a0,C0_INX # write to index register - .set noreorder - nop; nop; nop; nop; nop; nop; nop; nop - .set reorder - tlbr # put tlb entry in entrylo and hi - .set noreorder - nop; nop; nop; nop; nop; nop; nop; nop - .set reorder - mfc0 v0,C0_TLBLO0 # get the requested entry lo - mtc0 t1,C0_TLBHI # restore pid - mtc0 t0,C0_SR # restore status register - j ra -ENDFRAME(ret_tlblo0) - -FRAME(ret_tlblo1,sp,0,ra) - mfc0 t0,C0_SR # save sr - mtc0 zero,C0_SR # clear interrupts - mfc0 t1,C0_TLBHI # save pid - mtc0 a0,C0_INX # write to index register - .set noreorder - nop; nop; nop; nop; nop; nop; nop; nop - .set reorder - tlbr # put tlb entry in entrylo and hi - .set noreorder - nop; nop; nop; nop; nop; nop; nop; nop - .set reorder - mfc0 v0,C0_TLBLO1 # get the requested entry lo - mtc0 t1,C0_TLBHI # restore pid - mtc0 t0,C0_SR # restore status register - j ra -ENDFRAME(ret_tlblo1) - -/* -** ret_pagemask(index) -- return pagemask contents of tlb entry "index" -*/ -FRAME(ret_pagemask,sp,0,ra) - mfc0 t0,C0_SR # save sr - mtc0 zero,C0_SR # disable interrupts - mfc0 t1,C0_TLBHI # save current pid - mtc0 a0,C0_INX # drop it in C0 register - .set noreorder - nop; nop; nop; nop; nop; nop; nop; nop - .set reorder - tlbr # read entry to entry hi/lo - .set noreorder - nop; nop; nop; nop; nop; nop; nop; nop - .set reorder - mfc0 v0,C0_PAGEMASK # to return value - mtc0 t1,C0_TLBHI # restore current pid - mtc0 t0,C0_SR # restore sr - j ra -ENDFRAME(ret_pagemask) - -/* -** ret_tlbwired(void) -- return wired register -*/ -FRAME(ret_tlbwired,sp,0,ra) - mfc0 v0,C0_WIRED - j ra -ENDFRAME(ret_tlbwired) -#endif - -/* -** ret_tlbhi -- return the tlb entry high content for tlb entry -** index -*/ -FRAME(ret_tlbhi,sp,0,ra) -#if defined(CPU_R3000) - .set noreorder - mfc0 t0,C0_SR # save sr - nop - and t0,~SR_PE - mtc0 zero,C0_SR # disable interrupts - mfc0 t1,C0_TLBHI # save current pid - sll a0,TLBINX_INXSHIFT # position index - mtc0 a0,C0_INX # drop it in C0 register - nop - tlbr # read entry to entry hi/lo - nop - mfc0 v0,C0_TLBHI # to return value - mtc0 t1,C0_TLBHI # restore current pid - mtc0 t0,C0_SR # restore sr - j ra - nop - .set reorder -#endif -#if defined(CPU_R4000) - mfc0 t0,C0_SR # save sr - mtc0 zero,C0_SR # disable interrupts - mfc0 t1,C0_TLBHI # save current pid - mtc0 a0,C0_INX # drop it in C0 register - .set noreorder - nop; nop; nop; nop; nop; nop; nop; nop - .set reorder - tlbr # read entry to entry hi/lo0/lo1/mask - .set noreorder - nop; nop; nop; nop; nop; nop; nop; nop - .set reorder - mfc0 v0,C0_TLBHI # to return value - mtc0 t1,C0_TLBHI # restore current pid - mtc0 t0,C0_SR # restore sr - j ra -#endif -ENDFRAME(ret_tlbhi) - -/* -** ret_tlbpid() -- return tlb pid contained in the current entry hi -*/ -FRAME(ret_tlbpid,sp,0,ra) -#if defined(CPU_R3000) - .set noreorder - mfc0 v0,C0_TLBHI # fetch tlb high - nop - and v0,TLBHI_PIDMASK # isolate and position - srl v0,TLBHI_PIDSHIFT - j ra - nop - .set reorder -#endif -#if defined(CPU_R4000) - mfc0 v0,C0_TLBHI # to return value - nop - and v0,TLBHI_PIDMASK - j ra -#endif -ENDFRAME(ret_tlbpid) - -/* -** tlbprobe(address, pid) -- probe the tlb to see if address is currently -** mapped -** a0 = vpn - virtual page numbers are 0=0 1=0x1000, 2=0x2000... -** virtual page numbers for the r3000 are in -** entry hi bits 31-12 -** a1 = pid - this is a process id ranging from 0 to 63 -** this process id is shifted left 6 bits and or'ed into -** the entry hi register -** returns an index value (0-63) if successful -1 -f not -*/ -FRAME(tlbprobe,sp,0,ra) -#if defined(CPU_R3000) - .set noreorder - mfc0 t0,C0_SR /* fetch status reg */ - and a0,TLBHI_VPNMASK /* isolate just the vpn */ - and t0,~SR_PE /* don't inadvertantly clear pe */ - mtc0 zero,C0_SR - mfc0 t1,C0_TLBHI - sll a1,TLBHI_PIDSHIFT /* possition the pid */ - and a1,TLBHI_PIDMASK - or a0,a1 /* build entry hi value */ - mtc0 a0,C0_TLBHI - nop - tlbp /* do the probe */ - nop - mfc0 v1,C0_INX - li v0,-1 - bltz v1,1f - nop - sra v0,v1,TLBINX_INXSHIFT /* get index positioned for return */ -1: - mtc0 t1,C0_TLBHI /* restore tlb hi */ - mtc0 t0,C0_SR /* restore the status reg */ - j ra - nop - .set reorder -#endif -#if defined(CPU_R4000) - mfc0 t0,C0_SR # save sr - mtc0 zero,C0_SR # disable interrupts - mfc0 t1,C0_TLBHI # save current pid - and a0,TLBHI_VPN2MASK # construct tlbhi for probe - and a1,TLBHI_PIDMASK - or a0,a1 - mtc0 a0,C0_TLBHI - .set noreorder - nop; nop; nop; nop; nop; nop; nop; nop - .set reorder - tlbp # probe entry to entry hi/lo0/lo1/mask - .set noreorder - nop; nop; nop; nop; nop; nop; nop; nop - .set reorder - mfc0 v1,C0_INX - li v0,-1 - bltz v1,1f - move v0,v1 -1: mtc0 t1,C0_TLBHI # restore current pid - mtc0 t0,C0_SR # restore sr - j ra -#endif -ENDFRAME(tlbprobe) - -/* -** resettlb(index) Invalidate the TLB entry specified by index -*/ -FRAME(resettlb,sp,0,ra) -#if defined(CPU_R3000) - .set noreorder - mfc0 t0,C0_TLBHI # fetch the current hi - mfc0 v0,C0_SR # fetch the status reg. - li t2,K0BASE&TLBHI_VPNMASK - and v0,~SR_PE # dont inadvertantly clear PE - mtc0 zero,C0_SR - mtc0 t2,C0_TLBHI # set up tlbhi - mtc0 zero,C0_TLBLO - sll a0,TLBINX_INXSHIFT - mtc0 a0,C0_INX - nop - tlbwi # do actual invalidate - nop - mtc0 t0,C0_TLBHI - mtc0 v0,C0_SR - j ra - nop - .set reorder -#endif -#if defined(CPU_R4000) - li t2,K0BASE&TLBHI_VPN2MASK - mfc0 t0,C0_TLBHI # save current TLBHI - mfc0 v0,C0_SR # save SR and disable interrupts - mtc0 zero,C0_SR - mtc0 t2,C0_TLBHI # invalidate entry - mtc0 zero,C0_TLBLO0 - mtc0 zero,C0_TLBLO1 - mtc0 a0,C0_INX - .set noreorder - nop; nop; nop; nop; nop; nop; nop; nop - .set reorder - tlbwi - .set noreorder - nop; nop; nop; nop; nop; nop; nop; nop - .set reorder - mtc0 t0,C0_TLBHI - mtc0 v0,C0_SR - j ra -#endif -ENDFRAME(resettlb) - -#if defined(CPU_R3000) -/* -** Setup TLB entry -** -** map_tlb(index, tlbhi, phypage) -** a0 = TLB entry index -** a1 = virtual page number and PID -** a2 = physical page -*/ -FRAME(map_tlb,sp,0,ra) - .set noreorder - sll a0,TLBINX_INXSHIFT - mfc0 v0,C0_SR # fetch the current status - mfc0 a3,C0_TLBHI # save the current hi - and v0,~SR_PE # dont inadvertantly clear parity - - mtc0 zero,C0_SR - mtc0 a1,C0_TLBHI # set the hi entry - mtc0 a2,C0_TLBLO # set the lo entry - mtc0 a0,C0_INX # load the index - nop - tlbwi # put the hi/lo in tlb entry indexed - nop - mtc0 a3,C0_TLBHI # put back the tlb hi reg - mtc0 v0,C0_SR # restore the status register - j ra - nop - .set reorder -ENDFRAME(map_tlb) - #endif -#if defined(CPU_R4000) -/* -** Setup R4000 TLB entry -** -** map_tlb4000(mask_index, tlbhi, pte_even, pte_odd) -** a0 = TLB entry index and page mask -** a1 = virtual page number and PID -** a2 = pte -- contents of even pte -** a3 = pte -- contents of odd pte -*/ -FRAME(map_tlb4000,sp,0,ra) - and t2,a0,TLBPGMASK_MASK - and a0,TLBINX_INXMASK - mfc0 t1,C0_TLBHI # save current TLBPID - mfc0 v0,C0_SR # save SR and disable interrupts - mtc0 zero,C0_SR - mtc0 t2,C0_PAGEMASK # set - mtc0 a1,C0_TLBHI # set VPN and TLBPID - mtc0 a2,C0_TLBLO0 # set PPN and access bits - mtc0 a3,C0_TLBLO1 # set PPN and access bits - mtc0 a0,C0_INX # set INDEX to wired entry - .set noreorder - nop; nop; nop; nop; nop; nop; nop; nop - .set reorder - tlbwi # drop it in - .set noreorder - nop; nop; nop; nop; nop; nop; nop; nop - .set reorder - mtc0 t1,C0_TLBHI # restore TLBPID - mtc0 v0,C0_SR # restore SR - j ra -ENDFRAME(map_tlb4000) -#endif - - -/* -** Set current TLBPID. This assumes PID is positioned correctly in reg. -** a0. -*/ -FRAME(set_tlbpid,sp,0,ra) - .set noreorder - mtc0 a0,C0_TLBHI - j ra - nop - .set reorder -ENDFRAME(set_tlbpid) - diff --git a/c/src/lib/libbsp/mips/p4000/startup/inittlb.c b/c/src/lib/libbsp/mips/p4000/startup/inittlb.c deleted file mode 100644 index e61f0043be..0000000000 --- a/c/src/lib/libbsp/mips/p4000/startup/inittlb.c +++ /dev/null @@ -1,16 +0,0 @@ -/* - * $Id$ - */ - -#include <rtems/score/idtcpu.h> - -extern void resettlb( int i ); - -void init_tlb(void) -{ - int i; - - for (i = 0; i < N_TLB_ENTRIES; i++ ) - resettlb(i); -} - diff --git a/c/src/lib/libbsp/mips/p4000/startup/linkcmds b/c/src/lib/libbsp/mips/p4000/startup/linkcmds deleted file mode 100644 index 47e0ba1162..0000000000 --- a/c/src/lib/libbsp/mips/p4000/startup/linkcmds +++ /dev/null @@ -1,72 +0,0 @@ -/* - * $Id$ - */ - -OUTPUT_FORMAT("elf32-bigmips") -OUTPUT_ARCH(mips) -/* Do we need any of these for elf? - __DYNAMIC = 0; */ -_DYNAMIC_LINK = 0; -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - .text 0x80030000 : /* */ -/* .text 0xa0020000 : /* */ -/* .text 0x00020000 : /* */ - { - _ftext = . ; - *(.text) - CREATE_OBJECT_SYMBOLS - _etext = .; - } - .init ALIGN(8) : { *(.init) } =0 - .fini ALIGN(8) : { *(.fini) } =0 - .ctors ALIGN(8) : { *(.ctors) } - .dtors ALIGN(8) : { *(.dtors) } - .rodata ALIGN(8) : { *(.rodata) *(.gnu.linkonce.r*) } - .rodata1 ALIGN(8) : - { - *(.rodata1) - . = ALIGN(8); - } - .reginfo . : { *(.reginfo) } - /* also: .hash .dynsym .dynstr .plt(if r/o) .rel.got */ - /* Read-write section, merged into data segment: */ - .data ALIGN(16) : - { - _fdata = . ; - *(.data) - CONSTRUCTORS - } - .data1 ALIGN(8) : { *(.data1) } - _gp = . + 0x8000; - .lit8 . : { *(.lit8) } - .lit4 . : { *(.lit4) } - /* also (before uninitialized portion): .dynamic .got .plt(if r/w) - (or does .dynamic go into its own segment?) */ - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - .sdata ALIGN(8) : { *(.sdata) } - _edata = .; - __bss_start = ALIGN(8); - _fbss = .; - .sbss ALIGN(8) : { *(.sbss) *(.scommon) } - .bss ALIGN(8) : - { - *(.bss) - *(COMMON) - _end = . ; - end = . ; - } - /* Debug sections. These should never be loadable, but they must have - zero addresses for the debuggers to work correctly. */ - .line 0 : { *(.line) } - .debug 0 : { *(.debug) } - .debug_sfnames 0 : { *(.debug_sfnames) } - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_macinfo 0 : { *(.debug_macinfo) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } -} - diff --git a/c/src/lib/libbsp/mips/p4000/startup/setvec.c b/c/src/lib/libbsp/mips/p4000/startup/setvec.c deleted file mode 100644 index 1142eb64de..0000000000 --- a/c/src/lib/libbsp/mips/p4000/startup/setvec.c +++ /dev/null @@ -1,53 +0,0 @@ -/* set_vector - * - * This routine installs an interrupt vector on the target Board/CPU. - * This routine is allowed to be as board dependent as necessary. - * - * INPUT: - * handler - interrupt handler entry point - * vector - vector number - * type - 0 indicates raw hardware connect - * 1 indicates RTEMS interrupt connect - * - * RETURNS: - * address of previous interrupt handler - * - * COPYRIGHT (c) 1989-1998. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* - * Rather than deleting this, it is commented out to (hopefully) help - * the submitter send updates. - * - * static char _sccsid[] = "@(#)setvec.c 04/25/96 1.2\n"; - */ - - -#include <rtems.h> -#include <bsp.h> - -mips_isr_entry set_vector( /* returns old vector */ - rtems_isr_entry handler, /* isr routine */ - rtems_vector_number vector, /* vector number */ - int type /* RTEMS or RAW intr */ -) -{ - mips_isr_entry previous_isr; - - if ( type ) - rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr ); - else { - /* XXX: install non-RTEMS ISR as "raw" interupt */ - rtems_interrupt_catch( handler, vector, (rtems_isr_entry *) &previous_isr ); - } - return previous_isr; -} - diff --git a/c/src/lib/libbsp/mips/p4000/times b/c/src/lib/libbsp/mips/p4000/times deleted file mode 100644 index 58574229e1..0000000000 --- a/c/src/lib/libbsp/mips/p4000/times +++ /dev/null @@ -1,200 +0,0 @@ -# -# Timing Test Suite Results for the NO_BSP -# -# NOTE: This is just a template. The times are irrelevant since this BSP -# can only be compiled -- not executed. -# -# $Id$ -# -# @(#)times 08/01/96 1.4 - -NOTE: To obtain the execution time in microseconds, divide the number of - cycles by the clock speed. For example, if rtems_semaphore create - is reported to be 1164 cycles, then at 66 Mhz it takes 17.64 - microseconds or 8.75 microseconds at 133 Mhz. - -Board: Algorithmics P4000i -CPU: IDT 4650 -Clock Speed: 100MHz -Memory Configuration: SRAM, DRAM, cache, etc -Wait States: - -Times Reported in: cycles -Timer Source: on-CPU cycle counter - -Column A:RTEMS compiled with 64 bit pointers and 64 bit unsigned32 types -Column B:RTEMS compiled with 32 bit pointers and 32 bit unsigned32 types - -# DESCRIPTION A B -== ================================================================= ==== ==== - 1 rtems_semaphore_create 788 759 - rtems_semaphore_delete 903 945 - rtems_semaphore_obtain: available 119 119 - rtems_semaphore_obtain: not available -- NO_WAIT 118 118 - rtems_semaphore_release: no waiting tasks 127 127 - - 2 rtems_semaphore_obtain: not available -- caller blocks 842 840 - - 3 rtems_semaphore_release: task readied -- preempts caller 777 751 - - 4 rtems_task_restart: blocked task -- preempts caller 1611 1595 - rtems_task_restart: ready task -- preempts caller 1253 1395 - rtems_semaphore_release: task readied -- returns to caller 365 345 - rtems_task_create 798 797 - rtems_task_start 464 460 - rtems_task_restart: suspended task -- returns to caller 517 517 - rtems_task_delete: suspended task 529 595 - rtems_task_restart: ready task -- returns to caller 527 525 - rtems_task_restart: blocked task -- returns to caller 707 684 - rtems_task_delete: blocked task 609 675 - - 5 rtems_task_suspend: calling task 549 549 - rtems_task_resume: task readied -- preempts caller 702 699 - - 6 rtems_task_restart: calling task 291 291 - rtems_task_suspend: returns to caller 195 194 - rtems_task_resume: task readied -- returns to caller 198 198 - rtems_task_delete: ready task 734 736 - - 7 rtems_task_restart: suspended task -- preempts caller 1049 990 - - 8 rtems_task_set_priority: obtain current priority 94 94 - rtems_task_set_priority: returns to caller 418 355 - rtems_task_mode: obtain current mode 44 43 - rtems_task_mode: no reschedule 0 49 - rtems_task_mode: reschedule -- returns to caller 0 232 - rtems_task_mode: reschedule -- preempts caller 0 687 - rtems_task_set_note 0 101 - rtems_task_get_note 0 103 - rtems_clock_set 0 237 - rtems_clock_get 0 16 - - 9 rtems_message_queue_create 3583 3432 - rtems_message_queue_send: no waiting tasks 252 252 - rtems_message_queue_urgent: no waiting tasks 252 252 - rtems_message_queue_receive: available 207 207 - rtems_message_queue_flush: no messages flushed 95 96 - rtems_message_queue_flush: messages flushed 110 110 - rtems_message_queue_delete 1044 1111 - -10 rtems_message_queue_receive: not available -- NO_WAIT 132 131 - rtems_message_queue_receive: not available -- caller blocks 884 892 - -11 rtems_message_queue_send: task readied -- preempts caller 397 817 - -12 rtems_message_queue_send: task readied -- returns to caller 397 397 - -13 rtems_message_queue_urgent: task readied -- preempts caller 816 817 - -14 rtems_message_queue_urgent: task readied -- returns to caller 397 398 - -15 rtems_event_receive: obtain current events 5 5 - rtems_event_receive: not available -- NO_WAIT 99 99 - rtems_event_receive: not available -- caller blocks 689 689 - rtems_event_send: no task readied 123 123 - rtems_event_receive: available 326 349 - rtems_event_send: task readied -- returns to caller 333 429 - -16 rtems_event_send: task readied -- preempts caller 843 838 - -17 rtems_task_set_priority: preempts caller 1002 991 - -18 rtems_task_delete: calling task 1171 1157 - -19 rtems_signal_catch 0 1306 - rtems_signal_send: returns to caller 0 1019 - rtems_signal_send: signal to self 0 496 - exit ASR overhead: returns to calling task 0 120 - exit ASR overhead: returns to preempting task 0 73 - -20 rtems_partition_create 1293 1306 - rtems_region_create 1010 1019 - rtems_partition_get_buffer: available 481 496 - rtems_partition_get_buffer: not available 120 120 - rtems_partition_return_buffer 587 460 - rtems_partition_delete 379 320 - rtems_region_get_segment: available 179 179 - rtems_region_get_segment: not available -- NO_WAIT 349 293 - rtems_region_return_segment: no waiting tasks 335 322 - rtems_region_get_segment: not available -- caller blocks 1603 1496 - rtems_region_return_segment: task readied -- preempts caller 1616 1533 - rtems_region_return_segment: task readied -- returns to caller 940 939 - rtems_region_delete 301 348 - rtems_io_initialize 9 10 - rtems_io_open 6 6 - rtems_io_close 6 6 - rtems_io_read 6 6 - rtems_io_write 6 5 - rtems_io_control 6 6 - -21 rtems_task_ident 1057 1058 - rtems_message_queue_ident 963 963 - rtems_semaphore_ident 1137 1136 - rtems_partition_ident 962 961 - rtems_region_ident 923 924 - rtems_port_ident 918 917 - rtems_timer_ident 942 941 - rtems_rate_monotonic_ident 924 925 - -22 rtems_message_queue_broadcast: task readied -- returns to caller 1084 1095 - rtems_message_queue_broadcast: no waiting tasks 147 148 - rtems_message_queue_broadcast: task readied -- preempts caller 1305 1268 - -23 rtems_timer_create 202 201 - rtems_timer_fire_after: inactive 261 261 - rtems_timer_fire_after: active 271 269 - rtems_timer_cancel: active 142 141 - rtems_timer_cancel: inactive 122 124 - rtems_timer_reset: inactive 222 222 - rtems_timer_reset: active 246 245 - rtems_timer_fire_when: inactive 312 311 - rtems_timer_fire_when: active 358 358 - rtems_timer_delete: active 263 263 - rtems_timer_delete: inactive 247 247 - rtems_task_wake_when 833 831 - -24 rtems_task_wake_after: yield -- returns to caller 99 98 - rtems_task_wake_after: yields -- preempts caller 479 478 - -25 rtems_clock_tick 313 318 - -26 _ISR_Disable 64 57 - _ISR_Flash 51 36 - _ISR_Enable 31 18 - _Thread_Disable_dispatch 53 37 - _Thread_Enable_dispatch 260 233 - _Thread_Set_state 446 463 - _Thread_Disptach (NO FP) 839 801 - context switch: no floating point contexts 673 653 - context switch: self 156 162 - context switch: to another task 84 70 - context switch: restore 1st FP task 1030 1013 - fp context switch: save idle, restore idle 969 948 - fp context switch: save idle, restore initialized 275 267 - fp context switch: save initialized, restore initialized 319 292 - _Thread_Resume 512 480 - _Thread_Unblock 121 139 - _Thread_Ready 199 203 - _Thread_Get 27 27 - _Semaphore_Get 20 21 - _Thread_Get: invalid id 5 5 - -27 interrupt entry overhead: returns to interrupted task 0 0 - interrupt exit overhead: returns to interrupted task 27 41 - interrupt entry overhead: returns to nested interrupt 0 0 - interrupt exit overhead: returns to nested interrupt 0 0 - interrupt entry overhead: returns to preempting task 0 0 - interrupt exit overhead: returns to preempting task 0 0 - -28 rtems_port_create 574 560 - rtems_port_external_to_internal 87 87 - rtems_port_internal_to_external 86 86 - rtems_port_delete 395 353 - -29 rtems_rate_monotonic_create 621 633 - rtems_rate_monotonic_period: initiate period -- returns to caller 773 694 - rtems_rate_monotonic_period: obtain status 295 284 - rtems_rate_monotonic_cancel 408 451 - rtems_rate_monotonic_delete: inactive 453 471 - rtems_rate_monotonic_delete: active 332 336 - rtems_rate_monotonic_period: conclude periods -- caller blocks 664 686 diff --git a/c/src/lib/libbsp/mips64orion/p4000/start/Makefile.in b/c/src/lib/libbsp/mips64orion/p4000/start/Makefile.in deleted file mode 100644 index 046969120a..0000000000 --- a/c/src/lib/libbsp/mips64orion/p4000/start/Makefile.in +++ /dev/null @@ -1,54 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -# C source names, if any, go here -- minus the .c -C_PIECES= -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES=idt_csu -S_FILES=$(S_PIECES:%=%.S) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -PGM=${ARCH}/idt_csu.o - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: ${ARCH} $(SRCS) $(OBJS) $(PGM) - $(INSTALL_VARIANT) -m 555 ${PGM} ${PROJECT_RELEASE}/lib diff --git a/c/src/lib/libbsp/mips64orion/p4000/start/start.S b/c/src/lib/libbsp/mips64orion/p4000/start/start.S deleted file mode 100644 index 8dc31c8999..0000000000 --- a/c/src/lib/libbsp/mips64orion/p4000/start/start.S +++ /dev/null @@ -1,299 +0,0 @@ -/* - -Based upon IDT provided code with the following release: - -This source code has been made available to you by IDT on an AS-IS -basis. Anyone receiving this source is licensed under IDT copyrights -to use it in any way he or she deems fit, including copying it, -modifying it, compiling it, and redistributing it either with or -without modifications. No license under IDT patents or patent -applications is to be implied by the copyright license. - -Any user of this software should understand that IDT cannot provide -technical support for this software and will not be responsible for -any consequences resulting from the use of this software. - -Any person who transfers this source code or any derivative work must -include the IDT copyright notice, this paragraph, and the preceeding -two paragraphs in the transferred software. - -COPYRIGHT IDT CORPORATION 1996 -LICENSED MATERIAL - PROGRAM PROPERTY OF IDT - - $Id$ -*/ - -/************************************************************************* -** -** Copyright 1991-95 Integrated Device Technology, Inc. -** All Rights Reserved -** -** idt_csu.S -- IDT stand alone startup code -** -**************************************************************************/ -#include <rtems/score/iregdef.h> -#include <rtems/score/idtcpu.h> -#include <rtems/score/idtmon.h> - - -.extern _fbss,4 /* this is defined by the linker */ -.extern end,4 /* this is defined by the linker */ - -.lcomm sim_mem_cfg_struct,12 - - .text - - -#define TMP_STKSIZE 1024 - -/************************************************************************** -** -** start - Typicl standalone start up code required for R3000/R4000 -** -** -** 1) Initialize the STATUS Register -** a) Clear parity error bit -** b) Set co_processor 1 usable bit ON -** c) Clear all IntMask Enables -** d) Set kernel/disabled mode -** 2) Initialize Cause Register -** a) clear software interrupt bits -** 3) Determine FPU installed or not -** if not, clear CoProcessor 1 usable bit -** 4) Clear bss area -** 5) MUST allocate temporary stack until memory size determined -** It MUST be uncached to prevent overwriting when caches are cleared -** 6) Install exception handlers -** 7) Determine memory and cache sizes -** 8) Establish permanent stack (cached or uncached as defined by bss) -** 9) Flush Instruction and Data caches -** 10) If there is a Translation Lookaside Buffer, Clear the TLB -** 11) Execute initialization code if the IDT/c library is to be used -** -** 12) Jump to user's "main()" -** 13) Jump to promexit -** -** IDT/C 5.x defines _R3000, IDT/C 6.x defines _R4000 internally. -** This is used to mark code specific to R3xxx or R4xxx processors. -** IDT/C 6.x defines __mips to be the ISA level for which we're -** generating code. This is used to make sure the stack etc. is -** double word aligned, when using -mips3 (default) or -mips2, -** when compiling with IDT/C6.x -** -***************************************************************************/ - -FRAME(start,sp,0,ra) - - .set noreorder -#ifdef _R3000 - li v0,SR_PE|SR_CU1 /* reset parity error and set */ - /* cp1 usable */ -#endif -#ifdef _R4000 -#if __mips==3 || defined(R4650) - li v0,SR_CU1|SR_DE|SR_FR /* initally clear ERL, enable FPA 64bit regs*/ - /* 4650: Need fr to be set anyway */ -#else - li v0,SR_CU1|SR_DE /* initally clear ERL, enable FPA 32bit regs*/ -#endif mips3 -#endif - - mtc0 v0,C0_SR /* clr IntMsks/ kernel/disabled mode */ - nop - mtc0 zero,C0_CAUSE /* clear software interrupts */ - nop - -#ifdef _R4000 - li v0,CFG_C_NONCOHERENT # initialise default cache mode - mtc0 v0,C0_CONFIG -#endif - -/* -** check to see if an fpu is really plugged in -*/ - li t3,0xaaaa5555 /* put a's and 5's in t3 */ - mtc1 t3,fp0 /* try to write them into fp0 */ - mtc1 zero,fp1 /* try to write zero in fp */ - mfc1 t0,fp0 - mfc1 t1,fp1 - nop - bne t0,t3,1f /* branch if no match */ - nop - bne t1,zero,1f /* double check for positive id */ - nop - /* We have a FPU. clear fcsr */ - ctc1 zero, fcr31 - j 2f /* status register already correct */ - nop -1: -#ifdef _R3000 - li v0, SR_PE /* reset parity error/NO cp1 usable */ -#endif - -#ifdef _R4000 - li v0,SR_DE /* clear ERL and disable FPA */ -#endif - - mtc0 v0, C0_SR /* reset status register */ -2: - la gp, _gp - - la v0,_fbss /* clear bss before using it */ - la v1,end /* end of bss */ -3: sw zero,0(v0) - bltu v0,v1,3b - add v0,4 - - -/************************************************************************ -** -** Temporary Stack - needed to handle stack saves until -** memory size is determined and permanent stack set -** -** MUST be uncached to avoid confusion at cache -** switching during memory sizing -** -*************************************************************************/ -#if __mips==3 - /* For MIPS 3, we need to be sure that the stack is aligned on a - * double word boundary. - */ - andi t0, v0, 0x7 - beqz t0, 11f /* Last three bits Zero, already aligned */ - nop - add v0, 4 -11: -#endif - - or v0, K1BASE /* switch to uncached */ - add v1, v0, TMP_STKSIZE /* end of bss + length of tmp stack */ - sub v1, v1, (4*4) /* overhead */ - move sp, v1 /* set sp to top of stack */ -4: sw zero, 0(v0) - bltu v0, v1, 4b /* clear out temp stack */ - add v0, 4 - - jal init_exc_vecs /* install exception handlers */ - nop /* MUST do before memory probes */ - - la v0, 5f - li v1, K1BASE /* force into uncached space */ - or v0, v1 /* during memory/cache probes */ - j v0 - nop -5: - la a0, sim_mem_cfg_struct - jal sim_mem_cfg /* Make SIM call to get mem size */ - nop - la a0, sim_mem_cfg_struct - lw a0, 0(a0) /* Get memory size from struct */ -#ifdef _R3000 - jal config_Icache - nop - jal config_Dcache /* determine size of D & I caches */ - nop -#endif -#ifdef _R4000 - jal config_cache /* determine size of D & I caches */ - nop -#endif - - move v0, a0 /* mem_size */ - -#if __mips==3 - /* For MIPS 3, we need to be sure that the stack (and hence v0 - * here) is aligned on a double word boundary. - */ - andi t0, v0, 0x7 - beqz t0, 12f /* Last three bits Zero, already aligned */ - nop - subu v0, 4 /* mem_size was not aligned on doubleword bdry????*/ -12: -#endif - - - -/************************************************************************** -** -** Permanent Stack - now know top of memory, put permanent stack there -** -***************************************************************************/ - - la t2, _fbss /* cache mode as linked */ - and t2, 0xF0000000 /* isolate segment */ - la t1, 6f - j t1 /* back to original cache mode */ - nop -6: - or v0, t2 /* stack back to original cache mode */ - addiu v0,v0,-16 /* overhead */ - move sp, v0 /* now replace count w top of memory */ - move v1, v0 - subu v1, P_STACKSIZE /* clear requested stack size */ - -7: sw zero, 0(v1) /* clear P_STACKSIZE stack */ - bltu v1,v0,7b - add v1, 4 - .set reorder - -#ifdef _R3000 - jal flush_Icache - jal flush_Dcache /* flush Data & Instruction caches */ -#endif -#ifdef _R4000 - jal flush_cache_nowrite /* flush Data & Instruction caches */ -#endif - - - -/************************************************************************** -** -** If this chip supports a Translation Lookaside Buffer, clear it -** -***************************************************************************/ - - .set noreorder - mfc0 t1, C0_SR /* look at Status Register */ - nop - .set reorder -#ifdef _R3000 - li t2, SR_TS /* TLB Shutdown bit */ - and t1,t2 /* TLB Shutdown if 1 */ - bnez t1, 8f /* skip clearing if no TLB */ -#endif - -#ifndef R4650 - jal init_tlb /* clear the tlb */ -#endif - - -/************************************************************************ -** -** Initialization required if using IDT/c or libc.a, standard C Lib -** -** can SKIP if not necessary for application -** -************************************************************************/ -8: - - jal idtsim_init_sbrk - jal idtsim_init_file -/*********************** END I/O initialization **********************/ - - - jal main - - jal idtsim_promexit - -ENDFRAME(start) - - - .globl sim_mem_cfg -sim_mem_cfg: - .set noat - .set noreorder - li AT, (0xbfc00000+((55)*8)) - jr AT - nop - .set at - .set reorder diff --git a/c/src/lib/libbsp/powerpc/dmv177/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/Makefile.in deleted file mode 100644 index 3e5ccf3e06..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/Makefile.in +++ /dev/null @@ -1,25 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/directory.cfg - -SRCS=README - -# We only build the networking device driver if HAS_NETWORKING was defined -NETWORKING_DRIVER_yes_V = sonic -NETWORKING_DRIVER = $(NETWORKING_DRIVER_$(HAS_NETWORKING)_V) - -all: $(SRCS) - -# wrapup is the one that actually builds and installs the library -# from the individual .rel files built in other directories -SUB_DIRS=include clock console startup start timer \ - scv64 tod $(NETWORKING_DRIVER) wrapup diff --git a/c/src/lib/libbsp/powerpc/dmv177/QUIRKS b/c/src/lib/libbsp/powerpc/dmv177/QUIRKS deleted file mode 100644 index e1d95e6427..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/QUIRKS +++ /dev/null @@ -1,74 +0,0 @@ -# -# Quirks in the DY-4 DMV177 -# -# $Id$ -# - -JTAG and Caching -================ -If data or code caching is enabled on certain revisions of the PPC603e, -then the JTAG emulator interface become disfunctional. You can not -debug using the emulator on these chip revisions. On certain revisions, -it is so bad that when code caching is enabled, you can not even -download code reliably to the board. - -Caching and Peripherals -======================= -When caching is enabled, care must be exercised to insure that all -peripheral addresses are still uncached. - -Exar 88681 Clock -================ -This board uses a different clock for the Exar 88681 DUART than is -documented in the Exar manual or the original MC68681 manual. This -resulted in the need for the the mc68681 libchip driver to support -BSP specific baud rate tables and the development of a DMV177 -specific baud rate table. - -In the end, this all works but you have a very limited range of -useful baud rates on the 88681 ports compared to what would have -been supported had DY-4 just followed the Exar or Motorola manual. - - -SCC Addresses -============= -The full set of SCC addresses is not documented in the DY-4 manual -and they are not ordered as one would expect. Normally the four -SCC registers are ordered Control A, Data A, Control B, and Data B. -DY-4 orders them with B first. - -This required extra time to debug. - - -SCV64 and the Foundation Firmware -================================= -DY-4 technical support did not offer code to determine which interrupt -sources were pending at the SCV64. They recommended calling into the -Foundation Firmware ROM monitor to figure this out. The Foundation -Firmware did not recognize enough interrupts on this board to be useful. - -In the end, we gave up on their technical support's recommendation -and directly manipulated the SVC64. This is what we wanted to do in -the first place but we got no information from them to aid in this. -Luckily, the manual does document enough of DY-4's mapping of the specific -interrupt sources to make this work. - - -Z85C30 SCC Clock Speed -====================== - -The Z85C30 SCC can be factory configured for 10 Mhz or 2.4616 Mhz. Code -had to be added to dynamically determine which clock was installed. - -The board we had used a 10 Mhz clock. No testing was done with a 2.4616 Mhz -clock. - - -P2 Octopus Cable -================ - -DY-4's P2 breakout is large and a bit unwieldy. It was difficult to -fight into the VME cage we used. The SCSI connector comes off the -side and is very stiff thus making it difficult to route around -anything in the back of the cage. We gave up on trying to use -it in the first few slots of OAR's cage. diff --git a/c/src/lib/libbsp/powerpc/dmv177/README b/c/src/lib/libbsp/powerpc/dmv177/README deleted file mode 100644 index 0f00873225..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/README +++ /dev/null @@ -1,49 +0,0 @@ -# -# $Id$ -# - -BSP NAME: dmv177 -BOARD: DY-4 DMV177 -BUS: VMEBus -CPU FAMILY: powerpc -CPU: PowerPC 603e -COPROCESSORS: N/A -MODE: 32 bit mode - -DEBUG MONITOR: DY-4 General Purpose Monitor (GPM) - -PERIPHERALS -=========== -TIMERS: PPC internal Timebase register - RESOLUTION: ??? -SERIAL PORTS: 2 RS-232 provided by a Exar 88681 - 2 RS-422 provided by a Zilog Z8530 -REAL-TIME CLOCK: PPC internal Decrementer register -DMA: none -RTC: Harris ICM7170 -VIDEO: none -SCSI: QLogic FAS216 SCSI-2 (unsupported) -NETWORKING: National Semiconductor SONIC DP83932B (Ethernet) - -DRIVER INFORMATION -================== -CLOCK DRIVER: PPC internal -SHMSUPP: N/A -TIMER DRIVER: PPC internal -CONSOLE DRIVER: Uses libchip drivers for Exar 88681 and Zilog Z8530. - -STDIO -===== - -These are the default settings. - -PORT: Console port 0 -ELECTRICAL: RS-232 -BAUD: 9600 -BITS PER CHARACTER: 8 -PARITY: N -STOP BITS: 1 - -Notes -===== -The console and real-time clock drivers use the libchip library. diff --git a/c/src/lib/libbsp/powerpc/dmv177/README.net b/c/src/lib/libbsp/powerpc/dmv177/README.net deleted file mode 100644 index b3ff231340..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/README.net +++ /dev/null @@ -1,44 +0,0 @@ -# -# $Id$ -# - -Setting the Ethernet Hardware Address -===================================== - -The hardware Ethernet address is not set at the factory. It is the -responsibility of the end-user to insure that it is set properly. -This file describes the standard procedure recommended by DY-4 -technical support for setting this address. This procedure is -similar to that followed by VxWorks as documented in DY-4 -Document Number #807885. - -The hardware Ethernet address and OS configuration information -must be stored in the SEEPROM non-volatile memory of the -SVME/DMV-176/177. The Foundation Firmware (FFW) reserves the -first 256 bytes of the SEEPROM for its own use and the remaining -remaining 256 bytes are available for OS specific information. - -Three bytes in the Serial EEPROM are used for the lowest three bytes -of the hardware Ethernet address These should be set to the serial -number of your SVME/DMV-176/177 card to ensure a unique Ethernet -address on your network. The three high bytes are hard coded in the -BSP and represent the vendor-specific Ethernet codes (0x00, 0x80, 0x7F). -Together these six bytes form the target's Ethernet address. - -Address is of the form ... - -NOTE: The serial number is found on the packaging (box) that the -board came in OR it is also located on the solder side of the board and -looks something like SERNO:XXXXXX. It can not be determined dynamically -by software. - -Prior to using the Ethernet controller on the SVME/DMV-176/177 for the -first time, the Ethernet address bytes must be programmed into the -Serial EEPROM on the target card. The 'emm' (EEPROM Memory Modification) -command in the General Purpose Monitor (GPM) can be used to do this. - -In this example we will assume that the serial number of the target card -is 123456. - - - diff --git a/c/src/lib/libbsp/powerpc/dmv177/STATUS b/c/src/lib/libbsp/powerpc/dmv177/STATUS deleted file mode 100644 index 394412421e..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/STATUS +++ /dev/null @@ -1,82 +0,0 @@ -# -# This is a status file for the update effort. -# - -make/custom -=========== -dmv17x.cfg - -TOP -=== -README -Makefile.in -bsp_specs - -clock -===== -clock.c -Makefile.in - -console -======= -Changed console from - duart.c - console.c -To - consolebsp.h - console.c - 85c30.c - tbl85c30.c - -Note: Check the number of serial ports and modify - tbl85c30.c values to indicate the correct values. - -Makefile.in - Modified with new file names. - -timer -======= -timer.c -Makefile.in - -include -======= -chain.h -dmv170.h -bsp.h -Makefile -Makefile.in -coverhd.h - -network -======= -Eric's problem - -startup -======= -device-tree - remove -linkcmds -setvec.c - Modified to acount for general purpose vector. -sbrk.c - Ok -rtems-ctor.cc - Ok -bspclean.s - Ok -vmeintr.c -Makefile.in - Added genpvec.c -bspstart.c - Modified with changes from vista bsp. - -Added: -genpvec.c - -Note: Need to add routine which connects the general purpose interupt with the - various interupt handlers. genpvec.c uses this routine and may need - to be modified. -wrapup -======= -wrapup/Makefile.in - -vectors -======= - -start -======= -start/Makefile.in -start/start.s - Made modifications based upon Score603e mods. diff --git a/c/src/lib/libbsp/powerpc/dmv177/bsp_specs b/c/src/lib/libbsp/powerpc/dmv177/bsp_specs deleted file mode 100644 index ab5a8ddbeb..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/bsp_specs +++ /dev/null @@ -1,23 +0,0 @@ -%rename cpp old_cpp -%rename lib old_lib -%rename endfile old_endfile -%rename startfile old_startfile -%rename link old_link - -*cpp: -%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded) - -*lib: -%{!qrtems: %(old_lib)} %{qrtems: --start-group \ -%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \ --lc -lgcc --end-group ecrtn%O%s \ -%{!qnolinkcmds: -T linkcmds%s}} - -*startfile: -%{!qrtems: %(old_startfile)} %{qrtems: ecrti%O%s \ -%{!qrtems_debug: start.o%s} \ -%{qrtems_debug: start_g.o%s}} - -*link: -%{!qrtems: %(old_link)} %{qrtems: -Qy -dp -Bstatic -T linkcmds%s -e _start -u __vectors} - diff --git a/c/src/lib/libbsp/powerpc/dmv177/cable.doc b/c/src/lib/libbsp/powerpc/dmv177/cable.doc deleted file mode 100644 index e77fbd9a95..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/cable.doc +++ /dev/null @@ -1,97 +0,0 @@ -# -# Cable information for the DY-4 DMV177 -# -# $Id$ -# - -Background -========== - -All serial cables described in this file were built using RJ-45 ribbon -cables which were plugged into DB-25 or DB-9 adapters wired as described. -Matching the colors of the wires in the shell is the easiest way to -make sure the cable is built properly. - -The board is configured as follows: - - - An MC68681 is the first two serial ports. These are RS-232 and may - be accessed via the front panel or the P2. The front panel connector - has both A and B serial ports on a single connector. DY-4 part number - "OBYC3ASSY901132-000 Rev-" brings these ports out to two DB-25 - female connectors. - - - The MC68681 serial ports are also accessible on the P2 connector. - DY-4 part number "OBYC3ASSY901080-004 Rev A" brings these out - to DB-9 female connectors. These were not used in this effort. - - - A Z85C30 is used for the third and fourth serial ports. These are - RS-422 and may only be accessed via the P2 connector. These are - brought out to DB-25 male connectors. An RS-422 to RS-232 converter - was used to interface with these serial ports. - -References -========== - - - Linux Serial FAQ - - http://ahmed.egypt.com/electronics/serial - - DY-4 Documentation - -RS-422 Converter -================ - -An RS-422 to RS-232 converter from B&B Electronics was used to -adapt the RS-422 signals so they could be used with a normal -RS-232 serial port. Here is the information required to purchase -one of these: - - RS-232/RS-422 Converter: Model 422LCON - Power Supply: Model 422PS - - B&B Electronics Manufacturing Company - 707 Dayton Road - PO Box 1040 - Ottawa, IL 61350 - Voice: (815) 433-5100 - FAX: (815)434-7094 - - -Front Panel RS-232 Connection to a PC -===================================== - - Board's DB-25 PC's DB-9 Color in - Channel A COM1 Shell - ============= ============ ========= - RX on pin 2 TX on pin 2 Red - TX on pin 3 RX on pin 3 Blue - GND on pin 7 GND on pin 5 Black - DTR on pin 20 DTR on pin 4 Brown - - No other signals are used. - -RS-422 Connection to a PC -========================= - -This requires two cables with the converter connecting them. - -P2 RS-422 to the RS-422/RS-232 Converter -======================================== - - Board's Converter's Color in - DB-25 RS-422 DB-25 Shell - =============== ============== ======== - TXD_A on pin 2 RDA on pin 5 Red - TXD_B on pin 14 RDB on pin 17 Blue - RX_A on pin 3 TDA on pin 2 Brown - RX_B on pin 16 TDB on pin 14 Green - GND on pin 7 GND on pin 7 Black - - - Converter's PC's DB-9 Color in - RS-232 DB-25 COM1 Shell - =============== ============== ======== - TX on pin 2 TX on pin 2 Blue - RX on pin 3 RX on pin 3 Red - GND on pin 5 GND on pin 5 Black - DTR on pin 4 DTR on pin 4 Brown - - No other signals diff --git a/c/src/lib/libbsp/powerpc/dmv177/clock/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/clock/Makefile.in deleted file mode 100644 index 7c2cfc0772..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/clock/Makefile.in +++ /dev/null @@ -1,59 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/clock.rel - -# C source names, if any, go here -- minus the .c -C_PIECES=clock -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES= -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -${PGM}: ${SRCS} ${OBJS} - $(make-rel) - -all: ${ARCH} $(SRCS) $(PGM) - -# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile -install: all diff --git a/c/src/lib/libbsp/powerpc/dmv177/clock/clock.c b/c/src/lib/libbsp/powerpc/dmv177/clock/clock.c deleted file mode 100644 index 75490a3382..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/clock/clock.c +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Clock Tick Device Driver - * - * This routine utilizes the Decrementer Register common to the PPC family. - * - * The tick frequency is directly programmed to the configured number of - * microseconds per tick. - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <stdlib.h> - -#include <bsp.h> -#include <rtems/libio.h> - -extern rtems_cpu_table Cpu_table; - -/* - * The Real Time Clock Counter Timer uses this trap type. - */ - -#define CLOCK_VECTOR PPC_IRQ_DECREMENTER - -/* - * Clock ticks since initialization - */ - -volatile rtems_unsigned32 Clock_driver_ticks; - -/* - * This is the value programmed into the count down timer. - */ - -rtems_unsigned32 Clock_Decrementer_value; - -/* - * This is the value of the old isr routine. - */ -rtems_isr_entry Old_ticker; - - -void Clock_exit( void ); - -/* - * These are set by clock driver during its init - */ - -rtems_device_major_number rtems_clock_major = ~0; -rtems_device_minor_number rtems_clock_minor; - -/*PAGE - * - * Clock_isr - * - * This is the clock tick interrupt handler. - * - * Input parameters: - * vector - vector number - * - * Output parameters: NONE - * - * Return values: NONE - * - */ - -rtems_isr Clock_isr( - rtems_vector_number vector, - CPU_Interrupt_frame *frame -) -{ - /* - * Set the decrementer. - */ - - PPC_Set_decrementer( Clock_Decrementer_value ); - - /* - * The driver has seen another tick. - */ - - Clock_driver_ticks += 1; - - /* - * Real Time Clock counter/timer is set to automatically reload. - */ - - rtems_clock_tick(); -} - -/*PAGE - * - * Install_clock - * - * This routine actually performs the hardware initialization for the clock. - * - * Input parameters: - * clock_isr - clock interrupt service routine entry point - * - * Output parameters: NONE - * - * Return values: NONE - * - */ - -extern int CLOCK_SPEED; - -void Install_clock( - rtems_isr_entry clock_isr -) -{ - Clock_driver_ticks = 0; - - if ( BSP_Configuration.ticks_per_timeslice ) { - Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); - - PPC_Set_decrementer( Clock_Decrementer_value ); - - atexit( Clock_exit ); - } -} - -/*PAGE - * - * Clock_exit - * - * This routine allows the clock driver to exit by masking the interrupt and - * disabling the clock's counter. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: NONE - * - */ - -void Clock_exit( void ) -{ - if ( BSP_Configuration.ticks_per_timeslice ) { - - /* nothing to do */; - - /* do not restore old vector */ - } -} - -/*PAGE - * - * Clock_initialize - * - * This routine initializes the clock driver. - * - * Input parameters: - * major - clock device major number - * minor - clock device minor number - * parg - pointer to optional device driver arguments - * - * Output parameters: NONE - * - * Return values: - * rtems_device_driver status code - */ - -rtems_device_driver Clock_initialize( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *pargp -) -{ - Clock_Decrementer_value = Cpu_table.clicks_per_usec * - BSP_Configuration.microseconds_per_tick; - - Install_clock( Clock_isr ); - - /* - * make major/minor avail to others such as shared memory driver - */ - - rtems_clock_major = major; - rtems_clock_minor = minor; - - return RTEMS_SUCCESSFUL; -} - -/* PAGE - * - * Clock_control - * - * This routine is the clock device driver control entry point. - * - * Input parameters: - * major - clock device major number - * minor - clock device minor number - * parg - pointer to optional device driver arguments - * - * Output parameters: NONE - * - * Return values: - * rtems_device_driver status code - */ - -rtems_device_driver Clock_control( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *pargp -) -{ - rtems_unsigned32 isrlevel; - rtems_libio_ioctl_args_t *args = pargp; - - if (args == 0) - goto done; - - /* - * This is hokey, but until we get a defined interface - * to do this, it will just be this simple... - */ - - if (args->command == rtems_build_name('I', 'S', 'R', ' ')) - { - Clock_isr( CLOCK_VECTOR, pargp ); - } - else if (args->command == rtems_build_name('N', 'E', 'W', ' ')) - { - rtems_interrupt_disable( isrlevel ); - (void) set_vector( args->buffer, CLOCK_VECTOR, 1 ); - rtems_interrupt_enable( isrlevel ); - } - -done: - return RTEMS_SUCCESSFUL; -} - - - - - diff --git a/c/src/lib/libbsp/powerpc/dmv177/console/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/console/Makefile.in deleted file mode 100644 index 261eb79a82..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/console/Makefile.in +++ /dev/null @@ -1,54 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@:@srcdir@/../../../shared -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/console.rel - -# C source names, if any, go here -- minus the .c -C_PIECES=config console debugio -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -SRCS=$(C_FILES) $(H_FILES) -OBJS=$(C_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -${PGM}: ${SRCS} ${OBJS} - $(make-rel) - -all: ${ARCH} $(SRCS) $(PGM) - -# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile -install: all diff --git a/c/src/lib/libbsp/powerpc/dmv177/console/config.c b/c/src/lib/libbsp/powerpc/dmv177/console/config.c deleted file mode 100644 index e3a0eb073f..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/console/config.c +++ /dev/null @@ -1,283 +0,0 @@ -/* - * This file contains the TTY driver table for the DY-4 DMV177. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * $Id$ - */ - -#include <bsp.h> - -#include <libchip/serial.h> -#include <libchip/mc68681.h> -#include <libchip/z85c30.h> - -/* - * Configuration specific probe routines - * - * - * NOTE: There are no DMV177 specific configuration routines. These - * routines could be written to dynamically determine which serial - * ports are on a board. Debugging this would require access to - * multiple board models. - */ - -/* NONE CURRENTLY PROVIDED */ - -/* - * The following table configures the console drivers used in this BSP. - * - * The first entry which, when probed, is available, will be named /dev/console, - * all others being given the name indicated. - */ - -mc68681_baud_t - dmv177_mc68681_baud_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES] = { - { /* ACR[7] = 0, X = 0 */ - MC68681_BAUD_NOT_VALID, /* B0 */ - MC68681_BAUD_NOT_VALID, /* B50 */ - 0x01, /* B75 */ - MC68681_BAUD_NOT_VALID, /* B110 */ - 0x03, /* B134 */ - MC68681_BAUD_NOT_VALID, /* B150 */ - 0x04, /* B200 */ - MC68681_BAUD_NOT_VALID, /* B300 */ - MC68681_BAUD_NOT_VALID, /* B600 */ - MC68681_BAUD_NOT_VALID, /* B1200 */ - MC68681_BAUD_NOT_VALID, /* B1800 */ - MC68681_BAUD_NOT_VALID, /* B2400 */ - 0x0A, /* B4800 */ - MC68681_BAUD_NOT_VALID, /* B9600 */ - MC68681_BAUD_NOT_VALID, /* B19200 */ - MC68681_BAUD_NOT_VALID, /* B38400 */ - MC68681_BAUD_NOT_VALID, /* B57600 */ - MC68681_BAUD_NOT_VALID, /* B115200 */ - MC68681_BAUD_NOT_VALID, /* B230400 */ - MC68681_BAUD_NOT_VALID /* B460800 */ - }, - { /* ACR[7] = 1, X = 0 */ - MC68681_BAUD_NOT_VALID, /* B0 */ - 0x00, /* B50 */ - 0x01, /* B75 */ - MC68681_BAUD_NOT_VALID, /* B110 */ - MC68681_BAUD_NOT_VALID, /* B134 */ - MC68681_BAUD_NOT_VALID, /* B150 */ - 0x04, /* B200 */ - MC68681_BAUD_NOT_VALID, /* B300 */ - MC68681_BAUD_NOT_VALID, /* B600 */ - 0x0A, /* B1200 */ - MC68681_BAUD_NOT_VALID, /* B1800 */ - MC68681_BAUD_NOT_VALID, /* B2400 */ - MC68681_BAUD_NOT_VALID, /* B4800 */ - MC68681_BAUD_NOT_VALID, /* B9600 */ - MC68681_BAUD_NOT_VALID, /* B19200 */ - MC68681_BAUD_NOT_VALID, /* B38400 */ - MC68681_BAUD_NOT_VALID, /* B57600 */ - MC68681_BAUD_NOT_VALID, /* B115200 */ - MC68681_BAUD_NOT_VALID, /* B230400 */ - MC68681_BAUD_NOT_VALID /* B460800 */ - }, - { /* ACR[7] = 0, X = 1 */ - MC68681_BAUD_NOT_VALID, /* B0 */ - 0x00, /* B50 */ - 0x01, /* B75 */ - MC68681_BAUD_NOT_VALID, /* B110 */ - MC68681_BAUD_NOT_VALID, /* B134 */ - MC68681_BAUD_NOT_VALID, /* B150 */ - MC68681_BAUD_NOT_VALID, /* B200 */ - MC68681_BAUD_NOT_VALID, /* B300 */ - MC68681_BAUD_NOT_VALID, /* B600 */ - MC68681_BAUD_NOT_VALID, /* B1200 */ - MC68681_BAUD_NOT_VALID, /* B1800 */ - 0x04, /* B2400 */ - MC68681_BAUD_NOT_VALID, /* B4800 */ - 0x05, /* B9600 */ - 0x06, /* B19200 */ - 0x07, /* B38400 */ - MC68681_BAUD_NOT_VALID, /* B57600 */ - MC68681_BAUD_NOT_VALID, /* B115200 */ - MC68681_BAUD_NOT_VALID, /* B230400 */ - MC68681_BAUD_NOT_VALID /* B460800 */ - }, - { /* ACR[7] = 1, X = 1 */ - MC68681_BAUD_NOT_VALID, /* B0 */ - MC68681_BAUD_NOT_VALID, /* B50 */ - 0x01, /* B75 */ - MC68681_BAUD_NOT_VALID, /* B110 */ - 0x03, /* B134 */ - MC68681_BAUD_NOT_VALID, /* B150 */ - MC68681_BAUD_NOT_VALID, /* B200 */ - MC68681_BAUD_NOT_VALID, /* B300 */ - MC68681_BAUD_NOT_VALID, /* B600 */ - MC68681_BAUD_NOT_VALID, /* B1200 */ - MC68681_BAUD_NOT_VALID, /* B1800 */ - 0x04, /* B2400 */ - 0x0A, /* B4800 */ - 0x05, /* B9600 */ - 0x06, /* B19200 */ - 0x07, /* B38400 */ - MC68681_BAUD_NOT_VALID, /* B57600 */ - MC68681_BAUD_NOT_VALID, /* B115200 */ - MC68681_BAUD_NOT_VALID, /* B230400 */ - MC68681_BAUD_NOT_VALID /* B460800 */ - }, -}; - -#define MC68681_PORT_CONFIG \ - (MC68681_DATA_BAUD_RATE_SET_1|MC68681_XBRG_ENABLED) - -/* - * Based on BSP configuration information decide whether to do polling IO - * or interrupt driven IO. - */ - -#if (CONSOLE_USE_INTERRUPTS) -#define MC68681_FUNCTIONS &mc68681_fns -#define Z85C30_FUNCTIONS &z85c30_fns -#else -#define MC68681_FUNCTIONS &mc68681_fns_polled -#define Z85C30_FUNCTIONS &z85c30_fns_polled -#endif - -boolean dmv177_z85c30_probe(int minor); -boolean dmv177_mc68681_probe(int minor); - -console_tbl Console_Port_Tbl[] = { - { - "/dev/com0", /* sDeviceName */ - SERIAL_MC68681, /* deviceType */ - MC68681_FUNCTIONS, /* pDeviceFns */ - dmv177_mc68681_probe, /* deviceProbe */ - NULL, /* pDeviceFlow */ - 16, /* ulMargin */ - 8, /* ulHysteresis */ - (void *)9600, /* baud rate */ /* pDeviceParams */ - MC68681_ADDR, /* ulCtrlPort1 */ - MC68681_PORT1_ADDR, /* ulCtrlPort2 */ - MC68681_PORT_CONFIG, /* ulDataPort */ - mc68681_get_register_8, /* getRegister */ - mc68681_set_register_8, /* setRegister */ - NULL, /* unused */ /* getData */ - NULL, /* unused */ /* setData */ - (unsigned32)dmv177_mc68681_baud_table, /* ulClock */ - DMV170_DUART_IRQ /* ulIntVector */ - }, - { - "/dev/com1", /* sDeviceName */ - SERIAL_MC68681, /* deviceType */ - MC68681_FUNCTIONS, /* pDeviceFns */ - dmv177_mc68681_probe, /* deviceProbe */ - NULL, /* pDeviceFlow */ - 16, /* ulMargin */ - 8, /* ulHysteresis */ - (void *)9600, /* baud rate */ /* pDeviceParams */ - MC68681_ADDR, /* ulCtrlPort1 */ - MC68681_PORT2_ADDR, /* ulCtrlPort2 */ - MC68681_PORT_CONFIG, /* ulDataPort */ - mc68681_get_register_8, /* getRegister */ - mc68681_set_register_8, /* setRegister */ - NULL, /* unused */ /* getData */ - NULL, /* unused */ /* setData */ - (unsigned32)dmv177_mc68681_baud_table, /* ulClock */ - DMV170_DUART_IRQ /* ulIntVector */ - }, - { - "/dev/com3", /* sDeviceName */ - SERIAL_Z85C30, /* deviceType */ - Z85C30_FUNCTIONS, /* pDeviceFns */ - dmv177_z85c30_probe, /* deviceProbe */ - NULL, /* pDeviceFlow */ - 16, /* ulMargin */ - 8, /* ulHysteresis */ - (void *)9600, /* baud rate */ /* pDeviceParams */ - Z85C30_CTRL_A, /* ulCtrlPort1 */ - Z85C30_CTRL_A, /* ulCtrlPort2 */ - 0, /* ulDataPort */ - z85c30_get_register, /* getRegister */ - z85c30_set_register, /* setRegister */ - NULL, /* getData */ - NULL, /* setData */ - 0, /* filled in by probe */ /* ulClock */ - DMV170_SCC_IRQ /* ulIntVector */ - }, - { - "/dev/com4", /* sDeviceName */ - SERIAL_Z85C30, /* deviceType */ - Z85C30_FUNCTIONS, /* pDeviceFns */ - dmv177_z85c30_probe, /* deviceProbe */ - NULL, /* pDeviceFlow */ - 16, /* ulMargin */ - 8, /* ulHysteresis */ - (void *)9600, /* baud rate */ /* pDeviceParams */ - Z85C30_CTRL_B, /* ulCtrlPort1 */ - Z85C30_CTRL_A, /* ulCtrlPort2 */ - 0, /* ulDataPort */ - z85c30_get_register, /* getRegister */ - z85c30_set_register, /* setRegister */ - NULL, /* getData */ - NULL, /* setData */ - 0, /* filled in by probe */ /* ulClock */ - DMV170_SCC_IRQ /* ulIntVector */ - } -}; - -/* - * Declare some information used by the console driver - */ - -#define NUM_CONSOLE_PORTS (sizeof(Console_Port_Tbl)/sizeof(console_tbl)) - -unsigned long Console_Port_Count = NUM_CONSOLE_PORTS; - -console_data Console_Port_Data[NUM_CONSOLE_PORTS]; - -rtems_device_minor_number Console_Port_Minor; - -/* - * Hopefully, by checking the card resource register, this BSP - * will be able to operate on the DMV171, DMV176, or DMV177. - */ - -boolean dmv177_z85c30_probe(int minor) -{ - volatile unsigned32 *dma_control_status_reg; - volatile unsigned16 *card_resource_reg; - unsigned16 v; - - card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG; - - v = *card_resource_reg & DMV170_SCC_INST_MASK; - - if ( v != DMV170_SCC_INSTALLED ) - return FALSE; - - /* - * Figure out the clock speed of the Z85C30 SCC - */ - - dma_control_status_reg = (volatile unsigned32 *)DMV170_DMA_CONTROL_STATUS_REG; - - if ( *dma_control_status_reg & DMV170_SCC_10MHZ ) - Console_Port_Tbl[minor].ulClock = Z85C30_CLOCK_10; - else - Console_Port_Tbl[minor].ulClock = Z85C30_CLOCK_2; - - return TRUE; -} - -boolean dmv177_mc68681_probe(int minor) -{ - volatile unsigned16 *card_resource_reg; - unsigned16 v; - - card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG; - - v = *card_resource_reg & DMV170_DUART_INST_MASK; - - if ( v == DMV170_DUART_INSTALLED ) - return TRUE; - - return FALSE; -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c b/c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c deleted file mode 100644 index e3a0eb073f..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/console/conscfg.c +++ /dev/null @@ -1,283 +0,0 @@ -/* - * This file contains the TTY driver table for the DY-4 DMV177. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * $Id$ - */ - -#include <bsp.h> - -#include <libchip/serial.h> -#include <libchip/mc68681.h> -#include <libchip/z85c30.h> - -/* - * Configuration specific probe routines - * - * - * NOTE: There are no DMV177 specific configuration routines. These - * routines could be written to dynamically determine which serial - * ports are on a board. Debugging this would require access to - * multiple board models. - */ - -/* NONE CURRENTLY PROVIDED */ - -/* - * The following table configures the console drivers used in this BSP. - * - * The first entry which, when probed, is available, will be named /dev/console, - * all others being given the name indicated. - */ - -mc68681_baud_t - dmv177_mc68681_baud_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES] = { - { /* ACR[7] = 0, X = 0 */ - MC68681_BAUD_NOT_VALID, /* B0 */ - MC68681_BAUD_NOT_VALID, /* B50 */ - 0x01, /* B75 */ - MC68681_BAUD_NOT_VALID, /* B110 */ - 0x03, /* B134 */ - MC68681_BAUD_NOT_VALID, /* B150 */ - 0x04, /* B200 */ - MC68681_BAUD_NOT_VALID, /* B300 */ - MC68681_BAUD_NOT_VALID, /* B600 */ - MC68681_BAUD_NOT_VALID, /* B1200 */ - MC68681_BAUD_NOT_VALID, /* B1800 */ - MC68681_BAUD_NOT_VALID, /* B2400 */ - 0x0A, /* B4800 */ - MC68681_BAUD_NOT_VALID, /* B9600 */ - MC68681_BAUD_NOT_VALID, /* B19200 */ - MC68681_BAUD_NOT_VALID, /* B38400 */ - MC68681_BAUD_NOT_VALID, /* B57600 */ - MC68681_BAUD_NOT_VALID, /* B115200 */ - MC68681_BAUD_NOT_VALID, /* B230400 */ - MC68681_BAUD_NOT_VALID /* B460800 */ - }, - { /* ACR[7] = 1, X = 0 */ - MC68681_BAUD_NOT_VALID, /* B0 */ - 0x00, /* B50 */ - 0x01, /* B75 */ - MC68681_BAUD_NOT_VALID, /* B110 */ - MC68681_BAUD_NOT_VALID, /* B134 */ - MC68681_BAUD_NOT_VALID, /* B150 */ - 0x04, /* B200 */ - MC68681_BAUD_NOT_VALID, /* B300 */ - MC68681_BAUD_NOT_VALID, /* B600 */ - 0x0A, /* B1200 */ - MC68681_BAUD_NOT_VALID, /* B1800 */ - MC68681_BAUD_NOT_VALID, /* B2400 */ - MC68681_BAUD_NOT_VALID, /* B4800 */ - MC68681_BAUD_NOT_VALID, /* B9600 */ - MC68681_BAUD_NOT_VALID, /* B19200 */ - MC68681_BAUD_NOT_VALID, /* B38400 */ - MC68681_BAUD_NOT_VALID, /* B57600 */ - MC68681_BAUD_NOT_VALID, /* B115200 */ - MC68681_BAUD_NOT_VALID, /* B230400 */ - MC68681_BAUD_NOT_VALID /* B460800 */ - }, - { /* ACR[7] = 0, X = 1 */ - MC68681_BAUD_NOT_VALID, /* B0 */ - 0x00, /* B50 */ - 0x01, /* B75 */ - MC68681_BAUD_NOT_VALID, /* B110 */ - MC68681_BAUD_NOT_VALID, /* B134 */ - MC68681_BAUD_NOT_VALID, /* B150 */ - MC68681_BAUD_NOT_VALID, /* B200 */ - MC68681_BAUD_NOT_VALID, /* B300 */ - MC68681_BAUD_NOT_VALID, /* B600 */ - MC68681_BAUD_NOT_VALID, /* B1200 */ - MC68681_BAUD_NOT_VALID, /* B1800 */ - 0x04, /* B2400 */ - MC68681_BAUD_NOT_VALID, /* B4800 */ - 0x05, /* B9600 */ - 0x06, /* B19200 */ - 0x07, /* B38400 */ - MC68681_BAUD_NOT_VALID, /* B57600 */ - MC68681_BAUD_NOT_VALID, /* B115200 */ - MC68681_BAUD_NOT_VALID, /* B230400 */ - MC68681_BAUD_NOT_VALID /* B460800 */ - }, - { /* ACR[7] = 1, X = 1 */ - MC68681_BAUD_NOT_VALID, /* B0 */ - MC68681_BAUD_NOT_VALID, /* B50 */ - 0x01, /* B75 */ - MC68681_BAUD_NOT_VALID, /* B110 */ - 0x03, /* B134 */ - MC68681_BAUD_NOT_VALID, /* B150 */ - MC68681_BAUD_NOT_VALID, /* B200 */ - MC68681_BAUD_NOT_VALID, /* B300 */ - MC68681_BAUD_NOT_VALID, /* B600 */ - MC68681_BAUD_NOT_VALID, /* B1200 */ - MC68681_BAUD_NOT_VALID, /* B1800 */ - 0x04, /* B2400 */ - 0x0A, /* B4800 */ - 0x05, /* B9600 */ - 0x06, /* B19200 */ - 0x07, /* B38400 */ - MC68681_BAUD_NOT_VALID, /* B57600 */ - MC68681_BAUD_NOT_VALID, /* B115200 */ - MC68681_BAUD_NOT_VALID, /* B230400 */ - MC68681_BAUD_NOT_VALID /* B460800 */ - }, -}; - -#define MC68681_PORT_CONFIG \ - (MC68681_DATA_BAUD_RATE_SET_1|MC68681_XBRG_ENABLED) - -/* - * Based on BSP configuration information decide whether to do polling IO - * or interrupt driven IO. - */ - -#if (CONSOLE_USE_INTERRUPTS) -#define MC68681_FUNCTIONS &mc68681_fns -#define Z85C30_FUNCTIONS &z85c30_fns -#else -#define MC68681_FUNCTIONS &mc68681_fns_polled -#define Z85C30_FUNCTIONS &z85c30_fns_polled -#endif - -boolean dmv177_z85c30_probe(int minor); -boolean dmv177_mc68681_probe(int minor); - -console_tbl Console_Port_Tbl[] = { - { - "/dev/com0", /* sDeviceName */ - SERIAL_MC68681, /* deviceType */ - MC68681_FUNCTIONS, /* pDeviceFns */ - dmv177_mc68681_probe, /* deviceProbe */ - NULL, /* pDeviceFlow */ - 16, /* ulMargin */ - 8, /* ulHysteresis */ - (void *)9600, /* baud rate */ /* pDeviceParams */ - MC68681_ADDR, /* ulCtrlPort1 */ - MC68681_PORT1_ADDR, /* ulCtrlPort2 */ - MC68681_PORT_CONFIG, /* ulDataPort */ - mc68681_get_register_8, /* getRegister */ - mc68681_set_register_8, /* setRegister */ - NULL, /* unused */ /* getData */ - NULL, /* unused */ /* setData */ - (unsigned32)dmv177_mc68681_baud_table, /* ulClock */ - DMV170_DUART_IRQ /* ulIntVector */ - }, - { - "/dev/com1", /* sDeviceName */ - SERIAL_MC68681, /* deviceType */ - MC68681_FUNCTIONS, /* pDeviceFns */ - dmv177_mc68681_probe, /* deviceProbe */ - NULL, /* pDeviceFlow */ - 16, /* ulMargin */ - 8, /* ulHysteresis */ - (void *)9600, /* baud rate */ /* pDeviceParams */ - MC68681_ADDR, /* ulCtrlPort1 */ - MC68681_PORT2_ADDR, /* ulCtrlPort2 */ - MC68681_PORT_CONFIG, /* ulDataPort */ - mc68681_get_register_8, /* getRegister */ - mc68681_set_register_8, /* setRegister */ - NULL, /* unused */ /* getData */ - NULL, /* unused */ /* setData */ - (unsigned32)dmv177_mc68681_baud_table, /* ulClock */ - DMV170_DUART_IRQ /* ulIntVector */ - }, - { - "/dev/com3", /* sDeviceName */ - SERIAL_Z85C30, /* deviceType */ - Z85C30_FUNCTIONS, /* pDeviceFns */ - dmv177_z85c30_probe, /* deviceProbe */ - NULL, /* pDeviceFlow */ - 16, /* ulMargin */ - 8, /* ulHysteresis */ - (void *)9600, /* baud rate */ /* pDeviceParams */ - Z85C30_CTRL_A, /* ulCtrlPort1 */ - Z85C30_CTRL_A, /* ulCtrlPort2 */ - 0, /* ulDataPort */ - z85c30_get_register, /* getRegister */ - z85c30_set_register, /* setRegister */ - NULL, /* getData */ - NULL, /* setData */ - 0, /* filled in by probe */ /* ulClock */ - DMV170_SCC_IRQ /* ulIntVector */ - }, - { - "/dev/com4", /* sDeviceName */ - SERIAL_Z85C30, /* deviceType */ - Z85C30_FUNCTIONS, /* pDeviceFns */ - dmv177_z85c30_probe, /* deviceProbe */ - NULL, /* pDeviceFlow */ - 16, /* ulMargin */ - 8, /* ulHysteresis */ - (void *)9600, /* baud rate */ /* pDeviceParams */ - Z85C30_CTRL_B, /* ulCtrlPort1 */ - Z85C30_CTRL_A, /* ulCtrlPort2 */ - 0, /* ulDataPort */ - z85c30_get_register, /* getRegister */ - z85c30_set_register, /* setRegister */ - NULL, /* getData */ - NULL, /* setData */ - 0, /* filled in by probe */ /* ulClock */ - DMV170_SCC_IRQ /* ulIntVector */ - } -}; - -/* - * Declare some information used by the console driver - */ - -#define NUM_CONSOLE_PORTS (sizeof(Console_Port_Tbl)/sizeof(console_tbl)) - -unsigned long Console_Port_Count = NUM_CONSOLE_PORTS; - -console_data Console_Port_Data[NUM_CONSOLE_PORTS]; - -rtems_device_minor_number Console_Port_Minor; - -/* - * Hopefully, by checking the card resource register, this BSP - * will be able to operate on the DMV171, DMV176, or DMV177. - */ - -boolean dmv177_z85c30_probe(int minor) -{ - volatile unsigned32 *dma_control_status_reg; - volatile unsigned16 *card_resource_reg; - unsigned16 v; - - card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG; - - v = *card_resource_reg & DMV170_SCC_INST_MASK; - - if ( v != DMV170_SCC_INSTALLED ) - return FALSE; - - /* - * Figure out the clock speed of the Z85C30 SCC - */ - - dma_control_status_reg = (volatile unsigned32 *)DMV170_DMA_CONTROL_STATUS_REG; - - if ( *dma_control_status_reg & DMV170_SCC_10MHZ ) - Console_Port_Tbl[minor].ulClock = Z85C30_CLOCK_10; - else - Console_Port_Tbl[minor].ulClock = Z85C30_CLOCK_2; - - return TRUE; -} - -boolean dmv177_mc68681_probe(int minor) -{ - volatile unsigned16 *card_resource_reg; - unsigned16 v; - - card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG; - - v = *card_resource_reg & DMV170_DUART_INST_MASK; - - if ( v == DMV170_DUART_INSTALLED ) - return TRUE; - - return FALSE; -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/console/debugio.c b/c/src/lib/libbsp/powerpc/dmv177/console/debugio.c deleted file mode 100644 index d23df205a3..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/console/debugio.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * This file contains the debug IO support. - * - * COPYRIGHT (c) 1998 by Radstone Technology - * - * - * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY - * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK - * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU. - * - * You are hereby granted permission to use, copy, modify, and distribute - * this file, provided that this notice, plus the above copyright notice - * and disclaimer, appears in all copies. Radstone Technology will provide - * no support for this code. - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <bsp.h> -#include <rtems/libio.h> -#include <stdlib.h> -#include <assert.h> -#include <termios.h> - -#include <libchip/serial.h> - -/* - * Load configuration table - */ - -extern console_data Console_Port_Data[]; -extern rtems_device_minor_number Console_Port_Minor; - -/* PAGE - * - * DEBUG_puts - * - * This should be safe in the event of an error. It attempts to ensure - * that no TX empty interrupts occur while it is doing polled IO. Then - * it restores the state of that external interrupt. - * - * Input parameters: - * string - pointer to debug output string - * - * Output parameters: NONE - * - * Return values: NONE - */ - -void DEBUG_puts( - char *string -) -{ - char *s; - unsigned32 Irql; - - rtems_interrupt_disable(Irql); - - for ( s = string ; *s ; s++ ) { - Console_Port_Tbl[Console_Port_Minor].pDeviceFns-> - deviceWritePolled(Console_Port_Minor, *s); - } - - rtems_interrupt_enable(Irql); -} - -/* PAGE - * - * DEBUG_puth - * - * This should be safe in the event of an error. It attempts to ensure - * that no TX empty interrupts occur while it is doing polled IO. Then - * it restores the state of that external interrupt. - * - * Input parameters: - * ulHexNum - value to display - * - * Output parameters: NONE - * - * Return values: NONE - */ - -void DEBUG_puth( - unsigned32 ulHexNum -) -{ - unsigned long i,d; - unsigned32 Irql; - void (*poll)(int minor, char cChar); - - poll = Console_Port_Tbl[Console_Port_Minor].pDeviceFns->deviceWritePolled; - - rtems_interrupt_disable(Irql); - - (*poll)(Console_Port_Minor, '0'); - (*poll)(Console_Port_Minor, 'x'); - - for ( i=32 ; i ; ) { - i -= 4; - d = (ulHexNum>>i)&0xf; - (*poll)(Console_Port_Minor, (d<=9) ? d+'0' : d+'a'-0xa); - } - rtems_interrupt_enable(Irql); -} - diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/include/Makefile.in deleted file mode 100644 index a711b3e1de..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/include/Makefile.in +++ /dev/null @@ -1,36 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -H_FILES = $(srcdir)/bsp.h $(srcdir)/coverhd.h \ - $(srcdir)/dmv170.h $(srcdir)/../../../shared/tod.h - -# -# Equate files are for including from assembly preprocessed by -# gm4 or gasp. No examples are provided except for those for -# other CPUs. The best way to generate them would be to -# provide a program which generates the constants used based -# on the C equivalents. -# -# If you add equate files, don't forget to uncomment the install line -# below. -# - -EQ_FILES = - -SRCS=$(H_FILES) $(EQ_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: $(SRCS) - $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE) diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/bsp.h b/c/src/lib/libbsp/powerpc/dmv177/include/bsp.h deleted file mode 100644 index f99211f8d3..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/include/bsp.h +++ /dev/null @@ -1,187 +0,0 @@ -/* bsp.h - * - * This include file contains all DY-4 DMV170 board IO definitions. - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - -#ifndef __DMV170_BSP_h -#define __DMV170_BSP_h - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef ASM -/* Definition of where to store registers in alignment handler */ -#define ALIGN_REGS 0x0140 - -#else -#include <rtems.h> -#include <console.h> -#include <clockdrv.h> -#include <console.h> -#include <iosupp.h> - -#include <dmv170.h> - -#if 0 -#define Enable_Debug() \ - DMV170_WRITE( 0xffffbd0c, 0 ) - -#define Debug_Entry( num ) \ - DMV170_WRITE( 0xffffbd06, num ) -#else -#define Enable_Debug() -#define Debug_Entry( num ) -#endif - -/* - * The following macro calculates the Baud constant. For the Z8530 chip. - */ -#define Z8530_Baud( _frequency, _clock_by, _baud_rate ) \ - ( (_frequency /( _clock_by * 2 * _baud_rate)) - 2) - - -/* - * Define the time limits for RTEMS Test Suite test durations. - * Long test and short test duration limits are provided. These - * values are in seconds and need to be converted to ticks for the - * application. - * - */ - -#define MAX_LONG_TEST_DURATION 300 /* 5 minutes = 300 seconds */ -#define MAX_SHORT_TEST_DURATION 3 /* 3 seconds */ - - -/* - * Stuff for Time Test 27 - */ - -#define MUST_WAIT_FOR_INTERRUPT 1 - -#define Install_tm27_vector( _handler ) \ - set_vector( (_handler), PPC_IRQ_DECREMENTER, 1 ) - -#define Cause_tm27_intr() \ - do { \ - unsigned32 _clicks = 1; \ - asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \ - } while (0) - -#define Clear_tm27_intr() \ - do { \ - unsigned32 _clicks = 0xffffffff; \ - unsigned32 _msr = 0; \ - _ISR_Set_level( 0 ); \ - asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \ - _msr &= ~0x8000; \ - asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \ - asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \ - } while (0) - -#define Lower_tm27_intr() \ - do { \ - unsigned32 _msr = 0; \ - _ISR_Set_level( 0 ); \ - asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \ - _msr |= 0x8002; \ - asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \ - } while (0) - -/* Constants */ - -/* - * Device Driver Table Entries - */ - -/* - * NOTE: Use the standard Console driver entry - */ - -/* - * NOTE: Use the standard Clock driver entry - */ - - -/* - * Information placed in the linkcmds file. - */ - -extern int RAM_START; -extern int RAM_END; -extern int RAM_SIZE; - -extern int PROM_START; -extern int PROM_END; -extern int PROM_SIZE; - -extern int CLOCK_SPEED; - -extern int end; /* last address in the program */ - -/* - * How many libio files we want - */ - -#define BSP_LIBIO_MAX_FDS 20 - -/* functions */ - -/* - * genvec.c - */ -rtems_isr_entry set_EE_vector( - rtems_isr_entry handler, /* isr routine */ - rtems_vector_number vector /* vector number */ -); -void initialize_external_exception_vector (); - -/* - * console.c - */ -void DEBUG_puts( char *string ); - -void BSP_fatal_return( void ); - - - -void bsp_start( void ); - -void bsp_cleanup( void ); - -rtems_isr_entry set_vector( /* returns old vector */ - rtems_isr_entry handler, /* isr routine */ - rtems_vector_number vector, /* vector number */ - int type /* RTEMS or RAW intr */ -); - -void BSP_fatal_return( void ); - -void bsp_spurious_initialize( void ); - -extern rtems_configuration_table BSP_Configuration; /* owned by BSP */ - -extern rtems_cpu_table Cpu_table; /* owned by BSP */ - -extern rtems_unsigned32 bsp_isr_level; - -extern int CPU_PPC_CLICKS_PER_MS; - -#endif /* ASM */ - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/coverhd.h b/c/src/lib/libbsp/powerpc/dmv177/include/coverhd.h deleted file mode 100644 index 451d13b706..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/include/coverhd.h +++ /dev/null @@ -1,134 +0,0 @@ -/* coverhd.h - * - * This include file has defines to represent the overhead associated - * with calling a particular directive from C. These are used in the - * Timing Test Suite to ignore the overhead required to pass arguments - * to directives. On some CPUs and/or target boards, this overhead - * is significant and makes it difficult to distinguish internal - * RTEMS execution time from that used to call the directive. - * This file should be updated after running the C overhead timing - * test. Once this update has been performed, the RTEMS Time Test - * Suite should be rebuilt to account for these overhead times in the - * timing results. - * - * NOTE: If these are all zero, then the times reported include - * calling overhead including passing of arguments. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * This material may be reproduced by or for the U.S. Government pursuant - * to the copyright license under the clause at DFARS 252.227-7013. This - * notice must appear in all copies of this file and its derivatives. - * - * $Id$ - */ - -/* - * - * Units are 100ns. - * - * These numbers are of questionable use, as they are developed by calling - * the routine many times, thus getting its entry veneer into the (small) - * cache on the 403GA. This in general is not true of the RTEMS timing - * tests, which usually call a routine only once, thus having no cache loaded - * advantage. - * - * Whether the directive times are useful after deducting the function call - * overhead is also questionable. The user is more interested generally - * in the total cost of a directive, not the cost if the procedure call - * is inlined! (In general this is not true). - * - * Andrew Bray 18/08/1995 - * - */ - -#ifndef __COVERHD_h -#define __COVERHD_h - -#ifdef __cplusplus -extern "C" { -#endif - -#define CALLING_OVERHEAD_INITIALIZE_EXECUTIVE 0 -#define CALLING_OVERHEAD_SHUTDOWN_EXECUTIVE 0 -#define CALLING_OVERHEAD_TASK_CREATE 0 -#define CALLING_OVERHEAD_TASK_IDENT 0 -#define CALLING_OVERHEAD_TASK_START 0 -#define CALLING_OVERHEAD_TASK_RESTART 0 -#define CALLING_OVERHEAD_TASK_DELETE 0 -#define CALLING_OVERHEAD_TASK_SUSPEND 0 -#define CALLING_OVERHEAD_TASK_RESUME 0 -#define CALLING_OVERHEAD_TASK_SET_PRIORITY 0 -#define CALLING_OVERHEAD_TASK_MODE 0 -#define CALLING_OVERHEAD_TASK_GET_NOTE 0 -#define CALLING_OVERHEAD_TASK_SET_NOTE 0 -#define CALLING_OVERHEAD_TASK_WAKE_WHEN 0 -#define CALLING_OVERHEAD_TASK_WAKE_AFTER 0 -#define CALLING_OVERHEAD_INTERRUPT_CATCH 0 -#define CALLING_OVERHEAD_CLOCK_GET 0 -#define CALLING_OVERHEAD_CLOCK_SET 0 -#define CALLING_OVERHEAD_CLOCK_TICK 0 - -#define CALLING_OVERHEAD_TIMER_CREATE 0 -#define CALLING_OVERHEAD_TIMER_IDENT 0 -#define CALLING_OVERHEAD_TIMER_DELETE 0 -#define CALLING_OVERHEAD_TIMER_FIRE_AFTER 0 -#define CALLING_OVERHEAD_TIMER_FIRE_WHEN 0 -#define CALLING_OVERHEAD_TIMER_RESET 0 -#define CALLING_OVERHEAD_TIMER_CANCEL 0 -#define CALLING_OVERHEAD_SEMAPHORE_CREATE 0 -#define CALLING_OVERHEAD_SEMAPHORE_IDENT 0 -#define CALLING_OVERHEAD_SEMAPHORE_DELETE 0 -#define CALLING_OVERHEAD_SEMAPHORE_OBTAIN 0 -#define CALLING_OVERHEAD_SEMAPHORE_RELEASE 0 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE 0 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT 0 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE 0 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_SEND 0 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT 0 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST 0 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE 0 -#define CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH 0 - -#define CALLING_OVERHEAD_EVENT_SEND 0 -#define CALLING_OVERHEAD_EVENT_RECEIVE 0 -#define CALLING_OVERHEAD_SIGNAL_CATCH 0 -#define CALLING_OVERHEAD_SIGNAL_SEND 0 -#define CALLING_OVERHEAD_PARTITION_CREATE 0 -#define CALLING_OVERHEAD_PARTITION_IDENT 0 -#define CALLING_OVERHEAD_PARTITION_DELETE 0 -#define CALLING_OVERHEAD_PARTITION_GET_BUFFER 0 -#define CALLING_OVERHEAD_PARTITION_RETURN_BUFFER 0 -#define CALLING_OVERHEAD_REGION_CREATE 0 -#define CALLING_OVERHEAD_REGION_IDENT 0 -#define CALLING_OVERHEAD_REGION_DELETE 0 -#define CALLING_OVERHEAD_REGION_GET_SEGMENT 0 -#define CALLING_OVERHEAD_REGION_RETURN_SEGMENT 0 -#define CALLING_OVERHEAD_PORT_CREATE 0 -#define CALLING_OVERHEAD_PORT_IDENT 0 -#define CALLING_OVERHEAD_PORT_DELETE 0 -#define CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL 0 -#define CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL 0 - -#define CALLING_OVERHEAD_IO_INITIALIZE 0 -#define CALLING_OVERHEAD_IO_OPEN 0 -#define CALLING_OVERHEAD_IO_CLOSE 0 -#define CALLING_OVERHEAD_IO_READ 0 -#define CALLING_OVERHEAD_IO_WRITE 0 -#define CALLING_OVERHEAD_IO_CONTROL 0 -#define CALLING_OVERHEAD_FATAL_ERROR_OCCURRED 0 -#define CALLING_OVERHEAD_RATE_MONOTONIC_CREATE 0 -#define CALLING_OVERHEAD_RATE_MONOTONIC_IDENT 0 -#define CALLING_OVERHEAD_RATE_MONOTONIC_DELETE 0 -#define CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL 0 -#define CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD 0 -#define CALLING_OVERHEAD_MULTIPROCESSING_ANNOUNCE 0 - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h b/c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h deleted file mode 100644 index b676dafe0c..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/include/dmv170.h +++ /dev/null @@ -1,290 +0,0 @@ -/* dmv170.h - * - * This include file contains information pertaining to the DMV170. - * - * NOTE: Other than where absolutely required, this version currently - * supports only the peripherals and bits used by the basic board - * support package. This includes at least significant pieces of - * the following items: - * - * + UART Channels A and B - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef _INCLUDE_DMV170_h -#define _INCLUDE_DMV170_h - - -/* - * DY-4 uses a non-standard clock for the Exar 88681. - */ - -#undef MC68681_BAUD_RATE_MASK_9600 -#define MC68681_BAUD_RATE_MASK_9600 - -#define DMV17x_MC68681_BAUD_RATE_MASK_9600 - -#if 0 -#define MC68681_OFFSET_MULTIPLIER 8 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Note: Move address defs to the linker files. XXX */ - -/* Real Time Clock Base Address */ -#define DMV170_RTC_ADDRESS 0xf2c00000 - -/* base address of the DUART (68681) */ -#define MC68681_ADDR 0xf2800000 -#define MC68681_PORT1_ADDR 0xf2800000 -#define MC68681_PORT2_ADDR 0xf2800040 - -/* - * SONIC Information - */ - -#define DMV170_SONIC_ADDR 0xf3000000 - -#define SONIC_BASE_ADDRESS DMV170_SONIC_ADDR -#define SONIC_VECTOR DMV170_ETHERNET_IRQ - -/* base address for the SCC (85C30) */ -#define Z85C30_ADDR 0xfb000010 -#define Z85C30_CTRL_A 0xfb000010 -#define Z85C30_DATA_A 0xfb000018 -#define Z85C30_CTRL_B 0xfb000000 -#define Z85C30_DATA_B 0xfb000008 -#define Z85C30_CLOCK_10 (10485760) /* 10 Mhz */ -#define Z85C30_CLOCK_2 (2581175) /* 2.4616 Mhz */ - -/* base address for the SCV64 */ -#define DMV170_SCV64_BASE_ADDRESS 0xf2000000 - -#define DMV170_LOCAL_CONTROL_STATUS_REG 0xf2400000 -#define DMV170_TIMER0_COUNT_INTERVAL_REG 0xf2400008 -#define DMV170_TIMER1_COUNT_INTERVAL_REG 0xf2400010 -#define DMV170_TIMER2_COUNT_INTERVAL_REG 0xf2400018 -#define DMV170_TIMER_CONTROL_REG 0xf2400020 -#define DMV170_CARD_RESORCE_REG 0xf2400040 - -#define DMV170_WRITE( _reg, _data ) \ - *((volatile rtems_unsigned16 *)(_reg)) = (_data) - -#define DMV170_READ( _reg, _data ) \ - (_data) = *((volatile rtems_unsigned16 *)(_reg)) - -/* - * The following defines the bits in the DMA Control and Status Register - */ - -/* XXX fill in the other bits */ - -#define DMV170_DMA_CONTROL_STATUS_REG 0xfc000090 - -#define DMV170_SCC_10MHZ 0x00010000 - -/* - * The following defines the bits in the Local Control and Status Register. - */ -#define DMV170_IPLx_MASK 0x0007 -#define DMV170_MAXPACK_SENSE_MASK 0x0008 -#define DMV170_MAXPACK_NOT_INSTALLED 0x0008 -#define DMV170_MAXPACK_INSTALLED 0x0000 - -#define DMV170_MAXPACK_RESET_MASK 0x0010 -#define DMV170_MAXPACK_RESET_NEGATE 0x0010 -#define DMV170_MAXPACK_RESET_ASSERT 0x0000 -#define DMV170_EEPROM_READ_WRITE_MASK 0x0020 -#define DMV170_EEPROM_READ 0x0020 -#define DMV170_EEPROM_WRITE 0x0000 -#define DMV170_EEPROM_CLOCK_CTRL_MASK 0x0040 -#define DMV170_EEPROM_CLOCK_ASSERT 0x0040 -#define DMV170_EEPROM_CLOCK_NEGATE 0x0000 -#define DMV170_EEPROM_DATA_MASK 0x0080 -#define DMV170_EEPROM_DATA_HIGH 0x0080 -#define DMV170_EEPROM_DATA_LOW 0x0000 - -/* Bits 8-10: 68040 Transfer Modifer Codes represent the Transfer - * Modifier to be used on MAXPack Accesses. - * - * Bit 11 : 68040 Transfer Type (TT) 0:TT are both low 1:TT are both high - */ - -#define DMV170_USER_LINK0_STATUS_MASK 0x1000 -#define DMV170_USER_LINK0_OPEN 0x1000 -#define DMV170_USER_LINK0_INSTALLED 0x0000 -#define DMV170_LOWER_STATUS_LED_CONTROL_MASK 0x2000 -#define DMV170_LOWER_STATUS_LED_IS_OFF 0x2000 -#define DMV170_LOWER_STATUS_LED_IS_ON 0x0000 -#ifdef DMV176 - /* The following are not available for the DMV171 */ -#define DMV170_RAM_TYPE_MASK 0x4000 -#define DMV170_RAM_TYPE_IS_DRAM 0x4000 -#define DMV170_RAM_TYPE_IS_SRAM 0x0000 -#define DMV170_IACK_VECTOR_AUTOVECTOR_MASK 0x8000 -#define DMV170_IACK_VECTOR_AUTOVECTOR_IS_VECTOR 0x8000 -#define DMV170_IACK_VECTOR_AUTOVECTOR_IS_NOT_VECTOR 0x0000 -#endif - -/* - * The following defines the bits in the Timer Control Register. - */ - -#define DMV170_TIMER0_ENABLE_MASK 0x0001 -#define DMV170_TIMER0_IS_ENABLED 0x0001 -#define DMV170_TIMER0_IS_DISABLED 0x0000 -#define DMV170_TIMER1_ENABLE_MASK 0x0002 -#define DMV170_TIMER1_IS_ENABLED 0x0002 -#define DMV170_TIMER1_IS_DISABLED 0x0000 -#define DMV170_TIMER2_ENABLE_MASK 0x0004 -#define DMV170_TIMER2_IS_ENABLED 0x0004 -#define DMV170_TIMER2_IS_DISABLED 0x0000 -#define DMV170_TIMER1_CLOCK_MASK 0x0008 -#define DMV170_TIMER1_CLOCK_AT_TIMER0 0x0008 -#define DMV170_TIMER1_CLOCK_AT_1MHZ 0x0000 - -#define DMV170_TIMER2_CLOCK_MASK 0x0010 -#define DMV170_TIMER2_CLOCK_AT_TIMER0 0x0010 -#define DMV170_TIMER2_CLOCK_AT_1MHZ 0x0000 -#define DMV170_TIMER0_INTERRUPT_MASK 0x0020 -#define DMV170_TIMER0_INTERRUPT_ENABLE 0x0020 -#define DMV170_TIMER0_INTERRUPT_CLEAR 0x0000 -#define DMV170_TIMER1_INTERRUPT_MASK 0x0040 -#define DMV170_TIMER1_INTERRUPT_ENABLE 0x0040 -#define DMV170_TIMER1_INTERRUPT_CLEAR 0x0000 -#define DMV170_TIMER2_INTERRUPT_MASK 0x0080 -#define DMV170_TIMER2_INTERRUPT_ENABLE 0x0080 -#define DMV170_TIMER2_INTERRUPT_CLEAR 0x0000 - -/* - * The Following define the bits for the Card Resource Register. - */ - -#define DMV170_DUART_INTERRUPT_MASK 0x0001 /* DUART Interrupt Sense Bit */ -#define DMV170_DUART_INTERRUPT_NEGATE 0x0001 -#define DMV170_DUART_INTERRUPT_ASSERT 0x0000 -#define DMV170_SONIC_INTERRUPT_MASK 0x0002 /* SONIC Interrupt Sense Bit */ -#define DMV170_SONIC_INTERRUPT_NEGATE 0x0002 -#define DMV170_SONIC_INTERRUPT_ASSERT 0x0000 -#define DMV170_SCSI_INTERRUPT_MASK 0x0004 /* SCSI Interrupt Sense Bit */ -#define DMV170_SCSI_INTERRUPT_NEGATE 0x0004 -#define DMV170_SCSI_INTERRUPT_ASSERT 0x0000 -#define DMV170_SCC_INTERRUPT_MASK 0x0008 /* SCC Interrupt Sense Bit */ -#define DMV170_SCC_INTERRUPT_NEGATE 0x0008 -#define DMV170_SCC_INTERRUPT_ASSERT 0x0000 -#define DMV170_SNOOP_ENABLE_MASK 0x0010 /* CPU Snoop Enable Bit */ -#define DMV170_SNOOP_DISABLE 0x0010 -#define DMV170_SNOOP_ENABLE 0x0000 -#define DMV170_SONIC_RESET_MASK 0x0020 /* SONIC RESET Control */ -#define DMV170_SONIC_RESET_CLEAR 0x0020 -#define DMV170_SONIC_RESET_HOLD 0x0000 -#define DMV170_NV64_WE_MASK 0x0040 /* 64-bit Non-Volital Memory */ -#define DMV170_NV64_WRITE_ENABLE 0x0040 /* Write Enable */ -#define DMV170_NV64_WRITE_DISABLE 0x0000 -#define DMV170_BOOT_NV16_MASK 0x0080 /* BOOT Device Type */ -#define DMV170_BOOT_64_BIT 0x0080 -#define DMV170_BOOT_16_BIT 0x0000 -#define DMV170_DUART_INST_MASK 0x0100 /* DUART Sense Bit */ -#define DMV170_DUART_INSTALLED 0x0100 -#define DMV170_DUART_NOT_INSTALLED 0x0000 -#define DMV170_SONIC_INST_MASK 0x0200 /* SONIC Sense Bit */ -#define DMV170_SONIC_INSTALLED 0x0200 -#define DMV170_SONIC_NOT_INSTALLED 0x0000 -#define DMV170_16M_NV64_MASK 0x0400 /* 16 Mb of 64bit Flash Sense */ -#define DMV170_16Mb_FLASH_INSTALLED 0x0400 -#define DMV170_8Mb_FLASH_INSTALLED 0x0000 -#define DMV170_SCC_INST_MASK 0x0800 /* SCC Sense Bit */ -#define DMV170_SCC_INSTALLED 0x0800 -#define DMV170_SCC_NOT_INSTALLED 0x0000 -#define DMV170_RTC_INST_MASK 0x1000 /* RTC Sense Bit */ -#define DMV170_RTC_INSTALLED 0x1000 -#define DMV170_RTC_NOT_INSTALLED 0x0000 -#define DMV170_NV64_INST_MASK 0x2000 /* 64bit Non-Volital Mem Sense*/ - -#define DMV170_64_BIT_NON_VOLITAL_MEM_INSTALLED 0x2000 -#define DMV170_64_BIT_NON_VOLITAL_MEM_NOT_INSTALLED 0x0000 - - -/* - * DUART Baud Rate Definitions. - */ - -#define DMV170_DUART_9621 MC68681_BAUD_RATE_MASK_600 /* close to 9600 */ - -#define DMV170_RTC_FREQUENCY 0x0000 - - -/* - * CPU General Purpose Interrupt definations (PPC_IRQ_EXTERNAL). - * Note: For the interrupt level read the lower 3 bits of the - * Local Control and Status Register. - */ - -#define DMV170_IRQ_FIRST ( PPC_IRQ_LAST + 1 ) - -#define DMV170_LIRQ0 ( DMV170_IRQ_FIRST + 0 ) -#define DMV170_LIRQ1 ( DMV170_IRQ_FIRST + 1 ) -#define DMV170_LIRQ2 ( DMV170_IRQ_FIRST + 2 ) -#define DMV170_LIRQ3 ( DMV170_IRQ_FIRST + 3 ) -#define DMV170_LIRQ4 ( DMV170_IRQ_FIRST + 4 ) -#define DMV170_LIRQ5 ( DMV170_IRQ_FIRST + 5 ) -#define DMV170_L7IACF ( DMV170_IRQ_FIRST + 6 ) -#define DMV170_L7ISYS ( DMV170_IRQ_FIRST + 7 ) -#define DMV170_L7IMNI ( DMV170_IRQ_FIRST + 8 ) -#define DMV170_BIMODE ( DMV170_IRQ_FIRST + 9 ) - -#define DMV170_DUART_IRQ DMV170_LIRQ5 -#define DMV170_ETHERNET_IRQ DMV170_LIRQ5 -#define DMV170_SCSI_IRQ DMV170_LIRQ5 -#define DMV170_SCC_IRQ DMV170_LIRQ5 -#define DMV170_MEZZANINE_IRQ_0 DMV170_LIRQ4 -#define DMV170_TICK_IRQ DMV170_LIRQ3 -#define DMV170_LOCATION_MON_IRQ DMV170_LIRQ2 -#define DMV170_SCV64_IRQ DMV170_LIRQ1 -#define DMV170_RTC_IRQ DMV170_LIRQ0 - -#define DMV170_ACFAIL_IRQ DMV170_L7IACF -#define DMV170_SYSFAIL_IRQ DMV170_L7ISYS -#define DMV170_WATCHDOG_IRQ DMV170_L7IMNI -#define DMV170_BI_IRQ DMV170_BIMODE -#define DMV170_RAM_PARITY_IRQ ( DMV170_IRQ_FIRST + 10) -#define DMV170_DARF_BUS_ERROR_IRQ ( DMV170_IRQ_FIRST + 11) -#define DMV170_PERIPHERAL_IRQ ( DMV170_IRQ_FIRST + 12) - -#define MAX_BOARD_IRQS DMV170_PERIPHERAL_IRQ - -#define SCV64_Is_IRQ0( _status ) (_status&0x01) -#define SCV64_Is_IRQ1( _status ) (_status&0x02) -#define SCV64_Is_IRQ2( _status ) (_status&0x04) -#define SCV64_Is_IRQ3( _status ) (_status&0x08) -#define SCV64_Is_IRQ4( _status ) (_status&0x10) -#define SCV64_Is_IRQ5( _status ) (_status&0x20) - - -/* - * scv64.c - */ - -void SCV64_Generate_DUART_Interrupts(); -rtems_unsigned32 SCV64_Get_Interrupt(); -rtems_unsigned32 SCV64_Get_Interrupt_Enable(); - -#ifdef __cplusplus -} -#endif - -#endif /* !_INCLUDE_DMV170_h */ -/* end of include file */ - diff --git a/c/src/lib/libbsp/powerpc/dmv177/scv64/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/scv64/Makefile.in deleted file mode 100644 index 14961659b3..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/scv64/Makefile.in +++ /dev/null @@ -1,60 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/scv64.rel - -# C source names, if any, go here -- minus the .c -C_PIECES=$(SCV64_PIECES) -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -SRCS=$(C_FILES) $(H_FILES) -OBJS=$(C_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -SCV64_PIECES=scv64 - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -${PGM}: ${SRCS} ${OBJS} - $(make-rel) - -all: ${ARCH} $(SRCS) $(PGM) - -# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile -install: all - - - diff --git a/c/src/lib/libbsp/powerpc/dmv177/scv64/scv64.c b/c/src/lib/libbsp/powerpc/dmv177/scv64/scv64.c deleted file mode 100644 index 850618ad0e..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/scv64/scv64.c +++ /dev/null @@ -1,171 +0,0 @@ -/* scv64.c - * - * This set of routines control the scv64 chip on the DMV177 board. - * - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * $Id$ - */ - -#include <rtems.h> -#include <bsp.h> - -typedef struct { - /* DARF Registers */ - volatile rtems_unsigned32 DMALAR; /* 0x00 */ - volatile rtems_unsigned32 DMAVAR; /* 0x04 */ - volatile rtems_unsigned32 DMATC; /* 0x08 */ - volatile rtems_unsigned32 DCSR; /* 0x0c */ - volatile rtems_unsigned32 VMEBAR; /* 0x10 */ - volatile rtems_unsigned32 RXDATA; /* 0x14 */ - volatile rtems_unsigned32 RXADDR; /* 0x18 */ - volatile rtems_unsigned32 RXCTL; /* 0x1c */ - volatile rtems_unsigned32 BUSSEL; /* 0x20 */ - volatile rtems_unsigned32 IVECT; /* 0x24 */ - volatile rtems_unsigned32 APBR; /* 0x28 */ - volatile rtems_unsigned32 TXDATA; /* 0x2c */ - volatile rtems_unsigned32 TXADDR; /* 0x30 */ - volatile rtems_unsigned32 TXCTL; /* 0x34 */ - volatile rtems_unsigned32 LMFIFO; /* 0x38 */ - volatile rtems_unsigned32 MODE; /* 0x3c */ - volatile rtems_unsigned32 SA64BAR; /* 0x40 */ - volatile rtems_unsigned32 MA64BAR; /* 0x44 */ - volatile rtems_unsigned32 LAG; /* 0x48 */ - volatile rtems_unsigned32 DMAVTC; /* 0x4c */ - - /* Reserved */ - volatile rtems_unsigned32 reserved_50_7F[12]; - - /* ACC Registers */ - volatile rtems_unsigned8 STAT0_pad[3]; /* 0x80 */ - volatile rtems_unsigned8 STAT0; - volatile rtems_unsigned8 STAT1_pad[3]; /* 0x84 */ - volatile rtems_unsigned8 STAT1; - volatile rtems_unsigned8 GENCTL_pad[3]; /* 0x88 */ - volatile rtems_unsigned8 GENCTL; - volatile rtems_unsigned8 VINT_pad[3]; /* 0x8c */ - volatile rtems_unsigned8 VINT; - volatile rtems_unsigned8 VREQ_pad[3]; /* 0x90 */ - volatile rtems_unsigned8 VREQ; - volatile rtems_unsigned8 VARB_pad[3]; /* 0x94 */ - volatile rtems_unsigned8 VARB; - volatile rtems_unsigned8 ID_pad[3]; /* 0x98 */ - volatile rtems_unsigned8 ID; - volatile rtems_unsigned8 NA_pad[3]; /* 0x9c */ - volatile rtems_unsigned8 NA; - volatile rtems_unsigned8 _7IS_pad[3]; /* 0xa0 */ - volatile rtems_unsigned8 _7IS; - volatile rtems_unsigned8 LIS_pad[3]; /* 0xa4 */ - volatile rtems_unsigned8 LIS; - volatile rtems_unsigned8 UIE_pad[3]; /* 0xa8 */ - volatile rtems_unsigned8 UIE; - volatile rtems_unsigned8 LIE_pad[3]; /* 0xac */ - volatile rtems_unsigned8 LIE; - volatile rtems_unsigned8 VIE_pad[3]; /* 0xb0 */ - volatile rtems_unsigned8 VIE; - volatile rtems_unsigned8 IC10_pad[3]; /* 0xb4 */ - volatile rtems_unsigned8 IC10; - volatile rtems_unsigned8 IC32_pad[3]; /* 0xb8 */ - volatile rtems_unsigned8 IC32; - volatile rtems_unsigned8 IC54_pad[3]; /* 0xbc */ - volatile rtems_unsigned8 IC54; - /* Utility Registers */ - volatile rtems_unsigned32 MISC; - volatile rtems_unsigned32 delay_line[3]; - volatile rtems_unsigned32 MBOX0; - volatile rtems_unsigned32 MBOX1; - volatile rtems_unsigned32 MBOX2; - volatile rtems_unsigned32 MBOX3; -} SCV64_Registers; - -/* - * LIE Register - */ -#define LOCAL_INTERRUPT_ENABLE_0 0x01 -#define LOCAL_INTERRUPT_ENABLE_1 0x02 -#define LOCAL_INTERRUPT_ENABLE_2 0x04 -#define LOCAL_INTERRUPT_ENABLE_3 0x08 -#define LOCAL_INTERRUPT_ENABLE_4 0x10 -#define LOCAL_INTERRUPT_ENABLE_5 0x20 - -/* - * IC54 Register - */ -#define AUTOVECTOR_5 0x80 - - -/* - * Set the registers pointer to the base address of the SCV64 - */ -SCV64_Registers *SCV64 = (void *)DMV170_SCV64_BASE_ADDRESS; - -/*PAGE - * - * SCV64_Initialize - * - * This routine initializes the SCV64. - */ -void SCV64_Initialize() { - SCV64->LIE = 0; -} - -/*PAGE - * - * SCV64_Generate_DUART_Interrupts - * - * This sets the SCV64 to generate duart interrupts for - * the DMV177 board. - */ -void SCV64_Generate_DUART_Interrupts() { - - rtems_unsigned8 data; - - /* - * Set Local Interrupt 5 enable - */ - data = SCV64->LIE; - data |= LOCAL_INTERRUPT_ENABLE_5; - SCV64->LIE = data; - - /* - * Set Autovector. - */ - data = SCV64->IC54; - data |= AUTOVECTOR_5; - SCV64->IC54 = data; -} - -/*PAGE - * - * SCV64_Get_Interrupt - * - * This routine returns the SCV64 status register. - */ -rtems_unsigned32 SCV64_Get_Interrupt() -{ - rtems_unsigned8 data; - - /* - * Put the LIS data into the lower byte of the result - */ - data = SCV64->LIS; - - return data; -} - -/*PAGE - * - * SCV64_Get_Interrupt_Enable - * - * This routine returns the interrupt enable mask. - */ -rtems_unsigned32 SCV64_Get_Interrupt_Enable() -{ - /* - * Return the set of interrupts enabled. - */ - return SCV64->LIE; -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/sonic/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/sonic/Makefile.in deleted file mode 100644 index 35cd5ff209..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/sonic/Makefile.in +++ /dev/null @@ -1,60 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/sonic.rel - -# C source names, if any, go here -- minus the .c -C_PIECES=sonic -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES= -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -D_COMPILING_BSD_KERNEL_ -DKERNEL -DINET -DNFS \ - -DDIAGNOSTIC -DBOOTP_COMPAT -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -${PGM}: ${SRCS} ${OBJS} - $(make-rel) - -all: ${ARCH} $(SRCS) $(PGM) - -# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile -install: all diff --git a/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.c b/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.c deleted file mode 100644 index 651025ee71..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.c +++ /dev/null @@ -1,1599 +0,0 @@ -void break_when_you_get_here(); -/* - ******************************************************************* - ******************************************************************* - ** ** - ** RTEMS NETWORK DRIVER FOR NATIONAL DP83932 `SONIC' ** - ** SYSTEMS-ORIENTED NETWORK INTERFACE CONTROLLER ** - ** ** - ******************************************************************* - ******************************************************************* - */ - -/* - * $Revision$ $Date$ $Author$ - * $State$ - * $Id$ - */ - -/* - * References: - * 1) DP83932C-20/25/33 MHz SONIC(TM) Systems-Oriented Network Interface - * Controller data sheet. TL/F/10492, RRD-B30M105, National Semiconductor, - * 1995. - * - * 2) Software Driver Programmer's Guide for the DP83932 SONIC(TM), - * Application Note 746, Wesley Lee and Mike Lui, TL/F/11140, - * RRD-B30M75, National Semiconductor, March, 1991. - * - * 3) SVME/DMV-171 Single Board Computer Documentation Package, #805905, - * DY 4 Systems Inc., Kanata, Ontario, September, 1996. - */ - -#include <rtems/rtems_bsdnet.h> -#include "sonic.h" - -#include <stdio.h> - -#include <errno.h> -#include <rtems/error.h> - -#include <sys/param.h> -#include <sys/mbuf.h> -#include <sys/socket.h> -#include <sys/sockio.h> -#include <sys/sockio.h> - -#include <net/if.h> - -#include <netinet/in.h> -#include <netinet/if_ether.h> - -/* - * Debug levels - * - */ - -#define SONIC_DEBUG_NONE 0x0000 -#define SONIC_DEBUG_ALL 0xFFFF -#define SONIC_DEBUG_PRINT_REGISTERS 0x0001 -#define SONIC_DEBUG_MEMORY 0x0002 -#define SONIC_DEBUG_MEMORY_ALLOCATE 0x0004 -#define SONIC_DEBUG_FRAGMENTS 0x0008 -#define SONIC_DEBUG_CAM 0x0008 -#define SONIC_DEBUG_DESCRIPTORS 0x0010 -#define SONIC_DEBUG_ERRORS 0x0020 - -#define SONIC_DEBUG (SONIC_DEBUG_ERRORS) - -/* (SONIC_DEBUG_MEMORY|SONIC_DEBUG_DESCRIPTORS) */ - -/* SONIC_DEBUG_ALL */ - - -/* - * XXX - */ - -#include <dmv170.h> - -/* - * Use the top line if you want more symbols. - */ - -#define SONIC_STATIC -/* #define SONIC_STATIC static */ - -/* - * Number of devices supported by this driver - */ -#ifndef NSONIC -# define NSONIC 1 -#endif - -/* - * Default location of device registers - */ -#ifndef SONIC_BASE_ADDRESS -# define SONIC_BASE_ADDRESS 0xF3000000 -# warning "Using default SONIC_BASE_ADDRESS." -#endif - -/* - * Default interrupt vector - */ -#ifndef SONIC_VECTOR -# define SONIC_VECTOR 1 -# warning "Using default SONIC_VECTOR." -#endif - -/* - * Default device configuration register values - * Conservative, generic values. - * DCR: - * No extended bus mode - * Unlatched bus retry - * Programmable outputs unused - * Asynchronous bus mode - * User definable pins unused - * No wait states (access time controlled by DTACK*) - * 32-bit DMA - * Empty/Fill DMA mode - * Maximum Transmit/Receive FIFO - * DC2: - * Extended programmable outputs unused - * Normal HOLD request - * Packet compress output unused - * No reject on CAM match - */ -#define SONIC_DCR \ - (DCR_DW32 | DCR_WAIT0 | DCR_PO0 | DCR_PO1 | DCR_RFT4 | DCR_TFT8) -#ifndef SONIC_DCR -# define SONIC_DCR (DCR_DW32 | DCR_TFT28) -#endif -#ifndef SONIC_DC2 -# define SONIC_DC2 (0) -#endif - -/* - * Default sizes of transmit and receive descriptor areas - */ -#define RDA_COUNT 20 -#define TDA_COUNT 100 - -/* - * - * As suggested by National Application Note 746, make the - * receive resource area bigger than the receive descriptor area. - */ -#define RRA_EXTRA_COUNT 0 - -/* - * RTEMS event used by interrupt handler to signal daemons. - */ -#define INTERRUPT_EVENT RTEMS_EVENT_1 - -/* - * RTEMS event used to start transmit daemon. - * This must not be the same as INTERRUPT_EVENT. - */ -#define START_TRANSMIT_EVENT RTEMS_EVENT_2 - -/* - * Largest Ethernet frame. - */ -#define MAXIMUM_FRAME_SIZE 1518 - -/* - * Receive buffer size. - * Allow for a pointer, plus a full ethernet frame (including Frame - * Check Sequence) rounded up to a 4-byte boundary. - */ -#define RBUF_SIZE ((sizeof (void *) + (MAXIMUM_FRAME_SIZE) + 3) & ~3) -#define RBUF_WC ((((MAXIMUM_FRAME_SIZE) + 3) & ~3) / 2) - -/* - * Macros for manipulating 32-bit pointers as 16-bit fragments - */ -#define LSW(p) ((rtems_unsigned16)((rtems_unsigned32)(p))) -#define MSW(p) ((rtems_unsigned16)((rtems_unsigned32)(p) >> 16)) -#define PTR(m,l) ((void*)(((rtems_unsigned16)(m)<<16)|(rtems_unsigned16)(l))) - -/* - * Hardware-specific storage - */ -struct sonic_softc { - /* - * Connection to networking code - * This entry *must* be the first in the sonic_softc structure. - */ - struct arpcom arpcom; - - /* - * Default location of device registers - * ===CACHE=== - * This area must be non-cacheable, guarded. - */ - void *sonic; - - /* - * Interrupt vector - */ - rtems_vector_number vector; - - /* - * Indicates configuration - */ - int acceptBroadcast; - - /* - * Task waiting for interrupts - */ - rtems_id rxDaemonTid; - rtems_id txDaemonTid; - - /* - * Receive resource area - */ - int rdaCount; - ReceiveResourcePointer_t rsa; - ReceiveResourcePointer_t rea; - CamDescriptorPointer_t cdp; - ReceiveDescriptorPointer_t rda; - ReceiveDescriptorPointer_t rdp_last; - - /* - * Transmit descriptors - */ - int tdaCount; - TransmitDescriptorPointer_t tdaHead; /* Last filled */ - TransmitDescriptorPointer_t tdaTail; /* Next to retire */ - int tdaActiveCount; - - /* - * Statistics - */ - unsigned long Interrupts; - unsigned long rxInterrupts; - unsigned long rxMissed; - unsigned long rxGiant; - unsigned long rxNonOctet; - unsigned long rxBadCRC; - unsigned long rxCollision; - - unsigned long txInterrupts; - unsigned long txSingleCollision; - unsigned long txMultipleCollision; - unsigned long txCollision; - unsigned long txDeferred; - unsigned long txUnderrun; - unsigned long txLateCollision; - unsigned long txExcessiveCollision; - unsigned long txExcessiveDeferral; - unsigned long txLostCarrier; - unsigned long txRawWait; -}; -SONIC_STATIC struct sonic_softc sonic_softc[NSONIC]; - -/* - ****************************************************************** - * * - * Support Routines * - * * - ****************************************************************** - */ - -void sonic_write_register( - void *base, - unsigned32 regno, - unsigned32 value -); - -unsigned32 sonic_read_register( - void *base, - unsigned32 regno -); - -void sonic_enable_interrupts( - void *rp, - unsigned32 mask -) -{ - rtems_interrupt_level level; - - rtems_interrupt_disable( level ); - sonic_write_register( - rp, - SONIC_REG_IMR, - sonic_read_register(rp, SONIC_REG_IMR) | mask - ); - rtems_interrupt_enable( level ); -} - -/* - * Allocate non-cacheable memory on a single 64k page. - * Very simple minded -- just keeps trying till the memory is on a single page. - */ -SONIC_STATIC void * sonic_allocate(unsigned int nbytes) -{ - void *p; - unsigned long a1, a2; - - for (;;) { - /* - * ===CACHE=== - * Change malloc to malloc_noncacheable_guarded. - */ - p = malloc( nbytes, M_MBUF, M_NOWAIT ); - memset (p, '\0', nbytes); - if (p == NULL) - rtems_panic ("No memory!"); - a1 = (unsigned long)p; - a2 = a1 + nbytes - 1; - if ((a1 >> 16) == (a2 >> 16)) - break; - } -#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY_ALLOCATE) - printf( "sonic_allocate %d bytes at %p\n", nbytes, p ); -#endif - return p; -} - -/* - * Shut down the interface. - */ - -SONIC_STATIC void sonic_stop (struct sonic_softc *sc) -{ - void *rp = sc->sonic; - struct ifnet *ifp = &sc->arpcom.ac_if; - - ifp->if_flags &= ~IFF_RUNNING; - - /* - * Stop the transmitter and receiver. - */ - sonic_write_register( rp, SONIC_REG_CR, CR_HTX | CR_RXDIS ); -} - -/* - * Show interface statistics - */ -SONIC_STATIC void sonic_stats (struct sonic_softc *sc) -{ - printf (" Total Interrupts:%-8lu", sc->Interrupts); - printf (" Rx Interrupts:%-8lu", sc->rxInterrupts); - printf (" Giant:%-8lu", sc->rxGiant); - printf (" Non-octet:%-8lu\n", sc->rxNonOctet); - printf (" Bad CRC:%-8lu", sc->rxBadCRC); - printf (" Collision:%-8lu", sc->rxCollision); - printf (" Missed:%-8lu\n", sc->rxMissed); - - printf ( " Tx Interrupts:%-8lu", sc->txInterrupts); - printf ( " Deferred:%-8lu", sc->txDeferred); - printf (" Lost Carrier:%-8lu\n", sc->txLostCarrier); - printf ( "Single Collisions:%-8lu", sc->txSingleCollision); - printf ( "Multiple Collisions:%-8lu", sc->txMultipleCollision); - printf ("Excessive Collisions:%-8lu\n", sc->txExcessiveCollision); - printf ( " Total Collisions:%-8lu", sc->txCollision); - printf ( " Late Collision:%-8lu", sc->txLateCollision); - printf (" Underrun:%-8lu\n", sc->txUnderrun); - printf ( " Raw output wait:%-8lu\n", sc->txRawWait); -} - -/* - ****************************************************************** - * * - * Interrupt Handler * - * * - ****************************************************************** - */ - -SONIC_STATIC rtems_isr sonic_interrupt_handler (rtems_vector_number v) -{ - struct sonic_softc *sc = sonic_softc; - void *rp; - -#if (NSONIC > 1) - /* - * Find the device which requires service - */ - for (;;) { - if (sc->vector == v) - break; - if (++sc == &sonic[NSONIC]) - return; /* Spurious interrupt? */ - } -#endif /* NSONIC > 1 */ - - /* - * Get pointer to SONIC registers - */ - rp = sc->sonic; - - sc->Interrupts++; - - /* - * Packet received or receive buffer area exceeded? - */ - if ((sonic_read_register( rp, SONIC_REG_IMR ) & (IMR_PRXEN | IMR_RBAEEN)) && - (sonic_read_register( rp, SONIC_REG_ISR ) & (ISR_PKTRX | ISR_RBAE))) { - sonic_write_register( - rp, - SONIC_REG_IMR, - sonic_read_register( rp, SONIC_REG_IMR) & ~(IMR_PRXEN | IMR_RBAEEN) - ); - sc->rxInterrupts++; - rtems_event_send (sc->rxDaemonTid, INTERRUPT_EVENT); - } - - /* - * Packet started, transmitter done or transmitter error? - */ - if ((sonic_read_register( rp, SONIC_REG_IMR ) & (IMR_PINTEN | IMR_PTXEN | IMR_TXEREN)) - && (sonic_read_register( rp, SONIC_REG_ISR ) & (ISR_PINT | ISR_TXDN | ISR_TXER))) { - sonic_write_register( - rp, - SONIC_REG_IMR, - sonic_read_register( rp, SONIC_REG_IMR) & - ~(IMR_PINTEN | IMR_PTXEN | IMR_TXEREN) - ); - sc->txInterrupts++; - rtems_event_send (sc->txDaemonTid, INTERRUPT_EVENT); - } -} - -/* - ****************************************************************** - * * - * Transmitter Routines * - * * - ****************************************************************** - */ - -/* - * Soak up transmit descriptors that have been sent. - */ - -SONIC_STATIC void sonic_retire_tda (struct sonic_softc *sc) -{ - rtems_unsigned16 status; - unsigned int collisions; - struct mbuf *m, *n; - - /* - * Repeat for all completed transmit descriptors. - */ - while ((sc->tdaActiveCount != 0) - && ((status = sc->tdaTail->status) != 0)) { - -#if (SONIC_DEBUG & SONIC_DEBUG_DESCRIPTORS) - printf( "retire TDA %p (0x%04x)\n", sc->tdaTail, status ); -#endif - -#if (SONIC_DEBUG & SONIC_DEBUG_ERRORS) - if ( status != 0x0001 ) - printf( "ERROR: retire TDA %p (0x%04x)\n", sc->tdaTail, status ); -#endif - - /* - * Check for errors which stop the transmitter. - */ - if (status & (TDA_STATUS_EXD | - TDA_STATUS_EXC | - TDA_STATUS_FU | - TDA_STATUS_BCM)) { - /* - * Restart the transmitter if there are - * packets waiting to go. - */ - rtems_unsigned16 link; - link = *(sc->tdaTail->linkp); - - if ((link & TDA_LINK_EOL) == 0) { - void *rp = sc->sonic; - - sonic_write_register( rp, SONIC_REG_CTDA, link ); - sonic_write_register( rp, SONIC_REG_CR, CR_TXP ); - } - } - - /* - * Update network statistics - */ - collisions = (status & TDA_STATUS_COLLISION_MASK) >> TDA_STATUS_COLLISION_SHIFT; - if (collisions) { - if (collisions == 1) - sc->txSingleCollision++; - else - sc->txMultipleCollision++; - sc->txCollision += collisions; - } - if (status & TDA_STATUS_EXC) - sc->txExcessiveCollision++; - if (status & TDA_STATUS_OWC) - sc->txLateCollision++; - if (status & TDA_STATUS_EXD) - sc->txExcessiveDeferral++; - if (status & TDA_STATUS_DEF) - sc->txDeferred++; - if (status & TDA_STATUS_FU) - sc->txUnderrun++; - if (status & TDA_STATUS_CRSL) - sc->txLostCarrier++; - - /* - * Free the packet and reset a couple of fields - */ - sc->tdaActiveCount--; - m = (struct mbuf *)&sc->tdaTail->mbufp; - MFREE(m, n); - - sc->tdaTail->frag[0].frag_link = LSW(sc->tdaTail->link_pad); - sc->tdaTail->frag_count = 0; - - /* - * Move to the next transmit descriptor - */ - sc->tdaTail = sc->tdaTail->next; -#if (SONIC_DEBUG & SONIC_DEBUG_DESCRIPTORS) - printf( "next TDA %p\n", sc->tdaTail ); -#endif - } -} - -/* - * Send packet - */ -SONIC_STATIC void sonic_sendpacket (struct ifnet *ifp, struct mbuf *m) -{ - struct sonic_softc *sc = ifp->if_softc; - void *rp = sc->sonic; - struct mbuf *l = NULL; - TransmitDescriptorPointer_t tdp; - volatile struct TransmitDescriptorFragLink *fp; - unsigned int packetSize; - int i; - static char padBuf[64]; - - /* - * Free up transmit descriptors. - */ - sonic_retire_tda (sc); - - /* - * Wait for transmit descriptor to become available. - */ - if (sc->tdaActiveCount == sc->tdaCount) { -#if (SONIC_DEBUG & SONIC_DEBUG_FRAGMENTS) - puts( "Wait for more TDAs" ); -#endif - /* - * Clear old events. - */ - sonic_write_register( rp, SONIC_REG_ISR, ISR_PINT | ISR_TXDN | ISR_TXER ); - - /* - * Wait for transmit descriptor to become available. - * Note that the transmit descriptors are checked - * *before* * entering the wait loop -- this catches - * the possibility that a transmit descriptor became - * available between the `if' the started this block, - * and the clearing of the interrupt status register. - */ - sonic_retire_tda (sc); - while (sc->tdaActiveCount == sc->tdaCount) { - rtems_event_set events; - /* - * Enable transmitter interrupts. - */ - sonic_enable_interrupts( rp, (IMR_PINTEN | IMR_PTXEN | IMR_TXEREN) ); - - /* - * Wait for interrupt - */ - rtems_bsdnet_event_receive (INTERRUPT_EVENT, - RTEMS_WAIT|RTEMS_EVENT_ANY, - RTEMS_NO_TIMEOUT, - &events); - sonic_write_register( rp, SONIC_REG_ISR, ISR_PINT | ISR_TXDN | ISR_TXER ); - sonic_retire_tda (sc); - } - } - - /* - * Fill in the transmit descriptor fragment descriptors. - * ===CACHE=== - * If data cache is operating in write-back mode, flush cached - * data to memory. - */ - tdp = sc->tdaHead->next; - tdp->mbufp = m; - packetSize = 0; - fp = tdp->frag; - for (i = 0 ; i < MAXIMUM_FRAGS_PER_DESCRIPTOR ; i++, fp++) { - /* - * Throw away empty mbufs - */ - if (m->m_len) { - void *p = mtod (m, void *); - fp->frag_lsw = LSW(p); - fp->frag_msw = MSW(p); - fp->frag_size = m->m_len; - packetSize += m->m_len; - l = m; - m = m->m_next; -#if (SONIC_DEBUG & SONIC_DEBUG_FRAGMENTS) - printf( "fp %p 0x%04x%04x %d\n", - fp, fp->frag_msw, fp->frag_lsw, fp->frag_size ); -#endif - } - else { - struct mbuf *n; - MFREE (m, n); - m = n; - if (l != NULL) - l->m_next = m; - } - /* - * Break out of the loop if this mbuf is the last in the frame. - */ - if (m == NULL) - break; - } - - /* - * Pad short packets. - */ - if ((packetSize < 64) && (i < MAXIMUM_FRAGS_PER_DESCRIPTOR)) { - int padSize = 64 - packetSize; - fp++; - fp->frag_lsw = LSW(padBuf); - fp->frag_msw = MSW(padBuf); - fp->frag_size = padSize; -#if (SONIC_DEBUG & SONIC_DEBUG_FRAGMENTS) - printf( "PAD fp %p 0x%04x%04x %d\n", - fp, fp->frag_msw, fp->frag_lsw, fp->frag_size ); -#endif - packetSize += padSize; - i++; - } - - /* - * Fill Transmit Descriptor - */ - tdp->pkt_size = packetSize; - tdp->frag_count = i + 1; - tdp->status = 0; - - /* - * Chain onto list and start transmission. - */ - - tdp->linkp = &(fp+1)->frag_link; - *tdp->linkp = LSW(tdp->next) | TDA_LINK_EOL; - if ( sc->tdaHead->frag_count ) - *sc->tdaHead->linkp &= ~TDA_LINK_EOL; - sc->tdaActiveCount++; - sc->tdaHead = tdp; - - sonic_enable_interrupts( rp, (IMR_PINTEN | IMR_PTXEN | IMR_TXEREN) ); - sonic_write_register( rp, SONIC_REG_CR, CR_TXP ); -} - -/* - * Driver transmit daemon - */ -SONIC_STATIC void sonic_txDaemon (void *arg) -{ - struct sonic_softc *sc = (struct sonic_softc *)arg; - struct ifnet *ifp = &sc->arpcom.ac_if; - struct mbuf *m; - rtems_event_set events; - - for (;;) { - /* - * Wait for packet - */ - rtems_bsdnet_event_receive ( - START_TRANSMIT_EVENT, - RTEMS_EVENT_ANY | RTEMS_WAIT, - RTEMS_NO_TIMEOUT, - &events - ); - - /* - * Send packets till queue is empty - */ - for (;;) { - /* - * Get the next mbuf chain to transmit. - */ - IF_DEQUEUE(&ifp->if_snd, m); - if (!m) - break; - sonic_sendpacket (ifp, m); - } - ifp->if_flags &= ~IFF_OACTIVE; - } -} - -/* - ****************************************************************** - * * - * Receiver Routines * - * * - ****************************************************************** - */ - -/* - * Wait for SONIC to hand over a Receive Descriptor. - */ - -SONIC_STATIC void sonic_rda_wait( - struct sonic_softc *sc, - ReceiveDescriptorPointer_t rdp -) -{ - int i; - void *rp = sc->sonic; - rtems_event_set events; - - /* - * Wait for Receive Descriptor. - * The order of the tests is very important. - * The RDA is checked after RBAE is detected. This ensures that - * the driver processes all RDA entries before reusing the RRA - * entry holding the giant packet. - * The event wait is done after the RDA and RBAE checks. This - * catches the possibility that a Receive Descriptor became ready - * between the call to this function and the clearing of the - * interrupt status register bit. - */ - for (;;) { - /* - * Has a giant packet arrived? - * The National DP83932C data sheet is very vague on what - * happens under this condition. The description of the - * Interrupt Status Register (Section 4.3.6) states, - * ``Reception is aborted and the SONIC fetches the next - * available resource descriptors in the RRA. The buffer - * space is not re-used and an RDA is not setup for the - * truncated packet.'' - * I take ``Reception is aborted'' to mean that the RXEN - * bit in the Command Register is cleared and must be set - * by the driver to begin reception again. - * Unfortunately, an alternative interpretation could be - * that only reception of the current packet is aborted. - * This would be more difficult to recover from.... - */ - if (sonic_read_register( rp, SONIC_REG_ISR ) & ISR_RBAE) { - -#if (SONIC_DEBUG & SONIC_DEBUG_ERRORS) - printf( "ERROR: looks like a giant packet -- RBAE\n" ); -#endif - - /* - * One more check to soak up any Receive Descriptors - * that may already have been handed back to the driver. - */ - if (rdp->in_use == RDA_IN_USE) { -#if (SONIC_DEBUG & SONIC_DEBUG_ERRORS) - printf( "ERROR: nope just an RBAE\n" ); -#endif - break; - } - - /* - * Check my interpretation of the SONIC manual. - */ - if (sonic_read_register( rp, SONIC_REG_CR ) & CR_RXEN) - rtems_panic ("SONIC RBAE/RXEN"); - - /* - * Update statistics - */ - sc->rxGiant++; - - /* - * Reuse receive buffer. - * Again, the manual is subject to interpretation. The - * RRP register is described as, `the lower address of - * the next descriptor the SONIC will read.'' - * Since, acording to the ISR/RBAE notes, the SONIC has - * ``fetched the next available resource descriptor in - * the RRA'', I interpret this to mean that that the - * driver has to move the RRP back *two* entries to - * reuse the receive buffer holding the giant packet. - */ - for (i = 0 ; i < 2 ; i++) { - if (sonic_read_register( rp, SONIC_REG_RRP ) == - sonic_read_register( rp, SONIC_REG_RSA )) - sonic_write_register( - rp, - SONIC_REG_RRP, - sonic_read_register( rp, SONIC_REG_REA ) - ); - sonic_write_register( - rp, - SONIC_REG_RRP, - sonic_read_register(rp, SONIC_REG_RRP) - sizeof(ReceiveResource_t) - ); - } - - /* - * Restart reception - */ - sonic_write_register( rp, SONIC_REG_ISR, ISR_RBAE ); - sonic_write_register( rp, SONIC_REG_CR, CR_RXEN ); - } - - /* - * Clear old packet-received events. - */ - sonic_write_register( rp, SONIC_REG_ISR, ISR_PKTRX ); - - /* - * Has Receive Descriptor become available? - */ - if (rdp->in_use == RDA_IN_USE) - break; - - /* - * Enable interrupts. - */ - sonic_enable_interrupts( rp, (IMR_PRXEN | IMR_RBAEEN) ); - - /* - * Wait for interrupt. - */ - rtems_bsdnet_event_receive( - INTERRUPT_EVENT, - RTEMS_WAIT|RTEMS_EVENT_ANY, - RTEMS_NO_TIMEOUT, - &events - ); - } -#if (SONIC_DEBUG & SONIC_DEBUG_DESCRIPTORS) - printf( "RDA %p\n", rdp ); -#endif - -#if (SONIC_DEBUG & SONIC_DEBUG_ERRORS) - if (rdp->status & 0x000E) - printf( "ERROR: RDA %p (0x%04x)\n", rdp, rdp->status ); -#endif - -} - -/* - * SONIC reader task - */ -SONIC_STATIC void sonic_rxDaemon (void *arg) -{ - struct sonic_softc *sc = (struct sonic_softc *)arg; - struct ifnet *ifp = &sc->arpcom.ac_if; - void *rp = sc->sonic; - struct mbuf *m; - rtems_unsigned16 status; - ReceiveDescriptorPointer_t rdp; - ReceiveResourcePointer_t rwp, rea; - rtems_unsigned16 newMissedTally, oldMissedTally; - - rwp = sc->rsa; - rea = sc->rea; - rdp = sc->rda; - - /* - * Start the receiver - */ - oldMissedTally = sonic_read_register( rp, SONIC_REG_MPT ); - sonic_write_register( rp, SONIC_REG_CR, CR_RRRA ); - sonic_write_register( rp, SONIC_REG_CR, CR_RXEN ); - - /* - * Input packet handling loop - */ - for (;;) { - /* - * Wait till SONIC supplies a Receive Descriptor. - */ - if (rdp->in_use == RDA_FREE) { - sonic_rda_wait (sc, rdp); - } - -#if (SONIC_DEBUG & SONIC_DEBUG_DESCRIPTORS) - printf( "Incoming packet %p status=0x%04x\n", rdp, rdp->status ); -#endif - - /* - * Check that packet is valid - */ - status = rdp->status; - if (status & RDA_STATUS_PRX) { - struct mbuf **mp; - struct ether_header *eh; - void *p; - - /* - * Get the mbuf pointer - */ - p = PTR(rdp->pkt_msw, rdp->pkt_lsw); - mp = (struct mbuf **)p - 1; - m = *mp; - - /* - * Pass the packet up the chain. - * The mbuf count is reduced to remove - * the frame check sequence at the end - * of the packet. - * ===CACHE=== - * Invalidate cache entries for this memory. - */ - m->m_len = m->m_pkthdr.len = rdp->byte_count - - sizeof(rtems_unsigned32) - - sizeof(struct ether_header); - eh = mtod (m, struct ether_header *); - m->m_data += sizeof(struct ether_header); - ether_input (ifp, eh, m); - - /* - * Sanity check that Receive Resource Area is - * still in sync with Receive Descriptor Area - * The buffer reported in the Receive Descriptor - * should be the same as the buffer in the Receive - * Resource we are about to reuse. - */ -/* XXX figure out whether this is valid or not */ -#if 0 - if ((LSW(p) != rwp->buff_ptr_lsw) - || (MSW(p) != rwp->buff_ptr_msw)) - rtems_panic ("SONIC RDA/RRA"); -#endif - - /* - * Allocate a new mbuf. - */ - MGETHDR (m, M_WAIT, MT_DATA); - MCLGET (m, M_WAIT); - m->m_pkthdr.rcvif = ifp; - mp = mtod (m, struct mbuf **); - m->m_data += sizeof *mp; - *mp = m; - p = mtod (m, void *); - - /* - * Reuse Receive Resource. - */ - rwp->buff_ptr_lsw = LSW(p); - rwp->buff_ptr_msw = MSW(p); - rwp++; - if (rwp == rea) { -#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY) - printf( "Wrapping RWP from %p to %p\n", rwp, sc->rsa ); -#endif - rwp = sc->rsa; - } - sonic_write_register( rp, SONIC_REG_RWP , LSW(rwp) ); - - /* - * Tell the SONIC to reread the RRA. - */ - if (sonic_read_register( rp, SONIC_REG_ISR ) & ISR_RBE) - sonic_write_register( rp, SONIC_REG_ISR, ISR_RBE ); - } - else { - if (status & RDA_STATUS_COL) - sc->rxCollision++; - if (status & RDA_STATUS_FAER) - sc->rxNonOctet++; - else if (status & RDA_STATUS_CRCR) - sc->rxBadCRC++; - } - - /* - * Count missed packets - */ - newMissedTally = sonic_read_register( rp, SONIC_REG_MPT ); - if (newMissedTally != oldMissedTally) { - sc->rxMissed += (newMissedTally - oldMissedTally) & 0xFFFF; - newMissedTally = oldMissedTally; - } - - /* - * Move to next receive descriptor - */ - rdp->in_use = RDA_FREE; - rdp = rdp->next; - rdp->link &= ~RDA_LINK_EOL; - } -} - -/* - ****************************************************************** - * * - * Initialization Routines * - * * - ****************************************************************** - */ - -/* - * Initialize the SONIC hardware - */ -SONIC_STATIC void sonic_initialize_hardware(struct sonic_softc *sc) -{ - void *rp = sc->sonic; - int i; - unsigned char *hwaddr; - rtems_isr_entry old_handler; - TransmitDescriptorPointer_t tdp; - ReceiveDescriptorPointer_t ordp, rdp; - ReceiveResourcePointer_t rwp; - struct mbuf *m; - void *p; - CamDescriptorPointer_t cdp; - - /* - * The Revision B SONIC has a horrible bug known as the "Zero - * Length Packet bug". The initial board used to develop this - * driver had a newer revision of the SONIC so there was no reason - * to check for this. If you have the Revision B SONIC chip, then - * you need to add some code to the RX path to handle this weirdness. - */ - - if ( sonic_read_register( rp, SONIC_REG_SR ) < SONIC_REVISION_C ) { - rtems_fatal_error_occurred( 0x0BADF00D ); /* don't eat this part :) */ - } - - /* - * Set up circular linked list in Transmit Descriptor Area. - * Use the PINT bit in the transmit configuration field to - * request an interrupt on every other transmitted packet. - * - * NOTE: sonic_allocate() zeroes all of the memory allocated. - */ - - sc->tdaActiveCount = 0; - sc->tdaTail = sonic_allocate(sc->tdaCount * sizeof *tdp); -#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY) - printf( "tdaTail = %p\n", sc->tdaTail ); -#endif - tdp = sc->tdaTail; - for (i = 0 ; i < sc->tdaCount ; i++) { - /* - * status, pkt_config, pkt_size, and all fragment fields - * are set to zero by sonic_allocate. - */ - -/* XXX not used by the BSD drivers - if (i & 1) - tdp->pkt_config = TDA_CONFIG_PINT; -*/ - - tdp->frag_count = 0; - tdp->frag[0].frag_link = LSW(tdp + 1); - tdp->link_pad = LSW(tdp + 1) | TDA_LINK_EOL; - tdp->linkp = &((tdp + 1)->frag[0].frag_link); - tdp->next = (TransmitDescriptor_t *)(tdp + 1); - tdp++; - } - tdp--; - sc->tdaHead = tdp; - tdp->link_pad = LSW(sc->tdaTail) | TDA_LINK_EOL; - tdp->next = (TransmitDescriptor_t *)sc->tdaTail; - tdp->linkp = &sc->tdaTail->frag[0].frag_link; - - /* - * Set up circular linked list in Receive Descriptor Area. - * Leaves sc->rda pointing at the `beginning' of the list. - * - * NOTE: The RDA and CDP must have the same MSW for their addresses. - */ - - sc->rda = sonic_allocate( - (sc->rdaCount * sizeof(ReceiveDescriptor_t)) + - sizeof(CamDescriptor_t) ); - sc->cdp = (CamDescriptorPointer_t) ((unsigned char *)sc->rda + - (sc->rdaCount * sizeof(ReceiveDescriptor_t))); -#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY) - printf( "rda area = %p\n", sc->rda ); - printf( "cdp area = %p\n", sc->cdp ); -#endif - - ordp = rdp = sc->rda; - for (i = 0 ; i < sc->rdaCount ; i++) { - /* - * status, byte_count, pkt_ptr0, pkt_ptr1, and seq_no are set - * to zero by sonic_allocate. - */ - rdp->link = LSW(rdp + 1); - rdp->in_use = RDA_FREE; - rdp->next = (ReceiveDescriptor_t *)(rdp + 1); - ordp = rdp; - rdp++; - } - /* - * Link the last desriptor to the 1st one and mark it as the end - * of the list. - */ - ordp->next = sc->rda; - ordp->link = LSW(sc->rda) | RDA_LINK_EOL; - sc->rdp_last = rdp; - - /* - * Allocate the receive resource area. - * In accordance with National Application Note 746, make the - * receive resource area bigger than the receive descriptor area. - * This has the useful side effect of making the receive resource - * area big enough to hold the CAM descriptor area. - */ - - sc->rsa = sonic_allocate((sc->rdaCount + RRA_EXTRA_COUNT) * sizeof *sc->rsa); -#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY) - printf( "rsa area = %p\n", sc->rsa ); -#endif - - /* - * Set up list in Receive Resource Area. - * Allocate space for incoming packets. - */ - - rwp = sc->rsa; - for (i = 0 ; i < (sc->rdaCount + RRA_EXTRA_COUNT) ; i++, rwp++) { - struct mbuf **mp; - - /* - * Allocate memory for buffer. - * Place a pointer to the mbuf at the beginning of the buffer - * so we can find the mbuf when the SONIC returns the buffer - * to the driver. - */ - - MGETHDR (m, M_WAIT, MT_DATA); - MCLGET (m, M_WAIT); - m->m_pkthdr.rcvif = &sc->arpcom.ac_if; - mp = mtod (m, struct mbuf **); - - m->m_data += sizeof *mp; - *mp = m; - p = mtod (m, void *); - - /* - * Set up RRA entry - */ - rwp->buff_ptr_lsw = LSW(p); - rwp->buff_ptr_msw = MSW(p); - rwp->buff_wc_lsw = RBUF_WC; - rwp->buff_wc_msw = 0; - } - sc->rea = rwp; -#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY) - printf( "rea area = %p\n", sc->rea ); -#endif - - - /* - * Issue a software reset. - */ - sonic_write_register( rp, SONIC_REG_CR, CR_RST | CR_STP | CR_RXDIS | CR_HTX ); - - /* - * Set up data configuration registers. - */ - sonic_write_register( rp, SONIC_REG_DCR, SONIC_DCR ); - sonic_write_register( rp, SONIC_REG_DCR2, SONIC_DC2 ); - - sonic_write_register( rp, SONIC_REG_CR, CR_STP | CR_RXDIS | CR_HTX ); - - /* - * Mask all interrupts - */ - sonic_write_register( rp, SONIC_REG_IMR, 0x3fff ); - - /* - * Clear outstanding interrupts. - */ - sonic_write_register( rp, SONIC_REG_ISR, 0x7FFF ); - - /* - * Clear the tally counters - */ - - sonic_write_register( rp, SONIC_REG_CRCT, 0xFFFF ); - sonic_write_register( rp, SONIC_REG_FAET, 0xFFFF ); - sonic_write_register( rp, SONIC_REG_MPT, 0xFFFF ); - sonic_write_register( rp, SONIC_REG_RSC, 0 ); - - /* - * Set the Receiver mode - * - * Enable/disable reception of broadcast packets - */ - - if (sc->acceptBroadcast) - sonic_write_register( rp, SONIC_REG_RCR, RCR_BRD ); - else - sonic_write_register( rp, SONIC_REG_RCR, 0 ); - - /* - * Set up Resource Area pointers - */ - - sonic_write_register( rp, SONIC_REG_URRA, MSW(sc->rsa) ); - sonic_write_register( rp, SONIC_REG_RSA, LSW(sc->rsa) ); - - sonic_write_register( rp, SONIC_REG_REA, LSW(sc->rea) ); - - sonic_write_register( rp, SONIC_REG_RRP, LSW(sc->rsa) ); - sonic_write_register( rp, SONIC_REG_RWP, LSW(sc->rsa) ); /* XXX was rea */ - - sonic_write_register( rp, SONIC_REG_URDA, MSW(sc->rda) ); - sonic_write_register( rp, SONIC_REG_CRDA, LSW(sc->rda) ); - - sonic_write_register( rp, SONIC_REG_UTDA, MSW(sc->tdaTail) ); - sonic_write_register( rp, SONIC_REG_CTDA, LSW(sc->tdaTail) ); - - /* - * Set End Of Buffer Count register to the value recommended - * in Note 1 of Section 3.4.4.4 of the SONIC data sheet. - */ - - sonic_write_register( rp, SONIC_REG_EOBC, RBUF_WC - 2 ); - - /* - * Issue the load RRA command - */ - - sonic_write_register( rp, SONIC_REG_CR, CR_RRRA ); - while (sonic_read_register( rp, SONIC_REG_CR ) & CR_RRRA) - continue; - - /* - * Remove device reset - */ - - sonic_write_register( rp, SONIC_REG_CR, 0 ); - - /* - * Set up the SONIC CAM with our hardware address. - */ - - hwaddr = sc->arpcom.ac_enaddr; - cdp = sc->cdp; - -#if (SONIC_DEBUG & SONIC_DEBUG_CAM) - printf( "hwaddr: %2x:%2x:%2x:%2x:%2x:%2x\n", - hwaddr[0], hwaddr[1], hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5] ); -#endif - - cdp->cep = 0; /* Fill first and only entry in CAM */ - cdp->cap0 = hwaddr[1] << 8 | hwaddr[0]; - cdp->cap1 = hwaddr[3] << 8 | hwaddr[2]; - cdp->cap2 = hwaddr[5] << 8 | hwaddr[4]; - cdp->ce = 0x0001; /* Enable first entry in CAM */ - - sonic_write_register( rp, SONIC_REG_CDC, 1 ); /* 1 entry in CDA */ - sonic_write_register( rp, SONIC_REG_CDP, LSW(cdp) ); - sonic_write_register( rp, SONIC_REG_CR, CR_LCAM ); /* Load the CAM */ - - while (sonic_read_register( rp, SONIC_REG_CR ) & CR_LCAM) - continue; - - /* - * Verify that CAM was properly loaded. - */ - - sonic_write_register( rp, SONIC_REG_CR, CR_RST | CR_STP | CR_RXDIS | CR_HTX ); - -#if (SONIC_DEBUG & SONIC_DEBUG_CAM) - sonic_write_register( rp, SONIC_REG_CEP, 0 ); /* Select first entry in CAM */ - printf ("Loaded Ethernet address into SONIC CAM.\n" - " Wrote %04x%04x%04x - %#x\n" - " Read %04x%04x%04x - %#x\n", - cdp->cap2, cdp->cap1, cdp->cap0, cdp->ce, - sonic_read_register( rp, SONIC_REG_CAP2 ), - sonic_read_register( rp, SONIC_REG_CAP1 ), - sonic_read_register( rp, SONIC_REG_CAP0 ), - sonic_read_register( rp, SONIC_REG_CE )); -#endif - - sonic_write_register( rp, SONIC_REG_CEP, 0 ); /* Select first entry in CAM */ - if ((sonic_read_register( rp, SONIC_REG_CAP2 ) != cdp->cap2) - || (sonic_read_register( rp, SONIC_REG_CAP1 ) != cdp->cap1) - || (sonic_read_register( rp, SONIC_REG_CAP0 ) != cdp->cap0) - || (sonic_read_register( rp, SONIC_REG_CE ) != cdp->ce)) { - printf ("Failed to load Ethernet address into SONIC CAM.\n" - " Wrote %04x%04x%04x - %#x\n" - " Read %04x%04x%04x - %#x\n", - cdp->cap2, cdp->cap1, cdp->cap0, cdp->ce, - sonic_read_register( rp, SONIC_REG_CAP2 ), - sonic_read_register( rp, SONIC_REG_CAP1 ), - sonic_read_register( rp, SONIC_REG_CAP0 ), - sonic_read_register( rp, SONIC_REG_CE )); - rtems_panic ("SONIC LCAM"); - } - - sonic_write_register(rp, SONIC_REG_CR, CR_TXP | CR_RXEN | CR_STP); - - /* - * Attach SONIC interrupt handler - */ - sonic_write_register( rp, SONIC_REG_IMR, 0 ); - old_handler = set_vector(sonic_interrupt_handler, sc->vector, 0); - - /* - * Remainder of hardware initialization is - * done by the receive and transmit daemons. - */ -} - -/* - * Send packet (caller provides header). - */ - -SONIC_STATIC void sonic_start(struct ifnet *ifp) -{ - struct sonic_softc *sc = ifp->if_softc; - - rtems_event_send(sc->txDaemonTid, START_TRANSMIT_EVENT); - ifp->if_flags |= IFF_OACTIVE; -} - -/* - * Initialize and start the device - */ - -SONIC_STATIC void sonic_init (void *arg) -{ - struct sonic_softc *sc = arg; - struct ifnet *ifp = &sc->arpcom.ac_if; - void *rp = sc->sonic; - int rcr; - - if (sc->txDaemonTid == 0) { - - /* - * Set up SONIC hardware - */ - sonic_initialize_hardware (sc); - - /* - * Start driver tasks - */ - sc->txDaemonTid = rtems_bsdnet_newproc ("SNtx", 4096, sonic_txDaemon, sc); - sc->rxDaemonTid = rtems_bsdnet_newproc ("SNrx", 4096, sonic_rxDaemon, sc); - } - - /* - * Set flags appropriately - */ - rcr = sonic_read_register( rp, SONIC_REG_RCR ); - if (ifp->if_flags & IFF_PROMISC) - rcr |= RCR_PRO; - else - rcr &= ~RCR_PRO; - sonic_write_register( rp, SONIC_REG_RCR, rcr); - - /* - * Tell the world that we're running. - */ - ifp->if_flags |= IFF_RUNNING; - - /* - * Enable receiver and transmitter - */ - sonic_write_register(rp, SONIC_REG_CR, CR_TXP | CR_RXEN); -} - -/* - * Driver ioctl handler - */ -static int -sonic_ioctl (struct ifnet *ifp, int command, caddr_t data) -{ - struct sonic_softc *sc = ifp->if_softc; - int error = 0; - - switch (command) { - case SIOCGIFADDR: - case SIOCSIFADDR: - ether_ioctl (ifp, command, data); - break; - - case SIOCSIFFLAGS: - switch (ifp->if_flags & (IFF_UP | IFF_RUNNING)) { - case IFF_RUNNING: - sonic_stop (sc); - break; - - case IFF_UP: - sonic_init (sc); - break; - - case IFF_UP | IFF_RUNNING: - sonic_stop (sc); - sonic_init (sc); - break; - - default: - break; - } - break; - - case SIO_RTEMS_SHOW_STATS: - sonic_stats (sc); - break; - - /* - * FIXME: All sorts of multicast commands need to be added here! - */ - default: - error = EINVAL; - break; - } - return error; -} - -/* - * Attach an SONIC driver to the system - * This is the only `extern' function in the driver. - */ -int -rtems_sonic_driver_attach (struct rtems_bsdnet_ifconfig *config) -{ - struct sonic_softc *sc; - struct ifnet *ifp; - int mtu; - int i; - - /* - * Find an unused entry - */ - i = 0; - sc = sonic_softc; - for (;;) { - if (sc == &sonic_softc[NSONIC]) { - printf ("No more SONIC devices.\n"); - return 0; - } - ifp = &sc->arpcom.ac_if; - if (ifp->if_softc == NULL) - break; - sc++; - i++; - } - - /* - * zero out the control structure - */ - - memset( sc, 0, sizeof(*sc) ); - - - /* - * Process options - */ - if (config->hardware_address) { - memcpy (sc->arpcom.ac_enaddr, config->hardware_address, ETHER_ADDR_LEN); - } - else { - memset (sc->arpcom.ac_enaddr, 0x08, ETHER_ADDR_LEN); - } - if (config->mtu) - mtu = config->mtu; - else - mtu = ETHERMTU; - if (config->rbuf_count) - sc->rdaCount = config->rbuf_count; - else - sc->rdaCount = RDA_COUNT; - if (config->xbuf_count) - sc->tdaCount = config->xbuf_count; - else - sc->tdaCount = TDA_COUNT; - sc->acceptBroadcast = !config->ignore_broadcast; - - /* - * Set up network interface values - */ - ifp->if_softc = sc; - ifp->if_unit = i + 1; - ifp->if_name = "sonic"; - ifp->if_mtu = mtu; - ifp->if_init = sonic_init; - ifp->if_ioctl = sonic_ioctl; - ifp->if_start = sonic_start; - ifp->if_output = ether_output; - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; - if (ifp->if_snd.ifq_maxlen == 0) - ifp->if_snd.ifq_maxlen = ifqmaxlen; - - /* - * Attach the interface - */ - if_attach (ifp); - ether_ifattach (ifp); - return 1; -} - -#if (SONIC_DEBUG & SONIC_DEBUG_PRINT_REGISTERS) -#include <stdio.h> - -char SONIC_Reg_name[64][6]= { - "CR", /* 0x00 */ - "DCR", /* 0x01 */ - "RCR", /* 0x02 */ - "TCR", /* 0x03 */ - "IMR", /* 0x04 */ - "ISR", /* 0x05 */ - "UTDA", /* 0x06 */ - "CTDA", /* 0x07 */ - "0x08", /* 0x08 */ - "0x09", /* 0x09 */ - "0x0A", /* 0x0A */ - "0x0B", /* 0x0B */ - "0x0C", /* 0x0C */ - "URDA", /* 0x0D */ - "CRDA", /* 0x0E */ - "0x0F", /* 0x0F */ - "0x10", /* 0x10 */ - "0x11", /* 0x11 */ - "0x12", /* 0x12 */ - "EOBC", /* 0x13 */ - "URRA", /* 0x14 */ - "RSA", /* 0x15 */ - "REA", /* 0x16 */ - "RRP", /* 0x17 */ - "RWP", /* 0x18 */ - "0x19", /* 0x19 */ - "0x1A", /* 0x1A */ - "0x1B", /* 0x1B */ - "0x1C", /* 0x1C */ - "0x0D", /* 0x1D */ - "0x1E", /* 0x1E */ - "0x1F", /* 0x1F */ - "0x20", /* 0x20 */ - "CEP", /* 0x21 */ - "CAP2", /* 0x22 */ - "CAP1", /* 0x23 */ - "CAP0", /* 0x24 */ - "CE", /* 0x25 */ - "CDP", /* 0x26 */ - "CDC", /* 0x27 */ - "SR", /* 0x28 */ - "WT0", /* 0x29 */ - "WT1", /* 0x2A */ - "RSC", /* 0x2B */ - "CRCT", /* 0x2C */ - "FAET", /* 0x2D */ - "MPT", /* 0x2E */ - "MDT", /* 0x2F */ - "0x30", /* 0x30 */ - "0x31", /* 0x31 */ - "0x32", /* 0x32 */ - "0x33", /* 0x33 */ - "0x34", /* 0x34 */ - "0x35", /* 0x35 */ - "0x36", /* 0x36 */ - "0x37", /* 0x37 */ - "0x38", /* 0x38 */ - "0x39", /* 0x39 */ - "0x3A", /* 0x3A */ - "0x3B", /* 0x3B */ - "0x3C", /* 0x3C */ - "0x3D", /* 0x3D */ - "0x3E", /* 0x3E */ - "DCR2" /* 0x3F */ -}; -#endif -void sonic_write_register( - void *base, - unsigned32 regno, - unsigned32 value -) -{ - volatile unsigned32 *p = base; - -#if (SONIC_DEBUG & SONIC_DEBUG_PRINT_REGISTERS) - printf( "%p Write 0x%04x to %s (0x%02x)\n", - &p[regno], value, SONIC_Reg_name[regno], regno ); - fflush( stdout ); -#endif - p[regno] = value; -} - -unsigned32 sonic_read_register( - void *base, - unsigned32 regno -) -{ - volatile unsigned32 *p = base; - unsigned32 value; - - value = p[regno]; -#if (SONIC_DEBUG & SONIC_DEBUG_PRINT_REGISTERS) - printf( "%p Read 0x%04x from %s (0x%02x)\n", - &p[regno], value, SONIC_Reg_name[regno], regno ); - fflush( stdout ); -#endif - return value; -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.h b/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.h deleted file mode 100644 index 64aa1718f1..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.h +++ /dev/null @@ -1,372 +0,0 @@ -/*
- *******************************************************************
- *******************************************************************
- ** **
- ** DECLARATIONS FOR NATIONAL DP83932 `SONIC' **
- ** SYSTEMS-ORIENTED NETWORK INTERFACE CONTROLLER **
- ** **
- *******************************************************************
- *******************************************************************
- */
-
-/*
- * $Revision$ $Date$ $Author$
- * $State$
- * $Id$
- */
-
-#ifndef _SONIC_DP83932_
-#define _SONIC_DP83932_
-
-#include <bsp.h>
-
-/*
- ******************************************************************
- * *
- * Device Registers *
- * *
- ******************************************************************
- */
-#define SONIC_REG_CR 0x00 /* Command */
-#define SONIC_REG_DCR 0x01 /* Data configuration */
-#define SONIC_REG_RCR 0x02 /* Receive control */
-#define SONIC_REG_TCR 0x03 /* Transmit control */
-#define SONIC_REG_IMR 0x04 /* Interrupt mask */
-#define SONIC_REG_ISR 0x05 /* Interrupt status */
-#define SONIC_REG_UTDA 0x06 /* Upper transmit descriptor address */
-#define SONIC_REG_CTDA 0x07 /* Current transmit descriptor address */
-#define SONIC_REG_URDA 0x0D /* Upper receive descriptor address */
-#define SONIC_REG_CRDA 0x0E /* Current receive descriptor address */
-#define SONIC_REG_EOBC 0x13 /* End of buffer word count */
-#define SONIC_REG_URRA 0x14 /* Upper receive resource */
-#define SONIC_REG_RSA 0x15 /* Resource start address */
-#define SONIC_REG_REA 0x16 /* Resource end address */
-#define SONIC_REG_RRP 0x17 /* Resouce read pointer */
-#define SONIC_REG_RWP 0x18 /* Resouce write pointer */
-#define SONIC_REG_CEP 0x21 /* CAM entry pointer */
-#define SONIC_REG_CAP2 0x22 /* CAM address port 2 */
-#define SONIC_REG_CAP1 0x23 /* CAM address port 1 */
-#define SONIC_REG_CAP0 0x24 /* CAM address port 0 */
-#define SONIC_REG_CE 0x25 /* CAM enable */
-#define SONIC_REG_CDP 0x26 /* CAM descriptor pointer */
-#define SONIC_REG_CDC 0x27 /* CAM descriptor count */
-#define SONIC_REG_SR 0x28 /* Silicon revision */
-#define SONIC_REG_WT0 0x29 /* Watchdog timer 0 */
-#define SONIC_REG_WT1 0x2A /* Watchdog timer 1 */
-#define SONIC_REG_RSC 0x2B /* Receive sequence counter */
-#define SONIC_REG_CRCT 0x2C /* CRC error tally */
-#define SONIC_REG_FAET 0x2D /* FAE tally */
-#define SONIC_REG_MPT 0x2E /* Missed packet tally */
-#define SONIC_REG_MDT 0x2F /* TX Maximum Deferral */
-#define SONIC_REG_DCR2 0x3F /* Data configuration 2 */
-
-/*
- * Command register
- */
-#define CR_LCAM 0x0200
-#define CR_RRRA 0x0100
-#define CR_RST 0x0080
-#define CR_ST 0x0020
-#define CR_STP 0x0010
-#define CR_RXEN 0x0008
-#define CR_RXDIS 0x0004
-#define CR_TXP 0x0002
-#define CR_HTX 0x0001
-
-/*
- * Data configuration register
- */
-#define DCR_EXBUS 0x8000
-#define DCR_LBR 0x2000
-#define DCR_PO1 0x1000
-#define DCR_PO0 0x0800
-#define DCR_SBUS 0x0400
-#define DCR_USR1 0x0200
-#define DCR_USR0 0x0100
-#define DCR_WC1 0x0080
-#define DCR_WC0 0x0040
-#define DCR_DW 0x0020
-#define DCR_BMS 0x0010
-#define DCR_RFT1 0x0008
-#define DCR_RFT0 0x0004
-#define DCR_TFT1 0x0002
-#define DCR_TFT0 0x0001
-
-/* data configuration register aliases */
-#define DCR_SYNC DCR_SBUS /* synchronous (memory cycle 2 clocks) */
-#define DCR_ASYNC 0 /* asynchronous (memory cycle 3 clocks) */
-
-#define DCR_WAIT0 0 /* 0 wait states added */
-#define DCR_WAIT1 DCR_WC0 /* 1 wait state added */
-#define DCR_WAIT2 DCR_WC1 /* 2 wait states added */
-#define DCR_WAIT3 (DCR_WC1|DCR_WC0) /* 3 wait states added */
-
-#define DCR_DW16 0 /* use 16-bit DMA accesses */
-#define DCR_DW32 DCR_DW /* use 32-bit DMA accesses */
-
-#define DCR_DMAEF 0 /* DMA until TX/RX FIFO has emptied/filled */
-#define DCR_DMABLOCK DCR_BMS /* DMA until RX/TX threshold crossed */
-
-#define DCR_RFT4 0 /* receive threshold 4 bytes */
-#define DCR_RFT8 DCR_RFT0 /* receive threshold 8 bytes */
-#define DCR_RFT16 DCR_RFT1 /* receive threshold 16 bytes */
-#define DCR_RFT24 (DCR_RFT1|DCR_RFT0) /* receive threshold 24 bytes */
-
-#define DCR_TFT8 0 /* transmit threshold 8 bytes */
-#define DCR_TFT16 DCR_TFT0 /* transmit threshold 16 bytes */
-#define DCR_TFT24 DCR_TFT1 /* transmit threshold 24 bytes */
-#define DCR_TFT28 (DCR_TFT1|DCR_TFT0) /* transmit threshold 28 bytes */
-
-/*
- * Receive control register
- */
-#define RCR_ERR 0x8000
-#define RCR_RNT 0x4000
-#define RCR_BRD 0x2000
-#define RCR_PRO 0x1000
-#define RCR_AMC 0x0800
-#define RCR_LB1 0x0400
-#define RCR_LB0 0x0200
-#define RCR_MC 0x0100
-#define RCR_BC 0x0080
-#define RCR_LPKT 0x0040
-#define RCR_CRS 0x0020
-#define RCR_COL 0x0010
-#define RCR_CRCR 0x0008
-#define RCR_FAER 0x0004
-#define RCR_LBK 0x0002
-#define RCR_PRX 0x0001
-
-/*
- * Transmit control register
- */
-#define TCR_PINT 0x8000
-#define TCR_POWC 0x4000
-#define TCR_CRCI 0x2000
-#define TCR_EXDIS 0x1000
-#define TCR_EXD 0x0400
-#define TCR_DEF 0x0200
-#define TCR_NCRS 0x0100
-#define TCR_CRSL 0x0080
-#define TCR_EXC 0x0040
-#define TCR_OWC 0x0020
-#define TCR_PMB 0x0008
-#define TCR_FU 0x0004
-#define TCR_BCM 0x0002
-#define TCR_PTX 0x0001
-
-/*
- * Interrupt mask register
- */
-#define IMR_BREN 0x4000
-#define IMR_HBLEN 0x2000
-#define IMR_LCDEN 0x1000
-#define IMR_PINTEN 0x0800
-#define IMR_PRXEN 0x0400
-#define IMR_PTXEN 0x0200
-#define IMR_TXEREN 0x0100
-#define IMR_TCEN 0x0080
-#define IMR_RDEEN 0x0040
-#define IMR_RBEEN 0x0020
-#define IMR_RBAEEN 0x0010
-#define IMR_CRCEN 0x0008
-#define IMR_FAEEN 0x0004
-#define IMR_MPEN 0x0002
-#define IMR_RFOEN 0x0001
-
-/*
- * Interrupt status register
- */
-#define ISR_BR 0x4000
-#define ISR_HBL 0x2000
-#define ISR_LCD 0x1000
-#define ISR_PINT 0x0800
-#define ISR_PKTRX 0x0400
-#define ISR_TXDN 0x0200
-#define ISR_TXER 0x0100
-#define ISR_TC 0x0080
-#define ISR_RDE 0x0040
-#define ISR_RBE 0x0020
-#define ISR_RBAE 0x0010
-#define ISR_CRC 0x0008
-#define ISR_FAE 0x0004
-#define ISR_MP 0x0002
-#define ISR_RFO 0x0001
-
-/*
- * Data configuration register 2
- */
-#define DCR2_EXPO3 0x8000
-#define DCR2_EXPO2 0x4000
-#define DCR2_EXPO1 0x2000
-#define DCR2_EXPO0 0x1000
-#define DCR2_PH 0x0010
-#define DCR2_PCM 0x0004
-#define DCR2_PCNM 0x0002
-#define DCR2_RJCM 0x0001
-
-/*
- * Known values for the Silicon Revision Register
- */
-
-#define SONIC_REVISION_B 4
-#define SONIC_REVISION_C 6
-
-/*
- ******************************************************************
- * *
- * Transmit Buffer Management *
- * *
- ******************************************************************
- */
-
-/*
- * Transmit descriptor area entry.
- * There is one transmit descriptor for each packet to be transmitted.
- * Statically reserve space for up to MAXIMUM_FRAGS_PER_PACKET fragments
- * per descriptor.
- */
-#define MAXIMUM_FRAGS_PER_DESCRIPTOR 6
-struct TransmitDescriptor {
- rtems_unsigned32 status;
- rtems_unsigned32 pkt_config;
- rtems_unsigned32 pkt_size;
- rtems_unsigned32 frag_count;
-
- /*
- * Packet fragment pointers
- */
- struct TransmitDescriptorFragLink {
- rtems_unsigned32 frag_lsw; /* LSW of fragment address */
-#define frag_link frag_lsw
- rtems_unsigned32 frag_msw; /* MSW of fragment address */
- rtems_unsigned32 frag_size;
- } frag[MAXIMUM_FRAGS_PER_DESCRIPTOR];
-
- /*
- * Space for link if all fragment pointers are used.
- */
- rtems_unsigned32 link_pad;
-
- /*
- * Extra RTEMS stuff
- */
- struct TransmitDescriptor *next; /* Circularly-linked list */
- struct mbuf *mbufp; /* First mbuf in packet */
- volatile rtems_unsigned32 *linkp; /* Pointer to un[xxx].link */
-};
-typedef struct TransmitDescriptor TransmitDescriptor_t;
-typedef volatile TransmitDescriptor_t *TransmitDescriptorPointer_t;
-
-/*
- * Transmit Configuration.
- * For standard Ethernet transmission, all bits in the transmit
- * configuration field are set to 0.
- */
-#define TDA_CONFIG_PINT 0x8000
-#define TDA_CONFIG_POWC 0x4000
-#define TDA_CONFIG_CRCI 0x2000
-#define TDA_CONFIG_EXDIS 0x1000
-
-/*
- * Transmit status
- */
-#define TDA_STATUS_COLLISION_MASK 0xF800
-#define TDA_STATUS_COLLISION_SHIFT 11
-#define TDA_STATUS_EXD 0x0400
-#define TDA_STATUS_DEF 0x0200
-#define TDA_STATUS_NCRS 0x0100
-#define TDA_STATUS_CRSL 0x0080
-#define TDA_STATUS_EXC 0x0040
-#define TDA_STATUS_OWC 0x0020
-#define TDA_STATUS_PMB 0x0008
-#define TDA_STATUS_FU 0x0004
-#define TDA_STATUS_BCM 0x0002
-#define TDA_STATUS_PTX 0x0001
-
-#define TDA_LINK_EOL 0x0001
-#define TDA_LINK_EOL_MASK 0xFFFE
-
-
-
-/*
- ******************************************************************
- * *
- * Receive Buffer Management *
- * *
- ******************************************************************
- */
-
-/*
- * Receive resource area entry.
- * There is one receive resource entry for each receive buffer area (RBA).
- * This driver allows only one packet per receive buffer area, so one
- * receive resource entry corresponds to one correctly-received packet.
- */
-struct ReceiveResource {
- rtems_unsigned32 buff_ptr_lsw; /* LSW of RBA address */
- rtems_unsigned32 buff_ptr_msw; /* MSW of RBA address */
- rtems_unsigned32 buff_wc_lsw; /* LSW of RBA size (16-bit words) */
- rtems_unsigned32 buff_wc_msw; /* MSW of RBA size (16-bit words) */
-};
-typedef struct ReceiveResource ReceiveResource_t;
-typedef volatile ReceiveResource_t *ReceiveResourcePointer_t;
-
-/*
- * Receive descriptor area entry.
- * There is one receive descriptor for each packet received.
- */
-struct ReceiveDescriptor {
- rtems_unsigned32 status;
- rtems_unsigned32 byte_count;
- rtems_unsigned32 pkt_lsw; /* LSW of packet address */
- rtems_unsigned32 pkt_msw; /* MSW of packet address */
- rtems_unsigned32 seq_no;
- rtems_unsigned32 link;
- rtems_unsigned32 in_use;
-
- /*
- * Extra RTEMS stuff
- */
- volatile struct ReceiveDescriptor *next; /* Circularly-linked list */
-};
-typedef struct ReceiveDescriptor ReceiveDescriptor_t;
-typedef volatile ReceiveDescriptor_t *ReceiveDescriptorPointer_t;
-
-typedef struct {
- rtems_unsigned32 cep; /* CAM Entry Pointer */
- rtems_unsigned32 cap0; /* CAM Address Port 0 xx-xx-xx-xx-YY-YY */
- rtems_unsigned32 cap1; /* CAM Address Port 1 xx-xx-YY-YY-xxxx */
- rtems_unsigned32 cap2; /* CAM Address Port 2 YY-YY-xx-xx-xx-xx */
- rtems_unsigned32 ce;
-} CamDescriptor_t;
-
-typedef volatile CamDescriptor_t *CamDescriptorPointer_t;
-
-/*
- * Receive status
- */
-#define RDA_STATUS_ERR 0x8800
-#define RDA_STATUS_RNT 0x4000
-#define RDA_STATUS_BRD 0x2000
-#define RDA_STATUS_PRO 0x1000
-#define RDA_STATUS_AMC 0x0800
-#define RDA_STATUS_LB1 0x0400
-#define RDA_STATUS_LB0 0x0200
-#define RDA_STATUS_MC 0x0100
-#define RDA_STATUS_BC 0x0080
-#define RDA_STATUS_LPKT 0x0040
-#define RDA_STATUS_CRS 0x0020
-#define RDA_STATUS_COL 0x0010
-#define RDA_STATUS_CRCR 0x0008
-#define RDA_STATUS_FAER 0x0004
-#define RDA_STATUS_LBK 0x0002
-#define RDA_STATUS_PRX 0x0001
-
-#define RDA_LINK_EOL 0x0001
-#define RDA_LINK_EOL_MASK 0xFFFE
-#define RDA_IN_USE 0x0000 /* SONIC has finished with the packet */
- /* and the driver can process it */
-#define RDA_FREE 0xFFFF /* SONIC can use it */
-
-#endif /* _SONIC_DP83932_ */
diff --git a/c/src/lib/libbsp/powerpc/dmv177/start/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/start/Makefile.in deleted file mode 100644 index cb7d9c07ec..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/start/Makefile.in +++ /dev/null @@ -1,54 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGMS=${ARCH}/start.o - -# C source names, if any, go here -- minus the .c -C_PIECES= -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES=start -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: ${ARCH} $(SRCS) $(OBJS) $(PGM) - $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib diff --git a/c/src/lib/libbsp/powerpc/dmv177/start/start.s b/c/src/lib/libbsp/powerpc/dmv177/start/start.s deleted file mode 100644 index f8e4e4e614..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/start/start.s +++ /dev/null @@ -1,117 +0,0 @@ -/* - * This is based on the mvme-crt0.S file from libgloss/rs6000. - * crt0.S -- startup file for PowerPC systems. - * - * Copyright (c) 1995 Cygnus Support - * - * The authors hereby grant permission to use, copy, modify, distribute, - * and license this software and its documentation for any purpose, provided - * that existing copyright notices are retained in all copies and that this - * notice is included verbatim in any distributions. No written agreement, - * license, or royalty fee is required for any of the authorized uses. - * Modifications to this software may be copyrighted by their authors - * and need not follow the licensing terms described here, provided that - * the new terms are clearly indicated on the first page of each file where - * they apply. - * - * $Id$ - */ - -#include <rtems/score/targopts.h> -#include "ppc-asm.h" - - .file "start.s" - .section ".got2","aw" - .align 2 - -.LCTOC1 = .+32768 - - .extern FUNC_NAME(atexit) - .globl FUNC_NAME(__atexit) - .section ".sdata","aw" - .align 2 -FUNC_NAME(__atexit): /* tell C's eabi-ctor's we have an atexit function */ - .long FUNC_NAME(atexit)@fixup /* and that it is to register __do_global_dtors */ - - .section ".fixup","aw" - .align 2 - .long FUNC_NAME(__atexit) - - .section ".got2","aw" -.Ltable = .-.LCTOC1 - .long .LCTOC1 /* address we think .LCTOC1 is loaded at */ - -.Lbss_start = .-.LCTOC1 - .long __bss_start - -.Lend = .-.LCTOC1 - .long _end - -.Lstack = .-.LCTOC1 /* stack address if set by user */ - .long __stack - - .text -.Lptr: - .long .LCTOC1-.Laddr - - .globl _start - .type _start,@function -_start: - lis r5,0 - mr r4,r5 - ori r4,r4,0x0000 /* 0x2030 */ - mtmsr r4 - -/* Add special purpose register initialization based upon the console driver - * initialization of these registers XXXXX - */ - - bl .Laddr /* get current address */ - -.Laddr: - mflr r4 /* real address of .Laddr */ - lwz r5,(.Lptr-.Laddr)(r4) /* linker generated address of .LCTOC1 */ - add r5,r5,r4 /* correct to real pointer */ - lwz r4,.Ltable(r5) /* get linker's idea of where .Laddr is */ - subf r4,r4,r5 /* calculate difference between where linked and current */ - - /* clear bss */ - lwz r6,.Lbss_start(r5) /* calculate beginning of the BSS */ - lwz r7,.Lend(r5) /* calculate end of the BSS */ - add r6,r6,r4 /* adjust pointers */ - add r7,r7,r4 - - cmplw 1,r6,r7 - bc 4,4,.Ldone - - subf r8,r6,r7 /* number of bytes to zero */ - srwi r9,r8,2 /* number of words to zero */ - mtctr r9 - li r0,0 /* zero to clear memory */ - addi r6,r6,-4 /* adjust so we can use stwu */ -.Lloop: - stwu r0,4(r6) /* zero bss */ - bdnz .Lloop - -.Ldone: - - lwz r0,.Lstack(r5) /* stack address or 0 */ - cmplwi 1,r0,0 /* equal to 0? */ - bc 12,6,.Lnostack /* use default stack if == 0 */ - mr sp,r0 /* use user defined stack */ - -.Lnostack: - /* set up initial stack frame */ - addi sp,sp,-4 /* make sure we don't overwrite debug mem */ - lis r0,0 - stw r0,0(sp) /* clear back chain */ - stwu sp,-56(sp) /* push another stack frame */ - - /* Let her rip */ - bl FUNC_NAME(boot_card) - - /* return value from boot_card is argument to exit */ - /* bl FUNC_NAME(exit) */ - trap -.Lstart: - .size _start,.Lstart-_start diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/startup/Makefile.in deleted file mode 100644 index 0877918685..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/startup/Makefile.in +++ /dev/null @@ -1,57 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@:@srcdir@/../../../shared -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/startup.rel - -# C source names, if any, go here -- minus the .c -C_PIECES=bspclean bsplibc bsppost bspstart main sbrk setvec genpvec vmeintr -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES= -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=linkcmds $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -${PGM}: ${SRCS} ${OBJS} - $(make-rel) - -all: ${ARCH} $(SRCS) $(INSTALLED_O_FILES) $(PGM) - $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.c b/c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.c deleted file mode 100644 index 5e354f9387..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/startup/bspclean.c +++ /dev/null @@ -1,19 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1998. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -void bsp_cleanup( void ) -{ -#if 0 - asm volatile( "li 10,99" ); /* 0x63 */ - asm volatile( "sc" ); -#endif -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c b/c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c deleted file mode 100644 index 07a5bf1473..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/startup/bspstart.c +++ /dev/null @@ -1,134 +0,0 @@ -/* bspstart.c - * - * This set of routines starts the application. It includes application, - * board, and monitor specific initialization and configuration. - * The generic CPU dependent initialization has been performed - * before any of these are invoked. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * $Id$ - */ - -#include <bsp.h> -#include <rtems/libio.h> - -#include <libcsupport.h> - -#include <string.h> - -/* - * The original table from the application and our copy of it with - * some changes. - */ - -extern rtems_configuration_table Configuration; -rtems_configuration_table BSP_Configuration; -rtems_cpu_table Cpu_table; -rtems_unsigned32 bsp_isr_level; - -/* - * Use the shared implementations of the following routines - */ - -void bsp_postdriver_hook(void); -void bsp_libc_init( void *, unsigned32, int ); - -/*PAGE - * - * bsp_pretasking_hook - * - * BSP pretasking hook. Called just before drivers are initialized. - * Used to setup libc and install any BSP extensions. - */ - -void bsp_pretasking_hook(void) -{ - extern int end; - rtems_unsigned32 heap_start; - rtems_unsigned32 heap_size; - - heap_start = (rtems_unsigned32) &end; - if (heap_start & (CPU_ALIGNMENT-1)) - heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1); - - heap_size = BSP_Configuration.work_space_start - (void *)&end; - heap_size &= 0xfffffff0; /* keep it as a multiple of 16 bytes */ - - bsp_libc_init((void *) heap_start, heap_size, 0); - -#ifdef RTEMS_DEBUG - rtems_debug_enable( RTEMS_DEBUG_ALL_MASK ); -#endif -} - -/* PAGE - * - * bsp_predriver_hook - * - * Initialization before drivers are setup. - */ - -void bsp_predriver_hook(void) -{ - initialize_external_exception_vector(); -} - -/*PAGE - * - * bsp_start - * - * This routine does the bulk of the system initialization. - */ - -void bsp_start( void ) -{ - unsigned char *work_space_start; - unsigned int msr_value = 0x2030; - - /* - * Set BSP to initial value. Note: This value is a guess - * check how the real board comes up. This is critical to - * getting the source to work with the debugger. - */ - - _CPU_MSR_SET( msr_value ); - - /* - * Need to "allocate" the memory for the RTEMS Workspace and - * tell the RTEMS configuration where it is. This memory is - * not malloc'ed. It is just "pulled from the air". - */ - - work_space_start = - (unsigned char *)&RAM_END - BSP_Configuration.work_space_size; - - if ( work_space_start <= (unsigned char *)&end ) { - DEBUG_puts( "bspstart: Not enough RAM!!!\n" ); - bsp_cleanup(); - } - - BSP_Configuration.work_space_start = work_space_start; - - /* - * Account for the console's resources - */ - - console_reserve_resources( &BSP_Configuration ); - - /* - * initialize the CPU table for this BSP - */ - - Cpu_table.exceptions_in_RAM = TRUE; - Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ - Cpu_table.predriver_hook = bsp_predriver_hook; - Cpu_table.postdriver_hook = bsp_postdriver_hook; - /* Cpu_table.clicks_per_usec = 66666667 / 4000000; */ - Cpu_table.clicks_per_usec = 66666667 / 4000000 / 2; - - Cpu_table.do_zero_of_workspace = TRUE; - Cpu_table.interrupt_stack_size = (12 * 1024); -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c b/c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c deleted file mode 100644 index 2faa40ed9a..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/startup/genpvec.c +++ /dev/null @@ -1,239 +0,0 @@ -/* genpvec.c - * - * These routines handle the external exception. Multiple ISRs occur off - * of this one interrupt. This method will allow multiple ISRs to be - * called using the same IRQ index. However, removing the ISR routines is - * presently not supported. - * - * The external exception vector numbers begin with DMV170_IRQ_FIRST. - * DMV170_IRQ_FIRST is defined to be one greater than the last processor - * interrupt. - * - * COPYRIGHT (c) 1989-1998. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <bsp.h> -#include "chain.h" -#include <assert.h> - -#define NUM_LIRQ_HANDLERS 20 -#define NUM_LIRQ ( MAX_BOARD_IRQS - PPC_IRQ_LAST ) - -/* - * Structure to for one of possible multiple interrupt handlers for - * a given interrupt. - */ -typedef struct -{ - Chain_Node Node; - rtems_isr_entry handler; /* isr routine */ - rtems_vector_number vector; /* vector number */ -} EE_ISR_Type; - -/* - * Note: The following will not work if we add a method to remove - * handlers at a later time. - */ -EE_ISR_Type ISR_Nodes [NUM_LIRQ_HANDLERS]; -rtems_unsigned16 Nodes_Used; -Chain_Control ISR_Array [NUM_LIRQ]; - -/*PAGE - * - * external_exception_ISR - * - * This interrupt service routine is called for an External Exception. - * - * Input parameters: - * vector - vector number representing the external exception vector. - * - * Output parameters: NONE - * - * Return values: - */ - -rtems_isr external_exception_ISR ( - rtems_vector_number vector /* IN */ -) -{ - rtems_unsigned16 index; - rtems_boolean is_active=FALSE; - rtems_unsigned32 scv64_status; - rtems_vector_number chained_vector; - Chain_Node *node; - EE_ISR_Type *ee_isr; - - - /* - * Get all active interrupts. - */ - scv64_status = SCV64_Get_Interrupt(); - scv64_status &= SCV64_Get_Interrupt_Enable(); - - /* - * Process any set interrupts. - */ - for (index = 0; index <= 5; index++) { - switch(index) { - case 0: - is_active = SCV64_Is_IRQ0( scv64_status ); - break; - case 1: - is_active = SCV64_Is_IRQ1( scv64_status ); - break; - case 2: - is_active = SCV64_Is_IRQ2( scv64_status ); - break; - case 3: - is_active = SCV64_Is_IRQ3( scv64_status ); - break; - case 4: - is_active = SCV64_Is_IRQ4( scv64_status ); - break; - case 5: - is_active = SCV64_Is_IRQ5( scv64_status ); - break; - } - - if (is_active) { - /* - * Read vector. - */ - node = ISR_Array[ index ].first; - while ( !_Chain_Is_tail( &ISR_Array[ index ], node ) ) { - ee_isr = (EE_ISR_Type *) node; - (*ee_isr->handler)( ee_isr->vector ); - node = node->next; - } - } - } -} - - -/*PAGE - * - * initialize_external_exception_vector - * - * This routine initializes the external exception vector - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: NONE - */ - -void initialize_external_exception_vector () -{ - int i; - rtems_isr_entry previous_isr; - rtems_status_code status; - - Nodes_Used = 0; - - /* - * Initialize the SCV64 chip - */ - SCV64_Initialize(); - - for (i=0; i <NUM_LIRQ; i++) - Chain_Initialize_empty( &ISR_Array[i] ); - - /* - * Install external_exception_ISR () as the handler for - * the General Purpose Interrupt. - */ - - status = rtems_interrupt_catch( external_exception_ISR, - PPC_IRQ_EXTERNAL , (rtems_isr_entry *) &previous_isr ); - -} - -/*PAGE - * - * set_EE_vector - * - * This routine installs one of multiple ISRs for the general purpose - * inerrupt. - * - * Input parameters: - * handler - handler to call at exception - * vector - vector number associated with this handler. - * - * Output parameters: NONE - * - * Return values: - */ - -rtems_isr_entry set_EE_vector( - rtems_isr_entry handler, /* isr routine */ - rtems_vector_number vector /* vector number */ -) -{ - rtems_unsigned16 vec_idx = vector - DMV170_IRQ_FIRST; - rtems_unsigned32 index; - - /* - * Verify that all of the nodes have not been used. - */ - assert (Nodes_Used < NUM_LIRQ_HANDLERS); - - /* - * If we have already installed this handler for this vector, then - * just reset it. - */ - - for ( index=0 ; index <= Nodes_Used ; index++ ) { - if ( ISR_Nodes[index].vector == vector && - ISR_Nodes[index].handler == handler ) - return 0; - } - - /* - * Increment the number of nedes used and set the index for the node - * array. - */ - - Nodes_Used++; - index = Nodes_Used - 1; - - /* - * Write the values of the handler and the vector to this node. - */ - ISR_Nodes[index].handler = handler; - ISR_Nodes[index].vector = vector; - - /* - * Connect this node to the chain at the location of the - * vector index. - */ - Chain_Append( &ISR_Array[vec_idx], &ISR_Nodes[index].Node ); - - /* - * Enable the LIRQ interrupt. - */ - SCV64_Generate_DUART_Interrupts(); - - /* - * No interrupt service routine was removed so return 0 - */ - return 0; -} - - - - - - - - - - diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds b/c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds deleted file mode 100644 index 52e379d8a4..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/startup/linkcmds +++ /dev/null @@ -1,183 +0,0 @@ -OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", - "elf32-powerpc") -OUTPUT_ARCH(powerpc) -ENTRY(_start) - -/* - * Number of Decrementer countdowns per millisecond - * - * Calculated by: (66.67 Mhz * 1000) / 4 cycles per click - * - -PROVIDE(CPU_PPC_CLICKS_PER_MS = 16667); -*/ - -MEMORY - { - RAM : ORIGIN = 0x41000, LENGTH = 32M - EPROM : ORIGIN = 0xFFF00000, LENGTH = 0x20000 - } - -SECTIONS -{ - /* Read-only sections, merged into text segment: */ - /* . = 0x40000 + SIZEOF_HEADERS; */ - /* . = 0x1000000;*/ - . = 0x41000; - .interp : { *(.interp) } - .hash : { *(.hash) } - .dynsym : { *(.dynsym) } - .dynstr : { *(.dynstr) } - .rela.text : { *(.rela.text) } - .rela.data : { *(.rela.data) } - .rela.rodata : { *(.rela.rodata) } - .rela.got : { *(.rela.got) } - .rela.got1 : { *(.rela.got1) } - .rela.got2 : { *(.rela.got2) } - .rela.ctors : { *(.rela.ctors) } - .rela.dtors : { *(.rela.dtors) } - .rela.init : { *(.rela.init) } - .rela.fini : { *(.rela.fini) } - .rela.bss : { *(.rela.bss) } - .rela.plt : { *(.rela.plt) } - .rela.sdata : { *(.rela.sdata2) } - .rela.sbss : { *(.rela.sbss2) } - .rela.sdata2 : { *(.rela.sdata2) } - .rela.sbss2 : { *(.rela.sbss2) } - .plt : { *(.plt) } - .text : - { - *(.text) - *(.descriptors) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - } >RAM - .init : { *(.init) } >RAM - .fini : { *(.fini) } >RAM - .rodata : { *(.rodata) } >RAM - .rodata1 : { *(.rodata1) } >RAM - _etext = .; - PROVIDE (etext = .); - PROVIDE (__SDATA2_START__ = .); - .sdata2 : { *(.sdata2) } >RAM - .sbss2 : { *(.sbss2) } >RAM - PROVIDE (__SBSS2_END__ = .); - /* Adjust the address for the data segment. We want to adjust up to - the same address within the page on the next page up. It would - be more correct to do this: - . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1)); - The current expression does not correctly handle the case of a - text segment ending precisely at the end of a page; it causes the - data segment to skip a page. The above expression does not have - this problem, but it will currently (2/95) cause BFD to allocate - a single segment, combining both text and data, for this case. - This will prevent the text segment from being shared among - multiple executions of the program; I think that is more - important than losing a page of the virtual address space (note - that no actual memory is lost; the page which is skipped can not - be referenced). */ - . = ALIGN(8) + 0x40000; - PROVIDE (sdata = .); - .data : - { - *(.data) - CONSTRUCTORS - } >RAM - PROVIDE (__EXCEPT_START__ = .); - .gcc_except_table : { *(.gcc_except_table) } >RAM - PROVIDE (__EXCEPT_END__ = .); - - .data1 : { *(.data1) } >RAM - .got1 : { *(.got1) } >RAM - .dynamic : { *(.dynamic) } >RAM - /* Put .ctors and .dtors next to the .got2 section, so that the pointers - get relocated with -mrelocatable. Also put in the .fixup pointers. - The current compiler no longer needs this, but keep it around for 2.7.2 */ - PROVIDE (_GOT2_START_ = .); - PROVIDE (__GOT2_START__ = .); - .got2 : { *(.got2) } >RAM - PROVIDE (_GOT2_END_ = .); - PROVIDE (__GOT2_END__ = .); - - PROVIDE (__CTOR_LIST__ = .); - .ctors : { *(.ctors) } >RAM - PROVIDE (__CTOR_END__ = .); - - PROVIDE (__DTOR_LIST__ = .); - .dtors : { *(.dtors) } >RAM - PROVIDE (__DTOR_END__ = .); - - PROVIDE (_FIXUP_START_ = .); - PROVIDE (__FIXUP_START__ = .); - .fixup : { *(.fixup) } >RAM - PROVIDE (_FIXUP_END_ = .); - PROVIDE (__FIXUP_END__ = .); - - PROVIDE (_GOT2_END_ = .); - PROVIDE (_GOT_START_ = .); - s.got = .; - .got : { *(.got) } >RAM - .got.plt : { *(.got.plt) } >RAM - PROVIDE (_GOT_END_ = .); - PROVIDE (__GOT_END__ = .); - - /* We want the small data sections together, so single-instruction offsets - can access them all, and initialized data all before uninitialized, so - we can shorten the on-disk segment size. */ - PROVIDE (__SDATA_START__ = .); - .sdata : { *(.sdata) } >RAM - _edata = .; - PROVIDE (edata = .); - - PROVIDE (RAM_END = 4M); - .sbss : - { - PROVIDE (__sbss_start = .); - *(.sbss) - *(.scommon) - PROVIDE (__sbss_end = .); - } >RAM - PROVIDE (__SBSS_END__ = .); - .bss : - { - PROVIDE (__bss_start = .); - *(.dynbss) - *(.bss) - *(COMMON) - } >RAM - . = ALIGN(8) + 0x8000; - PROVIDE (__stack = .); - _end = . ; - PROVIDE (end = .); - - /* These are needed for ELF backends which have not yet been - converted to the new style linker. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. */ - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } - /* SGI/MIPS DWARF 2 extensions */ - .debug_weaknames 0 : { *(.debug_weaknames) } - .debug_funcnames 0 : { *(.debug_funcnames) } - .debug_typenames 0 : { *(.debug_typenames) } - .debug_varnames 0 : { *(.debug_varnames) } - /* These must appear regardless of . */ -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c b/c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c deleted file mode 100644 index cf385569d0..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/startup/setvec.c +++ /dev/null @@ -1,58 +0,0 @@ -/* set_vector - * - * This routine installs an interrupt vector on the target Board/CPU. - * This routine is allowed to be as board dependent as necessary. - * - * INPUT: - * handler - interrupt handler entry point - * vector - vector number - * type - 0 indicates raw hardware connect - * 1 indicates RTEMS interrupt connect - * - * RETURNS: - * address of previous interrupt handler - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <rtems.h> -#include <bsp.h> - -/*PAGE - * - * set_vector - * - * This routine installs an interrupt handler for vector. - */ - -rtems_isr_entry set_vector( /* returns old vector */ - rtems_isr_entry handler, /* isr routine */ - rtems_vector_number vector, /* vector number */ - int type /* RTEMS or RAW intr */ -) -{ - rtems_isr_entry previous_isr; - rtems_status_code status; - - /* - * vectors greater than PPC603e_IRQ_LAST are handled by the General purpose - * interupt handler. - */ - if ( vector > PPC_IRQ_LAST ) { - set_EE_vector ( handler, vector ); - } - else { - status = rtems_interrupt_catch( - handler, vector, (rtems_isr_entry *) &previous_isr ); - } - return previous_isr; -} - diff --git a/c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c b/c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c deleted file mode 100644 index 212d7eb938..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/startup/vmeintr.c +++ /dev/null @@ -1,84 +0,0 @@ -/* vmeintr.c - * - * VMEbus support routines for the DMV170. - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <rtems.h> -#include <bsp.h> -#include <vmeintr.h> - -/* PAGE - * - * VME_interrupt_Disable - * - * This routine disables vme interupts - * - * Input parameters: - * mask - interupt mask - * - * Output parameters: NONE - * - * Return values: NONE - */ - -void VME_interrupt_Disable ( - VME_interrupt_Mask mask /* IN */ -) -{ - volatile rtems_unsigned8 *VME_interrupt_enable; - rtems_unsigned8 value; - -#if 0 - VME_interrupt_enable = ACC_VIE; -#else - VME_interrupt_enable = 0; -#endif - value = *VME_interrupt_enable; - - value &= ~mask; /* turn off interrupts for all levels in mask */ - - *VME_interrupt_enable = value; -} - -/* PAGE - * - * VME_interrupt_Enable - * - * This routine enables vme interupts - * - * Input parameters: - * mask - interupt mask - * - * Output parameters: NONE - * - * Return values: - */ - -void VME_interrupt_Enable ( - VME_interrupt_Mask mask /* IN */ -) -{ - volatile rtems_unsigned8 *VME_interrupt_enable; - rtems_unsigned8 value; - -#if 0 - VME_interrupt_enable = ACC_VIE; -#else - VME_interrupt_enable = 0; -#endif - value = *VME_interrupt_enable; - - value |= mask; /* turn on interrupts for all levels in mask */ - - *VME_interrupt_enable = value; -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/timer/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/timer/Makefile.in deleted file mode 100644 index 16665e4de9..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/timer/Makefile.in +++ /dev/null @@ -1,59 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/timer.rel - -# C source names, if any, go here -- minus the .c -C_PIECES=timer -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES= -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -${PGM}: ${SRCS} ${OBJS} - $(make-rel) - -all: ${ARCH} $(SRCS) $(PGM) - -# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile -install: all diff --git a/c/src/lib/libbsp/powerpc/dmv177/timer/timer.c b/c/src/lib/libbsp/powerpc/dmv177/timer/timer.c deleted file mode 100644 index 674e2cf5a8..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/timer/timer.c +++ /dev/null @@ -1,132 +0,0 @@ -/* timer.c - * - * This file implements a benchmark timer using the General Purpose Timer on - * the MEC. - * - * The license and distribution terms for this file are in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <assert.h> - -#include <bsp.h> - -rtems_unsigned64 Timer_driver_Start_time; - -rtems_boolean Timer_driver_Find_average_overhead; - -/*PAGE - * - * Timer_initialize - * - * This routine initializes the timer. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: NONE - * - */ - -void Timer_initialize() -{ - /* - * Timer runs long and accurate enough not to require an interrupt. - */ - - - Timer_driver_Start_time = PPC_Get_timebase_register(); - - -} - -#define AVG_OVERHEAD 24 /* It typically takes 24 instructions */ - /* to start/stop the timer. */ -#define LEAST_VALID 1 /* Don't trust a value lower than this */ - -/* PAGE - * - * Read_timer - * - * This routine reads the timer. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: timer in ms units - * - */ - -int Read_timer() -{ - rtems_unsigned64 clicks; - rtems_unsigned64 total64; - rtems_unsigned32 total; - - /* approximately CLOCK_SPEED clicks per microsecond */ - - clicks = PPC_Get_timebase_register(); - - assert( clicks > Timer_driver_Start_time ); - - total64 = clicks - Timer_driver_Start_time; - - assert( total64 <= 0xffffffff ); /* fits into a unsigned32 */ - - total = (rtems_unsigned32) total64; - - if ( Timer_driver_Find_average_overhead == 1 ) - return total; /* in one microsecond units */ - - if ( total < LEAST_VALID ) - return 0; /* below timer resolution */ - - return total - AVG_OVERHEAD; -} - -/* PAGE - * - * Empty_function - * - * This routine is called during the idle loop. - * - * Input parameters: NONE - * - * Output parameters: - * status code of successful - * - * Return values: NONE - * - */ - -rtems_status_code Empty_function( void ) -{ - return RTEMS_SUCCESSFUL; -} - -/* PAGE - * - * Set_find_average_overhead - * - * This routine sets a global boolean to the value passed in. - * - * Input parameters: - * find_flag - flag to indicate to find the average overhead. - * - * Output parameters: NONE - * - * Return values: NONE - * - */ - -void Set_find_average_overhead( - rtems_boolean find_flag -) -{ - Timer_driver_Find_average_overhead = find_flag; -} diff --git a/c/src/lib/libbsp/powerpc/dmv177/times b/c/src/lib/libbsp/powerpc/dmv177/times deleted file mode 100644 index 2a18eae92a..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/times +++ /dev/null @@ -1,191 +0,0 @@ -# -# Timing Test Suite Results for the DY-4 DMV177 -# -# $Id$ -# - -Board: DY-4 DMV177 -CPU: PPC 603e -Clock Speed: 100 Mhz -Memory Configuration: 32 Mbyte DRAM -Wait States: XXX - -Times Reported in: cycles -Timer Source: on-CPU General Purpose Count Down Timer - -Column A: 4.0.0-lmco -Column B: unused - -# DESCRIPTION A B -== ================================================================= ==== ==== - 1 rtems_semaphore_create 571 - rtems_semaphore_delete 575 - rtems_semaphore_obtain: available 414 - rtems_semaphore_obtain: not available -- NO_WAIT 414 - rtems_semaphore_release: no waiting tasks 501 - - 2 rtems_semaphore_obtain: not available -- caller blocks 1254 - - 3 rtems_semaphore_release: task readied -- preempts caller 982 - - 4 rtems_task_restart: blocked task -- preempts caller 1640 - rtems_task_restart: ready task -- preempts caller 1601 - rtems_semaphore_release: task readied -- returns to caller 636 - rtems_task_create 2301 - rtems_task_start 794 - rtems_task_restart: suspended task -- returns to caller 906 - rtems_task_delete: suspended task 1555 - rtems_task_restart: ready task -- returns to caller 928 - rtems_task_restart: blocked task -- returns to caller 1102 - rtems_task_delete: blocked task 1609 - - 5 rtems_task_suspend: calling task 960 - rtems_task_resume: task readied -- preempts caller 803 - - 6 rtems_task_restart: calling task 1137 - rtems_task_suspend: returns to caller 433 - rtems_task_resume: task readied -- returns to caller 451 - rtems_task_delete: ready task 1620 - - 7 rtems_task_restart: suspended task -- preempts caller 1483 - - 8 rtems_task_set_priority: obtain current priority 368 - rtems_task_set_priority: returns to caller 633 - rtems_task_mode: obtain current mode 184 - rtems_task_mode: no reschedule 213 - rtems_task_mode: reschedule -- returns to caller 247 - rtems_task_mode: reschedule -- preempts caller 919 - rtems_task_set_note 383 - rtems_task_get_note 382 - rtems_clock_set 792 - rtems_clock_get 78 - - 9 rtems_message_queue_create 2270 - rtems_message_queue_send: no waiting tasks 923 - rtems_message_queue_urgent: no waiting tasks 919 - rtems_message_queue_receive: available 755 - rtems_message_queue_flush: no messages flushed 369 - rtems_message_queue_flush: messages flushed 431 - rtems_message_queue_delete 708 - -10 rtems_message_queue_receive: not available -- NO_WAIT 467 - rtems_message_queue_receive: not available -- caller blocks 1283 - -11 rtems_message_queue_send: task readied -- preempts caller 1322 - -12 rtems_message_queue_send: task readied -- returns to caller 955 - -13 rtems_message_queue_urgent: task readied -- preempts caller 1322 - -14 rtems_message_queue_urgent: task readied -- returns to caller 955 - -15 rtems_event_receive: obtain current events 43 - rtems_event_receive: not available -- NO_WAIT 331 - rtems_event_receive: not available -- caller blocks 1043 - rtems_event_send: no task readied 354 - rtems_event_receive: available 357 - rtems_event_send: task readied -- returns to caller 571 - -16 rtems_event_send: task readied -- preempts caller 946 - -17 rtems_task_set_priority: preempts caller 1211 - -18 rtems_task_delete: calling task 2117 - -19 rtems_signal_catch 267 - rtems_signal_send: returns to caller 408 - rtems_signal_send: signal to self 607 - exit ASR overhead: returns to calling task 464 - exit ASR overhead: returns to preempting task 752 - -20 rtems_partition_create 762 - rtems_region_create 614 - rtems_partition_get_buffer: available 394 - rtems_partition_get_buffer: not available 376 - rtems_partition_return_buffer 420 - rtems_partition_delete 426 - rtems_region_get_segment: available 515 - rtems_region_get_segment: not available -- NO_WAIT 472 - rtems_region_return_segment: no waiting tasks 544 - rtems_region_get_segment: not available -- caller blocks 1345 - rtems_region_return_segment: task readied -- preempts caller 1296 - rtems_region_return_segment: task readied -- returns to caller 935 - rtems_region_delete 425 - rtems_io_initialize 52 - rtems_io_open 42 - rtems_io_close 44 - rtems_io_read 42 - rtems_io_write 44 - rtems_io_control 42 - -21 rtems_task_ident 2900 - rtems_message_queue_ident 2828 - rtems_semaphore_ident 3243 - rtems_partition_ident 2828 - rtems_region_ident 2878 - rtems_port_ident 2828 - rtems_timer_ident 2828 - rtems_rate_monotonic_ident 2826 - -22 rtems_message_queue_broadcast: task readied -- returns to caller 1079 - rtems_message_queue_broadcast: no waiting tasks 589 - rtems_message_queue_broadcast: task readied -- preempts caller 1435 - -23 rtems_timer_create 357 - rtems_timer_fire_after: inactive 607 - rtems_timer_fire_after: active 646 - rtems_timer_cancel: active 378 - rtems_timer_cancel: inactive 339 - rtems_timer_reset: inactive 552 - rtems_timer_reset: active 591 - rtems_timer_fire_when: inactive 766 - rtems_timer_fire_when: active 764 - rtems_timer_delete: active 471 - rtems_timer_delete: inactive 432 - rtems_task_wake_when 1275 - -24 rtems_task_wake_after: yield -- returns to caller 245 - rtems_task_wake_after: yields -- preempts caller 851 - -25 rtems_clock_tick 214 - -26 _ISR_Disable 24 - _ISR_Flash 21 - _ISR_Enable 19 - _Thread_Disable_dispatch 27 - _Thread_Enable_dispatch 211 - _Thread_Set_state 177 - _Thread_Disptach (NO FP) 761 - context switch: no floating point contexts 585 - context switch: self 230 - context switch: to another task 236 - context switch: restore 1st FP task 730 - fp context switch: save idle, restore idle 478 - fp context switch: save idle, restore initialized 828 - fp context switch: save initialized, restore initialized 478 - _Thread_Resume 143 - _Thread_Unblock 143 - _Thread_Ready 147 - _Thread_Get 93 - _Semaphore_Get 77 - _Thread_Get: invalid id 20 - -27 interrupt entry overhead: returns to interrupted task 206 - interrupt exit overhead: returns to interrupted task 213 - interrupt entry overhead: returns to nested interrupt 201 - interrupt exit overhead: returns to nested interrupt 186 - interrupt entry overhead: returns to preempting task 202 - interrupt exit overhead: returns to preempting task 857 - -28 rtems_port_create 428 - rtems_port_external_to_internal 339 - rtems_port_internal_to_external 339 - rtems_port_delete 421 - -29 rtems_rate_monotonic_create 388 - rtems_rate_monotonic_period: initiate period -- returns to caller 556 - rtems_rate_monotonic_period: obtain status 377 - rtems_rate_monotonic_cancel 427 - rtems_rate_monotonic_delete: inactive 465 - rtems_rate_monotonic_delete: active 519 - rtems_rate_monotonic_period: conclude periods -- caller blocks 843 diff --git a/c/src/lib/libbsp/powerpc/dmv177/tod/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/tod/Makefile.in deleted file mode 100644 index f2af5cc8fb..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/tod/Makefile.in +++ /dev/null @@ -1,57 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@:@srcdir@/../../../shared -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGM=${ARCH}/tod.rel - -# C source names, if any, go here -- minus the .c -C_PIECES=config tod -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -SRCS=$(C_FILES) $(H_FILES) -OBJS=$(C_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# First and second generation use different RTC chips :( -TOD_PIECES=tod - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -${PGM}: ${SRCS} ${OBJS} - $(make-rel) - -all: ${ARCH} $(SRCS) $(PGM) - -# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile -install: all diff --git a/c/src/lib/libbsp/powerpc/dmv177/tod/config.c b/c/src/lib/libbsp/powerpc/dmv177/tod/config.c deleted file mode 100644 index aa44aa66bf..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/tod/config.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * This file contains the RTC driver table for the DY-4 DMV177. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * $Id$ - */ - -#include <bsp.h> - -#include <libchip/rtc.h> -#include <libchip/icm7170.h> - -/* - * Configuration specific probe routines - * - * NOTE: There are no DMV177 specific configuration routines. These - * routines could be written to dynamically determine what type - * of real-time clock is on this board. This would be useful for - * a BSP supporting multiple board models. - */ - -/* NONE CURRENTLY PROVIDED */ - -/* - * The following table configures the RTC drivers used in this BSP. - * - * The first entry which, when probed, is available, will be named /dev/rtc, - * all others being given the name indicated. - */ - -boolean dmv177_icm7170_probe(int minor); - -rtc_tbl RTC_Table[] = { - { - "/dev/rtc0", /* sDeviceName */ - RTC_ICM7170, /* deviceType */ - &icm7170_fns, /* pDeviceFns */ - dmv177_icm7170_probe, /* deviceProbe */ - (void *) ICM7170_AT_1_MHZ, /* pDeviceParams */ - DMV170_RTC_ADDRESS, /* ulCtrlPort1 */ - NULL, /* ulDataPort */ - icm7170_get_register_8, /* getRegister */ - icm7170_set_register_8, /* setRegister */ - } -}; - -/* - * Declare some information used by the RTC driver - */ - -#define NUM_RTCS (sizeof(RTC_Table)/sizeof(rtc_tbl)) - -unsigned long RTC_Count = NUM_RTCS; - -rtems_device_minor_number RTC_Minor; - -/* - * Hopefully, by checking the card resource register, this BSP - * will be able to operate on the DMV171, DMV176, or DMV177. - */ - -boolean dmv177_icm7170_probe(int minor) -{ - volatile unsigned16 *card_resource_reg; - unsigned16 v; - - card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG; - - v = *card_resource_reg & DMV170_RTC_INST_MASK; - - if ( v == DMV170_RTC_INSTALLED ) - return TRUE; - - return FALSE; -} - diff --git a/c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c b/c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c deleted file mode 100644 index aa44aa66bf..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * This file contains the RTC driver table for the DY-4 DMV177. - * - * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997. - * On-Line Applications Research Corporation (OAR). - * All rights assigned to U.S. Government, 1994. - * - * $Id$ - */ - -#include <bsp.h> - -#include <libchip/rtc.h> -#include <libchip/icm7170.h> - -/* - * Configuration specific probe routines - * - * NOTE: There are no DMV177 specific configuration routines. These - * routines could be written to dynamically determine what type - * of real-time clock is on this board. This would be useful for - * a BSP supporting multiple board models. - */ - -/* NONE CURRENTLY PROVIDED */ - -/* - * The following table configures the RTC drivers used in this BSP. - * - * The first entry which, when probed, is available, will be named /dev/rtc, - * all others being given the name indicated. - */ - -boolean dmv177_icm7170_probe(int minor); - -rtc_tbl RTC_Table[] = { - { - "/dev/rtc0", /* sDeviceName */ - RTC_ICM7170, /* deviceType */ - &icm7170_fns, /* pDeviceFns */ - dmv177_icm7170_probe, /* deviceProbe */ - (void *) ICM7170_AT_1_MHZ, /* pDeviceParams */ - DMV170_RTC_ADDRESS, /* ulCtrlPort1 */ - NULL, /* ulDataPort */ - icm7170_get_register_8, /* getRegister */ - icm7170_set_register_8, /* setRegister */ - } -}; - -/* - * Declare some information used by the RTC driver - */ - -#define NUM_RTCS (sizeof(RTC_Table)/sizeof(rtc_tbl)) - -unsigned long RTC_Count = NUM_RTCS; - -rtems_device_minor_number RTC_Minor; - -/* - * Hopefully, by checking the card resource register, this BSP - * will be able to operate on the DMV171, DMV176, or DMV177. - */ - -boolean dmv177_icm7170_probe(int minor) -{ - volatile unsigned16 *card_resource_reg; - unsigned16 v; - - card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG; - - v = *card_resource_reg & DMV170_RTC_INST_MASK; - - if ( v == DMV170_RTC_INSTALLED ) - return TRUE; - - return FALSE; -} - diff --git a/c/src/lib/libbsp/powerpc/dmv177/wrapup/Makefile.in b/c/src/lib/libbsp/powerpc/dmv177/wrapup/Makefile.in deleted file mode 100644 index 7119536c6a..0000000000 --- a/c/src/lib/libbsp/powerpc/dmv177/wrapup/Makefile.in +++ /dev/null @@ -1,62 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -# We only build the networking device driver if HAS_NETWORKING was defined -NETWORKING_DRIVER_yes_V = sonic -NETWORKING_DRIVER = $(NETWORKING_DRIVER_$(HAS_NETWORKING)_V) - -# pieces specific to this BSP -BSP_PIECES=startup clock console scv64 timer tod $(NETWORKING_DRIVER) - -# pieces to pick up out of libcpu/$(RTEMS_CPU) -CPU_PIECES= - -# shared pieces -GENERIC_PIECES= - -# bummer; have to use $foreach since % pattern subst rules only replace 1x -OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \ - $(foreach piece, $(CPU_PIECES), \ - ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(piece).rel) \ - $(foreach piece, $(GENERIC_PIECES), \ - ../../../$(piece)/$(ARCH)/$(piece).rel) -LIB=$(ARCH)/libbsp.a - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/lib.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -$(LIB): ${OBJS} - $(make-library) - -all: ${ARCH} $(SRCS) $(LIB) - $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib - diff --git a/c/src/lib/libbsp/powerpc/psim/start/Makefile.in b/c/src/lib/libbsp/powerpc/psim/start/Makefile.in deleted file mode 100644 index 35377e94f1..0000000000 --- a/c/src/lib/libbsp/powerpc/psim/start/Makefile.in +++ /dev/null @@ -1,54 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGMS=${ARCH}/startsim.o - -# C source names, if any, go here -- minus the .c -C_PIECES= -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES=startsim -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: ${ARCH} $(SRCS) $(OBJS) $(PGM) - $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib diff --git a/c/src/lib/libbsp/powerpc/psim/start/startsim.s b/c/src/lib/libbsp/powerpc/psim/start/startsim.s deleted file mode 100644 index f94a3ca330..0000000000 --- a/c/src/lib/libbsp/powerpc/psim/start/startsim.s +++ /dev/null @@ -1,106 +0,0 @@ -/* - * This is based on the mvme-crt0.S file from libgloss/rs6000. - * crt0.S -- startup file for PowerPC systems. - * - * Copyright (c) 1995 Cygnus Support - * - * The authors hereby grant permission to use, copy, modify, distribute, - * and license this software and its documentation for any purpose, provided - * that existing copyright notices are retained in all copies and that this - * notice is included verbatim in any distributions. No written agreement, - * license, or royalty fee is required for any of the authorized uses. - * Modifications to this software may be copyrighted by their authors - * and need not follow the licensing terms described here, provided that - * the new terms are clearly indicated on the first page of each file where - * they apply. - * - * $Id$ - */ - -#include "ppc-asm.h" - - .file "startsim.s" - .section ".got2","aw" - .align 2 - -.LCTOC1 = .+32768 - - .extern FUNC_NAME(atexit) - .globl FUNC_NAME(__atexit) - .section ".sdata","aw" - .align 2 -FUNC_NAME(__atexit): /* tell C's eabi-ctor's we have an atexit function */ - .long FUNC_NAME(atexit)@fixup /* and that it is to register __do_global_dtors */ - - .section ".fixup","aw" - .align 2 - .long FUNC_NAME(__atexit) - - .section ".got2","aw" -.Ltable = .-.LCTOC1 - .long .LCTOC1 /* address we think .LCTOC1 is loaded at */ - -.Lbss_start = .-.LCTOC1 - .long __bss_start - -.Lend = .-.LCTOC1 - .long _end - -.Lstack = .-.LCTOC1 /* stack address if set by user */ - .long __stack - - .text -.Lptr: - .long .LCTOC1-.Laddr - - .globl _start - .type _start,@function -_start: - bl .Laddr /* get current address */ -.Laddr: - mflr r4 /* real address of .Laddr */ - lwz r5,(.Lptr-.Laddr)(r4) /* linker generated address of .LCTOC1 */ - add r5,r5,r4 /* correct to real pointer */ - lwz r4,.Ltable(r5) /* get linker's idea of where .Laddr is */ - subf r4,r4,r5 /* calculate difference between where linked and current */ - - /* clear bss */ - lwz r6,.Lbss_start(r5) /* calculate beginning of the BSS */ - lwz r7,.Lend(r5) /* calculate end of the BSS */ - add r6,r6,r4 /* adjust pointers */ - add r7,r7,r4 - - cmplw 1,r6,r7 - bc 4,4,.Ldone - - subf r8,r6,r7 /* number of bytes to zero */ - srwi r9,r8,2 /* number of words to zero */ - mtctr r9 - li r0,0 /* zero to clear memory */ - addi r6,r6,-4 /* adjust so we can use stwu */ -.Lloop: - stwu r0,4(r6) /* zero bss */ - bdnz .Lloop - -.Ldone: - - lwz r0,.Lstack(r5) /* stack address or 0 */ - cmplwi 1,r0,0 /* equal to 0? */ - bc 12,6,.Lnostack /* use default stack if == 0 */ - mr sp,r0 /* use user defined stack */ - -.Lnostack: - /* set up initial stack frame */ - addi sp,sp,-4 /* make sure we don't overwrite debug mem */ - lis r0,0 - stw r0,0(sp) /* clear back chain */ - stwu sp,-56(sp) /* push another stack frame */ - - /* Let her rip */ - bl FUNC_NAME(boot_card) - - /* return value from boot_card is argument to exit */ - bl FUNC_NAME(exit) - trap -.Lstart: - .size _start,.Lstart-_start diff --git a/c/src/lib/libbsp/sh/gensh1/start/Makefile.in b/c/src/lib/libbsp/sh/gensh1/start/Makefile.in deleted file mode 100644 index b5d382a468..0000000000 --- a/c/src/lib/libbsp/sh/gensh1/start/Makefile.in +++ /dev/null @@ -1,59 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH=@srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGMS=${ARCH}/start.o - -# C source names, if any, go here -- minus the .c -C_PIECES= -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES=start -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# force optimization, unless start.o will not work -# CFLAGS_PROFILE= -# CFLAGS_DEBUG=-O3 -# CFLAGS_OPTIMIZE=-O3 - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: ${ARCH} $(SRCS) $(OBJS) $(PGM) - $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib diff --git a/c/src/lib/libbsp/shared/console.c b/c/src/lib/libbsp/shared/console.c deleted file mode 100644 index 60ced47ddf..0000000000 --- a/c/src/lib/libbsp/shared/console.c +++ /dev/null @@ -1,291 +0,0 @@ -/* - * This file contains the TTY driver for the PPCn_60x - * - * This driver uses the termios pseudo driver. - * - * COPYRIGHT (c) 1998 by Radstone Technology - * - * - * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY - * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK - * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU. - * - * You are hereby granted permission to use, copy, modify, and distribute - * this file, provided that this notice, plus the above copyright notice - * and disclaimer, appears in all copies. Radstone Technology will provide - * no support for this code. - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <bsp.h> -#include <rtems/libio.h> -#include <stdlib.h> -#include <assert.h> -#include <termios.h> - -#include <libchip/serial.h> - -/* - * Configuration Information - */ - -extern console_data Console_Port_Data[]; -extern unsigned long Console_Port_Count; -extern rtems_device_minor_number Console_Port_Minor; - -/*PAGE - * - * console_open - * - * open a port as a termios console. - * - */ - -rtems_device_driver console_open( - rtems_device_major_number major, - rtems_device_minor_number minor, - void * arg -) -{ - rtems_status_code status; - rtems_libio_open_close_args_t *args = arg; - rtems_libio_ioctl_args_t IoctlArgs; - struct termios Termios; - rtems_termios_callbacks Callbacks; - console_tbl *cptr; - - /* - * Verify the port number is valid. - */ - if ( minor > Console_Port_Count ) { - return RTEMS_INVALID_NUMBER; - } - - /* - * Open the port as a termios console driver. - */ - - cptr = &Console_Port_Tbl[minor]; - Callbacks.firstOpen = cptr->pDeviceFns->deviceFirstOpen; - Callbacks.lastClose = cptr->pDeviceFns->deviceLastClose; - Callbacks.pollRead = cptr->pDeviceFns->deviceRead; - Callbacks.write = cptr->pDeviceFns->deviceWrite; - Callbacks.setAttributes = cptr->pDeviceFns->deviceSetAttributes; - Callbacks.stopRemoteTx = cptr->pDeviceFlow->deviceStopRemoteTx; - Callbacks.startRemoteTx = cptr->pDeviceFlow->deviceStartRemoteTx; - Callbacks.outputUsesInterrupts = cptr->pDeviceFns->deviceOutputUsesInterrupts; - - /* XXX what about - * Console_Port_Tbl[minor].ulMargin, - * Console_Port_Tbl[minor].ulHysteresis); - */ - - status = rtems_termios_open ( major, minor, arg, &Callbacks ); - Console_Port_Data[minor].termios_data = args->iop->data1; - - if (minor!=Console_Port_Minor) { - /* - * If this is not the console we do not want ECHO and - * so forth - */ - IoctlArgs.iop=args->iop; - IoctlArgs.command=RTEMS_IO_GET_ATTRIBUTES; - IoctlArgs.buffer=&Termios; - rtems_termios_ioctl(&IoctlArgs); - Termios.c_lflag=ICANON; - IoctlArgs.command=RTEMS_IO_SET_ATTRIBUTES; - rtems_termios_ioctl(&IoctlArgs); - } - - if ( (args->iop->flags&LIBIO_FLAGS_READ) && - Console_Port_Tbl[minor].pDeviceFlow && - Console_Port_Tbl[minor].pDeviceFlow->deviceStartRemoteTx) { - Console_Port_Tbl[minor].pDeviceFlow->deviceStartRemoteTx(minor); - } - - return status; -} - -/*PAGE - * - * console_reserve_resources - * - * This routine uses the termios driver to reserve resources. - */ - -void console_reserve_resources( - rtems_configuration_table *configuration -) -{ - rtems_termios_reserve_resources( configuration, 4 ); -} - - -/*PAGE - * - * console_close - * - * This routine closes a port that has been opened as console. - */ - -rtems_device_driver console_close( - rtems_device_major_number major, - rtems_device_minor_number minor, - void * arg -) -{ - rtems_libio_open_close_args_t *args = arg; - - if ( (args->iop->flags&LIBIO_FLAGS_READ) && - Console_Port_Tbl[minor].pDeviceFlow && - Console_Port_Tbl[minor].pDeviceFlow->deviceStopRemoteTx) { - Console_Port_Tbl[minor].pDeviceFlow->deviceStopRemoteTx(minor); - } - - return rtems_termios_close (arg); -} - -/*PAGE - * - * console_read - * - * This routine uses the termios driver to read a character. - */ - -rtems_device_driver console_read( - rtems_device_major_number major, - rtems_device_minor_number minor, - void * arg -) -{ - return rtems_termios_read (arg); -} - -/*PAGE - * - * console_write - * - * this routine uses the termios driver to write a character. - */ - -rtems_device_driver console_write( - rtems_device_major_number major, - rtems_device_minor_number minor, - void * arg -) -{ - return rtems_termios_write (arg); -} - -/*PAGE - * - * console_control - * - * this routine uses the termios driver to process io - */ - -rtems_device_driver console_control( - rtems_device_major_number major, - rtems_device_minor_number minor, - void * arg -) -{ - return rtems_termios_ioctl (arg); -} - -/*PAGE - * - * console_initialize - * - * Routine called to initialize the console device driver. - */ - -rtems_device_driver console_initialize( - rtems_device_major_number major, - rtems_device_minor_number minor_arg, - void *arg -) -{ - rtems_status_code status; - rtems_device_minor_number minor; - - /* - * initialize the termio interface. - */ - - rtems_termios_initialize(); - - for (minor=0; minor < Console_Port_Count ; minor++) { - /* - * First perform the configuration dependent probe, then the - * device dependent probe - */ - - if ((!Console_Port_Tbl[minor].deviceProbe || - Console_Port_Tbl[minor].deviceProbe(minor)) && - Console_Port_Tbl[minor].pDeviceFns->deviceProbe(minor)) { - /* - * Use this device for the console - */ - break; - } - } - if ( minor == Console_Port_Count ) { - /* - * Failed to find a working device - */ - rtems_fatal_error_occurred(RTEMS_IO_ERROR); - } - - Console_Port_Minor=minor; - - /* - * Register Device Names - */ - status = rtems_io_register_name("/dev/console", major, Console_Port_Minor ); - if (status != RTEMS_SUCCESSFUL) { - rtems_fatal_error_occurred(status); - } - Console_Port_Tbl[minor].pDeviceFns->deviceInitialize(Console_Port_Minor); - - for (minor++;minor<Console_Port_Count;minor++) { - /* - * First perform the configuration dependent probe, then the - * device dependent probe - */ - - if ( (!Console_Port_Tbl[minor].deviceProbe || - Console_Port_Tbl[minor].deviceProbe(minor)) && - Console_Port_Tbl[minor].pDeviceFns->deviceProbe(minor)) { - status = rtems_io_register_name( - Console_Port_Tbl[minor].sDeviceName, - major, - minor ); - if (status != RTEMS_SUCCESSFUL) { - rtems_fatal_error_occurred(status); - } - - /* - * Initialize the hardware device. - */ - - Console_Port_Tbl[minor].pDeviceFns->deviceInitialize(minor); - - } - } - - return RTEMS_SUCCESSFUL; -} - - - diff --git a/c/src/lib/libbsp/shared/tod.c b/c/src/lib/libbsp/shared/tod.c deleted file mode 100644 index b43c7c1c04..0000000000 --- a/c/src/lib/libbsp/shared/tod.c +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Real Time Clock Driver Wrapper for Libchip - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include <rtems.h> -#include <libchip/rtc.h> - -/* - * Configuration Information - */ - -extern unsigned long RTC_Count; -extern rtems_device_minor_number RTC_Minor; - -int RTC_Present; - -/* - * rtc_initialize - * - * Initialize the RTC driver - */ - -rtems_device_driver rtc_initialize( - rtems_device_major_number major, - rtems_device_minor_number minor_arg, - void *arg -) -{ - rtems_device_minor_number minor; - rtems_status_code status; - - for (minor=0; minor < RTC_Count ; minor++) { - /* - * First perform the configuration dependent probe, then the - * device dependent probe - */ - - if (RTC_Table[minor].deviceProbe && RTC_Table[minor].deviceProbe(minor)) { - /* - * Use this device as the primary RTC - */ - RTC_Minor = minor; - RTC_Present = 1; - break; - } - } - - if ( !RTC_Present ) { - /* - * Failed to find an RTC -- this is not a fatal error. - */ - - return RTEMS_INVALID_NUMBER; - } - - /* - * Register and initialize the primary RTC's - */ - - status = rtems_io_register_name( "/dev/rtc", major, RTC_Minor ); - if (status != RTEMS_SUCCESSFUL) { - rtems_fatal_error_occurred(status); - } - - RTC_Table[minor].pDeviceFns->deviceInitialize( RTC_Minor ); - - /* - * Now initialize any secondary RTC's - */ - - for ( minor++ ; minor<RTC_Count ; minor++) { - /* - * First perform the configuration dependent probe, then the - * device dependent probe - */ - - if (RTC_Table[minor].deviceProbe && RTC_Table[minor].deviceProbe(minor)) { - status = rtems_io_register_name( - RTC_Table[minor].sDeviceName, - major, - minor ); - if (status != RTEMS_SUCCESSFUL) { - rtems_fatal_error_occurred(status); - } - - /* - * Initialize the hardware device. - */ - - RTC_Table[minor].pDeviceFns->deviceInitialize(minor); - - } - } - - return RTEMS_SUCCESSFUL; -} - - -/*PAGE - * - * This routine copies the time from the real time clock to RTEMS - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: NONE - */ - -void setRealTimeToRTEMS() -{ - rtems_time_of_day rtc_tod; - - if (!RTC_Present) - return; - - RTC_Table[RTC_Minor].pDeviceFns->deviceGetTime(RTC_Minor, &rtc_tod); - rtems_clock_set( &rtc_tod ); -} - -/*PAGE - * - * setRealTimeFromRTEMS - * - * This routine copies the time from RTEMS to the real time clock - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: NONE - */ - -void setRealTimeFromRTEMS() -{ - rtems_time_of_day rtems_tod; - - if (!RTC_Present) - return; - - rtems_clock_get( RTEMS_CLOCK_GET_TOD, &rtems_tod ); - RTC_Table[RTC_Minor].pDeviceFns->deviceSetTime(RTC_Minor, &rtems_tod); -} - -/*PAGE - * - * getRealTime - * - * This routine reads the current time from the RTC. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: NONE - */ - -void getRealTime( - rtems_time_of_day *tod -) -{ - - if (!RTC_Present) - return; - - RTC_Table[RTC_Minor].pDeviceFns->deviceGetTime(RTC_Minor, tod); -} - -/*PAGE - * - * setRealTime - * - * This routine sets the RTC. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: NONE - */ - -/* XXX this routine should be part of the public RTEMS interface */ -rtems_boolean _TOD_Validate( rtems_time_of_day *tod ); - -int setRealTime( - rtems_time_of_day *tod -) -{ - - if (!RTC_Present) - return -1; - - if ( !_TOD_Validate(tod) ) - return -1; - - RTC_Table[RTC_Minor].pDeviceFns->deviceSetTime(RTC_Minor, tod); - return 0; -} - - -/*PAGE - * - * checkRealTime - * - * This routine reads the returns the variance betweent the real time and - * rtems time. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * Return values: - * int The differance between the real time clock and rtems time. - */ - -/* XXX this routine should be part of the public RTEMS interface */ -unsigned32 _TOD_To_seconds( rtems_time_of_day *tod ); - -int checkRealTime() -{ - rtems_time_of_day rtems_tod; - rtems_time_of_day rtc_tod; - unsigned32 rtems_time; - unsigned32 rtc_time; - - if (!RTC_Present) - return -1; - - rtems_clock_get( RTEMS_CLOCK_GET_TOD, &rtems_tod ); - RTC_Table[RTC_Minor].pDeviceFns->deviceGetTime(RTC_Minor, &rtc_tod); - - rtems_time = _TOD_To_seconds( &rtems_tod ); - rtc_time = _TOD_To_seconds( &rtc_tod ); - - return rtems_time - rtc_time; -} - diff --git a/c/src/lib/libbsp/shared/tod.h b/c/src/lib/libbsp/shared/tod.h deleted file mode 100644 index 725211e082..0000000000 --- a/c/src/lib/libbsp/shared/tod.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Real Time Clock (MK48T08) for RTEMS on Score603e - * - * Based on MVME162 TOD by: - * COPYRIGHT (C) 1997 - * by Katsutoshi Shibuya - BU Denken Co.,Ltd. - Sapporo - JAPAN - * ALL RIGHTS RESERVED - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#ifndef TOD_H -#define TOD_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Set the RTC. - */ - -int setRealTime( - rtems_time_of_day *tod -); - -/* - * Get the time from the RTC. - */ - -void getRealTime( - rtems_time_of_day *tod -); - -/* - * Read real time from RTC and set it to RTEMS' clock manager - */ - -void setRealTimeToRTEMS(); - -/* - * Read time from RTEMS' clock manager and set it to RTC - */ - -void setRealTimeFromRTEMS(); - -/* - * Return the difference between RTC and RTEMS' clock manager time in minutes. - * If the difference is greater than 1 day, this returns 9999. - */ - -int checkRealTime(); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/c/src/lib/libbsp/shmdr/shm_driver.h b/c/src/lib/libbsp/shmdr/shm_driver.h deleted file mode 100644 index 8875525983..0000000000 --- a/c/src/lib/libbsp/shmdr/shm_driver.h +++ /dev/null @@ -1,542 +0,0 @@ -/* shm.h - * - * This include file contains all the constants, structures, - * and global variables for this RTEMS based shared memory - * communications interface driver. - * - * Processor board dependencies are in other files. - * - * COPYRIGHT (c) 1989-1998. - * On-Line Applications Research Corporation (OAR). - * Copyright assigned to U.S. Government, 1994. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __SHM_h -#define __SHM_h - -#include <clockdrv.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* The information contained in the Node Status, Locked Queue, and - * Envelope Control Blocks must be maintained in a NEUTRAL format. - * Currently the neutral format may be selected as big or little - * endian by simply defining either NEUTRAL_BIG or NEUTRAL_LITTLE. - * - * It is CRITICAL to note that the neutral format can ONLY be - * changed by modifying this file and recompiling the ENTIRE - * SHM driver including ALL target specific support files. - * - * The following table details the memory contents for the endian - * field of the Node Status Control Block in the various - * data format configurations (data is in hexadecimal): - * - * NEUTRAL NATIVE BYTE 0 BYTE 1 BYTE 2 BYTE 3 - * ======= ====== ====== ====== ====== ====== - * BIG BIG 00 00 00 01 - * BIG LITTLE 10 00 00 00 - * LITTLE BIG 01 00 00 00 - * LITTLE LITTLE 00 00 00 10 - * - * - * NOTE: XXX - * PORTABILITY OF LOCKING INSTRUCTIONS - * =================================== - * The locking mechanism described below is not - * general enough. Where the hardware supports - * it we should use "atomic swap" instructions - * so the values in the lock can be tailored to - * support a CPU with only weak atomic memory - * instructions. There are combinations of - * CPUs with inflexible atomic memory instructions - * which appear to be incompatible. For example, - * the SPARClite instruction uses a byte which is - * 0xFF when locked. The PA-RISC uses 1 to indicate - * locked and 0 when unlocked. These CPUs appear to - * have incompatible lock instructions. But - * they could be used in a heterogenous system - * with does not mix SPARCs and PA-RISCs. For - * example, the i386 and SPARC or i386 and SPARC - * could work together. The bottom line is that - * not every CPU will work together using this - * locking scheme. There are supposed to be - * algorithms to do this without hardware assist - * and one of these should be incorporated into - * the shared memory driver. - * - * The most flexible scheme using the instructions - * of the various CPUs for efficiency would be to use - * "atomic swaps" wherever possible. Make the lock - * and unlock configurable much like BIG vs LITTLE - * endian use of shared memory is now. The values - * of the lock could then reflect the "worst" - * CPU in a system. This still results in mixes - * of CPUs which are incompatible. - * - * The current locking mechanism is based upon the MC68020 - * "tas" instruction which is atomic. All ports to other CPUs - * comply with the restrictive placement of lock bit by this - * instruction. The lock bit is the most significant bit in a - * big-endian rtems_unsigned32. On other processors, the lock is - * typically implemented via an atomic swap or atomic modify - * bits type instruction. - */ - -#define NEUTRAL_BIG - -#ifdef NEUTRAL_BIG -#define SHM_BIG 0x00000001 -#define SHM_LITTLE 0x10000000 -#endif - -#ifdef NEUTRAL_LITTLE -#define SHM_BIG 0x01000000 -#define SHM_LITTLE 0x00000010 -#endif - -/* - * The following are the values used to fill in the lock field. Some CPUs - * are able to write only a single value into field. By making the - * lock and unlock values configurable, CPUs which support "atomic swap" - * instructions can generally be made to work in any heterogeneous - * configuration. However, it is possible for two CPUs to be incompatible - * in regards to the lock field values. This occurs when two CPUs - * which write only a single value to the field are used in a system - * but the two CPUs write different incompatible values. - * - * NOTE: The following is a first attempt at defining values which - * have a chance at working together. The m68k should use - * chk2 instead of tas to be less restrictive. Target endian - * problems (like the Force CPU386 which has (broken) big endian - * view of the VMEbus address space) are not addressed yet. - */ - -#if defined(__i960__) -#define SHM_LOCK_VALUE 0x00000080 -#define SHM_UNLOCK_VALUE 0 -#elif defined(__mc68000__) -#define SHM_LOCK_VALUE 0x80000000 -#define SHM_UNLOCK_VALUE 0 -#define SHM_LOCK_VALUE 0x80000000 -#define SHM_UNLOCK_VALUE 0 -#elif defined(__i386__) -#define SHM_LOCK_VALUE 0x80000000 -#define SHM_UNLOCK_VALUE 0 -#elif defined(__mips__) -#define SHM_LOCK_VALUE 0x80000000 -#define SHM_UNLOCK_VALUE 0 -#elif defined(__hppa__) -#define SHM_LOCK_VALUE 0 -#define SHM_UNLOCK_VALUE 1 -#elif defined(__PPC__) -#define SHM_LOCK_VALUE 1 -#define SHM_UNLOCK_VALUE 0 -#elif defined(__unix__) -#define SHM_LOCK_VALUE 0 -#define SHM_UNLOCK_VALUE 1 -#elif defined(no_cpu) /* for this values are irrelevant */ -#define SHM_LOCK_VALUE 1 -#define SHM_UNLOCK_VALUE 0 -#else -#error "shm.h - no SHM_LOCK_VALUE defined for this CPU architecture" -#endif - -#define Shm_Convert( value ) \ - ((Shm_Configuration->convert) ? \ - (*Shm_Configuration->convert)(value) : (value)) - -/* constants */ - -#define SHM_MASTER 1 /* master initialization node */ -#define SHM_FIRST_NODE 1 - -/* size constants */ - -#define KILOBYTE (1024) -#define MEGABYTE (1024*1024) - -/* inter-node interrupt values */ - -#define NO_INTERRUPT 0 /* used for polled nodes */ -#define BYTE 1 -#define WORD 2 -#define LONG 4 - -/* operational mode constants -- used in SHM Configuration Table */ -#define POLLED_MODE 0 -#define INTR_MODE 1 - -/* error codes */ - -#define NO_ERROR 0 -#define SHM_NO_FREE_PKTS 0xf0000 - -/* null pointers of different types */ - -#define NULL_ENV_CB ((Shm_Envelope_control *) 0) -#define NULL_CONVERT 0 - -/* - * size of stuff before preamble in envelope. - * It must be a constant since we will use it to generate MAX_PACKET_SIZE - */ - -#define SHM_ENVELOPE_PREFIX_OVERHEAD (4 * sizeof(vol_u32)) - -/* - * The following is adjusted so envelopes are MAX_ENVELOPE_SIZE bytes long. - * It must be >= RTEMS_MINIMUM_PACKET_SIZE in mppkt.h. - */ - -#ifndef MAX_ENVELOPE_SIZE -#define MAX_ENVELOPE_SIZE 0x180 -#endif - -#define MAX_PACKET_SIZE (MAX_ENVELOPE_SIZE - \ - SHM_ENVELOPE_PREFIX_OVERHEAD + \ - sizeof(Shm_Envelope_preamble) + \ - sizeof(Shm_Envelope_postamble)) - - -/* constants pertinent to Locked Queue routines */ - -#define LQ_UNLOCKED SHM_UNLOCK_VALUE -#define LQ_LOCKED SHM_LOCK_VALUE - -/* constants related to the Free Envelope Pool */ - -#define FREE_ENV_POOL 0 -#define FREE_ENV_CB (&Shm_Locked_queues[ FREE_ENV_POOL ]) - -/* The following are important when dealing with - * the shared memory communications interface area. - * - * NOTE: The starting address and length of the shared memory - * is defined in a system dependent file. - */ - -#define START_NS_CBS ((void *)Shm_Configuration->base) -#define START_LQ_CBS ((START_NS_CBS) + \ - ( (sizeof (Shm_Node_status_control)) * (Shm_Maximum_nodes + 1) ) ) -#define START_ENVELOPES ( ((void *) START_LQ_CBS) + \ - ( (sizeof (Shm_Locked_queue_Control)) * (Shm_Maximum_nodes + 1) ) ) -#define END_SHMCI_AREA ( (void *) START_ENVELOPES + \ - ( (sizeof (Shm_Envelope_control)) * Shm_Maximum_envelopes ) ) -#define END_SHARED_MEM (START_NS_CBS+Shm_Configuration->length) - -/* macros */ - -#define Shm_Is_master_node() \ - ( SHM_MASTER == Shm_Local_node ) - -#define Shm_Free_envelope( ecb ) \ - Shm_Locked_queue_Add( FREE_ENV_CB, (ecb) ) -#define Shm_Allocate_envelope() \ - Shm_Locked_queue_Get(FREE_ENV_CB) - -#define Shm_Initialize_receive_queue(node) \ - Shm_Locked_queue_Initialize( &Shm_Locked_queues[node], node ) - -#define Shm_Append_to_receive_queue(node, ecb) \ - Shm_Locked_queue_Add( &Shm_Locked_queues[node], (ecb) ) - -#define Shm_Envelope_control_to_packet_prefix_pointer(ecb) \ - ((void *)(ecb)->packet) - -#define Shm_Packet_prefix_to_envelope_control_pointer( pkt ) \ - ((Shm_Envelope_control *)((rtems_unsigned8 *)(pkt) - \ - (sizeof(Shm_Envelope_preamble) + SHM_ENVELOPE_PREFIX_OVERHEAD))) - -#define Shm_Build_preamble(ecb, node) \ - (ecb)->Preamble.endian = Shm_Configuration->format - -#define Shm_Build_postamble( ecb ) - -/* volatile types */ - -typedef volatile rtems_unsigned8 vol_u8; -typedef volatile rtems_unsigned32 vol_u32; - -/* shm control information */ - -struct shm_info { - vol_u32 not_currently_used_0; - vol_u32 not_currently_used_1; - vol_u32 not_currently_used_2; - vol_u32 not_currently_used_3; -}; - -typedef struct { - /*byte start_of_text;*/ - vol_u32 endian; - vol_u32 not_currently_used_0; - vol_u32 not_currently_used_1; - vol_u32 not_currently_used_2; -} Shm_Envelope_preamble; - -typedef struct { -} Shm_Envelope_postamble; - -/* WARNING! If you change this structure, don't forget to change - * SHM_ENVELOPE_PREFIX_OVERHEAD and - * Shm_Packet_prefix_to_envelope_control_pointer() above. - */ - -/* This comment block describes the contents of each field - * of the Envelope Control Block: - * - * next - The index of the next envelope on this queue. - * queue - The index of the queue this envelope is on. - * index - The index of this envelope. - * Preamble - Generic packet preamble. One day this structure - * could be enhanced to contain routing information. - * packet - RTEMS MPCI packet. Untouched by SHM Driver - * other than copying and format conversion as - * documented in the RTEMS User's Guide. - * Postamble - Generic packet postamble. One day this structure - * could be enhanced to contain checksum information. - */ - -typedef struct { - vol_u32 next; /* next envelope on queue */ - vol_u32 queue; /* queue on which this resides */ - vol_u32 index; /* index into array of envelopes*/ - vol_u32 pad0; /* insure the next one is aligned */ - Shm_Envelope_preamble Preamble; /* header information */ - vol_u8 packet[MAX_PACKET_SIZE]; /* RTEMS INFO */ - Shm_Envelope_postamble Postamble;/* trailer information */ -} Shm_Envelope_control; - -/* This comment block describes the contents of each field - * of the Locked Queue Control Block: - * - * lock - Lock used to insure mutually exclusive access. - * front - Index of first envelope on queue. This field - * is used to remove head of queue (receive). - * rear - Index of last envelope on queue. This field - * is used to add evelope to queue (send). - * owner - The node number of the recipient (owning) node. - * RTEMS does not use the node number zero (0). - * The zero node is used by the SHM Driver for the - * Free Envelope Queue shared by all nodes. - */ - -typedef struct { - vol_u32 lock; /* lock field for this queue */ - vol_u32 front; /* first envelope on queue */ - vol_u32 rear; /* last envelope on queue */ - vol_u32 owner; /* receiving (i.e. owning) node */ -} Shm_Locked_queue_Control; - -/* This comment block describes the contents of each field - * of the Node Status Control Block: - * - * status - Node status. Current values are Pending Initialization, - * Initialization Complete, and Active Node. Other values - * could be added to enhance fault tolerance. - * error - Zero if the node has not failed. Otherwise, - * this field contains a status indicating the - * failure reason. - * int_address, int_value, and int_length - * - These field are the Interrupt Information table - * for this node in neutral format. This is how - * each node knows how to generate interrupts. - */ - -typedef struct { - vol_u32 status; /* node status information */ - vol_u32 error; /* fatal error code */ - vol_u32 int_address; /* write here for interrupt */ - vol_u32 int_value; /* this value causes interrupt */ - vol_u32 int_length; /* for this length (0,1,2,4) */ - vol_u32 not_currently_used_0; - vol_u32 not_currently_used_1; - vol_u32 not_currently_used_2; -} Shm_Node_status_control; - -/* This comment block describes the contents of each field - * of the Interrupt Information Table. This table describes - * how another node can generate an interrupt to this node. - * This information is target board dependent. If the - * SHM Driver is in POLLED_MODE, then all fields should - * be initialized to NO_INTERRUPT. - * - * address - The address to which another node should - * write to cause an interrupt. - * value - The value which must be written - * length - The size of the value to write. Valid - * values are BYTE, WORD, and LONG. - * - * NOTE: The Node Status Control Block contains this - * information in neutral format and not in a - * structure to avoid potential alignment problems. - */ - -typedef struct { - vol_u32 *address; /* write here for interrupt */ - vol_u32 value; /* this value causes interrupt */ - vol_u32 length; /* for this length (0,1,2,4) */ -} Shm_Interrupt_information; - -/* SHM Configuration Table - * - * This comment block describes the contents of each field - * of the SHM Configuration Table. - * - * base - The base address of the shared memory. This - * address may be specific to this node. - * length - The length of the shared memory in bytes. - * format - The natural format for rtems_unsigned32's in the - * shared memory. Valid values are currently - * only SHM_LITTLE and SHM_BIG. - * convert - The address of the routine which converts - * between neutral and local format. - * poll_intr - The operational mode of the driver. Some - * target boards may not provide hardware for - * an interprocessor interrupt. If POLLED_MODE - * is selected, the SHM driver will install a - * wrapper around the Clock_isr() to poll for - * incoming packets. Throughput is dependent - * on the time between clock interrupts. - * Valid values are POLLED_MODE and INTR_MODE. - * cause_intr - This is the address of the routine used to - * write to a particular address and cause an - * interrupt on another node. This routine - * may need to be target dependent if something - * other than a normal write from C does not work. - * Intr - This structure describes the operation required - * to cause an interrupt to this node. The actual - * contents of this structure are described above. - */ - -struct shm_config_info { - vol_u32 *base; /* base address of SHM */ - vol_u32 length; /* length (in bytes) of SHM */ - vol_u32 format; /* SHM is big or little endian */ - vol_u32 (*convert)();/* neutral conversion routine */ - vol_u32 poll_intr;/* POLLED or INTR driven mode */ - void (*cause_intr)( rtems_unsigned32 ); - Shm_Interrupt_information Intr; /* cause intr information */ -}; - -typedef struct shm_config_info shm_config_table; - -/* global variables */ - -#ifdef _SHM_INIT -#define SHM_EXTERN -#else -#define SHM_EXTERN extern -#endif - -SHM_EXTERN shm_config_table *Shm_Configuration; -SHM_EXTERN Shm_Interrupt_information *Shm_Interrupt_table; -SHM_EXTERN Shm_Node_status_control *Shm_Node_statuses; -SHM_EXTERN Shm_Locked_queue_Control *Shm_Locked_queues; -SHM_EXTERN Shm_Envelope_control *Shm_Envelopes; -SHM_EXTERN rtems_configuration_table *Shm_RTEMS_Configuration; -SHM_EXTERN rtems_multiprocessing_table *Shm_RTEMS_MP_Configuration; -SHM_EXTERN rtems_unsigned32 Shm_Receive_message_count; -SHM_EXTERN rtems_unsigned32 Shm_Null_message_count; -SHM_EXTERN rtems_unsigned32 Shm_Interrupt_count; -SHM_EXTERN rtems_unsigned32 Shm_Local_node; -SHM_EXTERN Shm_Locked_queue_Control *Shm_Local_receive_queue; -SHM_EXTERN Shm_Node_status_control *Shm_Local_node_status; -SHM_EXTERN rtems_unsigned32 Shm_isrstat; - /* reported by shmdr */ - -SHM_EXTERN rtems_unsigned32 Shm_Pending_initialization; -SHM_EXTERN rtems_unsigned32 Shm_Initialization_complete; -SHM_EXTERN rtems_unsigned32 Shm_Active_node; - -SHM_EXTERN rtems_unsigned32 Shm_Maximum_nodes; -SHM_EXTERN rtems_unsigned32 Shm_Maximum_envelopes; - -SHM_EXTERN rtems_unsigned32 Shm_Locked_queue_End_of_list; -SHM_EXTERN rtems_unsigned32 Shm_Locked_queue_Not_on_list; - -/* functions */ - -/* locked queue routines */ -void Shm_Locked_queue_Add( - Shm_Locked_queue_Control *, Shm_Envelope_control * ); -Shm_Envelope_control *Shm_Locked_queue_Get( Shm_Locked_queue_Control * ); -void Shm_Locked_queue_Initialize( - Shm_Locked_queue_Control *, rtems_unsigned32 ); - /* Shm_Initialize_lock is CPU dependent */ - /* Shm_Lock is CPU dependent */ - /* Shm_Unlock is CPU dependent */ - -/* portable routines */ -void Init_env_pool(); -void Shm_Print_statistics( void ); -void MPCI_Fatal( Internal_errors_Source, boolean, rtems_unsigned32 ); -rtems_task Shm_Cause_interrupt( rtems_unsigned32 ); -void Shm_Poll(); -void Shm_setclockvec(); -void Shm_Convert_packet( rtems_packet_prefix * ); - -/* CPU specific routines are inlined in shmcpu.h */ - -/* target specific routines */ -void *Shm_Convert_address( void * ); -void Shm_Get_configuration( rtems_unsigned32, shm_config_table ** ); -void Shm_isr(); -void Shm_setvec( void ); - -void Shm_Initialize_lock( Shm_Locked_queue_Control * ); -void Shm_Lock( Shm_Locked_queue_Control * ); -void Shm_Unlock( Shm_Locked_queue_Control * ); - -/* MPCI entry points */ -rtems_mpci_entry Shm_Get_packet( - rtems_packet_prefix ** -); - -rtems_mpci_entry Shm_Initialization( void ); - -rtems_mpci_entry Shm_Receive_packet( - rtems_packet_prefix ** -); - -rtems_mpci_entry Shm_Return_packet( - rtems_packet_prefix * -); - -rtems_mpci_entry Shm_Send_packet( - rtems_unsigned32, - rtems_packet_prefix * -); - -extern rtems_mpci_table MPCI_table; - -#ifdef _SHM_INIT - -/* multiprocessor communications interface (MPCI) table */ - -rtems_mpci_table MPCI_table = { - 100000, /* default timeout value in ticks */ - MAX_PACKET_SIZE, /* maximum packet size */ - Shm_Initialization, /* initialization procedure */ - Shm_Get_packet, /* get packet procedure */ - Shm_Return_packet, /* return packet procedure */ - Shm_Send_packet, /* packet send procedure */ - Shm_Receive_packet /* packet receive procedure */ -}; - -#endif - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/c/src/lib/libbsp/sparc/erc32/start/Makefile.in b/c/src/lib/libbsp/sparc/erc32/start/Makefile.in deleted file mode 100644 index dbc9cea9e3..0000000000 --- a/c/src/lib/libbsp/sparc/erc32/start/Makefile.in +++ /dev/null @@ -1,54 +0,0 @@ -# -# $Id$ -# - -@SET_MAKE@ -srcdir = @srcdir@ -VPATH = @srcdir@ -RTEMS_ROOT = @top_srcdir@ -PROJECT_ROOT = @PROJECT_ROOT@ - -PGMS=${ARCH}/startsis.o - -# C source names, if any, go here -- minus the .c -C_PIECES= -C_FILES=$(C_PIECES:%=%.c) -C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) - -H_FILES= - -# Assembly source names, if any, go here -- minus the .s -S_PIECES=startsis -S_FILES=$(S_PIECES:%=%.s) -S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) - -SRCS=$(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg -include $(RTEMS_ROOT)/make/leaf.cfg - -# -# (OPTIONAL) Add local stuff here using += -# - -DEFINES += -CPPFLAGS += -CFLAGS += - -LD_PATHS += -LD_LIBS += -LDFLAGS += - -# -# Add your list of files to delete here. The config files -# already know how to delete some stuff, so you may want -# to just run 'make clean' first to see what gets missed. -# 'make clobber' already includes 'make clean' -# - -CLEAN_ADDITIONS += -CLOBBER_ADDITIONS += - -all: ${ARCH} $(SRCS) $(OBJS) $(PGM) - $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib diff --git a/c/src/lib/libbsp/sparc/erc32/start/startsis.s b/c/src/lib/libbsp/sparc/erc32/start/startsis.s deleted file mode 100644 index 6097c4ab36..0000000000 --- a/c/src/lib/libbsp/sparc/erc32/start/startsis.s +++ /dev/null @@ -1,309 +0,0 @@ -/* - * startsis.s - * - * Start code for the ERC32. - * - * This is based on the file srt0.s provided with the binary - * distribution of the SPARC Instruction Simulator (SIS) found - * at ftp://ftp.estec.esa.nl/pub/ws/wsd/erc32. - * - * $Id$ - */ - -#include <asm.h> -#include <erc32.h> - -/* - * Unexpected trap will halt the processor by forcing it to error state - */ - -#define BAD_TRAP \ - ta 0; \ - nop; \ - nop; \ - nop; - -/* - * Software trap. Treat as BAD_TRAP for the time being... - */ - -#define SOFT_TRAP BAD_TRAP - - - .seg "text" - PUBLIC(start) - .global start - -SYM(start): -start: - -/* - * The trap table has to be the first code in a boot PROM. But because - * the Memory Configuration comes up thinking we only have 4K of PROM, we - * cannot have a full trap table and still have room left over to - * reprogram the Memory Configuration register correctly. This file - * uses an abbreviated trap which has every entry which might be used - * before RTEMS installs its own trap table. - */ - - - PUBLIC(trap_table) -SYM(trap_table): - - RTRAP( 0, SYM(hard_reset) ); ! 00 reset trap - BAD_TRAP; ! 01 instruction access - ! exception - BAD_TRAP; ! 02 illegal instruction - BAD_TRAP; ! 03 privileged instruction - BAD_TRAP; ! 04 fp disabled - TRAP( 5, SYM(window_overflow_trap_handler) ); ! 05 window overflow - TRAP( 6, SYM(window_underflow_trap_handler) );! 06 window underflow - BAD_TRAP; ! 07 memory address not aligned - BAD_TRAP; ! 08 fp exception - BAD_TRAP; ! 09 data access exception - BAD_TRAP; ! 0A tag overflow - BAD_TRAP; ! 0B undefined - BAD_TRAP; ! 0C undefined - BAD_TRAP; ! 0D undefined - BAD_TRAP; ! 0E undefined - BAD_TRAP; ! 0F undefined - BAD_TRAP; ! 10 undefined - - /* - * ERC32 defined traps - */ - - BAD_TRAP; ! 11 masked errors - BAD_TRAP; ! 12 external 1 - BAD_TRAP; ! 13 external 2 - BAD_TRAP; ! 14 UART A RX/TX - BAD_TRAP; ! 15 UART B RX/TX - BAD_TRAP; ! 16 correctable memory error - BAD_TRAP; ! 17 UART error - BAD_TRAP; ! 18 DMA access error - BAD_TRAP; ! 19 DMA timeout - BAD_TRAP; ! 1A external 3 - BAD_TRAP; ! 1B external 4 - BAD_TRAP; ! 1C general purpose timer - BAD_TRAP; ! 1D real time clock - BAD_TRAP; ! 1E external 5 - BAD_TRAP; ! 1F watchdog timeout - - - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 20 - 23 undefined - BAD_TRAP; ! 24 cp_disabled - BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 25 - 27 undefined - BAD_TRAP; ! 28 cp_exception - BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 29 - 2B undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 2C - 2F undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 30 - 33 undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 34 - 37 undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 38 - 3B undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 3C - 3F undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 40 - 43 undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 44 - 47 undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 48 - 4B undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 4C - 4F undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 50 - 53 undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 54 - 57 undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 58 - 5B undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 5C - 5F undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 60 - 63 undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 64 - 67 undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 68 - 6B undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 6C - 6F undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 70 - 73 undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 74 - 77 undefined - BAD_TRAP; BAD_TRAP; BAD_TRAP; BAD_TRAP; ! 78 - 7B undefined - -/* - This is a sad patch to make sure that we know where the - MEC timer control register mirror is so we can stop the timers - from an external debugger. It is needed because the control - register is write-only. Trap 0x7C cannot occure in ERC32... - - We also use this location to store the last location of the - usable RAM in order not to overwrite the remote debugger with - the RTEMS work-space area. - -*/ - - .global __ERC32_MEC_Timer_Control_Mirror, _rdb_start, _CLOCK_SPEED - -_rdb_start: -__ERC32_MEC_Timer_Control_Mirror: - - BAD_TRAP; BAD_TRAP; ! 7C - 7D undefined - -_CLOCK_SPEED: - BAD_TRAP; BAD_TRAP; ! BAD_TRAP; BAD_TRAP; ! 7E - 7F undefined - - /* - * Software traps - * - * NOTE: At the risk of being redundant... this is not a full - * table. The setjmp on the SPARC requires a window flush trap - * handler and RTEMS will preserve the entries that were - * installed before. - */ - - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 80 - 82 - TRAP( 0x83, SYM(window_flush_trap_handler) ); ! 83 flush windows SW trap - - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 84 - 87 - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 88 - 8B - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 8C - 8F - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 90 - 93 - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 94 - 97 - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 98 - 9B - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! 9C - 9F - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! A0 - A3 - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! A4 - A7 - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! A8 - AB - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! AC - AF - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! B0 - B3 - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! B4 - B7 - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! B8 - BB - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! BC - BF - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! C0 - C3 - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! C4 - C7 - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! C8 - CB - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! CC - CF - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! D0 - D3 - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! D4 - D7 - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! D8 - DB - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! DC - DF - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! E0 - E3 - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! E4 - E7 - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! E8 - EB - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! EC - EF - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! F0 - F3 - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! F4 - F7 - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! F8 - FB - SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; SOFT_TRAP; ! FC - FF - -/* - * This is the hard reset code. - */ - -#define PSR_INIT 0x10c0 /* Disable traps, set s and ps */ -#define WIM_INIT 2 -#define STACK_SIZE 16 * 1024 - - PUBLIC(hard_reset) -SYM(hard_reset): - - set _trap_table, %g1 ! Initialize TBR - mov %g1, %tbr - - set (SYM(rdb_start)), %g6 ! End of work-space area - st %sp, [%g6] - - -/* Check if MEC is initialised. If not, this means that we are - running on the simulator. Initiate some of the parameters - that are done by the boot-prom otherwise. -*/ - - set SYM(ERC32_MEC), %g3 ! g3 = base address of peripherals - ld [%g3], %g2 - set 0xfe080000, %g1 - andcc %g1, %g2, %g0 - bne 1f - set 0x00101000, %g1 ! 2M ROM, 4M RAM - ! set the Memory Configuration - st %g1, [ %g3 + ERC32_MEC_MEMORY_CONFIGURATION_OFFSET ] - - set SYM(RAM_END), %sp ! End of work-space area - st %sp, [%g6] - - set _CLOCK_SPEED, %g6 ! Use 14 MHz in simulator - set 14, %g1 - st %g1, [%g6] - -/* Common initialisation */ -1: - set WIM_INIT, %g1 ! Initialize WIM - mov %g1, %wim - - set PSR_INIT, %g1 - wr %g1, 0x20, %psr ! enable traps - - nop - nop - nop - - sethi %hi(stack_space + STACK_SIZE), %g1 - or %g1,%lo(stack_space + STACK_SIZE),%g1 - ! g1 = top of stack - mov %g1, %sp ! Set stack pointer - mov %sp, %fp ! Set frame pointer - nop - - /* - * Copy the initialized data to RAM - * - * FROM: _endtext - * TO: _data_start - * LENGTH: (__bss_start - _data_start) bytes - */ - - - sethi %hi(_endtext),%g2 - or %g2,%lo(_endtext),%g2 ! g2 = start of initialized data in ROM - - sethi %hi(_data_start),%g3 - or %g3,%lo(_data_start),%g3 ! g3 = start of initialized data in RAM - - sethi %hi(__bss_start),%g4 - or %g4,%lo(__bss_start),%g4 ! g4 = end of initialized data in RAM - - cmp %g2, %g3 - be 1f - nop - -copy_data: - ldd [ %g2 ], %g6 - std %g6 , [ %g3 ] ! copy this double word - add %g3, 8, %g3 ! bump the destination pointer - add %g2, 8, %g2 ! bump the source pointer - cmp %g3, %g4 ! Is the pointer past the end of dest? - bl copy_data - nop - - /* clear the bss */ -1: - - sethi %hi(_edata),%g2 - or %g2,%lo(_edata),%g2 ! g2 = start of bss - sethi %hi(_end),%g3 - or %g3,%lo(_end),%g3 ! g3 = end of bss - mov %g0,%g1 ! so std has two zeros -zerobss: - std %g0,[%g2] - add %g2,8,%g2 - cmp %g2,%g3 - bleu,a zerobss - nop - - mov %0, %o2 ! environ - mov %0, %o1 ! argv - mov %0, %o0 ! argc - call SYM(boot_card) - sub %sp, 0x60, %sp ! room for boot_card to save args - nop - - PUBLIC(BSP_fatal_return) -SYM(BSP_fatal_return): - ta 0 ! Halt if _main returns ... - nop - - /* - * There does not seem to be a way to get this aligned AND - * in the BSS. - */ - - .align 32 - .comm stack_space, STACK_SIZE - -/* end of file */ |