{"id":8062,"date":"2022-12-23T14:20:15","date_gmt":"2022-12-23T06:20:15","guid":{"rendered":"http:\/\/xinyiworld.top\/wordpress_it\/?p=8062"},"modified":"2022-12-30T14:31:20","modified_gmt":"2022-12-30T06:31:20","slug":"rk3588%e7%bc%96%e8%af%91-uboot%e4%ba%a4%e5%8f%89%e7%bc%96%e8%af%91","status":"publish","type":"post","link":"http:\/\/xinyiworld.top\/wordpress_it\/?p=8062","title":{"rendered":"rk3588\u7f16\u8bd1-uboot\u4ea4\u53c9\u7f16\u8bd1"},"content":{"rendered":"<p><a href=\"https:\/\/blog.csdn.net\/weixin_45309916\/article\/details\/109218569\">https:\/\/blog.csdn.net\/weixin_45309916\/article\/details\/109218569<\/a><\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/guyongqiangx\/article\/details\/52565493\">https:\/\/blog.csdn.net\/guyongqiangx\/article\/details\/52565493<\/a><br \/>\n<a href=\"https:\/\/blog.csdn.net\/guyongqiangx\/article\/details\/52761678\">https:\/\/blog.csdn.net\/guyongqiangx\/article\/details\/52761678<\/a><\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/whitefish520\/article\/details\/107635906\">https:\/\/blog.csdn.net\/whitefish520\/article\/details\/107635906<\/a><\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/m0_37761102\/article\/details\/121147426\">https:\/\/blog.csdn.net\/m0_37761102\/article\/details\/121147426<\/a><\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/weixin_45309916\/article\/details\/109218569\">https:\/\/blog.csdn.net\/weixin_45309916\/article\/details\/109218569<\/a><\/p>\n<p>u-boot\u76ee\u5f55\u4e0b\u7684<strong>make.sh<\/strong>\u811a\u672c\u6267\u884c <code>make PYTHON=python2 CROSS_COMPILE=\/home\/xinyi\/android\/code\/Task1-debian\/rk3588_source\/prebuilts\/gcc\/linux-x86\/aarch64\/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu\/bin\/aarch64-none-linux-gnu- all --jobs=16<\/code> \u6307\u4ee4<\/p>\n<p><strong>\u5206\u6790u-boot\u76ee\u5f55\u4e0bMakefile\u6587\u4ef6\uff1a<\/strong><br \/>\n<code>all:\t\t$(ALL-y) cfg<\/code><\/p>\n<p>\u53d8\u91cf$(ALL-y)\u7684\u503c\u4e3a\uff1acheckarmreloc u-boot.srec u-boot.bin u-boot.sym System.map binary_size_check spl\/u-boot-spl.bin u-boot.img tpl\/u-boot-tpl.bin u-boot.dtb u-boot-dtb.img<\/p>\n<p>\u7136\u540e\u6211\u4eec\u770b\u770b\u5404\u4e2a\u76ee\u6807\u53c8\u662f\u5982\u4f55\u751f\u6210\u7684\uff1a\uff08\u4ee5#\u4e3a\u5c42\u7ea7\u8868\u793a\u76ee\u6807\uff09<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_16 counter-hierarchy counter-decimal ez-toc-grey\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" style=\"display: none;\"><i class=\"ez-toc-glyphicon ez-toc-icon-toggle\"><\/i><\/a><\/span><\/div>\n<nav><ul class=\"ez-toc-list ez-toc-list-level-1\"><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=8062\/#checkarmrelocarm%E9%87%8D%E5%AE%9A%E4%BD%8D%E5%89%8D%E7%BC%80%E6%A3%80%E6%9F%A5\" title=\"checkarmreloc(arm\u91cd\u5b9a\u4f4d\u524d\u7f00\u68c0\u67e5)\">checkarmreloc(arm\u91cd\u5b9a\u4f4d\u524d\u7f00\u68c0\u67e5)<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=8062\/#u-boot_%EF%BC%88%E5%BC%BA%E5%88%B6%E6%9B%B4%E6%96%B0%EF%BC%89\" title=\"u-boot \uff08\u5f3a\u5236\u66f4\u65b0\uff09\">u-boot \uff08\u5f3a\u5236\u66f4\u65b0\uff09<\/a><ul class=\"ez-toc-list-level-4\"><li class=\"ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=8062\/#u-boot-init\" title=\"u-boot-init\">u-boot-init<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-4\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=8062\/#u-boot-main\" title=\"u-boot-main\">u-boot-main<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-5\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=8062\/#u-bootlds\" title=\"u-boot.lds\">u-boot.lds<\/a><ul class=\"ez-toc-list-level-5\"><li class=\"ez-toc-heading-level-5\"><a class=\"ez-toc-link ez-toc-heading-6\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=8062\/#prepare\" title=\"prepare\">prepare<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"checkarmrelocarm%E9%87%8D%E5%AE%9A%E4%BD%8D%E5%89%8D%E7%BC%80%E6%A3%80%E6%9F%A5\"><\/span>checkarmreloc(arm\u91cd\u5b9a\u4f4d\u524d\u7f00\u68c0\u67e5)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code class=\"language-bash\"># ARM relocations should all be R_ARM_RELATIVE (32-bit) or\n# R_AARCH64_RELATIVE (64-bit).\ncheckarmreloc: u-boot   \n    @RELOC=&quot;`$(CROSS_COMPILE)readelf -r -W $&lt; | cut -d &#039; &#039; -f 4 | \\\n        grep R_A | sort -u`&quot;; \\\n    if test &quot;$$RELOC&quot; != &quot;R_ARM_RELATIVE&quot; -a \\\n         &quot;$$RELOC&quot; != &quot;R_AARCH64_RELATIVE&quot;; then \\\n        echo &quot;$&lt; contains unexpected relocations: $$RELOC&quot;; \\\n        false; \\\n    fi<\/code><\/pre>\n<p>\u4e0a\u9762\u4ee3\u7801\u7684\u610f\u601d\uff1a\u5229\u7528readelf\u5de5\u5177\u8bfb\u53d6u-boot\u8fd9\u4e2a\u6587\u4ef6\uff0c\u6309' '\u622a\u53d6\u51fa\u7b2c4\u5217\uff0c\u6700\u540e\u5f97\u5230\u7684\u7ed3\u679c\u662fR_AARCH64_RELATIVE\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"u-boot_%EF%BC%88%E5%BC%BA%E5%88%B6%E6%9B%B4%E6%96%B0%EF%BC%89\"><\/span>u-boot \uff08\u5f3a\u5236\u66f4\u65b0\uff09<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash\">u-boot: $(u-boot-init) $(u-boot-main) u-boot.lds FORCE\n    +$(call if_changed,u-boot__)<\/code><\/pre>\n<p>\u4e0a\u9762\u7b2c\u4e8c\u884c+\u53f7\u8868\u793a\u4ec0\u4e48\u610f\u601d\uff1f\uff1f\uff1f<br \/>\n\u770b\u8fd9\u4e2a<strong>if_changed<\/strong>\u51fd\u6570\uff0c\u5230\u5904\u90fd\u5728\u4f7f\u7528\uff0c\u5b83\u5b9a\u4e49\u5728<code>scripts\/Kbuild.include<\/code>\u6587\u4ef6\u4e2d<\/p>\n<pre><code class=\"language-bash\">ifneq ($(KBUILD_NOCMDDEP),1)\n# Check if both arguments has same arguments. Result is empty string if equal.\n# User may override this check using make KBUILD_NOCMDDEP=1\narg-check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \\\n                    $(filter-out $(cmd_$@),   $(cmd_$(1))) )\nelse\narg-check = $(if $(strip $(cmd_$@)),,1)\nendif\n\n# Find any prerequisites that is newer than target or that does not exist.\n# PHONY targets skipped in both cases.\nany-prereq = $(filter-out $(PHONY),$?) $(filter-out $(PHONY) $(wildcard $^),$^)\n\n# Execute command if command has changed or prerequisite(s) are updated.\n#\nif_changed = $(if $(strip $(any-prereq) $(arg-check)),                       \\\n    @set -e;                                                             \\\n    $(echo-cmd) $(cmd_$(1));                                             \\\n    printf &#039;%s\\n&#039; &#039;cmd_$@ := $(make-cmd)&#039; &gt; $(dot-target).cmd)\n<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"u-boot-init\"><\/span>u-boot-init<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>u-boot-init := $(head-y)<br \/>\nhead-y\u662f\u5b9a\u4e49\u5728include arch\/$(ARCH)\/Makefile\u4e2d\uff0chead-y := arch\/arm\/cpu\/$(CPU)\/start.o<\/p>\n<h4><span class=\"ez-toc-section\" id=\"u-boot-main\"><\/span>u-boot-main<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>u-boot-main := $(libs-y)<\/p>\n<p>libs-y: arch\/arm\/cpu\/built-in.o  arch\/arm\/cpu\/armv8\/built-in.o  arch\/arm\/lib\/built-in.o  arch\/arm\/mach-rockchip\/built-in.o  board\/rockchip\/evb_rk3588\/built-in.o  cmd\/built-in.o  common\/built-in.o  disk\/built-in.o  drivers\/built-in.o  drivers\/cpu\/built-in.o  drivers\/dma\/built-in.o  drivers\/gpio\/built-in.o  drivers\/i2c\/built-in.o  drivers\/mtd\/built-in.o  drivers\/mtd\/onenand\/built-in.o  drivers\/mtd\/spi\/built-in.o  drivers\/net\/built-in.o  drivers\/net\/phy\/built-in.o  drivers\/pci\/built-in.o  drivers\/power\/built-in.o  drivers\/power\/battery\/built-in.o  drivers\/power\/charge\/built-in.o  drivers\/power\/domain\/built-in.o  drivers\/power\/dvfs\/built-in.o  drivers\/power\/fuel_gauge\/built-in.o  drivers\/power\/io-domain\/built-in.o  drivers\/power\/mfd\/built-in.o  drivers\/power\/pmic\/built-in.o  drivers\/power\/regulator\/built-in.o  drivers\/serial\/built-in.o  drivers\/spi\/built-in.o  drivers\/usb\/cdns3\/built-in.o  drivers\/usb\/common\/built-in.o  drivers\/usb\/dwc3\/built-in.o  drivers\/usb\/emul\/built-in.o  drivers\/usb\/eth\/built-in.o  drivers\/usb\/gadget\/built-in.o  drivers\/usb\/gadget\/udc\/built-in.o  drivers\/usb\/host\/built-in.o  drivers\/usb\/musb-new\/built-in.o  drivers\/usb\/musb\/built-in.o  drivers\/usb\/phy\/built-in.o  drivers\/usb\/ulpi\/built-in.o  env\/built-in.o  fs\/built-in.o  lib\/built-in.o  net\/built-in.o  test\/built-in.o  test\/dm\/built-in.o<\/p>\n<p>\u53ef\u4ee5\u53d1\u73b0u-boot-main\u4f9d\u8d56\u7740\u5404\u4e2a\u6a21\u5757\u6587\u4ef6\u5939\u4e0b\u7684built-in.o\u6587\u4ef6<\/p>\n<h4><span class=\"ez-toc-section\" id=\"u-bootlds\"><\/span>u-boot.lds<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>u-boot.lds: $(LDSCRIPT) prepare FORCE<br \/>\n$(call if_changed_dep,cpp_lds)<\/p>\n<p>$(LDSCRIPT)\u4e3a\uff1a<code>.\/arch\/arm\/cpu\/armv8\/u-boot.lds<\/code>\uff0c\u4e3a\u94fe\u63a5\u811a\u672c\u6587\u4ef6\u3002<\/p>\n<h5><span class=\"ez-toc-section\" id=\"prepare\"><\/span>prepare<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<pre><code class=\"language-bash\">\n# prepare3 is used to check if we are building in a separate output directory,\n# and if so do:\n# 1) Check that make has not been executed in the kernel src $(srctree)\nprepare3: include\/config\/uboot.release\nifneq ($(KBUILD_SRC),)\n    @$(kecho) &#039;  Using $(srctree) as source for U-Boot&#039;\n    $(Q)if [ -f $(srctree)\/.config -o -d $(srctree)\/include\/config ]; then \\\n        echo &gt;&amp;2 &quot;  $(srctree) is not clean, please run &#039;make mrproper&#039;&quot;; \\\n        echo &gt;&amp;2 &quot;  in the &#039;$(srctree)&#039; directory.&quot;;\\\n        \/bin\/false; \\\n    fi;\nendif\n\n# prepare2 creates a makefile if using a separate output directory\nprepare2: prepare3 outputmakefile\n\nprepare1: prepare2 $(version_h) $(timestamp_h) \\\n                   include\/config\/auto.conf\nifeq ($(wildcard $(LDSCRIPT)),)\n    @echo &gt;&amp;2 &quot;  Could not find linker script.&quot;\n    @\/bin\/false\nendif\n\narchprepare: prepare1 scripts_basic\n\nprepare0: archprepare FORCE\n    $(Q)$(MAKE) $(build)=.\n\n# All the preparing..\nprepare: prepare0<\/code><\/pre>\n<p><strong>\u8981\u70b9\u4e00\uff1a<\/strong><br \/>\n\u770b<code>$(Q)$(MAKE) $(build)=.<\/code>\u8fd9\u884c\u811a\u672c\uff0c\u5230\u5904\u90fd\u6709\u4f7f\u7528\uff0c\u5176\u4e2dbuild\u53d8\u91cf\u5b9a\u4e49\u5728<strong><code>scripts\/Kbuild.include<\/code><\/strong>\u6587\u4ef6\u4e2d.<\/p>\n<pre><code class=\"language-bash\"># Shorthand for $(Q)$(MAKE) -f scripts\/Makefile.build obj=\n# Usage:\n# $(Q)$(MAKE) $(build)=dir\nbuild := -f $(srctree)\/scripts\/Makefile.build obj<\/code><\/pre>\n<p>-f:\u6307\u5b9aMakefile\u4e3a  <code>u-boot\/scripts\/Makefile.build<\/code><\/p>\n<p>\u5173\u4e8e\u8fd9\u884c\u811a\u672c<strong><code>$(Q)$(MAKE) $(build)=.<\/code><\/strong>\u7684\u7406\u89e3\uff1a<br \/>\n<a href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=8101\">http:\/\/xinyiworld.top\/wordpress_it\/?p=8101<\/a><\/p>\n<p><strong>\u8981\u70b9\u4e8c\uff1a<\/strong><br \/>\n\u53ef\u4ee5\u770b\u5230prepare\u7684\u4f9d\u8d56\u94fe\u8def\u4e3a<code>prepare--&gt;prepare0--&gt;archprepare --&gt; prepare1--&gt; prepare2--&gt; prepare3--&gt; prepare1 --&gt; include\/config\/uboot.release<\/code><\/p>\n<p>uboot.release\u662f\u5f3a\u5236\u66f4\u65b0\u7684\uff0c\u5e76\u4e14\u4f9d\u8d56\u4e86include\/config\/auto.conf\u76ee\u6807\u3002<\/p>\n<pre><code class=\"language-bash\">include\/config\/uboot.release: include\/config\/auto.conf FORCE<\/code><\/pre>\n<button class=\"simplefavorite-button\" data-postid=\"8062\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>https:\/\/blog.csdn.net\/weixin_45309916\/article\/deta [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[475],"tags":[],"_links":{"self":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/8062"}],"collection":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8062"}],"version-history":[{"count":27,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/8062\/revisions"}],"predecessor-version":[{"id":8208,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/8062\/revisions\/8208"}],"wp:attachment":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8062"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}