0c0f1bee | 30-Jun-2022 |
Peter Delevoryas <pdel@fb.com> |
hw/i2c/aspeed: Fix MASTER_EN missing error message
aspeed_i2c_bus_is_master is checking if master mode is enabled in the I2C bus controller's function-control register, not that slave mode is enable
hw/i2c/aspeed: Fix MASTER_EN missing error message
aspeed_i2c_bus_is_master is checking if master mode is enabled in the I2C bus controller's function-control register, not that slave mode is enabled or something. The error here is that the guest is trying to trigger an I2C master mode command while master mode is not enabled.
Fixes: ba2cccd64e90f342 ("aspeed: i2c: Add new mode support") Signed-off-by: Peter Delevoryas <pdel@fb.com> Message-Id: <20220630045133.32251-4-me@pjd.dev> Reviewed-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Cédric Le Goater <clg@kaod.org>
show more ...
|
b582b7a1 | 30-Jun-2022 |
Peter Delevoryas <pdel@fb.com> |
hw/i2c/aspeed: Fix DMA len write-enable bit handling
I noticed i2c rx transfers were getting shortened to "1" on Zephyr. It seems to be because the Zephyr i2c driver sets the RX DMA len with the RX
hw/i2c/aspeed: Fix DMA len write-enable bit handling
I noticed i2c rx transfers were getting shortened to "1" on Zephyr. It seems to be because the Zephyr i2c driver sets the RX DMA len with the RX field write-enable bit set (bit 31) to avoid a read-modify-write. [1]
/* 0x1C : I2CM Master DMA Transfer Length Register */
I think we should be checking the write-enable bits on the incoming value, not checking the register array. I'm not sure we're even writing the write-enable bits to the register array, actually.
[1] https://github.com/AspeedTech-BMC/zephyr/blob/db3dbcc9c52e67a47180890ac938ed380b33f91c/drivers/i2c/i2c_aspeed.c#L145-L148
Fixes: ba2cccd64e90f34 ("aspeed: i2c: Add new mode support") Signed-off-by: Peter Delevoryas <pdel@fb.com> Message-Id: <20220630045133.32251-3-me@pjd.dev> Reviewed-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Cédric Le Goater <clg@kaod.org>
show more ...
|
ceb3ff0e | 30-Jun-2022 |
Peter Delevoryas <pdel@fb.com> |
hw/i2c/aspeed: Fix R_I2CD_FUN_CTRL reference
Very minor, doesn't effect functionality, but this is supposed to be R_I2CC_FUN_CTRL (new-mode, not old-mode).
Fixes: ba2cccd64e9 ("aspeed: i2c: Add new
hw/i2c/aspeed: Fix R_I2CD_FUN_CTRL reference
Very minor, doesn't effect functionality, but this is supposed to be R_I2CC_FUN_CTRL (new-mode, not old-mode).
Fixes: ba2cccd64e9 ("aspeed: i2c: Add new mode support") Signed-off-by: Peter Delevoryas <pdel@fb.com> Message-Id: <20220630045133.32251-2-me@pjd.dev> Reviewed-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Cédric Le Goater <clg@kaod.org>
show more ...
|
dd0b3271 | 30-Jun-2022 |
Maheswara Kurapati <quic_mkurapat@quicinc.com> |
hw/i2c: pmbus: Page #255 is valid page for read requests.
Current implementation of the pmbus core driver treats the read request for page 255 as invalid request and sets the invalid command bit (bi
hw/i2c: pmbus: Page #255 is valid page for read requests.
Current implementation of the pmbus core driver treats the read request for page 255 as invalid request and sets the invalid command bit (bit 7) in the STATUS_CML register. As per the PMBus specification it is a valid request.
Refer to the PMBus specification, revision 1.3.1, section 11.10 PAGE, on the page 58: "Setting the PAGE to FFh means that all subsequent comands are to be applied to all outputs.
Some commands, such as READ_TEMPERATURE, may use a common sensor but be available on all pages of a device. Such implementations are the decision of each device manufacturer or are specified in a PMBus Application Profile. Consult the manufacturer's documents or the Application Profile Specification as needed."
For e.g., The VOUT_MODE is a valid command for page 255 for maxim 31785 device. refer to Table 1. PMBus Command Codes on page 14 in the datasheet. https://datasheets.maximintegrated.com/en/ds/MAX31785.pdf
Fixes: 38870253f1d1 ("hw/i2c: pmbus: fix error returns and guard against out of range accesses")
Signed-off-by: Maheswara Kurapati <quic_mkurapat@quicinc.com> Signed-off-by: Jae Hyun Yoo <quic_jaehyoo@quicinc.com> Reviewed-by: Titus Rwantare <titusr@google.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20220627154703.148943-4-quic_jaehyoo@quicinc.com> Signed-off-by: Cédric Le Goater <clg@kaod.org>
show more ...
|
33e30f11 | 13-Jun-2022 |
Cédric Le Goater <clg@kaod.org> |
aspeed/i2c: Enable SLAVE_ADDR_RX_MATCH always
There is no 'slave match interrupt' enable bit in the Interrupt Control Register. Consider it is always enabled and extend the mask value 'bus->regs[int
aspeed/i2c: Enable SLAVE_ADDR_RX_MATCH always
There is no 'slave match interrupt' enable bit in the Interrupt Control Register. Consider it is always enabled and extend the mask value 'bus->regs[intr_ctrl_reg]' with the SLAVE_ADDR_RX_MATCH bit when the interrupt is raised.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
show more ...
|
d72a712c | 13-Jun-2022 |
Klaus Jensen <k.jensen@samsung.com> |
hw/i2c/aspeed: add DEV_ADDR in old register mode
Add support for writing and reading the device address register in old register mode.
On the AST2400 (only 1 slave address)
* no upper bits
On t
hw/i2c/aspeed: add DEV_ADDR in old register mode
Add support for writing and reading the device address register in old register mode.
On the AST2400 (only 1 slave address)
* no upper bits
On the AST2500 (2 possible slave addresses),
* bit[31] : Slave Address match indicator * bit[30] : Slave Address Receiving pending
On the AST2600 (3 possible slave addresses),
* bit[31-30] : Slave Address match indicator * bit[29] : Slave Address Receiving pending
The model could be more precise to take into account all fields but since the Linux driver is masking the register value being set, it should be fine. See commit 3fb2e2aeafb2 ("i2c: aspeed: disable additional device addresses on ast2[56]xx") from Zeiv. This can be addressed later.
Signed-off-by: Klaus Jensen <k.jensen@samsung.com> [ clg: add details to commit log ] Message-Id: <20220601210831.67259-3-its@irrelevant.dk> Signed-off-by: Cédric Le Goater <clg@kaod.org>
show more ...
|
b03ec4ff | 13-Jun-2022 |
Klaus Jensen <k.jensen@samsung.com> |
hw/i2c/aspeed: rework raise interrupt trace event
Build a single string instead of having several parameters on the trace event.
Suggested-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Klaus J
hw/i2c/aspeed: rework raise interrupt trace event
Build a single string instead of having several parameters on the trace event.
Suggested-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Klaus Jensen <k.jensen@samsung.com> [ clg: simplified trace buffer creation ] Message-Id: <20220601210831.67259-2-its@irrelevant.dk> Signed-off-by: Cédric Le Goater <clg@kaod.org>
show more ...
|
b35802ce | 13-Jun-2022 |
Cédric Le Goater <clg@kaod.org> |
aspeed/i2c: Add ast1030 controller models
Based on :
https://lore.kernel.org/qemu-devel/20220324100439.478317-2-troy_lee@aspeedtech.com/
Cc: Troy Lee <troy_lee@aspeedtech.com> Cc: Jamin Lin <jam
aspeed/i2c: Add ast1030 controller models
Based on :
https://lore.kernel.org/qemu-devel/20220324100439.478317-2-troy_lee@aspeedtech.com/
Cc: Troy Lee <troy_lee@aspeedtech.com> Cc: Jamin Lin <jamin_lin@aspeedtech.com> Cc: Steven Lee <steven_lee@aspeedtech.com> Reviewed-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Cédric Le Goater <clg@kaod.org>
show more ...
|
e532cd04 | 13-Jun-2022 |
Joe Komlodi <komlodi@google.com> |
aspeed: i2c: Move regs and helpers to header file
Moves register definitions and short commonly used inlined functiosn to the header file to help tidy up the implementation file.
Signed-off-by: Joe
aspeed: i2c: Move regs and helpers to header file
Moves register definitions and short commonly used inlined functiosn to the header file to help tidy up the implementation file.
Signed-off-by: Joe Komlodi <komlodi@google.com> Change-Id: I34dff7485b6bbe3c9482715ccd94dbd65dc5f324 Message-Id: <20220331043248.2237838-8-komlodi@google.com> Signed-off-by: Cédric Le Goater <clg@kaod.org>
show more ...
|
0efec47b | 13-Jun-2022 |
Joe Komlodi <komlodi@google.com> |
aspeed: i2c: Add PKT_DONE IRQ to trace
Signed-off-by: Joe Komlodi <komlodi@google.com> Change-Id: I566eb09f4b9016e24570572f367627f6594039f5 Message-Id: <20220331043248.2237838-7-komlodi@google.com>
aspeed: i2c: Add PKT_DONE IRQ to trace
Signed-off-by: Joe Komlodi <komlodi@google.com> Change-Id: I566eb09f4b9016e24570572f367627f6594039f5 Message-Id: <20220331043248.2237838-7-komlodi@google.com> Signed-off-by: Cédric Le Goater <clg@kaod.org>
show more ...
|
ba2cccd6 | 13-Jun-2022 |
Joe Komlodi <komlodi@google.com> |
aspeed: i2c: Add new mode support
On AST2600, I2C has a secondary mode, called "new mode", which changes the layout of registers, adds some minor behavior changes, and introduces a new way to transf
aspeed: i2c: Add new mode support
On AST2600, I2C has a secondary mode, called "new mode", which changes the layout of registers, adds some minor behavior changes, and introduces a new way to transfer data called "packet mode".
Most of the bit positions of the fields are the same between old and new mode, so we use SHARED_FIELD_XX macros to reuse most of the code between the different modes.
For packet mode, most of the command behavior is the same compared to other modes, but there are some minor changes to how interrupts are handled compared to other modes.
Signed-off-by: Joe Komlodi <komlodi@google.com> Change-Id: I072f8301964f623afc74af1fe50c12e5caef199e Message-Id: <20220331043248.2237838-6-komlodi@google.com> Signed-off-by: Cédric Le Goater <clg@kaod.org>
show more ...
|
2260fc6f | 13-Jun-2022 |
Joe Komlodi <komlodi@google.com> |
aspeed: i2c: Use reg array instead of individual vars
Using a register array will allow us to represent old-mode and new-mode I2C registers by using the same underlying register array, instead of ad
aspeed: i2c: Use reg array instead of individual vars
Using a register array will allow us to represent old-mode and new-mode I2C registers by using the same underlying register array, instead of adding an entire new set of variables to represent new mode.
As part of this, we also do additional cleanup to use ARRAY_FIELD_ macros instead of FIELD_ macros on registers.
Signed-off-by: Joe Komlodi <komlodi@google.com> Change-Id: Ib94996b17c361b8490c042b43c99d8abc69332e3 [ clg: use of memset in aspeed_i2c_bus_reset() ] Message-Id: <20220331043248.2237838-5-komlodi@google.com> Signed-off-by: Cédric Le Goater <clg@kaod.org>
show more ...
|
648a4882 | 07-Mar-2022 |
Shengtan Mao <stmao@google.com> |
hw/i2c: Added linear mode translation for pmbus devices
Signed-off-by: Shengtan Mao <stmao@google.com> Reviewed-by: Titus Rwantare <titusr@google.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsa
hw/i2c: Added linear mode translation for pmbus devices
Signed-off-by: Shengtan Mao <stmao@google.com> Reviewed-by: Titus Rwantare <titusr@google.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Corey Minyard <cminyard@mvista.com> Message-Id: <20220307200605.4001451-7-titusr@google.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
show more ...
|
78fdfc59 | 07-Mar-2022 |
Titus Rwantare <titusr@google.com> |
hw/i2c: pmbus: refactor uint handling
This change cleans up the inputs to pmbus_receive uint, the length of received data is contained in PMBusDevice state and doesn't need to be passed around.
Sig
hw/i2c: pmbus: refactor uint handling
This change cleans up the inputs to pmbus_receive uint, the length of received data is contained in PMBusDevice state and doesn't need to be passed around.
Signed-off-by: Titus Rwantare <titusr@google.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Corey Minyard <cminyard@mvista.com> Message-Id: <20220307200605.4001451-5-titusr@google.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
show more ...
|
2192aaae | 07-Mar-2022 |
Titus Rwantare <titusr@google.com> |
hw/i2c: pmbus: add PEC unsupported warning
Signed-off-by: Titus Rwantare <titusr@google.com> Acked-by: Corey Minyard <cminyard@mvista.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Messa
hw/i2c: pmbus: add PEC unsupported warning
Signed-off-by: Titus Rwantare <titusr@google.com> Acked-by: Corey Minyard <cminyard@mvista.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220307200605.4001451-4-titusr@google.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
show more ...
|
38870253 | 07-Mar-2022 |
Titus Rwantare <titusr@google.com> |
hw/i2c: pmbus: fix error returns and guard against out of range accesses
Signed-off-by: Titus Rwantare <titusr@google.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Corey Minya
hw/i2c: pmbus: fix error returns and guard against out of range accesses
Signed-off-by: Titus Rwantare <titusr@google.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Corey Minyard <cminyard@mvista.com> Message-Id: <20220307200605.4001451-3-titusr@google.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
show more ...
|