From bc807e796ac3bbc095d47e28626bd9fe8518427c Mon Sep 17 00:00:00 2001 From: Olivier Dufour Date: Thu, 15 Nov 2012 09:37:07 +0100 Subject: cleo/linux/arch/arm/spc300: Add SRAM in MMU mapping, refs #2633 SRAM is remapped in virtual memory as an IO device. It enables access and code execution. --- common/include/asm/arch/ips/hardware/bus_sys.h | 4 +++ common/include/asm/arch/ips/sram.h | 37 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 common/include/asm/arch/ips/sram.h (limited to 'common/include/asm') diff --git a/common/include/asm/arch/ips/hardware/bus_sys.h b/common/include/asm/arch/ips/hardware/bus_sys.h index f9c7aa29c7..20cb68900d 100644 --- a/common/include/asm/arch/ips/hardware/bus_sys.h +++ b/common/include/asm/arch/ips/hardware/bus_sys.h @@ -73,4 +73,8 @@ #include "iomux.h" #endif +#ifdef CONFIG_CHIP_FEATURE_SRAM +#define SRAM_BASE (0x20000000) +#endif + #endif /* __ASM_ARCH_IPS_HW_BUS_SYS_H */ diff --git a/common/include/asm/arch/ips/sram.h b/common/include/asm/arch/ips/sram.h new file mode 100644 index 0000000000..b6297c834c --- /dev/null +++ b/common/include/asm/arch/ips/sram.h @@ -0,0 +1,37 @@ +/* + * include/asm/arch/ips/sram.h + * + * Copyright (C) 2012 MStar Semiconductor. + * + * 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef __ASM_ARCH_IPS_SRAM_H +#define __ASM_ARCH_IPS_SRAM_H + +#include +#include + +#define SRAM_DATA_OFFSET 0x1C00 +#define SRAM_SIZE 0x2000 +#define SRAM_CODE_SIZE SRAM_DATA_OFFSET +#define SRAM_DATA_SIZE (SRAM_SIZE - SRAM_CODE_SIZE) + +#ifndef __ASSEMBLY__ +/** Virtual Address for sram */ +#define SRAM_BASE_VA_PTR ((volatile uint32_t *)(IO_ADDRESS(SRAM_BASE))) +#define SRAM_DATA_BASE_VA_PTR ((volatile uint32_t *)(IO_ADDRESS(SRAM_BASE) + SRAM_DATA_OFFSET)) +#endif /* __ASSEMBLY__ */ + +#endif /* __ASM_ARCH_IPS_SRAM_H */ -- cgit v1.2.3