Debian 3.18.13-bone70 /drivers/usb/serial/option.c doesn't exist : add support for qmi_wwan

167 views
Skip to first unread message

Matt Maher Peterson

unread,
Dec 7, 2015, 6:07:27 PM12/7/15
to BeagleBoard
Hi,

Working with a Telit LE910 Cell Module and am trying to get a driver working for usb connection.

I am following the guide provided by Telit

I have loaded the kernel headers and such so that I can see

usr
/src/linux-headers-3.8.13-bone70/drivers/usb/serial# ls
ezusb_convert
.pl  Kconfig  Makefile  Makefile-keyspan_pda_f


Did so by doing
apt-cache search linux-headers-3.8.13-bone70
apt
-get install linux-headers-3.8.13-bone70


My issues is the guide is asking my to looking in /drivers/usb/serial/option.c

I cannot find option.c ??

Robert Nelson

unread,
Dec 7, 2015, 6:10:55 PM12/7/15
to Beagle Board

It's not a header, so you won't find it in "linux-headers-3.8.13-bone70"

Regards,

--
Robert Nelson
https://rcn-ee.com/
Message has been deleted

Matt Maher Peterson

unread,
Dec 7, 2015, 6:14:59 PM12/7/15
to BeagleBoard
Thanks for the clarification Rpbert


What is the proper way to 'retrieve the appropriate kernel source code..." for 3.18.3-bone70?



Robert Nelson

unread,
Dec 7, 2015, 6:25:19 PM12/7/15
to Beagle Board
On Mon, Dec 7, 2015 at 5:13 PM, Matt Maher Peterson <mat...@apana.com> wrote:
Thanks for the clarification Rpbert


What is the proper way to 'retrieve the appropriate kernel source code..." for 3.18.3-bone70?


cd ./linux-stable-rcn-ee
git checkout `uname -r` -b tmp


or if you have an existing linus clone:

git clone --reference <dir_to_linux_git> https://github.com/RobertCNelson/linux-stable-rcn-ee
cd ./linux-stable-rcn-ee
git checkout `uname -r` -b tmp

uname -r = 3.18.3-bone70 or whatever version...

Regards,

Matt Maher Peterson

unread,
Dec 7, 2015, 7:15:28 PM12/7/15
to BeagleBoard
Thanks Robert.

I found the file and everything seams legit.  The real issue I was trying to solve was that when plugging this device in to the USB input I was not getting the corresponding /dev/USBX's.

After doing a
modprobe option
echo
1bc7 1201 > /sys/bus/usb-serial/drivers/option1/new_id

I now see my /dev/USB1 thru /dev/USB6

Why do I have to do these manual commands?  I guess I can scripts these on boot but is there a better option.

Kind Regards,

Matt

Robert Nelson

unread,
Dec 7, 2015, 7:19:49 PM12/7/15
to Beagle Board
On Mon, Dec 7, 2015 at 6:15 PM, Matt Maher Peterson
<matt.mahe...@hydro-care.com> wrote:
> Thanks Robert.
>
> I found the file and everything seams legit. The real issue I was trying to
> solve was that when plugging this device in to the USB input I was not
> getting the corresponding /dev/USBX's.
>
> After doing a
> modprobe option
> echo 1bc7 1201 > /sys/bus/usb-serial/drivers/option1/new_id
>
> I now see my /dev/USB1 thru /dev/USB6
>
> Why do I have to do these manual commands? I guess I can scripts these on
> boot but is there a better option.

Well, you don't have to run 3.8.x:

https://github.com/beagleboard/linux/blob/4.1.13-ti-r35/drivers/usb/serial/option.c#L266-L274

Run "4.1.13-ti-r35" and it'll just work. ;)

Matt Maher Peterson

unread,
Dec 7, 2015, 7:21:42 PM12/7/15
to BeagleBoard
Yes I could but I have a custom device tree written to work in the old world of 3.18.3 Is there a simple way to port that into 4.1.13.ti.r35 ?

William Hermans

unread,
Dec 7, 2015, 8:09:22 PM12/7/15
to beagl...@googlegroups.com
There is no porting. You simply compile it with the proper device tree version. Which is different from the version used for 3.8.x.

http://www.embeddedhobbyist.com/2015/09/beaglebone-black-updating-device-tree-files/

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William Hermans

unread,
Dec 7, 2015, 8:12:24 PM12/7/15
to beagl...@googlegroups.com
Anyway, if you apt-get install <whichever> linux-image, and it ends up not working for you, simply change the uname-r variable in /boot/uEnv.txt ( to point to your 3.8.x kernel ). And problem solved. After that, an apt-get remove --purge <linux-image> should get rid of all traces of the newer 4.1.x kernel. *IF* that's what you want.

Robert Nelson

