|
| 1 | +<!DOCTYPE HTML> |
| 2 | +<html lang="ru" class="light sidebar-visible" dir="ltr"> |
| 3 | + <head> |
| 4 | + <!-- Book generated using mdBook --> |
| 5 | + <meta charset="UTF-8"> |
| 6 | + <title>Загрузка DTBO - Linux for ARM</title> |
| 7 | + |
| 8 | + |
| 9 | + <!-- Custom HTML head --> |
| 10 | + |
| 11 | + <meta name="description" content=""> |
| 12 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 13 | + <meta name="theme-color" content="#ffffff"> |
| 14 | + |
| 15 | + <link rel="icon" href="../../favicon.svg"> |
| 16 | + <link rel="shortcut icon" href="../../favicon.png"> |
| 17 | + <link rel="stylesheet" href="../../css/variables.css"> |
| 18 | + <link rel="stylesheet" href="../../css/general.css"> |
| 19 | + <link rel="stylesheet" href="../../css/chrome.css"> |
| 20 | + <link rel="stylesheet" href="../../css/print.css" media="print"> |
| 21 | + |
| 22 | + <!-- Fonts --> |
| 23 | + <link rel="stylesheet" href="../../FontAwesome/css/font-awesome.css"> |
| 24 | + <link rel="stylesheet" href="../../fonts/fonts.css"> |
| 25 | + |
| 26 | + <!-- Highlight.js Stylesheets --> |
| 27 | + <link rel="stylesheet" href="../../highlight.css"> |
| 28 | + <link rel="stylesheet" href="../../tomorrow-night.css"> |
| 29 | + <link rel="stylesheet" href="../../ayu-highlight.css"> |
| 30 | + |
| 31 | + <!-- Custom theme stylesheets --> |
| 32 | + <link rel="stylesheet" href="../../././mdbook-admonish.css"> |
| 33 | + <link rel="stylesheet" href="../../././1.css"> |
| 34 | + <link rel="stylesheet" href="../.././mdbook-admonish.css"> |
| 35 | + |
| 36 | + |
| 37 | + <!-- Provide site root to javascript --> |
| 38 | + <script> |
| 39 | + var path_to_root = "../../"; |
| 40 | + var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "ayu" : "light"; |
| 41 | + </script> |
| 42 | + <!-- Start loading toc.js asap --> |
| 43 | + <script src="../../toc.js"></script> |
| 44 | + </head> |
| 45 | + <body> |
| 46 | + <div id="body-container"> |
| 47 | + <!-- Work around some values being stored in localStorage wrapped in quotes --> |
| 48 | + <script> |
| 49 | + try { |
| 50 | + var theme = localStorage.getItem('mdbook-theme'); |
| 51 | + var sidebar = localStorage.getItem('mdbook-sidebar'); |
| 52 | + |
| 53 | + if (theme.startsWith('"') && theme.endsWith('"')) { |
| 54 | + localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1)); |
| 55 | + } |
| 56 | + |
| 57 | + if (sidebar.startsWith('"') && sidebar.endsWith('"')) { |
| 58 | + localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1)); |
| 59 | + } |
| 60 | + } catch (e) { } |
| 61 | + </script> |
| 62 | + |
| 63 | + <!-- Set the theme before any content is loaded, prevents flash --> |
| 64 | + <script> |
| 65 | + var theme; |
| 66 | + try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { } |
| 67 | + if (theme === null || theme === undefined) { theme = default_theme; } |
| 68 | + const html = document.documentElement; |
| 69 | + html.classList.remove('light') |
| 70 | + html.classList.add(theme); |
| 71 | + html.classList.add("js"); |
| 72 | + </script> |
| 73 | + |
| 74 | + <input type="checkbox" id="sidebar-toggle-anchor" class="hidden"> |
| 75 | + |
| 76 | + <!-- Hide / unhide sidebar before it is displayed --> |
| 77 | + <script> |
| 78 | + var sidebar = null; |
| 79 | + var sidebar_toggle = document.getElementById("sidebar-toggle-anchor"); |
| 80 | + if (document.body.clientWidth >= 1080) { |
| 81 | + try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { } |
| 82 | + sidebar = sidebar || 'visible'; |
| 83 | + } else { |
| 84 | + sidebar = 'hidden'; |
| 85 | + } |
| 86 | + sidebar_toggle.checked = sidebar === 'visible'; |
| 87 | + html.classList.remove('sidebar-visible'); |
| 88 | + html.classList.add("sidebar-" + sidebar); |
| 89 | + </script> |
| 90 | + |
| 91 | + <nav id="sidebar" class="sidebar" aria-label="Table of contents"> |
| 92 | + <!-- populated by js --> |
| 93 | + <mdbook-sidebar-scrollbox class="sidebar-scrollbox"></mdbook-sidebar-scrollbox> |
| 94 | + <noscript> |
| 95 | + <iframe class="sidebar-iframe-outer" src="../../toc.html"></iframe> |
| 96 | + </noscript> |
| 97 | + <div id="sidebar-resize-handle" class="sidebar-resize-handle"> |
| 98 | + <div class="sidebar-resize-indicator"></div> |
| 99 | + </div> |
| 100 | + </nav> |
| 101 | + |
| 102 | + <div id="page-wrapper" class="page-wrapper"> |
| 103 | + |
| 104 | + <div class="page"> |
| 105 | + <div id="menu-bar-hover-placeholder"></div> |
| 106 | + <div id="menu-bar" class="menu-bar sticky"> |
| 107 | + <div class="left-buttons"> |
| 108 | + <label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar"> |
| 109 | + <i class="fa fa-bars"></i> |
| 110 | + </label> |
| 111 | + <button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list"> |
| 112 | + <i class="fa fa-paint-brush"></i> |
| 113 | + </button> |
| 114 | + <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu"> |
| 115 | + <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li> |
| 116 | + <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li> |
| 117 | + <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li> |
| 118 | + <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li> |
| 119 | + <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li> |
| 120 | + </ul> |
| 121 | + <button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar"> |
| 122 | + <i class="fa fa-search"></i> |
| 123 | + </button> |
| 124 | + </div> |
| 125 | + |
| 126 | + <h1 class="menu-title">Linux for ARM</h1> |
| 127 | + |
| 128 | + <div class="right-buttons"> |
| 129 | + <a href="../../print.html" title="Print this book" aria-label="Print this book"> |
| 130 | + <i id="print-button" class="fa fa-print"></i> |
| 131 | + </a> |
| 132 | + <a href="https://github.com/linux-for-arm/handbook" title="Git repository" aria-label="Git repository"> |
| 133 | + <i id="git-repository-button" class="fa fa-github"></i> |
| 134 | + </a> |
| 135 | + <a href="https://github.com/linux-for-arm/handbook/edit/master/md/additional/u-boot/dtbo.md" title="Suggest an edit" aria-label="Suggest an edit"> |
| 136 | + <i id="git-edit-button" class="fa fa-edit"></i> |
| 137 | + </a> |
| 138 | + |
| 139 | + </div> |
| 140 | + </div> |
| 141 | + |
| 142 | + <div id="search-wrapper" class="hidden"> |
| 143 | + <form id="searchbar-outer" class="searchbar-outer"> |
| 144 | + <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header"> |
| 145 | + </form> |
| 146 | + <div id="searchresults-outer" class="searchresults-outer hidden"> |
| 147 | + <div id="searchresults-header" class="searchresults-header"></div> |
| 148 | + <ul id="searchresults"> |
| 149 | + </ul> |
| 150 | + </div> |
| 151 | + </div> |
| 152 | + |
| 153 | + <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM --> |
| 154 | + <script> |
| 155 | + document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible'); |
| 156 | + document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible'); |
| 157 | + Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) { |
| 158 | + link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1); |
| 159 | + }); |
| 160 | + </script> |
| 161 | + |
| 162 | + <div id="content" class="content"> |
| 163 | + <main> |
| 164 | + <h1 id="Загрузка-dtbo"><a class="header" href="#Загрузка-dtbo">Загрузка DTBO</a></h1> |
| 165 | +<p>Оверлеи Devicetree — это почти те же Devicetree-файлы, но с несколько иным синтаксисом. Пожалуйста, обратитесь к файлу <code>dt-object-internal.txt</code> в исходном коде компилятора devicetree за информацией о внутреннем формате оверлеев: <strong><a href="https://git.kernel.org/pub/scm/utils/dtc/dtc.git/tree/Documentation/dt-object-internal.txt">https://git.kernel.org/pub/scm/utils/dtc/dtc.git/tree/Documentation/dt-object-internal.txt</a></strong></p> |
| 166 | +<h2 id="Способы-использования-оверлеев-в-u-boot"><a class="header" href="#Способы-использования-оверлеев-в-u-boot">Способы использования оверлеев в U-Boot</a></h2> |
| 167 | +<p>Существует два способа применения оверлеев:</p> |
| 168 | +<ol> |
| 169 | +<li>Включить и определить оверлеи в FIT-образ и автоматически их применять;</li> |
| 170 | +<li>Вручную применять оверлеи;</li> |
| 171 | +</ol> |
| 172 | +<p>В оставшейся части документа будет рассмотрено использование оверлеев с помощью ручного подхода. Информацию об использовании оверлеев как части образа FIT можно найти в документе <code>doc/uImage.FIT/overlay-fdt-boot.txt</code> загрузчика U-Boot.</p> |
| 173 | +<h2 id="Ручная-загрузка-и-применение-оверлеев"><a class="header" href="#Ручная-загрузка-и-применение-оверлеев">Ручная загрузка и применение оверлеев</a></h2> |
| 174 | +<ol> |
| 175 | + <li>Определите, где разместить базовый devicetree и оверлей к нему. Убедитесь, что у вас достаточно места для наложения оверлея.</li> |
| 176 | + <pre><code>=> setenv fdtaddr 0x87f00000 |
| 177 | +=> setenv fdtovaddr 0x87fc0000</code></pre> |
| 178 | + <li>Загрузите базовый devicetree и оверлей к нему:</li> |
| 179 | + <pre><code>=> load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/base.dtb |
| 180 | +=> load ${devtype} ${bootpart} ${fdtovaddr} ${bootdir}/overlay.dtbo</code></pre> |
| 181 | + <li>Установите базовый devicetree как рабочее дерево FDT:</li> |
| 182 | + <pre><code>=> fdt addr $fdtaddr</code></pre> |
| 183 | + <li>Увеличте дерево FDT настолько, чтобы было возможно применить к нему все возможные (нужные для вас?) оверлеи:</li> |
| 184 | + <pre><code>=> fdt resize 8192</code></pre> |
| 185 | + <li>Примените оверлей:</li> |
| 186 | + <pre><code>=> fdt apply $fdtovaddr</code></pre> |
| 187 | + <li>Загрузите систему, как это делается с традиционным <code>dtb</code>.</li> |
| 188 | +</ol> |
| 189 | +<p>Для <code>bootm</code>:</p> |
| 190 | +<pre><code class="language-bash">=> bootm ${kerneladdr} - ${fdtaddr} |
| 191 | +</code></pre> |
| 192 | +<p>Для <code>bootz</code>:</p> |
| 193 | +<pre><code class="language-bash">=> bootz ${kerneladdr} - ${fdtaddr} |
| 194 | +</code></pre> |
| 195 | +<p>Обратите внимание, что в случае ошибки и базовый devicetree, и его оверлеи будут аннулированы, поэтому сохраните копии, чтобы избежать их перезагрузки.</p> |
| 196 | + |
| 197 | + </main> |
| 198 | + |
| 199 | + <nav class="nav-wrapper" aria-label="Page navigation"> |
| 200 | + <!-- Mobile navigation buttons --> |
| 201 | + <a rel="prev" href="../../additional/u-boot/env-vars.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left"> |
| 202 | + <i class="fa fa-angle-left"></i> |
| 203 | + </a> |
| 204 | + |
| 205 | + <a rel="next prefetch" href="../../additional/u-boot/partitions.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right"> |
| 206 | + <i class="fa fa-angle-right"></i> |
| 207 | + </a> |
| 208 | + |
| 209 | + <div style="clear: both"></div> |
| 210 | + </nav> |
| 211 | + </div> |
| 212 | + </div> |
| 213 | + |
| 214 | + <nav class="nav-wide-wrapper" aria-label="Page navigation"> |
| 215 | + <a rel="prev" href="../../additional/u-boot/env-vars.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left"> |
| 216 | + <i class="fa fa-angle-left"></i> |
| 217 | + </a> |
| 218 | + |
| 219 | + <a rel="next prefetch" href="../../additional/u-boot/partitions.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right"> |
| 220 | + <i class="fa fa-angle-right"></i> |
| 221 | + </a> |
| 222 | + </nav> |
| 223 | + |
| 224 | + </div> |
| 225 | + |
| 226 | + <!-- Livereload script (if served using the cli tool) --> |
| 227 | + <script> |
| 228 | + const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:'; |
| 229 | + const wsAddress = wsProtocol + "//" + location.host + "/" + "__livereload"; |
| 230 | + const socket = new WebSocket(wsAddress); |
| 231 | + socket.onmessage = function (event) { |
| 232 | + if (event.data === "reload") { |
| 233 | + socket.close(); |
| 234 | + location.reload(); |
| 235 | + } |
| 236 | + }; |
| 237 | + |
| 238 | + window.onbeforeunload = function() { |
| 239 | + socket.close(); |
| 240 | + } |
| 241 | + </script> |
| 242 | + |
| 243 | + |
| 244 | + |
| 245 | + <script> |
| 246 | + window.playground_copyable = true; |
| 247 | + </script> |
| 248 | + |
| 249 | + |
| 250 | + <script src="../../elasticlunr.min.js"></script> |
| 251 | + <script src="../../mark.min.js"></script> |
| 252 | + <script src="../../searcher.js"></script> |
| 253 | + |
| 254 | + <script src="../../clipboard.min.js"></script> |
| 255 | + <script src="../../highlight.js"></script> |
| 256 | + <script src="../../book.js"></script> |
| 257 | + |
| 258 | + <!-- Custom JS scripts --> |
| 259 | + |
| 260 | + |
| 261 | + </div> |
| 262 | + </body> |
| 263 | +</html> |
0 commit comments