drivers/char: support up to 1M BAR0 of xhci

AMD's XHCI has BAR0 of 1M (compared to 64K on Intel). Map it as a whole
(reserving more space in the fixmap). Make fixmap slot conditional on
CONFIG_XHCI.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Marek Marczykowski-Górecki authored and Jan Beulich committed 2022-12-14 12:04:26 +01:00
1 parent dd54ea500b
commit 549b042943
2 files changed
+7 -3

No files matched your search

+3 -1
View File
@@ -25,7 +25,7 @@
#include <asm/msi.h>
#include <acpi/apei.h>
#define MAX_XHCI_PAGES 16
#define MAX_XHCI_PAGES 256
/*
* Here we define all the compile-time 'special' virtual
@@ -45,8 +45,10 @@ enum fixed_addresses {
FIX_COM_BEGIN,
FIX_COM_END,
FIX_EHCI_DBGP,
#ifdef CONFIG_XHCI
FIX_XHCI_BEGIN,
FIX_XHCI_END = FIX_XHCI_BEGIN + MAX_XHCI_PAGES - 1,
#endif
#ifdef CONFIG_XEN_GUEST
FIX_PV_CONSOLE,
FIX_XEN_SHARED_INFO,
+4 -2
View File
@@ -268,10 +268,12 @@ static void *dbc_sys_map_xhc(uint64_t phys, size_t size)
{
size_t i;
if ( size != MAX_XHCI_PAGES * PAGE_SIZE )
if ( size > MAX_XHCI_PAGES * PAGE_SIZE )
return NULL;
for ( i = FIX_XHCI_END; i >= FIX_XHCI_BEGIN; i-- )
size >>= PAGE_SHIFT;
for ( i = FIX_XHCI_END; i > FIX_XHCI_END - size; i-- )
{
set_fixmap_nocache(i, phys);
phys += PAGE_SIZE;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.