Re: [U-Boot] [PATCH v7 15/23] rockchip: mmc: use non-removable property to distinguish emmc and sdcard register
On 17 November 2015 at 18:37, Lin Huangwrote: > emmc and sdcard have different register address, use non-removeable property > to distinguish them. > > Signed-off-by: Lin Huang > --- > Changes in v1: None > Changes in v2: None > Changes in v3: None > Changes in v4: None > Changes in v5: None > Changes in v6: None > Changes in v7: > - Adviced by Simon: > - use fdtdec_get_bool() to get property > > drivers/mmc/rockchip_dw_mmc.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c > index f11c8e0..dfe20f9 100644 > --- a/drivers/mmc/rockchip_dw_mmc.c > +++ b/drivers/mmc/rockchip_dw_mmc.c > @@ -50,8 +50,9 @@ static int rockchip_dwmmc_ofdata_to_platdata(struct udevice > *dev) > host->get_mmc_clk = rockchip_dwmmc_get_mmc_clk; > host->priv = dev; > > - /* TODO(s...@chromium.org): Remove the need for this hack */ > - host->dev_index = (ulong)host->ioaddr == 0xff0f ? 0 : 1; > + /* use non-removeable as sdcard and emmc as judgement */ > + if (fdtdec_get_bool(gd->fdt_blob, dev->of_offset, "non-removable")) > + host->dev_index = 1; > > return 0; > } > -- > 1.9.1 > Acked-by: Simon Glass ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v7 15/23] rockchip: mmc: use non-removable property to distinguish emmc and sdcard register
emmc and sdcard have different register address, use non-removeable property to distinguish them. Signed-off-by: Lin Huang--- Changes in v1: None Changes in v2: None Changes in v3: None Changes in v4: None Changes in v5: None Changes in v6: None Changes in v7: - Adviced by Simon: - use fdtdec_get_bool() to get property drivers/mmc/rockchip_dw_mmc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c index f11c8e0..dfe20f9 100644 --- a/drivers/mmc/rockchip_dw_mmc.c +++ b/drivers/mmc/rockchip_dw_mmc.c @@ -50,8 +50,9 @@ static int rockchip_dwmmc_ofdata_to_platdata(struct udevice *dev) host->get_mmc_clk = rockchip_dwmmc_get_mmc_clk; host->priv = dev; - /* TODO(s...@chromium.org): Remove the need for this hack */ - host->dev_index = (ulong)host->ioaddr == 0xff0f ? 0 : 1; + /* use non-removeable as sdcard and emmc as judgement */ + if (fdtdec_get_bool(gd->fdt_blob, dev->of_offset, "non-removable")) + host->dev_index = 1; return 0; } -- 1.9.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot