diff mbox

[U-Boot,09/12] sunxi: H5: add COUNTER_FREQUENCY

Message ID 1484271004-19681-10-git-send-email-andre.przywara@arm.com
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Andre Przywara Jan. 13, 2017, 1:30 a.m. UTC
For the arch timer to work properly, we need to setup the CNTFRQ
register, which is only possible in EL3.
Define the arch timer frequency in sun8i.h as well, so that ARMv8's
start.S can program the register correctly.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 include/configs/sun8i.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Maxime Ripard Jan. 16, 2017, 8:01 a.m. UTC | #1
On Fri, Jan 13, 2017 at 01:30:01AM +0000, Andre Przywara wrote:
> For the arch timer to work properly, we need to setup the CNTFRQ
> register, which is only possible in EL3.
> Define the arch timer frequency in sun8i.h as well, so that ARMv8's
> start.S can program the register correctly.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  include/configs/sun8i.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/configs/sun8i.h b/include/configs/sun8i.h
> index a4c3fb6..cbb7239 100644
> --- a/include/configs/sun8i.h
> +++ b/include/configs/sun8i.h
> @@ -13,6 +13,8 @@
>   * A23 specific configuration
>   */
>  
> +#define COUNTER_FREQUENCY		CONFIG_TIMER_CLK_FREQ
> +

Why not convert the armv8 code to use CONFIG_TIMER_CLK_FREQ, or armv7
to use COUNTER_FREQUENCY?

The both options seem redundant.

Maxime
Andre Przywara Jan. 22, 2017, 1:06 a.m. UTC | #2
Hi,

On 16/01/17 08:01, Maxime Ripard wrote:
> On Fri, Jan 13, 2017 at 01:30:01AM +0000, Andre Przywara wrote:
>> For the arch timer to work properly, we need to setup the CNTFRQ
>> register, which is only possible in EL3.
>> Define the arch timer frequency in sun8i.h as well, so that ARMv8's
>> start.S can program the register correctly.
>>
>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>> ---
>>  include/configs/sun8i.h | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/include/configs/sun8i.h b/include/configs/sun8i.h
>> index a4c3fb6..cbb7239 100644
>> --- a/include/configs/sun8i.h
>> +++ b/include/configs/sun8i.h
>> @@ -13,6 +13,8 @@
>>   * A23 specific configuration
>>   */
>>  
>> +#define COUNTER_FREQUENCY		CONFIG_TIMER_CLK_FREQ
>> +
> 
> Why not convert the armv8 code to use CONFIG_TIMER_CLK_FREQ, or armv7
> to use COUNTER_FREQUENCY?
> 
> The both options seem redundant.

Good point, they indeed are.
So I will drop this patch here and instead have a new one to rename the
v7 users over to use COUNTER_FREQUENCY.
I chose COUNTER_FREQUENCY because the other symbol has less users.

Thanks for the idea!

Cheers,
Andre.
diff mbox

Patch

diff --git a/include/configs/sun8i.h b/include/configs/sun8i.h
index a4c3fb6..cbb7239 100644
--- a/include/configs/sun8i.h
+++ b/include/configs/sun8i.h
@@ -13,6 +13,8 @@ 
  * A23 specific configuration
  */
 
+#define COUNTER_FREQUENCY		CONFIG_TIMER_CLK_FREQ
+
 #ifdef CONFIG_USB_EHCI
 #define CONFIG_USB_EHCI_SUNXI
 #endif