TWI584303B - Method and system for controlling status indication light of pcie hard disk drive - Google Patents

Method and system for controlling status indication light of pcie hard disk drive Download PDF

Info

Publication number
TWI584303B
TWI584303B TW104143795A TW104143795A TWI584303B TW I584303 B TWI584303 B TW I584303B TW 104143795 A TW104143795 A TW 104143795A TW 104143795 A TW104143795 A TW 104143795A TW I584303 B TWI584303 B TW I584303B
Authority
TW
Taiwan
Prior art keywords
hard disk
working mode
pcie
current working
bits
Prior art date
Application number
TW104143795A
Other languages
Chinese (zh)
Other versions
TW201724098A (en
Inventor
趙衛國
Original Assignee
英業達股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 英業達股份有限公司 filed Critical 英業達股份有限公司
Priority to TW104143795A priority Critical patent/TWI584303B/en
Application granted granted Critical
Publication of TWI584303B publication Critical patent/TWI584303B/en
Publication of TW201724098A publication Critical patent/TW201724098A/en

Links

Landscapes

  • Debugging And Monitoring (AREA)

Description

快捷外設互聯標準硬碟狀態燈的控制方法及系統 Quick peripheral peripheral interconnection standard hard disk status light control method and system

本發明涉及PCIE固態硬碟的技術領域,特別是涉及一種PCIE硬碟狀態燈的控制方法及系統。 The present invention relates to the technical field of PCIE solid state hard disks, and in particular to a method and system for controlling a PCIE hard disk status light.

目前,伺服器使用的大部分是傳輸速率為6G的SATA/SAS硬碟,小部分使用傳輸速率為12G的SATA/SAS硬碟。如第一圖所示,在控制傳輸速率為6G或12G的SATA/SAS硬碟的狀態燈顯示時,中央處理單元(Central Processing Unit;CPU)PA1藉由SAS控制器PA2連接到SAS擴展器(SAS Expander)PA3,SAS擴展器將信號連接到SFF-8639連接器PA4上,再由SFF-8639連接器PA4外接傳輸速率為6G或12G的SATA/SAS硬碟PA5,從而實現CPU PA1對傳輸速率為6G或12G的SATA/SAS硬碟PA5信號燈的控制。具體地,系統端的tool下命令到CPU PA1端,由CPU PA1藉由SAS控制器PA2去控制SAS擴展器發出串行輸入輸出(Small General Purpose Input Output;SGPIO)信號到複雜可程式邏輯控制器(Complex Programmable Logic Device;CPLD),再由CPLD去解析SGPIO組信號並輸出到對應硬碟的狀態燈,從而實現對傳輸速率為6G或12G的SATA/SAS硬碟PA5的狀態燈的控制。 Currently, most of the servers use SATA/SAS hard drives with a transfer rate of 6G, and a small portion uses SATA/SAS hard drives with a transfer rate of 12G. As shown in the first figure, when the status light of the SATA/SAS hard disk with the transmission rate of 6G or 12G is displayed, the central processing unit (CPU) PA1 is connected to the SAS expander by the SAS controller PA2 ( SAS Expander) PA3, SAS expander connects the signal to the SFF-8639 connector PA4, and then the SFF-8639 connector PA4 externally transmits the SATA/SAS hard disk PA5 with a transmission rate of 6G or 12G, thus achieving the CPU PA1 pair transmission rate. Control of 6G or 12G SATA/SAS hard disk PA5 signal lights. Specifically, the system-side tool commands to the CPU PA1 side, and the CPU PA1 controls the SAS expander to issue a Serial General Purpose Input Output (SGPIO) signal to the complex programmable logic controller through the SAS controller PA2 ( Complex Programmable Logic Device (CPLD), which then analyzes the SGPIO group signal and outputs it to the status light of the corresponding hard disk, thereby realizing the control of the status light of the SATA/SAS hard disk PA5 with a transmission rate of 6G or 12G.

隨著PCIE固態硬碟的廣泛使用,在一些伺服器上開始使用PCIE固態硬碟(PCIE SSD)。如再参照第一圖所示方式,SFF-8639連接器PA4為SATA/SAS硬碟和PCIE SSD提供了非共用的接腳,二者互斥訪問。然而,PCIE SSD現有的工作模式導致CPU PA1無法控制PCIE SSD狀態燈,從而無法及時判斷PCIE SSD的使用狀態。 With the widespread use of PCIE SSDs, PCIE Solid State Drives (PCIE SSDs) have been used on some servers. As further referred to in the first figure, the SFF-8639 connector PA4 provides non-shared pins for SATA/SAS hard disks and PCIE SSDs, which are mutually exclusive access. However, the existing working mode of the PCIE SSD causes the CPU PA1 to be unable to control the PCIE SSD status light, so that the PCIE SSD usage status cannot be determined in time.

鑑於以上所述現有技術的缺點,本發明的目的在於提供一種PCIE硬碟狀態燈的控制方法及系統,能夠實現PCIE硬碟的復位和定位操作所對應狀態燈的顯示控制,從而便於及時判斷PCIE硬碟的使用狀態。 In view of the above disadvantages of the prior art, an object of the present invention is to provide a method and system for controlling a PCIE hard disk status light, which can realize display control of a status light corresponding to a reset and positioning operation of a PCIE hard disk, thereby facilitating timely judgment of PCIE. The state of use of the hard drive.

為實現上述目的及其他相關目的,本發明提供一種PCIE硬碟狀態燈的控制方法,包括以下步驟:判斷PCIE硬碟的當前工作模式;CPU將所述當前工作模式信息發送至南橋晶片;所述南橋晶片將所述當前工作模式信息發送至複雜可程式邏輯控制器;根據所述當前工作模式信息,所述複雜可程式邏輯控制器控制所述當前工作模式對應的狀態燈的顯示。於本發明的一實施例中,PCIE硬碟的工作模式包括硬碟復位模式和硬碟定位模式。 To achieve the above and other related objects, the present invention provides a method for controlling a PCIE hard disk status light, comprising the steps of: determining a current working mode of a PCIE hard disk; and transmitting, by the CPU, the current working mode information to a south bridge chip; The south bridge chip sends the current working mode information to the complex programmable logic controller; according to the current working mode information, the complex programmable logic controller controls display of the status light corresponding to the current working mode. In an embodiment of the invention, the working mode of the PCIE hard disk includes a hard disk reset mode and a hard disk localization mode.

於本發明的一實施例中,將所述當前工作模式信息發送至所述南橋晶片時,藉由所述南橋晶片的GPIO串口擴展器對應的輸出電平暫存器來記錄所述當前工作模式信息。 In an embodiment of the present invention, when the current working mode information is sent to the south bridge chip, the current working mode is recorded by an output level register corresponding to the GPIO serial port expander of the south bridge chip. information.

於本發明的一實施例中,所述輸出電平暫存器共佔64位元,低8位由BIOS佔用,用兩位元表示PCIE硬碟的工作模式。 In an embodiment of the invention, the output level register occupies a total of 64 bits, and the lower 8 bits are occupied by the BIOS, and the working mode of the PCIE hard disk is represented by two bits.

於本發明的一實施例中,所述南橋晶片將所述當前工作模式信息發送至所述複雜可程式邏輯控制器時,包括以下步驟:對所述當前工作模式信息進行海明校驗(Hamming Check),生成海明校驗編碼(Hamming Check Code)資料;將生成的海明校驗編碼資料發送至所述複雜可程式邏輯控制器。 In an embodiment of the invention, when the south bridge chip sends the current working mode information to the complex programmable logic controller, the method includes the following steps: performing Hamming check on the current working mode information (Hamming) Check), generating Hamming Check Code data; and transmitting the generated Hamming check code data to the complex programmable logic controller.

同時,本發明還提供一種PCIE硬碟狀態燈的控制系統,包括判斷模組、第一發送模組、第二發送模組和控制模組;所述判斷模組用於判斷PCIE硬碟的當前工作模式;所述第一發送模組與所述判斷模組相連,用於透過CPU將所述當前工作模式信息發送至南橋晶片;所述第二發送模組與所述第一發送模組相連,用於藉由所述南橋晶片將所述當前工作模式信息發送至複雜可程式邏輯控制器;所述控制模組與所述第二發送模組相連,用於根據所述當前工作模式信息,藉由所述複雜可程式邏輯控制器控制所述當前工作模式對應的狀態燈的顯示。 Meanwhile, the present invention further provides a control system for a PCIE hard disk status light, including a determination module, a first transmission module, a second transmission module, and a control module; the determination module is configured to determine a current PCIE hard disk a working mode; the first sending module is connected to the determining module, configured to send the current working mode information to a south bridge chip through a CPU; and the second sending module is connected to the first sending module And sending, by the south bridge chip, the current working mode information to a complex programmable logic controller; the control module is connected to the second sending module, configured to use, according to the current working mode information, The display of the status light corresponding to the current working mode is controlled by the complex programmable logic controller.

於本發明的一實施例中,PCIE硬碟的工作模式包括硬碟復位模式和硬碟定位模式。 In an embodiment of the invention, the working mode of the PCIE hard disk includes a hard disk reset mode and a hard disk localization mode.

於本發明的一實施例中,所述第一發送模組將所述當前工作模式信息發送至所述南橋晶片時,藉由所述南橋晶片的GPIO串口擴展器對應的輸出電平暫存器來記錄所述當前工作模式信息。 In an embodiment of the present invention, when the first sending module sends the current working mode information to the south bridge chip, an output level register corresponding to the GPIO serial port expander of the south bridge chip To record the current working mode information.

本發明所採用的具體實施例,將藉由以下之實施例及圖式作進一步之說明。 The specific embodiments of the present invention will be further described by the following examples and drawings.

於本發明的一實施例中,所述輸出電平暫存器共佔64位元,低8位由BIOS佔用,用兩位元表示PCIE硬碟的工作模式。 In an embodiment of the invention, the output level register occupies a total of 64 bits, and the lower 8 bits are occupied by the BIOS, and the working mode of the PCIE hard disk is represented by two bits.

於本發明的一實施例中,所述南橋晶片將所述當前工作模式信息發送至所述複雜可程式邏輯控制器時,包括以下步驟:對所述當前工作模式信息進行海明校驗,生成海明校驗編碼資料;將生成的海明校驗編碼資料發送至所述複雜可程式邏輯控制器。 In an embodiment of the present invention, when the south bridge chip sends the current working mode information to the complex programmable logic controller, the method includes the following steps: performing a Hamming check on the current working mode information, and generating Hamming check code data; send the generated Hamming check code data to the complex programmable logic controller.

如上所述,本發明的PCIE硬碟狀態燈的控制方法及系統,具有以下有益效果:(1)CPU藉由南橋晶片對CPLD進行控制,進而實現對PCIE硬碟的復位和定位操作所對應狀態燈的顯示控制;(2)能夠及時判斷PCIE硬碟的使用狀態;(3)藉由對當前工作模式信息進行海明校驗,保證了狀態燈的準確顯示。 As described above, the control method and system for the PCIE hard disk status lamp of the present invention have the following beneficial effects: (1) The CPU controls the CPLD by the south bridge chip, thereby realizing the state corresponding to the reset and positioning operation of the PCIE hard disk. Display control of the lamp; (2) able to judge the use status of the PCIE hard disk in time; (3) ensure the accurate display of the status light by performing Hamming check on the current working mode information.

PA1‧‧‧CPU PA1‧‧‧CPU

PA2‧‧‧SAS控制器 PA2‧‧‧SAS controller

PA3‧‧‧SAS擴展器 PA3‧‧‧SAS expander

PA4‧‧‧SFF-8639連接器 PA4‧‧‧SFF-8639 connector

PA5‧‧‧SATA/SAS硬碟 PA5‧‧‧SATA/SAS hard drive

100‧‧‧CPU 100‧‧‧CPU

200‧‧‧SFF-8639連接器 200‧‧‧SFF-8639 connector

300‧‧‧PCIE硬碟 300‧‧‧PCIE hard disk

1‧‧‧判斷模組 1‧‧‧Judgement module

2‧‧‧第一發送模組 2‧‧‧First Sending Module

3‧‧‧第二發送模組 3‧‧‧Second Transmitter

4‧‧‧控制模組 4‧‧‧Control Module

第一圖顯示為先前技術中SATA/SAS硬碟的狀態燈控制系統的結構示意圖;第二圖顯示為本發明技術中PCIE硬碟的狀態燈控制系統的結構示意圖;第三圖顯示為本發明的PCIE硬碟狀態燈的控制方法的流程圖;以及第四圖顯示為本發明的PCIE硬碟狀態燈的控制系統的結構示意圖。 The first figure shows the structure of the state light control system of the SATA/SAS hard disk in the prior art; the second figure shows the structure of the state light control system of the PCIE hard disk in the technology of the present invention; the third figure shows the present invention. A flowchart of a method for controlling a PCIE hard disk status lamp; and a fourth diagram showing a structure of a control system for a PCIE hard disk status lamp of the present invention.

以下藉由特定的具體實例說明本發明的實施方式,本領域技術人員可由本說明書所揭露的內容輕易地了解本發明的其他優點與功效。本發明還可以藉由另外不同的具體實施方式加以實施或應用,本說明書中的各 項細節也可以基於不同觀點與應用,在沒有背離本發明的精神下進行各種修飾或改變。需說明的是,在不衝突的情況下,以下實施例及實施例中的特徵可以相互組合。 The embodiments of the present invention are described below by way of specific examples, and those skilled in the art can readily understand other advantages and effects of the present invention from the disclosure of the present disclosure. The invention may also be embodied or applied by various other specific embodiments, each of the The details of the items may also be varied and changed without departing from the spirit and scope of the invention. It should be noted that the features in the following embodiments and embodiments may be combined with each other without conflict.

需要說明的是,以下實施例中所提供的圖示僅以示意方式說明本發明的基本構想,遂圖式中僅顯示與本發明中有關的組件而非按照實際實施時的組件數目、形狀及尺寸繪製,其實際實施時各組件的型態、數量及比例可為一種隨意的改變,且其組件佈局型態也可能更為複雜。 It should be noted that the illustrations provided in the following embodiments merely illustrate the basic concept of the present invention in a schematic manner, and only the components related to the present invention are shown in the drawings, rather than the number and shape of components in actual implementation. Dimensional drawing, the actual type of implementation of each component's type, number and proportion can be a random change, and its component layout can be more complicated.

本發明的PCIE硬碟狀態燈的控制方法及系統藉由複雜可程式邏輯控制器(Complex Programmable Logic Device,CPLD)來實現PCIE硬碟的復位(Reset)和定位(Locate)操作所對應狀態燈的顯示控制。其中,本發明的PCIE硬碟狀態燈的控制方法及系統產生資料到CPLD,而CPLD可以控制PCIE硬碟的供電,進而實現對PCIE硬碟狀態燈的控制。 The control method and system for the PCIE hard disk status lamp of the present invention realizes the reset status of the PCIE hard disk and the status light corresponding to the positioning operation by the Complex Programmable Logic Device (CPLD). Display control. The control method and system of the PCIE hard disk status lamp of the present invention generate data to the CPLD, and the CPLD can control the power supply of the PCIE hard disk, thereby implementing control of the PCIE hard disk status light.

参照第二圖,CPU 100將PCIE信號線轉成SAS信號線直接連接到SFF-8639連接器200上,再由SFF-8639連接器PA4外接PCIE硬碟300。在本發明中所述的PCIE硬碟300係泛指各種利用PCIE介面傳輸資料與信號之硬碟,其中包含PCIE固態硬碟(PCIE SSD)。 Referring to the second figure, the CPU 100 converts the PCIE signal line into a SAS signal line and directly connects to the SFF-8639 connector 200, and then connects the PCIE hard disk 300 to the SFF-8639 connector PA4. The PCIE hard disk 300 described in the present invention generally refers to various hard disks that use the PCIE interface to transmit data and signals, including a PCIE solid state drive (PCIE SSD).

參照第三圖,本發明的PCIE硬碟狀態燈的控制方法包括以下步驟:步驟S1、判斷PCIE硬碟的當前工作模式。其中,PCIE硬碟的工作模式包括硬碟復位模式和硬碟定位模式。相較於現有技術,本發明增加了硬碟復位模式,從而可以根據狀態燈的顯示及時判斷PCIE硬碟的使用狀態。 Referring to the third figure, the control method of the PCIE hard disk status light of the present invention comprises the following steps: Step S1: determining the current working mode of the PCIE hard disk. Among them, the working mode of the PCIE hard disk includes a hard disk reset mode and a hard disk positioning mode. Compared with the prior art, the present invention increases the hard disk reset mode, so that the use state of the PCIE hard disk can be judged in time according to the display of the status light.

步驟S2、CPU將所述當前工作模式信息發送至南橋晶片(Platform Controller Hub,PCH)。其中,將當前工作模式信息發送至PCH時,從系統端修改南橋晶片的GPIO串口擴展器(GPIO Serial eXpander,GSX)對應的輸出電平暫存器(Output Level Register)以記錄當前工作模式信息。輸出 電平暫存器共佔64位元,其中低8位元被BIOS佔用,用所述64位元中除了BIOS所佔用的低8位元之外剩餘的56位元中的兩位元表示一個硬碟的工作模式。其中,高位元表示硬碟定位模式,低位元表示硬碟復位模式。 Step S2: The CPU sends the current working mode information to a Platform Controller Hub (PCH). When the current working mode information is sent to the PCH, the output level register corresponding to the GPIO Serial eXpander (GSX) of the south bridge chip is modified from the system side to record the current working mode information. Output The level register occupies a total of 64 bits, wherein the lower 8 bits are occupied by the BIOS, and the two bits of the remaining 56 bits except the lower 8 bits occupied by the BIOS are represented by the 64 bits. The working mode of the hard disk. Among them, the high bit indicates the hard disk positioning mode, and the low bit indicates the hard disk reset mode.

步驟S3、PCH將當前工作模式信息發送至複雜可程式邏輯控制器。其中,步驟S3包括以下步驟: Step S3: The PCH sends the current working mode information to the complex programmable logic controller. Wherein, step S3 comprises the following steps:

31)對當前工作模式信息進行海明校驗,生成海明校驗編碼資料。其中,海明碼可以糾正一位元的錯誤,檢測兩位元的錯誤,降低傳輸中的誤碼率。藉由利用海明校驗,能夠保證當前工作模式信息能夠準確地進行傳輸,以保證對LED狀態燈的準確顯示。 31) Perform Hamming check on the current working mode information to generate Hamming check code data. Among them, Hamming code can correct one-bit error, detect two-element error, and reduce the bit error rate in transmission. By using Hamming check, it is ensured that the current working mode information can be accurately transmitted to ensure accurate display of the LED status lights.

