From patchwork Sun Sep 17 19:15:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 9955001 X-Patchwork-Delegate: deller@gmx.de Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 72C5D60208 for ; Sun, 17 Sep 2017 19:15:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DCE428577 for ; Sun, 17 Sep 2017 19:15:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42E0D289B9; Sun, 17 Sep 2017 19:15:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4FCC289CD for ; Sun, 17 Sep 2017 19:15:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751334AbdIQTPT (ORCPT ); Sun, 17 Sep 2017 15:15:19 -0400 Received: from mout.gmx.net ([212.227.17.22]:62426 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751239AbdIQTPS (ORCPT ); Sun, 17 Sep 2017 15:15:18 -0400 Received: from p100.box ([193.159.28.181]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LmJsk-1dJmFZ2SCw-00a0TS; Sun, 17 Sep 2017 21:15:11 +0200 Date: Sun, 17 Sep 2017 21:15:09 +0200 From: Helge Deller To: linux-parisc@vger.kernel.org, James Bottomley , John David Anglin Subject: [PATCH] parisc: Add wrapper for pdc_instr() firmware function Message-ID: <20170917191509.GA8511@p100.box> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:SDoba9umIWFaCmVlzILF0LsufHcd/CPJ6VEgeeJj98EhpJp/UHq BJ+oHufJ2wj09Ki0hQ9mw+oXl7q0YE+VVoKdWRV+vFFTXtc85fhO1m9/Ih/DH27DHWCZF+J eHyHGlZpwkKO8aakEpmWWOHnKvyI9MDanLWCYMfQIGkt1AIJocugIdc8c6EagPpzAw8u5Kb vcVipQhNovbguemKIRpqQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:+QEzATvVZV4=:mw8is5GUQlo5YYJmOMvGzl nqlSDUHEAXGqaZ+rRhiJnodJ7jnaENVGl8+kT+K8p0xymdT6R/kitUeFlwlVQQ6sEGR26frL/ RVFcVeGCa1mHlL+u9tS98C2xaqPRk/vbHhhA856zjvchO85cirRSDA8+j53+uA1CvpAvc54pe 1cVzmURb7ZxvmSw1QaWox+kLpDuJFivI0k6tFD2SRf/uCjML4snX6velRVkmJ9XiK7G+07i1L /65YhngcP57k6cpYZBCUE+PhiN0T065deHaXHO09QSlaDGb6caaWQrwdaYGVO2QAM4q4bbMsL LGTFcVbE2nOhv/Xd8gGCSrFYUCM+rXghAVRUfypQo8VvVSC1DrCkv3Yvhn7TZ/Fl+PvIArow3 dwGS7qIPAkDWERCY7y882SG2W8BV1a29OAuLHhyzLr6v9SAywqMlmhwTKMeS4uWSEHBJ4lZ6W bZZXoqQbTdlwHfGEfFkMCyjMT1vYFHIzlSZheprCCtXbph5sEXLFapf8yHdWlW281Uopgql0s VpKA95aQ/5O7jDkb+LdWrX+LDp0Uz7dCdPHt64O9zefHYTsDdvuEvSw/Yuf81iP2qHqDQg5zb ydRzZN8sJQzf/OrdACuag+8HkfzvQmsg2ebhu/S//vcTAaB3j+yj0OIVCRdSmlWaRYs0xscqd XqYzig+2w8FBxqW5DYJZ1lZs9fLUyPtUFOUS9YrWejuQQMgCcUwwHyghpa898mLg3SWQugZD8 9GCd9OnvC/IUGROgo76i/Cuv1E6nLEfwtVhyyHQGNGF0q7ojwhWYxnpDJ1mNPKG4YPvT4R4Vh hP0zW69L9DIkOjoPJ+WDl8mT2v33w== Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Helge Deller --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/parisc/include/asm/pdc.h b/arch/parisc/include/asm/pdc.h index 26b4455..510341f 100644 --- a/arch/parisc/include/asm/pdc.h +++ b/arch/parisc/include/asm/pdc.h @@ -280,6 +280,7 @@ void setup_pdc(void); /* in inventory.c */ /* wrapper-functions from pdc.c */ int pdc_add_valid(unsigned long address); +int pdc_instr(unsigned int *instr); int pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len); int pdc_chassis_disp(unsigned long disp); int pdc_chassis_warn(unsigned long *warn); diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c index ab80e5c..6d471c0 100644 --- a/arch/parisc/kernel/firmware.c +++ b/arch/parisc/kernel/firmware.c @@ -233,6 +233,26 @@ int pdc_add_valid(unsigned long address) EXPORT_SYMBOL(pdc_add_valid); /** + * pdc_instr - Get instruction that invokes PDCE_CHECK in HPMC handler. + * @instr: Pointer to variable which will get instruction opcode. + * + * The return value is PDC_OK (0) in case call succeeded. + */ +int __init pdc_instr(unsigned int *instr) +{ + int retval; + unsigned long flags; + + spin_lock_irqsave(&pdc_lock, flags); + retval = mem_pdc_call(PDC_INSTR, 0UL, __pa(pdc_result)); + convert_to_wide(pdc_result); + *instr = pdc_result[0]; + spin_unlock_irqrestore(&pdc_lock, flags); + + return retval; +} + +/** * pdc_chassis_info - Return chassis information. * @result: The return buffer. * @chassis_info: The memory buffer address.