| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
The slot parameter actually is used as index into the memory resource.
Fixes: c11bbc7d
|
| |
|
|
|
|
|
|
|
|
| |
If the kernel panics while a thread is in the middle of an SDHCI
transaction, trying to dump to a dump target on the MMC would result in
a hang. Fix this by completing the transaction first.
Reviewed by: imp
Obtained from: Hewlett Packard Enterprise
Differential Revision: https://reviews.freebsd.org/D54255
|
| |
|
|
|
| |
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D53407
|
| |
|
|
|
|
|
|
| |
This patch add support for cvitek SDHCI controller (only SD card mode).
This controller is present on Milk-V's riscv SoCs.
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D48528
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Switch to using sys/stdarg.h for va_list type and va_* builtins.
Make an attempt to insert the include in a sensible place. Where
style(9) was followed this is easy, where it was ignored, aim for the
first block of sys/*.h headers and don't get too fussy or try to fix
other style bugs.
Reviewed by: imp
Exp-run by: antoine (PR 286274)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
|
| |
|
|
|
|
|
|
| |
Drop SDHCI_LOCK and instead acquire bus_topo_lock when adding and
removing new-bus devices.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D49271
|
| |
|
|
|
|
|
|
|
|
|
| |
This change fixes a couple of issues in the Rockchip SDHCI driver:
- Fix a panic caused by sdhci_fdt_rockchip_attach not populating the
softc's dev variable before initializing clocks
- Fix a bug where sdhci_fdt_rockchip_set_clock fails to call
sdhci_fdt_set_clock
Fixes: e17e33f997d6
Reported by: Alonso Cárdenas Márquez (acardenas@bsd-peru.org)
|
| |
|
|
|
|
|
|
|
|
| |
This patch refactors the 'sdhci_fdt.c' driver by moving all vendor
specific routines into separate files and making the base 'sdhci_fdt'
driver subclassable. The goal is to make adding new FDT-based drivers
easier and more maintainable. No functional change intended.
Reviewed by: manu, imp
Differential Revision: https://reviews.freebsd.org/D48527
|
| |
|
|
|
|
|
| |
These drivers perform additional teardown steps in between detaching
child devices and deleting child devices.
Differential Revision: https://reviews.freebsd.org/D47957
|
| |
|
|
|
|
|
|
|
|
|
| |
Add the missing bus_add_child DEVMETHOD. This is needed for the RPi5
running with a MMCCAM kernel and the worproject/rpi5-uefi to avoid a
kernel panic on boot when SDIO tries to attach to a 'Intel Bay Trail'
controller.
Reviewed by: imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D48152
|
| |
|
|
|
| |
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47675
|
| |
|
|
|
| |
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47674
|
| |
|
|
|
|
|
|
|
| |
Summary:
It can be useful to see what quirks are applied on an SDHCI slot.
Obtained from: Juniper Networks, Inc.
Reviewed By: manu
Differential Revision: https://reviews.freebsd.org/D46790
|
| |
|
|
|
|
|
|
|
| |
These quirk fields are u_int, so match the sysctl type to the actual
types, and use SYSCTL_UINT. This provides room for setting bit 31 quirk
as needed.
Sponsored by: Juniper Networks, Inc.
MFC after: 1 week
|
| |
|
|
|
| |
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45852
|
| |
|
|
| |
Sponsored by: Netflix
|
| |
|
|
|
|
|
| |
SDHCI_QUIRK_MISSING_CAPS needs to be set unconditionally so sdhci(4)
adheres to the slot caps and caps2 set by sdhci_fsl_fdt(4). However,
so far this bug didn't have an impact as the front-end only filters
SDHCI_CAN_DO_SUSPEND, which in turn isn't used, yet.
|
| |
|
|
|
|
|
|
|
|
|
| |
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/D43196
|
| |
|
|
|
|
|
|
|
|
|
| |
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: emaste, imp
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43195
|
| |
|
|
|
|
|
|
|
|
|
| |
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: emaste, imp
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43194
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The binding says that we can have one or two clocks to export.
The first one is the actual sdclock while the second is the sample clock.
Both have the same parent, clk_xin.
Correctly export the clocks for RK3399 and ZynqMP.
No need to use a high ID as before, we have our own clock domain so use
ids starting at 1 as all exported clocks should be.
Reviewed-by: bz
Differential Revision: https://reviews.freebsd.org/D41810
Sponsored by: Beckhoff Automation GmbH & Co. KG
|
| |
|
|
|
|
|
|
|
| |
Per the bindings the phy and the syscon can always be present not just
for RK3399.
Reviewed-by: bz
Differiential Revision: https://reviews.freebsd.org/D41809
Sponsored by: Beckhoff Automation GmbH & Co. KG
|
| |
|
|
|
|
|
|
|
| |
Those two (in fact all of the supported one in this driver except RK3568) always
needs the clocks to be enabled.
Reviewed-by: bz
Differential Revision: https://reviews.freebsd.org/D41808
Sponsored by: Beckhoff Automation GmbH & Co. KG
|
| |
|
|
|
|
|
|
| |
This was used when we had our own DTS, it's not used anymore.
Reviewed-by: bz
Differential Revision: https://reviews.freebsd.org/D41807
Sponsored by: Beckhoff Automation GmbH & Co. KG
|
| |
|
|
| |
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
|
| |
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| |
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| |
|
|
|
|
|
| |
Some platform needs it when the WP pin is broken.
Sponsored by: Beckhoff Automation GmbH & Co. KG
MFC after: 2 weeks
|
| |
|
|
|
| |
Sponsored by: Beckhoff Automation GmbH & Co. KG
MFC after: 2 weeks
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The original idea behind calling into the bridge driver was to have the
logic deciding whether tuning is actually required for a particular bus
timing in a given slot as well as doing the sanity checking only on the
controller layer which also generally is better suited for these due to
say SDHCI_SDR50_NEEDS_TUNING. On another thought, not every such driver
should need to check whether tuning is required at all, though, and not
everything is SDHCI in the first place.
Adjust sdhci{,_fsl_fdt}(4) accordingly, but keep sdhci_generic_tune() a
bit cautious still.
|
| | |
|
| |
|
|
|
|
|
| |
Include sys/malloc.h directly in sdhci_xenon.c to get the malloc(9)
definition rather than depend on header pollution.
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
| |
- s/overriden/overridden/
MFC after: 3 days
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to support various types of data stored in device
tree properties or ACPI _DSD packages, create a new enum so
the caller can specify the expected type of a property they
want to read, according to the binding. The bus logic will use
that information to process the underlying data.
For example in DT all integer properties are stored in BE format.
In order to get constant results across different platforms we
need to convert its endianness to match the host.
Another example are ACPI_TYPE_INTEGER properties stored
as uint64_t. Before this patch the ACPI logic would refuse
to read them if the provided buffer was smaller than 8 bytes.
Now this can be handled by using DEVICE_PROP_UINT32 type.
Modify the existing consumers of this API to reflect the changes
and update the man pages accordingly.
Reviewed by: mw
Obtained from: Semihalf
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D33457
|
| |
|
|
|
|
|
|
|
|
|
| |
This reverts commit 7d8700bc291b4b3be1a592cae539f9e682592d9d.
Reason for revert: the patch is incomplete. 64-bit operation
is supported fully in SDHCI v4.0, v3.0 does it only for ADMA mode.
This differentiation is missing and should be taken into consideration
in case the reverted code is re-introduced.
Reported by: mmel
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Some SoCs does not have a fixed regulator to handle voltage
switching automatically. Add support for voltage switching
through syscon register when necessary. Add new errata flag
indicating missing regulator. Apply errata to SoCs, which are
known to be affected, i.e. LS1046 and LS1012.
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D34029
|
| |
|
|
|
|
|
|
|
|
|
|
| |
LX2160A is affected by two erratum regarding SDHCI. However this board
has generic compat string in DTS for SDHCI which means erratum cannot
be simply applied. Compare compat string from "/" path with LX2160A
compat string when attaching device and apply erratum.
Reviewed by: mmel, imp
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D34028
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Some of the register writes were already done in the generic tuning code.
Remove them.
- Increase the polling timeout. The previous value is probably fine, but since
timeouts are treated as fatal errors increasing it to 200ms won't hurt.
- Rework the HS400 switching code. Make sure that the switch happens at the
right time. Reset the DLL0 block. We need to do that if u-boot has previously
configured the controller in HS400 mode.
- Check current timing before tuning. The tuning devmethod is always called,
even for timings that don't require the tuning procedure.
- Rework software tuning routine code. Use inner formula for clock
divider calculation, as previous one was incorrect.
- Implement custom re-tune procedure.
Co-authored-by: Hubert Mazur <hum@semihalf.com>
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D34027
|
| |
|
|
|
|
|
|
|
|
| |
The errata has to be applied every time after SDHCI_RESET_ALL is done.
Move it from attach to the custom reset routine.
Reviewed by: wma, mmel
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D33981
|
| |
|
|
|
|
|
|
| |
EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D33824
|
| |
|
|
|
|
| |
This change fixes interaction with recently added sddadump.
MFC after: 1 week
|
| |
|
|
| |
Sponsored by: Rubicon Communications, LLC ("Netgate")
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The controller requires some custom logic to perform MMC tuning
and to later switch to HS400 mode. Implement it supplying mmcbr_tune
and sdhci_set_uhs_timing devmethods respectivly. Since the latter
is called unconditionally when the ios is updated we need to keep
track of the tuning state in sc and execute the HS400 switch logic
only when required.
Two HS200/HS400 related errata were implemented.
1. In HS400 modes the clock divisors are limited to 4, 8, 12.
Apply it by falling back to the closes, higher divider when needed.
2. Hardware tuning procedure can sometimes fails. If that is the case
fallback to the software tuning.
Reviewed by: manu, mw
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D33320
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As `vqmmc-supply` is an optional Device Tree property, don't skip vccq
reconfiguration when the regulator is not specified. Instead, accept
voltage specified by the `voltage-ranges` property.
The actual voltage switch is done through a hw register in LS1028A.
Add errata flag for other boards, as they are not supported. Return
not supported error code when switching to 1.8V on affected platforms.
Fixes: b08bf4c35ca ("sdhci_fsl_fdt: Skip vccq reconfiguration without regulator")
Co-authored-by: Artur Rojek <ar@semihalf.com>
Reviewed by: manu, mw
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential revision: https://reviews.freebsd.org/D33319
|
| |
|
|
|
|
|
|
|
|
| |
Add compat string for LS1012A board and fill SoC specific
structure data.
Reviewed by: manu, mw
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D33318
|