Преглед на файлове

1.修复i2c访问carplay mfi认证芯片错误; 2.强制emmc从general purpose分区启动; 3.修复emmc写数据后sync不保存的问题

huangliang преди 2 години
родител
ревизия
c5f93ee6f4
променени са 3 файла, в които са добавени 25 реда и са изтрити 1 реда
  1. 3 1
      linux/drivers/i2c/busses/i2c-ark.c
  2. 17 0
      linux/drivers/mmc/host/dw_mmc-pltfm.c
  3. 5 0
      u-boot/common/spl/spl_mmc.c

+ 3 - 1
linux/drivers/i2c/busses/i2c-ark.c

@@ -695,7 +695,7 @@ static int ark_i2c_xfer(
 	I2C_DBG(&adap->dev, "slave address is %x\n", pmsg->addr);
 
 
-	if (i2c->status != STATUS_IDLE) {
+	if (i2c->status != STATUS_IDLE && i2c->status != STATUS_XFER_ABORT) {
 		dev_err(&adap->dev, "Adapter %d in transfer/standby\n", adap->nr);
 		mutex_unlock(&i2c->lock);
 #ifdef  CONFIG_PM_RUNTIME
@@ -747,6 +747,8 @@ static int ark_i2c_xfer(
 	/* Clear all interrupts */
 	readl(i2c->base + IC_CLR_INTR);
 
+	udelay(100);
+
 	i2c->status = STATUS_IDLE;
 	mutex_unlock(&i2c->lock);
 #ifdef  CONFIG_PM_RUNTIME

+ 17 - 0
linux/drivers/mmc/host/dw_mmc-pltfm.c

@@ -67,8 +67,25 @@ const struct dev_pm_ops dw_mci_pltfm_pmops = {
 };
 EXPORT_SYMBOL_GPL(dw_mci_pltfm_pmops);
 
+#ifdef CONFIG_SOC_ARK1668E
+static unsigned long ark_dwmmc_caps[3] = {
+	MMC_CAP_CMD23,
+	MMC_CAP_CMD23,
+	MMC_CAP_CMD23,
+};
+
+static const struct dw_mci_drv_data ark_drv_data = {
+	.caps			= ark_dwmmc_caps,
+	.num_caps		= ARRAY_SIZE(ark_dwmmc_caps),
+};
+#endif
+
 static const struct of_device_id dw_mci_pltfm_match[] = {
+#ifdef CONFIG_SOC_ARK1668E
+	{ .compatible = "snps,dw-mshc", .data = &ark_drv_data},
+#else
 	{ .compatible = "snps,dw-mshc", },
+#endif
 	{ .compatible = "altr,socfpga-dw-mshc", },
 	{ .compatible = "img,pistachio-dw-mshc", },
 	{},

+ 5 - 0
u-boot/common/spl/spl_mmc.c

@@ -321,6 +321,7 @@ int spl_mmc_load_image(struct spl_image_info *spl_image,
 	err = -EINVAL;
 	switch (boot_mode) {
 	case MMCSD_MODE_EMMCBOOT:
+#ifndef CONFIG_ARCH_ARKMICRO
 			/*
 			 * We need to check what the partition is configured to.
 			 * 1 and 2 match up to boot0 / boot1 and 7 is user data
@@ -330,6 +331,10 @@ int spl_mmc_load_image(struct spl_image_info *spl_image,
 
 			if (part == 7)
 				part = 0;
+#else
+			/* force to use general purpose partition */
+			part = 0;
+#endif
 
 			if (CONFIG_IS_ENABLED(MMC_TINY))
 				err = mmc_switch_part(mmc, part);