mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Çağlar Kilimci" <ckilimci@gmail.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox <barebox@lists.infradead.org>
Subject: Re: Reach out "dirty" state value
Date: Tue, 25 Apr 2017 09:08:25 +0300	[thread overview]
Message-ID: <CAGUZs0=NzW1dFyjRus0b_WzUMkoBwiL9A4f9U5ZWqH6q1r3jxw@mail.gmail.com> (raw)
In-Reply-To: <20170425055130.x7zhlezvpkb7hmx3@pengutronix.de>

Hi Sascha,

2017-04-25 8:51 GMT+03:00 Sascha Hauer <s.hauer@pengutronix.de>:
> Hi Çağlar,
>
> On Mon, Apr 24, 2017 at 11:20:47AM +0300, Çağlar Kilimci wrote:
>> Hi all,
>>
>> I would like to use state framework and now I can read variables from
>> both barebox and regular kernel space. In addition, if I can change
>> from barebox, I can successfully read the changes from kernel space
>> but if I change from kernel space, I could not reach out the new value
>> from barebox. The dirty variable is set and I can see the new value
>> from eeprom (where I store the values) but I guess there would be
>> better way to reach out the "dirty" values. So, how can I read last
>> value for that state variable?
>
> If you get outdated variables in barebox that's a bug. You are on latest
> master, right? Do you have stridesize specified in the devicetree?

Yes, I am on the latest master. And yes, I have specified stridsize.
Here is my of_dump of my state device:

barebox@Phytec phyCORE AM335x:/ of_dump /state
state {
        magic = <0x4aaef393>;
        compatible = "barebox,state";
        backend-type = "raw";
        backend = <0x3f>;
        backend-storage-type = "direct";
        backend-stridesize = <0x10>;
        partname {
                reg = <0x0 0x10>;
                type = "string";
                default = "mmc0.1";
        };
        optional {
                reg = <0x10 0x10>;
                type = "string";
                default = "none";
        };
};

I do not know how to calculate stridsize.

Here is my state variable value and layout in the eeprom:
barebox@Phytec phyCORE AM335x:/ echo $state.partname
mmc0.1
barebox@Phytec phyCORE AM335x:/ md -s /dev/eeprom0
00000000: 2354fdf3 00000030 4aaef393 00200000                ..T#0......J.. .
00000010: c81ccb67 c3f780e7 30636d6d 0000322e                g.......mmc0.2..
00000020: 00000000 00000000 656e6f6e 00000000                ........none....
00000030: 00000000 00000000 7b88e6a4 d0dfb994                ...........{....
00000040: 30636d6d 0000312e 00000000 00000000                mmc0.1..........
00000050: 656e6f6e 00000000 00000000 00000000                none............
00000060: 00000065 00000000 00000000 00000000                e...............
00000070: 00000000 00000000 00000000 6e6f6e00                .............non
00000080: 00000065 00000000 00000000 00000000                e...............
00000090: 00000000 ffff0000 ffffffff ffffffff                ................
000000a0: ffffffff fdf3ffff 003b2354 f3630000                ........T#;...c.
000000b0: 0000456e d8a5002b 9732f9fc 0000873f                nE..+.....2.?...
000000c0: 65646568 00000000 00000000 00000000                hede............
000000d0: 656e6f6e 00000000 00000000 00000000                none............
000000e0: 00000000 00000000 ffffff00 ffffffff                ................
000000f0: ffffffff ffffffff ffffffff ffffffff                ................

And here is the output from Linux side:
root@phyboard-wega-am335x-1:~# barebox-state -n /state -d
No backend-storage-type found, using default.
WARNING, no stridesize given although we use a direct file write.
Starting in degraded mode
Failed to initialize desired amount of direct buckets, only 1 of 3 succeeded
New state registered 'state'
partname=mmc0.2
optional=none

--
Çağlar Kilimci

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2017-04-25  6:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-24  8:20 Çağlar Kilimci
2017-04-25  5:51 ` Sascha Hauer
2017-04-25  6:08   ` Çağlar Kilimci [this message]
2017-04-25  6:42     ` Sascha Hauer
2017-04-25  9:17       ` Çağlar Kilimci
2017-04-25 13:08         ` Çağlar Kilimci
2017-04-25 13:24           ` Çağlar Kilimci

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGUZs0=NzW1dFyjRus0b_WzUMkoBwiL9A4f9U5ZWqH6q1r3jxw@mail.gmail.com' \
    --to=ckilimci@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox