forked from Mirrors/opensbi
platform: generic: Constify FDT pointers in fw_platform_init()
Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:

committed by
Anup Patel

parent
b15cc7715a
commit
3f964652d9
@@ -29,7 +29,7 @@ struct platform_override {
|
|||||||
int (*extensions_init)(const struct fdt_match *match,
|
int (*extensions_init)(const struct fdt_match *match,
|
||||||
struct sbi_hart_features *hfeatures);
|
struct sbi_hart_features *hfeatures);
|
||||||
int (*pmu_init)(const struct fdt_match *match);
|
int (*pmu_init)(const struct fdt_match *match);
|
||||||
void (*fw_init)(void *fdt, const struct fdt_match *match);
|
void (*fw_init)(const void *fdt, const struct fdt_match *match);
|
||||||
int (*vendor_ext_provider)(long funcid,
|
int (*vendor_ext_provider)(long funcid,
|
||||||
struct sbi_trap_regs *regs,
|
struct sbi_trap_regs *regs,
|
||||||
struct sbi_ecall_return *out,
|
struct sbi_ecall_return *out,
|
||||||
|
@@ -36,7 +36,7 @@ extern unsigned long platform_override_modules_size;
|
|||||||
static const struct platform_override *generic_plat = NULL;
|
static const struct platform_override *generic_plat = NULL;
|
||||||
static const struct fdt_match *generic_plat_match = NULL;
|
static const struct fdt_match *generic_plat_match = NULL;
|
||||||
|
|
||||||
static void fw_platform_lookup_special(void *fdt, int root_offset)
|
static void fw_platform_lookup_special(const void *fdt, int root_offset)
|
||||||
{
|
{
|
||||||
const struct platform_override *plat;
|
const struct platform_override *plat;
|
||||||
const struct fdt_match *match;
|
const struct fdt_match *match;
|
||||||
@@ -81,7 +81,7 @@ static DECLARE_BITMAP(generic_coldboot_harts, SBI_HARTMASK_MAX_BITS);
|
|||||||
* according to the DT property "cold-boot-harts" in "/chosen/opensbi-config"
|
* according to the DT property "cold-boot-harts" in "/chosen/opensbi-config"
|
||||||
* DT node. If there is no "cold-boot-harts" in DT, all harts will be allowed.
|
* DT node. If there is no "cold-boot-harts" in DT, all harts will be allowed.
|
||||||
*/
|
*/
|
||||||
static void fw_platform_coldboot_harts_init(void *fdt)
|
static void fw_platform_coldboot_harts_init(const void *fdt)
|
||||||
{
|
{
|
||||||
int chosen_offset, config_offset, cpu_offset, len, err;
|
int chosen_offset, config_offset, cpu_offset, len, err;
|
||||||
u32 val32;
|
u32 val32;
|
||||||
@@ -146,7 +146,7 @@ unsigned long fw_platform_init(unsigned long arg0, unsigned long arg1,
|
|||||||
unsigned long arg4)
|
unsigned long arg4)
|
||||||
{
|
{
|
||||||
const char *model;
|
const char *model;
|
||||||
void *fdt = (void *)arg1;
|
const void *fdt = (void *)arg1;
|
||||||
u32 hartid, hart_count = 0;
|
u32 hartid, hart_count = 0;
|
||||||
int rc, root_offset, cpus_offset, cpu_offset, len;
|
int rc, root_offset, cpus_offset, cpu_offset, len;
|
||||||
|
|
||||||
|
@@ -298,7 +298,7 @@ static bool starfive_jh7110_cold_boot_allowed(u32 hartid,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void starfive_jh7110_fw_init(void *fdt, const struct fdt_match *match)
|
static void starfive_jh7110_fw_init(const void *fdt, const struct fdt_match *match)
|
||||||
{
|
{
|
||||||
const fdt32_t *val;
|
const fdt32_t *val;
|
||||||
int len, coff;
|
int len, coff;
|
||||||
|
Reference in New Issue
Block a user