-
Notifications
You must be signed in to change notification settings - Fork 575
/
qemu-2.12.0-rc1_16m_ram_size.patch
92 lines (80 loc) · 3.19 KB
/
qemu-2.12.0-rc1_16m_ram_size.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
From ce82e5ad2fa1dbd6be2f69c7a894356807283d53 Mon Sep 17 00:00:00 2001
From: Manohara HK <[email protected]>
Date: Thu, 16 Aug 2018 22:55:46 +0530
Subject: [PATCH] hw/arm : stellaris : Increase sram and flash size and support
sdram
This patch increases the sram and flash size of stellaris lm3s6965 board.
It also adds a sdram of 512MB to the board.
Signed-off-by: Manohara HK <[email protected]>
Signed-off-by: pradeep.ns <[email protected]>
---
hw/arm/stellaris.c | 35 +++++++++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)
diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index de7c0fc..01783ba 100644
--- a/hw/arm/stellaris.c
+++ b/hw/arm/stellaris.c
@@ -56,6 +56,16 @@ typedef const struct {
#define STELLARIS_GPTM(obj) \
OBJECT_CHECK(gptm_state, (obj), TYPE_STELLARIS_GPTM)
+#define SRAM_16M_FLASH_128M 1 /*Increase the SRAM and FLASH to 16M and 128M*/
+#define SRAM_1M_FLASH_32M 0 /*Increase the SRAM and FLASH to 1M and 32M*/
+#define SUPPORT_SDARAM 1 /*Add a sdram @cortexm3 default extranal RAM map */
+
+
+#if SUPPORT_SDARAM
+#define CORTEXM3_SDRAM_SIZE (512 * 1024 * 1024)
+#define CORTEXM3_SDRAM_ADDR (0x60000000)
+#endif
+
typedef struct gptm_state {
SysBusDevice parent_obj;
@@ -1217,7 +1227,13 @@ static stellaris_board_info stellaris_boards[] = {
{ "LM3S6965EVB",
0x10010002,
0x1073402e,
+#if SRAM_16M_FLASH_128M
+ 0xffffffff, /* dc0 : flash(128M) sram(16M) */
+#elif SRAM_1M_FLASH_32M
+ 0x0fffffff, /* dc0 : flash(32M) sram(1M) */
+#else
0x00ff007f, /* dc0 */
+#endif
0x001133ff,
0x030f5317,
0x0f0f87ff,
@@ -1282,21 +1298,36 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board)
MemoryRegion *sram = g_new(MemoryRegion, 1);
MemoryRegion *flash = g_new(MemoryRegion, 1);
+#if SUPPORT_SDARAM
+ MemoryRegion *sdram = g_new(MemoryRegion, 1);
+#endif
MemoryRegion *system_memory = get_system_memory();
flash_size = (((board->dc0 & 0xffff) + 1) << 1) * 1024;
sram_size = ((board->dc0 >> 18) + 1) * 1024;
- /* Flash programming is done via the SCU, so pretend it is ROM. */
+ /* Flash is read/writable */
memory_region_init_ram(flash, NULL, "stellaris.flash", flash_size,
&error_fatal);
- memory_region_set_readonly(flash, true);
memory_region_add_subregion(system_memory, 0, flash);
memory_region_init_ram(sram, NULL, "stellaris.sram", sram_size,
&error_fatal);
memory_region_add_subregion(system_memory, 0x20000000, sram);
+#if SUPPORT_SDARAM
+ // Extranal RAM(SDRAM) of max CORTEXM3_SDRAM_SIZE @ CORTEXM3_SDRAM_ADDR
+ memory_region_init_ram(sdram, NULL, "stellaris.sdram", CORTEXM3_SDRAM_SIZE,
+ &error_fatal);
+
+ memory_region_add_subregion(system_memory, CORTEXM3_SDRAM_ADDR, sdram);
+ printf("%s : FLASH (B) = %d : SRAM (B) = %d : SDRAM (B) = %d\n",
+ board->name, flash_size, sram_size, CORTEXM3_SDRAM_SIZE);
+#else
+ printf("%s : FLASH (B) = %d : SRAM (B) = %d\n",
+ board->name, flash_size, sram_size);
+#endif
+
nvic = armv7m_init(system_memory, flash_size, NUM_IRQ_LINES,
ms->kernel_filename, ms->cpu_type);
--
1.9.1