Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu Kernel Team (http://www.linux-archive.org/ubuntu-kernel-team/)
-   -   mmc: Added quirks for Ricoh 1180:e823 lower base clock frequency (http://www.linux-archive.org/ubuntu-kernel-team/556762-mmc-added-quirks-ricoh-1180-e823-lower-base-clock-frequency.html)

Manoj Iyer 07-25-2011 04:22 PM

mmc: Added quirks for Ricoh 1180:e823 lower base clock frequency
 
Ricoh 1180:e823 does not recognize certain types of SD/MMC cards,
as reported at http://launchpad.net/bugs/773524. Lowering the SD
base clock frequency from 200Mhz to 50Mhz fixes this issue. This
solution was suggest by Koji Matsumuro, Ricoh Company, Ltd.

This change has no negative performance effect on standard SD
cards, though it's quite possible that there will be one on
UHS-1 cards.

Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Tested-by: Daniel Manrique <daniel.manrique@canonical.com>
Cc: Koji Matsumuro <matsumur@nts.ricoh.co.jp>
Cc: <stable@kernel.org>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
(cherry picked from commit 15bed0f2fa8e1d7db201692532c210a7823d2d21)

Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
---
drivers/pci/quirks.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index a1e4f61..b1c312e 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2755,6 +2755,29 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)

dev_notice(&dev->dev, "proprietary Ricoh MMC controller disabled (via firewire function)
");
dev_notice(&dev->dev, "MMC cards are now supported by standard SDHCI controller
");
+
+ /*
+ * RICOH 0xe823 SD/MMC card reader fails to recognize
+ * certain types of SD/MMC cards. Lowering the SD base
+ * clock frequency from 200Mhz to 50Mhz fixes this issue.
+ *
+ * 0x150 - SD2.0 mode enable for changing base clock
+ * frequency to 50Mhz
+ * 0xe1 - Base clock frequency
+ * 0x32 - 50Mhz new clock frequency
+ * 0xf9 - Key register for 0x150
+ * 0xfc - key register for 0xe1
+ */
+ if (dev->device == PCI_DEVICE_ID_RICOH_R5CE823) {
+ pci_write_config_byte(dev, 0xf9, 0xfc);
+ pci_write_config_byte(dev, 0x150, 0x10);
+ pci_write_config_byte(dev, 0xf9, 0x00);
+ pci_write_config_byte(dev, 0xfc, 0x01);
+ pci_write_config_byte(dev, 0xe1, 0x32);
+ pci_write_config_byte(dev, 0xfc, 0x00);
+
+ dev_notice(&dev->dev, "MMC controller base frequency changed to 50Mhz.
");
+ }
}
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH , PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
--
1.7.4.1


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team

Manoj Iyer 07-25-2011 04:22 PM

mmc: Added quirks for Ricoh 1180:e823 lower base clock frequency
 
Ricoh 1180:e823 does not recognize certain types of SD/MMC cards,
as reported at http://launchpad.net/bugs/773524. Lowering the SD
base clock frequency from 200Mhz to 50Mhz fixes this issue. This
solution was suggest by Koji Matsumuro, Ricoh Company, Ltd.

This change has no negative performance effect on standard SD
cards, though it's quite possible that there will be one on
UHS-1 cards.

Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Tested-by: Daniel Manrique <daniel.manrique@canonical.com>
Cc: Koji Matsumuro <matsumur@nts.ricoh.co.jp>
Cc: <stable@kernel.org>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
(cherry picked from commit 15bed0f2fa8e1d7db201692532c210a7823d2d21)

Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
---
drivers/pci/quirks.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index a1e4f61..b1c312e 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2755,6 +2755,29 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)

dev_notice(&dev->dev, "proprietary Ricoh MMC controller disabled (via firewire function)
");
dev_notice(&dev->dev, "MMC cards are now supported by standard SDHCI controller
");
+
+ /*
+ * RICOH 0xe823 SD/MMC card reader fails to recognize
+ * certain types of SD/MMC cards. Lowering the SD base
+ * clock frequency from 200Mhz to 50Mhz fixes this issue.
+ *
+ * 0x150 - SD2.0 mode enable for changing base clock
+ * frequency to 50Mhz
+ * 0xe1 - Base clock frequency
+ * 0x32 - 50Mhz new clock frequency
+ * 0xf9 - Key register for 0x150
+ * 0xfc - key register for 0xe1
+ */
+ if (dev->device == PCI_DEVICE_ID_RICOH_R5CE823) {
+ pci_write_config_byte(dev, 0xf9, 0xfc);
+ pci_write_config_byte(dev, 0x150, 0x10);
+ pci_write_config_byte(dev, 0xf9, 0x00);
+ pci_write_config_byte(dev, 0xfc, 0x01);
+ pci_write_config_byte(dev, 0xe1, 0x32);
+ pci_write_config_byte(dev, 0xfc, 0x00);
+
+ dev_notice(&dev->dev, "MMC controller base frequency changed to 50Mhz.
");
+ }
}
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH , PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
--
1.7.4.1


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team

Manoj Iyer 07-25-2011 04:38 PM

mmc: Added quirks for Ricoh 1180:e823 lower base clock frequency
 
Ricoh 1180:e823 does not recognize certain types of SD/MMC cards,
as reported at http://launchpad.net/bugs/773524. Lowering the SD
base clock frequency from 200Mhz to 50Mhz fixes this issue. This
solution was suggest by Koji Matsumuro, Ricoh Company, Ltd.

This change has no negative performance effect on standard SD
cards, though it's quite possible that there will be one on
UHS-1 cards.

Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Tested-by: Daniel Manrique <daniel.manrique@canonical.com>
Cc: Koji Matsumuro <matsumur@nts.ricoh.co.jp>
Cc: <stable@kernel.org>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
(cherry picked from commit 15bed0f2fa8e1d7db201692532c210a7823d2d21)

Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
---
drivers/pci/quirks.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index a1e4f61..b1c312e 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2755,6 +2755,29 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)

dev_notice(&dev->dev, "proprietary Ricoh MMC controller disabled (via firewire function)
");
dev_notice(&dev->dev, "MMC cards are now supported by standard SDHCI controller
");
+
+ /*
+ * RICOH 0xe823 SD/MMC card reader fails to recognize
+ * certain types of SD/MMC cards. Lowering the SD base
+ * clock frequency from 200Mhz to 50Mhz fixes this issue.
+ *
+ * 0x150 - SD2.0 mode enable for changing base clock
+ * frequency to 50Mhz
+ * 0xe1 - Base clock frequency
+ * 0x32 - 50Mhz new clock frequency
+ * 0xf9 - Key register for 0x150
+ * 0xfc - key register for 0xe1
+ */
+ if (dev->device == PCI_DEVICE_ID_RICOH_R5CE823) {
+ pci_write_config_byte(dev, 0xf9, 0xfc);
+ pci_write_config_byte(dev, 0x150, 0x10);
+ pci_write_config_byte(dev, 0xf9, 0x00);
+ pci_write_config_byte(dev, 0xfc, 0x01);
+ pci_write_config_byte(dev, 0xe1, 0x32);
+ pci_write_config_byte(dev, 0xfc, 0x00);
+
+ dev_notice(&dev->dev, "MMC controller base frequency changed to 50Mhz.
");
+ }
}
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH , PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
--
1.7.4.1


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team

Andy Whitcroft 07-25-2011 06:27 PM

mmc: Added quirks for Ricoh 1180:e823 lower base clock frequency
 
On Mon, Jul 25, 2011 at 11:22:26AM -0500, Manoj Iyer wrote:
> Ricoh 1180:e823 does not recognize certain types of SD/MMC cards,
> as reported at http://launchpad.net/bugs/773524. Lowering the SD
> base clock frequency from 200Mhz to 50Mhz fixes this issue. This
> solution was suggest by Koji Matsumuro, Ricoh Company, Ltd.
>
> This change has no negative performance effect on standard SD
> cards, though it's quite possible that there will be one on
> UHS-1 cards.
>
> Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
> Tested-by: Daniel Manrique <daniel.manrique@canonical.com>
> Cc: Koji Matsumuro <matsumur@nts.ricoh.co.jp>
> Cc: <stable@kernel.org>
> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> Signed-off-by: Chris Ball <cjb@laptop.org>
> (cherry picked from commit 15bed0f2fa8e1d7db201692532c210a7823d2d21)
>
> Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>

No BugLink:

> ---
> drivers/pci/quirks.c | 23 +++++++++++++++++++++++
> 1 files changed, 23 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index a1e4f61..b1c312e 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -2755,6 +2755,29 @@ static void ricoh_mmc_fixup_r5c832(struct pci_dev *dev)
>
> dev_notice(&dev->dev, "proprietary Ricoh MMC controller disabled (via firewire function)
");
> dev_notice(&dev->dev, "MMC cards are now supported by standard SDHCI controller
");
> +
> + /*
> + * RICOH 0xe823 SD/MMC card reader fails to recognize
> + * certain types of SD/MMC cards. Lowering the SD base
> + * clock frequency from 200Mhz to 50Mhz fixes this issue.
> + *
> + * 0x150 - SD2.0 mode enable for changing base clock
> + * frequency to 50Mhz
> + * 0xe1 - Base clock frequency
> + * 0x32 - 50Mhz new clock frequency
> + * 0xf9 - Key register for 0x150
> + * 0xfc - key register for 0xe1

This bit of commentary (last two) feels a little like its not telling me
anything.

> + */
> + if (dev->device == PCI_DEVICE_ID_RICOH_R5CE823) {
> + pci_write_config_byte(dev, 0xf9, 0xfc);
> + pci_write_config_byte(dev, 0x150, 0x10);
> + pci_write_config_byte(dev, 0xf9, 0x00);
> + pci_write_config_byte(dev, 0xfc, 0x01);
> + pci_write_config_byte(dev, 0xe1, 0x32);
> + pci_write_config_byte(dev, 0xfc, 0x00);
> +
> + dev_notice(&dev->dev, "MMC controller base frequency changed to 50Mhz.
");
> + }
> }
> DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
> DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH , PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);

Other than the BugLink: it seems to do what it says. Therefore:

Acked-by: Andy Whitcroft <apw@canonical.com>

-apw

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team


All times are GMT. The time now is 06:30 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.