DDR adaptive method, apparatus and computer-readable storage medium

By setting multiple memory capacity in the bootargs file, the problem that devices of different DDR sizes cannot share the same upgrade package is solved, and the shared configuration of DDR capacity size is realized, which simplifies development and testing and reduces maintenance costs.

CN112732186BActive Publication Date: 2024-12-10SHENZHEN SKYWORTH RGB ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011644029.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-31
Publication Date
2024-12-10
Estimated Expiration
2040-12-31

AI Technical Summary

Technical Problem

DDRs of different sizes require software to configure different DDR register tables, which makes it impossible for host models and derived models to share the same upgrade package, which increases the cost of product software development and maintenance.

Method used

By obtaining the preset bootargs file, confirm the memory capacity of the DDR to be configured, and set multiple memory capacity in the bootargs file, so that multiple DDRs with different memory capacity can share the same application file, and load the target bootargs file to change the memory configuration of the DDR parameter.

Benefits of technology

The DDR with multiple DDR capacity sizes is implemented to share a configuration file, which reduces the number of branches, simplifies development and testing, improves development efficiency, reduces software maintenance costs, and saves human resources and time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112732186B_ABST
    Figure CN112732186B_ABST
Patent Text Reader

Abstract

The present invention discloses a DDR adaptive method, including obtaining a preset bootargs file, wherein the preset bootargs file is obtained by loading a default DDR reg file; confirming the memory capacity of the DDR to be configured, setting the preset bootargs file according to the memory capacity to form a target bootargs file; loading the target bootargs file to change the memory configuration parameters of the DDR to be configured. The present invention also discloses a device and a computer-readable storage medium. The present invention sets the configuration parameters of bootargs so that DDRs of multiple DDR capacity sizes share a configuration file, thereby reducing the number of branches, simplifying development, and improving development and testing efficiency, while providing basic conditions for rapid iteration and upgrading of software.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data storage, and in particular to a DDR self-adaptation method, device and computer-readable storage medium. Background Art

[0002] As one of the mainstream operating systems for smart devices today, Android system has an increasing market share and a wider range of influence due to its open source nature. With the continuous progress and development of Android smart devices, users' requirements for Android smart devices vary greatly. Based on the positioning of different products, device manufacturers often configure different sizes of DDR for a series of products, the host model and multiple derivative models to meet the needs of different users. In the past, for different sizes of DDR, different DDR register tables needed to be configured by software, which required different software to adapt DDR, so that the host model and multiple derivative models could not share the same upgrade package, which increased the cost of product software development and maintenance.

[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of the present invention is to provide a DDR adaptive method, device and computer-readable storage medium, aiming to solve the technical problem that for DDRs of different sizes, different DDR register tables need to be configured by software and different software needs to be applied to adapt DDR, so that the host model and multiple derived models cannot share the same upgrade package, which increases the cost of product software development and maintenance.

[0005] To achieve the above object, the present invention provides a DDR self-adaptation method, comprising the following contents:

[0006] Obtain a preset bootargs file, wherein the preset bootargs file is obtained by loading a default DDR reg file;

[0007] Confirm the memory capacity of the DDR to be configured, and set the preset bootargs file according to the memory capacity to form a target bootargs file;

[0008] Load the target bootargs file to change the memory configuration parameters of the DDR to be configured

[0009] Optionally, the step of setting the preset bootargs file according to the memory capacity to form a target bootargs file includes:

[0010] Calling the setenv function, and setting the memory capacity to the file parameter of the preset bootargs file through the called setenv function;

[0011] Forms a target bootargs file based on a preset bootargs file with changed file parameters.

[0012] Optionally, the DDR adaptive method further includes:

[0013] A default DDR reg file of the DDR to be configured is obtained, and a preset bootargs file is generated using the DDR reg file.

[0014] Optionally, the step of generating a preset bootargs file using the DDR reg file includes:

[0015] Generate a corresponding reg file from the default DDR reg file;

[0016] Compile the reg file with boot, and generate a preset bootargs file according to the compilation result.

[0017] Optionally, after the step of generating a preset bootargs file using the DDR reg file, the method further includes:

[0018] Get compatible parameters of the DDR to be configured;

[0019] The parameter configuration of the preset bootargs file is updated through the compatible parameters.

[0020] Optionally, the step of obtaining compatible parameters of the DDR to be configured includes:

[0021] Acquire the memory capacity of the DDR to be configured, where the memory capacity is the memory capacity of one or more DDRs to be configured;

[0022] Generate compatible parameters with the stated memory capacity.

[0023] Optionally, the DDR adaptive method further includes:

[0024] Get the cfg.mak file;

[0025] Delete the DDR memory configuration parameters of the cfg.mak file.

[0026] Optionally, the DDR adaptive method further includes:

[0027] Change the lunch mk configuration of the current terminal system;

[0028] Point the configuration to the default DDR reg file.

[0029] In addition, to achieve the above-mentioned purpose, the present invention also provides a DDR adaptive device, which includes: a memory, a processor, and a DDR adaptive program stored in the memory and executable on the processor, and the DDR adaptive program implements the steps of the DDR adaptive method described above when executed by the processor.

[0030] To achieve the above objectives, the present invention also provides a computer-readable storage medium, which includes: a memory, a processor, and a DDR adaptive program stored in the memory and executable on the processor, wherein the DDR adaptive program implements the steps of the DDR adaptive method described above when executed by the processor.

[0031] The present invention proposes a DDR adaptive method, which obtains a preset bootargs file, which is obtained by loading a default DDR reg file; confirms the memory capacity of the DDR to be configured, sets the preset bootargs file according to the memory capacity to form a target bootargs file; loads the target bootargs file to change the memory configuration parameters of the DDR to be configured. The present invention sets multiple memory capacities in the bootargs file so that multiple DDRs with different memory capacities can share the same application file, solving the technical problem that the host model and multiple derived models cannot share the same upgrade package of DDR size. By setting the configuration parameters of bootargs, DDRs of multiple DDR capacity sizes share a configuration file, reducing the number of branches, simplifying development, improving development and testing efficiency, and providing basic conditions for rapid iterative upgrades of software. The software maintenance cost is reduced, and a considerable amount of human resources and time costs are saved and optimized for the research and development, design, testing and review, and burning verification of televisions. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a schematic diagram of the terminal\device structure of the hardware operating environment involved in the embodiment of the present invention;

[0033] Figure 2 It is a flowchart of the first embodiment of the DDR adaptive method of the present invention;

[0034] Figure 3 FIG. 4 is a flow chart of a second embodiment of a DDR adaptive method according to the present invention.

[0035] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0036] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0037] The main solution of the embodiment of the present invention is: obtaining a preset bootargs file, which is obtained by loading a default DDR reg file; confirming the memory capacity of the DDR to be configured, setting the preset bootargs file according to the memory capacity to form a target bootargs file; loading the target bootargs file to change the memory configuration parameters of the DDR to be configured.

[0038] The existing technical problem of upgrading DDR with different memory capacities requires software to configure different DDR register tables and apply different software to adapt DDR, which makes it impossible for the host model and multiple derivative models to share the same upgrade package, increasing the cost of product software development and maintenance.

[0039] The present invention provides a solution, by setting multiple memory capacities in the bootargs file, multiple DDRs with different memory capacities can share the same application file, solving the technical problem that the host model and multiple derived models cannot share the same upgrade package with different DDR sizes, and by setting the configuration parameters of bootargs, multiple DDRs with different DDR capacity sizes can share a configuration file, thereby reducing the number of branches, simplifying development, improving development and testing efficiency, and providing basic conditions for rapid iteration and upgrading of software. The software maintenance cost is reduced, and considerable human resources and time costs are saved and optimized for the research and development design, test review, burning verification, etc. of television sets.

