From: Gabriel Somlo <gsomlo@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: robh+dt@kernel.org, devicetree@vger.kernel.org,
ulf.hansson@linaro.org, linux-mmc@vger.kernel.org,
kgugala@antmicro.com, mholenko@antmicro.com,
krakoczy@antmicro.com, mdudek@internships.antmicro.com,
paulus@ozlabs.org, joel@jms.id.au, shorne@gmail.com,
geert@linux-m68k.org, david.abdurachmanov@sifive.com,
florent@enjoy-digital.fr, rdunlap@infradead.org,
andy.shevchenko@gmail.com
Subject: [PATCH v6 0/3] mmc: Add LiteSDCard mmc driver
Date: Thu, 6 Jan 2022 12:48:00 -0500 [thread overview]
Message-ID: <20220106174803.1773876-1-gsomlo@gmail.com> (raw)
Add support for the LiteX SD-Card device, LiteSDCard.
LiteSDCard is a simple SD-Card interface available as part of the LiteX
environment, used with various RISC-V and other FPGA based SoCs.
New in v6:
drivers/mmc/host/litex_mmc.c:
- fix handling of deferred probe vs. platform_get_irq_optional()
- don't #ifdef dma_set_mask_and_coherent(), since it automatically
does the right thing on both 32- and 64-bit DMA capable arches
- remove MMC_CAP2_FULL_PWR_CYCLE, add MMC_CAP2_NO_MMC to list of
hardcoded capabilities during litex_mmc_probe()
- hardcode mmc->ocr_avail to the full 2.7-3.6V range allowed by the
SDCard spec (the LiteSDCard device doesn't accept software
configuration)
>New in v5:
>
>MAINTAINERS:
>
> - picked up a/b Mateusz
>
>Doc/dt/bindings/mmc/litex,mmc.yaml:
>
> - picked up r/b Rob, Joel
>
>drivers/mmc/host/litex_mmc.c:
>
> - shorten #define constant names (cosmetic, make them less unwieldy)
> - picked up r/b Joel
>
>>New in v4:
>>
>>Doc/dt/bindings/mmc/litex,mmc.yaml:
>>
>> - fixed `dt_binding_check` errors uncovered by Rob's script
>>
>>drivers/mmc/host/litex_mmc.c:
>>
>> - struct litex_mmc_host fields re-ordered so that `pahole` reports
>> no holes in either 32- or 64-bit builds
>> - litex_mmc_set_bus_width() now encapsulates check for
>> host->is_bus_width_set
>> - litex_mmc_request() - factor out dma data setup into separate
>> helper function: litex_mmc_do_dma()
>>
>>>New in v3:
>>>
>>> MAINTAINERS:
>>>
>>> - picked up acked-by Joel
>>> - added listing for liteeth driver
>>> - added Joel as additional co-maintainer (thanks!)
>>>
>>> Doc/dt/bindings/mmc/litex,mmc.yaml:
>>>
>>> - picked up r/b Geert Uytterhoeven <geert@linux-m68k.org> in DT
>>> bindings document (please let me know if that was premature, and
>>> happy to take further review if needed :)
>>> - add dedicated DT property for source clock frequency
>>>
>>> drivers/mmc/host/litex_mmc.c:
>>>
>>> - fixed function signature (no line split), and naming (litex_mmc_*)
>>> - more informative MODULE_AUTHOR() entries
>>> - also added matching "Copyright" entries in file header
>>> - fixed description in Kconfig
>>> - fixed DT documentation
>>> - removed magic constants
>>> - removed litex_map_status(), have sdcard_wait_done() return *real*
>>> error codes directly instead.
>>> - streamlined litex_mmc_reponse_len()
>>> - call litex_mmc_set_bus_width() only once, and ensure it returns
>>> correct error code(s)
>>> - use readx_poll_timeout() -- more concise -- instead of
>>> read_poll_timeout()
>>> - use dev_err() in litex_mmc_send_cmd() (instead of pr_err())
>>> - litex_mmc_setclk() will update host->clock before returning
>>> - separate irq initialization into its own function,
>>> litex_mmc_irq_init()
>>> - document rationale for f_min, f_max
>>> - use dmam_alloc_coherent(), which simplifies cleanup significantly
>>> - large `if (data) { ... }` block in litex_mmc_request() left as-is,
>>> there are too many variables shared with the rest of the parent
>>> function body to easily separate (e.g., `len`, `transfer`, `direct`).
>>> If this is indeed a blocker, I can take another shot at refactoring
>>> it in a future revision!
>>> - bump dma_set_mask_and_coherent() to 64-bits on suitable
>>> architectures
>>> - clock source picked up from dedicated DT clock reference property
>>> - remove gpio card-detect logic (needs testing and a dt binding
>>> example before being eligible for upstream inclusion)
>>>
>>>> New in v2:
>>>> - reword info message in litex_set_clk()
>>>> - streamline code in litex_map_status()
>>>> - fix typos in Kconfig (thanks Randy Dunlap <rdunlap@infradead.org>)
>>>> - improvements suggested by Stafford Horne <shorne@gmail.com>
>>>> - allow COMPILE_TEST in Kconfig
>>>> - use read_poll_timeout() when waiting for cmd/data/DMA
>>>> xfer completion
>>>> - include interrupt.h (thanks kernel test robot <lkp@intel.com>)
Gabriel Somlo (3):
MAINTAINERS: co-maintain LiteX platform
dt-bindings: mmc: Add bindings for LiteSDCard
mmc: Add driver for LiteX's LiteSDCard interface
.../devicetree/bindings/mmc/litex,mmc.yaml | 72 ++
MAINTAINERS | 9 +-
drivers/mmc/host/Kconfig | 9 +
drivers/mmc/host/Makefile | 1 +
drivers/mmc/host/litex_mmc.c | 659 ++++++++++++++++++
5 files changed, 748 insertions(+), 2 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mmc/litex,mmc.yaml
create mode 100644 drivers/mmc/host/litex_mmc.c
--
2.31.1
next reply other threads:[~2022-01-06 17:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-06 17:48 Gabriel Somlo [this message]
2022-01-06 17:48 ` [PATCH v6 1/3] MAINTAINERS: co-maintain LiteX platform Gabriel Somlo
2022-01-06 17:48 ` [PATCH v6 2/3] dt-bindings: mmc: Add bindings for LiteSDCard Gabriel Somlo
2022-01-06 17:48 ` [PATCH v6 3/3] mmc: Add driver for LiteX's LiteSDCard interface Gabriel Somlo
2022-01-06 18:19 ` Andy Shevchenko
2022-01-06 22:50 ` Gabriel L. Somlo
2022-01-07 9:36 ` Geert Uytterhoeven
2022-01-07 10:12 ` Stafford Horne
2022-01-07 10:24 ` Andy Shevchenko
2022-01-07 10:29 ` Geert Uytterhoeven
2022-01-07 10:30 ` Geert Uytterhoeven
2022-01-07 10:38 ` Andy Shevchenko
2022-01-07 12:32 ` Stafford Horne
2022-01-07 14:07 ` Gabriel L. Somlo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220106174803.1773876-1-gsomlo@gmail.com \
--to=gsomlo@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=david.abdurachmanov@sifive.com \
--cc=devicetree@vger.kernel.org \
--cc=florent@enjoy-digital.fr \
--cc=geert@linux-m68k.org \
--cc=joel@jms.id.au \
--cc=kgugala@antmicro.com \
--cc=krakoczy@antmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=mdudek@internships.antmicro.com \
--cc=mholenko@antmicro.com \
--cc=paulus@ozlabs.org \
--cc=rdunlap@infradead.org \
--cc=robh+dt@kernel.org \
--cc=shorne@gmail.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).