mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: "DEMIRDJIAN, Antoine" <antoine.demirdjian@airliquide.com>,
	barebox@lists.infradead.org
Subject: Re: Why /dev/mem has null size?
Date: Mon, 14 Dec 2020 19:13:33 +0100	[thread overview]
Message-ID: <75571783-3a55-bb7a-eda7-ce906832ad6d@pengutronix.de> (raw)
In-Reply-To: <CAEuS4-2u1BDx0DKn1g4DP1P9H1=OyWxzVH0amhaMbihDE4wDGA@mail.gmail.com>

Hello Antoine,

On 14.12.20 18:51, DEMIRDJIAN, Antoine wrote:
> Dear all,
> 
> I'm trying to "addpart" to /dev/mem in order to copy my raw boot image inside.

The normal usage is to let barebox worry about memory allocation:

  bootm /image and go /image both memory map /image for you.

If you absolutely want to hardcode the load address, use the memcpy
command: https://www.barebox.org/doc/latest/commands/mem/memcpy.html

> But I noticed that /dev/mem doesn't really exists :
> 
> From devinfo :
> 
>    `-- mem1
>       `-- 0x00000000-0xffffffffffffffff (   0 Bytes): /dev/mem
> 
> And more specifically :
> 
> barebox@MyBoard:/ devinfo mem1
> Resources:
>   num: 0
>   name: mem
>   start: 0x00000000
>   size: 0x00000000
> Driver: mem
> Bus: platform
> 
> As a consequence, my addpart fails with "partition end is beyond device".

I don't think addpart is meant to operate on the mem device. /dev/mem
is usually used along with memcpy, md, mw, where /dev/mem is the default
device they operate on.

> Do you have any idea why my /dev/mem size is 0x0 ?

/dev/mem always has size 0 in barebox, because its size makes
it a bit special. Many operations don't make sense for it as well,
so having a zero size makes them fail.

Cheers,
Ahmad

> 
> Thanks,
> 
> --
> Antoine D
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

  reply	other threads:[~2020-12-14 18:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 17:51 DEMIRDJIAN, Antoine
2020-12-14 18:13 ` Ahmad Fatoum [this message]
2020-12-14 18:38   ` DEMIRDJIAN, Antoine

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=75571783-3a55-bb7a-eda7-ce906832ad6d@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=antoine.demirdjian@airliquide.com \
    --cc=barebox@lists.infradead.org \
    /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