diff mbox

[U-Boot,3/7] mips: ath79: Use uniform header for reset

Message ID BLU436-SMTP2276301664C8ABC2274684FF4D0@phx.gbl
State Superseded
Delegated to: Daniel Schwierzeck
Headers show

Commit Message

Wills Wang May 22, 2016, 3:59 a.m. UTC
Collect all reset operation on platform and move them into a uniform header

Signed-off-by: Wills Wang <wills.wang@live.com>
---

 arch/mips/mach-ath79/include/mach/ath79.h | 3 ---
 arch/mips/mach-ath79/include/mach/reset.h | 2 ++
 board/tplink/wdr4300/wdr4300.c            | 1 +
 3 files changed, 3 insertions(+), 3 deletions(-)

Comments

Marek Vasut May 22, 2016, 11:08 a.m. UTC | #1
On 05/22/2016 05:59 AM, Wills Wang wrote:
> Collect all reset operation on platform and move them into a uniform header
> 
> Signed-off-by: Wills Wang <wills.wang@live.com>
> ---
> 
>  arch/mips/mach-ath79/include/mach/ath79.h | 3 ---
>  arch/mips/mach-ath79/include/mach/reset.h | 2 ++
>  board/tplink/wdr4300/wdr4300.c            | 1 +
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/mips/mach-ath79/include/mach/ath79.h b/arch/mips/mach-ath79/include/mach/ath79.h
> index 17af082..18d1e26 100644
> --- a/arch/mips/mach-ath79/include/mach/ath79.h
> +++ b/arch/mips/mach-ath79/include/mach/ath79.h
> @@ -140,9 +140,6 @@ static inline int soc_is_qca956x(void)
>  	return soc_is_tp9343() || soc_is_qca9561();
>  }
>  
> -int ath79_eth_reset(void);
> -int ath79_usb_reset(void);
> -
>  void ar934x_pll_init(const u16 cpu_mhz, const u16 ddr_mhz, const u16 ahb_mhz);
>  void ar934x_ddr_init(const u16 cpu_mhz, const u16 ddr_mhz, const u16 ahb_mhz);
>  
> diff --git a/arch/mips/mach-ath79/include/mach/reset.h b/arch/mips/mach-ath79/include/mach/reset.h
> index c383bfe..7721e1d 100644
> --- a/arch/mips/mach-ath79/include/mach/reset.h
> +++ b/arch/mips/mach-ath79/include/mach/reset.h
> @@ -10,5 +10,7 @@
>  #include <linux/types.h>
>  
>  u32 get_bootstrap(void);
> +int ath79_eth_reset(void);
> +int ath79_usb_reset(void);

By moving the prototype into reset.h :
- New functions are added to a file which can be almost removed
- You need to include two headers now

So drop this patch and instead focus on getting rid of reset.h

