| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Reviewed by: imp, jhb
Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D50913
|
| |
|
|
| |
Differential Revision: https://reviews.freebsd.org/D47971
|
| |
|
|
|
|
|
| |
While here, check for errors from bus_generic_detach and move it to
the start of detach if necessary.
Differential Revision: https://reviews.freebsd.org/D47969
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This provides better semantics as a standalone DEVMETHOD for
device_attach as bus drivers should remove child devices they created
as part of detach cleanup. The implementation calls
bus_detach_children() first to permit child devices an opportunity to
veto the detach operation. If that succeeds, device_delete_children()
is used to delete the child devices.
This requires fixing various drivers that were deleting devices
explicitly (via a device_t pointer cached in the softc) after calling
bus_generic_detach to stop doing that and just rely on
bus_generic_detach to remove child devices.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47959
|
| |
|
|
|
| |
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47675
|
| |
|
|
|
| |
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47674
|
| |
|
|
|
| |
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47373
|
| |
|
|
| |
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
|
|
|
| |
We've removed kernel option EXT_RESOURCES almost two years ago.
While it was ok to have some code under a common 'extres' subdirectory
at first, we now have a lot of consumer of it and we made it mandatory
so no need to have it under a cryptic name.
Reviewed by: imp
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43192
|
| |
|
|
|
|
|
|
|
|
|
| |
We've removed kernel option EXT_RESOURCES almost two years ago.
While it was ok to have some code under a common 'extres' subdirectory
at first, we now have a lot of consumer of it and we made it mandatory
so no need to have it under a cryptic name.
Reviewed by: mhorne
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43191
|
| |
|
|
|
|
|
|
| |
No need to keep it under sys/arm/allwinner
It's easier to find which controller we support by looking under one directory.
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43185
|
| |
|
|
|
|
|
| |
No need to keep it under sys/arm64/rockchip
It's easier to find which controller we support by looking under one directory.
Sponsored by: Beckhoff Automation GmbH & Co. KG
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
|
|
|
| |
With ade70a1ad(svn r332196) ofw_spibus probes at the BUS_PROBE_DEFAULT
instead of 0. However, this races with spibus, resulting in ofw_spibus
often times losing the race and the OFW node not being referenced. This
in turn causes child device tree nodes to not be attached. Solve this
by returning 1 higher than spibus, just like acpi_spibus.
Sponsored by: Juniper Networks, Inc.
MFC after: 1 week
|
| |
|
|
| |
Matching table format is compatible with ACPI_ID_PROBE bus method.
|
| |
|
|
| |
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
|
| |
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| |
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| |
|
|
|
|
|
| |
intmax_t requires %j format specifier, %z is for size_t.
Fixes: 7d380b986a1808164846cfd9afb5ae3f99921fcf
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
When spibus is attached as child of Intel SPI controller it scans all
ACPI nodes for "SPI Serial Bus Connection Resource Descriptor" described
in section 19.6.126 of ACPI specs.
If such a descriptor is found, SPI child is added to spibus, it's SPI
chip select, mode, clock, IRQ resource and ACPI handle are added to ivars.
Existing ACPI bus-hosted child is deleted afterwards.
Apple ACPI SPI extensions are supported.
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41248
|
| |
|
|
|
|
|
|
|
|
|
| |
IRQ Resource is allocated on spibus(4). We must release it here too
rather than propagate request down the tree.
Fixes: 4dd8db62e9d3 ("Add IRQ resource to SPIBUS")
MFC after: 1 week
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41243
|
| |
|
|
|
|
|
|
| |
device_delete_children() detaches all children too.
MFC after: 1 month
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41240
|
| |
|
|
|
|
|
|
|
| |
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These feature are required for an upcoming Apple MacBook topcase
(HID over SPI) driver:
A delay after toggling CS is required to avoid anomalies like an extra
junk byte in front of the message. Keeping CS asserted is required to
be able to read a status report after writing a command. (The device
won't return the status if CS was deasserted.)
Sleep is not allowed in the interrupt context where the Apple input
driver runs its transactions. Use a flag to tell the SPI driver to
avoid mtx_sleep.
Reviewed by: manu (ok to SPI part of larger patch)
MFC afret: 1 month
Differential revision: https://reviews.freebsd.org/D29534
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bus_child_{pnpinfo,location} with sbuf
Now that the upper layers all go through a layer to tie into these
information functions that translates an sbuf into char * and len. The
current interface suffers issues of what to do in cases of truncation,
etc. Instead, migrate all these functions to using struct sbuf and these
issues go away. The caller is also in charge of any memory allocation
and/or expansion that's needed during this process.
Create a bus_generic_child_{pnpinfo,location} and make it default. It
just returns success. This is for those busses that have no information
for these items. Migrate the now-empty routines to using this as
appropriate.
Document these new interfaces with man pages, and oversight from before.
Reviewed by: jhb, bcr
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D29937
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add capability to SPIBUS to have child device with IRQ.
For example many ADC chip have a dedicated pin to signal "data ready"
and the host can just wait for a interrupt to go out and read the result.
It is the same code as in R282674 and R282702 for IICBUS by Michal Meloun
Submitted by: Oskar Holmund <oskar.holmlund@ohdata.se>
Differential Revision: https://reviews.freebsd.org/D27396
Notes:
svn path=/head/; revision=368725
|
| |
|
|
| |
Notes:
svn path=/head/; revision=365151
|
| |
|
|
|
|
|
|
|
|
| |
directly. This improves API compliance, asserts, etc.
Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D23283
Notes:
svn path=/head/; revision=357017
|
| |
|
|
|
|
|
|
|
|
|
|
| |
o Remove All Rights Reserved from my notices
o imp@FreeBSD.org everywhere
o regularize punctiation, eliminate date ranges
o Make sure that it's clear that I don't claim All Rights reserved by listing
All Rights Reserved on same line as other copyright holders (but not
me). Other such holders are also listed last where it's clear.
Notes:
svn path=/head/; revision=355394
|
| |
|
|
|
|
|
|
| |
Also rename SPIBUS_PNP_INFO -> SPIBUS_FDT_PNP_INFO because there could be
other kinds of pnpinfo for other (non-fdt) bus attachments.
Notes:
svn path=/head/; revision=348172
|
| |
|
|
|
|
|
|
| |
Some devices (such as spigen(4)) document that this works, but it appears that the
code to implement it never got added.
Notes:
svn path=/head/; revision=344556
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove unused and easy to misuse PNP macro parameter
Inspired by r338025, just remove the element size parameter to the
MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to
have correct pointer (or array) type. Since all invocations of the macro
already had this property and the emitted PNP data continues to include the
element size, there is no functional change.
Mostly done with the coccinelle 'spatch' tool:
$ cat modpnpsize0.cocci
@normaltables@
identifier b,c;
expression a,d,e;
declarer MODULE_PNP_INFO;
@@
MODULE_PNP_INFO(a,b,c,d,
-sizeof(d[0]),
e);
@singletons@
identifier b,c,d;
expression a;
declarer MODULE_PNP_INFO;
@@
MODULE_PNP_INFO(a,b,c,&d,
-sizeof(d),
1);
$ rg -l MODULE_PNP_INFO -- sys | \
xargs spatch --in-place --sp-file modpnpsize0.cocci
(Note that coccinelle invokes diff(1) via a PATH search and expects diff to
tolerate the -B flag, which BSD diff does not. So I had to link gdiff into
PATH as diff to use spatch.)
Tinderbox'd (-DMAKE_JUST_KERNELS).
Approved by: re (glen)
Notes:
svn path=/head/; revision=338948
|
| |
|
|
|
|
|
|
|
|
| |
I was not aware Warner was making or planning to make forward progress in
this area and have since been informed of that.
It's easy to apply/reapply when churn dies down.
Notes:
svn path=/head/; revision=338037
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Inspired by r338025, just remove the element size parameter to the
MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to
have correct pointer (or array) type. Since all invocations of the macro
already had this property and the emitted PNP data continues to include the
element size, there is no functional change.
Mostly done with the coccinelle 'spatch' tool:
$ cat modpnpsize0.cocci
@normaltables@
identifier b,c;
expression a,d,e;
declarer MODULE_PNP_INFO;
@@
MODULE_PNP_INFO(a,b,c,d,
-sizeof(d[0]),
e);
@singletons@
identifier b,c,d;
expression a;
declarer MODULE_PNP_INFO;
@@
MODULE_PNP_INFO(a,b,c,&d,
-sizeof(d),
1);
$ rg -l MODULE_PNP_INFO -- sys | \
xargs spatch --in-place --sp-file modpnpsize0.cocci
(Note that coccinelle invokes diff(1) via a PATH search and expects diff to
tolerate the -B flag, which BSD diff does not. So I had to link gdiff into
PATH as diff to use spatch.)
Tinderbox'd (-DMAKE_JUST_KERNELS).
Notes:
svn path=/head/; revision=338035
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Resources used by spigen_mmap_single() are now tracked using
devfs_set_cdevpriv() rather than in the softc.
- Since resources are now tracked per-open-fd, there is no need to try to
impose any exclusive-open logic, so flags related to that are removed.
- Flags used to track open status to prevent detach() when the device is
open are replaced with calls to device_busy()/device_unbusy(). That
extends the protection up the hierarchy so that the spibus and hardware
controller drivers also can't be detached while the device is open/in use.
- Arbitrary limits on the maximum size of a transfer are removed, along with
the sysctl variables that allowed the limits to be changed. There is just
no reason to limit the size of a spi transfer to the machine's page size.
Or to any other arbitrary value, really.
- Most of the locking is removed. It was mostly protecting access to flags
and fields in the softc that no longer exist. The locking that remains is
just to prevent concurrent calls to device_[un]busy().
- The code was calling malloc() with M_WAITOK while holding a mutex in
several places. Since most of the locking is gone, that's fixed.
Notes:
svn path=/head/; revision=336202
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
than assigning spigen device names in order of creation, this uses a device
name that corresponds to the owning spibus and chip-select index.
Example: /dev/spigen0.1 would be a child of spibus0, and use cs = 1
The intent is for systems like Raspberry Pi to have a consistent way of
using an SPI interface with a specific cs value from a user application.
Otherwise, there is no consistent way of knowing which cs pin will be
assigned to a particular spigen device. The alternative is to specify
everything in "the right order" in an overlay file, which is less than
ideal. Additionally, this duplicates (to some extent) the way Linux handles
a similar situation with their 'spidev' device, so it would be somewhat
familiar to those who also use Linux.
A new kernel config option, SPIGEN_LEGACY_CDEVNAME, causes the driver to
also create /dev/spigenN device name aliases, with N incrementing in the
order of device instantiation. This is provided to ease the transition
for existing systems using the original naming convention (particularly
when these changes are MFC'd to stable branches).
Differential Revision: https://reviews.freebsd.org/D15301
Notes:
svn path=/head/; revision=335506
|
| |
|
|
|
|
|
|
| |
The PNP info string is the same as the SIMPLEBUS one but driver should
depend on spibus and not simplebus
Notes:
svn path=/head/; revision=335158
|
| |
|
|
|
|
|
|
| |
when the FDT data doesn't enable the device instance, return
BUS_PROBE_NOWILDCARD, the same as for non-FDT systems.
Notes:
svn path=/head/; revision=332292
|
| |
|
|
|
|
|
|
|
|
|
| |
opposed to one that accidentally worked on the one arch I test-compiled for
on my first try).
Reported by: np@, O. Hartmann <ohartmann@walstatt.org>
Pointy hat: ian@
Notes:
svn path=/head/; revision=332259
|
| |
|
|
| |
Notes:
svn path=/head/; revision=332258
|
| |
|
|
|
|
|
|
|
| |
frequency ioctl actually set the corresponding ivar instead of just storing
the value locally in the softc (and then not using it for anything). Also,
return the correct error code if the ioctl cmd is not recognized.
Notes:
svn path=/head/; revision=332233
|
| |
|
|
|
|
|
| |
now that they can be set.
Notes:
svn path=/head/; revision=332231
|
| |
|
|
|
|
|
|
|
|
| |
FDT-based systems, and instead add proper FDT probe code. Because this
driver is freebsd-specific and just provides generic userland access to run
spibus transactions, there is no bindings document to mandate a compatible
string, so just arbitrarily use "freebsd,spigen".
Notes:
svn path=/head/; revision=332219
|
| |
|
|
|
|
|
|
|
|
| |
implementation that must be used, it's just the base system default driver.
Also add a comment noting that we're being more liberal about the bus
frequency property than the dts binding documents require.
Notes:
svn path=/head/; revision=332196
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- Change the description string to "SPI bus" (was "spibus bus").
- This is the default driver for a SPI bus, not a generic implementation,
so return the probe value that indicates such.
- Use device_delete_children() at detach time, instead of a local loop
to enumerate the children and detach each one individually.
Notes:
svn path=/head/; revision=332195
|
| |
|
|
|
|
|
|
|
|
| |
and phase) and the maximum bus speed can be changed. The chip select
number cannot be changed, because the device instances which are children
of spibus are inherently associated with the chip select number they were
instantiated for.
Notes:
svn path=/head/; revision=332194
|
| |
|
|
| |
Notes:
svn path=/head/; revision=332046
|
| |
|
|
|
|
|
| |
so other drivers can refer to them in DRIVER_MODULE() decls.
Notes:
svn path=/head/; revision=329539
|