| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
(cherry picked from commit 68ac788f00aea4daf0e51b72be45eb528f01f825)
|
|
|
|
| |
(cherry picked from commit 1289d51ce9ec2baff2d29b8e2e2be58890bbc7b4)
|
|
|
|
|
|
| |
value.
(cherry picked from commit 441ccf4b193c06e1a98e71d3709550f180bd4abb)
|
|
|
|
|
|
| |
one shot programming mode.
(cherry picked from commit becbb91ba37bcef86d7d313c0e2befffc88953f2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
on i2c devices, where the "register" can be any length.
Many (perhaps most) common i2c devices are organized as a collection of
(usually 1-byte-wide) registers, and are accessed by first writing a 1-byte
register index/offset number, then by reading or writing the data.
Generally there is an auto-increment feature so the when multiple bytes
are read or written, multiple contiguous registers are accessed.
Most existing slave device drivers allocate an array of iic_msg structures,
fill in all the transfer info, and invoke iicbus_transfer(). These new
functions commonize all that and reduce register access to a simple call
with a few arguments.
(cherry picked from commit 7b74ced64a8e58ab40767d2715f2a598b040f40a)
|
|
|
|
|
|
| |
effects from PHP.
(cherry picked from commit 9fbcb1b9dac21d044f29fd2d90a8bf2292b9bc57)
|
|
|
|
| |
(cherry picked from commit 1c3557fa39adee20222b5acd4c3eba78606b7382)
|
|
|
|
| |
(cherry picked from commit 923a6ff4c0a60466abedecfbb945a3c290b9b1c3)
|
|
|
|
| |
(cherry picked from commit f213dad2443a52a8e53f0ec95ac5b927b496a4b0)
|
|
|
|
| |
(cherry picked from commit c3d78dab701406f5bc46cfc1267df5f24ed4ad7a)
|
|
|
|
| |
(cherry picked from commit 981956f70fd72dfecf42adf4377e2acace4cfdd2)
|
|
|
|
| |
(cherry picked from commit cb5fdc6a7263db6b05ee95456e847e413fed13e2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
being overwritten, they are set only bits (cleared by hardware).
Disable the Acknowledge of the controller slave address. The slave mode is
not supported.
Make sure the interrupt flag bit is being cleared as recommended, add a
delay() _after_ clear the interrupt bit.
Sponsored by: Rubicon Communications, LLC (Netgate)
(cherry picked from commit a514510c057d6d853efa9c9558112f91760688ad)
|
|
|
|
|
|
|
|
|
| |
Add the ofw_bus_get_node() callback in mv_twsi, it is mandatory for the
ofw_iicbus usage.
Sponsored by: Rubicon Communications, LLC (Netgate)
(cherry picked from commit 63d5603d622c5bb69f74644f066faa68709e87fb)
|
|
|
|
|
|
| |
sys: Replace zero with NULL for pointers.
Found with: devel/coccinelle
|
| |
|
| |
|
|
|
|
| |
in both read and write.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r304459:
INTRNG: Rework handling with resources. Partially revert r301453.
- Read interrupt properties at bus enumeration time and store
it into global mapping table.
- At bus_activate_resource() time, given mapping entry is resolved and
connected to real interrupt source. A copy of mapping entry is attached
to given resource.
- At bus_setup_intr() time, mapping entry stored in resource is used
for delivery of requested interrupt configuration.
- For MSI/MSIX interrupts, mapping entry is created within
pci_alloc_msi()/pci_alloc_msix() call.
- For legacy PCI interrupts, mapping entry must be created within
pcib_route_interrupt() by pcib driver itself.
r305527:
Fix MIPS INTRNG (both FDT and non-FDT) behaviour broken by r304459
|
|
|
|
|
|
|
|
|
|
|
| |
r302523:
Add clk_get_by_ofw_node_index, which is like clk_get_by_ofw_index but
operates on a specific OF node instead of the pass in device's OF node.
r302528:
EXTRES: Add OF node as argument to all <foo>_get_by_ofw_<bar>() functions.
In some cases, the driver must handle given properties located in specific
OF subnode. Instead of creating duplicate set of function, add 'node' as
argument to existing functions, defaulting it to device OF node.
|
|
|
|
|
|
|
|
| |
to the framework in OFW (FDT) case.
This is a follow-up to r301451.
Differential Revision: https://reviews.freebsd.org/D6634
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pressing the PEK (power enable key) will shutdown the board.
Some events are reported to devd via system "PMU" and subsystem
"Battery", "AC" and "USB" such as connected/disconnected.
Some sensors values (power source voltage/current) are reported via
sysctl (dev.axp209_pmu.X.)
It also expose a gpioc node usable in kernel and userland. Only 3 of
the 4 GPIO are exposed (The GPIO3 is different and mostly unused on
boards). Most popular boards uses GPIO1 as a sense pin for OTG power.
Add a dtsi file that adds gpio-controller capability to the device as
upstream doesn't defined it and include it in our custom DTS.
Reviewed by: jmcneill
Approved by: cognet (mentor)
Differential Revision: https://reviews.freebsd.org/D6135
|
|
|
|
|
|
| |
unrelated code.
Discussed with: nwhitehorn (a long time ago)
|
|
|
|
|
|
|
|
|
|
|
| |
After r285994, sysctl(8) was fixed to use 273.15 instead of 273.20 as 0C
reference and as result, the temperature read in sysctl(8) now exibits a
+0.1C difference.
This commit fix the kernel references to match the reference value used in
sysctl(8) after r285994.
Sponsored by: Rubicon Communications (Netgate)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
to prevent memory exhaustion and short allocations on 32-bit systems. Since iicrdwr is intended to be a workalike of a Linux i2c-dev call, use the same limit of 42 that Linux uses.
Also check the return value of copyin(9) to prevent unnecessary allocation in the failure case.
Submitted by: ngie
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D5155
|
|
|
|
| |
Reviewed by: jhibbits
|
| |
|
|
|
|
| |
Most affect comments, very few have user-visible effects.
|
|
|
|
|
|
| |
Reviewed by: andrew, gonzo, Emmanuel Vadot <manu@bidouilliste.com>
Approved by: gonzo (mentor)
Differential Revision: https://reviews.freebsd.org/D5752
|
|
|
|
|
|
|
|
| |
This is compatible with the ds1307, but comparing the mcp7941x datasheet vs the
ds1307 code, appears there is one bit placement difference, so that is now
accounted for.
Relnotes: yes
|
|
|
|
| |
Missed a bunch from r297000.
|
|
|
|
|
|
|
|
| |
Most calls to bus_alloc_resource() use "anywhere" as the range, with a given
count. Migrate these to use the new bus_alloc_resource_anywhere() API.
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D5370
|
|
|
|
|
|
|
|
|
| |
support for the i2c, mmc, and gmac clocks. Further clocks can be added as
needed.
Submitted by: Emmanuel Vadot <manu@bidouilliste.com>
Reviewed by: jmcneill
Differential Revision: https://reviews.freebsd.org/D5339
|
|
|
|
|
|
| |
endian of the CPU so there is no need to call fdt32_to_cpu.
Sponsored by: ABT Systems Ltd
|
|
|
|
|
|
|
|
|
|
| |
Marvell twsi part, however uses different register locations, as such split
the existing driver into Marvell and Allwinner attachments.
While here clean a few style issues.
Submitted by: Emmanuel Vadot <manu@bidouilliste.com>
Differential Revision: https://reviews.freebsd.org/D4846
|
|
|
|
|
|
|
| |
directory as it is expected multiple attachments will be added for the SoC
families that use this hardware.
Sponsored by: ABT Systems Ltd
|
|
|
|
|
|
|
|
|
|
|
| |
negative array indexing in iicrdwr(..)
Differential Revision: https://reviews.freebsd.org/D5132
Obtained from: HardenedBSD
PR: 206754
Reported by: CTurt <cturt@hardenedbsd.org>
Submitted by: Madhi Moktari <mokhi64@gmail.com>
Sponsored by: EMC / Isilon Storage Division
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The FDT bindings for eeprom parts don't include any metadata about the
device other than the part name encoded in the compatible property.
Instead, a driver is required to have a compiled-in table of information
about the various parts (page size, device capacity, addressing scheme). So
much for FDT being an abstract description of hardware characteristics, huh?
In addition to the FDT-specific changes, this also switches to using the
newer iicbus_transfer_excl() mechanism which holds bus ownership for the
duration of the transfer. Previously this code held the bus across all
the transfers needed to complete the user's IO request, which could be
up to 128KB of data which might occupy the bus for 10-20 seconds. Now the
bus will be released and re-aquired between every page-sized (8-256 byte)
transfer, making this driver a much nicer citizen on the i2c bus.
The hint-based configuration mechanism is still in place for non-FDT systems.
Michal Meloun contributed some of the code for these changes.
|
|
|
|
|
|
| |
while holding exclusive ownership of the bus. This is the routine most
slave drivers should use unless they have a need to acquire and hold the
bus across a series of related operations that involves multiple transfers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the bus is detached and deleted by a call to device_delete_child() or
device_delete_children() on a device higher in the tree, I²C children
were already detached and deleted. So the device_t pointer stored in sc
points to freed memory: we must not try to delete it again.
By using device_delete_children(), we let subr_bus.c figure out if there
are children to take care of.
While here, make sure iicbus_detach() and iicoc_detach() call
device_delete_children() too, to be safe.
Reviewed by: jhb, imp
Approved by: jhb, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3926
|
|
|
|
| |
MFC after: 1 week
|
|
|
|
|
| |
an eeprom device with iicbus_request/release_bus(), which achieves the
same effect and also keeps other i2c slave drivers from clashing on the bus.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
these functions are thin wrappers around calling the hardware-layer driver,
but some of them do sanity checks and return an error. Since the hardware
layer can only return IIC_Exxxxx status values, the iicbus helper functions
must also adhere to that, so that drivers at higher layers can assume that
any non-zero status value is an IIC_Exxxx value that provides details about
what happened at the hardware layer (sometimes those details are important
for certain slave drivers).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
errno values that are at least vaguely equivelent. Also add a new status
value, IIC_ERESOURCE, to indicate a failure to acquire memory or other
required resources to complete a transaction.
The IIC_Exxxxxx values are supposed to communicate low-level details of the
i2c transaction status between the lowest-layer hardware driver and
higher-layer bus protocol and device drivers for slave devices on the bus.
Most of those slave drivers just return all status values from the lower
layers directly to their callers, resulting in crazy error reporting from a
user's point of view (things like timeouts being reported as "no such
process"). Now there's a helper function to make it easier to start
cleaning up all those drivers.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make it clearer what each one means in the comments that define them.
IIC_BUSBSY was used in many places to mean two different things, either
"someone else has reserved the bus so you have to wait until they're done"
or "the signal level on the bus was not in the state I expected before/after
issuing some command".
Now IIC_BUSERR is used consistantly to refer to protocol/signaling errors,
and IIC_BUSBSY refers to ownership/reservation of the bus.
|