CN106066842A - A kind of method of switch mode, SOC(system on a chip) and base station - Google Patents
A kind of method of switch mode, SOC(system on a chip) and base station Download PDFInfo
- Publication number
- CN106066842A CN106066842A CN201610369726.1A CN201610369726A CN106066842A CN 106066842 A CN106066842 A CN 106066842A CN 201610369726 A CN201610369726 A CN 201610369726A CN 106066842 A CN106066842 A CN 106066842A
- Authority
- CN
- China
- Prior art keywords
- usb
- equipment
- module
- mode
- descriptor
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
- G06F13/28—Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Systems (AREA)
Abstract
The embodiment of the present application discloses a kind of method of switch mode, SOC(system on a chip) and base station.The embodiment of the present application SOC(system on a chip) is applied to base station, including central processor CPU and adjust mode of operation holotype and between pattern switching USB module, USB module one end couples with CPU, and USB module is additionally operable to couple external USB equipment;When USB module couples external USB equipment, CPU is for detecting the device type of external USB equipment, and the device type of external USB equipment includes main equipment and from equipment;If external USB equipment is main equipment, CPU is additionally operable to adjust from pattern the mode of operation of USB module;If external USB equipment is from equipment, CPU is additionally operable to adjust in holotype the mode of operation of USB module.The embodiment of the present application makes base station as both can be connected with external USB equipment by generic USB data wire as from equipment, improve versatility and compatibility again as main equipment simultaneously.
Description
Technical field
The application relates to communication technical field, particularly to method, SOC(system on a chip) and the base station of a kind of switch mode.
Background technology
USB (universal serial bus) (English full name: Universal Serial Bus, English abbreviation: USB) module is on base station
Extensively application, by docking of USB module on base station and external equipment, it is possible to achieve near-end maintaining, the debugging loading to base station
Etc. function.
At present, the docking of USB module and external equipment on base station, one of them major programme is to insert USB flash disk to carry out software
Secondly upgrading, is multiplexed into debugging serial interface in USB interface, is equipped with the switching cable of " USB transfer RJ45 " of customization, is connected to just
Take and complete near-end maintaining on machine network interface, debugging loads function.But by the way of USB turns RJ45 cable connection portable machine, one
Aspect allots switching cable, increases Material Cost;On the other hand the customization of switching cable, is easily lost and affects station maintenance, and electricity
Cable produces general assembly without assembly relation, impact.
In order to solve above-mentioned client cables problem, follow-up appearance uses and includes that the generic USB data wire of four pins is (non-
OTG data wire) connect the USB port of portable machine, then driven by Ethernet USB, it is achieved the function of network interface, portable machine is general by this
Logical USB data line connects the USB module of base station.
But, in routine use, based on the consideration that convenience and scheme are compatible, base station USB module is under some scene
Remain a need for using insertion USB flash disk to realize the functions such as near-end maintaining, so require that base station USB module supports the identification of plurality of devices, both
Base station to be realized USB module connects USB flash disk, and now base station USB module is as main equipment, is operated in holotype;Realize portable machine again
Connecting base station by generic USB data wire, now base station USB module is as from equipment, is operated in from pattern, and currently without this
The compatible design of aspect.
Summary of the invention
The embodiment of the present application provides a kind of method of switch mode, SOC(system on a chip) and base station, makes base station as the most permissible
As main equipment, can have bigger versatility and compatibility as from equipment again.
The application first aspect provides a kind of SOC(system on a chip), is applied to base station, and described SOC(system on a chip) includes central authorities' process
Device CPU, and adjust mode of operation holotype and between pattern switching general-purpose serial bus USB module, described USB mould
Block one end couples with described CPU, and described USB module is additionally operable to couple external USB equipment;
When described USB module couples external USB equipment, described CPU is for detecting the equipment class of described external USB equipment
Type, the device type of described external USB equipment includes main equipment and from equipment;
If described external USB equipment is main equipment, described CPU is additionally operable to adjust the mode of operation of described USB module
From pattern;
If described external USB equipment is from equipment, described CPU is additionally operable to adjust the mode of operation of described USB module
Holotype.
In conjunction with the first aspect of the application, in the first implementation of the application first aspect, described USB module bag
Include adjust USB module mode of operation holotype and between pattern switching USB principal and subordinate's module, selector, USB physical layer mould
Block and USB interface, described USB interface couples with described USB physical layer block, and described USB interface is used for coupling external USB and sets
Standby, described selector and described USB physical layer block and described USB principal and subordinate's module couples;
Described CPU, specifically for when described external USB equipment is main equipment, is used for described by described selector
The mode of operation of USB module adjusts from pattern;
Described CPU, specifically for when described external USB equipment is from equipment, is used for described by described selector
The mode of operation of USB module adjusts in holotype.
In conjunction with the first implementation of the application first aspect, in the second implementation of the application first aspect
In, described USB principal and subordinate's module include USB primary module and USB from module, described selector respectively with described USB primary module and institute
State USB from module couples;
Described CPU is specifically for when described external USB equipment is main equipment, for being gated and institute by described selector
State USB connection between module, make the mode of operation of described USB module adjust from pattern;
Described CPU is specifically for when described external USB equipment is from equipment, for being gated and institute by described selector
State the connection between USB primary module, make the mode of operation of described USB module adjust in holotype.
In conjunction with the second implementation of the application first aspect, in the third implementation of the application first aspect
In, described USB primary module includes that open HCI OHCI controller, enhancement mode host controller interface EHCI control
Device;Described OHCI controller includes that the first depositor, described EHCI controller include the second depositor;
When described external USB equipment is from equipment, described CPU is additionally operable to determine what described external USB equipment was supported
Velocity mode;
If described external USB equipment supports fast mode, the most described CPU is additionally operable to the read-write of described external USB equipment
Data are routed to described EHCI controller;Described USB primary module is for sending equipment disconnecting message to described CPU;Described
CPU is additionally operable to build corresponding descriptor at the outside Double Data Rate synchronous DRAM DDR coupled, and retouches described
The address information stating symbol corresponding is written in described second depositor;
If described external USB equipment supports Full-Speed mode or low-speed mode, the most described CPU is additionally operable to described external USB
The read-write data of equipment are routed to described OHCI controller;Described USB primary module is for sending equipment disconnecting to described CPU
Message;Described CPU is additionally operable to build corresponding descriptor at the outside DDR coupled, and by address letter corresponding for described descriptor
Breath is written in described first depositor.
In conjunction with the third implementation of the application first aspect, in the 4th kind of implementation of the application first aspect
In, described USB primary module also includes buffer area;
Described USB primary module is additionally operable in the descriptor acquiring in described DDR to described buffer area, and to described description
Symbol resolves;
If described descriptor represent needs to described external USB equipment sending data, the most described USB primary module be additionally operable to from
Described DDR obtains the data needing to send, and sends to described external USB equipment;
If described descriptor represents that needs obtain data from described external USB equipment, the most described USB primary module is additionally operable to
Receive the data that described external USB equipment sends, be stored in described relief area, and write the DDR that pointer in described descriptor points to
In space.
In conjunction with the second implementation of the application first aspect, the third implementation of first aspect or first aspect
The 4th kind of implementation, in the 5th kind of implementation of the application first aspect, from module, described USB includes that the 3rd deposits
Device and direct memory access DMA;
When described external USB equipment is main equipment, described USB disappears for initiating disconnecting to described CPU from module
Breath, described CPU builds corresponding descriptor in outside DDR, and the entry address of described descriptor is written to the described 3rd
In depositor, described DMA is for obtaining described descriptor according to described entry address in described DDR;
Described DMA is additionally operable in described DDR obtain corresponding data and be transferred to described external USB equipment, transmits data
After update the descriptor state in described DDR,
Or,
Described DMA is additionally operable to receive the data of described external USB equipment transmission and be written back in described DDR, receives number
The descriptor state in described DDR is updated after according to.
The application second aspect provides a kind of method of switch mode, the SOC(system on a chip) being applied in base station, described
Upper system include adjust mode of operation holotype and between pattern switching general-purpose serial bus USB module;
Described method includes:
When described USB module couples external USB equipment, detect the device type of described external USB equipment, described outside
The device type of USB device includes main equipment and from equipment;
If described external USB equipment is main equipment, the mode of operation of described USB module is adjusted from pattern;
If described external USB equipment is from equipment, the mode of operation of described USB module is adjusted in holotype.
In conjunction with the second aspect of the application, in the first implementation of second aspect, described USB module includes adjusting
USB module mode of operation holotype and between pattern switching USB principal and subordinate's module, selector, USB physical layer block and
USB interface, described USB interface couples with described USB physical layer block, and described USB interface is used for coupling external USB equipment, institute
State selector and described USB physical layer block and described USB principal and subordinate's module couples;
The described mode of operation by described USB module adjusts from pattern, including:
By described selector, the mode of operation of described USB module is adjusted from pattern;
The described mode of operation by described USB module adjusts in holotype, including:
By described selector, the mode of operation of described USB module is adjusted in holotype.
In conjunction with the first implementation of the application second aspect, in the second implementation of the application second aspect
In, described USB principal and subordinate's module include USB primary module and USB from module, described selector respectively with described USB primary module and institute
State USB from module couples;
Described by described selector, the mode of operation of described USB module is adjusted from pattern, including:
Gated by described selector and described USB connection between module, make the mode of operation of described USB module adjust
Whole from pattern;
Described by described selector, the mode of operation of described USB module is adjusted in holotype, including:
Gated the connection between described USB primary module by described selector, make the mode of operation of described USB module adjust
Whole in holotype.
In conjunction with the second implementation of the application second aspect, in the third implementation of the application second aspect
In, described USB primary module includes that open HCI OHCI controller, enhancement mode host controller interface EHCI control
Device;Described OHCI controller includes that the first depositor, described EHCI controller include the second depositor;
When described external USB equipment is from equipment, described method also includes:
Determine the velocity mode that described external USB equipment is supported;
If described external USB equipment supports fast mode, then the read-write data of described external USB equipment are routed to described
EHCI controller;Equipment disconnecting message is sent to described CPU by described USB primary module;At the outside double-speed coupled
Rate synchronous DRAM DDR builds corresponding descriptor, and address information corresponding for described descriptor is written to institute
State in the second depositor;
If described external USB equipment supports Full-Speed mode or low-speed mode, then by the read-write data of described external USB equipment
It is routed to described OHCI controller;Equipment disconnecting message is sent to described CPU by described USB primary module;Couple
Outside DDR builds corresponding descriptor, and address information corresponding for described descriptor is written in described first depositor.
In conjunction with the third implementation of the application second aspect, in the 4th kind of implementation of the application second aspect
In, described USB primary module also includes buffer area;
Described method also includes:
By described USB primary module by the descriptor acquiring in described DDR to described buffer area, and to described descriptor
Resolve;
If described descriptor represents that needs to described external USB equipment sending data, then pass through described USB primary module from institute
State and DDR obtains the data needing to send, and send to described external USB equipment;
If described descriptor represents that needs obtain data from described external USB equipment, then connect by described USB primary module
Receive the data that described external USB equipment sends, be stored in described relief area, and it is empty to write the DDR that pointer in described descriptor points to
In between.
In conjunction with the second implementation of the application second aspect, the third implementation of second aspect or second aspect
The 4th kind of implementation, in the 5th kind of implementation of the application second aspect, from module, described USB includes that the 3rd deposits
Device and direct memory access DMA;
When described external USB equipment is main equipment, described method also includes:
Initiate disconnecting message from module to described CPU by described USB, in outside DDR, build corresponding description
Symbol, and the entry address of described descriptor is written in described 3rd depositor, described DMA is for according to described entry address
Described descriptor is obtained in described DDR;
Obtaining corresponding data in described DDR by described DMA and be transferred to described external USB equipment, transmission data are complete
The descriptor state in described DDR is updated after Biing,
Or,
Receive the data of described external USB equipment transmission by described DMA and be written back in described DDR, receiving data
After update the descriptor state in described DDR.
The application third aspect provides a kind of base station, including SOC(system on a chip) SoC and outside Double Data Rate synchronous dynamic with
Machine memorizer DDR, described SoC couple with described DDR, any one implementation that described SoC provides for above-mentioned first aspect
In SOC(system on a chip).
As can be seen from the above technical solutions, the embodiment of the present application has the advantage that
The embodiment of the present application is applied to the SOC(system on a chip) of base station, including adjust mode of operation holotype and from pattern it
Between switching general-purpose serial bus USB module, can according to access external equipment type, be switched to different mode of operations,
Make base station as both can be set with external USB by generic USB data wire as from equipment again as main equipment simultaneously
Standby connection, improves versatility and compatibility.
Accompanying drawing explanation
Fig. 1 is the configuration diagram in the embodiment of the present application;
Fig. 2 is an embodiment schematic diagram of SOC(system on a chip) in the embodiment of the present application;
Fig. 3 is another embodiment schematic diagram of SOC(system on a chip) in the embodiment of the present application;
Fig. 4 is another embodiment schematic diagram of SOC(system on a chip) in the embodiment of the present application;
Fig. 5 is an embodiment schematic diagram of the method for switch mode in the embodiment of the present application.
Detailed description of the invention
The embodiment of the present application provides a kind of method of switch mode, SOC(system on a chip) and base station, makes base station as the most permissible
As main equipment, can have bigger versatility and compatibility as from equipment again.
As it is shown in figure 1, be a configuration diagram in the embodiment of the present application, this schematic diagram is to realize USB merit in base station
Can the schematic diagram of correlation module, to base station side, including SOC(system on a chip) (English full name: System on Chip, English abbreviation:
And Double Data Rate synchronous DRAM (English full name: Double Data Rate Synchronous SoC)
Dynamic Random Access Memory, English abbreviation: DDR), it is (English that this SoC is used for coupling outside USB (universal serial bus)
Full name: Universal Serial Bus, English abbreviation: USB) equipment.
Provide firstly a kind of SOC(system on a chip) in the embodiment of the present application, this SOC(system on a chip) is applied to base station, is illustrated in figure 2
An embodiment schematic diagram of SOC(system on a chip) in the embodiment of the present invention, this SOC(system on a chip) includes central processing unit (Central
Processing Unit, CPU), and adjust mode of operation holotype and between pattern switching USB (universal serial bus)
USB module, described USB module one end couples with described CPU, and described USB module is additionally operable to couple external USB equipment;This USB mould
Block can also couple with DDR simultaneously.
When described USB module couples external USB equipment, described CPU is for detecting the equipment class of described external USB equipment
Type, the device type of described USB module includes main equipment and from equipment;
Wherein, detect the mode of the device type of described external USB equipment, can be that CPU is for by described USB module
Mode of operation is sequentially adjusted in holotype, from pattern (holotype in front or holotype rear), it is intended to and opposite end external USB
Equipment is mutual according to usb protocol, identifies the device type (being from equipment or main equipment) of opposite end, when USB module is at certain
Individual pattern can mutual with external USB equipment time, i.e. think that external USB equipment is and the equipment of this pattern phase inverse correspondence, such as,
Can be mutual with external USB equipment under USB module is in holotype, then it is assumed that external USB equipment is from equipment.
If described external USB equipment is main equipment, described CPU is additionally operable to adjust the mode of operation of described USB module
From pattern;
If described external USB equipment is from equipment, described CPU is additionally operable to adjust the mode of operation of described USB module
Holotype.
On the basis of embodiment illustrated in fig. 2, further, as it is shown on figure 3, this USB module includes adjusting USB module work
Pattern holotype and between pattern switching USB principal and subordinate's module, selector, USB physical layer block and USB interface, should
USB interface couples with this USB physical layer block, and this USB interface is used for coupling external USB equipment, this selector and this USB physics
Layer module and this USB principal and subordinate's module couples;
Described CPU, specifically for when described external USB equipment is main equipment, is used for described by described selector
The mode of operation of USB module adjusts from pattern;
Described CPU, specifically for when described external USB equipment is from equipment, is used for described by described selector
The mode of operation of USB module adjusts in holotype.
The embodiment of the present application is applied to the SOC(system on a chip) of base station, including adjust mode of operation holotype and from pattern it
Between switching general-purpose serial bus USB module, can according to access external equipment type, be switched to different mode of operations,
Make base station as both can be as main equipment, again can be as from equipment, and by generic USB data wire and external USB equipment
Connect, improve versatility and compatibility.While reservation USB flash disk is inserted directly into property easy to use simultaneously, use generic USB data
Line circumscribed USB main frame, uses as from equipment, and wire rod easily obtains to use generic USB data wire to ensure, at utmost meets base station
Application scenarios.
On the basis of embodiment illustrated in fig. 3, further, as shown in Figure 4, this USB principal and subordinate's module include USB primary module and
USB from module, selector respectively with this USB primary module and this USB from module couples;
Described CPU is specifically for when described external USB equipment is main equipment, for being gated and institute by described selector
State USB connection between module, make the mode of operation of described USB module adjust from pattern;
Described CPU is specifically for when described external USB equipment is from equipment, for being gated and institute by described selector
State the connection between USB primary module, make the mode of operation of described USB module adjust in holotype.
Optionally, the selector in the embodiment of the present invention can be alternative selector, or makes in multiselect one selector
By two situations selecting end.
Further, this USB primary module includes that open HCI OHCI controller, enhancement mode console controller connect
Mouth EHCI controller;Described OHCI controller includes that the first depositor, described EHCI controller include the second depositor;
When described external USB equipment is from equipment, described CPU is additionally operable to determine what described external USB equipment was supported
Velocity mode;CPU determines the velocity mode that external USB equipment is supported, i.e. detection determine external USB equipment be full-speed device,
Low-speed device or high-speed equipment, this detection determines that mechanism is similar with detection device rate during USB enumeration, the most superfluous
State.
If described external USB equipment supports fast mode, the most described CPU is additionally operable to the read-write of described external USB equipment
Data are routed to described EHCI controller;Described USB primary module is for sending equipment disconnecting message to described CPU;Described
CPU is additionally operable to build corresponding descriptor at the outside Double Data Rate synchronous DRAM DDR coupled, and retouches described
The address information stating symbol corresponding is written in described second depositor;
If described external USB equipment supports Full-Speed mode or low-speed mode, the most described CPU is additionally operable to described external USB
The read-write data of equipment are routed to described OHCI controller;Described USB primary module is for sending equipment disconnecting to described CPU
Message;Described CPU is additionally operable to build corresponding descriptor at the outside DDR coupled, and by address letter corresponding for described descriptor
Breath is written in described first depositor.
Optionally, as shown in Figure 4, described USB primary module also includes buffer area;
Described USB primary module is additionally operable in the descriptor acquiring in described DDR to described buffer area, and to described description
Symbol resolves;
If descriptor represents that needs are additionally operable to from described to described external USB equipment sending data, the most described USB primary module
DDR obtains the data needing to send, and sends to described external USB equipment;
If descriptor represents that needs obtain data from described external USB equipment, the most described USB primary module is additionally operable to receive
The data that described external USB equipment sends, are stored in described relief area, and write in the DDR space that pointer in descriptor points to.
Optionally, as shown in Figure 4, described USB includes the 3rd depositor and direct memory access (Direct from module
Memory Access, DMA);
When described external USB equipment is main equipment, described USB disappears for initiating disconnecting to described CPU from module
Breath, described CPU builds corresponding descriptor in outside DDR, and the entry address of descriptor is written to the described 3rd deposits
In device, described DMA is for obtaining described descriptor according to described entry address in described DDR;
Described DMA is additionally operable in described DDR obtain corresponding data and be transferred to described external USB equipment, transmits data
After update the descriptor state in described DDR,
Or,
Described DMA is additionally operable to receive the data of described external USB equipment transmission and be written back in described DDR, receives number
The descriptor state in described DDR is updated after according to.
In the embodiment of the present application, when being not inserted into external USB equipment on SoC, it is polled detection according to predetermined period,
After outside USB device identification success, no longer detecting, external USB equipment is extracted and is restarted automatic regular polling detection afterwards.
It should be noted that the USB correlation module of the USB module related in the embodiment of the present application and other correspondences and setting
Standby, such as USB interface, external USB equipment etc., both can support USB1.0, USB2.0, USB3.0, it is also possible to supports USB3.1,
It is not construed as limiting herein.
Below in conjunction with concrete scene, the embodiment of the present invention is introduced.
1) assuming that local terminal (base station side) is main equipment, opposite end (external USB equipment) is from equipment, it is assumed that external USB equipment
For USB flash disk, the selector within SOC is gated USB primary module, identify enumerating from equipment according to main equipment pattern (holotype)
Journey completes the identification of insertion equipment:
After being inserted into USB port from equipment USB flash disk, USB primary module first carries out speed negotiation with USB flash disk and shakes hands, after shaking hands successfully
As long as USB flash disk is in place, no longer poll identification.
If USB flash disk supports High-speed (fast mode), then it is routed to enhancement mode host controller interface (English complete
Claim: Enhanced Host Controller Interface, English abbreviation: EHCI) controller;
If USB flash disk supports Full-speed (Full-Speed mode) or Low-speed (low-speed mode), then it is routed to open
HCI (English full name: Open Host Controller Interface, English abbreviation: OHCI) controller.So
Rear USB primary module sends equipment to CPU and connects (Connect) interruption, and CPU builds corresponding descriptor at outside DDR subsequently, and
It is written to information such as base address in the first depositor of USB primary module or the second depositor (see and be routed to EHCI controller also
Being OHCI controller, if being routed to OHCI controller, being the most then the first depositor, if being routed to EHCI controller, the most then
It is the second depositor).
Descriptor in DDR is got in internal Buffer (relief area) by USB primary module, then resolves it, as
Really descriptor is shown to be needs and sends out data to USB flash disk, then need first to take the data needing to send from DDR, then USB flash disk is initiated OUT
Transmission (i.e. transmits data to USB flash disk);If descriptor is shown to be needs and obtains data from USB flash disk, then USB primary module is first to USB flash disk
Initiate IN operation (i.e. receiving the data of USB flash disk transmission), then retaking of a year or grade to data is stored in Buffer, then writes pointer in descriptor
In the DDR space pointed to.
When the main equipment of PC etc inserts, then cannot shake hands successfully, be strobed into USB by selector and switch to from module
From pattern, according to step 2) being identified of describing.
2) assume that local terminal (base station side) is that opposite end (external USB equipment) is main equipment from equipment, with outside USB device be
Illustrate as a example by PC (Personal Computer);
Selector MUX within SOC gates USB complete from setting from module, the enumeration process of cooperation opposite end main process equipment
Standby identification;
When the main equipment of PC etc inserts, and now USB initiates disconnecting from module to CPU, and CPU builds in DDR
Corresponding descriptor, and the entry address of descriptor is written to USB from the 3rd depositor of module, then DMA according to
This entry address takes descriptor in removing DDR, USB2.0Device resolves descriptor, if PC USB to be taken is from the number of module
According to, then fetch data during DMA needs DDR and be then transmitted, after end of transmission, update the descriptor state in DDR;If
PC sends data to USB from module, then DMA needs in the write back data that receives to DDR, and updates the description in DDR
Symbol state.
When USB flash disk etc after equipment is inserted into USB port, then cannot shake hands successfully.
3) automatic regular polling detection during inserting without equipment, repeats step 1 and 2, after equipment insertion identification principal and subordinate's success not
Detecting, equipment is extracted and is restarted automatic regular polling detection afterwards again.
The embodiment of the present application also provides for a kind of base station, SOC(system on a chip) SoC and outside Double Data Rate synchronous dynamic random deposit
Reservoir DDR, described SoC couple with described DDR, described SoC be as described above in arbitrary possible SOC(system on a chip).
In the embodiment of the present application embodiment of the method for switch mode is described below.
Referring to Fig. 5, for an embodiment of the method for switch mode in the embodiment of the present application, the method is applied to base station
In SOC(system on a chip), described SOC(system on a chip) include adjust mode of operation holotype and between pattern switching general serial total
Line USB module;
Described method includes:
501, when described USB module couples external USB equipment, the device type of described external USB equipment is detected;
Wherein, the device type of described external USB equipment includes main equipment and from equipment;
If 502 described external USB equipment are main equipment, the mode of operation of described USB module is adjusted from pattern;
If 503 described external USB equipment are from equipment, the mode of operation of described USB module is adjusted in holotype.
Optionally, described USB module includes adjusting USB module mode of operation in holotype and switching between pattern
USB principal and subordinate's module, selector, USB physical layer block and USB interface, described USB interface and described USB physical layer block coupling
Connecing, described USB interface is used for coupling external USB equipment, described selector and described USB physical layer block and described USB principal and subordinate
Module couples;
The described mode of operation by described USB module adjusts from pattern, including:
By described selector, the mode of operation of described USB module is adjusted from pattern;
The described mode of operation by described USB module adjusts in holotype, including:
By described selector, the mode of operation of described USB module is adjusted in holotype.
Optionally, described USB principal and subordinate's module include USB primary module and USB from module, described selector is respectively with described
USB primary module and described USB are from module couples;
Described by described selector, the mode of operation of described USB module is adjusted from pattern, including:
Gated by described selector and described USB connection between module, make the mode of operation of described USB module adjust
Whole from pattern;
Described by described selector, the mode of operation of described USB module is adjusted in holotype, including:
Gated the connection between described USB primary module by described selector, make the mode of operation of described USB module adjust
Whole in holotype.
Optionally, described USB primary module includes open HCI OHCI controller, enhancement mode console controller
Interface EHCI controller;Described OHCI controller includes that the first depositor, described EHCI controller include the second depositor;
When described external USB equipment is from equipment, described method also includes:
Determine the velocity mode that described external USB equipment is supported;
If described external USB equipment supports fast mode, then the read-write data of described external USB equipment are routed to described
EHCI controller;Equipment disconnecting message is sent to described CPU by described USB primary module;At the outside double-speed coupled
Rate synchronous DRAM DDR builds corresponding descriptor, and address information corresponding for described descriptor is written to institute
State in the second depositor;
If described external USB equipment supports Full-Speed mode or low-speed mode, then by the read-write data of described external USB equipment
It is routed to described OHCI controller;Equipment disconnecting message is sent to described CPU by described USB primary module;Couple
Outside DDR builds corresponding descriptor, and address information corresponding for described descriptor is written in described first depositor.
Optionally, described USB primary module also includes buffer area;
Described method also includes:
By described USB primary module by the descriptor acquiring in described DDR to described buffer area, and to described descriptor
Resolve;
If descriptor represents that needs to described external USB equipment sending data, then pass through described USB primary module from described
DDR obtains the data needing to send, and sends to described external USB equipment;
If descriptor represents that needs obtain data from described external USB equipment, then receive institute by described USB primary module
State the data that external USB equipment sends, be stored in described relief area, and write in the DDR space that pointer in descriptor points to.
Optionally, described USB includes the 3rd depositor and direct memory access DMA from module;
When described external USB equipment is main equipment, described method also includes:
Initiate disconnecting message from module to described CPU by described USB, in outside DDR, build corresponding description
Symbol, and the entry address of descriptor is written in described 3rd depositor, described DMA is used for according to described entry address in institute
Described descriptor is obtained in stating DDR;
Obtaining corresponding data in described DDR by described DMA and be transferred to described external USB equipment, transmission data are complete
The descriptor state in described DDR is updated after Biing,
Or,
Receive the data of described external USB equipment transmission by described DMA and be written back in described DDR, receiving data
After update the descriptor state in described DDR.
Those skilled in the art is it can be understood that arrive, for convenience and simplicity of description, and the system of foregoing description,
The specific works process of device and unit, is referred to the corresponding process in preceding method embodiment, does not repeats them here.
In several embodiments provided herein, it should be understood that disclosed system, apparatus and method are permissible
Realize by another way.Such as, device embodiment described above is only schematically, such as, and described unit
Dividing, be only a kind of logic function and divide, actual can have other dividing mode, the most multiple unit or assembly when realizing
Can in conjunction with or be desirably integrated into another system, or some features can be ignored, or does not performs.Another point, shown or
The coupling each other discussed or direct-coupling or communication connection can be the indirect couplings by some interfaces, device or unit
Close or communication connection, can be electrical, machinery or other form.
The described unit illustrated as separating component can be or may not be physically separate, shows as unit
The parts shown can be or may not be physical location, i.e. may be located at a place, or can also be distributed to multiple
On NE.Some or all of unit therein can be selected according to the actual needs to realize the mesh of the present embodiment scheme
's.
It addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it is also possible to
It is that unit is individually physically present, it is also possible to two or more unit are integrated in a unit.Above-mentioned integrated list
Unit both can realize to use the form of hardware, it would however also be possible to employ the form of SFU software functional unit realizes.
If described integrated unit realizes and as independent production marketing or use using the form of SFU software functional unit
Time, can be stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially
The part that in other words prior art contributed or this technical scheme completely or partially can be with the form of software product
Embodying, this computer software product is stored in a storage medium, including some instructions with so that a computer
Equipment (can be personal computer, server, or the network equipment etc.) performs the complete of method described in each embodiment of the present invention
Portion or part steps.And aforesaid storage medium includes: USB flash disk, portable hard drive, read only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey
The medium of sequence code.
The above, above example only in order to technical scheme to be described, is not intended to limit;Although with reference to front
State embodiment the present invention has been described in detail, it will be understood by those within the art that: it still can be to front
State the technical scheme described in each embodiment to modify, or wherein portion of techniques feature is carried out equivalent;And these
Amendment or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.
Claims (13)
1. a SOC(system on a chip), it is characterised in that be applied to base station, described SOC(system on a chip) includes central processor CPU, and adjusts
Full employment pattern holotype and between pattern switching general-purpose serial bus USB module, described USB module one end is with described
CPU couples, and described USB module is additionally operable to couple external USB equipment;
When described USB module couples external USB equipment, described CPU is used for detecting the device type of described external USB equipment,
The device type of described external USB equipment includes main equipment and from equipment;
If described external USB equipment is main equipment, described CPU is additionally operable to adjust from mould the mode of operation of described USB module
Formula;
If described external USB equipment is from equipment, described CPU is additionally operable to adjust at main mould the mode of operation of described USB module
Formula.
SOC(system on a chip) the most according to claim 1, it is characterised in that described USB module includes adjusting USB module Working mould
Formula holotype and between pattern switching USB principal and subordinate's module, selector, USB physical layer block and USB interface, described
USB interface couples with described USB physical layer block, and described USB interface is used for coupling external USB equipment, described selector and institute
State USB physical layer block and described USB principal and subordinate's module couples;
Described CPU, specifically for when described external USB equipment is main equipment, is used for described USB mould by described selector
The mode of operation of block adjusts from pattern;
Described CPU, specifically for when described external USB equipment is from equipment, is used for described USB mould by described selector
The mode of operation of block adjusts in holotype.
SOC(system on a chip) the most according to claim 2, it is characterised in that described USB principal and subordinate's module include USB primary module and
USB from module, described selector respectively with described USB primary module and described USB from module couples;
Described CPU is specifically for when described external USB equipment is main equipment, for being gated with described by described selector
USB connection between module, makes the mode of operation of described USB module adjust from pattern;
Described CPU is specifically for when described external USB equipment is from equipment, for being gated with described by described selector
Connection between USB primary module, makes the mode of operation of described USB module adjust in holotype.
SOC(system on a chip) the most according to claim 3, it is characterised in that described USB primary module includes open host computer control
Interface OHCI controller, enhancement mode host controller interface EHCI controller;Described OHCI controller includes the first depositor, institute
State EHCI controller and include the second depositor;
When described external USB equipment is from equipment, described CPU is additionally operable to determine the speed that described external USB equipment is supported
Pattern;
If described external USB equipment supports fast mode, the most described CPU is additionally operable to the read-write data of described external USB equipment
It is routed to described EHCI controller;Described USB primary module is for sending equipment disconnecting message to described CPU;Described CPU is also
For building corresponding descriptor at the outside Double Data Rate synchronous DRAM DDR coupled, and by described descriptor
Corresponding address information is written in described second depositor;
If described external USB equipment supports Full-Speed mode or low-speed mode, the most described CPU is additionally operable to described external USB equipment
Read-write data be routed to described OHCI controller;Described USB primary module disappears for sending equipment disconnecting to described CPU
Breath;Described CPU is additionally operable to build corresponding descriptor at the outside DDR coupled, and by address information corresponding for described descriptor
It is written in described first depositor.
SOC(system on a chip) the most according to claim 4, it is characterised in that described USB primary module also includes buffer area;
Described USB primary module is additionally operable in the descriptor acquiring in described DDR to described buffer area, and enters described descriptor
Row resolves;
If described descriptor represents that needs are additionally operable to from described to described external USB equipment sending data, the most described USB primary module
DDR obtains the data needing to send, and sends to described external USB equipment;
If described descriptor represents that needs obtain data from described external USB equipment, the most described USB primary module is additionally operable to receive
The data that described external USB equipment sends, are stored in described relief area, and write the DDR space that pointer in described descriptor points to
In.
6. according to described SOC(system on a chip) arbitrary in claim 3 to 5, it is characterised in that from module, described USB includes that the 3rd posts
Storage and direct memory access DMA;
When described external USB equipment is main equipment, described USB is used for initiating disconnecting message, institute to described CPU from module
State CPU and build corresponding descriptor in outside DDR, and the entry address of described descriptor is written to described 3rd depositor
In, described DMA is for obtaining described descriptor according to described entry address in described DDR;
Described DMA is additionally operable in described DDR obtain corresponding data and be transferred to described external USB equipment, and transmission data are complete
Descriptor state in the described DDR of rear renewal,
Or,
Described DMA is additionally operable to receive the data of described external USB equipment transmission and be written back in described DDR, receives data complete
The descriptor state in described DDR is updated after Biing.
7. the method for a switch mode, it is characterised in that the SOC(system on a chip) being applied in base station, described SOC(system on a chip) includes adjusting
Full employment pattern holotype and between pattern switching general-purpose serial bus USB module;
Described method includes:
When described USB module couples external USB equipment, detect the device type of described external USB equipment, described external USB
The device type of equipment includes main equipment and from equipment;
If described external USB equipment is main equipment, the mode of operation of described USB module is adjusted from pattern;
If described external USB equipment is from equipment, the mode of operation of described USB module is adjusted in holotype.
Method the most according to claim 7, it is characterised in that described USB module includes that adjusting USB module mode of operation exists
Holotype and the USB principal and subordinate's module, selector, USB physical layer block and the USB interface that switch between pattern, described USB connects
Mouth couples with described USB physical layer block, and described USB interface is used for coupling external USB equipment, described selector and described USB
Physical layer block and described USB principal and subordinate's module couples;
The described mode of operation by described USB module adjusts from pattern, including:
By described selector, the mode of operation of described USB module is adjusted from pattern;
The described mode of operation by described USB module adjusts in holotype, including:
By described selector, the mode of operation of described USB module is adjusted in holotype.
Method the most according to claim 8, it is characterised in that described USB principal and subordinate's module include USB primary module and USB from
Module, described selector respectively with described USB primary module and described USB from module couples;
Described by described selector, the mode of operation of described USB module is adjusted from pattern, including:
Gated by described selector and described USB connection between module, make the mode of operation of described USB module adjust
From pattern;
Described by described selector, the mode of operation of described USB module is adjusted in holotype, including:
Gated the connection between described USB primary module by described selector, make the mode of operation of described USB module adjust
Holotype.
Method the most according to claim 9, it is characterised in that described USB primary module includes open HCI
OHCI controller, enhancement mode host controller interface EHCI controller;Described OHCI controller includes the first depositor, described
EHCI controller includes the second depositor;
When described external USB equipment is from equipment, described method also includes:
Determine the velocity mode that described external USB equipment is supported;
If described external USB equipment supports fast mode, then the read-write data of described external USB equipment are routed to described EHCI
Controller;Equipment disconnecting message is sent to described CPU by described USB primary module;Same at the outside Double Data Rate coupled
Step dynamic RAM DDR builds corresponding descriptor, and address information corresponding for described descriptor is written to described the
In two depositors;
If described external USB equipment supports Full-Speed mode or low-speed mode, then the read-write data of described external USB equipment are route
To described OHCI controller;Equipment disconnecting message is sent to described CPU by described USB primary module;In the outside coupled
DDR builds corresponding descriptor, and address information corresponding for described descriptor is written in described first depositor.
11. methods according to claim 10, it is characterised in that described USB primary module also includes buffer area;
Described method also includes:
By described USB primary module by the descriptor acquiring in described DDR to described buffer area, and described descriptor is carried out
Resolve;
If described descriptor represents that needs to described external USB equipment sending data, then pass through described USB primary module from described
DDR obtains the data needing to send, and sends to described external USB equipment;
If described descriptor represents that needs obtain data from described external USB equipment, then receive institute by described USB primary module
State the data that external USB equipment sends, be stored in described relief area, and write in the DDR space that pointer in described descriptor points to.
12. according to Claim 8 to described method arbitrary in 10, it is characterised in that from module, described USB includes that the 3rd deposits
Device and direct memory access DMA;
When described external USB equipment is main equipment, described method also includes:
Initiate disconnecting message from module to described CPU by described USB, in outside DDR, build corresponding descriptor, and
Being written to the entry address of described descriptor in described 3rd depositor, described DMA is used for according to described entry address in institute
Described descriptor is obtained in stating DDR;
In described DDR, obtain corresponding data by described DMA and be transferred to described external USB equipment, after transmission data
Update the descriptor state in described DDR,
Or,
Receive the data of described external USB equipment transmission by described DMA and be written back in described DDR, receiving data complete
Descriptor state in the described DDR of rear renewal.
13. 1 kinds of base stations, it is characterised in that include SOC(system on a chip) SoC and outside Double Data Rate synchronous DRAM
DDR, described SoC couple with described DDR, and described SoC is the SOC(system on a chip) as described in arbitrary in claim 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610369726.1A CN106066842A (en) | 2016-05-30 | 2016-05-30 | A kind of method of switch mode, SOC(system on a chip) and base station |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610369726.1A CN106066842A (en) | 2016-05-30 | 2016-05-30 | A kind of method of switch mode, SOC(system on a chip) and base station |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106066842A true CN106066842A (en) | 2016-11-02 |
Family
ID=57420920
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610369726.1A Pending CN106066842A (en) | 2016-05-30 | 2016-05-30 | A kind of method of switch mode, SOC(system on a chip) and base station |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106066842A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107967049A (en) * | 2017-10-18 | 2018-04-27 | 珠海全志科技股份有限公司 | A kind of implementation method that chip power-consumption is reduced based on usb protocol |
CN108429693A (en) * | 2018-02-09 | 2018-08-21 | 上海康斐信息技术有限公司 | A kind of router and its control method of debugging mouth and network interface multiplexing |
CN108599212A (en) * | 2018-04-12 | 2018-09-28 | 浙江正泰电器股份有限公司 | Energy-storage system |
CN109408418A (en) * | 2017-08-17 | 2019-03-01 | 深圳市中兴微电子技术有限公司 | A kind of USB mode switching device and method, USB device |
CN111823863A (en) * | 2020-05-28 | 2020-10-27 | 惠州华阳通用电子有限公司 | Vehicle-mounted play source switching method, system and equipment |
CN112286849A (en) * | 2020-10-29 | 2021-01-29 | 捷开通讯(深圳)有限公司 | Wireless charging base data switching method and system, storage medium and terminal equipment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1362676A (en) * | 2002-01-28 | 2002-08-07 | 威盛电子股份有限公司 | USB control circuit capable of switching path automatically |
JP2007172160A (en) * | 2005-12-20 | 2007-07-05 | Seiko Epson Corp | Usb communication device, and method for switching communication speed |
CN101944074A (en) * | 2010-07-05 | 2011-01-12 | 中兴通讯股份有限公司 | Method and device for realizing OTG based on USB socket |
-
2016
- 2016-05-30 CN CN201610369726.1A patent/CN106066842A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1362676A (en) * | 2002-01-28 | 2002-08-07 | 威盛电子股份有限公司 | USB control circuit capable of switching path automatically |
JP2007172160A (en) * | 2005-12-20 | 2007-07-05 | Seiko Epson Corp | Usb communication device, and method for switching communication speed |
CN101944074A (en) * | 2010-07-05 | 2011-01-12 | 中兴通讯股份有限公司 | Method and device for realizing OTG based on USB socket |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109408418A (en) * | 2017-08-17 | 2019-03-01 | 深圳市中兴微电子技术有限公司 | A kind of USB mode switching device and method, USB device |
CN109408418B (en) * | 2017-08-17 | 2022-03-25 | 深圳市中兴微电子技术有限公司 | USB mode switching device and method and USB equipment |
CN107967049A (en) * | 2017-10-18 | 2018-04-27 | 珠海全志科技股份有限公司 | A kind of implementation method that chip power-consumption is reduced based on usb protocol |
CN108429693A (en) * | 2018-02-09 | 2018-08-21 | 上海康斐信息技术有限公司 | A kind of router and its control method of debugging mouth and network interface multiplexing |
CN108599212A (en) * | 2018-04-12 | 2018-09-28 | 浙江正泰电器股份有限公司 | Energy-storage system |
CN111823863A (en) * | 2020-05-28 | 2020-10-27 | 惠州华阳通用电子有限公司 | Vehicle-mounted play source switching method, system and equipment |
CN111823863B (en) * | 2020-05-28 | 2021-11-16 | 惠州华阳通用电子有限公司 | Vehicle-mounted play source switching method, system and equipment |
CN112286849A (en) * | 2020-10-29 | 2021-01-29 | 捷开通讯(深圳)有限公司 | Wireless charging base data switching method and system, storage medium and terminal equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106066842A (en) | A kind of method of switch mode, SOC(system on a chip) and base station | |
US20110191503A1 (en) | Motherboard Compatible with Multiple Versions of Universal Serial Bus (USB) and Related Method | |
US8407367B2 (en) | Unified connector architecture | |
CN204595844U (en) | USB multi-computer switcher | |
CN103095855B (en) | I2C communication interface unit | |
CN104765705B (en) | Read method, device and a kind of mobile terminal for the mobile terminal stored data do not started shooting | |
CN102073602B (en) | Computer system, connection control device as well as connecting and disconnecting method | |
CN115543894B (en) | Storage system, data processing method and device, storage medium and electronic equipment | |
WO2017095593A1 (en) | Increased data flow in universal serial bus (usb) cables | |
CN103631534B (en) | Data storage system and managing method thereof | |
CN109471660A (en) | Docking station device, electronic device and MAC address clone method | |
CN109471831A (en) | A kind of data processing method and device | |
CN107391409B (en) | PCI-E network controller, network equipment and data transmission method | |
CN105681222A (en) | Method and apparatus for data receiving and caching, and communication system | |
CN103412838B (en) | A kind of expanding system, communication means, address configuration method, equipment and device | |
CN107506324A (en) | Interconnecting device, telecommunication system, data transmission method and device | |
CN104123173A (en) | Method and device for achieving communication between virtual machines | |
CN103577356B (en) | Realize the Apparatus and method for of IIC interface IP address extension | |
CN107643938A (en) | Data transmission method, device and storage medium | |
CN204595794U (en) | USB computer switcher signal extender and extender system | |
CN108255759A (en) | PCI-E adapters and data processing system | |
CN104899164B (en) | Address addressing method for integrated circuit bus, integrated circuit bus device and system | |
CN104679687B (en) | A kind of method and device for identifying interrupt source | |
US8972625B2 (en) | Electronic apparatus and host determination method | |
TWM531105U (en) | Network card information recognition system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20161102 |
|
RJ01 | Rejection of invention patent application after publication |