]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
ARM: adjust arm-smccc code for use in U-Boot
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 14 Apr 2017 02:10:23 +0000 (11:10 +0900)
committerTom Rini <trini@konsulko.com>
Tue, 18 Apr 2017 14:29:17 +0000 (10:29 -0400)
Adjust ARM SMC Calling Convention code for U-Boot:
  - Replace the license block with SPDX
  - Change path to asm-offsets.h
  - Define UNWIND() as no-op
  - Add Kconfig entry
  - Add asm-offsets

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
arch/arm/Kconfig
arch/arm/cpu/armv7/Makefile
arch/arm/cpu/armv7/smccc-call.S
arch/arm/cpu/armv8/Makefile
arch/arm/cpu/armv8/smccc-call.S
arch/arm/include/asm/opcodes-sec.h
arch/arm/include/asm/opcodes-virt.h
arch/arm/include/asm/opcodes.h
arch/arm/lib/asm-offsets.c
include/linux/arm-smccc.h

index 42f93b4670d2f29f99635d82c14f26da92bc0095..16578b8b38906304c1a90ef884bb4942cb9c34c5 100644 (file)
@@ -174,6 +174,14 @@ config SYS_CACHELINE_SIZE
        default 64 if SYS_CACHE_SHIFT_6
        default 32 if SYS_CACHE_SHIFT_5
 
+config ARM_SMCCC
+       bool "Support for ARM SMC Calling Convention (SMCCC)"
+       depends on CPU_V7 || ARM64
+       help
+         Say Y here if you want to enable ARM SMC Calling Convention.
+         This should be enabled if U-Boot needs to communicate with system
+         firmware (for example, PSCI) according to SMCCC.
+
 config SEMIHOSTING
        bool "support boot from semihosting"
        help
index 02e8778be5bed57cb7e52afed8a92761f678ef02..3a9913a86bc1afad1dfba049f7024a1e98b4c683 100644 (file)
@@ -18,6 +18,7 @@ obj-y += lowlevel_init.o
 endif
 endif
 
+obj-$(CONFIG_ARM_SMCCC)                += smccc-call.o
 obj-$(CONFIG_ARMV7_NONSEC)     += nonsec_virt.o virt-v7.o virt-dt.o
 obj-$(CONFIG_ARMV7_PSCI)       += psci.o psci-common.o
 
index e5d43066b88948b8e079e14f1ffd33ad884db067..c2fdbadbb02583d6f4a1b6a7f084fd3ea8efa566 100644 (file)
@@ -1,22 +1,14 @@
 /*
  * Copyright (c) 2015, Linaro Limited
  *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
+ * SPDX-License-Identifier:    GPL-2.0
  */
 #include <linux/linkage.h>
 
 #include <asm/opcodes-sec.h>
 #include <asm/opcodes-virt.h>
-#include <asm/unwind.h>
 
+#define UNWIND(x...)
        /*
         * Wrap c macros in asm macros to delay expansion until after the
         * SMCCC asm macro is expanded.
index 65915eec3646ce51ace721424bcf380a6418f460..c447085fe4317cbedcbd853db2673b4a85ef5d2c 100644 (file)
@@ -16,6 +16,8 @@ obj-y += tlb.o
 obj-y  += transition.o
 obj-y  += fwcall.o
 obj-y  += cpu-dt.o
+obj-$(CONFIG_ARM_SMCCC)                += smccc-call.o
+
 ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_ARMV8_SPIN_TABLE) += spin_table.o spin_table_v8.o
 endif
index 62522342e1e476bdb0299bbb4872c65355462093..bbb6cba4a549ee841f8db75d16ec65645d656783 100644 (file)
@@ -1,19 +1,11 @@
 /*
  * Copyright (c) 2015, Linaro Limited
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License Version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
+ * SPDX-License-Identifier:    GPL-2.0
  */
 #include <linux/linkage.h>
 #include <linux/arm-smccc.h>
-#include <asm/asm-offsets.h>
+#include <generated/asm-offsets.h>
 
        .macro SMCCC instr
        .cfi_startproc
index bc3a9174417c090af7454cc4af8fd16f3450e953..16dee8f158b03888f9ae9f9dc61f91a684db72f7 100644 (file)
@@ -1,14 +1,7 @@
 /*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
  * Copyright (C) 2012 ARM Limited
+ *
+ * SPDX-License-Identifier:    GPL-2.0
  */
 
 #ifndef __ASM_ARM_OPCODES_SEC_H
index efcfdf92d9d5991ac618bf2ae608be27c44dc493..92729970d1abe870ad4107451c920caad1142995 100644 (file)
@@ -2,19 +2,7 @@
  * opcodes-virt.h: Opcode definitions for the ARM virtualization extensions
  * Copyright (C) 2012  Linaro Limited
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 #ifndef __ASM_ARM_OPCODES_VIRT_H
 #define __ASM_ARM_OPCODES_VIRT_H
index e796c598513bad226b10e89497af848082c6cac8..199f0ba04590066d4724bb7c761e1a6a63288f67 100644 (file)
@@ -1,9 +1,7 @@
 /*
  *  arch/arm/include/asm/opcodes.h
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
+ * SPDX-License-Identifier:    GPL-2.0
  */
 
 #ifndef __ASM_ARM_OPCODES_H
index e5bcaea1aee078628a2f02ecf268b4b6fb25c8bb..d620dc08a0745137120622522768d0104d1e8e0a 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <common.h>
 #include <linux/kbuild.h>
+#include <linux/arm-smccc.h>
 
 #if defined(CONFIG_MX25) || defined(CONFIG_MX27) || defined(CONFIG_MX35) \
        || defined(CONFIG_MX51) || defined(CONFIG_MX53)
@@ -198,5 +199,12 @@ int main(void)
        DEFINE(PLL_DP_HFS_MFN, offsetof(struct dpll, dp_hfs_mfn));
 #endif
 
+#ifdef CONFIG_ARM_SMCCC
+       DEFINE(ARM_SMCCC_RES_X0_OFFS, offsetof(struct arm_smccc_res, a0));
+       DEFINE(ARM_SMCCC_RES_X2_OFFS, offsetof(struct arm_smccc_res, a2));
+       DEFINE(ARM_SMCCC_QUIRK_ID_OFFS, offsetof(struct arm_smccc_quirk, id));
+       DEFINE(ARM_SMCCC_QUIRK_STATE_OFFS, offsetof(struct arm_smccc_quirk, state));
+#endif
+
        return 0;
 }
index 4c5bca38c6533ea56c5fa2f50841d3c09e31ff11..28e61ce83bb34b27cb423d21a126dad752bce1f1 100644 (file)
@@ -1,15 +1,7 @@
 /*
  * Copyright (c) 2015, Linaro Limited
  *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
+ * SPDX-License-Identifier:    GPL-2.0
  */
 #ifndef __LINUX_ARM_SMCCC_H
 #define __LINUX_ARM_SMCCC_H