All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: micky_ching@realsil.com.cn
Cc: sameo@linux.intel.com, devel@linuxdriverproject.org,
	linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
	rogerable@realtek.com, wei_wang@realsil.com.cn
Subject: Re: [PATCH v3 5/9] mfd: rtsx: update phy register
Date: Wed, 25 Feb 2015 15:23:22 +0000	[thread overview]
Message-ID: <20150225152322.GL5132@x1> (raw)
In-Reply-To: <941b86cc1c6c651106faa86732a6e8756451f5fd.1424842997.git.micky_ching@realsil.com.cn>

On Wed, 25 Feb 2015, micky_ching@realsil.com.cn wrote:

> From: Micky Ching <micky_ching@realsil.com.cn>
> 
> Update some phy register name and value for rts5249,
> the updated value makes chip more stable on some platform.
> 
> Signed-off-by: Micky Ching <micky_ching@realsil.com.cn>
> ---
>  drivers/mfd/rts5249.c        |  29 +++++++-----
>  include/linux/mfd/rtsx_pci.h | 109 ++++++++++++++++++++++---------------------
>  2 files changed, 72 insertions(+), 66 deletions(-)

Acked-by: Lee Jones <lee.jones@linaro.org>

> diff --git a/drivers/mfd/rts5249.c b/drivers/mfd/rts5249.c
> index 2fe2854..8de8220 100644
> --- a/drivers/mfd/rts5249.c
> +++ b/drivers/mfd/rts5249.c
> @@ -132,11 +132,12 @@ static int rts5249_optimize_phy(struct rtsx_pcr *pcr)
>  	if (err < 0)
>  		return err;
>  
> -	err = rtsx_pci_write_phy_register(pcr, PHY_REG_REV,
> -			PHY_REG_REV_RESV | PHY_REG_REV_RXIDLE_LATCHED |
> -			PHY_REG_REV_P1_EN | PHY_REG_REV_RXIDLE_EN |
> -			PHY_REG_REV_RX_PWST | PHY_REG_REV_CLKREQ_DLY_TIMER_1_0 |
> -			PHY_REG_REV_STOP_CLKRD | PHY_REG_REV_STOP_CLKWR);
> +	err = rtsx_pci_write_phy_register(pcr, PHY_REV,
> +			PHY_REV_RESV | PHY_REV_RXIDLE_LATCHED |
> +			PHY_REV_P1_EN | PHY_REV_RXIDLE_EN |
> +			PHY_REV_CLKREQ_TX_EN | PHY_REV_RX_PWST |
> +			PHY_REV_CLKREQ_DT_1_0 | PHY_REV_STOP_CLKRD |
> +			PHY_REV_STOP_CLKWR);
>  	if (err < 0)
>  		return err;
>  
> @@ -147,19 +148,21 @@ static int rts5249_optimize_phy(struct rtsx_pcr *pcr)
>  			PHY_BPCR_IB_FILTER | PHY_BPCR_CMIRROR_EN);
>  	if (err < 0)
>  		return err;
> +
>  	err = rtsx_pci_write_phy_register(pcr, PHY_PCR,
>  			PHY_PCR_FORCE_CODE | PHY_PCR_OOBS_CALI_50 |
>  			PHY_PCR_OOBS_VCM_08 | PHY_PCR_OOBS_SEN_90 |
> -			PHY_PCR_RSSI_EN);
> +			PHY_PCR_RSSI_EN | PHY_PCR_RX10K);
>  	if (err < 0)
>  		return err;
> +
>  	err = rtsx_pci_write_phy_register(pcr, PHY_RCR2,
>  			PHY_RCR2_EMPHASE_EN | PHY_RCR2_NADJR |
> -			PHY_RCR2_CDR_CP_10 | PHY_RCR2_CDR_SR_2 |
> -			PHY_RCR2_FREQSEL_12 | PHY_RCR2_CPADJEN |
> -			PHY_RCR2_CDR_SC_8 | PHY_RCR2_CALIB_LATE);
> +			PHY_RCR2_CDR_SR_2 | PHY_RCR2_FREQSEL_12 |
> +			PHY_RCR2_CDR_SC_12P | PHY_RCR2_CALIB_LATE);
>  	if (err < 0)
>  		return err;
> +
>  	err = rtsx_pci_write_phy_register(pcr, PHY_FLD4,
>  			PHY_FLD4_FLDEN_SEL | PHY_FLD4_REQ_REF |
>  			PHY_FLD4_RXAMP_OFF | PHY_FLD4_REQ_ADDA |
> @@ -167,11 +170,12 @@ static int rts5249_optimize_phy(struct rtsx_pcr *pcr)
>  			PHY_FLD4_BER_CHK_EN);
>  	if (err < 0)
>  		return err;
> -	err = rtsx_pci_write_phy_register(pcr, PHY_RDR, PHY_RDR_RXDSEL_1_9);
> +	err = rtsx_pci_write_phy_register(pcr, PHY_RDR,
> +			PHY_RDR_RXDSEL_1_9 | PHY_SSC_AUTO_PWD);
>  	if (err < 0)
>  		return err;
>  	err = rtsx_pci_write_phy_register(pcr, PHY_RCR1,
> -			PHY_RCR1_ADP_TIME | PHY_RCR1_VCO_COARSE);
> +			PHY_RCR1_ADP_TIME_4 | PHY_RCR1_VCO_COARSE);
>  	if (err < 0)
>  		return err;
>  	err = rtsx_pci_write_phy_register(pcr, PHY_FLD3,
> @@ -179,10 +183,11 @@ static int rts5249_optimize_phy(struct rtsx_pcr *pcr)
>  			PHY_FLD3_RXDELINK);
>  	if (err < 0)
>  		return err;
> +
>  	return rtsx_pci_write_phy_register(pcr, PHY_TUNE,
>  			PHY_TUNE_TUNEREF_1_0 | PHY_TUNE_VBGSEL_1252 |
>  			PHY_TUNE_SDBUS_33 | PHY_TUNE_TUNED18 |
> -			PHY_TUNE_TUNED12);
> +			PHY_TUNE_TUNED12 | PHY_TUNE_TUNEA12);
>  }
>  
>  static int rts5249_turn_on_led(struct rtsx_pcr *pcr)
> diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h
> index 87cff60..0103210 100644
> --- a/include/linux/mfd/rtsx_pci.h
> +++ b/include/linux/mfd/rtsx_pci.h
> @@ -630,16 +630,47 @@
>  
>  /* Phy register */
>  #define PHY_PCR				0x00
> +#define   PHY_PCR_FORCE_CODE		0xB000
> +#define   PHY_PCR_OOBS_CALI_50		0x0800
> +#define   PHY_PCR_OOBS_VCM_08		0x0200
> +#define   PHY_PCR_OOBS_SEN_90		0x0040
> +#define   PHY_PCR_RSSI_EN		0x0002
> +#define   PHY_PCR_RX10K			0x0001
> +
>  #define PHY_RCR0			0x01
>  #define PHY_RCR1			0x02
> +#define   PHY_RCR1_ADP_TIME_4		0x0400
> +#define   PHY_RCR1_VCO_COARSE		0x001F
> +
>  #define PHY_RCR2			0x03
> +#define   PHY_RCR2_EMPHASE_EN		0x8000
> +#define   PHY_RCR2_NADJR		0x4000
> +#define   PHY_RCR2_CDR_SR_2		0x0100
> +#define   PHY_RCR2_FREQSEL_12		0x0040
> +#define   PHY_RCR2_CDR_SC_12P		0x0010
> +#define   PHY_RCR2_CALIB_LATE		0x0002
> +
>  #define PHY_RTCR			0x04
>  #define PHY_RDR				0x05
> +#define   PHY_RDR_RXDSEL_1_9		0x4000
> +#define   PHY_SSC_AUTO_PWD		0x0600
>  #define PHY_TCR0			0x06
>  #define PHY_TCR1			0x07
>  #define PHY_TUNE			0x08
> +#define   PHY_TUNE_TUNEREF_1_0		0x4000
> +#define   PHY_TUNE_VBGSEL_1252		0x0C00
> +#define   PHY_TUNE_SDBUS_33		0x0200
> +#define   PHY_TUNE_TUNED18		0x01C0
> +#define   PHY_TUNE_TUNED12		0X0020
> +#define   PHY_TUNE_TUNEA12		0x0004
> +
>  #define PHY_IMR				0x09
>  #define PHY_BPCR			0x0A
> +#define   PHY_BPCR_IBRXSEL		0x0400
> +#define   PHY_BPCR_IBTXSEL		0x0100
> +#define   PHY_BPCR_IB_FILTER		0x0080
> +#define   PHY_BPCR_CMIRROR_EN		0x0040
> +
>  #define PHY_BIST			0x0B
>  #define PHY_RAW_L			0x0C
>  #define PHY_RAW_H			0x0D
> @@ -654,12 +685,35 @@
>  #define PHY_BPNR			0x16
>  #define PHY_BRNR2			0x17
>  #define PHY_BENR			0x18
> -#define PHY_REG_REV			0x19
> +#define PHY_REV				0x19
> +#define   PHY_REV_RESV			0xE000
> +#define   PHY_REV_RXIDLE_LATCHED	0x1000
> +#define   PHY_REV_P1_EN			0x0800
> +#define   PHY_REV_RXIDLE_EN		0x0400
> +#define   PHY_REV_CLKREQ_TX_EN		0x0200
> +#define   PHY_REV_CLKREQ_RX_EN		0x0100
> +#define   PHY_REV_CLKREQ_DT_1_0		0x0040
> +#define   PHY_REV_STOP_CLKRD		0x0020
> +#define   PHY_REV_RX_PWST		0x0008
> +#define   PHY_REV_STOP_CLKWR		0x0004
> +
>  #define PHY_FLD0			0x1A
>  #define PHY_FLD1			0x1B
>  #define PHY_FLD2			0x1C
>  #define PHY_FLD3			0x1D
> +#define   PHY_FLD3_TIMER_4		0x0800
> +#define   PHY_FLD3_TIMER_6		0x0020
> +#define   PHY_FLD3_RXDELINK		0x0004
> +
>  #define PHY_FLD4			0x1E
> +#define   PHY_FLD4_FLDEN_SEL		0x4000
> +#define   PHY_FLD4_REQ_REF		0x2000
> +#define   PHY_FLD4_RXAMP_OFF		0x1000
> +#define   PHY_FLD4_REQ_ADDA		0x0800
> +#define   PHY_FLD4_BER_COUNT		0x00E0
> +#define   PHY_FLD4_BER_TIMER		0x000A
> +#define   PHY_FLD4_BER_CHK_EN		0x0001
> +
>  #define PHY_DUM_REG			0x1F
>  
>  #define LCTLR				0x80
> @@ -675,59 +729,6 @@
>  #define PCR_SETTING_REG2		0x814
>  #define PCR_SETTING_REG3		0x747
>  
> -/* Phy bits */
> -#define PHY_PCR_FORCE_CODE			0xB000
> -#define PHY_PCR_OOBS_CALI_50			0x0800
> -#define PHY_PCR_OOBS_VCM_08			0x0200
> -#define PHY_PCR_OOBS_SEN_90			0x0040
> -#define PHY_PCR_RSSI_EN				0x0002
> -
> -#define PHY_RCR1_ADP_TIME			0x0100
> -#define PHY_RCR1_VCO_COARSE			0x001F
> -
> -#define PHY_RCR2_EMPHASE_EN			0x8000
> -#define PHY_RCR2_NADJR				0x4000
> -#define PHY_RCR2_CDR_CP_10			0x0400
> -#define PHY_RCR2_CDR_SR_2			0x0100
> -#define PHY_RCR2_FREQSEL_12			0x0040
> -#define PHY_RCR2_CPADJEN			0x0020
> -#define PHY_RCR2_CDR_SC_8			0x0008
> -#define PHY_RCR2_CALIB_LATE			0x0002
> -
> -#define PHY_RDR_RXDSEL_1_9			0x4000
> -
> -#define PHY_TUNE_TUNEREF_1_0			0x4000
> -#define PHY_TUNE_VBGSEL_1252			0x0C00
> -#define PHY_TUNE_SDBUS_33			0x0200
> -#define PHY_TUNE_TUNED18			0x01C0
> -#define PHY_TUNE_TUNED12			0X0020
> -
> -#define PHY_BPCR_IBRXSEL			0x0400
> -#define PHY_BPCR_IBTXSEL			0x0100
> -#define PHY_BPCR_IB_FILTER			0x0080
> -#define PHY_BPCR_CMIRROR_EN			0x0040
> -
> -#define PHY_REG_REV_RESV			0xE000
> -#define PHY_REG_REV_RXIDLE_LATCHED		0x1000
> -#define PHY_REG_REV_P1_EN			0x0800
> -#define PHY_REG_REV_RXIDLE_EN			0x0400
> -#define PHY_REG_REV_CLKREQ_DLY_TIMER_1_0	0x0040
> -#define PHY_REG_REV_STOP_CLKRD			0x0020
> -#define PHY_REG_REV_RX_PWST			0x0008
> -#define PHY_REG_REV_STOP_CLKWR			0x0004
> -
> -#define PHY_FLD3_TIMER_4			0x7800
> -#define PHY_FLD3_TIMER_6			0x00E0
> -#define PHY_FLD3_RXDELINK			0x0004
> -
> -#define PHY_FLD4_FLDEN_SEL			0x4000
> -#define PHY_FLD4_REQ_REF			0x2000
> -#define PHY_FLD4_RXAMP_OFF			0x1000
> -#define PHY_FLD4_REQ_ADDA			0x0800
> -#define PHY_FLD4_BER_COUNT			0x00E0
> -#define PHY_FLD4_BER_TIMER			0x000A
> -#define PHY_FLD4_BER_CHK_EN			0x0001
> -
>  #define rtsx_pci_init_cmd(pcr)		((pcr)->ci = 0)
>  
>  struct rtsx_pcr;

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2015-02-25 15:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-25  5:50 [PATCH v3 0/9] mfd: rtsx: add support for new rts524A and rts525A micky_ching
2015-02-25  5:50 ` [PATCH v3 1/9] mfd: rtsx: replace TAB by SPC after #define micky_ching
2015-02-25 15:24   ` Lee Jones
2015-02-25  5:50 ` [PATCH v3 2/9] mfd: rtsx: place register address and values togather micky_ching
2015-02-25 15:24   ` Lee Jones
2015-02-25  5:50 ` [PATCH v3 3/9] mfd: rtsx: update PETXCFG address micky_ching
2015-02-25 15:24   ` Lee Jones
2015-02-25  5:50 ` [PATCH v3 4/9] mfd: rtsx: update driving settings micky_ching
2015-02-25 15:25   ` Lee Jones
2015-02-25  5:50 ` [PATCH v3 5/9] mfd: rtsx: update phy register micky_ching
2015-02-25 15:23   ` Lee Jones [this message]
2015-02-25 15:25   ` Lee Jones
2015-02-25  5:50 ` [PATCH v3 6/9] mfd: rtsx: remove LCTLR defination micky_ching
2015-02-25 15:25   ` Lee Jones
2015-02-25  5:50 ` [PATCH v3 7/9] mfd: rtsx: add support for rts524A micky_ching
2015-02-25 15:22   ` Lee Jones
2015-02-25 15:25   ` Lee Jones
2015-02-25  5:50 ` [PATCH v3 8/9] mfd: rtsx: add support for rts525A micky_ching
2015-02-25 15:20   ` Lee Jones
2015-02-25 15:26   ` Lee Jones
2015-02-25  5:50 ` [PATCH v3 9/9] mfd: rtsx: using pcr_dbg replace dev_dbg micky_ching
2015-02-25 15:26   ` Lee Jones

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=20150225152322.GL5132@x1 \
    --to=lee.jones@linaro.org \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=micky_ching@realsil.com.cn \
    --cc=rogerable@realtek.com \
    --cc=sameo@linux.intel.com \
    --cc=wei_wang@realsil.com.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.