qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: "Pekka Enberg" <penberg@iki.fi>, "Zoltán Baldaszti" <bztemail@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	qemu-arm <qemu-arm@nongnu.org>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Andrew Baumann <Andrew.Baumann@microsoft.com>
Subject: Re: [Qemu-devel] [PATCH v2 2/3] raspi: Raspberry Pi 3 support
Date: Tue, 3 Sep 2019 14:42:41 +0200	[thread overview]
Message-ID: <CAAdtpL7ZRxLS=wbKKQrxQ_Ob8sLJFGvsqPWXmgtCGWKdJ-Ga9g@mail.gmail.com> (raw)
In-Reply-To: <20180216070201.4271-3-penberg@iki.fi>

Hi Pekka and Zoltán,

On Fri, Feb 16, 2018 at 8:04 AM Pekka Enberg <penberg@iki.fi> wrote:
>
> This patch adds Raspberry Pi 3 support to hw/arm/raspi.c. The
> differences to Pi 2 are:
>
>  - Firmware address
>  - Board ID
>  - Board revision
>
> The CPU is different too, but that's going to be configured as part of
> the machine default CPU when we introduce a new machine type.
>
> The patch was written from scratch by me but the logic is similar to
> Zoltán Baldaszti's previous work, which I used as a reference (with
> permission from the author):
>
>   https://github.com/bztsrc/qemu-raspi3
>
> Signed-off-by: Pekka Enberg <penberg@iki.fi>
> ---
>  hw/arm/raspi.c | 31 +++++++++++++++++++++----------
>  1 file changed, 21 insertions(+), 10 deletions(-)
>
> diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c
> index c24a4a1b14..66fe10e376 100644
> --- a/hw/arm/raspi.c
> +++ b/hw/arm/raspi.c
> @@ -5,6 +5,9 @@
>   * Rasperry Pi 2 emulation Copyright (c) 2015, Microsoft
>   * Written by Andrew Baumann
>   *
> + * Raspberry Pi 3 emulation Copyright (c) 2018 Zoltán Baldaszti
> + * Upstream code cleanup (c) 2018 Pekka Enberg
> + *
>   * This code is licensed under the GNU GPLv2 and later.
>   */
>
> @@ -22,10 +25,11 @@
>  #define SMPBOOT_ADDR    0x300 /* this should leave enough space for ATAGS */
>  #define MVBAR_ADDR      0x400 /* secure vectors */
>  #define BOARDSETUP_ADDR (MVBAR_ADDR + 0x20) /* board setup code */
> -#define FIRMWARE_ADDR   0x8000 /* Pi loads kernel.img here by default */
> +#define FIRMWARE_ADDR_2 0x8000 /* Pi 2 loads kernel.img here by default */
> +#define FIRMWARE_ADDR_3 0x80000 /* Pi 3 loads kernel.img here by default */
>
>  /* Table of Linux board IDs for different Pi versions */
> -static const int raspi_boardid[] = {[1] = 0xc42, [2] = 0xc43};
> +static const int raspi_boardid[] = {[1] = 0xc42, [2] = 0xc43, [3] = 0xc44};

Where does the value 0xc44 comes from?

I can only find 0xc42/0xc43 defined:
https://github.com/raspberrypi/linux/blob/rpi-3.18.y/arch/arm/tools/mach-types#L525

0xc43 seems controversial, see
http://lists.infradead.org/pipermail/linux-rpi-kernel/2015-February/001268.html
addition: https://github.com/raspberrypi/linux/commit/d9fac63adac#diff-6722037d79570df5b392a49e0e006573R526

Looking at the firmware source, the r1 register is always set to the
BCM2708 machine id before calling the kernel:
https://github.com/raspberrypi/tools/blob/920c7ed2ee/armstubs/armstub7.S#L133

Thanks,

Phil.


  reply	other threads:[~2019-09-03 12:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-16  7:01 [Qemu-devel] [PATCH v2 0/3] Raspberry Pi 3 support Pekka Enberg
2018-02-16  7:01 ` [Qemu-devel] [PATCH v2 1/3] bcm2836: Make CPU type configurable Pekka Enberg
2018-02-16  7:02 ` [Qemu-devel] [PATCH v2 2/3] raspi: Raspberry Pi 3 support Pekka Enberg
2019-09-03 12:42   ` Philippe Mathieu-Daudé [this message]
2019-09-04 14:35     ` bzt
2018-02-16  7:02 ` [Qemu-devel] [PATCH v2 3/3] raspi: Add "raspi3" machine type Pekka Enberg
2018-02-16  9:16 ` [Qemu-devel] [PATCH v2 0/3] Raspberry Pi 3 support 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='CAAdtpL7ZRxLS=wbKKQrxQ_Ob8sLJFGvsqPWXmgtCGWKdJ-Ga9g@mail.gmail.com' \
    --to=f4bug@amsat.org \
    --cc=Andrew.Baumann@microsoft.com \
    --cc=bztemail@gmail.com \
    --cc=penberg@iki.fi \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.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).