Compare commits
10 Commits
sg2044-dev
...
sg2260-pld
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9766a91e7 | ||
|
|
748244a84b | ||
|
|
b34f366831 | ||
|
|
14a44c33ba | ||
|
|
91259a7058 | ||
|
|
e48b09dc40 | ||
|
|
7c4563b652 | ||
|
|
725bce31fb | ||
|
|
408283dd89 | ||
|
|
08c8572c8d |
52
.github/workflows/repo-lockdown.yml
vendored
52
.github/workflows/repo-lockdown.yml
vendored
@@ -1,26 +1,26 @@
|
|||||||
name: 'Repo Lockdown'
|
#name: 'Repo Lockdown'
|
||||||
|
#
|
||||||
on:
|
#on:
|
||||||
pull_request_target:
|
# pull_request_target:
|
||||||
types: opened
|
# types: opened
|
||||||
|
#
|
||||||
permissions:
|
#permissions:
|
||||||
pull-requests: write
|
# pull-requests: write
|
||||||
|
#
|
||||||
jobs:
|
#jobs:
|
||||||
action:
|
# action:
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
steps:
|
# steps:
|
||||||
- uses: dessant/repo-lockdown@v4
|
# - uses: dessant/repo-lockdown@v4
|
||||||
with:
|
# with:
|
||||||
pr-comment: |
|
# pr-comment: |
|
||||||
We have mailing list based patch review so it would be great if you can send these patchs to OpenSBI mailing list.
|
# We have mailing list based patch review so it would be great if you can send these patchs to OpenSBI mailing list.
|
||||||
|
#
|
||||||
You need to join OpenSBI mailing list using following link
|
# You need to join OpenSBI mailing list using following link
|
||||||
http://lists.infradead.org/mailman/listinfo/opensbi
|
# http://lists.infradead.org/mailman/listinfo/opensbi
|
||||||
|
#
|
||||||
Make sure you use "git send-email" to send the patches.
|
# Make sure you use "git send-email" to send the patches.
|
||||||
|
#
|
||||||
Thanks for your contribution to OpenSBI project.
|
# Thanks for your contribution to OpenSBI project.
|
||||||
lock-pr: true
|
# lock-pr: true
|
||||||
close-pr: true
|
# close-pr: true
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ _start:
|
|||||||
bne a0, a6, _wait_for_boot_hart
|
bne a0, a6, _wait_for_boot_hart
|
||||||
_try_lottery:
|
_try_lottery:
|
||||||
/* Jump to relocation wait loop if we don't get relocation lottery */
|
/* Jump to relocation wait loop if we don't get relocation lottery */
|
||||||
lla a6, _boot_status
|
lla a6, _relocate_lottery
|
||||||
li a7, BOOT_STATUS_LOTTERY_DONE
|
li a7, BOOT_STATUS_LOTTERY_DONE
|
||||||
amoswap.w a6, a7, (a6)
|
amoswap.w a6, a7, (a6)
|
||||||
bnez a6, _wait_for_boot_hart
|
bnez a6, _wait_for_boot_hart
|
||||||
@@ -371,6 +371,8 @@ _skip_trap_handler_hyp:
|
|||||||
|
|
||||||
.data
|
.data
|
||||||
.align 3
|
.align 3
|
||||||
|
_relocate_lottery:
|
||||||
|
RISCV_PTR 0
|
||||||
_boot_status:
|
_boot_status:
|
||||||
RISCV_PTR 0
|
RISCV_PTR 0
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ struct sbi_platform_operations {
|
|||||||
|
|
||||||
/** Platform default heap size */
|
/** Platform default heap size */
|
||||||
#define SBI_PLATFORM_DEFAULT_HEAP_SIZE(__num_hart) \
|
#define SBI_PLATFORM_DEFAULT_HEAP_SIZE(__num_hart) \
|
||||||
(0x8000 + 0x800 * (__num_hart))
|
(0x8000 + 0x1000 * (__num_hart))
|
||||||
|
|
||||||
/** Representation of a platform */
|
/** Representation of a platform */
|
||||||
struct sbi_platform {
|
struct sbi_platform {
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ static void sbi_tlb_local_hfence_gvma(struct sbi_tlb_info *tinfo)
|
|||||||
|
|
||||||
static void sbi_tlb_local_sfence_vma(struct sbi_tlb_info *tinfo)
|
static void sbi_tlb_local_sfence_vma(struct sbi_tlb_info *tinfo)
|
||||||
{
|
{
|
||||||
|
#ifndef CONFIG_THEAD_C9XX_ERRATA_JTLB
|
||||||
unsigned long start = tinfo->start;
|
unsigned long start = tinfo->start;
|
||||||
unsigned long size = tinfo->size;
|
unsigned long size = tinfo->size;
|
||||||
unsigned long i;
|
unsigned long i;
|
||||||
@@ -96,6 +97,11 @@ static void sbi_tlb_local_sfence_vma(struct sbi_tlb_info *tinfo)
|
|||||||
: "r"(start + i)
|
: "r"(start + i)
|
||||||
: "memory");
|
: "memory");
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
sbi_pmu_ctr_incr_fw(SBI_PMU_FW_SFENCE_VMA_RCVD);
|
||||||
|
|
||||||
|
tlb_flush_all();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sbi_tlb_local_hfence_vvma_asid(struct sbi_tlb_info *tinfo)
|
static void sbi_tlb_local_hfence_vvma_asid(struct sbi_tlb_info *tinfo)
|
||||||
@@ -145,6 +151,7 @@ static void sbi_tlb_local_hfence_gvma_vmid(struct sbi_tlb_info *tinfo)
|
|||||||
|
|
||||||
static void sbi_tlb_local_sfence_vma_asid(struct sbi_tlb_info *tinfo)
|
static void sbi_tlb_local_sfence_vma_asid(struct sbi_tlb_info *tinfo)
|
||||||
{
|
{
|
||||||
|
#ifndef CONFIG_THEAD_C9XX_ERRATA_JTLB
|
||||||
unsigned long start = tinfo->start;
|
unsigned long start = tinfo->start;
|
||||||
unsigned long size = tinfo->size;
|
unsigned long size = tinfo->size;
|
||||||
unsigned long asid = tinfo->asid;
|
unsigned long asid = tinfo->asid;
|
||||||
@@ -167,6 +174,16 @@ static void sbi_tlb_local_sfence_vma_asid(struct sbi_tlb_info *tinfo)
|
|||||||
: "r"(start + i), "r"(asid)
|
: "r"(start + i), "r"(asid)
|
||||||
: "memory");
|
: "memory");
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
unsigned long asid = tinfo->asid;
|
||||||
|
|
||||||
|
sbi_pmu_ctr_incr_fw(SBI_PMU_FW_SFENCE_VMA_ASID_RCVD);
|
||||||
|
|
||||||
|
__asm__ __volatile__("sfence.vma x0, %0"
|
||||||
|
:
|
||||||
|
: "r"(asid)
|
||||||
|
: "memory");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sbi_tlb_local_fence_i(struct sbi_tlb_info *tinfo)
|
static void sbi_tlb_local_fence_i(struct sbi_tlb_info *tinfo)
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ static const struct fdt_match ipi_mswi_match[] = {
|
|||||||
{ .compatible = "riscv,clint0", .data = &clint_offset },
|
{ .compatible = "riscv,clint0", .data = &clint_offset },
|
||||||
{ .compatible = "sifive,clint0", .data = &clint_offset },
|
{ .compatible = "sifive,clint0", .data = &clint_offset },
|
||||||
{ .compatible = "thead,c900-clint", .data = &clint_offset },
|
{ .compatible = "thead,c900-clint", .data = &clint_offset },
|
||||||
|
{ .compatible = "thead,c900-clint-mswi", .data = &clint_offset },
|
||||||
{ .compatible = "thead,c900-aclint-mswi" },
|
{ .compatible = "thead,c900-aclint-mswi" },
|
||||||
{ .compatible = "riscv,aclint-mswi" },
|
{ .compatible = "riscv,aclint-mswi" },
|
||||||
{ },
|
{ },
|
||||||
|
|||||||
@@ -156,6 +156,8 @@ static const struct fdt_match timer_mtimer_match[] = {
|
|||||||
{ .compatible = "riscv,clint0", .data = &sifive_clint_quirks },
|
{ .compatible = "riscv,clint0", .data = &sifive_clint_quirks },
|
||||||
{ .compatible = "sifive,clint0", .data = &sifive_clint_quirks },
|
{ .compatible = "sifive,clint0", .data = &sifive_clint_quirks },
|
||||||
{ .compatible = "thead,c900-clint", .data = &thead_clint_quirks },
|
{ .compatible = "thead,c900-clint", .data = &thead_clint_quirks },
|
||||||
|
{ .compatible = "thead,c900-clint-mtimer",
|
||||||
|
.data = &thead_clint_quirks },
|
||||||
{ .compatible = "thead,c900-aclint-mtimer",
|
{ .compatible = "thead,c900-aclint-mtimer",
|
||||||
.data = &thead_aclint_quirks },
|
.data = &thead_aclint_quirks },
|
||||||
{ .compatible = "riscv,aclint-mtimer" },
|
{ .compatible = "riscv,aclint-mtimer" },
|
||||||
|
|||||||
@@ -58,6 +58,13 @@ config PLATFORM_SOPHGO_SG2042
|
|||||||
select THEAD_C9XX_PMU
|
select THEAD_C9XX_PMU
|
||||||
default n
|
default n
|
||||||
|
|
||||||
|
config PLATFORM_SOPHGO_SG2044
|
||||||
|
bool "Sophgo sg2044 support"
|
||||||
|
select THEAD_C9XX_ERRATA
|
||||||
|
select THEAD_C9XX_ERRATA_JTLB
|
||||||
|
select THEAD_C9XX_PMU
|
||||||
|
default n
|
||||||
|
|
||||||
config PLATFORM_STARFIVE_JH7110
|
config PLATFORM_STARFIVE_JH7110
|
||||||
bool "StarFive JH7110 support"
|
bool "StarFive JH7110 support"
|
||||||
default n
|
default n
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ CONFIG_PLATFORM_RENESAS_RZFIVE=y
|
|||||||
CONFIG_PLATFORM_SIFIVE_FU540=y
|
CONFIG_PLATFORM_SIFIVE_FU540=y
|
||||||
CONFIG_PLATFORM_SIFIVE_FU740=y
|
CONFIG_PLATFORM_SIFIVE_FU740=y
|
||||||
CONFIG_PLATFORM_SOPHGO_SG2042=y
|
CONFIG_PLATFORM_SOPHGO_SG2042=y
|
||||||
|
CONFIG_PLATFORM_SOPHGO_SG2044=y
|
||||||
CONFIG_PLATFORM_STARFIVE_JH7110=y
|
CONFIG_PLATFORM_STARFIVE_JH7110=y
|
||||||
CONFIG_PLATFORM_THEAD=y
|
CONFIG_PLATFORM_THEAD=y
|
||||||
CONFIG_FDT_GPIO=y
|
CONFIG_FDT_GPIO=y
|
||||||
|
|||||||
@@ -230,7 +230,11 @@ static int generic_early_init(bool cold_boot)
|
|||||||
rc = semihosting_init();
|
rc = semihosting_init();
|
||||||
else
|
else
|
||||||
rc = fdt_serial_init();
|
rc = fdt_serial_init();
|
||||||
if (rc)
|
|
||||||
|
/* console is not a necessary device for tp scalar*/
|
||||||
|
if (rc == SBI_ENODEV)
|
||||||
|
return 0;
|
||||||
|
else if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,3 +7,5 @@
|
|||||||
|
|
||||||
carray-platform_override_modules-$(CONFIG_PLATFORM_SOPHGO_SG2042) += sophgo_sg2042
|
carray-platform_override_modules-$(CONFIG_PLATFORM_SOPHGO_SG2042) += sophgo_sg2042
|
||||||
platform-objs-$(CONFIG_PLATFORM_SOPHGO_SG2042) += sophgo/sg2042.o
|
platform-objs-$(CONFIG_PLATFORM_SOPHGO_SG2042) += sophgo/sg2042.o
|
||||||
|
carray-platform_override_modules-$(CONFIG_PLATFORM_SOPHGO_SG2044) += sophgo_sg2044
|
||||||
|
platform-objs-$(CONFIG_PLATFORM_SOPHGO_SG2044) += sophgo/sg2044.o
|
||||||
|
|||||||
49
platform/generic/sophgo/sg2044.c
Normal file
49
platform/generic/sophgo/sg2044.c
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*
|
||||||
|
* Copyright (c)
|
||||||
|
*
|
||||||
|
* Authors:
|
||||||
|
* Inochi Amaoto <inochiama@outlook.com>
|
||||||
|
* YuQing Cai <caiyuqing_hz@163.com>
|
||||||
|
* ZhenYu Zhang <1204122531@qq.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#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,
|
||||||
|
};
|
||||||
@@ -7,3 +7,7 @@ config THEAD_C9XX_PMU
|
|||||||
config THEAD_C9XX_ERRATA
|
config THEAD_C9XX_ERRATA
|
||||||
bool "T-HEAD c9xx errata support"
|
bool "T-HEAD c9xx errata support"
|
||||||
default n
|
default n
|
||||||
|
|
||||||
|
config THEAD_C9XX_ERRATA_JTLB
|
||||||
|
bool "T-HEAD c9xx errata(JTLB) support"
|
||||||
|
default n
|
||||||
|
|||||||
Reference in New Issue
Block a user