qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelio Remonda <aurelio.remonda@tallertechnologies.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PING][PATCH] Added the -m flag feature to stellaris boards
Date: Mon, 28 Mar 2016 15:15:45 -0300	[thread overview]
Message-ID: <CANLssstrQCwc1nocBnnTcc0thyykhHMFAze_xDsbTpri-LQa6g@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA-DLHpSBgKTpADb6bsCe9bPRbOL1XiyvfVsF2YofSdNPw@mail.gmail.com>

>>  #define NUM_IRQ_LINES 64
>> +#define LM3S811EVB_DEFAULT_DC0 0x00001f00 /* Default value for dc0 sram_size half */
>> +#define LM3S6965EVB_DEFAULT_DC0 0x0000ff00 /* Default value for dc0 sram_size half */
>
> These don't seem to be the same as the default values we had previously ?

I thought it will be easier to see in hexadecimal rather than decimal,
these are ram_size just like
user-given are.

>> +    /* RAM size should be divided by 256 in order to get a valid 16 bits dc0 value */
>> +    ram_size = (ram_size >> 8) - 1;
>> +
>> +    if (ram_size > DC0_MAX_SRAM) {
>> +        error_report("Requested RAM size is too big for this board. The maximum allowed is 16M.");
>> +        exit(EXIT_FAILURE);
>> +    }
>> +
>> +    board->dc0 |= ram_size << DC0_SRAM_SHIFT;
>>      flash_size = (((board->dc0 & 0xffff) + 1) << 1) * 1024;
>>      sram_size = ((board->dc0 >> 18) + 1) * 1024;
>
> Do you know why your DC0_SRAM_SHIFT is 16 but this line which
> calculates sram_size from board->dc0 is doing a shift by 18 ?

DC0_SRAM_SHIFT will just place the ram_size, prevously calculated
based on the decimal ram_size
value, in the correct dc0 half. Then the sram_size will be calculated as always.

>> @@ -1391,6 +1405,7 @@ static void lm3s811evb_class_init(ObjectClass *oc, void *data)
>>
>>      mc->desc = "Stellaris LM3S811EVB";
>>      mc->init = lm3s811evb_init;
>> +    mc->default_ram_size = LM3S811EVB_DEFAULT_DC0;
>
> The default_ram_size should be a size in bytes, not a DC0 value.

As I said before, I thought it was easier to see ff00 rather than
65280, or 1f00 instead of 7936.
These values are fixed as default values to match the dc0 default
value on each board.

In the case of LM3S811EVB the value is aligned up and you get a ram
size of 8192 but your
dc0 will still be 0x001f001f.

In the other board LM3S6965EVB the value is aligned up to a ram size
of 65536 but your dc0
will be the default 0x00ff007f.

Thank you.
-- 
Aurelio Remonda

Taller Technologies Argentina

Software Engineer

San Lorenzo 47, 3rd Floor, Office 5
Córdoba, Argentina
Phone: +54-351-4217888 / 4218211

  reply	other threads:[~2016-03-28 18:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21 18:42 [Qemu-devel] [PING][PATCH] Added the -m flag feature to stellaris boards Aurelio Remonda
2016-03-23 15:39 ` Peter Maydell
2016-03-28 18:15   ` Aurelio Remonda [this message]
2016-04-14 12:21     ` Aurelio Remonda
2016-04-14 12:31       ` Peter Maydell
2016-04-14 13:27         ` Aurelio Remonda
2016-04-14 13:42     ` 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=CANLssstrQCwc1nocBnnTcc0thyykhHMFAze_xDsbTpri-LQa6g@mail.gmail.com \
    --to=aurelio.remonda@tallertechnologies.com \
    --cc=peter.maydell@linaro.org \
    --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).