All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: QEMU Developers <qemu-devel@nongnu.org>
Cc: "Cédric Le Goater" <clg@kaod.org>
Subject: Re: [Qemu-devel] [PULL 01/14] ast2400: add a memory controller device model
Date: Tue, 6 Sep 2016 15:59:08 +0100	[thread overview]
Message-ID: <CAFEAcA-LqDj=xV5Lb+tZzDP-hR2jaL0Fur0=GnaFuRQjEJwd0A@mail.gmail.com> (raw)
In-Reply-To: <1473167287-8326-2-git-send-email-peter.maydell@linaro.org>

On 6 September 2016 at 14:07, Peter Maydell <peter.maydell@linaro.org> wrote:
> From: Cédric Le Goater <clg@kaod.org>
>
> The uboot in the previous release of the SDK was using a hardcoded
> value for memory size. This is not true anymore, the value is now
> retrieved from the memory controller.
>
> Below is a model for this device, only supporting unlock and
> configuration. Without it, we endup running a guest with 64MB, which
> is a bit low nowdays. It uses a 'silicon-rev' property and ram_size to
> build a default value. Some bits should be linked to SCU strapping
> registers but it seems a bit complex to add for the current need.
>
> The model is ready for the AST2500 SOC.

> +static int ast2400_rambits(void)
> +{
> +    switch (ram_size >> 20) {
> +    case 64:
> +        return ASPEED_SDMC_DRAM_64MB;
> +    case 128:
> +        return ASPEED_SDMC_DRAM_128MB;
> +    case 256:
> +        return ASPEED_SDMC_DRAM_256MB;
> +    case 512:
> +        return ASPEED_SDMC_DRAM_512MB;
> +    default:
> +        qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid RAM size: 0x%"
> +                      HWADDR_PRIx "\n", __func__, ram_size);
> +        break;

This doesn't compile on 32-bit systems, because ram_size
is not a hwaddr, it's a ram_addr_t, and it needs a different
format specifier.

I'll fix this up locally and resend the pullreq.

However, I notice looking at this code more closely that it's
using the global ram_size to determine the behaviour of the
device. That seems a bit dubious to me, we don't have other
devices that look at global config settings like that.
Can you look at doing a followup patch where the board level
code tells the memory controller how much RAM it has directly,
please?

(Also it seems wrong to call this a GUEST_ERROR, because the
thing setting the ram_size is the user running QEMU (possibly
in conjunction with any restrictions imposed by the board
model code), not the guest code.)

thanks
-- PMM

  reply	other threads:[~2016-09-06 14:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06 13:07 [Qemu-devel] [PULL 00/14] target-arm queue Peter Maydell
2016-09-06 13:07 ` [Qemu-devel] [PULL 01/14] ast2400: add a memory controller device model Peter Maydell
2016-09-06 14:59   ` Peter Maydell [this message]
2016-09-06 15:52     ` Cédric Le Goater
2016-09-06 16:07       ` Peter Maydell
2016-09-06 16:21         ` Cédric Le Goater
2016-09-06 13:07 ` [Qemu-devel] [PULL 02/14] target-arm: Fix lpae bit in FSR on an alignment fault Peter Maydell
2016-09-06 13:07 ` [Qemu-devel] [PULL 03/14] ARM: ACPI: fix the AML ID format for CPU devices Peter Maydell
2016-09-06 13:07 ` [Qemu-devel] [PULL 04/14] ast2400: rename the Aspeed SoC files to aspeed_soc Peter Maydell
2016-09-06 13:07 ` [Qemu-devel] [PULL 05/14] ast2400: replace ast2400 with aspeed_soc Peter Maydell
2016-09-06 13:07 ` [Qemu-devel] [PULL 06/14] aspeed-soc: provide a framework to add new SoCs Peter Maydell
2016-09-06 18:51   ` Peter Maydell
2016-09-06 13:08 ` [Qemu-devel] [PULL 07/14] palmetto-bmc: rename the Aspeed board file to aspeed.c Peter Maydell
2016-09-06 13:08 ` [Qemu-devel] [PULL 08/14] palmetto-bmc: replace palmetto_bmc with aspeed Peter Maydell
2016-09-06 13:08 ` [Qemu-devel] [PULL 09/14] palmetto-bmc: add board specific configuration Peter Maydell
2016-09-06 13:08 ` [Qemu-devel] [PULL 10/14] hw/misc: use macros to define hw-strap1 register on the AST2400 Aspeed SoC Peter Maydell
2016-09-06 13:08 ` [Qemu-devel] [PULL 11/14] aspeed: add a ast2500 SoC and support to the SCU and SDMC controllers Peter Maydell
2016-09-06 13:08 ` [Qemu-devel] [PULL 12/14] arm: add support for an ast2500 evaluation board Peter Maydell
2016-09-06 13:08 ` [Qemu-devel] [PULL 13/14] palmetto-bmc: remove extra no_sdcard assignement Peter Maydell
2016-09-06 13:08 ` [Qemu-devel] [PULL 14/14] block: m25p80: Fix vmstate structure name Peter Maydell
2016-09-06 14:01 ` [Qemu-devel] [PULL 00/14] target-arm queue no-reply

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-LqDj=xV5Lb+tZzDP-hR2jaL0Fur0=GnaFuRQjEJwd0A@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=clg@kaod.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.