Re: [PATCH 1/5] k1c: Initial Kalray Coolidge (k1c) architecture support

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

 



On Wed, Jan 15, 2020 at 11:26:46AM +0100, Clement Leger wrote:
> +config MALLOC_BASE
> +	hex
> +	default 0x100000000
> +
> +config MALLOC_SIZE
> +	hex
> +	default 0x800000
> +	prompt "malloc area size"
> +endmenu

> diff --git a/arch/k1c/lib/board.c b/arch/k1c/lib/board.c
> new file mode 100644
> index 000000000..d17a32614
> --- /dev/null
> +++ b/arch/k1c/lib/board.c
> @@ -0,0 +1,20 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (C) 2019 Kalray Inc.
> + */
> +
> +#include <common.h>
> +#include <malloc.h>
> +#include <memory.h>
> +#include <asm-generic/memory_layout.h>
> +
> +
> +void __noreturn k1c_start_barebox(void)
> +{
> +	mem_malloc_init((void *)CONFIG_MALLOC_BASE,
> +			(void *)(CONFIG_MALLOC_BASE + MALLOC_SIZE - 1));

You could extract valid memory from the device tree instead and pick
some memory for malloc there. See of_find_mem() how this can be done.

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
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