A bus instruction control method and related equipment
By monitoring and modifying the power supply voltage data in the SPMI bus instructions in the integrated circuit device, it solves the problem in the existing technology that the voltage regulation strategy cannot be modified due to the non-disclosure of the voltage regulation mechanism, and achieves higher power supply voltage regulation flexibility and Operability.
Patent Information
- Application Number
- CN202410564448.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-05-09
AI Technical Summary
The voltage regulation mechanism of the existing SPMI bus is not disclosed, which prevents terminal manufacturers from modifying the control strategy and limits the flexibility and operability of power supply voltage regulation.
The integrated circuit device controls and adjusts the SPMI bus instructions by monitoring the SPMI bus instructions sent by the host, parsing and modifying the data carrying the preset register address, and sending modified instructions to adjust the power supply voltage.
It improves the flexibility and operability of power supply voltage regulation, solves the problem that the voltage regulation strategy cannot be modified, and enhances the flexibility and stability of the SPMI system.
Smart Images

Figure CN118170705B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a bus instruction control method and related equipment. Background Art
[0002] The System Power Management Interface (SPMI) is a two-wire serial interface that can be used to accurately monitor and control the processor performance level required for a given workload or application, and dynamically control various power supply voltages in real time based on the performance level. The SPMI bus supports multiple master devices (or hosts) and multiple slave devices (or slaves), supporting up to 4 master devices and 16 slave devices. However, the existing master-slave system of the SPMI bus directly implements power supply voltage control based on the SPMI protocol. Its specific control strategy is not disclosed, and terminal manufacturers cannot modify the control strategy, so naturally they cannot control the power supply voltage adjustment by themselves. Summary of the invention
[0003] The present application provides a bus instruction control method and related equipment. The method can be applied to IC devices. One end of the IC device is connected to one or more hosts via an SPMI bus, and the other end is connected to its corresponding slave. When the IC device receives an SPMI write instruction to be sent to a target slave and contains a preset register address, the IC device can modify the data corresponding to the preset register address in the instruction, and then send the modified instruction to the target slave, thereby realizing the adjustment of data such as power supply voltage carried by the SPMI bus instruction, and improving the operability and flexibility of power supply voltage adjustment.
[0004] In the first aspect, the present application provides a bus instruction control method. The method can be applied to integrated circuit devices. One end of the integrated circuit device can be connected to one or more hosts via an SPMI bus, and the other end can be connected to a first slave. The method may include: the integrated circuit device can monitor a first instruction sent by the host to the SPMI bus; when the slave address included in the first instruction is the same as the address of the first slave, and the first instruction includes a preset register address, and the first instruction is a write instruction, the integrated circuit device can modify the first data in the first instruction to obtain the second data, and then send the second instruction including the second data to the first slave. Among them, the first data is the data corresponding to the preset register address included in the first instruction, and the second data is the data corresponding to the preset register address included in the second instruction.
[0005] In the scheme provided by the present application, the integrated circuit device can monitor the instructions sent by the host to the SPMI bus. After monitoring the instructions sent by the host to the SPMI bus, when the target address of the instruction (i.e., the slave address included in the instruction) is the same as the address of the target slave, and the instruction includes a preset register address, and the instruction is a write instruction, the integrated circuit device can modify the data corresponding to the preset register address in the instruction, and send the instruction obtained after the modified data to the target slave. This method can realize the control of SPMI bus instructions, including the adjustment of data (for example, power supply voltage) carried by SPMI bus instructions, solves the problem that the voltage regulation strategy cannot be modified due to the non-disclosure of the voltage regulation mechanism, and improves the operability and flexibility of power supply voltage regulation.
[0006] It can be understood that the first slave refers to the slave corresponding to the integrated circuit device, or the slave connected to the integrated circuit device. Figure 4 As shown, in the case where the integrated circuit device is ICN, the first slave is slave N, and N is a positive integer not greater than 16.
[0007] In some embodiments of the present application, when the SPMI system includes a plurality of integrated circuit devices, the slaves to which the plurality of integrated circuit devices are connected are different from each other.
[0008] It should be noted that the first slave can be understood as a target slave of the integrated circuit device. For a detailed description of the target slave, please refer to the following text, which will not be elaborated in this application.
[0009] It is understood that the integrated circuit device is the IC device mentioned below (such as Figure 4 , Figure 5 , Figure 6 and Figure 8 The first instruction may be the SPMI bus instruction mentioned below, and the second instruction may be the modified SPMI bus instruction mentioned below.
[0010] In combination with the first aspect, in a possible implementation, after the integrated circuit device monitors the first instruction sent by the host to the SPMI bus, the method may also include: the integrated circuit device can parse the first instruction; in the process of parsing the first instruction, the integrated circuit device can determine whether the slave address included in the first instruction is the same as the address of the first slave; when the slave address included in the first instruction is the same as the address of the first slave, the integrated circuit device can determine whether the first instruction includes a preset register address; when the first instruction includes a preset register address, determine whether the first instruction is a write instruction.
[0011] In the solution provided in the present application, after the integrated circuit device monitors the instruction sent by the host to the SPMI bus, it can parse the instruction. First, it can determine whether its target address is the same as the address of the target slave (that is, determine whether the instruction is an instruction sent to the target slave). If the target address of the instruction is the same as the address of the target slave, it means that the instruction is an instruction sent to the target slave. In this case, the integrated circuit device continues to determine whether the instruction includes a preset register address. However, if the target address of the instruction is not the same as the address of the target slave, it means that the instruction is not an instruction sent to the target slave. In this case, the integrated circuit device no longer continues to parse the instruction. If the integrated circuit determines that the instruction includes a preset register address, the integrated circuit device can continue to determine the instruction type of the instruction, process the instruction according to the instruction type, and make a corresponding response to the instruction. However, if the integrated circuit determines that the instruction includes a preset register address, the integrated circuit device can directly send the instruction to the target slave without further parsing and processing it. In this way, the integrated circuit device can parse the SPMI bus instructions it monitors step by step, and stop parsing in time if it is found that the instruction does not meet the corresponding conditions (you can also refer to Figure 7 ), thereby saving programs and reducing power consumption to a certain extent.
[0012] In combination with the first aspect, in a possible implementation, the preset register address may be the address of the power register, and the first data includes a first voltage value. The integrated circuit device modifies the first data in the first instruction, which may specifically include: when the first voltage value is less than the first voltage threshold, the integrated circuit device may reduce the first voltage value by a1 to obtain the second data; when the first voltage value is greater than or equal to the first voltage threshold and less than the second voltage threshold, the integrated circuit device may reduce the first voltage value by a2 to obtain the second data; when the first voltage value is greater than or equal to the second voltage threshold, the first voltage value is reduced by a3 to obtain the second data. Wherein, a1 is less than a2, and a2 is less than a3.
[0013] In the scheme provided in the present application, the integrated circuit device can modify the data according to the data size corresponding to the preset register address carried by the SPMI instruction. For example, when the data corresponding to the preset register address is relatively large, the data can be reduced by a relatively large step size, and when the data corresponding to the preset register address is relatively small, the data can be reduced by a relatively small step size. In this way, the data corresponding to the preset register address carried by the SPMI bus instruction is not increased or decreased by a fixed step size, and the data corresponding to the preset register address carried by the SPMI bus instruction can be modified more reasonably.
[0014] In some embodiments of the present application, the first data may include a power supply voltage, that is, the first voltage value may be understood as the power supply voltage carried by the first instruction.
[0015] In combination with the first aspect, in a possible implementation, after the integrated circuit device monitors the first instruction sent by the host to the SPMI bus, the method may further include: when the slave address included in the first instruction is the same as the address of the first slave, and the first instruction includes a preset register address, and the first instruction is a read instruction, the integrated circuit device can obtain third data; the integrated circuit device can simulate the first slave to seize the SPMI bus and send the third data to the host. The third data is the original configuration data corresponding to the preset register address.
[0016] In the scheme provided by the present application, the integrated circuit device can monitor the instructions sent by the host to the SPMI bus. After monitoring the instructions sent by the host to the SPMI bus, when the target address of the instruction (i.e., the slave address included in the instruction) is the same as the address of the target slave, and the instruction includes a preset register address, and the instruction is a read instruction, the integrated circuit device can obtain the original configuration data corresponding to the preset register address and send it to the host. This method can avoid the inconsistency between the data read by the host from the slave register and the data originally written to the slave register due to the integrated circuit device modifying the data carried by the SPMI bus instruction, that is, avoiding the problem of inconsistent read and write data caused by data modification, thereby maintaining the stability of the voltage regulation of the SPMI system. In addition, this method can be completed by the integrated circuit device Read and respond (send the original configuration data read to the host), without notifying the slave to read and respond, saving the process to a certain extent, and can also control power consumption.
[0017] In some embodiments of the present application, before or after the integrated circuit device monitors an SPMI read instruction in which the target address (i.e., the slave address included in the instruction) is the same as the address of the target slave and includes a preset register address, the integrated circuit device may monitor an SPMI write instruction in which the target address (i.e., the slave address included in the instruction) is the same as the address of the target slave and includes a preset register address, and modify the power supply voltage carried by the SPMI write instruction.
[0018] In combination with the first aspect, in a possible implementation, the integrated circuit device may include one or more ROM partitions, and the one or more ROM partitions store original configuration data of different categories. The one or more ROM partitions may include a first partition, and the category of the original configuration data stored in the first partition is the same as the category of data corresponding to the preset register address. The integrated circuit device obtains the third data, which may specifically include: the integrated circuit device may obtain the third data from the first partition.
[0019] In the solution provided by the present application, the integrated circuit device may include one or more ROM partitions. In this case, if the integrated circuit device monitors an SPMI read instruction whose target address is the same as the address of the target slave and includes a preset register address, the integrated circuit device can search for the same category of original configuration data in the corresponding ROM partition based on the category of data corresponding to the preset register address. In this way, the integrated circuit device can store original configuration data of different categories in different ROM partitions respectively, and can search for the ROM partition storing the original configuration data of the corresponding category based on the address of the ROM partition, so as to obtain the original configuration data of a specific category from a variety of original configuration data more quickly and conveniently.
[0020] It can be understood that the third data is the original configuration data corresponding to the preset register address. The third data can be the original data mentioned below, and can also be the original register data mentioned below.
[0021] In combination with the first aspect, in a possible implementation, after the integrated circuit device monitors the first instruction sent by the host to the SPMI bus, the method may also include: when the slave address included in the first instruction is the same as the address of the first slave, and the first instruction includes a preset register address, and the first instruction is a write instruction, the integrated circuit device can determine whether the first slave needs to respond to the first instruction; when the first slave needs to respond to the first instruction, the integrated circuit device can simulate the first slave to preempt the SPMI bus, and respond to the host that the first instruction has been received.
[0022] In the scheme provided in the present application, the integrated circuit device can monitor the instructions sent by the host to the SPMI bus. After monitoring the instructions sent by the host to the SPMI bus, when the target address of the instruction (that is, the slave address included in the instruction) is the same as the address of the target slave, and the instruction includes a preset register address, and the instruction is a write instruction, the integrated circuit device can determine whether a response is required. If a response is required, the integrated circuit device can simulate the slave to seize the bus and respond to the host that the corresponding instruction has been received. There is no need to notify the slave to respond to the host. This can simplify the process and control power consumption to a certain extent.
[0023] In combination with the first aspect, in a possible implementation, the integrated circuit device is connected to a central processing unit (CPU). After the integrated circuit device sends the second instruction to the first slave, the method may further include: the integrated circuit device may receive a third instruction sent by the CPU; based on the third instruction, the integrated circuit device may switch the working mode from the first mode to the second mode; after switching the working mode to the second mode, the integrated circuit device may monitor the instructions sent by the host to the SPMI bus, and send the instructions sent by the host to the SPMI bus to the first slave.
[0024] In the solution provided in the present application, when the working mode of the integrated circuit device is the first mode, the integrated circuit device can respond to and process the monitored SPMI bus instructions according to the above-mentioned first aspect and any possible implementation method of the first aspect, and when the working mode of the integrated circuit device is the second mode, the integrated circuit device is only responsible for transparently transmitting the monitored SPMI bus instructions and does not process them. In addition, the CPU can control the working mode adopted by the integrated circuit device, and specifically can control its switching working mode by sending instructions to it to indicate switching the working mode. In this way, the integrated circuit device can process the monitored SPMI bus instructions in some scenarios (for example, combined with factors such as power consumption and user usage), and is only responsible for transparent transmission in other scenarios, which can reduce power consumption to a certain extent.
[0025] It is understandable that the third instruction may be the instruction for instructing to switch the working mode mentioned below.
[0026] In combination with the first aspect, in a possible implementation, before the integrated circuit device can monitor the first instruction sent by the host to the SPMI bus, the method may further include: the integrated circuit device can receive a fourth instruction sent by the CPU; based on the fourth instruction, the integrated circuit device can switch the working mode from the second mode to the first mode. It is understandable that after switching the working mode to the first mode, when monitoring the SPMI bus instruction, the integrated circuit device can parse and process the instruction (for details, please refer to the relevant content of the first aspect above).
[0027] In some embodiments of the present application, the default operating mode adopted by the integrated circuit device is the second mode.
[0028] In combination with the first aspect, in a possible implementation, the third instruction may include an address of the integrated circuit device. The address of the integrated circuit device is determined by a pull-up resistor or a pull-down resistor connected to the integrated circuit device through one or more pins.
[0029] In the solution provided in the present application, the instruction sent by the CPU to the integrated circuit device to instruct the switching of the working mode may include the address of the integrated circuit device. It is understood that the address of the integrated circuit device may be determined based on the pull-up resistor or the pull-down resistor connected to its pin, and the details may be referred to below.
[0030] In some embodiments of the present application, the SPMI system may include a plurality of integrated circuit devices.
[0031] In a second aspect, the present application provides an integrated circuit device. The integrated circuit device may include a processing module, and the integrated circuit device is coupled to a memory in an electronic device. The memory may be used to store program instructions, and the processing module may be used to read and execute the program instructions, so that the integrated circuit device performs the method described in the first aspect or any one of the implementations of the first aspect.
[0032] In some embodiments of the present application, the processing module may include a protocol parsing module and an IC configuration module.
[0033] In some embodiments of the present application, the processing module may include a bus monitoring module, a register response module, a bus response module and a protocol conversion module.
[0034] In some embodiments of the present application, the integrated circuit device may include a communication module. The communication module may be used to communicate with other devices and be responsible for forwarding data.
[0035] In some embodiments of the present application, the communication module may include a port (eg, a host port, a slave port, and other ports, etc.) and a data forwarding control module.
[0036] In some embodiments of the present application, the communication module may include ports (eg, a host port, a slave port, and other ports, etc.).
[0037] In some embodiments of the present application, the integrated circuit device may further include a storage module. The storage module may be used to store original configuration data of the integrated circuit device and / or a correspondingly connected slave.
[0038] In some embodiments of the present application, the storage module may include a slave data cache module.
[0039] In a third aspect, the present application provides an SPMI system. The SPMI system may include one or more hosts, an SPMI bus, one or more integrated circuit devices as described in the second aspect, and one or more slaves. The one or more hosts are respectively connected to the SPMI bus, and one end of each of the one or more integrated circuit devices can be connected to the SPMI bus, and the other end is connected to its respective corresponding slave.
[0040] In the solution provided by the present application, when the SPMI system includes multiple slaves and multiple integrated circuit devices, each integrated circuit device can be connected to a slave, and the slaves connected to it can be different from each other. In this way, each integrated circuit device in the SPMI system can parse the monitored SPMI bus instructions, and respond to and process the SPMI bus instructions sent to the slave connected to it.
[0041] In combination with the third aspect, in one possible implementation, when the SPMI system includes multiple integrated circuit devices as described in the second aspect, the address of each integrated circuit device in the multiple integrated circuit devices can be determined by a pull-up resistor or a pull-down resistor connected to itself through one or more pins, and the addresses of the multiple integrated circuit devices are different from each other.
[0042] In the solution provided in the present application, when the SPMI system includes multiple slaves and multiple integrated circuit devices, the multiple integrated circuit devices can be connected to the CPU through a communication interface of the CPU. In this case, the multiple integrated circuit devices can be configured with different addresses by connecting pull-up circuits or pull-down resistors, so that when the CPU sends instructions (or notifications) to the integrated circuit devices, they can be accurately sent to the corresponding integrated circuit devices. In addition, since the multiple integrated circuit devices only use one communication interface of the CPU, the CPU interface can be saved, which reduces the layout difficulty of the multiple integrated circuit devices to a certain extent.
[0043] In a fourth aspect, the present application provides an electronic device. The electronic device may include the SPMI system and a memory as described in the third aspect. The SPMI system is coupled to the memory, and the memory may be used to store program instructions.
[0044] In a fifth aspect, the present application provides a computer storage medium storing program instructions, which, when executed on an integrated circuit device, causes the integrated circuit device to execute the bus instruction control method described in the first aspect or any one of the implementations of the first aspect.
[0045] In a sixth aspect, the present application provides a computer program product comprising instructions. When the computer program product is run on an electronic device, the integrated circuit device in the electronic device can execute the method described in the first aspect or any one of the implementations of the first aspect.
[0046] It can be understood that the integrated circuit device provided in the second aspect, the SPMI system provided in the third aspect, the electronic device provided in the fourth aspect, the computer storage medium provided in the fifth aspect, and the computer program product provided in the sixth aspect are all used to execute the method described in the first aspect or any one of the implementations of the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of any possible implementation of the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A schematic diagram of the architecture of an SPMI bus provided in an embodiment of the present application;
[0048] Figure 2 A schematic diagram of an SPMI bus instruction cycle provided in an embodiment of the present application;
[0049] Figure 3 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0050] Figure 4 A schematic diagram of the architecture of an SPMI system provided in an embodiment of the present application;
[0051] Figure 5 A schematic diagram of address configuration of an IC device provided in an embodiment of the present application;
[0052] Figure 6 A schematic diagram of an SPMI system interaction provided in an embodiment of the present application;
[0053] Figure 7 A bus instruction control method provided in an embodiment of the present application;
[0054] Figure 8 A schematic diagram of software module interaction in an IC device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0056] It should be understood that the terms "first", "second", etc. in the specification, claims and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0057] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0058] The present application relates to the field of SPMI bus. To facilitate understanding of the method provided by the present application, some terms in the field of SPMI bus are introduced below.
[0059] 1. SPMI bus
[0060] The Mobile Industry Processor Interface (MIPI) Alliance defines a set of interface standards to standardize the interfaces within electronic devices (e.g., camera interface, display interface, RF / baseband interface, etc.), while increasing design flexibility and reducing costs, design complexity, power consumption, etc. The MIPI Alliance defines the hardware interface between the baseband or application processor and peripheral components to support advanced power management technologies. For example, SPMI is a two-wire serial interface defined by the MIPI Alliance for power management.
[0061] The SPMI bus is generally used for power management. It can be used to accurately monitor and control the processor performance level required for a given workload or application, and dynamically control various power supply voltages in real time according to the performance level. The SPMI bus is an asynchronous bus that can connect multiple hosts and multiple slaves. Among them, the host refers to the device that initializes transmission, generates clock signals, and terminates transmission, and the slave refers to the device addressed by the host. It can be understood that the SPMI bus is a bidirectional transmission bus. Therefore, the host and slave connected to the SPMI bus can both be transmitters (i.e., devices that send data) and receivers (i.e., devices that receive data).
[0062] For example, Figure 1 As shown, the SPMI bus can connect 4 hosts (i.e. Figure 1The host 1, host 2, host 3 and host 4 shown in the figure and N slaves. Wherein, N is a positive integer less than or equal to 16. It should be noted that the SPMI bus may include two signal lines, and the four hosts and N slaves are connected through the two signal lines, and the two signal lines are respectively a serial clock signal line and a serial data signal line. Wherein, the serial clock signal line can transmit a serial clock signal (SerialClock, SCLK), and the serial data signal line can transmit a serial data signal (SerialData, SDATA). It can be understood that the serial clock signal can be referred to as a clock signal, and the serial data signal can be referred to as a data signal.
[0063] It is understandable that the above four hosts and N slaves can exchange data through the SPMI bus. In some embodiments of the present application, the host and the slave can perform bus preemption through arbitration to resolve conflicts. When the bus is in an idle state, multiple hosts or slaves can access the bus through bus arbitration requests, and the host of the bus monitors the bus arbitration request and grants the bus to a requester.
[0064] 2. SPMI bus instruction cycle
[0065] Furthermore, a cycle of data interaction between the host and the slave may be referred to as an SPMI bus instruction cycle.
[0066] The SPMI bus instruction cycle can be divided into several stages: bus arbitration stage (such as Figure 2 bus arbitration as shown), the sequence start phase (such as Figure 2 The sequence shown in the start), bus frame sequence phase (such as Figure 2 frame sequence as shown) and bus stop cycles (such as Figure 2 as shown).
[0067] When multiple hosts or multiple slaves connected to the SPMI bus initiate data interaction (or communication transmission / data transmission), the bus arbitration stage is first entered, and the bus arbitration stage generally requires 9 clock cycles. In the bus arbitration stage, the host currently controlling the SPMI bus can determine which device initiating communication transmission on the SPMI bus has a higher priority, and determine the arbitration result according to the priority of the device, that is, the result of bus preemption (which can also be understood as the device that obtains bus ownership). After the device seizes the SPMI bus and becomes the controller of the SPMI bus, it can obtain control of the clock signal (i.e., SCLK) of the SPMI bus and provide the SCLK of the SPMI bus. In some embodiments of the present application, the device connected to the SPMI bus can achieve bus preemption by pulling the data signal line of the SPMI bus to a high level.
[0068] Next, the sequence start phase (also known as the bus buffer phase) can be entered. In the sequence start phase, a start timing (Sequence Start Condition, SSC) is generated. In some embodiments of the present application, in the sequence start phase, the device that obtains the control right of the SPMI bus can pull down SCLK and control the data signal line to first pull up the data signal (i.e., SDATA) and then pull down SDATA to generate a start timing.
[0069] After the receiver (or receiving device) on the SPMI bus, such as the Power Management Integrated Circuit (PMIC), detects the start timing, it can then enter the bus frame sequence phase, and the receiver on the SPMI bus can prepare to receive subsequent frame sequences. In the bus frame sequence phase, the device that obtains bus ownership can perform operations such as host read and write or slave read and write. In the bus frame sequence phase, the host / slave can send SPMI bus instructions to the host / slave to implement operations such as host read and write or slave read and write. After executing the SPMI bus instruction, the bus stop cycle can be entered.
[0070] In some embodiments of the present application, the SPMI bus instruction may include information such as instruction type, target address, data, etc. It is understandable that the data interaction process on the SPMI bus may include but is not limited to: the process of the host reading the slave, and the process of the host writing the slave. Correspondingly, the instruction type may include but is not limited to: the host reads the slave (i.e., the host reads the slave register instruction), the host writes the slave (the host writes the slave register instruction).
[0071] In some embodiments of the present application, the data interaction process on the SPMI bus may also include a process of writing from a slave to a host. Correspondingly, the instruction type may also include a write instruction from a slave to a host.
[0072] In some embodiments of the present application, the target address includes the address of the slave (which may be referred to as the slave address) and the address of the register of the slave (which may be referred to as the register address). For example, a specific SPMI bus instruction may be a command for the host to write a voltage value to the register with the address 0110 corresponding to the slave with the address 1111. The slave with the address 1111 may be a PMIC, and the voltage value may be a power management unit (PMU) voltage.
[0073] In some embodiments of the present application, PMU and PMIC may be understood as different names for the same device.
[0074] In such Figure 1In the SPMI system shown, both the host and the slave need to support the SPMI protocol, and both the host and the slave need to be connected via the SPMI bus. For example, both the host 1 and the slave 1 support the SPMI protocol, and the host 1 and the slave 1 are connected via the SPMI bus in advance, so that the host 1 and the slave 1 can communicate via the SPMI bus, and the host 1 can write data into the slave 1, or read the data of the slave 1. In other words, only the host and the slave that support the SPMI protocol and are connected via the SPMI bus can interact with each other. It should be noted that the SPMI bus instructions transmitted by the SPMI bus are obtained based on the SPMI protocol, and the data in the SPMI bus instructions are also obtained based on the SPMI protocol. The device receiving the SPMI bus instructions cannot modify the SPMI bus instructions. For example, the voltage regulation mechanism involved in the SPMI system (for example, a system including an SPMI bus, and a slave and a host connected to the SPMI bus) is not disclosed and cannot be modified. The device receiving the SPMI bus instruction in the SPMI system can only adjust the voltage according to the voltage value in the SPMI bus instruction, and cannot adjust the voltage by itself, and there are problems of low operability and poor flexibility.
[0075] Based on the above content, the embodiment of the present application provides a bus instruction control method and related equipment. The method can be applied to any integrated circuit (IC) device in the SPMI system. It can be understood that the host in the SPMI system is connected to the SPMI bus, and each slave in the SPMI system can be connected to an IC device, and each IC device can also be connected to the SPMI bus. For any IC device in the SPMI system, when the slave address in the SPMI bus instruction received by the IC device is the same as the address of the target slave, and the SPMI bus instruction includes a preset register address, and the SPMI bus instruction is a write instruction, the IC device can modify the data corresponding to the preset register address, and then send the SPMI bus instruction obtained after modifying the data (i.e., the modified SPMI bus instruction) to the target slave, however, when the slave address in the SPMI bus instruction received by the IC device is the same as the address of the target slave, and the SPMI bus instruction includes a preset register address, and the SPMI bus instruction is a read instruction, the IC device can read the original register data of the target slave, and then send the original register data to the host. The target slave of the IC device is the slave to which the IC device is connected. The original register data is the original data configured by the preset register address (or the original configuration data corresponding to the preset register address). This method can realize the control of SPMI bus instructions, including the adjustment of the data carried by the SPMI bus instructions (for example, the power supply voltage), solves the problem that the voltage regulation strategy cannot be modified due to the non-disclosure of the voltage regulation mechanism, and improves the operability and flexibility of the power supply voltage regulation.
[0076] The following first introduces the device involved in the embodiments of the present application.
[0077] It can be understood that the electronic devices involved in the embodiments of the present application can be mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA) or special cameras (such as SLR cameras, card cameras), etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0078] The following introduces the hardware structure of an electronic device provided in an embodiment of the present application.
[0079] See also Figure 3 , Figure 3A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0080] like Figure 3 As shown, the electronic device may include: a processor, a memory, a Universal Serial Bus (USB) interface, a charging management module, a power management module, a battery, etc.
[0081] It is understandable that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device. It is understandable that the illustrated components can be implemented in hardware, software, or a combination of software and hardware. In some embodiments of the present application, the electronic device may include more components than shown. Exemplarily, the electronic device may include an audio module, a sensor module, an antenna 1, an antenna 2, a mobile communication module, a wireless communication module, a sensor module, a button, a motor, an indicator, a camera, a display screen, and a Subscriber Identity Module (SIM) card slot, etc. Among them, the audio module may include a speaker, a receiver, a microphone, an earphone interface, etc., and the sensor module may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc. In some other embodiments of the present application, the electronic device may include fewer components than shown, or combine certain components, or split certain components, or arrange different components. Exemplarily, the electronic device may include a processor and a memory. The interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic description and does not constitute a structural limitation on the electronic device.
[0082] The processor may include one or more processing units, for example: the processor may include a central processing unit (CPU), an application processor (AP), a modem (also called a baseband processor), a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), and / or a neural-network processing unit (NPU). Among them, the AP is a processor responsible for running the operating system and applications. The modem is a processor responsible for processing various communication protocols.
[0083] In some embodiments of the present application, the processing unit included in the processor can also be understood as a chip. In this case, the processor may include one or more chips. For example, a system-level chip (SoC) and a microcontroller unit (MCU). SoC, also known as a system on chip, mainly refers to a chip circuit that integrates key system components on a chip and can realize complete system functions. SoC can process digital signals, analog signals, mixed signals, and even radio frequency signals, and is often used in embedded systems, such as mobile phones, tablets, smart home appliances and other intelligent devices, and is the core chip that constitutes its device. MCU is a small computer on a single IC, containing a processor core, memory, programmable input / output (I / O) peripherals, timers, counters, etc. It only provides minimal memory, interfaces and processing power. Compared with SoC packaging, the peripherals included on MCU are not as specific. MCU is usually used in small embedded control systems or control applications.
[0084] The charging management module is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module can receive charging input from the wired charger through a USB interface. In some wireless charging embodiments, the charging management module can receive wireless charging input through a wireless charging coil of the electronic device. While the charging management module is charging the battery, it can also power the electronic device through the power management module.
[0085] The power management module is used to connect the battery, the charging management module and the processor. The power management module receives input from the battery and / or the charging management module to power the processor, the internal memory, the external memory, the display screen, the camera and the wireless communication module. The power management module can also be used to monitor parameters such as battery capacity, battery cycle number and battery health status (for example, leakage, impedance, etc.). In some embodiments of the present application, the power management module can also be set in the processor. In some other embodiments of the present application, the power management module and the charging management module can also be set in the same device.
[0086] In some embodiments of the present application, the power management module may include one or more PMICs. In some other embodiments of the present application, one or more PMICs in the electronic device may be independently provided, and are not provided in the power management module or in the processor.
[0087] PMIC is a special-purpose integrated circuit whose main function is to manage power for the main system. PMIC can be used to control the charging management module. PMIC is often used in devices that use batteries as power sources, such as mobile phones or portable media players. Since such devices generally have more than one power source (for example, battery and USB power), the system requires multiple power supplies with different voltages, and the battery charging and discharging must be controlled. Meeting such requirements in a traditional way will take up a lot of space and increase product development time, which led to the emergence of PMIC.
[0088] In some embodiments of the present application, the electronic device may include a SoC and a PMIC, and the SoC and the PMIC are connected via an SPMI bus, which can be used to accurately monitor and control the processor performance level required for a given workload or application, and dynamically control various power supply voltages in real time according to the performance level.
[0089] The memory may include one or more RAMs and one or more non-volatile memories (NVMs). The random access memory can be directly read and written by the processor, and can be used to store executable programs (e.g., machine instructions) of the operating system or other running programs, and can also be used to store user and application data. The non-volatile memory can also store executable programs and user and application data, and can be loaded into the random access memory in advance for direct reading and writing by the processor.
[0090] In some embodiments of the present application, the electronic device may further include an external memory interface. The external memory interface may be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device.
[0091] In some embodiments of the present application, the electronic device may include an SPMI system, and monitor and adjust the power supply voltage through the SPMI system included therein.
[0092] The following introduces the architecture of an SPMI system provided in an embodiment of the present application.
[0093] like Figure 4As shown, the SPMI system may include an SPMI bus, one or more hosts (e.g., one or more hosts among hosts 1-4), one or more slaves (e.g., one or more slaves among slaves 1-N), and one or more IC devices (e.g., one or more IC devices among IC1-ICN), and the one or more hosts are connected to the one or more IC devices through the SPMI bus, and each IC device is connected to a slave, that is, the number of IC devices in the SPMI system is equal to the number of slaves. In other words, each slave is connected to the host through an IC device. It can also be understood that one or more hosts and one or more IC devices are mounted on the SPMI bus, and each IC device mounted on the SPMI bus is connected to a corresponding slave.
[0094] It should also be noted that one or more IC devices in the SPMI system can be connected to the CPU of the electronic device. In some embodiments of the present application, the one or more IC devices can be connected to the CPU of the electronic device through a communication interface (e.g., Figure 4 IC configuration interface shown) to connect with the CPU.
[0095] For ease of understanding, the relationship between the host, slave and IC device in the SPMI system can also be described and understood by series and parallel connection. Specifically, one or more hosts in the SPMI system are connected to the SPMI bus in parallel with each other. Similarly, one or more IC devices in the SPMI system are connected to the SPMI bus in parallel with each other, and each IC device is connected in series with a slave. In other words, the hosts in the SPMI system are connected in parallel with each other, the IC devices in the SPMI system are connected in parallel with each other, the slaves in the SPMI system are connected in parallel with each other, and the IC devices in the SPMI system are connected in series with their corresponding slaves.
[0096] It can be understood that, according to the above, the SPMI bus may include a serial clock signal line and a serial data signal line.
[0097] In some embodiments of the present application, one or more SoCs in an electronic device may include one or more hosts in an SPMI system, and one or more PMICs in an electronic device may include one or more slaves in an SPMI system.
[0098] In some embodiments of the present application, one or more MCUs in an electronic device may include one or more hosts in an SPMI system, and one or more PMICs in an electronic device may include one or more slaves in an SPMI system.
[0099] It is understandable that, when the SPMI system includes multiple hosts, the multiple hosts may be modules in one SoC or modules in different SoCs. Similarly, when the SPMI system includes multiple hosts, the multiple hosts may be modules in one MCU or modules in different MCUs. Similarly, when the SPMI system includes multiple slaves, the multiple slaves may be modules in one PMIC or modules in different PMICs.
[0100] In some embodiments of the present application, the IC device in the SPMI system can be understood as a device independent of the SoC, MCU and PMIC settings. In some other embodiments of the present application, the IC device in the SPMI system can also be set in other modules (e.g., power management module) of the electronic device, and the present application does not limit this.
[0101] It is understandable that the CPU of the electronic device and one or more hosts in its SPMI system can be in the same SoC or in different SoCs.
[0102] In some embodiments of the present application, the IC device may be any of the following: Field Programmable Gate Array (FPGA), MCU, active device circuit, Application Specific Integrated Circuit (ASIC). The relevant meanings of FPGA, MCU, active device circuit and ASIC can be referred to in relevant technical documents, and the present application does not elaborate on them here. Of course, the IC device may also be other types of integrated circuit devices, and the present application does not limit their specific types.
[0103] Further, based on Figure 4 The SPMI system architecture is shown, and an address configuration method of an IC device provided in an embodiment of the present application is specifically introduced below.
[0104] According to the above, in some embodiments of the present application, multiple IC devices can be connected to the CPU through a communication interface of the CPU (such as Figure 4 As shown in FIG. 1 ), the multiple IC devices can communicate with the CPU, so that the CPU and multiple IC devices can communicate with each other through only one communication interface, which reduces the occupation of the CPU communication interface and makes it more convenient to layout the SPMI system in the electronic device. In this case, the multiple IC devices can be configured with different addresses to ensure normal communication with the CPU.
[0105] In some embodiments of the present application, Figure 5As shown, IC devices can set the 4 GPIO (General Purpose Input / Output Port) of their pins (such as Figure 5 Specifically, the 4 GPIOs of the IC device can be connected to pull-up resistors (such as Figure 5 R1-R4 as shown) or a pull-down resistor (such as Figure 5 R5-R8 shown in the figure), after the GPIO is connected to the pull-up resistor, it corresponds to a high level, which can be represented by 1, and after the GPIO is connected to the pull-down resistor, it corresponds to a low level, which can be represented by 0. In this way, the levels corresponding to the 4 GPIOs of the corresponding pins of an IC device (that is, the pins of the configuration address) can be represented as 0000~1111, which means that in this way, there are 16 addresses that can be configured for the IC device. These 16 addresses are represented by 0000~1111 in binary, and can be represented by 0x0~0xF in hexadecimal.
[0106] It is understandable that the pins of the IC device configuration address can be set according to actual needs, and this application does not impose specific restrictions on this. It is understandable that the number of GPIOs set by the IC device configuration address can be determined based on the number of IC devices in the SPMI system. For ease of description, this application records the number of GPIOs set by the IC device configuration address as m. Among them, 2 to the power of m is not less than the number of IC devices in the SPMI system. It is understandable that 2 to the power of m represents the number of addresses that can be configured for the IC device. For example, Figure 5 As shown, the IC device is provided with 4 GPIOs, which means that the number of configurable addresses of the IC device is 16. In this case, the number of slaves in the SPMI system is not greater than 16. It can be understood that m is an integer not greater than 4.
[0107] In some embodiments of the present application, the number of GPIOs set by each IC device configuration address in the SPMI system can be set based on the number of slaves in the SPMI system (equal to the number of IC devices). For example, when the number of slaves in the SPMI system is not greater than 8, the number of GPIOs set by each IC device configuration address in the SPMI system can be 3. For another example, when the number of slaves in the SPMI system is not greater than 4, the number of GPIOs set by each IC device configuration address in the SPMI system can be 2. For another example, when the number of slaves in the SPMI system is not greater than 2, the number of GPIOs set by each IC device configuration address in the SPMI system can be 1.
[0108] In some embodiments of the present application, the number of GPIOs set by the configuration address of each IC device in the SPMI system is the same.
[0109] It is understandable that the resistance values of the pull-up resistor and the pull-down resistor connected to the IC device can be set according to actual needs, and this application does not impose specific restrictions on this. Figure 5 The resistance values of R1-R8 shown can be the same or different and can be specifically set according to actual needs.
[0110] A bus instruction control method provided by an embodiment of the present application is introduced below from the perspective of device interaction in an SPMI system.
[0111] See also Figure 6 , Figure 6 A schematic diagram of an SPMI system interaction provided in an embodiment of the present application. Figure 6 Taking the interaction between an IC device and a host and a slave in an SPMI system as an example, a bus instruction control method provided in an embodiment of the present application is introduced.
[0112] like Figure 6 As shown, the host can send an SPMI bus instruction to the SPMI bus, the IC device can receive the SPMI bus instruction on the SPMI bus (or monitor the instruction on the SPMI bus), and identify the SPMI bus instruction. The IC device can identify whether the SPMI bus instruction involves specific data of the target slave, and whether the SPMI bus instruction is a write instruction or a read instruction. When the IC device determines that the SPMI bus instruction it receives involves specific data of the target slave, and the SPMI bus instruction is a read instruction, the IC device can read the original data from the corresponding read-only memory (ROM) partition and send the original data to the host. When the IC device determines that the SPMI bus instruction it receives involves specific data of the target slave and the SPMI bus instruction is a write instruction, the IC device can further determine whether the SPMI bus instruction needs to be modified. If the IC device needs to modify the SPMI bus instruction, the IC device can modify the SPMI bus and send the modified SPMI bus instruction to the connected slave. If the IC device does not need to modify the SPMI bus instruction, the IC device can directly pass the received SPMI bus instruction to the corresponding connected slave (i.e., the target slave).
[0113] It can be understood that, for an IC device, the corresponding connected slave is its target slave. Figure 4 As shown, the target slave of IC1 is slave 1, the target slave of IC2 is slave 2, the target slave of IC3 is slave 3, and the target slave of ICN is slave N.
[0114] In some embodiments of the present application, the specific data may be data stored in a specific register. In this case, the specific data of the target slave is data stored in a specific register of the target slave, and the original data is original configuration data (or standard configuration data, i.e., original register data mentioned below) corresponding to the specific register of the target slave.
[0115] In some embodiments of the present application, the specific data may be data of a specific type, such as a power supply voltage. In this case, the original data is a standard power supply voltage corresponding to the target slave.
[0116] In some embodiments of the present application, the specific manner in which the IC device identifies the SPMI device can refer to step S102-step S103, which is not elaborated in this application.
[0117] In some embodiments of the present application, the specific manner in which the IC device determines whether the SPMI bus instruction involves specific data of the target slave device can refer to step S104, which is not elaborated in this application.
[0118] In some embodiments of the present application, the IC device may determine whether the SPMI bus instruction needs to be modified according to a preset configuration rule. In some embodiments of the present application, if the specific data of the target slave involved in the SPMI bus instruction is within a preset range, the IC device may not modify the SPMI bus instruction. In some embodiments of the present application, if the specific data of the target slave involved in the SPMI bus instruction is less than threshold 1 (or not greater than threshold 1), the IC device may increase the corresponding data in the SPMI bus instruction, and if the specific data of the target slave involved in the SPMI bus instruction is greater than threshold 2 (or not less than threshold 2), the IC device may reduce the corresponding data in the SPMI bus instruction.
[0119] In some embodiments of the present application, the minimum value of the preset range may be threshold 1, and the maximum value of the preset range may be threshold 2.
[0120] It is understandable that threshold 1 and threshold 2 can be set according to actual needs, and the present application does not limit this. In some embodiments of the present application, threshold 1 and threshold 2 can be equal.
[0121] It is understandable that other implementations of the preset configuration rules can be found below, and this application will not elaborate on them here.
[0122] In some embodiments of the present application, when it is determined that the SPMI bus instruction involves specific data of the target slave machine and the SPMI bus instruction is a write instruction, the IC device can directly modify the SPMI bus instruction (for example, modify the SPMI bus instruction according to a preset configuration rule) without first determining whether the SPMI bus instruction needs to be modified. The specific implementation method can refer to step S106.
[0123] In some embodiments of the present application, the IC device can be connected to the CPU, and the CPU can be used to configure and control the working mode of the IC device. The connection method between the IC device and the CPU can be specifically referred to above (such as Figure 4 As shown), this application will not be repeated here.
[0124] In some embodiments of the present application, the CPU may control the IC device to switch the working mode through an Inter-Integrated Circuit (I2C) bus. In some other embodiments of the present application, the CPU may control the IC device to switch the working mode through a Serial Peripheral Interface (SPI) bus. In some embodiments of the present application, the CPU may send an instruction to the IC device through a corresponding bus (e.g., I2C or SPI) to notify the IC device to switch the working mode.
[0125] In some embodiments of the present application, the working mode of the IC device may include a first mode and a second mode. When the IC device adopts the first mode, the IC device can identify the SPMI bus and process the SPMI bus instruction (for example, modify the SPMI bus instruction), and the specific process can refer to the above. When the IC device adopts the second mode, such as Figure 6 As shown, the IC device can transparently transmit the corresponding instructions. For example, the IC device can directly send the SPMI bus instructions sent by the host to the SPMI bus to the slave (ie, the target slave) connected to the IC device without identifying and processing it.
[0126] In some embodiments of the present application, the first mode may be a normal mode, and the second mode may be a low power consumption mode.
[0127] In some embodiments of the present application, the CPU can determine the operating mode that the IC device needs to adopt, and notify the IC device to switch the operating mode when the IC device needs to switch the operating mode. In some embodiments of the present application, the CPU can determine the operating mode that the IC device needs to adopt based on the power consumption of the electronic device. Of course, the CPU can also determine the operating mode that the IC device needs to adopt in combination with other factors (for example, the screen on and off status of the electronic device, whether the electronic device is in a specific mode such as night mode or flight mode, etc.), and the present application does not limit this.
[0128] In some embodiments of the present application, the IC device uses the second mode by default. That is, after the user triggers the electronic device to turn on, the IC device in the electronic device first uses the second mode.
[0129] In some embodiments of the present application, Figure 6 As shown, IC devices can be connected to resistors to configure their addresses. The specific implementation method can be found in the above ( Figure 5 ), this application will not go into details here.
[0130] A specific implementation of the above embodiment is introduced below.
[0131] See also Figure 7 , Figure 7 A bus instruction control method is provided in an embodiment of the present application. The method can be applied to each IC device connected to a slave in an SPMI system. The method may include but is not limited to the following steps:
[0132] S101: monitor the SPMI bus instructions sent by the host.
[0133] The IC device can monitor the instructions sent by the host to the SPMI bus, that is, the SPMI bus instructions.
[0134] S102: Determine whether the slave address in the SPMI bus instruction is the same as the address of the target slave.
[0135] If the IC device monitors the SPMI bus instruction sent by the host, it can identify the SPMI bus instruction, and specifically identify whether the SPMI bus instruction is an SPMI bus instruction sent to the target slave, that is, determine whether the SPMI bus instruction is an instruction sent to the slave connected to the IC device. Specifically, the IC device can parse the SPMI bus instruction, obtain the slave address in the SPMI bus instruction, and determine whether the slave address in the SPMI bus instruction is the address of the target slave. If the slave address in the SPMI bus instruction is the same as the address of the target slave, the IC device can continue to execute steps S103-S112. If the slave address in the SPMI bus instruction is not the same as the address of the target slave, it means that the SPMI bus instruction is not an instruction sent to the slave connected to the IC device. In this case, the IC device does not need to process the SPMI bus instruction.
[0136] It can be understood that the slave address in the SPMI bus instruction can be the target address in the SPMI bus instruction mentioned above.
[0137] S103: Parse the register address and data carried by the SPMI bus instruction.
[0138] According to the above, in some embodiments of the present application, the SPMI bus instruction may include the register address and data of the slave. It is understandable that when the IC device determines that the slave address in the SPMI bus instruction it monitors is the same as the address of the target slave, the IC device can parse the register address (the register address of the slave mentioned above) and data (including the data corresponding to the register address) carried by the SPMI bus instruction.
[0139] S104: Determine whether the SPMI bus instruction carries a preset register address.
[0140] After the IC device parses the register address and data carried by the SPMI bus instruction, it can determine whether the SPMI bus instruction carries a preset register address, and specifically, it can determine whether the register address in the SPMI bus instruction obtained by the parsing includes the preset register address. If the register address in the SPMI bus instruction obtained by the IC device parses includes the preset register address, it means that the SPMI bus instruction carries the preset register address. In this case, the IC device can execute step S105. If the register address in the SPMI bus instruction obtained by the IC device parses does not include the preset register address, it means that the SPMI bus instruction does not carry the preset register address. In this case, the IC device can execute step S112, that is, the IC device can directly send the SPMI bus instruction to the target slave.
[0141] In some embodiments of the present application, the preset register address can be set according to actual needs, and the present application does not impose specific restrictions on this. For example, the preset register address can be a register address corresponding to the slave that stores specific data. It can be understood that according to the above, the specific data can be data of a specific type (or category), such as power supply voltage.
[0142] It is understandable that the preset register address in each IC device can be set based on the register address of the slave device to which it is connected. In some embodiments of the present application, in the SPMI system, the register addresses storing specific data corresponding to different slave devices may be different from each other. In this case, the preset register addresses set in each IC device are also different from each other.
[0143] S105: Determine whether the SPMI bus instruction is a write instruction or a read instruction.
[0144] In the case where the SPMI bus instruction monitored by the IC device carries a preset register address, the IC device can determine the instruction type of the SPMI bus instruction, that is, determine whether the SPMI bus instruction is a write instruction or a read instruction. In the case where the SPMI bus instruction is a write instruction, the IC device can execute steps S106-S109, and in the case where the SPMI bus instruction is a read instruction, the IC device can execute steps S110-S111.
[0145] In some embodiments of the present application, when the SPMI bus instruction monitored by the IC device carries a preset register address, the IC device can determine the instruction type of the SPMI bus instruction, and specifically can determine whether the SPMI bus instruction is a write instruction. If the SPMI bus instruction is a write instruction, the IC device can execute steps S106-S109, and if the SPMI bus instruction is not a write instruction, the SPMI bus instruction is a read instruction, in which case the IC device can execute steps S110-S111.
[0146] S106: Modify the data corresponding to the preset register address in the SPMI bus instruction according to the preset configuration rule to obtain a modified SPMI bus instruction.
[0147] When the SPMI bus instruction monitored by the IC device is a write instruction, the IC device can modify the data corresponding to the preset register address in the SPMI bus instruction according to the preset configuration rule to obtain the modified SPMI bus instruction.
[0148] In some embodiments of the present application, the preset register may be a register of the target slave for storing the power supply voltage (ie, the power supply register of the target slave), and the data corresponding to the preset register address may be the power supply voltage.
[0149] In some embodiments of the present application, the preset configuration rule may include: adjusting the power supply voltage according to the first voltage threshold and the second voltage threshold. Specifically, when the power supply voltage is less than the first voltage threshold, the power supply voltage is reduced by a1, when the power supply voltage is greater than or equal to the first voltage threshold and less than the second voltage threshold, the power supply voltage is reduced by a2, and when the power supply voltage is greater than or equal to the second voltage threshold, the power supply voltage is reduced by a3.
[0150] That is, the IC device modifies the data corresponding to the preset register address in the SPMI bus instruction according to the preset configuration rule, which may specifically include: when the data corresponding to the preset register in the SPMI bus instruction is less than the first voltage threshold, the IC device can reduce a1 on the basis of the data to obtain a modified SPMI bus instruction, that is, the data corresponding to the preset register address in the modified SPMI bus instruction is a1 lower than the corresponding data in the original SPMI bus instruction, and when the data corresponding to the preset register in the SPMI bus instruction is greater than or equal to the first voltage threshold and less than the second voltage threshold, the IC device can reduce a2 on the basis of the data to obtain a modified SPMI bus instruction, that is, the data corresponding to the preset register address in the modified SPMI bus instruction is a2 lower than the corresponding data in the original SPMI bus instruction, and when the data corresponding to the preset register in the SPMI bus instruction is greater than or equal to the second voltage threshold, the IC device can reduce a3 on the basis of the data to obtain a modified SPMI bus instruction, that is, the data corresponding to the preset register address in the modified SPMI bus instruction is a3 lower than the corresponding data in the original SPMI bus instruction.
[0151] It is understandable that the first voltage threshold is less than the second voltage threshold. The first voltage threshold and the second voltage threshold can be set according to actual needs, and the present application does not limit this. For example, the first voltage threshold can be 2 volts (V), and the second voltage threshold can be 3V.
[0152] It is understandable that a1, a2 and a3 can be set according to actual needs, and the present application does not limit this. In some embodiments of the present application, a1 is less than a2, and a2 is less than a3. For example, a1 can be 100 millivolts (mV), a2 can be 200 mV, and a3 can be 300 mV.
[0153] In some embodiments of the present application, the preset configuration rule may include: adjusting the power supply voltage according to the third voltage threshold and the fourth voltage threshold. Specifically, when the power supply voltage is less than the third voltage threshold, the power supply voltage is increased, when the power supply voltage is greater than or equal to the third voltage threshold and less than the fourth voltage threshold, the power supply voltage is not adjusted, and when the power supply voltage is greater than or equal to the fourth voltage threshold, the power supply voltage is reduced. In a possible implementation, the preset configuration rule may also include: further setting a voltage threshold to increase the power supply voltage, such as setting one or more ranges, the power supply voltage falls within different ranges, and the corresponding step size of increasing the power supply voltage is different. For details, please refer to the implementation method of setting the range to reduce the power supply voltage above. Similarly, the preset configuration rule may also include: further setting a voltage threshold to reduce the power supply voltage, such as setting one or more ranges, the power supply voltage falls within different ranges, and the corresponding step size of reducing the power supply voltage is different. For details, please refer to the above, and this application will not repeat them.
[0154] It is understandable that the third voltage threshold is less than the fourth voltage threshold. The third voltage threshold and the fourth voltage threshold can be set according to actual needs, and this application does not limit this.
[0155] S107: As the host, send the modified SPMI bus instruction to the target slave.
[0156] After the IC device obtains the modified SPMI bus instruction, it can act as a host to send the modified SPMI bus instruction to a target slave, that is, the slave to which the IC device is connected.
[0157] Exemplarily, the address of the slave (ie, the target slave) to which the IC device is connected may be 0x2, the address of the power register of the slave is 0x1234, and the preset register address in the IC device is the address of the power register of the target slave, ie, 0x1234. After the IC device listens to a SPMI bus instruction, it can parse (or identify) the SPMI bus instruction. First, the DeviceAddr address bit is parsed and its content is determined to be 0x2, which means that the SPMI bus instruction is sent to the slave with address 0x2. The IC device can determine that the address is the same as the address of the target slave of the IC device. Further, the IC device can continue to parse the CMD command bit and determine that the instruction type of the SPMI bus instruction is a write instruction. Further, the IC device can continue to parse the DataAddr register address bit and determine that its content is 0x1234, which means that the SPMI bus instruction is an instruction for the register with address 0x1234. The IC device can determine that the content of the register address is the same as the preset register address. Further, the IC device can continue to parse the Data data bit and determine that its content is h'0708, and the parsing of the SPMI bus instruction is completed. After the IC device completes the parsing, it can determine the voltage value in the SPMI bus instruction. It can be understood that h'0708 is converted to decimal as 1800, so the IC device can determine that the data corresponding to the power register in the SPMI bus instruction is 1800mV, that is, the voltage value (i.e., the power supply voltage) carried by the SPMI bus instruction is 1800mV. Further, the IC device can determine that the voltage value in the SPMI bus instruction is less than 2V, so the IC device can reduce the voltage value by 100mV to obtain a new voltage value, i.e., 1700mV, and send the SPMI bus instruction carrying the new voltage value to the slave with the address 0x2.
[0158] In some embodiments of the present application, the slave to which the IC device is connected is a third-party device that only supports other third-party protocols but not the SPMI protocol. In this case, the IC device can convert the modified SPMI bus instructions into instructions supported by the third-party protocol and then send the converted instructions to the slave to which it is connected.
[0159] S108: Determine whether the target slave needs to respond to the SPMI bus instruction.
[0160] In the case where the SPMI bus instruction monitored by the IC device is a write instruction, the IC device can determine whether the target slave needs to respond to the SPMI bus instruction. If the target slave needs to respond to the SPMI bus instruction, the IC device not only needs to execute steps S106-S107, but also needs to execute step S109, that is, the IC device can simulate the target slave to seize the SPMI bus, and respond to the host that it has received the SPMI bus instruction sent by it. It can be understood that the relevant description of seizing the bus can refer to the above and other relevant technical documents, and this application will not be described in detail here. If the target slave does not need to respond to the SPMI bus instruction, the IC device only needs to execute steps S106-S107, and there is no need to execute step S109.
[0161] S109: Simulate the target slave to seize the SPMI bus, and respond to the host that the SPMI bus instruction sent by the host has been received.
[0162] In the case that the target slave needs to respond to the SPMI bus instruction, the IC device can simulate the target slave to seize the SPMI bus and respond to the host that the SPMI bus instruction sent by it has been received.
[0163] S110: Acquire original register data corresponding to the target slave from the corresponding ROM partition. The original register data is original configuration data corresponding to a preset register address.
[0164] When the SPMI bus instruction monitored by the IC device is a read instruction, the IC device can obtain the original register data corresponding to the target slave from the corresponding ROM partition. The corresponding ROM partition can be understood as: a ROM partition in the IC device that stores the original configuration data corresponding to the preset register address. It can be understood that the original configuration data may include the original register data corresponding to the target slave.
[0165] In some embodiments of the present application, the original register data may be a configured standard power supply voltage (or an original / original configured power supply voltage).
[0166] It is understandable that the IC device may include a storage module, which may be used to store original configuration data. In some embodiments of the present application, the storage module may include one or more ROM partitions. In the case where the storage module includes multiple ROM partitions, the multiple ROM partitions may store different original configuration data (e.g., different categories of original configuration data).
[0167] Exemplarily, as shown in Table 1, the IC device may include any one or more of the following ROM partitions: ROM partition 1, ROM partition 2, ROM partition 3, ROM partition 4, ROM partition 5, and ROM partition 6. The address of ROM partition 1 is 0x00, the address of ROM partition 2 is 0x01, the address of ROM partition 3 is 0x02, the address of ROM partition 4 is 0x03, the address of ROM partition 5 is 0x04, and the address of ROM partition 6 is 0x05. ROM partition 1 stores chip version information, ROM partition 2 stores chip software version information, ROM partition 3 stores chip working state information (e.g., standby, abnormal, working, etc.), ROM partition 4 stores chip working mode information (e.g., normal mode, low power mode, etc.), ROM partition 5 stores power information (e.g., power voltage), and ROM partition 6 stores power working mode information.
[0168] Table 1
[0169]
[0170] Exemplarily, the address of the slave (ie, the target slave) to which the IC device is connected may be 0x2, the address of the power register of the slave is 0x1234, and the preset register address in the IC device is the address of the power register of the target slave, ie, 0x1234. After the IC device listens to a SPMI bus instruction, it can parse (or identify) the SPMI bus instruction. First, the DeviceAddr address bit is parsed and its content is determined to be 0x2, which means that the SPMI bus instruction is sent to the slave with address 0x2. The IC device can determine that the address is the same as the address of the target slave of the IC device. Further, the IC device can continue to parse the CMD command bit and determine that the instruction type of the SPMI bus instruction is a read instruction. Further, the IC device can continue to parse the DataAddr register address bit and determine that its content is 0x1234, which means that the SPMI bus instruction is an instruction for the register with address 0x1234. The IC device can determine that the register address is the same as the preset register address, which means that the SPMI bus instruction is to read the data in the power register of the target slave, that is, to read the power supply voltage stored in the power register of the target slave. At this time, the parsing of the SPMI bus instruction is completed. After the IC device completes the parsing, since the power supply information is stored in ROM partition 5, the IC device can read the power supply voltage from ROM partition 5. It can be understood that the power supply voltage read by the IC device from ROM partition 5 is the configured standard power supply voltage.
[0171] S111: Simulate the target slave to seize the SPMI bus and send original register data to the host.
[0172] After the IC device obtains the original register data, it can simulate the target slave to seize the SPMI bus and send the original register data to the host.
[0173] S112: directly send the SPMI bus instruction to the target slave.
[0174] When the SPMI bus instruction monitored by the IC device does not carry a preset register address, the IC device can directly send the SPMI bus instruction to the target slave, that is, transparently transmit the SPMI bus instruction to the target slave.
[0175] The following is an illustrative introduction to a software module in an IC device, and a specific implementation of the above embodiment is introduced based on the software module in the IC device.
[0176] In some embodiments of the present application, Figure 8 As shown, the IC device may include a port (e.g., a host port, a slave port, and other ports, etc.), a protocol parsing module, a data forwarding control module, an IC configuration module, and a storage module. Among them, the port can be understood as a communication port between the IC device and other modules (e.g., CPU, host, slave, etc.). Specifically, the IC device can communicate with the host through the host port, and the IC device can communicate with the slave through the slave port. The protocol parsing module can be used to parse the instructions (e.g., SPMI bus instructions) monitored or received by the IC device. The data forwarding control module can be used to forward instructions or other data to other modules. The IC configuration module can be used to configure the working mode of the IC device and modify the instructions (e.g., SPMI bus instructions) monitored or received by the IC device, and can also include other configuration information. The storage module can be used to store original configuration data (e.g., the original configuration data of the power register of the target slave).
[0177] In some embodiments of the present application, the IC configuration module may include a slave configuration module and a slave data forwarding module. The slave configuration module may be used to configure the working mode of the IC device and modify the instructions (e.g., SPMI bus instructions) monitored or received by the IC device, and the slave data forwarding module may be used to control the forwarding of instructions sent by the slave.
[0178] In some embodiments of the present application, the IC configuration module can be divided into multiple software modules, each responsible for different configuration information. Figure 8The IC configuration module shown can be divided into two software modules, one of which can be called an IC working mode control module, and the other software module can use the original name, namely, the IC configuration module. In this case, the IC working mode control module can be used to configure the working mode of the IC device, modify instructions, and control data forwarding from the slave to the host, and the IC configuration module may include other configuration information.
[0179] like Figure 8 As shown, the IC device can receive the SPMI bus instruction through the host port. After receiving the SPMI bus instruction through the host port, the protocol parsing module in the IC device can parse the SPMI bus instruction. Specifically, when the slave address parsed in the SPMI bus instruction is the same as the address of the target slave, and the SPMI bus instruction carries a preset register address, the protocol parsing module can send the data corresponding to the preset register address to the IC configuration module in the IC device. In some embodiments of the present application, the protocol parsing module can send the data corresponding to the preset register address and the SPMI bus instruction together to the IC configuration module.
[0180] In the case where the SPMI bus instruction is a write instruction, after the IC configuration module receives the data corresponding to the preset register address, the data corresponding to the preset register address carried by the SPMI bus instruction can be modified to obtain the modified data corresponding to the preset register address, and the modified SPMI bus instruction. In some embodiments of the present application, the IC device can modify the data corresponding to the preset register address carried by the SPMI through the slave configuration module in the IC configuration module. After the IC configuration module obtains the modified SPMI bus instruction, the modified SPMI bus instruction can be sent to the data forwarding control module in the IC device. After the data forwarding control module receives the modified SPMI bus instruction, the modified SPMI bus instruction can be sent to the target slave through the slave port.
[0181] In the case where the SPMI bus instruction is a read instruction, after the IC configuration module receives the data corresponding to the preset register address, it can read the original register data from the corresponding ROM partition of the storage module and send the original register data to the data forwarding control module. After the data forwarding control module receives the original register data, it can send the original register data to the host through the host port.
[0182] In some embodiments of the present application, the IC device can configure its working mode through the IC configuration module. According to the above, the working mode of the IC device may include a first mode and a second mode. When the IC device adopts the first mode, the IC device can process the instructions it receives according to the above content, and when the IC device adopts the second mode, after the IC device receives the SPMI bus instruction through the host port, it can directly send the SPMI bus instruction to the target slave through the slave port through the data forwarding control module, without parsing it through the protocol parsing module, and without processing it through the IC configuration module.
[0183] In some embodiments of the present application, the default working mode of the IC device may be the second mode.
[0184] In some embodiments of the present application, the IC device may receive instructions for switching the working mode sent by the CPU through other ports. After the IC device receives the instruction, the protocol parsing module in the IC device may parse the instruction and then send the parsing result to the IC configuration module. After the IC configuration module receives the parsing result, it may configure the switched working mode. After the IC configuration module configures the switched working mode, the IC device may use the switched working mode to process the received instruction (for example, directly forward the instruction, or forward the instruction after performing corresponding processing).
[0185] It is understandable that the specific triggering conditions for the CPU to send an instruction to switch the working mode to the IC device can be referred to above, and this application does not impose any restrictions on this.
[0186] In some embodiments of the present application, the IC device may include a port, a bus monitoring module, a register response module, a bus response module, a slave data cache module, and a protocol conversion module. The relevant description of the port can refer to the above, and the present application will not repeat it here. The bus monitoring module can realize the monitoring and parsing of the SPMI bus instruction, and trigger other modules to work when the slave address parsed in the SPMI bus instruction is the same as the address of the target slave. The register response module is used to address the original configuration data pre-stored in the internal corresponding ROM, and send the data to the host through the SPMI bus. It can be understood that the register response module is triggered by a read instruction. That is, when the bus monitoring module monitors the SPMI bus instruction including the target slave address, and the instruction is a read instruction, the register response module in the IC device executes the above content (i.e., obtains and sends the corresponding original configuration data). The bus response module is used to simulate the slave seizing the bus and responding to the host. It can be understood that when the IC device determines that the SPMI bus instruction needs to be responded, the bus response module in the IC device executes the above content. The slave data cache module is used to cache write instructions, and trigger the protocol conversion module to parse the SPMI bus instruction and modify the data it carries. The protocol parsing module can also be used for protocol conversion, such as converting instructions supporting the SPMI protocol into instructions supporting other protocols.
[0187] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A bus instruction control method, characterized in that: The method is applied to an integrated circuit device, one end of which is connected to one or more hosts via a system power management interface SPMI bus, and the other end of which is connected to a first slave, and both the host and the first slave support the SPMI protocol. The method includes: Monitoring a first instruction sent by the host to the SPMI bus; In the case where the slave address included in the first instruction is the same as the address of the first slave, the first instruction includes a preset register address, and the first instruction is a write instruction, modify the first data in the first instruction to obtain second data, and send the second instruction to the first slave; the first data is the data corresponding to the preset register address included in the first instruction; the second data is the data corresponding to the preset register address included in the second instruction; the data corresponding to the preset register address includes data to be stored in the register corresponding to the preset register address; In a case where the slave address included in the first instruction is the same as the address of the first slave and the first instruction does not include a preset register address, the first instruction is sent to the first slave.
2. The method according to claim 1, characterized in that After monitoring the first instruction sent by the host to the SPMI bus, the method further includes: parsing the first instruction; In the process of parsing the first instruction, determine whether the slave address included in the first instruction is the same as the address of the first slave; if the slave address included in the first instruction is the same as the address of the first slave, determine whether the first instruction includes the preset register address; if the first instruction includes the preset register address, determine whether the first instruction is a write instruction.
3. The method according to claim 1 or 2, characterized in that The preset register address is the address of the power register, and the first data includes a first voltage value; and modifying the first data in the first instruction includes: When the first voltage value is less than a first voltage threshold, the first voltage value is reduced by a1 to obtain the second data; When the first voltage value is greater than or equal to the first voltage threshold and less than a second voltage threshold, the first voltage value is reduced by a2 to obtain the second data; When the first voltage value is greater than or equal to the second voltage threshold, reducing the first voltage value by a3 to obtain the second data; Wherein, a1 is smaller than a2, and a2 is smaller than a3.
4. The method according to claim 1 or 2, characterized in that: After monitoring the first instruction sent by the host to the SPMI bus, the method further includes: When the slave address included in the first instruction is the same as the address of the first slave, and the first instruction includes the preset register address, and the first instruction is a read instruction, obtaining third data; the third data is original configuration data corresponding to the preset register address; The first slave is simulated to seize the SPMI bus, and sends the third data to the host.
5. The method according to claim 4, characterized in that The integrated circuit device includes one or more ROM partitions, and the one or more ROM partitions store original configuration data of different categories; the one or more ROM partitions include a first partition, and the category of the original configuration data stored in the first partition is the same as the category of the data corresponding to the preset register address; The acquiring the third data includes: acquiring the third data from the first partition.
6. The method according to claim 1 or 2, characterized in that: After monitoring the first instruction sent by the host to the SPMI bus, the method further includes: In a case where the slave address included in the first instruction is the same as the address of the first slave, the first instruction includes a preset register address, and the first instruction is a write instruction, determining whether the first slave needs to respond to the first instruction; In the case that the first slave needs to respond to the first instruction, the first slave is simulated to seize the SPMI bus, and responds to the host that the first instruction has been received.
7. The method according to claim 1 or 2, characterized in that: The integrated circuit device is connected to a central processing unit CPU; after sending the second instruction to the first slave, the method further includes: receiving a third instruction sent by the CPU; Based on the third instruction, switching the working mode from the first mode to the second mode; After the working mode is switched to the second mode, the instructions sent from the host to the SPMI bus are monitored, and the instructions sent from the host to the SPMI bus are sent to the first slave.
8. The method according to claim 7, characterized in that The third instruction includes the address of the integrated circuit device; the address of the integrated circuit device is determined by a pull-up resistor or a pull-down resistor connected to the integrated circuit device through one or more pins.
9. An integrated circuit device, characterized in that: The integrated circuit device includes a processing module, and the integrated circuit device is coupled to a memory in an electronic device; the memory is used to store program instructions; the processing module is used to read and execute the program instructions, so that the integrated circuit device executes the bus instruction control method as described in any one of claims 1 to 8.
10. An SPMI system, characterized in that: The SPMI system includes one or more hosts, an SPMI bus, one or more integrated circuit devices as described in claim 9, and one or more slaves, wherein the one or more hosts are respectively connected to the SPMI bus, and one end of each of the one or more integrated circuit devices is connected to the SPMI bus, and the other end is connected to the corresponding slave.
11. The SPMI system according to claim 10, characterized in that: In the case where the SPMI system includes multiple integrated circuit devices as described in claim 9, the address of each of the multiple integrated circuit devices is determined by a pull-up resistor or a pull-down resistor connected to itself through one or more pins; the addresses of the multiple integrated circuit devices are different from each other.
12. An electronic device, characterized in that: The electronic device comprises the SPMI system and a memory as claimed in claim 10; the SPMI system is coupled to the memory; and the memory is used to store program instructions.
13. A computer storage medium, characterized in that: The computer storage medium stores program instructions, and when the program instructions are executed on an integrated circuit device, the integrated circuit device executes the bus instruction control method according to any one of claims 1 to 8.
