* [U-Boot] [dm/next PATCH v1] dm: qspi fix claim bus and release bus
@ 2015-04-14 5:19 Peng Fan
2015-04-15 9:50 ` Peng Fan
0 siblings, 1 reply; 4+ messages in thread
From: Peng Fan @ 2015-04-14 5:19 UTC (permalink / raw)
To: u-boot
For fsl_qspi_claim_bus and fsl_qspi_release_bus, the input parameter
"struct udevice *dev" represents device: "qspi[x]: qspi@[address] {...}".
Since "dev" already represents the qspi controller, use its parent to
get platdata and get 'priv' is wrong.
After applying this patch, qspi flashes can be correctly probed.
CC: Simon Glass <sjg@chromium.org>
CC: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
CC: Haikun Wang <Haikun.Wang@freescale.com>
Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
---
Hi,
This patch is based on dm/next branch.
Regards,
Peng.
drivers/spi/fsl_qspi.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c
index 868df5f..04f1801 100644
--- a/drivers/spi/fsl_qspi.c
+++ b/drivers/spi/fsl_qspi.c
@@ -1044,11 +1044,9 @@ static int fsl_qspi_xfer(struct udevice *dev, unsigned int bitlen,
static int fsl_qspi_claim_bus(struct udevice *dev)
{
struct fsl_qspi_priv *priv;
- struct udevice *bus;
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_platdata(dev);
- bus = dev->parent;
- priv = dev_get_priv(bus);
+ priv = dev_get_priv(dev);
priv->cur_amba_base =
priv->amba_base[0] + FSL_QSPI_FLASH_SIZE * slave_plat->cs;
@@ -1061,10 +1059,8 @@ static int fsl_qspi_claim_bus(struct udevice *dev)
static int fsl_qspi_release_bus(struct udevice *dev)
{
struct fsl_qspi_priv *priv;
- struct udevice *bus;
- bus = dev->parent;
- priv = dev_get_priv(bus);
+ priv = dev_get_priv(dev);
qspi_module_disable(priv, 1);
--
1.8.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [dm/next PATCH v1] dm: qspi fix claim bus and release bus
2015-04-14 5:19 [U-Boot] [dm/next PATCH v1] dm: qspi fix claim bus and release bus Peng Fan
@ 2015-04-15 9:50 ` Peng Fan
2015-04-23 15:17 ` Simon Glass
0 siblings, 1 reply; 4+ messages in thread
From: Peng Fan @ 2015-04-15 9:50 UTC (permalink / raw)
To: u-boot
Add missed people.
On 4/14/2015 1:19 PM, Peng Fan wrote:
> For fsl_qspi_claim_bus and fsl_qspi_release_bus, the input parameter
> "struct udevice *dev" represents device: "qspi[x]: qspi@[address] {...}".
> Since "dev" already represents the qspi controller, use its parent to
> get platdata and get 'priv' is wrong.
>
> After applying this patch, qspi flashes can be correctly probed.
>
> CC: Simon Glass <sjg@chromium.org>
> CC: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
> CC: Haikun Wang <Haikun.Wang@freescale.com>
> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
> ---
>
> Hi,
>
> This patch is based on dm/next branch.
>
> Regards,
> Peng.
>
> drivers/spi/fsl_qspi.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c
> index 868df5f..04f1801 100644
> --- a/drivers/spi/fsl_qspi.c
> +++ b/drivers/spi/fsl_qspi.c
> @@ -1044,11 +1044,9 @@ static int fsl_qspi_xfer(struct udevice *dev, unsigned int bitlen,
> static int fsl_qspi_claim_bus(struct udevice *dev)
> {
> struct fsl_qspi_priv *priv;
> - struct udevice *bus;
> - struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
> + struct dm_spi_slave_platdata *slave_plat = dev_get_platdata(dev);
>
> - bus = dev->parent;
> - priv = dev_get_priv(bus);
> + priv = dev_get_priv(dev);
>
> priv->cur_amba_base =
> priv->amba_base[0] + FSL_QSPI_FLASH_SIZE * slave_plat->cs;
> @@ -1061,10 +1059,8 @@ static int fsl_qspi_claim_bus(struct udevice *dev)
> static int fsl_qspi_release_bus(struct udevice *dev)
> {
> struct fsl_qspi_priv *priv;
> - struct udevice *bus;
>
> - bus = dev->parent;
> - priv = dev_get_priv(bus);
> + priv = dev_get_priv(dev);
>
> qspi_module_disable(priv, 1);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [dm/next PATCH v1] dm: qspi fix claim bus and release bus
2015-04-15 9:50 ` Peng Fan
@ 2015-04-23 15:17 ` Simon Glass
2015-04-26 7:05 ` Peng Fan
0 siblings, 1 reply; 4+ messages in thread
From: Simon Glass @ 2015-04-23 15:17 UTC (permalink / raw)
To: u-boot
Hi Peng,
On 15 April 2015 at 03:50, Peng Fan <Peng.Fan@freescale.com> wrote:
> Add missed people.
>
>
> On 4/14/2015 1:19 PM, Peng Fan wrote:
>>
>> For fsl_qspi_claim_bus and fsl_qspi_release_bus, the input parameter
>> "struct udevice *dev" represents device: "qspi[x]: qspi@[address] {...}".
>> Since "dev" already represents the qspi controller, use its parent to
>> get platdata and get 'priv' is wrong.
>>
>> After applying this patch, qspi flashes can be correctly probed.
Is this patch still needed after this patch?
http://patchwork.ozlabs.org/patch/462595/
>>
>> CC: Simon Glass <sjg@chromium.org>
>> CC: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
>> CC: Haikun Wang <Haikun.Wang@freescale.com>
>> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
>> ---
>>
>> Hi,
>>
>> This patch is based on dm/next branch.
>>
>> Regards,
>> Peng.
>>
>> drivers/spi/fsl_qspi.c | 10 +++-------
>> 1 file changed, 3 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c
>> index 868df5f..04f1801 100644
>> --- a/drivers/spi/fsl_qspi.c
>> +++ b/drivers/spi/fsl_qspi.c
>> @@ -1044,11 +1044,9 @@ static int fsl_qspi_xfer(struct udevice *dev,
>> unsigned int bitlen,
>> static int fsl_qspi_claim_bus(struct udevice *dev)
>> {
>> struct fsl_qspi_priv *priv;
>> - struct udevice *bus;
>> - struct dm_spi_slave_platdata *slave_plat =
>> dev_get_parent_platdata(dev);
>> + struct dm_spi_slave_platdata *slave_plat = dev_get_platdata(dev);
>> - bus = dev->parent;
>> - priv = dev_get_priv(bus);
>> + priv = dev_get_priv(dev);
>> priv->cur_amba_base =
>> priv->amba_base[0] + FSL_QSPI_FLASH_SIZE * slave_plat->cs;
>> @@ -1061,10 +1059,8 @@ static int fsl_qspi_claim_bus(struct udevice *dev)
>> static int fsl_qspi_release_bus(struct udevice *dev)
>> {
>> struct fsl_qspi_priv *priv;
>> - struct udevice *bus;
>> - bus = dev->parent;
>> - priv = dev_get_priv(bus);
>> + priv = dev_get_priv(dev);
>> qspi_module_disable(priv, 1);
>>
>
>
Regards,
Simon
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [dm/next PATCH v1] dm: qspi fix claim bus and release bus
2015-04-23 15:17 ` Simon Glass
@ 2015-04-26 7:05 ` Peng Fan
0 siblings, 0 replies; 4+ messages in thread
From: Peng Fan @ 2015-04-26 7:05 UTC (permalink / raw)
To: u-boot
Hi Simon,
On 4/23/2015 11:17 PM, Simon Glass wrote:
> Hi Peng,
>
> On 15 April 2015 at 03:50, Peng Fan <Peng.Fan@freescale.com> wrote:
>> Add missed people.
>>
>>
>> On 4/14/2015 1:19 PM, Peng Fan wrote:
>>> For fsl_qspi_claim_bus and fsl_qspi_release_bus, the input parameter
>>> "struct udevice *dev" represents device: "qspi[x]: qspi@[address] {...}".
>>> Since "dev" already represents the qspi controller, use its parent to
>>> get platdata and get 'priv' is wrong.
>>>
>>> After applying this patch, qspi flashes can be correctly probed.
> Is this patch still needed after this patch?
>
> http://patchwork.ozlabs.org/patch/462595/
After applying your patch, this patch is not needed.
>
>>> CC: Simon Glass <sjg@chromium.org>
>>> CC: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
>>> CC: Haikun Wang <Haikun.Wang@freescale.com>
>>> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
>>> ---
>>>
>>> Hi,
>>>
>>> This patch is based on dm/next branch.
>>>
>>> Regards,
>>> Peng.
>>>
>>> drivers/spi/fsl_qspi.c | 10 +++-------
>>> 1 file changed, 3 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c
>>> index 868df5f..04f1801 100644
>>> --- a/drivers/spi/fsl_qspi.c
>>> +++ b/drivers/spi/fsl_qspi.c
>>> @@ -1044,11 +1044,9 @@ static int fsl_qspi_xfer(struct udevice *dev,
>>> unsigned int bitlen,
>>> static int fsl_qspi_claim_bus(struct udevice *dev)
>>> {
>>> struct fsl_qspi_priv *priv;
>>> - struct udevice *bus;
>>> - struct dm_spi_slave_platdata *slave_plat =
>>> dev_get_parent_platdata(dev);
>>> + struct dm_spi_slave_platdata *slave_plat = dev_get_platdata(dev);
>>> - bus = dev->parent;
>>> - priv = dev_get_priv(bus);
>>> + priv = dev_get_priv(dev);
>>> priv->cur_amba_base =
>>> priv->amba_base[0] + FSL_QSPI_FLASH_SIZE * slave_plat->cs;
>>> @@ -1061,10 +1059,8 @@ static int fsl_qspi_claim_bus(struct udevice *dev)
>>> static int fsl_qspi_release_bus(struct udevice *dev)
>>> {
>>> struct fsl_qspi_priv *priv;
>>> - struct udevice *bus;
>>> - bus = dev->parent;
>>> - priv = dev_get_priv(bus);
>>> + priv = dev_get_priv(dev);
>>> qspi_module_disable(priv, 1);
>>>
>>
> Regards,
> Simon
> .
>
Regards,
Peng.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-04-26 7:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-14 5:19 [U-Boot] [dm/next PATCH v1] dm: qspi fix claim bus and release bus Peng Fan
2015-04-15 9:50 ` Peng Fan
2015-04-23 15:17 ` Simon Glass
2015-04-26 7:05 ` Peng Fan
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.