32)將生成的海明校驗編碼資料發送至CPLD。 32) Send the generated Hamming check code data to the CPLD.

步驟S4、根據當前工作模式信息,複雜可程式邏輯控制器控制當前工作模式對應的狀態燈的顯示。具體地,CPLD解析接收到的資料,獲取當前工作模式信息,並輸出信號到對應的LED狀態燈,以控制相應的LED狀態燈的顯示。 Step S4: The complex programmable logic controller controls the display of the status light corresponding to the current working mode according to the current working mode information. Specifically, the CPLD parses the received data, obtains the current working mode information, and outputs a signal to the corresponding LED status light to control the display of the corresponding LED status light.

現有技術中,伺服器中的最大應用場景包括24顆PCIE硬碟。下面基於12顆硬碟的應用場景來描述本發明的PCIE硬碟狀態燈的控制方法。 In the prior art, the largest application scenario in the server includes 24 PCIE hard disks. The control method of the PCIE hard disk status light of the present invention is described below based on the application scenario of 12 hard disks.

首先,利用MMAP函數將GSX暫存器的BASE ADDRESS(0xfed04000)映射到內存,該暫存器共佔0x400h bytes,GSX對應的輸出電平暫存器的偏移量是0x30h。由於輸出電平暫存器的低8位元被BIOS佔用,故使用bit 8~bit 63。但是為了便於計算,在設計編碼時,先按bit 0~bit 55編碼,最後將終值左移8位元並與BIOS控制的低8位元做或運算後再輸出。需要註明一點,上述算法只應用在12顆硬碟的場景,24顆硬碟數的場景則需要微調代碼才可實現。 First, the BASE ADDRESS (0xfed04000) of the GSX register is mapped to the memory by the MMAP function. The register accounts for 0x400h bytes, and the offset of the output level register corresponding to the GSX is 0x30h. Since the lower 8 bits of the output level register are occupied by the BIOS, bit 8~bit 63 is used. However, in order to facilitate calculation, when designing the code, first encode according to bit 0~bit 55, and finally shift the final value to the left by 8 bits and perform the OR operation with the lower 8 bits of the BIOS control before outputting. It should be noted that the above algorithm is only applied to the scene of 12 hard disks, and the scene of 24 hard disks requires fine tuning of the code.

硬碟編號與各自的控制位元間的分佈關係下表所示。 The distribution relationship between the hard disk number and the respective control bits is shown in the table below.

對當前工作模式信息進行海明校驗時,需要加入海明校驗碼。海明校驗碼的編碼規則是在正常的資料位中插入校驗碼,分別放在2n位,n=0,1,2,3,4......,海明校驗碼的長度與資料位的長度關係如表2所示。 When performing Hamming check on the current working mode information, you need to add the Hamming check code. The encoding rule of Hamming check code is to insert the check code into the normal data bits, which are placed in 2n bits, n=0, 1, 2, 3, 4..., Hamming check code. The relationship between the length and the length of the data bits is shown in Table 2.

由於只需要24位元即可表示12顆硬碟的兩個控制位元,所以只需要5個校驗碼。校驗碼和資料位組合後的排列關係如表3所示,其中,資料位用Di表示,校驗位用Pj表示。 Since only 24 bits are needed to represent the two control bits of 12 hard disks, only five check codes are needed. The arrangement relationship between the check code and the data bits is as shown in Table 3. The data bits are represented by Di and the check bits are represented by Pj.

由表3可知:整個校驗資料長度為29位,校驗位元P1是從第0位元開始,每隔一位校驗,即校驗第0位元,2位元,4位元,6位元,8位元......餘此類推。 It can be seen from Table 3 that the length of the whole check data is 29 bits, and the check bit P1 starts from the 0th bit, and every other check verifies that the 0th bit, 2 bits, 4 bits, 6-bit, 8-bit...

校驗位元P2是從第1位元開始,連續校驗兩位元,間隔兩位元,再校驗兩位元,即校驗第1、2位元,第5、6位元,第9、10位元......餘此類推。 The check bit P2 starts from the first bit, continuously checks two bits, and is separated by two bits, and then checks two bits, that is, the first and second bits are verified, and the fifth and sixth bits are used. 9, 10 bits... the rest of the way.

校驗位元P3是從第3位元開始,連續校驗四位元,間隔四位元,再校驗四位元,即校驗第3、4、5、6位元,第11、12、13、14位元,第19、20、21、22位元......餘此類推。 The check bit P3 starts from the third bit, continuously checks four bits, is separated by four bits, and then checks four bits, that is, checks the third, fourth, fifth, and sixth bits, the eleventh, the twelfth 13, 13 and 14 bits, 19th, 20th, 21st, 22nd...

校驗位元P4是從第7位元開始,連續校驗八位元,間隔八位元,再校驗八位元,即校驗第7、8、9、10、11、12、13、14位元,第23、24、25、26、27、28位元。 The check bit P4 starts from the 7th bit, continuously checks the octet, divides the octet, and checks the octet, that is, checks the 7, 8, 9, 10, 11, 12, 13, 14 bits, 23, 24, 25, 26, 27, 28 bits.

