Skip to content

Commit 71ed3e4

Browse files
committed
fixed there is no eMMC if user boot from sdcard with jumper
Change-Id: Icebb8574245688c5bd9e49a7c292629c7cc6b0ff Reviewed-on: https://tp-biosrd-v02/gerrit/81136 Reviewed-by: Jamess Huang(黃以民) <[email protected]> Tested-by: Jamess Huang(黃以民) <[email protected]>
1 parent 19d99d8 commit 71ed3e4

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

arch/arm/boot/dts/rk3288.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@
347347
fifo-depth = <0x100>;
348348
interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
349349
reg = <0x0 0xff0f0000 0x0 0x4000>;
350+
maskrom_gpio = <&gpio6 7 GPIO_ACTIVE_HIGH>;
350351
status = "okay";
351352
supports-emmc;
352353
};

drivers/mmc/host/dw_mmc-rockchip.c

100644100755
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
#include "dw_mmc.h"
2121
#include "dw_mmc-pltfm.h"
2222

23+
#include <dt-bindings/gpio/gpio.h>
24+
#ifdef CONFIG_OF
25+
#include <linux/of_gpio.h>
26+
#endif
27+
28+
2329
#define RK3288_CLKGEN_DIV 2
2430

2531
struct dw_mci_rockchip_priv_data {
@@ -232,12 +238,26 @@ static int dw_mci_rk3288_parse_dt(struct dw_mci *host)
232238

233239
static int dw_mci_rockchip_init(struct dw_mci *host)
234240
{
241+
struct device_node *np = host->dev->of_node;
242+
int gpio;
243+
enum of_gpio_flags flags;
244+
235245
/* It is slot 8 on Rockchip SoCs */
236246
host->sdio_id0 = 8;
237247

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

251+
gpio = of_get_named_gpio_flags(np, "maskrom_gpio", 0, &flags);
252+
253+
if (gpio_is_valid(gpio)) {
254+
if(!gpio_request(gpio, "maskrom_gpio")) {
255+
gpio_direction_output(gpio, (flags==GPIO_ACTIVE_HIGH)?1:0);
256+
gpio_free(gpio);
257+
mdelay(10);
258+
dev_info(host->dev, "set maskrom gpio to enable emmc\n");
259+
}
260+
}
241261
return 0;
242262
}
243263

0 commit comments

Comments
 (0)