WO2022052883A1 - 一种节约双片上系统存储资源的方法、双片上系统 - Google Patents

一种节约双片上系统存储资源的方法、双片上系统 Download PDF

Info

Publication number
WO2022052883A1
WO2022052883A1 PCT/CN2021/116640 CN2021116640W WO2022052883A1 WO 2022052883 A1 WO2022052883 A1 WO 2022052883A1 CN 2021116640 W CN2021116640 W CN 2021116640W WO 2022052883 A1 WO2022052883 A1 WO 2022052883A1
Authority
WO
WIPO (PCT)
Prior art keywords
soc
driver
usb
memory
firmware code
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.)
Ceased
Application number
PCT/CN2021/116640
Other languages
English (en)
French (fr)
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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Publication of WO2022052883A1 publication Critical patent/WO2022052883A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/167Interprocessor communication using a common memory, e.g. mailbox
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/76Architectures of general purpose stored program computers
    • G06F15/78Architectures of general purpose stored program computers comprising a single central processing unit
    • G06F15/7807System on chip, i.e. computer system on a single chip; System in package, i.e. computer system on one or more chips in a single package
    • G06F15/781On-chip cache; Off-chip memory
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

Definitions

  • the present application relates to the embedded field, and in particular, to a method for saving storage resources of a dual-chip system, and a dual-chip system.
  • Some embedded devices have two SoCs, and according to the two SoCs, these embedded devices run two independent operating systems simultaneously, for example, one operating system is Android and the other is Linux.
  • FIG. 1 is a schematic diagram of a dual-chip system in a related embedded device.
  • the first system-on-chip consists of a system-on-a-chip (SOC, System-on-a-Chip) A, a synchronous dynamic random access memory (SDRAM, Synchronous Dynamic Random Access Memory) A connected to the SOC A, a flash memory chip ( Flash) A and input output (IO, Input Output) A, the first system-on-chip supports operating system (OS, Operation System) A, wherein Flash A includes OS A firmware code partition and OS A file system partition; the second The system-on-chip consists of SOC B, and SDRAM B, Flash B and IO B connected to the SOC B by zzsrwdaxz respectively.
  • the second system-on-chip supports OS B, wherein Flash B includes OS B firmware code partition and OS B file system partition.
  • each operating system has its own independent storage resources, such as Flash.
  • the embedded device For an embedded device with two SoCs, the embedded device has two independent operating systems, which leads to a waste of storage resources in the embedded device.
  • the embodiments of the present application provide a method for saving storage resources of a dual-chip system, and dual-chip systems, so as to realize that dual operating systems share the same storage resource and save storage resources.
  • An embodiment of the present application provides a method for saving storage resources of a dual-chip system, where the dual-chip system includes: a first SOC, a first memory connected to the first SOC, and a memory connected to the first SOC. a first system on a chip, and a second system on a chip, the second system on a chip includes a second SOC and a second memory connected to the second SOC;
  • a communication link is established between the first SOC and the second SOC, and the second SOC operates the memory through the communication link.
  • the first SoC supports a first OS
  • the second SoC supports a second OS
  • the memory stores the firmware code of the first OS and the firmware code of the second OS; wherein, the firmware code of the first OS and the firmware code of the second OS respectively include a driver for establishing a communication link;
  • a startup code is solidified in the second SOC, and the startup code includes a driver for establishing a communication link;
  • the communication link is established as follows:
  • the firmware code of the first OS is read from the memory, and the firmware code of the first OS is loaded into the first memory, the first OS is started, and the driver is loaded in the first OS;
  • the driver is a Universal Serial Bus (USB, Universal Serial Bus) driver
  • a communication link between the first SOC and the second SOC is established, including:
  • the handshake protocol data packet is sent to the USB driver on the first SOC side until the USB communication link between the first SOC and the second SOC is successfully established.
  • the second SOC operates the memory through a communication link, including:
  • the USB driver on the second SOC side sends an OS firmware code request command to the USB driver on the first SOC side, so that the USB driver on the first SOC side reads the second SOC in the memory in response to the OS firmware code request command
  • the firmware code of the OS and through the USB communication link, the firmware code of the second OS is sent to the USB driver on the second SOC side;
  • the USB driver on the second SOC side After the USB driver on the second SOC side successfully receives the firmware code of the second OS from the first SOC, it loads the firmware code of the second OS into the second memory, starts the second OS, and enables the startup of the second SOC.
  • the life cycle of the USB driver in the code is over;
  • the USB driver in the firmware code of the second OS is loaded in the second SOC, and the USB driver on the second SOC side establishes a communication link with the USB driver on the first SOC side again;
  • the USB driver on the first SOC side maps the storage address information of the partition allocated to the second SOC in the memory to the USB driver on the first SOC side, and the USB driver on the first SOC side maps the mapped storage address.
  • the information is sent to the USB driver on the second SOC side; after receiving the storage address information, the USB driver on the second SOC side establishes an address map of the memory, accesses the memory through the address map, and performs data transmission.
  • the memory has a partition for storing the firmware code of the first OS, a partition for storing the firmware code of the second OS, a partition for storing the file system of the first OS, and a partition for storing the second OS.
  • the driver is a Serial Peripheral Interface (SPI, Serial Peripheral Interface) driver or a Universal Asynchronous Receiver Transmitter (UART, Universal Asynchronous Receiver Transmitter) driver.
  • SPI Serial Peripheral Interface
  • UART Universal Asynchronous Receiver Transmitter
  • An embodiment of the present application provides a dual-chip system, the dual-chip system includes a first on-chip system consisting of a first SOC, a first memory connected to the first SOC, and a memory connected to the first SOC a system, and a second system on a chip; the second system on a chip includes a second SOC and a second memory connected to the second SOC;
  • a communication link is established between the first SOC and the second SOC, and the second SOC operates the memory through the communication link.
  • the first SoC supports a first OS
  • the second SoC supports a second OS
  • the memory stores the firmware code of the first OS and the firmware code of the second OS; wherein, the firmware code of the first OS and the firmware code of the second OS respectively include a driver for establishing a communication link;
  • a startup code is solidified in the second SOC, and the startup code includes a driver for establishing a communication link;
  • the first SOC reads the first OS firmware code from the memory, loads the firmware code of the first OS into the first memory, starts the first OS, and loads the driver in the first OS;
  • the second SOC loads the startup code into the second memory, runs the startup code, and loads the driver in the second OS;
  • the driver is a USB driver
  • a communication link between the first SOC and the second SOC is established, including:
  • the handshake protocol data packet is sent to the USB driver on the first SOC side until the USB communication link between the first SOC and the second SOC is successfully established.
  • the memory has a partition for storing the firmware code of the first OS, a partition for storing the firmware code of the second OS, a partition for storing the file system of the first OS, and a partition for storing the second OS.
  • the driver is an SPI driver or a UART driver.
  • An access control provided by an embodiment of the present application includes any one of the above-mentioned dual-chip systems.
  • the method and dual SoC provided by the embodiments of the present application provide a communication link established between a first SOC in the first SoC and a second SOC in the second SoC, so that the first SOC Sharing the same memory with the second SOC reduces the number of memory chips in the dual-chip system, saves the chip cost of the dual-chip system, and provides redundant space for the layout of the dual-chip system circuit board, which is convenient for the miniaturization of the dual-chip system. reduction, weight reduction and integration.
  • FIG. 1 is a schematic diagram of a dual system-on-chip in a related embedded device.
  • FIG. 5 is a schematic diagram of storage space allocation in Flash according to an embodiment of the present application.
  • the communication protocol supported by the communication link adopts the USB communication protocol.
  • the USB driver of the first SoC can be stored in Flash A to reduce the memory occupation caused by the program being solidified in SOC A.
  • a USB driver can be included in the OS A firmware code.
  • SOC B loads Bootrom, the boot code solidified inside SOC B, into SDRAM B;
  • the USB driver on the SOC B side sends a handshake protocol packet to the USB driver on the SOC A side, until the USB driver of SOC A and the USB driver of SOC B are successful Establish a USB communication link between SOC A and SOC B; the USB driver on the SOC A side waits to receive the handshake protocol data packet sent by the USB driver on the SOC B side.
  • USB communication link can be established between SOC A and SOC B.
  • SOC B can directly access Flash A through the established USB communication link as if it were accessing the memory connected to itself.
  • the USB driver on the SOC A side After receiving the OS firmware code request command, the USB driver on the SOC A side reads the OS B firmware code in Flash A in response to the OS firmware code request command, and sends the OS B firmware code to the SOC through the USB communication link USB driver on side B.
  • the USB driver on the SOC A side maps the storage address information of the partition allocated to the SOC B in the memory to the USB driver on the SOCA side, and the USB driver on the SOCA side sends the mapped storage address information to the USB driver on the SOC B side.
  • the storage address information of the partition allocated to SOC B in Flash A can be mapped to the USB driver on the SOCA side, so that the USB driver on the SOCA side sends the mapped storage address information to SOC B.
  • the OS A firmware code partition is a partition for storing the OS A firmware code.
  • the OS B firmware code partition is the partition used to store OS B's firmware code.
  • the OS A file system partition is the partition used to store the OS A file system.
  • the OS B file system partition is the partition used to store the OS B file system.
  • the first partition is used to store data written by SOC A
  • the second partition is used to store data written by SOC B.
  • SOC A reads data from the first partition
  • SOC B reads data from the second partition.
  • the second system-on-chip is used for algorithm-based data processing, for example, processing image data based on a face recognition algorithm.
  • the second system-on-chip supports a Linux system, and connects image acquisition modules, such as thermal imaging modules and/or camera modules, through IO B.
  • SOC A After SOC A starts, SOC A reads the OS B firmware code in Flash A, sends it to SOC B through the USB communication link, and maps the storage address information of the OS B file system partition in Flash A to the USB driver of SOC A , SOC A sends the storage address information of the OS B file system partition to SOC B through the USB driver, so that SOC B can directly read and write Flash A through the USB communication link like accessing the memory connected to itself.
  • SOC B When SOC B starts, load Bootrom into SDRAM B and run Bootrom; receive OS B firmware code from SOC A, load OS B firmware code into SDRAM B through Bootrom, start OS B, and detect through USB driver To the mapped OS B file system partition, read the algorithm program file from Flash A, and load the algorithm program file into SDRAM B.
  • SOC B runs the algorithm program file to perform face recognition based on image data, and transmits the recognition result (ie, the algorithm processing result) to SOC A through the USB communication link.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Stored Programmes (AREA)

Abstract

本申请公开了一种节约双片上系统存储资源的方法和双片上系统,双片上系统包括由第一系统级芯片SOC、与第一SOC相连接的第一内存、与第一SOC相连接的存储器组成的第一片上系统,以及第二片上系统,其中,第二片上系统包括第二SOC、以及与第二SOC相连接的第二内存,第一SOC与第二SOC之间建立有通信链路,使得第二SOC通过通信链路操作存储器。本申请实施例提供的技术方案中,第一SOC与第二SOC共用同一存储器,减少了双片上系统中存储器的芯片数量,降低了系统的芯片成本,为双片上系统电路板的布局提供了冗余空间,便于双片上系统的小型化、轻量化和集成化。

Description

一种节约双片上系统存储资源的方法、双片上系统
本申请要求于2020年9月9日提交中国专利局、申请号为202010940183.0发明名称为“一种节约双片上系统存储资源的方法、双片上系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及嵌入式领域,特别地,涉及一种节约双片上系统存储资源的方法、双片上系统。
背景技术
在一些嵌入式设备中具有两个片上系统,依据两个片上系统,这些嵌入式设备同时运行两个独立的操作系统,例如,一个操作系统为安卓系统,另一个操作系统为Linux系统。
参见图1所示,图1为相关嵌入式设备中的双片上系统的一种示意图。第一片上系统由系统级芯片(SOC,System-on-a-Chip)A、以及分别与该SOC A相连的同步动态随机存取内存(SDRAM,Synchronous Dynamic Random Access Memory)A、闪存芯片(Flash)A和输入输出(IO,Input Output)A组成,第一片上系统支持操作系统(OS,Operation System)A,其中,Flash A包括OS A固件代码分区以及OS A文件系统分区;第二片上系统由SOC B、以及zzsrwdaxz分别与该SOC B相连的SDRAM B、Flash B和IO B组成,第二片上系统支持OS B,其中,Flash B包括OS B固件代码分区以及OS B文件系统分区。
从操作系统而言,每个操作系统都拥有自己独立的存储资源,例如,Flash。而具有两个片上系统的嵌入式设备而言,该嵌入式设备具有两个独立的操作系统,这导致了嵌入式设备中存储资源的浪费。
发明内容
本申请实施例提供了一种节约双片上系统存储资源的方法、双片上系统,以实现双操作系统共用同一存储资源,节约存储资源。
本申请实施例提供的一种节约双片上系统存储资源的方法,所述双片上系统包括:由第一SOC、与第一SOC相连接的第一内存、与第一SOC相连 接的存储器组成的第一片上系统,以及第二片上系统,所述第二片上系统包括第二SOC、以及与第二SOC相连接的第二内存;
所述第一SOC与所述第二SOC之间建立有通信链路,所述第二SOC通过通信链路操作所述存储器。
可选的,所述第一片上系统支持第一OS,所述第二片上系统支持第二OS;
所述存储器存储有第一OS的固件代码以及第二OS的固件代码;其中,第一OS的固件代码和第二OS的固件代码分别包含有用于建立通信链路的驱动程序;
所述第二SOC中固化有启动代码,该启动代码包含有用于建立通信链路的驱动程序;
所述通信链路按照如下步骤建立:
在第一SOC侧,从存储器中读取第一OS的固件代码,并将第一OS的固件代码加载至第一内存中,启动第一OS,在第一OS中加载驱动程序;
在第二SOC侧,将启动代码加载至第二内存中,运行启动代码,在第二OS中加载驱动程序;
第一SOC和第二SOC分别加载驱动程序后,建立第一SOC和第二SOC间的通信链路。
可选的,所述驱动程序为通用串行总线(USB,Universal Serial Bus)驱动程序;
所述第一SOC和第二SOC分别加载驱动程序后,建立第一SOC和第二SOC间的通信链路,包括:
在第一SOC侧,USB驱动程序加载成功后,等待接收第二SOC侧的USB驱动程序发出的握手协议数据包;
在第二SOC侧,USB驱动程序加载成功后,向第一SOC侧的USB驱动程序发送所述握手协议数据包,直至成功建立第一SOC和第二SOC间的USB通信链路。
可选的,所述第二SOC通过通信链路操作存储器,包括:
第一SOC侧的USB驱动程序和第二SOC侧的USB驱动程序成功建立第 一SOC和第二SOC间的USB通信链路后,
第二SOC侧的USB驱动程序向第一SOC侧的USB驱动程序发送OS固件代码请求命令,使得第一SOC侧的USB驱动程序响应于所述OS固件代码请求命令,读取存储器中的第二OS的固件代码,并通过USB通信链路,将第二OS的固件代码发送给第二SOC侧的USB驱动程序;
第二SOC侧的USB驱动程序成功接收来自第一SOC的第二OS的固件代码后,将第二OS的固件代码加载到第二内存里,启动第二OS,并使得第二SOC中的启动代码里的USB驱动程序的生命周期结束;
第二OS启动成功后,在第二SOC中加载第二OS的固件代码中的USB驱动程序,第二SOC侧的USB驱动程序再次与第一SOC侧的USB驱动程序建立通信链路;如果建立成功,第一SOC侧的USB驱动程序将存储器中分配给第二SOC的分区的存储地址信息映射给第一SOC侧的USB驱动程序,由第一SOC侧的USB驱动程序将所映射的存储地址信息发送给第二SOC侧的USB驱动程序;第二SOC侧的USB驱动程序接收到存储地址信息后,建立存储器的地址映射,通过该地址映射访问存储器,并进行数据传输。
可选的,所述存储器具有用于存储第一OS的固件代码的分区、用于存储第二OS的固件代码的分区、用于存储第一OS的文件系统的分区、用于存储第二OS的文件系统的分区、分配给第二SOC的第二分区、以及分配给第一SOC的第一分区。
可选的,所述驱动程序为串行外设接口(SPI,Serial Peripheral Interface)驱动程序或通用异步收发器(UART,Universal Asynchronous Receiver Transmitter)驱动程序。
本申请实施例提供的一种双片上系统,所述双片上系统包括,由第一SOC、与第一SOC相连接的第一内存、以及与第一SOC相连接的存储器组成的第一片上系统,以及第二片上系统;所述第二片上系统包括第二SOC、以及与第二SOC相连接的第二内存;
所述第一SOC与所述第二SOC之间建立有通信链路,所述第二SOC通过通信链路操作所述存储器。
可选的,所述第一片上系统支持第一OS,所述第二片上系统支持第二 OS;
所述存储器存储有第一OS的固件代码、以及第二OS的固件代码;其中,第一OS的固件代码和第二OS的固件代码分别包含有用于建立通信链路的驱动程序;
所述第二SOC中固化有启动代码,该启动代码包含有用于建立通信链路的驱动程序;
所述第一SOC从存储器中读取第一OS固件代码,并将第一OS的固件代码加载至第一内存中,启动第一OS,在第一OS中加载驱动程序;
所述第二SOC将启动代码加载至第二内存中,运行启动代码,在第二OS中加载驱动程序;
第一SOC和第二SOC分别加载驱动程序后,建立第一SOC和第二SOC间的通信链路。
可选的,所述驱动程序为USB驱动程序;
所述第一SOC和第二SOC分别加载驱动程序后,建立第一SOC和第二SOC间的通信链路,包括:
第一SOC侧的USB驱动程序加载成功后,等待接收第二SOC上USB驱动程序发送的握手协议数据包;
第二SOC侧的USB驱动程序加载成功后,向第一SOC侧的USB驱动程序发送所述握手协议数据包,直至成功建立第一SOC和第二SOC间的USB通信链路。
可选的,所述第二SOC通过通信链路操作存储器,包括,
第一SOC侧的USB驱动程序和第二SOC侧的USB驱动成功建立第一SOC和第二SOC间的USB通信链路后,第二SOC侧的USB驱动程序向第一SOC侧的USB驱动程序发送OS固件代码请求命令,使得第一SOC侧的USB驱动程序响应于该OS固件代码请求命令,读取存储器中的第二OS的固件代码,并通过USB通信链路路,将第二OS的固件代码发送给第二SOC侧的USB驱动程序;
第二SOC侧的USB驱动程序成功接收来自第一SOC的第二OS的固件代码后,将第二OS固件代码加载到第二内存里,启动第二OS,并使得第二 SOC中的启动代码里的USB驱动程序的生命周期结束;
第二OS启动成功后,在第二SOC中加载第二OS的固件代码中的USB驱动程序,第二SOC侧的USB驱动程序再次与第一SOC侧的USB驱动程序建立通信链路;如果建立成功,第一SOC侧的USB驱动程序将存储器中分配给第二SOC的分区的存储地址信息映射给第一SOC侧的USB驱动程序,由第一SOC侧的USB驱动程序将所映射的存储地址信息发送给第二SOC侧的USB驱动程序;第二SOC侧的USB驱动程序接收到存储地址信息后,建立存储器的地址映射,通过该地址映射访问存储器件,并进行数据传输。
可选的,所述存储器具有用于存储第一OS的固件代码的分区、用于存储第二OS的固件代码的分区、用于存储第一OS的文件系统的分区、用于存储第二OS的文件系统的分区、分配给第二SOC的第二分区、以及分配给第一SOC的第一分区。
可选的,所述驱动程序为SPI驱动程序或UART驱动程序。
本申请实施例提供的一种门禁,所述门禁包括上述任一所述的双片上系统。
本申请实施例提供的节约双片上系统存储资源的方法和双片上系统,通过第一片上系统中的第一SOC与第二片上系统中的第二SOC建立的通信链路,使得第一SOC与第二SOC共用同一存储器,减少了双片上系统中存储器的芯片数量,节约了双片上系统地芯片成本,还可以为双片上系统电路板的布局提供了冗余空间,便于双片上系统的小型化、轻量化和集成化。
另外,在进行固件升级时,只需要通过一个SOC将待升级的固件代码烧录到存储器上即可,提高了固件升级的效率。
附图说明
图1是为相关嵌入式设备中的双片上系统的一种示意图。
图2为本申请实施例提供的节约双片上系统存储资源的一种双片上系统的示意图。
图3为本申请实施例提供的双片上系统加载USB驱动建立USB通信链路的一种流程示意图。
图4为本申请实施例提供的双片上系统启动进入正常工作的一种流程示 意图。
图5为本申请实施例提供的Flash中存储空间分配的一种示意图。
图6为本申请实施例提供的应用于人脸识别门禁控制的双片上系统的一种示意图。
具体实施方式
为了使本申请的目的、技术手段和优点更加清楚明白,以下结合附图对本申请做进一步详细说明。
本申请实施例在不损失系统功能的同时,为节省硬件资源,将双片上系统中的任一片上系统中的存储芯片去除,保留另一片上系统中的存储芯片,在两个片上系统的SOC之间建立通信链路,以使得双片上系统共用同一存储资源。其中,存储芯片又可以称为存储器。
参见图2所示,图2为本申请实施例提供的节约双片上系统存储资源的一种双片上系统的示意图。该双片上系统包括,由SOC A、Flash A、SDRAM A、IO A组成的第一片上系统,由SOC B、SDRAM B、IO B组成的第二片上系统。其中,Flash A可以存储有OS A固件代码、OS A文件系统、OS B固件代码、以及OS B文件系统。因为SOC B无Flash可用,也就无法加载Flash中的代码进行运行,为了能让SOC B获取要运行的代码,在SOC A和SOC B之间增加通信链路,SOC B通过通信链路从SOC A获取代码进行运行。
其中,Flash指的是存储器,SDRAM表示内存。
所述通信链路所支持的通信协议可以是USB通信协议、串行外设接口(SPI,Serial Peripheral Interface)通信协议和通用异步收发器通信协议(UART,Universal Asynchronous Receiver Transmitter)等通信协议之一。
鉴于USB通信协议通用性更强、以及传输速率更高的优点,在本申请的一个实施例中,通信链路所支持的通信协议采用USB通信协议。
对于第一片上系统而言,第一片上系统的USB驱动程序可存储于Flash A中,以减少因程序固化在SOC A内部而导致的内存占用。可选的,OS A固件代码中可以包含USB驱动程序。
对于第二片上系统而言,由于OS B固件代码存储于Flash A中,在通信链路未建立时,尚不能获取到OS B固件代码以启动OS B,故而第二片上系 统的USB驱动程序作为启动代码的一部份,被包含在启动代码(如Bootrom)中,并将启动代码固化于中SOC B内部。可选的,OS B固件代码中可以包含USB驱动程序。
基于图2所示的双片上系统,本申请实施例提供了一种双片上系统加载USB驱动程序建立USB通信链路的流程。参见图3所示,图3为双片上系统加载USB驱动程序建立USB通信链路的一种流程示意图。当双片上系统上电后,SOC A和SOC B分别上电。
在SOC A侧:
SOC A从Flash A读取OS A固件代码,该固件代码中包含有USB驱动程序,并将OS A固件代码加载至SDRAM A中;
SOC A启动OS A,在启动OS A中加载OS A固件代码中的USB驱动程序。
在SOC B侧:
SOC B将固化于SOC B内部的启动代码Bootrom加载至SDRAM B中;
SOC B运行Bootrom代码,在启动OS B中加载Bootrom代码中的USB驱动程序。
当SOC A和SOC B分别加载USB驱动程序成功后,SOC B侧的USB驱动程序向SOC A侧的USB驱动程序发送握手协议数据包,直至SOC A的USB驱动程序和SOC B的USB驱动程序成功建立SOC A与SOC B间的USB通信链路;SOC A侧的USB驱动程序则等待接收来自SOC B侧的USB驱动程序发出的握手协议数据包。
这样,SOC A和SOC B之间就可建立USB通信链路。后续双片上系统启动和正常运行时,SOC B可直接通过已建立的USB通信链路像访问连接到自身的存储器一样,访问Flash A。
本申请实施例中,SOC B侧的USB驱动程序与SOC A侧的USB驱动程序间的通信可以理解为:SOC B与SOC A间的通信。
基于图2所示的双片上系统,本申请实施例提供了一种双片上系统启动后进入正常工作的流程。参见图4所示,图4为本申请实施例提供的双片上系统启动后进入正常工作的一种流程示意图。利用启动代码中的USB驱动程 序,SOC A侧的USB驱动程序和SOC B侧的USB驱动程序成功建立SOC A与SOC B间的USB通信链路后,双片上系统每次启动时,
SOC B侧的USB驱动程序开始向SOC A侧的USB驱动程序发送OS固件代码请求命令;
SOC A侧的USB驱动程序接收到该OS固件代码请求命令后,响应于该OS固件代码请求命令,读取Flash A中的OS B固件代码,通过USB通信链路将OS B固件代码发送给SOC B侧的USB驱动程序。
SOC B侧的USB驱动程序将接收到的OS B固件代码加载到内存(即SDRAM B),并启动OS B,在OS B中加载OS B固件代码中的USB驱动程序,SOC B侧的USB驱动程序再次与SOC A的USB驱动程序建立通信链路。
如果建立成功,SOC A侧的USB驱动程序将存储器中分配给SOC B的分区的存储地址信息映射给SOCA侧的USB驱动程序,由该SOCA侧的USB驱动程序将所映射的存储地址信息发送给SOC B侧的USB驱动程序。此时就可以将Flash A中分配给SOC B的分区的存储地址信息映射给SOCA侧的USB驱动程序,使得SOCA侧的USB驱动程序将所映射的存储地址信息发送给SOC B。
这样,SOC B就能够通过USB通信链路像访问连接到自身的存储器一样,直接读写Flash A。
上述分配给SOC B的分区的存储地址信息即为第二分区的存储地址信息。
在本申请的一个实施例中,在OS A运行时,SOC A可以独立地读写Flash A,不受SOC B读写Flash A的影响。
SOC B启动时,SOC B通过USB驱动程序将Bootrom加载至SDRAM B中,并运行Bootrom;接收到来自SOC A的OS B固件代码时,可以通过Bootrom将OS B固件代码加载到SDRAM B中;SOC B启动OS B,并在OS B启动后,通过USB驱动程序,在OS B中加载OS B固件代码中的USB驱动程序;之后,SOC B侧的USB驱动程序再次与SOC A侧的USB驱动程序建立通信链路。此时,启动代码里的USB驱动程序的生命周期结束。
SOC B通过USB通信链路接收所映射的存储地址信息来建立存储地址信息表,从而进行寻址操作和数据传输操作。这样,SOC B就可以如同像访问 连接到自身的存储器一样,访问Flash A,例如,读取数据或写入数据。
另外,在OS B运行时,SOC B可以独立地读写Flash A,不受SOC A读写Flash A的影响。
可选地,为了避免SOC A和SOC B对Flash写冲突的问题,可以将Flash A中的空闲存储空间进行分配,其中,一部分空闲存储空间分配给SOC A,一部分空闲存储空间分配给SOC B。参见图5所示,图5为Flash中存储空间分配的一种示意图,其包括了OS A固件代码分区、OS B固件代码分区、OS A文件系统分区、OS B文件系统分区、分配给SOC A的第一分区、分配给SOC B的第二分区。
其中,OS A固件代码分区为用于存储OS A的固件代码的分区。OS B固件代码分区为用于存储OS B的固件代码的分区。OS A文件系统分区为用于存储OS A文件系统的分区。OS B文件系统分区为用于存储OS B文件系统的分区。
其中,第一分区用于存储SOC A写入的数据,第二分区用于存储SOC B写入的数据。相应的,SOC A从第一分区读取数据,SOC B从第二分区读取数据。
本申请实施例提供的节约双片上系统存储资源的方法,两SOC共用一Flash,在不影响系统功能的同时,减少了电路板芯片布局所需要的空间,从而为其他功能硬件的布局提供冗余空间,有利于设备的小型化和轻量化,降低芯片成本。
当需要固件升级时,只需要通过SOC A将OS A和OS B的固件代码烧录到Flash A上的不同分区即可。这相对于相关技术分别进行固件升级而言,具有更高的效率,从而使得固件升级更为方便,通过在SOC之间建立通信链路,使得相对于一方SOC,另一方SOC如同外设一样方便访问操作。
参见图6所示,图6为本申请实施例提供的应用于人脸识别门禁控制的双片上系统的一种示意图。
其中,第一片上系统用于业务应用,可以包括人机交互和门禁控制。第一片上系统支持安卓系统,通过IO A连接显示设备。
第二片上系统用于基于算法的数据处理,例如,基于人脸识别算法处理 图像数据。第二片上系统支持Linux系统,通过IO B连接图像采集模组,例如,热成像模组和/或摄像头模组。
Flash A中包括OS A固件代码分区、OS B固件代码分区、OS A文件系统分区、OS B文件系统分区、分配给SOC A的第一分区、以及分配给SOC B的第二分区。所述OS A文件系统分区包括业务应用程序文件,所述OS B文件系统包括算法程序文件。
SOC A启动后,SOC A读取Flash A中的OS B固件代码,通过USB通信链路发送给SOC B,并将Flash A中OS B文件系统分区的存储地址信息映射给SOC A的USB驱动程序,SOC A通过USB驱动程序将OS B文件系统分区的存储地址信息发送给SOC B,以使得SOC B能够通过USB通信链路像访问连接到自身的存储器一样,直接读写Flash A。
SOC A读取Flash A中的OS A固件代码和OS A文件系统中的业务应用程序文件,并将OS A固件代码和业务应用文件加载至SDRAM A中,启动OS A,运行业务应用程序文件,并接收SOC B通过USB通信链路传输的算法处理结果,从而完成基于人脸识别的门禁控制业务。
SOC B启动时,将Bootrom加载至SDRAM B中,并运行Bootrom;接收来自SOC A的OS B固件代码,通过Bootrom,将OS B固件代码加载到SDRAM B中,启动OS B,通过USB驱动程序检测到所映射的OS B文件系统分区,从Flash A中读取算法程序文件,并将算法程序文件加载至SDRAM B中。SOC B运行算法程序文件,以基于图像数据进行人脸识别,并将识别的结果(即算法处理结果)通过USB通信链路传递给SOC A。
存储器可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。
对于装置/网络侧设备/存储介质实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者 其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。