校驗位元P5是從第15位元開始,連續校驗十六位元,間隔十六位元,再校驗十六位元,即校驗第15、16、17、18、19、20、21、22、23、24、25、26、27、28位元。 The check bit P5 starts from the 15th bit, continuously checks the 16-bit, divides the 16-bit, and then checks the 16-bit, that is, the 15th, 16th, 17th, 18th, 19th, 20th. , 21, 22, 23, 24, 25, 26, 27, 28 bits.

因為對於12顆硬碟數量的背板,只需要一共29位資料位和校驗位,超出的部分不再校驗。如果是24顆硬碟數量的場景,就需要6個校驗碼。程序需要進行相應調整。 Because for the backplane of the number of 12 hard disks, only a total of 29 data bits and check digits are needed, and the excess is no longer verified. If it is a scene with 24 hard disks, you need 6 checksums. The program needs to be adjusted accordingly.

下面使用偶校驗來生成校驗碼,即每個校驗碼所需要校驗的資料位元連同校驗碼本身,包含“1“的個數為偶數,具體校驗關係如表4所示。 The parity check code is generated by using the even check, that is, the data bit to be verified by each check code together with the check code itself, and the number of "1" is even, and the specific check relationship is as shown in Table 4. .

將有效資料位放置到正確的海明碼位置。根據原始編碼與海明碼位置的關係的代碼如下:if(0==strcmp(argv[1],ResetCmd)) { //gsxOut0=0x1<<hd_index; base=2; /*The empty location is reserver for parity bit.*/ if(hd_index>=1) offset++; if(hd_index>=2) offset++; if(hd_index>=6) offset++; } if(0==strcmp(argv[1],LocateCmd)∥0==strcmp(argv[1],UnFreezeCmd)) { //gsxOut0=0x02<<hd_index; base=4; /*The empty location is reserver for parity bit.*/ if(hd_index>=2) offset++; if(hd_index>=5) offset++; } if(0==strcmp(argv[1],UnFreezeCmd)) gsxOut0 &=~(1<<(hd_index * 2+base+offset));//unfreeze action need to clear the locate bit of corresponding hard disk. else gsxOut0 |=1<<(hd_index * 2+base+offset);//move the locate bit to the correct location. Place the valid data bits in the correct Hamming code position. The code based on the relationship between the original encoding and the Hamming code position is as follows: if(0==strcmp(argv[1], ResetCmd)) { //gsxOut0=0x1<<hd_index; base=2; /*The empty location is reserver for parity bit.*/ if(hd_index>=1) offset++; if(hd_index>=2) offset++; if(hd_index>=6 Offset++; } if(0==strcmp(argv[1],LocateCmd)∥0==strcmp(argv[1],UnFreezeCmd)) { //gsxOut0=0x02<<hd_index; base=4; /*The empty Location is reserver for parity bit.*/ if(hd_index>=2) offset++; if(hd_index>=5) offset++; } if(0==strcmp(argv[1],UnFreezeCmd)) gsxOut0 &=~(1< <(hd_index * 2+base+offset));//unfreeze action need to clear the locate bit of corresponding hard disk. Else gsxOut0 |=1<<(hd_index * 2+base+offset);//move the locate bit to the correct location.

將有效資料位放置到正確位置後,生成校驗資料的代碼如下:for(i=0;i<MaxParityIndex;i++) { counter=0; parityBit=0; dataPower=(0x1<<i)-1; gsxOut0 &=~(0x1<<dataPower);//Clear the parity bit. for(j=dataPower;j<TotalBitsNumber;j++) { parityBit+=((gsxOut0>>j)& 0x1); counter++; if(counter==(0x1<<i)) { j+=counter; counter=0; } } gsxOut0 |=((parityBit & 0x1)<<dataPower);//even parity check,save the parity bit to corresponding locateion. } gsxOut1=(gsxOut0>>24); gsxOut0=(gsxOut0<<8)|(value_olvl1 & 0x000000FF);由於資料位加校驗位需空出被BIOS使用的低8位元,故傳輸的資料總和會從GSX的輸出暫存器0的32位元中溢出。/*BIOS set the default value to 0xFFFFFFFF,and we need to clean this value when the value is 0xFFFFFFFF to 0x000000FF. * And we need to keep the Locate LED data when system not reset.*/ if(value_olvl1==0xFFFFFFFF) gsxOut0=(value_olvl1 & 0x000000FF)>>8; else gsxOut0=(value_olvl1>>8)|(value_olvl2<<24);最後將運算後的資料寫回GSX的輸出電平暫存器,同樣由於資料從GSX輸出暫存器0中溢出,所以要把溢出的資料存儲到GSX輸出暫存器1中。*((unsigned int *)addr_olvl1)=gsxOut0; *((unsigned int *)addr_olvl2)=gsxOut1;並且開啟序列號進程。addr_CMD=gsx_base+0x40; *((unsigned int *)addr_CMD)=1;對於硬件復位的調用,在發送完資料後,需要將原資料復位,因為復位操作只是一次性的,不需要保持。if(0==strcmp(argv[1],ResetCmd))//the reset command need to clean the reset bit after transfer. { *((unsigned int *)addr_olvl1)=value_olvl1;//zwg 2015-07-24 the locate action need keep data.So disable this code. *((unsigned int *)addr_olvl2)=value_olvl2; }最後終止發送*((unsigned int *)addr_CMD)=0;完成運作。 After placing the valid data bits in the correct position, the code for generating the verification data is as follows: for(i=0;i<MaxParityIndex;i++) { counter=0; parityBit=0; dataPower=(0x1<<i)-1; gsxOut0 &=~(0x1<<dataPower);//Clear the parity bit. for(j=dataPower;j<TotalBitsNumber;j++) { parityBit+=((gsxOut0>>j)&0x1);counter++; if(counter= =(0x1<<i)) { j+=counter; counter=0; } } gsxOut0 |=((parityBit &0x1)<<dataPower);//even parity check,save the parity bit to corresponding locateion. gsxOut1=(gsxOut0>>24); gsxOut0=(gsxOut0<<8)|(value_olvl1 &0x000000FF); Since the data bit plus check digit needs to be vacated by the lower 8 bits used by the BIOS, the sum of the transmitted data will be The 32 bits of the output register 0 of GSX overflow. /*BIOS set the default value to 0xFFFFFFFF, and we need to clean this value when the value is 0xFFFFFFFF to 0x000000FF. * And we need to keep the Locate LED data when system not reset.*/ if(value_olvl1==0xFFFFFFFF) gsxOut0 =(value_olvl1 &0x000000FF)>>8; else gsxOut0=(value_olvl1>>8)|(value_olvl2<<24); Finally, the calculated data is written back to the output level register of GSX, also because the data is output from GSX The scratchpad 0 overflows, so the overflow data is stored in the GSX output register 1. *((unsigned int *)addr_olvl1)=gsxOut0; *((unsigned int *)addr_olvl2)=gsxOut1; and the serial number process is turned on. addr_CMD=gsx_base+0x40; *((unsigned int *)addr_CMD)=1; For the hardware reset call, after the data is sent, the original data needs to be reset, because the reset operation is only one-time and does not need to be maintained. If(0==strcmp(argv[1],ResetCmd))//the reset command need to clean the reset bit after transfer. { *((unsigned int *)addr_olvl1)=value_olvl1;//zwg 2015-07-24 The locate action *((unsigned int *)addr_olvl2)=value_olvl2; } Finally terminates the transmission *((unsigned int *)addr_CMD)=0; completes the operation.

參照第四圖,本發明的PCIE硬碟狀態燈的控制系統包括判斷模組1、第一發送模組2、第二發送模組3和控制模組4。 Referring to the fourth figure, the control system of the PCIE hard disk status light of the present invention comprises a determination module 1, a first transmission module 2, a second transmission module 3 and a control module 4.

判斷模組1用於判斷PCIE硬碟的當前工作模式。其中,PCIE硬碟的工作模式包括硬碟復位模式和硬碟定位模式。相較於現有技術,本發明增加了硬碟復位模式,從而可以根據狀態燈的顯示及時判斷PCIE硬碟的使用狀態。 The judging module 1 is configured to judge the current working mode of the PCIE hard disk. Among them, the working mode of the PCIE hard disk includes a hard disk reset mode and a hard disk positioning mode. Compared with the prior art, the present invention increases the hard disk reset mode, so that the use state of the PCIE hard disk can be judged in time according to the display of the status light.

第一發送模組2與判斷模組1相連,用於藉由CPU將所述當前工作模式信息發送至PCH。其中,1將當前工作模式信息發送至PCH時,從系統端修改南橋晶片的GPIO串口擴展器(GPIO Serial eXpander,GSX)對應的輸出電平暫存器(Output Level Register)以記錄當前工作模式信息。輸出電平暫存器共佔64位元,其中低8位元被BIOS佔用,用所述64位元中除了BIOS所佔用的低8位元之外剩餘的56位元中的兩位元表示一個硬碟的工作模式。其中,高位元表示硬碟定位模式,低位元表示硬碟復位模式。 The first sending module 2 is connected to the determining module 1 and configured to send the current working mode information to the PCH by the CPU. Wherein, when the current working mode information is sent to the PCH, the output level register corresponding to the GPIO Serial eXpander (GSX) of the south bridge chip is modified from the system side to record the current working mode information. . The output level register occupies a total of 64 bits, wherein the lower 8 bits are occupied by the BIOS, and the two bits of the remaining 56 bits except the lower 8 bits occupied by the BIOS are represented by the 64 bits. A working mode of a hard drive. Among them, the high bit indicates the hard disk positioning mode, and the low bit indicates the hard disk reset mode.

第二發送模組3與第一發送模組2相連,用於藉由PCH將當前工作模式信息發送至複雜可程式邏輯控制器。其中,第二發送模組3藉由以下步驟來發送當前工作模式信息: The second sending module 3 is connected to the first sending module 2 for transmitting the current working mode information to the complex programmable logic controller by the PCH. The second sending module 3 sends the current working mode information by the following steps:

31)對當前工作模式信息進行海明校驗,生成海明校驗編碼資料。其中,海明碼可以糾正一位元的錯誤,檢測兩位元的錯誤,降低傳輸中的誤碼率。藉由利用海明校驗,能夠保證當前工作模式信息能夠準確地進行 傳輸,以保證對LED狀態燈的準確顯示。 31) Perform Hamming check on the current working mode information to generate Hamming check code data. Among them, Hamming code can correct one-bit error, detect two-element error, and reduce the bit error rate in transmission. By using Hamming check, it is possible to ensure that the current working mode information can be accurately performed. Transmission to ensure accurate display of LED status lights.