[0040] like Figure 1 As shown, Figure 1 It is a schematic diagram of the terminal\device structure of the hardware operating environment involved in the embodiment of the present invention.

[0041] The terminal in the embodiment of the present invention may be a PC, or may be a mobile or non-mobile terminal device such as a smart phone, a tablet computer, an e-book reader, or a portable computer.

[0042] like Figure 1As shown, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0043] Those skilled in the art will understand that Figure 1 The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0044] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a DDR adaptive program.

[0045] exist Figure 1 In the terminal shown, the network interface 1004 is mainly used to connect to the backend server and perform data communication with the backend server; the user interface 1003 is mainly used to connect to the client (user end) and perform data communication with the client; and the processor 1001 can be used to call the DDR adaptive program stored in the memory 1005 and perform the following operations:

[0046] Obtain a preset bootargs file, wherein the preset bootargs file is obtained by loading a default DDR reg file;

[0047] Confirm the memory capacity of the DDR to be configured, and set the preset bootargs file according to the memory capacity to form a target bootargs file;

[0048] The target bootargs file is loaded to change the memory configuration parameters of the DDR to be configured.

[0049] Further, the processor 1001 may call the DDR adaptive program stored in the memory 1005, and further perform the following operations:

[0050] Calling the setenv function, and setting the memory capacity to the file parameter of the preset bootargs file through the called setenv function;

[0051] Forms a target bootargs file based on a preset bootargs file with changed file parameters.

[0052] Further, the processor 1001 may call the DDR adaptive program stored in the memory 1005, and further perform the following operations:

[0053] A default DDR reg file of the DDR to be configured is obtained, and a preset bootargs file is generated using the DDR reg file.

[0054] Further, the processor 1001 may call the DDR adaptive program stored in the memory 1005, and further perform the following operations:

[0055] Generate a corresponding reg file from the default DDR reg file;

[0056] Compile the reg file with boot, and generate a preset bootargs file according to the compilation result.

[0057] Further, the processor 1001 may call the DDR adaptive program stored in the memory 1005, and further perform the following operations:

[0058] Get compatible parameters of the DDR to be configured;

[0059] The parameter configuration of the preset bootargs file is updated through the compatible parameters.

[0060] Further, the processor 1001 may call the DDR adaptive program stored in the memory 1005, and further perform the following operations:

[0061] Acquire the memory capacity of the DDR to be configured, where the memory capacity is the memory capacity of one or more DDRs to be configured;

[0062] Generate compatible parameters with the stated memory capacity.

[0063] Further, the processor 1001 may call the DDR adaptive program stored in the memory 1005, and further perform the following operations:

[0064] Get the cfg.mak file;

[0065] Delete the DDR memory configuration parameters of the cfg.mak file.

[0066] Further, the processor 1001 may call the DDR adaptive program stored in the memory 1005, and further perform the following operations:

[0067] Change the lunch mk configuration of the current terminal system;

[0068] Point the configuration to the default DDR reg file.

[0069] Reference Figure 2 , Figure 2 This is a flow chart of a first embodiment of a DDR adaptive method according to the present invention. The DDR adaptive method includes:

[0070] Step S10, obtaining a preset bootargs file, wherein the preset bootargs file is obtained by loading a default DDR reg file;

[0071] Based on the current DDR (Double Data Rate, DDR SDRAM=double data rate synchronous dynamic random access memory) configuration requirements, after the current application terminal is started, a preset bootargs file is loaded to obtain a configuration file for configuring the DDR, wherein the application terminal is a terminal device for implementing the current DDR configuration, and in the terminal device, relevant function settings are configured to implement the current DDR configuration operation. Generally, the terminal device function settings based on the DDR configuration operation include changing the system file content of the terminal device to point to the default DDR reg file loading, in order to obtain the preset bootargs file for configuring the DDR. In actual applications, the operation of changing the system file content of the terminal device to point to can be shown as follows, and the DDR adaptive method also includes:

[0072] Change the lunch mk configuration of the current terminal system;

[0073] Point the configuration to the default DDR reg file.

[0074] Based on the current DDR configuration operation, change the lunch mk file of the terminal device currently configured. For example, if the same terminal system is used and the models are packaged together, W81 and W81P share a lunch, and the lunch mk configuration is as follows:

[0075] Select the default 3G DDR reg configuration file, because the minimum memory of the two models W81 and W81P is 3G:

[0076] EMMC_BOOT_REG_NAME:=

[0077] hi3751v811dmo_4layer_cpu1500m_DDR4_2133_3072m_1024mch0_2048mch1.reg

[0078] In addition, with regard to the DDR settings of the current terminal device, before changing the content of lunch mk to point to the default DDRreg file, it is necessary to delete the original DDR-related configuration parameters of the terminal device in order to automatically identify the DDR capacity size. Therefore, the DDR adaptive method further includes:

[0079] Get the cfg.mak file;

[0080] Delete the DDR memory configuration parameters of the cfg.mak file.

[0081] In the current terminal device, the system file modification related to the DDR memory configuration parameters based on the DDR memory parameter registration is obtained in the terminal system file. In actual applications, the changes in the terminal system file exist in the form of configuration items. Therefore, the file for deleting the DDR memory configuration parameters takes a 3G DDR device as an example. The configuration item in the terminal system file is defined as CFG_MEM_3G=y. According to the determined configuration item, CFG_MEM_3G=y is set, and the configuration item related to the CFG_MEM_3G and the DDR memory is deleted. In this way, when the terminal system starts to load the DDR reg file, the terminal device application system will automatically identify the DDR size, and the kernel will obtain the DDR related parameters from the bootargs of the boot for configuration to achieve DDR adaptation.

[0082] As shown above, according to the relevant configuration operations of the current terminal device system, based on the currently configured preset bootargs file, after the default DDR reg configuration file is loaded at the earliest stage of the terminal device boot, the DDR reg file name is as follows:

[0083] hi3751v811dmo_4layer_cpu1500m_DDR4_2133_3072m_1024mch0_2048mch1.reg

[0084] According to the preset bootargs file pointing information pre-registered in the default DDR reg file, the corresponding preset bootargs file is obtained and loaded, and the file name of the preset bootargs file is defined as bootargs_Hi3751V811-64bit_security.txt file in the terminal device.

[0085] Step S20, confirming the memory capacity of the DDR to be configured, and setting the preset bootargs file according to the memory capacity to form a target bootargs file;

[0086] Based on the current DDR to be configured, defined as the DDR to be configured, the memory capacity of the DDR to be configured is confirmed, and the relevant parameter content of the preset bootargs file is set according to the memory capacity. When the system application file of the terminal device is changed, the relevant function needs to be changed, that is, the step of setting the preset bootargs file according to the memory capacity to form a target bootargs file includes:

[0087] Calling the setenv function, and setting the memory capacity to the file parameter of the preset bootargs file through the called setenv function;

[0088] Forms a target bootargs file based on a preset bootargs file with changed file parameters.

[0089] Based on the current DDR configuration requirements, the setenv function is called based on program operation to change the file parameters of the preset bootargs file. The setenv function is a Linux application function used to change or increase the content of environment variables. The file parameters of the bootargs file are reset by setenv to realize the configuration of DDR parameters. The change method takes W81 as an example. For example, if the memory of W81 is 3G, the mem=3Gdma_zone=2G, mmz=ddr,0,1972M,72M configuration parameters obtained from bootargs_Hi3751V811-64bit_security.txt will be set to the end of bootargs to update bootargs; if the memory of W81P is 4G, the mem=4G,3584M@0x0,512M@0x100000000dma_zone=3584M obtained from bootargs_Hi3751V811-64bit_security.txt will be set to the end of bootargs. mmz=ddr,0,1972M,72M configuration parameter is set to the end of bootargs, and bootargs is updated. The updated bootargs file is used as the target bootargs file to implement the current DDR memory configuration update.

