From 381a1cd9da3b4c98660257c54e4ab6e7997e1472 Mon Sep 17 00:00:00 2001 From: Raphael Roth Date: Thu, 28 Nov 2024 15:22:20 +0100 Subject: [PATCH] WIP small changes to test stuff out --- Bender.lock | 2 +- hw/cheshire_idma_wrap.sv | 2 +- sw/include/dif/dma.h | 6 +++--- sw/tests/smmu_test.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Bender.lock b/Bender.lock index 94d44a95..cdc4ee08 100644 --- a/Bender.lock +++ b/Bender.lock @@ -131,7 +131,7 @@ packages: dependencies: - common_cells idma: - revision: 85c45ac5d6dde9d3a93e47c5e44f25b5a1d34790 + revision: 864e6af3155c99ea616121645546df40d872b718 version: null source: Git: https://github.com/pulp-platform/iDMA.git diff --git a/hw/cheshire_idma_wrap.sv b/hw/cheshire_idma_wrap.sv index 4a265562..ee5bd6fe 100644 --- a/hw/cheshire_idma_wrap.sv +++ b/hw/cheshire_idma_wrap.sv @@ -343,7 +343,7 @@ module cheshire_idma_wrap #( localparam int unsigned sMMU_FillPolicyTLB = 1; // localparam int unsigned sMMU_ReplacementPolicyTLB = 1; - `SMMU_TYPEDEF_GEN_SV57(va_t, pa_t, pte_t) + `SMMU_TYPEDEF_GEN_SV48(va_t, pa_t, pte_t) `SMMU_TYPEDEF_GEN_DEFAULT(va_t, pa_t, options_t, sMMU_StreamIDSize, sMMU_MaxByteTransferWidth, sMMU_MaxPageTransferWidth, sMMU_PageSize) /* Variable */ diff --git a/sw/include/dif/dma.h b/sw/include/dif/dma.h index a84bee94..8298cbb8 100644 --- a/sw/include/dif/dma.h +++ b/sw/include/dif/dma.h @@ -137,12 +137,12 @@ } \ \ inline void NAME##_dma_smmu_config(uint64_t exe, uint64_t bare, uint64_t update_tlb, uint64_t user){ \ - *(NAME##_dma_smmu_conf_ptr()) = ((update_tlb & 1) << 3) + ((bare & 1) << 2) + ((user & 1) << 1) + (exe & 1); \ + *(NAME##_dma_smmu_conf_ptr()) = ((update_tlb & 1) << IDMA_REG64_2D_SMMU_F_UPDATE_TLB_BIT) | ((bare & 1) << IDMA_REG64_2D_SMMU_F_BARE_BIT) | ((user & 1) << IDMA_REG64_2D_SMMU_F_USER_BIT) | ((exe & 1) << IDMA_REG64_2D_SMMU_F_EXE_BIT); \ } \ \ inline void NAME##_dma_smmu_set_pt_root(uint64_t root_adr){ \ - *(NAME##_dma_smmu_pt_root_high_ptr()) = (uint32_t) ((root_adr >> 32) & 0x00000000FFFFFFFF); \ - *(NAME##_dma_smmu_pt_root_low_ptr()) = (uint32_t) (root_adr & 0x00000000FFFFFFFF); \ + *(NAME##_dma_smmu_pt_root_high_ptr()) = (uint64_t) ((root_adr >> 32) & 0x00000000FFFFFFFF); \ + *(NAME##_dma_smmu_pt_root_low_ptr()) = (uint64_t) (root_adr & 0x00000000FFFFFFFF); \ } \ \ inline uint64_t NAME##_dma_get_status(void) { \ diff --git a/sw/tests/smmu_test.c b/sw/tests/smmu_test.c index 17a51fcb..fbd75f4e 100644 --- a/sw/tests/smmu_test.c +++ b/sw/tests/smmu_test.c @@ -50,7 +50,7 @@ int main(void) { sys_dma_memcpy((uintptr_t)(void *)dst, (uintptr_t)(void *)src, sizeof(src_cached)); // Write Destination Adress - uart_write_str(&__base_uart, dst, sizeof(dst)); + uart_write_str(&__base_uart, dst, sizeof(dst_cached)); uart_write_flush(&__base_uart); // Write the end Message