diff mbox series

[edk2,edk2-platforms,v1,33/38] Silicon/Hisilicon/D06: Modify for close slave core clock.

Message ID 20180724070922.63362-34-ming.huang@linaro.org
State Superseded
Headers show
Series Upload for D06 platform | expand

Commit Message

Ming Huang July 24, 2018, 7:09 a.m. UTC
From: ZhenYao <yaozhen6@huawei.com>


When BIOS booting, the power consumption is too high, so need close
some clusters clock that don't work to reduce power consumption.

The implementation of functions is in edk2-non-osi.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: ZhenYao <yaozhen6@huawei.com>

Signed-off-by: Ming Huang <ming.huang@linaro.org>

Signed-off-by: Heyi Guo <heyi.guo@linaro.org>

---
 Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.17.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Leif Lindholm Aug. 4, 2018, 3:14 p.m. UTC | #1
On Tue, Jul 24, 2018 at 03:09:17PM +0800, Ming Huang wrote:
> From: ZhenYao <yaozhen6@huawei.com>

> 

> When BIOS booting, the power consumption is too high, so need close

> some clusters clock that don't work to reduce power consumption.


On the one hand: should this not be handled in ARM-TF?
What if (during development) we load a bad EDK2 image?

> The implementation of functions is in edk2-non-osi.

> 

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: ZhenYao <yaozhen6@huawei.com>

> Signed-off-by: Ming Huang <ming.huang@linaro.org>

> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>

> ---

>  Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h | 3 +++

>  1 file changed, 3 insertions(+)

> 

> diff --git a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h

> index ec2b9a36e7..cc60e213de 100644

> --- a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h

> +++ b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h

> @@ -102,5 +102,8 @@ VOID PlatformEventBroadcastConfig(VOID);

>  UINTN GetDjtagRegBase(UINT32 NodeId);

>  VOID LlcCleanInvalidateAsm(VOID);

>  VOID PlatformMdioInit(VOID);

> +VOID CloseClusterClock(UINTN CpuClusterBase);


The opposite of Enable is Disable. So Could this be DisableClusterClock?

> +VOID EnableClusterClock(UINTN CpuClusterBase);

> +VOID CloseSktClock (UINT8 Skt);


Disable?
Also, Socket, not Skt.

/
    Leif

>  

>  #endif

> -- 

> 2.17.0

> 

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Ming Huang Aug. 9, 2018, 12:15 p.m. UTC | #2
在 8/4/2018 11:14 PM, Leif Lindholm 写道:
> On Tue, Jul 24, 2018 at 03:09:17PM +0800, Ming Huang wrote:
>> From: ZhenYao <yaozhen6@huawei.com>
>>
>> When BIOS booting, the power consumption is too high, so need close
>> some clusters clock that don't work to reduce power consumption.
> 
> On the one hand: should this not be handled in ARM-TF?

This can no be handled in TF and should be handled in Sec phase.

> What if (during development) we load a bad EDK2 image?

Sorry, I don't understand really.

> 
>> The implementation of functions is in edk2-non-osi.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: ZhenYao <yaozhen6@huawei.com>
>> Signed-off-by: Ming Huang <ming.huang@linaro.org>
>> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
>> ---
>>  Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
>> index ec2b9a36e7..cc60e213de 100644
>> --- a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
>> +++ b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
>> @@ -102,5 +102,8 @@ VOID PlatformEventBroadcastConfig(VOID);
>>  UINTN GetDjtagRegBase(UINT32 NodeId);
>>  VOID LlcCleanInvalidateAsm(VOID);
>>  VOID PlatformMdioInit(VOID);
>> +VOID CloseClusterClock(UINTN CpuClusterBase);
> 
> The opposite of Enable is Disable. So Could this be DisableClusterClock?

Yes, this name is better.

> 
>> +VOID EnableClusterClock(UINTN CpuClusterBase);
>> +VOID CloseSktClock (UINT8 Skt);
> 
> Disable?
> Also, Socket, not Skt.

OK, modify it in v2.

> 
> /
>     Leif
> 
>>  
>>  #endif
>> -- 
>> 2.17.0
>>
Leif Lindholm Aug. 9, 2018, 12:27 p.m. UTC | #3
On Thu, Aug 09, 2018 at 08:15:27PM +0800, Ming wrote:
> 在 8/4/2018 11:14 PM, Leif Lindholm 写道:
> > On Tue, Jul 24, 2018 at 03:09:17PM +0800, Ming Huang wrote:
> >> From: ZhenYao <yaozhen6@huawei.com>
> >>
> >> When BIOS booting, the power consumption is too high, so need close
> >> some clusters clock that don't work to reduce power consumption.
> > 
> > On the one hand: should this not be handled in ARM-TF?
> 
> This can no be handled in TF and should be handled in Sec phase.

OK.
Well, as long as it's in Sec phase, I guess it doesn't make too much
difference.

> > What if (during development) we load a bad EDK2 image?
> 
> Sorry, I don't understand really.

What happens to the system if the EDK2 image crashes before we get
here? Will it overheat and damage the silicon? Or is it purely a power
consumption issue to avoid blowing the fuses in the data centre when
you power on a whole rack at once?

