From: Sascha Hauer <s.hauer@pengutronix.de> To: Barebox List <barebox@lists.infradead.org> Subject: [PATCH 02/12] mci: sdhci: Add and use SDHCI_CAPABILITIES_1 defines Date: Mon, 7 Jun 2021 12:44:01 +0200 [thread overview] Message-ID: <20210607104411.23071-3-s.hauer@pengutronix.de> (raw) In-Reply-To: <20210607104411.23071-1-s.hauer@pengutronix.de> Linux has defines for the SDHCI_CAPABILITIES_1 register at offset 0x44. Add these and convert the only user so far to use the defines. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- drivers/mci/atmel-sdhci-common.c | 6 ++---- drivers/mci/sdhci.h | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/mci/atmel-sdhci-common.c b/drivers/mci/atmel-sdhci-common.c index 92013feb95..b391775b00 100644 --- a/drivers/mci/atmel-sdhci-common.c +++ b/drivers/mci/atmel-sdhci-common.c @@ -24,8 +24,6 @@ #include "atmel-sdhci.h" -#define AT91_SDHCI_CA1R 0x44 /* Capabilities 1 Register */ - #define AT91_SDHCI_MC1R 0x204 #define AT91_SDHCI_MC1_FCD BIT(7) #define AT91_SDHCI_CALCR 0x240 @@ -237,9 +235,9 @@ static int at91_sdhci_set_clock(struct at91_sdhci *host, unsigned clock) if (clock == 0) return 0; - caps = sdhci_read32(sdhci, AT91_SDHCI_CA1R); + caps = sdhci_read32(sdhci, SDHCI_CAPABILITIES_1); - caps_clk_mult = (caps & SDHCI_CLOCK_MUL_MASK) >> SDHCI_CLOCK_MUL_SHIFT; + caps_clk_mult = FIELD_GET(SDHCI_CLOCK_MUL_MASK, caps); if (caps_clk_mult) { for (clk_div = 1; clk_div <= 1024; clk_div++) { diff --git a/drivers/mci/sdhci.h b/drivers/mci/sdhci.h index 9bd9749dd6..fd63cd84de 100644 --- a/drivers/mci/sdhci.h +++ b/drivers/mci/sdhci.h @@ -123,7 +123,20 @@ #define SDHCI_CAN_64BIT_V4 0x08000000 #define SDHCI_CAN_64BIT 0x10000000 -#define SDHCI_CLOCK_MUL_MASK 0x00FF0000 +#define SDHCI_CAPABILITIES_1 0x44 +#define SDHCI_SUPPORT_SDR50 0x00000001 +#define SDHCI_SUPPORT_SDR104 0x00000002 +#define SDHCI_SUPPORT_DDR50 0x00000004 +#define SDHCI_DRIVER_TYPE_A 0x00000010 +#define SDHCI_DRIVER_TYPE_C 0x00000020 +#define SDHCI_DRIVER_TYPE_D 0x00000040 +#define SDHCI_RETUNING_TIMER_COUNT_MASK GENMASK(11, 8) +#define SDHCI_USE_SDR50_TUNING 0x00002000 +#define SDHCI_RETUNING_MODE_MASK GENMASK(15, 14) +#define SDHCI_CLOCK_MUL_MASK GENMASK(23, 16) +#define SDHCI_CAN_DO_ADMA3 0x08000000 +#define SDHCI_SUPPORT_HS400 0x80000000 /* Non-standard */ + #define SDHCI_CLOCK_MUL_SHIFT 16 #define SDHCI_SPEC_200_MAX_CLK_DIVIDER 256 -- 2.29.2 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2021-06-07 10:51 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-07 10:43 [PATCH 00/12] SDHCI updates Sascha Hauer 2021-06-07 10:44 ` [PATCH 01/12] mci: sdhci: straighten capabilities register Sascha Hauer 2021-06-07 10:44 ` Sascha Hauer [this message] 2021-06-07 10:44 ` [PATCH 03/12] mci: sdhci: Use SDHCI_MAX_DIV_SPEC_200 define Sascha Hauer 2021-06-07 10:44 ` [PATCH 04/12] mci: sdhci: port over some common functions from Linux Sascha Hauer 2021-06-07 10:44 ` [PATCH 05/12] mci: sdhci: imx: Use sdhci_setup_host() Sascha Hauer 2021-06-07 10:44 ` [PATCH 06/12] mci: sdhci: Use Linux defines for SDHCI_HOST_CONTROL register Sascha Hauer 2022-01-26 6:32 ` Antony Pavlov 2022-01-26 9:23 ` Sascha Hauer 2022-01-26 10:13 ` Antony Pavlov 2021-06-07 10:44 ` [PATCH 07/12] mci: sdhci: arasan: Use sdhci_setup_host() Sascha Hauer 2021-06-07 10:44 ` [PATCH 08/12] mci: sdhci: arasan: Use sdhci_set_bus_width() Sascha Hauer 2021-06-07 10:44 ` [PATCH 09/12] mci: sdhci: Use Linux defines for SDHCI_CLOCK_CONTROL register Sascha Hauer 2021-06-07 10:44 ` [PATCH 10/12] mci: sdhci: arasan: Use sdhci_set_clock() Sascha Hauer 2021-06-07 10:44 ` [PATCH 11/12] mci: sdhci: Get rid of many register ops Sascha Hauer 2021-06-07 10:44 ` [PATCH 12/12] mci: Add support for Rockchip variant of the dwcmshc Sascha Hauer
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=20210607104411.23071-3-s.hauer@pengutronix.de \ --to=s.hauer@pengutronix.de \ --cc=barebox@lists.infradead.org \ --subject='Re: [PATCH 02/12] mci: sdhci: Add and use SDHCI_CAPABILITIES_1 defines' \ /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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox