staylor has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aholler_ has joined #imx6-dev
aholler has quit [Ping timeout: 250 seconds]
staylor has joined #imx6-dev
staylor has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Er0l has quit [Remote host closed the connection]
Er0l has joined #imx6-dev
aholler_ has quit [Ping timeout: 250 seconds]
Er0l has quit [Read error: Connection reset by peer]
Er0l has joined #imx6-dev
Er0l has quit [Remote host closed the connection]
Er0l has joined #imx6-dev
Er0l has quit [Ping timeout: 245 seconds]
Er0l has joined #imx6-dev
Er0l_ has joined #imx6-dev
Er0l_ has quit [Remote host closed the connection]
Er0l has quit [Remote host closed the connection]
Er0l has joined #imx6-dev
Er0l_ has joined #imx6-dev
Er0l_ has quit [Client Quit]
Er0l has quit [Ping timeout: 250 seconds]
Er0l has joined #imx6-dev
Er0l has quit [Client Quit]
Er0l has joined #imx6-dev
paulk-aldrin has joined #imx6-dev
kimo_ has joined #imx6-dev
kimo_ has quit [Remote host closed the connection]
kimo_ has joined #imx6-dev
aholler has joined #imx6-dev
vstehle-work has joined #imx6-dev
rz2k_ has joined #imx6-dev
kimo_ has quit [Remote host closed the connection]
diego_r has joined #imx6-dev
FelixH has joined #imx6-dev
steeve has quit [Remote host closed the connection]
sjoerd has quit [Ping timeout: 265 seconds]
FelixH has quit [Quit: Leaving]
FelixH has joined #imx6-dev
<vpeter>
Hi, need little suggestion. I'm running same kernel + different device tree files on a different systems (but very similar). I need to run some code at power_off in linux kernel only on one system. How could I do that? How could I determinate on which system I am?
<aholler>
how do you give them hostnames?
<vpeter>
They all get same (default) hostname via /proc/sys/kernel/hostname.
steeve has joined #imx6-dev
<aholler>
ok, other way around, how do they get MACs?
<vpeter>
From OTP rom I think. And one system from kernel command line.
<jnettlet>
the MACs are set by fuses and can be read via the OTP
<aholler>
ok, so they are different, right?
<vpeter>
What I would like to do is to have in function kernel_power_off() if (system1) then use this GPIO else something different.
<jnettlet>
vpeter, what is the differentiating factors?
<vpeter>
I was not clear enough: One is SolidRun's CuBox-i, second is TBS Matrix, ... all have same Soc.
<jnettlet>
are they the same board, SOC ?
sjoerd has joined #imx6-dev
<vpeter>
different boards!
<jnettlet>
oh then you can query the device-tree for the model
<vpeter>
Yes, something that I would like to do. But don't know yet where to look for some code how to query :(
<aholler>
just ask for the machine model
<jnettlet>
vpeter, look at arch/arm/mach-imx/cpu.c
<aholler>
look at arch/arm/kernel/setup.c
<jnettlet>
or there
<aholler>
or drivers/of/fdt.c can't remember ;
<aholler>
)
<jnettlet>
also drivers/base/soc.c
<aholler>
fdt.c has a function named of_flat_dt_get_machine_name
<aholler>
just don't forget to release the dt-node afterwards. ok, not really necessary on shutdown ;)
<vpeter>
Found it. Now let's try to do something. Thank you both.
<aholler>
ok, releasing a node is not necessary with the stuff that function uses
steeve has quit [Read error: Connection reset by peer]
<aholler>
standard way would be to add a binding
<aholler>
;)
<aholler>
jnettlet: who burns the fuses? freescale or the oem?
<jnettlet>
aholler, oem
<aholler>
I wonder if all boards might use the same mac
<jnettlet>
it is possible but they shouldn't. Although you will find some dev boards do.
<vpeter>
aholler: And sometimes they forget to burn :) And then you get random MAC in kernel.
<jnettlet>
if the fuses aren't burnt then u-boot will make up a fake address...so will the in kernel driver
<aholler>
ah, thanks for the explanation. never looked at how that works for imx
<jnettlet>
you can burn the fuses yourself in u-boot or the kernel but be careful. You burn the wrong thing and you can toast your SOC
<jnettlet>
fyi if you write to a node in the otp directory of sysfs you are burning the fuse
<vpeter>
That's why I just leave it zero. And set in kernel command line.
<jnettlet>
I have been meaning to write a patch that makes it much harder to do
<aholler>
uh, yes, please do it. sounds dangerous
<vpeter>
One flag to enable writing?
<jnettlet>
I was thinking a writable otp node that you need to turn on first
<jnettlet>
or maybe a write procedure.
<aholler>
something like that. I wonder no else already cried.
<jnettlet>
I didn't even know about it until a couple of months ago. I thought that was all read only and you had to burn the fuses in u-boot
<jnettlet>
then I found out that all you had to do was echo "0" > /sys/path/to/otp/node and it was burnt, no confirmation or anything
<jnettlet>
notice I am making a gibberish path because I don't want people to copy and paste without knowing what they are doing
<jnettlet>
generally the important fuses are already burnt and can't be changed, but things like secure-boot can easily be enabled and that would be "bad"
<aholler>
the horrors some engineers implement or forget to remove when publishing their stuff
<aholler>
especially as the board is likely dead if one enables secure-boot without preparing it before
<vpeter>
Thank you again aholler and jnettlet. Just add few lines to read device tree and it compiles. So I'm on a good way. aholler, you mentioned to add a binding: any example for it?
<aholler>
any dt-enabled driver
<aholler>
just add something like <explode-on-shutdown> ;)
<vpeter>
But I want to use my board again after shutdown :)
<vpeter>
I think I found something and have enough info for now.
<aholler>
just did git grep otp arch/arm/mach-imx/ in order to do a quick-hack :/
<aholler>
@@ -246,7 +246,7 @@ static int fsl_otp_probe(struct platform_device *pdev)
<aholler>
otp_kattr[i].attr.name = desc[i];
<aholler>
otp_kattr[i].attr.mode = 0600;
<aholler>
otp_kattr[i].show = fsl_otp_show;
<aholler>
- otp_kattr[i].store = fsl_otp_store;
<aholler>
+// otp_kattr[i].store = fsl_otp_store;
<aholler>
attrs[i] = &otp_kattr[i].attr;
<aholler>
}
<aholler>
otp_attr_group->attrs = attrs;
<aholler>
jnettlet: I assume that does the trick, yes?
<aholler>
hmm, should set mode to 0400 too
<aholler>
still boots and everything is now ro ;)
<aholler>
what a crazy driver
<aholler>
sorry, but I don't understand such.
<aholler>
someone should write an harsh email to one of the imx-mls
<aholler>
like "please turn on your brain" or similiar
<aholler>
jnettlet: thanks for making me aware of that.
<jnettlet>
aholler, that should do it. no problem
<aholler>
jnettlet: if you write a patch, I would prefer to have a config-option to disable write at all which is by default disabled. It shouldn't even possible by default to write the otp with some more complicated stuff
staylor has joined #imx6-dev
<jnettlet>
aholler, well I would prefer to make the linux driver read only and only support burning fuses in u-boot
<aholler>
yes
steeve has joined #imx6-dev
<aholler>
jnettlet: if you don't want to write a patch, I could send one.
<jnettlet>
aholler, go right ahead. I am swamped in other things right now
<aholler>
ok, one minute, I just have to install ssmtp
steeve has quit [Ping timeout: 240 seconds]
steeve has joined #imx6-dev
steeve has quit [Remote host closed the connection]
silviof has quit [Read error: Connection reset by peer]
silviof has joined #imx6-dev
<aholler>
jnettlet: you might have to look into your spam-folder. gmail sometimes doesn't like me.
Er0l_ has joined #imx6-dev
Er0l has quit [Read error: Connection reset by peer]
<jnettlet>
aholler, quick suggestion. Can you make that a kernel config option?
<jnettlet>
it will probably be more easily accepted upstream if people can easily turn the old behavior back on. It should be defaulted to off
<aholler>
I don't think it should be a kernel option
<aholler>
and fsl_otp doesn't seem to be upstream
<aholler>
I assume any reasonable maintainer would it refuse it without that patch ;)
<jnettlet>
oh I thought it was already upstreamed.
<jnettlet>
I will merge it as is. thanks
<aholler>
i've just looked at 3.17, don't know if it's someone else queue
<aholler>
+in
<jnettlet>
must have been in a dream...make that a nightmare :)
<aholler>
vendor trees and even upstream already is often a nightmare ;)