Where is the GPIO LED driver in this display?

109 views
Skip to first unread message

Robert Willy

unread,
Sep 6, 2015, 5:42:57 PM9/6/15
to BeagleBoard
Hi,

I have a TI Sitara SK board, similar to BeagleBone Black. Now it is with its new ti-processor-sdk-linux-am335x-evm-01.00.00.03 and boot to its work state, i.e. Matrix web application. When I run ps command, I have the following process:


root@am335x-evm:~# ps
  PID USER       VSZ STAT COMMAND
    1 root      1324 S    init [5]
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    5 root         0 SW<  [kworker/0:0H]
    7 root         0 SW<  [khelper]
    8 root         0 SW   [kdevtmpfs]
   49 root         0 SW   [kworker/0:1]
  272 root         0 SW<  [writeback]
  275 root         0 SW<  [bioset]
  276 root         0 SW<  [crypto]
  278 root         0 SW<  [kblockd]
  371 root         0 SW<  [ata_sff]
  382 root         0 SW   [khubd]
  495 root         0 SW<  [rpciod]
  510 root         0 SW   [kswapd0]
  511 root         0 SW   [fsnotify_mark]
  512 root         0 SW<  [nfsiod]
  691 root         0 SW<  [kpsmoused]
  775 root         0 SW<  [deferwq]
  778 root         0 SW   [irq/86-44e0b000]
  807 root         0 SW   [irq/150-mmc0]
  813 root         0 SW   [mmcqd/0]
  876 root      2828 S    /lib/udev/udevd -d
  964 root         0 SW<  [cryptodev_queue]
  980 root         0 SW<  [kworker/0:1H]
 1065 root         0 SW<  [pvr_timer]
 1243 root      2900 S    /lib/udev/udevd -d
 1244 root      2900 S    /lib/udev/udevd -d
 1267 root         0 SW   [jbd2/mmcblk0p2-]
 1268 root         0 SW<  [ext4-rsv-conver]
 1373 messageb  2356 S    /usr/bin/dbus-daemon --system
 1387 root      2148 S    /usr/sbin/dropbear -r /etc/dropbear/dropbear_rsa_hos
 1390 root      1872 S    /usr/sbin/telnetd
 1400 rpc       1936 S    /usr/sbin/rpcbind
 1413 rpcuser   1680 S    /usr/sbin/rpc.statd
 1422 root      1872 S    /sbin/syslogd -n -O /var/log/messages
 1425 root      1872 S    /sbin/klogd -n
 1429 nobody    2256 S    /usr/sbin/thttpd -d /srv/www -p 8080
 1481 root         0 SW<  [pvr_workqueue]
 1486 root      2900 S    /usr/sbin/lighttpd -f /etc/lighttpd.conf
 1500 root      164m S    /usr/bin/matrix_browser http://localhost:80/
 1622 root      2628 S    /bin/login --
 1623 root      1876 S    /sbin/getty 38400 tty1
 1646 root      2596 S    -sh
 1680 root         0 SW   [kworker/u2:0]
 1681 root         0 SW   [kworker/u2:1]
 1695 root         0 SW   [kworker/0:2]
 1703 root      2160 R    ps
.........
" 1500 root      164m S    /usr/bin/matrix_browser http://localhost:80/" is the matrix application I think.

When I run lsmod, there is such info:

root@am335x-evm:~# lsmod
Module                  Size  Used by
bufferclass_ti          5396  0
omaplfb                12042  1
musb_dsps               7319  0
musb_hdrc              54316  1 musb_dsps
snd_soc_evm             5589  0
pvrsrvkm              177007  6 bufferclass_ti,omaplfb
wlcore_sdio             5153  0
compat                  2624  1 wlcore_sdio
cryptodev              32483  1
lis3lv02d_i2c           3153  0
lis3lv02d              14936  1 lis3lv02d_i2c
snd_soc_tlv320aic3x    40349  1
input_polldev           3345  1 lis3lv02d
snd_soc_davinci_mcasp    15606  2
musb_am335x             1217  0
root@am335x-evm:~#
.............

The LEDS works as I can see it flashes, but I don't see it above in the modular list. What category is the LEDS in the driver modules?

Thanks,

William Hermans

