To be used by devices bridging PCIe to/from e.g. host memory. Inherits
pcie_upstream_translator. Defines a port object downstream_port and a
connect host_memory to which upstream Mem transactions are forwarded,
by default. Defines a port message, to which Msg transactions are
forwarded, by default. The message port inherits the message_port
template. Other transaction types are terminated, by default.
Inherits pcie_device and pcie_upstream_translator. Defines a connect
upstream_target and a port object downstream_port. Defines a port
upstream_message_router which routes upstream messages either to itself or
forwards them further upstream or reroutes them downstream. Defines a port
upstream_message which handles upstream transactions of type Msg
directed at this PCIe port.
To be used by Downstream Switch Ports. Inherits pcie_port and
pcie_hotplug_port.
To be used by Root Ports. Inherits pcie_downstream_port.
To be used by Upstream Switch Ports. Inherits pcie_port.
Implements transaction interface where it receives and dispatches
transactions of type Msg to instances (on the same level) of the
handling_messages template. Unhandled messages will be terminated
with error or silently dropped depending on type of Msg.
Implements transaction_translator interface where it receives translator
requests of type Msg from downstream. Forwards messages depending
on pcie_msg_route atom. Messages to be routed upstream are forwarded to
parameter default_target, messages to be routed downstream are forwarded to
downstream_port and messages targeting this PCIe port are forwarded to
parameter local_target for local handling of the message.
parameter is_root_port is used to determine if messages with routing type
of PCIE_Msg_Route_Upstream should be forwarded to local_target instead of
default_target for Error Messages.
Should be implemented by (DML) objects that wants to handle PCIe messages
dispatched by the message_port template. When a message is received on a
message_port instance, it will iterate over instances of this template (in
an undefined order) and call the message method. Note that downstream
messages have stub-methods in the pcie_config.message group and are not
handled by instancing this template.
Called by the message_port template when a PCIe message is received.
Must return PCIE_Error_Not_Set if the message is not
handled. Returning anything else means that the message was handled by
this method call. Note that message handlers that implement handling of
VDM messages must still return PCIE_Error_Not_Set for messages it has
no handler for. The handler should thus not assume that the message is
handled by this method. Other atoms such as pcie_msg_vdm_vendor_id
and/or pcie_msg_vdm_subtype (or other custom atoms) should be
inspected.
Handles Device Readiness Status messages. Sets the values in the "DRS Message Received", "Flit Mode Status" and "Downstream Presence Detected" fields accordingly. Does not handle any other type of PCIe VDM Message.
Stub methods for an RC receiving ATS messages. Inherits
handling_messages
Called when a ATS Invalidation Completion message is received. Device model
has to override the default implementation to process the message.
Returns true if processing of the message was successful.
Default implementation always returns false.
Template for an RC receiving and sending PRS messages. Method
page_request_received must be overridden to implement the
logic to handle a page request message. Inherits handling_messages.
Sends a Page Response message to target_id via mt. Argument pasid can be set to NULL to leave out the PASID from the transaction.
Stub method, called when a Page Request message is received. Should
return true if the message was handled correctly or false if the
message could not be handled. The default implementation logs an
unimpl message and returns false.
Default PCIe upstream translator, implementing transaction_translator.
Redirects transactions based on the pcie_type atom. Transactions are
forwarded according to parameters msg, mem, io and cfg in the group
txl_target. By default, all parameters point to the parameter def which
defaults to NULL, i.e. transactions are terminated.
Stub template for handling ATS transactions. Inherits
pcie_upstream_translator. Defines the ports ats_untranslated,
ats_translated and ats_request to which Memory transactions are
forwarded according to the pcie_at atom. All other transactions are handled
according to the default behavior of pcie_upstream_translator. The port
ats_request implements transaction with the method issue which by
default logs an unimpl message and returns PCIE_Error_Completer_Abort.
The two other ports implement transaction_translator and forward all
transactions to host_memory.map_target, by default.
Sends an ATS invalidation message via mt to an endpoint to
invalidate a translated address. The method automatically masks the lower
bits of the provided untranslated_addr according to PCIe specification
based on the size argument. Argument pasid can be set to NULL
in order to leave out the pcie_pasid atom from the transaction.
Inherits physical_config_bank and adds Type 1 specific registers. Automatically handles mapping of the downstream_target, according to the secondary/subordinate and base/limit registers. Handles broadcasting of downstream messages to downstream_target.
Implements the common functionality of Type 1 base address groups such as
io, memory and prefetchable. Handles mapping of the relevant
downstream ranges into the upstream target address spaces. Inherits
abstract_base_address.
Can be applied to a connect to automatically create a pcie-downstream-port
object with map targets for cfg, msg, mem and io. The interface
pcie_port_control and transaction are connected to the downstream port
of the automatically created object.
This template should only be applied to a Downstream Port of PCI Express Switch or a Root Port of PCI Express Root Complex.
When instantiating this template, an implementation of the
pcie_hotplug_events interface will be added to the device. When a method of
this interface is invoked, it will check if the device has a PCI Express
Capability Structure that has support for the incoming Hot-Plug event. If it
does, it will trigger a Hot-Plug event.
This template also adds handling of the Hot-Plug PCIe message types defined in this library.
Can be applied to objects that inherit the pcie_downstream_port or the pcie_root_port template. Applying this template will implement the pcie_link_training interface. Implementing this interface will allow the object to initiate link training by the trigger method being invoked.
The template will also set the link_training_target in the link group of the PCI Express Capability Structure in the device.
Parameters:
pcie_link_training_target: A map_target_t pointer that is not NULL
during post_init, default downstream_port.phy.map_targetAdds a port that instantiates the pcie_downstream_translator template
for each PCIe space. These ports are used to translate transactions to the
corresponding port in the pcie-downstream-port helper object. The ports are
cfg, mem, msg and io.
Default PCIe downstream translator, implementing transaction_translator.
Redirects to the applicable port (port cfg, mem, msg or io), which
translates to the corresponding memory space, in the pcie-downstream-port
helper object. An override to the implementation of the
transaction_translator interface method which creates a chained transaction
to add atoms to the transaction chain, SHOULD consider whether or not
deferred transactions should be supported in the platform this device will be
a part of. See more details at
here.