mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Graichen <michael.graichen@hotmail.com>
To: "johannes@gnu-linux.rocks" <johannes@gnu-linux.rocks>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: AW: Porting Cora Z7 Board to barebox
Date: Mon, 19 May 2025 08:32:32 +0000	[thread overview]
Message-ID: <VI1PR02MB442974EA90C7070E2DCB3350AB9CA@VI1PR02MB4429.eurprd02.prod.outlook.com> (raw)
In-Reply-To: <aBCO-SSyT0BQnlek@pengutronix.de>

> > 
> > In lowlevel.c I am setting the clock divider for the sdio0 interface to 10
> > and the Source for generated clock is IO PLL. Therefore, the sdio IP
> > should get a 100 MHz input clock. IS this correct? Do you know which
> > clockrate the driver expects? 
> > 
> > Or do you have any other idea what could case the error?
> 
> Ok, I found out that maybe 100 MHz is a little bit to slow for this SD
> Card IP. When setting the clock to 200 MHz or 250 MHz, the mmc0 gets
> detected all the time by barebox.
> 



This only works for me on my soldert eMMC card (MTFC8GAKAJCN). 
>From my measurements back in 2020 i remember that the amplitude of the clock signal will shrink with higher frequencies on Zynq-7000. 
Therefore I reduced the Clock to 25MHz on purpose, or some micro SD cards connected to the other sdhci interface do not work.

I do not have a solution for this, but an eval hack ;-)

@@ -985,10 +985,13 @@ static int sd_change_freq(struct mci *mci)
 	if (mci->scr[0] & SD_DATA_STAT_AFTER_ERASE)
 		mci->erased_byte = 0xFF;
 	else
 		mci->erased_byte = 0x0;
 
+	/* Bug do not change freqency for SD cords */
+	return 0;
+
 	/* Version 1.0 doesn't support switching */
 	if (mci->version == SD_VERSION_1_0)
 		return 0;
 
 	timeout = 4;
@@ -1499,14 +1502,22 @@ static int mci_mmc_try_bus_width(struct mci *mci, enum mci_bus_width bus_width,
 static int mci_mmc_select_bus_width(struct mci *mci)
 {
 	struct mci_host *host = mci->host;
 	int ret;
 	int idx = 0;
+
+#ifdef CONFIG_ARCH_ZYNQ
+	/* On zynq-7000 mmc and sdcard are connected via 4-line bus anyway */
+	static enum mci_bus_width bus_widths[] = {
+		MMC_BUS_WIDTH_4,
+	};
+#else
 	static enum mci_bus_width bus_widths[] = {
 		MMC_BUS_WIDTH_4,
 		MMC_BUS_WIDTH_8,
 	};
+#endif
 
 	if (!(host->host_caps & (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)))
 		return MMC_BUS_WIDTH_1;
 
 	/*








      parent reply	other threads:[~2025-05-19  8:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-28 17:20 johannes
2025-04-29  8:34 ` Sascha Hauer
2025-04-29  9:49   ` Ahmad Fatoum
2025-05-01 12:16     ` Johannes Roith
2025-05-01 13:56       ` Johannes Roith
2025-05-05  7:39       ` Sascha Hauer
2025-05-06 17:04         ` Johannes Roith
2025-05-16 19:45           ` Ahmad Fatoum
2025-05-19  8:32   ` Michael Graichen [this message]

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=VI1PR02MB442974EA90C7070E2DCB3350AB9CA@VI1PR02MB4429.eurprd02.prod.outlook.com \
    --to=michael.graichen@hotmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=johannes@gnu-linux.rocks \
    /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