rockchip,drive = <VALUE_DRV_DEFAULT>;
//rockchip,tristate = <VALUE_TRI_DEFAULT>;
};
+
+ sdmmc0_gpio: sdmmc0_gpio{
+ rockchip,pins =
+ <GPIO6_C4>, //CMD
+ <GPIO6_C5>, //CLK
+ <GPIO6_C6>, //DET
+ <GPIO6_C0>, //D0
+ <GPIO6_C1>, //D1
+ <GPIO6_C2>, //D2
+ <GPIO6_C3>; //D3
+ rockchip,pull = <VALUE_PULL_UP>;
+ //rockchip,voltage = <VALUE_VOL_DEFAULT>;
+ rockchip,drive = <VALUE_DRV_DEFAULT>;
+ //rockchip,tristate = <VALUE_TRI_DEFAULT>;
+ };
+
};
+ gpio4_sdio0 {
+
+ sdio0_clk: sdio0_clk {
+ rockchip,pins = <SDIO0_CLKOUT>;
+ rockchip,pull = <VALUE_PULL_DISABLE>;
+ //rockchip,voltage = <VALUE_VOL_DEFAULT>;
+ rockchip,drive = <VALUE_DRV_DEFAULT>;
+ //rockchip,tristate = <VALUE_TRI_DEFAULT>;
+ };
+
+ sdio0_cmd: sdio0_cmd {
+ rockchip,pins = <SDIO0_CMD>;
+ rockchip,pull = <VALUE_PULL_UP>;
+ //rockchip,voltage = <VALUE_VOL_DEFAULT>;
+ rockchip,drive = <VALUE_DRV_DEFAULT>;
+ //rockchip,tristate = <VALUE_TRI_DEFAULT>;
+ };
+
+ sdio0_dectn: sdio0-dectn{
+ rockchip,pins = <SDIO0_DETECTN>;
+ rockchip,pull = <VALUE_PULL_UP>;
+ //rockchip,voltage = <VALUE_VOL_DEFAULT>;
+ rockchip,drive = <VALUE_DRV_DEFAULT>;
+ //rockchip,tristate = <VALUE_TRI_DEFAULT>;
+ };
+
+ sdio0_wrprt: sdio0_wrprt{
+ rockchip,pins = <SDIO0_WRPRT>;
+ rockchip,pull = <VALUE_PULL_UP>;
+ //rockchip,voltage = <VALUE_VOL_DEFAULT>;
+ rockchip,drive = <VALUE_DRV_DEFAULT>;
+ //rockchip,tristate = <VALUE_TRI_DEFAULT>;
+ };
+
+ sdio0_pwr: sdio0-pwren{
+ rockchip,pins = <SDIO0_PWREN>;
+ rockchip,pull = <VALUE_PULL_UP>;
+ //rockchip,voltage = <VALUE_VOL_DEFAULT>;
+ rockchip,drive = <VALUE_DRV_DEFAULT>;
+ //rockchip,tristate = <VALUE_TRI_DEFAULT>;
+ };
+
+ sdio0_bkpwr: sdio0-bkpwr{
+ rockchip,pins = <SDIO0_BKPWR>;
+ rockchip,pull = <VALUE_PULL_UP>;
+ //rockchip,voltage = <VALUE_VOL_DEFAULT>;
+ rockchip,drive = <VALUE_DRV_DEFAULT>;
+ //rockchip,tristate = <VALUE_TRI_DEFAULT>;
+ };
+
+ sdio0_intn: sdio0-intn{
+ rockchip,pins = <SDIO0_INTN>;
+ rockchip,pull = <VALUE_PULL_UP>;
+ //rockchip,voltage = <VALUE_VOL_DEFAULT>;
+ rockchip,drive = <VALUE_DRV_DEFAULT>;
+ //rockchip,tristate = <VALUE_TRI_DEFAULT>;
+ };
+
+
+ sdio0_bus1: sdio0-bus-width1 {
+ rockchip,pins = <SDIO0_DATA0>;
+ rockchip,pull = <VALUE_PULL_UP>;
+ //rockchip,voltage = <VALUE_VOL_DEFAULT>;
+ rockchip,drive = <VALUE_DRV_DEFAULT>;
+ //rockchip,tristate = <VALUE_TRI_DEFAULT>;
+ };
+
+ sdio0_bus4: sdio0-bus-width4 {
+ rockchip,pins = <SDIO0_DATA0>,
+ <SDIO0_DATA1>,
+ <SDIO0_DATA2>,
+ <SDIO0_DATA3>;
+ rockchip,pull = <VALUE_PULL_UP>;
+ //rockchip,voltage = <VALUE_VOL_DEFAULT>;
+ rockchip,drive = <VALUE_DRV_DEFAULT>;
+ //rockchip,tristate = <VALUE_TRI_DEFAULT>;
+ };
+
+ sdio0_gpio: sdio0-all-gpio{
+ rockchip,pins =
+ <GPIO4_D1>, //CLK
+ <GPIO4_D0>, //CMD
+ <GPIO4_D2>, //DET
+ <GPIO4_D3>, //wrprt
+ <GPIO4_D4>, //PWREN
+ <GPIO4_D5>, //BKPWR
+ <GPIO4_D6>, //DO
+ <GPIO4_C4>, //D1
+ <GPIO4_C5>, //D2
+ <GPIO4_C6>, //D3
+ <GPIO4_C7>; //INTN
+ rockchip,pull = <VALUE_PULL_UP>;
+ //rockchip,voltage = <VALUE_VOL_DEFAULT>;
+ rockchip,drive = <VALUE_DRV_DEFAULT>;
+ //rockchip,tristate = <VALUE_TRI_DEFAULT>;
+ };
+ };
+
gpio2_gps {
gps_mag:gps-mag {
rockchip,pins = <GPS_MAG>;
};
sdmmc: rksdmmc@ff0c0000 {
- compatible = "rockchip,rk_mmc";
+ compatible = "rockchip,rk_mmc";
reg = <0xff0c0000 0x4000>;
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>; /*irq=64*/
- #address-cells = <1>;
- #size-cells = <0>;
+ #address-cells = <1>;
+ #size-cells = <0>;
- //pinctrl-names = "default","suspend";
- //pinctrl-0 = <&sd0_clk &sd0_cmd &sd0_cd &sd0_wp &sd0_pwr &sd0_bus1 &sd0_bus4>;
- //pinctrl-1 = <&sd0_cd_gpio>; //for int gpio?
+ pinctrl-names = "default","idle";
+ pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_dectn &sdmmc0_bus4>;
+ pinctrl-1 = <&sdmmc0_gpio>;
clocks = <&clk_sdmmc>, <&clk_gates8 3>;
clock-names = "clk_mmc", "hclk_mmc";
- num-slots = <1>;
- fifo-depth = <0x100>;
- bus-width = <4>;
+ num-slots = <1>;
+ fifo-depth = <0x100>;
+ bus-width = <4>;
};
sdio: rksdmmc@ff0d0000 {
compatible = "rockchip,rk_mmc";
- reg = <0xff0d0000 0x4000>;
- interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
- #address-cells = <1>;
- #size-cells = <0>;
- //pinctrl-names = "default","suspend";
- //pinctrl-0 = <&sd1_clk &sd1_cmd &sd1_cd &sd1_wp &sd1_bus1 &sd1_bus4>;
-
+ reg = <0xff0d0000 0x4000>;
+ interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pinctrl-names = "default","idle";
+ pinctrl-0 = <&sdio0_clk &sdio0_cmd &sdio0_dectn &sdio0_wrprt &sdio0_pwr &sdio0_bkpwr
+ &sdio0_intn &sdio0_bus4>;
+ pinctrl-1 = <&sdio0_gpio>;
+
clocks = <&clk_sdio0>, <&clk_gates8 4>;
clock-names = "clk_mmc", "hclk_mmc";
- num-slots = <1>;
+ num-slots = <1>;
- fifo-depth = <0x100>;
- bus-width = <4>;
+ fifo-depth = <0x100>;
+ bus-width = <4>;
};
sdio1: rksdmmc@ff0e0000 {
if (host->prev_blksz != data->blksz)
dw_mci_adjust_fifoth(host, data);
- temp = mci_readl(host, CTRL);
+ /* Reset DMA FIFO*/
+ temp = mci_readl(host, CTRL);
temp |= (SDMMC_CTRL_DMA_RESET | SDMMC_CTRL_FIFO_RESET);
mci_writel(host, CTRL, temp);
host->sg = NULL;
host->data = data;
+ /* Reset FIFO*/
+ temp = mci_readl(host, CTRL);
+ temp |= (SDMMC_CTRL_DMA_RESET | SDMMC_CTRL_FIFO_RESET);
+ mci_writel(host, CTRL, temp);
+
if (data->flags & MMC_DATA_READ) {
host->dir_status = DW_MCI_RECV_STATUS;
dw_mci_ctrl_rd_thld(host, data);
if (ret)
goto err_setup_bus;
+ /* Pinctrl set default iomux state to fucntion port.
+ * Fixme: DON'T TOUCH EMMC SETTING!
+ */
+ if(!(host->mmc->restrict_caps & RESTRICT_CARD_TYPE_EMMC))
+ {
+ host->pinctrl = devm_pinctrl_get(host->dev);
+ host->pins_default = pinctrl_lookup_state(host->pinctrl,PINCTRL_STATE_DEFAULT);
+ if(!host->pins_default)
+ pinctrl_select_state(host->pinctrl, host->pins_default);
+ else
+ printk("%s: Warning : No default pinctrl matched!\n",mmc_hostname(host->mmc));
+ }
+
#if defined(CONFIG_DEBUG_FS)
dw_mci_init_debugfs(slot);
#endif