[U-Boot] [PATCH v2 07/20] dm: Implement a CPU uclass

Simon Glass sjg at chromium.org
Thu Apr 30 06:22:09 CEST 2015


On 29 April 2015 at 08:07, Bin Meng <bmeng.cn at gmail.com> wrote:
> Hi Simon,
>
> On Wed, Apr 29, 2015 at 9:32 PM, Simon Glass <sjg at chromium.org> wrote:
>> Hi Bin,
>>
>> On 28 April 2015 at 23:01, Bin Meng <bmeng.cn at gmail.com> wrote:
>>> Hi Simon,
>>>
>>> On Wed, Apr 29, 2015 at 10:25 AM, Simon Glass <sjg at chromium.org> wrote:
>>>> It is useful to be able to keep track of the available CPUs in a multi-CPU
>>>> system. This uclass is mostly intended for use with SMP systems.
>>>>
>>>> The uclass provides methods for getting basic information about each CPU.
>>>>
>>>> Signed-off-by: Simon Glass <sjg at chromium.org>
>>>> ---
>>>
>>> Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
>>>

Applied to u-boot-x86.

>>> But one comment raised previously not addressed below.
>>>
>>>>
>>>> Changes in v2:
>>>> - Change header guard to capital letters
>>>> - Change get_info() in function comment to cpu_get_info()
>>>>
>>>>  drivers/Kconfig          |  2 ++
>>>>  drivers/Makefile         |  1 +
>>>>  drivers/cpu/Kconfig      |  8 +++++
>>>>  drivers/cpu/Makefile     |  7 ++++
>>>>  drivers/cpu/cpu-uclass.c | 61 +++++++++++++++++++++++++++++++++++
>>>>  include/cpu.h            | 84 ++++++++++++++++++++++++++++++++++++++++++++++++
>>>>  include/dm/uclass-id.h   |  1 +
>>>>  7 files changed, 164 insertions(+)
>>>>  create mode 100644 drivers/cpu/Kconfig
>>>>  create mode 100644 drivers/cpu/Makefile
>>>>  create mode 100644 drivers/cpu/cpu-uclass.c
>>>>  create mode 100644 include/cpu.h
>>>>
>>>> diff --git a/drivers/Kconfig b/drivers/Kconfig
>>>> index 941aa0c..1f40887 100644
>>>> --- a/drivers/Kconfig
>>>> +++ b/drivers/Kconfig
>>>> @@ -2,6 +2,8 @@ menu "Device Drivers"
>>>>
>>>>  source "drivers/core/Kconfig"
>>>>
>>>> +source "drivers/cpu/Kconfig"
>>>> +
>>>>  source "drivers/demo/Kconfig"
>>>>
>>>>  source "drivers/pci/Kconfig"
>>>> diff --git a/drivers/Makefile b/drivers/Makefile
>>>> index 5ef58c0..405b64b 100644
>>>> --- a/drivers/Makefile
>>>> +++ b/drivers/Makefile
>>>> @@ -3,6 +3,7 @@ obj-$(CONFIG_DM_DEMO) += demo/
>>>>  obj-$(CONFIG_BIOSEMU) += bios_emulator/
>>>>  obj-y += block/
>>>>  obj-$(CONFIG_BOOTCOUNT_LIMIT) += bootcount/
>>>> +obj-$(CONFIG_CPU) += cpu/
>>>>  obj-y += crypto/
>>>>  obj-$(CONFIG_FPGA) += fpga/
>>>>  obj-y += hwmon/
>>>> diff --git a/drivers/cpu/Kconfig b/drivers/cpu/Kconfig
>>>> new file mode 100644
>>>> index 0000000..0d1424d
>>>> --- /dev/null
>>>> +++ b/drivers/cpu/Kconfig
>>>> @@ -0,0 +1,8 @@
>>>> +config CPU
>>>
>>> Should it be DM_CPU? Like other DM drivers (DM_SERIAL, DM_I2C, etc).
>>>
>>>> +       bool "Enable CPU drivers using Driver Model"
>>>> +       help
>>>> +         This allows drivers to be provided for CPUs and their type to be
>>>> +         specified in the board's device tree. For boards which support
>>>> +         multiple CPUs, then normally have to be set up in U-Boot so that
>>>> +         they can work correctly in the OS. This provides a framework for
>>>> +         finding out information about available CPUs and making changes.
>>>
>>
>> I prefer only using the DM prefix when there is a non-DM option. In
>> fact the way it is supposed to work is that eventually the
>> CONFIG_DM... option goes away. When every board uses DM for a
>> subsystem we should be able to drop it.
>>
>
> Good to know that those CONFIG_DM_xxx will eventually go away.
>
>> CPU support (or whatever we call it) will only be available with
>> driver model, so I don't think we need separate CONFIG_CPU and
>> CONFIG_DM_CPU options.
>>
>
> OK.
>
> Regards,
> Bin


More information about the U-Boot mailing list