U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sumit Garg <sumit.garg@kernel.org>
To: Caleb Connolly <caleb.connolly@linaro.org>
Cc: Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Lukasz Majewski <lukma@denx.de>,
	Sean Anderson <seanga2@gmail.com>,
	u-boot@lists.denx.de, u-boot-qcom@groups.io
Subject: Re: [PATCH 1/6] event: signal when livetree has been built
Date: Thu, 10 Apr 2025 14:14:44 +0530	[thread overview]
Message-ID: <Z_eE_JjxDb84s-k2@sumit-X1> (raw)
In-Reply-To: <20250409-livetree-fixup-v1-1-76dfea80b07f@linaro.org>

On Wed, Apr 09, 2025 at 07:17:24PM +0200, Caleb Connolly wrote:
> OF_LIVE offers a variety of benefits, one of them being that the live
> tree can be modified without caring about the underlying FDT. This is
> particularly valuable for working around U-Boot limitations like lacking
> USB superspeed support on Qualcomm platforms, no runtime OTG, or
> peripherals like the sdcard being broken (and displaying potentially
> worrying error messages).
> 
> Add an event to signal when the live tree has been built so that we can
> apply fixups to it directly before devices are bound.
> 
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
>  common/event.c  | 3 +++
>  include/event.h | 9 +++++++++
>  lib/of_live.c   | 3 +++
>  3 files changed, 15 insertions(+)
>

Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com>

-Sumit

> diff --git a/common/event.c b/common/event.c
> index dda569d447851f559a83f98fb7b1f3543156eab5..8d7513eb10b61919e1e784481dfdcc076be14986 100644
> --- a/common/event.c
> +++ b/common/event.c
> @@ -47,8 +47,11 @@ const char *const type_name[] = {
>  	"ft_fixup",
>  
>  	/* main loop events */
>  	"main_loop",
> +
> +	/* livetree has been built */
> +	"of_live_init",
>  };
>  
>  _Static_assert(ARRAY_SIZE(type_name) == EVT_COUNT, "event type_name size");
>  #endif
> diff --git a/include/event.h b/include/event.h
> index 75141a192a48b0931667632f41be8ff4d6139f7c..3fc673ba635ed45467aae8587705d37bef1c2a3f 100644
> --- a/include/event.h
> +++ b/include/event.h
> @@ -152,8 +152,17 @@ enum event_t {
>  	 * A non-zero return value causes the boot to fail.
>  	 */
>  	EVT_MAIN_LOOP,
>  
> +	/**
> +	 * @EVT_OF_LIVE_INIT:
> +	 * This event is triggered immediately after the live device tree has been
> +	 * built. This allows for machine specific fixups to be done to the live tree
> +	 * (like disabling known-unsupported devices) before DM init happens. This
> +	 * event is only available if OF_LIVE is enabled and is only used after relocation.
> +	 */
> +	EVT_OF_LIVE_INIT,
> +
>  	/**
>  	 * @EVT_COUNT:
>  	 * This constants holds the maximum event number + 1 and is used when
>  	 * looping over all event classes.
> diff --git a/lib/of_live.c b/lib/of_live.c
> index 90b9459ede313e492e28c8556c730f3bd8aaa9df..e1962b8f1fb9d8c2c87d04ca4e238a1e4d00376a 100644
> --- a/lib/of_live.c
> +++ b/lib/of_live.c
> @@ -10,8 +10,9 @@
>  
>  #define LOG_CATEGORY	LOGC_DT
>  
>  #include <abuf.h>
> +#include <event.h>
>  #include <log.h>
>  #include <linux/libfdt.h>
>  #include <of_live.h>
>  #include <malloc.h>
> @@ -334,8 +335,10 @@ int of_live_build(const void *fdt_blob, struct device_node **rootp)
>  		return ret;
>  	}
>  	debug("%s: stop\n", __func__);
>  
> +	event_notify_null(EVT_OF_LIVE_INIT);
> +
>  	return ret;
>  }
>  
>  void of_live_free(struct device_node *root)
> 
> -- 
> 2.49.0
> 

  reply	other threads:[~2025-04-10  8:44 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09 17:17 [PATCH 0/6] Qualcomm: cleanup OF_LIVE fixup and fix RB1/2 Caleb Connolly
2025-04-09 17:17 ` [PATCH 1/6] event: signal when livetree has been built Caleb Connolly
2025-04-10  8:44   ` Sumit Garg [this message]
2025-04-10  8:54   ` Neil Armstrong
2025-04-10 11:27   ` Simon Glass
2025-04-10 13:00     ` Caleb Connolly
2025-04-10 13:07       ` Simon Glass
2025-04-10 14:04         ` Caleb Connolly
2025-04-10 14:15           ` Simon Glass
2025-04-10 15:41             ` Caleb Connolly
2025-04-10 21:25               ` Simon Glass
2025-04-11 11:52                 ` Caleb Connolly
2025-04-11 18:30                   ` Simon Glass
2025-04-09 17:17 ` [PATCH 2/6] mach-snapdragon: use EVT_OF_LIVE_INIT to apply DT fixups Caleb Connolly
2025-04-10  8:50   ` Sumit Garg
2025-04-10  8:54   ` Neil Armstrong
2025-04-09 17:17 ` [PATCH 3/6] mach-snapdragon: of_fixup: skip disabled USB nodes Caleb Connolly
2025-04-10  7:45   ` Neil Armstrong
2025-04-10  8:51   ` Sumit Garg
2025-04-09 17:17 ` [PATCH 4/6] clk/qcom: qcm2290: show clock name in set_rate() Caleb Connolly
2025-04-10  7:45   ` Neil Armstrong
2025-04-10  8:51   ` Sumit Garg
2025-04-09 17:17 ` [PATCH 5/6] mach-snapdragon: of_fixup: set dr_mode for RB1/2 boards Caleb Connolly
2025-04-10  7:46   ` Neil Armstrong
2025-04-10  9:04   ` Sumit Garg
2025-04-09 17:17 ` [PATCH 6/6] pinctrl: qcom: qcm2290: fix off by 1 in pin_count Caleb Connolly
2025-04-10  7:46   ` Neil Armstrong
2025-04-10  9:05   ` Sumit Garg
2025-04-10  8:41 ` [PATCH 0/6] Qualcomm: cleanup OF_LIVE fixup and fix RB1/2 Sumit Garg
2025-04-10  9:54 ` Caleb Connolly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z_eE_JjxDb84s-k2@sumit-X1 \
    --to=sumit.garg@kernel.org \
    --cc=caleb.connolly@linaro.org \
    --cc=lukma@denx.de \
    --cc=neil.armstrong@linaro.org \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox