From patchwork Fri Jul 20 08:24:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyungmin Park X-Patchwork-Id: 1220091 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 7B4D6DF24C for ; Fri, 20 Jul 2012 08:29:13 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Ss8Vq-00077d-It; Fri, 20 Jul 2012 08:24:38 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Ss8VW-00077L-Ai for linux-arm-kernel@lists.infradead.org; Fri, 20 Jul 2012 08:24:21 +0000 Received: from epcpsbgm2.samsung.com (mailout1.samsung.com [203.254.224.24]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M7G002VW9YJAKR0@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 20 Jul 2012 17:24:12 +0900 (KST) X-AuditID: cbfee61b-b7f566d000005c8a-f4-500915abb73d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 5B.32.23690.BA519005; Fri, 20 Jul 2012 17:24:11 +0900 (KST) Received: from july ([165.213.74.254]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M7G00H3HA0ARRQ1@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 20 Jul 2012 17:24:11 +0900 (KST) Received: by july (sSMTP sendmail emulation); Fri, 20 Jul 2012 17:24:19 +0900 Date: Fri, 20 Jul 2012 17:24:19 +0900 From: Kyungmin Park To: Russell King , Arnd Bergmann Subject: [PATCH v3] ARM: Make a compile firmware conditionally Message-id: <20120720082419.GA9394@july> MIME-version: 1.0 Content-disposition: inline rom: Kyungmin Park User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFLMWRmVeSWpSXmKPExsVy+t9jAd3VopwBBg8X6FpsenyN1YHRY/OS +gDGKC6blNSczLLUIn27BK6MT5eaWAqaJSt2rv3K2sD4U7iLkZNDQsBEYtfpl4wQtpjEhXvr 2boYuTiEBBYxSrS+bYJy5jNJnD/RzgRSJSTgK7Hp2BywDhYBVYmJfx6xg9hsAloSVz7sAbNF BDwkOjuuM4PYzAKNjBK7ZvuB2MICdhJNO16xgdi8AhoSK6d/ZYawBSV+TL7HAlGvJbF+53Em CFta4tHfGewQezUljv59A9YrKqAiMeXkNrYJjAKzkLTPQtI+C0n7AkbmVYyiqQXJBcVJ6blG esWJucWleel6yfm5mxjBIfhMegfjqgaLQ4wCHIxKPLwTkzgChFgTy4orcw8xSnAwK4nwzvgA FOJNSaysSi3Kjy8qzUktPsQozcGiJM5r4v3VX0ggPbEkNTs1tSC1CCbLxMEp1cDYvPm9dDXX 1tPxVraVs1Y37fWw/nez+WKNiPjvMyFqCzIkby+/0sReJGUrKhyzYvbxC7v2f/TpVXSzO+Ib uELILu1+sLz7mbi9+6fUf7nlfzwmebaH9WSzuemq8+fdkV3Z9J+dq/AUi5Py/X5LvTO/zX91 tczTWVcbqmlX9nPHDTF2LzMmtUlKLMUZiYZazEXFiQC2IHw+PQIAAA== X-TM-AS-MML: No X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.24 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 4.0 HDRS_LCASE Odd capitalization of message header 1.0 MANY_HDRS_LCASE Odd capitalization of multiple message headers Cc: olof@lixom.net, dave.martin@linaro.org, linux-arm-kernel@lists.infradead.org, Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Kyungmin Park Some boards can use the firmware at trustzone but others can't use this. However we need to build it simultaneously. To address this issue, introduce arm firmware support and use it at each board files. e.g., In boot_secondary at mach-exynos/platsmp.c __raw_writel(virt_to_phys(exynos4_secondary_startup), CPU1_BOOT_REG); if (IS_ENABLED(CONFIG_ARM_FIRMWARE)) { /* Call Exynos specific smc call */ firmware_ops.cpu_boot(cpu); } gic_raise_softirq(cpumask_of(cpu), 1); if (pen_release == -1) Now smp_ops is not yet merged, now just call the firmware_init at init_early at board file e.g., exynos4412 based board static void __init board_init_early(void) { exynos_firmware_init(); } TODO 1. DT support. 2. call firmware init by smp_ops. Signed-off-by: Kyungmin Park diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig index 283fa1d..5b097ca 100644 --- a/arch/arm/common/Kconfig +++ b/arch/arm/common/Kconfig @@ -21,6 +21,9 @@ config ARM_VIC_NR The maximum number of VICs available in the system, for power management. +config ARM_FIRMWARE + bool + config ICST bool diff --git a/arch/arm/common/Makefile b/arch/arm/common/Makefile index e8a4e58..4af6568 100644 --- a/arch/arm/common/Makefile +++ b/arch/arm/common/Makefile @@ -4,6 +4,7 @@ obj-$(CONFIG_ARM_GIC) += gic.o obj-$(CONFIG_ARM_VIC) += vic.o +obj-$(CONFIG_ARM_FIRMWARE) += firmware.o obj-$(CONFIG_ICST) += icst.o obj-$(CONFIG_SA1111) += sa1111.o obj-$(CONFIG_PCI_HOST_VIA82C505) += via82c505.o diff --git a/arch/arm/common/firmware.c b/arch/arm/common/firmware.c new file mode 100644 index 0000000..ffb6822 --- /dev/null +++ b/arch/arm/common/firmware.c @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2012 Samsung Electronics. + * Kyungmin Park + * + * 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. + */ + +#include +#include + +#include + +static void cpu_boot(int cpu) +{ + /* Do nothing */ +} + +struct firmware_ops firmware_ops = { + .do_idle = cpu_do_idle, + .cpu_boot = cpu_boot, +}; diff --git a/arch/arm/include/asm/firmware.h b/arch/arm/include/asm/firmware.h new file mode 100644 index 0000000..c8c28bf --- /dev/null +++ b/arch/arm/include/asm/firmware.h @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2012 Samsung Electronics. + * Kyungmin Park + * + * 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. + */ + +#ifndef __ASM_ARM_FIRMWARE_H +#define __ASM_ARM_FIRMWARE_H + +struct firmware_ops { + int (*do_idle)(void); + void (*cpu_boot)(int cpu); +}; + +extern struct firmware_ops firmware_ops; + +#endif