{"id":763,"date":"2010-10-19T19:47:17","date_gmt":"2010-10-20T02:47:17","guid":{"rendered":"http:\/\/www.graphics-muse.org\/wp\/?p=763"},"modified":"2010-10-21T14:01:28","modified_gmt":"2010-10-21T21:01:28","slug":"beaglebox-which-u-boot-am-i-fiddling-with","status":"publish","type":"post","link":"https:\/\/www.graphics-muse.org\/wp\/?p=763","title":{"rendered":"BeagleBox: which u-boot am I fiddling with?"},"content":{"rendered":"<p>I fiddled with the u-boot env variables tonight to try and  resolve the S-Video problem.\u00a0 One trick from the BeagleBoard mailing  list said to set <span style=\"color: #003366;\"><em>omapfb.mode=tv:ntsc<\/em><\/span> and <span style=\"color: #003366;\"><em>omapdss.def_disp=tv<\/em><\/span>.\u00a0  I tried this but found that if I tried to run the boot manually\u00a0 to pick up these changes to the bootargs the  boot failed for various reasons related to how the rest of the environment is  set up.\u00a0 The only boot that works (albeit without S-Video support  properly configured) is the default boot.\u00a0 This boot reads the <span style=\"color: #003366;\"><strong>boot.scr<\/strong><\/span> file from the SD card, which is a text file from the Angstrom distro that has been run through with the <em>mkimage<\/em> tool from u-boot.\u00a0 Browsing <span style=\"color: #003366;\">recipes\/angstrom\/angstrom-uboot-scripts<\/span> I find a  couple of possible scripts that may be the one being used for  boot.scr.\u00a0 I&#8217;ll either have to decipher the angstrom build process for  BeagleBoard or just ask on the mailing list for which one is the one used to create the validation images for the C4 boards.<\/p>\n<p>This  idea of setting up u-boot via files on the SD card is interesting.\u00a0 I  can see why they&#8217;d want to do it &#8211; it&#8217;s easier to reconfigure u-boot by updating a file on the SD card than trying to rebuild u-boot and\/or flashing a ROM.\u00a0 What I don&#8217;t think I like (at least  not yet, I may change my mind) is how this differs from the way u-boot  is used in general.\u00a0 Maybe this has always been done and I&#8217;ve just never  seen it.\u00a0 But its another step in my build process that I&#8217;ll need to  add if I want to keep using the current x-loader on the C4 board I have.<\/p>\n<p>Of  course, if I change the boot loader (u-boot) on the SD card to  something other than what the BeagleBoard validation images use it&#8217;s  questionable if the use of the boot scripts will still work.\u00a0 I&#8217;m not  sure if the x-loader is loading u-boot from the SD card initially and *that* is the one that calls the boot.scr or if  there is a u-boot in the ROM that loads first and *that* is the one  whose env vars I&#8217;ve been mucking with.<\/p>\n<p>I think I need to ask the list for help on this.\u00a0 If anyone reads this and has the answer, please post a comment.\u00a0 Thanks!<\/p>\n<p><span style=\"color: #003366;\"><strong>Update: 2010-10-20<\/strong><\/span><\/p>\n<p>D&#8217;oh!\u00a0 Stupidity is setting in.\u00a0 It&#8217;s obvious there are two u-boots.\u00a0 The first one provided me the command line interface.\u00a0 I know this because I actually loaded the second one from the SD card!<\/p>\n<ul>\n<li><em><span style=\"color: #003366;\">mmc init<br \/>\n<\/span><\/em><\/li>\n<li><em><span style=\"color: #003366;\">fatload mmc ${loadaddr} uImage.bin<\/span><\/em><\/li>\n<\/ul>\n<p>The first command initialized access to the SD card.\u00a0 The second read the u-boot image from the card into an address.\u00a0 When I booted I ran what was at that address.\u00a0 Thus: 2 u-boots.<\/p>\n<p>So my changes to the env vars within the first u-boot obviously never got picked up by the second one.\u00a0 And the second one gets its environment settings from the *.scr scripts.\u00a0 So the only way to really change the environment is to create these scripts in text files and then turn them into image files with u-boot&#8217;s mkimage.\u00a0 Well, that&#8217;s not completely true but it is true if I want to continue using the x-loader\/u-boot already stored in ROM on the board.\u00a0 And I still need to make sure that my u-boot on the SD card is configured properly to pick up the boot scripts.\u00a0 I need to make sure it is.<\/p>\n<p>It&#8217;s amazing what a bad-night&#8217;s sleep can expose.<\/p>\n<p><span style=\"color: #003366;\"><strong>Update: 2010-10-21<\/strong><\/span><\/p>\n<p>And so it seems a night&#8217;s missed sleep doesn&#8217;t always help.\u00a0 According to <em>JKridner<\/em> on the <a href=\"http:\/\/beagleboard.org\/\">BeagleBoard latest news feeds<\/a> (thanks to him for offering some insight on this):<\/p>\n<p style=\"padding-left: 30px;\"><em>This post is wrong , but highly appreciated to explain what a user&#8217;s experience might be. uImage.bin is the Linux kernel, not u-boot. I&#8217;m not sure what the two u-boots could be, but if you have a C4, there could be one in the flash as well as one on the SD card.<\/em><\/p>\n<p>And so it is.\u00a0 Yet again &#8211; D&#8217;OH!\u00a0 Yes, I knew that <em>uImage<\/em> was the kernel.\u00a0 But I am, at far too frequent times these days, too stupid to pay attention to even what I&#8217;m writing, much less doing.\u00a0 Note that it&#8217;s easy to verify if u-boot is in NAND:\u00a0 don&#8217;t use an SD card and see if you can interrupt the boot.\u00a0 The x-loader may offer a command line but something tells me it doesn&#8217;t (need to verify that).\u00a0 Also, use an SD card but leave off the u-boot images (<a href=\"http:\/\/code.google.com\/p\/beagleboard\/wiki\/BeagleboardRevC3Validation\">the one titled u-boot.bin and the one titled u-boot-f.bin<\/a>).\u00a0 I need to identify which u-boot is reading the scripts.\u00a0 That way I can decide if I need one on the SD card or not.\u00a0 Automatic updates to u-boot on NAND might require it, but the question is &#8220;is the u-boot on SD required?&#8221;\u00a0 I&#8217;ll be in better shape when I can answer that question.<\/p>\n<p>In any case, I&#8217;ve been formulating my ideas on how I want it to work for BeagleBox.\u00a0 Assuming only one u-boot is running (be it from flash or SD card), I want to use it to read the scripts to handle my configuration.\u00a0 I can automate their generation as part of the build process for BeagleBox.\u00a0 But I better get a tighter grasp on exactly how this is all working if I expect to make this thing work correctly.\u00a0 Accidentally on purpose doesn&#8217;t count.\u00a0 I&#8217;m still trying to figure out what the MLO image is for &#8211; I&#8217;d found it once before so hopefully it&#8217;s in my blog somewhere.<\/p>\n<p>Finally, I guess I&#8217;m going to have to give more attention to working on this than an hour before The Daily Show each night.\u00a0 Especially when I&#8217;m going to have to start back into working on the update to my last GIMP book.\u00a0 I NEED TO FOCUS!!!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I fiddled with the u-boot env variables tonight to try and resolve the S-Video problem.\u00a0 One trick from the BeagleBoard mailing list said to set omapfb.mode=tv:ntsc and omapdss.def_disp=tv.\u00a0 I tried this but found that if I tried to run the boot manually\u00a0 to pick up these changes to the bootargs the boot failed for various [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[390,8,5],"tags":[447,376,381,444,642,439,442],"class_list":{"0":"post-763","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-beaglebox-hardware","7":"category-hardware","8":"category-linux","9":"tag-angstrom","10":"tag-beagleboard","11":"tag-beaglebox","12":"tag-ntsc","13":"tag-omapfb","14":"tag-s-video","15":"tag-sd-card","16":"czr-hentry"},"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pe9t8-cj","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/763","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=763"}],"version-history":[{"count":5,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/763\/revisions"}],"predecessor-version":[{"id":765,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/763\/revisions\/765"}],"wp:attachment":[{"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}