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