695 lines
89 KiB
HTML
695 lines
89 KiB
HTML
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn" lang="zh-cn" data-whc_version="27.0">
|
||
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="description" content="本节描述不同存储介质的默认分区方案,仅涉及启动相关的分区。应用相关的分区不同的方案会有不同的选择,此节未做描述。 在 ArtInChip 的方案中: env.txt 可以配置分区表信息,包括各分区在存储介质中的位置和大小。 env.txt 通常位于 target/<ic>/common/ 。 各项目对应的 image_cfg.json 中设置分区要烧录的内容。 MMC 分区配置 MMC 包括 SD ..."/><meta name="DC.rights.owner" content="(C) 版权 2025"/><meta name="copyright" content="(C) 版权 2025"/><meta name="generator" content="DITA-OT"/><meta name="DC.type" content="concept"/><meta name="DC.relation" content="../../../topics/sdk/boot/uboot-module.html"/><meta name="DC.relation" content="../../../topics/sdk/boot/mmc-drivers.html"/><meta name="DC.relation" content="../../../topics/sdk/boot/uboot-core.html"/><meta name="DC.contributor" content="yan.wang"/><meta name="DC.contributor" content="yan.wang"/><meta name="DC.date.modified" content="2024-01-15"/><meta name="DC.format" content="HTML5"/><meta name="DC.identifier" content="concept_l2d_xk3_pzb"/><meta name="DC.language" content="zh-CN"/><title>配置启动分区</title><!-- Generated with build number 2024112209. --><meta name="wh-path2root" content="../../../"/><meta name="wh-toc-id" content="concept_l2d_xk3_pzb-d4445e2607"/><meta name="wh-source-relpath" content="topics/sdk/boot/uboot-partition-config.dita"/><meta name="wh-out-relpath" content="topics/sdk/boot/uboot-partition-config.html"/>
|
||
|
||
<link rel="stylesheet" type="text/css" href="../../../webhelp/app/commons.css?buildId=2024112209"/>
|
||
<link rel="stylesheet" type="text/css" href="../../../webhelp/app/topic.css?buildId=2024112209"/>
|
||
|
||
<script src="../../../webhelp/app/options/properties.js?buildId=20250123154945"></script>
|
||
<script src="../../../webhelp/app/localization/strings.js?buildId=2024112209"></script>
|
||
<script src="../../../webhelp/app/search/index/keywords.js?buildId=20250123154945"></script>
|
||
<script defer="defer" src="../../../webhelp/app/commons.js?buildId=2024112209"></script>
|
||
<script defer="defer" src="../../../webhelp/app/topic.js?buildId=2024112209"></script>
|
||
<link rel="stylesheet" type="text/css" href="../../../webhelp/template/aic-styles-web.css?buildId=2024112209"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/notes.css?buildId=2024112209"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/aic-common.css?buildId=2024112209"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/aic-images.css?buildId=2024112209"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/footnote.css?buildId=2024112209"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/aic-web-watermark.css?buildId=2024112209"/><link rel="stylesheet" type="text/css" href="../../../webhelp/template/topic-body-list.css?buildId=2024112209"/></head>
|
||
|
||
<body id="concept_l2d_xk3_pzb" class="wh_topic_page frmBody">
|
||
<a href="#wh_topic_body" class="sr-only sr-only-focusable">
|
||
跳转到主要内容
|
||
</a>
|
||
|
||
|
||
|
||
|
||
<header class="navbar navbar-default wh_header">
|
||
<div class="container-fluid">
|
||
<div class="wh_header_flex_container navbar-nav navbar-expand-md navbar-dark">
|
||
<div class="wh_logo_and_publication_title_container">
|
||
<div class="wh_logo_and_publication_title">
|
||
|
||
<a href="http://www.artinchip.com" class=" wh_logo d-none d-sm-block "><img src="../../../company-logo-white.png" alt=" Linux SDK 使用指南 SDK 指南文件 "/></a>
|
||
<div class=" wh_publication_title "><a href="../../../index.html"><span class="booktitle"> <span class="ph mainbooktitle">Linux SDK 使用指南</span> <span class="ph booktitlealt">SDK 指南文件</span> </span></a></div>
|
||
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
<div class="wh_top_menu_and_indexterms_link collapse navbar-collapse" id="wh_top_menu_and_indexterms_link">
|
||
|
||
|
||
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</header>
|
||
|
||
|
||
|
||
|
||
<div class=" wh_search_input navbar-form wh_topic_page_search search " role="form">
|
||
|
||
|
||
|
||
<form id="searchForm" method="get" role="search" action="../../../search.html"><div><input type="search" placeholder="搜索 " class="wh_search_textfield" id="textToSearch" name="searchQuery" aria-label="搜索查询" required="required"/><button type="submit" class="wh_search_button" aria-label="搜索"><span class="search_input_text">搜索</span></button></div></form>
|
||
|
||
|
||
|
||
</div>
|
||
|
||
<div class="container-fluid" id="wh_topic_container">
|
||
<div class="row">
|
||
|
||
<nav class="wh_tools d-print-none navbar-expand-md" aria-label="Tools">
|
||
|
||
<div data-tooltip-position="bottom" class=" wh_breadcrumb "><ol class="d-print-none"><li><span class="home"><a href="../../../index.html"><span>主页</span></a></span></li><li><div class="topicref" data-id="id"><div class="title"><a href="../../../topics/sdk/chapter-advanced-app.html">高级应用</a><div class="wh-tooltip"><p class="shortdesc">系统、存储、多媒体、接口、安全等模块的详细配置和设计说明。</p></div></div></div></li><li><div class="topicref" data-id="uBoot"><div class="title"><a href="../../../topics/sdk/boot/uboot-module.html">U-Boot</a><div class="wh-tooltip"><p class="shortdesc">启动支持的基本功能以及运行时的基本硬件环境。</p></div></div></div></li><li class="active"><div class="topicref" data-id="concept_l2d_xk3_pzb"><div class="title"><a href="../../../topics/sdk/boot/uboot-partition-config.html">配置启动分区</a></div></div></li></ol></div>
|
||
|
||
|
||
|
||
<div class="wh_right_tools">
|
||
<button class="wh_hide_highlight" aria-label="切换搜索突出显示" title="切换搜索突出显示"></button>
|
||
<button class="webhelp_expand_collapse_sections" data-next-state="collapsed" aria-label="折叠截面" title="折叠截面"></button>
|
||
<div class=" wh_navigation_links "><span id="topic_navigation_links" class="navheader">
|
||
|
||
<span class="navprev"><a class="- topic/link link" href="../../../topics/sdk/boot/mmc-drivers.html" title="MMC" aria-label="上一主题: MMC" rel="prev"></a></span>
|
||
<span class="navnext"><a class="- topic/link link" href="../../../topics/sdk/boot/uboot-core.html" title="启动内核" aria-label="下一主题: 启动内核" rel="next"></a></span> </span></div>
|
||
|
||
|
||
|
||
<div class=" wh_print_link print d-none d-md-inline-block "><button onClick="window.print()" title="打印此页" aria-label="打印此页"></button></div>
|
||
|
||
<button type="button" id="wh_toc_button" class="custom-toggler navbar-toggler collapsed wh_toggle_button navbar-light" aria-expanded="false" aria-label="Toggle publishing table of content" aria-controls="wh_publication_toc">
|
||
<span class="navbar-toggler-icon"></span>
|
||
</button>
|
||
</div>
|
||
|
||
</nav>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
<div class="wh_content_area">
|
||
<div class="row">
|
||
|
||
<nav id="wh_publication_toc" class="col-lg-3 col-md-3 col-sm-12 d-md-block d-none d-print-none" aria-label="Table of Contents Container">
|
||
<div id="wh_publication_toc_content">
|
||
|
||
<div class=" wh_publication_toc " data-tooltip-position="right"><span class="expand-button-action-labels"><span id="button-expand-action" role="button" aria-label="Expand"></span><span id="button-collapse-action" role="button" aria-label="Collapse"></span><span id="button-pending-action" role="button" aria-label="Pending"></span></span><ul role="tree" aria-label="Table of Contents"><li role="treeitem"><div data-tocid="revinfo_linux-d4445e1079" class="topicref" data-id="revinfo_linux" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/revinfo/revinfo_linux.html" id="revinfo_linux-d4445e1079-link">修订记录</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d4445e1096" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d4445e1096-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/env/sdk-compile.html" id="id-d4445e1096-link">SDK 编译</a><div class="wh-tooltip"><p class="shortdesc">介绍不同编译环境下 SDK 的详细编译流程。</p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="tocId-d4445e1240" class="topicref" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action tocId-d4445e1240-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/advanced/lb_usage_commands.html" id="tocId-d4445e1240-link">使用指南</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="concept_rcx_czh_pzb-d4445e1360" class="topicref" data-id="concept_rcx_czh_pzb" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action concept_rcx_czh_pzb-d4445e1360-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/chapter-app.html" id="concept_rcx_czh_pzb-d4445e1360-link">应用场景</a><div class="wh-tooltip"><p class="shortdesc">描述了 SDK 在不同应用场景中的配置和使用,包括系统更新、OTA、安全方案等。</p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d4445e1678" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d4445e1678-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/peripheral/peripheral-intro.html" id="id-d4445e1678-link">外设移植</a><div class="wh-tooltip"><p class="shortdesc"><span class="ph">触摸屏、显示器、WIFI 模块、按键</span>等外设的介绍和使用说明。</p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="id-d4445e1964" class="topicref" data-id="id" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action id-d4445e1964-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/bringup/chapter-bringup.html" id="id-d4445e1964-link">BringUp</a><div class="wh-tooltip"><p class="shortdesc">在硬件上电后快速初始化系统,为操作系统的启动准备好必要的硬件环境。</p></div></div></div></li><li role="treeitem" aria-expanded="true"><div data-tocid="id-d4445e2153" class="topicref" data-id="id" data-state="expanded"><span role="button" tabindex="0" aria-labelledby="button-collapse-action id-d4445e2153-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/chapter-advanced-app.html" id="id-d4445e2153-link">高级应用</a><div class="wh-tooltip"><p class="shortdesc">系统、存储、多媒体、接口、安全等模块的详细配置和设计说明。</p></div></div></div><ul role="group" class="navbar-nav nav-list"><li role="treeitem" aria-expanded="true"><div data-tocid="uBoot-d4445e2170" class="topicref" data-id="uBoot" data-state="expanded"><span role="button" tabindex="0" aria-labelledby="button-collapse-action uBoot-d4445e2170-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/uboot-module.html" id="uBoot-d4445e2170-link">U-Boot</a><div class="wh-tooltip"><p class="shortdesc">启动支持的基本功能以及运行时的基本硬件环境。</p></div></div></div><ul role="group" class="navbar-nav nav-list"><li role="treeitem"><div data-tocid="_65-d4445e2187" class="topicref" data-id="_65" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/uboot-hardware-env.html" id="_65-d4445e2187-link">硬件运行环境</a></div></div></li><li role="treeitem"><div data-tocid="_1601-d4445e2201" class="topicref" data-id="_1601" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/uboot-parameter.html" id="_1601-d4445e2201-link">启动参数</a></div></div></li><li role="treeitem"><div data-tocid="_1601_0-d4445e2215" class="topicref" data-id="_1601_0" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/boot-memory.html" id="_1601_0-d4445e2215-link">内存相关</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="concept_lbx_3n3_pzb-d4445e2229" class="topicref" data-id="concept_lbx_3n3_pzb" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action concept_lbx_3n3_pzb-d4445e2229-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/environment-variables.html" id="concept_lbx_3n3_pzb-d4445e2229-link">环境变量</a></div></div></li><li role="treeitem"><div data-tocid="dts-d4445e2271" class="topicref" data-id="dts" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/uboot-dts.html" id="dts-d4445e2271-link">DTS</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="spl-d4445e2285" class="topicref" data-id="spl" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action spl-d4445e2285-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/spl-program-stage.html" id="spl-d4445e2285-link">SPL 阶段</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="uBoot_0-d4445e2411" class="topicref" data-id="uBoot_0" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action uBoot_0-d4445e2411-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/uboot-stage.html" id="uBoot_0-d4445e2411-link">U-Boot 阶段</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="concept_q5s_jn3_pzb-d4445e2495" class="topicref" data-id="concept_q5s_jn3_pzb" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action concept_q5s_jn3_pzb-d4445e2495-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/uboot-driver-support.html" id="concept_q5s_jn3_pzb-d4445e2495-link">驱动支持</a></div></div></li><li role="treeitem" class="active"><div data-tocid="concept_l2d_xk3_pzb-d4445e2607" class="topicref" data-id="concept_l2d_xk3_pzb" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/uboot-partition-config.html" id="concept_l2d_xk3_pzb-d4445e2607-link">配置启动分区</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="concept_afz_xk3_pzb-d4445e2621" class="topicref" data-id="concept_afz_xk3_pzb" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action concept_afz_xk3_pzb-d4445e2621-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/uboot-core.html" id="concept_afz_xk3_pzb-d4445e2621-link">启动内核</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="concept_uzy_yk3_pzb-d4445e2692" class="topicref" data-id="concept_uzy_yk3_pzb" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action concept_uzy_yk3_pzb-d4445e2692-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/bundle-images.html" id="concept_uzy_yk3_pzb-d4445e2692-link">打包镜像</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="concept_yfv_1l3_pzb-d4445e2832" class="topicref" data-id="concept_yfv_1l3_pzb" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action concept_yfv_1l3_pzb-d4445e2832-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/uboot-chapter-image-burn.html" id="concept_yfv_1l3_pzb-d4445e2832-link">镜像烧录</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="userid-d4445e2888" class="topicref" data-id="userid" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action userid-d4445e2888-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/userid-burn.html" id="userid-d4445e2888-link">UserID 烧录</a></div></div></li><li role="treeitem"><div data-tocid="concept_azt_bl3_pzb-d4445e2944" class="topicref" data-id="concept_azt_bl3_pzb" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/logo-display.html" id="concept_azt_bl3_pzb-d4445e2944-link">图像显示</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="_1601_1-d4445e2958" class="topicref" data-id="_1601_1" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action _1601_1-d4445e2958-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/debug-configuration.html" id="_1601_1-d4445e2958-link">调试配置</a></div></div></li><li role="treeitem"><div data-tocid="opensbi-d4445e3000" class="topicref" data-id="opensbi" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/opensbi.html" id="opensbi-d4445e3000-link">OpenSBI</a></div></div></li><li role="treeitem"><div data-tocid="pbp-d4445e3014" class="topicref" data-id="pbp" data-state="leaf"><span role="button" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/boot/pre-boot-program.html" id="pbp-d4445e3014-link">Pre-Boot Program (PBP)</a></div></div></li></ul></li><li role="treeitem" aria-expanded="false"><div data-tocid="concept_mtx_tk3_pzb-d4445e3028" class="topicref" data-id="concept_mtx_tk3_pzb" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action concept_mtx_tk3_pzb-d4445e3028-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/sdk/linux/chapter_linux.html" id="concept_mtx_tk3_pzb-d4445e3028-link">Linux</a></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="chapter-system-d4445e3198" class="topicref" data-id="chapter-system" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action chapter-system-d4445e3198-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/chapter-title/chapter-system.html" id="chapter-system-d4445e3198-link">系统</a><div class="wh-tooltip"><p class="shortdesc"></p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="chapter-memory-d4445e4054" class="topicref" data-id="chapter-memory" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action chapter-memory-d4445e4054-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/chapter-title/chapter-memory-sdk.html" id="chapter-memory-d4445e4054-link">存储</a><div class="wh-tooltip"><p class="shortdesc">SDMC、SPI NAND、SPI NOR 等存储模块的介绍和使用说明。</p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="concept_mcc_32s_nbc-d4445e4438" class="topicref" data-id="concept_mcc_32s_nbc" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action concept_mcc_32s_nbc-d4445e4438-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/chapter-title/chapter-multi-media-sdk.html" id="concept_mcc_32s_nbc-d4445e4438-link">多媒体</a><div class="wh-tooltip"><p class="shortdesc">GE、VE、Display、DVP、MPP、MPP 播放器等多媒体模块的介绍和使用说明。</p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="concept_nww_hzh_pzb-d4445e5947" class="topicref" data-id="concept_nww_hzh_pzb" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action concept_nww_hzh_pzb-d4445e5947-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/chapter-title/chapter-interface-sdk.html" id="concept_nww_hzh_pzb-d4445e5947-link">接口</a><div class="wh-tooltip"><p class="shortdesc">CAN、CIR、GPAI、GPIO、I2C、PSADC、PWM 等接口模块的介绍和使用说明。</p></div></div></div></li><li role="treeitem" aria-expanded="false"><div data-tocid="chapter-safety-d4445e7944" class="topicref" data-id="chapter-safety" data-state="not-ready"><span role="button" tabindex="0" aria-labelledby="button-expand-action chapter-safety-d4445e7944-link" class="wh-expand-btn"></span><div class="title"><a href="../../../topics/chapter-title/chapter-safety-sdk.html" id="chapter-safety-d4445e7944-link">安全</a><div class="wh-tooltip"><p class="shortdesc">SPI ENC、CE、eFuse 等安全模块的介绍和使用说明。</p></div></div></div></li></ul></li></ul></div>
|
||
|
||
</div>
|
||
</nav>
|
||
|
||
|
||
<div class="col-lg-7 col-md-9 col-sm-12" id="wh_topic_body">
|
||
<button id="wh_close_publication_toc_button" class="close-toc-button d-none" aria-label="Toggle publishing table of content" aria-controls="wh_publication_toc" aria-expanded="true">
|
||
<span class="close-toc-icon-container">
|
||
<span class="close-toc-icon"></span>
|
||
</span>
|
||
</button>
|
||
<button id="wh_close_topic_toc_button" class="close-toc-button d-none" aria-label="Toggle topic table of content" aria-controls="wh_topic_toc" aria-expanded="true">
|
||
<span class="close-toc-icon-container">
|
||
<span class="close-toc-icon"></span>
|
||
</span>
|
||
</button>
|
||
|
||
<div class=" wh_topic_content body "><main role="main"><article class="- topic/topic concept/concept topic concept" role="article" aria-labelledby="ariaid-title1">
|
||
<span class="edit-link" style="font-size:12px; opacity:0.6; text-align:right; vertical-align:middle"><a target="_blank" title="Edit this document" href="http://172.16.35.88/tasks/jdssno1uvvbf2mltu9kb9v3if05d5gopuakboe8hlud18rma/edit/F:/aicdita/aicdita-cn/topics/sdk/boot/uboot-partition-config.dita">Edit online</a></span><h1 class="- topic/title title topictitle1" id="ariaid-title1">配置启动分区</h1>
|
||
|
||
<div class="date inPage">15 Jan 2024</div><div style="color: gray;">
|
||
Read time: 7 minute(s)
|
||
</div>
|
||
<div class="- topic/body concept/conbody body conbody">
|
||
<p class="- topic/p p" data-ofbid="d112356e33__20250123155209">本节描述不同存储介质的默认分区方案,仅涉及启动相关的分区。应用相关的分区不同的方案会有不同的选择,此节未做描述。</p>
|
||
<div class="- topic/p p" data-ofbid="d112356e36__20250123155209">在 ArtInChip 的方案中:<ul class="- topic/ul ul" id="concept_l2d_xk3_pzb__ul_mjk_4t5_4dc" data-ofbid="concept_l2d_xk3_pzb__ul_mjk_4t5_4dc">
|
||
<li class="- topic/li li" data-ofbid="d112356e40__20250123155209">
|
||
<p class="- topic/p p" data-ofbid="d112356e42__20250123155209"><span class="+ topic/ph sw-d/filepath ph filepath">env.txt</span> 可以配置分区表信息,包括各分区在存储介质中的位置和大小。</p>
|
||
<p class="- topic/p p" data-ofbid="d112356e47__20250123155209"><span class="+ topic/ph sw-d/filepath ph filepath">env.txt</span> 通常位于
|
||
<span class="+ topic/ph sw-d/filepath ph filepath">target/<ic>/common/</span>。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d112356e56__20250123155209">
|
||
<p class="- topic/p p" data-ofbid="d112356e58__20250123155209">各项目对应的 <span class="+ topic/ph sw-d/filepath ph filepath">image_cfg.json</span> 中设置分区要烧录的内容。</p>
|
||
</li>
|
||
</ul></div>
|
||
<section class="- topic/section section" id="concept_l2d_xk3_pzb__section_h3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__section_h3d_pch_bzb"><h2 class="- topic/title title sectiontitle">MMC 分区配置</h2>
|
||
|
||
<p class="- topic/p p" data-ofbid="d112356e71__20250123155209">MMC 包括 SD Card 和 eMMC。对于 eMMC,ArtInChip 方案中不支持从 Boot Partition 启动, 只支持从 UDA (User
|
||
Data Area) 启动,因此具体的分区方式与 SD Card 一致,统一采用 GPT 分区。</p>
|
||
<ul class="- topic/ul ul" id="concept_l2d_xk3_pzb__ul_ygn_b55_4dc" data-ofbid="concept_l2d_xk3_pzb__ul_ygn_b55_4dc">
|
||
<li class="- topic/li li" data-ofbid="d112356e76__20250123155209">
|
||
<p class="- topic/p p" data-ofbid="d112356e78__20250123155209"><strong class="+ topic/ph hi-d/b ph b">目标平台上的 GPT 分区</strong></p>
|
||
<div class="- topic/p p" data-ofbid="d112356e82__20250123155209">在项目的<span class="+ topic/ph sw-d/filepath ph filepath">image_cfg.json</span> 中配置具体分区。使用
|
||
<span class="+ topic/ph sw-d/filepath ph filepath">mk_image.py</span> 生成镜像过程中,相关分区信息会被添加到
|
||
<span class="+ topic/ph sw-d/filepath ph filepath">env.bin</span> 中,以 <span class="+ topic/keyword pr-d/parmname keyword parmname">GPT=</span>
|
||
格式存储在环境变量中,示例如下:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="concept_l2d_xk3_pzb__codeblock_i3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__codeblock_i3d_pch_bzb"><code>GPT=size1@offset1(partition name1),size2@offset2(partition name2),-(last partition)</code></pre></div>
|
||
<div class="- topic/p p" data-ofbid="d112356e99__20250123155209">其中<ul class="- topic/ul ul" id="concept_l2d_xk3_pzb__ul_y51_f55_4dc" data-ofbid="concept_l2d_xk3_pzb__ul_y51_f55_4dc">
|
||
<li class="- topic/li li" data-ofbid="d112356e103__20250123155209">size 是分区的大小。</li>
|
||
<li class="- topic/li li" data-ofbid="d112356e106__20250123155209">
|
||
<p class="- topic/p p" data-ofbid="d112356e108__20250123155209">offset 是分区的开始位置,相对 UDA 的开始位置,单位为字节。</p>
|
||
<p class="- topic/p p" data-ofbid="d112356e111__20250123155209">如果是最后一个分区,可以不设置 <span class="+ topic/keyword pr-d/parmname keyword parmname">size@offset</span>,使用
|
||
<span class="+ topic/keyword pr-d/parmname keyword parmname">-</span> 代替,表示剩余的所有空间都分配给该分区。</p>
|
||
</li>
|
||
</ul></div>
|
||
<div class="- topic/p p" data-ofbid="d112356e122__20250123155209">例如 <span class="+ topic/ph sw-d/filepath ph filepath">image_cfg.json</span>
|
||
中的分区配置:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="concept_l2d_xk3_pzb__codeblock_j3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__codeblock_j3d_pch_bzb"><code><span class="hl-string">"mmc"</span>: { <em class="hl-comment">// Media type</em>
|
||
<span class="hl-string">"size"</span>: <span class="hl-string">"8G"</span>, <em class="hl-comment">// Size of SD/eMMC</em>
|
||
<span class="hl-string">"partitions"</span>: { <em class="hl-comment">// Partition table apply to device</em>
|
||
<span class="hl-string">"spl_1"</span>: { <span class="hl-string">"offset"</span>: <span class="hl-string">"0x4400"</span>, <span class="hl-string">"size"</span>: <span class="hl-string">"128k"</span> },
|
||
<span class="hl-string">"spl_2"</span>: { <span class="hl-string">"size"</span>: <span class="hl-string">"367k"</span> },
|
||
<span class="hl-string">"uboot"</span>: { <span class="hl-string">"size"</span>: <span class="hl-string">"1m"</span> },
|
||
<span class="hl-string">"env"</span>: { <span class="hl-string">"size"</span>: <span class="hl-string">"512k"</span> },
|
||
<span class="hl-string">"kernel"</span>: { <span class="hl-string">"size"</span>: <span class="hl-string">"16m"</span> },
|
||
<span class="hl-string">"rootfs"</span>: { <span class="hl-string">"size"</span>: <span class="hl-string">"64m"</span> },
|
||
<span class="hl-string">"user"</span>: { <span class="hl-string">"size"</span>: <span class="hl-string">"-"</span> },
|
||
},
|
||
},</code></pre></div>
|
||
<div class="- topic/p p" data-ofbid="d112356e130__20250123155209">环境变量中保存的格式:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="concept_l2d_xk3_pzb__codeblock_k3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__codeblock_k3d_pch_bzb"><code>GPT=<span class="hl-number">128</span>k@<span class="hl-number">0x4400</span>(spl_<span class="hl-number">1</span>),<span class="hl-number">367</span>k(spl_<span class="hl-number">2</span>),<span class="hl-number">1</span>m(uboot),<span class="hl-number">512</span>k(env),<span class="hl-number">16</span>m(kernel),<span class="hl-number">64</span>m(rootfs),-(user)</code></pre></div>
|
||
<div class="- topic/p p" data-ofbid="d112356e136__20250123155209">不设置
|
||
offset,表示各分区相连,程序自动计算该分区的开始位置:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="concept_l2d_xk3_pzb__codeblock_l3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__codeblock_l3d_pch_bzb"><code>GPT=<span class="hl-number">128</span>k(spl_<span class="hl-number">1</span>),<span class="hl-number">367</span>k(spl_<span class="hl-number">2</span>),<span class="hl-number">1</span>m(uboot),<span class="hl-number">512</span>k(env),<span class="hl-number">512</span>k(bootui),<span class="hl-number">512</span>k(dtb),
|
||
<span class="hl-number">16</span>m(kernel),<span class="hl-number">64</span>m(rootfs),-(user)</code></pre></div>
|
||
<div class="- topic/note note note note_note" id="concept_l2d_xk3_pzb__note_fwq_44r_c1c" data-ofbid="concept_l2d_xk3_pzb__note_fwq_44r_c1c"><span class="note__title">注:</span> <div class="note__body">
|
||
<p class="- topic/p p" data-ofbid="d112356e143__20250123155209">UDA 的前面 34 个 block 被用作 GPT Header,无论第一个分区是否设置 offset,程序在做分区时都会预留 34 个
|
||
block 给 GPT Header。即:128k@0x4400(spl_1) 和 128k(spl_1) 是一样的。</p>
|
||
</div></div>
|
||
<div class="table-container"><table class="- topic/table table frame-all" id="concept_l2d_xk3_pzb__table_m3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__table_m3d_pch_bzb" data-cols="4"><caption class="- topic/title title tablecap" data-caption-side="top" data-is-repeated="true"><span class="table--title-label">表<span class="table--title-label-number"> 1</span><span class="table--title-label-punctuation">. </span></span><span class="table--title">基本分区</span></caption><colgroup><col style="width:18.679549114331724%"/><col style="width:18.357487922705314%"/><col style="width:16.10305958132045%"/><col style="width:46.85990338164252%"/></colgroup><thead class="- topic/thead thead">
|
||
<tr class="- topic/row">
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__1">分区</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__2">大小</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__3">-</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__4">备注</th>
|
||
</tr>
|
||
</thead><tbody class="- topic/tbody tbody">
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__1">spl_1</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__2">128KB</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__4">分区开始位置固定,从 0x4400 开始,大小固定</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__1">spl_2</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__2">≥ 128KB</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__4">分区开始位置固定,镜像备份,可不要</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__1">uboot</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__2">.</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__4">大小根据实际项目需要配置</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__1">env</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__2">≥16KB</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__4">保存环境变量</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__1">dtb</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__2">.</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__4">保存 kernel dtb,大小根据实际情况分配</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__1">kernel</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__2">.</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__4">大小根据实际项目需要配置</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__1">rootfs</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__2">.</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__3">Ext4</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__4">大小根据实际项目需要配置</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__1">user</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__2">.</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__3">Ext4</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_m3d_pch_bzb__entry__4">大小根据实际项目需要配置</td>
|
||
</tr>
|
||
</tbody></table></div>
|
||
<p class="- topic/p p" data-ofbid="d112356e307__20250123155209">如果 Kernel 使用 FIT Image 格式,上述分区中的 dtb 可以省略。 user 分区以及是否有更多的应用分区,由具体项目决定。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d112356e311__20250123155209">
|
||
<p class="- topic/p p" data-ofbid="d112356e313__20250123155209"><strong class="+ topic/ph hi-d/b ph b">SD 量产卡的 GPT 分区</strong></p>
|
||
<div class="- topic/p p" data-ofbid="d112356e317__20250123155209">量产卡用在工厂生产过程中,通过运行量产卡中的升级程序,对目标平台进行量产升级。 具体的分区设置在 <span class="+ topic/ph sw-d/filepath ph filepath">env.txt</span> 中的
|
||
<span class="+ topic/keyword pr-d/parmname keyword parmname">burn_mmc=</span>
|
||
配置。例如:<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="concept_l2d_xk3_pzb__codeblock_n3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__codeblock_n3d_pch_bzb"><code>burn_mmc=<span class="hl-number">128</span>k@<span class="hl-number">0x4400</span>(spl_<span class="hl-number">1</span>),<span class="hl-number">367</span>k(spl_<span class="hl-number">2</span>),<span class="hl-number">1</span>m(uboot),<span class="hl-number">512</span>k(env),<span class="hl-number">512</span>k(bootui),-(image)</code></pre></div>
|
||
<div class="table-container"><table class="- topic/table table frame-all" id="concept_l2d_xk3_pzb__table_o3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__table_o3d_pch_bzb" data-cols="4"><caption class="- topic/title title tablecap" data-caption-side="top" data-is-repeated="true"><span class="table--title-label">表<span class="table--title-label-number"> 2</span><span class="table--title-label-punctuation">. </span></span><span class="table--title"></span></caption><colgroup><col style="width:18.679549114331724%"/><col style="width:18.357487922705314%"/><col style="width:16.10305958132045%"/><col style="width:46.85990338164252%"/></colgroup><thead class="- topic/thead thead">
|
||
<tr class="- topic/row">
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__1">分区</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__2">大小</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__3">-</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__4">备注</th>
|
||
</tr>
|
||
</thead><tbody class="- topic/tbody tbody">
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__1">spl_1</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__2">128KB</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__4">用于升级的 SPL</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__1">spl_2</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__2">≥ 128KB</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__4">用于升级的 SPL 备份</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__1">uboot</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__2">.</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__4">用于升级的 U-Boot</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__1">env</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__2">≥ 16KB</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__4">保存环境变量</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__1">data</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__2">.</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_o3d_pch_bzb__entry__4">保存用于烧录固件镜像文件</td>
|
||
</tr>
|
||
</tbody></table></div>
|
||
<p class="- topic/p p" data-ofbid="d112356e441__20250123155209">目标平台在启动到 U-Boot 时,进入量产模式。U-Boot 量产程序从 <code class="+ topic/ph pr-d/codeph ph codeph">data</code>
|
||
分区读取固件数据,并且烧录到目标存储介质。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d112356e448__20250123155209">
|
||
<p class="- topic/p p" data-ofbid="d112356e450__20250123155209"><strong class="+ topic/ph hi-d/b ph b">SPL 分区的特别说明</strong></p>
|
||
<div class="- topic/p p" data-ofbid="d112356e454__20250123155209">MMC GPT 分区时,BROM 启动过程中,固定从两个地方读取 SPL 程序的备份。 首先尝试读取 SPL 备份 1,如果验证失败,再尝试读取 SPL
|
||
备份 2。其中备份 2 是可选的。<div class="table-container"><table class="- topic/table table frame-all" id="concept_l2d_xk3_pzb__table_p3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__table_p3d_pch_bzb" data-cols="3"><caption></caption><colgroup><col style="width:33.33333333333333%"/><col style="width:33.33333333333333%"/><col style="width:33.33333333333333%"/></colgroup><thead class="- topic/thead thead">
|
||
<tr class="- topic/row">
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_p3d_pch_bzb__entry__1">分区</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_p3d_pch_bzb__entry__2">大小/位置</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_p3d_pch_bzb__entry__3">备注</th>
|
||
</tr>
|
||
</thead><tbody class="- topic/tbody tbody">
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_p3d_pch_bzb__entry__1">GPT HEADER</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_p3d_pch_bzb__entry__2">17KB(LBA0~LBA33)</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_p3d_pch_bzb__entry__3">预留给 GPT Header</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_p3d_pch_bzb__entry__1">备份 1</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_p3d_pch_bzb__entry__2">128KB(LBA34~LBA289)</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_p3d_pch_bzb__entry__3">必须</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_p3d_pch_bzb__entry__1">备份 2</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_p3d_pch_bzb__entry__2">128KB(LBA290~LBA545)</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_p3d_pch_bzb__entry__3">可选</td>
|
||
</tr>
|
||
</tbody></table></div></div>
|
||
</li>
|
||
</ul>
|
||
</section>
|
||
<section class="- topic/section section" id="concept_l2d_xk3_pzb__section_q3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__section_q3d_pch_bzb"><h2 class="- topic/title title sectiontitle">SPI NAND 分区配置</h2>
|
||
|
||
<p class="- topic/p p" data-ofbid="d112356e530__20250123155209">具体的分区在项目的 <span class="+ topic/ph sw-d/filepath ph filepath">image_cfg.json</span> 中配置,<span class="+ topic/ph sw-d/filepath ph filepath">mk_image.py</span>
|
||
生成镜像过程中,相关分区信息会被添加到 <span class="+ topic/ph sw-d/filepath ph filepath">env.bin</span>, 以 <span class="+ topic/keyword pr-d/parmname keyword parmname">MTD=</span> 和
|
||
<span class="+ topic/keyword pr-d/parmname keyword parmname">UBI=</span> 格式存储在环境变量中:</p>
|
||
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="concept_l2d_xk3_pzb__codeblock_r3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__codeblock_r3d_pch_bzb"><code>MTD=size1@offset1(partition name1),size2@offset2(partition name2),-(last partition)</code></pre>
|
||
<p class="- topic/p p" data-ofbid="d112356e551__20250123155209">其中 size 是分区的大小,offset 是分区的开始位置(相对 UDA 的开始位置,单位为字节)。 如果是最后一个分区,可以不设置
|
||
<span class="+ topic/keyword pr-d/parmname keyword parmname">size@offset</span>,使用 <span class="+ topic/keyword pr-d/parmname keyword parmname">-</span> 代替,表示剩余的所有空间都分配给该分区。</p>
|
||
<p class="- topic/p p" data-ofbid="d112356e560__20250123155209">例如: <span class="+ topic/ph sw-d/filepath ph filepath">image_cfg.json</span> 中的分区配置:</p>
|
||
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="concept_l2d_xk3_pzb__codeblock_s3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__codeblock_s3d_pch_bzb"><code><span class="hl-string">"spi-nand"</span>: { <em class="hl-comment">// Device, The name should be the same with string in image:info:media:type</em>
|
||
<span class="hl-string">"size"</span>: <span class="hl-string">"128m"</span>, <em class="hl-comment">// Size of SPI NAND</em>
|
||
<span class="hl-string">"partitions"</span>: {
|
||
<span class="hl-string">"spl"</span>: { <span class="hl-string">"size"</span>: <span class="hl-string">"1m"</span> },
|
||
<span class="hl-string">"uboot"</span>: { <span class="hl-string">"size"</span>: <span class="hl-string">"1m"</span> },
|
||
<span class="hl-string">"env"</span>: { <span class="hl-string">"size"</span>: <span class="hl-string">"256k"</span> },
|
||
<span class="hl-string">"kernel"</span>: { <span class="hl-string">"size"</span>: <span class="hl-string">"12m"</span> },
|
||
<span class="hl-string">"ubiroot"</span>: {
|
||
<span class="hl-string">"size"</span>: <span class="hl-string">"32m"</span>,
|
||
<span class="hl-string">"ubi"</span>: { <em class="hl-comment">// Volume in UBI device</em>
|
||
<span class="hl-string">"rootfs"</span>: { <span class="hl-string">"size"</span>: <span class="hl-string">"-"</span> },
|
||
},
|
||
},
|
||
<span class="hl-string">"ubisystem"</span>: {
|
||
<span class="hl-string">"size"</span>: <span class="hl-string">"-"</span>,
|
||
<span class="hl-string">"ubi"</span>: { <em class="hl-comment">// Volume in UBI device</em>
|
||
<span class="hl-string">"user"</span>: { <span class="hl-string">"size"</span>: <span class="hl-string">"-"</span> },
|
||
},
|
||
},
|
||
}
|
||
},</code></pre>
|
||
<p class="- topic/p p" data-ofbid="d112356e570__20250123155209">生成的环境变量内容:</p>
|
||
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="concept_l2d_xk3_pzb__codeblock_t3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__codeblock_t3d_pch_bzb"><code>MTD=spi1.<span class="hl-number">0</span>:<span class="hl-number">1</span>m(spl),<span class="hl-number">1</span>m(uboot),<span class="hl-number">256</span>k(env),<span class="hl-number">12</span>m(kernel),<span class="hl-number">32</span>m(ubiroot),-(ubisystem)
|
||
UBI=ubiroot:-(rootfs);ubisystem:-(user)</code></pre>
|
||
<p class="- topic/p p" data-ofbid="d112356e576__20250123155209">前面 <span class="+ topic/keyword pr-d/parmname keyword parmname">MTD=</span> 描述 MTD 分区的配置,后面 <span class="+ topic/keyword pr-d/parmname keyword parmname">UBI=</span> 描述被用作 UBI 的 MTD 分区的
|
||
UBI 卷分配。</p>
|
||
<div class="- topic/note note note note_note" id="concept_l2d_xk3_pzb__note_lk4_yd3_p1c" data-ofbid="concept_l2d_xk3_pzb__note_lk4_yd3_p1c"><span class="note__title">注:</span> <div class="note__body">
|
||
<p class="- topic/p p" data-ofbid="d112356e587__20250123155209">mtdids 与使用的 spi 接口有关系。当使用 spi0 接口时,为 spi0.0。当使用 spi1 接口时,为 spi1.0</p>
|
||
</div></div>
|
||
<p class="- topic/p p" data-ofbid="d112356e591__20250123155209">Boot 阶段相关的几个分区有两种备选方案。</p>
|
||
<p class="- topic/p p" data-ofbid="d112356e595__20250123155209"><strong class="+ topic/ph hi-d/b ph b">方案一:</strong> MTD 分区</p>
|
||
<div class="table-container"><table class="- topic/table table frame-all" id="concept_l2d_xk3_pzb__table_u3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__table_u3d_pch_bzb" data-cols="4"><caption></caption><colgroup><col style="width:18.726591760299627%"/><col style="width:19.101123595505616%"/><col style="width:19.288389513108616%"/><col style="width:42.88389513108614%"/></colgroup><thead class="- topic/thead thead">
|
||
<tr class="- topic/row">
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__1">分区</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__2">大小</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__3">-</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__4">备注</th>
|
||
</tr>
|
||
</thead><tbody class="- topic/tbody tbody">
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__1">spl</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__2">1MB</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__4">保存 SPL 备份的区域</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__1">uboot</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__2">2MB</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__4">保存 U-Boot,需要预留空闲备用块</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__1">env</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__2">1 Block</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__4">保存环境变量</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__1">envbak</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__2">1 Block</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__4">保存环境变量备份,可不用</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__1">dtb</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__2">1 Block</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__4">保存 kernel dtb</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__1">kernel</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__2">.</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__4">保存 kernel,需要预留空闲备用块</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__1">rootfs</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__2">.</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__3">UBIFS</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__4">-</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__1">user</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__2">.</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__3">UBIFS</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_u3d_pch_bzb__entry__4">-</td>
|
||
</tr>
|
||
</tbody></table></div>
|
||
<p class="- topic/p p" data-ofbid="d112356e757__20250123155209"><strong class="+ topic/ph hi-d/b ph b">方案二:</strong> UBI 分区</p>
|
||
<div class="table-container"><table class="- topic/table table frame-all" id="concept_l2d_xk3_pzb__table_ytp_tch_bzb" data-ofbid="concept_l2d_xk3_pzb__table_ytp_tch_bzb" data-cols="4"><caption></caption><colgroup><col style="width:18.726591760299627%"/><col style="width:19.101123595505616%"/><col style="width:19.288389513108616%"/><col style="width:42.88389513108614%"/></colgroup><thead class="- topic/thead thead">
|
||
<tr class="- topic/row">
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__1">分区</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__2">大小</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__3">-</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__4">备注</th>
|
||
</tr>
|
||
</thead><tbody class="- topic/tbody tbody">
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__1">spl</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__2">1MB</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__4">保存 SPL 备份的区域</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__1">uboot</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__2">2MB</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__4">保存 U-Boot,需要预留空闲备用块</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__1">env</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__2">1 Block</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__4">保存环境变量</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__1">envbak</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__2">1 Block</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__3">RAW</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__4">保存环境变量备份,可不用</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__1">dtb</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__2">1 Block</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__3">UBI</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__4">保存 kernel dtb</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__1">kernel</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__2">.</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__3">UBI</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__4">保存 kernel</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__1">rootfs</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__2">.</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__3">UBIFS</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__4">-</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__1">user</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__2">.</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__3">UBIFS</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__table_ytp_tch_bzb__entry__4">-</td>
|
||
</tr>
|
||
</tbody></table></div>
|
||
<p class="- topic/p p" data-ofbid="d112356e919__20250123155209">上述两个方案中,差别在于 dtb/kernel 部分是否使用 UBI 分区。由于使用 UBI 分区在启动速度上比使用 MTD 分区稍微慢一点,因此后续如果没有其他原因,
|
||
优先使用方案一的分区方式,即启动阶段读取的数据统一使用 MTD 分区保存。</p>
|
||
<p class="- topic/p p" data-ofbid="d112356e922__20250123155209"><strong class="+ topic/ph hi-d/b ph b">SPL 分区的特别说明</strong></p>
|
||
<p class="- topic/p p" data-ofbid="d112356e927__20250123155209">由于 NAND 可能会有坏块,为了尽可能的支持有坏块的 NAND 器件,ArtInChip 平台对 SPL 备份的存储方案做了一些特殊处理。</p>
|
||
<ul class="- topic/ul ul" id="concept_l2d_xk3_pzb__ul_w3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__ul_w3d_pch_bzb">
|
||
<li class="- topic/li li" data-ofbid="d112356e932__20250123155209">
|
||
<p class="- topic/p p" data-ofbid="d112356e934__20250123155209">首先在 NAND 存储设备中,烧录时 SPL 会保存 4 个备份,每个备份占用一个物理擦除块(PEB)。 因此在 NAND 中,共有 4 个 PEB 用来保存
|
||
SPL。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d112356e938__20250123155209">
|
||
<p class="- topic/p p" data-ofbid="d112356e940__20250123155209">保存 SPL 的 PEB 是从一个固定的候选 PEB 列表中选取的,具体可参考表 3.20 。 因此可能分布在 NAND 器件的不同位置。 由于 NAND
|
||
厂商保证前面几个块在出厂时不是坏块,因此大概率前面几个块会被选作 SPL 存储块。 因此 ArtInChip 默认将前面 1MB 分为 SPL
|
||
分区。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d112356e944__20250123155209">
|
||
<p class="- topic/p p" data-ofbid="d112356e946__20250123155209">PEB 中保存的 SPL 格式,不是原始的 SPL 数据。在烧录时,SPL 数据被分切为固定 2KB 大小的数据切片,
|
||
按照页(Page)进行保存,并且使用 Page Table 对这些数据切片进行管理。</p>
|
||
</li>
|
||
<li class="- topic/li li" data-ofbid="d112356e950__20250123155209">
|
||
<p class="- topic/p p" data-ofbid="d112356e952__20250123155209">被选中用于保存 SPL 的 PEB,会被标记为保留块(坏块)。因此在烧录 SPL 之后, NAND 上会出现几个被标记了的坏块,这是正常现象。</p>
|
||
</li>
|
||
</ul>
|
||
<div class="table-container"><table class="- topic/table table frame-all" id="concept_l2d_xk3_pzb__id2" data-ofbid="concept_l2d_xk3_pzb__id2" data-cols="3"><caption class="- topic/title title tablecap" data-caption-side="top" data-is-repeated="true"><span class="table--title-label">表<span class="table--title-label-number"> 3</span><span class="table--title-label-punctuation">. </span></span><span class="table--title">候选启动块列表</span></caption><colgroup><col style="width:16.773162939297126%"/><col style="width:15.974440894568689%"/><col style="width:67.25239616613419%"/></colgroup><thead class="- topic/thead thead">
|
||
<tr class="- topic/row">
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__id2__entry__1">优先顺序</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__id2__entry__2">Block ID</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__id2__entry__3">说明</th>
|
||
</tr>
|
||
</thead><tbody class="- topic/tbody tbody">
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">1</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">0</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">启动分区内,优先使用</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">2</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">1</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">启动分区内,优先使用</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">3</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">2</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">启动分区内,优先使用</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">4</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">3</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">启动分区内,优先使用</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">5</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">202</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">如果是好块,则作为启动块。写入启动镜像后标记为坏块</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">6</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">32</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">如果是好块,则作为启动块。写入启动镜像后标记为坏块</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">7</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">312</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">如果是好块,则作为启动块。写入启动镜像后标记为坏块</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">8</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">296</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">如果是好块,则作为启动块。写入启动镜像后标记为坏块</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">9</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">142</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">如果是好块,则作为启动块。写入启动镜像后标记为坏块</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">10</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">136</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">如果是好块,则作为启动块。写入启动镜像后标记为坏块</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">11</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">392</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">如果是好块,则作为启动块。写入启动镜像后标记为坏块</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">12</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">526</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">如果是好块,则作为启动块。写入启动镜像后标记为坏块</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">13</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">452</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">如果是好块,则作为启动块。写入启动镜像后标记为坏块</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">14</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">708</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">如果是好块,则作为启动块。写入启动镜像后标记为坏块</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">15</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">810</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">如果是好块,则作为启动块。写入启动镜像后标记为坏块</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">16</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">552</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">如果是好块,则作为启动块。写入启动镜像后标记为坏块</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">17</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">906</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">如果是好块,则作为启动块。写入启动镜像后标记为坏块</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__1">18</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__2">674</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id2__entry__3">如果是好块,则作为启动块。写入启动镜像后标记为坏块</td>
|
||
</tr>
|
||
</tbody></table></div>
|
||
</section>
|
||
<section class="- topic/section section" id="concept_l2d_xk3_pzb__section_x3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__section_x3d_pch_bzb"><h2 class="- topic/title title sectiontitle">SPI NOR 分区配置</h2>
|
||
|
||
<p class="- topic/p p" data-ofbid="d112356e1215__20250123155209">具体的分区在项目的 <span class="+ topic/ph sw-d/filepath ph filepath">image_cfg.json</span> 中配置,mk_image.py 生成镜像过程中,相关分区信息会被添加到
|
||
env.bin, 以 <span class="+ topic/keyword pr-d/parmname keyword parmname">MTD=</span> 格式存储在环境变量中:</p>
|
||
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="concept_l2d_xk3_pzb__codeblock_y3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__codeblock_y3d_pch_bzb"><code>MTD=size1@offset1(partition name1),size2@offset2(partition name2),-(last partition)</code></pre>
|
||
<p class="- topic/p p" data-ofbid="d112356e1227__20250123155209">其中 size 是分区的大小,offset 是分区的开始位置(相对 UDA 的开始位置,单位为字节)。 如果是最后一个分区,可以不设置
|
||
<span class="+ topic/keyword pr-d/parmname keyword parmname">size@offset</span>,使用 <span class="+ topic/keyword pr-d/parmname keyword parmname">-</span> 代替,表示剩余的所有空间都分配给该分区。</p>
|
||
<p class="- topic/p p" data-ofbid="d112356e1236__20250123155209">例如:</p>
|
||
<pre class="+ topic/pre pr-d/codeblock pre codeblock language-c" id="concept_l2d_xk3_pzb__codeblock_z3d_pch_bzb" data-ofbid="concept_l2d_xk3_pzb__codeblock_z3d_pch_bzb"><code>MTD=spi0.<span class="hl-number">0</span>:<span class="hl-number">128</span>k(spl),<span class="hl-number">512</span>k(uboot),<span class="hl-number">64</span>k(env),<span class="hl-number">64</span>k(envbak),<span class="hl-number">128</span>k(bootui),<span class="hl-number">128</span>k(dtb),
|
||
<span class="hl-number">5</span>m(kernel),<span class="hl-number">8</span>m(rootfs),-(user)</code></pre>
|
||
<div class="- topic/note note note note_note" id="concept_l2d_xk3_pzb__note_nzf_y4r_c1c" data-ofbid="concept_l2d_xk3_pzb__note_nzf_y4r_c1c"><span class="note__title">注:</span> <div class="note__body">
|
||
<p class="- topic/p p" data-ofbid="d112356e1245__20250123155209">mtdids 与使用的 spi 接口有关系。当使用 spi0 接口时,为 spi0.0。当使用 spi1 接口时,为 spi1.0</p>
|
||
</div></div>
|
||
<p class="- topic/p p" data-ofbid="d112356e1249__20250123155209"><strong class="+ topic/ph hi-d/b ph b">SPL 分区的特别说明</strong></p>
|
||
<p class="- topic/p p" data-ofbid="d112356e1253__20250123155209">NOR 分区时,BROM 启动过程中,固定从两个地方读取 SPL 程序的备份。 首先尝试读取 SPL 备份 1,如果验证失败,再尝试读取 SPL
|
||
备份 2。其中备份 2 是可选的。</p>
|
||
<div class="table-container"><table class="- topic/table table frame-all" id="concept_l2d_xk3_pzb__id3" data-ofbid="concept_l2d_xk3_pzb__id3" data-cols="3"><caption class="- topic/title title tablecap" data-caption-side="top" data-is-repeated="true"><span class="table--title-label">表<span class="table--title-label-number"> 4</span><span class="table--title-label-punctuation">. </span></span><span class="table--title">普通 NOR 的启动分区</span></caption><colgroup><col style="width:33.33333333333333%"/><col style="width:33.33333333333333%"/><col style="width:33.33333333333333%"/></colgroup><thead class="- topic/thead thead">
|
||
<tr class="- topic/row">
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__id3__entry__1">分区</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__id3__entry__2">大小/位置</th>
|
||
<th class="- topic/entry entry colsep-0 rowsep-0" id="concept_l2d_xk3_pzb__id3__entry__3">备注</th>
|
||
</tr>
|
||
</thead><tbody class="- topic/tbody tbody">
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id3__entry__1">备份 1</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id3__entry__2">128KB(0~128KB)</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id3__entry__3">必须</td>
|
||
</tr>
|
||
<tr class="- topic/row">
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id3__entry__1">备份 2</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id3__entry__2">128KB(128KB~256KB)</td>
|
||
<td class="- topic/entry entry colsep-0 rowsep-0" headers="concept_l2d_xk3_pzb__id3__entry__3">可选</td>
|
||
</tr>
|
||
</tbody></table></div>
|
||
</section>
|
||
</div>
|
||
</article></main></div>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</div>
|
||
|
||
<nav role="navigation" id="wh_topic_toc" aria-label="On this page" class="col-lg-2 d-none d-lg-block navbar d-print-none">
|
||
<div id="wh_topic_toc_content">
|
||
|
||
<div class=" wh_topic_toc "><div class="wh_topic_label">在本页上</div><ul><li class="section-item"><div class="section-title"><a href="#concept_l2d_xk3_pzb__section_h3d_pch_bzb" data-tocid="concept_l2d_xk3_pzb__section_h3d_pch_bzb">MMC 分区配置</a></div></li><li class="section-item"><div class="section-title"><a href="#concept_l2d_xk3_pzb__section_q3d_pch_bzb" data-tocid="concept_l2d_xk3_pzb__section_q3d_pch_bzb">SPI NAND 分区配置</a></div></li><li class="section-item"><div class="section-title"><a href="#concept_l2d_xk3_pzb__section_x3d_pch_bzb" data-tocid="concept_l2d_xk3_pzb__section_x3d_pch_bzb">SPI NOR 分区配置</a></div></li></ul></div>
|
||
|
||
</div>
|
||
</nav>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
</div>
|
||
<footer class="navbar navbar-default wh_footer">
|
||
<div class=" footer-container mx-auto ">
|
||
<title>footer def</title>
|
||
<style><!--
|
||
|
||
.p1 {
|
||
font-family: FangZhengShuSong, Times, serif;
|
||
}
|
||
.p2 {
|
||
font-family: Arial, Helvetica, sans-serif;
|
||
}
|
||
.p3 {
|
||
font-family: "Lucida Console", "Courier New", monospace;
|
||
}
|
||
|
||
--></style>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div class="webhelp.fragment.footer">
|
||
<p class="p1">Copyright © 2019-2024 广东匠芯创科技有限公司. All rights reserved.</p>
|
||
</div><div>
|
||
<div class="generation_time">
|
||
Update Time: 2025-01-23
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</footer>
|
||
|
||
<button id="go2top" class="d-print-none" title="返回顶部">
|
||
<span class="oxy-icon oxy-icon-up"></span>
|
||
</button>
|
||
|
||
<div id="modal_img_large" class="modal">
|
||
<span class="close oxy-icon oxy-icon-remove"></span>
|
||
<div id="modal_img_container"></div>
|
||
<div id="caption"></div>
|
||
</div>
|
||
|
||
|
||
<script src="${pd}/publishing/publishing-styles-AIC-template/js/custom.js" defer="defer"></script>
|
||
|
||
|
||
</body>
|
||
</html> |