History log of /openbmc/libmctp/libmctp-astlpc.h (Results 1 – 17 of 17)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 400766f9 07-Sep-2023 Konstantin Aladyshev <aladyshev22@gmail.com>

astlpc: Provide KCS device path as a binding argument

Currently astlpc binding expects a '/dev/mctp0' device in the system
for the KCS communication. This device is a symbolic link to the
real '/dev

astlpc: Provide KCS device path as a binding argument

Currently astlpc binding expects a '/dev/mctp0' device in the system
for the KCS communication. This device is a symbolic link to the
real '/dev/raw-kcsX' device, created by the udev rules populated by the
build system.
This approach is not ideal since the build system populates udev rules
for the KCS3 and KCS4 channels simultaneously and for these channels
only. This means that there are some design limitations for the MCTP
communication. It is only possible on KCS3 or KCS4 channel, and if one
of these channels is used, the other one must be disabled.
To make design more flexible get rid of all the udev rules and provide
'/dev/raw-kcsX' device path as an argument to the binding
initialization code.

Change-Id: I505e44280636c83b59669b314f60279b371d0403
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>

show more ...


# 4df106db 16-May-2023 Frederic Barrat <fbarrat@linux.ibm.com>

astlpc: Add mctp_astlpc_tx_done() API

Add the mctp_astlpc_tx_done() API to help with packet transfer
performance when using the LPC binding with the Aspeed BMC. The goal
of the API is to tell the ca

astlpc: Add mctp_astlpc_tx_done() API

Add the mctp_astlpc_tx_done() API to help with packet transfer
performance when using the LPC binding with the Aspeed BMC. The goal
of the API is to tell the caller that the Transmit buffer has been
consumed by the remote side, i.e. the Rx_complete command has been
received locally. It can be helpful on the host side because of the
way the Aspeed BMC implements the KCS devices.

The Aspeed BMC's KCS device doesn't provide an interrupt when the ODR
register is read by the remote client/host. To workaround it, the
linux KCS driver for Aspeed arms a timer to periodically check (every
0.5 second in the current implementation) the state of the register
and generate an "Output Buffer Empty" (OBE) event to wake up any
client on the BMC, for example the mctp-demux-daemon.

Typically, the mctp-demux-daemon waits in the poll() system call and
wakes up when it receives a packet. When it's coming from the LPC bus
and KCS device, the remote writes a Tx_begin command in the IDR
register, which does generate an interrupt. To acknowledge the packet,
the mctp-demux-daemon writes a Tx_complete command in the ODR and can
then dispatch the request to the proper recipient (i.e. the PLDM
daemon). When it wants to send a message on the LPC bus, the
mctp-demux-daemon needs to wait till the ODR register has been read by
the remote. Because we don't have an interrupt to know when that
happens, the mctp-demux-daemon waits in poll() and will be awaken when
an OBE event is generated by a background thread processing the timer
interrupt. So when the mctp-demux-daemon enters poll() with something
to send on the LPC bus, if the ODR is not available immediately, it
will only be sent after the timer fires. Which could take up to 0.5s
with the current driver implementation.

So when the host sends a PLDM request, it is therefore crucial, for
good performance, that it reads the Rx_complete command out of the ODR
very quickly when it's sending a MCTP packet as to free it and make
sure the mctp-demux-daemon can send the reply immediately instead of
having to wait in poll(). That's where the new mctp_astlpc_tx_done()
helps: immediately after sending a message, the host can call
repeatedly mctp_astlpc_poll() to read the KCS device status and read
the ODR as fast as possible and with the mctp_astlpc_tx_done() API, it
knows when to stop. Pseudo code looks like this (ignoring that we
should timeout out of the loop after a while):

mctp_message_tx()
while (!mctp_astlpc_tx_done(astlpc)) {
mctp_astlpc_poll(astlpc);
}

Note that the API, while generic, is (so far) only useful when called
from a remote LPC endpoint.

