From: Dave H. <dhy...@gm...> - 2010-01-20 17:21:28
|
Hi Mino, On Wed, Jan 20, 2010 at 7:38 AM, Mino Bernardi <mi...@mi...> wrote: > Hi all, > I'd need to set the I2C bus speed to 100kHz, so I followed the > instructions and issued a: > > setenv bootargs i2c_bus=3,100 > > in uBoot, followed by a "saveenv". I can then see the option correctly > with "printenv", however these options seems to be ignored by the > kernel boot: > > root@overo:~# dmesg | grep "command line" > Kernel command line: console=ttyS2,115200n8 vram=12M > omapfb.mode=dvi:1024x768MR-16@60 omapfb.debug=y omapdss.def_disp=dvi > root=/dev /mtdblock4 rw rootfstype2 > > And so the speed remains to 400kHz: > > root@overo:~# dmesg | grep i2c > i2c_omap i2c_omap.1: bus 1 rev3.12 at 2600 kHz > i2c_omap i2c_omap.3: bus 3 rev3.12 at 400 kHz > > Am I doing anything wrong? Yep :) What happens is that u-boot runs the contents of the variable called bootcmd. It eventually calls either mmcboot or nandboot, both of which set bootargs, which means that they'll wipe out anything that you set. So, you'll want to add your stuff to the end of mmcargs or nandargs. Now, I'd probably do this by adding something like ${extrabootargs} to the end of each, and then put your stuff in the extrabootargs variable. This is also easier if you're just experimenting. When you're changing the variable, make sure you use single quotes: setenv mmcargs 'console=${console} vram=${vram} omapfb.mode=dvi:${dvimode} omapfb.debug=y omapdss.def_disp=${defaultdisplay} root=${mmcroot} rootfstype=${mmcrootfstype} ${extrabootargs}' The above was from my version of u-boot - I recommend that you copy and paste from your own. After you're done make sure that you do a printenv to verify that the variable are still unexpanded. If you were to do: setenv bar 123 setenv foo1 "${bar}" setenv foo2 '${bar}' setenv foo3 ${bar} printenv you would see: bar=123 foo1=123 foo2=${bar} foo3=123 On that note, you can add to to mmcargs by doing: setenv mmcargs ${mmcargs} '${extrabootargs}' Again, do a printenv to verify that things are the way you want. Finally, do a saveenv to make it permanent. You can also examine the kernel command line to see if it "took". Look in the boot log, a few lines after the "Uncompressing Linux...." and you should see something like: Kernel command line: console=ttyS2,115200n8 vram=12M omapfb.mode=dvi:1024x768MR-16@60 omapfb.debug=y omapdss.def_disp=dvi root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait You can also do: cat /proc/cmdline to see the command line that the kernel was booted with. -- Dave Hylands Shuswap, BC, Canada http://www.DaveHylands.com/ |