-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add acpi device resource enumeration support #62694
Add acpi device resource enumeration support #62694
Conversation
30ccc57
to
53c187b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked in details. But took a quick look over the UART driver, and it seems you are replacing PCIe with ACPI in several places. That is not right.
drivers/serial/uart_ns16550.c
Outdated
} | ||
|
||
#define UART_NS16550_IRQ_CONFIG_PCIE0(n) \ | ||
_CONCAT(UART_NS16550_IRQ_CONFIG_ACPI, DT_INST_ON_BUS(n, acpi))(n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if there are no ACPI instances but purely PCIe instances?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The design change takecare UART instances on both ACPI and PCI or DTS and ACPI at the same time. (For example: UART0 on ACPI node, UART1 on PCI or UART0 on DTS and UART1 on PCI. But doesn't support ACPI and DTS at the same time.
drivers/serial/uart_ns16550.c
Outdated
#define UART_NS16550_IRQ_CONFIG_ACPI1(n) \ | ||
static void irq_config_func##n(const struct device *dev) \ | ||
{ \ | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this empty for ACPI1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For instances on ACPI node, both IRQ and MMIO config as part of init routine. So ACPI irq config is add as stub function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated the code
The design change takecare UART instances on both ACPI and PCI or DTS and ACPI at the same time. (For example: UART0 on ACPI node, UART1 on PCI or UART0 on DTS and UART1 on PCI. But doesn't support ACPI and DTS at the same time. You can go through existing code and changes to get full picture. |
This is getting overly complicated. Could you find another way of doing this? Might want to use |
I totally agree that it will complicate drivers if we need to support on multiple bus topologies and for this I just created a draft PR (WIP): #62993 to abstract such complexity and is given currently just for analyzes purpose. |
d2b9ad2
to
8f550df
Compare
8f550df
to
c9ac74b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still an issue in dts side.
dts/bindings/acpi/acpi-device.yaml
Outdated
# Copyright (c) 2023 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Common fields for PCIe devices |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Common fields for ACPI informed based devices"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
dts/bindings/acpi/acpi-device.yaml
Outdated
@@ -0,0 +1,23 @@ | |||
# Copyright (c) 2023 Intel Corporation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename the file to acpi.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
add device resource enumaration support such as irq and mmio. Signed-off-by: Najumon B.A <[email protected]>
add acpi pnp/hw id for pcie node to enable support for retreive interrupt routing information for pci legacy interrupt via acpi Signed-off-by: Najumon B.A <[email protected]>
update prt retrieve based on acpi pnp id instead of acpi device path/name Signed-off-by: Najumon B.A <[email protected]>
add resource enumeration and acpi method shell commands such as retrieve mmio and interrupt resources. Signed-off-by: Najumon B.A <[email protected]>
add acpi hid support for mc146818 yaml file. Currently this added for acpi test case support. Signed-off-by: Najumon B.A <[email protected]>
remove pci bus compatible id dependency from qemu platforms overlay files for disk and ivshmem test apps. This already provided as part of respecitve board dts files and hence no need to duplicate here. Signed-off-by: Najumon B.A <[email protected]>
update acpi test cases with device enumeration, mmio and irq resources enumeration. Signed-off-by: Najumon B.A <[email protected]>
rename intel,pcie compatible id referance to pcie-controller in header file comments and rst files Signed-off-by: Najumon B.A <[email protected]>
add fake x86 acpi function and config macros for acpi unit test Signed-off-by: Najumon B.A <[email protected]>
08ecb14
046f4dd
to
08ecb14
Compare
Align with changes at `boards/x86/intel_adl` done by zephyrproject-rtos#62694 and zephyrproject-rtos#67452 while the `up_squared_pro_700` board was in migration to HWMv2 at `collab-hwm' branch. Signed-off-by: Dmitrii Golovanov <[email protected]>
Align with changes at `boards/x86/intel_adl` done by #62694 and #67452 while the `up_squared_pro_700` board was in migration to HWMv2 at `collab-hwm' branch. Signed-off-by: Dmitrii Golovanov <[email protected]>
Align with changes at `boards/x86/intel_adl` done by zephyrproject-rtos#62694 and zephyrproject-rtos#67452 while the `up_squared_pro_700` board was in migration to HWMv2 at `collab-hwm' branch. Signed-off-by: Dmitrii Golovanov <[email protected]>
Align with changes at `boards/x86/intel_adl` done by #62694 and #67452 while the `up_squared_pro_700` board was in migration to HWMv2 at `collab-hwm' branch. Signed-off-by: Dmitrii Golovanov <[email protected]>
Align with changes at `boards/x86/intel_adl` done by #62694 and #67452 while the `up_squared_pro_700` board was in migration to HWMv2 at `collab-hwm' branch. Signed-off-by: Dmitrii Golovanov <[email protected]>
Align with changes at `boards/x86/intel_adl` done by zephyrproject-rtos#62694 and zephyrproject-rtos#67452 while the `up_squared_pro_700` board was in migration to HWMv2 at `collab-hwm' branch. Signed-off-by: Dmitrii Golovanov <[email protected]>
Add acpi device resource enumeration interface and updated uart driver with the new acpi interface