Path: blob/master/arch/blackfin/include/asm/def_LPBlackfin.h
15126 views
/*1* Blackfin core register bit & address definitions2*3* Copyright 2005-2008 Analog Devices Inc.4*5* Licensed under the ADI BSD license or GPL-2 (or later).6*/78#ifndef _DEF_LPBLACKFIN_H9#define _DEF_LPBLACKFIN_H1011#include <mach/anomaly.h>1213#define MK_BMSK_(x) (1<<x)14#define BFIN_DEPOSIT(mask, x) (((x) << __ffs(mask)) & (mask))15#define BFIN_EXTRACT(mask, x) (((x) & (mask)) >> __ffs(mask))1617#ifndef __ASSEMBLY__1819#include <linux/types.h>2021#if ANOMALY_0500019822# define NOP_PAD_ANOMALY_05000198 "nop;"23#else24# define NOP_PAD_ANOMALY_0500019825#endif2627#define _bfin_readX(addr, size, asm_size, asm_ext) ({ \28u32 __v; \29__asm__ __volatile__( \30NOP_PAD_ANOMALY_05000198 \31"%0 = " #asm_size "[%1]" #asm_ext ";" \32: "=d" (__v) \33: "a" (addr) \34); \35__v; })36#define _bfin_writeX(addr, val, size, asm_size) \37__asm__ __volatile__( \38NOP_PAD_ANOMALY_05000198 \39#asm_size "[%0] = %1;" \40: \41: "a" (addr), "d" ((u##size)(val)) \42: "memory" \43)4445#define bfin_read8(addr) _bfin_readX(addr, 8, b, (z))46#define bfin_read16(addr) _bfin_readX(addr, 16, w, (z))47#define bfin_read32(addr) _bfin_readX(addr, 32, , )48#define bfin_write8(addr, val) _bfin_writeX(addr, val, 8, b)49#define bfin_write16(addr, val) _bfin_writeX(addr, val, 16, w)50#define bfin_write32(addr, val) _bfin_writeX(addr, val, 32, )5152#define bfin_read(addr) \53({ \54sizeof(*(addr)) == 1 ? bfin_read8(addr) : \55sizeof(*(addr)) == 2 ? bfin_read16(addr) : \56sizeof(*(addr)) == 4 ? bfin_read32(addr) : \57({ BUG(); 0; }); \58})59#define bfin_write(addr, val) \60do { \61switch (sizeof(*(addr))) { \62case 1: bfin_write8(addr, val); break; \63case 2: bfin_write16(addr, val); break; \64case 4: bfin_write32(addr, val); break; \65default: BUG(); \66} \67} while (0)6869#define bfin_write_or(addr, bits) \70do { \71typeof(addr) __addr = (addr); \72bfin_write(__addr, bfin_read(__addr) | (bits)); \73} while (0)7475#define bfin_write_and(addr, bits) \76do { \77typeof(addr) __addr = (addr); \78bfin_write(__addr, bfin_read(__addr) & (bits)); \79} while (0)8081#endif /* __ASSEMBLY__ */8283/**************************************************84* System Register Bits85**************************************************/8687/**************************************************88* ASTAT register89**************************************************/9091/* definitions of ASTAT bit positions*/9293/*Result of last ALU0 or shifter operation is zero*/94#define ASTAT_AZ_P 0x0000000095/*Result of last ALU0 or shifter operation is negative*/96#define ASTAT_AN_P 0x0000000197/*Condition Code, used for holding comparison results*/98#define ASTAT_CC_P 0x0000000599/*Quotient Bit*/100#define ASTAT_AQ_P 0x00000006101/*Rounding mode, set for biased, clear for unbiased*/102#define ASTAT_RND_MOD_P 0x00000008103/*Result of last ALU0 operation generated a carry*/104#define ASTAT_AC0_P 0x0000000C105/*Result of last ALU0 operation generated a carry*/106#define ASTAT_AC0_COPY_P 0x00000002107/*Result of last ALU1 operation generated a carry*/108#define ASTAT_AC1_P 0x0000000D109/*Result of last ALU0 or MAC0 operation overflowed, sticky for MAC*/110#define ASTAT_AV0_P 0x00000010111/*Sticky version of ASTAT_AV0 */112#define ASTAT_AV0S_P 0x00000011113/*Result of last MAC1 operation overflowed, sticky for MAC*/114#define ASTAT_AV1_P 0x00000012115/*Sticky version of ASTAT_AV1 */116#define ASTAT_AV1S_P 0x00000013117/*Result of last ALU0 or MAC0 operation overflowed*/118#define ASTAT_V_P 0x00000018119/*Result of last ALU0 or MAC0 operation overflowed*/120#define ASTAT_V_COPY_P 0x00000003121/*Sticky version of ASTAT_V*/122#define ASTAT_VS_P 0x00000019123124/* Masks */125126/*Result of last ALU0 or shifter operation is zero*/127#define ASTAT_AZ MK_BMSK_(ASTAT_AZ_P)128/*Result of last ALU0 or shifter operation is negative*/129#define ASTAT_AN MK_BMSK_(ASTAT_AN_P)130/*Result of last ALU0 operation generated a carry*/131#define ASTAT_AC0 MK_BMSK_(ASTAT_AC0_P)132/*Result of last ALU0 operation generated a carry*/133#define ASTAT_AC0_COPY MK_BMSK_(ASTAT_AC0_COPY_P)134/*Result of last ALU0 operation generated a carry*/135#define ASTAT_AC1 MK_BMSK_(ASTAT_AC1_P)136/*Result of last ALU0 or MAC0 operation overflowed, sticky for MAC*/137#define ASTAT_AV0 MK_BMSK_(ASTAT_AV0_P)138/*Result of last MAC1 operation overflowed, sticky for MAC*/139#define ASTAT_AV1 MK_BMSK_(ASTAT_AV1_P)140/*Condition Code, used for holding comparison results*/141#define ASTAT_CC MK_BMSK_(ASTAT_CC_P)142/*Quotient Bit*/143#define ASTAT_AQ MK_BMSK_(ASTAT_AQ_P)144/*Rounding mode, set for biased, clear for unbiased*/145#define ASTAT_RND_MOD MK_BMSK_(ASTAT_RND_MOD_P)146/*Overflow Bit*/147#define ASTAT_V MK_BMSK_(ASTAT_V_P)148/*Overflow Bit*/149#define ASTAT_V_COPY MK_BMSK_(ASTAT_V_COPY_P)150151/**************************************************152* SEQSTAT register153**************************************************/154155/* Bit Positions */156#define SEQSTAT_EXCAUSE0_P 0x00000000 /* Last exception cause bit 0 */157#define SEQSTAT_EXCAUSE1_P 0x00000001 /* Last exception cause bit 1 */158#define SEQSTAT_EXCAUSE2_P 0x00000002 /* Last exception cause bit 2 */159#define SEQSTAT_EXCAUSE3_P 0x00000003 /* Last exception cause bit 3 */160#define SEQSTAT_EXCAUSE4_P 0x00000004 /* Last exception cause bit 4 */161#define SEQSTAT_EXCAUSE5_P 0x00000005 /* Last exception cause bit 5 */162#define SEQSTAT_IDLE_REQ_P 0x0000000C /* Pending idle mode request,163* set by IDLE instruction.164*/165#define SEQSTAT_SFTRESET_P 0x0000000D /* Indicates whether the last166* reset was a software reset167* (=1)168*/169#define SEQSTAT_HWERRCAUSE0_P 0x0000000E /* Last hw error cause bit 0 */170#define SEQSTAT_HWERRCAUSE1_P 0x0000000F /* Last hw error cause bit 1 */171#define SEQSTAT_HWERRCAUSE2_P 0x00000010 /* Last hw error cause bit 2 */172#define SEQSTAT_HWERRCAUSE3_P 0x00000011 /* Last hw error cause bit 3 */173#define SEQSTAT_HWERRCAUSE4_P 0x00000012 /* Last hw error cause bit 4 */174/* Masks */175/* Exception cause */176#define SEQSTAT_EXCAUSE (MK_BMSK_(SEQSTAT_EXCAUSE0_P) | \177MK_BMSK_(SEQSTAT_EXCAUSE1_P) | \178MK_BMSK_(SEQSTAT_EXCAUSE2_P) | \179MK_BMSK_(SEQSTAT_EXCAUSE3_P) | \180MK_BMSK_(SEQSTAT_EXCAUSE4_P) | \181MK_BMSK_(SEQSTAT_EXCAUSE5_P) | \1820)183184/* Indicates whether the last reset was a software reset (=1) */185#define SEQSTAT_SFTRESET (MK_BMSK_(SEQSTAT_SFTRESET_P))186187/* Last hw error cause */188#define SEQSTAT_HWERRCAUSE (MK_BMSK_(SEQSTAT_HWERRCAUSE0_P) | \189MK_BMSK_(SEQSTAT_HWERRCAUSE1_P) | \190MK_BMSK_(SEQSTAT_HWERRCAUSE2_P) | \191MK_BMSK_(SEQSTAT_HWERRCAUSE3_P) | \192MK_BMSK_(SEQSTAT_HWERRCAUSE4_P) | \1930)194195/* Translate bits to something useful */196197/* Last hw error cause */198#define SEQSTAT_HWERRCAUSE_SHIFT (14)199#define SEQSTAT_HWERRCAUSE_SYSTEM_MMR (0x02 << SEQSTAT_HWERRCAUSE_SHIFT)200#define SEQSTAT_HWERRCAUSE_EXTERN_ADDR (0x03 << SEQSTAT_HWERRCAUSE_SHIFT)201#define SEQSTAT_HWERRCAUSE_PERF_FLOW (0x12 << SEQSTAT_HWERRCAUSE_SHIFT)202#define SEQSTAT_HWERRCAUSE_RAISE_5 (0x18 << SEQSTAT_HWERRCAUSE_SHIFT)203204/**************************************************205* SYSCFG register206**************************************************/207208/* Bit Positions */209#define SYSCFG_SSSTEP_P 0x00000000 /* Supervisor single step, when210* set it forces an exception211* for each instruction executed212*/213#define SYSCFG_CCEN_P 0x00000001 /* Enable cycle counter (=1) */214#define SYSCFG_SNEN_P 0x00000002 /* Self nesting Interrupt Enable */215216/* Masks */217218/* Supervisor single step, when set it forces an exception for each219*instruction executed220*/221#define SYSCFG_SSSTEP MK_BMSK_(SYSCFG_SSSTEP_P )222/* Enable cycle counter (=1) */223#define SYSCFG_CCEN MK_BMSK_(SYSCFG_CCEN_P )224/* Self Nesting Interrupt Enable */225#define SYSCFG_SNEN MK_BMSK_(SYSCFG_SNEN_P)226/* Backward-compatibility for typos in prior releases */227#define SYSCFG_SSSSTEP SYSCFG_SSSTEP228#define SYSCFG_CCCEN SYSCFG_CCEN229230/****************************************************231* Core MMR Register Map232****************************************************/233234/* Data Cache & SRAM Memory (0xFFE00000 - 0xFFE00404) */235236#define SRAM_BASE_ADDRESS 0xFFE00000 /* SRAM Base Address Register */237#define DMEM_CONTROL 0xFFE00004 /* Data memory control */238#define DCPLB_STATUS 0xFFE00008 /* Data Cache Programmable Look-Aside239* Buffer Status240*/241#define DCPLB_FAULT_STATUS 0xFFE00008 /* "" (older define) */242#define DCPLB_FAULT_ADDR 0xFFE0000C /* Data Cache Programmable Look-Aside243* Buffer Fault Address244*/245#define DCPLB_ADDR0 0xFFE00100 /* Data Cache Protection Lookaside246* Buffer 0247*/248#define DCPLB_ADDR1 0xFFE00104 /* Data Cache Protection Lookaside249* Buffer 1250*/251#define DCPLB_ADDR2 0xFFE00108 /* Data Cache Protection Lookaside252* Buffer 2253*/254#define DCPLB_ADDR3 0xFFE0010C /* Data Cacheability Protection255* Lookaside Buffer 3256*/257#define DCPLB_ADDR4 0xFFE00110 /* Data Cacheability Protection258* Lookaside Buffer 4259*/260#define DCPLB_ADDR5 0xFFE00114 /* Data Cacheability Protection261* Lookaside Buffer 5262*/263#define DCPLB_ADDR6 0xFFE00118 /* Data Cacheability Protection264* Lookaside Buffer 6265*/266#define DCPLB_ADDR7 0xFFE0011C /* Data Cacheability Protection267* Lookaside Buffer 7268*/269#define DCPLB_ADDR8 0xFFE00120 /* Data Cacheability Protection270* Lookaside Buffer 8271*/272#define DCPLB_ADDR9 0xFFE00124 /* Data Cacheability Protection273* Lookaside Buffer 9274*/275#define DCPLB_ADDR10 0xFFE00128 /* Data Cacheability Protection276* Lookaside Buffer 10277*/278#define DCPLB_ADDR11 0xFFE0012C /* Data Cacheability Protection279* Lookaside Buffer 11280*/281#define DCPLB_ADDR12 0xFFE00130 /* Data Cacheability Protection282* Lookaside Buffer 12283*/284#define DCPLB_ADDR13 0xFFE00134 /* Data Cacheability Protection285* Lookaside Buffer 13286*/287#define DCPLB_ADDR14 0xFFE00138 /* Data Cacheability Protection288* Lookaside Buffer 14289*/290#define DCPLB_ADDR15 0xFFE0013C /* Data Cacheability Protection291* Lookaside Buffer 15292*/293#define DCPLB_DATA0 0xFFE00200 /* Data Cache 0 Status */294#define DCPLB_DATA1 0xFFE00204 /* Data Cache 1 Status */295#define DCPLB_DATA2 0xFFE00208 /* Data Cache 2 Status */296#define DCPLB_DATA3 0xFFE0020C /* Data Cache 3 Status */297#define DCPLB_DATA4 0xFFE00210 /* Data Cache 4 Status */298#define DCPLB_DATA5 0xFFE00214 /* Data Cache 5 Status */299#define DCPLB_DATA6 0xFFE00218 /* Data Cache 6 Status */300#define DCPLB_DATA7 0xFFE0021C /* Data Cache 7 Status */301#define DCPLB_DATA8 0xFFE00220 /* Data Cache 8 Status */302#define DCPLB_DATA9 0xFFE00224 /* Data Cache 9 Status */303#define DCPLB_DATA10 0xFFE00228 /* Data Cache 10 Status */304#define DCPLB_DATA11 0xFFE0022C /* Data Cache 11 Status */305#define DCPLB_DATA12 0xFFE00230 /* Data Cache 12 Status */306#define DCPLB_DATA13 0xFFE00234 /* Data Cache 13 Status */307#define DCPLB_DATA14 0xFFE00238 /* Data Cache 14 Status */308#define DCPLB_DATA15 0xFFE0023C /* Data Cache 15 Status */309#define DCPLB_DATA16 0xFFE00240 /* Extra Dummy entry */310311#define DTEST_COMMAND 0xFFE00300 /* Data Test Command Register */312#define DTEST_DATA0 0xFFE00400 /* Data Test Data Register */313#define DTEST_DATA1 0xFFE00404 /* Data Test Data Register */314315/* Instruction Cache & SRAM Memory (0xFFE01004 - 0xFFE01404) */316317#define IMEM_CONTROL 0xFFE01004 /* Instruction Memory Control */318#define ICPLB_STATUS 0xFFE01008 /* Instruction Cache miss status */319#define CODE_FAULT_STATUS 0xFFE01008 /* "" (older define) */320#define ICPLB_FAULT_ADDR 0xFFE0100C /* Instruction Cache miss address */321#define CODE_FAULT_ADDR 0xFFE0100C /* "" (older define) */322#define ICPLB_ADDR0 0xFFE01100 /* Instruction Cacheability323* Protection Lookaside Buffer 0324*/325#define ICPLB_ADDR1 0xFFE01104 /* Instruction Cacheability326* Protection Lookaside Buffer 1327*/328#define ICPLB_ADDR2 0xFFE01108 /* Instruction Cacheability329* Protection Lookaside Buffer 2330*/331#define ICPLB_ADDR3 0xFFE0110C /* Instruction Cacheability332* Protection Lookaside Buffer 3333*/334#define ICPLB_ADDR4 0xFFE01110 /* Instruction Cacheability335* Protection Lookaside Buffer 4336*/337#define ICPLB_ADDR5 0xFFE01114 /* Instruction Cacheability338* Protection Lookaside Buffer 5339*/340#define ICPLB_ADDR6 0xFFE01118 /* Instruction Cacheability341* Protection Lookaside Buffer 6342*/343#define ICPLB_ADDR7 0xFFE0111C /* Instruction Cacheability344* Protection Lookaside Buffer 7345*/346#define ICPLB_ADDR8 0xFFE01120 /* Instruction Cacheability347* Protection Lookaside Buffer 8348*/349#define ICPLB_ADDR9 0xFFE01124 /* Instruction Cacheability350* Protection Lookaside Buffer 9351*/352#define ICPLB_ADDR10 0xFFE01128 /* Instruction Cacheability353* Protection Lookaside Buffer 10354*/355#define ICPLB_ADDR11 0xFFE0112C /* Instruction Cacheability356* Protection Lookaside Buffer 11357*/358#define ICPLB_ADDR12 0xFFE01130 /* Instruction Cacheability359* Protection Lookaside Buffer 12360*/361#define ICPLB_ADDR13 0xFFE01134 /* Instruction Cacheability362* Protection Lookaside Buffer 13363*/364#define ICPLB_ADDR14 0xFFE01138 /* Instruction Cacheability365* Protection Lookaside Buffer 14366*/367#define ICPLB_ADDR15 0xFFE0113C /* Instruction Cacheability368* Protection Lookaside Buffer 15369*/370#define ICPLB_DATA0 0xFFE01200 /* Instruction Cache 0 Status */371#define ICPLB_DATA1 0xFFE01204 /* Instruction Cache 1 Status */372#define ICPLB_DATA2 0xFFE01208 /* Instruction Cache 2 Status */373#define ICPLB_DATA3 0xFFE0120C /* Instruction Cache 3 Status */374#define ICPLB_DATA4 0xFFE01210 /* Instruction Cache 4 Status */375#define ICPLB_DATA5 0xFFE01214 /* Instruction Cache 5 Status */376#define ICPLB_DATA6 0xFFE01218 /* Instruction Cache 6 Status */377#define ICPLB_DATA7 0xFFE0121C /* Instruction Cache 7 Status */378#define ICPLB_DATA8 0xFFE01220 /* Instruction Cache 8 Status */379#define ICPLB_DATA9 0xFFE01224 /* Instruction Cache 9 Status */380#define ICPLB_DATA10 0xFFE01228 /* Instruction Cache 10 Status */381#define ICPLB_DATA11 0xFFE0122C /* Instruction Cache 11 Status */382#define ICPLB_DATA12 0xFFE01230 /* Instruction Cache 12 Status */383#define ICPLB_DATA13 0xFFE01234 /* Instruction Cache 13 Status */384#define ICPLB_DATA14 0xFFE01238 /* Instruction Cache 14 Status */385#define ICPLB_DATA15 0xFFE0123C /* Instruction Cache 15 Status */386#define ITEST_COMMAND 0xFFE01300 /* Instruction Test Command Register */387#define ITEST_DATA0 0xFFE01400 /* Instruction Test Data Register */388#define ITEST_DATA1 0xFFE01404 /* Instruction Test Data Register */389390/* Event/Interrupt Controller Registers (0xFFE02000 - 0xFFE02110) */391392#define EVT0 0xFFE02000 /* Event Vector 0 ESR Address */393#define EVT1 0xFFE02004 /* Event Vector 1 ESR Address */394#define EVT2 0xFFE02008 /* Event Vector 2 ESR Address */395#define EVT3 0xFFE0200C /* Event Vector 3 ESR Address */396#define EVT4 0xFFE02010 /* Event Vector 4 ESR Address */397#define EVT5 0xFFE02014 /* Event Vector 5 ESR Address */398#define EVT6 0xFFE02018 /* Event Vector 6 ESR Address */399#define EVT7 0xFFE0201C /* Event Vector 7 ESR Address */400#define EVT8 0xFFE02020 /* Event Vector 8 ESR Address */401#define EVT9 0xFFE02024 /* Event Vector 9 ESR Address */402#define EVT10 0xFFE02028 /* Event Vector 10 ESR Address */403#define EVT11 0xFFE0202C /* Event Vector 11 ESR Address */404#define EVT12 0xFFE02030 /* Event Vector 12 ESR Address */405#define EVT13 0xFFE02034 /* Event Vector 13 ESR Address */406#define EVT14 0xFFE02038 /* Event Vector 14 ESR Address */407#define EVT15 0xFFE0203C /* Event Vector 15 ESR Address */408#define EVT_OVERRIDE 0xFFE02100 /* Event Vector Override Register */409#define IMASK 0xFFE02104 /* Interrupt Mask Register */410#define IPEND 0xFFE02108 /* Interrupt Pending Register */411#define ILAT 0xFFE0210C /* Interrupt Latch Register */412#define IPRIO 0xFFE02110 /* Core Interrupt Priority Register */413414/* Core Timer Registers (0xFFE03000 - 0xFFE0300C) */415416#define TCNTL 0xFFE03000 /* Core Timer Control Register */417#define TPERIOD 0xFFE03004 /* Core Timer Period Register */418#define TSCALE 0xFFE03008 /* Core Timer Scale Register */419#define TCOUNT 0xFFE0300C /* Core Timer Count Register */420421/* Debug/MP/Emulation Registers (0xFFE05000 - 0xFFE05008) */422#define DSPID 0xFFE05000 /* DSP Processor ID Register for423* MP implementations424*/425426#define DBGSTAT 0xFFE05008 /* Debug Status Register */427428/* Trace Buffer Registers (0xFFE06000 - 0xFFE06100) */429430#define TBUFCTL 0xFFE06000 /* Trace Buffer Control Register */431#define TBUFSTAT 0xFFE06004 /* Trace Buffer Status Register */432#define TBUF 0xFFE06100 /* Trace Buffer */433434/* Watchpoint Control Registers (0xFFE07000 - 0xFFE07200) */435436/* Watchpoint Instruction Address Control Register */437#define WPIACTL 0xFFE07000438/* Watchpoint Instruction Address Register 0 */439#define WPIA0 0xFFE07040440/* Watchpoint Instruction Address Register 1 */441#define WPIA1 0xFFE07044442/* Watchpoint Instruction Address Register 2 */443#define WPIA2 0xFFE07048444/* Watchpoint Instruction Address Register 3 */445#define WPIA3 0xFFE0704C446/* Watchpoint Instruction Address Register 4 */447#define WPIA4 0xFFE07050448/* Watchpoint Instruction Address Register 5 */449#define WPIA5 0xFFE07054450/* Watchpoint Instruction Address Count Register 0 */451#define WPIACNT0 0xFFE07080452/* Watchpoint Instruction Address Count Register 1 */453#define WPIACNT1 0xFFE07084454/* Watchpoint Instruction Address Count Register 2 */455#define WPIACNT2 0xFFE07088456/* Watchpoint Instruction Address Count Register 3 */457#define WPIACNT3 0xFFE0708C458/* Watchpoint Instruction Address Count Register 4 */459#define WPIACNT4 0xFFE07090460/* Watchpoint Instruction Address Count Register 5 */461#define WPIACNT5 0xFFE07094462/* Watchpoint Data Address Control Register */463#define WPDACTL 0xFFE07100464/* Watchpoint Data Address Register 0 */465#define WPDA0 0xFFE07140466/* Watchpoint Data Address Register 1 */467#define WPDA1 0xFFE07144468/* Watchpoint Data Address Count Value Register 0 */469#define WPDACNT0 0xFFE07180470/* Watchpoint Data Address Count Value Register 1 */471#define WPDACNT1 0xFFE07184472/* Watchpoint Status Register */473#define WPSTAT 0xFFE07200474475/* Performance Monitor Registers (0xFFE08000 - 0xFFE08104) */476477/* Performance Monitor Control Register */478#define PFCTL 0xFFE08000479/* Performance Monitor Counter Register 0 */480#define PFCNTR0 0xFFE08100481/* Performance Monitor Counter Register 1 */482#define PFCNTR1 0xFFE08104483484/****************************************************485* Core MMR Register Bits486****************************************************/487488/**************************************************489* EVT registers (ILAT, IMASK, and IPEND).490**************************************************/491492/* Bit Positions */493#define EVT_EMU_P 0x00000000 /* Emulator interrupt bit position */494#define EVT_RST_P 0x00000001 /* Reset interrupt bit position */495#define EVT_NMI_P 0x00000002 /* Non Maskable interrupt bit position */496#define EVT_EVX_P 0x00000003 /* Exception bit position */497#define EVT_IRPTEN_P 0x00000004 /* Global interrupt enable bit position */498#define EVT_IVHW_P 0x00000005 /* Hardware Error interrupt bit position */499#define EVT_IVTMR_P 0x00000006 /* Timer interrupt bit position */500#define EVT_IVG7_P 0x00000007 /* IVG7 interrupt bit position */501#define EVT_IVG8_P 0x00000008 /* IVG8 interrupt bit position */502#define EVT_IVG9_P 0x00000009 /* IVG9 interrupt bit position */503#define EVT_IVG10_P 0x0000000a /* IVG10 interrupt bit position */504#define EVT_IVG11_P 0x0000000b /* IVG11 interrupt bit position */505#define EVT_IVG12_P 0x0000000c /* IVG12 interrupt bit position */506#define EVT_IVG13_P 0x0000000d /* IVG13 interrupt bit position */507#define EVT_IVG14_P 0x0000000e /* IVG14 interrupt bit position */508#define EVT_IVG15_P 0x0000000f /* IVG15 interrupt bit position */509510/* Masks */511#define EVT_EMU MK_BMSK_(EVT_EMU_P ) /* Emulator interrupt mask */512#define EVT_RST MK_BMSK_(EVT_RST_P ) /* Reset interrupt mask */513#define EVT_NMI MK_BMSK_(EVT_NMI_P ) /* Non Maskable interrupt mask */514#define EVT_EVX MK_BMSK_(EVT_EVX_P ) /* Exception mask */515#define EVT_IRPTEN MK_BMSK_(EVT_IRPTEN_P) /* Global interrupt enable mask */516#define EVT_IVHW MK_BMSK_(EVT_IVHW_P ) /* Hardware Error interrupt mask */517#define EVT_IVTMR MK_BMSK_(EVT_IVTMR_P ) /* Timer interrupt mask */518#define EVT_IVG7 MK_BMSK_(EVT_IVG7_P ) /* IVG7 interrupt mask */519#define EVT_IVG8 MK_BMSK_(EVT_IVG8_P ) /* IVG8 interrupt mask */520#define EVT_IVG9 MK_BMSK_(EVT_IVG9_P ) /* IVG9 interrupt mask */521#define EVT_IVG10 MK_BMSK_(EVT_IVG10_P ) /* IVG10 interrupt mask */522#define EVT_IVG11 MK_BMSK_(EVT_IVG11_P ) /* IVG11 interrupt mask */523#define EVT_IVG12 MK_BMSK_(EVT_IVG12_P ) /* IVG12 interrupt mask */524#define EVT_IVG13 MK_BMSK_(EVT_IVG13_P ) /* IVG13 interrupt mask */525#define EVT_IVG14 MK_BMSK_(EVT_IVG14_P ) /* IVG14 interrupt mask */526#define EVT_IVG15 MK_BMSK_(EVT_IVG15_P ) /* IVG15 interrupt mask */527528/**************************************************529* DMEM_CONTROL Register530**************************************************/531/* Bit Positions */532#define ENDM_P 0x00 /* (doesn't really exist) Enable533*Data Memory L1534*/535#define DMCTL_ENDM_P ENDM_P /* "" (older define) */536537#define ENDCPLB_P 0x01 /* Enable DCPLBS */538#define DMCTL_ENDCPLB_P ENDCPLB_P /* "" (older define) */539#define DMC0_P 0x02 /* L1 Data Memory Configure bit 0 */540#define DMCTL_DMC0_P DMC0_P /* "" (older define) */541#define DMC1_P 0x03 /* L1 Data Memory Configure bit 1 */542#define DMCTL_DMC1_P DMC1_P /* "" (older define) */543#define DCBS_P 0x04 /* L1 Data Cache Bank Select */544#define PORT_PREF0_P 0x12 /* DAG0 Port Preference */545#define PORT_PREF1_P 0x13 /* DAG1 Port Preference */546547/* Masks */548#define ENDM 0x00000001 /* (doesn't really exist) Enable549* Data Memory L1550*/551#define ENDCPLB 0x00000002 /* Enable DCPLB */552#define ASRAM_BSRAM 0x00000000553#define ACACHE_BSRAM 0x00000008554#define ACACHE_BCACHE 0x0000000C555#define DCBS 0x00000010 /* L1 Data Cache Bank Select */556#define PORT_PREF0 0x00001000 /* DAG0 Port Preference */557#define PORT_PREF1 0x00002000 /* DAG1 Port Preference */558559/* IMEM_CONTROL Register */560/* Bit Positions */561#define ENIM_P 0x00 /* Enable L1 Code Memory */562#define IMCTL_ENIM_P 0x00 /* "" (older define) */563#define ENICPLB_P 0x01 /* Enable ICPLB */564#define IMCTL_ENICPLB_P 0x01 /* "" (older define) */565#define IMC_P 0x02 /* Enable */566#define IMCTL_IMC_P 0x02 /* Configure L1 code memory as567* cache (0=SRAM)568*/569#define ILOC0_P 0x03 /* Lock Way 0 */570#define ILOC1_P 0x04 /* Lock Way 1 */571#define ILOC2_P 0x05 /* Lock Way 2 */572#define ILOC3_P 0x06 /* Lock Way 3 */573#define LRUPRIORST_P 0x0D /* Least Recently Used Replacement574* Priority575*/576/* Masks */577#define ENIM 0x00000001 /* Enable L1 Code Memory */578#define ENICPLB 0x00000002 /* Enable ICPLB */579#define IMC 0x00000004 /* Configure L1 code memory as580* cache (0=SRAM)581*/582#define ILOC0 0x00000008 /* Lock Way 0 */583#define ILOC1 0x00000010 /* Lock Way 1 */584#define ILOC2 0x00000020 /* Lock Way 2 */585#define ILOC3 0x00000040 /* Lock Way 3 */586#define LRUPRIORST 0x00002000 /* Least Recently Used Replacement587* Priority588*/589590/* TCNTL Masks */591#define TMPWR 0x00000001 /* Timer Low Power Control,592* 0=low power mode, 1=active state593*/594#define TMREN 0x00000002 /* Timer enable, 0=disable, 1=enable */595#define TAUTORLD 0x00000004 /* Timer auto reload */596#define TINT 0x00000008 /* Timer generated interrupt 0=no597* interrupt has been generated,598* 1=interrupt has been generated599* (sticky)600*/601602/* DCPLB_DATA and ICPLB_DATA Registers */603/* Bit Positions */604#define CPLB_VALID_P 0x00000000 /* 0=invalid entry, 1=valid entry */605#define CPLB_LOCK_P 0x00000001 /* 0=entry may be replaced, 1=entry606* locked607*/608#define CPLB_USER_RD_P 0x00000002 /* 0=no read access, 1=read access609* allowed (user mode)610*/611/* Masks */612#define CPLB_VALID 0x00000001 /* 0=invalid entry, 1=valid entry */613#define CPLB_LOCK 0x00000002 /* 0=entry may be replaced, 1=entry614* locked615*/616#define CPLB_USER_RD 0x00000004 /* 0=no read access, 1=read access617* allowed (user mode)618*/619620#define PAGE_SIZE_1KB 0x00000000 /* 1 KB page size */621#define PAGE_SIZE_4KB 0x00010000 /* 4 KB page size */622#define PAGE_SIZE_1MB 0x00020000 /* 1 MB page size */623#define PAGE_SIZE_4MB 0x00030000 /* 4 MB page size */624#define CPLB_L1SRAM 0x00000020 /* 0=SRAM mapped in L1, 0=SRAM not625* mapped to L1626*/627#define CPLB_PORTPRIO 0x00000200 /* 0=low priority port, 1= high628* priority port629*/630#define CPLB_L1_CHBL 0x00001000 /* 0=non-cacheable in L1, 1=cacheable631* in L1632*/633/* ICPLB_DATA only */634#define CPLB_LRUPRIO 0x00000100 /* 0=can be replaced by any line,635* 1=priority for non-replacement636*/637/* DCPLB_DATA only */638#define CPLB_USER_WR 0x00000008 /* 0=no write access, 0=write639* access allowed (user mode)640*/641#define CPLB_SUPV_WR 0x00000010 /* 0=no write access, 0=write642* access allowed (supervisor mode)643*/644#define CPLB_DIRTY 0x00000080 /* 1=dirty, 0=clean */645#define CPLB_L1_AOW 0x00008000 /* 0=do not allocate cache lines on646* write-through writes,647* 1= allocate cache lines on648* write-through writes.649*/650#define CPLB_WT 0x00004000 /* 0=write-back, 1=write-through */651652#define CPLB_ALL_ACCESS CPLB_SUPV_WR | CPLB_USER_RD | CPLB_USER_WR653654/* TBUFCTL Masks */655#define TBUFPWR 0x0001656#define TBUFEN 0x0002657#define TBUFOVF 0x0004658#define TBUFCMPLP_SINGLE 0x0008659#define TBUFCMPLP_DOUBLE 0x0010660#define TBUFCMPLP (TBUFCMPLP_SINGLE | TBUFCMPLP_DOUBLE)661662/* TBUFSTAT Masks */663#define TBUFCNT 0x001F664665/* ITEST_COMMAND and DTEST_COMMAND Registers */666/* Masks */667#define TEST_READ 0x00000000 /* Read Access */668#define TEST_WRITE 0x00000002 /* Write Access */669#define TEST_TAG 0x00000000 /* Access TAG */670#define TEST_DATA 0x00000004 /* Access DATA */671#define TEST_DW0 0x00000000 /* Select Double Word 0 */672#define TEST_DW1 0x00000008 /* Select Double Word 1 */673#define TEST_DW2 0x00000010 /* Select Double Word 2 */674#define TEST_DW3 0x00000018 /* Select Double Word 3 */675#define TEST_MB0 0x00000000 /* Select Mini-Bank 0 */676#define TEST_MB1 0x00010000 /* Select Mini-Bank 1 */677#define TEST_MB2 0x00020000 /* Select Mini-Bank 2 */678#define TEST_MB3 0x00030000 /* Select Mini-Bank 3 */679#define TEST_SET(x) ((x << 5) & 0x03E0) /* Set Index 0->31 */680#define TEST_WAY0 0x00000000 /* Access Way0 */681#define TEST_WAY1 0x04000000 /* Access Way1 */682/* ITEST_COMMAND only */683#define TEST_WAY2 0x08000000 /* Access Way2 */684#define TEST_WAY3 0x0C000000 /* Access Way3 */685/* DTEST_COMMAND only */686#define TEST_BNKSELA 0x00000000 /* Access SuperBank A */687#define TEST_BNKSELB 0x00800000 /* Access SuperBank B */688689#endif /* _DEF_LPBLACKFIN_H */690691692