All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] FSL PCI: Configure PCIe reference ratio
Date: Tue, 21 Nov 2017 18:39:59 +0000	[thread overview]
Message-ID: <1511289598.4775.161.camel@infinera.com> (raw)
In-Reply-To: <VI1PR04MB2078B44BD2D7BED32A9502559A230@VI1PR04MB2078.eurprd04.prod.outlook.com>

On Tue, 2017-11-21 at 18:35 +0000, York Sun wrote:
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> 
> On 11/21/2017 10:20 AM, Joakim Tjernlund wrote:
> > On Tue, 2017-11-21 at 18:04 +0000, York Sun wrote:
> > > 
> > > 
> > > On 11/21/2017 09:52 AM, Joakim Tjernlund wrote:
> > > > On Tue, 2017-11-21 at 17:45 +0000, York Sun wrote:
> > > > > 
> > > > > On 11/21/2017 09:41 AM, Joakim Tjernlund wrote:
> > > > > > On Tue, 2017-11-21 at 17:32 +0000, York Sun wrote:
> > > > > > > CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
> > > > > > > 
> > > > > > > 
> > > > > > > On 11/21/2017 09:29 AM, Joakim Tjernlund wrote:
> > > > > > > > On Tue, 2017-11-21 at 17:23 +0000, York Sun wrote:
> > > > > > > > > CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > On 11/21/2017 09:18 AM, Joakim Tjernlund wrote:
> > > > > > > > > > On Tue, 2017-09-12 at 19:56 +0200, Joakim Tjernlund wrote:
> > > > > > > > > > > Most FSL PCIe controllers expects 333 MHz PCI reference clock.
> > > > > > > > > > > This clock is derived from the CCB but in many cases the ref.
> > > > > > > > > > > clock is not 333 MHz and a divisor needs to be configured.
> > > > > > > > > > > 
> > > > > > > > > > > This adds PEX_CCB_DIV #define which can be defined for each
> > > > > > > > > > > type of CPU/platform.
> > > > > > > > > > > 
> > > > > > > > > > > Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
> > > > > > > > > > > ---
> > > > > > > > > > >  drivers/pci/fsl_pci_init.c | 6 ++++++
> > > > > > > > > > >  1 file changed, 6 insertions(+)
> > > > > > > > > > > 
> > > > > > > > > > > diff --git a/drivers/pci/fsl_pci_init.c b/drivers/pci/fsl_pci_init.c
> > > > > > > > > > > index 52792dcd59..4d00b3f26c 100644
> > > > > > > > > > > --- a/drivers/pci/fsl_pci_init.c
> > > > > > > > > > > +++ b/drivers/pci/fsl_pci_init.c
> > > > > > > > > > > @@ -322,6 +322,12 @@ void fsl_pci_init(struct pci_controller *hose, struct fsl_pci_info *pci_info)
> > > > > > > > > > > 
> > > > > > > > > > >      pci_setup_indirect(hose, cfg_addr, cfg_data);
> > > > > > > > > > > 
> > > > > > > > > > > +#ifdef PEX_CCB_DIV
> > > > > > > > > > > +    /* Configure the PCIE controller core clock ratio */
> > > > > > > > > > > +    pci_hose_write_config_dword(hose, dev, 0x440,
> > > > > > > > > > > +                                ((gd->bus_clk / 1000000) *
> > > > > > > > > > > +                                 (16 / PEX_CCB_DIV)) / 333);
> > > > > > > > > > > +#endif
> > > 
> > > 
> > > 
> > > I took another look at this patch. Would it be appropriate to alway
> > > write to this register with correct clock?
> > 
> > I sure hope so, the docs I have only mentions this reg having a default value which
> > needs to be changed in most cases I guess.
> 
> 
> The only case we don't need to set this register is when the actual
> clock is 333MHz. I wonder why we didn't have a problem so far. Maybe we
> just didn't realize it.

Have you tried higher PCI speeds? I remember a board we had didn't work with higher
speeds so we settled for less than max. Don't hav the board handy now.

 Jocke

  reply	other threads:[~2017-11-21 18:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-12 17:56 [U-Boot] [PATCH] FSL PCI: Configure PCIe reference ratio Joakim Tjernlund
2017-09-14 21:15 ` York Sun
2017-09-15  6:14   ` Mingkai Hu
2017-11-21 17:18 ` Joakim Tjernlund
2017-11-21 17:23   ` York Sun
2017-11-21 17:29     ` Joakim Tjernlund
2017-11-21 17:32       ` York Sun
2017-11-21 17:41         ` Joakim Tjernlund
2017-11-21 17:45           ` York Sun
2017-11-21 17:51             ` Joakim Tjernlund
2017-11-21 18:04               ` York Sun
2017-11-21 18:20                 ` Joakim Tjernlund
2017-11-21 18:35                   ` York Sun
2017-11-21 18:39                     ` Joakim Tjernlund [this message]
2017-11-21 18:41                       ` York Sun
2018-02-27 19:30                   ` York Sun
2018-02-27 19:52                     ` Joakim Tjernlund
2018-02-27 19:54                       ` York Sun
2018-08-02 22:38                         ` Joakim Tjernlund
2018-08-02 22:43                           ` York Sun
2018-08-13 16:29 ` York Sun

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=1511289598.4775.161.camel@infinera.com \
    --to=joakim.tjernlund@infinera.com \
    --cc=u-boot@lists.denx.de \
    /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.