Green Wan | 2e5da52 | 2021-05-27 06:52:13 -0700 | [diff] [blame] | 1 | // 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 Li | ec34849 | 2021-09-01 15:01:42 +0800 | [diff] [blame] | 10 | #include <cpu_func.h> |
Green Wan | 2e5da52 | 2021-05-27 06:52:13 -0700 | [diff] [blame] | 11 | #include <dm.h> |
Zong Li | 5cc6af2 | 2021-07-27 17:06:59 +0800 | [diff] [blame] | 12 | #include <asm/sections.h> |
13 | |||||
Ilias Apalodimas | ab5348a | 2021-10-26 09:12:33 +0300 | [diff] [blame] | 14 | void *board_fdt_blob_setup(int *err) |
Zong Li | 5cc6af2 | 2021-07-27 17:06:59 +0800 | [diff] [blame] | 15 | { |
Ilias Apalodimas | ab5348a | 2021-10-26 09:12:33 +0300 | [diff] [blame] | 16 | *err = 0; |
Bin Meng | 4c6a28c | 2022-01-05 09:07:57 +0800 | [diff] [blame] | 17 | if (IS_ENABLED(CONFIG_OF_SEPARATE) || IS_ENABLED(CONFIG_OF_BOARD)) { |
Zong Li | 5cc6af2 | 2021-07-27 17:06:59 +0800 | [diff] [blame] | 18 | if (gd->arch.firmware_fdt_addr) |
Bin Meng | de1d089 | 2021-09-12 11:15:16 +0800 | [diff] [blame] | 19 | return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr; |
Zong Li | 5cc6af2 | 2021-07-27 17:06:59 +0800 | [diff] [blame] | 20 | } |
Bin Meng | 50753b4 | 2021-09-11 22:31:23 +0800 | [diff] [blame] | 21 | |
Shiji Yang | eff11fa | 2023-08-03 09:47:17 +0800 | [diff] [blame] | 22 | return (ulong *)_end; |
Zong Li | 5cc6af2 | 2021-07-27 17:06:59 +0800 | [diff] [blame] | 23 | } |
Green Wan | 2e5da52 | 2021-05-27 06:52:13 -0700 | [diff] [blame] | 24 | |
25 | int board_init(void) | ||||
26 | { | ||||
Green Wan | 2e5da52 | 2021-05-27 06:52:13 -0700 | [diff] [blame] | 27 | /* enable all cache ways */ |
Zong Li | ec34849 | 2021-09-01 15:01:42 +0800 | [diff] [blame] | 28 | enable_caches(); |
29 | |||||
Green Wan | 2e5da52 | 2021-05-27 06:52:13 -0700 | [diff] [blame] | 30 | return 0; |
31 | } |