Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/pl181.c
RevisionDateAuthorComments
 1.9  07-Aug-2021  thorpej Merge thorpej-cfargs2.
 1.8  24-Apr-2021  thorpej branches: 1.8.8;
Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
actually needed.
- Don't be explicit about what interface attribute is attaching if
the device only has one. (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
situations, making is visibly easier to see when indirect config is
in play, and allowing for future change in semantics. (As of now,
this is just a wrapper around config_match(), but that is an
implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance. This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
 1.7  12-Jun-2019  skrll branches: 1.7.12;
Trailing whitespace
 1.6  03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.5  19-Feb-2018  jmcneill branches: 1.5.2; 1.5.4;
Rewrite data transfer path to take advantage of the PL181's 64-byte FIFO.

Before: 134217728 bytes transferred in 43.683 secs (3072539 bytes/sec)
After: 134217728 bytes transferred in 23.789 secs (5642007 bytes/sec)
 1.4  04-Jun-2017  jmcneill branches: 1.4.4;
Re-introduce support for multi-block transfers and split transfers to fit
within the 65535-byte limit.
 1.3  02-Jun-2017  jmcneill branches: 1.3.2;
Separate clock frequency from maximum supported bus frequency.
 1.2  01-Jun-2017  jmcneill The sdmmc layer will send single requests up to MAXPHYS (65536) in size.
The length field on PL180/PL181 is 16-bit, and can only support up to
65535 byte transfers.

Workaround this for now by setting the SMC_CAPS_SINGLE_ONLY flag to only
do single block (512-byte) transfers. While here set SMC_CAPS_4BIT_MODE
as well.
 1.1  27-Jan-2015  jmcneill branches: 1.1.2;
Add driver for ARM PrimeCell MultiMedia Card Interface (PL181). Not tested
with real hardware, only qemu "integratorcp" configuration.
 1.1.2.3  28-Aug-2017  skrll Sync with HEAD
 1.1.2.2  06-Apr-2015  skrll Sync with HEAD
 1.1.2.1  27-Jan-2015  skrll file pl181.c was added on branch nick-nhusb on 2015-04-06 15:18:09 +0000
 1.3.2.1  04-Jun-2017  bouyer Pull up following revision(s) (requested by jmcneill in ticket #3):
sys/dev/sdmmc/sdmmcvar.h: revision 1.24
sys/dev/sdmmc/sdmmc_mem.c: revision 1.57
sys/dev/ic/pl181.c: revision 1.4
Give a hint to controllers in the command flags if we are performing a
transfer with an SDHC capable card. If the controller needs to adjust
command args, it can use this hint to understand how it is encoded.
Re-introduce support for multi-block transfers and split transfers to fit
within the 65535-byte limit.
 1.4.4.2  03-Dec-2017  jdolecek update from HEAD
 1.4.4.1  04-Jun-2017  jdolecek file pl181.c was added on branch tls-maxphys on 2017-12-03 11:37:04 +0000
 1.5.4.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.5.4.1  10-Jun-2019  christos Sync with HEAD
 1.5.2.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.7.12.1  21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.8.8.1  04-Aug-2021  thorpej Adapt to CFARGS().

RSS XML Feed