Questions about uboot for sdmmc Partition

Source: Internet
Author: User
#elif defined(CFG_FASTBOOT_SDMMCBSP){ int start, count; unsigned char pid; pcount = 0;#if defined(CONFIG_FUSED) /* FW BL1 for fused chip */ strcpy(ptable[pcount].name, "fwbl1"); ptable[pcount].start = 0; ptable[pcount].length = 0; ptable[pcount].flags = FASTBOOT_PTENTRY_FLAGS_USE_MOVI_CMD; pcount++;#endif /* Bootloader */ strcpy(ptable[pcount].name, "bootloader"); ptable[pcount].start = 0; ptable[pcount].length = 0; ptable[pcount].flags = FASTBOOT_PTENTRY_FLAGS_USE_MOVI_CMD; pcount++; /* Kernel */ strcpy(ptable[pcount].name, "kernel"); ptable[pcount].start = 0; ptable[pcount].length = 0; ptable[pcount].flags = FASTBOOT_PTENTRY_FLAGS_USE_MOVI_CMD; pcount++; /* Ramdisk */ strcpy(ptable[pcount].name, "ramdisk"); ptable[pcount].start = 0; ptable[pcount].length = 0x300000; ptable[pcount].flags = FASTBOOT_PTENTRY_FLAGS_USE_MOVI_CMD; pcount++; /* System */ get_mmc_part_info("0", 2, &start, &count, &pid); if (pid != 0x83)  goto part_type_error; strcpy(ptable[pcount].name, "system"); ptable[pcount].start = start * CFG_FASTBOOT_SDMMC_BLOCKSIZE; ptable[pcount].length = count * CFG_FASTBOOT_SDMMC_BLOCKSIZE; ptable[pcount].flags = FASTBOOT_PTENTRY_FLAGS_USE_MMC_CMD; pcount++; /* Data */ get_mmc_part_info("0", 3, &start, &count, &pid); if (pid != 0x83)  goto part_type_error; strcpy(ptable[pcount].name, "userdata"); ptable[pcount].start = start * CFG_FASTBOOT_SDMMC_BLOCKSIZE; ptable[pcount].length = count * CFG_FASTBOOT_SDMMC_BLOCKSIZE; ptable[pcount].flags = FASTBOOT_PTENTRY_FLAGS_USE_MMC_CMD; pcount++; /* Cache */ get_mmc_part_info("0", 4, &start, &count, &pid); if (pid != 0x83)  goto part_type_error; strcpy(ptable[pcount].name, "cache"); ptable[pcount].start = start * CFG_FASTBOOT_SDMMC_BLOCKSIZE; ptable[pcount].length = count * CFG_FASTBOOT_SDMMC_BLOCKSIZE; ptable[pcount].flags = FASTBOOT_PTENTRY_FLAGS_USE_MMC_CMD; pcount++; /* fat */ get_mmc_part_info("0", 1, &start, &count, &pid); if (pid != 0xc)  goto part_type_error; strcpy(ptable[pcount].name, "fat"); ptable[pcount].start = start * CFG_FASTBOOT_SDMMC_BLOCKSIZE; ptable[pcount].length = count * CFG_FASTBOOT_SDMMC_BLOCKSIZE; ptable[pcount].flags = FASTBOOT_PTENTRY_FLAGS_USE_MMC_CMD; pcount++;

 

Understand. The kernel and U-boot both confirm their locations by name.
The following function determines
Int movi_set_ofs (uint last)
{
Int changed = 0;

If (ofsinfo. Last! = Last ){
Ofsinfo. Last = last-(efuse_size/movi_blksize );
Ofsinfo. BL1 = ofsinfo. Last-movi_bl1_blkcnt;
Ofsinfo. Env = ofsinfo. BL1-movi_env_blkcnt;
Ofsinfo. bl2 = ofsinfo. BL1-(movi_bl2_blkcnt + movi_env_blkcnt );
Ofsinfo. kernel = ofsinfo. bl2-movi_zimage_blkcnt;
Ofsinfo. rootfs = ofsinfo. kernel-movi_rootfs_blkcnt;
Changed = 1;
}

Return changed;
}
------------ The following functions in do_movi can be attached
If (strcmp (argv [2], "U-Boot") = 0 ){
If (movi_emmc = 1) {/* emmc_4.3 */
Printf ("emmc writing bootloader to Sector % d (% d sectors)...", ofsinfo. bl2, emmc_bl_blkcnt );
Emmc_write (uint) ADDR, ofsinfo. bl2, emmc_bl_blkcnt );
} Else {/* SD/MMC */
Printf ("Writing 1st bootloader to Sector % d (% d sectors) ..", ofsinfo. BL1, movi_bl1_blkcnt );
Movi_write (uint) ADDR, ofsinfo. BL1, movi_bl1_blkcnt );
Printf ("completed \ nwriting 2nd bootloader to Sector % d (% d sectors) ..", ofsinfo. bl2, movi_bl2_blkcnt );
Movi_write (uint) ADDR, ofsinfo. bl2, movi_bl2_blkcnt );
}
Printf ("completed \ n ");

} Else if (strcmp (argv [2], "kernel") = 0 ){
If (movi_emmc = 1) {/* emmc_4.3 */
Printf ("emmc writing kernel to Sector % d (% d sectors) ..", ofsinfo. kernel, emmc_kernel_blkcnt );
Emmc_write (uint) ADDR, ofsinfo. kernel, emmc_kernel_blkcnt );
} Else {/* SD/MMC */
Printf ("Writing kernel to Sector % d (% d sectors)...", ofsinfo. kernel, movi_zimage_blkcnt );
Movi_write (uint) ADDR, ofsinfo. kernel, movi_zimage_blkcnt );
}
Printf ("completed \ n ");

}

 

For more information, see the irom documentation of s5pv210.

Well, I finally understood something. The interesting uboot is very different from wince.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.