[U-Boot] [RFC PATCH v1] lib: make strmhz available in SPL
Chris Packham
Chris.Packham at alliedtelesis.co.nz
Wed May 25 06:56:14 CEST 2016
On 05/25/2016 03:30 PM, Simon Glass wrote:
> Hi Chris,
>
> On 24 May 2016 at 20:20, Chris Packham <judge.packham at gmail.com> wrote:
>> From: Chris Packham <chris.packham at alliedtelesis.co.nz>
>>
>> When setting up a DDR controller it is useful to be able to display
>> frequencies in a readable form. Make the strmhz() function available in
>> SPL builds provided there is full vsprintf available.
>>
>> Reviewed-by: Tony O'Brien <tony.obrien at alliedtelesis.co.nz>
>> Signed-off-by: Chris Packham <judge.packham at gmail.com>
>> ---
>>
>> lib/Makefile | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> Reviewed-by: Simon Glass <sjg at chromium.org>
>
> I notice there is print_freq(). Should these be rationalised?
They appear to do different things. strmhz() populates a string with a
value in MHz rounded to 3 places (i.e. the nearest KHz). print_freq()
can handle Hz, KHz, MHz and GHz it also prints the output directly
rather than to a user supplied buffer.
strmhz() is much more widely used but both strmhz() and print_freq() are
used in command output ("bdinfo" and "cpu detail" respectively) so I
don't think it would be a simple case of swapping one for the other.
More information about the U-Boot
mailing list