| Age | Commit message (Collapse) | Author | Files | Lines |
|
The ASPEED BMC SoCs have many knobs and switches that are sometimes
design-specific and often defy any approach to unify them under an
existing subsystem.
Add a driver to translate a devicetree table into sysfs entries to
expose bits and fields for manipulation from userspace. This encompasses
concepts from scratch registers to boolean conditions to enable or
disable host interface features.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
|
|
Change energy sensor to cumulative energy sensor.
Actually energy sensor implementation works as simply translation for
value read from PCS register to microjoules.
With this change, energy sensor will behave as accumulative sensor>
After every read on energyN_input file new energy sample will be
gathered, and the difference between new sample and previous one will
be added to sensor value.
This approach solves problems with counters overflow and interpretation
of the energy sensor value.
Signed-off-by: Olender, Agata <agata.olender@intel.com>
|
|
Remove modparam to enable peci-mctp probe and enable it by default.
Tested: Verified that peci-mctp driver probes correctly:
peci peci-1: cdev of adapter [peci-mctp] registered as minor 1
Manually verified that applications using PECI work correctly.
Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
|
|
When peci-mctp finds that there is no discovered CPU, it queries
aspeed-mctp to read BDFs for each static EID reserved by CPU socket.
If BDF is non-zero, peci-mctp reads CPUNODEID_CFG register to determine
CPU represented by this endpoint.
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
|
|
Right now, send and receive API functions are called directly from xfer
handler. Let's add a dedicated helper function responsible for
send/receive to allow issuing PECI messages originated in peci-mctp
driver.
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
|
|
Recently, aspeed-mctp driver functionality was extended to store BDF
values for already discovered MCTP endpoints on PCIe bus.
Let's expose kernel API to read BDF based on endpoint ID.
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
|
|
Support interrupt generation for both 16 and 32 mailbox registers.
Tested:
After applied this patch, write the mailbox registers from BIOS side,
the misc manager can capture the new mailbox data.
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
|
|
Adjust energy sensor to be 31 bits counter and return only positive
values using S32 type - that is a part of common sensor struct for
all hwmon peci sensors.
Signed-off-by: Olender, Agata <agata.olender@intel.com>
|
|
Fixed out of range write by ignoring usage of CCC_WORKAROUND
when DEVICE_ADDR_TABLE_POINTER register returns 0 value. It
allows to use simulation software like QEMU where I3C may not
be implemented and all its registers are set to zeros.
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
|
|
This commit fixes SUS_WARN handling as dual-edge detection mode
to support deepsx entry event properly.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
|
|
Modify eSPI driver to support poll fops.
Signed-off-by: Arun P. Mohanan <arun.p.m@linux.intel.com>
|
|
When PCH works under eSPI mode, the PMC (Power Management Controller) in
PCH is waiting for SUS_ACK from BMC after it alerts SUS_WARN. It is in
dead loop if no SUS_ACK assert. This is the basic requirement for the BMC
works as eSPI slave.
Also for the host power on / off actions, from BMC side, the following VW
(Virtual Wire) messages are done in firmware:
1. SLAVE_BOOT_LOAD_DONE / SLAVE_BOOT_LOAD_STATUS
2. SUS_ACK
3. OOB_RESET_ACK
4. HOST_RESET_ACK
Also, it provides monitoring interface of PLTRST_N signal through
/dev/espi-pltrstn
Signed-off-by: Haiyue Wang <haiyue.wang@linux.intel.com>
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
Signed-off-by: James Feist <james.feist@linux.intel.com>
Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
|
|
AST2600 A1 has separate reset control for LPC and eSPI so this
commit fix the index definition to make it work on AST2600 A1.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
|
|
There is a data to send/read FIFO used by the AST26xx series JTAG Master
Controller when hardware mode 1 and 2 transfer is selected. The proper
usage of this FIFO allows AST26xx JTAG peripheral to xfer up to 512 bit
without CPU interaction.
In this commit we included a delay after FIFO R/W operations to provide
enough time for JTAG master controller to handle FIFO transitions.
Additionally we included aspeed_jtag_xfer_hw_26xx() to separate AST25xx
and AST26xx HW1 xfer handlers and setup the delay only for AST26xx
series.
These changes doesn't affect Software mode or AST25xx functionality.
Tested:
ASD Sanity works finished successfully for AST26xx in SW/HW1/HW2 modes
50 times jtag_test -h -t 8 -i 8000000 (HW2)
50 times jtag_test -h -t 8 -i 8000000 (HW1)
50 times jtag_test -i 8000000 (SW)
Signed-off-by: Ernesto Corona <ernesto.corona@intel.com>
|
|
Now that it is possible to send PECI frames via aspeed-mctp driver,
let's add aspeed-peci-mctp node to allow bind peci-mctp-aspeed adapter
driver.
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
|
|
PECI frames can be encapsulated into MCTP PCIe VDM packets.
Let's add driver that allows to send PECI frames via aspeed-mctp driver.
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
|
|
Currently driver submits 1 (or rarely more than 1) packet then
waits until HW signals transmission completion before sending
more packets. This logic requires interrupt after each packet,
aspeed_mctp_tx_tasklet() is invoked twice per packet.
New logic uses TX ring correctly, packets are added to the end of
circular ring buffer. The driver does not have to wait for HW to
complete transmission of enqueued packets before adding more packets
to TX queue. Interrupt is generated only if TX ring if full.
This change significantly improves packet transmission performance:
PECI GetTemp command takes ~25us instead of ~30us.
This change also fixes sporadic TX hangs during host reboot seen
with current driver.
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
|
|
If self EID is known then the driver updates source EID in
MCTP header of sent packets. For MCTP control packets the
source EID is not updated as it may disrupt MCTP discovery flow.
Self EID is determined from list of known endpoints provided
by ASPEED_MCTP_IOCTL_SET_EID_INFO IOCTL.
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
|
|
This commit ports I3C updates from Aspeed SDK v00.06.00.
Note: Should be refined to get upstreamed.
Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
|
|
Add support for energy consumption of CPU package sensor.
Energy is reported in micro Joules and exposed under
energyN_input file.
Signed-off-by: Olender, Agata <agata.olender@intel.com>
|
|
Under even moderate traffic the driver can miss a lot of received
packets and eventually stops receiving packets at all.
There is an bug in AST2600 RX logic where HW does not wrap
around RX read buffer pointer correctly. Current driver
workaround for this bug resets RX HW read pointer to 0 whenever
it reaches end of the RX buffer ring - this does not work properly
if more than 1 packet is received while RX pointer is close to
the end of the RX buffer ring - in such case HW can detect ring
full condition and stop RX.
The new workaround has different logic: it sets HW buffer count to
4n - 1 and updates driver maintained RX write pointer so it
tracks HW read pointer to prevent hardware from stopping.
Received packets are located by looking into RX data buffers
rather that HW read pointer that contains incorrect value anyway.
Driver never resets HW read pointer, HW is receiving packets without
any interference form the driver.
Also handle RX_CMD_NO_MORE_INT - if RX ring if full then
HW will clear RX_CMD_READY bit and we need to re-enable it
once we free some space in RX ring.
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
|
|
Initial value of I2CD18 is undefined according to the datasheet
so this commit adds the I2CD18 register clearing code into bus
initialization function to prevent any unexpected slave match
events.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
|
|
Right now, PECI revision is determined using a result of GetDIB() PECI
command. Because GetDIB() may not be supported by all type of physical
media that provides PECI, we need an alternative.
Until we figure how to determine PECI revision there (if we can't do
that, we'll fallback to device tree), let's allow to hardcode PECI
revision as a property of hardware adapter.
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
|
|
Some protocols that are already implemented in kernel can be
encapsulated in MCTP packets. To allow use aspeed-mctp internally in
kernel space, let's allow to use selected functions outside of
aspeed-mctp.
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
|
|
Right now, TX ring contains packets with PCIe header already swapped
to little endian (byte order expected by HW), while RX ring contains
packets with PCIe header already swapped to network order (expected by
userspace).
Let's keep TX packets in network order and swap before write to HW
buffer.
To make it more readable, let's extract swapping into a helper function.
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
|
|
Implement two new ioctls for storing EID related information:
* ASPEED_MCTP_IOCTL_GET_EID_INFO
* ASPEED_MCTP_IOCTL_SET_EID_INFO
Driver stores EID mapping in a list which is traversed when
one tries to get information using ASPEED_MCTP_IOCTL_GET_EID_INFO
ioctl, when given EID mapping is not found in the list, next entry
is returned. When there are no entries with EIDs higher than specified
in the IOCTL call -ENODEV is returned.
Whenever new information about EID mapping is stored with
ASPEED_MCTP_IOCTL_SET_EID_INFO ioctl driver empties exsiting
list of mappings and creates new one based on user input.
After insertion list is sorted by EID. Invalid input
such as duplicated EIDs will cause driver to return -EINVAL.
Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
|
|
Uevent objects are different for PCI_READY=0 and PCI_READY=1.
Let's make uevents consistent and use the same object in both cases.
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
|
|
MCTP client can register for receiving packets with selected
MCTP message type or PCIE vendor defined message type.
Vendor defined type is 2 bytes but in Intel VDMs the first byte
is variable and only the second byte contains constant message
type - to support this use case we have to specify 2 byte mask
that is applied to packet type before comparing with registered
vendor type.
When MCTP packet arrives its header is compared with a list
of registered (vendor) types.
If no client registered for packet's (vendor) type then
the packet is dispatched to the default client.
Fragmented packets are not considered for type matching.
Only one client can register for given (vendor) type.
Client can register for multiple (vendor) types.
All packet fields must be specified in big endian byte
order.
This feature allows to support multiple clients simultaneously
but only one client per (vendor) message type.
For example we can have PECI client in kernel that uses PECI
vendor message type, dcpmm daemon in user space that handles
NVDIMM vendor type messages and mctpd service that handles MCTP
control and PLDM message types.
tested with peci_mctp_test application
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
|
|
Add IOCTL to register given client as default client that
receives all packets that were not dispatched to other
clients.
This IOCTL is intended to be used by mctpd service or test
application that should receive all packets that are not
claimed by other clients.
mctpd service might not be the first user space
client since dcpmm or telemetry client can start
before mctpd or mctpd can crash and be restarted
automatically at any time.
To preserve backward compatibility with mctpd, the first user space
client will be registered automatically as default client - once mctpd
is modified to call ASPEED_MCTP_IOCTL_REGISTER_DEFAULT_HANDLER we
can remove this workaround.
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
|
|
Whenever MCTP packet arrives it is dispatched to a specific
client - there is no need to wake up all clients
waiting in aspeed_mctp_poll().
Move wait queue from driver structure to client structure.
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
|
|
This commit adds minimal support for multiple clients.
Currently packets are dispatched to default client.
Support for dispatching incoming packets to different
clients will be added in subsequent patches.
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
|
|
This commit adds a WA to cover timing negotiation hang issue on
target CPU cold resets by retriggering the timing negotiation.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
|
|
Pinpad AF22,AF23,AE22 and AE24 are dedicated pins for I3C but
pinmux setting should be set in SCU438 register accordingly otherwise
I3C pins are not enabled. To fix this issue, this commit adds
pinctrl settings for I3C1 and I3C2.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
|
|
This commit fixed module probing fail by moving irq enabling to
just before the i3c_master_register.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
|
|
This commit makes the driver call devm_request_irq when the driver
is completely ready to handle interrupts.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
|
|
AST2600 provides different function of WDT0C[4] and it doesn't
provides WDT10[1] so this commit fixes driver to make it available
on AST2600.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
|
|
1. Peci dimmpower module implementation.
2. Enable DIMM avarage power, power limit, power limit max setting,
power limit min setting reading and expose them under
power1_avarage, power1_cap, power1_cap_max, power1_cap_min in
sysfs.
3. Enable DIMM power limit writing through power1_cap.
Tested:
* on WilsonCity platform,
* power1_avarage, power1_cap, power1_cap_max and power1_cap_min work
as expected
Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
|
|
1. Use hwmon peci pcs utils to refactor peci cpupower module.
2. Enable CPU power limit, power limit max (TDP) setting,
power limit min setting reading and expose them under
power1_cap, power1_cap_max, power1_cap_min.
3. Enable CPU power limit writing through power1_cap.
Tested:
* on WilsonCity platform,
* power1_avarage works as before the change,
* power1_cap, power1_cap_max, power1_cap_min work as expected.
Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
|
|
1. Helpers for reading/writing PCS registers added.
2. PECI sensor configuration structure definition and helpers added.
3. New PECI PCS index and parameters definitions added.
Tested:
* on WilsonCity platform
* hwmon/peci modules work as before the change
Signed-off-by: Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>
|
|
FuzzUSB (a variant of syzkaller) found an illegal array access
using an incorrect index while binding a gadget with UDC.
Reference: https://www.spinics.net/lists/linux-usb/msg194331.html
This bug occurs when a size variable used for a buffer
is misused to access its strcpy-ed buffer.
Given a buffer along with its size variable (taken from user input),
from which, a new buffer is created using kstrdup().
Due to the original buffer containing 0 value in the middle,
the size of the kstrdup-ed buffer becomes smaller than that of the original.
So accessing the kstrdup-ed buffer with the same size variable
triggers memory access violation.
The fix makes sure no zero value in the buffer,
by comparing the strlen() of the orignal buffer with the size variable,
so that the access to the kstrdup-ed buffer is safe.
BUG: KASAN: slab-out-of-bounds in gadget_dev_desc_UDC_store+0x1ba/0x200
drivers/usb/gadget/configfs.c:266
Read of size 1 at addr ffff88806a55dd7e by task syz-executor.0/17208
CPU: 2 PID: 17208 Comm: syz-executor.0 Not tainted 5.6.8 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0xce/0x128 lib/dump_stack.c:118
print_address_description.constprop.4+0x21/0x3c0 mm/kasan/report.c:374
__kasan_report+0x131/0x1b0 mm/kasan/report.c:506
kasan_report+0x12/0x20 mm/kasan/common.c:641
__asan_report_load1_noabort+0x14/0x20 mm/kasan/generic_report.c:132
gadget_dev_desc_UDC_store+0x1ba/0x200 drivers/usb/gadget/configfs.c:266
flush_write_buffer fs/configfs/file.c:251 [inline]
configfs_write_file+0x2f1/0x4c0 fs/configfs/file.c:283
__vfs_write+0x85/0x110 fs/read_write.c:494
vfs_write+0x1cd/0x510 fs/read_write.c:558
ksys_write+0x18a/0x220 fs/read_write.c:611
__do_sys_write fs/read_write.c:623 [inline]
__se_sys_write fs/read_write.c:620 [inline]
__x64_sys_write+0x73/0xb0 fs/read_write.c:620
do_syscall_64+0x9e/0x510 arch/x86/entry/common.c:294
entry_SYSCALL_64_after_hwframe+0x49/0xbe
Signed-off-by: Kyungtae Kim <kt0755@gmail.com>
Reported-and-tested-by: Kyungtae Kim <kt0755@gmail.com>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200510054326.GA19198@pizza01
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
|
Currently, there is no proper MCTP networking subsystem in Linux.
Until we are able to work out the details of that, we are going to
expose HW to userspace using raw read/write interface.
Because of that, this driver is not intended to be submitted upstream.
Here we are providing a simple device driver for AST2600 MCTP
controller.
v2: Added workarounds for BMC reboot/reset, corrected endianess comment,
changed TX_BUF_ADDR to be consistent, fixed typos.
v3: Added workaround for RX hang, added swapping PCIe VDM header to
network order, corrected buffer allocation size.
v4: Fixed TX broken after sending 32 byte packet
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
|
|
AST2600 provides MCTP over PCIe controller allowing BMC to communicate
with devices on host PCIe bus.
We are also adding syscon node describing PCIe Host controller device
which can be used to gather information on PCIe enumeration (and
assigned address).
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
|
|
This commit ports I3C related changes from Aspeed SDK v00.05.05.
It also includes Vitor's I3C cdev implementation which isn't
upstreamed yet so it should be refined later.
Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com>
Signed-off-by: Vitor Soares <soares@synopsys.com>
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
|
|
When an arbitration loss happens in a multi-master bus, driver
drops the packet induce I2C subsystem to retry the transaction
by returning -EAGAIN. During this handling, tx_ack comes along
sometimes and it causes this this garbage printing
out:
aspeed-i2c-bus 1e78a400.i2c-bus: irq handled != irq. expected 0x00000009, but was 0x00000008
To fix this issue, this commit adds the tx_ack flag clearing into
the arbitration loss handling logic.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
|
|
This commit refines clock settings with cherry picking the latest
code from Aspeed SDK v00.05.05
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
|
|
jffs2_flash_direct_writev() always invokes jffs2_sum_add_kvec(), even
if mtd_writev() fails. Usually, this results in an extra summary entry
pointing to dirty node space, which should be ignored -- it is a bit of
a waste, but harmless.
When mtd_writev() returns *retlen == 0, though, the node space is not
reserved as dirty, but re-used; the extra summary entry then points
into the space of the next node. After the erase block has been closed,
we get the following messages on remount:
jffs2: error: (79) jffs2_link_node_ref:
Adding new ref c3048d18 at (0x00ec5b88-0x00ec6bcc)
not immediately after previous (0x00ec5b88-0x00ec5b88)
...
jffs2: Checked all inodes but still 0x2088 bytes of unchecked space?
jffs2: No space for garbage collection. Aborting GC thread
The extra summary entries amount to "unchecked space", so that
jffs2_garbage_collect_pass() returns -ENOSPC. And without garbage
collection, the filesystem becomes unuseable over time as the erase
blocks fill up.
Fix this by skipping jffs2_sum_add_kvec() when the MTD write fails. We
don't need the summary entry anyway, and the behaviour matches that of
jffs2_flash_writev() in wbuf.c (with write buffering enabled).
Signed-off-by: Thomas Betker <thomas.betker@rohde-schwarz.com>
|
|
Modifying the mailbox driver to use FIFO queue while using interrupt.
Signed-off-by: Arun P. Mohanan <arun.p.m@linux.intel.com>
|
|
This commit includes additions/changes in driver code
to support 9 PWM outputs and 9 fan tachometer inputs for
ast2600 as per archer city usage
Signed-off-by: Ayushi Smriti <smriti.ayushi@intel.com>
|
|
The ftgmac100_open function initializes state for the NCSI
channel. The get link settings function does not return this
data. This caused the link speed, and the duplex value to be returned
incorrectly by the PHY driver (0 Mbps, and duplex off).
Update the driver to return either the PHY settings when not using
NCSI, or the NCSI values that were assigned when the driver is opened.
Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
|
|
This commit adds quick fix for cases of run time registration
through sysfs. It should be fixed later by adding parsing code for
ipmb_id instead.
This is a temporary fix. Do not upstream it.
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
|