| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
This replaces 50 ms busy loop with mtx_sleep for the same duration thus
saving CPU time when iichid is driven with interrupts.
Sponsored by: Future Crew, LLC
MFC after: 2 month
Differential Revision: https://reviews.freebsd.org/D48956
(cherry picked from commit c7225a3ede3cf99c538158962f4d65dee435bbcd)
|
| |
|
|
|
|
| |
MFC after: 1 month
(cherry picked from commit 64dcfa2593d4729f16cb3e2d97088a2e69900df1)
|
| |
|
|
|
|
|
| |
PR: 282389
MFC after: 3 days
(cherry picked from commit bab5e3d468305928e9e5cf1ca9efcee4c89f6a76)
|
| |
|
|
|
|
|
|
|
|
| |
Reviewed by: emaste, Daniel Schaefer <dhs@frame.work>
MFC after: 3 days
Sponsored by: Framework Computer Inc
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46249
(cherry picked from commit d3b05d0ea10abe059dc63c6fb6ef3f061b758af2)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before every wait for FIFO interrupt set how much data/space do we
want to see there. Previous code was not using it for receive, as
result aggregating interrupts only within processing latency. The
new code needs only one interrupt per transfer per FIFO length.
On my Dell XPS 13 9310 with iichid(4) touchscreen and touchpad this
reduces the interrupt rate per device down to 2 per sample or 16-20
per second when idle and 120-160 per second when actively touched.
MFC after: 1 month
(cherry picked from commit 13037eaabede7fb7fbc25f4e84b549c73f9acb3c)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
At least on my Tiger Lake-LP queue depth detection failed before the
ig4iic_set_config() call, resulting in no FIFO use. Moving it after
solves the problem, getting proper 64 bytes size.
On my Dell XPS 13 9310 with iichid(4) touchscreen and touchpad this
by few times reduces context switch rate in the driver, and probably
also improves the I2C bus utilization.
MFC after: 1 month
(cherry picked from commit 9c9d7fdd9f0041783955c5f540ac55a900877c0c)
|
| |
|
|
|
| |
PR: 275115
Tested by: Sam <sam3423.yntmr_AT_slmail_DOT_me>
|
| |
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| |
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| |
|
|
|
|
|
|
|
|
|
| |
A one-bit wide bit-field can take only the values 0 and -1. Clang 16
introduced a warning that "implicit truncation from 'int' to a one-bit
wide bit-field changes value from 1 to -1". Fix by using c99 bool.
Reported by: Clang
Reviewed by: emaste, wulf
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39665
|
| |
|
|
|
| |
Tested by: Andrés Ramírez <rrandresf_AT_hotmail_DOT_com>
MFC after: 1 week
|
| | |
|
| | |
|
| |
|
|
| |
MFC after: 2 month
|
| |
|
|
|
| |
Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks
|
| |
|
|
|
| |
Submitted by: Dmitry Luhtionov
MFC after: 2 weeks
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per the i2c spec, a slave device can stretch SCL idefinitely, so 25ms is
a bit arbitrary in general. smbus does specify an optional timeout
recovery mechanism to be done at about 25~35ms, but the IPMI SSIF spec
says that BMCs don't have any obligation to implement that.
The BMC on Altra seems to mostly respond within 25ms, but occasionally
will stretch SCL for ~300 msec.
Also, the count_us mechanism seems to actually timeout around 25%
earlier than it would claim (timeout really happening around 19ms
instead of 25ms).
Sponsored by: Ampere Computing LLC
Submitted by: Klara Inc.
Reviewed by: manu, imp
Differential Revision: https://reviews.freebsd.org/D28747
|
| |
|
|
|
|
|
|
| |
Submitted by: Neel Chauhan <neel AT neelc DOT org>
Differential Revision: https://reviews.freebsd.org/D27483
Notes:
svn path=/head/; revision=368366
|
| |
|
|
|
|
|
| |
MFC after: 2 weeks
Notes:
svn path=/head/; revision=367230
|
| |
|
|
|
|
|
| |
MFC after: 1 week
Notes:
svn path=/head/; revision=360499
|
| |
|
|
|
|
|
|
|
| |
PR: 245654
Reported by: <xspbe3ho3p5uac@protonmail.com>
MFC after: 1 week
Notes:
svn path=/head/; revision=360355
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use DRIVER_MODULE_ORDERED(SI_ORDER_ANY) so that ig4's ACPI attachment
happens after iicbus and acpi_iicbus drivers are registered.
I have seen a problem where iicbus attached under ig4 instead of
acpi_iicbus when ig4.ko was loaded with kldload. I believe that that
happened because ig4 driver was a first driver to register, it attached
and created an iicbus child. Then iicbus driver was registered and,
since it was the only driver that could attach to the iicbus child
device, it did exactly that. After that acpi_iicbus driver was
registered. It would be able to attach to the iicbus device, but it was
already attached, so nothing happened.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=360241
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When iicbus is attached as child of Designware I2C controller it scans all
ACPI nodes for "I2C Serial Bus Connection Resource Descriptor" described
in section 19.6.57 of ACPI specs.
If such a descriptor is found, I2C child is added to iicbus, it's I2C
address, IRQ resource and ACPI handle are added to ivars. Existing
ACPI bus-hosted child is deleted afterwards.
The driver also installs so called "I2C address space handler" which is
disabled by default as nontested.
Set hw.iicbus.enable_acpi_space_handler loader tunable to 1 to enable it.
Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22901
Notes:
svn path=/head/; revision=358820
|
| |
|
|
|
|
|
|
|
|
|
| |
bus_get/set_resource methods are implemented in child device (iicbus).
As their implementation with bus_generic_rl_get/set calls do not
recurse up the tree, the versions in ig4 are never called.
Suggested by: jhb
Notes:
svn path=/head/; revision=355596
|
| |
|
|
| |
Notes:
svn path=/head/; revision=354327
|
| |
|
|
| |
Notes:
svn path=/head/; revision=354322
|
| |
|
|
|
|
|
| |
To be inline with intel-lpss Linux driver
Notes:
svn path=/head/; revision=354321
|
| |
|
|
|
|
|
|
|
|
| |
They are clocked at 216MHz rate, much higher than previous models.
PR: 240485
Submitted by: Neel Chauhan <neel@neelc.org>
Notes:
svn path=/head/; revision=354320
|
| |
|
|
|
|
|
| |
That allows ig4 children to allocate IRQs
Notes:
svn path=/head/; revision=354319
|
| |
|
|
|
|
|
| |
With leaving some data queued in the TX FIFO at the end of write cycle.
Notes:
svn path=/head/; revision=354318
|
| |
|
|
|
|
|
|
| |
It gives better error detection and ig4 driver's lock coverage
in a pipelined write case
Notes:
svn path=/head/; revision=354317
|
| |
|
|
|
|
|
|
| |
It is very helpful during debugging of I2C issues.
It is done only for SkyLakes due to lack of testing on other hardware.
Notes:
svn path=/head/; revision=354316
|
| |
|
|
|
|
|
|
|
| |
if controller has not it done for us yet.
Reset controller when transfer abort is failed.
Notes:
svn path=/head/; revision=354315
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Handle error bits of INTR_STAT and TX_ABORT registers.
Move interrupt clearing from interrupt handler to polling loop to get
common execution path with polled mode.
Do not clear interrupts with reading of IG4_REG_CLR_INTR register as
interrupts, triggered during the period from reg_read(IG4_REG_INTR_STAT)
to reg_read(IG4_REG_CLR_INTR) will be missed.
Instead, read each IG4_REG_CLR_* register separately.
Notes:
svn path=/head/; revision=354314
|
| |
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=354313
|
| |
|
|
| |
Notes:
svn path=/head/; revision=354312
|
| |
|
|
|
|
|
|
| |
in ig4iic_read routine. It makes possible interrupt utilization while
waiting for empty space in TX FIFO.
Notes:
svn path=/head/; revision=354311
|
| |
|
|
|
|
|
|
| |
rather than TX_NOTFULL. It makes possible interrupt utilization while
waiting for empty space in TX FIFO.
Notes:
svn path=/head/; revision=354310
|
| |
|
|
| |
Notes:
svn path=/head/; revision=354309
|
| |
|
|
|
|
|
|
|
|
| |
That is done with re-execution of controller initialization procedure
from resume handler.
PR: 238037
Notes:
svn path=/head/; revision=354308
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=354307
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=354306
|
| |
|
|
|
|
|
| |
They appeared to be supported (although undocumented) on SkyLakes+ too.
Notes:
svn path=/head/; revision=354305
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=354303
|
| |
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=354302
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=354301
|
| |
|
|
|
|
|
| |
It is required by controller specifications.
Notes:
svn path=/head/; revision=354300
|
| |
|
|
|
|
|
| |
Obtained from: DragonfliBSD (0b3eedb)
Notes:
svn path=/head/; revision=354299
|
| |
|
|
|
|
|
|
|
|
|
| |
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)
Notes:
svn path=/head/; revision=354298
|
| |
|
|
| |
Notes:
svn path=/head/; revision=354297
|