Claims (13)

  1. 一种节约双片上系统存储资源的方法,所述双片上系统包括:由第一SOC、与第一SOC相连接的第一内存、与第一SOC相连接的存储器组成的第一片上系统,以及第二片上系统,其特征在于,
    所述第二片上系统包括第二SOC、以及与第二SOC相连接的第二内存;
    所述第一SOC与所述第二SOC之间建立有通信链路,所述第二SOC通过通信链路操作所述存储器。
  2. 如权利要求1所述的方法,其特征在于,所述第一片上系统支持第一操作系统OS,所述第二片上系统支持第二OS;
    所述存储器存储有第一OS的固件代码以及第二OS的固件代码;其中,第一OS的固件代码和第二OS的固件代码分别包含有用于建立通信链路的驱动程序;
    所述第二SOC中固化有启动代码,该启动代码包含有用于建立通信链路的驱动程序;
    所述通信链路按照如下步骤建立:
    在第一SOC侧,从存储器中读取第一OS的固件代码,并将第一OS的固件代码加载至第一内存中,启动第一OS,在第一OS中加载驱动程序;
    在第二SOC侧,将启动代码加载至第二内存中,运行启动代码,在第二OS中加载驱动程序;
    第一SOC和第二SOC分别加载驱动程序后,建立第一SOC和第二SOC间的通信链路。
  3. 如权利要求2所述的方法,其特征在于,所述驱动程序为通用串行总线USB驱动程序;
    所述第一SOC和第二SOC分别加载驱动程序后,建立第一SOC和第二SOC间的通信链路,包括:
    在第一SOC侧,USB驱动程序加载成功后,等待接收第二SOC侧的USB驱动程序发出的握手协议数据包;
    在第二SOC侧,USB驱动程序加载成功后,向第一SOC侧的USB驱动程序发送所述握手协议数据包,直至成功建立第一SOC和第二SOC间的USB 通信链路。
  4. 如权利要求3所述的方法,其特征在于,所述第二SOC通过通信链路操作存储器,包括:
    第一SOC侧的USB驱动程序和第二SOC侧的USB驱动程序成功建立第一SOC和第二SOC间的USB通信链路后,
    第二SOC侧的USB驱动程序向第一SOC侧的USB驱动程序发送OS固件代码请求命令,使得第一SOC侧的USB驱动程序响应于所述OS固件代码请求命令,读取存储器中的第二OS的固件代码,并通过USB通信链路,将第二OS的固件代码发送给第二SOC侧的USB驱动程序;
    第二SOC侧的USB驱动程序成功接收来自第一SOC的第二OS的固件代码后,将第二OS的固件代码加载到第二内存里,启动第二OS,并使得第二SOC中的启动代码里的USB驱动程序的生命周期结束;
    第二OS启动成功后,在第二SOC中加载第二OS的固件代码中的USB驱动程序,第二SOC侧的USB驱动程序再次与第一SOC侧的USB驱动程序建立通信链路;如果建立成功,第一SOC侧的USB驱动程序将存储器中分配给第二SOC的分区的存储地址信息映射给第一SOC侧的USB驱动程序,由第一SOC侧的USB驱动程序将所映射的存储地址信息发送给第二SOC侧的USB驱动程序;第二SOC侧的USB驱动程序接收到存储地址信息后,建立存储器的地址映射,通过该地址映射访问存储器,并进行数据传输。
  5. 如权利要求4所述的方法,其特征在于,所述存储器具有用于存储第一OS的固件代码的分区、用于存储第二OS的固件代码的分区、用于存储第一OS的文件系统的分区、用于存储第二OS的文件系统的分区、分配给第二SOC的第二分区、以及分配给第一SOC的第一分区。
  6. 如权利要求2所述的方法,其特征在于,所述驱动程序为串行外设接口SPI驱动程序或通用异步收发器UART驱动程序。
  7. 一种双片上系统,所述双片上系统包括,由第一SOC、与第一SOC相连接的第一内存、以及与第一SOC相连接的存储器组成的第一片上系统,以及第二片上系统;其特征在于,
    所述第二片上系统包括第二SOC、以及与第二SOC相连接的第二内存;
    所述第一SOC与所述第二SOC之间建立有通信链路,所述第二SOC通过通信链路操作所述存储器。
  8. 如权利要求7所述的双片上系统,其特征在于,所述第一片上系统支持第一操作系统OS,所述第二片上系统支持第二OS;
    所述存储器存储有第一OS的固件代码、以及第二OS的固件代码;其中,第一OS的固件代码和第二OS的固件代码分别包含有用于建立通信链路的驱动程序;
    所述第二SOC中固化有启动代码,该启动代码包含有用于建立通信链路的驱动程序;
    所述第一SOC从存储器中读取第一OS固件代码,并将第一OS的固件代码加载至第一内存中,启动第一OS,在第一OS中加载驱动程序;
    所述第二SOC将启动代码加载至第二内存中,运行启动代码,在第二OS中加载驱动程序;
    第一SOC和第二SOC分别加载驱动程序后,建立第一SOC和第二SOC间的通信链路。
  9. 如权利要求8所述的双片上系统,其特征在于,所述驱动程序为通用串行总线USB驱动程序;
    所述第一SOC和第二SOC分别加载驱动程序后,建立第一SOC和第二SOC间的通信链路,包括:
    第一SOC侧的USB驱动程序加载成功后,等待接收第二SOC上USB驱动程序发送的握手协议数据包;
    第二SOC侧的USB驱动程序加载成功后,向第一SOC侧的USB驱动程序发送所述握手协议数据包,直至成功建立第一SOC和第二SOC间的USB通信链路。
  10. 如权利要求9所述的双片上系统,其特征在于,所述第二SOC通过通信链路操作存储器,包括,
    第一SOC侧的USB驱动程序和第二SOC侧的USB驱动成功建立第一SOC和第二SOC间的USB通信链路后,第二SOC侧的USB驱动程序向第一SOC侧的USB驱动程序发送OS固件代码请求命令,使得第一SOC侧的 USB驱动程序响应于该OS固件代码请求命令,读取存储器中的第二OS的固件代码,并通过USB通信链路路,将第二OS的固件代码发送给第二SOC侧的USB驱动程序;
    第二SOC侧的USB驱动程序成功接收来自第一SOC的第二OS的固件代码后,将第二OS固件代码加载到第二内存里,启动第二OS,并使得第二SOC中的启动代码里的USB驱动程序的生命周期结束;
    第二OS启动成功后,在第二SOC中加载第二OS的固件代码中的USB驱动程序,第二SOC侧的USB驱动程序再次与第一SOC侧的USB驱动程序建立通信链路;如果建立成功,第一SOC侧的USB驱动程序将存储器中分配给第二SOC的分区的存储地址信息映射给第一SOC侧的USB驱动程序,由第一SOC侧的USB驱动程序将所映射的存储地址信息发送给第二SOC侧的USB驱动程序;第二SOC侧的USB驱动程序接收到存储地址信息后,建立存储器的地址映射,通过该地址映射访问存储器件,并进行数据传输。
  11. 如权利要求10所述的双片上系统,其特征在于,所述存储器具有用于存储第一OS的固件代码的分区、用于存储第二OS的固件代码的分区、用于存储第一OS的文件系统的分区、用于存储第二OS的文件系统的分区、分配给第二SOC的第二分区、以及分配给第一SOC的第一分区。
  12. 如权利要求8所述的双片上系统,其特征在于,所述驱动程序为串行外设接口SPI驱动程序或通用异步收发器UART驱动程序。
  13. 一种门禁,其特征在于,所述门禁包括如权利要求7-12任一项所述的双片上系统。
