Where is the GPIO LED driver in this display?

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@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?

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

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,

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,

Yes, your post:

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,

The board is from TI, Sitara AM335(9?) Starter Kit board. There are two GbE (Ethernet) ports on the board. Thanks

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,

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:~#

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,

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?
What is about the built-in GPIO in my AM3358 SK board?

Thanks,

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,

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,

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,

there is no loadable module, because the kernel modules are compiled in statically. At least according to what you’ve posted above.

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,

Static == compiled into the kernel.

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

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,

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.