Change-Id: I5e6d62aa142fe97449ccf9c9a2ade3cf45d02bf6
Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>

show more ...


# 0af68f2e 29-Sep-2022 Andrew Jeffery <andrew@aj.id.au>

libmctp-astlpc: Format with clang-format

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: If8a22091f0dc8b9d0bcb0123f6dcce934cda328b


# 8f53d631 25-Jul-2022 Andrew Jeffery <andrew@aj.id.au>

mctp-demux-daemon: Exploit binding mctp_*_init_pollfd() APIs

Once bindings are correctly implemented as async the daemon itself will
follow.

Finally, now they're unused, drop the mctp_*_get_fd() AP

mctp-demux-daemon: Exploit binding mctp_*_init_pollfd() APIs

Once bindings are correctly implemented as async the daemon itself will
follow.

Finally, now they're unused, drop the mctp_*_get_fd() APIs as they're
strictly less powerful.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ibc2bbc1d75b031e4422429d606e6345d794cb44d

show more ...


# 1111c6a5 25-Jul-2022 Andrew Jeffery <andrew@aj.id.au>

bindings: Add mctp_*_init_pollfd() API

The new API allows the binding to own the poll(2) parameters, providing
the opportunity for it to properly idle when it's unable to send control
messages. Desp

bindings: Add mctp_*_init_pollfd() API

The new API allows the binding to own the poll(2) parameters, providing
the opportunity for it to properly idle when it's unable to send control
messages. Despite this, we hold off on adjusting the behaviour directly
in this commit, as it would constitute a regression until
mctp-demux-daemon has also been converted to exploit the new API.

Change-Id: Ic5a7c5a943566a0f36695daa64457440886fb2ab
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>

show more ...


Revision tags: v0.11
# 0620b4c3 09-Mar-2021 Andrew Jeffery <andrew@aj.id.au>

astlpc: Fix whitespace in ops struct

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: If64467bb99f480cddc0c315ef97069c0ab18d778


Revision tags: v0.10
# 55fb90be 11-May-2020 Andrew Jeffery <andrew@aj.id.au>

astlpc: Consolidate direct vs indirect LPC access

Use helpers to wrap up LPC accessors so we're not littering the code
with conditional checks for direct or indirect access. As a result, drop
the pr

astlpc: Consolidate direct vs indirect LPC access

Use helpers to wrap up LPC accessors so we're not littering the code
with conditional checks for direct or indirect access. As a result, drop
the priv_hdr pointer from struct mctp_binding_astlpc as we're utilising
the buffers provided by the caller, which in turn removes a heap
allocation.

Change-Id: Iab9ca4295879a3f3a0209fb23163c0383476c223
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>

show more ...


# 7cd72f14 12-May-2020 Andrew Jeffery <andrew@aj.id.au>

astlpc: Support the host-side binding interface

The host-side KCS interface differs to the BMC that we need to mirror
the use of the IBF/OBF bits and the location of the Tx/Rx buffers.

