Circuit device and electronic device
The circuit device employs a bus system with defined access authority and permission settings for master and slave circuits, enhancing security and flexibility in protecting confidential information by simplifying protection settings.
Patent Information
- Application Number
- JP2021028266
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-02-25
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-02-25
AI Technical Summary
Existing circuit devices face security issues due to complex access rights settings, making them vulnerable to incorrect access and compromising the security of confidential information.
Implementing a bus system with master and slave circuits, where access authority and permission settings are defined for each circuit, allowing flexible and simplified protection settings based on access authority and permission settings, stored in non-volatile memory, to determine access permissions.
This approach enhances security by preventing unauthorized access to sensitive information, allowing users to balance convenience and robustness according to their needs, while simplifying protection settings and reducing the risk of malicious access.
Smart Images

Figure 0007589584000001 
Figure 0007589584000002 
Figure 0007589584000003
Abstract
Description
[Technical field]
[0001] The present invention relates to a circuit device, an electronic device, and the like. [Background technology]
[0002] In a circuit device such as a microcomputer, important information such as confidential information may be stored in a memory of the circuit device. It is undesirable for such confidential information to be read from the circuit device by access from an external device. For example, a conventional technology for protecting confidential information is disclosed in Patent Document 1. In Patent Document 1, a storage unit stores specific data in a specific data area. When an execution unit receives a specific command for accessing the specific data, the execution unit determines whether the received specific command is executable based on the security status of the specific data area, and executes the process of the specific command if it is determined that the command is executable. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP2019-160191A Summary of the Invention [Problem to be solved by the invention]
[0004] In Patent Document 1, a specific command from an external device is judged to determine whether or not to allow access to specific data. This makes setting access rights cumbersome and, from a security standpoint, makes it easier for incorrect access to occur, which may reduce the security of important information. [Means for solving the problem]
[0005] One aspect of the present disclosure relates to a circuit device that includes a bus, a plurality of master circuits connected to the bus and serving as bus masters on the bus, and a plurality of slave circuits connected to the plurality of master circuits via the bus and serving as bus slaves on the bus, wherein the plurality of master circuits are set with access authority to the bus slaves, and the plurality of slave circuits are set with permission settings for read access or write access from the bus master, and each master circuit of the plurality of master circuits is related to a circuit device in which whether or not to access each slave circuit of the plurality of slave circuits is determined based on the access authority and the permission settings.
[0006] Another aspect of the present disclosure relates to an electronic device including the circuit device described above. [Brief description of the drawings]
[0007] [Figure 1] 2 shows an example of the configuration of a circuit device according to the present embodiment. [Diagram 2] 3 shows a first detailed configuration example of the circuit device of the present embodiment. [Diagram 3] 13 shows a second detailed configuration example of the circuit device of the present embodiment. [Figure 4] FIG. 13 is an explanatory diagram of setting access permissions. [Diagram 5] FIG. 13 is an explanatory diagram of access permission settings. [Figure 6] 13 shows an application example of the method of the present embodiment. [Figure 7] FIG. 4 is an explanatory diagram of bus access information. [Figure 8] 4 is a flowchart illustrating a process according to the present embodiment. [Figure 9] 4 is a flowchart illustrating a process according to the present embodiment. [Figure 10] 4 is a flowchart illustrating a process according to the present embodiment. [Figure 11] 2 shows an example of the configuration of an electronic device according to the present embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0008] A preferred embodiment of the present invention will be described in detail below. Note that the embodiment described below does not unduly limit the content of the present invention described in the claims, and all of the configurations described in the embodiment are not necessarily essential as the solution of the present invention.
[0009] 1.Circuit device 1 shows an example of the configuration of a circuit device 10 of this embodiment. The circuit device 10 of this embodiment includes a bus 12, a plurality of master circuits 20-1 to 20-n that are connected to the bus 12 and serve as bus masters on the bus 12, and a plurality of slave circuits 30-1 to 30-m that are connected to the plurality of master circuits 20-1 to 20-n via the bus 12 and serve as bus slaves on the bus 12. Here, n and m are integers of 2 or more. The circuit device 10 may also include a memory controller 40 and a non-volatile memory 50.
[0010] The bus master controls transfers on the bus 12. In the master / slave system, the bus master obtains the right to use the bus and designates a target device to transfer data. To prevent data collisions on the bus 12, for example, devices are divided into bus masters and bus slaves, and the bus slaves can input and output data only when instructed to do so by the bus master. In FIG. 1, the master circuits 20-1 to 20-n are circuits that operate as bus masters, and the slave circuits 30-1 to 30-m are circuits that operate as bus slaves.
[0011] The memory controller 40 controls the non-volatile memory 50. For example, the memory controller 40 controls reading and writing of the non-volatile memory 50. This memory controller 40 is also, for example, one of the slave circuits, and operates as a bus slave.
[0012] The nonvolatile memory 50 is a memory that retains stored information even when power is not supplied. For example, the nonvolatile memory 50 is a memory that can retain stored information even when power is not supplied and that allows the information to be rewritten. The nonvolatile memory 50 stores various information necessary for the operation of the circuit device 10, etc.
[0013] For example, the nonvolatile memory 50 is an EEPROM (Electrically Erasable Programmable Read-Only Memory) realized by a FAMOS memory (Floating gate Avalanche injection MOS memory) or a MONOS memory (Metal-Oxide-Nitride-Oxide-Silicon memory). Specifically, the nonvolatile memory 50 is a flash memory capable of a batch erase operation or the like. The flash memory is, for example, a flash ROM. The nonvolatile memory 50 has, for example, a storage area such as a user storage area 52 for storing user information such as confidential information, and a setting storage area 54 for storing protection setting information. The protection setting information is, for example, information on access authority and permission setting.
[0014] In this embodiment, the master circuits 20-1 to 20-n are set with access authority to the bus slaves. For example, the master circuits 20-1 to 20-n are set with access authority to the slave circuits 30-1 to 30-m, which are bus slaves. For example, the access authority is set for each bus master that instructs access to a circuit to be accessed, such as a peripheral circuit or a memory. That is, the presence or absence of access authority is set for each master circuit of the master circuits 20-1 to 20-n. Also, the slave circuits 30-1 to 30-m are set with permission settings for read access or write access from the bus master. For example, when a bus master with access authority performs a read access or write access, permission settings for whether or not to permit the read access or write access are set for each slave circuit of the slave circuits 30-1 to 30-m. Then, for each master circuit of the master circuits 20-1 to 20-n, whether or not to permit access to each slave circuit of the slave circuits 30-1 to 30-m is determined based on the access authority and the permission settings. For example, each of the master circuits 20-1 to 20-n determines whether to allow access to each slave circuit based on the access authority set for each master circuit and the permission setting set for each slave circuit 30-1 to 30-m. For example, when a master circuit with access authority makes a read access to a slave circuit, if the read access permission setting is set for the slave circuit, the read access is permitted. Also, when a master circuit with access authority makes a write access to a slave circuit, if the write access permission setting is set for the slave circuit, the write access is permitted. Also, if the permission setting for both read access and write access is set for the slave circuit, both read access and write access of the master circuit with access authority are permitted.
[0015] For example, important information such as confidential information of a user is stored in the user storage area 52 of the non-volatile memory 50. For example, when the circuit device 10 is a microcomputer, the confidential information is information of a user's application program executed in the microcomputer and various data. The confidential information is, for example, key information used in encryption processing. In this case, for example, an external device may access the circuit device 10 and such important information such as confidential information may be read out to the outside. In this embodiment, in order to prevent such an occurrence and to protect information such as confidential information, a method is adopted in which the master circuit is allowed to access the slave circuit based on the access authority set in the master circuit and the access permission setting set in the slave circuit. Note that the information to be protected is not limited to information stored in the non-volatile memory 50, and may be information stored in another memory of the circuit device 10.
[0016] Specifically, in this embodiment, the presence or absence of access authority is set for each master circuit that becomes a bus master. Also, permission settings are made for each slave circuit that becomes a bus slave with respect to read access or write access from the bus master. Then, when each master circuit performs read access or write access to each slave circuit, the read access or write access is determined based on the access authority of each master circuit and the permission settings of each slave circuit. In this way, it becomes possible to finely set the permission of access to circuits such as peripheral circuits and memories, and it becomes possible to freely set the balance between convenience and robustness of security according to the user's request. For example, a user who values robustness of security can meet the user's request by setting strict protection settings for access authority and access permission settings. On the other hand, a user who values convenience can meet the user's request by setting loose protection settings for access authority and access permission settings. This makes it possible to realize a circuit device 10 with advanced protection functions.
[0017] For example, in the conventional technology of Patent Document 1 mentioned above, the security state changes according to an external command received, and whether or not to execute the command is determined according to the state. In contrast, in this embodiment, protection is set by setting the access authority to the master circuit in the circuit device 10 and the access permission setting to the slave circuit. Therefore, whether or not to access can be determined only by the access authority or access permission setting and the combination of the master circuit and the slave circuit, without depending on the command, and flexible protection can be set with simple settings.
[0018] For example, in this embodiment, the multiple master circuits 20-1 to 20-n include a first master circuit in which an access right to the bus slave is set, and a second master circuit in which an access right to the bus slave is not set. As an example, the first master circuit in which an access right is set is, for example, the processor 22 or the DMA controller 26 in FIG. 2 and FIG. 3 described later. The second master circuit in which an access right is not set is, for example, the external bus interface 28 or the debug circuit 24. The multiple slave circuits 30-1 to 30-m include a first slave circuit in which a first permission setting is set. The first master circuit is permitted to make a read access or a write access to the first slave circuit regardless of the first permission setting. That is, the first master circuit in which an access right to the bus slave is set is permitted to make a read access or a write access to the first slave circuit regardless of whether or not the read access or the write access is permitted in the first permission setting of the first slave circuit. On the other hand, the second master circuit is permitted to make a read access or a write access to the first slave circuit based on the first permission setting. That is, the second master circuit, for which the access authority to the bus slave is not set, is permitted to read access or write access to the first slave circuit based on the first permission setting of the first slave circuit. For example, if read access is permitted in the first permission setting, the second master circuit is permitted to read access to the first slave circuit, and if write access is permitted in the first permission setting, the second master circuit is permitted to write access to the first slave circuit. In this way, by setting the access authority, the read access and write access by the first master circuit to the first slave circuit can be set collectively, and for the second master circuit for which the access authority is not set, the first permission setting to the first slave circuit determines whether or not the second master circuit can access the first slave circuit with read access or write access. Therefore, flexible protection settings are possible with just simple settings, and the balance between convenience and robustness of security can be appropriately set according to the user's needs.
[0019] As shown in FIG. 1, the circuit device 10 of the present embodiment includes a nonvolatile memory 50 that stores protection setting information, which is information on access authority and permission settings. For example, the protection setting information, which is information on access authority and permission settings, is stored in a setting storage area 54 of the nonvolatile memory 50. In this manner, the protection setting information, which is information on access authority and permission settings, is stored in the nonvolatile memory 50, which is a memory that retains information even when power is not supplied. Therefore, after power is applied to the circuit device 10, it is possible to set access authority to the master circuit and to set permission for read access or write access to the slave circuit based on the protection setting information stored in the nonvolatile memory 50. Therefore, it is possible to more reliably prevent information such as confidential information of a user from being read out by an external device.
[0020] As shown in FIG. 1, the circuit device 10 of the present embodiment includes a memory controller 40 that sets access authority and permission based on the protection setting information read from the nonvolatile memory 50. For example, in an initialization process after power is turned on, the memory controller 40 reads the protection setting information from the nonvolatile memory 50 and sets the access authority to the master circuit and the permission to access the slave circuit based on the protection setting information that has been read. In this way, it is possible to effectively use the memory controller 40 that controls the nonvolatile memory 50 that stores the protection setting information to set the access authority of the master circuit and the permission to access the slave circuit. That is, the memory controller 40 reads the protection setting information, which is information on the access authority and permission setting, from the nonvolatile memory 50 that it controls to read, and can execute the setting of the access authority of the master circuit and the permission to access the slave circuit based on the information on the access authority and permission setting. It is also possible to grant the access authority to the master circuit and / or grant the access permission setting to the slave circuit without storing the protection setting information, which is information on the access authority and permission setting, in the nonvolatile memory 50. For example, the access authority and the access permission may be set by a fixed hardware circuit, or the access authority and the access permission may be stored in a mask ROM other than an EEPROM.
[0021] The permission setting information is written to the registers 31-1 to 31-m provided in each of the slave circuits 30-1 to 30-m. For example, the permission setting for read access or write access of the slave circuit 30-1 is written to the register 31-1 of the slave circuit 30-1. Similarly, the permission setting for read access or write access of each of the slave circuits 30-2 to 30-m is written to each of the registers 31-2 to 31-m of the slave circuits 30-2 to 30-m. For example, in an initialization process after power-on, the memory controller 40 reads the protection setting information from the non-volatile memory 50 and writes the permission setting information included in the protection setting information to the registers 31-1 to 31-m. In this way, the slave circuits 30-1 to 30-m can determine whether to permit the read access or write access of the master circuit based on the permission setting information written to their own registers 31-1 to 31-m and the access authority of the master circuit. The registers 31-1 to 31-m can be realized by, for example, flip-flop circuits or memory elements.
[0022] Furthermore, the access authority information is included in the bus access information for the bus 12. For example, the access authority information is included in the bus access information when the master circuit accesses a slave circuit via the bus 12. For example, the bus access information includes access authority information, which is information on whether the bus access of the master circuit is a bus access with access authority. In this way, when a read access or write access is received from the master circuit, the slave circuit can determine whether to permit the read access or write access based on the access authority information included in the bus access information for the read access or write access and the access permission setting information set for the slave circuit itself.
[0023] 2. Detailed configuration example FIG. 2 shows a detailed first configuration example of the circuit device 10 of the present embodiment. FIG. 2 shows a configuration example in which the circuit device 10 of the present embodiment is, for example, a microcomputer. In FIG. 2, a processor 22, a debug circuit 24, a DMA controller 26, and an external bus interface 28 are provided as the master circuits 20-1 to 20-n in FIG. 1. Access authority is set for the processor 22, the debug circuit 24, the DMA controller 26, and the external bus interface 28. In addition, an SRAM controller 32, a bus bridge circuit 34, and a memory controller 40 are provided as the slave circuits 30-1 to 30-m in FIG. 1. Access permission is set for the SRAM controller 32, the bus bridge circuit 34, and the memory controller 40.
[0024] The processor 22 is, for example, a CPU (Central Processing Unit), and is, for example, a circuit that fetches instructions and executes the instructions. Note that the processor 22 is not limited to a CPU, and can be, for example, various processing circuits that execute instructions such as programs.
[0025] The debug circuit 24 is a circuit that performs debugging of the circuit device 10, which is a microcomputer. For example, the debug circuit 24 performs debugging to check whether the program executed by the processor 22 executes the desired operation. The debug circuit 24 has a format such as JTAG (Joint Test Action Group), SWD (Serial Wire Debug Port), or ETM (Embedded Trace Macrocell), and can perform various operations and settings by connecting to an external personal computer or the like through, for example, an ICE (In-Circuit Emulator).
[0026] The DMA controller 26 is a controller for performing DMA (Direct Memory Access) transfer. For example, the DMA controller 26 is a controller for performing DMA transfer, which transfers data directly between memories or peripheral circuits, without the intervention of the processing of the processor 22, which is the CPU. For example, the DMA controller 26 accesses the bus 12 according to a predetermined algorithm or the like to perform the DMA transfer.
[0027] The external bus interface 28 is a circuit that performs interface processing with the external bus of the circuit device 10. Providing the external bus interface 28 enables data transfer with an external device connected to the external bus. For example, providing the external bus interface 28 enables data transfer such as DMA transfer with an external device such as a memory, such as a ROM or RAM, or an I / O device, connected to the external bus. The external bus interface 28 may be, for example, an Ethernet controller. For example, the Ethernet controller, which is the external bus interface 28, has built-in circuits for a media access control layer (MAC) and a physical layer (PHY), and enables TCP / IP communication.
[0028] The SRAM controller 32 is a controller that controls the SRAM 33. For example, the SRAM controller 32 controls reading and writing of the SRAM 33. The SRAM 33 is a memory that functions as a temporary storage area for each circuit such as the processor 22 of the circuit device 10.
[0029] The bus bridge circuit 34 is a circuit provided between the bus 12, which is a main bus, and the peripheral bus 14 to which multiple peripheral circuits 36, 37, 38, and 39 are connected. For example, the bus bridge circuit 34 is a circuit for converting bus access between two buses having different protocols and performing communication. That is, the bus bridge circuit 34 is provided between the bus 12 of a first protocol and the peripheral bus 14 of a second protocol, and performs protocol conversion and the like required for data transfer. For example, when the bus 12 is an AHB (Advanced High-performance Bus) and the peripheral bus 14 is an APB (Advanced Peripheral Bus), the bus bridge circuit 34 performs protocol conversion and the like between the AHB and APB.
[0030] Peripheral circuits 36, 37, 38, and 39 are connected to the peripheral bus 14. The peripheral circuits 36, 37, 38, and 39 include, for example, a timer circuit, a serial interface such as a universal asynchronous receiver / transmitter (UART) or a serial peripheral interface (SPI), a display driver such as a liquid crystal display driver, an A / D conversion circuit, a D / A conversion circuit, a digital filter, or a digital camera interface.
[0031] In FIG. 2, the memory controller 40 uses a first signal line 16 provided separately from the bus 12 to set permissions for the SRAM controller 32 and the bus bridge circuit 34, which are multiple slave circuits. That is, the memory controller 40 sets permissions for read access and write access to the SRAM controller 32 and the bus bridge circuit 34 by outputting a signal to the dedicated first signal line 16. The first signal line 16 is composed of one or more signal lines, and can also be called a first signal line group for permission setting. For example, the memory controller 40 sets permissions for each of the slave circuits, the SRAM controller 32 and the bus bridge circuit 34, by outputting a signal for permission setting to the first signal line 16 during initialization processing or the like. Specifically, the permission setting information is written to the register of each slave circuit. In this way, for example, during a period before the circuit device 10 performs actual operation processing, the memory controller 40 can set permissions for the slave circuits using the dedicated first signal line 16. This makes it possible to prevent, for example, a situation in which confidential information or other information is read or rewritten due to malicious access from an external device during actual operation of the circuit device 10.
[0032] In FIG. 2, the memory controller 40 uses a second signal line 18 provided separately from the bus 12 to set access rights for the processor 22, the debug circuit 24, the DMA controller 26, and the external bus interface 28, which are multiple master circuits. That is, the memory controller 40 sets the presence or absence of access rights for the processor 22, the debug circuit 24, the DMA controller 26, and the external bus interface 28 by outputting a signal to the dedicated second signal line 18. For example, the memory controller 40 outputs a signal for setting access rights to the second signal line 18 during initialization processing or the like to set the rights for each of the master circuits, the processor 22, the debug circuit 24, the DMA controller 26, and the external bus interface 28. In this way, for example, during a period before the circuit device 10 performs processing for the actual operation, the memory controller 40 can set the access rights of the master circuits using the dedicated second signal line 18. This makes it possible to prevent, for example, a situation in which confidential information or other information is read or rewritten by malicious access from an external device during the actual operation of the circuit device 10.
[0033] As shown in FIG. 2, the circuit device 10 includes a bus bridge circuit 34 provided between the bus 12 and the peripheral bus 14 to which the multiple peripheral circuits 36-39 are connected, and permission setting information for each of the multiple peripheral circuits 36-39 is written to a register 35 provided in the bus bridge circuit 34. For example, the memory controller 40 writes permission setting information to the register 35 of the bus bridge circuit 34 by outputting a permission setting signal to the first signal line 16 during initialization processing or the like. In this way, the access permission setting for the peripheral circuits 36-39 connected to the peripheral bus 14 can be set collectively using the register 35 of the bus bridge circuit 34, and the access permission setting process can be simplified and the processing load can be reduced. In other words, if the access permission setting is individually performed for each of the multiple peripheral circuits 36-39 connected to the peripheral bus 14, problems such as the memory controller 40 or the like becoming complicated in the permission setting process and the processing load becoming heavy may occur. In this regard, if permission settings are made for the peripheral circuits 36 to 39 by writing permission setting information to the register 35 of the bus bridge circuit 34, the occurrence of such problems can be prevented. Then, when there is an access from the master circuit, the bus bridge circuit 34 can collectively determine and process permission settings for each of the multiple peripheral circuits 36 to 39 based on the permission setting information written to the register 35. This can improve security performance and realize a circuit device 10 with advanced protection functions. It can also prevent inappropriate access, such as transferring information stored in a memory such as the nonvolatile memory 50 or the SRAM 33 to the peripheral circuits 36 to 39 and outputting it to the outside.
[0034] Fig. 3 shows a second detailed configuration example of the circuit device 10 of this embodiment. Fig. 3 also shows a configuration example in which the circuit device 10 of this embodiment is, for example, a microcomputer. Here, differences from Fig. 2 will be described.
[0035] In FIG. 3, the circuit device 10 includes an authority control circuit 70 provided between the processor 22, the debug circuit 24, the DMA controller 26, which are multiple master circuits, and the bus 12. Here, for example, the processor 22 and the debug circuit 24 are configured to be included in the core block 21. The authority control circuit 70 and the core block 21 are connected by a first bus, and the authority control circuit 70 and the DMA controller 26 are connected by a second bus. The authority control circuit 70 sets the access authority by rewriting the access authority information included in the bus access information from the multiple master circuits, the processor 22, the debug circuit 24, and the DMA controller 26. For example, depending on the architecture of a CPU, etc., there are some that can dynamically switch the access authority by issuing a command, etc. For example, the access authority is dynamically switched so that the access authority given when executing the processing of the OS (Operating System) is not given when executing the application program. For this reason, there are cases where the master circuit sets the access authority by itself and accesses the bus 12. In this case, the access authority information included in the bus access information is rewritten by overwriting the access authority information included in the protection setting information. In this way, even if the access authority is set inappropriately for the master circuit, the authority control circuit 70 can rewrite the access authority information included in the bus access information from the master circuit to set the access authority to the appropriate one. This makes it possible to prevent situations in which confidential information or other information is read or rewritten by malicious access from an external device.
[0036] In FIG. 3, the circuit device 10 includes a nonvolatile memory 50 that stores protection setting information, which is information on access rights and permission settings, and a memory controller 40 that controls the nonvolatile memory, and the memory controller 40 sets the access rights for the authority control circuit 70. For example, the memory controller 40 reads the protection setting information from the nonvolatile memory 50 and transfers the access rights information included in the protection setting information to the authority control circuit 70 via, for example, the second signal line 18. The authority control circuit 70 then rewrites the access rights setting set by the master circuit itself based on the access rights information included in the protection setting information. In this way, even if the access rights are inappropriately set for the master circuit, the memory controller 40 can read the protection setting information from the nonvolatile memory 50 and set the access rights for the authority control circuit 70. As a result, the authority control circuit 70 can rewrite the access rights information included in the bus access information from the master circuit and set the access rights to appropriate access rights.
[0037] In FIG. 3 as well, the memory controller 40 uses the first signal line 16 to set access permission for the SRAM controller 32 and the bus bridge circuit 34, which are slave circuits.
[0038] Next, specific examples of setting access rights and access permissions will be described with reference to Figures 4, 5, and 6. For example, Figure 4 shows an example of setting access rights, in which the access rights for the processor 22 and the DMA controller 26 are set to "Yes." On the other hand, the access rights for the debug circuit 24 and the external bus interface 28 are set to "No," meaning that no access rights are set.
[0039] FIG. 4 shows an example of access permission settings. For example, for the non-volatile memory 50, read access and write address permission can be set individually for each memory storage area AR1 to AR128. For example, for the memory storage areas AR1 and AR2, both read access and write access are set to be permitted, and for the memory storage area AR3, both read access and write access are set to be prohibited. For the memory storage area AR128, read access is set to be prohibited, but write access is set to be permitted. For example, for memory storage areas in which important information such as confidential information is stored, it is desirable to set read access and write access to be prohibited. For the SRAM 33 connected to the SRAM controller 32, read access is set to be permitted, while write access is set to be prohibited. In this way, it is possible to prevent a situation in which a master circuit without access authority writes information such as confidential information to the SRAM 33 and transfers and outputs it to the outside. It is also possible to set read access and write access to be permitted or prohibited individually for each memory storage area of the SRAM 33. Also, for the peripheral circuits PA to PZ connected to the bus bridge circuit 34, settings are made to permit or prohibit read access and write access according to each peripheral circuit.
[0040] Fig. 6 is a diagram showing whether read access or write access is possible when the access authority and access permission are set as shown in Fig. 4 and Fig. 5. For example, since the access authority is set as shown in Fig. 4 for the processor 22 and the DMA controller 26, read access and write access are possible for any of the SRAM 33 and the peripheral circuits PA to PZ as shown in Fig. 6.
[0041] On the other hand, the debug circuit 24 and the external bus interface 28 are not set with access authority, and are considered to have no access authority. Therefore, whether the debug circuit 24 and the external bus interface 28 can access the SRAM 33 is determined based on the permission setting of the accessed slave circuit. For example, the access permission setting is set such that read access is permitted and write access is prohibited for the SRAM 33. Therefore, the debug circuit 24 and the external bus interface 28, which do not have access authority, are permitted to read access to the SRAM 33 but are prohibited from write access. This makes it possible to prevent, for example, a situation in which the debug circuit 24 writes information such as confidential information to the SRAM 33 and transfers it to an external personal computer or the like to read it out. It also makes it possible to prevent a situation in which the external bus interface 28 writes information such as confidential information to the SRAM 33 and transfers it to the external bus to read it out.
[0042] Also, for the peripheral circuit PA, the access permission setting is made such that both read access and write access are permitted. Therefore, the debug circuit 24 and the external bus interface 28 that do not have the access authority are permitted to both read access and write access to the peripheral circuit PA. For example, for a peripheral circuit that cannot output information such as confidential information to the outside, it is considered that there will be little problem even if both read access and write access are permitted. Also, for the peripheral circuit PB, the access permission setting is made such that read access is prohibited and write access is permitted. Therefore, the debug circuit 24 and the external bus interface 28 that do not have the access authority are permitted to write access to the peripheral circuit PB, but are prohibited from read access. For the peripheral circuit PC, the access permission setting is made such that both read access and write access are prohibited. Therefore, the debug circuit 24 and the external bus interface 28 that do not have the access authority are prohibited from both read access and write access to the peripheral circuit PC. For example, in an application example such as a microcomputer, a peripheral circuit that is not used by the user may be provided in the circuit device 10. By prohibiting both read access and write access to such a peripheral circuit, it is possible to prevent a security hole from occurring due to an unused peripheral circuit.
[0043] 4 to 6, the first master circuit for which the access authority to the bus slave is set is the processor 22 or the DMA controller 26. Therefore, for example, when a first permission setting for access is made to the first slave circuit, the processor 22 and the DMA controller 26, which are the first master circuits, are permitted to read access and write access to the first slave circuit without depending on the first permission setting of the first slave circuit. Therefore, the processor 22 and the DMA controller 26 can access the first slave circuit to read data and write data. This enables the processor 22 to properly execute command execution processes, etc., and enables the DMA controller 26 to properly execute data transfer processes.
[0044] 4 to 6, the second master circuits for which the access authority to the bus slave is not set are the debug circuit 24 and the external bus interface 28. Therefore, for example, when a first permission setting for access is made to the first slave circuit, the debug circuit 24 and the external bus interface 28, which are the second master circuits, are permitted to read access or write access to the first slave circuit based on the first permission setting. Therefore, the debug circuit 24 and the external bus interface 28 can permit or prohibit read access or write access according to the first permission setting of the first slave circuit. Therefore, it is possible to prevent a situation in which information such as confidential information is read or rewritten by malicious access via the debug circuit 24 and the external bus interface 28, for example.
[0045] According to this embodiment, as shown in Figures 4 to 6, it is possible to finely set whether or not read access and write access are permitted, and it becomes possible to freely set the balance between convenience and security robustness according to the user's needs.
[0046] An example of bus access information is shown in Fig. 7. When a master circuit, which is a bus master, accesses the bus 12, the bus access information is sent out as a packet having a configuration as shown in Fig. 7. The bus access information includes information such as an access type, an access address, a write / read instruction, write data, an access size, and access authority. When the master circuit sends out the bus access information of Fig. 7 and makes a read access or a write access, the slave circuit, which is a bus slave, decides whether or not to process the read access or write access based on the access authority information included in the bus access information of Fig. 7 and its own access permission setting.
[0047] In this case, the processor 22, which is a CPU, has an instruction bus and a data bus, and as shown in FIG. 7, the bus access from the instruction bus can be distinguished from other bus accesses by the access authority information included in the bus access information. Here, other bus accesses are bus accesses from the data bus and other bus masters. Access authority is always set for accesses from the instruction bus of the processor 22, and even if an area is prohibited from being read from the data bus, it is possible to read it to execute it as an instruction. Therefore, the processor 22 can appropriately execute and process the instructions of the program using the instruction bus. By being able to distinguish between bus accesses from the instruction bus and other bus accesses in this way, it is possible to simultaneously protect the code of an instruction including a confidential algorithm and execute the instruction.
[0048] 3. Processing Details Next, the details of the processing of this embodiment will be described. In this embodiment, in order to protect information such as confidential information inside the nonvolatile memory 50 from malicious access from the outside, the following processing is performed. First, as shown in the flowchart of FIG. 8, during the initialization processing of the circuit device 10 including the power-on reset, the memory controller 40 reads the protection setting information written in the setting storage area 54 in the nonvolatile memory 50, sets the access authority to the master circuit, and sets the access permission to the slave circuit. Also, as shown in the flowchart of FIG. 9, only when the setting storage area 54 is in a completely erased state, that is, when the protection setting is not set, the protection setting information can be written to the setting storage area 54. For example, when the protection setting is set, the contents of the protection setting cannot be changed. Also, as shown in the flowchart of FIG. 10, in order to release the protection setting, the entire area of the nonvolatile memory 50 is erased at the same time as erasing information such as confidential information. Then, it is not permitted to perform a partial erase only on the setting storage area 54 and leave only information such as confidential information. However, if the area is write-accessible, partial erasure is possible since the protection setting is not changed.
[0049] Specifically, in the initialization process of FIG. 8, first, the acceptance of access from the bus master is stopped (step S1). Then, the memory controller 40 reads the protection setting information from the setting storage area 54 of the nonvolatile memory 50 (step S2), and sets the access authority for the bus master and the access permission for the bus slave (step S3). Then, the acceptance of access from the bus master is started (step S4). Thus, in the initialization process of FIG. 8, the memory controller 40 reads the protection setting information from the nonvolatile memory 50, and sets the access authority for the bus master and the access permission for the bus slave based on the read protection setting information. Then, after the access authority and the access permission are set, the bus access by the bus master is started, and it becomes possible to cause the circuit device 10 to perform various processes in a state where advanced protection settings are set by the access authority and the access permission settings.
[0050] 9, when a command to write the protection setting information to the setting storage area 54 of the non-volatile memory 50 is issued (step S11), the memory controller 40 judges whether the setting storage area 54 is in a fully erased state (step S12). If the setting storage area 54 is in a fully erased state, the memory controller 40 executes the issued command, writes the protection setting information to the setting storage area 54 (step S13), and completes the writing of the protection setting information. On the other hand, if the setting storage area 54 is not in a fully erased state, the memory controller 40 does not execute the command, leaves the protection setting unchanged (step S14), and completes the writing of the protection setting information.
[0051] In the erasure process of the nonvolatile memory 50 in FIG. 10, when an erasure command for the nonvolatile memory 50 is issued (step S21), the memory controller 40 judges whether or not the entire area of the nonvolatile memory 50 is to be erased at once (step S22). If the entire area is to be erased at once, the memory controller 40 erases the entire area including the setting storage area 54 of the protection setting information (step S23), moves to the initialization process (step S24), and completes the erasure process of the nonvolatile memory 50. On the other hand, if the entire area is not to be erased at once, the memory controller 40 judges whether or not the designated storage area for the erasure process is the setting storage area 54 (step S25), and if the designated storage area is the setting storage area 54, does not execute the erasure command (step S26), and completes the erasure process of the nonvolatile memory 50. On the other hand, if the designated storage area is not the setting storage area 54, the memory controller 40 judges whether or not the designated storage area is write-prohibited (step S27). If write is prohibited, the memory controller 40 does not execute the erase command (step S26) and completes the erase process of the non-volatile memory 50; if write is not prohibited, the memory controller 40 erases the specified storage area and completes the erase process of the non-volatile memory 50.
[0052] As described above, in this embodiment, the memory controller 40 permits writing of the protection setting information to the non-volatile memory 50 when the setting storage area 54 of the protection setting information is in a fully erased state. That is, as shown in step S11 of FIG. 9, when a command to write the protection setting information to the setting storage area 54 of the non-volatile memory 50 is issued, as shown in step S12, the memory controller 40 judges whether the setting storage area 54 is in a fully erased state. For example, when the bit of the memory cell in the erased state is "1", it is judged whether all the bits of the setting storage area 54 are "1". Then, as shown in step S14, when the setting storage area 54 is not in a fully erased state, the memory controller 40 does not execute a write command of the protection setting information to the setting storage area 54 of the non-volatile memory 50, and prohibits writing of the protection setting information. In this way, it is possible to prevent a situation in which the setting of the access authority of the protection setting information or the access permission setting is rewritten due to malicious access from the outside, for example, and it is possible to realize a circuit device 10 having an advanced protection function.
[0053] In this embodiment, when the protection setting information is stored in the setting storage area 54, the memory controller 40 does not permit partial erasure of the setting storage area 54. To unlock the protection setting, the non-volatile memory 50 must be erased at the same time by erasing all areas of the non-volatile memory 50 at once. For example, when an erase command for the non-volatile memory 50 is issued in step S21 of FIG. 10, the memory controller 40 judges whether the issued command is a command for erasing all areas of the non-volatile memory 50 at once. If the command is a command for erasing all areas at once, the memory controller 40 erases all areas including the setting storage area 54 of the protection setting information. This causes information such as confidential information stored in the user storage area 52 to be erased. On the other hand, if the erase command is not a command for erasing all areas at once, the memory controller 40 judges whether the designated storage area of the erase command is the setting storage area 54 of the protection setting information as shown in step S25. That is, it judges whether the setting storage area 54 is to be partially erased. If the designated storage area of the erase command is the setting storage area 54 and the setting storage area 54 is to be partially erased, the memory controller 40 does not execute the erase command as shown in step S26. That is, if the protection setting information is stored in the setting storage area 54, the memory controller 40 does not permit the partial erasure of the setting storage area 54. In this way, it is possible to prevent the occurrence of a situation in which the setting storage area 54 of the non-volatile memory 50 is partially erased and the protection setting is released. To erase the protection setting information of the setting storage area 54 and release the protection setting, it is necessary to perform a collective erasure of the entire area of the non-volatile memory 50, and by performing a collective erasure of the entire area, not only the protection setting information but also information such as confidential information is erased. Therefore, it is possible to prevent a situation in which the protection setting is released by malicious access from the outside and information such as confidential information is read out.
[0054] 4.Electronic equipment 11 shows a configuration example of an electronic device 300 including the circuit device 10 of the present embodiment. The electronic device 300 may include the circuit device 10 of the present embodiment, a display unit 310, a memory 320, an operation interface 330, and a communication interface 340. Specific examples of the electronic device 300 include various electronic devices, such as panel devices such as a meter panel, in-vehicle devices such as a car navigation system, sensor devices having sensors such as a gyro sensor and an acceleration sensor, projectors, head-mounted displays, printing devices, personal digital assistants, portable game terminals, robots, and information processing devices.
[0055] The circuit device 10, which is a processing device, performs control processing of the electronic device 300 and various signal processing. The display unit 310 can be realized by, for example, a liquid crystal panel or an organic EL panel. The display unit 310 may be a touch panel. The memory 320 stores data from, for example, the operation interface 330 or the communication interface 340, or functions as a work memory for the circuit device 10. The memory 320 can be realized by, for example, a semiconductor memory such as a RAM or a ROM, or a magnetic storage device such as a hard disk drive. The operation interface 330 is a user interface that accepts various operations from a user. For example, the operation interface 330 can be realized by a button, a mouse, a keyboard, or a touch panel. The communication interface 340 is an interface that communicates image data and control data. The communication processing of the communication interface 340 may be wired communication processing or wireless communication processing.
[0056] As described above, the circuit device of this embodiment includes a bus, a plurality of master circuits connected to the bus and serving as bus masters of the bus, and a plurality of slave circuits connected to the plurality of master circuits via the bus and serving as bus slaves of the bus. The plurality of master circuits are set with access authority to the bus slaves, and the plurality of slave circuits are set with permission settings for read access or write access from the bus master. The permission settings determine whether each master circuit of the plurality of master circuits is allowed to access each of the plurality of slave circuits.
[0057] According to this embodiment, an access right is set for each master circuit that serves as a bus master. Also, permission for read access or write access from the bus master is set for each slave circuit that serves as a bus slave. Then, when each master circuit performs a read access or write access to each slave circuit, the read access or write access is determined based on the access right of each master circuit and the permission setting of each slave circuit. In this way, the permission for access to each circuit of the circuit device can be set in detail, and it is possible to freely set the balance between convenience and robustness of security according to the user's request. This makes it possible to realize a circuit device with advanced protection functions.
[0058] In this embodiment, the multiple master circuits may include a first master circuit in which access authority to the bus slave is set and a second master circuit in which access authority to the bus slave is not set, and the multiple slave circuits may include a first slave circuit in which a first permission setting is set. The first master circuit may be permitted to have read access or write access to the first slave circuit regardless of the first permission setting, and the second master circuit may be permitted to have read access or write access to the first slave circuit based on the first permission setting.
[0059] In this manner, by setting the access authority, it becomes possible to set permission for read access and write access by the first master circuit to the first slave circuit all at once, and for the second master circuit for which access authority has not been set, it becomes possible to determine whether or not read access and write access are permitted by the first permission setting for the first slave circuit.
[0060] Also in this embodiment, the first master circuit may be a processor or a DMA controller.
[0061] In this manner, when a first permission setting for access is made to the first slave circuit, the processor or DMA controller which is the first master circuit is permitted to make read access or write access to the first slave circuit, independent of the first permission setting of the first slave circuit.
[0062] In this embodiment, the second master circuit may be an external bus interface or a debug circuit.
[0063] In this manner, when a first permission setting for access is made to the first slave circuit, the second master circuit, which is a debug circuit or an external bus interface, is permitted to make read access or write access to the first slave circuit based on the first permission setting.
[0064] In addition, this embodiment may include a non-volatile memory that stores protection setting information, which is information on access authority and permission settings.
[0065] In this way, the protection setting information, which is information on access authority and permission settings, can be stored in a non-volatile memory, which is a memory that retains information even when power is not supplied.
[0066] In addition, this embodiment may include a memory controller that sets access authority and permission based on the protection setting information read from the non-volatile memory.
[0067] In this way, it is possible to effectively utilize the memory controller that controls the non-volatile memory that stores the protection setting information to set the access rights for the master circuit and the permission to access the slave circuit.
[0068] In this embodiment, the memory controller may set permissions for a plurality of slave circuits using a first signal line provided separately from the bus.
[0069] In this way, for example, during the period after the initialization process and before the circuit device starts its actual operation, the memory controller can use the dedicated first signal line to set the permission of the slave circuit.
[0070] In this embodiment, the memory controller may set access rights for a plurality of master circuits using a second signal line provided separately from the bus.
[0071] In this way, for example, during the period after the initialization process and before the circuit device starts its actual operation, the memory controller can set the access authority of the master circuit using the dedicated second signal line.
[0072] Furthermore, this embodiment includes an authority control circuit provided between the multiple master circuits and the bus, and the authority control circuit may set access authority by rewriting information on access authority included in information on bus access from each of the multiple master circuits.
[0073] In this way, even if access authority is inappropriately set for the master circuit, the authority control circuit can rewrite the access authority information included in the bus access information from the master circuit, thereby making it possible to set the access authority to the appropriate one.
[0074] In addition, this embodiment includes a non-volatile memory that stores protection setting information, which is information on access rights and permission settings, and a memory controller that controls the non-volatile memory, and the memory controller may set access rights for the authority control circuit.
[0075] In this way, even if access rights are inappropriately set for the master circuit, the memory controller can read the protection setting information from the non-volatile memory and set the access rights in the authority control circuit, so that the authority control circuit can rewrite the access right information contained in the bus access information from the master circuit and set the access rights to the appropriate ones.
[0076] In this embodiment, the memory controller may permit writing of the protection setting information to the non-volatile memory when the setting storage area for the protection setting information is in a completely erased state.
[0077] In this way, if the setting memory area is not in a completely erased state, writing of protection setting information to the setting memory area is prohibited, making it possible to prevent a situation in which the access authority settings and access permission settings of the protection setting information are rewritten due to malicious access from outside, for example.
[0078] In addition, in this embodiment, the memory controller may not permit partial erasure of the setting memory area when protection setting information is stored in the setting memory area.
[0079] In this way, it is possible to prevent the occurrence of a situation in which the setting storage area is partially erased and the protection setting is cancelled.
[0080] In this embodiment, the permission setting information may be written to a register provided in each of the slave circuits.
[0081] In this way, each slave circuit can determine whether or not to permit read access or write access from the master circuit based on the permission setting information written in its own register and the access authority of the master circuit.
[0082] In this embodiment, the information on the access authority may be included in the information on bus access to the bus.
[0083] In this way, when a read access or write access is received from the master circuit, each slave circuit can decide whether or not to permit the read access or write access based on the access authority information contained in the bus access information for the read access or write access and the access permission setting information set for the slave circuit itself.
[0084] In addition, this embodiment includes a bus bridge circuit provided between the bus and a peripheral bus to which multiple peripheral circuits are connected, and information on permission settings for each of the multiple peripheral circuits may be written to a register provided in the bus bridge circuit.
[0085] In this way, access permission settings for peripheral circuits connected to the peripheral bus can be set all at once using the registers of the bus bridge circuit, which simplifies the process of setting access permission and reduces the processing load.
[0086] The present embodiment also relates to an electronic device including the circuit device described above.
[0087] Although the present embodiment has been described in detail as above, it will be easily understood by those skilled in the art that many modifications are possible without substantially departing from the novel matters and effects of the present invention. Therefore, all such modifications are intended to be included in the scope of the present invention. For example, a term described at least once in the specification or drawings together with a different term having a broader meaning or synonymy can be replaced with that different term anywhere in the specification or drawings. In addition, all combinations of the present embodiment and modifications are also included in the scope of the present invention. In addition, the configuration and operation of the circuit device and electronic device are not limited to those described in the present embodiment, and various modifications are possible. [Explanation of symbols]
[0088] 10...circuit device, 12...bus, 14...peripheral bus, 16...first signal line, 18...second signal line, 20-1 to 20-n...master circuit, 21...core block, 22...processor, 24...debug circuit, 26...DMA controller, 28...external bus interface, 30-1 to 30-m...slave circuit, 31-1 to 31-m...register, 32...SRAM controller, 34...bus bridge circuit, 35...register, 36, 37, 38, 39...peripheral circuit, 40...memory controller, 50...non-volatile memory, 52...user memory area, 54...setting memory area, 70...authority control circuit, 300...electronic device, 310...display unit, 320...memory, 330...operation interface, 340...communication interface, AR1 to AR128...memory memory area, PA to PZ...peripheral circuit
Claims
1. Bus and a plurality of master circuits connected to the bus and which are bus masters on the bus; A bus slave circuit connected to the plurality of master circuits via the bus a plurality of slave circuits, Including, The plurality of master circuits are set with access rights to the bus slaves. 、 The plurality of slave circuits receive read access or write access from the bus master. The permission is set for the Each of the master circuits of the plurality of master circuits performs a command based on the access authority and the permission setting. determining whether or not to allow access to each of the plurality of slave circuits; The plurality of master circuits include a first master circuit to which the access authority to the bus slave is set; a second master circuit to which the access authority to the bus slave is not set; Including, the plurality of slave circuits includes a first slave circuit having a first permission setting; The first master circuit transmits a command to the first slave circuit independent of the first permission setting. said read access or said write access is permitted, The second master circuit transmits a command to the first slave circuit based on the first permission setting. A circuit device, characterized in that the read access or the write access is permitted.
2. 2. The circuit device according to claim 1, The first master circuit is a processor or a DMA controller. A circuit device.
3. 3. The circuit device according to claim 1, The second master circuit is an external bus interface or a debug circuit. A circuit device that resembles a
4. A bus, a plurality of master circuits connected to the bus and which are bus masters on the bus; A bus slave circuit connected to the plurality of master circuits via the bus a plurality of slave circuits, Including, The plurality of master circuits are set with access rights to the bus slaves. 、 The plurality of slave circuits receive read access or write access from the bus master. The permission is set for the Each of the master circuits of the plurality of master circuits performs a command based on the access authority and the permission setting. determining whether or not to allow access to each of the plurality of slave circuits; A non-volatile memory that stores the access authority and the protection setting information that is information on the permission setting. A circuit device comprising a photosensitive memory.
5. 5. The circuit device according to claim 4, The access control unit 100 controls the access control information based on the protection setting information read from the nonvolatile memory. a memory controller for setting access authority and for setting the permission, road device.
6. 6. The circuit device according to claim 5, The memory controller includes: The plurality of slave circuits are connected to a first signal line provided separately from the bus. A circuit device for setting permissions.
7. 7. The circuit device according to claim 5, The memory controller includes: The plurality of master circuits are connected to the second signal line provided separately from the bus. A circuit device for setting access authority.
8. Bus and a plurality of master circuits connected to the bus and which are bus masters on the bus; A bus slave circuit connected to the plurality of master circuits via the bus a plurality of slave circuits, an authority control circuit provided between the plurality of master circuits and the bus; A non-volatile memory; A memory controller that controls the non-volatile memory; Including, The plurality of master circuits are set with access rights to the bus slaves. 、 The plurality of slave circuits receive read access or write access from the bus master. The permission is set for the Each of the master circuits of the plurality of master circuits performs a command based on the access authority and the permission setting. determining whether or not to allow access to each of the plurality of slave circuits; The authority control circuit includes: before being included in information on bus access from each of the plurality of master circuits By rewriting the information of the access authority, the access authority is set, The non-volatile memory includes: storing protection setting information which is information on the access authority and the permission setting; The memory controller includes: A circuit device, characterized in that the access authority is set in the authority control circuit.
9. A circuit arrangement according to any one of claims 5 to 8, The memory controller includes: When the setting storage area of the protection setting information is in a completely erased state, a protection setting information storage section that stores protection setting information for a first write operation of the protection setting information storage section,
10. 10. The circuit arrangement according to claim 9, The memory controller includes: When the protection setting information is stored in the setting storage area, A circuit arrangement for disallowing partial erasure of an area.
11. A circuit arrangement according to any one of claims 1 to 10, The permission setting information is stored in a level provided in each of the plurality of slave circuits. A circuit device characterized in that the circuit device is written to a register.
12. A circuit arrangement according to any one of claims 1 to 11, The information on the access authority is included in information on bus access to the bus. A circuit device that resembles a
Citation Information
Patent Citations
Microprocessor and multiprocessor system
JP1998154124A
Data processor
JP2003044457A
Data processing system and method with peripheral device access protection
JP2006523347A
Portable electronic device and IC card
JP2019160191A
Peripheral access on a secure-aware bus system
WO2020002432A1