>  #endif /* __ASM_MACH_RESET_H */
> diff --git a/board/tplink/wdr4300/wdr4300.c b/board/tplink/wdr4300/wdr4300.c
> index 6e070fd..8382ce0 100644
> --- a/board/tplink/wdr4300/wdr4300.c
> +++ b/board/tplink/wdr4300/wdr4300.c
> @@ -9,6 +9,7 @@
>  #include <asm/addrspace.h>
>  #include <asm/types.h>
>  #include <mach/ath79.h>
> +#include <mach/reset.h>
>  #include <mach/ar71xx_regs.h>
>  #include <mach/ddr.h>
>  #include <debug_uart.h>
>
Wills Wang May 22, 2016, 11:29 a.m. UTC | #2
On 05/22/2016 07:08 PM, Marek Vasut wrote:
> On 05/22/2016 05:59 AM, Wills Wang wrote:
>> Collect all reset operation on platform and move them into a uniform header
>>
>> Signed-off-by: Wills Wang <wills.wang@live.com>
>> ---
>>
>>   arch/mips/mach-ath79/include/mach/ath79.h | 3 ---
>>   arch/mips/mach-ath79/include/mach/reset.h | 2 ++
>>   board/tplink/wdr4300/wdr4300.c            | 1 +
>>   3 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/mips/mach-ath79/include/mach/ath79.h b/arch/mips/mach-ath79/include/mach/ath79.h
>> index 17af082..18d1e26 100644
>> --- a/arch/mips/mach-ath79/include/mach/ath79.h
>> +++ b/arch/mips/mach-ath79/include/mach/ath79.h
>> @@ -140,9 +140,6 @@ static inline int soc_is_qca956x(void)
>>   	return soc_is_tp9343() || soc_is_qca9561();
>>   }
>>   
>> -int ath79_eth_reset(void);
>> -int ath79_usb_reset(void);
>> -
>>   void ar934x_pll_init(const u16 cpu_mhz, const u16 ddr_mhz, const u16 ahb_mhz);
>>   void ar934x_ddr_init(const u16 cpu_mhz, const u16 ddr_mhz, const u16 ahb_mhz);
>>   
>> diff --git a/arch/mips/mach-ath79/include/mach/reset.h b/arch/mips/mach-ath79/include/mach/reset.h
>> index c383bfe..7721e1d 100644
>> --- a/arch/mips/mach-ath79/include/mach/reset.h
>> +++ b/arch/mips/mach-ath79/include/mach/reset.h
>> @@ -10,5 +10,7 @@
>>   #include <linux/types.h>
>>   
>>   u32 get_bootstrap(void);
>> +int ath79_eth_reset(void);
>> +int ath79_usb_reset(void);
> By moving the prototype into reset.h :
> - New functions are added to a file which can be almost removed
> - You need to include two headers now
>
> So drop this patch and instead focus on getting rid of reset.h
You mean we should use a header "ath79.h" for all?
>>   #endif /* __ASM_MACH_RESET_H */
>> diff --git a/board/tplink/wdr4300/wdr4300.c b/board/tplink/wdr4300/wdr4300.c
>> index 6e070fd..8382ce0 100644
>> --- a/board/tplink/wdr4300/wdr4300.c
>> +++ b/board/tplink/wdr4300/wdr4300.c
>> @@ -9,6 +9,7 @@
>>   #include <asm/addrspace.h>
>>   #include <asm/types.h>
>>   #include <mach/ath79.h>
>> +#include <mach/reset.h>
>>   #include <mach/ar71xx_regs.h>
>>   #include <mach/ddr.h>
>>   #include <debug_uart.h>
>>
>
Marek Vasut May 22, 2016, 11:32 a.m. UTC | #3
On 05/22/2016 01:29 PM, Wills Wang wrote:
> 
> 
> On 05/22/2016 07:08 PM, Marek Vasut wrote:
>> On 05/22/2016 05:59 AM, Wills Wang wrote:
>>> Collect all reset operation on platform and move them into a uniform
>>> header
>>>
>>> Signed-off-by: Wills Wang <wills.wang@live.com>
>>> ---
>>>
>>>   arch/mips/mach-ath79/include/mach/ath79.h | 3 ---
>>>   arch/mips/mach-ath79/include/mach/reset.h | 2 ++
>>>   board/tplink/wdr4300/wdr4300.c            | 1 +
>>>   3 files changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/arch/mips/mach-ath79/include/mach/ath79.h
>>> b/arch/mips/mach-ath79/include/mach/ath79.h
>>> index 17af082..18d1e26 100644
>>> --- a/arch/mips/mach-ath79/include/mach/ath79.h
>>> +++ b/arch/mips/mach-ath79/include/mach/ath79.h
>>> @@ -140,9 +140,6 @@ static inline int soc_is_qca956x(void)
>>>       return soc_is_tp9343() || soc_is_qca9561();
>>>   }
>>>   -int ath79_eth_reset(void);
>>> -int ath79_usb_reset(void);
>>> -
>>>   void ar934x_pll_init(const u16 cpu_mhz, const u16 ddr_mhz, const
>>> u16 ahb_mhz);
>>>   void ar934x_ddr_init(const u16 cpu_mhz, const u16 ddr_mhz, const
>>> u16 ahb_mhz);
>>>   diff --git a/arch/mips/mach-ath79/include/mach/reset.h
>>> b/arch/mips/mach-ath79/include/mach/reset.h
>>> index c383bfe..7721e1d 100644
>>> --- a/arch/mips/mach-ath79/include/mach/reset.h
>>> +++ b/arch/mips/mach-ath79/include/mach/reset.h
>>> @@ -10,5 +10,7 @@
>>>   #include <linux/types.h>
>>>     u32 get_bootstrap(void);
>>> +int ath79_eth_reset(void);
>>> +int ath79_usb_reset(void);
>> By moving the prototype into reset.h :
>> - New functions are added to a file which can be almost removed
>> - You need to include two headers now
>>
>> So drop this patch and instead focus on getting rid of reset.h
> You mean we should use a header "ath79.h" for all?