The device (

astlpc: Support the host-side binding interface

The host-side KCS interface differs to the BMC that we need to mirror
the use of the IBF/OBF bits and the location of the Tx/Rx buffers.

The device (currently restricted to the host) also needs to use a
different initialisation sequence to the bus-owner (currently restricted
to the BMC), in that it must not write to regions of the control space
that the bus-owner owns. Concretely, the device is to write its
supported version range and then send the channel-init command via the
KCS interface.

Change-Id: I715b83d82119ebbdce6ef8176ea0a9facf9bb555
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>

show more ...


# 0ddd07e7 25-May-2020 Andrew Jeffery <andrew@aj.id.au>

libmctp-astlpc: Fix comment typo

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I17b5c63794c526560af84f933ea3be26fbfe6912


# 06b2cd86 17-Mar-2020 Andrew Jeffery <andrew@aj.id.au>

astlpc: Avoid requiring off_t

off_t is spec'ed to be defined in sys/types.h, however not all
environments define it. The LPC FW address space is only 27 bits, so a
long will be more than sufficient.

astlpc: Avoid requiring off_t

off_t is spec'ed to be defined in sys/types.h, however not all
environments define it. The LPC FW address space is only 27 bits, so a
long will be more than sufficient.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I44af91b8a98a08daace05e41f4928832bbdde5b7

show more ...


# 4663f67c 10-Mar-2020 Andrew Jeffery <andrew@aj.id.au>

astlpc: Add mctp_astlpc_destroy()

Provide an abstraction to cleanup memory to avoid false-positives with
leak sanitizers.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ib73506432eed108

astlpc: Add mctp_astlpc_destroy()

Provide an abstraction to cleanup memory to avoid false-positives with
leak sanitizers.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ib73506432eed108cb992cfc12b40c479b0321463

show more ...


# a0452495 05-Feb-2020 Andrew Jeffery <andrew@aj.id.au>

astlpc: mctp_astlpc_init_ops: constify ops struct

No need for the passed ops struct to be mutable. Lets try to enforce
const where we can.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id:

astlpc: mctp_astlpc_init_ops: constify ops struct

No need for the passed ops struct to be mutable. Lets try to enforce
const where we can.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I3d24efc6cc858e09bb6ab00f202b875bc695b29f

show more ...


# 3b36d17c 03-Sep-2019 Jeremy Kerr <jk@ozlabs.org>

API: Add binding accessors to generic struct mctp_binding

Rather than have every binding include their own wrappers around
binding<->core functions, introduce an accessor to retrieve the struct
mctp

API: Add binding accessors to generic struct mctp_binding

Rather than have every binding include their own wrappers around
binding<->core functions, introduce an accessor to retrieve the struct
mctp_binding from each.

This means we no longer need the binding-specific registration
callbacks. However, we do now need a ->start callback, to allow bindings
to perform post-registration init.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Change-Id: I6cee9e93f37520f85c155a0ca34017cc0675552c

show more ...


# bc53d35a 28-Aug-2019 Jeremy Kerr <jk@ozlabs.org>

astlpc: abstract hardware interactions to allow a non-fileio-based implementation

Currently, the astlpc binding assumes a particular method of access to
the KCS and LPC interfaces, using reads and w

astlpc: abstract hardware interactions to allow a non-fileio-based implementation

Currently, the astlpc binding assumes a particular method of access to
the KCS and LPC interfaces, using reads and writes to a pair of Linux
devices.

We want to be able to use the astlpc binding in different environments,
possibly not backed by file IO. This change adds an interface to provide
custom operations to read and write the KCS and LPC state.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Change-Id: I3e403a025760657a7264098f5486f046e3ac436b

show more ...


# 8682ef24 30-May-2019 Jeremy Kerr <jk@ozlabs.org>

autotools: Install headers

Use the _HEADERS automake variables to install headers appropriately.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>


# 3d36ee2e 29-May-2019 Jeremy Kerr <jk@ozlabs.org>

LICENSE: add GPLv2 license option.

As per the MCTP design document
(https://github.com/openbmc/docs/blob/master/designs/mctp.md), a
dual-licence (GPLv2+ and Apache-2.0) gives us flexibility with inc

LICENSE: add GPLv2 license option.

As per the MCTP design document
(https://github.com/openbmc/docs/blob/master/designs/mctp.md), a
dual-licence (GPLv2+ and Apache-2.0) gives us flexibility with including
libcmtp code into various firmware environments.

This change adds GPLv2+ as a license option. All current contributors
have agreed to this change.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

show more ...


# 672c8852 28-Feb-2019 Jeremy Kerr <jk@ozlabs.org>

bindings: AST LPC binding implementation

Add a binding implementation for the ASPEED 2500 LPC + KCS devices.
While not a standard, this does give us a hardware binding
implementation to use on curre

bindings: AST LPC binding implementation

Add a binding implementation for the ASPEED 2500 LPC + KCS devices.
While not a standard, this does give us a hardware binding
implementation to use on current hardware.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

show more ...