[SOLVED] SAMA5D2 and eMMC on custom board

Discussion around products based on ARM Cortex-A5 core.

Moderator: nferre

Automotive
Posts: 1
Joined: Mon Jun 11, 2018 11:21 am

[SOLVED] SAMA5D2 and eMMC on custom board

Mon Jun 11, 2018 11:38 am

Hello,

I have only solution here, in a company we solved an issue and decided to share knowledge.

Our company developed custom board with SAMA5D24 (rev. C) and eMMC 8GB (SanDisk) 1.8V I/O levels, 3.3V core logic (not possible to change this using SDMMC_1V8SEL - pin not connected on our board in purpose).
We faced into problem - AT91Bootstrap do not want to initialize the eMMC disk.
eMMC disk response on CMD0 and CMD1. But after CMD1 (when it returns ready flag) - CMD2 commands fails with error code CMDCRC (Command CRC Error).

First thing we found - AT91bootstrap always using 3.3V levels.
here:
at91bootstrap/blob/master/driver/sdhc.c

Code: Select all

/* SDMMC_PCR */
#define	SDMMC_PCR_SDBPWR	(0x1 << 0)	/* SD Bus Power */
#define	SDMMC_PCR_SDBVSEL	(0x7 << 1) /* SD Bus Voltage Select */
...
static void sdhc_set_power(void)
{
	unsigned char value = sdhc_readb(SDMMC_PCR);

	sdhc_writeb(SDMMC_PCR, value | SDMMC_PCR_SDBPWR);
}
this code set bus power to 3.3V. For 1.8V SDMMC_PCR_SDBVSEL should be (0x5 << 1)

Second thing (main issue), in board file:

Code: Select all

	
	pmc_enable_periph_generated_clk(CONFIG_SYS_ID_SDHC,
					GCK_CSS_UPLL_CLK,
                                        ATMEL_SDHC_GCKDIV_VALUE);
where GCK_CSS_UPLL_CLK should be GCK_CSS_MCK_CLK.

After this changes - AT91bootstrap able to load uboot from eMMC.

Hope it helps somebody.

Return to “SAMA5D Cortex-A5 MPU”

Who is online

Users browsing this forum: No registered users and 11 guests