PCT/CN2021/116640 2020-09-09 2021-09-06 一种节约双片上系统存储资源的方法、双片上系统 Ceased WO2022052883A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010940183.0 2020-09-09
CN202010940183.0A CN112035393B (zh) 2020-09-09 2020-09-09 一种节约双片上系统存储资源的方法、双片上系统

Publications (1)

Publication Number Publication Date
WO2022052883A1 true WO2022052883A1 (zh) 2022-03-17

Family

ID=73584485

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/116640 Ceased WO2022052883A1 (zh) 2020-09-09 2021-09-06 一种节约双片上系统存储资源的方法、双片上系统

Country Status (2)

Country Link
CN (1) CN112035393B (zh)
WO (1) WO2022052883A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035393B (zh) * 2020-09-09 2023-11-24 杭州海康威视数字技术股份有限公司 一种节约双片上系统存储资源的方法、双片上系统
CN112948315B (zh) * 2021-01-29 2024-07-23 Oppo广东移动通信有限公司 存储区域共享方法、存储介质及电子设备
CN116088950A (zh) * 2023-02-02 2023-05-09 Oppo广东移动通信有限公司 系统启动方法、装置和电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102439563A (zh) * 2009-05-15 2012-05-02 汤姆森许可贸易公司 用于共享存储器的系统和方法
US10346342B1 (en) * 2017-03-07 2019-07-09 Amazon Technologies, Inc. Uniform memory access architecture
CN111163001A (zh) * 2019-12-20 2020-05-15 青岛海信宽带多媒体技术有限公司 一种共享Flash存储器的方法及融合网关
CN112035393A (zh) * 2020-09-09 2020-12-04 杭州海康威视数字技术股份有限公司 一种节约双片上系统存储资源的方法、双片上系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102439563A (zh) * 2009-05-15 2012-05-02 汤姆森许可贸易公司 用于共享存储器的系统和方法
US10346342B1 (en) * 2017-03-07 2019-07-09 Amazon Technologies, Inc. Uniform memory access architecture
CN111163001A (zh) * 2019-12-20 2020-05-15 青岛海信宽带多媒体技术有限公司 一种共享Flash存储器的方法及融合网关
CN112035393A (zh) * 2020-09-09 2020-12-04 杭州海康威视数字技术股份有限公司 一种节约双片上系统存储资源的方法、双片上系统