32)將生成的海明校驗編碼資料發送至CPLD。 32) Send the generated Hamming check code data to the CPLD.

控制模組4與第二發送模組3相連,用於根據當前工作模式信息,藉由複雜可程式邏輯控制器控制當前工作模式對應的狀態燈的顯示。具體地,CPLD解析接收到的資料,獲取當前工作模式信息,並輸出信號到對應的LED狀態燈,以控制相應的LED狀態燈的顯示。綜上所述,本發明的PCIE硬碟狀態燈的控制方法及系統CPU藉由南橋晶片對CPLD進行控制,進而實現對PCIE硬碟的復位和定位操作所對應狀態燈的顯示控制;因此,能夠及時判斷PCIE硬碟的使用狀態。同時,藉由對當前工作模式信息進行海明校驗,更能進一步保證了狀態燈的準確顯示。所以,本發明有效克服了現有技術中的種種缺點而具高度產業利用價值。 The control module 4 is connected to the second sending module 3, and is configured to control the display of the status light corresponding to the current working mode by the complex programmable logic controller according to the current working mode information. Specifically, the CPLD parses the received data, obtains the current working mode information, and outputs a signal to the corresponding LED status light to control the display of the corresponding LED status light. In summary, the control method and system CPU of the PCIE hard disk status lamp of the present invention controls the CPLD by the south bridge chip, thereby realizing the display control of the status light corresponding to the reset and positioning operation of the PCIE hard disk; therefore, Timely judge the use status of the PCIE hard disk. At the same time, by performing Hamming check on the current working mode information, the accurate display of the status light can be further ensured. Therefore, the present invention effectively overcomes various shortcomings in the prior art and has high industrial utilization value.

