Re: [PATCH v2 03/12] Add initial RISC-V architecture support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 28, 2018 at 10:39:44AM +0300, Antony Pavlov wrote:
> Signed-off-by: Antony Pavlov <antonynpavlov@xxxxxxxxx>
> ---
> +++ b/arch/riscv/lib/barebox.lds.S
> @@ -0,0 +1,89 @@
> +/*
> + * Copyright (C) 2016 Antony Pavlov <antonynpavlov@xxxxxxxxx>
> + *
> + * This file is part of barebox.
> + * 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 <asm-generic/barebox.lds.h>
> +
> +OUTPUT_ARCH(riscv)
> +ENTRY(_start)
> +SECTIONS
> +{
> +	. = TEXT_BASE;
> +
> +	. = ALIGN(8);
> +	.text      :
> +	{
> +		_stext = .;
> +		_start = .;
> +		KEEP(*(.text_entry*))
> +		_text = .;
> +		__bare_init_start = .;
> +		*(.text_bare_init*)
> +		__bare_init_end = .;
> +		*(.text*)
> +	}
> +	BAREBOX_BARE_INIT_SIZE

Do you need these __bare_init* stuff? If not I would prefer to remove
it.

> +
> +	PRE_IMAGE

Same here.

> +static int of_riscv_init(void)
> +{
> +	struct device_node *root;
> +
> +	root = of_get_root_node();
> +	if (root)
> +		return 0;
> +
> +	root = of_unflatten_dtb(__dtb_start);
> +	if (!IS_ERR(root)) {
> +		pr_debug("using internal DTB\n");
> +		of_set_root_node(root);
> +		if (IS_ENABLED(CONFIG_OFDEVICE))
> +			of_probe();
> +	}

Can we just call of_unflatten_dtb()/of_set_root_node() from the board
code and use obj-dtb-y to include the dtb?

That way a board can specify the dtb and not the config.

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 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux