Jump to content
cubeberg

BBB problems - possible OS recommendations?

Recommended Posts

fyi, I saw the definitive way to enable virtual capes on bootup from panto on IRC...

12:47 < vaizki_> now that I have a "virtual cape" DTO fragment in /lib/firmware, what's the right way to enable it at boot?
12:47 < vaizki_> just do a systemd service that echos to the slots?
12:47 < panto> vaizki_, capemgr.enable_partno=FOO
12:48 < vaizki_> iin sysctl.conf I presume
12:50 < panto> vaizki_, no, in the kernel command line you pass
 
So uEnv.txt needs to be modified and capemgr.enable_partno=<blahblah> added to the "optargs" line I think.  I am assuming you can specify that multiple times or have a comma-separated list of partno's but I don't know.

Share this post


Link to post
Share on other sites

Like this?

root@beaglebone:~# pg /boot/uEnv.txt
optargs=run_hardware_tests quiet capemgr.enable_partno=spi0
(EOF):
 
I added it to the end, but it didn't seem to do anything after reboot.  Oddly enough - in the 6/20 release - it's back to bone_capemgr.8 instead of 9
 
I wrote a script to quickly enable spi0, but for some crazy reason it won't work in my script, but it will if I run from the command line

 

./spi.sh: line 4: /sys/devices/bone_capemgr.*/slots: No such file or directory

 

Share this post


Link to post
Share on other sites

Here is a copy of my uEnv.txt

 

bootdelay=1
ipaddr=192.168.xxx.xxx
serverip=192.168.xxx.xxx
static_ip=192.168.xxx.xxx:192.168.xxx.xxx:192.168.xxx.xxx:255.255.255.0:arm
rootpath=/home/william/rootfs,rsize=32768,wsize=32768
console=ttyO0,9600n8
optargs=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
loadtftp=tftpboot 0x80200000 /boot/uImage; tftpboot 0x815f0000 /boot/am335x-boneblack.dtb
netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},vers=3 rw ip=${static_ip}
uenvcmd=setenv autoload no; run loadtftp; run netargs; bootm 0x80200000 - 0x815f0000
 
the key things to note here for the case of this discussion is:
 
optargs= . . .
And
${optargs}
 
$optargs are parameters passed by uboot to the kernel. Or if you prefer $optargs are command line kernel arguments.
 
So if we take a look at http://git.denx.de/?p=u-boot.git;a=blob;f=include/configs/am335x_evm.h;hb=HEAD#l57 and study the various boot options like mmcargs netargs, nandargs etc, you will note each boot options makes  a call to  or specifies ${optargs}. Anyway what this means is that while we can use more complex boot options with ${optargs } called, or specified from within them, technically we can just assign a value to $optargs, and "know" that those parameters will be passed to the kernel. Since it is a uboot system environment variable that is always called.
 
So next to know is that the firmware or compiled DT file must exist in the /lib/firmware/ path. So If I run say -> ls /lib/firmware/ I should get back a list of potential file I might be able to use. If what I need does not exist, I need to either find a suitable file from somewhere else, or compile one myself. Then in need to place the file in the path /lib/firmware/ .Now let us say I did find what I need in /lib/firmware in just  a quick example ( of the only dt file i have in here right now ) enable-uart5-00A0.dtbo
 
I can enable this manually from the command line by doing:
 
echo enable-uart5 > /sys/devices/bone_capemgr.*/slots
 
or I can load it via uboot with the following statement.
optargs=capemgr.enable_partno=enable-uart5
 
The file extension, and what i can only guess at is the version(00A0) is ignored.
 
Anyhow hopefully I covered that in full enough detail ?

Share this post


Link to post
Share on other sites

Also for what its worth you technically should be able to run

 

echo enable-uart5 > /sys/devices/bone_capemgr.[0-9]/slots in place of using an asterisk. What this does is try to match anything after the period from 0 to 9. Single digit. ? would match any single character, and * will match anything after the period.

 

Maybe useful, maybe not ? *shrug*

Share this post


Link to post
Share on other sites

Thanks - I'll check that out - I think the "echo" problem must be something with my cut+paste.  When I type it manually it works great, but  if I run the script right after it fails.  I appreciate all the help!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...