Skip to content

Conversation

@sdurawa
Copy link
Owner

@sdurawa sdurawa commented Oct 24, 2024

Add PCH rootbus support

Copy link

@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

enum vmd_resource {
VMD_RES_CFGBAR = 0,
VMD_RES_MBAR_1,
VMD_RES_MBAR_2,

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,

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

@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)) {

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

@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

*/
bus_number = (vmd_has_pch_rootbus(vmd) &&
bus->number == VMD_PRIMARY_PCH_BUS) ?
vmd->busn_start[VMD_BUS_1] : bus->number;

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 <[email protected]>
Reviewed-by: Mariusz Tkaczyk <[email protected]>
Signed-off-by: Szymon Durawa <[email protected]>
@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 <[email protected]>
Reviewed-by: Mariusz Tkaczyk <[email protected]>
Signed-off-by: Szymon Durawa <[email protected]>
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 <[email protected]>
Reviewed-by: Mariusz Tkaczyk <[email protected]>
Signed-off-by: Szymon Durawa <[email protected]>
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.

3 participants