CN115344309A - Memory parameter modification method and device, electronic equipment and storage medium - Google Patents

Memory parameter modification method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115344309A
CN115344309A CN202210879120.8A CN202210879120A CN115344309A CN 115344309 A CN115344309 A CN 115344309A CN 202210879120 A CN202210879120 A CN 202210879120A CN 115344309 A CN115344309 A CN 115344309A
Authority
CN
China
Prior art keywords
memory
parameter
target memory
firmware
memory parameter
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.)
Pending
Application number
CN202210879120.8A
Other languages
Chinese (zh)
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.)
Loongson Technology Corp Ltd
Original Assignee
Loongson Technology Corp 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 Loongson Technology Corp Ltd filed Critical Loongson Technology Corp Ltd
Priority to CN202210879120.8A priority Critical patent/CN115344309A/en
Publication of CN115344309A publication Critical patent/CN115344309A/en
Pending legal-status Critical Current

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
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management

Abstract

The embodiment of the invention provides a memory parameter modification method and device. The method comprises the following steps: after the firmware is started, a modification request aiming at a target memory parameter in a plurality of memory parameters is received, the modification request is analyzed to obtain a modified value of the target memory parameter and an offset address corresponding to the target memory parameter, the modified value of the target memory parameter and the offset address are stored in a storage space outside the firmware in a ROM so as to replace the target memory parameter in the firmware when the firmware is restarted, the memory parameter is modified online in the use process of the board card, the generated memory parameter modification can be sensed before the memory is initialized, the complex operation of modifying, compiling and burning the source code of the firmware is avoided, the production of the board card is facilitated, the maintained firmware version is reduced, and the workload of later maintenance is reduced.

Description

