From patchwork Mon Apr 6 07:03:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 458335 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0E5AC140218 for ; Mon, 6 Apr 2015 17:14:05 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id E78BB1A084B for ; Mon, 6 Apr 2015 17:14:04 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e28smtp07.in.ibm.com (e28smtp07.in.ibm.com [122.248.162.7]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 65F381A030F for ; Mon, 6 Apr 2015 17:14:01 +1000 (AEST) Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 6 Apr 2015 12:43:58 +0530 Received: from d28dlp02.in.ibm.com (9.184.220.127) by e28smtp07.in.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 6 Apr 2015 12:43:57 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 7C6FA3940053 for ; Mon, 6 Apr 2015 12:43:54 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay03.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t367C6WB55181512 for ; Mon, 6 Apr 2015 12:43:54 +0530 Received: from d28av02.in.ibm.com (localhost [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t366m110022840 for ; Mon, 6 Apr 2015 12:18:02 +0530 Received: from localhost.localdomain ([9.124.35.90]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t366m1sN022792 for ; Mon, 6 Apr 2015 12:18:01 +0530 From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Mon, 06 Apr 2015 12:33:11 +0530 Message-ID: <20150406070256.10986.88820.stgit@localhost.localdomain> In-Reply-To: <20150406065920.10986.50507.stgit@localhost.localdomain> References: <20150406065920.10986.50507.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15040607-0025-0000-0000-0000041E2A61 Subject: [Skiboot] [PATCH 01/12] FSP/LED: Move led header file to include directory X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" We want to refer leds header file in hdata. Hence move header file to include directory. No functionality changes. Signed-off-by: Vasant Hegde --- hw/fsp/fsp-leds.c | 3 - hw/fsp/fsp-leds.h | 153 ---------------------------------------------------- include/fsp-leds.h | 153 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 154 insertions(+), 155 deletions(-) delete mode 100644 hw/fsp/fsp-leds.h create mode 100644 include/fsp-leds.h diff --git a/hw/fsp/fsp-leds.c b/hw/fsp/fsp-leds.c index cbb0817..6ac0122 100644 --- a/hw/fsp/fsp-leds.c +++ b/hw/fsp/fsp-leds.c @@ -26,8 +26,7 @@ #include #include #include - -#include "fsp-leds.h" +#include /* LED prefix */ #define PREFIX "FSPLED: " diff --git a/hw/fsp/fsp-leds.h b/hw/fsp/fsp-leds.h deleted file mode 100644 index a411636..0000000 --- a/hw/fsp/fsp-leds.h +++ /dev/null @@ -1,153 +0,0 @@ -/* Copyright 2013-2014 IBM Corp. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - * implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - */ - - -/* - * SPCN based LED location code and other information - */ - -#ifndef __FSP_LEDS_H -#define __FSP_LEDS_H - -/* Supported FSP response codes */ -#define FSP_IND_NOT_IMPLMNTD 0x00 /* Indicator not implemented */ -#define FSP_IND_IMPLMNTD 0x04 /* Indicator implemented */ -#define FSP_IND_IMPL_UNKNOWN 0x08 /* Implemtation unknown */ -#define FSP_IND_INACTIVE 0x00 /* Indicator not active */ -#define FSP_IND_IDENTIFY_ACTV 0x01 /* Identify state active */ -#define FSP_IND_FAULT_ACTV 0x02 /* Fault state active */ -#define FSP_IND_STATE_UNKNOWN 0xff /* Indicator state unknown */ -#define FSP_RSRC_NOT_PRESENT 0x00 /* Resource not present */ -#define FSP_RSRC_PRESENT 0x40 /* Resource present */ -#define FSP_RSRC_PRSNC_UNKNOWN 0x80 /* Resource presence unknown */ - -/* LED exclussive bits */ -#define FSP_LED_EXCL_FAULT 1UL << 0 -#define FSP_LED_EXCL_IDENTIFY 1UL << 1 - -/* LED update message source */ -enum spcn_cmd_src { - SPCN_SRC_FSP = 0, - SPCN_SRC_OPAL = 1, - SPCN_SRC_MAX = 2 -}; - -/* SPCN set LED */ -struct spcn_led_data { - u8 lc_len; - u16 state; - char lc_code[LOC_CODE_SIZE]; -}; - -/* LED data */ -struct fsp_led_data { - u16 rid; /* Resource ID */ - u8 lc_len; /* Location code len */ - char loc_code[LOC_CODE_SIZE]; - u16 parms; /* Parameters */ - u16 status; /* Status */ - u16 excl_bit; /* Exclussive LED bit */ - struct list_node link; -}; - -/* FSP location code request */ -struct fsp_loc_code_req { - u16 len; - u16 req_type; - u8 raw_len; - u8 lc_sz; - char loc_code[LOC_CODE_SIZE]; -}; - -/* FSP location code data */ -struct fsp_loc_code_data { - u16 size; - u32 ccin; - u8 status; - u8 ind_state; - u8 raw_len; - u8 fld_sz; - - /* The size below must include the padding to - * make the whole structure aligned to a - * multiple of 4 bytes - */ - char loc_code[LOC_CODE_SIZE + 2]; /* 82 */ - - /* We need to pack the structure otherwise the - * compiler adds additional alignment to make - * it 8 bytes aligned - */ -} __packed; - -/* Get indicator state request */ -struct fsp_get_ind_state_req { - u16 size; - u8 lc_len; - u8 fld_sz; - char loc_code[LOC_CODE_SIZE]; -}; - -/* Set indicator state request */ -struct fsp_set_ind_state_req { - u16 size; - u16 req_type; - u8 reserved[3]; - u8 ind_state; - u8 lc_len; - u8 fld_sz; - char loc_code[LOC_CODE_SIZE]; -}; - -/* LED set SPCN command */ -struct led_set_cmd { - char loc_code[LOC_CODE_SIZE]; - u8 command; - u8 state; - u16 ckpt_status; /* Checkpointed status */ - u16 ckpt_excl_bit; /* Checkpointed exclusive status */ - u64 async_token; /* OPAL async token */ - enum spcn_cmd_src cmd_src; /* OPAL or FSP based */ - struct list_node link; -}; - -/* LED commands and state */ -#define LED_COMMAND_FAULT 1 -#define LED_COMMAND_IDENTIFY 0 -#define LED_STATE_ON 1 -#define LED_STATE_OFF 0 - -/* FSP get loc-code list command request type */ -#define GET_LC_CMPLT_SYS 0x8000 -#define GET_LC_ENCLOSURES 0x4000 -#define GET_LC_ENCL_DESCENDANTS 0x2000 -#define GET_LC_SINGLE_LOC_CODE 0x0100 - -/* FSP set indicator command request type */ -#define SET_IND_ENCLOSURE 0x4000 -#define SET_IND_SINGLE_LOC_CODE 0x0001 - -/* Response buffer */ -#define OUTBUF_HEADER_SIZE 8 - -/* LED miscellaneous */ -#define LOC_CODE_LEN 1 -#define LED_CONTROL_LEN 2 -#define FSP_LC_STRUCT_FIXED_SZ 0x0a - -#endif diff --git a/include/fsp-leds.h b/include/fsp-leds.h new file mode 100644 index 0000000..a411636 --- /dev/null +++ b/include/fsp-leds.h @@ -0,0 +1,153 @@ +/* Copyright 2013-2014 IBM Corp. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* + */ + + +/* + * SPCN based LED location code and other information + */ + +#ifndef __FSP_LEDS_H +#define __FSP_LEDS_H + +/* Supported FSP response codes */ +#define FSP_IND_NOT_IMPLMNTD 0x00 /* Indicator not implemented */ +#define FSP_IND_IMPLMNTD 0x04 /* Indicator implemented */ +#define FSP_IND_IMPL_UNKNOWN 0x08 /* Implemtation unknown */ +#define FSP_IND_INACTIVE 0x00 /* Indicator not active */ +#define FSP_IND_IDENTIFY_ACTV 0x01 /* Identify state active */ +#define FSP_IND_FAULT_ACTV 0x02 /* Fault state active */ +#define FSP_IND_STATE_UNKNOWN 0xff /* Indicator state unknown */ +#define FSP_RSRC_NOT_PRESENT 0x00 /* Resource not present */ +#define FSP_RSRC_PRESENT 0x40 /* Resource present */ +#define FSP_RSRC_PRSNC_UNKNOWN 0x80 /* Resource presence unknown */ + +/* LED exclussive bits */ +#define FSP_LED_EXCL_FAULT 1UL << 0 +#define FSP_LED_EXCL_IDENTIFY 1UL << 1 + +/* LED update message source */ +enum spcn_cmd_src { + SPCN_SRC_FSP = 0, + SPCN_SRC_OPAL = 1, + SPCN_SRC_MAX = 2 +}; + +/* SPCN set LED */ +struct spcn_led_data { + u8 lc_len; + u16 state; + char lc_code[LOC_CODE_SIZE]; +}; + +/* LED data */ +struct fsp_led_data { + u16 rid; /* Resource ID */ + u8 lc_len; /* Location code len */ + char loc_code[LOC_CODE_SIZE]; + u16 parms; /* Parameters */ + u16 status; /* Status */ + u16 excl_bit; /* Exclussive LED bit */ + struct list_node link; +}; + +/* FSP location code request */ +struct fsp_loc_code_req { + u16 len; + u16 req_type; + u8 raw_len; + u8 lc_sz; + char loc_code[LOC_CODE_SIZE]; +}; + +/* FSP location code data */ +struct fsp_loc_code_data { + u16 size; + u32 ccin; + u8 status; + u8 ind_state; + u8 raw_len; + u8 fld_sz; + + /* The size below must include the padding to + * make the whole structure aligned to a + * multiple of 4 bytes + */ + char loc_code[LOC_CODE_SIZE + 2]; /* 82 */ + + /* We need to pack the structure otherwise the + * compiler adds additional alignment to make + * it 8 bytes aligned + */ +} __packed; + +/* Get indicator state request */ +struct fsp_get_ind_state_req { + u16 size; + u8 lc_len; + u8 fld_sz; + char loc_code[LOC_CODE_SIZE]; +}; + +/* Set indicator state request */ +struct fsp_set_ind_state_req { + u16 size; + u16 req_type; + u8 reserved[3]; + u8 ind_state; + u8 lc_len; + u8 fld_sz; + char loc_code[LOC_CODE_SIZE]; +}; + +/* LED set SPCN command */ +struct led_set_cmd { + char loc_code[LOC_CODE_SIZE]; + u8 command; + u8 state; + u16 ckpt_status; /* Checkpointed status */ + u16 ckpt_excl_bit; /* Checkpointed exclusive status */ + u64 async_token; /* OPAL async token */ + enum spcn_cmd_src cmd_src; /* OPAL or FSP based */ + struct list_node link; +}; + +/* LED commands and state */ +#define LED_COMMAND_FAULT 1 +#define LED_COMMAND_IDENTIFY 0 +#define LED_STATE_ON 1 +#define LED_STATE_OFF 0 + +/* FSP get loc-code list command request type */ +#define GET_LC_CMPLT_SYS 0x8000 +#define GET_LC_ENCLOSURES 0x4000 +#define GET_LC_ENCL_DESCENDANTS 0x2000 +#define GET_LC_SINGLE_LOC_CODE 0x0100 + +/* FSP set indicator command request type */ +#define SET_IND_ENCLOSURE 0x4000 +#define SET_IND_SINGLE_LOC_CODE 0x0001 + +/* Response buffer */ +#define OUTBUF_HEADER_SIZE 8 + +/* LED miscellaneous */ +#define LOC_CODE_LEN 1 +#define LED_CONTROL_LEN 2 +#define FSP_LC_STRUCT_FIXED_SZ 0x0a + +#endif