[0090] Step S30, loading the target bootargs file to change the memory configuration parameters of the DDR to be configured.

[0091] According to the updated target bootargs file, the target bootargs file is loaded to change the memory configuration parameters of the DDR to be configured. In actual applications, the method of loading the target bootargs file is the system file loading method when the application system of the terminal device is started, which involves the relevant configuration parameter content in the target bootargs file. The DDR memory configuration parameter changes achieved by loading the target bootargs file are related to the relevant configuration parameters configured in the target bootargs file. Therefore, in the case of registering multiple DDR related configuration parameter contents in the target bootargs file, the DDR whose memory configuration parameters are changed by loading the target bootargs file includes one or more.

[0092] In this embodiment, by setting multiple memory capacities in the bootargs file, multiple DDRs with different memory capacities can share the same application file, solving the technical problem that the host model and multiple derived models cannot share the same upgrade package with different DDR sizes. By setting the configuration parameters of bootargs, multiple DDR capacity sizes of DDR can share a configuration file, reducing the number of branches, simplifying development, improving development and testing efficiency, and providing basic conditions for rapid iteration and upgrading of software. The software maintenance cost is reduced, and considerable human resources and time costs are saved and optimized for the research and development, design, testing and review, and burning verification of televisions.

[0093] Reference Figure 3 , Figure 3 This is a flow chart of the second embodiment of the DDR adaptive method of the present invention. Figure 2 In the first embodiment shown, the DDR adaptive method further includes:

[0094] Step S40, obtaining a default DDR reg file of the DDR to be configured, and generating a preset bootargs file with the DDR reg file.

[0095] Step S50, obtaining compatible parameters of the DDR to be configured;

[0096] Step S60: updating the parameter configuration of the preset bootargs file through the compatible parameters.

[0097] Based on the DDR to be configured of the current terminal device, a default DDR reg file of the DDR to be configured is obtained, the default DDR reg file is a default configuration file based on the DDR to be configured, and is used to load when the terminal system is enabled to apply the DDR, and the default DDR reg file is a system application file based on the terminal device. After obtaining the default DDR reg file, a preset bootargs file is generated with the default DDR reg file, that is, the step of generating a preset bootargs file with the DDR reg file includes:

[0098] Generate a corresponding reg file from the default DDR reg file;

[0099] Compile the reg file with boot, and generate a preset bootargs file according to the compilation result.

[0100] In actual application, when the corresponding reg file is generated by the default DDR reg file, the default DDR reg file is used as a system file loaded when the terminal device is used in the system application, and can also be defined as a system application file, that is, a sysreg file. The sysreg file is used to describe basic SOC operation information such as CPU configuration and DDR configuration when the application system of the terminal device is enabled, and is used to boot to configure the main chip in the early stage so that the application system of the terminal device can run normally. In actual terminal device applications, there are generally several different typical configurations, and a sysreg file with a typical configuration is provided according to information such as chip model, CPU frequency, DDR frequency, DDR capacity, each DDR PHY capacity, storage medium, etc. The files generated based on the default DDRreg file include two, that is, the reg files generated based on the DDR reg (sysreg) file include two, one is an excel file, and the other is a reg file manually generated based on the excel file. When applied, the system compilation (boot) of the terminal system is used to compile the reg file into the boot for use, so the file that truly realizes the application is the reg file manually generated based on the Excel file. After the application system is compiled based on the current terminal device, that is, after the reg file is compiled with boot, a preset bootargs file is generated based on the compilation result.

[0101] Further, in the preset bootargs file generated based on the default DDR reg file of the current terminal device DDR, the parameter configuration of the current multiple DDRs is involved, and the preset bootargs file generated is updated with the compatible parameters of the current DDR to be configured. The compatible parameters are defined as standard format parameter information applicable to the content of the preset bootargs file generated by the memory capacity of the current DDR to be configured. Therefore, the step of obtaining the compatible parameters of the DDR to be configured includes:

