CN116501390A - Multi-firmware switching method, device, terminal equipment and storage medium - Google Patents

Multi-firmware switching method, device, terminal equipment and storage medium Download PDF

Info

Publication number
CN116501390A
CN116501390A CN202210059709.3A CN202210059709A CN116501390A CN 116501390 A CN116501390 A CN 116501390A CN 202210059709 A CN202210059709 A CN 202210059709A CN 116501390 A CN116501390 A CN 116501390A
Authority
CN
China
Prior art keywords
firmware
scene
peripheral
sdio
chip
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210059709.3A
Other languages
Chinese (zh)
Inventor
张晨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202210059709.3A priority Critical patent/CN116501390A/en
Publication of CN116501390A publication Critical patent/CN116501390A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/24Handling requests for interconnection or transfer for access to input/output bus using interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • G06F13/4286Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus using a handshaking protocol, e.g. RS232C link
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • G06F13/4291Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus using a clocked protocol
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application discloses a method, a device, terminal equipment and a storage medium for switching multiple firmware, which are used for separately maintaining multiple firmware, and each scene firmware is not coupled, so that the scene firmware can be switched rapidly. The method comprises the following steps: loading corresponding first scene firmware through secure digital input/output SDIO according to a first scene currently used; and when the scene firmware is switched, reentering the initialization state of the peripheral register, and loading the second scene firmware through the SDIO.

Description

