CN113076140A - GPIO (general purpose input/output) configuration detection method and device and server - Google Patents

GPIO (general purpose input/output) configuration detection method and device and server Download PDF

Info

Publication number
CN113076140A
CN113076140A CN202110322679.6A CN202110322679A CN113076140A CN 113076140 A CN113076140 A CN 113076140A CN 202110322679 A CN202110322679 A CN 202110322679A CN 113076140 A CN113076140 A CN 113076140A
Authority
CN
China
Prior art keywords
logic
gpio
detection
pin
bios
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202110322679.6A
Other languages
Chinese (zh)
Other versions
CN113076140B (en
Inventor
罗鹏芳
杨少俊
王兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Yingxin Computer Technology Co Ltd
Original Assignee
Shandong Yingxin Computer Technology Co Ltd
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 Shandong Yingxin Computer Technology Co Ltd filed Critical Shandong Yingxin Computer Technology Co Ltd
Priority to CN202110322679.6A priority Critical patent/CN113076140B/en
Publication of CN113076140A publication Critical patent/CN113076140A/en
Application granted granted Critical
Publication of CN113076140B publication Critical patent/CN113076140B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2289Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing by configuration test

Abstract

The invention discloses a GPIO configuration detection method, a device and a server, which are characterized in that each GPIO and hardware are initialized; after initialization, sequentially reading pin logics of all GPIOs; comparing the read pin logic with standard logic in a pre-stored logic detection table, and judging whether the read pin logic is consistent with the standard logic; and outputting the comparison result, wherein if the comparison result is consistent with the comparison result, the GPIO configuration is normal, otherwise, the GPIO configuration is abnormal. The invention prestores a logic detection table, pin standard logic of the GPIO is stored in the table, a machine is started to automatically collect pin information of the GPIO, the collected information is matched with the prestored standard logic direction, automatic detection is carried out, and a detection result is obtained and output. The method can obtain the correctness of the current GPIO configuration in the PCH, enhance the testability of the GPIO function, improve the test integrity and effectively improve the detection efficiency.

Description

GPIO (general purpose input/output) configuration detection method and device and server
Technical Field
The invention relates to the field of GPIO configuration detection, in particular to a GPIO configuration detection method, a GPIO configuration detection device and a server.
Background
With the updating and upgrading of the PCH chip of the server, GPIOs of the PCH become more and more. The setting of GPIO is determined by hardware, a single GPIO is configured in the starting stage according to hardware design, and Native function or GPIO function is selected. Taking the GPIO function as an example, the GPIO function is configured to input and output signals, and how many are configured to be input and output depends on the hardware configuration. When configured as an output signal, it can be configured as a high level or a low level, the path bit of the GPIO allows inputting an SMI (system control interrupt), SCI (system management interrupt) or NMI (non maskable interrupt), each bit can be used as a path of the SMI or SCI, and some registers of the GPIO can be changed from lock down to read-only state.
Each GPIO corresponds to one function, the function can be ensured to normally run by checking the setting of each GPIO, and the abnormal test result of part of functions caused by the problem of the setting of part of GPIOs in the whole machine test can not occur. At present, part of set functions of the GPIO can be used for work function test, but most of the functions may not have corresponding function test cases, and the functions are generally read out through a tool during configuration verification, and the configuration of the GPIO is manually checked one by one. However, many GPIOs are in the PCH, manual inspection is time-consuming, errors are prone to occurring, and only developers can inspect the GPIOs, the tests cannot completely cover the functional tests, and functional abnormalities caused by GPIO configuration errors are prone to occurring.
Disclosure of Invention
In order to solve the above problems, the present invention provides a GPIO configuration detection method, apparatus, and server, which can automatically detect GPIO configuration and improve detection efficiency.
The technical scheme of the invention is as follows: a GPIO configuration detection method comprises the following steps:
s1, initializing each GPIO and hardware;
s2, sequentially reading the pin logic of each GPIO;
s3, comparing the read pin logic with the standard logic in the pre-stored logic detection table, and judging whether the two are consistent;
and S4, outputting the comparison result, wherein if the comparison result is consistent with the comparison result, the GPIO configuration is normal, otherwise, the GPIO configuration is abnormal.
Further, the method is performed during a BIOS boot process.
Further, steps S2-S4 are performed during the DXE phase of the BIOS boot process.
Further, step S1 is preceded by the following steps:
adding a detection variable in a BIOS, wherein the detection variable comprises an opening state and a closing state;
step S1 is followed by the following steps:
judging the state of the detection variable;
if the state of the check variable is on, performing subsequent steps S2-S4, and continuing to start the BIOS after completing step S4;
if the state of the detection variable is OFF, the steps S2-S4 are skipped and the BIOS is continuously started.
Further, the step S4 outputs the comparison result, specifically, outputs the comparison result through BIOS serial port printing.
Further, if the read pin logic does not match the standard logic in the pre-stored logic detection table, the output result includes the read pin logic and the corresponding standard logic.
The technical scheme of the invention also comprises a GPIO configuration detection device, which comprises,
an initialization module: initializing each GPIO and hardware;
a pin logic reading module: sequentially reading pin logics of all GPIOs;
a pin logic comparison module: comparing the read pin logic with standard logic in a pre-stored logic detection table, and judging whether the read pin logic is consistent with the standard logic;
a result output module: and outputting the comparison result, wherein if the comparison result is consistent with the comparison result, the GPIO configuration is normal, otherwise, the GPIO configuration is abnormal.
Further, the device operates during the BIOS boot process;
the pin logic reading module, the pin logic comparison module and the result output module operate in DXE stage of BIOS starting process.
Further, the device also comprises a control device,
a detection variable setting module: setting the state of a detection variable; wherein the detection variable comprises two states of opening and closing;
a detection variable state judgment module: judging the state of the detection variable; if the state of the detection variable is on, the BIOS is continuously started after the pin logic reading module, the pin logic comparison module and the result output module are operated; and if the state of the detection variable is closed, skipping over the pin logic reading module, the pin logic comparison module and the result output module and continuing to start the BIOS.
The technical scheme of the invention also comprises a server which executes any one of the methods when being started.
The GPIO configuration detection method, the device and the server pre-store a logic detection table, the pin standard logic of the GPIO is stored in the table, a machine is started to automatically collect pin information of the GPIO, the collected information is matched with the pre-stored standard logic direction, automatic detection is carried out, and a detection result is obtained and output. The method can obtain the correctness of the current GPIO configuration in the PCH, enhance the testability of the GPIO function, improve the test integrity and effectively improve the detection efficiency.
Drawings
FIG. 1 is a schematic flow chart of a method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a method of one embodiment of the present invention;
fig. 3 is a schematic block diagram of a second structure according to an embodiment of the present invention.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings by way of specific examples, which are illustrative of the present invention and are not limited to the following embodiments.
The following explains some of the english terms referred to in this application:
BIOS: basic Input Output System, Basic Input Output System;
GPIO: general-purpose input/output, General-purpose input/output;
DXE phase: driver Execution Environment, one of Execution phases of UEFI BIOS; the stage executes most of system initialization work, and when the stage is entered, the memory can be completely used, so that a large amount of complex work can be performed in the stage;
PCH: platform Controller Hub, Intel corporation integrated south bridge.
Example one
As shown in fig. 1, the present embodiment provides a GPIO configuration detection method, which includes the following steps:
s1, initializing each GPIO and hardware;
s2, sequentially reading the pin logic of each GPIO;
s3, comparing the read pin logic with the standard logic in the pre-stored logic detection table, and judging whether the two are consistent;
and S4, outputting the comparison result, wherein if the comparison result is consistent with the comparison result, the GPIO configuration is normal, otherwise, the GPIO configuration is abnormal.
The method comprises the steps of firstly pre-storing a logic detection table, storing pin standard logic of each GPIO in the table, automatically detecting the configuration of the GPIO in a mode of matching and comparing the pin standard logic with the pin standard logic in the table after reading the pin logic of each GPIO, and improving the detection efficiency without manual inspection.
The method of the embodiment is executed in the BIOS starting process, and the GPIO pin logic is automatically detected in the BIOS starting process to give a detection result. Specifically, the execution of detection is controlled by adding a detection variable in a setting menu of the BIOS, the detection variable includes two states of on and off, when the detection variable is in the on state, the method of the embodiment is executed to perform GPIO pin logic detection, otherwise, the detection is skipped to normally start the BIOS.
To further illustrate the present invention, an embodiment of the present invention is provided below with reference to the above steps, based on the principle of the present invention, as shown in fig. 2, the embodiment includes the following steps:
SS1, adding menu option of detecting variable in BIOS;
the option is newly added for the tester to set according to the requirement, the states of the detection variables comprise an opening state and a closing state, and the detection function is opened or closed according to the requirement.
SS2, pre-storing a logic detection table;
and a tester prestores a logic detection table, and pin standard logic of each GPIO is stored in the table for subsequent detection.
SS3, setting the state of the detection variable;
as described above, the test variables include both on and off states, which the tester selects as needed.
SS4, starting BIOS, initializing each GPIO and hardware;
initializing each GPIO and hardware after starting the BIOS, and completing pin configuration of the GPIO after initialization is completed;
SS5, judging the state of the detection variable; if the state of the detection variable is on, the step SS6 is entered, and if the state of the detection variable is off, the step SS9 is entered;
and (4) performing GPIO pin logic detection in an opening state, otherwise, not performing detection, and continuing to normally start the BIOS.
Note that step SS 5-step SS8 are performed during the DXE phase of the BIOS boot process.
SS6, reading the pin logic of each GPIO in turn;
SS7, comparing the read pin logic with the standard logic in the pre-stored logic detection table, and judging whether the two are consistent;
after detection, the pin logic of each GPIO is firstly read, the read pin logic is compared and matched with the standard logic in the logic detection table, whether the pin logic and the standard logic are consistent or not is detected, if so, GPIO configuration is correct, and if not, GPIO configuration is wrong.
It should be noted that the comparison and matching can be performed once every time one GPIO is read.
SS8, outputting the comparison result, if the comparison result is consistent with the comparison result, the GPIO configuration is normal, otherwise, the GPIO configuration is abnormal;
and after all the comparison is finished, printing the result through the BIOS serial port and outputting the result. It should be noted that, for the case that the read pin logic does not match the standard logic in the pre-stored logic detection table, the output result includes the read pin logic and the corresponding standard logic. In addition, if the read pin logic is not matched with the standard logic in the pre-stored logic detection table, the configuration is displayed as abnormal on the output result, and if the read pin logic is not matched with the standard logic in the pre-stored logic detection table, the configuration is displayed as normal.
SS9, continuing to start BIOS;
and after the detection is finished or when the detection is not carried out, normally starting the BIOS.
The method automatically completes the GPIO pin logic detection in the BIOS starting stage, thereby knowing whether the GPIO is configured correctly, displaying the result visually and having high detection efficiency.
Example two
As shown in fig. 3, on the basis of the first embodiment, the present embodiment provides a GPIO configuration detection apparatus, which executes the method of the first embodiment after operation, and includes the following functional modules.
The initialization module 101: initializing each GPIO and hardware;
pin logic read module 102: sequentially reading pin logics of all GPIOs;
pin logic comparison module 103: comparing the read pin logic with standard logic in a pre-stored logic detection table, and judging whether the read pin logic is consistent with the standard logic;
the result output module 104: and outputting the comparison result, wherein if the comparison result is consistent with the comparison result, the GPIO configuration is normal, otherwise, the GPIO configuration is abnormal.
The device runs in the BIOS starting process, wherein the pin logic reading module, the pin logic comparison module and the result output module run in the DXE stage of the BIOS starting process, namely, the GPIO and hardware are initialized in the initialization stage of the BIOS starting process to complete configuration, and then the GPIO configuration is detected in the DXE stage.
In addition, the present embodiment is configured with a detection control function in advance, and determines whether the detection function is turned on. Specifically, the device further comprises the following functional modules.
The detection variable setting module 105: setting the state of a detection variable; wherein the detection variable comprises two states of opening and closing;
the detection variable state judgment module 106: judging the state of the detection variable; if the state of the detection variable is on, the BIOS is continuously started after the pin logic reading module, the pin logic comparison module and the result output module are operated; and if the state of the detection variable is closed, skipping over the pin logic reading module, the pin logic comparison module and the result output module and continuing to start the BIOS.
EXAMPLE III
The embodiment provides a server, which executes the method of the first embodiment when the server is started, and realizes the configuration detection of the GPIO in the process of starting the BIOS of the server.
The above disclosure is only for the preferred embodiments of the present invention, but the present invention is not limited thereto, and any non-inventive changes that can be made by those skilled in the art and several modifications and amendments made without departing from the principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A GPIO configuration detection method is characterized by comprising the following steps:
s1, initializing each GPIO and hardware;
s2, sequentially reading the pin logic of each GPIO;
s3, comparing the read pin logic with the standard logic in the pre-stored logic detection table, and judging whether the two are consistent;
and S4, outputting the comparison result, wherein if the comparison result is consistent with the comparison result, the GPIO configuration is normal, otherwise, the GPIO configuration is abnormal.
2. The GPIO configuration detection method of claim 1, wherein the method is performed during BIOS startup.
3. The GPIO configuration detection method of claim 2, wherein the steps S2-S4 are performed during DXE phase of the BIOS boot process.
4. The GPIO configuration detection method of claim 2 or 3, wherein step S1 is preceded by the steps of:
adding a detection variable in a BIOS, wherein the detection variable comprises an opening state and a closing state;
step S1 is followed by the following steps:
judging the state of the detection variable;
if the state of the check variable is on, performing subsequent steps S2-S4, and continuing to start the BIOS after completing step S4;
if the state of the detection variable is OFF, the steps S2-S4 are skipped and the BIOS is continuously started.
5. The GPIO configuration detection method according to claim 2 or 3, wherein the step S4 outputs the comparison result, specifically by BIOS serial port printing.
6. The GPIO configuration detection method of claim 5, wherein if the read pin logic does not match the standard logic in the pre-stored logic detection table, the output result comprises the read pin logic and the corresponding standard logic.
7. A GPIO configuration detection device is characterized by comprising,
an initialization module: initializing each GPIO and hardware;
a pin logic reading module: sequentially reading pin logics of all GPIOs;
a pin logic comparison module: comparing the read pin logic with standard logic in a pre-stored logic detection table, and judging whether the read pin logic is consistent with the standard logic;
a result output module: and outputting the comparison result, wherein if the comparison result is consistent with the comparison result, the GPIO configuration is normal, otherwise, the GPIO configuration is abnormal.
8. The GPIO configuration detection device of claim 7, wherein the device operates during BIOS startup;
the pin logic reading module, the pin logic comparison module and the result output module operate in DXE stage of BIOS starting process.
9. The GPIO configuration detection device of claim 8, wherein the device further comprises,
a detection variable setting module: setting the state of a detection variable; wherein the detection variable comprises two states of opening and closing;
a detection variable state judgment module: judging the state of the detection variable; if the state of the detection variable is on, the BIOS is continuously started after the pin logic reading module, the pin logic comparison module and the result output module are operated; and if the state of the detection variable is closed, skipping over the pin logic reading module, the pin logic comparison module and the result output module and continuing to start the BIOS.
10. A server, characterized in that the method of any of claims 1-6 is performed at start-up.
CN202110322679.6A 2021-03-26 2021-03-26 GPIO (general purpose input/output) configuration detection method and device and server Active CN113076140B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110322679.6A CN113076140B (en) 2021-03-26 2021-03-26 GPIO (general purpose input/output) configuration detection method and device and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110322679.6A CN113076140B (en) 2021-03-26 2021-03-26 GPIO (general purpose input/output) configuration detection method and device and server

Publications (2)

Publication Number Publication Date
CN113076140A true CN113076140A (en) 2021-07-06
CN113076140B CN113076140B (en) 2023-02-28

Family

ID=76610346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110322679.6A Active CN113076140B (en) 2021-03-26 2021-03-26 GPIO (general purpose input/output) configuration detection method and device and server

Country Status (1)

Country Link
CN (1) CN113076140B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115883288A (en) * 2022-11-29 2023-03-31 四川天邑康和通信股份有限公司 Fusion gateway-based double-CPU interaction efficiency improving method, system and storage medium
CN115883288B (en) * 2022-11-29 2024-04-19 四川天邑康和通信股份有限公司 Dual-CPU interaction efficiency improving method, system and storage medium based on fusion gateway

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040025097A1 (en) * 2002-07-31 2004-02-05 Broadcom Corporation Error detection in user input device using general purpose input-output
CN101778007A (en) * 2009-01-12 2010-07-14 哈尔滨威帝电子股份有限公司 System and method for automatically testing I/O pin of CAN bus control module
CN102024504A (en) * 2010-10-21 2011-04-20 中广核工程有限公司 Logic test method and device suitable for reactor protection system
CN103869801A (en) * 2012-12-13 2014-06-18 中广核工程有限公司 Test method of nuclear power plant instrumentation control logic function block and system
CN104678982A (en) * 2013-11-28 2015-06-03 英业达科技有限公司 Test device using independent control module to test, and method of test device
CN105224459A (en) * 2015-10-21 2016-01-06 浪潮电子信息产业股份有限公司 Under a kind of LINUX platform, test b MC is by the method for OEM order read-write BIOS configuration feature
CN106547655A (en) * 2015-09-22 2017-03-29 龙芯中科技术有限公司 The method and system of the memory bar quantity on circuit for detecting plate
CN109032878A (en) * 2018-09-13 2018-12-18 郑州云海信息技术有限公司 A kind of GPIO test method and device
CN110472421A (en) * 2019-07-22 2019-11-19 深圳中电长城信息安全系统有限公司 Mainboard, firmware safety detection method and terminal device
CN111639736A (en) * 2020-06-01 2020-09-08 上海爱信诺航芯电子科技有限公司 Anti-counterfeiting method of RFID chip
CN111949294A (en) * 2020-08-06 2020-11-17 曙光信息产业(北京)有限公司 Firmware refreshing method, device, server and computer readable storage medium
CN112286750A (en) * 2020-10-29 2021-01-29 山东云海国创云计算装备产业创新中心有限公司 GPIO (general purpose input/output) verification method and device, electronic equipment and medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040025097A1 (en) * 2002-07-31 2004-02-05 Broadcom Corporation Error detection in user input device using general purpose input-output
CN101778007A (en) * 2009-01-12 2010-07-14 哈尔滨威帝电子股份有限公司 System and method for automatically testing I/O pin of CAN bus control module
CN102024504A (en) * 2010-10-21 2011-04-20 中广核工程有限公司 Logic test method and device suitable for reactor protection system
CN103869801A (en) * 2012-12-13 2014-06-18 中广核工程有限公司 Test method of nuclear power plant instrumentation control logic function block and system
CN104678982A (en) * 2013-11-28 2015-06-03 英业达科技有限公司 Test device using independent control module to test, and method of test device
CN106547655A (en) * 2015-09-22 2017-03-29 龙芯中科技术有限公司 The method and system of the memory bar quantity on circuit for detecting plate
CN105224459A (en) * 2015-10-21 2016-01-06 浪潮电子信息产业股份有限公司 Under a kind of LINUX platform, test b MC is by the method for OEM order read-write BIOS configuration feature
CN109032878A (en) * 2018-09-13 2018-12-18 郑州云海信息技术有限公司 A kind of GPIO test method and device
CN110472421A (en) * 2019-07-22 2019-11-19 深圳中电长城信息安全系统有限公司 Mainboard, firmware safety detection method and terminal device
CN111639736A (en) * 2020-06-01 2020-09-08 上海爱信诺航芯电子科技有限公司 Anti-counterfeiting method of RFID chip
CN111949294A (en) * 2020-08-06 2020-11-17 曙光信息产业(北京)有限公司 Firmware refreshing method, device, server and computer readable storage medium
CN112286750A (en) * 2020-10-29 2021-01-29 山东云海国创云计算装备产业创新中心有限公司 GPIO (general purpose input/output) verification method and device, electronic equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115883288A (en) * 2022-11-29 2023-03-31 四川天邑康和通信股份有限公司 Fusion gateway-based double-CPU interaction efficiency improving method, system and storage medium
CN115883288B (en) * 2022-11-29 2024-04-19 四川天邑康和通信股份有限公司 Dual-CPU interaction efficiency improving method, system and storage medium based on fusion gateway

Also Published As

Publication number Publication date
CN113076140B (en) 2023-02-28

Similar Documents

Publication Publication Date Title
US6393586B1 (en) Method and apparatus for diagnosing and conveying an identification code in post on a non-booting personal computer
US7293204B2 (en) Computer peripheral connecting interface system configuration debugging method and system
US5896535A (en) Method and system for testing computer system software
US20110126043A1 (en) Operating System-Firmware Interface Update Recovery
CN110704304A (en) Application program testing method and device, storage medium and server
US20100049961A1 (en) Update method for basic input/output system and update system thereof
EP0111952A2 (en) Verification of a processor architecture having a partial instruction set
CN111427601A (en) Method and device for automatically upgrading BIOS in batches, computer equipment and storage medium
US8122293B2 (en) Method for automatically simulating manual testing of a computer, and testing system for performing the method
CN109117299B (en) Error detecting device and method for server
CN113076140B (en) GPIO (general purpose input/output) configuration detection method and device and server
CN111722965A (en) Computer system and debugging method thereof
CN113377586A (en) Automatic server detection method and device and storage medium
CN105159810B (en) The method and device that the BIOS of computer system is tested
US6427233B1 (en) Method for addressing the dynamic windows
CN113315675B (en) White box switch U-Boot automatic testing method, system and storage medium
US7415560B2 (en) Method of automatically monitoring computer system debugging routine
US20070168978A1 (en) Computer program code debugging method and system
CN110321171B (en) Startup detection device, system and method
CN112765021A (en) Debugging and checking method, device, equipment and storage medium of boot program
JP2765549B2 (en) Operation evaluation system in computer system
US9116875B2 (en) Test circuit and method for processing a test routine
CN107229457B (en) Electronic controller, guide loading method and device thereof and automobile
EP1868099B1 (en) Bug management tool
US20090106545A1 (en) Booting method for computer system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant