Changeset 0cfc4d38 in mainline
- Timestamp:
- 2005-12-14T01:52:19Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 38282c0
- Parents:
- 8ad925c
- Location:
- arch/sparc64
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/sparc64/Makefile.inc
r8ad925c r0cfc4d38 57 57 arch/$(ARCH)/src/sparc64.c \ 58 58 arch/$(ARCH)/src/start.S \ 59 arch/$(ARCH)/src/trap_table.S 59 arch/$(ARCH)/src/trap_table.S \ 60 arch/$(ARCH)/src/trap.c -
arch/sparc64/include/mm/frame.h
r8ad925c r0cfc4d38 30 30 #define __sparc64_FRAME_H__ 31 31 32 #include <arch/types.h> 33 32 34 #define FRAME_SIZE 8192 35 36 union frame_address { 37 __address address; 38 struct { 39 unsigned : 23; 40 __u64 pfn : 28; /**< Physical Frame Number. */ 41 unsigned offset : 13; /**< Offset. */ 42 } __attribute__ ((packed)); 43 }; 44 45 typedef union frame_address frame_address_t; 33 46 34 47 extern void frame_arch_init(void); -
arch/sparc64/include/mm/tlb.h
r8ad925c r0cfc4d38 31 31 32 32 #include <arch/mm/tte.h> 33 #include <arch/mm/mmu.h> 33 34 #include <arch/mm/page.h> 34 35 #include <arch/asm.h> … … 40 41 #define DTLB_ENTRY_COUNT 64 41 42 42 /** I-MMU ASIs. */ 43 #define ASI_IMMU 0x50 44 #define ASI_IMMU_TSB_8KB_PTR_REG 0x51 45 #define ASI_IMMU_TSB_64KB_PTR_REG 0x52 46 #define ASI_ITLB_DATA_IN_REG 0x54 47 #define ASI_ITLB_DATA_ACCESS_REG 0x55 48 #define ASI_ITLB_TAG_READ_REG 0x56 49 #define ASI_IMMU_DEMAP 0x57 50 51 /** Virtual Addresses within ASI_IMMU. */ 52 #define VA_IMMU_TAG_TARGET 0x0 /**< IMMU tag target register. */ 53 #define VA_IMMU_SFSR 0x18 /**< IMMU sync fault status register. */ 54 #define VA_IMMU_TSB_BASE 0x28 /**< IMMU TSB base register. */ 55 #define VA_IMMU_TAG_ACCESS 0x30 /**< IMMU TLB tag access register. */ 56 57 /** D-MMU ASIs. */ 58 #define ASI_DMMU 0x58 59 #define ASI_DMMU_TSB_8KB_PTR_REG 0x59 60 #define ASI_DMMU_TSB_64KB_PTR_REG 0x5a 61 #define ASI_DMMU_TSB_DIRECT_PTR_REG 0x5b 62 #define ASI_DTLB_DATA_IN_REG 0x5c 63 #define ASI_DTLB_DATA_ACCESS_REG 0x5d 64 #define ASI_DTLB_TAG_READ_REG 0x5e 65 #define ASI_DMMU_DEMAP 0x5f 66 67 /** Virtual Addresses within ASI_DMMU. */ 68 #define VA_DMMU_TAG_TARGET 0x0 /**< DMMU tag target register. */ 69 #define VA_PRIMARY_CONTEXT_REG 0x8 /**< DMMU primary context register. */ 70 #define VA_SECONDARY_CONTEXT_REG 0x10 /**< DMMU secondary context register. */ 71 #define VA_DMMU_SFSR 0x18 /**< DMMU sync fault status register. */ 72 #define VA_DMMU_SFAR 0x20 /**< DMMU sync fault address register. */ 73 #define VA_DMMU_TSB_BASE 0x28 /**< DMMU TSB base register. */ 74 #define VA_DMMU_TAG_ACCESS 0x30 /**< DMMU TLB tag access register. */ 75 #define VA_DMMU_VA_WATCHPOINT_REG 0x38 /**< DMMU VA data watchpoint register. */ 76 #define VA_DMMU_PA_WATCHPOINT_REG 0x40 /**< DMMU PA data watchpoint register. */ 43 /** Page sizes. */ 44 #define PAGESIZE_8K 0 45 #define PAGESIZE_64K 1 46 #define PAGESIZE_512K 2 47 #define PAGESIZE_4M 3 77 48 78 49 /** I-/D-TLB Data In/Access Register type. */ -
arch/sparc64/src/mm/tlb.c
r8ad925c r0cfc4d38 29 29 #include <arch/mm/tlb.h> 30 30 #include <mm/tlb.h> 31 #include <arch/mm/frame.h> 32 #include <arch/mm/page.h> 33 #include <arch/mm/mmu.h> 31 34 #include <print.h> 32 35 #include <arch/types.h> 33 36 #include <typedefs.h> 37 #include <config.h> 34 38 39 /** Initialize ITLB and DTLB. 40 * 41 * The goal of this function is to disable MMU 42 * so that both TLBs can be purged and new 43 * kernel 4M locked entry can be installed. 44 * After TLB is initialized, MMU is enabled 45 * again. 46 */ 35 47 void tlb_arch_init(void) 36 48 { 49 tlb_tag_access_reg_t tag; 50 tlb_data_t data; 51 frame_address_t fr; 52 page_address_t pg; 53 54 fr.address = config.base; 55 pg.address = config.base; 56 57 immu_disable(); 58 dmmu_disable(); 59 60 /* 61 * For simplicity, we do identity mapping of first 4M of memory. 62 * The very next change should be leaving the first 4M unmapped. 63 */ 64 tag.value = 0; 65 tag.vpn = pg.vpn; 66 67 itlb_tag_access_write(tag.value); 68 dtlb_tag_access_write(tag.value); 69 70 data.value = 0; 71 data.v = true; 72 data.size = PAGESIZE_4M; 73 data.pfn = fr.pfn; 74 data.l = true; 75 data.cp = 1; 76 data.cv = 1; 77 data.p = true; 78 data.w = true; 79 data.g = true; 80 81 itlb_data_in_write(data.value); 82 dtlb_data_in_write(data.value); 83 84 tlb_invalidate_all(); 85 86 dmmu_enable(); 87 immu_enable(); 37 88 } 38 89 … … 74 125 d.value = itlb_data_access_read(i); 75 126 if (!d.l) { 76 printf("invalidating ");77 127 t.value = itlb_tag_read_read(i); 78 128 d.v = false; -
arch/sparc64/src/sparc64.c
r8ad925c r0cfc4d38 29 29 #include <arch.h> 30 30 #include <print.h> 31 #include <arch/asm.h> 32 #include <memstr.h> 31 #include <arch/trap.h> 33 32 #include <arch/trap_table.h> 34 33 #include <arch/console.h> … … 45 44 void arch_pre_smp_init(void) 46 45 { 47 /* 48 * Copy OFW's trap table into kernel and point TBA there. 49 */ 50 memcpy((void *) trap_table, (void *) tba_read(), TRAP_TABLE_SIZE); 51 /* 52 * TBA cannot be changed until there are means of getting it into TLB. 53 * tba_write((__u64) trap_table); 54 */ 46 trap_init(); 55 47 } 56 48
Note:
See TracChangeset
for help on using the changeset viewer.