Re: [PATCH net-next 1/2] net: davinci_mdio: don't request io address range

2015-03-11 Thread Murali Karicheri

Tony,

On 02/27/2015 11:51 AM, Tony Lindgren wrote:

* Murali Karicheri  [150224 13:32]:

From: Grygorii Strashko

Historically Davinci MDIO driver was  created with assumption that
MDIO is standalone device, but for Keystone 2 it's a part
of NETCP module and now NETCP driver requests IO range which
includes MDIO IO range too. This causes Keystone 2 networking stack
failure during the boot.

"netcp-1.0 2620110.netcp: Probe of module(netcp-gbe) failed with -16"

Hence, don't request io address range from Davinci MDIO driver and
just remap it.


Best to fix this up properly so you don't have overlapping resources.
You probably want to have the whole hardware driver block defined
in the dts file as a single entry, and then have the modules within
that hardware block use the dt ranges property. This allows you to
do standard Linux drivers without any extra hacks.

Sounds like this following untested imaginary example should do
the trick:

mac: ethernet@deadbeef {
compatible = "ti,cpsw", "simple-bus";
reg =<0xdeadbeef 0x1000>;
ranges =<0 0xdeadbeef 0x2000>;
...

davinci_mdio: mdio@1000 {
reg =<0x1000 0x100>;
...
};
};

That allows you to get rid of all the existing code for dealing
with the chilren with for_each_child_of_node(node, slave_node)
in cpsw_probe_dt() as that all happens automatically for you and
does not cause problems with modules being moved around.


This is not for CPSW driver. I am working to add the support for NetCP.
NetCP driver depends on DaVinci MDIO driver to talk to the Phy. So this
can be outside the NetCP device node. I will rework the NetCP driver to 
map only it's register space and let MDIO manage the mapping of its 
register region. I plan to use ranges to define the NetCP address space 
and use reg to refer to individual module reg spaces (Packet 
Accelerator, Ethenet sub system and security accelerator). This way MDIO 
can have its own register space and will not collide with the address 
NetCP driver maps. My v1 will implement this.


Murali


Regards,

Tony



--
Murali Karicheri
Linux Kernel, Texas Instruments
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net-next 1/2] net: davinci_mdio: don't request io address range

2015-03-11 Thread Murali Karicheri

Tony,

On 02/27/2015 11:51 AM, Tony Lindgren wrote:

* Murali Karicherim-kariche...@ti.com  [150224 13:32]:

From: Grygorii Strashkogrygorii.stras...@ti.com

Historically Davinci MDIO driver was  created with assumption that
MDIO is standalone device, but for Keystone 2 it's a part
of NETCP module and now NETCP driver requests IO range which
includes MDIO IO range too. This causes Keystone 2 networking stack
failure during the boot.

netcp-1.0 2620110.netcp: Probe of module(netcp-gbe) failed with -16

Hence, don't request io address range from Davinci MDIO driver and
just remap it.


Best to fix this up properly so you don't have overlapping resources.
You probably want to have the whole hardware driver block defined
in the dts file as a single entry, and then have the modules within
that hardware block use the dt ranges property. This allows you to
do standard Linux drivers without any extra hacks.

Sounds like this following untested imaginary example should do
the trick:

mac: ethernet@deadbeef {
compatible = ti,cpsw, simple-bus;
reg =0xdeadbeef 0x1000;
ranges =0 0xdeadbeef 0x2000;
...

davinci_mdio: mdio@1000 {
reg =0x1000 0x100;
...
};
};

That allows you to get rid of all the existing code for dealing
with the chilren with for_each_child_of_node(node, slave_node)
in cpsw_probe_dt() as that all happens automatically for you and
does not cause problems with modules being moved around.


This is not for CPSW driver. I am working to add the support for NetCP.
NetCP driver depends on DaVinci MDIO driver to talk to the Phy. So this
can be outside the NetCP device node. I will rework the NetCP driver to 
map only it's register space and let MDIO manage the mapping of its 
register region. I plan to use ranges to define the NetCP address space 
and use reg to refer to individual module reg spaces (Packet 
Accelerator, Ethenet sub system and security accelerator). This way MDIO 
can have its own register space and will not collide with the address 
NetCP driver maps. My v1 will implement this.


Murali


Regards,

Tony



--
Murali Karicheri
Linux Kernel, Texas Instruments
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net-next 1/2] net: davinci_mdio: don't request io address range