Multi-firmware switching method, device, terminal equipment and storage medium
Technical Field
The present invention relates to the field of terminal devices, and in particular, to a method and apparatus for switching multiple firmware, a terminal device, and a storage medium.
Background
Most of single-chip multi-firmware schemes at present have some defects, such as the switching between the firmware needs to perform power-off and power-on operations on the chip, and some peripheral devices need time to enter a stable state when the chip is powered on again, so that the switching time of the firmware is prolonged.
Disclosure of Invention
The embodiment of the application provides a method, a device, terminal equipment and a storage medium for switching multiple firmware, which are used for maintaining multiple firmware separately, and each scene firmware is not coupled, so that the scene firmware can be switched rapidly.
A first aspect of the present application provides a method for multi-firmware handover, which may include:
loading corresponding first scene firmware through secure digital input/output SDIO according to a first scene currently used;
and when the scene firmware is switched, reentering the initialization state of the peripheral register, and loading the second scene firmware through the SDIO.
A second aspect of the present application provides an apparatus for multi-firmware handover, which may include:
the processing module is used for loading corresponding first scene firmware through the Secure Digital Input Output (SDIO) according to the first scene which is currently used; and when the scene firmware is switched, reentering the initialization state of the peripheral register, and loading the second scene firmware through the SDIO.
A third aspect of the present application provides an apparatus for multi-firmware handover, which may include:
the control chip is used for loading corresponding first scene firmware through the Secure Digital Input Output (SDIO) according to the first scene which is currently used; and when the scene firmware is switched, reentering the initialization state of the peripheral register, and loading the second scene firmware through the SDIO.
A fourth aspect of the present application provides a terminal device, which may include an apparatus for multi-firmware handover as described in the second aspect of the present application.
Yet another aspect of an embodiment of the present application provides a computer-readable storage medium comprising instructions which, when run on a processor, cause the processor to perform the method described in the first aspect of the present application.
In yet another aspect, an embodiment of the invention discloses a computer program product, which when run on a computer causes the computer to perform the method according to the first aspect of the application.
In yet another aspect, an embodiment of the present invention discloses an application publishing platform, which is configured to publish a computer program product, where the computer program product, when run on a computer, causes the computer to perform the method according to the first aspect of the present application.
From the above technical solutions, the embodiments of the present application have the following advantages:
in the embodiment of the application, according to a first scene which is currently used, loading corresponding first scene firmware through Secure Digital Input Output (SDIO); and when the scene firmware is switched, reentering the initialization state of the peripheral register, and loading the second scene firmware through the SDIO. The method is used for maintaining a plurality of firmware separately, each scene firmware is not coupled, development is facilitated, the scene firmware can be switched rapidly, and the firmware customized according to the scene is more beneficial to optimizing performance and power consumption.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly introduce the drawings that are needed in the embodiments and the description of the prior art, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings.
FIG. 1 is a schematic diagram of one embodiment of a method for multi-firmware handoff in an embodiment of the present application;
FIG. 2 is a schematic diagram of a firmware boot loader process according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a software running sequence in an embodiment of the present application;
FIG. 4 is a schematic diagram of another embodiment of a method for multi-firmware handoff in an embodiment of the present application;
FIG. 5 is a schematic diagram of firmware storage in an embodiment of the present application;
FIG. 6 is a schematic diagram of one embodiment of an apparatus for multi-firmware switching in an embodiment of the present application;
FIG. 7 is a schematic diagram of another embodiment of a device for multi-firmware switching in an embodiment of the present application;
FIG. 8 is a schematic diagram of an embodiment of a terminal device according to an embodiment of the present application
Fig. 9 is a schematic diagram of another embodiment of a terminal device in an embodiment of the present application.
Detailed Description
The embodiment of the application provides a method, a device, terminal equipment and a storage medium for switching multiple firmware, which are used for maintaining multiple firmware separately, and each scene firmware is not coupled, so that the scene firmware can be switched rapidly.
In order for those skilled in the art to better understand the present application, the following description will describe embodiments of the present application with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. Based on the examples in this application, all shall fall within the scope of protection of this application.
The current chip is designed to have very powerful functions, and often a simple image processing chip integrates an image signal processor (Image Signal Processor, ISP), a network processor (Neural-network Processing Unit, NPU), a central processing unit (central processing unit, CPU) and a plurality of storage media. In order to make the best use of the chip, the chip uses only a part of the modules to process some simple scenes, and all the capabilities of the chip are not needed in these scenes. Generally, to solve the problem of resource waste, a developer may use the following two methods:
1. implementing multi-scenario resource management logic inside code using single firmware
The scheme has the advantages of small quantity of firmware and easy maintenance and upgrading. The different use scenes are distinguished in the codes, the resource control is carried out according to the different scenes, and the performance and the power consumption performance are expected to be optimized while the differentiation function is realized by software logic.
2. The use of multiple sets of firmware is a current common solution, and a user downloads corresponding firmware to an integrated circuit (integrated circuit, IC) according to the requirements of different scenes through firmware switching logic on a System On Chip (SOC), so that each firmware has a single function, and part of resource management logic in the firmware is transferred to the main SOC.
The conventional software solutions, whether single-chip single-firmware or single-chip multi-firmware, have unavoidable drawbacks. For example, a single-chip single-firmware scheme has obvious defects that firmware codes are redundant when processing simple logic, and the relatively huge code quantity has high requirement on the capacity of a code storage medium and can only normally run in a Dynamic Random-Access Memory (DRAM); this results in the general inability to dispense with higher power DRAM modules for power consumption optimization. However, most of the single-chip multi-firmware schemes at present have some drawbacks, such as the switching between the firmware requires the operations of powering off and powering on the chip, and some peripherals need time to enter a stable state when the chip is powered on again, resulting in prolonged switching time of the firmware.
The Secure Digital input output (Secure Digital Input and Output Card, SDIO) defines a peripheral interface on the Secure Digital (SD) standard. SDIO has two main classes of applications-removable and non-removable. The removable device acts as an extension to Palm and Windows Mobile to add bluetooth, camera, global positioning system (Global Positioning System, GPS) and 802.11b functionality. The non-removable devices follow the same electrical standard but do not require compliance with the physical standard. Some handsets include an 802.11 chip connected to a CPU via an SDIO. This uses "precious" Input/Output (I/O) pin resources for more important functions.
Bluetooth, camera, GPS and 802.11b devices have application specifications defined specifically for them. These application specifications are very similar to the class specifications defined for PCI bus (Peripheral Component Interconnect, PCI) and universal serial bus (Universal Serial Bus, USB) devices. They allow any hosting device to "talk" to any peripheral device as long as they all support the application specification.
An important difference between the SDIO and SD card specifications is the addition of low speed standards. The SDIO card requires only a serial peripheral interface (Serial Peripheral Interface, SPI) and a 1-bit SD transmission mode. The target application for the low-speed card is to support low-speed I/O capabilities with minimal hardware effort. The low speed card supports applications like modems, barcode scanners, and GPS receivers. For "combination" cards (memory + SDIO), full speed and 4-bit operation are mandatory for both the memory and SDIO portions within the card.
SPI is a high-speed, full duplex, synchronous communication bus and occupies only four wires on the pins of the chip, saving pins of the chip, while saving space on the layout of printed wiring boards (Printed Circuit Board, PCB), providing convenience, and just for this simple and easy-to-use feature, more and more chips integrate such communication protocols as AT91RM9200.
The terminal device applied in the embodiments of the present application may be deployed on land, including indoor or outdoor, hand-held, wearable or vehicle-mounted; can also be deployed on the water surface (such as ships, etc.); but may also be deployed in the air (e.g., on aircraft, balloon, satellite, etc.).
In the embodiment of the present application, the terminal device may be a Mobile Phone (Mobile Phone), a tablet computer (Pad), a computer with a wireless transceiving function, a Virtual Reality (VR) terminal device, an augmented Reality (Augmented Reality, AR) terminal device, a wireless terminal device in industrial control (industrial control), a wireless terminal device in unmanned driving (self driving), a wireless terminal device in remote medical (remote medical), a wireless terminal device in smart grid (smart grid), a wireless terminal device in transportation security (transportation safety), a wireless terminal device in smart city (smart city), or a wireless terminal device in smart home (smart home), and the like.
By way of example, and not limitation, in embodiments of the present application, the terminal device may also be a wearable device. The wearable device can also be called as a wearable intelligent device, and is a generic name for intelligently designing daily wear by applying wearable technology and developing wearable devices, such as glasses, gloves, watches, clothes, shoes and the like. The wearable device is a portable device that is worn directly on the body or integrated into the clothing or accessories of the user. The wearable device is not only a hardware device, but also can realize a powerful function through software support, data interaction and cloud interaction. The generalized wearable intelligent device includes full functionality, large size, and may not rely on the smart phone to implement complete or partial functionality, such as: smart watches or smart glasses, etc., and focus on only certain types of application functions, and need to be used in combination with other devices, such as smart phones, for example, various smart bracelets, smart jewelry, etc. for physical sign monitoring.
In the following, by way of example, the technical solution of the present application is further described, as shown in fig. 1, which is a schematic diagram of an embodiment of a method for switching multiple firmware in an embodiment of the present application, and may include:
101. When the external chip is powered on, the external chip is initialized through a boot chip BootRom, a phase-locked loop PLL is enabled, the SDIO is enabled, and connection is established with the control chip through interrupt and/or SDIO signals.
It can be understood that, the present application adds the hardware peripheral initialization firmware and the timely Zhong Chushi firmware ON the basis of implementing multiple sets of firmware according to a scene (for example, a Camera (Camera) scene, an always ON Camera (AON) scene), which is used as the basic firmware of the multi-firmware switching scene. Among them, AON is generally used for scenes such as action/person recognition, and has a camera usage scheme with low power consumption characteristics.
An external chip in this application, also referred to as an external IC chip; the External IC chip may include an External IC chip Core (External-IC Core), which may be also called an External chip Core, an External IC chip Storage medium (External-IC Storage), which may be also called an External chip Storage medium, and an External IC chip peripheral (External-IC Peripherals), which may be also called External chip Peripherals. Wherein, the External-IC Core refers to other chips that are generally independent of the AP SOC chip. An AP SOC chip may be understood as a control chip. The control chip is also referred to as a control IC chip (Integrated Circuit Chip).
Illustratively, upon power-up (PowerOn) of the External chip, the External-IC Storage triggers the External-IC Core start-up chip (BootRom Trigger), the External chip is initialized by BootRom, the External-IC Core enables (enable) the phase-locked loop (Phase Locked Loop, PLL) to the External-IC Peripherals, enables secure digital input output (Secure Digital Input and Output, SDIO), the External-IC Peripherals are handshaking by interrupt, and/or the SDIO signal handshakes with the control chip, i.e., the AP, so that Inter-process communication (Inter-Process Communication, IPC) handshakes (handshakes) can be understood.
Enabling a PLL may also be understood as initializing a PLL; enabling SDIO can also be understood as initializing the SDIO Clock (Clock).
102. And under the condition that the control chip receives the starting signal, loading the peripheral firmware through the control chip, and sending the peripheral firmware to an external chip storage medium.
The control chip receives the start signal and transmits the external firmware to the external chip storage medium through the SDIO. It will also be appreciated that the peripheral firmware will be loaded into the microprocessor (Microprocessor Unit, MPU) protection address in order to avoid being stepped on by the scene firmware.
Optionally, when the control chip receives the start signal, loading the peripheral firmware through the control chip, and sending the peripheral firmware to an external chip storage medium may include: and under the condition that the control chip receives the starting signal, loading the peripheral firmware through the control chip, encrypting the peripheral firmware, transmitting the encrypted peripheral firmware to an external chip storage medium, and decrypting the encrypted peripheral firmware through the external chip storage medium to obtain the decrypted peripheral firmware.
It can be understood that in the firmware switching process, the control chip, i.e. the firmware on the AP side, needs to be transferred to the chip SRAM or DRAM through the SDIO and the serial peripheral interface (Serial Peripheral Interface, SPI); to ensure the stability and privacy of the transmission, an encryption and decryption mechanism can be added in the transmission protocol. Namely, when the firmware is finely split, encryption and decryption firmware can be added for encrypting and decrypting the scene firmware, and the security of the firmware transmitted through the SDIO is improved.
103. Initializing the peripheral register by the peripheral firmware.
Illustratively, the control chip, i.e. the AP, initiates loading of the peripheral firmware which initializes the peripheral registers by which it is initialized, i.e. which is restored to its initial state.
104. And running the peripheral firmware, executing adjustment parameters and/or checking the double-rate storage medium.
Illustratively, the peripheral firmware is run, and steps such as adjusting (Tuning) Double Data Rate (DDR) parameters, checking DDR storage media, and the like are performed.
It can be understood that in the firmware switching process, the control chip, i.e. the firmware on the AP side, needs to be transferred to the chip SRAM or DRAM through the SDIO and the serial peripheral interface (Serial Peripheral Interface, SPI); to ensure the stability and privacy of the transmission, a verification step may be added to the transmission protocol.
It should be noted that steps 101-104 are optional steps.
105. And loading corresponding first scene firmware through the secure digital input output SDIO according to the first scene currently used.
By way of example, the control chip is used for judging the currently used scene, and the corresponding first scene firmware is loaded through the SDIO.
106. And when the scene firmware is switched, reentering the initialization state of the peripheral register, and loading the second scene firmware through the SDIO.
Optionally, when switching the scenario firmware, reentering the peripheral register initialization state, and loading the second scenario firmware through the SDIO may include: when the scene firmware is switched, the control chip is switched to a peripheral firmware reset task function, the peripheral register is reinitialized, and the second scene firmware is loaded through the SDIO.
Illustratively, upon a context (firmware) switch, reentering the peripheral register initialization state through the control chip; and further directly loads the second scene firmware, namely the new scene firmware, through the SDIO. Thereby achieving the effect of fast switching of the firmware.
Fig. 2 is a schematic diagram of a firmware boot loading process according to an embodiment of the present application. In FIG. 2, the chip is initialized first; downloading peripheral chips, and adjusting peripheral parameters; downloading scene firmware of a current use scene; when the scene is switched or powered off, the judgment of the current use scene is entered again, and the corresponding scene firmware is downloaded, so that the scene firmware is switched.
Fig. 3 is a schematic diagram of software running timing in the embodiment of the present application. The first starting sequence of the hardware is that an external chip is electrified, a PLL is initialized, and an SDIO Clock is initialized; handshake with AP. The AP then initiates loading of the peripheral firmware which initializes the peripheral registers and restores the peripheral registers to an initial state. Meanwhile, the peripheral firmware can be loaded to the MPU protection address, so that the stepping of the scene firmware is avoided. When the scene firmware is switched, the PC pointer is firstly switched to the position of the peripheral firmware reset task function (reset task function), and the peripheral register is reinitialized, so that the scene firmware to be loaded is prevented from being influenced.
It can be understood that in the application, the fine firmware is disassembled, related operations such as initializing, configuring and the like of the peripheral of the chip can be independent through the disassembly, and the system can quickly reset the peripheral state when the firmware is switched by providing a function entry for task jump. In addition, the stability of the standby clock and the power supply is also concerned, and if the stability of the peripheral clock and the power supply can be maintained during the firmware switching, the firmware switching time can be shortened.
In the embodiment of the application, according to a first scene which is currently used, loading corresponding first scene firmware through Secure Digital Input Output (SDIO); and when the scene firmware is switched, reentering the initialization state of the peripheral register, and loading the second scene firmware through the SDIO. The method is used for maintaining a plurality of firmware separately, each scene firmware is not coupled, development is facilitated, the scene firmware can be switched rapidly, and the firmware customized according to the scene is more beneficial to optimizing performance and power consumption. And the scene firmware is switched on the basis of keeping unified peripheral firmware by finely disassembling the firmware, so that the switching time is shortened. Based on the fine disassembly of the firmware, the firmware of each scene only uses the hardware resources which are dependent on the firmware, and some hardware resources which are not used or are used for a short time can be powered off, so that the aim of low power consumption is fulfilled.
As shown in fig. 4, another embodiment of a method for multi-firmware switching in an embodiment of the present application is shown, which may include:
401. when the external chip is powered on, the external chip is initialized through a boot chip BootRom, a phase-locked loop PLL is enabled, the SDIO is enabled, and connection is established with the control chip through interrupt and/or SDIO signals.
402. And under the condition that the control chip receives the starting signal, loading the peripheral firmware through the control chip, and sending the peripheral firmware to an external chip storage medium.
403. Initializing the peripheral register by the peripheral firmware.
404. And running the peripheral firmware, executing adjustment parameters and/or checking the double-rate storage medium.
It should be noted that, steps 401 to 404 may refer to steps 101 to 104 in the embodiment shown in fig. 1, and will not be described herein.
405. After the reset of the peripheral firmware is completed, the scene firmware is downloaded to a corresponding storage unit, wherein the storage unit comprises a Static Random Access Memory (SRAM) or a Dynamic Random Access Memory (DRAM).
Optionally, the downloading the scene firmware to the corresponding storage unit may include:
downloading the scene firmware to the SRAM when the size of the space occupied by the scene firmware is smaller than a first preset space; and when the running space of the scene firmware is smaller than a second preset space, opening up a stack from the SRAM, and closing the DRAM or entering a low-power consumption mode.
Optionally, the downloading the scene firmware to the corresponding storage unit may include:
downloading the scene firmware to the DRAM when the size of the space occupied by the scene firmware is larger than or equal to a first preset space; when the running space of the scene firmware is smaller than a second preset space, a stack is opened up from the SRAM; and when the running space of the scene firmware is larger than or equal to the second preset space, opening up a stack from the DRAM.
For example, after the reset of the peripheral firmware is completed, the AP downloads the new scene firmware to the corresponding storage unit, which may be determined according to the firmware size and the space required during operation. If the firmware is smaller, the processing logic is simple, the firmware can be directly downloaded to a Static Random-Access Memory (SRAM), and if the stack required for operation is also smaller, the stack can be opened up directly from the SRAM, and the DRAM is turned off or enters a low power consumption mode. Otherwise, the firmware may be loaded into the DRAM; stacks can be opened up from DRAM or SRAM as desired.
From the perspective of the storage medium, the location where each firmware is loaded, and the Program Counter (PC) pointer jump procedure. Fig. 5 is a schematic diagram of firmware storage in the embodiment of the present application. The PBL shown in fig. 5, in english, is generally referred to as primary boot loader, and is commonly used to refer to the initialization boot firmware of the micro control unit (Microcontroller Unit, MCU).
It can be understood that the fine disassembly of the firmware is also beneficial to the realization of low power consumption, the disassembled firmware can only supply power and clock to part of the modules of the chip according to the requirement, and the power supply voltage and clock frequency can be adjusted according to the requirement. For example, in the Explorer project, ISP functions used in AON scenes are very few, DRAM in a chip is not needed to be used, and disassembled firmware is relatively smaller, so that the loading time is reduced. The split firmware can carry out fine control on the modules in the chip according to scene requirements, such as closing unused modules (DDR, part of Sysbuf, part of ISP modules) and adjusting the voltage and clock frequency of the used modules. The software controls the chip to enter a low power consumption mode in the process of inter-frame processing, and the like.
406. And loading corresponding first scene firmware through the secure digital input output SDIO according to the first scene currently used.
407. And when the scene firmware is switched, reentering the initialization state of the peripheral register, and loading the second scene firmware through the SDIO.
It should be noted that, the steps 406-407 may refer to the steps 105-106 in the embodiment shown in fig. 1, and will not be described herein.
In the embodiment of the application, according to a first scene which is currently used, loading corresponding first scene firmware through Secure Digital Input Output (SDIO); and when the scene firmware is switched, reentering the initialization state of the peripheral register, and loading the second scene firmware through the SDIO. The method is used for maintaining a plurality of firmware separately, each scene firmware is not coupled, development is facilitated, the scene firmware can be switched rapidly, and the firmware customized according to the scene is more beneficial to optimizing performance and power consumption. And the scene firmware is switched on the basis of keeping unified peripheral firmware by finely disassembling the firmware, so that the switching time is shortened. Based on the fine disassembly of the firmware, the firmware of each scene only uses the hardware resources which are dependent on the firmware, and some hardware resources which are not used or are used for a short time can be powered off, so that the aim of low power consumption is fulfilled.
As shown in fig. 6, an embodiment of an apparatus for multi-firmware switching in an embodiment of the present application is shown, which may include:
the processing module 601 is configured to load corresponding first scenario firmware through secure digital input/output SDIO according to a first scenario currently used; and when the scene firmware is switched, reentering the initialization state of the peripheral register, and loading the second scene firmware through the SDIO.
Optionally, the processing module 601 is specifically configured to switch to a peripheral firmware reset task function through the control chip when switching the scenario firmware, reinitialize the peripheral register, and load the second scenario firmware through the SDIO.
Optionally, the processing module 601 is further configured to initialize the external chip by starting a BootRom when the external chip is powered on, enable a phase-locked loop PLL, enable the SDIO, and establish a connection with the control chip by interrupting and/or SDIO signals; and under the condition that the control chip receives the starting signal, loading the peripheral firmware through the control chip, and sending the peripheral firmware to an external chip storage medium.
Optionally, the processing module 601 is further configured to initialize the peripheral register through the peripheral firmware; and running the peripheral firmware, executing adjustment parameters and/or checking the double-rate storage medium.
Optionally, the processing module 601 is further configured to download the scenario firmware to a corresponding storage unit after the reset of the peripheral firmware is completed, where the storage unit includes a static random access memory SRAM or a dynamic random access memory DRAM.
Optionally, the processing module 601 is specifically configured to download the scenario firmware to the SRAM when the size of the space occupied by the scenario firmware is smaller than a first preset space; and when the running space of the scene firmware is smaller than a second preset space, opening up a stack from the SRAM, and closing the DRAM or entering a low-power consumption mode.
Optionally, the processing module 601 is specifically configured to download the scenario firmware to the DRAM when the size of the space occupied by the scenario firmware is greater than or equal to a first preset space; when the running space of the scene firmware is smaller than a second preset space, a stack is opened up from the SRAM; and when the running space of the scene firmware is larger than or equal to the second preset space, opening up a stack from the DRAM.
As shown in fig. 7, another embodiment of an apparatus for multi-firmware switching in an embodiment of the present application is shown, which may include:
the control chip 701 is configured to load corresponding first scenario firmware through secure digital input/output SDIO according to a first scenario currently used; and when the scene firmware is switched, reentering the initialization state of the peripheral register, and loading the second scene firmware through the SDIO.
Optionally, the control chip 701 is specifically configured to, when switching the scenario firmware, switch to a peripheral firmware reset task function through the control chip, reinitialize the peripheral register, and load the second scenario firmware through the SDIO.
Optionally, the control chip 701 is further configured to initialize the external chip by starting a BootRom when the external chip is powered on, enable a phase-locked loop PLL, enable the SDIO, and establish a connection with the control chip by interrupting and/or SDIO signals; and under the condition that the control chip receives the starting signal, loading the peripheral firmware through the control chip, and sending the peripheral firmware to an external chip storage medium.
Optionally, the external chip 702 is further configured to initialize the peripheral register through the peripheral firmware; and running the peripheral firmware, executing adjustment parameters and/or checking the double-rate storage medium.
Optionally, the external chip 702 is further configured to download the scenario firmware to a corresponding storage unit after the reset of the peripheral firmware is completed, where the storage unit includes a static random access memory SRAM or a dynamic random access memory DRAM.
Optionally, the external chip 702 is specifically configured to download the scenario firmware to the SRAM when the size of the space occupied by the scenario firmware is smaller than a first preset space; and when the running space of the scene firmware is smaller than a second preset space, opening up a stack from the SRAM, and closing the DRAM or entering a low-power consumption mode.
Optionally, the external chip 702 is specifically configured to download the scenario firmware to the DRAM when the size of the space occupied by the scenario firmware is greater than or equal to a first preset space; when the running space of the scene firmware is smaller than a second preset space, a stack is opened up from the SRAM; and when the running space of the scene firmware is larger than or equal to the second preset space, opening up a stack from the DRAM.
As shown in fig. 8, which is a schematic diagram of an embodiment of a terminal device in an embodiment of the present application, an apparatus for switching multiple firmware as shown in fig. 6 or fig. 7 may be included.
Fig. 9 is a schematic diagram of another embodiment of a terminal device in an embodiment of the present application.
Fig. 9 is a block diagram showing a part of the structure of a mobile phone related to a wireless terminal provided by an embodiment of the present invention. Referring to fig. 9, the mobile phone includes: radio Frequency (RF) circuitry 910, memory 920, input unit 930, display unit 940, sensor 950, audio circuitry 960, wireless fidelity (wireless fidelity, wi-Fi) module 970, processor 980, power source 990, and so forth. It will be appreciated by those skilled in the art that the handset construction shown in fig. 9 is not limiting of the handset and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The following describes the components of the mobile phone in detail with reference to fig. 9:
the RF circuit 910 may be used for receiving and transmitting signals during a message or a call, and particularly, after receiving downlink information of a base station, the signal is processed by the processor 980; in addition, the data of the design uplink is sent to the base station. Typically, the RF circuitry 910 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, and the like. In addition, the RF circuitry 910 may also communicate with networks and other devices via wireless communications. The wireless communications may use any communication standard or protocol including, but not limited to, global system for mobile communications (Global System of Mobile communication, GSM), general packet radio service (General Packet Radio Service, GPRS), code division multiple access (Code Division Multiple Access, CDMA), wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA), long term evolution (Long Term Evolution, LTE), email, short message service (Short Messaging Service, SMS), and the like.
The memory 920 may be used to store software programs and modules, and the processor 980 performs various functional applications and data processing by operating the software programs and modules stored in the memory 920. The memory 920 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, memory 920 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The input unit 930 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the handset. In particular, the input unit 930 may include a touch panel 931 and other input devices 932. The touch panel 931, also referred to as a touch screen, may collect touch operations thereon or thereabout by a user (such as operations of the user on the touch panel 931 or thereabout using any suitable object or accessory such as a finger, a stylus, or the like) and drive the corresponding connection device according to a predetermined program. Alternatively, the touch panel 931 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 980, and can receive commands from the processor 980 and execute them. In addition, the touch panel 931 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 930 may include other input devices 932 in addition to the touch panel 931. In particular, other input devices 932 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 940 may be used to display information input by a user or information provided to the user and various menus of the mobile phone. The display unit 940 may include a display panel 941, and alternatively, the display panel 941 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch panel 931 may overlay the display panel 941, and when the touch panel 931 detects a touch operation thereon or thereabout, the touch operation is transferred to the processor 980 to determine a type of touch event, and then the processor 980 provides a corresponding visual output on the display panel 941 according to the type of touch event. Although in fig. 9, the touch panel 931 and the display panel 941 are implemented as two separate components for the input and output functions of the mobile phone, in some embodiments, the touch panel 931 may be integrated with the display panel 941 to implement the input and output functions of the mobile phone.
The handset may also include at least one sensor 950, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 941 according to the brightness of ambient light, and the proximity sensor may turn off the display panel 941 and/or the backlight when the mobile phone moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and direction when stationary, and can be used for applications of recognizing the gesture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the handset are not described in detail herein.
Audio circuitry 960, speaker 961, microphone 962 may provide an audio interface between a user and a cell phone. Audio circuit 960 may transmit the received electrical signal converted from audio data to speaker 961, where it is converted to a sound signal by speaker 961 for output; on the other hand, microphone 962 converts the collected sound signals into electrical signals, which are received by audio circuit 960 and converted into audio data, which are processed by audio data output processor 980 for transmission to, for example, another cell phone via RF circuit 910 or for output to memory 920 for further processing.
Wi-Fi belongs to a short-distance wireless transmission technology, and a mobile phone can help a user to send and receive e-mails, browse webpages, access streaming media and the like through a Wi-Fi module 970, so that wireless broadband Internet access is provided for the user. Although fig. 9 shows Wi-Fi module 970, it is understood that it does not belong to the necessary constitution of the handset, and can be omitted entirely as needed within the scope of not changing the essence of the invention.
The processor 980 is a control center of the handset, connecting various parts of the entire handset using various interfaces and lines, performing various functions and processing data of the handset by running or executing software programs and/or modules stored in the memory 920, and invoking data stored in the memory 920, thereby performing overall monitoring of the handset. Optionally, processor 980 may include one or more processing units; preferably, the processor 980 may integrate an application processor with a modem processor, wherein the application processor primarily handles operating systems, user interfaces, applications programs, etc., and the modem processor primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 980.
The handset further includes a power supply 990 (e.g., a battery) for powering the various components, which may be logically connected to the processor 980 by a power management system, such as for performing charge, discharge, and power management functions via the power management system.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which will not be described herein.
In the embodiment of the present invention, the processor 980 is configured to load, according to a first scenario currently used, a corresponding first scenario firmware through the secure digital input output SDIO; and when the scene firmware is switched, reentering the initialization state of the peripheral register, and loading the second scene firmware through the SDIO.
Optionally, the processor 980 is specifically configured to switch to a peripheral firmware reset task function through the control chip when switching the scenario firmware, reinitialize the peripheral register, and load the second scenario firmware through the SDIO.
Optionally, the processor 980 is further configured to initialize the external chip by starting a BootRom of the chip when the external chip is powered on, enable a phase-locked loop PLL, enable the SDIO, and establish a connection with the control chip by interrupting and/or SDIO signals; and under the condition that the control chip receives the starting signal, loading the peripheral firmware through the control chip, and sending the peripheral firmware to an external chip storage medium.
Optionally, the memory 920 is further configured to initialize the peripheral register by the peripheral firmware; and running the peripheral firmware, executing adjustment parameters and/or checking the double-rate storage medium.
Optionally, the memory 920 is further configured to download the scenario firmware to a corresponding storage unit after the reset of the peripheral firmware is completed, where the storage unit includes a static random access memory SRAM or a dynamic random access memory DRAM.
Optionally, the memory 920 is specifically configured to download the scenario firmware to the SRAM when the size of the space occupied by the scenario firmware is smaller than a first preset space; and when the running space of the scene firmware is smaller than a second preset space, opening up a stack from the SRAM, and closing the DRAM or entering a low-power consumption mode.
Optionally, the memory 920 is specifically configured to download the scenario firmware to the DRAM when the size of the space occupied by the scenario firmware is greater than or equal to a first preset space; when the running space of the scene firmware is smaller than a second preset space, a stack is opened up from the SRAM; and when the running space of the scene firmware is larger than or equal to the second preset space, opening up a stack from the DRAM.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are merely for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the corresponding technical solutions.

