[solved] 3.18.x (with DT): config leds in script.fex?

This forum is for supported devices using an ARMv7 Allwinner SoC.

[solved] 3.18.x (with DT): config leds in script.fex?

Postby crashmaster » Wed Jan 28, 2015 3:27 pm

With older kernels this works:
$this->bbcode_second_pass_code('', '
[leds_para]
leds_used = 1
leds_num = 2
leds_pin_1 = port:PH20<1><default><default><0>
leds_name_1 = "green:ph20:led1"
leds_default_1 = 0
leds_trigger_1 = "mmc0"
')

For the latest kernels (i use 3.18.x and i changed only the 'leds_name' to this (like i've seen in /sys):
$this->bbcode_second_pass_code('', '
[leds_para]
leds_used = 1
leds_num = 2
leds_pin_1 = port:PH20<1><default><default><0>
leds_name_1 = "cubieboard2:green:usr"
leds_default_1 = 0
leds_trigger_1 = "mmc0"
')

Doesn't work. What else should be changed ?

Thanks and regards, mmi
Last edited by crashmaster on Thu Jan 29, 2015 4:19 am, edited 1 time in total.
crashmaster
 
Posts: 119
Joined: Wed Mar 13, 2013 1:00 am

Re: Kernel 3.18.x (with DT): configuration (leds) in script.

Postby sehraf » Wed Jan 28, 2015 4:36 pm

since the fex-file is ignored by the kernel, you can edit your LEDs this way. I don't know if there is a fex equivalent ...

Though you can always set the LEDs as root through
$this->bbcode_second_pass_code('', '/sys/class/leds/*LED*/')

(on a cubietruck)
e.g. you can set the brightness or the trigger. To get all available triggers just run
$this->bbcode_second_pass_code('', '# cat /sys/class/leds/cubietruck\:blue\:usr/trigger')
to set a trigger (or anything else) just echo it
$this->bbcode_second_pass_code('', '# echo 'cpu0' > /sys/class/leds/cubietruck\:blue\:usr/trigger')


sehraf
sehraf
 
Posts: 69
Joined: Mon Feb 03, 2014 10:06 pm

Re: Kernel 3.18.x (with DT): configuration (leds) in script.

Postby crashmaster » Thu Jan 29, 2015 2:20 am

Hello sehraf and thanks for your reply.

I know how to set it via the kernel variables and i let it systemd do with a conf file in /etc/tmpfiles.d/ with this content, f.e.:
$this->bbcode_second_pass_code('', '
w /sys/class/leds/cubieboard2:blue:usr/trigger - - - - cpu0
w /sys/class/leds/cubieboard2:green:usr/trigger - - - - cpu1
')
It works but it was nicer to see the effect earlier - ok, i can try another place and it's not so important. ;)

You wrote:
$this->bbcode_second_pass_quote('', '.').. since the fex-file is ignored by the kernel ...

Does this mean the fex-file is basically obsolete now?
crashmaster
 
Posts: 119
Joined: Wed Mar 13, 2013 1:00 am

Re: Kernel 3.18.x (with DT): configuration (leds) in script.

Postby WarheadsSE » Thu Jan 29, 2015 2:46 am

When using a DT kernel, yes. It's dust.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Kernel 3.18.x (with DT): configuration (leds) in script.

Postby crashmaster » Thu Jan 29, 2015 4:16 am

Thanks - and a last question:
Is it possible to use the latest 'u-boot-sunxi-with-spl.bin' also on NAND ?
crashmaster
 
Posts: 119
Joined: Wed Mar 13, 2013 1:00 am

Re: [solved] 3.18.x (with DT): config leds in script.fex?

Postby sehraf » Thu Jan 29, 2015 11:21 am

no - as far as i know the (old) allwinner uboot version it the only one that boots from NAND.

sehraf

EDIT:
i accidentally came across this: https://github.com/torvalds/linux/blob/ ... i.dtsi#L14
since both (RPi and Cubieboard) are using GPIO LEDs this DT entry should work on a CB, too. Downside is that you need to edit your dts file and recompile it..
sehraf
 
Posts: 69
Joined: Mon Feb 03, 2014 10:06 pm

Re: [solved] 3.18.x (with DT): config leds in script.fex?

Postby WarheadsSE » Thu Jan 29, 2015 1:05 pm

The good news is, compiling a dts is not that hard :)

And hopefully, sunxi will be adding in overlay support.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: [solved] 3.18.x (with DT): config leds in script.fex?

Postby crashmaster » Fri Jan 30, 2015 2:52 am

@sehraf:
Thanks for the tip, i added the default-trigger to the leds node in sun7i-a20-cubieboard2.dtb using 'fdtput'
$this->bbcode_second_pass_code('', '
blue {
linux,default-trigger = "cpu0";
label = "cubieboard2:blue:usr";
gpios = <0x00000018 0x00000007 0x00000015 0x00000000>;
};
green {
linux,default-trigger = "cpu1";
label = "cubieboard2:green:usr";
gpios = <0x00000018 0x00000007 0x00000014 0x00000000>;
};
')

It works fine also on the cubieboard. :D


$this->bbcode_second_pass_quote('', 'T')he good news is, compiling a dts is not that hard

That's what i've looked for now and this seems to work: ;)

$this->bbcode_second_pass_code('', '
# DTS -> DTB:
dtc --in-format dts test.dts --out-format dtb -o test.dtb

# DTB to DTS:
dtc --in-format dtb test.dtb --out-format dts -o test.dts
')
crashmaster
 
Posts: 119
Joined: Wed Mar 13, 2013 1:00 am


Return to Allwinner

Who is online

Users browsing this forum: No registered users and 8 guests

cron