@@ -49,7 +49,7 @@ efi_status_t efi_boot_kernel(void *handle, efi_loaded_image_t *image,
struct exit_boot_struct priv;
unsigned long desc_size;
efi_status_t status;
- u32 desc_ver;
+ u32 desc_ver, val;
status = efi_alloc_virtmap(&priv.runtime_map, &desc_size, &desc_ver);
if (status != EFI_SUCCESS) {
@@ -69,6 +69,12 @@ efi_status_t efi_boot_kernel(void *handle, efi_loaded_image_t *image,
priv.runtime_entry_count * desc_size, desc_size,
desc_ver, priv.runtime_map);
+ /* Change address translation mode */
+ val = csr_read32(LOONGARCH_CSR_CRMD);
+ val &= ~CSR_CRMD_DA;
+ val |= CSR_CRMD_PG;
+ csr_write32(val, LOONGARCH_CSR_CRMD);
+
/* Config Direct Mapping */
csr_write64(CSR_DMW0_INIT, LOONGARCH_CSR_DMWIN0);
csr_write64(CSR_DMW1_INIT, LOONGARCH_CSR_DMWIN1);