···2020#define ARC_REG_PERIBASE_BCR 0x692121#define ARC_REG_FP_BCR 0x6B /* Single-Precision FPU */2222#define ARC_REG_DPFP_BCR 0x6C /* Dbl Precision FPU */2323-#define ARC_REG_MMU_BCR 0x6f2423#define ARC_REG_DCCM_BCR 0x74 /* DCCM Present + SZ */2524#define ARC_REG_TIMERS_BCR 0x752625#define ARC_REG_ICCM_BCR 0x78···3334#define ARC_REG_D_UNCACH_BCR 0x6A34353536/* status32 Bits Positions */3636-#define STATUS_H_BIT 0 /* CPU Halted */3737-#define STATUS_E1_BIT 1 /* Int 1 enable */3838-#define STATUS_E2_BIT 2 /* Int 2 enable */3939-#define STATUS_A1_BIT 3 /* Int 1 active */4040-#define STATUS_A2_BIT 4 /* Int 2 active */4137#define STATUS_AE_BIT 5 /* Exception active */4238#define STATUS_DE_BIT 6 /* PC is in delay slot */4339#define STATUS_U_BIT 7 /* User/Kernel mode */4440#define STATUS_L_BIT 12 /* Loop inhibit */45414642/* These masks correspond to the status word(STATUS_32) bits */4747-#define STATUS_H_MASK (1<<STATUS_H_BIT)4848-#define STATUS_E1_MASK (1<<STATUS_E1_BIT)4949-#define STATUS_E2_MASK (1<<STATUS_E2_BIT)5050-#define STATUS_A1_MASK (1<<STATUS_A1_BIT)5151-#define STATUS_A2_MASK (1<<STATUS_A2_BIT)5243#define STATUS_AE_MASK (1<<STATUS_AE_BIT)5344#define STATUS_DE_MASK (1<<STATUS_DE_BIT)5445#define STATUS_U_MASK (1<<STATUS_U_BIT)···7687/* Auxiliary registers */7788#define AUX_IDENTITY 47889#define AUX_INTR_VEC_BASE 0x257979-#define AUX_IRQ_LEV 0x200 /* IRQ Priority: L1 or L2 */8080-#define AUX_IRQ_HINT 0x201 /* For generating Soft Interrupts */8181-#define AUX_IRQ_LV12 0x43 /* interrupt level register */82908383-#define AUX_IENABLE 0x40c8484-#define AUX_ITRIGGER 0x40d8585-#define AUX_IPULSE 0x4158686-8787-/* Timer related Aux registers */8888-#define ARC_REG_TIMER0_LIMIT 0x23 /* timer 0 limit */8989-#define ARC_REG_TIMER0_CTRL 0x22 /* timer 0 control */9090-#define ARC_REG_TIMER0_CNT 0x21 /* timer 0 count */9191-#define ARC_REG_TIMER1_LIMIT 0x102 /* timer 1 limit */9292-#define ARC_REG_TIMER1_CTRL 0x101 /* timer 1 control */9393-#define ARC_REG_TIMER1_CNT 0x100 /* timer 1 count */9494-9595-#define TIMER_CTRL_IE (1 << 0) /* Interupt when Count reachs limit */9696-#define TIMER_CTRL_NH (1 << 1) /* Count only when CPU NOT halted */9797-9898-/* MMU Management regs */9999-#define ARC_REG_TLBPD0 0x405100100-#define ARC_REG_TLBPD1 0x406101101-#define ARC_REG_TLBINDEX 0x407102102-#define ARC_REG_TLBCOMMAND 0x408103103-#define ARC_REG_PID 0x409104104-#define ARC_REG_SCRATCH_DATA0 0x418105105-106106-/* Bits in MMU PID register */107107-#define MMU_ENABLE (1 << 31) /* Enable MMU for process */108108-109109-/* Error code if probe fails */110110-#define TLB_LKUP_ERR 0x80000000111111-112112-/* TLB Commands */113113-#define TLBWrite 0x1114114-#define TLBRead 0x2115115-#define TLBGetIndex 0x3116116-#define TLBProbe 0x4117117-118118-#if (CONFIG_ARC_MMU_VER >= 2)119119-#define TLBWriteNI 0x5 /* write JTLB without inv uTLBs */120120-#define TLBIVUTLB 0x6 /* explicitly inv uTLBs */121121-#else122122-#undef TLBWriteNI /* These cmds don't exist on older MMU */123123-#undef TLBIVUTLB124124-#endif125125-126126-/* Instruction cache related Auxiliary registers */127127-#define ARC_REG_IC_BCR 0x77 /* Build Config reg */128128-#define ARC_REG_IC_IVIC 0x10129129-#define ARC_REG_IC_CTRL 0x11130130-#define ARC_REG_IC_IVIL 0x19131131-#if (CONFIG_ARC_MMU_VER > 2)132132-#define ARC_REG_IC_PTAG 0x1E133133-#endif134134-135135-/* Bit val in IC_CTRL */136136-#define IC_CTRL_CACHE_DISABLE 0x1137137-138138-/* Data cache related Auxiliary registers */139139-#define ARC_REG_DC_BCR 0x72140140-#define ARC_REG_DC_IVDC 0x47141141-#define ARC_REG_DC_CTRL 0x48142142-#define ARC_REG_DC_IVDL 0x4A143143-#define ARC_REG_DC_FLSH 0x4B144144-#define ARC_REG_DC_FLDL 0x4C145145-#if (CONFIG_ARC_MMU_VER > 2)146146-#define ARC_REG_DC_PTAG 0x5C147147-#endif148148-149149-/* Bit val in DC_CTRL */150150-#define DC_CTRL_INV_MODE_FLUSH 0x40151151-#define DC_CTRL_FLUSH_STATUS 0x100152152-153153-/* MMU Management regs */154154-#define ARC_REG_PID 0x409155155-#define ARC_REG_SCRATCH_DATA0 0x418156156-157157-/* Bits in MMU PID register */158158-#define MMU_ENABLE (1 << 31) /* Enable MMU for process */1599116092/*16193 * Floating Pt Registers···203293#endif204294};205295206206-struct bcr_mmu_1_2 {207207-#ifdef CONFIG_CPU_BIG_ENDIAN208208- unsigned int ver:8, ways:4, sets:4, u_itlb:8, u_dtlb:8;209209-#else210210- unsigned int u_dtlb:8, u_itlb:8, sets:4, ways:4, ver:8;211211-#endif212212-};213213-214214-struct bcr_mmu_3 {215215-#ifdef CONFIG_CPU_BIG_ENDIAN216216- unsigned int ver:8, ways:4, sets:4, osm:1, reserv:3, pg_sz:4,217217- u_itlb:4, u_dtlb:4;218218-#else219219- unsigned int u_dtlb:4, u_itlb:4, pg_sz:4, reserv:3, osm:1, sets:4,220220- ways:4, ver:8;221221-#endif222222-};223223-224296#define EXTN_SWAP_VALID 0x1225297#define EXTN_NORM_VALID 0x2226298#define EXTN_MINMAX_VALID 0x2···232340 unsigned int ram_org:2, num_banks:4, bank_sz:4, ver:8;233341#else234342 unsigned int ver:8, bank_sz:4, num_banks:4, ram_org:2;235235-#endif236236-};237237-238238-struct bcr_cache {239239-#ifdef CONFIG_CPU_BIG_ENDIAN240240- unsigned int pad:12, line_len:4, sz:4, config:4, ver:8;241241-#else242242- unsigned int ver:8, config:4, sz:4, line_len:4, pad:12;243343#endif244344};245345
+9-10
arch/arc/include/asm/cache.h
···99#ifndef __ARC_ASM_CACHE_H1010#define __ARC_ASM_CACHE_H11111212-#include <asm/mmu.h> /* some of cache registers depend on MMU ver */1313-1412/* In case $$ not config, setup a dummy number for rest of kernel */1513#ifndef CONFIG_ARC_CACHE_LINE_SHIFT1614#define L1_CACHE_SHIFT 6···3436#define is_not_cache_aligned(p) ((unsigned long)p & (~DCACHE_LINE_MASK))3537#endif36383939+/*4040+ * ARC700 doesn't cache any access in top 256M.4141+ * Ideal for wiring memory mapped peripherals as we don't need to do4242+ * explicit uncached accesses (LD.di/ST.di) hence more portable drivers4343+ */4444+#define ARC_UNCACHED_ADDR_SPACE 0xc00000004545+3746#ifndef __ASSEMBLY__38473948/* Uncached access macros */···64596560#define ARCH_DMA_MINALIGN L1_CACHE_BYTES66616767-/*6868- * ARC700 doesn't cache any access in top 256M.6969- * Ideal for wiring memory mapped peripherals as we don't need to do7070- * explicit uncached accesses (LD.di/ST.di) hence more portable drivers7171- */7272-#define ARC_UNCACHED_ADDR_SPACE 0xc00000007373-7462extern void arc_cache_init(void);7563extern char *arc_cache_mumbojumbo(int cpu_id, char *buf, int len);7664extern void __init read_decode_cache_bcr(void);7777-#endif6565+6666+#endif /* !__ASSEMBLY__ */78677968#endif /* _ASM_CACHE_H */
+20
arch/arc/include/asm/irqflags.h
···19192020#include <asm/arcregs.h>21212222+/* status32 Reg bits related to Interrupt Handling */2323+#define STATUS_E1_BIT 1 /* Int 1 enable */2424+#define STATUS_E2_BIT 2 /* Int 2 enable */2525+#define STATUS_A1_BIT 3 /* Int 1 active */2626+#define STATUS_A2_BIT 4 /* Int 2 active */2727+2828+#define STATUS_E1_MASK (1<<STATUS_E1_BIT)2929+#define STATUS_E2_MASK (1<<STATUS_E2_BIT)3030+#define STATUS_A1_MASK (1<<STATUS_A1_BIT)3131+#define STATUS_A2_MASK (1<<STATUS_A2_BIT)3232+3333+/* Other Interrupt Handling related Aux regs */3434+#define AUX_IRQ_LEV 0x200 /* IRQ Priority: L1 or L2 */3535+#define AUX_IRQ_HINT 0x201 /* For generating Soft Interrupts */3636+#define AUX_IRQ_LV12 0x43 /* interrupt level register */3737+3838+#define AUX_IENABLE 0x40c3939+#define AUX_ITRIGGER 0x40d4040+#define AUX_IPULSE 0x4154141+2242#ifndef __ASSEMBLY__23432444/******************************************************************