unread,
Dec 7, 2015, 8:33:19 PM12/7/15
to Beagle Board
On Mon, Dec 7, 2015 at 6:21 PM, Matt Maher Peterson
<matt.mahe...@hydro-care.com> wrote:
> Yes I could but I have a custom device tree written to work in the old world
> of 3.18.3 Is there a simple way to port that into 4.1.13.ti.r35 ?

Yeap, two options, install 4.1.13.ti.r35

Then use the dtb-rebuilder to build your matching *.dtb and boot with it:

https://github.com/RobertCNelson/dtb-rebuilder/tree/4.1-ti

or use the bb.org-overlays to build a custom *.dtbo overlay

https://github.com/beagleboard/bb.org-overlays

the biggest delta is gpio #'ing but the rest we can help with..

Matt Maher Peterson

unread,
Dec 8, 2015, 1:17:35 PM12/8/15
to BeagleBoard
OK so I upgraded to 4.1.13.ti.r35

How do I use this rebuilder?

Just to confirm I have a custom .dtbo name BB-APA-01 that loaded on boot where I had it baked into the kernel.  I did not add it uEnv.txt but it still loaded. 

Here is what I tried to get cape loaded:

root@mmpTestBox:~# dmesg | grep BB-APA
[    0.000000] Kernel command line: console=ttyO0,115200n8 capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN capemgr.enable_partno=BB-APA-01 root=UUID=38808bbf-7f2e-469d-8ff6-e5eec3303fc9 ro rootfstype=ext4 rootwait fixrtc quiet init=/lib/systemd/systemd
root@mmpTestBox:~# cat /sys/devices/platform/bone_capemgr/slots
 0: PF----  -1
 1: PF----  -1
 2: PF----  -1
 3: PF----  -1
root@mmpTestBox:~# sh -c "echo 'BB-APA-01' > /sys/devices/platform/bone_capemgr/slots"
root@mmpTestBox:~# cat /sys/devices/platform/bone_capemgr/slots
 0: PF----  -1
 1: PF----  -1
 2: PF----  -1
 3: PF----  -1
root@mmpTestBox:~# dmesg | grep BB-APA-01
[    0.000000] Kernel command line: console=ttyO0,115200n8 capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN capemgr.enable_partno=BB-APA-01 root=UUID=38808bbf-7f2e-469d-8ff6-e5eec3303fc9 ro rootfstype=ext4 rootwait fixrtc quiet init=/lib/systemd/systemd
[  224.000061] bone_capemgr bone_capemgr: part_number 'BB-APA-01', version 'N/A'
[  224.000251] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,BB-APA-01'

Matt Maher Peterson

unread,
Dec 8, 2015, 7:01:21 PM12/8/15
to BeagleBoard
So I was able to to get the custom dtbo loaded after recompiling it with:

dtc -O dtb -o BB-APA-01-00A0.dtbo -b 0 -@ BB-APA-02-00A0.dts

Did the UARTS get renamed? I also had to remove this from the dts to get it to comiple:

     fragment@4 {
               target
= <&uart6>;
               __overlay__
{
                       pinctrl
-names = "default";
                       pinctrl
-0 = <&uart5_pins>;
                       status
= "okay";
               
};
       
};

Doesn't seam to be loading on boot despite having entered it in /boot/uEnv.txt:

cape_enable=capemgr.enable_partno=BB-APA-01




I can manually load it:

root@mmpTestBox:/sys/class/gpio# cat /sys/devices/platform/bone_capemgr/slots

 
0: PF----  -1
 
1: PF----  -1
 
2: PF----  -1
 
3: PF----  -1

root@mmpTestBox
:/sys/class/gpio# sh -c "echo 'BB-APA-01' > /sys/devices/platform/bone_capemgr/slots"
root@mmpTestBox
:/sys/class/gpio# cat /sys/devices/platform/bone_capemgr/slots

 
0: PF----  -1
 
1: PF----  -1
 
2: PF----  -1
 
3: PF----  -1

 
4: P-O-L-   0 Override Board Name,00A0,Override Manuf,BB-APA-01

After manually loading it:

Now I have an issued with ADC.setup() from the adafruit library.  Wasn't an issue before I update:

/powerMGMT.py", line 46, in shorePowerCheck
    ADC.setup()
RuntimeError: Unable to setup ADC system. Possible causes are:
  - A cape with a conflicting pin mapping is loaded
  - A device tree object is loaded that uses the same name for a fragment: helper


Any ideas?



Robert Nelson

unread,
Dec 8, 2015, 7:46:42 PM12/8/15
to Beagle Board
On Tue, Dec 8, 2015 at 6:01 PM, Matt Maher Peterson
<matt.mahe...@hydro-care.com> wrote:
> So I was able to to get the custom dtbo loaded after recompiling it with:
>
> dtc -O dtb -o BB-APA-01-00A0.dtbo -b 0 -@ BB-APA-02-00A0.dts
>
> Did the UARTS get renamed? I also had to remove this from the dts to get it
> to comiple:
>
> fragment@4 {
> target = <&uart6>;
> __overlay__ {
> pinctrl-names = "default";
> pinctrl-0 = <&uart5_pins>;
> status = "okay";
> };
> };

