public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] mcb: enable register PCI devices using any BAR
@ 2026-03-02 13:47 Filip Jensen
  2026-03-02 13:47 ` [PATCH v2 1/2] mcb: Use more than the first bar in pci devices Filip Jensen
  2026-03-02 13:47 ` [PATCH v2 2/2] mcb: refactor the bus operations out of the common code Filip Jensen
  0 siblings, 2 replies; 4+ messages in thread
From: Filip Jensen @ 2026-03-02 13:47 UTC (permalink / raw)
  To: morbidrsa; +Cc: linux-kernel, Filip Jensen, Jose Javier Rodriguez Barbarin

V1 -> V2: Thanks to the review from Johannes Thumshirn, the patch 2/3 of
the first version has been removed and the cleaner solution from patch 3/3
is then kept.

The PCI mcb driver is currently only able to register devices that use
the first PCI BAR. That is hardcoded in mcb-parse.c in lines 156-161:

		c = kzalloc_obj(struct chameleon_bar);
		if (!c)
			return -ENOMEM;

		bar_count = 1;
		c->addr = mapbase;
                
However, mcb devices can use other indexes of the 6 PCI BARs. This serie of
patches allows to use these devices by adding the relevant PCI BAR info to
the chameleon table. As this code must also work for lpc devices, it has
been done a refactoring in order to keep the two buses dependent operations
regarding bars (get_bar and is_io_mapped_bar) outside of the common parsing
code. These callback operations are stored in a structure and passed over
to the parser, thus rendering each module, the mcb-lpc and mcb-pci, only
with their own bus relevant logic.

This patch depends on the previously accepted patch:
Link: https://lore.kernel.org/lkml/20260217075124.10052-1-dev-Felipe.Jensen@duagon.com/

Reviewed-by: Jose Javier Rodriguez Barbarin <dev-josejavier.rodriguez@duagon.com>

Filip Jensen (2):
  mcb: Use more than the first bar in pci devices
  mcb: refactor the bus operations out of the common code

 drivers/mcb/mcb-internal.h | 10 ++++-
 drivers/mcb/mcb-lpc.c      | 56 ++++++++++++++++++++++++++-
 drivers/mcb/mcb-parse.c    | 77 +++++---------------------------------
 drivers/mcb/mcb-pci.c      | 40 +++++++++++++++++++-
 4 files changed, 111 insertions(+), 72 deletions(-)

-- 
2.34.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-03 17:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-02 13:47 [PATCH v2 0/2] mcb: enable register PCI devices using any BAR Filip Jensen
2026-03-02 13:47 ` [PATCH v2 1/2] mcb: Use more than the first bar in pci devices Filip Jensen
2026-03-03 17:12   ` Johannes Thumshirn
2026-03-02 13:47 ` [PATCH v2 2/2] mcb: refactor the bus operations out of the common code Filip Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox