-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
DynamicTablesPkg: Support for generic DBG2 devices #5779
base: master
Are you sure you want to change the base?
Conversation
Add support for creating DBG2 nodes for non-serial port devices. This allows for either COM based or devices that point to other nodes. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
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.
Hello Jeff,
Thanks for the patch, I added some comments,
Regards,
Pierre
@@ -949,6 +974,29 @@ PrintChar8 ( | |||
)); | |||
} | |||
|
|||
STATIC |
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.
Is it possible to add a function description ?
Also, I don't think this will build as CM_OBJ_PARSER.PrintFormatter is a function pointer such as:
VOID (EFIAPI *FNPTR_PRINT_FORMATTER)(CONST CHAR8 *Format, UINT8 *Ptr);
and this function has an additional parameter.
Maybe you can create a function Print6UINT64
instead
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 just saw the PR at #5826
and I think it is indeed a better option than what I suggested (I wanted to avoid you the trouble of making a bigger modification)
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.
Yeah this code was based on top of this internally, will rebase on that once that review is done.
DEBUG (( | ||
DEBUG_ERROR, | ||
"ERROR: DBG2: Serial port information not found. Status = %r\n", | ||
EFI_NOT_FOUND | ||
"WARNING: DBG2: Too many serial ports to populated. Count = %x\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.
to populate
UINT8 NumberOfAddresses; | ||
|
||
/// The physical base address array for the device | ||
UINT64 BaseAddress[PCI_MAX_BAR]; |
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 don't think the max number of addresses should be bound to PCI_MAX_BAR and to the pci code.
In order to re-use the CM_ARM_SERIAL_PORT_INFO struct, would it be possible to do this instead ?
- Add the following fields to CM_ARM_SERIAL_PORT_INFO:
///
/// Reference Token for a CM_ARM_ADDRESS_RANGE_INFO,
/// describing other addresses if the port needs multiple.
/// Token identifying a CM_ARM_OBJ_REF structure.
/// Only used in DBG2.
///
CM_OBJECT_TOKEN AdditionnalAddressesToken;
///
/// The port type.
/// Only used in DBG2.
///
UINT16 PortType;
///
/// ASCII Null terminated string.
/// Only used in DBG2.
///
CHAR8 ObjectName[AML_NAME_SEG_SIZE + 1];
- Create the following object:
typedef struct CmArmAddressRangeInfo {
/// Base Address
UINT64 BaseAddress;
/// Address length
UINT8 AddressLength;
} CM_ARM_ADDRESS_RANGE_INFO;
This would allow the Dbg2Generator to only have to handle one type of serial port description.
If AdditionnalAddressesToken is not the NULL token, then other addresses need to be fetched.
You can check how the CM_ARM_PCI_ADDRESS_MAP_INFO object / CM_ARM_PCI_CONFIG_SPACE_INFO.AddressMapToken field are used at
Platform/ARM/JunoPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
Also, would it be possible to make the changes on top of this branch:
https://github.com/pierregondois/edk2/commits/pg/dyntables_libraries_reorg/
The objects/code has been shuffled quite a lot, so it would avoid both of us some work if the changes were targeting this branch instead.
(this means that CM_ARM_ADDRESS_RANGE_INFO should go to the ArchCommon name space)
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.
Ok, that sounds good. will work on getting a patch in both places, our platforms to test this uses current edk2 (Do you have ETA for when the reorg will hit tiancore?)
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.
Unfortunately I don't have a date to give, but hopefully this might happen next week (@samimujawar )
This PR has been automatically marked as stale because it has not had activity in 60 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions. |
PR can not be merged due to conflict. Please rebase and resubmit |
Description
Add support for creating DBG2 nodes for non-serial port devices.
This allows for either COM based or devices that point to other nodes.
How This Was Tested
Generated DBG2 entries for PCIe network devices with and without a serial debug device.
Integration Instructions
N/A