[0102] Acquire the memory capacity of the DDR to be configured, where the memory capacity is the memory capacity of one or more DDRs to be configured;

[0103] Generate compatible parameters with the stated memory capacity.

[0104] Based on the currently generated preset bootargs file, compatible parameters are generated with the memory capacity of the current DDR to be configured to update the parameter configuration in the preset bootargs file to implement the memory configuration parameter change of the DDR to be configured. In actual application, the configuration update operation of the bootargs file is performed by generating compatible parameters with the memory capacity of the DDR to be configured. The relevant steps of the update operation can be described as follows:

[0105] BOOT_ARGS_FILE:=$(DEVICE_DIR_PATH) / etc / bootargs_Hi3751V811-64bit_security.txt

[0106] Taking the DDR to be configured with a memory capacity of 1.5G, 2G, 3G, and 4G as an example, when configuring the bootargs parameter for compatible DDR capacity of 1.5G (1536M), 2G, 3G, and 4G, the corresponding bootargs_Hi3751V811-64bit_security.txt file is changed as follows:

[0107] mem_1536M=mem=1536M mmz=ddr,0,0,72M

[0108] mem_2G=mem=2G mmz=ddr,0,0,72M

[0109] mem_3G=mem=3G dma_zone=2G mmz=ddr,0,1972M,72M

[0110] mem_4G=mem=4G,3584M@0x0,512M@0x100000000

[0111] dma_zone=3584M mmz=ddr,0,1972M,72M

[0112] bootargs=selinux=1

[0113] Due to the reasons for loading the terminal device application system, the memory size cannot be specified in the bootargs file. You need to change bootargs=mem=3072M to bootargs=selinux=1

[0114] in:

[0115] mem_1536M=mem=1536M mmz=ddr,0,0,72M

[0116] mem_2G=mem=2G mmz=ddr,0,0,72M

[0117] mem_3G=mem=3G dma_zone=2G mmz=ddr,0,1972M,72M

[0118] mem_4G=mem=4G,3584M@0x0,512M@0x100000000

[0119] dma_zone=3584M mmz=ddr,0,1972M,72M

[0120] The parameter configuration update operation of the preset bootargs file as described above is compatible with bootargs parameters of different DDR sizes of 1.5G (1536M), 2G, 3G, and 4G in the preset bootargs file, where:

[0121] mem_4G=mem=4G,3584M@0x0,512M@0x100000000

[0122] dma_zone=3584M mmz=ddr,0,1972M,72M

[0123] In addition, the parameters of the above configuration parameter update operation can be defined as follows:

[0124] dma_zone=3584M is the maximum address range of the dma zone;

[0125] mem indicates the entire DDR memory capacity;

[0126] The memory is divided into OS memory and MMZ memory. OS memory is used by the system, and MMZ memory is used for local media.

[0127] MMZ is the area size based on the mmz area, for example, mmz=ddr,0,1972M,72M means that the starting address 1972M and the size 72M are reserved in the entire mem for MMZ use, and the rest is allocated to system memory use. Since the setting content of the mmz parameter is based on the memory application parameter when the terminal device is turned on, it needs to be set according to the specific memory capacity of the current terminal device DDR, otherwise it will fail to boot due to the failure of HIFB0 memory application at boot time.

[0128] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a DDR adaptive program is stored. When the DDR adaptive program is executed by a processor, the following operations are implemented:

[0129] Obtain a preset bootargs file, wherein the preset bootargs file is obtained by loading a default DDR reg file;

[0130] Confirm the memory capacity of the DDR to be configured, and set the preset bootargs file according to the memory capacity to form a target bootargs file;

[0131] The target bootargs file is loaded to change the memory configuration parameters of the DDR to be configured.

