Commit dadd1a34 authored by Andy Ross's avatar Andy Ross Committed by Henrik Brix Andersen
Browse files

soc/mediatek: Add second "DMA" memory region



The Linux SOF driver owns this space, but puts buffers here which the
DSP is expected to read and write.  Give it a space in the default MPU
mapping.

Note that this assumes that the DMA region is numerically above the
linkable DRAM region in the address space.  That's true for existing
devices, but likely to be broken in the future.

Signed-off-by: default avatarAndy Ross <andyross@google.com>
parent 481e2f2c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -19,6 +19,11 @@ extern char _mtk_adsp_dram_end[];
#define DRAM_SIZE  DT_REG_SIZE(DT_NODELABEL(dram0))
#define DRAM_END   (DRAM_START + DRAM_SIZE)

#define DMA_START DT_REG_ADDR(DT_NODELABEL(dram1))
#define DMA_SIZE  DT_REG_SIZE(DT_NODELABEL(dram1))
#define DMA_END   (DMA_START + DMA_SIZE)


#ifdef CONFIG_SOC_MT8196
#define INIT_STACK "0x90400000"
#define LOG_BASE   0x90580000
@@ -197,6 +202,8 @@ static void enable_mpu(void)
		{ DRAM_START, 0xf7f00 },          /* cached DRAM */
		{ (uint32_t)&_mtk_adsp_dram_end, 0x06f00 }, /* uncached DRAM */
		{ DRAM_END,   0x06000 },          /* inaccessible top of mem */
		{ DMA_START,  0x06f00 },          /* uncached host "DMA" area */
		{ DMA_END,    0x06000 },          /* inaccessible top of mem */
	};

	/* Must write BACKWARDS FROM THE END to avoid introducing a