上述實施例僅例示性說明本發明的原理及其功效,而非用於限制本發明。任何熟悉此技術的人士皆可在不違背本發明的精神及範疇下,對上述實施例進行修飾或改變。因此,舉凡所屬技術領域中具有通常知識者在未脫離本發明所揭示的精神與技術思想下所完成的一切等效修飾或改變,仍應由本發明的權利要求所涵蓋。 The above-described embodiments are merely illustrative of the principles of the invention and its effects, and are not intended to limit the invention. Modifications or variations of the above-described embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention. Therefore, all equivalent modifications or changes made by those skilled in the art without departing from the spirit and scope of the invention will be covered by the appended claims.

Claims (8)

一種快捷外設互聯標準硬碟狀態燈的控制方法,包括以下步驟:判斷一快捷外設互聯標準(Peripheral Component Interconnect Express;PCIE)硬碟的當前工作模式;利用一中央處理單元(Central Processing Unit;CPU)將所述當前工作模式信息發送至一南橋晶片;所述南橋晶片將所述當前工作模式信息進行海明校驗(Hamming Check),以生成一海明校驗編碼(Hamming Check Code)資料,並將生成的所述海明校驗編碼資料發送至一複雜可程式邏輯控制器;以及根據所述當前工作模式信息,所述複雜可程式邏輯控制器控制所述當前工作模式對應的狀態燈的顯示。 A method for controlling a standard peripheral hard disk status light, comprising the steps of: determining a current working mode of a Peripheral Component Interconnect Express (PCIE) hard disk; and utilizing a central processing unit (Central Processing Unit; The CPU transmits the current working mode information to a south bridge chip; the south bridge chip performs a Hamming Check on the current working mode information to generate a Hamming Check Code data. And generating the generated Hamming check coded data to a complex programmable logic controller; and according to the current working mode information, the complex programmable logic controller controls the status light corresponding to the current working mode Display. 如申請專利範圍第1項所述的PCIE硬碟狀態燈的控制方法,其中,所述PCIE硬碟的工作模式包括硬碟復位(Reset)模式和硬碟定位(Locate)模式。 The method for controlling a PCIE hard disk status light according to claim 1, wherein the working mode of the PCIE hard disk comprises a hard disk reset mode and a hard disk positioning mode. 如申請專利範圍第1項所述的PCIE硬碟狀態燈的控制方法,其中,將所述當前工作模式信息發送至所述南橋晶片時,是藉由所述南橋晶片的GPIO串口擴展器對應的輸出電平暫存器來記錄所述當前工作模式信息。 The method for controlling a PCIE hard disk status lamp according to claim 1, wherein the current working mode information is sent to the south bridge chip by a GPIO serial port expander of the south bridge chip. The level register is output to record the current operating mode information. 如申請專利範圍第3項所述的PCIE硬碟狀態燈的控制方法,其中,所述輸出電平暫存器共佔64位元,低8位元由基本輸入輸 出系統(Basic Input/Output System;BIOS)佔用,用所述64位元中,除了BIOS所佔用的低8位元之外剩餘的56位元中的兩位元表示所述PCIE硬碟的工作模式。 The method for controlling a PCIE hard disk status lamp according to claim 3, wherein the output level register occupies a total of 64 bits, and the lower 8 bits are input by a basic input. The system (Basic Input/Output System; BIOS) occupies the work of the PCIE hard disk by using two bits of the remaining 56 bits except the lower 8-bit occupied by the BIOS. mode. 一種快捷外設互聯標準硬碟狀態燈的控制系統,包括:一判斷模組,用於判斷一快捷外設互聯標準(Peripheral Component Interconnect Express;PCIE)硬碟的當前工作模式;一第一發送模組,與所述判斷模組相連,用於透過一中央處理單元(Central Processing Unit;CPU)將所述當前工作模式信息發送至一南橋晶片;一第二發送模組,與所述第一發送模組相連,用於藉由所述南橋晶片將所述當前工作模式信息進行海明校驗(Hamming Check),生成一海明校驗編碼(Hamming Check Code)資料,並將生成的所述海明校驗編碼資料發送至一複雜可程式邏輯控制器;以及一控制模組,與所述第二發送模組相連,用於根據所述當前工作模式信息,藉由所述複雜可程式邏輯控制器控制所述當前工作模式對應的狀態燈的顯示。 A control system for a fast peripheral interconnect standard hard disk status light, comprising: a judgment module for determining a current working mode of a Peripheral Component Interconnect Express (PCIE) hard disk; a first transmit mode a group, connected to the determining module, configured to send the current working mode information to a south bridge chip through a central processing unit (CPU); a second sending module, and the first sending The modules are connected to perform a Hamming Check on the current working mode information by the south bridge chip, generate a Hamming Check Code data, and generate the sea The clear check code data is sent to a complex programmable logic controller; and a control module is connected to the second sending module, configured to be controlled by the complex programmable logic according to the current working mode information The device controls display of the status light corresponding to the current working mode. 如申請專利範圍第5項所述的PCIE硬碟狀態燈的控制系統,其中,所述PCIE硬碟的工作模式包括硬碟復位(Reset)模式和硬碟定位(Locate)模式。 The control system of the PCIE hard disk status light according to claim 5, wherein the working mode of the PCIE hard disk comprises a hard disk reset mode and a hard disk positioning mode. 如申請專利範圍第5項所述的PCIE硬碟狀態燈的控制系統,其中,所述第一發送模組將所述當前工作模式信息發送至所述南橋晶片時,藉由所述南橋晶片的GPIO串口擴展器對應的輸出電平暫存器來記錄所述當前工作模式信息。 The control system of the PCIE hard disk status lamp of claim 5, wherein the first transmitting module transmits the current working mode information to the south bridge wafer by using the south bridge wafer The output level register corresponding to the GPIO serial port expander records the current working mode information. 如申請專利範圍第7項所述的PCIE硬碟狀態燈的控制系統,其中,所述輸出電平暫存器共佔64位元,低8位元由BIOS佔用,用所述64位元中,除了BIOS所佔用的低8位元之外剩餘的56位元中的56位元中的兩位元表示所述PCIE硬碟的工作模式。 The control system of the PCIE hard disk status lamp according to claim 7, wherein the output level register occupies 64 bits, and the lower 8 bits are occupied by the BIOS, and the 64 bits are used. Two of the 56 bits remaining in the remaining 56 bits other than the low 8-bit occupied by the BIOS represent the operating mode of the PCIE hard disk.
TW104143795A 2015-12-25 2015-12-25 Method and system for controlling status indication light of pcie hard disk drive TWI584303B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW104143795A TWI584303B (en) 2015-12-25 2015-12-25 Method and system for controlling status indication light of pcie hard disk drive

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW104143795A TWI584303B (en) 2015-12-25 2015-12-25 Method and system for controlling status indication light of pcie hard disk drive

Publications (2)

Publication Number Publication Date
TWI584303B true TWI584303B (en) 2017-05-21
TW201724098A TW201724098A (en) 2017-07-01

Family

ID=59367378

Family Applications (1)

Application Number Title Priority Date Filing Date
TW104143795A TWI584303B (en) 2015-12-25 2015-12-25 Method and system for controlling status indication light of pcie hard disk drive

Country Status (1)

Country Link
TW (1) TWI584303B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100037043A1 (en) * 2008-08-11 2010-02-11 Kenneth Sheets Storage device selection and switching system
US20110295967A1 (en) * 2010-05-28 2011-12-01 Drc Computer Corporation Accelerator System For Remote Data Storage
US8078770B1 (en) * 2007-08-10 2011-12-13 American Megatrends, Inc. Combining multiple SGPIO streams to provide device status indicators
TW201222246A (en) * 2010-11-30 2012-06-01 Inventec Corp Computer chassis system and hard disk status display method thereof
US20140344962A1 (en) * 2013-05-17 2014-11-20 Nvidia Corporation Preventing water damage in portable devices
US20140344483A1 (en) * 2013-05-20 2014-11-20 Hon Hai Precision Industry Co., Ltd. Monitoring system and method for monitoring hard disk drive working status
US20140344484A1 (en) * 2013-05-17 2014-11-20 Hong Fu Jin Precision Industry (Shenzhen) Co., Ltd. Detection system for hard disk drive
US9087548B2 (en) * 2013-04-23 2015-07-21 Hong Fu Jin Precision Industry (Shenzhen) Co., Ltd. Control circuit for hard disk drive

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8078770B1 (en) * 2007-08-10 2011-12-13 American Megatrends, Inc. Combining multiple SGPIO streams to provide device status indicators
US20100037043A1 (en) * 2008-08-11 2010-02-11 Kenneth Sheets Storage device selection and switching system
US20110295967A1 (en) * 2010-05-28 2011-12-01 Drc Computer Corporation Accelerator System For Remote Data Storage
TW201222246A (en) * 2010-11-30 2012-06-01 Inventec Corp Computer chassis system and hard disk status display method thereof
US9087548B2 (en) * 2013-04-23 2015-07-21 Hong Fu Jin Precision Industry (Shenzhen) Co., Ltd. Control circuit for hard disk drive
US20140344962A1 (en) * 2013-05-17 2014-11-20 Nvidia Corporation Preventing water damage in portable devices
US20140344484A1 (en) * 2013-05-17 2014-11-20 Hong Fu Jin Precision Industry (Shenzhen) Co., Ltd. Detection system for hard disk drive
US20140344483A1 (en) * 2013-05-20 2014-11-20 Hon Hai Precision Industry Co., Ltd. Monitoring system and method for monitoring hard disk drive working status

Also Published As

Publication number Publication date
TW201724098A (en) 2017-07-01

Similar Documents

Publication Publication Date Title
US10909818B2 (en) Method and system for controlling status indication light of PCIE hard disk drive
KR101931297B1 (en) Stacked memory device with metadata management
KR101689998B1 (en) High performance interconnect link layer
TWI566088B (en) Header parity error handling
US8990657B2 (en) Selective masking for error correction
KR101887126B1 (en) Enhanced data bus invert encoding for or chained buses
US20150121166A1 (en) Ecc bypass using low latency ce correction with retry select signal
US20130266047A1 (en) 8b/9b decoding for reducing crosstalk on a high speed parallel bus
WO2017113333A1 (en) Fpga circuit and method for processing configuration file thereof
WO2015080819A1 (en) Error correction in memory
CN103218271B (en) A kind of data error-correcting method and device
WO2014051797A1 (en) Techniques associated with error correction for encoded data
US20220107867A1 (en) End-to-end data protection for compute in memory (cim)/compute near memory (cnm)
US8738990B2 (en) Cyclic redundancy check generation via distributed time multiplexed linear feedback shift registers
TW202121879A (en) System, apparatus and method for communicating telemetry information via virtual bus encodings
TWI584303B (en) Method and system for controlling status indication light of pcie hard disk drive
US11755525B2 (en) System including PIPE5 to PIPE4 converter and method thereof
CN104182292A (en) Data storage method and device
US10044500B2 (en) Error correction coding redundancy based data hashing
CN112068985A (en) NORFLASH memory ECC (error correction code) error detection and correction method and system with programming instruction identification function
WO2023020114A1 (en) Data processing method and apparatus
WO2023129284A1 (en) Selectable cache writing policies for cache management
WO2022252987A1 (en) Method and apparatus for testing memory chip
WO2024016971A1 (en) Error determination method and system, processor, and memory
US20120226949A1 (en) Multi-Channel Bus Protection