1 /* SPDX-License-Identifier: GPL-2.0+ */ 2 /* 3 * (C) Copyright 2002 4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 5 * 6 * Copyright (c) 2017 Microsemi Corporation. 7 * Padmarao Begari, Microsemi Corporation <padmarao.begari@microsemi.com> 8 */ 9 10 #ifndef __ASM_GBL_DATA_H 11 #define __ASM_GBL_DATA_H 12 13 #include <asm/smp.h> 14 #include <asm/u-boot.h> 15 #include <compiler.h> 16 17 /* Architecture-specific global data */ 18 struct arch_global_data { 19 long boot_hart; /* boot hart id */ 20 phys_addr_t firmware_fdt_addr; 21 #if CONFIG_IS_ENABLED(SIFIVE_CLINT) 22 void __iomem *clint; /* clint base address */ 23 #endif 24 #ifdef CONFIG_ANDES_PLICSW 25 void __iomem *plicsw; /* andes plicsw base address */ 26 #endif 27 #if CONFIG_IS_ENABLED(SMP) 28 struct ipi_data ipi[CONFIG_NR_CPUS]; 29 #endif 30 #if !CONFIG_IS_ENABLED(XIP) 31 #ifdef CONFIG_AVAILABLE_HARTS 32 ulong available_harts; 33 #endif 34 #endif 35 }; 36 37 #include <asm-generic/global_data.h> 38 39 #define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("gp") 40 set_gd(volatile gd_t * gd_ptr)41static inline void set_gd(volatile gd_t *gd_ptr) 42 { 43 #ifdef CONFIG_64BIT 44 asm volatile("ld gp, %0\n" : : "m"(gd_ptr)); 45 #else 46 asm volatile("lw gp, %0\n" : : "m"(gd_ptr)); 47 #endif 48 } 49 50 #endif /* __ASM_GBL_DATA_H */ 51