summaryrefslogtreecommitdiff
path: root/common/include/asm
diff options
context:
space:
mode:
authorOlivier Dufour2012-11-15 09:37:07 +0100
committerOlivier Dufour2012-12-21 15:15:42 +0100
commitbc807e796ac3bbc095d47e28626bd9fe8518427c (patch)
treec592ebafbf205fd7429aec24d8e97cec505b9d5b /common/include/asm
parent3694e71021130534581ac1a40200fe9f1984eae4 (diff)
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.
Diffstat (limited to 'common/include/asm')
-rw-r--r--common/include/asm/arch/ips/hardware/bus_sys.h4
-rw-r--r--common/include/asm/arch/ips/sram.h37
2 files changed, 41 insertions, 0 deletions
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 <asm/arch/ips/ips_access.h>
+#include <asm/arch/ips/hardware/bus_sys.h>
+
+#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 */