Skip to contentSkip to conversation

Revert "x86: Convert MMC to driver model"

PATCH New Bin Meng 2 participants 3 messages Jun 26, 2017 – Jun 27, 2017

Subsystems (2)
lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/1 Revert "x86: Convert MMC to driver model"

This reverts commit ddb3ac3c716f56cead695444e65a7ba7b0946555.

With MMC converted to driver model, SCSI driver is broken due to zero address access at (ops->read) in block_dread() function.

The fix (SCSI driver converted to DM) is ready in u-boot-dm branch, but it is too late for this relese to get that in.

---

 arch/Kconfig                       |  1 -
 arch/x86/cpu/baytrail/valleyview.c | 12 ++++++
 arch/x86/cpu/quark/quark.c         | 10 +++++
 arch/x86/cpu/queensbay/Makefile    |  2 +-
 arch/x86/cpu/queensbay/topcliff.c  | 20 +++++++++
 drivers/mmc/pci_mmc.c              | 86 ++++++++++++--------------------------
 include/mmc.h                      | 12 ++++++
 7 files changed, 81 insertions(+), 62 deletions(-)
 create mode 100644 arch/x86/cpu/queensbay/topcliff.c
arch/Kconfig +0 -1
index e447671..d04ab9f 100644
@@ -96,7 +96,6 @@ config X86
 	select DM_SPI
 	select DM_SPI_FLASH
 	select USB_EHCI_HCD
-	select DM_MMC if MMC
 	imply CMD_FPGA_LOADMK
 	imply CMD_GETTIME
 	imply CMD_IO
arch/x86/cpu/baytrail/valleyview.c +12 -0
index c58f6a8..87ba849 100644
@@ -11,6 +11,18 @@
 #include <asm/mrccache.h>
 #include <asm/post.h>
 
+static struct pci_device_id mmc_supported[] = {
+	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT_SDIO },
+	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT_SD },
+	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BYT_EMMC2 },
+	{},
+};
+
+int cpu_mmc_init(bd_t *bis)
+{
+	return pci_mmc_init("ValleyView SDHCI", mmc_supported);
+}
+
 #ifndef CONFIG_EFI_APP
 int arch_cpu_init(void)
 {
arch/x86/cpu/quark/quark.c +10 -0
index c36a589..0c2cea4 100644
@@ -16,6 +16,11 @@
 #include <asm/arch/msg_port.h>
 #include <asm/arch/quark.h>
 
+static struct pci_device_id mmc_supported[] = {
+	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_QRK_SDIO },
+	{},
+};
+
 static void quark_setup_mtrr(void)
 {
 	u32 base, mask;
@@ -323,6 +328,11 @@ int arch_early_init_r(void)
 	return 0;
 }
 
+int cpu_mmc_init(bd_t *bis)
+{
+	return pci_mmc_init("Quark SDHCI", mmc_supported);
+}
+
 int arch_misc_init(void)
 {
 #ifdef CONFIG_ENABLE_MRC_CACHE
arch/x86/cpu/queensbay/Makefile +1 -1
index c068199..af3ffad 100644
@@ -5,4 +5,4 @@
 #
 
 obj-y += fsp_configs.o irq.o
-obj-y += tnc.o
+obj-y += tnc.o topcliff.o
arch/x86/cpu/queensbay/topcliff.c new file +20 -0
new file mode 100644
index 0000000..b76dd7d
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2014, Bin Meng <[email protected]>
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <mmc.h>
+#include <pci_ids.h>
+
+static struct pci_device_id mmc_supported[] = {
+	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TCF_SDIO_0 },
+	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TCF_SDIO_1 },
+	{},
+};
+
+int cpu_mmc_init(bd_t *bis)
+{
+	return pci_mmc_init("Topcliff SDHCI", mmc_supported);
+}
drivers/mmc/pci_mmc.c +26 -60

97 lines not on this page · raw message

include/mmc.h +12 -0
index 6a0ea0a..00576fa 100644
@@ -585,6 +585,18 @@ int cpu_mmc_init(bd_t *bis);
 int mmc_get_env_addr(struct mmc *mmc, int copy, u32 *env_addr);
 int mmc_get_env_dev(void);
 
+struct pci_device_id;
+
+/**
+ * pci_mmc_init() - set up PCI MMC devices
+ *
+ * This finds all the matching PCI IDs and sets them up as MMC devices.
+ *
+ * @name:		Name to use for devices
+ * @mmc_supported:	PCI IDs to search for, terminated by {0, 0}
+ */
+int pci_mmc_init(const char *name, struct pci_device_id *mmc_supported);
+
 /* Set block count limit because of 16 bit register limit on some hardware*/
 #ifndef CONFIG_SYS_MMC_MAX_BLK_COUNT
 #define CONFIG_SYS_MMC_MAX_BLK_COUNT 65535
Signature · 1 line
2.9.2
#1 lore raw

PATCH 1/1 Revert "x86: Convert MMC to driver model"

Quoted 18 lines · Bin Meng

This reverts commit ddb3ac3c716f56cead695444e65a7ba7b0946555.

With MMC converted to driver model, SCSI driver is broken due to zero address access at (ops->read) in block_dread() function.

The fix (SCSI driver converted to DM) is ready in u-boot-dm branch, but it is too late for this relese to get that in.

---

arch/Kconfig | 1 -
arch/x86/cpu/baytrail/valleyview.c | 12 ++++++ arch/x86/cpu/quark/quark.c | 10 +++++ arch/x86/cpu/queensbay/Makefile | 2 +- arch/x86/cpu/queensbay/topcliff.c | 20 +++++++++ drivers/mmc/pci_mmc.c | 86 ++++++++++++-------------------------- include/mmc.h | 12 ++++++

Quoted 2 lines
7 files changed, 81 insertions(+), 62 deletions(-)

create mode 100644 arch/x86/cpu/queensbay/topcliff.c

author
#2 lore raw

PATCH 1/1 Revert "x86: Convert MMC to driver model"

Quoted 22 lines · Simon Glass
Quoted 18 lines · Bin Meng

This reverts commit ddb3ac3c716f56cead695444e65a7ba7b0946555.

With MMC converted to driver model, SCSI driver is broken due to zero address access at (ops->read) in block_dread() function.

The fix (SCSI driver converted to DM) is ready in u-boot-dm branch, but it is too late for this relese to get that in.

---

arch/Kconfig | 1 -
arch/x86/cpu/baytrail/valleyview.c | 12 ++++++ arch/x86/cpu/quark/quark.c | 10 +++++ arch/x86/cpu/queensbay/Makefile | 2 +- arch/x86/cpu/queensbay/topcliff.c | 20 +++++++++ drivers/mmc/pci_mmc.c | 86 ++++++++++++-------------------------- include/mmc.h | 12 ++++++

Quoted 2 lines
7 files changed, 81 insertions(+), 62 deletions(-)

create mode 100644 arch/x86/cpu/queensbay/topcliff.c

Quoted 1 line

applied to u-boot-x86, thanks!