qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>,
	 "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Cc: Huacai Chen <chenhuacai@kernel.org>, Paul Burton <paulburton@kernel.org>
Subject: Re: [PATCH v2 8/8] hw/mips/boston: Use bootloader helper to set GCRs
Date: Wed, 6 Jan 2021 18:30:43 +0100	[thread overview]
Message-ID: <CAAdtpL4gB7qhR68UzFDLMX07qMQPY7xRT36F3eOxhGSN9rng6Q@mail.gmail.com> (raw)
In-Reply-To: <105f0d1b-ca44-b7bc-aa11-7179f7d7d081@amsat.org>

On Wed, Jan 6, 2021 at 6:28 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> On 12/15/20 7:46 AM, Jiaxun Yang wrote:
> > Translate embedded assembly into IO writes which is more
> > readable.
> >
> > Also hardcode cm_base at boot time instead of reading from CP0.
> >
> > Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> > ---
> >  hw/mips/boston.c | 45 ++++++++++++---------------------------------
> >  1 file changed, 12 insertions(+), 33 deletions(-)
> >
> > diff --git a/hw/mips/boston.c b/hw/mips/boston.c
> > index b622222c7d..9f08aa7285 100644
> > --- a/hw/mips/boston.c
> > +++ b/hw/mips/boston.c
> > @@ -281,42 +281,21 @@ static void gen_firmware(uint32_t *p, hwaddr kernel_entry, hwaddr fdt_addr,
> >      const uint32_t gic_base = 0x16120000;
> >      const uint32_t cpc_base = 0x16200000;
> >
> > -    /* Move CM GCRs */
> >      if (is_64b) {
> > -        stl_p(p++, 0x40287803);                 /* dmfc0 $8, CMGCRBase */
> > -        stl_p(p++, 0x00084138);                 /* dsll $8, $8, 4 */
> > +        bl_gen_write_u64(&p, cm_base,
> > +                    cpu_mips_phys_to_kseg1(NULL, GCR_BASE_ADDR + GCR_BASE_OFS));
> > +        bl_gen_write_u64(&p, gic_base | GCR_GIC_BASE_GICEN_MSK,
> > +                    cpu_mips_phys_to_kseg1(NULL, cm_base + GCR_GIC_BASE_OFS));
> > +        bl_gen_write_u64(&p, cpc_base | GCR_CPC_BASE_CPCEN_MSK,
> > +                    cpu_mips_phys_to_kseg1(NULL, cm_base + GCR_CPC_BASE_OFS));
> >      } else {
> > -        stl_p(p++, 0x40087803);                 /* mfc0 $8, CMGCRBase */
> > -        stl_p(p++, 0x00084100);                 /* sll  $8, $8, 4 */
> > +        bl_gen_write_u32(&p, cm_base,
> > +                    cpu_mips_phys_to_kseg1(NULL, GCR_BASE_ADDR + GCR_BASE_OFS));
> > +        bl_gen_write_u32(&p, gic_base | GCR_GIC_BASE_GICEN_MSK,
> > +                    cpu_mips_phys_to_kseg1(NULL, cm_base + GCR_GIC_BASE_OFS));
> > +        bl_gen_write_u32(&p, cpc_base | GCR_CPC_BASE_CPCEN_MSK,
> > +                    cpu_mips_phys_to_kseg1(NULL, cm_base + GCR_CPC_BASE_OFS));
> >      }
>
> What about simplifying adding bl_gen_write_target_ulong() or
> bl_gen_write_ulong()?

bl_gen_store_ulong() similarly to bl_gen_load_ulong()?


  reply	other threads:[~2021-01-06 17:32 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-15  6:41 [PATCH v2 0/8] MIPS Bootloader helper Jiaxun Yang
2020-12-15  6:41 ` [PATCH v2 1/8] hw/mips: Make bootloader addresses unsgined Jiaxun Yang
2021-01-01 23:15   ` Philippe Mathieu-Daudé
2021-01-03 15:57     ` Philippe Mathieu-Daudé
2021-01-03 20:41       ` Philippe Mathieu-Daudé
2020-12-15  6:41 ` [PATCH v2 2/8] hw/mips/malta: Use address translation helper to calculate bootloader_run_addr Jiaxun Yang
2021-01-01 20:40   ` Philippe Mathieu-Daudé
2020-12-15  6:41 ` [PATCH v2 3/8] hw/mips: Use address translation helper to handle ENVP_ADDR Jiaxun Yang
2021-01-01 20:38   ` Philippe Mathieu-Daudé
2021-01-01 23:16     ` Philippe Mathieu-Daudé
2020-12-15  6:45 ` [PATCH v2 4/8] hw/mips: Add a bootloader helper Jiaxun Yang
2020-12-15  6:45 ` [PATCH v2 5/8] hw/mips: Use bl_gen_kernel_jump to generate bootloaders Jiaxun Yang
2021-01-06 17:48   ` Philippe Mathieu-Daudé
2021-01-27  3:03     ` Jiaxun Yang
2020-12-15  6:45 ` [PATCH v2 6/8] target/mips/addr: Add translation helpers for KSEG1 Jiaxun Yang
2021-01-01 20:42   ` Philippe Mathieu-Daudé
2021-01-01 23:16     ` Philippe Mathieu-Daudé
2021-01-03  1:46       ` Huacai Chen
2020-12-15  6:45 ` [PATCH v2 7/8] hw/mips/malta: Use bootloader helper to set BAR resgiters Jiaxun Yang
2021-01-06 17:21   ` Philippe Mathieu-Daudé
2020-12-15  6:46 ` [PATCH v2 8/8] hw/mips/boston: Use bootloader helper to set GCRs Jiaxun Yang
2021-01-06 17:28   ` Philippe Mathieu-Daudé
2021-01-06 17:30     ` Philippe Mathieu-Daudé [this message]
2021-01-06 17:35       ` Philippe Mathieu-Daudé
2020-12-19  6:20 ` [PATCH v2 0/8] MIPS Bootloader helper Jiaxun Yang
2020-12-19 19:04 ` Philippe Mathieu-Daudé
2021-01-03 20:42 ` Philippe Mathieu-Daudé
2021-01-06 17:50   ` Philippe Mathieu-Daudé

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=CAAdtpL4gB7qhR68UzFDLMX07qMQPY7xRT36F3eOxhGSN9rng6Q@mail.gmail.com \
    --to=f4bug@amsat.org \
    --cc=chenhuacai@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=paulburton@kernel.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).