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

Bin Meng bmeng.cn at gmail.com
Wed Apr 29 07:01:53 CEST 2015


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>

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.

[snip]

Regards,
Bin


More information about the U-Boot mailing list