unread,
Sep 6, 2015, 6:12:54 PM9/6/15
to beagl...@googlegroups.com
william@xanbustester:~/can-dev/can-web$ lsmod
Module                  Size  Used by
can_raw                 5555  3
can                    26598  1 can_raw
tda998x                11577  0
tilcdc                 24624  0
omap_sham              20563  0
omap_aes               12439  0
c_can_platform          6083  0
c_can                   9077  1 c_can_platform
omap_rng                4264  0
drm_kms_helper        103830  3 tda998x,tilcdc
rng_core                7113  1 omap_rng
can_dev                11496  1 c_can
uio_pdrv_genirq         3321  0
leds_gpio               3186  0
uio                     8146  1 uio_pdrv_genirq


william@xanbustester:~/can-dev/can-web$ ls /sys/class/leds/
beaglebone:green:usr0  beaglebone:green:usr1  beaglebone:green:usr2  beaglebone:green:usr3

IS this what you're asking, or are you asking which subsection the leds are in make menuconfig?

William Hermans

unread,
Sep 6, 2015, 6:14:54 PM9/6/15
to beagl...@googlegroups.com
For whats it's worth though none of the modules you have loaded resemble those that a beaglebone has loaded.

Robert Willy

unread,
Sep 6, 2015, 8:30:32 PM9/6/15
to BeagleBoard
Yes, your post:
leds_gpio               3186  0

is what I want. I don't know why my board has no such module.


For whats it's worth though none of the modules you have loaded resemble those that a beaglebone has loaded.

You think my board does not load leds? I have been supposing that Sitara board SK is similar to BeagleBone Black. It has 5 LEDS D1--D5, quite similar to BBB.

Thanks,

Robert Nelson

unread,
Sep 6, 2015, 11:48:59 PM9/6/15
to Beagle Board
On Sun, Sep 6, 2015 at 7:30 PM, Robert Willy <rxj...@gmail.com> wrote:
> Yes, your post:
> leds_gpio 3186 0
>
> is what I want. I don't know why my board has no such module.
>
> For whats it's worth though none of the modules you have loaded resemble
> those that a beaglebone has loaded.
>
> You think my board does not load leds? I have been supposing that Sitara
> board SK is similar to BeagleBone Black. It has 5 LEDS D1--D5, quite similar
> to BBB.

It 'could' be built-in.. BTW, we don't use crystal balls in this
email list. You should atleast add what kernel (uname -r) you are
using to the messages you post. if it's specific to TI's kernel sdk
release, the ti's e2e forums might actually be better..

Regards,

--
Robert Nelson
https://rcn-ee.com/

William Hermans

unread,
Sep 7, 2015, 12:36:04 AM9/7/15
to beagl...@googlegroups.com
Yes, your post:
leds_gpio               3186  0

is what I want. I don't know why my board has no such module.

For whats it's worth though none of the modules you have loaded resemble those that a beaglebone has loaded.

You think my board does not load leds? I have been supposing that Sitara board SK is similar to BeagleBone Black. It has 5 LEDS D1--D5, quite similar to BBB.

Thanks,

As Robert says, we do not know what kernel you're running. For that matter, we really have no idea what rootfs you're running either. We do not even know if its ubuntu, debian, or Angstrom*cough*.

So assuming best case scenario it's debian, and some form of 3.8.x kernel. If it does not use the same modules, then it is quite different.

Also, which board is this ? The original dual GbE ethenet board ?

RJ Wang

unread,
Sep 7, 2015, 8:32:40 AM9/7/15
to beagl...@googlegroups.com
The SDK is a rather new one from TI. It is released this year. The kernel is this one:

am335x-evm login: root                                                         
root@am335x-evm:~# uname -r                                                    
3.14.43-g875c69b

Thanks,

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/GoYJdV9MI3c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

RJ Wang

unread,
Sep 7, 2015, 8:38:26 AM9/7/15
to beagl...@googlegroups.com
The board is from TI, Sitara AM335(9?) Starter Kit board. There are two GbE (Ethernet) ports on the board. Thanks

RJ Wang

unread,
Sep 7, 2015, 8:49:19 AM9/7/15
to beagl...@googlegroups.com

Hi,

The lsmod online help says it reads /proc/modules.

The SK board is using NFS TFTP, see below please.


root@am335x-evm:~# cat /proc/cmdline                                            
console=ttyO0,115200n8 root=/dev/nfs nfsroot=192.168.0.109:/home/u64rj/ti-proces
sor-sdk-linux-am335x-evm-01.00.00.03/targetNFS,nolock rw ip=dhcp                
root@am335x-evm:~# lsmod                                                        
Module                  Size  Used by                                           


bufferclass_ti          5396  0                                                 
omaplfb                12042  1                                                 
musb_dsps               7319  0                                                 
musb_hdrc              54316  1 musb_dsps                                       
snd_soc_evm             5589  0                                                 

wlcore_sdio             5153  0                                                 
pvrsrvkm              177007  6 bufferclass_ti,omaplfb                          
compat                  2624  1 wlcore_sdio                                     


lis3lv02d_i2c           3153  0                                                 
lis3lv02d              14936  1 lis3lv02d_i2c                                   
snd_soc_tlv320aic3x    40349  1                                                 
input_polldev           3345  1 lis3lv02d                                       

cryptodev              32483  1                                                 
musb_am335x             1217  0                                                 
snd_soc_davinci_mcasp    15606  2 


On host Ubuntu PC folder: /home/u64rj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/targetNFS/proc, there is no file at all. Where is the above lsmod content from?

Thanks,

RJ Wang

unread,
Sep 7, 2015, 9:20:44 AM9/7/15
to beagl...@googlegroups.com
It looks like the question is not related to NFS. When I use sdcard file system. It still has no gpio module. See below please.
Thanks,

root@am335x-evm:~# lsmod
Module                  Size  Used by
bufferclass_ti          5396  0
omaplfb                12042  1
musb_dsps               7319  0
musb_hdrc              54316  1 musb_dsps
snd_soc_evm             5589  0
pvrsrvkm              177007  6 bufferclass_ti,omaplfb
wlcore_sdio             5153  0
compat                  2624  1 wlcore_sdio
cryptodev              32483  1
lis3lv02d_i2c           3153  0
lis3lv02d              14936  1 lis3lv02d_i2c
snd_soc_tlv320aic3x    40349  1
input_polldev           3345  1 lis3lv02d
snd_soc_davinci_mcasp    15606  2
musb_am335x             1217  0
root@am335x-evm:~#

RJ Wang

unread,
Sep 7, 2015, 10:20:07 AM9/7/15
to beagl...@googlegroups.com
Thanks. I just got feedback from e2e forum. GPIO is built in on my board. I know loadable module but not built-in module.
I have not found any info on built-in module.
Do you know where I can learn on built in module?

Thanks,

RJ Wang

unread,
Sep 7, 2015, 10:32:55 AM9/7/15
to beagl...@googlegroups.com
On link
it is talked about gpio

It has comments:
Note that standard kernel drivers exist for common "LEDs and Buttons"
GPIO tasks:  "leds-gpio" and "gpio_keys", respectively. Use those
instead of talking directly to the GPIOs; they integrate with kernel
frameworks better than your userspace code could.

What category does GPIO in BeagleBone Black belong to?
What is about the built-in GPIO in my AM3358 SK board?

Thanks,

Robert Nelson

unread,
Sep 7, 2015, 11:06:03 AM9/7/15
to Beagle Board


On Sep 7, 2015 9:32 AM, "RJ Wang" <rxj...@gmail.com> wrote:
>
> On link
> https://www.kernel.org/doc/Documentation/gpio/sysfs.txt
> it is talked about gpio
>
> It has comments:
>
> Note that standard kernel drivers exist for common "LEDs and Buttons"
> GPIO tasks:  "leds-gpio" and "gpio_keys", respectively. Use those
> instead of talking directly to the GPIOs; they integrate with kernel
> frameworks better than your userspace code could.
>
>
> What category does GPIO in BeagleBone Black belong to?

Led-gpio

>
> What is about the built-in GPIO in my AM3358 SK board?

Just actually look at the kernel dts file for you board.

Regards,

RJ Wang

