All information contained in these materials, including products and product specifications,
represents information on the product at the time of publication and is subject to change by Renesas
Electronics Corp. without notice. Please review the latest information published by Renesas
Electronics Corp. through various means, including the Renesas Electronics Corp. website
(http://www.renesas.com).
User’s Manual
Corporate Headquarters
Contact information
TOYOSU FORESIA, 3-2-24 Toyosu,
Koto-ku, Tokyo 135-0061, Japan
www.renesas.com
For further information on a product, technology, the most up-to-date
version of a document, or your nearest sales office, please visit:
www.renesas.com/contact/.
Trademarks
Renesas and the Renesas logo are trademarks of Renesas
Electronics Corporation. All trademarks and registered trademarks
are the property of their respective owners.
Notice
1. Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation of semiconductor products
and application examples. You are fully responsible for the incorporation or any other use of the circuits, software, and information in the design of your
product or system. Renesas Electronics disclaims any and all liability for any losses and damages incurred by you or third parties arising from the use of
these circuits, software, or information.
2. Renesas Electronics hereby expressly disclaims any warranties against and liability for infringement or any other claims involving patents, copyrights, or
other intellectual property rights of third parties, by or arising from the use of Renesas Electronics products or technical information described in this
document, including but not limited to, the product data, drawings, charts, programs, algorithms, and application examples.
3. No license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights of Renesas Electronics or
others.
4. You shall not alter, modify, copy, or reverse engineer any Renesas Electronics product, whether in whole or in part. Renesas Electronics disclaims any
and all liability for any losses or damages incurred by you or third parties arising from such alteration, modification, copying or reverse engineering.
5. Renesas Electronics products are classified according to the following two quality grades: “Standard” and “High Quality”. The intended applications for each Renesas Electronics product depends on the product’s quality grade, as indicated below.
"Standard": Computers; office equipment; communications equipment; test and measurement equipment; audio and visual equipment; home
"High Quality": Transportation equipment (automobiles, trains, ships, etc.); traffic control (traffic lights); large-scale communication equipment; key
Unless expressly designated as a high reliability product or a product for harsh environments in a Renesas Electronics data sheet or other Renesas
Electronics document, Renesas Electronics products are not intended or authorized for use in products or systems that may pose a direct threat to
human life or bodily injury (artificial life support devices or systems; surgical implantations; etc.), or may cause serious property damage (space system;
undersea repeaters; nuclear power control systems; aircraft control systems; key plant systems; military equipment; etc.). Renesas Electronics disclaims
any and all liability for any damages or losses incurred by you or any third parties arising from the use of any Renesas Electronics product that is
inconsistent with any Renesas Electronics data sheet, user’s manual or other Renesas Electronics document.
6. When using Renesas Electronics products, refer to the latest product information (data sheets, user’s manuals, application notes, “General Notes for Handling and Using Semiconductor Devices” in the reliability handbook, etc.), and ensure that usage conditions are within the ranges specified by
Renesas Electronics with respect to maximum ratings, operating power supply voltage range, heat dissipation characteristics, installation, etc. Renesas
Electronics disclaims any and all liability for any malfunctions, failure or accident arising out of the use of Renesas Electronics products outside of such
specified ranges.
7. Although Renesas Electronics endeavors to improve the quality and reliability of Renesas Electronics products, semiconductor products have specific
characteristics, such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Unless designated as a high reliability
product or a product for harsh environments in a Renesas Electronics data sheet or other Renesas Electronics document, Renesas Electronics products
are not subject to radiation resistance design. You are responsible for implementing safety measures to guard against the possibility of bodily injury,
injury or damage caused by fire, and/or danger to the public in the event of a failure or malfunction of Renesas Electronics products, such as safety
design for hardware and software, including but not limited to redundancy, fire control and malfunction prevention, appropriate treatment for aging
degradation or any other appropriate measures. Because the evaluation of microcomputer software alone is very difficult and impractical, you are
responsible for evaluating the safety of the final products or systems manufactured by you.
8. Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas
Electronics product. You are responsible for carefully and sufficiently investigating applicable laws and regulations that regulate the inclusion or use of
controlled substances, including without limitation, the EU RoHS Directive, and using Renesas Electronics products in compliance with all these
applicable laws and regulations. Renesas Electronics disclaims any and all liability for damages or losses occurring as a result of your noncompliance
with applicable laws and regulations.
9. Renesas Electronics products and technologies shall not be used for or incorporated into any products or systems whose manufacture, use, or sale is
prohibited under any applicable domestic or foreign laws or regulations. You shall comply with any applicable export control laws and regulations
promulgated and administered by the governments of any countries asserting jurisdiction over the parties or transactions.
10. It is the responsibility of the buyer or distributor of Renesas Electronics products, or any other party who distributes, disposes of, or otherwise sells or
transfers the product to a third party, to notify such third party in advance of the contents and conditions set forth in this document.
11. This document shall not be reprinted, reproduced or duplicated in any form, in whole or in part, without prior written consent of Renesas Electronics.
12. Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas
Electronics products.
(Note1) “Renesas Electronics” as used in this document means Renesas Electronics Corporation and also includes its directly or indirectly controlled
(Note2) “Renesas Electronics product(s)” means any product developed or manufactured by or for Renesas Electronics.
subsidiaries.
electronic appliances; machine tools; personal electronic equipment; industrial robots; etc.
financial terminal systems; safety control equipment; etc.
This manual describes how users can port the Linux BSP for the RZ/G2 reference boards to boards (henceforth referred
to as “custom boards”) which they are developing with the use of the RZ/G2 Group MPU.
For more information on how to access the sources and how to build, see the manuals provided for each distribution
method of Linux BSP.
Via GitHub: “RZ/G2 Yocto recipe Start-Up Guide”
Verified Linux Package for 64bit kernel (hereinafter called as VLP64): “Release Note” provided with VLP64
This manual is intended for users who intend to develop their own custom boards.
Statements in this manual apply to the following version of the BSP.
This manual includes references to the documents listed in the table below.
Particular attention should be paid to the precautionary notes when using the manual. These notes occur within
the body of the text, at the end of each section.
The revision history summarizes the locations of revisions and additions. It does not list all revisions. Refer to the
text of the manual for details.
Word
Full Form
Description
BSP
Board Support Package
A set of software components that allows a given OS to run on
a specific hardware platform.
Linux BSP
Linux Board Support Package
Board support package to run the Linux environment
U-Boot
Das U-Boot
This is a boot loader, also referred to as the Universal Boot
Loader, which is released under the GPL. “Universal” indicates
that it can run on multiple types of platform.
VLP64
RZ/G Verified Linux Package for
64bit kernel
The software packages provided by Renesas for the users to
evaluate/develop the GNU/Linux environment on the RZ/G2
Group processors.
TF-A
Trusted Firmware-A
-
ATF
Arm Trusted Firmware-A
-
ATF-A
Arm Trusted Firmware-A
-
EK874
-
Silicon Linux RZ/G2E evaluation kit
TFTP
Trivial File Transfer Protocol
-
PRR
Product Register
PRR indicates the product version and which of the Arm
Cortex cores is present.
BL1
Boot Loader stage 1
-
BL2
Boot Loader stage 2
-
BL31
Boot Loader stage 3-1
-
BL33
Boot Loader stage 3-2
-
custom
board
-
The board which will be based on RZ/G2 reference boards
and includes the user’s customization
2. List of Abbreviations, Acronyms and Keywords
3. Notations Used in This Manual
Constant width text means the code fragment or the variable, function, environment variable or keyword
in the body text.
Constant width bold text means the commands to be executed.
Green highlighter in the source code fragment shows the part to be focused on.
Characters with border in the source code fragment are the part to be referred from the body text.
The meaning of the other notation in the source code fragment is shown near each fragment.
All trademarks and registered trademarks are the property of their respective owners.
The official name of Windows is Microsoft® Windows® Operating System.
Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States
and/or other countries.
Linux is a registered trademark or trademark of Linus Torvalds in the United States and other countries.
Ubuntu is a trademark or registered trademark of Canonical Ltd. in the United Kingdom and other countries.
Qt is a trademark or registered trademark of The Qt Company Ltd. and its subsidiaries in the United States and other
countries.
GitHub is a trademark or registered trademark of The GitHub, Inc.. and its subsidiaries in the United States and other
countries.
The symbols for trademark and registered trademark (® and ™) may be omitted in this manual.
3.2 How to customize a functionality in TF-A ................................................................................................... 8
3.2.1 Board specific flag ............................................................................................................................ 8
4.1 Editing the U-Boot Source Code .............................................................................................................. 18
4.2 List of Board-specific files ........................................................................................................................ 20
4.3 Procedure for Porting U-Boot .................................................................................................................. 21
4.3.1 Deciding the board name ............................................................................................................... 22
4.3.2 Creating the Board Directory .......................................................................................................... 22
4.3.3 Creating the board file .................................................................................................................... 22
4.3.4 Creating the board Kconfig file ....................................................................................................... 24
4.3.5 Creating the Makefile ..................................................................................................................... 25
4.3.6 Creating the defconfig file .............................................................................................................. 25
4.3.7 Creating the board header File ...................................................................................................... 26
4.3.8 Adding the entry to the board Kconfig file to architecture's Kconfig .............................................. 28
4.3.9 Creating the Device tree file ........................................................................................................... 28
4.3.10 Building U-Boot .............................................................................................................................. 29
4.3.11 Writing U-Boot to a Custom Board ................................................................................................. 29
5. Porting the Linux Kernel .................................................................................................. 30
5.1 Editing the Source Code of the Linux Kernel ........................................................................................... 30
5.2 Procedure for Porting the Linux Kernel .................................................................................................... 30
5.3 List of Board-specific Files ....................................................................................................................... 31
5.4 Adding, Modifying, and Deleting Device Drivers ..................................................................................... 32
5.5 Creating the Device Tree and Modifying the Makefile ............................................................................. 34
5.5.1 Device Trees of the RZ/G2E EK874 Kit ......................................................................................... 36
5.5.2 Creating the Device Tree and Modifying the Makefile ................................................................... 37
5.5.4 Enabling or Disabling Existing Devices .......................................................................................... 39
5.5.5 Customizing the pin multiplex ........................................................................................................ 40
5.5.6 Newly Creating a Pin Group ........................................................................................................... 43
5.5.7 Adding, Deleting, and Modifying Devices ...................................................................................... 45
5.6 Changing the Kernel Configuration .......................................................................................................... 47
5.7 Building the Linux Kernel ......................................................................................................................... 47
5.8 Examples of Adding Devices/Kernel functions ........................................................................................ 48
5.8.1 Adding an I2C Device .................................................................................................................... 48
R01US0447EJ0105
Rev. 1.05
Feb. 26, 2021
On-Chip ROM
Boot code
Firmware-A
Das U-Boot
Linux Kernel
Boot Process
See chapter 5
See Chapter 4
See Chapter 3
RZ/G Series Linux BSP Porting Guide
Renesas RZ Family Microprocessors
1. Overview
This manual describes how users can port the Linux BSP from the RZ/G2 Linux platform that supports RZ/G2
reference boards to custom boards they are developing. Linux BSP for the RZ/G2 reference boards are provided
as a part of the Yocto recipe on the GitHub repository or "RZ/G Verified Linux Package for 64bit kernel"
(hereinafter, referred to as VLP64). When the users make their own custom boards based on the Linux BSP on
the RZ/G2 reference boards, the Linux BSP are to be updated. Some parts in this manual describes how to port
the Linux BSP for the Silicon Linux RZ/G2E evaluation kit (EK874) to a custom board as an example.
1.1 Porting Parts Explained in this Document
As shown in Figure 1.1, this document explains about following software components:
Trusted Firmware-A (refer to the section 3. Porting Trusted Firmware-A)
Das U-Boot (refer to the section 4. Porting U-Boot)
Linux kernel (refer to the section 5. Porting the Linux Kernel)
Also, how to add new machine configuration to Yocto recipe is explained in the section 0.
Adding new machine configuration to Yocto recipes. This enables the build configuration for
the custom boards to both of Das U-boot and Linux kernel in Yocto build.
This document doesn’t explain about Loader or user-land/root file system. To port user-land/root file system,
please refer “Yocto Start-up Guide” document.
Also, this document assumes the boot process is QSPI flash boot.
This document assumes the boot procedure using SPI flash as a boot device.
Trusted
R01US0447EJ0105 Rev. 1.05 Page 1 of 52
Feb. 26, 2021
Figure 1.1 Porting Parts Explained in this Document
RZ/G2 Group Linux BSP Porting Guide 1. Overview
Item
description
Linux BSP
Version 1.0.0 or later [VLP64 based development]
tag: BSP-1.0.0 or later [Yocto recipe-based development]
Listed on “2. Build environment” of VLP64’s release notes or “2. Environmental Requirement” of “RZ/G2 Yocto recipe Start-Up Guide” [1]
Version
Silicon
Linux
EK874
Evaluation
Kit (EK874)
Hoperun
Technology
HiHope RZ/G2M
platform
(RZ/G2M v1.3)
Hoperun
Technology
HiHope RZ/G2M
platform
(RZ/G2M v3.0)
Hoperun
Technology
HiHope RZ/G2N
platform
Hoperun
Technology
HiHope RZ/G2H
platform
1.0.0
X
1.0.1 X X
1.0.2 X X X
1.0.3-RT X X X
1.0.4 X X X
X
1.0.5-RT
1.0.6 … X X X X X
1.2 Prerequisites
This document assumes the prerequisites on Table 1.1.
Table 1.1 Prerequisites
Supported boards are depend on the Linux BSP version which provided by Yocto recipe on GitHub or in
VLP64 (Table 1.2). Later version is recommended when multiple versions support a board.
Table 1.2 Supported boards by each Linux BSP version
VLP64 are available on the site below. Please create an account to download the packages. Basic packages
of VLP64 can be downloaded.
4. Boot Loader stage 3-3 (BL33) U-Boot loads kernel image and devicetree and execute kernel image.
U-Boot
Figure 1.2 Overview of VLP64 boot sequence
R01US0447EJ0105 Rev. 1.05 Page 3 of 52
Feb. 26, 2021
RZ/G2 Group Linux BSP Porting Guide 2. Adding new machine configuration to Yocto recipes
Symbol
Example value
Description
SOC_FAMILY
r8a774c0
Part name of RZ/G2E.
Change this if another MPU is used. Note that list of
available MPU can be found as .inc files under metarzg2/conf/machine/include/ (Ex: r8a774c0.inc,
r8a774a1.inc…)
DEFAULTTUNE
cortexa53
Tune setting when building. In this case, choose this
value because RZ/G2E r8a774c0 is based on ARM
Cortex-A53.
Change this corresponding to SOC_FAMILY.
SERIAL_CONSOLE
"115200 ttySC0"
Setting for using debug serial console (in this case
EK874 use ttySC0 channel for debug serial, with baud
rate 115200).
Change this corresponding to hardware setting of
custom board.
PREFERRED_PROVIDER_virtual
/kernel
linux-renesas
Use package "linux-renesas" package for Linux kernel
(shouldn’t change)
KERNEL_DEVICETREE
"renesas/r8a774c0ek874.dtb
renesas/r8a774c0cat874.dtb"
List of device tree in Linux kernel that will be used for
this machine.
Change this to the device tree of custom board created
in 5.5
PREFERRED_VERSION_u-boot
v2018.09%
Version of u-boot to be build
(shouldn’t change)
UBOOT_CONFIG
ek874
Set defconfig for building u-boot.
Change this to the defconfig of custom board created
in 4.3.6
UBOOT_CONFIG[ek874]
r8a774c0_ek874_defconfig
2. Adding new machine configuration to Yocto recipes
Linux BSP for RZ/G2 are provided as a Yocto recipe and the machine configuration manages the MPU and
the board information used by the U-boot, the Linux kernel and the other software in common. This chapter is
optional for porting but recommended for easier board management.
2.1 Create machine config file
First create a machine config file in Renesas Yocto layer meta-rzg2, for example metarzg2/conf/machine/custom-rzg2e.conf. In this case, the machine name is custom-rzg2e. The
typical machine name is composed only by lowercase letters: a-z, numbers: 0-9 and hyphen. Machine name
example can be found in the conf/machine directories of the Yocto Metadata layers available on
If the multimedia features like OpenGL support or window system support is to be supported, need to add to
some multimedia support packages as well.
(At default, the multimedia features are available in core-image-weston, core-image-bsp, core-image-hmi, and
not available in core-image-minimal, core-image-bsp)
Certain packages require specific build configurations depend on the MPU and the board. For MPU
dependences, Yocto can configure automatically if SOC_FAMILY is the same with the reference boards,
therefore following packages can work without any modification:
But there is one package that depends on the board hardware and must be modified manually. But it can be
skipped if multimedia features are not used when the target image is core-image-minimal or core-image-bsp.
R01US0447EJ0105 Rev. 1.05 Page 5 of 52
Feb. 26, 2021
RZ/G2 Group Linux BSP Porting Guide 2. Adding new machine configuration to Yocto recipes
MMNGR module depends on the RAM setting of the board. With different value of macro MMNGR_CFG it will
have different set of definitions (for different address and memory size). If custom board has same memory
setting with one reference boards from Renesas, set the same value.
MMNGR_CFG_custom-rzg2e = "MMNGR_EBISU"
If custom board has completely different RAM setting with all Renesas reference boards, need to create a new
setting for it. This involves modifying source code of MMNGR. If it is too difficult, please contact to Renesas
Sales.
R01US0447EJ0105 Rev. 1.05 Page 6 of 52
Feb. 26, 2021
RZ/G2 Group Linux BSP Porting Guide 3. Porting Trusted Firmware-A
3. Porting Trusted Firmware-A
Linux BSP for RZ/G2 uses Trusted Firmware-A (originally, known as Arm Trusted Firmware-A. hereinafter,
referred to as TF-A) as a loader for BL2 and BL31 as shown on 0
R01US0447EJ0105 Rev. 1.05 Page 7 of 52
Feb. 26, 2021
RZ/G2 Group Linux BSP Porting Guide 3. Porting Trusted Firmware-A
Overview of the boot sequence.
3.1 Customization flow
Followings are one of example customization flow of TF-A provided with VLP64. This flow is based on one
shown in https://wiki.yoctoproject.org/wiki/TipsAndTricks/Patching_the_source_for_a_recipe.
1. Setup the bitbake build environment. The directory /home/user/work is just an example and specify
your existing Yocto build environment's work directory.
2. (Optional) Making the layer for the customization. This step is required only when the modification for
porting will be stored on the new Yocto layer (other than meta-rzg2). For the details of the following
command, please refer to https://www.yoctoproject.org/docs/2.4.3/dev-manual/dev-
5. Modify the source code with reference to “3.2 How to customize a functionality in TF-A”. bitbake arm-
trusted-firmware -c devshell is easy to access the source code (not mandatory)
6. Modify the recipe $WORK/meta-rzg2/recipes-bsp/arm-trusted-firmware/arm-trusted-
firmware_git.bb if requred. devtool edit-recipe arm-trusted-firmware -a is easy to
access the recipe (not mandatory).
7. Build and test TF-A to confirm that the modification is correct and works well. Build results will be
available on $WORK/build/tmp/deploy/images/[machine name]. Regarding how to write TF-A to
the board, refer to the section “1.3Writing Bootloader” of “RZ/G2 Reference Boards Start-up Guide” [5]
provided with VLP64 or the section “4. Writing of IPL/Secure” of “Yocto recipe Start-Up Guide” [1].
bitbake arm-trusted-firmware
8. Repeat from step 4 to get the TF-A for the custom board.
9. Commit the changes to the source code in the source code directory. The number of commits will be the
same as the number of patch files created in the step 8.
cd $WORK/build/workspace/sources/arm-trusted-firmware
git add .
git commit
10. Convert the changes of the source code to the recipe. There are two ways:
devtool update-recipe arm-trusted firmware to update the original arm-trusted-
firmware’s recipe on $WORK/meta-rzg2/recipes-bsp/arm-trusted-firmware/armtrusted-firmware_git.bb
devtool update-recipe -a $WORK/meta-userboard arm-trusted-firmware to convert
the changes to .bbappend file on the different layer like $WORK/meta-userboard/recipes-bsp/arm-trusted-firmware/arm-trusted-firmware_git.bbappend and patches on
R01US0447EJ0105 Rev. 1.05 Page 8 of 52
Feb. 26, 2021
RZ/G2 Group Linux BSP Porting Guide 3. Porting Trusted Firmware-A
$WORK/meta-userboard/recipes-bsp/arm-trusted-firmware/arm-trustedfirmware/. Note that layer name "meta-userboard" are the same as the one used in step 2.
11. If the customization is finished, run the following command to remove the source code directory
$WORK/build/workspace/sources/arm-trusted-firmware and recover the normal build method
using $WORK/build/tmp/work/...
devtool reset arm-trusted-firmware
3.2 How to customize a functionality in TF-A
3.2.1 Board specific flag
VLP64's TF-A can be applied the board specific configuration by using the build argument in ATFW_OPT
defined in arm-trusted-firmware_git.bb.
The board specific option RZG_EK874 is set for EK874, RZG_HIHOPE_RZG2M is for hihope-rzg2m,
RZG_HIHOPE_RZG2N is for hihope-rzg2n and RZG_HIHOPE_RZG2H is for hihope-rzg2h.
These options will be processed in plat/renesas/rzg/platform.mk as follows:
R01US0447EJ0105 Rev. 1.05 Page 9 of 52
Feb. 26, 2021
RZ/G2 Group Linux BSP Porting Guide 3. Porting Trusted Firmware-A
... (snip) ...
# Process RZG_DRAM_ECC flag
ifndef RZG_DRAM_ECC
RZG_DRAM_ECC :=0
endif
$(eval $(call add_define,RZG_DRAM_ECC))
# Process RZG_DRAM_ECC_FULL flag
# 0 : ECC Full mode will not be applied
# 1 : ECC Full mode dual channel will be applied
# 2 : ECC Full mode single channel will be applied ifndef RZG_DRAM_ECC_FULL
RZG_DRAM_ECC_FULL :=0
endif
$(eval $(call add_define,RZG_DRAM_ECC_FULL))
... (snip) ...
The board specific option RZG_EK874 is set for EK874, RZG_HIHOPE_RZG2M is for hihope-rzg2m,
RZG_HIHOPE_RZG2N is for hihope-rzg2n and RZG_HIHOPE_RZG2H is for hihope-rzg2h.
R01US0447EJ0105 Rev. 1.05 Page 10 of 52
Feb. 26, 2021
RZ/G2 Group Linux BSP Porting Guide 3. Porting Trusted Firmware-A
Product
Filename
Function
RZ/G2H
pfc_init_g2h.c
pfc_init_g2h()
RZ/G2M (v1.3, v3.0)
pfc_init_g2m.c
pfc_init_g2m()
RZ/G2N
pfc_init_g2n.c
pfc_init_g2n()
RZ/G2E
pfc_init_g2e.c
pfc_init_g2e()
3.2.2 PFC/GPIO setting
VLP64’s TF-A have PFC/GPIO settings for each device’s reference board. The customization of PFC/GPIO
settings based on the difference between the reference board and the custom board.
Following files are related to PFC/GPIO setting of RZ/G2 devices.
drivers/renesas/rzg/pfc
├── pfc_init.c
├── pfc.mk
├── pfc_regs.h
├── G2E
│ ├── pfc_init_g2e.c
│ └── pfc_init_g2e.h
├── G2H
│ ├── pfc_init_g2h.c
│ └── pfc_init_g2h.h
├── G2M
│ ├── pfc_init_g2m.c
│ └── pfc_init_g2m.h
├── G2N
│ ├── pfc_init_g2n.c
│ └── pfc_init_g2n.h
pfc_init() calls each device’s PFC/GPIO initialization function depends on the value of Product Register (PRR)
of RZ/G2 group. Table 3.1 shows each device’s PFC/GPIO initialization function.
Table 3.1 File and Function list of PFC/GPIO setting
3.2.2.1 Multiplexed pin functions
Some groups of pins of RZ/G2 Group devices have selectable two or more functions. "Module Select Register
0" (MOD_SEL0) to "Module Select Register n" (MOD_SELn) (n=2 [RZG2H], [RZG2M], [RZ/G2N]; n=1
[RZ/G2E]) can be configured as follows:
R01US0447EJ0105 Rev. 1.05 Page 11 of 52
Feb. 26, 2021
RZ/G2 Group Linux BSP Porting Guide 3. Porting Trusted Firmware-A
/* initialize module select */
pfc_reg_write(PFC_MOD_SEL0, MOD_SEL0_FOO
| MOD_SEL0_BAR);
pfc_reg_write(PFC_MOD_SEL1, MOD_SEL1_FOO
| MOD_SEL1_BAR);
Macro definitions for MOD_SEL0 and MOD_SEL1 register values are defined in the files listed on Table 3.1
as follows:
...
#define MOD_SEL0_HSCIF0_A ((uint32_t)0U << 24U)
#define MOD_SEL0_HSCIF0_B ((uint32_t)1U << 24U)
#define MOD_SEL0_HSCIF1_A ((uint32_t)0U << 23U)
#define MOD_SEL0_HSCIF1_B ((uint32_t)1U << 23U)
#define MOD_SEL0_HSCIF2_A ((uint32_t)0U << 22U)
#define MOD_SEL0_HSCIF2_B ((uint32_t)1U << 22U)
...
Refer to "8.2.9 Module Select Register 0-2 (MOD_SEL0-2)" [RZG2H], [RZ/G2M] [RZ/G2N] or "9.2.9 Module
Select Register 0-1 (MOD_SEL0-1)" [RZ/G2E] of "RZ/G Series, 2nd Generation User’s Manual: Hardware" [4]
for the meaning of each bit.
Some pins of RZ/G2 Group devices have selectable two or more functions. Peripheral Function Select
Register 0 (IPSR0) to Peripheral Function Select Register 15 (IPSR15) can be configured as follows:
/* initialize peripheral function select */
pfc_reg_write(PFC_IPSR0, IPSR_28_FUNC(2) /* select 2nd function for IP0[31:28] */
...
| IPSR_4_FUNC(1)); /* select 1st function for IP0[7:4] */
| IPSR_0_FUNC(0)); /* select 0th function for IP0[3:0] */
pfc_reg_write(PFC_IPSR1, IPSR_28_FUNC(2) /* select 2nd function for IP1[31:28] */
...
| IPSR_4_FUNC(1)); /* select 1st function for IP1[7:4] */
| IPSR_0_FUNC(0)); /* select 0th function for IP1[3:0] */
R01US0447EJ0105 Rev. 1.05 Page 12 of 52
Feb. 26, 2021
Loading...
+ 43 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.