mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Steffen Trumtrar <s.trumtrar@pengutronix.de>,
	barebox@lists.infradead.org
Subject: Re: [PATCH 08/12] mci: core: parse more host capabilities from DT
Date: Mon, 11 Mar 2024 09:23:48 +0100	[thread overview]
Message-ID: <715e191a-bd9b-471f-9c64-e302b2e9db28@pengutronix.de> (raw)
In-Reply-To: <20240308-v2024-02-0-topic-arasan-hs200-support-v1-8-6d50c90485f3@pengutronix.de>

Hi Steffen,

On 08.03.24 12:17, Steffen Trumtrar wrote:
> @@ -2322,9 +2322,31 @@ void mci_of_parse_node(struct mci_host *host,
>  
>  	host->broken_cd = of_property_read_bool(np, "broken-cd");
>  	host->non_removable = of_property_read_bool(np, "non-removable");
> -	host->no_sd = of_property_read_bool(np, "no-sd");
> -	host->no_sdio = of_property_read_bool(np, "no-sdio");
>  	host->disable_wp = of_property_read_bool(np, "disable-wp");
> +
> +	if (of_property_read_bool(np, "full-pwr-cycle"))
> +		host->caps2 |= MMC_CAP2_FULL_PWR_CYCLE;
> +	if (of_property_read_bool(np, "full-pwr-cycle-in-suspend"))
> +		host->caps2 |= MMC_CAP2_FULL_PWR_CYCLE_IN_SUSPEND;
> +	if (of_property_read_bool(np, "mmc-hs200-1_8v"))
> +		host->caps2 |= MMC_CAP2_HS200_1_8V_SDR;
> +	if (of_property_read_bool(np, "mmc-hs200-1_2v"))
> +		host->caps2 |= MMC_CAP2_HS200_1_2V_SDR;
> +	if (of_property_read_bool(np, "mmc-hs400-1_8v"))
> +		host->caps2 |= MMC_CAP2_HS400_1_8V | MMC_CAP2_HS200_1_8V_SDR;
> +	if (of_property_read_bool(np, "mmc-hs400-1_2v"))
> +		host->caps2 |= MMC_CAP2_HS400_1_2V | MMC_CAP2_HS200_1_2V_SDR;
> +	if (of_property_read_bool(np, "mmc-hs400-enhanced-strobe"))
> +		host->caps2 |= MMC_CAP2_HS400_ES;
> +	if (of_property_read_bool(np, "no-sdio"))
> +		host->caps2 |= MMC_CAP2_NO_SDIO;
> +	if (of_property_read_bool(np, "no-sd"))
> +		host->caps2 |= MMC_CAP2_NO_SD;
> +	if (of_property_read_bool(np, "no-mmc"))
> +		host->caps2 |= MMC_CAP2_NO_MMC;
> +	if (of_property_read_bool(np, "no-mmc-hs400"))
> +		host->caps2 &= ~(MMC_CAP2_HS400_1_8V | MMC_CAP2_HS400_1_2V |
> +				 MMC_CAP2_HS400_ES);

Can you move all the stuff with hs200 and hs400 into it into
an IS_ENABLED(CONFIG_MCI_TUNING)?

With this done: Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

>  }
>  
>  void mci_of_parse(struct mci_host *host)
> diff --git a/include/mci.h b/include/mci.h
> index 9a52e3f360..ed2967c889 100644
> --- a/include/mci.h
> +++ b/include/mci.h
> @@ -468,6 +468,36 @@ struct mci_host {
>  	const char *devname;		/**< the devicename for the card, defaults to disk%d */
>  	unsigned voltages;
>  	unsigned host_caps;	/**< Host's interface capabilities, refer MMC_VDD_* */
> +	unsigned caps2;		/* More host capabilities */
> +#define MMC_CAP2_BOOTPART_NOACC	(1 << 0)	/* Boot partition no access */
> +#define MMC_CAP2_FULL_PWR_CYCLE	(1 << 2)	/* Can do full power cycle */
> +#define MMC_CAP2_FULL_PWR_CYCLE_IN_SUSPEND (1 << 3) /* Can do full power cycle in suspend */
> +#define MMC_CAP2_HS200_1_8V_SDR	(1 << 5)        /* can support */
> +#define MMC_CAP2_HS200_1_2V_SDR	(1 << 6)        /* can support */
> +#define MMC_CAP2_HS200		(MMC_CAP2_HS200_1_8V_SDR | \
> +				 MMC_CAP2_HS200_1_2V_SDR)
> +#define MMC_CAP2_SD_EXP		(1 << 7)	/* SD express via PCIe */
> +#define MMC_CAP2_SD_EXP_1_2V	(1 << 8)	/* SD express 1.2V */
> +#define MMC_CAP2_CD_ACTIVE_HIGH	(1 << 10)	/* Card-detect signal active high */
> +#define MMC_CAP2_RO_ACTIVE_HIGH	(1 << 11)	/* Write-protect signal active high */
> +#define MMC_CAP2_NO_PRESCAN_POWERUP (1 << 14)	/* Don't power up before scan */
> +#define MMC_CAP2_HS400_1_8V	(1 << 15)	/* Can support HS400 1.8V */
> +#define MMC_CAP2_HS400_1_2V	(1 << 16)	/* Can support HS400 1.2V */
> +#define MMC_CAP2_HS400		(MMC_CAP2_HS400_1_8V | \
> +				 MMC_CAP2_HS400_1_2V)
> +#define MMC_CAP2_HSX00_1_8V	(MMC_CAP2_HS200_1_8V_SDR | MMC_CAP2_HS400_1_8V)
> +#define MMC_CAP2_HSX00_1_2V	(MMC_CAP2_HS200_1_2V_SDR | MMC_CAP2_HS400_1_2V)
> +#define MMC_CAP2_SDIO_IRQ_NOTHREAD (1 << 17)
> +#define MMC_CAP2_NO_WRITE_PROTECT (1 << 18)	/* No physical write protect pin, assume that card is always read-write */
> +#define MMC_CAP2_NO_SDIO	(1 << 19)	/* Do not send SDIO commands during initialization */
> +#define MMC_CAP2_HS400_ES	(1 << 20)	/* Host supports enhanced strobe */
> +#define MMC_CAP2_NO_SD		(1 << 21)	/* Do not send SD commands during initialization */
> +#define MMC_CAP2_NO_MMC		(1 << 22)	/* Do not send (e)MMC commands during initialization */
> +#define MMC_CAP2_CQE		(1 << 23)	/* Has eMMC command queue engine */
> +#define MMC_CAP2_CQE_DCMD	(1 << 24)	/* CQE can issue a direct command */
> +#define MMC_CAP2_AVOID_3_3V	(1 << 25)	/* Host must negotiate down from 3.3V */
> +#define MMC_CAP2_MERGE_CAPABLE	(1 << 26)	/* Host can merge a segment over the segment size */
> +#define MMC_CAP2_CRYPTO		0
>  	unsigned f_min;		/**< host interface lower limit */
>  	unsigned f_max;		/**< host interface upper limit */
>  	unsigned clock;		/**< Current clock used to talk to the card */
> @@ -478,8 +508,6 @@ struct mci_host {
>  	int use_dsr;		/**< optional dsr usage flag */
>  	int broken_cd;		/**< card detect is broken */
>  	bool non_removable;	/**< device is non removable */
> -	bool no_sd;		/**< do not send SD commands during initialization */
> -	bool no_sdio;		/**< do not send SDIO commands during initialization */
>  	bool disable_wp;	/**< ignore write-protect detection logic */
>  	struct regulator *supply;
>  
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




  reply	other threads:[~2024-03-11  8:24 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 11:16 [PATCH 00/12] mci: add HS200 support for eMMCs Steffen Trumtrar
2024-03-08 11:16 ` [PATCH 01/12] ARM: zynqmp: add sd_dll_reset call Steffen Trumtrar
2024-03-11  8:43   ` Ahmad Fatoum
2024-03-08 11:17 ` [PATCH 02/12] zynqmp: firmware: add functions to set tap delay Steffen Trumtrar
2024-03-11  8:43   ` Ahmad Fatoum
2024-03-08 11:17 ` [PATCH 03/12] mci: arasan: implement 25MHz quirk for zynqmp Steffen Trumtrar
2024-03-12  8:34   ` Ahmad Fatoum
2024-03-08 11:17 ` [PATCH 04/12] mci: arasan: read clk phases from DT Steffen Trumtrar
2024-03-11  8:16   ` Ahmad Fatoum
2024-03-11  8:44   ` Ahmad Fatoum
2024-03-08 11:17 ` [PATCH 05/12] mci: arasan: register sdcard/sampleclk Steffen Trumtrar
2024-03-11  8:14   ` Ahmad Fatoum
2024-03-08 11:17 ` [PATCH 06/12] include: mci: sync mci_timing with linux Steffen Trumtrar
2024-03-11  8:11   ` Ahmad Fatoum
2024-03-08 11:17 ` [PATCH 07/12] include: mci: add more EXT_CSD_CARD_TYPE_* Steffen Trumtrar
2024-03-11  8:17   ` Ahmad Fatoum
2024-03-08 11:17 ` [PATCH 08/12] mci: core: parse more host capabilities from DT Steffen Trumtrar
2024-03-11  8:23   ` Ahmad Fatoum [this message]
2024-03-08 11:17 ` [PATCH 09/12] mci: mci-core: add HS200 support Steffen Trumtrar
2024-03-12  8:20   ` Ahmad Fatoum
2024-03-08 11:17 ` [PATCH 10/12] mci: sdhci: add tuning support Steffen Trumtrar
2024-03-12  8:32   ` Ahmad Fatoum
2024-03-08 11:17 ` [PATCH 11/12] mci: arasan-sdhci: add HS200 tuning support on ZynqMP Steffen Trumtrar
2024-03-12  8:33   ` Ahmad Fatoum
2024-03-08 11:17 ` [PATCH 12/12] mci: arasan: use sdhci_wait_idle2 Steffen Trumtrar
2024-03-11  8:42   ` Ahmad Fatoum

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=715e191a-bd9b-471f-9c64-e302b2e9db28@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.trumtrar@pengutronix.de \
    /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