linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Wan ZongShun <Vincent.Wan@amd.com>
Cc: ulf.hansson@linaro.org, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Wan ZongShun <mcuos.com@gmail.com>,
	Wan ZongShun <linux@mcuos.com>
Subject: Re: [PATCH] SDHCI: Change AMD SDHCI quirk application scope
Date: Thu, 4 Jun 2015 17:32:20 +0200	[thread overview]
Message-ID: <20150604153220.GA4521@pd.tnic> (raw)
In-Reply-To: <1433428437-6067-1-git-send-email-Vincent.Wan@amd.com>

On Thu, Jun 04, 2015 at 10:33:57PM +0800, Wan ZongShun wrote:
> From: Vincent Wan <vincent.wan@amd.com>
> 
> Change this quirk to apply to AMD Carrizo platform.
> 
> Signed-off-by: Vincent Wan <vincent.wan@amd.com>
> Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
> Signed-off-by: Wan ZongShun <linux@mcuos.com>
> 
> Tested-by: Nath, Arindam <Arindam.Nath@amd.com>
> Tested-by: Ramesh, Ramya <Ramya.Ramesh@amd.com>
> ---
>  drivers/mmc/host/sdhci-pci.c | 25 ++++++++++++++++++++++++-
>  include/linux/pci_ids.h      |  1 +
>  2 files changed, 25 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
> index f208f20..94f54d2 100644
> --- a/drivers/mmc/host/sdhci-pci.c
> +++ b/drivers/mmc/host/sdhci-pci.c
> @@ -724,14 +724,37 @@ static const struct sdhci_pci_fixes sdhci_rtsx = {
>  	.probe_slot	= rtsx_probe_slot,
>  };
>  
> +/*AMD chipset generation*/
> +enum amd_chipset_gen {
> +	AMD_CHIPSET_BEFORE_ML,
> +	AMD_CHIPSET_CZ,
> +	AMD_CHIPSET_NL,
> +	AMD_CHIPSET_UNKNOWN,
> +};
> +
>  static int amd_probe(struct sdhci_pci_chip *chip)
>  {
>  	struct pci_dev	*smbus_dev;
> +	enum amd_chipset_gen gen;
>  
>  	smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD,
>  			PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, NULL);
> +	if (smbus_dev) {
> +		gen = AMD_CHIPSET_BEFORE_ML;
> +	} else {
> +		smbus_dev = pci_get_device(PCI_VENDOR_ID_AMD,
> +				PCI_DEVICE_ID_AMD_KERNCZ_SMBUS, NULL);
> +		if (smbus_dev) {
> +			if (smbus_dev->revision < 0x51)
> +				gen = AMD_CHIPSET_CZ;
> +			else
> +				gen = AMD_CHIPSET_NL;
> +		} else {
> +			gen = AMD_CHIPSET_UNKNOWN;
> +		}
> +	}
>  
> -	if (smbus_dev && (smbus_dev->revision < 0x51)) {
> +	if ((gen == AMD_CHIPSET_BEFORE_ML) || (gen == AMD_CHIPSET_CZ)) {
>  		chip->quirks2 |= SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD;
>  		chip->quirks2 |= SDHCI_QUIRK2_BROKEN_HS200;
>  	}
> diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
> index 2f7b9a4..cb63a7b 100644
> --- a/include/linux/pci_ids.h
> +++ b/include/linux/pci_ids.h
> @@ -579,6 +579,7 @@
>  #define PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE	0x7800
>  #define PCI_DEVICE_ID_AMD_HUDSON2_SMBUS		0x780b
>  #define PCI_DEVICE_ID_AMD_HUDSON2_IDE		0x780c
> +#define PCI_DEVICE_ID_AMD_KERNCZ_SMBUS  0x790b

KERNCZ?

Also, that device id is used only in sdhci-pci.c so it should be defined
there. Only when multiple drivers/compilation units need it, then it
should go to pci_ids.h.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--

  reply	other threads:[~2015-06-04 15:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-04 14:33 [PATCH] SDHCI: Change AMD SDHCI quirk application scope Wan ZongShun
2015-06-04 15:32 ` Borislav Petkov [this message]
2015-06-05  1:37   ` Wan ZongShun
2015-06-05  9:20     ` Borislav Petkov
2015-06-05 10:01       ` Wan ZongShun
2015-06-05 13:52         ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150604153220.GA4521@pd.tnic \
    --to=bp@alien8.de \
    --cc=Vincent.Wan@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux@mcuos.com \
    --cc=mcuos.com@gmail.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).