Claims (10)

1. A method for multi-firmware handoff, comprising:
loading corresponding first scene firmware through secure digital input/output SDIO according to a first scene currently used;
and when the scene firmware is switched, reentering the initialization state of the peripheral register, and loading the second scene firmware through the SDIO.
2. The method of claim 1, wherein the re-entering the peripheral register initialization state when switching the scenario firmware, loading the second scenario firmware via the SDIO, comprises:
when the scene firmware is switched, the control chip is switched to a peripheral firmware reset task function, the peripheral register is reinitialized, and the second scene firmware is loaded through the SDIO.
3. The method of claim 1, wherein prior to the determining the currently used scene, the method further comprises:
when an external chip is electrified, initializing the external chip by starting a chip BootRom, enabling a phase-locked loop (PLL), enabling the SDIO, and establishing connection with a control chip by interrupting and/or SDIO signals;
and under the condition that the control chip receives the starting signal, loading the peripheral firmware through the control chip, and sending the peripheral firmware to an external chip storage medium.
4. The method of claim 3, wherein after the transmitting the peripheral firmware to an external chip storage medium, the method further comprises:
initializing the peripheral register by the peripheral firmware;
and running the peripheral firmware, executing adjustment parameters and/or checking the double-rate storage medium.
5. The method according to any one of claims 1-4, further comprising:
after the reset of the peripheral firmware is completed, the scene firmware is downloaded to a corresponding storage unit, wherein the storage unit comprises a Static Random Access Memory (SRAM) or a Dynamic Random Access Memory (DRAM).
6. The method of claim 5, wherein said downloading the scenario firmware to the corresponding storage unit comprises:
downloading the scene firmware to the SRAM when the size of the space occupied by the scene firmware is smaller than a first preset space;
and when the running space of the scene firmware is smaller than a second preset space, opening up a stack from the SRAM, and closing the DRAM or entering a low-power consumption mode.
7. The method of claim 5, wherein said downloading the scenario firmware to the corresponding storage unit comprises:
downloading the scene firmware to the DRAM when the size of the space occupied by the scene firmware is larger than or equal to a first preset space;
when the running space of the scene firmware is smaller than a second preset space, a stack is opened up from the SRAM;
and when the running space of the scene firmware is larger than or equal to the second preset space, opening up a stack from the DRAM.
8. An apparatus for multi-firmware switching, comprising:
the control chip is used for loading corresponding first scene firmware through the Secure Digital Input Output (SDIO) according to the first scene which is currently used; and when the scene firmware is switched, reentering the initialization state of the peripheral register, and loading the second scene firmware through the SDIO.
9. A terminal device comprising the apparatus for multi-firmware handoff of claim 8.
10. A computer readable storage medium comprising instructions which, when run on a processor, cause the processor to perform the method of any of claims 1-7.
CN202210059709.3A 2022-01-19 2022-01-19 Multi-firmware switching method, device, terminal equipment and storage medium Pending CN116501390A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210059709.3A CN116501390A (en) 2022-01-19 2022-01-19 Multi-firmware switching method, device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210059709.3A CN116501390A (en) 2022-01-19 2022-01-19 Multi-firmware switching method, device, terminal equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116501390A true CN116501390A (en) 2023-07-28

