From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 08/16] dm: Set up driver model after relocation
Date: Fri, 28 Jun 2013 22:53:57 +0200 [thread overview]
Message-ID: <201306282253.57717.marex@denx.de> (raw)
In-Reply-To: <1371613960-28678-9-git-send-email-sjg@chromium.org>
Dear Simon Glass,
> Make driver model available after relocation, by setting up data structures
> and scanning for devices using compiled-in platform_data and (when
> available) the device tree.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> Changes in v3: None
> Changes in v2: None
>
> common/board_r.c | 33 +++++++++++++++++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
> diff --git a/common/board_r.c b/common/board_r.c
> index f5649c9..5fe86ef 100644
> --- a/common/board_r.c
> +++ b/common/board_r.c
> @@ -34,6 +34,7 @@
> #ifdef CONFIG_HAS_DATAFLASH
> #include <dataflash.h>
> #endif
> +#include <dm.h>
> #include <environment.h>
> #include <fdtdec.h>
> #if defined(CONFIG_CMD_IDE)
> @@ -66,7 +67,9 @@
> #ifdef CONFIG_X86
> #include <asm/init_helpers.h>
> #endif
> +#include <dm/root.h>
> #include <linux/compiler.h>
> +#include <linux/err.h>
>
> DECLARE_GLOBAL_DATA_PTR;
>
> @@ -269,6 +272,33 @@ static int initr_malloc(void)
> return 0;
> }
>
> +#ifdef CONFIG_DM
> +static int initr_dm(void)
> +{
> + int ret;
> +
> + ret = dm_init();
> + if (ret) {
> + debug("dm_init() failed: %d\n", ret);
> + return ret;
> + }
> + ret = dm_scan_platform_data();
> + if (ret) {
> + debug("dm_scan_platform_data() failed: %d\n", ret);
> + return ret;
> + }
> +#ifdef CONFIG_OF_CONTROL
> + ret = dm_scan_fdt(gd->fdt_blob);
This part is _very_ nice!
> + if (ret) {
> + debug("dm_scan_fdt() failed: %d\n", ret);
> + return ret;
> + }
> +#endif
> +
> + return 0;
> +}
> +#endif
> +
> __weak int power_init_board(void)
> {
> return 0;
> @@ -766,6 +796,9 @@ init_fnc_t init_sequence_r[] = {
> initr_barrier,
> initr_malloc,
> bootstage_relocate,
> +#ifdef CONFIG_DM
> + initr_dm,
> +#endif
> #ifdef CONFIG_ARCH_EARLY_INIT_R
> arch_early_init_r,
> #endif
Best regards,
Marek Vasut
next prev parent reply other threads:[~2013-06-28 20:53 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-19 3:52 [U-Boot] [PATCH v3 0/16] Driver model implementation, tests, demo and GPIO Simon Glass
2013-06-19 3:52 ` [U-Boot] [PATCH v3 01/16] sandbox: Make map_to_sysmem() use a constant pointer Simon Glass
2013-06-19 3:52 ` [U-Boot] [PATCH v3 02/16] sandbox: Correct data sizes and printf() strings in fdtdec.c Simon Glass
2013-06-19 3:52 ` [U-Boot] [PATCH v3 03/16] sandbox: config: Don't use 64-bit physical memory Simon Glass
2013-06-19 3:52 ` [U-Boot] [PATCH v3 04/16] sandbox: Build a device tree file for sandbox Simon Glass
2013-06-19 3:52 ` [U-Boot] [PATCH v3 05/16] Add cmd_process_error() to report and process errors Simon Glass
2013-06-19 3:52 ` [U-Boot] [PATCH v3 06/16] sandbox: config: Enable driver model Simon Glass
2013-06-19 3:52 ` [U-Boot] [PATCH v3 07/16] dm: Add base driver model support Simon Glass
2013-06-28 20:53 ` Marek Vasut
2013-10-18 16:44 ` Simon Glass
2013-06-19 3:52 ` [U-Boot] [PATCH v3 08/16] dm: Set up driver model after relocation Simon Glass
2013-06-28 20:53 ` Marek Vasut [this message]
2013-10-18 16:45 ` Simon Glass
2013-10-19 0:45 ` Marek Vasut
2013-06-19 3:52 ` [U-Boot] [PATCH v3 09/16] dm: Add basic tests Simon Glass
2013-06-19 3:52 ` [U-Boot] [PATCH v3 10/16] dm: Add a 'dm' command for testing Simon Glass
2013-06-28 20:57 ` Marek Vasut
2013-10-18 17:00 ` Simon Glass
2013-06-19 3:52 ` [U-Boot] [PATCH v3 11/16] dm: Add a demonstration/example driver Simon Glass
2013-06-28 21:46 ` Marek Vasut
2013-10-18 19:44 ` Simon Glass
2013-06-19 3:52 ` [U-Boot] [PATCH v3 12/16] dm: Add GPIO support and tests Simon Glass
2013-06-28 21:51 ` Marek Vasut
2013-10-18 19:46 ` Simon Glass
2013-06-19 3:52 ` [U-Boot] [PATCH v3 13/16] sandbox: Convert GPIOs to use driver model Simon Glass
2013-06-19 3:52 ` [U-Boot] [PATCH v3 14/16] dm: Enable gpio command to support " Simon Glass
2013-06-19 3:52 ` [U-Boot] [PATCH v3 15/16] dm: Add README for " Simon Glass
2013-06-28 21:26 ` Marek Vasut
2013-10-18 17:05 ` Simon Glass
2013-06-19 3:52 ` [U-Boot] [PATCH v3 16/16] dm: Move old driver model documentation into an 'old-docs' directory Simon Glass
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=201306282253.57717.marex@denx.de \
--to=marex@denx.de \
--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