From e2b35750099bc328f0535cd27a0290c748dfe407 Mon Sep 17 00:00:00 2001 From: junmin kim Date: Wed, 30 Aug 2017 04:16:05 -0700 Subject: [PATCH] Add qemu patch and update qemu README.md qemu-2.10.0-rc2_increase_ram_size.patch is needed for using ram-increased lm3s6965evb Without this patch, user can use only original lm3s6965evb(64KB ram) --- build/configs/qemu/README.md | 5 +- .../qemu/qemu-2.10.0-rc2_increase_ram_size.patch | 80 ++++++++++++++++++++++ 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 build/configs/qemu/qemu-2.10.0-rc2_increase_ram_size.patch diff --git a/build/configs/qemu/README.md b/build/configs/qemu/README.md index 71986ba..2483c81 100644 --- a/build/configs/qemu/README.md +++ b/build/configs/qemu/README.md @@ -13,9 +13,12 @@ QEMU uses lm3s6963-ek machine. wget http://download.qemu-project.org/qemu-2.10.0-rc2.tar.xz tar xvJf qemu-2.10.0-rc2.tar.xz cd qemu-2.10.0-rc2 +/* Copy qemu-2.10.0-rc2_increase_ram_size.patch from TizenRT/build/configs/qemu */ +patch -p1 < qemu-2.10.0-rc2_increase_ram_size.patch ./configure --target-list=arm-softmmu make -j 4 -Check executable in "arm-softmmu/qemu-system-arm" +cd arm-softmmu/ +sudo ln qemu-system-arm /usr/local/bin/qemu-system-arm ``` ## How to program a binary diff --git a/build/configs/qemu/qemu-2.10.0-rc2_increase_ram_size.patch b/build/configs/qemu/qemu-2.10.0-rc2_increase_ram_size.patch new file mode 100644 index 0000000..f23966f --- /dev/null +++ b/build/configs/qemu/qemu-2.10.0-rc2_increase_ram_size.patch @@ -0,0 +1,80 @@ +From a9f770243ccb354e99b9ff33ecfecbeca73b1b03 Mon Sep 17 00:00:00 2001 +From: Manohara HK +Date: Mon, 20 Mar 2017 19:13:02 +0530 +Subject: [PATCH v2] arm : stellaris : Increase sram and flash size and support + sdram + +This patch increase's the sram and flash size of stellaris lm3s6965 board. +It also adds a sdram of 512MB to the board. + +Signed-off-by: Manohara HK +Signed-off-by: pradeep.ns +--- + hw/arm/stellaris.c | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c +index 408c1a1..6c44158 100644 +--- a/hw/arm/stellaris.c ++++ b/hw/arm/stellaris.c +@@ -55,6 +55,15 @@ typedef const struct { + #define STELLARIS_GPTM(obj) \ + OBJECT_CHECK(gptm_state, (obj), TYPE_STELLARIS_GPTM) + ++#define INCREASE_SRAM_FLASH 1 /*Increase the SRAM and FLASH to its Max Size Possible*/ ++#define SUPPORT_SDARAM 1 /*Add a sdram @cortexm3 default extranal RAM map */ ++ ++ ++#if defined(SUPPORT_SDARAM) ++#define CORTEXM3_SDRAM_SIZE (512 * 1024 * 1024) ++#define CORTEXM3_SDRAM_ADDR (0x60000000) ++#endif ++ + typedef struct gptm_state { + SysBusDevice parent_obj; + +@@ -1216,7 +1225,11 @@ static stellaris_board_info stellaris_boards[] = { + { "LM3S6965EVB", + 0x10010002, + 0x1073402e, ++#if defined(INCREASE_SRAM_FLASH) ++ 0xffffffff, /* dc0 : flash(128M) sram(16M) */ ++#else + 0x00ff007f, /* dc0 */ ++#endif + 0x001133ff, + 0x030f5317, + 0x0f0f87ff, +@@ -1282,6 +1295,9 @@ static void stellaris_init(const char *kernel_filename, const char *cpu_model, + + MemoryRegion *sram = g_new(MemoryRegion, 1); + MemoryRegion *flash = g_new(MemoryRegion, 1); ++#if defined(SUPPORT_SDARAM) ++ MemoryRegion *sdram = g_new(MemoryRegion, 1); ++#endif + MemoryRegion *system_memory = get_system_memory(); + + flash_size = (((board->dc0 & 0xffff) + 1) << 1) * 1024; +@@ -1297,6 +1313,19 @@ static void stellaris_init(const char *kernel_filename, const char *cpu_model, + &error_fatal); + memory_region_add_subregion(system_memory, 0x20000000, sram); + ++#if defined(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, + kernel_filename, cpu_model); + +-- +1.9.1 + -- 2.7.4