blob: 6675548c2bf81ae648194c6ef7db9443010d795f [file] [log] [blame]
Green Wan2e5da522021-05-27 06:52:13 -07001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (c) 2020-2021, SiFive Inc
4 *
5 * Authors:
6 * Pragnesh Patel <pragnesh.patel@sifive.com>
7 */
8
9#include <common.h>
Zong Liec348492021-09-01 15:01:42 +080010#include <cpu_func.h>
Green Wan2e5da522021-05-27 06:52:13 -070011#include <dm.h>
Zong Li5cc6af22021-07-27 17:06:59 +080012#include <asm/sections.h>
13
Ilias Apalodimasab5348a2021-10-26 09:12:33 +030014void *board_fdt_blob_setup(int *err)
Zong Li5cc6af22021-07-27 17:06:59 +080015{
Ilias Apalodimasab5348a2021-10-26 09:12:33 +030016 *err = 0;
Bin Meng4c6a28c2022-01-05 09:07:57 +080017 if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) {
Zong Li5cc6af22021-07-27 17:06:59 +080018 if (gd->arch.firmware_fdt_addr)
Bin Mengde1d0892021-09-12 11:15:16 +080019 return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
Zong Li5cc6af22021-07-27 17:06:59 +080020 }
Bin Meng50753b42021-09-11 22:31:23 +080021
Shiji Yangeff11fa2023-08-03 09:47:17 +080022 return (ulong *)_end;
Zong Li5cc6af22021-07-27 17:06:59 +080023}
Green Wan2e5da522021-05-27 06:52:13 -070024
25int board_init(void)
26{
Green Wan2e5da522021-05-27 06:52:13 -070027 /* enable all cache ways */
Zong Liec348492021-09-01 15:01:42 +080028 enable_caches();
29
Green Wan2e5da522021-05-27 06:52:13 -070030 return 0;
31}