Skip to content

Commit

Permalink
fixed there is no eMMC if user boot from sdcard with jumper
Browse files Browse the repository at this point in the history
Change-Id: Icebb8574245688c5bd9e49a7c292629c7cc6b0ff
Reviewed-on: https://tp-biosrd-v02/gerrit/81136
Reviewed-by: Jamess Huang(黃以民) <[email protected]>
Tested-by: Jamess Huang(黃以民) <[email protected]>
  • Loading branch information
jamess-huang committed Oct 20, 2017
1 parent 19d99d8 commit 71ed3e4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/boot/dts/rk3288.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@
fifo-depth = <0x100>;
interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
reg = <0x0 0xff0f0000 0x0 0x4000>;
maskrom_gpio = <&gpio6 7 GPIO_ACTIVE_HIGH>;
status = "okay";
supports-emmc;
};
Expand Down
20 changes: 20 additions & 0 deletions drivers/mmc/host/dw_mmc-rockchip.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
#include "dw_mmc.h"
#include "dw_mmc-pltfm.h"

#include <dt-bindings/gpio/gpio.h>
#ifdef CONFIG_OF
#include <linux/of_gpio.h>
#endif


#define RK3288_CLKGEN_DIV 2

struct dw_mci_rockchip_priv_data {
Expand Down Expand Up @@ -232,12 +238,26 @@ static int dw_mci_rk3288_parse_dt(struct dw_mci *host)

static int dw_mci_rockchip_init(struct dw_mci *host)
{
struct device_node *np = host->dev->of_node;
int gpio;
enum of_gpio_flags flags;

/* It is slot 8 on Rockchip SoCs */
host->sdio_id0 = 8;

/* It needs this quirk on all Rockchip SoCs */
host->pdata->quirks |= DW_MCI_QUIRK_BROKEN_DTO;

gpio = of_get_named_gpio_flags(np, "maskrom_gpio", 0, &flags);

if (gpio_is_valid(gpio)) {
if(!gpio_request(gpio, "maskrom_gpio")) {
gpio_direction_output(gpio, (flags==GPIO_ACTIVE_HIGH)?1:0);
gpio_free(gpio);
mdelay(10);
dev_info(host->dev, "set maskrom gpio to enable emmc\n");
}
}
return 0;
}

Expand Down

0 comments on commit 71ed3e4

Please sign in to comment.