Memory parameter modification method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a memory parameter modification method, a memory parameter modification apparatus, an electronic device, and a readable storage medium.
Background
At present, a chip DDR (Double Data Rate) memory is often used on a board, and thus some parameters required for memory operation need to be set and trained in firmware.
The memory needs to be initialized at a BIOS (Basic Input Output System) start-up stage after power-on, where the initialization includes: and reading a section of memory parameters stored in the firmware, writing the memory parameters into a corresponding register, and then performing read-write training. After initialization is complete, these memory parameters will not change and will go through this process each time they are started.
The memory parameters needed by a single memory channel in the memory controller of the processor correspond to about 500B of contents, and meanwhile, certain coupling relation exists among the memory parameters. The type and capacity of the memory used by different products and part of the traces all affect the required values of the memory parameters.
Due to continuous iteration of the board card, the used memory often needs to be upgraded, and the used memory parameters also need to be adjusted correspondingly at this time. In the using process of the product, once the memory parameters in the firmware need to be changed, the source codes of the firmware need to be modified again, and the source codes are programmed again after the source codes are modified. Obviously, the source code for modifying the firmware is complicated and is not suitable for productization, different board cards may have different states, so that the version of the firmware to be maintained is increased, and the workload of later maintenance is increased.
Disclosure of Invention
The technical problem to be solved by the embodiments of the present invention is to provide a method, an apparatus, an electronic device and a readable storage medium for modifying a memory parameter, so as to solve the problems that a source code for modifying a firmware is relatively complicated and is not suitable for commercialization, different boards may have different states, and then, the number of versions of the firmware to be maintained becomes large, and the workload of later maintenance becomes large.
In order to solve the above problem, the present invention provides a method for modifying memory parameters, comprising:
after the firmware is started, receiving a modification request aiming at a target memory parameter in a plurality of memory parameters;
analyzing the modification request to obtain a modification value of the target memory parameter and an offset address corresponding to the target memory parameter; the offset address is the offset of the target memory parameter relative to the starting positions corresponding to the plurality of memory parameters;
and storing the modified value of the target memory parameter and the offset address in a storage space outside the firmware in a ROM so as to replace the target memory parameter in the firmware when the firmware is restarted.
Optionally, the storing, in a storage space outside the firmware in the ROM, the modified value of the target memory parameter and the offset address further includes:
storing the modification identification; wherein, the modification identifier is used for identifying the modified memory parameter in the plurality of memory parameters;
the method further comprises the following steps:
when the firmware is started again, acquiring a modified value and an offset address of the target memory parameter stored in the ROM according to the modified identifier;
modifying the target memory parameter into the modified value according to the offset address;
and writing the modified target memory parameter into a register corresponding to the target memory parameter.
Optionally, before the storing the modified value of the target memory parameter and the offset address in the storage space outside the firmware in the ROM, the method further comprises:
initializing each memory channel of the memory according to the modified value of the target memory parameter; the method comprises the following steps that read-write operation is independently carried out among a plurality of memory channels of the memory;
and determining that the modified value of the target memory parameter is available under the condition that the initialization of each memory channel is successful.
Optionally, the initializing each memory channel of the memory according to the modified value of the target memory parameter includes:
under the condition that one memory channel works normally, the modified value of the target memory parameter is written into a register corresponding to the target memory parameter of other memory channels;
initializing the other memory channels to obtain feedback information; the feedback information is used for reflecting an initialization result corresponding to the memory channel;
and determining that the initialization of the other memory channels is successful according to the feedback information.
The invention also provides a memory parameter modifying device, which comprises:
the request receiving module is used for receiving a modification request aiming at a target memory parameter in a plurality of memory parameters after the firmware is started;
the request analysis module is used for analyzing the modification request to obtain a modification value of the target memory parameter and an offset address corresponding to the target memory parameter; the offset address is the offset of the target memory parameter relative to the starting positions corresponding to the plurality of memory parameters;
and the storage module is used for storing the modified value of the target memory parameter and the offset address in a storage space except the firmware in the ROM so as to replace the target memory parameter in the firmware when the firmware is restarted.
Optionally, the storage module is further configured to: storing the modification identification; the modification identifier is used for identifying a modified memory parameter in the plurality of memory parameters;
the device further comprises:
a parameter obtaining module, configured to obtain, when the firmware is restarted, a modified value and an offset address of the target memory parameter stored in the ROM according to the modification identifier;
a parameter modification module, configured to modify the target memory parameter into the modified value according to the offset address;
and the parameter writing module is used for writing the modified target memory parameters into the register corresponding to the target memory parameters.
Optionally, the apparatus further comprises:
an initialization module, configured to initialize each memory channel of a memory according to a modified value of the target memory parameter before storing the modified value of the target memory parameter and the offset address in a storage space outside the firmware in a ROM; the method comprises the following steps that read-write operation is independently carried out among a plurality of memory channels of the memory;
an available determination module, configured to determine that a modified value of the target memory parameter is available if the initialization of each memory channel is successful.
Optionally, the initialization module includes:
a modified value writing submodule, configured to write a modified value of the target memory parameter into a register corresponding to the target memory parameter of another memory channel when one memory channel is operating normally;
the initialization submodule is used for initializing the other memory channels to obtain feedback information; the feedback information is used for reflecting an initialization result corresponding to the memory channel;
and the success determining submodule is used for determining that the initialization of the other memory channels is successful according to the feedback information.
The embodiment of the invention also discloses electronic equipment which is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps as described above when executing the program stored in the memory.
The embodiment of the invention also discloses a readable storage medium, and when the instructions in the storage medium are executed by a processor of the electronic equipment, the electronic equipment can execute one or more methods in the embodiment of the invention.
According to the embodiment of the invention, after the firmware is started, a modification request aiming at a target memory parameter in a plurality of memory parameters is received, and the modification request is analyzed to obtain a modification value of the target memory parameter and an offset address corresponding to the target memory parameter; the offset address is an offset of the target memory parameter relative to the corresponding initial positions of the plurality of memory parameters, and a modified value of the target memory parameter and the offset address are stored in a storage space outside the firmware in the ROM so as to replace the target memory parameter in the firmware when the firmware is restarted, so that the memory parameter is modified online in the use process of the board card, the memory parameter modification generated can be sensed before the memory is initialized, the complex operation of modifying, compiling and burning the source code of the firmware is avoided, the production of the board card is facilitated, the firmware version of the maintenance is reduced, and the workload of the later maintenance is reduced.
Drawings
Fig. 1 is a flowchart illustrating steps of a method for modifying memory parameters according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating a modified command execution flow;
fig. 3 is a flowchart illustrating steps of a method for modifying memory parameters according to another embodiment of the present invention;
FIG. 4 is a schematic diagram showing a firmware boot phase flow;
FIG. 5 is a data flow diagram illustrating memory parameter modification;
fig. 6 is a block diagram illustrating a structure of an embodiment of a memory parameter modification apparatus according to another embodiment of the present invention;
fig. 7 is a block diagram illustrating an electronic device for memory parameter modification according to an example embodiment.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Referring to fig. 1, a flowchart illustrating steps of a memory parameter modification method according to an embodiment of the present invention is shown, which specifically includes the following steps:
step 101, after the firmware is started, a modification request for a target memory parameter of a plurality of memory parameters is received.
In the embodiment of the present invention, the firmware refers to software solidified in hardware for booting the operation of the hardware. Firmware can simplify the interaction of software (e.g., an operating system) with hardware. Common firmware includes BIOS (Basic Input Output System) program, PMON (programmable read only memory Monitor) program, and the like. The firmware may implement initializing various hardware devices, initializing cache and memory controllers, and so forth.
In the embodiment of the invention, the memory plays a decisive role in the normal operation of the electronic equipment. In order to ensure that the memory of the electronic device can be normally accessed, a plurality of memory parameters are often required to be configured for the memory. For example, the memory parameters such as read window enable, write window enable, phase difference of the phase-locked loop, or any other suitable memory parameters, which are not limited in this embodiment of the present invention.
In the embodiment of the present invention, the preset memory parameter may be a memory parameter preset for the electronic device. The preset memory parameters may be predetermined through experiments and stored in the firmware. When the firmware is started every time, the processor retrains a group of memory parameters according to preset memory parameters based on a preset memory training algorithm, and then performs memory configuration based on the memory parameters.
In the embodiment of the present invention, the memory parameter targeted by the modification request is recorded as the target memory parameter. A modification request may be for one or more target memory parameters. The modification request carries modification values for one or more target memory parameters.
The embodiment of the invention provides that a relevant instruction for modifying the memory parameter is added into a command library of the existing firmware. After the firmware is started, a user can submit a modification request through a command line or an operation interface, and the processor receives the modification request. For example, in the command line of the firmware, a modification instruction, an identification of a target memory parameter, and a modification value are entered. As another example, in the operating interface of the firmware, the modified target memory parameter is selected and the modified value is entered.
Step 102, analyzing the modification request to obtain a modification value of the target memory parameter and an offset address corresponding to the target memory parameter.
In the embodiment of the present invention, after the firmware is started, the code and data in the firmware are loaded to the processor for execution, and the memory parameter in the firmware is read into the cache of the processor first, so as to write the memory parameter in the cache into the corresponding register. The offset address is an offset of the target memory parameter relative to a starting location of the plurality of memory parameters in the cache. That is, when the processor locates a memory parameter, it determines the memory parameter according to the starting location of the memory parameters in the cache and the offset address of the memory parameter relative to the starting location. In this embodiment, a plurality of memory parameters respectively correspond to their own storage addresses in the cache, and when each memory parameter is continuously stored in the cache, the initial position is the minimum value of the storage addresses corresponding to the memory parameters, that is, the position where the memory parameters start to store data in the cache; when each memory parameter is stored discontinuously in the cache, the address of the minimum value of the memory addresses stored in the cache in the memory parameters is used as the initial position, and therefore the offset address is obtained according to the initial position. In a specific implementation manner, the modification request may carry a modification value and an offset address of the target memory parameter, and the processor may analyze the modification request to obtain the modification value and the offset address of the target memory parameter. In another specific implementation, the modification request may carry a modification value and an identifier of the target memory parameter, and therefore, in the firmware, the program needs to automatically determine an offset address of the target memory parameter relative to a start address of the memory parameter. For example, the processor analyzes the modification request to obtain a modification value and an identifier of the target memory parameter, the firmware stores a mapping relationship between the identifier of the memory parameter and the offset address, and the corresponding offset address is searched according to the identifier of the target memory parameter.
Step 103, storing the modified value of the target memory parameter and the offset address in a storage space outside the firmware in the ROM, so as to replace the target memory parameter in the firmware when the firmware is restarted.
In an embodiment of the present invention, a ROM (Read-Only Memory) is used to store firmware, for example, the firmware is stored in a FLASH Memory. In order not to affect the normal use of the original firmware, the invention provides a storage space in the ROM except the original firmware for storing the modified value and the offset address of the target memory parameter. After the information is added, the original firmware can still run normally, which is equivalent to upgrading the original firmware to obtain a new version of firmware.
For example, the firmware is usually present in FLASH, and the modified values and offset addresses of the target memory parameters are written into FLASH storing the firmware and stored in a storage space following the storage space of the firmware. When the modification request is directed to a plurality of target memory parameters, in storing the modification value and the offset address, the modification value and the offset address of one target memory parameter may be sequentially stored, and then the modification value and the offset address of the next target memory parameter may be stored, or the offset address and the modification value of one target memory parameter may be sequentially stored, and then the offset address and the modification value of the next target memory parameter may be stored.
According to the embodiment of the invention, after the firmware is started, a modification request aiming at a target memory parameter in a plurality of memory parameters is received, and the modification request is analyzed to obtain a modification value of the target memory parameter and an offset address corresponding to the target memory parameter; wherein the offset address is an offset of the target memory parameter relative to an initial position of the plurality of memory parameters in a cache, and a modified value of the target memory parameter and the offset address are stored in a storage space outside the firmware in a ROM so as to replace the target memory parameter in the firmware when the firmware is restarted; the modification identifier is used for identifying the modified memory parameters in the plurality of memory parameters, so that the memory parameters are modified on line in the use process of the board card, the generated memory parameter modification can be sensed before the memory is initialized, the complex operation of modifying, compiling and burning the source codes of the firmware is avoided, the production of the board card is facilitated, the firmware version of the maintenance is reduced, and the workload of the later maintenance is reduced.
In an optional embodiment of the present invention, before the storing, in a storage space outside the firmware in the ROM, the modified value and the offset address of the target memory parameter, and the modification identifier, so as to replace the target memory parameter in the firmware when the firmware is restarted, in a specific implementation manner, the method may further include: initializing each memory channel of the memory according to the modified value of the target memory parameter; the method comprises the following steps that read-write operation is independently carried out among a plurality of memory channels of the memory; and determining that the modified value of the target memory parameter is available under the condition that the initialization of each memory channel is successful.
The memory and a memory controller on the processor communicate with the rest of the computer through a bus. The communication channel is added between the memory and the memory controller, so that the data transmission rate can be increased. The memory channel is composed of memory granules and the routing between the memory controller and the memory granules. The memory particles may be in the form of memory particles, or in the form of memory cards encapsulating the memory particles. And independently performing read-write operation among a plurality of memory channels of the memory. For example, two memory controllers are embedded in the processor, each memory controller controls one memory channel, the two memory channels can work independently, and the processor can address and read and write data from and to the two memory channels respectively. Memories typically have one channel, two channels (dual channel), four channels (four channel), six channels, eight channels, and so on. Memory parameters (including target memory parameters) need to be available for each memory channel to ensure that the memory is operating properly.
And respectively initializing each memory channel of the memory by the processor according to the modified value of the target memory parameter when the firmware is in a starting state. Of course, for other memory parameters except the target memory parameter, the preset memory parameter is still adopted. The initialization method is the same as that of a normal memory initialization method. However, since the firmware is still in the boot state, all the memory channels cannot be initialized at the same time, and at least one memory channel needs to be reserved to work normally. If the initialization of each memory channel is successful, determining that the modified value of the target memory parameter is available, and if the initialization of some memory channels is unsuccessful, reporting an error to a user.
In an optional embodiment of the present invention, initializing each memory channel of the memory according to the modified value of the target memory parameter includes: under the condition that one memory channel works normally, the processor writes the modified value of the target memory parameter into a register corresponding to the target memory parameter of other memory channels; initializing the other memory channels to obtain feedback information, wherein the feedback information is used for reflecting the initialization result corresponding to the memory channels, and determining that the initialization of the other memory channels is successful according to the feedback information.
After receiving a modification request aiming at a target memory parameter, a processor firstly reserves a normally working memory channel, and then writes a modified value of the target memory parameter into a register corresponding to the target memory parameter of other memory channels. And triggering the memory controller to initialize other memory channels again and obtaining initialized feedback information. The feedback information is used for reflecting the initialization result corresponding to the memory channel. The feedback information includes initialized relevant information, for example, the state of relevant registers, the results of the various steps performed, logs, and the like. And if the feedback information indicates that the initialization process of one memory channel is not error-reported, determining that the initialization of the memory channel is successful.
For example, a schematic diagram of the flow of the modified command run as shown in fig. 2. Firstly, reading a modified value of a target memory parameter input by a keyboard, then writing the modified value into a corresponding register of a single memory channel, and initializing the memory channel. If the initialized feedback result indicates that the test is passed, the modification identifier is modified to 1 (which is equivalent to the fact that the memory parameter is added with the modified modification identifier), and the modified value and the offset address of the target memory parameter are stored in a FLASH for storing the firmware. And if the initialized feedback result indicates that the test is not passed, reporting an error to the client.
Referring to fig. 3, a flowchart illustrating steps of a method for modifying memory parameters according to another embodiment of the present invention is shown, which may specifically include the following steps:
in step 201, after the firmware is started, a modification request for a target memory parameter of a plurality of memory parameters is received.
In the embodiment of the present invention, the specific implementation manner of this step may refer to the description in the foregoing embodiment, and details are not described herein.
Step 202, analyzing the modification request to obtain a modified value of the target memory parameter and an offset address corresponding to the target memory parameter.
In the embodiment of the present invention, the specific implementation manner of this step may refer to the description in the foregoing embodiment, and details are not described herein.
Step 203, storing the modified value and the offset address of the target memory parameter and a modification identifier in a storage space outside the firmware in the ROM, so as to replace the target memory parameter in the firmware when the firmware is restarted.
In the embodiment of the present invention, the modification identifier is used to identify a modified memory parameter in the plurality of memory parameters, so that the program can sense that the memory parameter is modified before the memory is initialized, and when the firmware needs to be restarted, the modified value is used to replace the target memory parameter in the firmware.
Step 204, when the firmware is restarted, obtaining the modified value and the offset address of the target memory parameter stored in the ROM according to the modified identifier.
In the embodiment of the invention, when the firmware is started again and the processor needs to initialize the memory, the modification identifier is read, and whether the modification identifier for modifying the memory parameter exists is judged. For example, the modification flag has two states (0 and 1), and if the modification flag is 1, the memory parameter is modified, and if the modification flag is 0, the memory parameter is not modified.
In the embodiment of the invention, if the processor determines that the memory parameters are not modified, the processor still reads and uses the memory parameters preset in the firmware as the basis for initializing the memory controller.
In the embodiment of the present invention, if the processor determines that the memory parameter is modified, on the basis of reading the memory parameter preset in the firmware, the modified value and the offset address of the target memory parameter in the firmware are also required to be read and used.
Step 205, modifying the target memory parameter into the modified value according to the offset address.
In the embodiment of the present invention, according to the start address and the offset address, the storage location of the target memory parameter in the cache may be determined, that is, the memory parameter corresponding to the start address and the offset address is the target memory parameter. And modifying the value of the memory parameter into a modified value.
Step 206, writing the modified target memory parameter into a register corresponding to the target memory parameter.
In the embodiment of the present invention, the processor writes all the memory parameters (including the target memory parameter and other memory parameters that are not modified) into the corresponding registers. In this way, the modified value of the target memory parameter is written into the register corresponding to the target memory parameter, thereby completing the modification of the target memory parameter, so as to initialize the memory by using the modified target memory parameter. After that, the memory may be initialized according to a normal memory initialization method.
For example, a schematic diagram of the firmware boot phase flow shown in fig. 4. When the processor needs to initialize the memory controller, the memory parameters in the process a are fixed and cannot be changed, the memory parameters in the firmware are read, and the memory parameters are transferred to the corresponding registers. And the memory parameter modification is realized in the flow b, and whether the modification identification bit is the modification identification of the memory parameter with modification is judged. And if the modification identification bit is the modified modification identification of the memory parameter, reading the stored modified value and offset address of the target memory parameter. And modifying the value of the target memory parameter in the processor into a modified value. And writing the modified value back to the firmware, and transferring the modified value to a register corresponding to the target memory parameter.
In one embodiment of the present invention, a data flow diagram of memory parameter modification is shown in fig. 5.
After the BIOS is started, the processor reads codes and data from the ROM, the BIOS runs on the processor, all memory parameters are read into a cache of the processor firstly, and all memory parameters are stored in the cache of the processor in a fixed sequence. The user modifies the memory parameter of the phase difference of the phase-locked loop in the BIOS, the original value of the phase difference of the phase-locked loop is 0x20, the offset address of the phase-locked loop is 0x0038, and the modified value is 0x40. And the processor determines the storage position of the memory parameter in the cache according to the offset address 0x0038, and modifies 0x20 stored in the cache to 0x40.
Then, the processor may initialize each memory channel of the memory according to a modified value 0x40 of the phase difference of the phase-locked loop, and determine that the modified value of the phase difference of the phase-locked loop is available when the initialization of each memory channel is successful.
The total capacity of the ROM is 4M and the ROM occupies 1M of storage space. And the processor burns the ROM according to the offset address and the modified value of the phase difference of the phase-locked loop in the cache, specifically, writing at the position behind the 1M storage space, writing the modified identifier 1, and then writing the offset address 0x0038 and the modified value 0x40. The modification of the phase difference of the phase-locked loop is completed.
After the BIOS is restarted, the processor reads the codes and data from the ROM, the BIOS runs on the processor, and all the memory parameters are read into the cache of the processor. The processor reads the modification flag 1, as well as the offset address 0x0038 and the modification value 0x40. And determining the position of the phase difference of the phase-locked loop in the cache according to the modification identifier 1 and the offset address 0x0038, and modifying the value of the phase difference of the phase-locked loop in the cache to be a modified value 0x40. Finally, the processor writes all the memory parameters in the cache into the registers of the memory controller in a fixed sequence, that is, the modified value of the phase difference of the phase-locked loop is also written into the corresponding register of the memory controller.
According to the embodiment of the invention, after the firmware is started, a modification request aiming at a target memory parameter in a plurality of memory parameters is received, the modification request is analyzed to obtain a modification value of the target memory parameter and an offset address corresponding to the target memory parameter, the modification value and the offset address of the target memory parameter and a modification identifier are stored in a storage space outside the firmware in a ROM, so that the target memory parameter in the firmware is replaced when the firmware is restarted, the modification value and the offset address of the target memory parameter stored in the ROM are obtained according to the modification identifier when the firmware is restarted, the target memory parameter is modified into the modification value according to the offset address, the modified target memory parameter is written into a register corresponding to the target memory parameter, the memory parameter is modified on line in the use process of a board card, the generated memory parameter modification can be sensed before the memory is initialized, the complicated operation of compiling and rewriting the source code of the firmware is avoided, the production of the board card is facilitated, the maintenance workload of the firmware is reduced, and the maintenance workload of the firmware is reduced.
It should be noted that for simplicity of description, the method embodiments are shown as a series of combinations of acts, but those skilled in the art will recognize that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 6, a block diagram of a memory parameter modification apparatus according to another embodiment of the present invention is shown, which may specifically include the following modules:
a request receiving module 301, configured to receive a modification request for a target memory parameter in a plurality of memory parameters after firmware is started;
a request parsing module 302, configured to parse the modification request to obtain a modification value of the target memory parameter and an offset address corresponding to the target memory parameter; the offset address is the offset of the target memory parameter relative to the starting positions corresponding to the plurality of memory parameters;
a storage module 303, configured to store, in a storage space outside the firmware in the ROM, the modified value of the target memory parameter and the offset address, so as to replace the target memory parameter in the firmware when the firmware is restarted; wherein the modification identifier is used for identifying that the modified memory parameter exists in the plurality of memory parameters.
In an optional embodiment of the invention, the storage module is further configured to: storing the modification identification; wherein, the modification identifier is used for identifying the modified memory parameter in the plurality of memory parameters;
the device further comprises:
a parameter obtaining module, configured to obtain, according to the modification identifier, a modification value and an offset address of the target memory parameter stored in the ROM when the firmware is restarted;
a parameter modification module, configured to modify the target memory parameter into the modified value according to the offset address;
and the parameter writing module is used for writing the modified target memory parameters into the register corresponding to the target memory parameters.
In an optional embodiment of the invention, the apparatus further comprises:
an initialization module, configured to initialize each memory channel of a memory according to a modified value of the target memory parameter before storing the modified value of the target memory parameter and the offset address in a storage space outside the firmware in a ROM; the method comprises the following steps that read-write operation is independently carried out among a plurality of memory channels of the memory;
an available determination module, configured to determine that a modified value of the target memory parameter is available if the initialization of each memory channel is successful.
In an optional embodiment of the invention, the initialization module comprises:
a modified value writing submodule, configured to write a modified value of the target memory parameter into a register corresponding to the target memory parameter of another memory channel when one memory channel is operating normally;
the initialization submodule is used for initializing the other memory channels to obtain feedback information; the feedback information is used for reflecting an initialization result corresponding to the memory channel;
and the success determining submodule is used for determining that the initialization of the other memory channels is successful according to the feedback information.
According to the embodiment of the invention, after the firmware is started, a modification request aiming at a target memory parameter in a plurality of memory parameters is received, and the modification request is analyzed to obtain a modification value of the target memory parameter and an offset address corresponding to the target memory parameter; wherein the offset address is an offset of the target memory parameter relative to an initial position of the plurality of memory parameters in a cache, and a modified value of the target memory parameter and the offset address are stored in a storage space outside the firmware in a ROM so as to replace the target memory parameter in the firmware when the firmware is restarted; the modification identifier is used for identifying the modified memory parameters in the plurality of memory parameters, so that the memory parameters are modified on line in the use process of the board card, the generated memory parameter modification can be sensed before the memory is initialized, the complex operation of modifying, compiling and burning the source codes of the firmware is avoided, the production of the board card is facilitated, the firmware version of maintenance is reduced, and the workload of later maintenance is reduced.
For the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
Fig. 7 is a block diagram illustrating an electronic device 700 for memory parameter modification according to an exemplary embodiment. For example, the electronic device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 7, electronic device 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input/output (I/O) interface 712, a sensor component 714, and a communication component 716.
The processing component 702 generally controls overall operation of the electronic device 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing elements 702 may include one or more processors 720 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 702 may include one or more modules that facilitate interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.
The memory 704 is configured to store various types of data to support operation at the device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 704 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power components 704 provide power to the various components of the electronic device 700. Power components 704 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for electronic device 700.
The multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 700 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 710 is configured to output and/or input audio signals. For example, the audio component 710 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 700 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 704 or transmitted via the communication component 716. In some embodiments, audio component 710 further includes a speaker for outputting audio signals.
The I/O interface 712 provides an interface between the processing component 702 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 may detect an open/closed state of the device 700, the relative positioning of components, such as a display and keypad of the electronic device 700, the sensor assembly 714 may also detect a change in the position of the electronic device 700 or a component of the electronic device 700, the presence or absence of user contact with the electronic device 700, orientation or acceleration/deceleration of the electronic device 700, and a change in the temperature of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 714 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 714 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 704 comprising instructions, executable by the processor 720 of the electronic device 700 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium, instructions in which, when executed by a processor of a terminal, enable the terminal to perform a memory parameter modification method, the method comprising:
after the firmware is started, receiving a modification request aiming at a target memory parameter in a plurality of memory parameters;
analyzing the modification request to obtain a modification value of the target memory parameter and an offset address corresponding to the target memory parameter; the offset address is the offset of the target memory parameter relative to the initial position of the plurality of memory parameters in the cache;
storing the modified value of the target memory parameter and the offset address in a storage space outside the firmware in a ROM for replacing the target memory parameter in the firmware when the firmware is restarted.
Optionally, the storing, in a storage space outside the firmware in the ROM, the modified value of the target memory parameter and the offset address further includes:
storing the modification identification; the modification identifier is used for identifying a modified memory parameter in the plurality of memory parameters;
the method further comprises the following steps:
when the firmware is started again, acquiring a modified value and an offset address of the target memory parameter stored in the ROM according to the modified identifier;
according to the offset address, modifying the target memory parameter into the modified value;
and writing the modified target memory parameter into a register corresponding to the target memory parameter.
Optionally, before the storing the modified value of the target memory parameter and the offset address in the storage space outside the firmware in the ROM, the method further comprises:
initializing each memory channel of the memory according to the modified value of the target memory parameter; the method comprises the following steps that read-write operation is independently carried out among a plurality of memory channels of the memory;
determining that a modified value of the target memory parameter is available if the initialization of each memory channel is successful.
Optionally, the initializing each memory channel of the memory according to the modified value of the target memory parameter includes:
under the condition that one memory channel works normally, writing the modified value of the target memory parameter into a register corresponding to the target memory parameter of other memory channels;
initializing the other memory channels to obtain feedback information; the feedback information is used for reflecting an initialization result corresponding to the memory channel;
and determining that the initialization of the other memory channels is successful according to the feedback information.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one of skill in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the true scope of the embodiments of the present invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or terminal device that comprises the element.
The above detailed description is made on a memory parameter modification method and a memory parameter modification device provided by the present invention, and a specific example is applied in the present document to explain the principle and the implementation manner of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for modifying memory parameters, comprising:
after the firmware is started, receiving a modification request aiming at a target memory parameter in a plurality of memory parameters;
analyzing the modification request to obtain a modification value of the target memory parameter and an offset address corresponding to the target memory parameter; the offset address is the offset of the target memory parameter relative to the starting positions corresponding to the plurality of memory parameters;
storing the modified value of the target memory parameter and the offset address in a storage space outside the firmware in a ROM for replacing the target memory parameter in the firmware when the firmware is restarted.
2. The method of claim 1, wherein the storing in the ROM outside of the firmware, the modified value of the target memory parameter and the offset address, further comprises:
storing the modification identification; wherein, the modification identifier is used for identifying the modified memory parameter in the plurality of memory parameters;
the method further comprises the following steps:
when the firmware is started again, acquiring a modified value and an offset address of the target memory parameter stored in the ROM according to the modified identifier;
according to the offset address, modifying the target memory parameter into the modified value;
and writing the modified target memory parameter into a register corresponding to the target memory parameter.
3. The method of claim 1, wherein prior to storing the modified value of the target memory parameter and the offset address in the memory space outside of the firmware in the ROM, the method further comprises:
initializing each memory channel of the memory according to the modified value of the target memory parameter; the method comprises the following steps that read-write operation is independently carried out among a plurality of memory channels of the memory;
and determining that the modified value of the target memory parameter is available under the condition that the initialization of each memory channel is successful.
4. The method according to claim 3, wherein the initializing each memory channel of the memory according to the modified value of the target memory parameter comprises:
under the condition that one memory channel works normally, the modified value of the target memory parameter is written into a register corresponding to the target memory parameter of other memory channels;
initializing the other memory channels to obtain feedback information; the feedback information is used for reflecting an initialization result corresponding to the memory channel;
and determining that the initialization of the other memory channels is successful according to the feedback information.
5. A memory parameter modification apparatus, comprising:
the request receiving module is used for receiving a modification request aiming at a target memory parameter in a plurality of memory parameters after the firmware is started;
the request analysis module is used for analyzing the modification request to obtain a modification value of the target memory parameter and an offset address corresponding to the target memory parameter; the offset address is the offset of the target memory parameter relative to the corresponding initial positions of the plurality of memory parameters;
and the storage module is used for storing the modified value of the target memory parameter and the offset address in a storage space except the firmware in the ROM so as to replace the target memory parameter in the firmware when the firmware is restarted.
6. The apparatus of claim 5, wherein the storage module is further configured to: storing the modification identification; the modification identifier is used for identifying a modified memory parameter in the plurality of memory parameters;
the device further comprises:
a parameter obtaining module, configured to obtain, when the firmware is restarted, a modified value and an offset address of the target memory parameter stored in the ROM according to the modification identifier;
a parameter modification module, configured to modify the target memory parameter into the modified value according to the offset address;
and the parameter writing module is used for writing the modified target memory parameter into a register corresponding to the target memory parameter.
7. The apparatus of claim 5, further comprising:
an initialization module, configured to initialize each memory channel of a memory according to a modified value of the target memory parameter before storing the modified value of the target memory parameter and the offset address in a storage space outside the firmware in a ROM; the method comprises the following steps that read-write operation is independently carried out among a plurality of memory channels of the memory;
an available determination module, configured to determine that a modified value of the target memory parameter is available if the initialization of each memory channel is successful.
8. The apparatus of claim 7, wherein the initialization module comprises:
a modified value writing submodule, configured to write a modified value of the target memory parameter into a register corresponding to the target memory parameter of another memory channel when one memory channel normally operates;
the initialization submodule is used for initializing the other memory channels to obtain feedback information; the feedback information is used for reflecting an initialization result corresponding to the memory channel;
and the success determining submodule is used for determining that the initialization of the other memory channels is successful according to the feedback information.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 4 when executing a program stored in the memory.
10. A readable storage medium, characterized in that instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the memory parameter modification method according to one or more of the method claims 1-4.
CN202210879120.8A 2022-07-25 2022-07-25 Memory parameter modification method and device, electronic equipment and storage medium Pending CN115344309A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210879120.8A CN115344309A (en) 2022-07-25 2022-07-25 Memory parameter modification method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210879120.8A CN115344309A (en) 2022-07-25 2022-07-25 Memory parameter modification method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115344309A true CN115344309A (en) 2022-11-15

Family

ID=83949509

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210879120.8A Pending CN115344309A (en) 2022-07-25 2022-07-25 Memory parameter modification method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115344309A (en)

Similar Documents

Publication Publication Date Title
CN107967141B (en) Operating system upgrading method and device and terminal
KR102400384B1 (en) Electronic device having an external memory and method operating the same
US20170150290A1 (en) Method and device for information push
CN104484200A (en) Method and device for updating firmware
CN104281478B (en) The method and device of more new application
CN107291626B (en) Data storage method and device
CN105468410B (en) Method for upgrading system and device
EP3040856B1 (en) Firmware refreshing method and device
CN105630546A (en) System updating method and system updating device
CN113160873A (en) Memory test method and device, electronic equipment and storage medium
CN106293683B (en) Project compiling method and device
CN108563487B (en) User interface updating method and device
CN112463199A (en) System upgrading method and terminal
CN115344309A (en) Memory parameter modification method and device, electronic equipment and storage medium
CN105630548A (en) System updating method and system updating device
CN104951337A (en) File incremental updating method and device
CN108427568B (en) User interface updating method and device
CN110874259A (en) Program execution method, device, equipment and storage medium
CN113326069A (en) Operating system starting method and device, electronic equipment and storage medium
CN111813426A (en) Fingerprint data processing method and device
CN113836069B (en) Chip, pin operation method, readable storage medium and electronic device
CN114020504B (en) Data processing method and device, electronic equipment and storage medium
CN111596949B (en) Method and device for developing application program
CN110659081B (en) File processing method and device for program object and electronic equipment
CN110990068B (en) Display method, display device, electronic equipment and storage medium

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