[PATCH 07/16] sandbox: add support to pass dtb to barebox

Sascha Hauer s.hauer at pengutronix.de
Sat Feb 28 23:33:52 PST 2015


On Sat, Feb 28, 2015 at 10:40:12PM +0100, Marc Kleine-Budde wrote:
> Signed-off-by: Marc Kleine-Budde <mkl at pengutronix.de>
> ---
>  arch/sandbox/board/Makefile                    |  1 +
>  arch/sandbox/board/dtb.c                       | 57 ++++++++++++++++++++++++++
>  arch/sandbox/mach-sandbox/include/mach/linux.h |  1 +
>  arch/sandbox/os/common.c                       | 47 ++++++++++++++++++++-
>  4 files changed, 105 insertions(+), 1 deletion(-)
>  create mode 100644 arch/sandbox/board/dtb.c
> 
> diff --git a/arch/sandbox/board/Makefile b/arch/sandbox/board/Makefile
> index 5104f5cb2679..460116332df9 100644
> --- a/arch/sandbox/board/Makefile
> +++ b/arch/sandbox/board/Makefile
> @@ -3,5 +3,6 @@ obj-y += clock.o
>  obj-y += hostfile.o
>  obj-y += console.o
>  obj-y += devices.o
> +obj-y += dtb.o
>  
>  extra-y += barebox.lds
> diff --git a/arch/sandbox/board/dtb.c b/arch/sandbox/board/dtb.c
> new file mode 100644
> index 000000000000..9d4210164e01
> --- /dev/null
> +++ b/arch/sandbox/board/dtb.c
> @@ -0,0 +1,57 @@
> +/*
> + * Copyright (c) 2013 Sascha Hauer <s.hauer at pengutronix.de>, Pengutronix
> + * Copyright (c) 2015 Marc Kleine-Budde <mkl at pengutronix.de>, Pengutronix
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2
> + * as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + */
> +
> +#include <common.h>
> +#include <init.h>
> +#include <of.h>
> +
> +#include <mach/linux.h>
> +#include <linux/err.h>
> +
> +static const void *dtb;
> +
> +int barebox_register_dtb(const void *new_dtb)
> +{
> +	if (dtb)
> +		return -EBUSY;
> +
> +	dtb = new_dtb;
> +
> +	return 0;
> +}
> +
> +static int of_sandbox_init(void)
> +{
> +	struct device_node *root;
> +
> +	if (!dtb)
> +		return 0;
> +
> +	root = of_unflatten_dtb(dtb);

of_unflatten_dtb is only defined when CONFIG_OFTREE is enabled. I see
nothing in this patch selectin this option or depending on this option.
Does this compile with device tree support disabled?

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list