Uboot Startup Process
For MySQL 2440, there are not many startup methods. Generally, it is a nand flash outside, and 2440 has a nand flash Controller, which will automatically copy the first 4 K of nand flash to 2440 of the On-Chip SRAM. 2440 this in-chip SRAM is the so-called Stepping Stone is exactly 4 K. The startup code is uboot. Generally, uboot is divided into two parts, BL1 and BL2. The sum of BL1 and BL2 is the entire uboot. The two parts have their own division of labor. To meet the 2440 requirement, the BL1 size is set to 4 kb. The tasks to be completed for these 4 kb are as follows: 1. The memory is configured (for 2440, the memory is SDRAM ). 2. After the memory is configured, the entire uboot is moved to the SDRAM for running. At this time, the mission of BL1 is complete. Next, BL2 runs on the SDRAM and the OS on the FLASH is also moved to the SDRAM. The entire boot process is complete. Chip replacement and upgrade to S5PV210. At this time, the startup method is not as simple as 2440, such as SD card startup, emmc startup, USB boot, and so on, secondly, the external memory is no longer a simple memory like SDRAM, but a memory like DDR. Therefore, preparations are greatly increased at the beginning. Therefore, S5PV210 has an item called IROM, and the program is solidified internally. After power-on, IROM starts the internal program and initializes some external devices, such as SD card and emmc. The internal SRAM has also been upgraded from 4 K to 96k to meet more complex configuration requirements. Next, let's take a look at the uboot boot process officially recommended by Samsung, which is similar to the 2440 boot process. When powered on, it automatically copies an external fixed-size program to the on-chip SRAM. For 2440, the size is 4 K. For 210, the size is 16 K. Assume that we are now selecting the SD card boot, then our uboot will certainly be placed in the SD card. Similarly, for the 210 feature, uboot is also divided into two parts: BL1 and BL2; the size of BL1 is of course 16 K. Then, after power-on, the 16 K will be automatically copied to the SRAM in the chip, which is completed by the IROM inside the chip (this process is usually called BL0 ). At this time, the SRAM in the chip is not filled, and there is 80 KB of capacity. Samsung thinks that the 80 K capacity is enough for BL2. So, according to Samsung's idea, after BL1 is loaded into SRAM. BL1 starts to run. At this time, the BL1 task only needs to move BL2 to SRAM. Then let BL2 configure the DDR and run the OS to the DDR. That is to say, Samsung assigned BL1 the task of carrying BL2 to SRAM, and BL2 the task of configuring DDR and moving OS to DDR. However, during the Uboot process, we found that Uboot did not adopt the boot process recommended by Samsung. The reason is that with the development of Uboot, The Uboot size has become very large, far greater than 96 K. That is to say, Uboot cannot all be placed into the on-chip SRAM. So we cannot adopt the Samsung method. Therefore, Uboot re-allocates tasks to BL1 and BL2: (of course, the size of BL1 can only be 16 KB, which should be fixed for the program in IROM, it only copies the first 16 K of content to the SRAM .) Uboot not only needs to configure the DDR, but also carries BL2 to the DDR for operation. BL2 only needs to move the OS to DDR for running. Therefore, the three-star recommended practices are different from those of Uboot: 1. Uboot provides BL1 more tasks than Samsung does. First, he needs to configure DDR, and then move BL2 to DDR. The task that Samsung handed over to BL1 was simply to move BL2 to the on-chip SRAM. 2. In UBoot mode, BL2 runs on the DDR, while in Samsung mode, BL2 runs on the On-Chip SRAM. 3. In the UBoot mode, BL2 only needs to move the OS to DDR. In the Samsung mode, BL2 needs to configure the DDR before moving the OS to DDR. Conclusion: 1. the SRAM is inside the chip and can be accessed directly without initialization. The external memory such as DDR and SDRAM needs to be initialized. We need to write some configuration programs for access after initialization. So whether it is 2440, 210, or intel. Follow the step-by-step startup process. 2. For 2440, first load the first 4 K content of the external Flash to the SRAM, and then initialize the SDRAM by running the code in the SRAM, and carry the main program to the SDRAM. 3. This is also true for 210. the first 16 K content of the External Flash will be copied to the SRAM. 4. Distinguish BL0, BL1, and BL2. BL0 is actually a program that is solidified inside the chip. While BL1 and BL2 are two parts of Boot, the size of BL1 must be designed according to the characteristics of the chip. For 2440, your BL1 should not exceed 4 K, and for 210, BL1 should not exceed 16 K. 5. When writing boot, you can also follow the Samsung steps as long as your BL2 is no greater than 80 K. 7. DDR or SDRAM will be much larger than the on-chip SRAM, so as long as the external memory is initialized, many things (such as BL2) to some extent, it is no longer limited by the size.