qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Aurelio Remonda <aurelio.remonda@tallertechnologies.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Memory on stellaris board
Date: Thu, 10 Mar 2016 06:24:50 +0700	[thread overview]
Message-ID: <CAFEAcA_gSo7D27uRyKAU-sj83qXkB63m7Q+VgH2qJkwDJs5PVg@mail.gmail.com> (raw)
In-Reply-To: <CANLsssvBN=C_-_i+9Mh7p_o=L3BZy19UJPB1aGFH2SsVAoFwaw@mail.gmail.com>

On 10 March 2016 at 03:56, Aurelio Remonda
<aurelio.remonda@tallertechnologies.com> wrote:
>
>
> On Mon, Mar 7, 2016 at 8:37 PM, Peter Maydell <peter.maydell@linaro.org>
> wrote:
>>
>> On 8 March 2016 at 02:58, Aurelio Remonda
>> <aurelio.remonda@tallertechnologies.com> wrote:
>> > Hello, sorry for taking so long, I am working on this again.
>> > About your last response, I was looking at the struct
>> > stellaris_board_info
>> > ,which contains
>> > dc0, and this entire struct is const. If we need to calculate dc0 based
>> > on
>> > the provided RAM size
>> > or default value at least the dc0 field should not be const.
>>
>> Yes, certainly.
>>
>> You might also need to look at the magic hex numbers in
>> the stellaris_board[] array -- one is labelled /* dc0 */
>> so might be related.
>
> Thanks Peter!
> I have a question about the set_memory_options function, when the m flag is
> present, this function takes the size value (or the default_ram_size) and
> perform
> an QEMU_ALIGN_UP. Let's say you want the board default ram_size, the default
> dc0 value should be 0xff00 (65280) when the align is made this value becomes
> 0x00ffff (65535). This align will make the dc0 value change, so I have to
> make some
> operations on ram_size so dc0 will be as exact as it should.
>
> Something like this:
>     ram_size |= ((ram_size-1)>>8);
>     board->dc0 |= (ram_size & 0xffff)<<16;
> On stellaris_init function
>
> Then the sram_size and the flash_size are exposed like always. I change the
> magic hex numbers
> in the stellaris_board[] array from 0x00ff007f to 0x0000007f as the
> flash_size
> will not change even with the flag. The default_ram_size is also changed for
> this board to
> be 64K on lm3s6965evb_class_init func:
>    mc->default_ram_size = 0x0000ff00;
>
> What do you think of this approach? Thank you!

You should reject unworkable ram sizes rather than silently
changing what the user asked for; this matches our preferred
approach where the user asks for more RAM than the board
can support.

thanks
-- PMM

  reply	other threads:[~2016-03-09 23:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03 13:00 [Qemu-devel] Memory on stellaris board Aurelio Remonda
2016-02-03 13:34 ` Peter Maydell
2016-02-03 13:45   ` Aurelio Remonda
2016-02-05 16:09     ` Aurelio Remonda
2016-02-05 16:23       ` Peter Maydell
2016-02-05 16:55         ` Aurelio Remonda
2016-02-05 17:00           ` Peter Maydell
2016-02-11 12:46             ` Aurelio Remonda
2016-02-11 13:01               ` Peter Maydell
2016-03-07 19:58                 ` Aurelio Remonda
2016-03-07 23:37                   ` Peter Maydell
2016-03-09 20:56                     ` Aurelio Remonda
2016-03-09 23:24                       ` Peter Maydell [this message]
2016-03-10  0:23                         ` Aurelio Remonda
2016-03-10  1:54                           ` Peter Maydell
2016-03-11 14:12                             ` Aurelio Remonda
2016-03-11 22:31                               ` Peter Maydell

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=CAFEAcA_gSo7D27uRyKAU-sj83qXkB63m7Q+VgH2qJkwDJs5PVg@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=aurelio.remonda@tallertechnologies.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).