Yes, having one header per function makes no sense and ath79.h already
has multiple function prototypes in it.
Daniel Schwierzeck May 30, 2016, 10:10 a.m. UTC | #4
Am 22.05.2016 um 13:32 schrieb Marek Vasut:
> On 05/22/2016 01:29 PM, Wills Wang wrote:
>>
>>
>> On 05/22/2016 07:08 PM, Marek Vasut wrote:
>>> On 05/22/2016 05:59 AM, Wills Wang wrote:
>>>> Collect all reset operation on platform and move them into a uniform
>>>> header
>>>>
>>>> Signed-off-by: Wills Wang <wills.wang@live.com>
>>>> ---
>>>>
>>>>   arch/mips/mach-ath79/include/mach/ath79.h | 3 ---
>>>>   arch/mips/mach-ath79/include/mach/reset.h | 2 ++
>>>>   board/tplink/wdr4300/wdr4300.c            | 1 +
>>>>   3 files changed, 3 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/arch/mips/mach-ath79/include/mach/ath79.h
>>>> b/arch/mips/mach-ath79/include/mach/ath79.h
>>>> index 17af082..18d1e26 100644
>>>> --- a/arch/mips/mach-ath79/include/mach/ath79.h
>>>> +++ b/arch/mips/mach-ath79/include/mach/ath79.h
>>>> @@ -140,9 +140,6 @@ static inline int soc_is_qca956x(void)
>>>>       return soc_is_tp9343() || soc_is_qca9561();
>>>>   }
>>>>   -int ath79_eth_reset(void);
>>>> -int ath79_usb_reset(void);
>>>> -
>>>>   void ar934x_pll_init(const u16 cpu_mhz, const u16 ddr_mhz, const
>>>> u16 ahb_mhz);
>>>>   void ar934x_ddr_init(const u16 cpu_mhz, const u16 ddr_mhz, const
>>>> u16 ahb_mhz);
>>>>   diff --git a/arch/mips/mach-ath79/include/mach/reset.h
>>>> b/arch/mips/mach-ath79/include/mach/reset.h
>>>> index c383bfe..7721e1d 100644
>>>> --- a/arch/mips/mach-ath79/include/mach/reset.h
>>>> +++ b/arch/mips/mach-ath79/include/mach/reset.h
>>>> @@ -10,5 +10,7 @@
>>>>   #include <linux/types.h>
>>>>     u32 get_bootstrap(void);
>>>> +int ath79_eth_reset(void);
>>>> +int ath79_usb_reset(void);
>>> By moving the prototype into reset.h :
>>> - New functions are added to a file which can be almost removed
>>> - You need to include two headers now
>>>
>>> So drop this patch and instead focus on getting rid of reset.h
>> You mean we should use a header "ath79.h" for all?
> 
> Yes, having one header per function makes no sense and ath79.h already
> has multiple function prototypes in it.
> 

@Wills, could you please send an updated series with patches 3/7 to 7/7
which addresses Marek's comments? The merge window closes on the 4th of
June. You can also send patch 7/7 alone to enable ethernet on AP121. Thanks.
diff mbox

Patch

diff --git a/arch/mips/mach-ath79/include/mach/ath79.h b/arch/mips/mach-ath79/include/mach/ath79.h
index 17af082..18d1e26 100644
--- a/arch/mips/mach-ath79/include/mach/ath79.h
+++ b/arch/mips/mach-ath79/include/mach/ath79.h
@@ -140,9 +140,6 @@  static inline int soc_is_qca956x(void)
 	return soc_is_tp9343() || soc_is_qca9561();
 }
 
-int ath79_eth_reset(void);
-int ath79_usb_reset(void);
-
 void ar934x_pll_init(const u16 cpu_mhz, const u16 ddr_mhz, const u16 ahb_mhz);
 void ar934x_ddr_init(const u16 cpu_mhz, const u16 ddr_mhz, const u16 ahb_mhz);
 
diff --git a/arch/mips/mach-ath79/include/mach/reset.h b/arch/mips/mach-ath79/include/mach/reset.h
index c383bfe..7721e1d 100644
--- a/arch/mips/mach-ath79/include/mach/reset.h
+++ b/arch/mips/mach-ath79/include/mach/reset.h
@@ -10,5 +10,7 @@ 
 #include <linux/types.h>
 
 u32 get_bootstrap(void);
+int ath79_eth_reset(void);
+int ath79_usb_reset(void);
 
 #endif /* __ASM_MACH_RESET_H */
diff --git a/board/tplink/wdr4300/wdr4300.c b/board/tplink/wdr4300/wdr4300.c
index 6e070fd..8382ce0 100644
--- a/board/tplink/wdr4300/wdr4300.c
+++ b/board/tplink/wdr4300/wdr4300.c
@@ -9,6 +9,7 @@ 
 #include <asm/addrspace.h>
 #include <asm/types.h>
 #include <mach/ath79.h>
+#include <mach/reset.h>
 #include <mach/ar71xx_regs.h>
 #include <mach/ddr.h>
 #include <debug_uart.h>