* [PATCH] mmc: zynq_sdhci: Dll reset only for ZynqMP platform @ 2023-07-10 12:11 ` Michal Simek 2023-07-11 5:00 ` Jaehoon Chung 2023-07-17 9:21 ` Michal Simek 0 siblings, 2 replies; 5+ messages in thread From: Michal Simek @ 2023-07-10 12:11 UTC (permalink / raw) To: u-boot, git; +Cc: Ashok Reddy Soma, Jaehoon Chung, Peng Fan From: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Dll reset is needed only for ZynqMP platforms, add condition in tuning to call arasan_zynqmp_dll_reset() just for ZynqMP platforms. On other platforms like Versal NET, If this condition is not added, we see PLM error messages when dll reset smc is called. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Signed-off-by: Michal Simek <michal.simek@amd.com> --- drivers/mmc/zynq_sdhci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c index e779251ce34f..935540d17194 100644 --- a/drivers/mmc/zynq_sdhci.c +++ b/drivers/mmc/zynq_sdhci.c @@ -422,7 +422,8 @@ static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) mdelay(1); - arasan_zynqmp_dll_reset(host, priv->node_id); + if (device_is_compatible(mmc->dev, "xlnx,zynqmp-8.9a")) + arasan_zynqmp_dll_reset(host, priv->node_id); sdhci_writel(host, SDHCI_INT_DATA_AVAIL, SDHCI_INT_ENABLE); sdhci_writel(host, SDHCI_INT_DATA_AVAIL, SDHCI_SIGNAL_ENABLE); @@ -468,7 +469,9 @@ static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) } udelay(1); - arasan_zynqmp_dll_reset(host, priv->node_id); + + if (device_is_compatible(mmc->dev, "xlnx,zynqmp-8.9a")) + arasan_zynqmp_dll_reset(host, priv->node_id); /* Enable only interrupts served by the SD controller */ sdhci_writel(host, SDHCI_INT_DATA_MASK | SDHCI_INT_CMD_MASK, -- 2.36.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [PATCH] mmc: zynq_sdhci: Dll reset only for ZynqMP platform 2023-07-10 12:11 ` [PATCH] mmc: zynq_sdhci: Dll reset only for ZynqMP platform Michal Simek @ 2023-07-11 5:00 ` Jaehoon Chung 2023-07-11 6:28 ` Michal Simek 2023-07-17 9:21 ` Michal Simek 1 sibling, 1 reply; 5+ messages in thread From: Jaehoon Chung @ 2023-07-11 5:00 UTC (permalink / raw) To: 'Michal Simek', u-boot, git Cc: 'Ashok Reddy Soma', 'Peng Fan' Hi, > -----Original Message----- > From: Michal Simek <michal.simek@amd.com> > Sent: Monday, July 10, 2023 9:12 PM > To: u-boot@lists.denx.de; git@xilinx.com > Cc: Ashok Reddy Soma <ashok.reddy.soma@amd.com>; Jaehoon Chung <jh80.chung@samsung.com>; Peng Fan > <peng.fan@nxp.com> > Subject: [PATCH] mmc: zynq_sdhci: Dll reset only for ZynqMP platform > > From: Ashok Reddy Soma <ashok.reddy.soma@amd.com> > > Dll reset is needed only for ZynqMP platforms, add condition in tuning > to call arasan_zynqmp_dll_reset() just for ZynqMP platforms. > > On other platforms like Versal NET, If this condition is not added, we > see PLM error messages when dll reset smc is called. > > Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> > Signed-off-by: Michal Simek <michal.simek@amd.com> > --- > > drivers/mmc/zynq_sdhci.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c > index e779251ce34f..935540d17194 100644 > --- a/drivers/mmc/zynq_sdhci.c > +++ b/drivers/mmc/zynq_sdhci.c > @@ -422,7 +422,8 @@ static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) > > mdelay(1); > > - arasan_zynqmp_dll_reset(host, priv->node_id); > + if (device_is_compatible(mmc->dev, "xlnx,zynqmp-8.9a")) > + arasan_zynqmp_dll_reset(host, priv->node_id); How about using local variable to check whether it needs to reset or not? It's not efficient to call device_is_compatible() everytime. (I'm not sure that it will be added more in future.) e.g) bool reset = device_is_compatible(mmc->dev, "xlx,zynmp-8.8a"); if (reset) arasan_zynqmp_dll_reset(host, priv->node_id); .. If (reset) arasan_zynqmp_dll_reset(host, priv->node_id); Best Regards, Jaehoon Chung > > sdhci_writel(host, SDHCI_INT_DATA_AVAIL, SDHCI_INT_ENABLE); > sdhci_writel(host, SDHCI_INT_DATA_AVAIL, SDHCI_SIGNAL_ENABLE); > @@ -468,7 +469,9 @@ static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) > } > > udelay(1); > - arasan_zynqmp_dll_reset(host, priv->node_id); > + > + if (device_is_compatible(mmc->dev, "xlnx,zynqmp-8.9a")) > + arasan_zynqmp_dll_reset(host, priv->node_id); > > /* Enable only interrupts served by the SD controller */ > sdhci_writel(host, SDHCI_INT_DATA_MASK | SDHCI_INT_CMD_MASK, > -- > 2.36.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: zynq_sdhci: Dll reset only for ZynqMP platform 2023-07-11 5:00 ` Jaehoon Chung @ 2023-07-11 6:28 ` Michal Simek 2023-07-11 6:48 ` Jaehoon Chung 0 siblings, 1 reply; 5+ messages in thread From: Michal Simek @ 2023-07-11 6:28 UTC (permalink / raw) To: Jaehoon Chung, u-boot, git; +Cc: 'Ashok Reddy Soma', 'Peng Fan' Hi, On 7/11/23 07:00, Jaehoon Chung wrote: > Hi, > >> -----Original Message----- >> From: Michal Simek <michal.simek@amd.com> >> Sent: Monday, July 10, 2023 9:12 PM >> To: u-boot@lists.denx.de; git@xilinx.com >> Cc: Ashok Reddy Soma <ashok.reddy.soma@amd.com>; Jaehoon Chung <jh80.chung@samsung.com>; Peng Fan >> <peng.fan@nxp.com> >> Subject: [PATCH] mmc: zynq_sdhci: Dll reset only for ZynqMP platform >> >> From: Ashok Reddy Soma <ashok.reddy.soma@amd.com> >> >> Dll reset is needed only for ZynqMP platforms, add condition in tuning >> to call arasan_zynqmp_dll_reset() just for ZynqMP platforms. >> >> On other platforms like Versal NET, If this condition is not added, we >> see PLM error messages when dll reset smc is called. >> >> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> >> Signed-off-by: Michal Simek <michal.simek@amd.com> >> --- >> >> drivers/mmc/zynq_sdhci.c | 7 +++++-- >> 1 file changed, 5 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c >> index e779251ce34f..935540d17194 100644 >> --- a/drivers/mmc/zynq_sdhci.c >> +++ b/drivers/mmc/zynq_sdhci.c >> @@ -422,7 +422,8 @@ static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) >> >> mdelay(1); >> >> - arasan_zynqmp_dll_reset(host, priv->node_id); >> + if (device_is_compatible(mmc->dev, "xlnx,zynqmp-8.9a")) >> + arasan_zynqmp_dll_reset(host, priv->node_id); > > How about using local variable to check whether it needs to reset or not? > It's not efficient to call device_is_compatible() everytime. > (I'm not sure that it will be added more in future.) > > e.g) > bool reset = device_is_compatible(mmc->dev, "xlx,zynmp-8.8a"); > > if (reset) > arasan_zynqmp_dll_reset(host, priv->node_id); > > .. > > If (reset) > arasan_zynqmp_dll_reset(host, priv->node_id); This is very valid request and TBH I have already added this to our TODO list to convert all device_is_compatible() to flags because over time the driver was extended and this construct is used more than it should be. This is going to be the last device_is_compatible() patch. Is it fine for you? Thanks, Michal ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] mmc: zynq_sdhci: Dll reset only for ZynqMP platform 2023-07-11 6:28 ` Michal Simek @ 2023-07-11 6:48 ` Jaehoon Chung 0 siblings, 0 replies; 5+ messages in thread From: Jaehoon Chung @ 2023-07-11 6:48 UTC (permalink / raw) To: 'Michal Simek', u-boot, git Cc: 'Ashok Reddy Soma', 'Peng Fan' Hi, > -----Original Message----- > From: Michal Simek <michal.simek@amd.com> > Sent: Tuesday, July 11, 2023 3:28 PM > To: Jaehoon Chung <jh80.chung@samsung.com>; u-boot@lists.denx.de; git@xilinx.com > Cc: 'Ashok Reddy Soma' <ashok.reddy.soma@amd.com>; 'Peng Fan' <peng.fan@nxp.com> > Subject: Re: [PATCH] mmc: zynq_sdhci: Dll reset only for ZynqMP platform > > Hi, > > On 7/11/23 07:00, Jaehoon Chung wrote: > > Hi, > > > >> -----Original Message----- > >> From: Michal Simek <michal.simek@amd.com> > >> Sent: Monday, July 10, 2023 9:12 PM > >> To: u-boot@lists.denx.de; git@xilinx.com > >> Cc: Ashok Reddy Soma <ashok.reddy.soma@amd.com>; Jaehoon Chung <jh80.chung@samsung.com>; Peng Fan > >> <peng.fan@nxp.com> > >> Subject: [PATCH] mmc: zynq_sdhci: Dll reset only for ZynqMP platform > >> > >> From: Ashok Reddy Soma <ashok.reddy.soma@amd.com> > >> > >> Dll reset is needed only for ZynqMP platforms, add condition in tuning > >> to call arasan_zynqmp_dll_reset() just for ZynqMP platforms. > >> > >> On other platforms like Versal NET, If this condition is not added, we > >> see PLM error messages when dll reset smc is called. > >> > >> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> > >> Signed-off-by: Michal Simek <michal.simek@amd.com> > >> --- > >> > >> drivers/mmc/zynq_sdhci.c | 7 +++++-- > >> 1 file changed, 5 insertions(+), 2 deletions(-) > >> > >> diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c > >> index e779251ce34f..935540d17194 100644 > >> --- a/drivers/mmc/zynq_sdhci.c > >> +++ b/drivers/mmc/zynq_sdhci.c > >> @@ -422,7 +422,8 @@ static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) > >> > >> mdelay(1); > >> > >> - arasan_zynqmp_dll_reset(host, priv->node_id); > >> + if (device_is_compatible(mmc->dev, "xlnx,zynqmp-8.9a")) > >> + arasan_zynqmp_dll_reset(host, priv->node_id); > > > > How about using local variable to check whether it needs to reset or not? > > It's not efficient to call device_is_compatible() everytime. > > (I'm not sure that it will be added more in future.) > > > > e.g) > > bool reset = device_is_compatible(mmc->dev, "xlx,zynmp-8.8a"); > > > > if (reset) > > arasan_zynqmp_dll_reset(host, priv->node_id); > > > > .. > > > > If (reset) > > arasan_zynqmp_dll_reset(host, priv->node_id); > > This is very valid request and TBH I have already added this to our TODO list to > convert all device_is_compatible() to flags because over time the driver was > extended and this construct is used more than it should be. > > This is going to be the last device_is_compatible() patch. > Is it fine for you? It's fine. Thanks! Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Best Regards, Jaehoon Chung > > Thanks, > Michal > > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: zynq_sdhci: Dll reset only for ZynqMP platform 2023-07-10 12:11 ` [PATCH] mmc: zynq_sdhci: Dll reset only for ZynqMP platform Michal Simek 2023-07-11 5:00 ` Jaehoon Chung @ 2023-07-17 9:21 ` Michal Simek 1 sibling, 0 replies; 5+ messages in thread From: Michal Simek @ 2023-07-17 9:21 UTC (permalink / raw) To: u-boot, git; +Cc: Ashok Reddy Soma, Jaehoon Chung, Peng Fan On 7/10/23 14:11, Michal Simek wrote: > From: Ashok Reddy Soma <ashok.reddy.soma@amd.com> > > Dll reset is needed only for ZynqMP platforms, add condition in tuning > to call arasan_zynqmp_dll_reset() just for ZynqMP platforms. > > On other platforms like Versal NET, If this condition is not added, we > see PLM error messages when dll reset smc is called. > > Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> > Signed-off-by: Michal Simek <michal.simek@amd.com> > --- > > drivers/mmc/zynq_sdhci.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c > index e779251ce34f..935540d17194 100644 > --- a/drivers/mmc/zynq_sdhci.c > +++ b/drivers/mmc/zynq_sdhci.c > @@ -422,7 +422,8 @@ static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) > > mdelay(1); > > - arasan_zynqmp_dll_reset(host, priv->node_id); > + if (device_is_compatible(mmc->dev, "xlnx,zynqmp-8.9a")) > + arasan_zynqmp_dll_reset(host, priv->node_id); > > sdhci_writel(host, SDHCI_INT_DATA_AVAIL, SDHCI_INT_ENABLE); > sdhci_writel(host, SDHCI_INT_DATA_AVAIL, SDHCI_SIGNAL_ENABLE); > @@ -468,7 +469,9 @@ static int arasan_sdhci_execute_tuning(struct mmc *mmc, u8 opcode) > } > > udelay(1); > - arasan_zynqmp_dll_reset(host, priv->node_id); > + > + if (device_is_compatible(mmc->dev, "xlnx,zynqmp-8.9a")) > + arasan_zynqmp_dll_reset(host, priv->node_id); > > /* Enable only interrupts served by the SD controller */ > sdhci_writel(host, SDHCI_INT_DATA_MASK | SDHCI_INT_CMD_MASK, Applied. M ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-07-17 9:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20230710121212epcas1p34d0fdfe9d31b8d28f2e1f167c7685eff@epcas1p3.samsung.com>
2023-07-10 12:11 ` [PATCH] mmc: zynq_sdhci: Dll reset only for ZynqMP platform Michal Simek
2023-07-11 5:00 ` Jaehoon Chung
2023-07-11 6:28 ` Michal Simek
2023-07-11 6:48 ` Jaehoon Chung
2023-07-17 9:21 ` Michal Simek
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.