[U-Boot] [PATCH 6/8] cpu: Add cpu_print_info function

Simon Glass sjg at chromium.org
Wed Apr 18 15:45:28 UTC 2018


Hi Mario,

On 18 April 2018 at 02:35, Mario Six <mario.six at gdsys.cc> wrote:
> Hi Simon,
>
> On Thu, Apr 12, 2018 at 6:37 PM, Simon Glass <sjg at chromium.org> wrote:
>> Hi Mario,
>>
>> On 11 April 2018 at 00:39, Mario Six <mario.six at gdsys.cc> wrote:
>>> Hi Simon,
>>>
>>> On Fri, Mar 30, 2018 at 10:41 AM, Simon Glass <sjg at chromium.org> wrote:
>>>> Hi,
>>>>
>>>> On 28 March 2018 at 20:38, Mario Six <mario.six at gdsys.cc> wrote:
>>>>> Add a cpu_print_info function to the CPU uclass to emulate the behavior
>>>>> of some current non-DM drivers (e.g. MPC83xx) to print CPU information
>>>>> during startup.
>>>>>
>>>>> Signed-off-by: Mario Six <mario.six at gdsys.cc>
>>>>> ---
>>>>>  drivers/cpu/cpu-uclass.c | 10 ++++++++++
>>>>>  include/cpu.h            | 15 +++++++++++++++
>>>>>  2 files changed, 25 insertions(+)
>>>>>
>>>>
>>>> I really don't want drivers printing stuff. Can you use the existing
>>>> get_info() method?
>>>>
>>>
>>> I could, but I'm just emulating the behavior of the legacy code here, which
>>> prints some information when the CPU is initialized. I think that's pretty
>>> useful, and I can do that in our board file, but that would mean implementing
>>> the same routine in every MPC83xx board to get the legacy behavior back.
>>
>> Yes, but I don't want the legacy code creeping into the eclass. Can
>> you convert the board to use the CPU eclass instead?
>>
>
> That's what I did, and I just discovered DISPLAY_CPUINFO, which does exactly
> what is needed. I'll implement the print_cpuinfo function in the CPU driver, so
> I can get rid of the print function in the uclass (and still retain the
> information printing at bootup).

OK I see. Ideally we would have a function (perhaps in board_f) which
prints out the CPU info after obtaining it from the uclass. So could
you move your print_cpuinfo() function into board_f? Would it be
possible to use that if CONFIG_CPU is defined?

At some point print_cpuinfo() could be removed from various board files.

Regards,
Simon


More information about the U-Boot mailing list