2021-05-27 06:52:13 -07:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2020-2021, SiFive Inc
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Pragnesh Patel <pragnesh.patel@sifive.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
2021-09-01 15:01:42 +08:00
|
|
|
#include <cpu_func.h>
|
2021-05-27 06:52:13 -07:00
|
|
|
#include <dm.h>
|
2021-07-27 17:06:59 +08:00
|
|
|
#include <asm/sections.h>
|
|
|
|
|
2021-10-26 09:12:33 +03:00
|
|
|
void *board_fdt_blob_setup(int *err)
|
2021-07-27 17:06:59 +08:00
|
|
|
{
|
2021-10-26 09:12:33 +03:00
|
|
|
*err = 0;
|
2022-01-05 09:07:57 +08:00
|
|
|
if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) {
|
2021-07-27 17:06:59 +08:00
|
|
|
if (gd->arch.firmware_fdt_addr)
|
2021-09-12 11:15:16 +08:00
|
|
|
return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
|
2021-07-27 17:06:59 +08:00
|
|
|
}
|
2021-09-11 22:31:23 +08:00
|
|
|
|
|
|
|
return (ulong *)&_end;
|
2021-07-27 17:06:59 +08:00
|
|
|
}
|
2021-05-27 06:52:13 -07:00
|
|
|
|
|
|
|
int board_init(void)
|
|
|
|
{
|
|
|
|
/* enable all cache ways */
|
2021-09-01 15:01:42 +08:00
|
|
|
enable_caches();
|
|
|
|
|
2021-05-27 06:52:13 -07:00
|
|
|
return 0;
|
|
|
|
}
|