[u-boot][PATCH v2 1/4] dm: memory: Introduce new uclass

Simon Glass sjg at chromium.org
Thu Oct 6 21:07:29 CEST 2022


Hi Roger,

On Thu, 6 Oct 2022 at 07:24, Roger Quadros <rogerq at kernel.org> wrote:
>
> Introduce UCLASS_MEMORY for future Memory Controller
> device drivers.
>
> Signed-off-by: Roger Quadros <rogerq at kernel.org>
> ---
>  arch/sandbox/dts/test.dts       |  4 ++++
>  drivers/memory/Kconfig          | 17 +++++++++++++++++
>  drivers/memory/Makefile         |  2 ++
>  drivers/memory/memory-sandbox.c | 18 ++++++++++++++++++
>  drivers/memory/memory-uclass.c  | 13 +++++++++++++
>  include/dm/uclass-id.h          |  1 +
>  test/dm/Makefile                |  1 +
>  test/dm/memory.c                | 21 +++++++++++++++++++++
>  8 files changed, 77 insertions(+)
>  create mode 100644 drivers/memory/memory-sandbox.c
>  create mode 100644 drivers/memory/memory-uclass.c
>  create mode 100644 test/dm/memory.c
>

Reviewed-by: Simon Glass <sjg at chromium.org>
(with change below)

> diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
> index 2761588f0d..d65b2d2dcb 100644
> --- a/arch/sandbox/dts/test.dts
> +++ b/arch/sandbox/dts/test.dts
> @@ -926,6 +926,10 @@
>                 };
>         };
>
> +       memory-controller {
> +               compatible = "sandbox,memory";
> +       };
> +
>         misc-test {
>                 #address-cells = <1>;
>                 #size-cells = <1>;
> diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
> index 7271892763..632feb3aaa 100644
> --- a/drivers/memory/Kconfig
> +++ b/drivers/memory/Kconfig
> @@ -4,6 +4,23 @@
>
>  menu "Memory Controller drivers"
>
> +config DM_MEMORY

Please use MEMORY since there is no non-DM memory option.

> +       bool "Enable Driver Model for Memory Controller drivers"
> +       depends on DM
> +       help
> +         Enable driver model for Memory Controller devices.
> +         These devices provide Memory bus interface to various devices like
> +         SRAM, Ethernet adapters, FPGAs, etc.
> +         For now this uclass has no methods yet.
> +
> +config SANDBOX_MEMORY
> +       bool "Enable Sandbox Memory Controller driver"
> +       depends on SANDBOX && DM_MEMORY
> +       help
> +         This is a driver model based Memory Controller driver for sandbox.
> +         Currently it is a stub only, as there are no usable uclass methods
> +         yet.
> +
>  config STM32_FMC2_EBI
>         bool "Support for FMC2 External Bus Interface on STM32MP SoCs"
>         depends on ARCH_STM32MP
[..]

Regards,
Simon


More information about the U-Boot mailing list