Family

ID=87320716

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210059709.3A Pending CN116501390A (en) 2022-01-19 2022-01-19 Multi-firmware switching method, device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116501390A (en)

Similar Documents

Publication Publication Date Title
KR101832953B1 (en) Remote wakeup of application processor of mobile device
US11252724B2 (en) Electronic device for transmitting or receiving data in wireless communication system and method therefor
CN107678989B (en) UART (Universal asynchronous receiver transmitter) and USB (Universal Serial bus) multiplexing circuit and mobile terminal
CN107613126B (en) UART (Universal asynchronous receiver transmitter) and USB (Universal Serial bus) multiplexing circuit and mobile terminal
CN108668353B (en) Electronic device and transmission power control method
US20170118759A1 (en) Electronic device and method for avoiding interference between frequencies therefor
EP3749001A1 (en) Electronic device and method for switching electronic device between dual standby mode and single standby mode
CN107635069B (en) UART and USB multiplex circuit and mobile terminal
EP2631792A1 (en) Apparatus and method for verifying operating system of host device in portable terminal
CN110832888A (en) Method for automatically switching SIM (subscriber identity Module) cards and electronic device
WO2019052291A1 (en) Unlocking methods and related products
US10979952B2 (en) Electronic device for reducing power consumption and operating method thereof
US11385690B2 (en) Electronic device for switching between communication channels and control method thereof
CN111273955B (en) Thermal restoration plug-in optimization method and device, storage medium and electronic equipment
JP2006261846A (en) Information processing apparatus and method of controlling power supply with the information processing apparatus
US10419227B2 (en) Network card
CN111026457B (en) Hardware configuration method and device, storage medium and terminal equipment
CN115733549B (en) PCIE network card, switching method of interface modes of PCIE network card, electronic equipment and storage medium
CN111885591A (en) Network connection method, device, storage medium and terminal
EP4287763A2 (en) Electronic device for reducing power consumption in network on basis of wi-fi direct protocol, and method related thereto
CN111404242A (en) Charging method, charging device, storage medium and mobile terminal
CN111104186A (en) Bluetooth configuration file loading method and device, storage medium and terminal equipment
US11758598B1 (en) Automated multi-client and multi-mode wireless device pairing and connection methods and systems
CN116501390A (en) Multi-firmware switching method, device, terminal equipment and storage medium
CN113489508B (en) Power supply control method, power supply control device, electronic device, and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination