From c645a5aac4c2af002c7748524fbe1f51a64e2300 Mon Sep 17 00:00:00 2001 From: Tristan Shieh Date: Wed, 4 Jul 2018 13:37:39 +0800 Subject: mediatek: Share MMU operation code among similar SOCs Refactor MMU operation code which will be reused among similar SOCs. BUG=b:80501386 BRANCH=none TEST=Boots correctly on Elm Change-Id: Id8173da0a02e57e863263fcd89c91a9c089e8a0f Signed-off-by: Tristan Shieh Reviewed-on: https://review.coreboot.org/27349 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- .../mediatek/mt8173/include/soc/mmu_operations.h | 39 ---------------------- src/soc/mediatek/mt8173/include/soc/symbols.h | 23 +++++++++++++ 2 files changed, 23 insertions(+), 39 deletions(-) delete mode 100644 src/soc/mediatek/mt8173/include/soc/mmu_operations.h create mode 100644 src/soc/mediatek/mt8173/include/soc/symbols.h (limited to 'src/soc/mediatek/mt8173/include') diff --git a/src/soc/mediatek/mt8173/include/soc/mmu_operations.h b/src/soc/mediatek/mt8173/include/soc/mmu_operations.h deleted file mode 100644 index 2428c4280c..0000000000 --- a/src/soc/mediatek/mt8173/include/soc/mmu_operations.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This file is part of the coreboot project. - * - * Copyright 2015 MediaTek Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#ifndef __SOC_MEDIATEK_MT8173_MMU_OPERATIONS_H__ -#define __SOC_MEDIATEK_MT8173_MMU_OPERATIONS_H__ - -#include - -enum { - DEV_MEM = MA_DEV | MA_S | MA_RW, - CACHED_MEM = MA_MEM | MA_NS | MA_RW, - SECURE_MEM = MA_MEM | MA_S | MA_RW, - UNCACHED_MEM = MA_MEM | MA_NS | MA_RW | MA_MEM_NC, -}; - -extern unsigned char _sram_l2c[]; -extern unsigned char _esram_l2c[]; -#define _sram_l2c_size (_esram_l2c - _sram_l2c) - -extern unsigned char _dram_dma[]; -extern unsigned char _edram_dma[]; -#define _dram_dma_size (_edram_dma - _dram_dma) - -void mt8173_mmu_init(void); -void mt8173_mmu_after_dram(void); - -#endif //__SOC_MEDIATEK_MT8173_MMU_OPERATIONS_H__ diff --git a/src/soc/mediatek/mt8173/include/soc/symbols.h b/src/soc/mediatek/mt8173/include/soc/symbols.h new file mode 100644 index 0000000000..8e2d0a4fb3 --- /dev/null +++ b/src/soc/mediatek/mt8173/include/soc/symbols.h @@ -0,0 +1,23 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2018 MediaTek Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#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) + +#endif -- cgit v1.2.3