[OE-core] [PATCH] busybox: add devmem

Leon Woestenberg leon at sidebranch.com
Thu Jan 31 12:14:35 UTC 2019


On Thu, Jan 31, 2019 at 11:16 AM Philip Balister <philip at balister.org> wrote:
>
> On 01/30/2019 09:09 PM, Scott Ellis wrote:
> > Is the busybox devmem functionally different then the standalone devmem2
> > package?
>
> Replying again ....
>
> I've been told they are functionally different and to use devmem2. I
> think the issue with the busybox version is that it does a readback when
> writing, this can be bad for some hardware.
>
And the fact that the devmem2 tool is written with no fixed integer
width. You have to understand that on a 64-bit system, reading a
"word" from a 32-bit hardware peripheral (most are), you are touching
two registers.

        case 'h':
            read_result = *((unsigned short *) virt_addr);
            break;
        case 'w':
            read_result = *((unsigned long *) virt_addr);
            break;

I rewrote it once to use uint<N>_t but I do not think there is a
proper upstream repository / maintenance going on.

Not sure about devmem in Busybox.

Anyway, devmem being useful for development, I do not see why it
should be in BusyBox by default.  We are not shipping devmem2 and
should not.
We can have such reasoning for every tool out there. I rather would
have a single switch to include tools like these.

I disagree that devmem(2) should be included for purposes such as
pin-muxing. Yes, I use it weekly for that during bring-up, but the
released result should be in DTS or DTS overlays, or boot loader code
in the end.

Regards,
-- 
Leon Woestenberg
http://www.sidebranch.com


More information about the Openembedded-core mailing list