I have been studying ecos for a while, so I had the idea of porting ecos to the qemu platform of mini2440. After a few days of hard work, I can finally see the redboot command on qemu.
Take a look at the results first, then enter the boring coding process
Now let's look at the code. :-)
1. Get the code
git clone git://repo.or.cz/qemu/mini2440.git qemu
Modify the startup part to start directly from the minimum address of RAM
-
ricky@ricky-laptop:~/ecos/projects/mini2440-qemu/mini2440$ git diff
-
diff --git a/hw/mini2440.c b/hw/mini2440.c
-
index 5decf4b..7a70aae 100644
-
--- a/hw/mini2440.c
-
+++ b/hw/mini2440.c
-
@@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)
-
struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;
-
uint32_t image_size;
-
-
- /*
-
- * Normally we would load 4 KB of nand to SRAM and jump there, but
-
- * it is not working perfectly as expected, so we cheat and load
-
- * it from nand directly relocated to 0x33f80000 and jump there
-
- */
-
- if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1
-
- mini2440_printf("loaded default u-boot from NAND/n");
-
- s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start addr
-
- }
-
-#if 0 && defined(LATER)
-
- if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM
-
- s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT; /* start address
-
- mini2440_printf("4KB SteppingStone loaded from NAND/n");
-
- }
-
-#endif
-
:
-
diff --git a/hw/mini2440.c b/hw/mini2440.c
-
index 5decf4b..7a70aae 100644
-
--- a/hw/mini2440.c
-
+++ b/hw/mini2440.c
-
@@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)
-
struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;
-
uint32_t image_size;
-
-
- /*
-
- * Normally we would load 4 KB of nand to SRAM and jump there, but
-
- * it is not working perfectly as expected, so we cheat and load
-
- * it from nand directly relocated to 0x33f80000 and jump there
-
- */
-
- if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*10
-
- mini2440_printf("loaded default u-boot from NAND/n");
-
- s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start addre
-
- }
-
-#if 0 && defined(LATER)
-
- if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_
-
- s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT; /* start address,
-
- mini2440_printf("4KB SteppingStone loaded from NAND/n");
-
- }
-
-#endif
-
- /*
-
:
-
diff --git a/hw/mini2440.c b/hw/mini2440.c
-
index 5decf4b..7a70aae 100644
-
--- a/hw/mini2440.c
-
+++ b/hw/mini2440.c
-
@@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)
-
struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;
-
uint32_t image_size;
-
-
- /*
-
- * Normally we would load 4 KB of nand to SRAM and jump there, but
-
- * it is not working perfectly as expected, so we cheat and load
-
- * it from nand directly relocated to 0x33f80000 and jump there
-
- */
-
- if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*102
-
- mini2440_printf("loaded default u-boot from NAND/n");
-
- s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start addres
-
- }
-
-#if 0 && defined(LATER)
-
- if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_S
-
- s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT; /* start address,
-
- mini2440_printf("4KB SteppingStone loaded from NAND/n");
-
- }
-
-#endif
-
- /*
-
- * if a u--boot is available as a file, we always use it
-
:
-
diff --git a/hw/mini2440.c b/hw/mini2440.c
-
index 5decf4b..7a70aae 100644
-
--- a/hw/mini2440.c
-
+++ b/hw/mini2440.c
-
@@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)
-
struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;
-
uint32_t image_size;
-
-
- /*
-
- * Normally we would load 4 KB of nand to SRAM and jump there, but
-
- * it is not working perfectly as expected, so we cheat and load
-
- * it from nand directly relocated to 0x33f80000 and jump there
-
- */
-
- if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1024)>
-
- mini2440_printf("loaded default u-boot from NAND/n");
-
- s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address,
-
- }
-
-#if 0 && defined(LATER)
-
- if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_SIZE
-
- s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT; /* start address, u-b
-
- mini2440_printf("4KB SteppingStone loaded from NAND/n");
-
- }
-
-#endif
-
- /*
-
- * if a u--boot is available as a file, we always use it
-
- */
-
- {
-
- image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f8000
-
:
-
diff --git a/hw/mini2440.c b/hw/mini2440.c
-
index 5decf4b..7a70aae 100644
-
--- a/hw/mini2440.c
-
+++ b/hw/mini2440.c
-
@@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)
-
struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;
-
uint32_t image_size;
-
-
- /*
-
- * Normally we would load 4 KB of nand to SRAM and jump there, but
-
- * it is not working perfectly as expected, so we cheat and load
-
- * it from nand directly relocated to 0x33f80000 and jump there
-
- */
-
- if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1024)> 0)
-
- mini2440_printf("loaded default u-boot from NAND/n");
-
- s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address, u-b
-
- }
-
-#if 0 && defined(LATER)
-
- if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_SIZE) >
-
- s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT; /* start address, u-boot
-
- mini2440_printf("4KB SteppingStone loaded from NAND/n");
-
- }
-
-#endif
-
- /*
-
- * if a u--boot is available as a file, we always use it
-
- */
-
- {
-
- image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f80000))
-
- if (image_size < 0)
-
- image_size = load_image("u-boot.bin", qemu_get_ram_ptr(0x03f80000));
-
- if (image_size > 0) {
-
:
-
diff --git a/hw/mini2440.c b/hw/mini2440.c
-
index 5decf4b..7a70aae 100644
-
--- a/hw/mini2440.c
-
+++ b/hw/mini2440.c
-
@@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)
-
struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;
-
uint32_t image_size;
-
-
- /*
-
- * Normally we would load 4 KB of nand to SRAM and jump there, but
-
- * it is not working perfectly as expected, so we cheat and load
-
- * it from nand directly relocated to 0x33f80000 and jump there
-
- */
-
- if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1024)> 0) {
-
- mini2440_printf("loaded default u-boot from NAND/n");
-
- s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address, u-boot
-
- }
-
-#if 0 && defined(LATER)
-
- if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_SIZE) > 0)
-
- s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT; /* start address, u-boot rel
-
- mini2440_printf("4KB SteppingStone loaded from NAND/n");
-
- }
-
-#endif
-
- /*
-
- * if a u--boot is available as a file, we always use it
-
- */
-
- {
-
- image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f80000));
-
- if (image_size < 0)
-
- image_size = load_image("u-boot.bin", qemu_get_ram_ptr(0x03f80000));
-
- if (image_size > 0) {
-
- if (image_size & (512 -1)) /* round size to a NAND block size *
-
- image_size = (image_size + 512) & ~(512-1);
-
- mini2440_printf("loaded override u-boot (size %x)/n", image_size);
-
:
-
diff --git a/hw/mini2440.c b/hw/mini2440.c
-
index 5decf4b..7a70aae 100644
-
--- a/hw/mini2440.c
-
+++ b/hw/mini2440.c
-
@@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)
-
struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;
Previous article:ecos on QEMU for mini2440 compilation method
Next article:Porting minigui1.6 to mini2440
Recommended ReadingLatest update time:2024-11-17 03:09
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- Simulation and MCU source code of sawtooth wave generated by DAC0832
- Hardware and software design of wireless driving recorder based on MCU
- Watch the video and win a JD card | Tektronix Oscilloscope Video Learning Center is now online!
- Show off your prizes [Review of SGP40]
- Now that the galvanometer has been repaired, what can I DIY with it?
- Questions about CSL_CGEM
- How to improve the power of voltage doubler rectifier circuit
- Mesh Wi-Fi system enhances smart home applications and makes connectivity easy
- Good tools can make work more efficient: Keysight Technology promotion season is here!
- Introduction to the SIG852 arbitrary waveform generator based on computer software (similar to a virtual oscilloscope)