Also Published As

Publication number Publication date
CN112035393A (zh) 2020-12-04
CN112035393B (zh) 2023-11-24

Similar Documents

Publication Publication Date Title
US10282192B1 (en) Updating device code through a bus
CN116431530A (zh) 一种cxl内存模组、内存的处理方法及计算机系统
US9680972B2 (en) SD switch box in a cellular handset
CN113742269B (zh) 用于epa设备的数据传输方法、处理设备和介质
CN112035393A (zh) 一种节约双片上系统存储资源的方法、双片上系统
CN115357416A (zh) 一种跨系统进行数据处理的方法及装置
CN108287804A (zh) 一种i2c控制器驱动方法及系统
CN101496379B (zh) 具有usb和无线连接的非易失性存储设备及控制该连接的方法
CN112015687A (zh) 一种自动分配pcie带宽的主板结构及其方法
CN112948315B (zh) 存储区域共享方法、存储介质及电子设备
CN112527722B (zh) 异构多核嵌入式系统及该系统的数据交互方法
US11442882B2 (en) Bridge circuit for providing conversion between PCIe-NVMe protocol and NVMe-TCP protocol and computer system using the same
JP4793798B2 (ja) マイクロコンピュータ
WO2022126398A1 (zh) 消息通知方法及装置
JPH11232213A (ja) 入出力装置におけるデータ転送方式
KR101041838B1 (ko) 모바일용 스토리지 제어 장치 및 방법
CN114003399B (zh) 一种基于idm的数据传输方法及系统
US11372800B2 (en) System on chip comprising a plurality of central processing units whose mailboxes are set in tightly-coupled memories
JP2002149623A (ja) マイクロコンピュータ
CN112799974B (zh) 一种存储卡的控制方法及系统
JP4860811B2 (ja) マイクロコンピュータ
US7532625B2 (en) Block transfer for WLAN device control
CN119739541A (zh) 一种数据共享的方法、装置、芯片及电子设备
JP6763307B2 (ja) 計算機、デバイス制御システムおよびデバイス制御方法
CN116088998A (zh) 通用串行总线usb设备重定向的方法和装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21865937

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21865937

Country of ref document: EP

Kind code of ref document: A1