[0132] Furthermore, when the DDR adaptive program is executed by the processor, the following operations are also implemented:

[0133] Calling the setenv function, and setting the memory capacity to the file parameter of the preset bootargs file through the called setenv function;

[0134] Forms a target bootargs file based on a preset bootargs file with changed file parameters.

[0135] Furthermore, when the DDR adaptive program is executed by the processor, the following operations are also implemented:

[0136] A default DDR reg file of the DDR to be configured is obtained, and a preset bootargs file is generated using the DDR reg file.

[0137] Furthermore, when the DDR adaptive program is executed by the processor, the following operations are also implemented:

[0138] Generate a corresponding reg file from the default DDR reg file;

[0139] Compile the reg file with boot, and generate a preset bootargs file according to the compilation result.

[0140] Furthermore, when the DDR adaptive program is executed by the processor, the following operations are also implemented:

[0141] Get compatible parameters of the DDR to be configured;

[0142] The parameter configuration of the preset bootargs file is updated through the compatible parameters.

[0143] Furthermore, when the DDR adaptive program is executed by the processor, the following operations are also implemented:

[0144] Acquire the memory capacity of the DDR to be configured, where the memory capacity is the memory capacity of one or more DDRs to be configured;

[0145] Generate compatible parameters with the stated memory capacity.

[0146] Furthermore, when the DDR adaptive program is executed by the processor, the following operations are also implemented:

[0147] Get the cfg.mak file;

[0148] Delete the DDR memory configuration parameters of the cfg.mak file.

[0149] Furthermore, when the DDR adaptive program is executed by the processor, the following operations are also implemented:

[0150] Change the lunch mk configuration of the current terminal system;

[0151] Point the configuration to the default DDR reg file.

[0152] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, drug or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, drug or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, drug or system including the element.

[0153] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0154] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0155] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A DDR adaptive method, characterized in that: The DDR adaptive method comprises the following steps: Obtain a preset bootargs file, wherein the preset bootargs file is obtained by loading a default DDR reg file; Confirm the memory capacity of the DDR to be configured, call the setenv function, and set the memory capacity to the file parameter of the preset bootargs file through the called setenv function; Form a target bootargs file based on the preset bootargs file with changed file parameters; Loading the target bootargs file to change the memory configuration parameters of the DDR to be configured; The DDR adaptive method further comprises: Change the lunch mk configuration of the current terminal system; Point the configuration to the default DDR reg file; The DDR adaptive method further comprises: Get the cfg.mak file; Delete the DDR memory configuration parameters of the cfg.mak file; The step of generating a preset bootargs file using the DDR reg file comprises: Generate a corresponding reg file from the default DDR reg file; Compile the reg file with boot, and generate a preset bootargs file according to the compilation result; After the step of generating a preset bootargs file with the DDR reg file, the method further includes: Get compatible parameters of the DDR to be configured; Update the parameter configuration of the preset bootargs file through the compatible parameters; The step of obtaining compatible parameters of the DDR to be configured includes: Acquire the memory capacity of the DDR to be configured, where the memory capacity is the memory capacity of one or more DDRs to be configured; Generate compatible parameters with the stated memory capacity.

2. The DDR adaptive method according to claim 1, characterized in that: The step of generating a preset bootargs file using the DDR reg file comprises: Generate a corresponding reg file from the default DDR reg file; Compile the reg file with boot, and generate a preset bootargs file according to the compilation result.

3. A DDR adaptive device, characterized in that: The DDR adaptive device comprises: a memory, a processor, and a DDR adaptive program stored in the memory and executable on the processor. When the DDR adaptive program is executed by the processor, the steps of the DDR adaptive method according to any one of claims 1 to 2 are implemented.

4. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises: a memory, a processor, and a DDR adaptive program stored in the memory and executable on the processor, wherein the DDR adaptive program implements the steps of the DDR adaptive method according to any one of claims 1 to 2 when executed by the processor.