diff mbox

[U-Boot,v1,6/8] net/fman: add a fm_enable_port function

Message ID 1374832955-4544-7-git-send-email-valentin.longchamp@keymile.com
State Superseded
Delegated to: York Sun
Headers show

Commit Message

Valentin Longchamp July 26, 2013, 10:02 a.m. UTC
This can be useful if we want to disable an interface in u-boot and
later reenable them, so that it looks available when trying to fix the
FDT or for the kernel.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
---
 drivers/net/fm/init.c | 7 +++++++
 include/fm_eth.h      | 1 +
 2 files changed, 8 insertions(+)

Comments

York Sun Aug. 13, 2013, 8:38 p.m. UTC | #1
On 07/26/2013 03:02 AM, Valentin Longchamp wrote:
> This can be useful if we want to disable an interface in u-boot and
> later reenable them, so that it looks available when trying to fix the
> FDT or for the kernel.
> 
> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> 
> ---
> drivers/net/fm/init.c | 7 +++++++
>  include/fm_eth.h      | 1 +
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/net/fm/init.c b/drivers/net/fm/init.c
> index 5908c32..820277e 100644
> --- a/drivers/net/fm/init.c
> +++ b/drivers/net/fm/init.c
> @@ -158,6 +158,13 @@ void fm_disable_port(enum fm_port port)
>  	fman_disable_port(port);
>  }
>  
> +void fm_enable_port(enum fm_port port)
> +{
> +	int i = fm_port_to_index(port);
> +
> +	fm_info[i].enabled = 1;
> +}
> +
>  void fm_info_set_mdio(enum fm_port port, struct mii_dev *bus)
>  {
>  	int i = fm_port_to_index(port);
> diff --git a/include/fm_eth.h b/include/fm_eth.h
> index 8fcf172..b464e04 100644
> --- a/include/fm_eth.h
> +++ b/include/fm_eth.h
> @@ -162,5 +162,6 @@ void fm_info_set_phy_address(enum fm_port port, int address);
>  int fm_info_get_phy_address(enum fm_port port);
>  void fm_info_set_mdio(enum fm_port port, struct mii_dev *bus);
>  void fm_disable_port(enum fm_port port);
> +void fm_enable_port(enum fm_port port);
>  

Is this function called somewhere?

York
Valentin Longchamp Aug. 19, 2013, 3:28 p.m. UTC | #2
On 08/13/2013 10:38 PM, York Sun wrote:
> On 07/26/2013 03:02 AM, Valentin Longchamp wrote:
>> This can be useful if we want to disable an interface in u-boot and
>> later reenable them, so that it looks available when trying to fix the
>> FDT or for the kernel.
>>
>> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
>>
>> ---
>> drivers/net/fm/init.c | 7 +++++++
>>  include/fm_eth.h      | 1 +
>>  2 files changed, 8 insertions(+)
>>
>> diff --git a/drivers/net/fm/init.c b/drivers/net/fm/init.c
>> index 5908c32..820277e 100644
>> --- a/drivers/net/fm/init.c
>> +++ b/drivers/net/fm/init.c
>> @@ -158,6 +158,13 @@ void fm_disable_port(enum fm_port port)
>>  	fman_disable_port(port);
>>  }
>>  
>> +void fm_enable_port(enum fm_port port)
>> +{
>> +	int i = fm_port_to_index(port);
>> +
>> +	fm_info[i].enabled = 1;
>> +}
>> +
>>  void fm_info_set_mdio(enum fm_port port, struct mii_dev *bus)
>>  {
>>  	int i = fm_port_to_index(port);
>> diff --git a/include/fm_eth.h b/include/fm_eth.h
>> index 8fcf172..b464e04 100644
>> --- a/include/fm_eth.h
>> +++ b/include/fm_eth.h
>> @@ -162,5 +162,6 @@ void fm_info_set_phy_address(enum fm_port port, int address);
>>  int fm_info_get_phy_address(enum fm_port port);
>>  void fm_info_set_mdio(enum fm_port port, struct mii_dev *bus);
>>  void fm_disable_port(enum fm_port port);
>> +void fm_enable_port(enum fm_port port);
>>  
> 
> Is this function called somewhere?
> 

Yes it is used in the patch 8/8 of this series.

Valentin
diff mbox

Patch

diff --git a/drivers/net/fm/init.c b/drivers/net/fm/init.c
index 5908c32..820277e 100644
--- a/drivers/net/fm/init.c
+++ b/drivers/net/fm/init.c
@@ -158,6 +158,13 @@  void fm_disable_port(enum fm_port port)
 	fman_disable_port(port);
 }
 
+void fm_enable_port(enum fm_port port)
+{
+	int i = fm_port_to_index(port);
+
+	fm_info[i].enabled = 1;
+}
+
 void fm_info_set_mdio(enum fm_port port, struct mii_dev *bus)
 {
 	int i = fm_port_to_index(port);
diff --git a/include/fm_eth.h b/include/fm_eth.h
index 8fcf172..b464e04 100644
--- a/include/fm_eth.h
+++ b/include/fm_eth.h
@@ -162,5 +162,6 @@  void fm_info_set_phy_address(enum fm_port port, int address);
 int fm_info_get_phy_address(enum fm_port port);
 void fm_info_set_mdio(enum fm_port port, struct mii_dev *bus);
 void fm_disable_port(enum fm_port port);
+void fm_enable_port(enum fm_port port);
 
 #endif