2015-02-27 Thread Tony Lindgren
* Murali Karicheri  [150224 13:32]:
> From: Grygorii Strashko 
> 
> Historically Davinci MDIO driver was  created with assumption that
> MDIO is standalone device, but for Keystone 2 it's a part
> of NETCP module and now NETCP driver requests IO range which
> includes MDIO IO range too. This causes Keystone 2 networking stack
> failure during the boot.
> 
> "netcp-1.0 2620110.netcp: Probe of module(netcp-gbe) failed with -16"
> 
> Hence, don't request io address range from Davinci MDIO driver and
> just remap it.

Best to fix this up properly so you don't have overlapping resources.
You probably want to have the whole hardware driver block defined
in the dts file as a single entry, and then have the modules within
that hardware block use the dt ranges property. This allows you to
do standard Linux drivers without any extra hacks.

Sounds like this following untested imaginary example should do
the trick:

mac: ethernet@deadbeef {
compatible = "ti,cpsw", "simple-bus";
reg = <0xdeadbeef 0x1000>;
ranges = <0 0xdeadbeef 0x2000>;
...

davinci_mdio: mdio@1000 {
reg = <0x1000 0x100>;
...
};
};

That allows you to get rid of all the existing code for dealing
with the chilren with for_each_child_of_node(node, slave_node)
in cpsw_probe_dt() as that all happens automatically for you and
does not cause problems with modules being moved around.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net-next 1/2] net: davinci_mdio: don't request io address range

2015-02-27 Thread Lad, Prabhakar
On Tue, Feb 24, 2015 at 9:27 PM, Murali Karicheri  wrote:
> From: Grygorii Strashko 
>
> Historically Davinci MDIO driver was  created with assumption that
> MDIO is standalone device, but for Keystone 2 it's a part
> of NETCP module and now NETCP driver requests IO range which
> includes MDIO IO range too. This causes Keystone 2 networking stack
> failure during the boot.
>
> "netcp-1.0 2620110.netcp: Probe of module(netcp-gbe) failed with -16"
>
> Hence, don't request io address range from Davinci MDIO driver and
> just remap it.
>
> Signed-off-by: Grygorii Strashko 
> Signed-off-by: Murali Karicheri 

Acked-by: Lad, Prabhakar 

Cheers,
--Prabhakar Lad

> ---
>  drivers/net/ethernet/ti/davinci_mdio.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/ti/davinci_mdio.c 
> b/drivers/net/ethernet/ti/davinci_mdio.c
> index 98655b4..b13ec82 100644
> --- a/drivers/net/ethernet/ti/davinci_mdio.c
> +++ b/drivers/net/ethernet/ti/davinci_mdio.c
> @@ -371,7 +371,7 @@ static int davinci_mdio_probe(struct platform_device 
> *pdev)
> spin_lock_init(>lock);
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -   data->regs = devm_ioremap_resource(dev, res);
> +   data->regs = devm_ioremap_nocache(dev, res->start, 
> resource_size(res));
> if (IS_ERR(data->regs)) {
> ret = PTR_ERR(data->regs);
> goto bail_out;
> --
> 1.7.9.5
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net-next 1/2] net: davinci_mdio: don't request io address range

2015-02-27 Thread Tony Lindgren
* Murali Karicheri m-kariche...@ti.com [150224 13:32]:
 From: Grygorii Strashko grygorii.stras...@ti.com
 
 Historically Davinci MDIO driver was  created with assumption that
 MDIO is standalone device, but for Keystone 2 it's a part
 of NETCP module and now NETCP driver requests IO range which
 includes MDIO IO range too. This causes Keystone 2 networking stack
 failure during the boot.
 
 netcp-1.0 2620110.netcp: Probe of module(netcp-gbe) failed with -16
 
 Hence, don't request io address range from Davinci MDIO driver and
 just remap it.

Best to fix this up properly so you don't have overlapping resources.
You probably want to have the whole hardware driver block defined
in the dts file as a single entry, and then have the modules within
that hardware block use the dt ranges property. This allows you to
do standard Linux drivers without any extra hacks.

Sounds like this following untested imaginary example should do
the trick:

mac: ethernet@deadbeef {
compatible = ti,cpsw, simple-bus;
reg = 0xdeadbeef 0x1000;
ranges = 0 0xdeadbeef 0x2000;
...

davinci_mdio: mdio@1000 {
reg = 0x1000 0x100;
...
};
};

That allows you to get rid of all the existing code for dealing
with the chilren with for_each_child_of_node(node, slave_node)
in cpsw_probe_dt() as that all happens automatically for you and
does not cause problems with modules being moved around.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net-next 1/2] net: davinci_mdio: don't request io address range

