2018-05-06 17:58:06 -04:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2017-12-26 13:55:51 +08: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 19:28:32 +01:00
|
|
|
#include <asm/smp.h>
|
2020-06-24 06:41:16 -04:00
|
|
|
#include <asm/u-boot.h>
|
|
|
|
#include <compiler.h>
|
2019-03-17 19:28:32 +01:00
|
|
|
|
2017-12-26 13:55:51 +08:00
|
|
|
/* Architecture-specific global data */
|
|
|
|
struct arch_global_data {
|
2018-12-12 06:12:45 -08:00
|
|
|
long boot_hart; /* boot hart id */
|
2020-04-21 11:15:01 -07:00
|
|
|
phys_addr_t firmware_fdt_addr;
|
2018-12-12 06:12:30 -08:00
|
|
|
#ifdef CONFIG_SIFIVE_CLINT
|
|
|
|
void __iomem *clint; /* clint base address */
|
|
|
|
#endif
|
2019-04-02 15:56:39 +08:00
|
|
|
#ifdef CONFIG_ANDES_PLIC
|
|
|
|
void __iomem *plic; /* plic base address */
|
|
|
|
#endif
|
2019-04-02 15:56:40 +08:00
|
|
|
#ifdef CONFIG_ANDES_PLMT
|
|
|
|
void __iomem *plmt; /* plmt base address */
|
|
|
|
#endif
|
2020-04-16 08:09:30 -07:00
|
|
|
#if CONFIG_IS_ENABLED(SMP)
|
2019-03-17 19:28:32 +01:00
|
|
|
struct ipi_data ipi[CONFIG_NR_CPUS];
|
|
|
|
#endif
|
2019-04-30 13:49:33 +08:00
|
|
|
#ifndef CONFIG_XIP
|
2019-03-17 19:28:32 +01:00
|
|
|
ulong available_harts;
|
2019-04-30 13:49:33 +08:00
|
|
|
#endif
|
2017-12-26 13:55:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#include <asm-generic/global_data.h>
|
|
|
|
|
2018-02-12 11:10:04 +08:00
|
|
|
#define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("gp")
|
2017-12-26 13:55:51 +08:00
|
|
|
|
2020-09-10 07:47:39 +02: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 13:55:51 +08:00
|
|
|
#endif /* __ASM_GBL_DATA_H */
|