#
b0eb9d3e |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Convert polling loop from status-based to interrupt-based
INTR_STAT register exposes more useful informaton then STA register does e.g. it exposes error and I2C bus STOP conditions. Make it a
[ig4] Convert polling loop from status-based to interrupt-based
INTR_STAT register exposes more useful informaton then STA register does e.g. it exposes error and I2C bus STOP conditions. Make it a main source of I2C transfer state.
show more ...
|
#
7f6aee64 |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Use interrupts for waiting for empty TX FIFO
|
#
7814f978 |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Convert last remaining usage of TX_NOTFULL status to TX_EMPTY
in ig4iic_read routine. It makes possible interrupt utilization while waiting for empty space in TX FIFO.
|
#
023c42ed |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Rewrite ig4iic_write routine to use TX_EMPTY status flag
rather than TX_NOTFULL. It makes possible interrupt utilization while waiting for empty space in TX FIFO.
|
#
6f0c4b85 |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Remove dead code inherited from DragonflyBSD
|
#
db7caa2e |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Add suspend/resume support
That is done with re-execution of controller initialization procedure from resume handler.
PR: 238037
|
#
83a66b9b |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Implement burst mode for data reads
In this mode DATA_CMD register reads and writes are performed in TX/RX FIFO-sized bursts to increase I2C bus utilization.
That reduces read time from 60us
[ig4] Implement burst mode for data reads
In this mode DATA_CMD register reads and writes are performed in TX/RX FIFO-sized bursts to increase I2C bus utilization.
That reduces read time from 60us to 30us per byte when read data is fit in to RX FIFO buffer in FAST speed mode in my setup.
show more ...
|
#
88512838 |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Set clock registers based on controller model
IC clock rates are varied between different controller models so we have to adjust timing registers in each case individually. Borrow intresting c
[ig4] Set clock registers based on controller model
IC clock rates are varied between different controller models so we have to adjust timing registers in each case individually. Borrow intresting constants and formulas from Intel specs, i2c-designware and lpss_intel drivers and apply them to FreeBSD supported controller models.
Implement fetching of timing data via ACPI methods execution if available.
show more ...
|
#
38cca60b |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] dump IG4_REG_COMP_PARAM1 and IG4_REG_COMP_VER registers unconditionally
They appeared to be supported (although undocumented) on SkyLakes+ too.
|
#
6777ccd9 |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Do not wait until interrupts are enabled at attach stage
as the driver is fully functional on a cold boot through utilization of polled mode.
As a side effect, ig4 children probe and attach m
[ig4] Do not wait until interrupts are enabled at attach stage
as the driver is fully functional on a cold boot through utilization of polled mode.
As a side effect, ig4 children probe and attach methods can be called earlier in the boot sequence, so now it is up to the child drivers to wait for a kernel initialization completion if it is required.
show more ...
|
#
41b24e09 |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Allow enabling of polled mode from iicbus allocation callback
If controller is allocated with IIC_NOWAIT option ig4 enables polled mode for a period of allocation that makes possible to start
[ig4] Allow enabling of polled mode from iicbus allocation callback
If controller is allocated with IIC_NOWAIT option ig4 enables polled mode for a period of allocation that makes possible to start I2C transfers from the contexts where sleeping is not allowed e.g. from ithreads or callouts.
show more ...
|
#
c59aca57 |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Add support for polled mode
Currently ig4 internally depends on it's own interrupts and uses mtx_sleep() to wait for them. That means it can not be used from any context where sleeping is disa
[ig4] Add support for polled mode
Currently ig4 internally depends on it's own interrupts and uses mtx_sleep() to wait for them. That means it can not be used from any context where sleeping is disallowed e.g. on cold boot, from DDB/KDB, from other device driver's interrupt handlers and so on.
This change replaces sleeps with busy loops in cold boot and DDB cases.
show more ...
|
#
d117e363 |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] disable controller before initialization of clock counters
It is required by controller specifications.
|
#
edcf6a9f |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Stop I2C controller after checking that it's kind of functional.
Obtained from: DragonfliBSD (0b3eedb)
|
#
811ff4dd |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] We actually need to set the Rx threshold register one smaller.
Setting the IG4_REG_RX_TL register to 1 was actually generating an interrupt after 2 bytes were available in the Rx fifo. We need
[ig4] We actually need to set the Rx threshold register one smaller.
Setting the IG4_REG_RX_TL register to 1 was actually generating an interrupt after 2 bytes were available in the Rx fifo. We need to set the register to 0 to get an interrupt for 1 byte already.
Obtained from: DragonflyBSD (02f0bf2)
show more ...
|
#
0a6b1b56 |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Ignore stray interrupts
|
#
733d657a |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Reduce scope of io_lock
Now io_lock is used as condition variable to synchronize active process with the interrupt handler. It is not used for tasks other than waiting for interrupt and passin
[ig4] Reduce scope of io_lock
Now io_lock is used as condition variable to synchronize active process with the interrupt handler. It is not used for tasks other than waiting for interrupt and passing parameters to and from it's handler.
show more ...
|
#
85cd895f |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Do not wait for interrupts in set_controller() routine
Specs shows no dedicated interrupt firing on disable of the controller.
Remove io lock acquisitions around set_controller() calls as the
[ig4] Do not wait for interrupts in set_controller() routine
Specs shows no dedicated interrupt firing on disable of the controller.
Remove io lock acquisitions around set_controller() calls as they are not needed anymore.
show more ...
|
#
eca74de0 |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Drop driver's internal RX FIFO
There is no need to read all controller's RX FIFO data to clear RX_FULL bit in interrupt handler as interrupts are masked permanently since previous commit.
|
#
21e459c6 |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Only enable interrupts when we want them. Otherwise keep mask at 0.
This avoids possible interrupt storms, depending on the state of the I2C controller before the driver attached.
During atta
[ig4] Only enable interrupts when we want them. Otherwise keep mask at 0.
This avoids possible interrupt storms, depending on the state of the I2C controller before the driver attached.
During attaching this clears the interrupt mask.
Revert r338215 as this change makes it no-op.
Obtained from: DragonflyBSD (d7c8555)
show more ...
|
#
bf9c3c58 |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Handle controller startup errors
Fail the attach on controller startup errors. For some reason the dell xps 13 says there's I2C controller, but the controller appears to be permanente disable
[ig4] Handle controller startup errors
Fail the attach on controller startup errors. For some reason the dell xps 13 says there's I2C controller, but the controller appears to be permanente disabled and will refuse to enable.
Obtained from: DragonflyBSD (509820b)
show more ...
|
#
984ed3e4 |
| 03-Nov-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
[ig4] Give common name to PCI and ACPI device drivers
They share common device driver code with different bus attachments
This commit starts a bunch of changes which have following properties:
Rev
[ig4] Give common name to PCI and ACPI device drivers
They share common device driver code with different bus attachments
This commit starts a bunch of changes which have following properties:
Reviewed by: imp (previous version) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D22016
show more ...
|
Revision tags: release/12.1.0 |
|
#
61c1328e |
| 13-Sep-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r352105 through r352307.
|
#
3ca6000f |
| 12-Sep-2019 |
Vladimir Kondratyev <wulf@FreeBSD.org> |
ig4(4): Fix SDA HOLD time set too low on Skylake controllers
Execution of "Soft reset" command (IG4_REG_RESETS_SKL) at controller init stage sets SDA_HOLD register value to 0x0001 which is often too
ig4(4): Fix SDA HOLD time set too low on Skylake controllers
Execution of "Soft reset" command (IG4_REG_RESETS_SKL) at controller init stage sets SDA_HOLD register value to 0x0001 which is often too low for normal operation.
Set SDA_HOLD back to 28 after reset to restore controller functionality.
PR: 240339 Reported by: imp, GregV, et al. MFC after: 3 days
show more ...
|
Revision tags: release/11.3.0, release/12.0.0 |
|
#
c6879c6c |
| 23-Oct-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r339015 through r339669.
|