Yeap:

https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-UART5-00A0.dts#L44


>
> Doesn't seam to be loading on boot despite having entered it in
> /boot/uEnv.txt:
>
> cape_enable=capemgr.enable_partno=BB-APA-01

cape_enable=bone_capemgr.enable_partno=BB-APA-01
There's a patch in this thread:

https://github.com/adafruit/adafruit-beaglebone-io-python/issues/80#issuecomment-161431164
Message has been deleted

Matt Maher Peterson

unread,
Dec 8, 2015, 7:51:58 PM12/8/15
to BeagleBoard
How do I apply this patch?

Robert Nelson

unread,
Dec 8, 2015, 8:07:36 PM12/8/15
to Beagle Board
On Tue, Dec 8, 2015 at 6:50 PM, Matt Maher Peterson <mat...@apana.com> wrote:
> How do I apply this patch?


git clone https://github.com/adafruit/adafruit-beaglebone-io-python

cd ./adafruit-beaglebone-io-python

wget https://gist.githubusercontent.com/grizmio/bc752dd070652f21266b/raw/336b5ab5ad14ef28341edfeff6cbf20d959d2f70/gistfile1.txt

patch -p1 < gistfile1.txt

sudo python setup.py install

Matt Maher Peterson

unread,
Dec 9, 2015, 11:42:08 AM12/9/15
to BeagleBoard
Thanks that worked to adafruit library working.


Still having an issues getting the device tree to load on boot. 

Is there a better way to do this than in /boot/uEnv.txt ?  I have this line in there now but it does not seam to do the job as I do not see the overlay loaded after boot in .../slots
cape_enable=capemgr.enable_partno=BB-APA-01




I can manually load it:

root@mmpTestBox:/sys/class/gpio# cat /sys/devices/platform/bone_capemgr/slots

 
0: PF----  -1
 
1: PF----  -1
 
2: PF----  -1
 
3: PF----  -1

root@mmpTestBox
:/sys/class/gpio# sh -c "echo 'BB-APA-01' > /sys/devices/platform/bone_capemgr/slots"
root@mmpTestBox
:/sys/class/gpio# cat /sys/devices/platform/bone_capemgr/slots

 
0: PF----  -1
 
1: PF----  -1
 
2: PF----  -1
 
3: PF----  -1

 
4: P-O-L-   0 Override Board Name,00A0,Override Manuf,BB-APA-01

I believe in the old kernel 3.8.x I fuound a way to bake the overlay kernel.  Is this possible in 4.1.x?

Robert Nelson

unread,
Dec 9, 2015, 11:51:48 AM12/9/15
to Beagle Board
The trick is in the "bb-customizations" package:

Encase you don't have it installed:

https://github.com/rcn-ee/repos/blob/master/bb-bb-customizations/suite/jessie/debian/dtbo

if [ ! -x /usr/share/initramfs-tools/hooks/dtbo ] ; then
sudo chmod +x /usr/share/initramfs-tools/hooks/dtbo
fi

then just:

sudo update-initramfs -u -k $(uname -r)

and it'll be in your initrd.

Matt Maher Peterson

unread,
Dec 9, 2015, 12:13:51 PM12/9/15
to BeagleBoard
Thanks for bearing with me here.

I did a wget  https://github.com/rcn-ee/repos/blob/master/bb-bb-customizations/suite/jessie/debian/dtbo

Now do I add this to the file?

if [ ! -x /usr/share/initramfs-tools/

hooks
/dtbo ] ; then
    sudo chmod
+x /usr/share/initramfs-tools/hooks/dtbo
fi

and then
sudo update-initramfs -u -k $(uname -r)

Just to confirm my BB-APA-01-00A0.dtbo is in /lib/firmware and loads manually.

I can see that usr/share/initramfs-tools/hooks/dtbo file matches what you have in the repo

William Hermans

unread,
Dec 9, 2015, 2:48:50 PM12/9/15
to beagl...@googlegroups.com
Now do I add this to the file?

if [ ! -x /usr/share/initramfs-tools/
hooks
/dtbo ] ; then
    sudo chmod
+x /usr/share/initramfs-tools/hooks/dtbo
fi

That's bash script programmer speak for making that file executable, if it's not already ;)


--

William Hermans

unread,
Dec 9, 2015, 2:52:21 PM12/9/15
to beagl...@googlegroups.com
In other words. if the file /usr/share/initramfs-tools/hooks/dtbo is not already executable run chmod +x on it. *OR* You could create a bash script, drop that code into it. Make the script executable, then run it. And it'd do it for you. Pick your poison.

Matt Maher Peterson

unread,
Dec 9, 2015, 5:46:42 PM12/9/15
to BeagleBoard
Ah k.  lol that makessense now.

Have that done but still not loading my overlay on boot...
Reply all
Reply to author
Forward
0 new messages