HLK7628N SD Card Device Tree

Viewed 8

Hello,

We are using a HLK-7628N with custom OpenWRT containing changes on its device tree.
We are developing a product that needs to use a SD Card, we had made changes to the device tree in order to enable it and we have added the mtk-mmc kernel driver into the build, the SD Card is still not able to be accesed, example below:

[ 1.235582] mtk-sd 10130000.mmc: no support for card's volts
[ 1.246911] mmc0: error -22 whilst initialising SDIO card

After checking the device pins we measured that a constant 1v, and no other activity, what changes we need to perform on our device tree in order to enable the SD Card?

Please check below our device tree snippet and the pinctrl mapping from the Kernel.


Device tree:

&pinctrl {
    uart2_pins: uart2 {
        groups = "uart2";
        function = "uart2";
    };

	sdhci_pins: sdhci_pins {
		sd_grp {
			groups = "sdmode";
			function = "sdxc";
		};
		/* * Force Bit 15 to 0 to ensure signals are NOT routed 
			* to Ethernet PHYs.
			*/
		esd_grp {
			groups = "esd";
			function = "iot"; /* In your C code, 'iot' writes 0, which is what we want */
		};
    };

    i2c_pins: i2c_pins {
        groups = "i2c";
        function = "i2c";
    };
};

/* Enable the SD Controller */
&sdhci {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&sdhci_pins>;

	compatible = "ralink,mt7620-sdhci";
    
    /* * Configure bus width to 4-bit (uses DAT0-DAT3).
     * If your hardware only wires 1 bit, change this to <1>.
     */
    bus-width = <4>;

    /* * Use "broken-cd" if you are NOT using Pin 23 for Card Detect.
     * This forces the OS to poll the bus or assume a card is present.
     */
    broken-cd; 

	no-1-8-v;          /* MT7628 only supports 3.3V signaling */

    disable-wp;
	vmmc-supply = <&reg_3p3v>;
	vqmmc-supply = <&reg_3p3v>;
};

This is our OpenWRT pinctrl.c for MT7628N:


/*
 * "esd" (Ethernet SDXC) group supports two mode:
 * "gpio" - SDXC mux to I2S/I2C/GPIO0/UART1 pins with "gpio" mode
 * "iot"  - SDXC mux to EPHY pins, eth p1-p4 pad must be set to "digital"
 */
static struct mtmips_pmx_func esd_grp[] = { FUNC("iot", 0, 47, 1) };

static struct mtmips_pmx_func sd_mode_grp[] = {
	FUNC("jtag", 3, 22, 8),
	FUNC("utif", 2, 22, 8),
	FUNC("gpio", 1, 22, 8),
	FUNC("sdxc", 0, 22, 8),
};
2 Answers

Hello, could you pls help to check the firmware version. is it 14.07 version?

Hello we are using a custom OpenWRT with the device tree attached, the base files are from the OpenWRT 24.10.7

Related