aboutsummaryrefslogtreecommitdiff
path: root/src/soc/mediatek/mt8173
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/mediatek/mt8173')
-rw-r--r--src/soc/mediatek/mt8173/flash_controller.c4
-rw-r--r--src/soc/mediatek/mt8173/include/soc/symbols.h4
-rw-r--r--src/soc/mediatek/mt8173/mmu_operations.c3
3 files changed, 5 insertions, 6 deletions
diff --git a/src/soc/mediatek/mt8173/flash_controller.c b/src/soc/mediatek/mt8173/flash_controller.c
index 0fe9bb4e57..d63b69c174 100644
--- a/src/soc/mediatek/mt8173/flash_controller.c
+++ b/src/soc/mediatek/mt8173/flash_controller.c
@@ -171,10 +171,10 @@ static int nor_read(const struct spi_flash *flash, u32 addr, size_t len,
if (ENV_BOOTBLOCK || ENV_VERSTAGE) {
dma_buf = (uintptr_t)_dma_coherent;
- dma_buf_len = _dma_coherent_size;
+ dma_buf_len = REGION_SIZE(dma_coherent);
} else {
dma_buf = (uintptr_t)_dram_dma;
- dma_buf_len = _dram_dma_size;
+ dma_buf_len = REGION_SIZE(dram_dma);
}
while (len - done >= SFLASH_DMA_ALIGN) {
diff --git a/src/soc/mediatek/mt8173/include/soc/symbols.h b/src/soc/mediatek/mt8173/include/soc/symbols.h
index 8e2d0a4fb3..85cfd789ff 100644
--- a/src/soc/mediatek/mt8173/include/soc/symbols.h
+++ b/src/soc/mediatek/mt8173/include/soc/symbols.h
@@ -16,8 +16,6 @@
#ifndef __SOC_MEDIATEK_MT8173_DRAM_DMA_H__
#define __SOC_MEDIATEK_MT8173_DRAM_DMA_H__
-extern unsigned char _dram_dma[];
-extern unsigned char _edram_dma[];
-#define _dram_dma_size (_edram_dma - _dram_dma)
+DECLARE_REGION(dram_dma)
#endif
diff --git a/src/soc/mediatek/mt8173/mmu_operations.c b/src/soc/mediatek/mt8173/mmu_operations.c
index 443bc6eb4d..c80226477a 100644
--- a/src/soc/mediatek/mt8173/mmu_operations.c
+++ b/src/soc/mediatek/mt8173/mmu_operations.c
@@ -23,7 +23,8 @@
void mtk_soc_after_dram(void)
{
- mmu_config_range(_dram_dma, _dram_dma_size, NONSECURE_UNCACHED_MEM);
+ mmu_config_range(_dram_dma, REGION_SIZE(dram_dma),
+ NONSECURE_UNCACHED_MEM);
mtk_mmu_disable_l2c_sram();
}