2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2017-12-26 05:55:51 +00:00
|
|
|
/*
|
|
|
|
* (C) Copyright 2002
|
|
|
|
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2017 Microsemi Corporation.
|
|
|
|
* Padmarao Begari, Microsemi Corporation <padmarao.begari@microsemi.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ASM_GBL_DATA_H
|
|
|
|
#define __ASM_GBL_DATA_H
|
|
|
|
|
2019-03-17 18:28:32 +00:00
|
|
|
#include <asm/smp.h>
|
2020-06-24 10:41:16 +00:00
|
|
|
#include <asm/u-boot.h>
|
|
|
|
#include <compiler.h>
|
2019-03-17 18:28:32 +00:00
|
|
|
|
2017-12-26 05:55:51 +00:00
|
|
|
/* Architecture-specific global data */
|
|
|
|
struct arch_global_data {
|
2018-12-12 14:12:45 +00:00
|
|
|
long boot_hart; /* boot hart id */
|
2020-04-21 18:15:01 +00:00
|
|
|
phys_addr_t firmware_fdt_addr;
|
2021-05-11 12:04:12 +00:00
|
|
|
#if CONFIG_IS_ENABLED(SIFIVE_CLINT)
|
2018-12-12 14:12:30 +00:00
|
|
|
void __iomem *clint; /* clint base address */
|
|
|
|
#endif
|
2019-04-02 07:56:39 +00:00
|
|
|
#ifdef CONFIG_ANDES_PLIC
|
|
|
|
void __iomem *plic; /* plic base address */
|
|
|
|
#endif
|
2020-04-16 15:09:30 +00:00
|
|
|
#if CONFIG_IS_ENABLED(SMP)
|
2019-03-17 18:28:32 +00:00
|
|
|
struct ipi_data ipi[CONFIG_NR_CPUS];
|
|
|
|
#endif
|
2019-04-30 05:49:33 +00:00
|
|
|
#ifndef CONFIG_XIP
|
2019-03-17 18:28:32 +00:00
|
|
|
ulong available_harts;
|
2019-04-30 05:49:33 +00:00
|
|
|
#endif
|
2017-12-26 05:55:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#include <asm-generic/global_data.h>
|
|
|
|
|
2018-02-12 03:10:04 +00:00
|
|
|
#define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("gp")
|
2017-12-26 05:55:51 +00:00
|
|
|
|
2020-09-10 05:47:39 +00:00
|
|
|
static inline void set_gd(volatile gd_t *gd_ptr)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_64BIT
|
|
|
|
asm volatile("ld gp, %0\n" : : "m"(gd_ptr));
|
|
|
|
#else
|
|
|
|
asm volatile("lw gp, %0\n" : : "m"(gd_ptr));
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2017-12-26 05:55:51 +00:00
|
|
|
#endif /* __ASM_GBL_DATA_H */
|