|
3288 android4.4 sd那组管脚无法作为普通io使用
发表于 2018-2-1 11:51:24
浏览:7151
|
回复:1
打印
只看该作者
[复制链接]
楼主
各位好,
向各位请教一个问题:
由于项目需要,我的板子在硬件上把3288的sd(sdmmc)的整组管脚用作了普通IO; 软件改动中,我对dts和dtsi文件做了改动,如下: (我用的是android4.4的系统,内核版本为3.10.49)
dts文件的
//&sdmmc {
// clock-frequency = <50000000>;
// clock-freq-min-max = <400000 50000000>;
// supports-highspeed;
// supports-sd;
// broken-cd;
// card-detect-delay = <200>;
// ignore-pm-notify;
// keep-power-in-suspend;
// vmmc-supply = <&rk818_ldo9_reg>;
// status = "disabled";
//};
dtsi文件的
//sdmmc: rksdmmc@ff0c0000 {
// compatible = "rockchip,rk_mmc", "rockchip,rk32xx-sdmmc";
// reg = <0xff0c0000 0x4000>;
// interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
// #address-cells = <1>;
// #size-cells = <0>;
// pinctrl-names = "default", "idle";
//pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
// pinctrl-0 = <&sdmmc0_gpio>;
// cd-gpios = <&gpio6 GPIO_C6 GPIO_ACTIVE_HIGH>;/*CD GPIO*/
// clocks = <&clk_sdmmc>, <&clk_gates8 3>;
// clock-names = "clk_mmc", "hclk_mmc";
// num-slots = <1>;
// fifo-depth = <0x100>;
// bus-width = <4>;
//};
然后我在我的驱动中使用GPIO6 C2, GPIO6 C3, (sd data2, sd data3 管脚)
of_get_named_gpio, gpio_request 函数操作后,用 gpio_direction_output 函数将这两个管脚设置为低;
编译,更新固件;
从打印信息看,对于这两个IO的操作没有报错,返回值正确;但是我去测量,这两个IO一直都是高;
也尝试过以下改动,效果一样,这两个io无法控制:
dts文件的
&sdmmc {
clock-frequency = <50000000>;
clock-freq-min-max = <400000 50000000>;
supports-highspeed;
supports-sd;
broken-cd;
card-detect-delay = <200>;
ignore-pm-notify;
keep-power-in-suspend;
vmmc-supply = <&rk818_ldo9_reg>;
status = "disabled";
};
dtsi文件的
sdmmc: rksdmmc@ff0c0000 {
compatible = "rockchip,rk_mmc", "rockchip,rk32xx-sdmmc";
reg = <0xff0c0000 0x4000>;
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default", "idle";
//pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
pinctrl-0 = <&sdmmc0_gpio>;
cd-gpios = <&gpio6 GPIO_C6 GPIO_ACTIVE_HIGH>;/*CD GPIO*/
clocks = <&clk_sdmmc>, <&clk_gates8 3>;
clock-names = "clk_mmc", "hclk_mmc";
num-slots = <1>;
fifo-depth = <0x100>;
bus-width = <4>;
};
请问,有把sd 卡那组管脚作为普通io使用,能够正常操作的朋友吗? 能否指导下, 我还需要做哪些改动吗?
(在尝试过程中,我试过把mmc驱动中sd卡部分的屏蔽了,但是那两个管脚一直还是高,无法控制为低)
若有试过这方面操作的朋友,麻烦告知一下,已经折腾这个问题好几天了,一直没进展;项目一直卡着;
谢谢各位; |
|