swahren
Posts: 23
Joined: Mon Sep 19, 2016 5:24 pm
Location: Germany

Review: eMMC part on CM1

Thu May 17, 2018 12:41 pm

Hi,
i'm working on the DTS for Compute Module 1 + IO board for Linux Mainline. Based on the datasheet and the schematics i created the following source and i would appreciate a review:

Code: Select all

// SPDX-License-Identifier: GPL-2.0
/dts-v1/;
#include "bcm2835.dtsi"
#include "bcm2835-rpi.dtsi"

/ {
	emmc_pwrseq: emmc-pwrseq {
		compatible = "mmc-pwrseq-emmc";
		pinctrl-0 = <&emmc_reset>;
		pinctrl-names = "default";
		reset-gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
	};

	reg_3v3: fixed-regulator {
		compatible = "regulator-fixed";
		regulator-name = "3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
	};

	reg_1v8: fixed-regulator {
		compatible = "regulator-fixed";
		regulator-name = "1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		regulator-always-on;
	};
};

&gpio {
	emmc_reset: emmc-reset {
		brcm,pins = <47>;
		brcm,function = <BCM2835_FSEL_GPIO_OUT>;
	};
};

&sdhost {
	non-removable;
	mmc-pwrseq = <&emmc_pwrseq>;
	vmmc-supply = <&reg_3v3>;
	vqmmc-supply = <&reg_1v8>;
};
Thanks Stefan

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1871
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Review: eMMC part on CM1

Thu May 17, 2018 12:52 pm

What is your intention with the EMMC pwrseq support? Lowering EMMC_DISABLE_N won't reset the EMMC device, only disconnect the CMD line.

swahren
Posts: 23
Joined: Mon Sep 19, 2016 5:24 pm
Location: Germany

Re: Review: eMMC part on CM1

Thu May 17, 2018 1:09 pm

PhilE wrote:
Thu May 17, 2018 12:52 pm
What is your intention with the EMMC pwrseq support?
* The simple eMMC hardware reset provider

The purpose of this driver is to perform standard eMMC hw reset
procedure, as described by Jedec 4.4 specification. This procedure is
performed just after MMC core enabled power to the given mmc host (to
fix possible issues if bootloader has left eMMC card in initialized or
unknown state), and before performing complete system reboot (also in
case of emergency reboot call). The latter is needed on boards, which
doesn't have hardware reset logic connected to emmc card and (limited or
broken) ROM bootloaders are unable to read second stage from the emmc
card if the card is left in unknown or already initialized state.
PhilE wrote:
Thu May 17, 2018 12:52 pm
Lowering EMMC_DISABLE_N won't reset the EMMC device, only disconnect the CMD line.
This confuses me, according to the datasheet GPIO47 is EMMC EN N 1V8 not EMMC_DISABLE_N. So there is no reset line?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1871
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Review: eMMC part on CM1

Thu May 17, 2018 1:21 pm

That's correct - the EMMC RSTN is tied high. I'm not sure why you would be confused, since the schematics are published here. GPIO47 provides the SoC's input to the logic that allows the user to choose to boot from EMMC or USB (but with the ability to access EMMC after boot). It also drives the ACT LED.

swahren
Posts: 23
Joined: Mon Sep 19, 2016 5:24 pm
Location: Germany

Re: Review: eMMC part on CM1

Thu May 17, 2018 1:31 pm

As a software guy i'm not really familiar with reading schematics. But the regulators do match?

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1871
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Review: eMMC part on CM1

Thu May 17, 2018 1:37 pm

The regulator voltages are correct, but the bindings document says:
Controllers may implement power control from both the connected cards and
the IO signaling (for example to change to high-speed 1.8V signalling). If
the system supports this, then the following two properties should point
to valid regulator nodes:

- vqmmc-supply: supply node for IO line power
- vmmc-supply: supply node for card's power
Since there is no voltage control, I think these properties should not be set.

swahren
Posts: 23
Joined: Mon Sep 19, 2016 5:24 pm
Location: Germany

Re: Review: eMMC part on CM1

Thu May 17, 2018 1:47 pm

Without providing a fixed regulator the MMC core doesn't have any chance to know the IO line power and assume 3.3 V. This is correct for most of the Raspberry Pis except the Compute Modules.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1871
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Review: eMMC part on CM1

Thu May 17, 2018 2:00 pm

> Without providing a fixed regulator the MMC core doesn't have any chance to know the IO line power and assume 3.3 V. This is correct for most of the Raspberry Pis except the Compute Modules.

What makes you think it is changeable? The EMMC is hard-wired to GPIOs 48-53, which aren't affected by J3.

swahren
Posts: 23
Joined: Mon Sep 19, 2016 5:24 pm
Location: Germany

Re: Review: eMMC part on CM1

Thu May 17, 2018 2:10 pm

I never said it's changeable. There are example boards like sun7i-a20-olinuxino-lime2-emmc.dts which uses a fixed regulator as vqmmc-supply.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1871
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Review: eMMC part on CM1

Thu May 17, 2018 2:24 pm

I never said it's changeable.
Then please explain this statement:
Without providing a fixed regulator the MMC core doesn't have any chance to know the IO line power and assume 3.3 V. This is correct for most of the Raspberry Pis except the Compute Modules.

swahren
Posts: 23
Joined: Mon Sep 19, 2016 5:24 pm
Location: Germany

Re: Review: eMMC part on CM1

Thu May 17, 2018 4:16 pm

This statement has nothing to do with changeable voltages.

Regarding to my understanding:
Raspberry Pi 3 B SD IO voltage: fixed 3.3V
Raspberry Pi CM1 MMC IO voltage: fixed 1.8V

Per default MMC core assumes a IO voltage of 3.3V. My devicetree source provides the correct, fixed IO voltage.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1871
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Review: eMMC part on CM1

Thu May 17, 2018 5:24 pm

Yes, your understanding is correct - the CM uses a 1.8V voltage reference for the SD interface on 48-53.

I haven't found a code path where providing a fixed 1.8V vqmmc makes a useful difference - it will just run more core before returning an error - but in terms of describing the hardware it is more accurate.

Return to “Device Tree”

Who is online

Users browsing this forum: No registered users and 3 guests