/
    Leif

> >> The implementation of functions is in edk2-non-osi.
> >>
> >> Contributed-under: TianoCore Contribution Agreement 1.1
> >> Signed-off-by: ZhenYao <yaozhen6@huawei.com>
> >> Signed-off-by: Ming Huang <ming.huang@linaro.org>
> >> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
> >> ---
> >>  Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h | 3 +++
> >>  1 file changed, 3 insertions(+)
> >>
> >> diff --git a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
> >> index ec2b9a36e7..cc60e213de 100644
> >> --- a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
> >> +++ b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
> >> @@ -102,5 +102,8 @@ VOID PlatformEventBroadcastConfig(VOID);
> >>  UINTN GetDjtagRegBase(UINT32 NodeId);
> >>  VOID LlcCleanInvalidateAsm(VOID);
> >>  VOID PlatformMdioInit(VOID);
> >> +VOID CloseClusterClock(UINTN CpuClusterBase);
> > 
> > The opposite of Enable is Disable. So Could this be DisableClusterClock?
> 
> Yes, this name is better.
> 
> > 
> >> +VOID EnableClusterClock(UINTN CpuClusterBase);
> >> +VOID CloseSktClock (UINT8 Skt);
> > 
> > Disable?
> > Also, Socket, not Skt.
> 
> OK, modify it in v2.
> 
> > 
> > /
> >     Leif
> > 
> >>  
> >>  #endif
> >> -- 
> >> 2.17.0
> >>
Ming Huang Aug. 10, 2018, 2:05 a.m. UTC | #4
在 8/9/2018 8:27 PM, Leif Lindholm 写道:
> On Thu, Aug 09, 2018 at 08:15:27PM +0800, Ming wrote:
>> 在 8/4/2018 11:14 PM, Leif Lindholm 写道:
>>> On Tue, Jul 24, 2018 at 03:09:17PM +0800, Ming Huang wrote:
>>>> From: ZhenYao <yaozhen6@huawei.com>
>>>>
>>>> When BIOS booting, the power consumption is too high, so need close
>>>> some clusters clock that don't work to reduce power consumption.
>>>
>>> On the one hand: should this not be handled in ARM-TF?
>>
>> This can no be handled in TF and should be handled in Sec phase.
> 
> OK.
> Well, as long as it's in Sec phase, I guess it doesn't make too much
> difference.
> 
>>> What if (during development) we load a bad EDK2 image?
>>
>> Sorry, I don't understand really.
> 
> What happens to the system if the EDK2 image crashes before we get
> here? Will it overheat and damage the silicon? Or is it purely a power
> consumption issue to avoid blowing the fuses in the data centre when
> you power on a whole rack at once?

It will not damage the silicon if wo load a bad EDK2 image.
It is purely a power consumption issue.

> 
> /
>     Leif
> 
>>>> The implementation of functions is in edk2-non-osi.
>>>>
>>>> Contributed-under: TianoCore Contribution Agreement 1.1
>>>> Signed-off-by: ZhenYao <yaozhen6@huawei.com>
>>>> Signed-off-by: Ming Huang <ming.huang@linaro.org>
>>>> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
>>>> ---
>>>>  Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h | 3 +++
>>>>  1 file changed, 3 insertions(+)
>>>>
>>>> diff --git a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
>>>> index ec2b9a36e7..cc60e213de 100644
>>>> --- a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
>>>> +++ b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
>>>> @@ -102,5 +102,8 @@ VOID PlatformEventBroadcastConfig(VOID);
>>>>  UINTN GetDjtagRegBase(UINT32 NodeId);
>>>>  VOID LlcCleanInvalidateAsm(VOID);
>>>>  VOID PlatformMdioInit(VOID);
>>>> +VOID CloseClusterClock(UINTN CpuClusterBase);
>>>
>>> The opposite of Enable is Disable. So Could this be DisableClusterClock?
>>
>> Yes, this name is better.
>>
>>>
>>>> +VOID EnableClusterClock(UINTN CpuClusterBase);
>>>> +VOID CloseSktClock (UINT8 Skt);
>>>
>>> Disable?
>>> Also, Socket, not Skt.
>>
>> OK, modify it in v2.
>>
>>>
>>> /
>>>     Leif
>>>
>>>>  
>>>>  #endif
>>>> -- 
>>>> 2.17.0
>>>>
diff mbox series

Patch

diff --git a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
index ec2b9a36e7..cc60e213de 100644
--- a/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
+++ b/Silicon/Hisilicon/Include/Library/PlatformSysCtrlLib.h
@@ -102,5 +102,8 @@  VOID PlatformEventBroadcastConfig(VOID);
 UINTN GetDjtagRegBase(UINT32 NodeId);
 VOID LlcCleanInvalidateAsm(VOID);
 VOID PlatformMdioInit(VOID);
+VOID CloseClusterClock(UINTN CpuClusterBase);
+VOID EnableClusterClock(UINTN CpuClusterBase);
+VOID CloseSktClock (UINT8 Skt);
 
 #endif