OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-sparc/] [swift.h] - Blame information for rev 1772

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
/* swift.h: Specific definitions for the _broken_ Swift SRMMU
2
 *          MMU module.
3
 *
4
 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5
 */
6
 
7
#ifndef _SPARC_SWIFT_H
8
#define _SPARC_SWIFT_H
9
 
10
/* Swift is so brain damaged, here is the mmu control register. */
11
#define SWIFT_ST       0x00800000   /* SW tablewalk enable */
12
#define SWIFT_WP       0x00400000   /* Watchpoint enable   */
13
 
14
/* Branch folding (buggy, disable on production systems!)  */
15
#define SWIFT_BF       0x00200000
16
#define SWIFT_PMC      0x00180000   /* Page mode control   */
17
#define SWIFT_PE       0x00040000   /* Parity enable       */
18
#define SWIFT_PC       0x00020000   /* Parity control      */
19
#define SWIFT_AP       0x00010000   /* Graphics page mode control (TCX/SX) */
20
#define SWIFT_AC       0x00008000   /* Alternate Cacheability (see viking.h) */
21
#define SWIFT_BM       0x00004000   /* Boot mode */
22
#define SWIFT_RC       0x00003c00   /* DRAM refresh control */
23
#define SWIFT_IE       0x00000200   /* Instruction cache enable */
24
#define SWIFT_DE       0x00000100   /* Data cache enable */
25
#define SWIFT_SA       0x00000080   /* Store Allocate */
26
#define SWIFT_NF       0x00000002   /* No fault mode */
27
#define SWIFT_EN       0x00000001   /* MMU enable */
28
 
29
extern inline void swift_inv_insn_tag(unsigned long addr)
30
{
31
        __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
32
                             "r" (addr), "i" (ASI_M_TXTC_TAG));
33
}
34
 
35
extern inline void swift_inv_data_tag(unsigned long addr)
36
{
37
        __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
38
                             "r" (addr), "i" (ASI_M_DATAC_TAG));
39
}
40
 
41
extern inline void swift_flush_dcache(void)
42
{
43
        unsigned long addr;
44
 
45
        for(addr = 0; addr < (PAGE_SIZE << 2); addr += 16)
46
                swift_inv_data_tag(addr);
47
}
48
 
49
extern inline void swift_flush_icache(void)
50
{
51
        unsigned long addr;
52
 
53
        for(addr = 0; addr < (PAGE_SIZE << 2); addr += 16)
54
                swift_inv_insn_tag(addr);
55
}
56
 
57
extern inline void swift_idflash_clear(void)
58
{
59
        unsigned long addr;
60
 
61
        for(addr = 0; addr < (PAGE_SIZE << 2); addr += 16) {
62
                swift_inv_insn_tag(addr);
63
                swift_inv_data_tag(addr);
64
        }
65
}
66
 
67
/* Swift is so broken, it isn't even safe to use the following. */
68
extern inline void swift_flush_page(unsigned long page)
69
{
70
        __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
71
                             "r" (page), "i" (ASI_M_FLUSH_PAGE));
72
}
73
 
74
extern inline void swift_flush_segment(unsigned long addr)
75
{
76
        __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
77
                             "r" (addr), "i" (ASI_M_FLUSH_SEG));
78
}
79
 
80
extern inline void swift_flush_region(unsigned long addr)
81
{
82
        __asm__ __volatile__("sta %%g0, [%0] %1\n\t" : :
83
                             "r" (addr), "i" (ASI_M_FLUSH_REGION));
84
}
85
 
86
extern inline void swift_flush_context(void)
87
{
88
        __asm__ __volatile__("sta %%g0, [%%g0] %0\n\t" : :
89
                             "i" (ASI_M_FLUSH_CTX));
90
}
91
 
92
#endif /* !(_SPARC_SWIFT_H) */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.