All of lore.kernel.org
 help / color / mirror / Atom feed
From: Asherah Connor <ashe@kivikakk.ee>
To: u-boot@lists.denx.de
Subject: [PATCH v3 1/4] arm: x86: qemu: move qfw to DM, include Arm support
Date: Wed, 24 Feb 2021 00:22:54 +0000	[thread overview]
Message-ID: <20210224002254.xckn6g4tcue6cqkd@talia.n4wrvuuuhszuhem3na2pm5saea.px.internal.cloudapp.net> (raw)
In-Reply-To: <d26821d4-dc30-2e17-a2dc-67dbaab6beee@gmx.de>

On 21/02/23 01:02:p, Heinrich Schuchardt wrote:
> On 23.02.21 12:43, Asherah Connor wrote:
> For which architectures does the fw_cfg device exist?
> 
> It it is only ARM and X86, than I am missing such a dependency on
> CONFIG_CMD_QFW.

Right now we have:

arch/arm/Kconfig:
	...
	config ARCH_QEMU
		...
		imply CMD_QFW

I think we also want this:

arch/x86/cpu/qemu/Kconfig
	config QEMU
		...
		imply CMD_QFW

This is my first time using Kconfig and I'll admit I'm not too certain
where things go.


> If these numbers are constants, why should they be copied to platform
> data? This only increases code size.
> 
> I think there is nothing wrong with using constants here.

Okay, excellent.  I'll fold those into drivers/misc/qfw_pio.c and get
rid of the qfw_pio_plat struct entirely.  


> ARM yield is meant to be used on multi-threaded systems to indicate that
> the thread can be swapped. Why would we need it in U-Boot which is
> single-threaded?
> 
> Can't we simply use
> 
> while (be32_to_cpu(dma.control) & ~FW_CFG_DMA_ERROR);
> 
> with no command in the loop for all architectures?

Good question.  This code originated here, where the original (x86-only)
driver used pause:

https://gitlab.denx.de/u-boot/u-boot/-/commit/f60df20aa966c3de850afafe3cce70a51d0b261c#41c93c056084377352da52f1d88fc49288a4846f_0_59

When porting to Arm I used the equivalent.

While U-Boot is single-threaded, the architecture that executes this
instruction is always QEMU, and -- at a guess -- it might be that
pause/yield here lets QEMU finish its part of the DMA faster.

I've run the QEMU tests on arm(64)/x86(_64) without the yield or pause
and they still pass.  It might be simply unnecessary, so I'll remove for
now in favour of simplicity and less arch-specific code.

Best,

Asherah

  parent reply	other threads:[~2021-02-24  0:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-23 11:43 [PATCH v3 0/4] Move qfw to DM, add Arm support Asherah Connor
2021-02-23 11:43 ` [PATCH v3 1/4] arm: x86: qemu: move qfw to DM, include " Asherah Connor
2021-02-23 12:59   ` Heinrich Schuchardt
2021-02-23 14:53     ` Tom Rini
2021-02-23 15:54       ` Heinrich Schuchardt
2021-02-23 16:03         ` Tom Rini
2021-02-23 16:15           ` Heinrich Schuchardt
2021-02-23 16:33             ` Tom Rini
2021-02-23 23:54               ` Asherah Connor
2021-02-23 23:58                 ` Tom Rini
2021-02-24  0:12                   ` Asherah Connor
2021-02-24  0:22     ` Asherah Connor [this message]
2021-02-23 11:43 ` [PATCH v3 2/4] arm: x86: qemu: add UCLASS_QFW, split driver into _pio and _mmio Asherah Connor
2021-02-23 15:58   ` Simon Glass
2021-02-23 11:43 ` [PATCH v3 3/4] arm: x86: qemu: unify qfw driver functions as qfw_ Asherah Connor
2021-02-23 11:43 ` [PATCH v3 4/4] qemu: add sandbox driver and tests Asherah Connor
2021-02-23 12:26   ` Asherah Connor
2021-02-23 15:58   ` Simon Glass

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=20210224002254.xckn6g4tcue6cqkd@talia.n4wrvuuuhszuhem3na2pm5saea.px.internal.cloudapp.net \
    --to=ashe@kivikakk.ee \
    --cc=u-boot@lists.denx.de \
    /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.