Skip to content

VMD PCH rootbus#4

Open
sdurawa wants to merge 3 commits into
masterfrom
vmd_pch_rootbus_v2
Open

VMD PCH rootbus#4
sdurawa wants to merge 3 commits into
masterfrom
vmd_pch_rootbus_v2

Conversation

@sdurawa
Copy link
Copy Markdown
Owner

@sdurawa sdurawa commented Oct 24, 2024

Add PCH rootbus support

Copy link
Copy Markdown

@mtkaczyk mtkaczyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one small suggestion

Comment thread drivers/pci/controller/vmd.c Outdated
enum vmd_resource {
VMD_RES_CFGBAR = 0,
VMD_RES_MBAR_1,
VMD_RES_MBAR_2,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
VMD_RES_MBAR_2,
/*VMD Resource MemoryBar 1 */
VMD_RES_MBAR_1,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And same for MBAR_2 - just to explain full meaning.

Copy link
Copy Markdown

@mtkaczyk mtkaczyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PATCH v2 LGTM, one small suggestion

.flags = IORESOURCE_BUS | IORESOURCE_PCI_FIXED,
};

if (vmd_has_pch_rootbus(vmd)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please put declarations inside if:

Suggested change
if (vmd_has_pch_rootbus(vmd)) {
u16 ioc_range = 0;
u16 pch_range = 0;
pci_read_config_word(vmd->dev, VMD_BUSRANGE0, &ioc_range);
pci_read_config_word(vmd->dev, VMD_BUSRANGE1, &pch_range);

Copy link
Copy Markdown

@mtkaczyk mtkaczyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one formatting issue

Comment thread drivers/pci/controller/vmd.c Outdated
*/
bus_number = (vmd_has_pch_rootbus(vmd) &&
bus->number == VMD_PRIMARY_PCH_BUS) ?
vmd->busn_start[VMD_BUS_1] : bus->number;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting here

Suggested change
vmd->busn_start[VMD_BUS_1] : bus->number;
vmd->busn_start[VMD_BUS_1] : bus->number;

@sdurawa sdurawa force-pushed the vmd_pch_rootbus_v2 branch from 21f8866 to e79e17e Compare October 24, 2024 13:08
This function is too long and needs to be shortened to make it more readable.
This clean up is a prework for enablement additional VMD bus range.
It doesn't change functional behavior of vmd_enable_domain().

Suggested-by: Nirmal Patel <nirmal.patel@linux.intel.com>
Reviewed-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Szymon Durawa <szymon.durawa@linux.intel.com>
@sdurawa sdurawa force-pushed the vmd_pch_rootbus_v2 branch from e79e17e to 6d128be Compare October 25, 2024 09:38
Szymon Durawa added 2 commits October 25, 2024 12:38
Starting from Intel Arrow Lake VMD enhacement introduces separate
rotbus for PCH. It means that all 3 MMIO BARs exposed by VMD are
shared now between CPU IOC and PCH. This patch adds PCH bus
enumeration and MMIO management for devices with VMD enhancement
support.

Suggested-by: Nirmal Patel <nirmal.patel@linux.intel.com>
Reviewed-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Szymon Durawa <szymon.durawa@linux.intel.com>
VMD PCH rootbus primary number is 0x80 and pci_scan_bridge_extend()
cannot assign it as "hard-wired to 0" and marks setup as broken. To
avoid this, PCH bus number has to be the same as PCH primary number.

Suggested-by: Nirmal Patel <nirmal.patel@linux.intel.com>
Reviewed-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Szymon Durawa <szymon.durawa@linux.intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants