A method, apparatus, electronic device, and storage medium for modifying memory parameters.
By receiving and parsing memory parameter modification requests after firmware startup, and saving the modified values and offset addresses in the external storage space of ROM, the problem of cumbersome firmware source code modification is solved, and the board is simplified and productized, and the maintenance workload is reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-25
- Publication Date
- 2026-03-13
AI Technical Summary
Modifying firmware source code in existing technologies is cumbersome and unsuitable for productization, resulting in multiple firmware versions for different board states and a large maintenance workload.
After the firmware starts, it receives a request to modify memory parameters, parses the target memory parameter modification value and offset address, and saves it in the external storage space of ROM to replace the parameters in the firmware, thus realizing online modification.
This avoids tedious modifications to the firmware source code, simplifies the productization process of the board, and reduces firmware versioning and maintenance workload.
Smart Images

Figure CN115344309B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method for modifying memory parameters, a device for modifying memory parameters, an electronic device, and a readable storage medium. Background Technology
[0002] Currently, surface-mount DDR (Double Data Rate) memory is often used on circuit boards, so it is necessary to set and train some parameters required for memory operation in the firmware.
[0003] The memory needs to be initialized during the BIOS (Basic Input Output System) boot phase after power-on. This includes reading a set of memory parameters stored in the firmware, writing these parameters into the corresponding registers, and then performing read / write training. After initialization, these memory parameters will not change, and this process will be repeated every time the system boots.
[0004] In a processor's memory controller, a single memory channel requires approximately 500 bytes of memory parameters, and these parameters are interconnected. The type and capacity of memory used in different products, as well as some of the wiring, will affect the required memory parameters.
[0005] As circuit boards are constantly iterated, the memory used often needs to be upgraded, requiring corresponding adjustments to the memory parameters. During product use, if changes to the memory parameters in the firmware are needed, the firmware source code must be modified and re-flashed. Obviously, modifying the firmware source code is cumbersome and unsuitable for productization. Different circuit boards may have different states, leading to more firmware versions to maintain and a greater workload for later maintenance. Summary of the Invention
[0006] The technical problem to be solved by the embodiments of the present invention is to provide a method, apparatus, electronic device and readable storage medium for modifying memory parameters, so as to solve the problems that modifying firmware source code is cumbersome, unsuitable for productization, different boards may have different states, resulting in more firmware versions to be maintained and a larger workload for later maintenance.
[0007] To address the above problems, this invention provides a method for modifying memory parameters, including:
[0008] After the firmware starts, it receives a modification request for the target memory parameter among multiple memory parameters;
[0009] The modification request is parsed to obtain the modified value of the target memory parameter and the offset address corresponding to the target memory parameter; wherein, the offset address is the offset of the target memory parameter relative to the starting position corresponding to the plurality of memory parameters;
[0010] The modified value of the target memory parameter and the offset address are stored in a storage space outside the firmware in the ROM, so that they can replace the target memory parameter in the firmware when the firmware is restarted.
[0011] Optionally, the storage space outside the firmware in the ROM, which stores the modified values of the target memory parameters and the offset address, further includes:
[0012] A modification identifier is stored; wherein the modification identifier is used to identify the modified memory parameter among the plurality of memory parameters;
[0013] The method further includes:
[0014] When the firmware restarts, the modified value and offset address of the target memory parameter stored in the ROM are obtained according to the modification identifier.
[0015] Based on the offset address, modify the target memory parameter to the modified value;
[0016] The modified target memory parameters are written into the register corresponding to the target memory parameters.
[0017] Optionally, before storing the modified value of the target memory parameter and the offset address in storage space outside the firmware in the ROM, the method further includes:
[0018] Based on the modified values of the target memory parameters, each memory channel is initialized; wherein, read and write operations are performed independently among the multiple memory channels.
[0019] If the initialization of each memory channel is successful, the modified value of the target memory parameter is determined to be available.
[0020] Optionally, initializing each memory channel according to the modified value of the target memory parameter includes:
[0021] When one memory channel is working normally, the modified value of the target memory parameter is written to the register corresponding to the target memory parameter in other memory channels;
[0022] The other memory channels are initialized to obtain feedback information; wherein the feedback information is used to reflect the initialization result of the corresponding memory channel.
[0023] Based on the feedback information, it is determined that the initialization of the other memory channels was successful.
[0024] The present invention also provides a memory parameter modification device, comprising:
[0025] The request receiving module is used to receive modification requests for the target memory parameter among multiple memory parameters after the firmware is started.
[0026] The request parsing module is used to parse the modification request to obtain the modified value of the target memory parameter and the offset address corresponding to the target memory parameter; wherein, the offset address is the offset of the target memory parameter relative to the starting position corresponding to the plurality of memory parameters;
[0027] A storage module is used to store 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.
[0028] Optionally, the storage module is further configured to: store a modification identifier; wherein the modification identifier is used to identify the modified memory parameter among the plurality of memory parameters;
[0029] The device further includes:
[0030] The parameter acquisition module is used to acquire the modified value and offset address of the target memory parameter stored in the ROM according to the modification identifier when the firmware is restarted.
[0031] The parameter modification module is used to modify the target memory parameter to the modified value according to the offset address;
[0032] The parameter writing module is used to write the modified target memory parameters into the register corresponding to the target memory parameters.
[0033] Optionally, the device further includes:
[0034] An initialization module is used to initialize each memory channel of the memory according to the modified value of the target memory parameter before storing the modified value of the target memory parameter in the storage space outside the firmware in the ROM; wherein, the multiple memory channels of the memory are read and written independently.
[0035] A determination module is available to determine if the modified value of the target memory parameter is available if the initialization of each memory channel is successful.
[0036] Optionally, the initialization module includes:
[0037] The modified value writing submodule is used to write the modified value of the target memory parameter to the register corresponding to the target memory parameter in other memory channels when one memory channel is working normally;
[0038] An initialization submodule is used to initialize the other memory channels and obtain feedback information; wherein, the feedback information is used to reflect the initialization result of the memory channel.
[0039] The successful determination submodule is used to determine, based on the feedback information, that the initialization of the other memory channels was successful.
[0040] This invention also discloses an electronic device, characterized in that it includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0041] Memory, used to store computer programs;
[0042] When a processor executes a program stored in memory, it implements the method steps described above.
[0043] This invention also discloses a readable storage medium, wherein when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is able to perform one or more of the methods described in this invention.
[0044] According to an embodiment of the present invention, after firmware startup, a modification request for a target memory parameter among multiple memory parameters is received. The modification request is parsed to obtain the modified value of the target memory parameter and the offset address corresponding to the target memory parameter. The offset address is the offset of the target memory parameter relative to the starting position of the multiple memory parameters. The modified value of the target memory parameter and the offset address are stored in a storage space outside the firmware in the ROM. This storage space replaces the target memory parameter in the firmware when the firmware is restarted, enabling online modification of memory parameters during board use. The modification of memory parameters can be detected before memory initialization, avoiding the cumbersome operation of modifying, compiling, and rewriting the firmware source code. This facilitates board productization, reduces the number of firmware versions to be maintained, and reduces the workload of later maintenance. Attached Figure Description
[0045] Figure 1 The following is a flowchart illustrating the steps of a memory parameter modification method provided by an embodiment of the present invention;
[0046] Figure 2 A schematic diagram illustrating the execution flow of the modification command is shown;
[0047] Figure 3 A flowchart illustrating the steps of a memory parameter modification method according to another embodiment of the present invention is shown.
[0048] Figure 4 A schematic diagram of the firmware boot phase process is shown;
[0049] Figure 5 The data flow diagram for modifying memory parameters is shown;
[0050] Figure 6 A structural block diagram of another embodiment of a memory parameter modification device provided by the present invention is shown;
[0051] Figure 7 A structural block diagram of an electronic device for modifying memory parameters is shown according to an exemplary embodiment. Detailed Implementation
[0052] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0053] Reference Figure 1 The diagram illustrates a flowchart of a memory parameter modification method provided by an embodiment of the present invention, which may specifically include the following steps:
[0054] Step 101: After the firmware starts, it receives a modification request for the target memory parameter among multiple memory parameters.
[0055] In this embodiment of the invention, firmware refers to software embedded in hardware, used to guide the hardware's operation. Firmware simplifies the interaction between software (e.g., an operating system) and hardware. Common firmware includes BIOS (Basic Input Output System) programs, PMON (Programmable Read-Only Memory Monitor) programs, etc. Firmware can initialize various hardware devices, initialize caches and memory controllers, etc.
[0056] In this embodiment of the invention, memory plays a decisive role in the normal operation of electronic devices. To ensure that the memory of electronic devices can be accessed normally, it is often necessary to configure multiple memory parameters. For example, memory parameters such as read window enable, write window enable, phase difference of phase-locked loop, or any other applicable memory parameters are not limited in this embodiment of the invention.
[0057] In this embodiment of the invention, the preset memory parameters can be memory parameters pre-set for the electronic device. These preset memory parameters can be determined experimentally and stored in the firmware. Each time the firmware boots, the processor retrains a set of memory parameters based on a preset memory training algorithm and the preset memory parameters, and then configures the memory based on these parameters.
[0058] In this embodiment of the invention, the memory parameter targeted by the modification request is denoted as the target memory parameter. A single modification request may target one or more target memory parameters. The modification request carries the modified values of one or more target memory parameters.
[0059] This invention proposes adding instructions for modifying memory parameters to the existing firmware command library. After the firmware boots, the user can submit modification requests via command line or user interface, and the processor receives the requests. For example, in the firmware command line, the user can type the modification command, the identifier of the target memory parameter, and the modification value. Alternatively, in the firmware user interface, the user can select the target memory parameter to be modified and type the modification value.
[0060] Step 102: Parse the modification request to obtain the modified value of the target memory parameter and the offset address corresponding to the target memory parameter.
[0061] In this embodiment of the invention, after the firmware starts, the code and data in the firmware are loaded into the processor for execution. The memory parameters in the firmware are first read into the processor's cache, and then the memory parameters in the cache are written into the corresponding registers. The offset address is the offset of the target memory parameter relative to the starting position of multiple memory parameters in the cache. That is, when the processor locates a memory parameter, it is determined based on the starting position of multiple memory parameters in the cache and the offset address of the memory parameter relative to the starting position. In this embodiment, each of the multiple memory parameters corresponds to its own storage address in the cache. When the memory parameters are stored contiguously in the cache, the starting position is the minimum value of the storage addresses corresponding to these memory parameters, that is, the position where these memory parameters begin to be stored in the cache. When the memory parameters are not stored contiguously in the cache, the starting position is the address where the minimum value of the storage address of the memory parameter in the cache is located, and the offset address is obtained based on the starting position. In one specific implementation, the modification request can carry the modified value and offset address of the target memory parameter. The processor parses the modification request to obtain the modified value and offset address of the target memory parameter. In another specific implementation, the modification request can carry the modified value and identifier of the target memory parameter. Therefore, in the firmware, the program needs to automatically determine the offset address of the target memory parameter relative to the starting address of the memory parameter. For example, the processor can parse the modification request to obtain the modified value and identifier of the target memory parameter. The firmware stores the mapping relationship between the identifier of the memory parameter and the offset address, and looks up the corresponding offset address based on the identifier of the target memory parameter.
[0062] Step 103: Store the modified value of the target memory parameter and the offset address in the storage space outside the firmware in the ROM, so as to replace the target memory parameter in the firmware when the firmware is restarted.
[0063] In this embodiment of the invention, the ROM (Read-Only Memory) is used to store firmware, for example, the firmware is stored in FLASH (flash memory). To avoid affecting the normal use of the original firmware, this invention proposes storing the modified values and offset addresses of the target memory parameters in a storage space outside the original firmware within the ROM. After adding this information, the original firmware can still run normally, which is equivalent to upgrading the original firmware to obtain a new version.
[0064] For example, firmware is typically stored in FLASH memory. The modified values and offset addresses of the target memory parameters are written into the FLASH memory where the firmware is stored, and then stored in a storage space following the firmware's storage space. When a modification request targets multiple target memory parameters, the modified values and offset addresses can be stored sequentially, either one after the other, or the offset address and modified value of one target memory parameter after the other.
[0065] According to an embodiment of the present invention, after firmware startup, a modification request for a target memory parameter among multiple memory parameters is received. The modification request is parsed to obtain the modified value of the target memory parameter and the corresponding offset address. The offset address is the offset of the target memory parameter relative to the starting position of the multiple memory parameters in the cache. The modified value of the target memory parameter and the offset address are stored in a storage space outside the firmware in the ROM, so that they can replace the target memory parameter in the firmware when the firmware restarts. The modification identifier is used to identify the memory parameter among the multiple memory parameters that has been modified, enabling online modification of memory parameters during board use. This allows for the detection of memory parameter modifications before memory initialization, avoiding the cumbersome operation of modifying, compiling, and rewriting the firmware source code. This facilitates board productization, reduces the number of firmware versions to be maintained, and reduces the workload of later maintenance.
[0066] In an optional embodiment of the present invention, the modified value of the target memory parameter, the offset address, and the modification identifier 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. In a specific implementation, it may further include: initializing each memory channel of the memory according to the modified value of the target memory parameter; wherein the multiple memory channels of the memory are read and write independently; and if the initialization of each memory channel is successful, determining that the modified value of the target memory parameter is available.
[0067] The memory and the memory controller on the processor communicate with the rest of the computer via a bus. Adding communication channels between the memory and the memory controller can speed up data transfer. A memory channel consists of memory chips and the wiring between the memory controller and the memory chips. Memory chips can be either physical memory chips or memory cards that encapsulate them. Multiple memory channels can perform read and write operations independently. For example, a processor may have two embedded memory controllers, each controlling one memory channel. The two memory channels can operate independently, and the processor can address and read / write data to each channel separately. Memory typically has one channel, two channels (dual-channel), four channels (quad-channel), six channels, eight channels, etc. Memory parameters (including target memory parameters) need to be available for each memory channel to ensure proper memory operation.
[0068] While the firmware is in the boot state, the processor initializes each memory channel according to the modified values of the target memory parameters. Of course, for other memory parameters besides the target parameters, the preset memory parameters are still used. The initialization method is the same as the usual memory initialization method. However, since the firmware must still be in the boot state, it cannot initialize all memory channels simultaneously; at least one memory channel must be kept operational. If the initialization of each memory channel is successful, the modified values of the target memory parameters are considered usable; if the initialization of some memory channels fails, an error is reported to the user.
[0069] In an optional embodiment of the present invention, each memory channel is initialized according to the modified value of the target memory parameter, including: when one memory channel is working normally, the processor writes the modified value of the target memory parameter into the register corresponding to the target memory parameter of other memory channels; the other memory channels are initialized to obtain feedback information, wherein the feedback information is used to reflect the initialization result of the memory channel, and the initialization of the other memory channels is determined to be successful according to the feedback information.
[0070] After receiving a modification request for target memory parameters, the processor first reserves one memory channel for normal operation. Then, it writes the modified target memory parameters to the registers corresponding to the target memory parameters in the other memory channels. Next, it triggers the memory controller to re-initialize the other memory channels and obtains initialization feedback information. This feedback information reflects the initialization result of the memory channel. The feedback information includes relevant initialization information, such as the status of relevant registers, the results of each executed step, and logs. If the feedback information indicates that the initialization process of a memory channel proceeded without errors, then the initialization of that memory channel is considered successful.
[0071] For example, such as Figure 2 The diagram illustrates the execution flow of the modification command. First, the modified value of the target memory parameter entered from the keyboard is read. Then, this modified value is written to the corresponding register of the single memory channel, and the memory channel is initialized. If the initialization feedback indicates that the test passed, the modification flag is changed to 1 (equivalent to adding a modification flag indicating that the memory parameter has been modified), and the modified value of the target memory parameter and its offset address are stored in the FLASH memory of the firmware. If the initialization feedback indicates that the test failed, an error is reported to the client.
[0072] Reference Figure 3 The diagram illustrates a flowchart of a memory parameter modification method according to another embodiment of the present invention, which may specifically include the following steps:
[0073] Step 201: After the firmware starts, it receives a modification request for the target memory parameter among multiple memory parameters.
[0074] In this embodiment of the invention, the specific implementation of this step can be found in the description of the foregoing embodiments, and will not be repeated here.
[0075] Step 202: Parse the modification request to obtain the modified value of the target memory parameter and the offset address corresponding to the target memory parameter.
[0076] In this embodiment of the invention, the specific implementation of this step can be found in the description of the foregoing embodiments, and will not be repeated here.
[0077] Step 203: Store the modified value of the target memory parameter, the offset address, and the modification identifier in the storage space outside the firmware in the ROM, so as to replace the target memory parameter in the firmware when the firmware is restarted.
[0078] In this embodiment of the invention, the modification identifier is used to identify the modified memory parameter among multiple memory parameters, so that the program can detect the modification of the memory parameter before the memory is initialized, and the modified value is used to replace the target memory parameter in the firmware when the firmware is restarted.
[0079] Step 204: When the firmware restarts, obtain the modified value and offset address of the target memory parameter stored in the ROM according to the modification identifier.
[0080] In this embodiment of the invention, when the firmware restarts and the processor initializes the memory, it reads the modification flag to determine whether there is a modification flag indicating that the memory parameters have been modified. For example, the modification flag has two states (0 and 1): if the modification flag is 1, the memory parameters have been modified; if the modification flag is 0, the memory parameters have not been modified.
[0081] In this embodiment of the invention, if the processor determines that the memory parameters have not been modified, it will still read and use the preset memory parameters in the firmware as the basis for initializing the memory controller.
[0082] In this embodiment of the invention, if the processor determines that the memory parameters have been modified, it needs to read and use the modified value and offset address of the target memory parameters in the firmware, in addition to reading the preset memory parameters in the firmware.
[0083] Step 205: Modify the target memory parameter to the modified value according to the offset address.
[0084] In this embodiment of the invention, the storage location of the target memory parameter in the cache can be determined based on the start address and the offset address. In other words, the memory parameter corresponding to the start address and the offset address is the target memory parameter. The value of this memory parameter is then modified to the modified value.
[0085] Step 206: Write the modified target memory parameters into the register corresponding to the target memory parameters.
[0086] In this embodiment of the invention, the processor writes all memory parameters (including the target memory parameters and other unmodified memory parameters) into the corresponding registers. This writes the modified value of the target memory parameters into the register corresponding to those parameters, thus completing the modification of the target memory parameters so that the modified parameters can be used to initialize the memory. Afterwards, the memory can be initialized using the usual memory initialization method.
[0087] For example, such as Figure 4 The diagram illustrates the firmware startup process. When the processor initializes the memory controller, in process a, the memory parameters are fixed and cannot be changed. The memory parameters are read from the firmware and transferred to the corresponding registers. Process b, however, modifies the memory parameters by checking if a modification flag indicates that the memory parameters have been modified. If the flag indicates modification, the modified value and offset address of the target memory parameter are read. The value of the target memory parameter in the processor is then modified to the modified value. Finally, the modified value is written back to the firmware and transferred to the register corresponding to the target memory parameter.
[0088] In one embodiment of the present invention, such as Figure 5 The diagram shows the data flow for modifying memory parameters.
[0089] After the BIOS boots up, the processor reads code and data from the ROM. The BIOS runs on the processor, and all memory parameters are first read into the processor's cache. In the processor's cache, all memory parameters are stored in a fixed order. The user modifies the phase difference of the phase-locked loop (PLL) in the BIOS. The original value of the PLL phase difference was 0x20, with an offset address of 0x0038; the modified value is 0x40. The processor, based on the offset address 0x0038, determines the storage location of this memory parameter in the cache and modifies the stored value from 0x20 to 0x40.
[0090] Then, the processor can initialize each memory channel according to the phase difference modification value of 0x40 of the phase-locked loop. If the initialization of each memory channel is successful, the phase difference modification value of the phase-locked loop is determined to be available.
[0091] The total capacity of the ROM is 4MB, and the ROM occupies 1MB of storage space. The processor writes to the ROM based on the offset address and modified value of the phase difference of the phase-locked loop in the cache. Specifically, writing begins after the 1MB storage space is filled, first writing the modification flag 1, then writing the offset address 0x0038 and the modified value 0x40. The modification of the phase difference of the phase-locked loop is then complete.
[0092] After the BIOS restarts, the processor reads code and data from the ROM. The BIOS runs on the processor, and all memory parameters are first read into the processor's cache. The processor reads the modification flag 1, along with the offset address 0x0038 and the modification value 0x40. Based on the modification flag 1 and the offset address 0x0038, the processor determines the position of the phase difference of the phase-locked loop (PLL) in the cache and modifies the value of the PLL phase difference in the cache to the modification value 0x40. Finally, the processor writes all memory parameters from the cache into the various registers of the memory controller in a fixed order; that is, the modified value of the PLL phase difference is also written into the corresponding register of the memory controller.
[0093] According to an embodiment of the present invention, after firmware startup, a modification request for a target memory parameter among multiple memory parameters is received. The modification request is parsed to obtain the modified value of the target memory parameter and the offset address corresponding to the target memory parameter. The modified value of the target memory parameter, the offset address, and a modification identifier are stored in a storage space outside the firmware in the ROM. This storage space is used to replace the target memory parameter in the firmware when the firmware restarts. When the firmware restarts, the modified value and offset address of the target memory parameter stored in the ROM are obtained according to the modification identifier. The target memory parameter is modified to the modified value according to the offset address. The modified target memory parameter is written to the register corresponding to the target memory parameter. This allows for online modification of memory parameters during board use. The modification of memory parameters can be detected before memory initialization, avoiding the cumbersome operation of modifying, compiling, and rewriting the firmware source code. This is beneficial for the productization of the board, reduces the number of firmware versions to be maintained, and reduces the workload of later maintenance.
[0094] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0095] Reference Figure 6 The diagram illustrates a structural block diagram of a memory parameter modification device according to another embodiment of the present invention, which may specifically include the following modules:
[0096] The request receiving module 301 is used to receive a modification request for a target memory parameter among multiple memory parameters after the firmware is started.
[0097] The request parsing module 302 is used to parse the modification request to obtain the modified value of the target memory parameter and the offset address corresponding to the target memory parameter; wherein, the offset address is the offset of the target memory parameter relative to the starting position corresponding to the plurality of memory parameters;
[0098] Storage module 303 is used to store 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; wherein, the modification identifier is used to identify the memory parameter that has been modified among the plurality of memory parameters.
[0099] In an optional embodiment of the present invention, the storage module is further configured to: store a modification identifier; wherein the modification identifier is used to identify the modified memory parameter among the plurality of memory parameters;
[0100] The device further includes:
[0101] The parameter acquisition module is used to acquire the modified value and offset address of the target memory parameter stored in the ROM according to the modification identifier when the firmware is restarted.
[0102] The parameter modification module is used to modify the target memory parameter to the modified value according to the offset address;
[0103] The parameter writing module is used to write the modified target memory parameters into the register corresponding to the target memory parameters.
[0104] In an optional embodiment of the present invention, the device further includes:
[0105] An initialization module is used to initialize each memory channel of the memory according to the modified value of the target memory parameter before storing the modified value of the target memory parameter in the storage space outside the firmware in the ROM; wherein, the multiple memory channels of the memory are read and written independently.
[0106] A determination module is available to determine if the modified value of the target memory parameter is available if the initialization of each memory channel is successful.
[0107] In an optional embodiment of the present invention, the initialization module includes:
[0108] The modified value writing submodule is used to write the modified value of the target memory parameter to the register corresponding to the target memory parameter in other memory channels when one memory channel is working normally;
[0109] An initialization submodule is used to initialize the other memory channels and obtain feedback information; wherein, the feedback information is used to reflect the initialization result of the memory channel.
[0110] The successful determination submodule is used to determine, based on the feedback information, that the initialization of the other memory channels was successful.
[0111] According to an embodiment of the present invention, after firmware startup, a modification request for a target memory parameter among multiple memory parameters is received. The modification request is parsed to obtain the modified value of the target memory parameter and the corresponding offset address. The offset address is the offset of the target memory parameter relative to the starting position of the multiple memory parameters in the cache. The modified value of the target memory parameter and the offset address are stored in a storage space outside the firmware in the ROM, to replace the target memory parameter in the firmware when the firmware restarts. The modification identifier is used to identify the memory parameter among the multiple memory parameters that has been modified, enabling online modification of memory parameters during board use. This allows for the detection of memory parameter modifications before memory initialization, avoiding the cumbersome operation of modifying, compiling, and rewriting the firmware source code. This facilitates board productization, reduces the number of firmware versions to be maintained, and reduces the workload of later maintenance.
[0112] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0113] Figure 7 This is a structural block diagram illustrating an electronic device 700 for modifying memory parameters according to an exemplary embodiment. For example, the electronic device 700 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0114] Reference Figure 7 The electronic device 700 may include one or more of the following components: a processing component 702, a memory 704, a power supply 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.
[0115] Processing component 702 typically controls the overall operation of electronic device 700, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 702 may include one or more modules to facilitate interaction between processing component 702 and other components. For example, processing component 702 may include a multimedia module to facilitate interaction between multimedia component 708 and processing component 702.
[0116] Memory 704 is configured to store various types of data to support the operation of device 700. Examples of this data include instructions for any application or method operating on electronic device 700, contact data, phonebook data, messages, pictures, videos, etc. Memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, 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 storage, flash memory, magnetic disk, or optical disk.
[0117] Power component 704 provides power to various components of electronic device 700. Power component 704 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 700.
[0118] Multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and the 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 touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 708 includes a front-facing camera and / or a rear-facing camera. When the electronic device 700 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0119] Audio component 710 is configured to output and / or input audio signals. For example, audio component 710 includes a microphone (MIC) configured to receive external audio signals when electronic device 700 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 704 or transmitted via communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.
[0120] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0121] Sensor assembly 714 includes one or more sensors for providing state assessments of various aspects of electronic device 700. For example, sensor assembly 714 may detect the on / off state of device 700, the relative positioning of components such as the display and keypad of electronic device 700, changes in position of electronic device 700 or a component of electronic device 700, the presence or absence of user contact with electronic device 700, orientation or acceleration / deceleration of electronic device 700, and temperature changes of electronic device 700. Sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. 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, sensor assembly 714 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0122] Communication component 716 is configured to facilitate wired or wireless communication between electronic device 700 and other devices. Electronic device 700 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 714 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 714 also includes a near-field communication (NFC) module to facilitate short-range communication. 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.
[0123] 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, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0124] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, which can be executed by a processor 720 of an electronic device 700 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0125] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a terminal's processor, enables the terminal to perform a memory parameter modification method, the method comprising:
[0126] After the firmware starts, it receives a modification request for the target memory parameter among multiple memory parameters;
[0127] The modification request is parsed to obtain the modified value of the target memory parameter and the offset address corresponding to the target memory parameter; wherein, the offset address is the offset of the target memory parameter relative to the starting position of the plurality of memory parameters in the cache;
[0128] The modified value of the target memory parameter and the offset address are stored in a storage space outside the firmware in the ROM, so that they can replace the target memory parameter in the firmware when the firmware is restarted.
[0129] Optionally, the storage space outside the firmware in the ROM, which stores the modified values of the target memory parameters and the offset address, further includes:
[0130] A modification identifier is stored; wherein the modification identifier is used to identify the modified memory parameter among the plurality of memory parameters;
[0131] The method further includes:
[0132] When the firmware restarts, the modified value and offset address of the target memory parameter stored in the ROM are obtained according to the modification identifier.
[0133] Based on the offset address, modify the target memory parameter to the modified value;
[0134] The modified target memory parameters are written into the register corresponding to the target memory parameters.
[0135] Optionally, before storing the modified value of the target memory parameter and the offset address in storage space outside the firmware in the ROM, the method further includes:
[0136] Based on the modified values of the target memory parameters, each memory channel is initialized; wherein, read and write operations are performed independently among the multiple memory channels.
[0137] If the initialization of each memory channel is successful, the modified value of the target memory parameter is determined to be available.
[0138] Optionally, initializing each memory channel according to the modified value of the target memory parameter includes:
[0139] When one memory channel is working normally, the modified value of the target memory parameter is written to the register corresponding to the target memory parameter in other memory channels;
[0140] The other memory channels are initialized to obtain feedback information; wherein the feedback information is used to reflect the initialization result of the corresponding memory channel.
[0141] Based on the feedback information, it is determined that the initialization of the other memory channels was successful.
[0142] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0143] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0144] This invention is 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 block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0145] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0146] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0147] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0148] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0149] The present invention has provided a detailed description of a method and apparatus for modifying memory parameters. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for modifying memory parameters, characterized in that, include: After the firmware starts, it receives a modification request for the target memory parameter among multiple memory parameters; The modification request is parsed to obtain the modified value of the target memory parameter and the offset address corresponding to the target memory parameter; wherein, the offset address is the offset of the target memory parameter relative to the starting position of the plurality of memory parameters in the cache; The modified value of the target memory parameter and the offset address are stored in a storage space outside the firmware in the ROM, so that they can replace the target memory parameter in the firmware when the firmware is restarted.
2. The method according to claim 1, characterized in that, The storage space outside the firmware in the ROM, which stores the modified values of the target memory parameters and the offset address, further includes: A modification identifier is stored; wherein the modification identifier is used to identify the modified memory parameter among the plurality of memory parameters; The method further includes: When the firmware restarts, the modified value and offset address of the target memory parameter stored in the ROM are obtained according to the modification identifier. Based on the offset address, modify the target memory parameter to the modified value; The modified target memory parameters are written into the register corresponding to the target memory parameters.
3. The method according to claim 1, characterized in that, Before storing the modified values of the target memory parameters and the offset address in the storage space outside the firmware in the ROM, the method further includes: Based on the modified values of the target memory parameters, each memory channel is initialized; wherein, read and write operations are performed independently among the multiple memory channels. If the initialization of each memory channel is successful, the modified value of the target memory parameter is determined to be available.
4. The method according to claim 3, characterized in that, The initialization of each memory channel based on the modified value of the target memory parameter includes: When one memory channel is working normally, the modified value of the target memory parameter is written to the register corresponding to the target memory parameter in other memory channels; The other memory channels are initialized to obtain feedback information; wherein the feedback information is used to reflect the initialization result of the corresponding memory channel. Based on the feedback information, it is determined that the initialization of the other memory channels was successful.
5. A memory parameter modification device, characterized in that, include: The request receiving module is used to receive modification requests for the target memory parameter among multiple memory parameters after the firmware is started. The request parsing module is used to parse the modification request to obtain the modified value of the target memory parameter and the offset address corresponding to the target memory parameter; wherein, the offset address is the offset of the target memory parameter relative to the starting position of the plurality of memory parameters in the cache; A storage module is used to store 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.
6. The apparatus according to claim 5, characterized in that, The storage module is further configured to: store a modification identifier; wherein the modification identifier is used to identify the modified memory parameter among the plurality of memory parameters; The device further includes: The parameter acquisition module is used to acquire the modified value and offset address of the target memory parameter stored in the ROM according to the modification identifier when the firmware is restarted. The parameter modification module is used to modify the target memory parameter to the modified value according to the offset address; The parameter writing module is used to write the modified target memory parameters into the register corresponding to the target memory parameters.
7. The apparatus according to claim 5, characterized in that, The device further includes: An initialization module is used to initialize each memory channel of the memory according to the modified value of the target memory parameter before storing the modified value of the target memory parameter in the storage space outside the firmware in the ROM; wherein, the multiple memory channels of the memory are read and written independently. A determination module is available to determine if the modified value of the target memory parameter is available if the initialization of each memory channel is successful.
8. The apparatus according to claim 7, characterized in that, The initialization module includes: The modified value writing submodule is used to write the modified value of the target memory parameter to the register corresponding to the target memory parameter in other memory channels when one memory channel is working normally; An initialization submodule is used to initialize the other memory channels and obtain feedback information; wherein, the feedback information is used to reflect the initialization result of the memory channel. The successful determination submodule is used to determine, based on the feedback information, that the initialization of the other memory channels was successful.
9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-4.
10. A readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform one or more of the memory parameter modification methods as described in claims 1-4.
Citation Information
Patent Citations
Memory initialization device and method and computer system
CN113867803A
Memory parameter adjustment method and device, equipment and medium
CN114281538A
Firmware management method and device, storage medium and electronic equipment
CN114594975A