您尚未登录。

楼主 #1 2019-04-24 22:02:01

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

全志芯片主线Linux 启动 eMMC 8-bit 模式测试

https://www.kernel.org/doc/Documentation/devicetree/bindings/mmc/sunxi-mmc.txt

* Allwinner sunxi MMC controller

The highspeed MMC host controller on Allwinner SoCs provides an interface
for MMC, SD and SDIO types of memory cards.

Supported maximum speeds are the ones of the eMMC standard 4.5 as well
as the speed of SD standard 3.0.
Absolute maximum transfer rate is 200MB/s

Required properties:
 - compatible : should be one of:
   * "allwinner,sun4i-a10-mmc"
   * "allwinner,sun5i-a13-mmc"
   * "allwinner,sun7i-a20-mmc"
   * "allwinner,sun8i-a83t-emmc"
   * "allwinner,sun9i-a80-mmc"
   * "allwinner,sun50i-a64-emmc"
   * "allwinner,sun50i-a64-mmc"
   * "allwinner,sun50i-h6-emmc", "allwinner.sun50i-a64-emmc"
   * "allwinner,sun50i-h6-mmc", "allwinner.sun50i-a64-mmc"
 - reg : mmc controller base registers
 - clocks : a list with 4 phandle + clock specifier pairs
 - clock-names : must contain "ahb", "mmc", "output" and "sample"
 - interrupts : mmc controller interrupt

Optional properties:
 - resets : phandle + reset specifier pair
 - reset-names : must contain "ahb"
 - for cd, bus-width and additional generic mmc parameters
   please refer to mmc.txt within this directory

Examples:
	- Within .dtsi:
	mmc0: mmc@1c0f000 {
		compatible = "allwinner,sun5i-a13-mmc";
		reg = <0x01c0f000 0x1000>;
		clocks = <&ahb_gates 8>, <&mmc0_clk>, <&mmc0_output_clk>, <&mmc0_sample_clk>;
		clock-names = "ahb", "mod", "output", "sample";
		interrupts = <0 32 4>;
		status = "disabled";
	};

	- Within dts:
	mmc0: mmc@1c0f000 {
		pinctrl-names = "default", "default";
		pinctrl-0 = <&mmc0_pins_a>;
		pinctrl-1 = <&mmc0_cd_pin_reference_design>;
		bus-width = <4>;
		cd-gpios = <&pio 7 1 0>; /* PH1 */
		cd-inverted;
		status = "okay";
	};




离线

楼主 #2 2019-04-24 22:04:53

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Re: 全志芯片主线Linux 启动 eMMC 8-bit 模式测试

上面默认是 4bit 模式, 下面试一试把 S3/V3s 的 mmc2 改成 8bit 模式:

sun8i-dtsi 添加:

    mmc2_pins: mmc1-pins {
        pins = "PC0", "PC1", "PC2", "PC3",
               "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10";
        function = "mmc2";
        drive-strength = <30>;
        bias-pull-up;
    };

mmc2 改为:

mmc2: mmc@1c11000 {
            compatible = "allwinner,sun7i-a20-mmc";
            reg = <0x01c11000 0x1000>;
            clocks = <&ccu CLK_BUS_MMC2>,
                 <&ccu CLK_MMC2>,
                 <&ccu CLK_MMC2_OUTPUT>,
                 <&ccu CLK_MMC2_SAMPLE>;
            clock-names = "ahb",
                      "mmc",
                      "output",
                      "sample";
            resets = <&ccu RST_BUS_MMC2>;
            reset-names = "ahb";
            interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
            pinctrl-names = "default", "default";
            pinctrl-0 = <&mmc2_pins>;
            bus-width = <8>;
            status = "disabled";
            #address-cells = <1>;
            #size-cells = <0>;
        };


sun8i-v3s-licheepi-zero.dts 添加:

&mmc2 {
    broken-cd;
    bus-width = <4>;
    vmmc-supply = <&reg_vcc3v3>;
    status = "okay";
};

仅有 PC 这组 MMC 可以运行 8bit模式.

驱动程序: https://github.com/torvalds/linux/blob/master/drivers/mmc/host/sunxi-mmc.c

设备树:
https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun8i-v3s.dtsi
https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts





离线

楼主 #7 2019-05-05 10:56:36

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Re: 全志芯片主线Linux 启动 eMMC 8-bit 模式测试

没有测试, 因为我没有 8bit eMMC 的板子
没有测试, 因为我没有 8bit eMMC 的板子
没有测试, 因为我没有 8bit eMMC 的板子

如果哪位测试 OK 了, 麻烦冒个泡泡.





离线

楼主 #9 2019-05-05 15:04:30

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Re: 全志芯片主线Linux 启动 eMMC 8-bit 模式测试

zhenfanhei 说:

前面s3的mmc2  4bit sd nand上3.4上有识别到,4.13上好像没有识别到,

会不会是 IO,寄存器基地址和中断等资源配置不对呢?





离线

楼主 #13 2019-06-29 15:23:03

晕哥
管理员
注册时间: 2017-09-06
已发帖子: 9,342
积分: 9202

Re: 全志芯片主线Linux 启动 eMMC 8-bit 模式测试

那 4bit 可以用吗? 就是设备树什么都不用改,默认可以作为TF卡使用吗?





离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn