Memory bank initialization method and device, equipment and storage medium
By obtaining and parsing the information of the I2C bus and the memory stick, determining the available devices and associating the API function pointers, the problem of low initialization efficiency of the memory stick in the existing technology is solved, and the availability of the I2C bus is quickly confirmed and the read and write access speed is improved.
Patent Information
- Application Number
- CN202410639348.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-24
- Publication Date
- 2024-08-27
AI Technical Summary
In the existing technology, there is a lack of connection between the initialization of the multi-programming interface/multi-chip I2C bus and the memory stick, resulting in the inability to quickly confirm the availability of the I2C bus after the memory stick is powered on, and the lack of read and write API binding between the memory stick and the I2C bus. , resulting in low initialization efficiency.
By obtaining the information of each I2C bus and memory bar in the server, storing it in a pre-built data structure, and parsing the information based on the parser, determining the available memory bar and its corresponding available I2C bus, and obtaining the available I2C bus API function pointer, perform association processing, and initialize the available memory bank in the controller initialization main function.
It improves the initialization efficiency of the memory stick, avoids the need to try different I2C buses one by one to establish communication connections during the initialization process, reduces the addressing time, and improves the read and write access speed.
Smart Images

Figure CN118550844A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer hardware and system management, and in particular to a memory bar initialization method, device, equipment and storage medium. Background Art
[0002] In the prior art, in the case of an I2C bus and a memory stick with multiple programming interfaces / multi-chips, since the initialization of the I2C bus and the memory stick is usually performed separately, there is a lack of connection between the two, resulting in the inability to quickly confirm the availability of the I2C bus after the memory stick is powered on, and there is currently no structure for binding the read and write application programming interface (application programming interface, API) between the memory stick and the I2C bus. Therefore, during the initialization process of the memory stick, different I2C buses need to be tried one by one to establish a communication connection, resulting in the need to start addressing from the beginning and find the base address of the corresponding bus during read and write access, which consumes a lot of time and leads to low initialization efficiency of the memory stick. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a method, device, equipment and storage medium for initializing a memory bar, so as to improve the initialization efficiency of the memory bar.
[0004] In order to solve the above technical problem, the present invention provides a method for initializing a memory stick, comprising:
[0005] Obtaining I2C bus information corresponding to each I2C bus in the server, and storing the I2C bus information in a pre-constructed I2C data structure, wherein the I2C bus information includes an I2C initialization status flag, a first programming interface number, a first chip number, and a first controller number;
[0006] Obtain memory bar information corresponding to each memory bar in the server, and store the memory bar information in a pre-constructed memory bar data structure, wherein the memory bar information includes a memory bar power-on status flag, a second programming interface number, a second chip number, and a second controller number;
[0007] Parsing the first I2C bus information in the I2C data structure and the first memory bar information in the memory bar data structure based on a preset parser, comparing each first memory bar information with all the first I2C bus information in turn, and determining an available memory bar and an available I2C bus corresponding to the available memory bar;
[0008] Obtaining an API function pointer corresponding to the available I2C bus, and associating the available memory stick with the API function pointer;
[0009] When the controller initializes the main function and traverses to the available memory bar, the available memory bar is initialized based on the API function pointer.
[0010] In a possible implementation, obtaining I2C bus information corresponding to each I2C bus in the server specifically includes:
[0011] Determine all I2C buses in the server according to all programming interface numbers and all chip numbers in the server;
[0012] Initializing all the I2C buses respectively, and setting a corresponding I2C initialization status flag for each I2C bus based on the initialization result;
[0013] And obtain the first programming interface number, the first chip number and the first controller number corresponding to each I2C bus, and use the I2C initialization status flag, the first programming interface number, the first chip number and the first controller number as the I2C bus information corresponding to each I2C bus.
[0014] Furthermore, according to the programming interface number and chip number in the server, all I2C buses in the server can be obtained efficiently and accurately, and all I2C buses can be initialized. Based on the initialization result, the initialization status flag of each I2C bus is set, and the initialization status of each bus can be recorded so that the successfully initialized I2C bus can be quickly obtained from all I2C buses based on the initialization status flag.
[0015] In a possible implementation, after storing the I2C bus information in a pre-built I2C data structure, the method further includes:
[0016] According to the initialization result, obtaining all target I2C buses whose initialization result is successful initialization;
[0017] Obtain a target API function pointer corresponding to each target I2C bus, and store the target API function pointer in a preset heap space.
[0018] Furthermore, by screening out the target I2C devices that have been successfully initialized based on the initialization results, we can exclude devices that have failed to initialize or have other problems, and only focus on available devices, which helps to reduce the burden of subsequent processing and improve the stability and reliability of the system; at the same time, by obtaining the target API function pointer corresponding to each target I2C device and storing it in a preset heap space, the API function can be easily managed and called.
[0019] In a possible implementation, after setting a corresponding I2C initialization status flag for each I2C bus based on the initialization result, the method further includes:
[0020] Acquire all first I2C buses whose I2C initialization state flag is 1, and detect the clock signal corresponding to each first I2C bus in real time;
[0021] When it is detected that the clock signal is a low level signal and the duration of the low level signal is greater than a preset time threshold, it is determined that a driving failure occurs on the current first I2C bus, and the I2C initialization state flag corresponding to the current first I2C bus is adjusted to 0.
[0022] Furthermore, by detecting the clock signal corresponding to each first I2C bus in real time, the working status of the bus can be monitored. Under normal circumstances, the clock signal will periodically switch between a high level and a low level; therefore, by detecting the clock signal in real time, abnormal situations can be quickly discovered; and once it is determined that a drive failure has occurred on the first I2C bus, the corresponding I2C initialization status flag is adjusted to 0, so that the fault status of the current bus can be clearly marked, so that communication interactions with the faulty bus can be avoided during subsequent operations.
[0023] In a possible implementation, obtaining memory bar information corresponding to each memory bar in the server specifically includes:
[0024] Determine all memory sticks in the server based on all I2C buses in the server;
[0025] Powering on all the memory bars respectively, and setting a corresponding memory bar power-on status flag for each memory bar based on the power-on result;
[0026] Obtain a first I2C bus corresponding to each memory stick, and determine a second programming interface number, a second chip number, and a second controller number corresponding to each memory stick based on the first I2C bus;
[0027] The memory bar power-on status flag, the second programming interface number, the second chip number and the second controller number are used as the memory bar information corresponding to each memory bar.
[0028] Furthermore, according to all I2C buses in the server, all memory bars in the server can be obtained efficiently and accurately, and all memory bars can be powered on. Based on the power-on results, the memory bar power-on status flag of each memory bar is set, and the power-on status of each memory bar can be recorded, so that the memory bar that has been successfully powered on can be quickly obtained from all memory bars based on the memory bar power-on status flag.
[0029] In a possible implementation, power-on processing is performed on all the memory bars respectively, and based on the power-on result, a corresponding memory bar power-on status flag is set for each memory bar respectively, which specifically includes:
[0030] Set the control and monitoring port bits for each memory bank separately;
[0031] After determining that the preset voltage is input to all the memory bars respectively, obtaining the level jump state of the control and monitoring port bit corresponding to each memory bar, and when the control and monitoring port bit has a level jump, determining that the power-on result of the memory bar is a power-on success, otherwise, determining that the power-on result of the memory bar is a power-on failure;
[0032] When the power-on result is a power-on success, the memory bar power-on status flag corresponding to the memory bar is set to 1; when the power-on result is a power-on failure, the memory bar power-on status flag corresponding to the memory bar is set to 0.
[0033] Furthermore, by setting control and monitoring port bits for each memory stick, control and monitoring of each memory stick can be achieved, and by detecting the level jump status of the control and monitoring port bits, the power-on result of each memory stick can be determined; in this way, memory sticks that have failed to power on can be discovered in time, and a corresponding power-on status flag can be set for each memory stick, so that the power-on result of each memory stick can be accurately recorded, so that the status of each memory stick can be conveniently determined in subsequent operations, and memory sticks that have failed to power on can be quickly identified.
[0034] In a possible implementation, parsing the first I2C bus information in the I2C data structure and the first memory bar information in the memory bar data structure based on a preset parser, comparing each first memory bar information with all the first I2C bus information in sequence, and determining an available memory bar and an available I2C bus corresponding to the available memory bar, specifically includes:
[0035] Setting an I2C initialization state flag to 1 as a first extraction condition, and extracting all first I2C bus information satisfying the first extraction condition from the I2C data structure;
[0036] Setting the memory bar power-on status flag to 1 as a second extraction condition, and extracting all first memory bar information satisfying the second extraction condition from the memory bar data structure;
[0037] Obtain the second programming interface number, the second chip number and the second controller number corresponding to each first memory bar information, and simultaneously obtain the first programming interface number, the first chip number and the first controller number corresponding to each first I2C bus information;
[0038] Compare each first memory bar information with all the first I2C bus information in turn. If the first programming interface number is the same as the second programming interface number, the first chip number is the same as the second chip number, and the first controller number is the same as the second controller number, the memory bar corresponding to the current first memory bar information is used as an available memory bar, and the I2C bus corresponding to the current first I2C bus information is used as an available I2C bus corresponding to the available memory bar.
[0039] Furthermore, since the set initialization status flag and power-on status flag can accurately record the status of the I2C bus and the memory stick, the first I2C bus information and the first memory stick information that meet the specific conditions can be quickly extracted in subsequent operations based on the initialization status flag and the power-on status flag, so that the processing focus can be concentrated on the information that meets the requirements, reducing unnecessary operations and calculations, and improving processing efficiency. By obtaining the programming interface, chip and controller number in the first memory stick information and the first I2C bus information, the properties and position of each memory stick and I2C bus can be accurately identified, so that the available memory sticks and their corresponding available I2C buses can be quickly determined.
[0040] The present invention also provides a memory bar initialization device, comprising: an I2C bus information acquisition module, a memory bar information acquisition module, an information parsing module, a function pointer association module and a memory bar initialization processing module;
[0041] The I2C bus information acquisition module is used to acquire the I2C bus information corresponding to each I2C bus in the server, and store the I2C bus information in a pre-constructed I2C data structure, wherein the I2C bus information includes an I2C initialization status flag, a first programming interface number, a first chip number, and a first controller number;
[0042] The memory bar information acquisition module is used to acquire the memory bar information corresponding to each memory bar in the server, and store the memory bar information in a pre-constructed memory bar data structure, wherein the memory bar information includes a memory bar power-on status flag, a second programming interface number, a second chip number, and a second controller number;
[0043] The information parsing module is used to parse the first I2C bus information in the I2C data structure and the first memory bar information in the memory bar data structure based on a preset parser, compare each first memory bar information with all the first I2C bus information in turn, and determine an available memory bar and an available I2C bus corresponding to the available memory bar;
[0044] The function pointer association module is used to obtain the API function pointer corresponding to the available I2C bus, and associate the available memory bar with the API function pointer;
[0045] The memory bar initialization processing module is used to initialize the available memory bar based on the API function pointer when the controller initializes the main function and traverses to the available memory bar.
[0046] In a possible implementation, the I2C bus information acquisition module is used to acquire the I2C bus information corresponding to each I2C bus in the server, specifically including:
[0047] Determine all I2C buses in the server according to all programming interface numbers and all chip numbers in the server;
[0048] Initializing all the I2C buses respectively, and setting a corresponding I2C initialization status flag for each I2C bus based on the initialization result;
[0049] And obtain the first programming interface number, the first chip number and the first controller number corresponding to each I2C bus, and use the I2C initialization status flag, the first programming interface number, the first chip number and the first controller number as the I2C bus information corresponding to each I2C bus.
[0050] The present invention provides a memory stick initialization device, further comprising: an API function pointer acquisition module;
[0051] Among them, the api function pointer acquisition module is used to obtain all target I2C buses whose initialization results are successful initialization according to the initialization result, obtain the target api function pointer corresponding to each target I2C bus, and store the target api function pointer in a preset heap space.
[0052] In a possible implementation, the I2C bus information acquisition module is used to set a corresponding I2C initialization status flag for each I2C bus based on the initialization result, and further includes:
[0053] Acquire all first I2C buses whose I2C initialization state flag is 1, and detect the clock signal corresponding to each first I2C bus in real time;
[0054] When it is detected that the clock signal is a low level signal and the duration of the low level signal is greater than a preset time threshold, it is determined that a driving failure occurs on the current first I2C bus, and the I2C initialization state flag corresponding to the current first I2C bus is adjusted to 0.
[0055] In a possible implementation, the memory bar information acquisition module is used to acquire the memory bar information corresponding to each memory bar in the server, specifically including:
[0056] Determine all memory sticks in the server based on all I2C buses in the server;
[0057] Powering on all the memory bars respectively, and setting a corresponding memory bar power-on status flag for each memory bar based on the power-on result;
[0058] Obtain a first I2C bus corresponding to each memory stick, and determine a second programming interface number, a second chip number, and a second controller number corresponding to each memory stick based on the first I2C bus;
[0059] The memory bar power-on status flag, the second programming interface number, the second chip number and the second controller number are used as the memory bar information corresponding to each memory bar.
[0060] In a possible implementation, the memory bar information acquisition module is used to perform power-on processing on all the memory bars respectively, and set a corresponding memory bar power-on status flag for each memory bar based on the power-on result, specifically including:
[0061] Set the control and monitoring port bits for each memory bank separately;
[0062] After determining that the preset voltage is input to all the memory bars respectively, obtaining the level jump state of the control and monitoring port bit corresponding to each memory bar, and when the control and monitoring port bit has a level jump, determining that the power-on result of the memory bar is a power-on success, otherwise, determining that the power-on result of the memory bar is a power-on failure;
[0063] When the power-on result is a power-on success, the memory bar power-on status flag corresponding to the memory bar is set to 1; when the power-on result is a power-on failure, the memory bar power-on status flag corresponding to the memory bar is set to 0.
[0064] In a possible implementation, the information parsing module is used to parse the first I2C bus information in the I2C data structure and the first memory bar information in the memory bar data structure based on a preset parser, and compare each of the first memory bar information with all the first I2C bus information in sequence to determine the available memory bars and the available I2C buses corresponding to the available memory bars, specifically including:
[0065] Setting an I2C initialization state flag to 1 as a first extraction condition, and extracting all first I2C bus information satisfying the first extraction condition from the I2C data structure;
[0066] Setting the memory bar power-on status flag to 1 as a second extraction condition, and extracting all first memory bar information satisfying the second extraction condition from the memory bar data structure;
[0067] Obtain the second programming interface number, the second chip number and the second controller number corresponding to each first memory bar information, and simultaneously obtain the first programming interface number, the first chip number and the first controller number corresponding to each first I2C bus information;
[0068] Compare each first memory bar information with all the first I2C bus information in turn. If the first programming interface number is the same as the second programming interface number, the first chip number is the same as the second chip number, and the first controller number is the same as the second controller number, the memory bar corresponding to the current first memory bar information is used as an available memory bar, and the I2C bus corresponding to the current first I2C bus information is used as an available I2C bus corresponding to the available memory bar.
[0069] The present invention also provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the memory bar initialization method as described in any one of the above when executing the computer program.
[0070] The present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the memory bar initialization method as described in any one of the above.
[0071] Compared with the prior art, the memory stick initialization method, device, equipment and storage medium of the embodiment of the present invention have the following beneficial effects:
[0072] By acquiring I2C bus information corresponding to each I2C bus in the server, the I2C bus information is stored in a pre-constructed I2C data structure; acquiring memory bar information corresponding to each memory bar in the server, the memory bar information is stored in a pre-constructed memory bar data structure; parsing the first I2C bus information in the I2C data structure and the first memory bar information in the memory bar data structure based on a preset parser, comparing each first memory bar information with all the first I2C bus information in turn, determining the available memory bar and the available I2C bus corresponding to the available memory bar; acquiring the api function pointer corresponding to the available I2C bus, and associating the available memory bar with the api function pointer; when the controller initializes the main function and traverses to the available memory bar, initializing the available memory bar based on the api function pointer. Compared with the prior art, the technical solution of the present invention obtains and stores information about the I2C bus and the memory stick in advance, and parses and determines the available memory stick and I2C bus during the controller initialization process, thereby avoiding the need to try different I2C buses one by one to establish a communication connection during the memory stick initialization process, thereby improving the efficiency of memory stick initialization; at the same time, since the available memory stick and I2C bus have been determined, by obtaining the API function pointer corresponding to the available I2C bus, and associating the available memory stick with the API function pointer, it is also avoided that the need to start addressing from the beginning and find the base address of the corresponding bus during read and write access is avoided, thereby improving the read and write access speed, thereby improving the efficiency of memory stick initialization. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 It is a flow chart of an embodiment of a method for initializing a memory bar provided by the present invention;
[0074] Figure 2 It is a structural schematic diagram of an embodiment of a memory stick initialization device provided by the present invention;
[0075] Figure 3 It is a structural diagram of a multi-programming interface / multi-chip server provided by an embodiment of the present invention;
[0076] Figure 4 It is another flowchart diagram of an embodiment of a method for initializing a memory bar provided by the present invention;
[0077] Figure 5 This is another structural schematic diagram of an embodiment of a memory stick initialization device provided by the present invention. DETAILED DESCRIPTION
[0078] The following will be combined with the accompanying drawings in the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0079] Example 1, see Figure 1 , Figure 1 FIG. 1 is a flow chart of an embodiment of a method for initializing a memory bar provided by the present invention. Figure 1 As shown, the method includes steps 101 to 105, which are specifically as follows:
[0080] Step 101: Obtain I2C bus information corresponding to each I2C bus in the server, and store the I2C bus information in a pre-constructed I2C data structure, wherein the I2C bus information includes an I2C initialization status flag, a first programming interface number, a first chip number, and a first controller number.
[0081] In one embodiment, the server is composed of multiple programming interface sockets and multiple chip dies.
[0082] Preferably, the server is composed of two programming interface sockets, wherein each programming interface socket is composed of two chip dies; each chip die is driven by two universal bus protocol (Inter-Integrated Ci rcuit, I2C) buses, wherein each I2C bus can be externally connected to 8 memory sticks, and the memory sticks are dual inline memory modules (Dual Inline Memory Modules, DIMM); Figure 3 As shown, Figure 3 The figure is a schematic diagram of the structure of a multi-programming interface / multi-chip server, in which each programming interface socket, each chip die, each I2C bus and each memory module DIMM has a corresponding number.
[0083] In one embodiment, all I2C buses in the server are determined based on all programming interface numbers and all chip numbers in the server.
[0084] Specifically, all programming interfaces in the server are obtained, and based on all the programming interfaces, the programming interface number corresponding to each programming interface is determined to obtain all programming interface numbers in the server; based on the first structural relationship between the programming interface and the chip in the server, all chips corresponding to each programming interface are determined, all the chips are integrated, the chip number corresponding to each chip is determined, and all chip numbers in the server are obtained.
[0085] Specifically, after obtaining all the programming interface numbers and all the chip numbers, each programming interface number is combined with all its corresponding chip numbers to obtain the first number combination quantity corresponding to each programming interface, and all the first number combination quantities are integrated to obtain the integrated quantity of first number combinations in the server; at the same time, the second constituent relationship between the chip in the server and the I2C bus is obtained, and based on the second constituent relationship and the first number combination integration quantity, all the I2C buses in the server are determined.
[0086] Taking the example that the server is composed of two programming interface sockets, each programming interface socket is composed of two chip dies, and each chip die is driven by two I2C buses respectively, the determination of all I2C buses in the server is specifically described as follows:
[0087] All programming interfaces in the server are obtained to obtain programming interface socket0 and programming interface socket1. Based on the first structural relationship between the programming interface and the chip in the server, each programming interface socket is composed of two chips dies, and the chips dies 0 and dies 1 corresponding to the programming interface socket0 and the programming interface socket1 are determined respectively; each programming interface number is combined with all the chip numbers corresponding to it to obtain socket0-dies 0, socket0-dies 1, socket1-dies 0 and socket1-dies 1, that is, the number of first number combinations in the server is 4. At the same time, since the second structural relationship between the chip and the I2C bus in the server is that each chip dies is driven by two I2C buses, namely I2C0 and I2C1, the first number combination and the I2C bus number are continued to be combined to determine that all I2C buses in the server are: socket0-dies 0-I2C0, socket0-dies 0-I2C1, socket0-dies 1-I2C0, socket0-dies 0-I2C1 ie1-I2C1, socket1-d ie0-I2C0, socket1-d ie0-I2C1, socket1-d ie1-I2C0 and socket1-d ie1-I2C1.
[0088] In one embodiment, initialization processing is performed on all the I2C buses respectively, and based on the initialization result, a corresponding I2C initialization state flag is set for each I2C bus respectively.
[0089] Specifically, the initialization result corresponding to each I2C bus is obtained. When the initialization result is initialization failure, the I2C initialization status flag corresponding to the I2C bus is set to I2Cx_ok=0, where x is 0 / 1 / 2, etc., indicating the I2C bus number corresponding to the I2C bus; when the initialization result is initialization success, the I2C initialization status flag corresponding to the I2C bus is set to I2Cx_ok=1.
[0090] In one embodiment, the first programming interface number, the first chip number and the first controller number corresponding to each I2C bus are obtained, and the I2C initialization status flag, the first programming interface number, the first chip number and the first controller number are used as the I2C bus information corresponding to each I2C bus.
[0091] Specifically, the first controller number is the number of a double data rate synchronous dynamic random access memory (Double Data Rate, DDR). In the computer system, the DDR controller is responsible for managing and controlling the access and data transmission of the DDR memory. Since modern computer systems often include multiple DDR controllers, in order to distinguish different controllers, the DDR controller is identified by the controller number.
[0092] Specifically, by using the I2C initialization status flag, the first programming interface number, the first chip number and the first controller number as the I2C bus information corresponding to each I2C bus, it is possible to clearly understand the location information of the current I2C bus, which is which I2C bus in which chip die in which programming interface socket under which DDR controller, and based on the I2C initialization status flag, it is possible to quickly understand whether the current I2C bus is successfully initialized, that is, whether the current I2C bus is valid.
[0093] In one embodiment, an I2C data structure driver-info is set up for storing information and is saved in an area of the heap space. During the initialization of the I2C bus, the I2C bus information corresponding to the current I2C bus is recorded and stored in the I2C data structure driver-info.
[0094] In one embodiment, during the operation of the system, an effective I2C bus may fail, causing the I2C bus to be unusable. At this time, if the corresponding I2C initialization status flag is not modified, an invalid I2C bus may be selected when the memory stick is initialized later. Therefore, in order to solve the problem that the effective I2C bus may fail during the operation of the system, in this embodiment, the I2C bus is initialized, and based on the initialization result, the corresponding I2C initialization status flag is set for each I2C bus, and then all first I2C buses with the I2C initialization status flag of 1 are obtained, and the clock signal corresponding to each first I2C bus is detected in real time; when the clock signal is detected to be a low-level signal, and the duration of the low-level signal is greater than a preset time threshold, it is determined that a driver failure occurs on the current first I2C bus, and the I2C initialization status flag corresponding to the current first I2C bus is adjusted to 0, and the I2C initialization status flag corresponding to the current first I2C bus stored in the I2C data structure driv-info is updated, so that during the operation of the entire server, the I2C data structure driv-info is updated. The data stored in iver-info can be updated dynamically to ensure data reliability.
[0095] In one embodiment, after the I2C bus information is stored in a pre-constructed I2C data structure, all target I2C buses whose initialization results are successful are obtained based on the initialization result; the target api function pointer corresponding to each target I2C bus is obtained, and the target api function pointer is stored in a preset heap space.
[0096] Specifically, a function pointer of an API function that can access each target I2C bus is obtained and stored in the heap space so as to be used by the DDR controller initialization main function later.
[0097] Step 102: Obtain memory bar information corresponding to each memory bar in the server, and store the memory bar information in a pre-constructed memory bar data structure, wherein the memory bar information includes a memory bar power-on status flag, a second programming interface number, a second chip number, and a second controller number.
[0098] In one embodiment, all memory banks in the server are determined based on all I2C buses in the server.
[0099] Specifically, a third configuration relationship between the I2C bus and the memory stick in the server is obtained, and based on the third configuration relationship, all the memory sticks in the server are determined.
[0100] Preferably, when the third configuration relationship is that each I2C bus is externally connected to 8 memory sticks DIMM, the number of all memory sticks in the server can be determined based on the number of the I2C buses.
[0101] In one embodiment, all the memory bars are powered on respectively, and based on the power-on result, a corresponding memory bar power-on status flag is set for each memory bar respectively.
[0102] Specifically, a control and monitoring port (CAMP) bit is set for each memory stick respectively; after determining that a preset voltage is input to all the memory sticks respectively, the level jump state of the control and monitoring port bit corresponding to each memory stick is obtained, and when there is a level jump in the control and monitoring port bit, it is determined that the power-on result of the memory stick is a power-on success; otherwise, it is determined that the power-on result of the memory stick is a power-on failure.
[0103] Specifically, when the power-on result is a successful power-on, the memory stick power-on status flag DIMMx_ok corresponding to the memory stick is set to 1; when the power-on result is a power-on failure, the memory stick power-on status flag DIMMx_ok corresponding to the memory stick is set to 0, where x is 0 / 1 / 2, etc., indicating the memory stick number corresponding to the memory stick.
[0104] An example is given for the process of powering on all the memory sticks in the present embodiment: a special control and monitoring port CAMP bit is set in the DIMM to determine whether the memory stick DIMM is valid, and a DIMM 3.3V mgmt voltage is input to all the memory sticks. When the memory stick DIMM is powered on, it is determined whether the control and monitoring port bit of the current memory stick DIMM has a level jump state. If so, it means that the current memory stick DIMM is powered on successfully, that is, the memory stick DIMM is valid. Otherwise, the current memory stick DIMM fails to power on, that is, the current memory stick DIMM is invalid.
[0105] In one embodiment, a first I2C bus corresponding to each memory stick is obtained, and based on the first I2C bus, a second programming interface number, a second chip number, and a second controller number corresponding to each memory stick are determined.
[0106] Specifically, since the memory stick is externally connected to the I2C bus, each memory stick has a corresponding first I2C bus, and the first programming interface number, first chip number and first controller number corresponding to the first I2C bus are used as the second programming interface number, second chip number and second controller number corresponding to each memory stick; that is, for the memory stick and the I2C bus that are externally connected, the programming interface number, chip number and controller number of the two are the same.
[0107] In one embodiment, the memory bar power-on status flag, the second programming interface number, the second chip number and the second controller number are used as the memory bar information corresponding to each memory bar.
[0108] Specifically, by using the memory stick power-on status flag, the second programming interface number, the second chip number and the second controller number as the memory stick information corresponding to each memory stick, the location information of the current memory stick can be clearly understood, which is which memory stick DIMM connected to which chip d ie in which I2C bus in which programming interface socket under which DDR controller, and based on the memory stick power-on status flag, it is possible to quickly understand whether the current memory stick DIMM is initialized successfully, that is, whether the memory stick DIMM is valid.
[0109] In one embodiment, a memory bar data structure DIMM_info for storing information is set and saved in an area of the heap space. During the power-on process of the memory bar DIMM, the memory bar information corresponding to the memory bar DIMM is recorded and stored in the memory bar data structure DIMM_info.
[0110] Step 103: Parse the first I2C bus information in the I2C data structure and the first memory bar information in the memory bar data structure based on a preset parser, compare each first memory bar information with all the first I2C bus information in turn, and determine the available memory bars and the available I2C buses corresponding to the available memory bars.
[0111] In one embodiment, setting the I2C initialization state flag to 1 is used as a first extraction condition, and all first I2C bus information satisfying the first extraction condition is extracted from the I2C data structure.
[0112] Specifically, since the I2C data structure stores invalid I2C bus information and valid I2C bus information, based on the I2C initialization status flag, the I2C initialization status flag is set to 1 as the first extraction condition, and all I2C bus information whose I2C initialization status flag is 1 is extracted from the I2C data structure, that is, all valid I2C bus information is extracted from the I2C data structure to obtain all first I2C bus information.
[0113] In one embodiment, setting the memory bar power-on status flag to 1 is used as the second extraction condition, and all first memory bar information satisfying the second extraction condition is extracted from the memory bar data structure.
[0114] Specifically, since the memory bar data structure stores invalid memory bar information and valid memory bar information, based on the memory bar power-on status flag, the memory bar power-on status flag is set to 1 as the second extraction condition, and all memory bar information whose memory bar power-on status flag is 1 is extracted from the memory bar data structure, that is, all valid memory bar information is extracted from the memory bar data structure to obtain all the first memory bar information.
[0115] In one embodiment, the second programming interface number, the second chip number and the second controller number corresponding to each first memory bar information are obtained, and the first programming interface number, the first chip number and the first controller number corresponding to each first I2C bus information are obtained.
[0116] In one embodiment, each first memory bar information is compared with all the first I2C bus information in turn. If the first programming interface number is the same as the second programming interface number, the first chip number is the same as the second chip number, and the first controller number is the same as the second controller number, the memory bar corresponding to the current first memory bar information is used as an available memory bar, and the I2C bus corresponding to the current first I2C bus information is used as an available I2C bus corresponding to the available memory bar.
[0117] Specifically, since only when the memory stick and the I2C bus corresponding to the memory stick are valid, can it be determined that the memory stick can be used and can be communicated with; and since the programming interface number, chip number and controller number corresponding to the memory stick and the I2C bus corresponding to the memory stick are the same; therefore, after extracting all valid first I2C bus information and all valid first memory stick information, by comparing the programming interface number, chip number and controller number, it can be determined which DIMMs can be used and can be communicated with.
[0118] Step 104: Obtain an API function pointer corresponding to the available I2C bus, and associate the available memory stick with the API function pointer.
[0119] In one embodiment, since in step 101, the function pointer of the api function that can access each target I2C bus has been obtained and stored in the heap space, after determining the available I2C bus, the target I2C bus information corresponding to the target I2C bus stored in the heap space is traversed based on the available I2C bus information corresponding to the available I2C bus, and after traversing to the target I2C bus information that is the same as the available I2C bus information, the function pointer of the api function corresponding to the target I2C bus information is used as the api function pointer corresponding to the available I2C bus.
[0120] Step 105: When the controller initializes the main function and traverses to the available memory bar, the available memory bar is initialized based on the API function pointer.
[0121] In one embodiment, during the process of initializing the main function of the controller, all programming interface numbers and all chip numbers in the server are obtained, and all memory sticks in the server are enumerated in sequence based on the largest programming interface number and the largest chip number. When all memory sticks are enumerated, it is determined whether the memory stick is an available memory stick. If so, the API function pointer associated with the available memory stick is obtained, and the available memory stick is initialized based on the API function pointer.
[0122] An example of a memory module initialization method provided in this embodiment is as follows:
[0123] When the memory stick is initialized, all I2C buses I2C_bus in the server are enumerated according to all programming interface numbers socket_np and all chip numbers die_no in the server, and all I2C buses are initialized respectively. After the initialization is successful, the corresponding I2C initialization status flag of each I2C bus is set to 1. If the initialization fails, the corresponding I2C initialization status flag of each I2C bus is set to 0. The programming interface number socket_np and all chip numbers die_no are used as the location information of the I2C bus. The current location information of each I2C bus and the validity information are saved in driver_info through the I2C module. At the same time, the read and write API functions corresponding to the valid I2C bus are addressed, and the obtained target API function pointer is stored in the preset address space.
[0124] When the memory stick is initialized, the DIMM 3.3V mgmt voltage is also input to the memory stick. When the memory stick DIMM is powered on, the DIMM power management chip detects whether the voltage reaches the standard by judging whether there is a level jump state in the control and monitoring port bits of the current memory stick DIMM. If so, the memory stick power-on status flag DIMM is set to 1, otherwise, the memory stick power-on status flag DIMM is set to 0; and a DIMM_info structure is created to store the location information of the memory stick DIMM_ and the power-on status flag of the memory stick DIMM.
[0125] Based on the preset parser, the location information of the valid I2C bus obtained from the heap space and the location information of the valid memory stick DIMM obtained from the DIMM_info structure are parsed to analyze the physical location of the memory stick in the system that can be communicated by the host, that is, to determine the available memory stick and the available I2C bus corresponding to the available memory stick, and based on the heap space, the api function pointer of the read and write api function of the I2C bus corresponding to the available memory stick DIMM is stored, and when initializing the main function, the current system status is obtained from the constructed heap space, and the memory stick DIMM that can be accessed through I2C and powered on normally is initialized, that is, the available memory stick is initialized based on the api function pointer stored in the heap space. Figure 4 As shown, Figure 4 This is another flow chart of an embodiment of a method for initializing a memory stick provided by the present invention.
[0126] In summary, the present invention provides a method for initializing a memory bar, which can achieve rapid acquisition and storage of information of both by acquiring information of each I2C bus and memory bar in the server and storing it in a pre-constructed data structure; then, the I2C data structure and the memory bar data structure are parsed by a preset parser to determine the available memory bar and its corresponding available I2C bus; then, the API function pointer corresponding to the available I2C bus is acquired, and it is associated with the available memory bar for processing. In the controller initialization main function, when the available memory bar is traversed, the available memory bar is initialized based on the API function pointer. In this way, the information of the two can be quickly and organically combined to achieve faster initialization processing, and it can be confirmed whether the memory bar has been powered on successfully and has communication conditions when the I2C bus is available. In addition, by associating the API function pointer with the memory bar, more efficient read and write access can be achieved in the case of multiple programming interfaces and multiple chips, avoiding a lot of time spent on addressing, thereby improving the initialization efficiency of subsequent memory bars.
[0127] Example 2, see Figure 2 , Figure 2 FIG. 1 is a schematic diagram of a structure of an embodiment of a memory stick initialization device provided by the present invention. Figure 2 As shown, the device includes an I2C bus information acquisition module 201, a memory bar information acquisition module 202, an information parsing module 203, a function pointer association module 204 and a memory bar initialization processing module 205, which are specifically as follows:
[0128] The I2C bus information acquisition module 201 is used to obtain the I2C bus information corresponding to each I2C bus in the server, and store the I2C bus information in a pre-constructed I2C data structure, wherein the I2C bus information includes an I2C initialization status flag, a first programming interface number, a first chip number and a first controller number.
[0129] The memory bar information acquisition module 202 is used to obtain the memory bar information corresponding to each memory bar in the server, and store the memory bar information in a pre-constructed memory bar data structure, wherein the memory bar information includes a memory bar power-on status flag, a second programming interface number, a second chip number, and a second controller number.
[0130] The information parsing module 203 is used to parse the first I2C bus information in the I2C data structure and the first memory bar information in the memory bar data structure based on a preset parser, and compare each first memory bar information with all the first I2C bus information in turn to determine the available memory bars and the available I2C buses corresponding to the available memory bars.
[0131] The function pointer associating module 204 is used to obtain the API function pointer corresponding to the available I2C bus, and associate the available memory stick with the API function pointer.
[0132] The memory bar initialization processing module 205 is used to initialize the available memory bar based on the API function pointer when the controller initializes the main function and traverses to the available memory bar.
[0133] In one embodiment, the I2C bus information acquisition module 201 is used to obtain the I2C bus information corresponding to each I2C bus in the server, specifically including: determining all the I2C buses in the server according to all the programming interface numbers and all the chip numbers in the server; initializing all the I2C buses respectively, and setting the corresponding I2C initialization status flag for each I2C bus based on the initialization result; and obtaining the first programming interface number, the first chip number and the first controller number corresponding to each I2C bus, and using the I2C initialization status flag, the first programming interface number, the first chip number and the first controller number as the I2C bus information corresponding to each I2C bus.
[0134] In one embodiment, the memory stick initialization device provided in this embodiment further includes: an API function pointer acquisition module 206; Figure 5 As shown, Figure 5 This is another structural schematic diagram of a memory stick initialization device provided by the present invention.
[0135] In one embodiment, the api function pointer acquisition module 206 is used to acquire all target I2C buses whose initialization results are successful initialization according to the initialization result, acquire the target api function pointer corresponding to each target I2C bus, and store the target api function pointer in a preset heap space.
[0136] In one embodiment, the I2C bus information acquisition module 201 is used to set the corresponding I2C initialization status flag for each I2C bus based on the initialization result, and further includes: acquiring all first I2C buses whose I2C initialization status flag is 1, and detecting the clock signal corresponding to each first I2C bus in real time; when it is detected that the clock signal is a low-level signal, and the duration of the low-level signal is greater than a preset time threshold, determining that a drive fault occurs on the current first I2C bus, and adjusting the I2C initialization status flag corresponding to the current first I2C bus to 0.
[0137] In one embodiment, the memory bar information acquisition module 202 is used to obtain the memory bar information corresponding to each memory bar in the server, specifically including: determining all the memory bars in the server based on all the I2C buses in the server; performing power-on processing on all the memory bars respectively, and setting a corresponding memory bar power-on status flag for each memory bar based on the power-on result; obtaining the first I2C bus corresponding to each memory bar, and determining the second programming interface number, the second chip number and the second controller number corresponding to each memory bar based on the first I2C bus; using the memory bar power-on status flag, the second programming interface number, the second chip number and the second controller number as the memory bar information corresponding to each memory bar.
[0138] In one embodiment, the memory bar information acquisition module 202 is used to perform power-on processing on all the memory bars respectively, and based on the power-on result, set the corresponding memory bar power-on status flag for each memory bar respectively, specifically including: setting the control and monitoring port bits for each memory bar respectively; after determining that a preset voltage is input to all the memory bars respectively, obtaining the level jump status of the control and monitoring port bits corresponding to each memory bar, when the control and monitoring port bits have a level jump, determining that the power-on result of the memory bar is a power-on success, otherwise, determining that the power-on result of the memory bar is a power-on failure; when the power-on result is a power-on success, setting the memory bar power-on status flag corresponding to the memory bar to 1, and when the power-on result is a power-on failure, setting the memory bar power-on status flag corresponding to the memory bar to 0.
[0139] In one embodiment, the information parsing module 203 is used to parse the first I2C bus information in the I2C data structure and the first memory bar information in the memory bar data structure based on a preset parser, and compare each of the first memory bar information with all the first I2C bus information in turn to determine the available memory bars and the available I2C buses corresponding to the available memory bars, specifically including: setting the I2C initialization state flag to 1 as a first extraction condition, and extracting all the first I2C bus information that meets the first extraction condition from the I2C data structure; setting the memory bar power-on state flag to 1 as a second extraction condition, and extracting all the first memory bar information that meets the second extraction condition from the memory bar data structure; obtaining each The second programming interface number, the second chip number and the second controller number corresponding to each first memory bar information are obtained, and the first programming interface number, the first chip number and the first controller number corresponding to each first I2C bus information are obtained at the same time; each first memory bar information is compared with all the first I2C bus information in turn, and if the first programming interface number is the same as the second programming interface number, the first chip number is the same as the second chip number, and the first controller number is the same as the second controller number, the memory bar corresponding to the current first memory bar information is used as an available memory bar, and the I2C bus corresponding to the current first I2C bus information is used as an available I2C bus corresponding to the available memory bar.
[0140] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0141] It should be noted that the above-mentioned embodiment of the memory bar initialization device is only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0142] Based on the above-mentioned embodiment of the memory stick initialization method, another embodiment of the present invention provides a memory stick initialization terminal device, the memory stick initialization terminal device includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, when the processor executes the computer program, the memory stick initialization method of any embodiment of the present invention is implemented.
[0143] Exemplarily, in this embodiment, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the initialization terminal device of the memory stick.
[0144] The initialization terminal device of the memory bar can be a computing device such as a desktop computer, a notebook, a palm computer, a cloud server, etc. The initialization terminal device of the memory bar can include, but is not limited to, a processor and a memory.
[0145] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the initialization terminal device of the memory stick, and uses various interfaces and lines to connect various parts of the initialization terminal device of the entire memory stick.
[0146] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the initialization terminal device of the memory bar by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0147] Based on the above-mentioned embodiment of the memory stick initialization method, another embodiment of the present invention provides a storage medium, wherein the storage medium includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the memory stick initialization method of any embodiment of the present invention.
[0148] In this embodiment, the storage medium is a computer-readable storage medium, and the computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0149] In summary, the present invention provides a method, device, equipment and storage medium for initializing a memory bar, which comprises the following steps: storing the acquired I2C bus information of each I2C bus in a server in an I2C data structure; storing the acquired memory bar information of each memory bar in the server in a memory bar data structure; parsing the first I2C bus information in the I2C data structure and the first memory bar information in the memory bar data structure based on a parser, comparing each first memory bar information with all the first I2C bus information in turn, and determining the available memory bars and their corresponding available I2C buses; acquiring the api function pointer corresponding to the available I2C bus, and associating the available memory bars with the api function pointer; initializing the available memory bars traversed by the controller initialization main function based on the api function pointer; compared with the prior art, the technical solution of the present invention can improve the initialization efficiency of the memory bars.
[0150] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and substitutions can be made without departing from the technical principles of the present invention. These improvements and substitutions should also be regarded as the scope of protection of the present invention.
Claims
1. A method for initializing a memory bar, characterized in that: include: Obtaining I2C bus information corresponding to each I2C bus in the server, and storing the I2C bus information in a pre-constructed I2C data structure, wherein the I2C bus information includes an I2C initialization status flag, a first programming interface number, a first chip number, and a first controller number; Obtain memory bar information corresponding to each memory bar in the server, and store the memory bar information in a pre-constructed memory bar data structure, wherein the memory bar information includes a memory bar power-on status flag, a second programming interface number, a second chip number, and a second controller number; Parsing the first I2C bus information in the I2C data structure and the first memory bar information in the memory bar data structure based on a preset parser, comparing each first memory bar information with all the first I2C bus information in turn, and determining an available memory bar and an available I2C bus corresponding to the available memory bar; Obtaining an API function pointer corresponding to the available I2C bus, and associating the available memory stick with the API function pointer; When the controller initializes the main function and traverses to the available memory bar, the available memory bar is initialized based on the API function pointer.
2. A memory stick initialization method as claimed in claim 1, characterized in that: Get the I2C bus information corresponding to each I2C bus in the server, including: Determine all I2C buses in the server according to all programming interface numbers and all chip numbers in the server; Initializing all the I2C buses respectively, and setting a corresponding I2C initialization status flag for each I2C bus based on the initialization result; And obtain the first programming interface number, the first chip number and the first controller number corresponding to each I2C bus, and use the I2C initialization status flag, the first programming interface number, the first chip number and the first controller number as the I2C bus information corresponding to each I2C bus.
3. A memory bar initialization method as claimed in claim 2, characterized in that: After storing the I2C bus information in the pre-built I2C data structure, the method further includes: According to the initialization result, obtaining all target I2C buses whose initialization result is successful initialization; Obtain a target API function pointer corresponding to each target I2C bus, and store the target API function pointer in a preset heap space.
4. A memory stick initialization method as claimed in claim 2, characterized in that: Based on the initialization result, after setting the corresponding I2C initialization status flag for each I2C bus, it also includes: Acquire all first I2C buses whose I2C initialization state flag is 1, and detect the clock signal corresponding to each first I2C bus in real time; When it is detected that the clock signal is a low level signal and the duration of the low level signal is greater than a preset time threshold, it is determined that a driving failure occurs on the current first I2C bus, and the I2C initialization state flag corresponding to the current first I2C bus is adjusted to 0.
5. A memory bar initialization method as claimed in claim 2, characterized in that: Get the memory bank information corresponding to each memory bank in the server, including: Determine all memory sticks in the server based on all I2C buses in the server; Powering on all the memory bars respectively, and setting a corresponding memory bar power-on status flag for each memory bar based on the power-on result; Obtain a first I2C bus corresponding to each memory stick, and determine a second programming interface number, a second chip number, and a second controller number corresponding to each memory stick based on the first I2C bus; The memory bar power-on status flag, the second programming interface number, the second chip number and the second controller number are used as the memory bar information corresponding to each memory bar.
6. A memory bar initialization method as claimed in claim 5, characterized in that: Powering on all the memory bars separately, and setting a corresponding memory bar power-on status flag for each memory bar based on the power-on result, specifically including: Set the control and monitoring port bits for each memory bank separately; After determining that the preset voltage is input to all the memory bars respectively, obtaining the level jump state of the control and monitoring port bit corresponding to each memory bar, and when the control and monitoring port bit has a level jump, determining that the power-on result of the memory bar is a power-on success, otherwise, determining that the power-on result of the memory bar is a power-on failure; When the power-on result is a power-on success, the memory bar power-on status flag corresponding to the memory bar is set to 1; when the power-on result is a power-on failure, the memory bar power-on status flag corresponding to the memory bar is set to 0.
7. A memory bar initialization method as claimed in claim 6, characterized in that: Parsing the first I2C bus information in the I2C data structure and the first memory bar information in the memory bar data structure based on a preset parser, comparing each of the first memory bar information with all of the first I2C bus information in sequence, and determining an available memory bar and an available I2C bus corresponding to the available memory bar, specifically includes: Setting an I2C initialization state flag to 1 as a first extraction condition, and extracting all first I2C bus information satisfying the first extraction condition from the I2C data structure; Setting the memory bar power-on status flag to 1 as a second extraction condition, and extracting all first memory bar information satisfying the second extraction condition from the memory bar data structure; Obtain the second programming interface number, the second chip number and the second controller number corresponding to each first memory bar information, and simultaneously obtain the first programming interface number, the first chip number and the first controller number corresponding to each first I2C bus information; Compare each first memory bar information with all the first I2C bus information in turn. If the first programming interface number is the same as the second programming interface number, the first chip number is the same as the second chip number, and the first controller number is the same as the second controller number, the memory bar corresponding to the current first memory bar information is used as an available memory bar, and the I2C bus corresponding to the current first I2C bus information is used as an available I2C bus corresponding to the available memory bar.
8. A memory stick initialization device, characterized in that: include: I2C bus information acquisition module, memory bar information acquisition module, information parsing module, function pointer association module and memory bar initialization processing module; The I2C bus information acquisition module is used to acquire the I2C bus information corresponding to each I2C bus in the server, and store the I2C bus information in a pre-constructed I2C data structure, wherein the I2C bus information includes an I2C initialization status flag, a first programming interface number, a first chip number, and a first controller number; The memory bar information acquisition module is used to acquire the memory bar information corresponding to each memory bar in the server, and store the memory bar information in a pre-constructed memory bar data structure, wherein the memory bar information includes a memory bar power-on status flag, a second programming interface number, a second chip number, and a second controller number; The information parsing module is used to parse the first I2C bus information in the I2C data structure and the first memory bar information in the memory bar data structure based on a preset parser, compare each first memory bar information with all the first I2C bus information in turn, and determine an available memory bar and an available I2C bus corresponding to the available memory bar; The function pointer association module is used to obtain the API function pointer corresponding to the available I2C bus, and associate the available memory bar with the API function pointer; The memory bar initialization processing module is used to initialize the available memory bar based on the API function pointer when the controller initializes the main function and traverses to the available memory bar.
9. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for initializing a memory bar as claimed in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the memory bar initialization method according to any one of claims 1 to 7.
