void __init tlb_init(void) { unsigned int config = read_c0_config(); unsigned long status; probe_tlb(config); status = read_c0_status(); status &= ~(ST0_UPS | ST0_KPS); #ifdef CONFIG_PAGE_SIZE_4KB status |= (TFP_PAGESIZE_4K << 32) | (TFP_PAGESIZE_4K << 36); #elif defined(CONFIG_PAGE_SIZE_8KB) status |= (TFP_PAGESIZE_8K << 32) | (TFP_PAGESIZE_8K << 36); #elif defined(CONFIG_PAGE_SIZE_16KB) status |= (TFP_PAGESIZE_16K << 32) | (TFP_PAGESIZE_16K << 36); #elif defined(CONFIG_PAGE_SIZE_64KB) status |= (TFP_PAGESIZE_64K << 32) | (TFP_PAGESIZE_64K << 36); #endif write_c0_status(status); write_c0_wired(0); local_flush_tlb_all(); memcpy((void *)(CKSEG0 + 0x00), &except_vec0_generic, 0x80); memcpy((void *)(CKSEG0 + 0x80), except_vec1_r8k, 0x80); flush_icache_range(CKSEG0 + 0x80, CKSEG0 + 0x100); }
void tlb_init(void) { unsigned int config = read_c0_config(); unsigned long status; probe_tlb(config); status = read_c0_status(); status &= ~(ST0_UPS | ST0_KPS); #ifdef CONFIG_PAGE_SIZE_4KB status |= (TFP_PAGESIZE_4K << 32) | (TFP_PAGESIZE_4K << 36); #elif defined(CONFIG_PAGE_SIZE_8KB) status |= (TFP_PAGESIZE_8K << 32) | (TFP_PAGESIZE_8K << 36); #elif defined(CONFIG_PAGE_SIZE_16KB) status |= (TFP_PAGESIZE_16K << 32) | (TFP_PAGESIZE_16K << 36); #elif defined(CONFIG_PAGE_SIZE_64KB) status |= (TFP_PAGESIZE_64K << 32) | (TFP_PAGESIZE_64K << 36); #endif write_c0_status(status); write_c0_wired(0); local_flush_tlb_all(); build_tlb_refill_handler(); }