redboot on QEMU for mini2440

Publisher:EnchantedHeartLatest update time:2024-06-27 Source: elecfansKeywords:redboot  QEMU  for  mini2440 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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

  1. ricky@ricky-laptop:~/ecos/projects/mini2440-qemu/mini2440$ git diff

  2. diff --git a/hw/mini2440.c b/hw/mini2440.c

  3. index 5decf4b..7a70aae 100644

  4. --- a/hw/mini2440.c

  5. +++ b/hw/mini2440.c

  6. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)

  7. struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;

  8. uint32_t image_size;

  9. -       /*

  10. -        * Normally we would load 4 KB of nand to SRAM and jump there, but

  11. -        * it is not working perfectly as expected, so we cheat and load

  12. -        * it from nand directly relocated to 0x33f80000 and jump there

  13. -        */

  14. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1

  15. -               mini2440_printf("loaded default u-boot from NAND/n");

  16. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start addr

  17. -       }

  18. -#if 0 && defined(LATER)

  19. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM

  20. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address

  21. -           mini2440_printf("4KB SteppingStone loaded from NAND/n");

  22. -       }

  23. -#endif

  24. :

  25. diff --git a/hw/mini2440.c b/hw/mini2440.c

  26. index 5decf4b..7a70aae 100644

  27. --- a/hw/mini2440.c

  28. +++ b/hw/mini2440.c

  29. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)

  30. struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;

  31. uint32_t image_size;

  32. -       /*

  33. -        * Normally we would load 4 KB of nand to SRAM and jump there, but

  34. -        * it is not working perfectly as expected, so we cheat and load

  35. -        * it from nand directly relocated to 0x33f80000 and jump there

  36. -        */

  37. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*10

  38. -               mini2440_printf("loaded default u-boot from NAND/n");

  39. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start addre

  40. -       }

  41. -#if 0 && defined(LATER)

  42. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_

  43. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address,

  44. -           mini2440_printf("4KB SteppingStone loaded from NAND/n");

  45. -       }

  46. -#endif

  47. -       /*

  48. :

  49. diff --git a/hw/mini2440.c b/hw/mini2440.c

  50. index 5decf4b..7a70aae 100644

  51. --- a/hw/mini2440.c

  52. +++ b/hw/mini2440.c

  53. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)

  54. struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;

  55. uint32_t image_size;

  56. -       /*

  57. -        * Normally we would load 4 KB of nand to SRAM and jump there, but

  58. -        * it is not working perfectly as expected, so we cheat and load

  59. -        * it from nand directly relocated to 0x33f80000 and jump there

  60. -        */

  61. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*102

  62. -               mini2440_printf("loaded default u-boot from NAND/n");

  63. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start addres

  64. -       }

  65. -#if 0 && defined(LATER)

  66. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_S

  67. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address,

  68. -           mini2440_printf("4KB SteppingStone loaded from NAND/n");

  69. -       }

  70. -#endif

  71. -       /*

  72. -        * if a u--boot is available as a file, we always use it

  73. :

  74. diff --git a/hw/mini2440.c b/hw/mini2440.c

  75. index 5decf4b..7a70aae 100644

  76. --- a/hw/mini2440.c

  77. +++ b/hw/mini2440.c

  78. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)

  79. struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;

  80. uint32_t image_size;

  81. -       /*

  82. -        * Normally we would load 4 KB of nand to SRAM and jump there, but

  83. -        * it is not working perfectly as expected, so we cheat and load

  84. -        * it from nand directly relocated to 0x33f80000 and jump there

  85. -        */

  86. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1024)>

  87. -               mini2440_printf("loaded default u-boot from NAND/n");

  88. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address,

  89. -       }

  90. -#if 0 && defined(LATER)

  91. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_SIZE

  92. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address, u-b

  93. -           mini2440_printf("4KB SteppingStone loaded from NAND/n");

  94. -       }

  95. -#endif

  96. -       /*

  97. -        * if a u--boot is available as a file, we always use it

  98. -        */

  99. -       {

  100. -           image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f8000

  101. :

  102. diff --git a/hw/mini2440.c b/hw/mini2440.c

  103. index 5decf4b..7a70aae 100644

  104. --- a/hw/mini2440.c

  105. +++ b/hw/mini2440.c

  106. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)

  107. struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;

  108. uint32_t image_size;

  109. -       /*

  110. -        * Normally we would load 4 KB of nand to SRAM and jump there, but

  111. -        * it is not working perfectly as expected, so we cheat and load

  112. -        * it from nand directly relocated to 0x33f80000 and jump there

  113. -        */

  114. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1024)> 0)

  115. -               mini2440_printf("loaded default u-boot from NAND/n");

  116. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address, u-b

  117. -       }

  118. -#if 0 && defined(LATER)

  119. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_SIZE) >

  120. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address, u-boot

  121. -           mini2440_printf("4KB SteppingStone loaded from NAND/n");

  122. -       }

  123. -#endif

  124. -       /*

  125. -        * if a u--boot is available as a file, we always use it

  126. -        */

  127. -       {

  128. -           image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f80000))

  129. -           if (image_size < 0)

  130. -                   image_size = load_image("u-boot.bin", qemu_get_ram_ptr(0x03f80000));

  131. -               if (image_size > 0) {

  132. :

  133. diff --git a/hw/mini2440.c b/hw/mini2440.c

  134. index 5decf4b..7a70aae 100644

  135. --- a/hw/mini2440.c

  136. +++ b/hw/mini2440.c

  137. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)

  138. struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;

  139. uint32_t image_size;

  140. -       /*

  141. -        * Normally we would load 4 KB of nand to SRAM and jump there, but

  142. -        * it is not working perfectly as expected, so we cheat and load

  143. -        * it from nand directly relocated to 0x33f80000 and jump there

  144. -        */

  145. -       if (mini2440_load_from_nand(s->nand, 0, S3C_RAM_BASE | 0x03f80000, 256*1024)> 0) {

  146. -               mini2440_printf("loaded default u-boot from NAND/n");

  147. -               s->cpu->env->regs[15] = S3C_RAM_BASE | 0x03f80000; /* start address, u-boot

  148. -       }

  149. -#if 0 && defined(LATER)

  150. -       if (mini2440_load_from_nand(s->nand, 0, S3C_SRAM_BASE_NANDBOOT, S3C_SRAM_SIZE) > 0)

  151. -           s->cpu->env->regs[15] = S3C_SRAM_BASE_NANDBOOT;     /* start address, u-boot rel

  152. -           mini2440_printf("4KB SteppingStone loaded from NAND/n");

  153. -       }

  154. -#endif

  155. -       /*

  156. -        * if a u--boot is available as a file, we always use it

  157. -        */

  158. -       {

  159. -           image_size = load_image("mini2440/u-boot.bin", qemu_get_ram_ptr(0x03f80000));

  160. -           if (image_size < 0)

  161. -                   image_size = load_image("u-boot.bin", qemu_get_ram_ptr(0x03f80000));

  162. -               if (image_size > 0) {

  163. -                       if (image_size & (512 -1))      /* round size to a NAND block size *

  164. -                               image_size = (image_size + 512) & ~(512-1);

  165. -                       mini2440_printf("loaded override u-boot (size %x)/n", image_size);

  166. :

  167. diff --git a/hw/mini2440.c b/hw/mini2440.c

  168. index 5decf4b..7a70aae 100644

  169. --- a/hw/mini2440.c

  170. +++ b/hw/mini2440.c

  171. @@ -258,46 +258,15 @@ static void mini2440_reset(void *opaque)

  172. struct mini2440_board_s *s = (struct mini2440_board_s *) opaque;

[1] [2] [3] [4]
Keywords:redboot  QEMU  for  mini2440 Reference address:redboot on QEMU for mini2440

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

Digi-Key's Tony Ng talks about how small-volume distributors can get closer to their customers
Digi-Key, a world-renowned electronic component distributor, recently participated in the Munich Electronics Show in Shanghai. During the exhibition, Tony Ng, Digi-Key's vice president of global sales, accepted an exclusive interview with EEWORLD and gave a multi-angle interpretation of Digi-Key's future plans. Among
[Semiconductor design/manufacturing]
Digi-Key's Tony Ng talks about how small-volume distributors can get closer to their customers
Intel launches oneAPI 2023 toolkit to dramatically increase the value of upcoming Intel hardware
Intel launches oneAPI 2023 toolkit to dramatically increase the value of upcoming Intel hardware New Intel Tool Capabilities Boost Cross-Platform Productivity Today, Intel announced that the 2023 version of the Intel® oneAPI toolkit is now available on the Intel® Developer Cloud and is
[Network Communication]
Intel launches oneAPI 2023 toolkit to dramatically increase the value of upcoming Intel hardware
Razer Phone 2 new version: more storage and THX audio support
A new version of the Razer Phone 2 has been revealed and it's quite different from the original Razer Phone 2. It may be called the Razer Phone 2.5. The Razer Phone 2 is an incremental upgrade to Razer's first attempt at making a smartphone after it acquired startup Nextbit. It has a 120Hz refresh rate screen, 64GB or
[Mobile phone portable]
Which iPhone 12 series is suitable to buy?
The iPhone 12 series has been released. It includes four mobile phones including iPhone 12 mini, iPhone 12, iPhone 12 Pro, and iPhone 12 Pro Max. So which one should consumers buy? Regarding this issue, Li Nan, former senior vice president of Meizu and current founder of Angry Miao, shared his views on Weibo. Li Nan
[Mobile phone portable]
Apple says iPhone 12 Mini's MagSafe charging power is limited
In a recently updated support document, Apple said that its new MagSafe charger will be limited to 12W peak power delivery when used with the upcoming iPhone 12 mini, while all other iPhone 12 models will be limited to 15W peak power. Apple said that this 12W peak can be achieved if a USB-C PD power adapter is used wi
[Mobile phone portable]
Apple says iPhone 12 Mini's MagSafe charging power is limited
Dalian Pinjia Group launches smart door lock solution based on Infineon products
Dalian Pinjia Group launches smart door lock solution based on Infineon products On February 1, 2023, Dalianda Holdings, a leading semiconductor component distributor committed to the Asia-Pacific market, announced that its subsidiary Pinjia launched smart doors based on Infineon CY8C6347BZI-BLD53 and CY8C4024LQI-S4
[Internet of Things]
Dalian Pinjia Group launches smart door lock solution based on Infineon products
Mini2440 Hardware - UART
Universal Asynchronous Receiver/Transmitter (UART), commonly known as UART, is an asynchronous receiver/transmitter. UART transmits data in full-duplex mode. The simplest connection has only two wires, TxD for sending, RxD for receiving, and Gnd for ground. UART uses standard TTL level (0~3.3V or 0~5V) to indicate hig
[Microcontroller]
Mini2440 Hardware - UART
mini2440----keil for AMR IIC read and write EEPROM (AT24C08)
Article Outline: 1: Introduction to EEPROM chip (including various read and write timing and pin definitions) 2: Registers that need to be configured for IIC in S3C2440 3: IIC successfully reads and writes EEPROM program (the IIC read and write program on the CD is really hard for beginners to understand)   1: Introdu
[Microcontroller]
mini2440----keil for AMR IIC read and write EEPROM (AT24C08)
Recommended Content
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号