2015-02-27 Thread Lad, Prabhakar
On Tue, Feb 24, 2015 at 9:27 PM, Murali Karicheri m-kariche...@ti.com wrote:
 From: Grygorii Strashko grygorii.stras...@ti.com

 Historically Davinci MDIO driver was  created with assumption that
 MDIO is standalone device, but for Keystone 2 it's a part
 of NETCP module and now NETCP driver requests IO range which
 includes MDIO IO range too. This causes Keystone 2 networking stack
 failure during the boot.

 netcp-1.0 2620110.netcp: Probe of module(netcp-gbe) failed with -16

 Hence, don't request io address range from Davinci MDIO driver and
 just remap it.

 Signed-off-by: Grygorii Strashko grygorii.stras...@ti.com
 Signed-off-by: Murali Karicheri m-kariche...@ti.com

Acked-by: Lad, Prabhakar prabhakar.cse...@gmail.com

Cheers,
--Prabhakar Lad

 ---
  drivers/net/ethernet/ti/davinci_mdio.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/drivers/net/ethernet/ti/davinci_mdio.c 
 b/drivers/net/ethernet/ti/davinci_mdio.c
 index 98655b4..b13ec82 100644
 --- a/drivers/net/ethernet/ti/davinci_mdio.c
 +++ b/drivers/net/ethernet/ti/davinci_mdio.c
 @@ -371,7 +371,7 @@ static int davinci_mdio_probe(struct platform_device 
 *pdev)
 spin_lock_init(data-lock);

 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 -   data-regs = devm_ioremap_resource(dev, res);
 +   data-regs = devm_ioremap_nocache(dev, res-start, 
 resource_size(res));
 if (IS_ERR(data-regs)) {
 ret = PTR_ERR(data-regs);
 goto bail_out;
 --
 1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH net-next 1/2] net: davinci_mdio: don't request io address range

2015-02-24 Thread Murali Karicheri
From: Grygorii Strashko 

Historically Davinci MDIO driver was  created with assumption that
MDIO is standalone device, but for Keystone 2 it's a part
of NETCP module and now NETCP driver requests IO range which
includes MDIO IO range too. This causes Keystone 2 networking stack
failure during the boot.

"netcp-1.0 2620110.netcp: Probe of module(netcp-gbe) failed with -16"

Hence, don't request io address range from Davinci MDIO driver and
just remap it.

Signed-off-by: Grygorii Strashko 
Signed-off-by: Murali Karicheri 
---
 drivers/net/ethernet/ti/davinci_mdio.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/davinci_mdio.c 
b/drivers/net/ethernet/ti/davinci_mdio.c
index 98655b4..b13ec82 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -371,7 +371,7 @@ static int davinci_mdio_probe(struct platform_device *pdev)
spin_lock_init(>lock);
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   data->regs = devm_ioremap_resource(dev, res);
+   data->regs = devm_ioremap_nocache(dev, res->start, resource_size(res));
if (IS_ERR(data->regs)) {
ret = PTR_ERR(data->regs);
goto bail_out;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH net-next 1/2] net: davinci_mdio: don't request io address range

2015-02-24 Thread Murali Karicheri
From: Grygorii Strashko grygorii.stras...@ti.com

Historically Davinci MDIO driver was  created with assumption that
MDIO is standalone device, but for Keystone 2 it's a part
of NETCP module and now NETCP driver requests IO range which
includes MDIO IO range too. This causes Keystone 2 networking stack
failure during the boot.

netcp-1.0 2620110.netcp: Probe of module(netcp-gbe) failed with -16

Hence, don't request io address range from Davinci MDIO driver and
just remap it.

Signed-off-by: Grygorii Strashko grygorii.stras...@ti.com
Signed-off-by: Murali Karicheri m-kariche...@ti.com
---
 drivers/net/ethernet/ti/davinci_mdio.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ti/davinci_mdio.c 
b/drivers/net/ethernet/ti/davinci_mdio.c
index 98655b4..b13ec82 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -371,7 +371,7 @@ static int davinci_mdio_probe(struct platform_device *pdev)
spin_lock_init(data-lock);
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   data-regs = devm_ioremap_resource(dev, res);
+   data-regs = devm_ioremap_nocache(dev, res-start, resource_size(res));
if (IS_ERR(data-regs)) {
ret = PTR_ERR(data-regs);
goto bail_out;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/