blob: c8696270ba27a4c9b449af0598a1bc458d36e17f [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
Zong Liec348492021-09-01 15:01:42 +08009#include <cpu_func.h>
Green Wan2e5da522021-05-27 06:52:13 -070010#include <dm.h>
Zong Li5cc6af22021-07-27 17:06:59 +080011#include <asm/sections.h>
12
Ilias Apalodimasab5348a2021-10-26 09:12:33 +030013void *board_fdt_blob_setup(int *err)
Zong Li5cc6af22021-07-27 17:06:59 +080014{
Ilias Apalodimasab5348a2021-10-26 09:12:33 +030015 *err = 0;
Bin Meng4c6a28c2022-01-05 09:07:57 +080016 if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) {
Zong Li5cc6af22021-07-27 17:06:59 +080017 if (gd->arch.firmware_fdt_addr)
Bin Mengde1d0892021-09-12 11:15:16 +080018 return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
Zong Li5cc6af22021-07-27 17:06:59 +080019 }
Bin Meng50753b42021-09-11 22:31:23 +080020
Shiji Yangeff11fa2023-08-03 09:47:17 +080021 return (ulong *)_end;
Zong Li5cc6af22021-07-27 17:06:59 +080022}
Green Wan2e5da522021-05-27 06:52:13 -070023
24int board_init(void)
25{
Green Wan2e5da522021-05-27 06:52:13 -070026 /* enable all cache ways */
Zong Liec348492021-09-01 15:01:42 +080027 enable_caches();
28
Green Wan2e5da522021-05-27 06:52:13 -070029 return 0;
30}