Method and apparatus for enabling device spreading
Patent Information
- Application Number
- CN202311541742.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-17
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-11-17
AI Technical Summary
[0006]本发明实施例提供了一种开启设备展频的方法及装置,以至少解决相关技术中手动开启展频效率低的问题
[0020]通过本发明,通过在目标设备的配置空间中读取目标设备的目标身份标识,根据目标身份标识确定展频选项值,展频选项值用于指示目标设备是否开启展频;在展频选项值为目标值的情况下,开启目标设备的展频。在开启所述目标设备的展频之后,将目标值写入南桥;在展频选项值不是目标值的情况下,将展频选项值写入所述南桥。
Smart Images

Figure CN117767977B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wireless communication, and more specifically, to a method and apparatus for enabling device spread spectrum. Background Technology
[0002] Spread spectrum is a technique that broadens a signal in the frequency domain, improving the reliability, interference immunity, and security of communication systems. By expanding the signal's distribution in the spectrum, spread spectrum technology provides a more efficient and reliable solution for wireless communication in everyday life.
[0003] Spread spectrum technology is widely used in many communication systems. In systems such as Wireless Local Area Networks (WLANs), Bluetooth, and CDMA, spreading spectrum technology enables multiple users to transmit data simultaneously, improving system throughput and reliability. Furthermore, spreading spectrum technology can also be used in military communications, radar systems, and broadband wireless access. In these scenarios, spreading spectrum technology can better resist interference and eavesdropping attacks, ensuring the security and stability of communications.
[0004] Currently, spreading can only be enabled or disabled by modifying the BIOS (Basic Input Output System) setup option "SB Clock Spread Spectrum". The spreading option value is written to the southbridge during the UEFI (Unified Extensible Firmware Interface) PEI stage and cannot be changed once it takes effect. Spreading is disabled by default. If any device exceeds radiation limits, spreading must be manually enabled in the setup. For example, some older devices, such as the Samsung PM9A3 hard drive, were found to have excessive radiation in EMC radiation tests. The solution is to manually enable spreading in the setup. This method is effective when there is only one device. However, if the factory ships in batches, it is impossible to manually modify the option one by one, causing production delays.
[0005] There is currently no effective solution to the above problems. Summary of the Invention
[0006] This invention provides a method and apparatus for enabling device spread spectrum, thereby at least solving the problem of low efficiency in manually enabling spread spectrum in related technologies.
[0007] According to an embodiment of the present invention, a method for enabling device spread spectrum is provided, comprising: reading a target identity identifier of the target device in the configuration space of the target device; determining a spread spectrum option value based on the target identity identifier, wherein the spread spectrum option value is used to indicate whether the target device enables spread spectrum; enabling spread spectrum of the target device when the spread spectrum option value is a target value; writing the target value to the southbridge after enabling spread spectrum of the target device; and writing the spread spectrum option value to the southbridge when the spread spectrum option value is not the target value.
[0008] In one exemplary embodiment, reading the target identity identifier of the target device in the configuration space of the target device includes: reading offsets 0, 1, 2, and 3 in the configuration space of the target device; determining the device identifier of the target device based on offsets 0 and 1, wherein the target identity identifier includes the device identifier; and determining the manufacturer identifier of the target device based on offsets 2 and 3, wherein the target identity identifier includes the manufacturer identifier.
[0009] In one exemplary embodiment, determining the spread spectrum option value based on the target identity identifier includes: determining that the target identity identifier is valid when neither the device identifier of the target device nor the manufacturer identifier of the target device is equal to a preset parameter value; and determining the spread spectrum option value based on the target identity identifier when the target identity identifier is valid.
[0010] In one exemplary embodiment, determining the spread spectrum option value based on the target identity identifier includes: setting the spread spectrum option value to the target value when the target identity identifier is the same as a preset identity identifier; and setting the spread spectrum option value to a default value when the target identity identifier is different from the preset identity identifier.
[0011] In an exemplary embodiment, before reading the target identity identifier of the target device in the configuration space of the target device, the method further includes: obtaining a target parameter set, wherein the target parameter set includes the bus number, device number, and function number of the target device; and initializing the configuration space of the target device using the target parameter set.
[0012] In one exemplary embodiment, initializing the configuration space of the target device using the target parameter set includes: determining the memory space address of the root node where the target device is located based on the target parameter set; accessing the configuration space of the memory space address; and initializing the configuration space of the target device based on the configuration space of the memory space address.
[0013] In one exemplary embodiment, initializing the configuration space of the target device based on the configuration space of the memory space address includes: reading offsets 0, 1, 2, and 3 in the configuration space of the memory space address; determining the device identifier of the root node based on offset 0 and offset 1; determining the vendor identifier of the root node based on offset 2 and offset 3; determining whether the root node is valid based on the device identifier and vendor identifier of the root node; and initializing the configuration space of the target device if the root node is valid.
[0014] In an exemplary embodiment, determining whether the root node is valid based on the device identifier and the manufacturer identifier of the root node includes: determining that the root node is valid when neither the device identifier nor the manufacturer identifier of the root node is equal to a preset parameter value.
[0015] In one exemplary embodiment, when the root node is valid, the configuration space of the target device is initialized, including: writing the bus number of the target device to an offset of 0x19 in the configuration space of the memory space address.
[0016] In one exemplary embodiment, the method for enabling device spread spectrum is applied to an AMD platform.
[0017] According to another embodiment of the present invention, an apparatus for enabling device spread spectrum is provided, comprising: a reading module for reading a target identity identifier of the target device in a configuration space of the target device; a determining module for determining a spread spectrum option value based on the target identity identifier, wherein the spread spectrum option value is used to indicate whether the target device enables spread spectrum; an enabling module for enabling spread spectrum of the target device when the spread spectrum option value is a target value; a first writing module for writing the target value to a southbridge after enabling spread spectrum of the target device; and a second writing module for writing the spread spectrum option value to the southbridge when the spread spectrum option value is not the target value.
[0018] According to yet another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program, when executed by a processor, implements the steps of the method described in any of the preceding claims.
[0019] According to yet another embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0020] This invention involves reading the target device's target identity identifier from its configuration space, determining a spread spectrum option value based on the target identity identifier, and using the spread spectrum option value to indicate whether the target device should enable spread spectrum. If the spread spectrum option value is a target value, spread spectrum is enabled on the target device. After enabling spread spectrum on the target device, the target value is written to the southbridge; if the spread spectrum option value is not a target value, the spread spectrum option value is written to the southbridge.
[0021] Because this application determines whether to enable spreading based on the target device's identity before the spreading option value is written to the southbridge, it avoids the inefficiency problem in existing technologies where the spreading option value cannot be changed after it is written to the southbridge and requires manual setup to enable spreading. This achieves the goal of automatically enabling spreading and improves the efficiency of spreading activation. Attached Figure Description
[0022] Figure 1 A hardware structure block diagram of a mobile terminal for enabling device spread spectrum method according to an embodiment of the present invention;
[0023] Figure 2 This is a flowchart of a device spread spectrum activation method according to an embodiment of the present invention;
[0024] Figure 3 This is a flowchart according to an embodiment of the present invention;
[0025] Figure 4 This is a structural block diagram of the opening device spread spectrum apparatus according to an embodiment of the present invention. Detailed Implementation
[0026] The following is an explanation of the English abbreviations used in this application:
[0027] BIOS: Basic Input Output System, generally referring to UEFI.
[0028] UEFI: Unified Extensible Firmware Interface.
[0029] SMU: System Management Unit.
[0030] POST: Power On Self Test.
[0031] Spread spectrum technology has two main methods: spread spectrum and frequency hopping. Spread spectrum technology expands the signal's spectrum to several times or even more than the original bandwidth by multiplying the original signal with a high-speed pseudo-random code. Spread spectrum signals exhibit high spatial complexity, making it difficult for other users or interfering signals to demodulate correctly, thus providing good anti-interference performance. Frequency hopping technology, on the other hand, continuously switches frequencies according to a certain pattern when transmitting data, causing the signal to be distributed in both the time and frequency domains, thereby improving the system's security and anti-interference capability.
[0032] The PCIe architecture defines four address spaces: configuration space, memory space, IO space, and message space.
[0033] Configuration Space: Each PCIe Function has 4KB of configuration space. The first 256 bytes are PCI-compatible configuration space, and the remainder is PCIe Extended Configuration Space. The PCIe configuration space address range is 0x000 to 0xfff. Software can use the configuration space to control and check the device's status. The PCIe Enhanced Configuration Access Mechanism (ECAM) is a mechanism for accessing the PCIe configuration space. It maps the PCIe configuration space to the MEM space, allowing access to the configuration space via the MEM. The PCIe Extended Configuration Space can only be accessed through the ECAM mechanism.
[0034] I / O Space: PCIe supports I / O space for compatibility with legacy devices that require it. Future revisions to the PCIe specification may deprecate the use of I / O space.
[0035] Memory space: The address space for accessing memory, also known as the MMio space. PCIe can support a maximum of 64 bits of memory addresses.
[0036] Message space: The Message space is used to report in-band messages and events, such as error messages and power management messages.
[0037] The PCIe (Peripheral Component Interconnect Express) configuration space refers to a memory area in a PCIe device used to store and manage device-related information. Each PCIe device has its own configuration space, which contains identifying information such as the device's vendor ID, device ID, and subsystem ID, as well as detailed parameters such as the device's functional characteristics, resource allocation, and interrupt settings.
[0038] The configuration space is 256 bytes in size and is divided into multiple registers, each with a specific function and meaning. By reading and writing these registers, the system can obtain and configure various attributes and characteristics of the device, such as device type, speed mode, and transmission protocol. Simultaneously, the configuration space also contains important information required by the device driver, such as port base address and interrupt number.
[0039] The configuration space is accessed via the PCIe bus and is device-independent. It provides a standardized interface that allows the operating system and software to communicate and interact with PCIe devices. Through the configuration space, the system can initialize, identify, and control devices, ensuring their normal operation and coordination.
[0040] The PCIe bus address space needs to be mapped to the memory domain's memory address space during initialization for easy processor access. When configuring the PCI bus, the system software first obtains the initialization information of the BAR register, and then writes the appropriate base address into the corresponding BAR register according to the processor system configuration. This process is completed during the BIOS runtime and OS boot phases. The system software can also use this register to obtain the length of the BAR space used by the PCI device by writing 0xFFFF FFFF to the BAR register and then reading the register.
[0041] MMIO (Memory Mapping I / O) is part of the PCIe specification. In MMIO, I / O devices are placed in memory space instead of I / O space. From the processor's perspective, memory-mapped I / O accesses system devices in the same way as memory. This allows access to the frame buffer on AGP / PCI-E graphics cards, the BIOS, and PCIe devices to be accomplished using the same assembly instructions as reading and writing memory, simplifying program design and reducing interface complexity. I / O, as a channel for communication between the CPU and peripherals, is mainly divided into two types: Port I / O and MMIO (Memory Mapping I / O). In short, MMIO maps peripheral devices to memory space, facilitating CPU access.
[0042] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and examples.
[0043] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0044] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for enabling a device spread spectrum method according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0045] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the device spread spectrum method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0046] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0047] This embodiment provides a device spread spectrum enabling method running on the aforementioned mobile terminal. Figure 2 This is a flowchart illustrating the process of enabling dynamic spread spectrum according to an embodiment of the present invention. The method for enabling device spread spectrum is applied to the AMD platform, such as... Figure 2 As shown, the process includes the following steps:
[0048] Step S202: Read the target identity identifier of the target device from the configuration space of the target device;
[0049] The target device mentioned above can be a PCIe device. The PCIe (Peripheral Component Interconnect Express) configuration space refers to a memory area in a PCIe device used to store and manage device-related information. Software can read the configuration space of each PCIe device to obtain some information about the device, and can also configure the device through the configuration space. Each PCIe device can have at least one configuration space.
[0050] The configuration space is a collection of registers. The contents stored at each location in the space are defined by the protocol. For example, Typ0 is the configuration of the Endpoint and Type1 is the configuration of the Bridge.
[0051] The target device's identity can be either DeviceID or VendorID. The DeviceID and VendorID of the target device are stored in a designated location within the configuration space according to the protocol.
[0052] Step S204: Determine the spread spectrum option value based on the target identity identifier, wherein the spread spectrum option value is used to indicate whether the target device enables spread spectrum;
[0053] The target identity can be read from offsets 0, 1, 2, and 3 in the configuration space of the target device. Specifically, the device ID of the target device can be read from offsets 0 and 1, and the vendor ID of the target device can be read from offsets 2 and 3.
[0054] As an optional implementation, determining the spread spectrum option value based on the target identity includes the following steps: if neither the device identifier of the target device nor the manufacturer identifier of the target device is equal to a preset parameter value, the target identity is determined to be valid; if the target identity is valid, the spread spectrum option value is determined based on the target identity.
[0055] Specifically, the preset parameter value of 0Xffff reads the offsets 0, 1, 2, and 3 of the target device's configuration space to obtain the Vendor ID and Device ID of the root node. If neither the Vendor ID nor the Device ID is equal to 0Xffff, then the root node where the target device resides is valid, and the target identity is valid.
[0056] Specifically, determining the spread spectrum option value based on the target identity identifier includes the following steps:
[0057] If the target identity is the same as the preset identity, the spread spectrum option value is set to the target value;
[0058] If the target identity is different from the preset identity, the spread spectrum option value is set to the default value.
[0059] The aforementioned preset identity identifier is a pre-set identity identifier for the device that needs to enable spread spectrum. The preset identity identifier can be stored in a database in advance. The preset identity identifier is read from the database and compared with the target identity identifier. If the target identity identifier is the same as the preset identity identifier, the spread spectrum option value is set to the target value (the target value can be set according to the actual situation, for example, 1). If the target identity identifier is different from the preset identity identifier, the spread spectrum option value is set to the default value (which can be set according to the actual situation, for example, 0).
[0060] A flag is set to PM9A3 (the device that needs to be enabled for spread spectrum; PM9A3 is only for illustrating this embodiment, and could be other devices, depending on the actual situation). If the Vendor ID and Device ID of the target device are the same as those of PM9A3, then the target device is determined to be the device that needs to be enabled for spread spectrum, and the spread spectrum option value of the target device is set to 1. If the Vendor ID and Device ID of the target device are different from those of PM9A3, then the spread spectrum option value of the target device is set to 0.
[0061] As an optional implementation, the target device's target identifier can be compared with preset identifiers in a target database. The database contains multiple preset identifiers, and these preset identifiers are those of the devices whose spread spectrum needs to be enabled. By comparing the target device's target identifier with the preset identifiers in the target database one by one, it can be determined whether the target device is a device that needs to enable spread spectrum. Furthermore, by pre-recording the identifiers of devices that need to be enabled for spread spectrum in the target database, and then comparing them with the identifiers in the database when confirming whether the target device needs to enable spread spectrum, it is possible to quickly determine whether the target device needs to enable spread spectrum, thereby achieving the technical effect of improving the efficiency of enabling spread spectrum for the target device.
[0062] Furthermore, by comparing the target device's target identifier with preset identifiers in the target database, this application can simultaneously compare multiple identifiers with preset identifiers in the target database to determine whether multiple devices need to enable spread spectrum. For batch production, this application can enable spread spectrum for multiple devices in batches. Compared to the existing method of manually modifying BIOS setup options one by one, this application is more efficient and saves manpower.
[0063] Step S206: If the spread spectrum option value is the target value, enable the spread spectrum of the target device;
[0064] Step S208: After enabling the spread spectrum of the target device, write the target value into the southbridge;
[0065] Step S210: If the spread spectrum option value is not the target value, write the spread spectrum option value to the southbridge.
[0066] In this application, before the PCIe device is initialized during the PEI stage and before the spreading option value is written to the southbridge, the determination of whether the target device has enabled spreading is based on the target device's identity. This avoids the problem in the prior art where the spreading option value is written to the southbridge during the PEI stage, resulting in low efficiency due to the need to manually enter setup to enable spreading.
[0067] Optionally, the entity performing the above steps may be a background processor or other devices with similar processing capabilities, or a machine that integrates at least an image acquisition device and a data processing device. The image acquisition device may include an image acquisition module such as a camera, and the data processing device may include a terminal such as a computer or a mobile phone, but is not limited thereto.
[0068] Through the above steps, the target device's target identity is read from its configuration space, and a spreading option value is determined based on this identity. This spreading option value indicates whether the target device should enable spreading. If the spreading option value is the target value, spreading is enabled. After enabling spreading, the target value is written to the southbridge; otherwise, the spreading option value is written to the southbridge. Because this application determines whether to enable spreading based on the target device's target identity before writing the spreading option value to the southbridge, it avoids the inefficiency problem in existing technologies where the spreading option value cannot be changed after being written to the southbridge, requiring manual setup to enable spreading. This achieves the goal of automatically enabling spreading and improves the efficiency of spreading.
[0069] As an optional implementation, before reading the target identity identifier of the target device from the configuration space of the target device, the method further includes:
[0070] Obtain a target parameter set, wherein the target parameter set includes the bus number, device number, and function number of the target device;
[0071] Here, the bus number is Bus, the device number is Device, the function number is Function, and the target parameter set includes {Bus, Device, Function}. According to the UEFI specification, the memory space address of each root node rootport can be calculated as BaseAddress.
[0072] The PCIe configuration space of the root node at address BaseAddress can be directly accessed using MmioRead. MmioRead is a function provided in existing technology, capable of reading data of a specified length.
[0073] The configuration space of the target device is initialized using the target parameter set.
[0074] Specifically, the configuration space of the target device can be initialized in the following way:
[0075] The memory space address of the root node where the target device is located is determined based on the target parameter set;
[0076] Access the configuration space at the memory address;
[0077] The PCIe configuration space of the root node with the address BaseAddress can be accessed via MmioRead.
[0078] The configuration space of the target device is initialized according to the configuration space of the memory space address.
[0079] Specifically, the configuration space of the target device can be initialized based on the configuration space at the memory space address in the following manner:
[0080] Read offsets 0, 1, 2, and 3 from the configuration space of the memory address;
[0081] The device identifier of the root node is determined based on offset 0 and offset 1; the manufacturer identifier of the root node is determined based on offset 2 and offset 3.
[0082] As described above, the Vendor ID and Device ID of the root node can be obtained directly from the PCIe configuration space of the root node with the address BaseAddress using the MmioRead method, at offsets 0, 1, 2, and 3 in the configuration space.
[0083] The validity of the root node is determined based on the device identifier and the manufacturer identifier of the root node.
[0084] Specifically, if neither the device identifier nor the manufacturer identifier of the root node is equal to a preset parameter value, the root node is determined to be valid.
[0085] As described in the above implementation, the preset parameter value is 0Xffff. If neither the Vendor ID nor the Device ID is equal to 0Xffff, then the root node device is valid.
[0086] If the root node is valid, the configuration space of the target device is initialized.
[0087] Specifically, the bus number of the target device is written to the offset 0x19 of the configuration space of the memory space address.
[0088] For example, you can read the configuration space offset 0x19 of the root port, specify a Bus number: X, and write X to offset 0x19. At this point, the device connected to the root port has been assigned the Bus number: X, the configuration space has been initialized, and its configuration space can be accessed using the MmioRead method.
[0089] The above embodiments achieve the initialization of the device's configuration space.
[0090] The present application is illustrated below through a specific embodiment, such as... Figure 3 The flowchart shown includes the following steps:
[0091] Step 1: "SB Clock Spread Spectrum" is an option that controls whether spread spectrum is enabled on the AMD platform. Locate the option value SpreadSpectrum (spread spectrum option value) and find that it is written into the entry code of the Southbridge.
[0092] Step 2: According to the AMD specification, in the format of {Bus, Device, Function} (corresponding to the target parameter set, where Bus is the bus, Device is the device, and Function is the function), traverse the PICe device tree to find all root ports (root nodes), build a PICe root port array, and according to the UEFI specification, calculate the memory space address of each root port: BaseAddress;
[0093] Step 3: Access the PICe configuration space of the root port of the root node with the address BaseAddress in Step 2 directly via Mmio Read;
[0094] Step 4: Read offsets 0, 1, 2, and 3 of the PICe configuration space from Step 3. Offsets 0 and 1 yield the Vendor ID (manufacturer identifier) of the root node, while offsets 2 and 3 yield the Device ID (device identifier) of the root node. If both the Vendor ID and Device ID are not equal to 0xffff (preset parameter value), then the root node is valid.
[0095] Step 5: Continue reading the configuration space offset 0x19 of the root port device, specify a Busnumber: X (X can be set according to the actual situation, such as 1, 2, 3, etc.), and write X to offset 0x19. At this time, the device (target device) connected to the root port has been assigned the Bus number: X, and the configuration space has been initialized.
[0096] Step 6: Define a variable pcd as a flag to indicate whether PM9A3 (the device that needs to be spread spectrum enabled) exists in the current PICe configuration, and give pcd a default value of 0;
[0097] Step 7: Access the configuration space of the device (target device) with Bus:Device.Function set to X:00.0 in Step 5 using the MmioRead method. Read the values of offset 0, offset 1, offset 2, and offset 3 of the target device's PICe configuration space to obtain the device's Vendor ID and Device ID (obtain the Vendor ID from offset 0 and offset 1, and the Device ID from offset 2 and offset 3). If neither the Vendor ID nor the Device ID is equal to 0Xffff, then the root node device (target device) is valid.
[0098] Step 8: Determine whether the Vendor ID and Device ID obtained in Step 7 match the Vendor ID and Device ID of PM9A3 (preset identification identifiers; PM9A3 is a preset device, a device that is pre-determined to enable spread spectrum). If they match, the pcd value is 1; if they do not match, do nothing, end the function, and execute Step 10.
[0099] Step 9: Before the code that writes the value of SpreadSpectrum in the BIOS "SB Clock Spread Spectrum" option to the FCH southbridge runs, check the value of pcd. If the value of pcd is 0, write the value of SpreadSpectrum directly to the FCH, end the function, and execute step 10; if the value of pcd is 1, first assign the value of SpreadSpectrum to 1, then write it to the FCH, end the function, and execute step 10.
[0100] Step 10: End.
[0101] This invention provides a dynamic method for enabling spread spectrum based on the AMD platform. Before the PCIe device is initialized in the PEI stage and before the spread spectrum option value is written to the southbridge, the method determines whether there is a device with excessive radiation (such as PM9A3). If it exists, spread spectrum is enabled; if it does not exist, the option value is written to the setup.
[0102] The advantage of dynamic spread spectrum activation lies in its ability to improve the anti-interference capability and reliability of wireless communication systems. Spread spectrum technology reduces the probability of signal interference during transmission by distributing the original signal across a wider frequency band. Dynamic spread spectrum activation, on the other hand, only activates the technology when needed, based on the interference situation in the actual environment, to maximize signal quality and reliability. This flexible spread spectrum approach can effectively cope with different interference environments, providing better communication performance and user experience.
[0103] This invention changes the previous method of manually enabling spread spectrum via setup options. It allows the BIOS to determine device information by traversing the PCIe device tree during startup, thus dynamically enabling spread spectrum based on different devices. Since PCIe resources are allocated only during the DXE phase, dynamically enabling spread spectrum could only be done at the end of the DXE phase. This patent provides a method to temporarily allocate bus numbers during the PEI phase, allowing the PCIe configuration space to be initialized in advance, thereby determining whether to enable spread spectrum.
[0104] This application proposes a solution for dynamically enabling spread spectrum throughout the entire UEFI startup phase. This effectively addresses issues such as improving system anti-interference capabilities, communication quality and capacity, and adapting to diverse environmental requirements.
[0105] Enhanced anti-interference capability: Spread spectrum technology can distribute the original signal across a wider frequency band, reducing the probability of interference during transmission. By dynamically enabling spread spectrum, the use of this technology can be selected based on actual conditions, thereby improving the system's resistance to interference.
[0106] Improved communication quality: Spread spectrum technology can reduce the bit error rate during signal transmission and improve data reliability and integrity. Dynamically enabling spread spectrum allows for flexible adjustment of spread spectrum parameters based on channel conditions and interference, maximizing communication quality.
[0107] Increased system capacity: Spread spectrum technology can support simultaneous data transmission by multiple users under the same spectrum resources, thereby increasing system capacity. By dynamically enabling spread spectrum, resources can be allocated rationally according to user demand and network load, improving system throughput and efficiency.
[0108] Adaptable to diverse environments: Different environments present different types of interference. Dynamic spread spectrum activation can be flexibly adjusted according to real-time interference conditions to adapt to different working scenarios and application requirements. This enables the system to better adapt to the ever-changing wireless communication environment and provide stable and reliable communication services.
[0109] In summary, dynamic spread spectrum activation can improve the system's anti-interference capability, communication quality and capacity, and adapt to diverse environmental requirements, bringing many advantages to wireless communication systems.
[0110] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0111] This embodiment also provides an apparatus for enabling device spread spectrum, which is used to implement the above embodiments and preferred embodiments, and will not be repeated as already described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0112] Figure 4 This is a structural block diagram of the opening device spread spectrum apparatus according to an embodiment of the present invention, such as... Figure 4 As shown, the device includes a reading module 402 for reading the target identity identifier of the target device from the configuration space of the target device; a determining module 404 for determining a spreading option value based on the target identity identifier, wherein the spreading option value is used to indicate whether the target device enables spreading; an enabling module 406 for enabling spreading of the target device when the spreading option value is a target value; a first writing module 408 for writing the target value to the southbridge after enabling spreading of the target device; and a second writing module 410 for writing the spreading option value to the southbridge when the spreading option value is not the target value.
[0113] In an exemplary embodiment, the above-described apparatus is further configured to read offsets 0, 1, 2, and 3 in the configuration space of the target device in the following manner: determining the device identifier of the target device based on offset 0 and offset 1, wherein the target identity identifier includes the device identifier; and determining the manufacturer identifier of the target device based on offsets 2 and 3, wherein the target identity identifier includes the manufacturer identifier.
[0114] In one exemplary embodiment, the apparatus is further configured to determine the spread spectrum option value based on the target identity identifier in the following manner: if neither the device identifier of the target device nor the manufacturer identifier of the target device is equal to a preset parameter value, the target identity identifier is determined to be valid; if the target identity identifier is valid, the spread spectrum option value is determined based on the target identity identifier.
[0115] In an exemplary embodiment, the above-described apparatus is further configured to determine a spread spectrum option value based on the target identity identifier in the following manner: if the target identity identifier is the same as a preset identity identifier, the spread spectrum option value is set to the target value; if the target identity identifier is different from the preset identity identifier, the spread spectrum option value is set to a default value.
[0116] In an exemplary embodiment, the above-described apparatus is further configured to obtain a set of target parameters before reading the target identity identifier of the target device in the configuration space of the target device in the following manner: the bus number, device number, and function number of the target device; and initialize the configuration space of the target device using the set of target parameters.
[0117] In an exemplary embodiment, the above-described apparatus is further configured to initialize the configuration space of the target device by: determining the memory space address of the root node where the target device is located based on the target parameter set; accessing the configuration space of the memory space address; and initializing the configuration space of the target device based on the configuration space of the memory space address.
[0118] In an exemplary embodiment, the above-described apparatus is further configured to initialize the configuration space of the target device according to the configuration space of the memory space address in the following manner: reading offsets 0, 1, 2, and 3 in the configuration space of the memory space address; determining the device identifier of the root node according to offset 0 and offset 1; determining the vendor identifier of the root node according to offset 2 and offset 3; determining whether the root node is valid according to the device identifier and vendor identifier of the root node; and initializing the configuration space of the target device if the root node is valid.
[0119] In an exemplary embodiment, the above-described apparatus is further configured to determine whether the root node is valid based on the device identifier and the manufacturer identifier of the root node in the following manner: if neither the device identifier nor the manufacturer identifier of the root node is equal to a preset parameter value, the root node is determined to be valid.
[0120] In an exemplary embodiment, the above-described apparatus is further configured to initialize the configuration space of the target device when the root node is valid by writing the bus number of the target device to an offset of 0x19 in the configuration space of the memory space address.
[0121] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0122] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any of the preceding claims.
[0123] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0124] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0125] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0126] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0127] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0128] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for enabling device spread spectrum, characterized in that, include: Obtain a target parameter set, wherein the target parameter set includes the bus number, device number, and function number of the target device; The memory space address of the root node where the target device is located is determined based on the target parameter set; Access the configuration space at the memory address; Read offsets 0, 1, 2, and 3 from the configuration space of the memory address; The device identifier of the root node is determined based on the offset 0 and the offset 1; The manufacturer identifier of the root node is determined based on offset 2 and offset 3; The validity of the root node is determined based on the device identifier and the manufacturer identifier of the root node. If the root node is valid, write the bus number of the target device to the offset 0x19 of the configuration space of the memory space address; Read the target identity identifier of the target device from the configuration space of the target device; The spread spectrum option value is determined based on the target identity identifier, wherein the spread spectrum option value is used to indicate whether the target device enables spread spectrum; When the spread spectrum option value is the target value, the spread spectrum of the target device is enabled; After enabling the spread spectrum of the target device, the target value is written to the southbridge; If the spread spectrum option value is not the target value, the spread spectrum option value is written to the southbridge.
2. The method according to claim 1, characterized in that, Read the target identity identifier of the target device from the configuration space of the target device, including: Read offsets 0, 1, 2, and 3 from the configuration space of the target device; The device identifier of the target device is determined based on the offset 0 and the offset 1, wherein the target identity identifier includes the device identifier; The manufacturer identifier of the target device is determined based on offset 2 and offset 3, wherein the target identity identifier includes the manufacturer identifier.
3. The method according to claim 2, characterized in that, Determining the spread spectrum option value based on the target identity identifier includes: If neither the device identifier nor the manufacturer identifier of the target device is equal to a preset parameter value, the target identity identifier is determined to be valid. If the target identity is valid, the spread spectrum option value is determined based on the target identity.
4. The method according to claim 3, characterized in that, Determining the spread spectrum option value based on the target identity identifier includes: If the target identity is the same as the preset identity, the spread spectrum option value is set to the target value; If the target identity is different from the preset identity, the spread spectrum option value is set to the default value.
5. The method according to claim 1, characterized in that, Determining the spread spectrum option value based on the target identity identifier includes: If the target identity is the same as the preset identity, the spread spectrum option value is set to the target value; If the target identity is different from the preset identity, the spread spectrum option value is set to the default value.
6. The method according to claim 1, characterized in that, Determining the validity of the root node based on its device identifier and vendor identifier includes: If neither the device identifier nor the manufacturer identifier of the root node is equal to a preset parameter value, the root node is determined to be valid.
7. The method according to claim 1, characterized in that, If the root node is valid, the configuration space of the target device is initialized, including: Write the bus number of the target device to the offset 0x19 of the configuration space of the memory space address.
8. The method according to any one of claims 1 to 7, characterized in that, The method of enabling device spread spectrum is applied to the AMD platform.
9. A device for initiating device spread spectrum, characterized in that, include: The reading module is used to read the target identity identifier of the target device from the configuration space of the target device; The determining module is used to determine a spreading option value based on the target identity identifier, wherein the spreading option value is used to indicate whether the target device enables spreading; The activation module is used to activate the spread spectrum of the target device when the spread spectrum option value is the target value; The first writing module is used to write the target value to the southbridge after the spread spectrum of the target device is enabled; The second writing module is used to write the spread spectrum option value to the southbridge when the spread spectrum option value is not the target value. The device is further configured to acquire a target parameter set, wherein the target parameter set includes the bus number, device number, and function number of the target device; determine the memory space address of the root node where the target device is located based on the target parameter set; access the configuration space of the memory space address; read offsets 0, 1, 2, and 3 in the configuration space of the memory space address; determine the device identifier of the root node based on offsets 0 and 1; determine the vendor identifier of the root node based on offsets 2 and 3; determine whether the root node is valid based on the device identifier and the vendor identifier of the root node; and initialize the configuration space of the target device if the root node is valid.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 8.
11. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Clock spread spectrum function setting method and device, electronic equipment and storage medium
CN116185509A