unread,
Sep 7, 2015, 12:12:18 PM9/7/15
to beagl...@googlegroups.com
Thanks Robert. In am335x-evmsk.dts, there is leds definition:


    leds {
        pinctrl-names = "default", "sleep";
        pinctrl-0 = <&user_leds_default>;
        pinctrl-1 = <&user_leds_sleep>;

        compatible = "gpio-leds";

        led@1 {
            label = "evmsk:green:usr0";
            gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
            default-state = "off";
        };

        led@2 {
            label = "evmsk:green:usr1";
            gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
            default-state = "off";
        };

        led@3 {
            label = "evmsk:green:mmc0";
            gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
            linux,default-trigger = "mmc0";
            default-state = "off";
        };

        led@4 {
            label = "evmsk:green:heartbeat";
            gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
            linux,default-trigger = "heartbeat";
            default-state = "off";
        };
    };

On this board, there is no gpio when running lsmod. Does this .dts file tell me something?
I am new to this topic.


Just actually look at the kernel dts file for you board.

The above leds in .dts tells me something?

Thanks,


--

RJ Wang

unread,
Sep 7, 2015, 1:06:36 PM9/7/15
to beagl...@googlegroups.com
The .dtb file is about the device tree. It doesn't matter the device driver is built-in, or a loadable module. Is it right?

Thanks,

William Hermans

unread,
Sep 7, 2015, 1:13:21 PM9/7/15
to beagl...@googlegroups.com
there is no loadable module, because the kernel modules are compiled in statically. At least according to what you've posted above.

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.

RJ Wang

unread,
Sep 7, 2015, 1:18:24 PM9/7/15
to beagl...@googlegroups.com
I remember loadable module (device driver) is about some Linux device driver can be inserted, and can also be removed.
'statically'/dynamically is a different categorization or something else?
Some device drivers, not necessarily those essential components such as MMU, drive etc., cannot be removed?

Thanks,

William Hermans

unread,
Sep 7, 2015, 1:39:07 PM9/7/15
to beagl...@googlegroups.com
Static == compiled into the kernel.

Dynamic == Compiled as a module - Can be added / removed at will using modprobe - technically . . .

RJ Wang

unread,
Sep 7, 2015, 1:55:59 PM9/7/15
to beagl...@googlegroups.com
Static == compiled into the kernel.
Command lsmod does not show static module?

Dynamic == Compiled as a module - Can be added / removed at will using modprobe - technically . . .
lsmod will show dynamic module?


Thanks,

William Hermans

unread,
Sep 7, 2015, 1:56:20 PM9/7/15
to beagl...@googlegroups.com
Just t be clear . . .


Dynamic == Compiled as a module - Can be added / removed at will using modprobe - technically . . .

Just because you technically can, does not mean it is a good idea. Before using modprobe to remove a driver, you should probably at minimum understand the consequences of unloading that driver.

William Hermans

unread,
Sep 7, 2015, 1:58:58 PM9/7/15
to beagl...@googlegroups.com
Yes, and it is my guess that the led driver module you speak of is compiled into the kernel. Hence will not show up using lsmod.

Sometimes there is a kernel config file on the system you can grep to see if a certain module has been statically compiled in. But I'm not sure if that exists on that Linux image or not.

William Hermans

unread,
Sep 7, 2015, 2:10:52 PM9/7/15
to beagl...@googlegroups.com
SO on my system . .

william@xanbustester:~/can-dev/can-web$ stat /proc/config.gz
  File: `/proc/config.gz'
  Size: 33425           Blocks: 0          IO Block: 1024   regular file
Device: 4h/4d   Inode: 4026531946  Links: 1
Access: (0444/-r--r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2015-09-07 11:01:29.840792651 -0700
Modify: 2015-09-07 11:01:29.840792651 -0700
Change: 2015-09-07 11:01:29.840792651 -0700
 Birth: -
 
Is where it lives.

Example:

william@xanbustester:~/can-dev/can-web$ zcat /proc/config.gz | grep LEDS_GPIO
CONFIG_LEDS_GPIO=m

Anyway I found the correct LED config option b first using

william@xanbustester:~/can-dev/can-web$ zcat /proc/config.gz | grep LEDS

Lots of output I did not feel like pasting here . . .


Reply all
Reply to author
Forward
0 new messages