forked from riscv-software-src/opensbi
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
platform: generic: add sophgo sg2044 soc support
Signed-off-by: tingzhu.wang <[email protected]> Signed-off-by: Xiaoguang Xing <[email protected]>
- Loading branch information
1 parent
cbf76ce
commit 3361818
Showing
4 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* SPDX-License-Identifier: BSD-2-Clause | ||
* | ||
* Copyright (c) | ||
* | ||
* Authors: | ||
* Inochi Amaoto <[email protected]> | ||
* YuQing Cai <[email protected]> | ||
* ZhenYu Zhang <[email protected]> | ||
*/ | ||
|
||
#include <platform_override.h> | ||
#include <thead/c9xx_pmu.h> | ||
#include <sbi/riscv_asm.h> | ||
#include <sbi/riscv_encoding.h> | ||
#include <sbi/sbi_const.h> | ||
#include <sbi/sbi_ecall_interface.h> | ||
#include <sbi/sbi_pmu.h> | ||
#include <sbi/sbi_platform.h> | ||
#include <sbi_utils/fdt/fdt_helper.h> | ||
|
||
static u32 selected_hartid = -1; | ||
|
||
static bool sg2044_cold_boot_allowed(u32 hartid, | ||
const struct fdt_match *match) | ||
{ | ||
if (selected_hartid != -1) | ||
return (selected_hartid == hartid); | ||
|
||
return true; | ||
} | ||
|
||
static int sg2044_extensions_init(const struct fdt_match *match, | ||
struct sbi_hart_features *hfeatures) | ||
{ | ||
thead_c9xx_register_pmu_device(); | ||
return 0; | ||
} | ||
|
||
static const struct fdt_match sophgo_sg2044_match[] = { | ||
{ .compatible = "sophgo,sg2044" }, | ||
{ }, | ||
}; | ||
|
||
const struct platform_override sophgo_sg2044 = { | ||
.match_table = sophgo_sg2044_match, | ||
.cold_boot_allowed = sg2044_cold_boot_allowed, | ||
.extensions_init = sg2044_extensions_init, | ||
}; |