<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/spibus, branch releng/12.4</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.4</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F12.4'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2019-06-23T16:16:55Z</updated>
<entry>
<title>MFC r348169-r348170, r348172-r348173, r348183-r348184</title>
<updated>2019-06-23T16:16:55Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2019-06-23T16:16:55Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=682a3ddec43f2229a396e54a4edb11867379ae84'/>
<id>urn:sha1:682a3ddec43f2229a396e54a4edb11867379ae84</id>
<content type='text'>
r348169:
Define macros making it easier to define bus-specific pnpinfo for FDT systems.

Pnpinfo is bus-specific and requires the bus name. The FDTCOMPAT_PNP_INFO()
macro makes it easier to define new FDT-based pnpinfo for busses other than
simplebus.

Differential Revision:	https://reviews.freebsd.org/D20382

r348170:
Add pnpinfo for icee(4) on fdt systems.

r348172:
Use the new FDTCOMPAT_PNP_INFO() macro to define SPIBUS_FDT_PNP_INFO().
Also rename SPIBUS_PNP_INFO -&gt; SPIBUS_FDT_PNP_INFO because there could be
other kinds of pnpinfo for other (non-fdt) bus attachments.

r348173:
Rename IICBUS_FDT_PNPINFO -&gt; IICBUS_FDT_PNP_INFO because all the other
existing pnpinfo-related macros right now use PNP_INFO, not PNPINFO.

r348183:
Add pnpinfo.

r348184:
Add pnpinfo to all i2c drivers that have FDT compat data.
</content>
</entry>
<entry>
<title>MFC r344556:</title>
<updated>2019-04-22T00:49:13Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2019-04-22T00:49:13Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=dcbeb83fe78598e610242528eb3223e4a71066af'/>
<id>urn:sha1:dcbeb83fe78598e610242528eb3223e4a71066af</id>
<content type='text'>
Set maximum bus clock speed from hints when attaching hinted spibus(4) children.

Some devices (such as spigen(4)) document that this works, but it appears
that the code to implement it never got added.
</content>
</entry>
<entry>
<title>Reapply, with minor tweaks, r338025, from the original commit:</title>
<updated>2018-09-26T17:12:14Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2018-09-26T17:12:14Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=329e817fcc97aa847765c5171cc89a81a0b25527'/>
<id>urn:sha1:329e817fcc97aa847765c5171cc89a81a0b25527</id>
<content type='text'>
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,&amp;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)
</content>
</entry>
<entry>
<title>Back out r338035 until Warner is finished churning GSoC PNP patches</title>
<updated>2018-08-19T00:46:22Z</updated>
<author>
<name>Conrad Meyer</name>
<email>cem@FreeBSD.org</email>
</author>
<published>2018-08-19T00:46:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b8e771e97a39a88bbf6ebf8f31dcc820c91fe355'/>
<id>urn:sha1:b8e771e97a39a88bbf6ebf8f31dcc820c91fe355</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Remove unused and easy to misuse PNP macro parameter</title>
<updated>2018-08-19T00:22:21Z</updated>
<author>
<name>Conrad Meyer</name>
<email>cem@FreeBSD.org</email>
</author>
<published>2018-08-19T00:22:21Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=faa319436f0d548cff97c2c8c763538997b63f34'/>
<id>urn:sha1:faa319436f0d548cff97c2c8c763538997b63f34</id>
<content type='text'>
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,&amp;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).
</content>
</entry>
<entry>
<title>Enhancements and fixes for the spigen(4) driver...</title>
<updated>2018-07-11T17:54:41Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2018-07-11T17:54:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7a4f19151ab2cf3588d77a02933160316d2fa41a'/>
<id>urn:sha1:7a4f19151ab2cf3588d77a02933160316d2fa41a</id>
<content type='text'>
- 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.
</content>
</entry>
<entry>
<title>Incorporate bus and chip select numbers into spigen(4) cdev names.  Rather</title>
<updated>2018-06-21T21:16:26Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2018-06-21T21:16:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1fcf4de055a112bca942e47dba2c33170cc63b9e'/>
<id>urn:sha1:1fcf4de055a112bca942e47dba2c33170cc63b9e</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>spi: Add SPIBUS_PNP_INFO macro</title>
<updated>2018-06-14T17:20:47Z</updated>
<author>
<name>Emmanuel Vadot</name>
<email>manu@FreeBSD.org</email>
</author>
<published>2018-06-14T17:20:47Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=64b507e5fe1d27bdbad831ba9249e68fdffc759a'/>
<id>urn:sha1:64b507e5fe1d27bdbad831ba9249e68fdffc759a</id>
<content type='text'>
The PNP info string is the same as the SIMPLEBUS one but driver should
depend on spibus and not simplebus
</content>
</entry>
<entry>
<title>Allow hinted attachment on FDT-based systems.  Instead of returning ENXIO</title>
<updated>2018-04-08T17:06:30Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2018-04-08T17:06:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=bc7b44aeaf05364c44d32e72c1223330352d897a'/>
<id>urn:sha1:bc7b44aeaf05364c44d32e72c1223330352d897a</id>
<content type='text'>
when the FDT data doesn't enable the device instance, return
BUS_PROBE_NOWILDCARD, the same as for non-FDT systems.
</content>
</entry>
<entry>
<title>Cast the data pointer to the correct type for the data being accessed (as</title>
<updated>2018-04-07T22:21:06Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2018-04-07T22:21:06Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=197d784bf3167062ddaa273cf24aeea745fbaed6'/>
<id>urn:sha1:197d784bf3167062ddaa273cf24aeea745fbaed6</id>
<content type='text'>
opposed to one that accidentally worked on the one arch I test-compiled for
on my first try).

Reported by:	np@, O. Hartmann &lt;ohartmann@walstatt.org&gt;
Pointy hat:	ian@
</content>
</entry>
</feed>
