[U-Boot] [RFC PATCH 3/3] arm: bootm: Add dm_pre_os_remove() call to announce_and_cleanup()

Simon Glass sjg at chromium.org
Fri Mar 3 04:53:11 UTC 2017


Hi Stefan,

On 1 March 2017 at 03:23, Stefan Roese <sr at denx.de> wrote:
> This patch adds a call to dm_pre_os_remove() to announce_and_cleanup()
> so that drivers that have the flag DM_FLAG_PRE_OS_REMOVE set may do
> some last-stage cleanup before the OS is started.
>
> Signed-off-by: Stefan Roese <sr at denx.de>
> Cc: Simon Glass <sjg at chromium.org>
> ---
>  arch/arm/lib/bootm.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> index 8125cf023f..84f3415c1e 100644
> --- a/arch/arm/lib/bootm.c
> +++ b/arch/arm/lib/bootm.c
> @@ -91,6 +91,14 @@ static void announce_and_cleanup(int fake)
>
>         board_quiesce_devices();
>
> +       /*
> +        * Call remove function of all devices with the pre-OS remove flag
> +        * set (DM_FLAG_PRE_OS_REMOVE). This may be useful for last-stage
> +        * operations, like cancelling of DMA operation or releasing device
> +        * internal buffers.
> +        */
> +       dm_pre_os_remove();

In a full DM world we could perhaps have devices which use the DMA
uclass, so we can tell which ones need to be removed.

How about dm_remove_dma_devices()?

> +
>         cleanup_before_linux();
>  }
>
> --
> 2.12.0
>

Also (once we have things figured out) this needs some sort of test in test/.

Regards,
Simon


More information about the U-Boot mailing list