Merge branch 'master' of git://git.denx.de/u-boot-sunxi
authorTom Rini <trini@konsulko.com>
Fri, 12 Apr 2019 19:43:08 +0000 (15:43 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 12 Apr 2019 19:43:08 +0000 (15:43 -0400)
379 files changed:
Kconfig
Makefile
README
arch/arm/Kconfig
arch/arm/dts/Makefile
arch/arm/dts/am335x-guardian-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/am335x-guardian.dts [new file with mode: 0644]
arch/arm/dts/armada-370-xp.dtsi
arch/arm/dts/armada-385-amc.dts [deleted file]
arch/arm/dts/armada-385-atl-x530-u-boot.dtsi
arch/arm/dts/armada-385-db-88f6820-amc.dts [new file with mode: 0644]
arch/arm/dts/armada-xp-98dx3236.dtsi [new file with mode: 0644]
arch/arm/dts/armada-xp-98dx3336.dtsi [new file with mode: 0644]
arch/arm/dts/armada-xp-98dx4251.dtsi [new file with mode: 0644]
arch/arm/dts/armada-xp-db-xc3-24g4xg-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/armada-xp-db-xc3-24g4xg.dts [new file with mode: 0644]
arch/arm/dts/armada-xp-gp.dts
arch/arm/dts/armada-xp-maxbcm.dts
arch/arm/dts/armada-xp-mv78230.dtsi
arch/arm/dts/armada-xp-mv78260.dtsi
arch/arm/dts/armada-xp-mv78460.dtsi
arch/arm/dts/armada-xp-synology-ds414.dts
arch/arm/dts/armada-xp-theadorable.dts
arch/arm/dts/armada-xp.dtsi
arch/arm/dts/at91sam9g25-gardena-smart-gateway-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/at91sam9g25-gardena-smart-gateway.dts [new file with mode: 0644]
arch/arm/dts/at91sam9x5.dtsi
arch/arm/dts/da850-evm-u-boot.dtsi
arch/arm/dts/dra7.dtsi
arch/arm/dts/dra71-evm.dts
arch/arm/dts/imx53-kp-u-boot.dtsi [new file with mode: 0644]
arch/arm/dts/k3-am65-wakeup.dtsi
arch/arm/dts/k3-am654-base-board-u-boot.dtsi
arch/arm/dts/keystone-k2g-evm.dts
arch/arm/dts/keystone-k2g-ice.dts
arch/arm/dts/r8a7790-lager.dts
arch/arm/dts/r8a7790-stout.dts
arch/arm/dts/r8a7790.dtsi
arch/arm/dts/r8a7791-koelsch.dts
arch/arm/dts/r8a7791-porter.dts
arch/arm/dts/r8a7791.dtsi
arch/arm/dts/r8a7792.dtsi
arch/arm/dts/r8a7793-gose.dts
arch/arm/dts/r8a7793.dtsi
arch/arm/dts/r8a7794-alt-u-boot.dts
arch/arm/dts/r8a7794-silk.dts
arch/arm/dts/r8a7794.dtsi
arch/arm/dts/r8a7795-h3ulcb-u-boot.dts
arch/arm/dts/r8a7795-h3ulcb.dts
arch/arm/dts/r8a7795-salvator-x-u-boot.dts
arch/arm/dts/r8a7795-salvator-x.dts
arch/arm/dts/r8a7795-u-boot.dtsi
arch/arm/dts/r8a7795.dtsi
arch/arm/dts/r8a7796-m3ulcb-u-boot.dts
arch/arm/dts/r8a7796-m3ulcb.dts
arch/arm/dts/r8a7796-salvator-x-u-boot.dts
arch/arm/dts/r8a7796-salvator-x.dts
arch/arm/dts/r8a7796-u-boot.dtsi
arch/arm/dts/r8a7796.dtsi
arch/arm/dts/r8a77965-m3nulcb-u-boot.dts [new file with mode: 0644]
arch/arm/dts/r8a77965-m3nulcb.dts [new file with mode: 0644]
arch/arm/dts/r8a77965-salvator-x-u-boot.dts
arch/arm/dts/r8a77965-u-boot.dtsi
arch/arm/dts/r8a77965.dtsi
arch/arm/dts/r8a77970-u-boot.dtsi
arch/arm/dts/r8a77970.dtsi
arch/arm/dts/r8a77990-ebisu-u-boot.dts
arch/arm/dts/r8a77990-ebisu.dts
arch/arm/dts/r8a77990-u-boot.dtsi
arch/arm/dts/r8a77990.dtsi
arch/arm/dts/r8a77995-draak.dts
arch/arm/dts/r8a77995-u-boot.dtsi
arch/arm/dts/r8a77995.dtsi
arch/arm/dts/salvator-common.dtsi
arch/arm/dts/ulcb.dtsi
arch/arm/include/asm/arch-am33xx/ddr_defs.h
arch/arm/mach-at91/Kconfig
arch/arm/mach-at91/arm926ejs/Makefile
arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
arch/arm/mach-at91/armv7/sama5d2_devices.c
arch/arm/mach-at91/clock.c
arch/arm/mach-at91/include/mach/at91_wdt.h
arch/arm/mach-at91/include/mach/sama5d2.h
arch/arm/mach-at91/spl_at91.c
arch/arm/mach-k3/am6_init.c
arch/arm/mach-k3/common.c
arch/arm/mach-k3/include/mach/sys_proto.h
arch/arm/mach-keystone/Kconfig
arch/arm/mach-keystone/include/mach/hardware-k2g.h
arch/arm/mach-keystone/include/mach/mux-k2g.h
arch/arm/mach-kirkwood/cpu.c
arch/arm/mach-kirkwood/include/mach/cpu.h
arch/arm/mach-kirkwood/include/mach/soc.h
arch/arm/mach-mvebu/Kconfig
arch/arm/mach-mvebu/Makefile
arch/arm/mach-mvebu/cpu.c
arch/arm/mach-mvebu/include/mach/config.h
arch/arm/mach-mvebu/include/mach/cpu.h
arch/arm/mach-mvebu/include/mach/soc.h
arch/arm/mach-mvebu/mbus.c
arch/arm/mach-mvebu/serdes/axp/high_speed_env_lib.c
arch/arm/mach-omap2/Kconfig
arch/arm/mach-omap2/am33xx/Kconfig
arch/arm/mach-rmobile/Kconfig.64
arch/arm/mach-rmobile/lowlevel_init_gen3.S
arch/riscv/Kconfig
arch/riscv/cpu/ax25/Kconfig
arch/riscv/cpu/cpu.c
arch/riscv/cpu/start.S
arch/riscv/dts/Makefile
arch/riscv/dts/ae350_32.dts
arch/riscv/dts/ae350_64.dts
arch/riscv/include/asm/csr.h
arch/riscv/include/asm/global_data.h
arch/riscv/include/asm/sbi.h [new file with mode: 0644]
arch/riscv/include/asm/smp.h [new file with mode: 0644]
arch/riscv/include/asm/syscon.h
arch/riscv/lib/Makefile
arch/riscv/lib/andes_plic.c [new file with mode: 0644]
arch/riscv/lib/andes_plmt.c [new file with mode: 0644]
arch/riscv/lib/asm-offsets.c
arch/riscv/lib/bootm.c
arch/riscv/lib/sbi_ipi.c [new file with mode: 0644]
arch/riscv/lib/smp.c [new file with mode: 0644]
board/AndesTech/ax25-ae350/Kconfig
board/CZ.NIC/turris_omnia/turris_omnia.c
board/Marvell/db-xc3-24g4xg/.gitignore [new file with mode: 0644]
board/Marvell/db-xc3-24g4xg/MAINTAINERS [new file with mode: 0644]
board/Marvell/db-xc3-24g4xg/Makefile [new file with mode: 0644]
board/Marvell/db-xc3-24g4xg/README [new file with mode: 0644]
board/Marvell/db-xc3-24g4xg/binary.0 [new file with mode: 0644]
board/Marvell/db-xc3-24g4xg/db-xc3-24g4xg.c [new file with mode: 0644]
board/Marvell/db-xc3-24g4xg/kwbimage.cfg.in [new file with mode: 0644]
board/Synology/ds414/ds414.c
board/alliedtelesis/x530/x530.c
board/bosch/guardian/Kconfig [new file with mode: 0644]
board/bosch/guardian/MAINTAINERS [new file with mode: 0644]
board/bosch/guardian/Makefile [new file with mode: 0644]
board/bosch/guardian/board.c [new file with mode: 0644]
board/bosch/guardian/board.h [new file with mode: 0644]
board/bosch/guardian/mux.c [new file with mode: 0644]
board/davinci/da8xxevm/da850evm.c
board/davinci/da8xxevm/u-boot-spl-da850evm.lds
board/emulation/qemu-riscv/Kconfig
board/gardena/smart-gateway-at91sam/Kconfig [new file with mode: 0644]
board/gardena/smart-gateway-at91sam/MAINTAINERS [new file with mode: 0644]
board/gardena/smart-gateway-at91sam/Makefile [new file with mode: 0644]
board/gardena/smart-gateway-at91sam/board.c [new file with mode: 0644]
board/gardena/smart-gateway-at91sam/spl.c [new file with mode: 0644]
board/logicpd/am3517evm/am3517evm.c
board/maxbcm/maxbcm.c
board/renesas/rcar-common/common.c
board/renesas/ulcb/MAINTAINERS
board/renesas/ulcb/ulcb.c
board/ronetix/pm9g45/pm9g45.c
board/sifive/fu540/Kconfig
board/solidrun/clearfog/README
board/theadorable/theadorable.c
board/ti/am335x/board.c
board/ti/am65x/evm.c
board/ti/dra7xx/evm.c
board/ti/dra7xx/mux_data.h
board/ti/ks2_evm/board_k2g.c
board/ti/ks2_evm/mux-k2g.h
cmd/Kconfig
cmd/Makefile
cmd/fs.c
cmd/usb.c
cmd/wdt.c [new file with mode: 0644]
common/spl/spl_ymodem.c
common/usb_hub.c
configs/ae350_rv32_defconfig
configs/ae350_rv64_defconfig
configs/am335x_evm_defconfig
configs/am335x_guardian_defconfig [new file with mode: 0644]
configs/am57xx_evm_defconfig
configs/am65x_evm_a53_defconfig
configs/da850evm_defconfig
configs/da850evm_nand_defconfig
configs/db-88f6820-amc_defconfig
configs/db-mv784mp-gp_defconfig
configs/db-xc3-24g4xg_defconfig [new file with mode: 0644]
configs/dns325_defconfig
configs/dra7xx_evm_defconfig
configs/dra7xx_hs_evm_defconfig
configs/dreamplug_defconfig
configs/ds109_defconfig
configs/ds414_defconfig
configs/gardena-smart-gateway-at91sam_defconfig [new file with mode: 0644]
configs/goflexhome_defconfig
configs/guruplug_defconfig
configs/k2e_evm_defconfig
configs/k2e_hs_evm_defconfig
configs/k2g_evm_defconfig
configs/k2g_hs_evm_defconfig
configs/k2hk_evm_defconfig
configs/k2hk_hs_evm_defconfig
configs/k2l_evm_defconfig
configs/k2l_hs_evm_defconfig
configs/lschlv2_defconfig
configs/lsxhl_defconfig
configs/nas220_defconfig
configs/pm9g45_defconfig
configs/r8a7795_salvator-x_defconfig
configs/r8a7795_ulcb_defconfig
configs/r8a77965_salvator-x_defconfig
configs/r8a77965_ulcb_defconfig [new file with mode: 0644]
configs/r8a7796_salvator-x_defconfig
configs/r8a7796_ulcb_defconfig
configs/sheevaplug_defconfig
configs/smartweb_defconfig
configs/taurus_defconfig
configs/theadorable_debug_defconfig
configs/turris_omnia_defconfig
configs/x530_defconfig
doc/README.rmobile
doc/device-tree-bindings/i2c/i2c.txt
doc/git-mailrc
drivers/Kconfig
drivers/ata/Kconfig
drivers/ata/ahci_mvebu.c
drivers/ata/sata_mv.c
drivers/clk/renesas/Kconfig
drivers/clk/renesas/Makefile
drivers/clk/renesas/clk-rcar-gen3.c
drivers/clk/renesas/r8a7790-cpg-mssr.c
drivers/clk/renesas/r8a7791-cpg-mssr.c
drivers/clk/renesas/r8a7792-cpg-mssr.c
drivers/clk/renesas/r8a7794-cpg-mssr.c
drivers/clk/renesas/r8a7795-cpg-mssr.c
drivers/clk/renesas/r8a7796-cpg-mssr.c
drivers/clk/renesas/r8a77965-cpg-mssr.c [new file with mode: 0644]
drivers/clk/renesas/r8a77990-cpg-mssr.c
drivers/clk/renesas/r8a77995-cpg-mssr.c
drivers/clk/renesas/rcar-gen3-cpg.h
drivers/clk/renesas/renesas-cpg-mssr.h
drivers/ddr/marvell/axp/xor_regs.h
drivers/dma/Kconfig
drivers/dma/Makefile
drivers/dma/ti/Kconfig [new file with mode: 0644]
drivers/dma/ti/Makefile [new file with mode: 0644]
drivers/dma/ti/k3-udma-hwdef.h [new file with mode: 0644]
drivers/dma/ti/k3-udma.c [new file with mode: 0644]
drivers/firmware/ti_sci.c
drivers/firmware/ti_sci.h
drivers/i2c/i2c-uclass.c
drivers/i2c/muxes/Kconfig
drivers/i2c/muxes/pca954x.c
drivers/i2c/mxc_i2c.c
drivers/misc/i2c_eeprom.c
drivers/mmc/omap_hsmmc.c
drivers/mtd/ubi/debug.h
drivers/net/macb.c
drivers/net/sh_eth.c
drivers/net/ti/cpsw-common.c
drivers/net/ti/cpsw.c
drivers/net/ti/keystone_net.c
drivers/pinctrl/pinctrl-at91.c
drivers/pinctrl/renesas/Kconfig
drivers/pinctrl/renesas/Makefile
drivers/pinctrl/renesas/pfc-r8a7790.c
drivers/pinctrl/renesas/pfc-r8a7791.c
drivers/pinctrl/renesas/pfc-r8a7792.c
drivers/pinctrl/renesas/pfc-r8a7794.c
drivers/pinctrl/renesas/pfc-r8a7795.c
drivers/pinctrl/renesas/pfc-r8a7796.c
drivers/pinctrl/renesas/pfc-r8a77965.c [new file with mode: 0644]
drivers/pinctrl/renesas/pfc-r8a77970.c
drivers/pinctrl/renesas/pfc-r8a77990.c
drivers/pinctrl/renesas/pfc-r8a77995.c
drivers/pinctrl/renesas/pfc.c
drivers/pinctrl/renesas/sh_pfc.h
drivers/power/regulator/pbias_regulator.c
drivers/serial/Kconfig
drivers/serial/atmel_usart.c
drivers/soc/Kconfig [new file with mode: 0644]
drivers/soc/Makefile
drivers/soc/keystone/Makefile [deleted file]
drivers/soc/keystone/keystone_serdes.c [deleted file]
drivers/soc/ti/Kconfig [new file with mode: 0644]
drivers/soc/ti/Makefile [new file with mode: 0644]
drivers/soc/ti/k3-navss-ringacc.c [new file with mode: 0644]
drivers/soc/ti/keystone_serdes.c [new file with mode: 0644]
drivers/usb/host/ehci-mx6.c
drivers/usb/host/usb-uclass.c
drivers/watchdog/Kconfig
drivers/watchdog/at91sam9_wdt.c
drivers/watchdog/orion_wdt.c
dts/Kconfig
env/ext4.c
env/nand.c
fs/ext4/ext4_common.c
fs/ext4/ext4_common.h
fs/ext4/ext4_journal.c
fs/ext4/ext4_write.c
fs/ext4/ext4fs.c
fs/fat/fat.c
fs/fs.c
fs/ubifs/debug.h
include/config_defaults.h
include/configs/alt.h
include/configs/am335x_guardian.h [new file with mode: 0644]
include/configs/clearfog.h
include/configs/corvus.h
include/configs/da850evm.h
include/configs/db-88f6720.h
include/configs/db-88f6820-amc.h
include/configs/db-88f6820-gp.h
include/configs/db-mv784mp-gp.h
include/configs/db-xc3-24g4xg.h [new file with mode: 0644]
include/configs/dra7xx_evm.h
include/configs/ds414.h
include/configs/gardena-smart-gateway-at91sam.h [new file with mode: 0644]
include/configs/helios4.h
include/configs/k2e_evm.h
include/configs/k2g_evm.h
include/configs/k2hk_evm.h
include/configs/k2l_evm.h
include/configs/lsxl.h
include/configs/mvebu_armada-8k.h
include/configs/omapl138_lcdk.h
include/configs/pm9g45.h
include/configs/smartweb.h
include/configs/taurus.h
include/configs/theadorable.h
include/configs/ti_armv7_keystone2.h
include/configs/ti_omap5_common.h
include/configs/turris_mox.h
include/configs/turris_omnia.h
include/cpsw.h
include/dt-bindings/clock/r8a7790-cpg-mssr.h
include/dt-bindings/clock/r8a7791-cpg-mssr.h
include/dt-bindings/clock/r8a7792-cpg-mssr.h
include/dt-bindings/clock/r8a7793-clock.h
include/dt-bindings/clock/r8a7793-cpg-mssr.h
include/dt-bindings/clock/r8a7794-clock.h
include/dt-bindings/clock/r8a7794-cpg-mssr.h
include/dt-bindings/clock/r8a7795-cpg-mssr.h
include/dt-bindings/clock/r8a7796-cpg-mssr.h
include/dt-bindings/clock/r8a77995-cpg-mssr.h
include/dt-bindings/dma/k3-udma.h [new file with mode: 0644]
include/dt-bindings/pinctrl/at91.h
include/efi_api.h
include/efi_loader.h
include/environment/ti/nand.h [new file with mode: 0644]
include/ext4fs.h
include/fdtdec.h
include/fs.h
include/i2c.h
include/linux/soc/ti/cppi5.h [new file with mode: 0644]
include/linux/soc/ti/k3-navss-ringacc.h [new file with mode: 0644]
include/linux/soc/ti/ti-udma.h [new file with mode: 0644]
include/linux/soc/ti/ti_sci_protocol.h
include/net.h
include/watchdog.h
lib/Kconfig
lib/efi_loader/efi_bootmgr.c
lib/efi_loader/efi_boottime.c
lib/efi_loader/efi_console.c
lib/efi_loader/efi_file.c
lib/efi_loader/efi_image_loader.c
lib/efi_loader/efi_memory.c
lib/efi_loader/efi_setup.c
lib/efi_loader/efi_variable.c
lib/efi_selftest/efi_selftest_miniapp_exit.c
lib/fdtdec.c
scripts/Makefile.spl
scripts/config_whitelist.txt
test/py/tests/test_efi_selftest.py
test/py/tests/test_fs/conftest.py
test/py/tests/test_fs/fstest_defs.py
test/py/tests/test_fs/fstest_helpers.py [new file with mode: 0644]
test/py/tests/test_fs/test_basic.py
test/py/tests/test_fs/test_ext.py
test/py/tests/test_fs/test_mkdir.py
test/py/tests/test_fs/test_symlink.py [new file with mode: 0644]
test/py/tests/test_fs/test_unlink.py
test/py/tests/test_mmc_rd.py
tools/kwbimage.c

diff --git a/Kconfig b/Kconfig
index 305b265ed7134aaf6b3198de6c90e6c9b91aa133..7a5491bd6775b5d0420777f6cb1a42790940cc09 100644 (file)
--- a/Kconfig
+++ b/Kconfig
@@ -224,6 +224,16 @@ config BUILD_ROM
          which are not shipped in the U-Boot source tree.
          Please, see doc/README.x86 for details.
 
+config SPL_IMAGE
+       string "SPL image used in the combined SPL+U-Boot image"
+       default "spl/boot.bin" if ARCH_AT91 && SPL_NAND_SUPPORT
+       default "spl/u-boot-spl.bin"
+       help
+         Select the SPL build target that shall be generated by the SPL
+         build process (default spl/u-boot-spl.bin). This image will be
+         used to generate a combined image with SPL and main U-Boot
+         proper as one single image.
+
 config BUILD_TARGET
        string "Build target special images"
        default "u-boot-with-spl.sfp" if TARGET_SOCFPGA_ARRIA10
@@ -232,6 +242,7 @@ config BUILD_TARGET
        default "u-boot-elf.srec" if RCAR_GEN3
        default "u-boot.itb" if SPL_LOAD_FIT && ARCH_SUNXI
        default "u-boot.kwb" if KIRKWOOD
+       default "u-boot-with-spl.bin" if ARCH_AT91 && SPL_NAND_SUPPORT
        help
          Some SoCs need special image types (e.g. U-Boot binary
          with a special header) as build targets. By defining
index aedc2ea4d93b9277be66e97d3197f4b732dbe106..2824a6e159440c9475d76fdfcdf40915dfa03b80 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -945,11 +945,22 @@ ifneq ($(CONFIG_DM_USB)$(CONFIG_OF_CONTROL)$(CONFIG_BLK),yyy)
        @echo >&2 "===================================================="
 endif
 endif
-ifeq ($(CONFIG_LIBATA)$(CONFIG_MVSATA_IDE),y)
-ifneq ($(CONFIG_DM_SCSI),y)
+ifeq ($(CONFIG_MVSATA_IDE),y)
        @echo >&2 "===================== WARNING ======================"
-       @echo >&2 "This board does not use CONFIG_DM_SCSI. Please update"
-       @echo >&2 "the storage controller to use CONFIG_DM_SCSI before the v2019.07 release."
+       @echo >&2 "This board does use CONFIG_MVSATA_IDE which is not"
+       @echo >&2 "ported to driver-model (DM) yet. Please update the storage"
+       @echo >&2 "controller driver to use CONFIG_AHCI before the v2019.07"
+       @echo >&2 "release."
+       @echo >&2 "Failure to update by the deadline may result in board removal."
+       @echo >&2 "See doc/driver-model/MIGRATION.txt for more info."
+       @echo >&2 "===================================================="
+endif
+ifeq ($(CONFIG_LIBATA),y)
+ifneq ($(CONFIG_AHCI),y)
+       @echo >&2 "===================== WARNING ======================"
+       @echo >&2 "This board does use CONFIG_LIBATA but has CONFIG_AHCI not"
+       @echo >&2 "enabled. Please update the storage controller driver to use"
+       @echo >&2 "CONFIG_AHCI before the v2019.07 release."
        @echo >&2 "Failure to update by the deadline may result in board removal."
        @echo >&2 "See doc/driver-model/MIGRATION.txt for more info."
        @echo >&2 "===================================================="
@@ -1020,6 +1031,20 @@ quiet_cmd_copy = COPY    $@
 
 ifeq ($(CONFIG_MULTI_DTB_FIT),y)
 
+ifeq ($(CONFIG_MULTI_DTB_FIT_LZO),y)
+FINAL_DTB_CONTAINER = fit-dtb.blob.lzo
+else ifeq ($(CONFIG_MULTI_DTB_FIT_GZIP),y)
+FINAL_DTB_CONTAINER = fit-dtb.blob.gz
+else
+FINAL_DTB_CONTAINER = fit-dtb.blob
+endif
+
+fit-dtb.blob.gz: fit-dtb.blob
+       @gzip -kf9 $< > $@
+
+fit-dtb.blob.lzo: fit-dtb.blob
+       @lzop -f9 $< > $@
+
 fit-dtb.blob: dts/dt.dtb FORCE
        $(call if_changed,mkimage)
 
@@ -1027,7 +1052,7 @@ MKIMAGEFLAGS_fit-dtb.blob = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
        -a 0 -e 0 -E \
        $(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) -d /dev/null
 
-u-boot-fit-dtb.bin: u-boot-nodtb.bin fit-dtb.blob
+u-boot-fit-dtb.bin: u-boot-nodtb.bin $(FINAL_DTB_CONTAINER)
        $(call if_changed,cat)
 
 u-boot.bin: u-boot-fit-dtb.bin FORCE
@@ -1232,9 +1257,11 @@ else
 SPL_PAYLOAD := u-boot.bin
 endif
 
+SPL_IMAGE := $(CONFIG_SPL_IMAGE:"%"=%)
+
 OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \
                                   --pad-to=$(CONFIG_SPL_PAD_TO)
-u-boot-with-spl.bin: spl/u-boot-spl.bin $(SPL_PAYLOAD) FORCE
+u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
        $(call if_changed,pad_cat)
 
 ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
diff --git a/README b/README
index c9a20db34f726986ccbb3c34fbc58e92b2d47a25..a514f48caefc68b8453b8cc7ce0da3581f3504a8 100644 (file)
--- a/README
+++ b/README
@@ -767,9 +767,6 @@ The following options need to be configured:
                SoC, then define this variable and provide board
                specific code for the "hw_watchdog_reset" function.
 
-               CONFIG_AT91_HW_WDT_TIMEOUT
-               specify the timeout in seconds. default 2 seconds.
-
 - Real-Time Clock:
 
                When CONFIG_CMD_DATE is selected, the type of the RTC
index 4a23e327dfb486e041038ae3c34f53bec65a87d2..398dbef1cb834d539cd4654254cacf8de9b0796f 100644 (file)
@@ -1464,6 +1464,21 @@ config TI_SECURE_DEVICE
          authenticated) and the code. See the doc/README.ti-secure
          file for further details.
 
+if AM43XX || AM33XX || OMAP54XX || ARCH_KEYSTONE
+config ISW_ENTRY_ADDR
+       hex "Address in memory or XIP address of bootloader entry point"
+       default 0x402F4000 if AM43XX
+       default 0x402F0400 if AM33XX
+       default 0x40301350 if OMAP54XX
+       help
+         After any reset, the boot ROM searches the boot media for a valid
+         boot image. For non-XIP devices, the ROM then copies the image into
+         internal memory. For all boot modes, after the ROM processes the
+         boot image it eventually computes the entry point address depending
+         on the device type (secure/non-secure), boot media (xip/non-xip) and
+         image headers.
+endif
+
 source "arch/arm/mach-aspeed/Kconfig"
 
 source "arch/arm/mach-at91/Kconfig"
@@ -1563,6 +1578,7 @@ source "arch/arm/cpu/armv8/Kconfig"
 source "arch/arm/mach-imx/Kconfig"
 
 source "board/bosch/shc/Kconfig"
+source "board/bosch/guardian/Kconfig"
 source "board/CarMediaLab/flea3/Kconfig"
 source "board/Marvell/aspenite/Kconfig"
 source "board/Marvell/gplugd/Kconfig"
index e6ee98e05c9d559a1213149e880c07de2bad22a0..e3633f5954e4436f584e9734ce8cb2742eaad2aa 100644 (file)
@@ -138,7 +138,7 @@ dtb-$(CONFIG_ARCH_MVEBU) +=                 \
        armada-388-clearfog.dtb                 \
        armada-388-gp.dtb                       \
        armada-388-helios4.dtb                  \
-       armada-385-amc.dtb                      \
+       armada-385-db-88f6820-amc.dtb           \
        armada-385-turris-omnia.dtb             \
        armada-7040-db.dtb                      \
        armada-7040-db-nand.dtb                 \
@@ -151,7 +151,8 @@ dtb-$(CONFIG_ARCH_MVEBU) +=                 \
        armada-xp-theadorable.dtb               \
        armada-38x-controlcenterdc.dtb          \
        armada-385-atl-x530.dtb                 \
-       armada-385-atl-x530DP.dtb
+       armada-385-atl-x530DP.dtb               \
+       armada-xp-db-xc3-24g4xg.dtb
 
 dtb-$(CONFIG_ARCH_UNIPHIER_LD11) += \
        uniphier-ld11-global.dtb \
@@ -251,7 +252,8 @@ dtb-$(CONFIG_AM33XX) += \
        am335x-pdu001.dtb \
        am335x-chiliboard.dtb \
        am335x-sl50.dtb \
-       am335x-base0033.dtb
+       am335x-base0033.dtb \
+       am335x-guardian.dtb
 dtb-$(CONFIG_AM43XX) += am437x-gp-evm.dtb am437x-sk-evm.dtb    \
        am43x-epos-evm.dtb \
        am437x-idk-evm.dtb \
@@ -568,6 +570,7 @@ dtb-$(CONFIG_RCAR_GEN3) += \
        r8a7795-salvator-x-u-boot.dtb \
        r8a7796-m3ulcb-u-boot.dtb \
        r8a7796-salvator-x-u-boot.dtb \
+       r8a77965-m3nulcb-u-boot.dtb \
        r8a77965-salvator-x-u-boot.dtb \
        r8a77970-eagle-u-boot.dtb \
        r8a77990-ebisu-u-boot.dtb \
@@ -599,6 +602,8 @@ dtb-$(CONFIG_TARGET_AT91SAM9260EK) += \
 
 dtb-$(CONFIG_TARGET_AT91SAM9M10G45EK) += at91sam9m10g45ek.dtb
 
+dtb-$(CONFIG_TARGET_PM9G45) += at91sam9m10g45ek.dtb
+
 dtb-$(CONFIG_TARGET_AT91SAM9X5EK) += \
        at91sam9g15ek.dtb       \
        at91sam9g25ek.dtb       \
@@ -608,6 +613,9 @@ dtb-$(CONFIG_TARGET_AT91SAM9X5EK) += \
 
 dtb-$(CONFIG_TARGET_AT91SAM9N12EK) += at91sam9n12ek.dtb
 
+dtb-$(CONFIG_TARGET_GARDENA_SMART_GATEWAY_AT91SAM) += \
+       at91sam9g25-gardena-smart-gateway.dtb
+
 dtb-$(CONFIG_TARGET_ETHERNUT5) += ethernut5.dtb
 
 dtb-$(CONFIG_TARGET_USB_A9263) += usb_a9263.dtb
diff --git a/arch/arm/dts/am335x-guardian-u-boot.dtsi b/arch/arm/dts/am335x-guardian-u-boot.dtsi
new file mode 100644 (file)
index 0000000..156b9b0
--- /dev/null
@@ -0,0 +1,66 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018 EETS GmbH - https://www.eets.ch/
+ * Copyright (C) 2018 Robert Bosch Power Tools GmbH
+ */
+
+/ {
+       ocp {
+               u-boot,dm-pre-reloc;
+       };
+};
+
+&l4_wkup {
+       u-boot,dm-pre-reloc;
+};
+
+&mmc1 {
+       u-boot,dm-pre-reloc;
+};
+
+&mmc1_pins {
+       u-boot,dm-pre-reloc;
+};
+
+&rtc {
+       clocks = <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>;
+       clock-names = "int-clk";
+};
+
+&scm {
+       u-boot,dm-pre-reloc;
+};
+
+&uart0 {
+       u-boot,dm-pre-reloc;
+};
+
+&uart0_pins {
+       u-boot,dm-pre-reloc;
+};
+
+&usb {
+       u-boot,dm-pre-reloc;
+};
+
+&usb_ctrl_mod {
+       u-boot,dm-pre-reloc;
+};
+
+&usb0 {
+       u-boot,dm-pre-reloc;
+};
+
+&usb0_phy {
+       u-boot,dm-pre-reloc;
+};
+
+&am33xx_pinmux {
+       u-boot,dm-pre-reloc;
+
+       lcd0_pins: pinmux_lcd0_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x908, PIN_OUTPUT_PULLUP   | MUX_MODE7)
+               >;
+       };
+};
diff --git a/arch/arm/dts/am335x-guardian.dts b/arch/arm/dts/am335x-guardian.dts
new file mode 100644 (file)
index 0000000..f3f022c
--- /dev/null
@@ -0,0 +1,509 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2018 Robert Bosch Power Tools GmbH
+ */
+/dts-v1/;
+
+#include "am33xx.dtsi"
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+/ {
+       model = "Bosch AM335x Guardian";
+       compatible = "bosch,am335x-guardian", "ti,am33xx";
+
+       chosen {
+               stdout-path = &uart0;
+               tick-timer = &timer2;
+       };
+
+       cpus {
+               cpu@0 {
+                       cpu0-supply = <&dcdc2_reg>;
+               };
+       };
+
+       memory@80000000 {
+               device_type = "memory";
+               reg = <0x80000000 0x10000000>; /* 256 MB */
+       };
+
+       gpio_keys {
+               compatible = "gpio-keys";
+               pinctrl-names = "default";
+               pinctrl-0 = <&gpio_keys_pins>;
+
+               button21 {
+                       label = "guardian-power-button";
+                       linux,code = <KEY_POWER>;
+                       gpios = <&gpio2 21 0>;
+                       wakeup-source;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&leds_pins>;
+
+               led1 {
+                       label = "green:heartbeat";
+                       gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "heartbeat";
+                       default-state = "off";
+               };
+
+               led2 {
+                       label = "green:mmc0";
+                       gpios = <&gpio1 26 GPIO_ACTIVE_HIGH>;
+                       linux,default-trigger = "mmc0";
+                       default-state = "off";
+               };
+       };
+
+       panel {
+               compatible = "ti,tilcdc,panel";
+               pinctrl-names = "default", "sleep";
+               pinctrl-0 = <&lcd_pins_default &lcd_disen_pins>;
+               pinctrl-1 = <&lcd_pins_sleep>;
+
+               display-timings {
+                       320x240 {
+                               hactive         = <320>;
+                               vactive         = <240>;
+                               hback-porch     = <68>;
+                               hfront-porch    = <20>;
+                               hsync-len       = <1>;
+                               vback-porch     = <18>;
+                               vfront-porch    = <4>;
+                               vsync-len       = <1>;
+                               clock-frequency = <9000000>;
+                               hsync-active    = <0>;
+                               vsync-active    = <0>;
+                       };
+               };
+               panel-info {
+                       ac-bias           = <255>;
+                       ac-bias-intrpt    = <0>;
+                       dma-burst-sz      = <16>;
+                       bpp               = <24>;
+                       bus-width         = <16>;
+                       fdd               = <0x80>;
+                       sync-edge         = <0>;
+                       sync-ctrl         = <1>;
+                       raster-order      = <0>;
+                       fifo-th           = <0>;
+               };
+
+       };
+
+       pwm7: dmtimer-pwm {
+               compatible = "ti,omap-dmtimer-pwm";
+               ti,timers = <&timer7>;
+               pinctrl-names = "default";
+               pinctrl-0 = <&dmtimer7_pins>;
+       };
+
+       vmmcsd_fixed: regulator-3v3 {
+               compatible = "regulator-fixed";
+               regulator-name = "vmmcsd_fixed";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+       };
+};
+
+&cppi41dma  {
+       status = "okay";
+};
+
+&elm {
+       status = "okay";
+};
+
+&gpmc {
+       pinctrl-names = "default";
+       pinctrl-0 = <&nandflash_pins>;
+       ranges = <0 0 0x08000000 0x1000000>;  /* CS0: 16MB for NAND */
+       status = "okay";
+
+       nand@0,0 {
+               compatible = "ti,omap2-nand";
+               reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
+               interrupt-parent = <&gpmc>;
+               interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
+                            <1 IRQ_TYPE_NONE>; /* termcount */
+               rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */
+               ti,nand-ecc-opt = "bch16";
+               ti,elm-id = <&elm>;
+               nand-bus-width = <8>;
+               gpmc,device-width = <1>;
+               gpmc,sync-clk-ps = <0>;
+               gpmc,cs-on-ns = <0>;
+               gpmc,cs-rd-off-ns = <44>;
+               gpmc,cs-wr-off-ns = <44>;
+               gpmc,adv-on-ns = <6>;
+               gpmc,adv-rd-off-ns = <34>;
+               gpmc,adv-wr-off-ns = <44>;
+               gpmc,we-on-ns = <0>;
+               gpmc,we-off-ns = <40>;
+               gpmc,oe-on-ns = <0>;
+               gpmc,oe-off-ns = <54>;
+               gpmc,access-ns = <64>;
+               gpmc,rd-cycle-ns = <82>;
+               gpmc,wr-cycle-ns = <82>;
+               gpmc,bus-turnaround-ns = <0>;
+               gpmc,cycle2cycle-delay-ns = <0>;
+               gpmc,clk-activation-ns = <0>;
+               gpmc,wr-access-ns = <40>;
+               gpmc,wr-data-mux-bus-ns = <0>;
+
+               /*
+                * MTD partition table
+                *
+                * All SPL-* partitions are sized to minimal length which can
+                * be independently programmable. For NAND flash this is equal
+                * to size of erase-block.
+                */
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               partition@0 {
+                       label = "SPL";
+                       reg = <0x0 0x40000>;
+               };
+
+               partition@1 {
+                       label = "SPL.backup1";
+                       reg = <0x40000  0x40000>;
+               };
+
+               partition@2 {
+                       label = "SPL.backup2";
+                       reg = <0x80000  0x40000>;
+               };
+
+               partition@3 {
+                       label = "SPL.backup3";
+                       reg = <0xc0000  0x40000>;
+               };
+
+               partition@4 {
+                       label = "u-boot";
+                       reg = <0x100000 0x100000>;
+               };
+
+               partition@5 {
+                       label = "u-boot.backup1";
+                       reg = <0x200000 0x100000>;
+               };
+
+               partition@6 {
+                       label = "u-boot-env";
+                       reg = <0x300000 0x40000>;
+               };
+
+               partition@7 {
+                       label = "u-boot-env.backup1";
+                       reg = <0x340000 0x40000>;
+               };
+
+               partition@8 {
+                       label = "UBI";
+                       reg = <0x380000 0x1fc80000>;
+               };
+       };
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins>;
+       clock-frequency = <400000>;
+       status = "okay";
+
+       tps: tps@24 {
+               reg = <0x24>;
+       };
+};
+
+&lcdc {
+       blue-and-red-wiring = "crossed";
+       status = "okay";
+};
+
+&mmc1 {
+       bus-width = <0x4>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc1_pins>;
+       cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
+       vmmc-supply = <&vmmcsd_fixed>;
+       status = "okay";
+};
+
+&rtc {
+       clocks = <&clk_32768_ck>, <&clk_24mhz_clkctrl AM3_CLK_24MHZ_CLKDIV32K_CLKCTRL 0>;
+       clock-names = "ext-clk", "int-clk";
+       system-power-controller;
+};
+
+&spi0 {
+       ti,pindir-d0-out-d1-in;
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi0_pins>;
+       status = "okay";
+};
+
+/include/ "tps65217.dtsi"
+
+&tps {
+       ti,pmic-shutdown-controller;
+       interrupt-parent = <&intc>;
+       interrupts = <7>; /* NMI */
+
+       backlight {
+               isel = <1>;  /* 1 - ISET1, 2 ISET2 */
+               fdim = <100>; /* TPS65217_BL_FDIM_100HZ */
+               default-brightness = <100>;
+       };
+
+       regulators {
+               dcdc1_reg: regulator@0 {
+                       regulator-name = "vdds_dpr";
+                       regulator-always-on;
+               };
+
+               dcdc2_reg: regulator@1 {
+                       regulator-name = "vdd_mpu";
+                       regulator-min-microvolt = <925000>;
+                       regulator-max-microvolt = <1351500>;
+                       regulator-boot-on;
+                       regulator-always-on;
+               };
+
+               dcdc3_reg: regulator@2 {
+                       regulator-name = "vdd_core";
+                       regulator-min-microvolt = <925000>;
+                       regulator-max-microvolt = <1150000>;
+                       regulator-boot-on;
+                       regulator-always-on;
+               };
+
+               ldo1_reg: regulator@3 {
+                       regulator-name = "vio,vrtc,vdds";
+                       regulator-always-on;
+               };
+
+               ldo2_reg: regulator@4 {
+                       regulator-name = "vdd_3v3aux";
+                       regulator-always-on;
+               };
+
+               ldo3_reg: regulator@5 {
+                       regulator-name = "vdd_1v8";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+                       regulator-always-on;
+               };
+
+               ldo4_reg: regulator@6 {
+                       regulator-name = "vdd_3v3a";
+                       regulator-always-on;
+               };
+       };
+};
+
+&tscadc {
+       status = "okay";
+
+       adc {
+               ti,adc-channels = <0 1 2 3 4 5 6>;
+       };
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins>;
+       status = "okay";
+};
+
+&usb {
+       status = "okay";
+};
+
+&usb_ctrl_mod {
+       status = "okay";
+};
+
+&usb0 {
+       dr_mode = "peripheral";
+       status = "okay";
+};
+
+&usb0_phy {
+       status = "okay";
+};
+
+&usb1 {
+       dr_mode = "host";
+       status = "okay";
+};
+
+&usb1_phy {
+       status = "okay";
+};
+
+&am33xx_pinmux {
+       pinctrl-names = "default";
+       pinctrl-0 = <&clkout2_pin &gpio_pins>;
+
+       clkout2_pin: pinmux_clkout2_pin {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x9b4, PIN_OUTPUT_PULLDOWN | MUX_MODE3)
+               >;
+       };
+
+       dmtimer7_pins: pinmux_dmtimer7_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x968, PIN_OUTPUT | MUX_MODE5)
+               >;
+       };
+
+       gpio_keys_pins: pinmux_gpio_keys_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x940, PIN_INPUT | MUX_MODE7)
+               >;
+       };
+
+       gpio_pins: pinmux_gpio_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x928, PIN_OUTPUT | MUX_MODE7)
+                       AM33XX_IOPAD(0x990, PIN_OUTPUT | MUX_MODE7)
+               >;
+       };
+
+       i2c0_pins: pinmux_i2c0_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0)
+                       AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0)
+               >;
+       };
+
+       lcd_disen_pins: pinmux_lcd_disen_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x9a4, PIN_OUTPUT_PULLUP | SLEWCTRL_SLOW | MUX_MODE7)
+               >;
+       };
+
+       lcd_pins_default: pinmux_lcd_pins_default {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x820, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1)
+                       AM33XX_IOPAD(0x824, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1)
+                       AM33XX_IOPAD(0x828, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1)
+                       AM33XX_IOPAD(0x82c, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1)
+                       AM33XX_IOPAD(0x830, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1)
+                       AM33XX_IOPAD(0x834, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1)
+                       AM33XX_IOPAD(0x838, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1)
+                       AM33XX_IOPAD(0x83c, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE1)
+                       AM33XX_IOPAD(0x8a0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8a4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8a8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8ac, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8b0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8b4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8b8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8bc, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8c0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8c4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8c8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8cc, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8d0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8d4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8d8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8dc, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8e0, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8e4, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8e8, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+                       AM33XX_IOPAD(0x8ec, PIN_OUTPUT | SLEWCTRL_SLOW | MUX_MODE0)
+               >;
+       };
+
+       lcd_pins_sleep: pinmux_lcd_pins_sleep {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x8a0, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8a4, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8a8, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8ac, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8b0, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8b4, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8b8, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8bc, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8c0, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8c4, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8c8, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8cc, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8d0, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8d4, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8d8, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8dc, PULL_DISABLE | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8e0, PIN_INPUT_PULLDOWN | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8e4, PIN_INPUT_PULLDOWN | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8e8, PIN_INPUT_PULLDOWN | SLEWCTRL_SLOW | MUX_MODE7)
+                       AM33XX_IOPAD(0x8ec, PIN_INPUT_PULLDOWN | SLEWCTRL_SLOW | MUX_MODE7)
+               >;
+       };
+
+       leds_pins: pinmux_leds_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x868, PIN_OUTPUT | MUX_MODE7)
+                       AM33XX_IOPAD(0x86c, PIN_OUTPUT | MUX_MODE7)
+               >;
+       };
+
+       mmc1_pins: pinmux_mmc1_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x8f0, PIN_INPUT_PULLUP | MUX_MODE0)
+                       AM33XX_IOPAD(0x8f4, PIN_INPUT_PULLUP | MUX_MODE0)
+                       AM33XX_IOPAD(0x8f8, PIN_INPUT_PULLUP | MUX_MODE0)
+                       AM33XX_IOPAD(0x8fc, PIN_INPUT_PULLUP | MUX_MODE0)
+                       AM33XX_IOPAD(0x900, PIN_INPUT_PULLUP | MUX_MODE0)
+                       AM33XX_IOPAD(0x904, PIN_INPUT_PULLUP | MUX_MODE0)
+                       AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7)
+               >;
+       };
+
+       spi0_pins: pinmux_spi0_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x950, PIN_OUTPUT_PULLDOWN | MUX_MODE0)
+                       AM33XX_IOPAD(0x954, PIN_OUTPUT_PULLUP | MUX_MODE0)
+                       AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE0)
+                       AM33XX_IOPAD(0x95c, PIN_OUTPUT_PULLUP | MUX_MODE0)
+               >;
+       };
+
+       uart0_pins: pinmux_uart0_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x970, PIN_INPUT_PULLUP | MUX_MODE0)
+                       AM33XX_IOPAD(0x974, PIN_OUTPUT_PULLDOWN | MUX_MODE0)
+               >;
+       };
+
+       nandflash_pins: pinmux_nandflash_pins {
+               pinctrl-single,pins = <
+                       AM33XX_IOPAD(0x800, PIN_INPUT | MUX_MODE0)
+                       AM33XX_IOPAD(0x804, PIN_INPUT | MUX_MODE0)
+                       AM33XX_IOPAD(0x808, PIN_INPUT | MUX_MODE0)
+                       AM33XX_IOPAD(0x80c, PIN_INPUT | MUX_MODE0)
+                       AM33XX_IOPAD(0x810, PIN_INPUT | MUX_MODE0)
+                       AM33XX_IOPAD(0x814, PIN_INPUT | MUX_MODE0)
+                       AM33XX_IOPAD(0x818, PIN_INPUT | MUX_MODE0)
+                       AM33XX_IOPAD(0x81c, PIN_INPUT | MUX_MODE0)
+                       AM33XX_IOPAD(0x870, PIN_INPUT | MUX_MODE0)
+                       AM33XX_IOPAD(0x874, PIN_OUTPUT | MUX_MODE0)
+                       AM33XX_IOPAD(0x87c, PIN_OUTPUT | MUX_MODE0)
+                       AM33XX_IOPAD(0x890, PIN_OUTPUT | MUX_MODE0)
+                       AM33XX_IOPAD(0x894, PIN_OUTPUT | MUX_MODE0)
+                       AM33XX_IOPAD(0x898, PIN_OUTPUT | MUX_MODE0)
+                       AM33XX_IOPAD(0x89c, PIN_OUTPUT | MUX_MODE0)
+               >;
+       };
+};
index 0b2a78d393010fbdbfb400ddad63a4dba2d9ff18..e4c35d4e98f4d3078fd2266c1332cbfeae44030b 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
  * Device Tree Include file for Marvell Armada 370 and Armada XP SoC
  *
@@ -8,50 +9,10 @@
  * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  * Ben Dooks <ben.dooks@codethink.co.uk>
  *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This file is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU General Public License as
- *     published by the Free Software Foundation; either version 2 of the
- *     License, or (at your option) any later version.
- *
- *     This file is distributed in the hope that it will be useful
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- * Or, alternatively
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
- *
  * This file contains the definitions that are common to the Armada
  * 370 and Armada XP SoC.
  */
 
-/include/ "skeleton64.dtsi"
-
 #define MBUS_ID(target,attributes) (((target) << 24) | ((attributes) << 16))
 
 / {
@@ -86,7 +47,7 @@
                pcie-mem-aperture = <0xf8000000 0x7e00000>;
                pcie-io-aperture  = <0xffe00000 0x100000>;
 
-               devbus-bootcs {
+               devbus_bootcs: devbus-bootcs {
                        compatible = "marvell,mvebu-devbus";
                        reg = <MBUS_ID(0xf0, 0x01) 0x10400 0x8>;
                        ranges = <0 MBUS_ID(0x01, 0x2f) 0 0xffffffff>;
@@ -96,7 +57,7 @@
                        status = "disabled";
                };
 
-               devbus-cs0 {
+               devbus_cs0: devbus-cs0 {
                        compatible = "marvell,mvebu-devbus";
                        reg = <MBUS_ID(0xf0, 0x01) 0x10408 0x8>;
                        ranges = <0 MBUS_ID(0x01, 0x3e) 0 0xffffffff>;
                        status = "disabled";
                };
 
-               devbus-cs1 {
+               devbus_cs1: devbus-cs1 {
                        compatible = "marvell,mvebu-devbus";
                        reg = <MBUS_ID(0xf0, 0x01) 0x10410 0x8>;
                        ranges = <0 MBUS_ID(0x01, 0x3d) 0 0xffffffff>;
                        status = "disabled";
                };
 
-               devbus-cs2 {
+               devbus_cs2: devbus-cs2 {
                        compatible = "marvell,mvebu-devbus";
                        reg = <MBUS_ID(0xf0, 0x01) 0x10418 0x8>;
                        ranges = <0 MBUS_ID(0x01, 0x3b) 0 0xffffffff>;
                        status = "disabled";
                };
 
-               devbus-cs3 {
+               devbus_cs3: devbus-cs3 {
                        compatible = "marvell,mvebu-devbus";
                        reg = <MBUS_ID(0xf0, 0x01) 0x10420 0x8>;
                        ranges = <0 MBUS_ID(0x01, 0x37) 0 0xffffffff>;
                        #address-cells = <1>;
                        #size-cells = <1>;
                        ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>;
-                       u-boot,dm-pre-reloc;
 
-                       rtc@10300 {
+                       rtc: rtc@10300 {
                                compatible = "marvell,orion-rtc";
                                reg = <0x10300 0x20>;
                                interrupts = <50>;
                        };
 
-                       spi0: spi@10600 {
-                               reg = <0x10600 0x28>;
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-                               cell-index = <0>;
-                               interrupts = <30>;
-                               clocks = <&coreclk 0>;
-                               status = "disabled";
-                       };
-
-                       spi1: spi@10680 {
-                               reg = <0x10680 0x28>;
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-                               cell-index = <1>;
-                               interrupts = <92>;
-                               clocks = <&coreclk 0>;
-                               status = "disabled";
-                       };
-
                        i2c0: i2c@11000 {
                                compatible = "marvell,mv64xxx-i2c";
                                #address-cells = <1>;
                                msi-controller;
                        };
 
-                       coherency-fabric@20200 {
+                       coherencyfab: coherency-fabric@20200 {
                                compatible = "marvell,coherency-fabric";
                                reg = <0x20200 0xb0>, <0x21010 0x1c>;
                        };
 
-                       timer@20300 {
+                       timer: timer@20300 {
                                reg = <0x20300 0x30>, <0x21040 0x30>;
                                interrupts = <37>, <38>, <39>, <40>, <5>, <6>;
                        };
 
-                       watchdog@20300 {
+                       watchdog: watchdog@20300 {
                                reg = <0x20300 0x34>, <0x20704 0x4>;
                        };
 
-                       pmsu@22000 {
+                       cpurst: cpurst@20800 {
+                               compatible = "marvell,armada-370-cpu-reset";
+                               reg = <0x20800 0x8>;
+                       };
+
+                       pmsu: pmsu@22000 {
                                compatible = "marvell,armada-370-pmsu";
                                reg = <0x22000 0x1000>;
                        };
 
-                       usb@50000 {
+                       usb0: usb@50000 {
                                compatible = "marvell,orion-ehci";
                                reg = <0x50000 0x500>;
                                interrupts = <45>;
                                status = "disabled";
                        };
 
-                       usb@51000 {
+                       usb1: usb@51000 {
                                compatible = "marvell,orion-ehci";
                                reg = <0x51000 0x500>;
                                interrupts = <46>;
                                status = "disabled";
                        };
 
-                       mdio: mdio {
+                       mdio: mdio@72004 {
                                #address-cells = <1>;
                                #size-cells = <0>;
                                compatible = "marvell,orion-mdio";
                                status = "disabled";
                        };
 
-                       sata@a0000 {
+                       sata: sata@a0000 {
                                compatible = "marvell,armada-370-sata";
                                reg = <0xa0000 0x5000>;
                                interrupts = <55>;
                                status = "disabled";
                        };
 
-                       mvsdio@d4000 {
+                       sdio: mvsdio@d4000 {
                                compatible = "marvell,orion-sdio";
                                reg = <0xd4000 0x200>;
                                interrupts = <54>;
                                status = "disabled";
                        };
                };
+
+               spi0: spi@10600 {
+                       reg = <MBUS_ID(0xf0, 0x01) 0x10600 0x28>, /* control */
+                             <MBUS_ID(0x01, 0x1e) 0 0xffffffff>, /* CS0 */
+                             <MBUS_ID(0x01, 0x5e) 0 0xffffffff>, /* CS1 */
+                             <MBUS_ID(0x01, 0x9e) 0 0xffffffff>, /* CS2 */
+                             <MBUS_ID(0x01, 0xde) 0 0xffffffff>, /* CS3 */
+                             <MBUS_ID(0x01, 0x1f) 0 0xffffffff>, /* CS4 */
+                             <MBUS_ID(0x01, 0x5f) 0 0xffffffff>, /* CS5 */
+                             <MBUS_ID(0x01, 0x9f) 0 0xffffffff>, /* CS6 */
+                             <MBUS_ID(0x01, 0xdf) 0 0xffffffff>; /* CS7 */
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       cell-index = <0>;
+                       interrupts = <30>;
+                       clocks = <&coreclk 0>;
+                       status = "disabled";
+               };
+
+               spi1: spi@10680 {
+                       reg = <MBUS_ID(0xf0, 0x01) 0x10680 0x28>, /* control */
+                             <MBUS_ID(0x01, 0x1a) 0 0xffffffff>, /* CS0 */
+                             <MBUS_ID(0x01, 0x5a) 0 0xffffffff>, /* CS1 */
+                             <MBUS_ID(0x01, 0x9a) 0 0xffffffff>, /* CS2 */
+                             <MBUS_ID(0x01, 0xda) 0 0xffffffff>, /* CS3 */
+                             <MBUS_ID(0x01, 0x1b) 0 0xffffffff>, /* CS4 */
+                             <MBUS_ID(0x01, 0x5b) 0 0xffffffff>, /* CS5 */
+                             <MBUS_ID(0x01, 0x9b) 0 0xffffffff>, /* CS6 */
+                             <MBUS_ID(0x01, 0xdb) 0 0xffffffff>; /* CS7 */
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       cell-index = <1>;
+                       interrupts = <92>;
+                       clocks = <&coreclk 0>;
+                       status = "disabled";
+               };
        };
 
        clocks {
diff --git a/arch/arm/dts/armada-385-amc.dts b/arch/arm/dts/armada-385-amc.dts
deleted file mode 100644 (file)
index c9ccbb5..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Device Tree file for Marvell Armada 385 development board
- * (DB-88F6820-AMC)
- *
- * Copyright (C) 2014 Marvell
- *
- * Gregory CLEMENT <gregory.clement@free-electrons.com>
- *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This file is licensed under the terms of the GNU General Public
- *     License version 2.  This program is licensed "as is" without
- *     any warranty of any kind, whether express or implied.
- *
- * Or, alternatively,
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use,
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/dts-v1/;
-#include "armada-385.dtsi"
-#include <dt-bindings/gpio/gpio.h>
-
-/ {
-       model = "Marvell Armada 385 AMC";
-       compatible = "marvell,a385-amc", "marvell,armada385", "marvell,armada380";
-
-       chosen {
-               stdout-path = "serial0:115200n8";
-       };
-
-       aliases {
-               ethernet0 = &eth0;
-               ethernet1 = &eth2;
-               i2c0 = &i2c0;
-               spi1 = &spi1;
-       };
-
-       memory {
-               device_type = "memory";
-               reg = <0x00000000 0x80000000>; /* 2 GB */
-       };
-
-       soc {
-               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
-                         MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
-
-               internal-regs {
-                       i2c@11000 {
-                               clock-frequency = <100000>;
-                               u-boot,i2c-slave-addr = <0x0>;
-                               pinctrl-names = "default";
-                               pinctrl-0 = <&i2c0_pins>;
-                               status = "okay";
-                       };
-
-                       serial@12000 {
-                               /*
-                                * Exported on the micro USB connector CON16
-                                * through an FTDI
-                                */
-
-                               pinctrl-names = "default";
-                               pinctrl-0 = <&uart0_pins>;
-                               status = "okay";
-                               u-boot,dm-pre-reloc;
-                       };
-
-                       ethernet@34000 {
-                               status = "okay";
-                               phy = <&phy1>;
-                               phy-mode = "sgmii";
-                       };
-
-                       usb@58000 {
-                               status = "okay";
-                       };
-
-                       ethernet@70000 {
-                               pinctrl-names = "default";
-                               /*
-                                * The Reference Clock 0 is used to provide a
-                                * clock to the PHY
-                                */
-                               pinctrl-0 = <&ge0_rgmii_pins>, <&ref_clk0_pins>;
-                               status = "okay";
-                               phy = <&phy0>;
-                               phy-mode = "rgmii-id";
-                       };
-
-
-                       mdio@72004 {
-                               pinctrl-names = "default";
-                               pinctrl-0 = <&mdio_pins>;
-
-                               phy0: ethernet-phy@1 {
-                                       reg = <1>;
-                               };
-
-                               phy1: ethernet-phy@0 {
-                                       reg = <0>;
-                               };
-                       };
-
-                       flash@d0000 {
-                               status = "okay";
-                               num-cs = <1>;
-                               marvell,nand-keep-config;
-                               marvell,nand-enable-arbiter;
-                               nand-on-flash-bbt;
-                       };
-               };
-
-               pcie {
-                       status = "okay";
-                       pcie@1,0 {
-                               /* Port 0, Lane 0 */
-                               status = "okay";
-                       };
-
-               };
-       };
-};
-
-&spi1 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&spi1_pins>;
-       status = "okay";
-       u-boot,dm-pre-reloc;
-
-       spi-flash@0 {
-               u-boot,dm-pre-reloc;
-               #address-cells = <1>;
-               #size-cells = <1>;
-               compatible = "st,m25p128", "jedec,spi-nor", "spi-flash";
-               reg = <0>; /* Chip select 0 */
-               spi-max-frequency = <50000000>;
-               m25p,fast-read;
-       };
-};
-
-&refclk {
-       clock-frequency = <20000000>;
-};
index 7074a73537fa739a82a24d6aaa2890dbb271ae64..79b694cb84bce0935936d3a150576e8c9d1083c9 100644 (file)
@@ -11,3 +11,7 @@
 &uart0 {
        u-boot,dm-pre-reloc;
 };
+
+&watchdog {
+       u-boot,dm-pre-reloc;
+};
diff --git a/arch/arm/dts/armada-385-db-88f6820-amc.dts b/arch/arm/dts/armada-385-db-88f6820-amc.dts
new file mode 100644 (file)
index 0000000..59a425f
--- /dev/null
@@ -0,0 +1,146 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Device Tree file for Marvell Armada 385 AMC board
+ * (DB-88F6820-AMC)
+ *
+ * Copyright (C) 2017 Allied Telesis Labs
+ */
+
+/dts-v1/;
+#include "armada-385.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+       model = "Marvell Armada 385 AMC";
+       compatible = "marvell,a385-db-amc", "marvell,armada385", "marvell,armada380";
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       aliases {
+               ethernet0 = &eth0;
+               ethernet1 = &eth2;
+               i2c0 = &i2c0;
+               spi1 = &spi1;
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x80000000>; /* 2GB */
+       };
+
+       soc {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
+                         MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
+       };
+};
+
+&i2c0 {
+       u-boot,i2c-slave-addr = <0x0>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins>;
+       status = "okay";
+};
+
+&uart0 {
+       /*
+        * Exported on the micro USB connector CON3
+        * through an FTDI
+        */
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins>;
+       status = "okay";
+       u-boot,dm-pre-reloc;
+};
+
+
+&eth0 {
+       pinctrl-names = "default";
+       /*
+        * The Reference Clock 0 is used to provide a
+        * clock to the PHY
+        */
+       pinctrl-0 = <&ge0_rgmii_pins>, <&ref_clk0_pins>;
+       status = "okay";
+       phy = <&phy0>;
+       phy-mode = "rgmii-id";
+};
+
+&eth2 {
+       status = "okay";
+       phy = <&phy1>;
+       phy-mode = "sgmii";
+};
+
+&usb0 {
+       status = "okay";
+};
+
+
+
+&mdio {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mdio_pins>;
+
+       phy0: ethernet-phy@1 {
+               reg = <1>;
+       };
+
+       phy1: ethernet-phy@0 {
+               reg = <0>;
+       };
+};
+
+&nand_controller {
+       status = "okay";
+       marvell,nand-keep-config;
+       marvell,nand-enable-arbiter;
+       nand-on-flash-bbt;
+};
+
+&pciec {
+       status = "okay";
+};
+
+&pcie1 {
+       /* Port 0, Lane 0 */
+       status = "okay";
+};
+
+&spi1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi1_pins>;
+       status = "okay";
+       u-boot,dm-pre-reloc;
+
+       spi-flash@0 {
+               u-boot,dm-pre-reloc;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "jedec,spi-nor";
+               reg = <0>; /* Chip select 0 */
+               spi-max-frequency = <50000000>;
+               m25p,fast-read;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       partition@0 {
+                               reg = <0x00000000 0x00100000>;
+                               label = "u-boot";
+                       };
+                       partition@100000 {
+                               reg = <0x00100000 0x00040000>;
+                               label = "u-boot-env";
+                       };
+               };
+       };
+};
+
+&refclk {
+       clock-frequency = <20000000>;
+};
diff --git a/arch/arm/dts/armada-xp-98dx3236.dtsi b/arch/arm/dts/armada-xp-98dx3236.dtsi
new file mode 100644 (file)
index 0000000..5df1d18
--- /dev/null
@@ -0,0 +1,343 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree Include file for Marvell 98dx3236 family SoC
+ *
+ * Copyright (C) 2016 Allied Telesis Labs
+ *
+ * Contains definitions specific to the 98dx3236 SoC that are not
+ * common to all Armada XP SoCs.
+ */
+
+#include "armada-370-xp.dtsi"
+
+/ {
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       model = "Marvell 98DX3236 SoC";
+       compatible = "marvell,armadaxp-98dx3236", "marvell,armada-370-xp";
+
+       aliases {
+               gpio0 = &gpio0;
+               gpio1 = &gpio1;
+               gpio2 = &gpio2;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               enable-method = "marvell,98dx3236-smp";
+
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "marvell,sheeva-v7";
+                       reg = <0>;
+                       clocks = <&cpuclk 0>;
+                       clock-latency = <1000000>;
+               };
+       };
+
+       soc {
+               compatible = "marvell,armadaxp-mbus", "simple-bus";
+
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
+                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
+                         MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000
+                         MBUS_ID(0x03, 0x00) 0 0 0xa8000000 0x4000000
+                         MBUS_ID(0x08, 0x00) 0 0 0xac000000 0x100000>;
+
+               bootrom {
+                       compatible = "marvell,bootrom";
+                       reg = <MBUS_ID(0x01, 0x1d) 0 0x100000>;
+               };
+
+               /*
+                * 98DX3236 has 1 x1 PCIe unit Gen2.0
+                */
+               pciec: pcie@82000000 {
+                       compatible = "marvell,armada-xp-pcie";
+                       status = "disabled";
+                       device_type = "pci";
+
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+
+                       msi-parent = <&mpic>;
+                       bus-range = <0x00 0xff>;
+
+                       ranges =
+                              <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000   /* Port 0.0 registers */
+                               0x82000000 0x1 0       MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */
+                               0x81000000 0x1 0       MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO  */>;
+
+                       pcie1: pcie@1,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
+                               reg = <0x0800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
+                                         0x81000000 0 0 0x81000000 0x1 0 1 0>;
+                               bus-range = <0x00 0xff>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &mpic 58>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gateclk 5>;
+                               status = "disabled";
+                       };
+               };
+
+               internal-regs {
+                       sdramc: sdramc@1400 {
+                               compatible = "marvell,armada-xp-sdram-controller";
+                               reg = <0x1400 0x500>;
+                       };
+
+                       L2: l2-cache@8000 {
+                               compatible = "marvell,aurora-system-cache";
+                               reg = <0x08000 0x1000>;
+                               cache-id-part = <0x100>;
+                               cache-level = <2>;
+                               cache-unified;
+                               wt-override;
+                       };
+
+                       gpio0: gpio@18100 {
+                               compatible = "marvell,orion-gpio";
+                               reg = <0x18100 0x40>;
+                               ngpios = <32>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <82>, <83>, <84>, <85>;
+                       };
+
+                       /* does not exist */
+                       gpio1: gpio@18140 {
+                               compatible = "marvell,orion-gpio";
+                               reg = <0x18140 0x40>;
+                               status = "disabled";
+                       };
+
+                       gpio2: gpio@18180 { /* rework some properties */
+                               compatible = "marvell,orion-gpio";
+                               reg = <0x18180 0x40>;
+                               ngpios = <1>; /* only gpio #32 */
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <87>;
+                       };
+
+                       systemc: system-controller@18200 {
+                               compatible = "marvell,armada-370-xp-system-controller";
+                               reg = <0x18200 0x500>;
+                       };
+
+                       gateclk: clock-gating-control@18220 {
+                               compatible = "marvell,mv98dx3236-gating-clock";
+                               reg = <0x18220 0x4>;
+                               clocks = <&coreclk 0>;
+                               #clock-cells = <1>;
+                       };
+
+                       cpuclk: clock-complex@18700 {
+                               #clock-cells = <1>;
+                               compatible = "marvell,mv98dx3236-cpu-clock";
+                               reg = <0x18700 0x24>, <0x1c054 0x10>;
+                               clocks = <&coreclk 1>;
+                       };
+
+                       corediv-clock@18740 {
+                               status = "disabled";
+                       };
+
+                       cpu-config@21000 {
+                               compatible = "marvell,armada-xp-cpu-config";
+                               reg = <0x21000 0x8>;
+                       };
+
+                       ethernet@70000 {
+                               compatible = "marvell,armada-xp-neta";
+                       };
+
+                       ethernet@74000 {
+                               compatible = "marvell,armada-xp-neta";
+                       };
+
+                       xor1: xor@f0800 {
+                               compatible = "marvell,orion-xor";
+                               reg = <0xf0800 0x100
+                                      0xf0a00 0x100>;
+                               clocks = <&gateclk 22>;
+                               status = "okay";
+
+                               xor10 {
+                                       interrupts = <51>;
+                                       dmacap,memcpy;
+                                       dmacap,xor;
+                               };
+                               xor11 {
+                                       interrupts = <52>;
+                                       dmacap,memcpy;
+                                       dmacap,xor;
+                                       dmacap,memset;
+                               };
+                       };
+
+                       nand_controller: nand@d0000 {
+                               clocks = <&dfx_coredivclk 0>;
+                       };
+
+                       xor0: xor@f0900 {
+                               compatible = "marvell,orion-xor";
+                               reg = <0xF0900 0x100
+                                      0xF0B00 0x100>;
+                               clocks = <&gateclk 28>;
+                               status = "okay";
+
+                               xor00 {
+                                       interrupts = <94>;
+                                       dmacap,memcpy;
+                                       dmacap,xor;
+                               };
+                               xor01 {
+                                       interrupts = <95>;
+                                       dmacap,memcpy;
+                                       dmacap,xor;
+                                       dmacap,memset;
+                               };
+                       };
+               };
+
+               dfx: dfx-server@ac000000 {
+                       compatible = "marvell,dfx-server", "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 MBUS_ID(0x08, 0x00) 0 0x100000>;
+                       reg = <MBUS_ID(0x08, 0x00) 0 0x100000>;
+
+                        thermal: thermal@f8078 {
+                                compatible = "marvell,armada380-thermal";
+                                reg = <0xf8078 0x4>, <0xf8074 0x4>;
+                                status = "okay";
+                        };
+
+                       coreclk: mvebu-sar@f8204 {
+                               compatible = "marvell,mv98dx3236-core-clock";
+                               reg = <0xf8204 0x4>;
+                               #clock-cells = <1>;
+                       };
+
+                       dfx_coredivclk: corediv-clock@f8268 {
+                               compatible = "marvell,mv98dx3236-corediv-clock";
+                               reg = <0xf8268 0xc>;
+                               #clock-cells = <1>;
+                               clocks = <&mainpll>;
+                               clock-output-names = "nand";
+                       };
+               };
+
+               switch: switch@a8000000 {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 MBUS_ID(0x03, 0x00) 0 0x100000>;
+
+                       pp0: packet-processor@0 {
+                               compatible = "marvell,prestera-98dx3236", "marvell,prestera";
+                               reg = <0 0x4000000>;
+                               interrupts = <33>, <34>, <35>;
+                               dfx = <&dfx>;
+                       };
+               };
+       };
+
+       clocks {
+               /* 25 MHz reference crystal */
+               refclk: oscillator {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <25000000>;
+               };
+       };
+};
+
+&i2c0 {
+       compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
+       reg = <0x11000 0x100>;
+};
+
+&i2c1 {
+       compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
+       reg = <0x11100 0x100>;
+};
+
+&mpic {
+       reg = <0x20a00 0x2d0>, <0x21070 0x58>;
+};
+
+&rtc {
+       status = "disabled";
+};
+
+&timer {
+       compatible = "marvell,armada-xp-timer";
+       clocks = <&coreclk 2>, <&refclk>;
+       clock-names = "nbclk", "fixed";
+};
+
+&watchdog {
+       compatible = "marvell,armada-xp-wdt";
+       clocks = <&coreclk 2>, <&refclk>;
+       clock-names = "nbclk", "fixed";
+};
+
+&cpurst {
+       reg = <0x20800 0x20>;
+};
+
+&usb0 {
+       clocks = <&gateclk 18>;
+};
+
+&usb1 {
+       clocks = <&gateclk 19>;
+};
+
+&pinctrl {
+       compatible = "marvell,98dx3236-pinctrl";
+
+       nand_pins: nand-pins {
+               marvell,pins = "mpp20", "mpp21", "mpp22",
+                              "mpp23", "mpp24", "mpp25",
+                              "mpp26", "mpp27", "mpp28",
+                              "mpp29", "mpp30";
+               marvell,function = "dev";
+       };
+
+       nand_rb: nand-rb {
+               marvell,pins = "mpp19";
+               marvell,function = "nand";
+       };
+
+       spi0_pins: spi0-pins {
+               marvell,pins = "mpp0", "mpp1",
+                              "mpp2", "mpp3";
+               marvell,function = "spi0";
+       };
+};
+
+&spi0 {
+       compatible = "marvell,armada-xp-spi", "marvell,orion-spi";
+       pinctrl-0 = <&spi0_pins>;
+       pinctrl-names = "default";
+};
+
+&sdio {
+       status = "disabled";
+};
diff --git a/arch/arm/dts/armada-xp-98dx3336.dtsi b/arch/arm/dts/armada-xp-98dx3336.dtsi
new file mode 100644 (file)
index 0000000..1d9d8a8
--- /dev/null
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree Include file for Marvell 98dx3336 family SoC
+ *
+ * Copyright (C) 2016 Allied Telesis Labs
+ *
+ * Contains definitions specific to the 98dx3236 SoC that are not
+ * common to all Armada XP SoCs.
+ */
+
+#include "armada-xp-98dx3236.dtsi"
+
+/ {
+       model = "Marvell 98DX3336 SoC";
+       compatible = "marvell,armadaxp-98dx3336", "marvell,armadaxp-98dx3236", "marvell,armada-370-xp";
+
+       cpus {
+               cpu@1 {
+                       device_type = "cpu";
+                       compatible = "marvell,sheeva-v7";
+                       reg = <1>;
+                       clocks = <&cpuclk 1>;
+                       clock-latency = <1000000>;
+               };
+       };
+
+       soc {
+               internal-regs {
+                       resume@20980 {
+                               compatible = "marvell,98dx3336-resume-ctrl";
+                               reg = <0x20980 0x10>;
+                       };
+               };
+       };
+};
+
+&pp0 {
+       compatible = "marvell,prestera-98dx3336", "marvell,prestera";
+};
diff --git a/arch/arm/dts/armada-xp-98dx4251.dtsi b/arch/arm/dts/armada-xp-98dx4251.dtsi
new file mode 100644 (file)
index 0000000..48ffdc7
--- /dev/null
@@ -0,0 +1,54 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree Include file for Marvell 98dx4521 family SoC
+ *
+ * Copyright (C) 2016 Allied Telesis Labs
+ *
+ * Contains definitions specific to the 98dx4521 SoC that are not
+ * common to all Armada XP SoCs.
+ */
+
+#include "armada-xp-98dx3236.dtsi"
+
+/ {
+       model = "Marvell 98DX4251 SoC";
+       compatible = "marvell,armadaxp-98dx4251", "marvell,armadaxp-98dx3236", "marvell,armada-370-xp";
+
+       cpus {
+               cpu@1 {
+                       device_type = "cpu";
+                       compatible = "marvell,sheeva-v7";
+                       reg = <1>;
+                       clocks = <&cpuclk 1>;
+                       clock-latency = <1000000>;
+               };
+       };
+
+       soc {
+               internal-regs {
+                       resume@20980 {
+                               compatible = "marvell,98dx3336-resume-ctrl";
+                               reg = <0x20980 0x10>;
+                       };
+               };
+       };
+};
+
+&sdio {
+       status = "okay";
+};
+
+&pinctrl {
+       compatible = "marvell,98dx4251-pinctrl";
+
+       sdio_pins: sdio-pins {
+               marvell,pins = "mpp5", "mpp6", "mpp7",
+                              "mpp8", "mpp9", "mpp10";
+               marvell,function = "sd0";
+       };
+};
+
+&pp0 {
+       compatible = "marvell,prestera-98dx4251", "marvell,prestera";
+       interrupts = <33>, <34>, <35>, <36>;
+};
diff --git a/arch/arm/dts/armada-xp-db-xc3-24g4xg-u-boot.dtsi b/arch/arm/dts/armada-xp-db-xc3-24g4xg-u-boot.dtsi
new file mode 100644 (file)
index 0000000..90cad85
--- /dev/null
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+&uart0 {
+       u-boot,dm-pre-reloc;
+};
+
+&nand_controller {
+       compatible="marvell,mvebu-pxa3xx-nand";
+       status = "okay";
+       label = "pxa3xx_nand-0";
+       nand-rb = <0>;
+       marvell,nand-keep-config;
+       nand-on-flash-bbt;
+       nand-ecc-strength = <4>;
+       nand-ecc-step-size = <512>;
+};
+
+&spi0 {
+       u-boot,dm-pre-reloc;
+
+       spi-flash@0 {
+               u-boot,dm-pre-reloc;
+       };
+};
diff --git a/arch/arm/dts/armada-xp-db-xc3-24g4xg.dts b/arch/arm/dts/armada-xp-db-xc3-24g4xg.dts
new file mode 100644 (file)
index 0000000..d4b5288
--- /dev/null
@@ -0,0 +1,110 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree file for DB-XC3-24G4XG board
+ *
+ * Copyright (C) 2016 Allied Telesis Labs
+ *
+ * Based on armada-xp-db.dts
+ *
+ * Note: this Device Tree assumes that the bootloader has remapped the
+ * internal registers to 0xf1000000 (instead of the default
+ * 0xd0000000). The 0xf1000000 is the default used by the recent,
+ * DT-capable, U-Boot bootloaders provided by Marvell. Some earlier
+ * boards were delivered with an older version of the bootloader that
+ * left internal registers mapped at 0xd0000000. If you are in this
+ * situation, you should either update your bootloader (preferred
+ * solution) or the below Device Tree should be adjusted.
+ */
+
+/dts-v1/;
+#include "armada-xp-98dx3336.dtsi"
+#include "armada-xp-db-xc3-24g4xg-u-boot.dtsi"
+
+/ {
+       model = "DB-XC3-24G4XG";
+       compatible = "marvell,armadaxp-98dx3336", "marvell,armadaxp-mv78260", "marvell,armadaxp", "marvell,armada-370-xp";
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+               bootargs = "console=ttyS0,115200 earlyprintk";
+       };
+
+       aliases {
+               spi0 = &spi0;
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0 0x00000000 0 0x40000000>; /* 1 GB */
+       };
+};
+
+&L2 {
+       arm,parity-enable;
+       marvell,ecc-enable;
+};
+
+&devbus_bootcs {
+       status = "okay";
+
+       /* Device Bus parameters are required */
+
+       /* Read parameters */
+       devbus,bus-width    = <16>;
+       devbus,turn-off-ps  = <60000>;
+       devbus,badr-skew-ps = <0>;
+       devbus,acc-first-ps = <124000>;
+       devbus,acc-next-ps  = <248000>;
+       devbus,rd-setup-ps  = <0>;
+       devbus,rd-hold-ps   = <0>;
+
+       /* Write parameters */
+       devbus,sync-enable = <0>;
+       devbus,wr-high-ps  = <60000>;
+       devbus,wr-low-ps   = <60000>;
+       devbus,ale-wr-ps   = <60000>;
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&uart1 {
+       status = "okay";
+};
+
+&i2c0 {
+       clock-frequency = <100000>;
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+};
+
+&spi0 {
+       status = "okay";
+
+       spi-flash@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "spi-flash", "jedec,spi-nor";
+               reg = <0>; /* Chip select 0 */
+               spi-max-frequency = <108000000>;
+               m25p,fast-read;
+
+               partition@u-boot {
+                       reg = <0x00000000 0x00100000>;
+                       label = "u-boot";
+               };
+               partition@u-boot-env {
+                       reg = <0x00100000 0x00040000>;
+                       label = "u-boot-env";
+               };
+               partition@unused {
+                       reg = <0x00140000 0x00ec0000>;
+                       label = "unused";
+               };
+
+       };
+};
index 27799d1254eadc1f9056a17184195449c5cd8624..1139e9469a83792efc102ff2c8dd375d1c5591b3 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
  * Device Tree file for Marvell Armada XP development board
  * (DB-MV784MP-GP)
@@ -8,44 +9,6 @@
  * Gregory CLEMENT <gregory.clement@free-electrons.com>
  * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This file is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU General Public License as
- *     published by the Free Software Foundation; either version 2 of the
- *     License, or (at your option) any later version.
- *
- *     This file is distributed in the hope that it will be useful
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- * Or, alternatively
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
- *
  * Note: this Device Tree assumes that the bootloader has remapped the
  * internal registers to 0xf1000000 (instead of the default
  * 0xd0000000). The 0xf1000000 is the default used by the recent,
                stdout-path = "serial0:115200n8";
        };
 
-       aliases {
-               spi0 = &spi0;
-       };
-
-       memory {
+       memory@0 {
                device_type = "memory";
                /*
                  * 8 GB of plug-in RAM modules by default.The amount
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
                          MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
-                         MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000>;
+                         MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000
+                         MBUS_ID(0x09, 0x09) 0 0 0xf1100000 0x10000
+                         MBUS_ID(0x09, 0x05) 0 0 0xf1110000 0x10000
+                         MBUS_ID(0x0c, 0x04) 0 0 0xf1200000 0x100000>;
 
                devbus-bootcs {
                        status = "okay";
                        };
                };
 
-               pcie-controller {
-                       status = "okay";
-
-                       /*
-                        * The 3 slots are physically present as
-                        * standard PCIe slots on the board.
-                        */
-                       pcie@1,0 {
-                               /* Port 0, Lane 0 */
-                               status = "okay";
-                       };
-                       pcie@9,0 {
-                               /* Port 2, Lane 0 */
-                               status = "okay";
-                       };
-                       pcie@10,0 {
-                               /* Port 3, Lane 0 */
-                               status = "okay";
-                       };
-               };
-
                internal-regs {
                        serial@12000 {
                                status = "okay";
-                               u-boot,dm-pre-reloc;
                        };
                        serial@12100 {
                                status = "okay";
                                status = "okay";
                        };
 
-                       mdio {
-                               phy0: ethernet-phy@0 {
-                                       reg = <16>;
-                               };
-
-                               phy1: ethernet-phy@1 {
-                                       reg = <17>;
-                               };
-
-                               phy2: ethernet-phy@2 {
-                                       reg = <18>;
-                               };
-
-                               phy3: ethernet-phy@3 {
-                                       reg = <19>;
-                               };
-                       };
-
                        ethernet@70000 {
                                status = "okay";
                                phy = <&phy0>;
                                phy-mode = "qsgmii";
+                               buffer-manager = <&bm>;
+                               bm,pool-long = <0>;
                        };
                        ethernet@74000 {
                                status = "okay";
                                phy = <&phy1>;
                                phy-mode = "qsgmii";
+                               buffer-manager = <&bm>;
+                               bm,pool-long = <1>;
                        };
                        ethernet@30000 {
                                status = "okay";
                                phy = <&phy2>;
                                phy-mode = "qsgmii";
+                               buffer-manager = <&bm>;
+                               bm,pool-long = <2>;
                        };
                        ethernet@34000 {
                                status = "okay";
                                phy = <&phy3>;
                                phy-mode = "qsgmii";
+                               buffer-manager = <&bm>;
+                               bm,pool-long = <3>;
                        };
 
                        /* Front-side USB slot */
                                status = "okay";
                        };
 
-                       spi0: spi@10600 {
+                       bm@c0000 {
                                status = "okay";
-                               u-boot,dm-pre-reloc;
-
-                               spi-flash@0 {
-                                       u-boot,dm-pre-reloc;
-                                       #address-cells = <1>;
-                                       #size-cells = <1>;
-                                       compatible = "n25q128a13", "jedec,spi-nor";
-                                       reg = <0>; /* Chip select 0 */
-                                       spi-max-frequency = <108000000>;
-                               };
                        };
 
                        nand@d0000 {
                                status = "okay";
+                               label = "pxa3xx_nand-0";
                                num-cs = <1>;
                                marvell,nand-keep-config;
-                               marvell,nand-enable-arbiter;
                                nand-on-flash-bbt;
                        };
                };
+
+               bm-bppi {
+                       status = "okay";
+               };
+       };
+};
+
+&pciec {
+       status = "okay";
+
+       /*
+        * The 3 slots are physically present as
+        * standard PCIe slots on the board.
+        */
+       pcie@1,0 {
+               /* Port 0, Lane 0 */
+               status = "okay";
+       };
+       pcie@9,0 {
+               /* Port 2, Lane 0 */
+               status = "okay";
+       };
+       pcie@a,0 {
+               /* Port 3, Lane 0 */
+               status = "okay";
+       };
+};
+
+&mdio {
+       phy0: ethernet-phy@0 {
+               reg = <16>;
+       };
+
+       phy1: ethernet-phy@1 {
+               reg = <17>;
+       };
+
+       phy2: ethernet-phy@2 {
+               reg = <18>;
+       };
+
+       phy3: ethernet-phy@3 {
+               reg = <19>;
+       };
+};
+
+&spi0 {
+       status = "okay";
+
+       spi-flash@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "n25q128a13", "jedec,spi-nor";
+               reg = <0>; /* Chip select 0 */
+               spi-max-frequency = <108000000>;
        };
 };
index d7d7f65c85fec623f7a66fcd4efdc12fa0216d47..921eb708625433ca6f3d471c67d67f9c02ae392d 100644 (file)
                                status = "okay";
                        };
 
-                       spi0: spi@10600 {
-                               status = "okay";
-
-                               spi-flash@0 {
-                                       #address-cells = <1>;
-                                       #size-cells = <1>;
-                                       compatible = "n25q128a13", "jedec,spi-nor";
-                                       reg = <0>; /* Chip select 0 */
-                                       spi-max-frequency = <108000000>;
-                               };
-                       };
-
                        nand@d0000 {
                                status = "okay";
                                num-cs = <1>;
                };
        };
 };
+
+&spi0 {
+       status = "okay";
+
+       spi-flash@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "n25q128a13", "jedec,spi-nor";
+               reg = <0>; /* Chip select 0 */
+               spi-max-frequency = <108000000>;
+       };
+};
index f6bab9fb20a908e305e5c84ca296c9ed22e37dc6..8558bf6bb54c603c16b8a5a987c991413e3297c8 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
  * Device Tree Include file for Marvell Armada XP family SoC
  *
@@ -5,44 +6,6 @@
  *
  * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This file is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU General Public License as
- *     published by the Free Software Foundation; either version 2 of the
- *     License, or (at your option) any later version.
- *
- *     This file is distributed in the hope that it will be useful
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- * Or, alternatively
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
- *
  * Contains definitions specific to the Armada XP MV78230 SoC that are not
  * common to all Armada XP SoCs.
  */
 
                internal-regs {
                        gpio0: gpio@18100 {
-                               compatible = "marvell,orion-gpio";
-                               reg = <0x18100 0x40>;
+                               compatible = "marvell,armada-370-gpio",
+                                            "marvell,orion-gpio";
+                               reg = <0x18100 0x40>, <0x181c0 0x08>;
+                               reg-names = "gpio", "pwm";
                                ngpios = <32>;
                                gpio-controller;
                                #gpio-cells = <2>;
+                               #pwm-cells = <2>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                interrupts = <82>, <83>, <84>, <85>;
+                               clocks = <&coreclk 0>;
                        };
 
                        gpio1: gpio@18140 {
-                               compatible = "marvell,orion-gpio";
-                               reg = <0x18140 0x40>;
+                               compatible = "marvell,armada-370-gpio",
+                                            "marvell,orion-gpio";
+                               reg = <0x18140 0x40>, <0x181c8 0x08>;
+                               reg-names = "gpio", "pwm";
                                ngpios = <17>;
                                gpio-controller;
                                #gpio-cells = <2>;
+                               #pwm-cells = <2>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                interrupts = <87>, <88>, <89>;
+                               clocks = <&coreclk 0>;
                        };
                };
        };
index d39231f69d9a960f011e27f44974d2afe2f270c3..2d85fe8ac327296420e1050228e88fa0df48d79a 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
  * Device Tree Include file for Marvell Armada XP family SoC
  *
@@ -5,44 +6,6 @@
  *
  * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This file is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU General Public License as
- *     published by the Free Software Foundation; either version 2 of the
- *     License, or (at your option) any later version.
- *
- *     This file is distributed in the hope that it will be useful
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- * Or, alternatively
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
- *
  * Contains definitions specific to the Armada XP MV78260 SoC that are not
  * common to all Armada XP SoCs.
  */
 
                internal-regs {
                        gpio0: gpio@18100 {
-                               compatible = "marvell,orion-gpio";
-                               reg = <0x18100 0x40>;
+                               compatible = "marvell,armada-370-gpio",
+                                            "marvell,orion-gpio";
+                               reg = <0x18100 0x40>, <0x181c0 0x08>;
+                               reg-names = "gpio", "pwm";
                                ngpios = <32>;
                                gpio-controller;
                                #gpio-cells = <2>;
+                               #pwm-cells = <2>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                interrupts = <82>, <83>, <84>, <85>;
+                               clocks = <&coreclk 0>;
                        };
 
                        gpio1: gpio@18140 {
-                               compatible = "marvell,orion-gpio";
-                               reg = <0x18140 0x40>;
+                               compatible = "marvell,armada-370-gpio",
+                                            "marvell,orion-gpio";
+                               reg = <0x18140 0x40>, <0x181c8 0x08>;
+                               reg-names = "gpio", "pwm";
                                ngpios = <32>;
                                gpio-controller;
                                #gpio-cells = <2>;
+                               #pwm-cells = <2>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                interrupts = <87>, <88>, <89>, <90>;
+                               clocks = <&coreclk 0>;
                        };
 
                        gpio2: gpio@18180 {
-                               compatible = "marvell,orion-gpio";
+                               compatible = "marvell,armada-370-gpio",
+                                            "marvell,orion-gpio";
                                reg = <0x18180 0x40>;
                                ngpios = <3>;
                                gpio-controller;
index c642565d1bc68119dfa5c470fdc7e4d0c63865b0..230a3fd36b3048937c760784ec2fd619f49f9bdb 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
  * Device Tree Include file for Marvell Armada XP family SoC
  *
@@ -5,44 +6,6 @@
  *
  * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This file is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU General Public License as
- *     published by the Free Software Foundation; either version 2 of the
- *     License, or (at your option) any later version.
- *
- *     This file is distributed in the hope that it will be useful
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- * Or, alternatively
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
- *
  * Contains definitions specific to the Armada XP MV78460 SoC that are not
  * common to all Armada XP SoCs.
  */
 
                internal-regs {
                        gpio0: gpio@18100 {
-                               compatible = "marvell,orion-gpio";
-                               reg = <0x18100 0x40>;
+                               compatible = "marvell,armada-370-gpio",
+                                            "marvell,orion-gpio";
+                               reg = <0x18100 0x40>, <0x181c0 0x08>;
+                               reg-names = "gpio", "pwm";
                                ngpios = <32>;
                                gpio-controller;
                                #gpio-cells = <2>;
+                               #pwm-cells = <2>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                interrupts = <82>, <83>, <84>, <85>;
+                               clocks = <&coreclk 0>;
                        };
 
                        gpio1: gpio@18140 {
-                               compatible = "marvell,orion-gpio";
-                               reg = <0x18140 0x40>;
+                               compatible = "marvell,armada-370-gpio",
+                                            "marvell,orion-gpio";
+                               reg = <0x18140 0x40>, <0x181c8 0x08>;
+                               reg-names = "gpio", "pwm";
                                ngpios = <32>;
                                gpio-controller;
                                #gpio-cells = <2>;
+                               #pwm-cells = <2>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                interrupts = <87>, <88>, <89>, <90>;
+                               clocks = <&coreclk 0>;
                        };
 
                        gpio2: gpio@18180 {
-                               compatible = "marvell,orion-gpio";
+                               compatible = "marvell,armada-370-gpio",
+                                            "marvell,orion-gpio";
                                reg = <0x18180 0x40>;
                                ngpios = <3>;
                                gpio-controller;
index 0a60ddfa4149ee75da08ef732bf5699544c7131c..861967cd7e8728124f0e336819bf4c034b930a56 100644 (file)
@@ -1,13 +1,9 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
  * Device Tree file for Synology DS414
  *
  * Copyright (C) 2014, Arnaud EBALARD <arno@natisbad.org>
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- *
  * Note: this Device Tree assumes that the bootloader has remapped the
  * internal registers to 0xf1000000 (instead of the old 0xd0000000).
  * The 0xf1000000 is the default used by the recent, DT-capable, U-Boot
                spi0 = &spi0;
        };
 
-       memory {
+       memory@0 {
                device_type = "memory";
                reg = <0 0x00000000 0 0x40000000>; /* 1GB */
        };
 
        soc {
                ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
-                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
-
-               pcie-controller {
-                       status = "okay";
-
-                       /*
-                        * Connected to Marvell 88SX7042 SATA-II controller
-                        * handling the four disks.
-                        */
-                       pcie@1,0 {
-                               /* Port 0, Lane 0 */
-                               status = "okay";
-                       };
-
-                       /*
-                        * Connected to EtronTech EJ168A XHCI controller
-                        * providing the two rear USB 3.0 ports.
-                        */
-                       pcie@5,0 {
-                               /* Port 1, Lane 0 */
-                               status = "okay";
-                       };
-               };
+                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
+                         MBUS_ID(0x09, 0x09) 0 0 0xf1100000 0x10000
+                         MBUS_ID(0x09, 0x05) 0 0 0xf1110000 0x10000>;
 
                internal-regs {
 
                                status = "disabled";
                        };
 
-                       spi0: spi@10600 {
-                               status = "okay";
-                               u-boot,dm-pre-reloc;
-
-                               spi-flash@0 {
-                                       u-boot,dm-pre-reloc;
-                                       #address-cells = <1>;
-                                       #size-cells = <1>;
-                                       compatible = "micron,n25q064";
-                                       reg = <0>; /* Chip select 0 */
-                                       spi-max-frequency = <20000000>;
-
-                                       /*
-                                        * Warning!
-                                        *
-                                        * Synology u-boot uses its compiled-in environment
-                                        * and it seems Synology did not care to change u-boot
-                                        * default configuration in order to allow saving a
-                                        * modified environment at a sensible location. So,
-                                        * if you do a 'saveenv' under u-boot, your modified
-                                        * environment will be saved at 1MB after the start
-                                        * of the flash, i.e. in the middle of the uImage.
-                                        * For that reason, it is strongly advised not to
-                                        * change the default environment, unless you know
-                                        * what you are doing.
-                                        */
-                                       partition@00000000 { /* u-boot */
-                                               label = "RedBoot";
-                                               reg = <0x00000000 0x000d0000>; /* 832KB */
-                                       };
-
-                                       partition@000c0000 { /* uImage */
-                                               label = "zImage";
-                                               reg = <0x000d0000 0x002d0000>; /* 2880KB */
-                                       };
-
-                                       partition@003a0000 { /* uInitramfs */
-                                               label = "rd.gz";
-                                               reg = <0x003a0000 0x00430000>; /* 4250KB */
-                                       };
-
-                                       partition@007d0000 { /* MAC address and serial number */
-                                               label = "vendor";
-                                               reg = <0x007d0000 0x00010000>; /* 64KB */
-                                       };
-
-                                       partition@007e0000 {
-                                               label = "RedBoot config";
-                                               reg = <0x007e0000 0x00010000>; /* 64KB */
-                                       };
-
-                                       partition@007f0000 {
-                                               label = "FIS directory";
-                                               reg = <0x007f0000 0x00010000>; /* 64KB */
-                                       };
-                               };
-                       };
-
                        i2c@11000 {
                                clock-frequency = <400000>;
                                status = "okay";
                                status = "okay";
                        };
 
-                       mdio {
-                               phy0: ethernet-phy@0 { /* Marvell 88E1512 */
-                                       reg = <0>;
-                               };
-
-                               phy1: ethernet-phy@1 { /* Marvell 88E1512 */
-                                       reg = <1>;
-                               };
-                       };
-
                        ethernet@70000 {
                                status = "okay";
                                pinctrl-0 = <&ge0_rgmii_pins>;
                             &sata3_pwr_pin &sata4_pwr_pin>;
                pinctrl-names = "default";
 
-               sata1_regulator: sata1-regulator {
+               sata1_regulator: sata1-regulator@1 {
                        compatible = "regulator-fixed";
                        reg = <1>;
                        regulator-name = "SATA1 Power";
                        gpio = <&gpio1 10 GPIO_ACTIVE_HIGH>;
                };
 
-               sata2_regulator: sata2-regulator {
+               sata2_regulator: sata2-regulator@2 {
                        compatible = "regulator-fixed";
                        reg = <2>;
                        regulator-name = "SATA2 Power";
                        gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
                };
 
-               sata3_regulator: sata3-regulator {
+               sata3_regulator: sata3-regulator@3 {
                        compatible = "regulator-fixed";
                        reg = <3>;
                        regulator-name = "SATA3 Power";
                        gpio = <&gpio1 13 GPIO_ACTIVE_HIGH>;
                };
 
-               sata4_regulator: sata4-regulator {
+               sata4_regulator: sata4-regulator@4 {
                        compatible = "regulator-fixed";
                        reg = <4>;
                        regulator-name = "SATA4 Power";
        };
 };
 
+&pciec {
+       status = "okay";
+
+       /*
+        * Connected to Marvell 88SX7042 SATA-II controller
+        * handling the four disks.
+        */
+       pcie@1,0 {
+               /* Port 0, Lane 0 */
+               status = "okay";
+       };
+
+       /*
+        * Connected to EtronTech EJ168A XHCI controller
+        * providing the two rear USB 3.0 ports.
+        */
+       pcie@5,0 {
+               /* Port 1, Lane 0 */
+               status = "okay";
+       };
+};
+
+
+&mdio {
+       phy0: ethernet-phy@0 { /* Marvell 88E1512 */
+               reg = <0>;
+       };
+
+       phy1: ethernet-phy@1 { /* Marvell 88E1512 */
+               reg = <1>;
+       };
+};
+
 &pinctrl {
        sata1_pwr_pin: sata1-pwr-pin {
                marvell,pins = "mpp42";
                marvell,function = "gpio";
        };
 };
+
+&spi0 {
+       status = "okay";
+
+       spi-flash@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "micron,n25q064", "jedec,spi-nor";
+               reg = <0>; /* Chip select 0 */
+               spi-max-frequency = <20000000>;
+
+               /*
+                * Warning!
+                *
+                * Synology u-boot uses its compiled-in environment
+                * and it seems Synology did not care to change u-boot
+                * default configuration in order to allow saving a
+                * modified environment at a sensible location. So,
+                * if you do a 'saveenv' under u-boot, your modified
+                * environment will be saved at 1MB after the start
+                * of the flash, i.e. in the middle of the uImage.
+                * For that reason, it is strongly advised not to
+                * change the default environment, unless you know
+                * what you are doing.
+                */
+               partition@0 { /* u-boot */
+                       label = "RedBoot";
+                       reg = <0x00000000 0x000d0000>; /* 832KB */
+               };
+
+               partition@c0000 { /* uImage */
+                       label = "zImage";
+                       reg = <0x000d0000 0x002d0000>; /* 2880KB */
+               };
+
+               partition@3a0000 { /* uInitramfs */
+                       label = "rd.gz";
+                       reg = <0x003a0000 0x00430000>; /* 4250KB */
+               };
+
+               partition@7d0000 { /* MAC address and serial number */
+                       label = "vendor";
+                       reg = <0x007d0000 0x00010000>; /* 64KB */
+               };
+
+               partition@7e0000 {
+                       label = "RedBoot config";
+                       reg = <0x007e0000 0x00010000>; /* 64KB */
+               };
+
+               partition@7f0000 {
+                       label = "FIS directory";
+                       reg = <0x007f0000 0x00010000>; /* 64KB */
+               };
+       };
+};
index 5695e9b758569234dd4dcb6ffeb7e0af39583f65..bcb4bfdd5c198cdc809a808ce2317cfecb0cb9c7 100644 (file)
                                status = "okay";
                        };
 
-                       spi0: spi@10600 {
-                               status = "okay";
-                               u-boot,dm-pre-reloc;
-
-                               spi-flash@0 {
-                                       u-boot,dm-pre-reloc;
-                                       #address-cells = <1>;
-                                       #size-cells = <1>;
-                                       compatible = "n25q128a13", "jedec,spi-nor", "spi-flash";
-                                       reg = <0>; /* Chip select 0 */
-                                       spi-max-frequency = <27777777>;
-                               };
-
-                               fpga@1 {
-                                       #address-cells = <1>;
-                                       #size-cells = <1>;
-                                       compatible = "spi-generic-device";
-                                       reg = <1>; /* Chip select 1 */
-                                       spi-max-frequency = <27777777>;
-                               };
-                       };
-
-                       spi1: spi@10680 {
-                               status = "okay";
-
-                               fpga@0 {
-                                       #address-cells = <1>;
-                                       #size-cells = <1>;
-                                       compatible = "spi-generic-device";
-                                       reg = <0>; /* Chip select 0 */
-                                       spi-max-frequency = <27777777>;
-                               };
-                       };
-
                        /* The LCD controller is only used on this board */
                        lcd0: lcd-controller@e0000 {
                                compatible = "marvell,armada-xp-lcd";
        };
 };
 
+&spi0 {
+       status = "okay";
+       u-boot,dm-pre-reloc;
+
+       spi-flash@0 {
+               u-boot,dm-pre-reloc;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "n25q128a13", "jedec,spi-nor", "spi-flash";
+               reg = <0>; /* Chip select 0 */
+               spi-max-frequency = <27777777>;
+       };
+
+       fpga@1 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "spi-generic-device";
+               reg = <1>; /* Chip select 1 */
+               spi-max-frequency = <27777777>;
+       };
+};
+
+&spi1 {
+       status = "okay";
+
+       fpga@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "spi-generic-device";
+               reg = <0>; /* Chip select 0 */
+               spi-max-frequency = <27777777>;
+       };
+};
+
+
 &pciec {
        status = "okay";
 
index 3fac39e41d789199947a3927bf7c4630ea14c275..d856d96022727a7802fcd71c5b526a309d0a0bda 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
  * Device Tree Include file for Marvell Armada XP family SoC
  *
@@ -8,44 +9,6 @@
  * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  * Ben Dooks <ben.dooks@codethink.co.uk>
  *
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This file is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU General Public License as
- *     published by the Free Software Foundation; either version 2 of the
- *     License, or (at your option) any later version.
- *
- *     This file is distributed in the hope that it will be useful
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- * Or, alternatively
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
- *
  * Contains definitions specific to the Armada XP SoC that are not
  * common to all Armada SoCs.
  */
@@ -53,6 +16,9 @@
 #include "armada-370-xp.dtsi"
 
 / {
+       #address-cells = <2>;
+       #size-cells = <2>;
+
        model = "Marvell Armada XP family SoC";
        compatible = "marvell,armadaxp", "marvell,armada-370-xp";
 
                };
 
                internal-regs {
-                       sdramc@1400 {
+                       sdramc: sdramc@1400 {
                                compatible = "marvell,armada-xp-sdram-controller";
                                reg = <0x1400 0x500>;
                        };
 
-                       L2: l2-cache {
+                       L2: l2-cache@8000 {
                                compatible = "marvell,aurora-system-cache";
                                reg = <0x08000 0x1000>;
                                cache-id-part = <0x100>;
                                wt-override;
                        };
 
-                       spi0: spi@10600 {
-                               compatible = "marvell,armada-xp-spi",
-                                               "marvell,orion-spi";
-                               pinctrl-0 = <&spi0_pins>;
-                               pinctrl-names = "default";
-                       };
-
-                       spi1: spi@10680 {
-                               compatible = "marvell,armada-xp-spi",
-                                               "marvell,orion-spi";
-                       };
-
-
-                       i2c0: i2c@11000 {
-                               compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
-                               reg = <0x11000 0x100>;
-                       };
-
-                       i2c1: i2c@11100 {
-                               compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
-                               reg = <0x11100 0x100>;
-                       };
-
                        uart2: serial@12200 {
                                compatible = "snps,dw-apb-uart";
                                pinctrl-0 = <&uart2_pins>;
                                status = "disabled";
                        };
 
-                       system-controller@18200 {
+                       systemc: system-controller@18200 {
                                compatible = "marvell,armada-370-xp-system-controller";
                                reg = <0x18200 0x500>;
                        };
                                #clock-cells = <1>;
                        };
 
-                       thermal@182b0 {
+                       thermal: thermal@182b0 {
                                compatible = "marvell,armadaxp-thermal";
                                reg = <0x182b0 0x4
                                        0x184d0 0x4>;
                                clocks = <&coreclk 1>;
                        };
 
-                       interrupt-controller@20a00 {
-                             reg = <0x20a00 0x2d0>, <0x21070 0x58>;
-                       };
-
-                       timer@20300 {
-                               compatible = "marvell,armada-xp-timer";
-                               clocks = <&coreclk 2>, <&refclk>;
-                               clock-names = "nbclk", "fixed";
-                       };
-
-                       watchdog@20300 {
-                               compatible = "marvell,armada-xp-wdt";
-                               clocks = <&coreclk 2>, <&refclk>;
-                               clock-names = "nbclk", "fixed";
-                       };
-
-                       cpurst@20800 {
-                               compatible = "marvell,armada-370-cpu-reset";
-                               reg = <0x20800 0x20>;
+                       cpu-config@21000 {
+                               compatible = "marvell,armada-xp-cpu-config";
+                               reg = <0x21000 0x8>;
                        };
 
                        eth2: ethernet@30000 {
                                status = "disabled";
                        };
 
-                       usb@50000 {
-                               clocks = <&gateclk 18>;
-                       };
-
-                       usb@51000 {
-                               clocks = <&gateclk 19>;
-                       };
-
-                       usb@52000 {
+                       usb2: usb@52000 {
                                compatible = "marvell,orion-ehci";
                                reg = <0x52000 0x500>;
                                interrupts = <47>;
                                status = "disabled";
                        };
 
-                       xor@60900 {
+                       xor1: xor@60900 {
                                compatible = "marvell,orion-xor";
                                reg = <0x60900 0x100
                                       0x60b00 0x100>;
                                compatible = "marvell,armada-xp-neta";
                        };
 
-                       xor@f0900 {
+                       cesa: crypto@90000 {
+                               compatible = "marvell,armada-xp-crypto";
+                               reg = <0x90000 0x10000>;
+                               reg-names = "regs";
+                               interrupts = <48>, <49>;
+                               clocks = <&gateclk 23>, <&gateclk 23>;
+                               clock-names = "cesa0", "cesa1";
+                               marvell,crypto-srams = <&crypto_sram0>,
+                                                      <&crypto_sram1>;
+                               marvell,crypto-sram-size = <0x800>;
+                       };
+
+                       bm: bm@c0000 {
+                               compatible = "marvell,armada-380-neta-bm";
+                               reg = <0xc0000 0xac>;
+                               clocks = <&gateclk 13>;
+                               internal-mem = <&bm_bppi>;
+                               status = "disabled";
+                       };
+
+                       xor0: xor@f0900 {
                                compatible = "marvell,orion-xor";
                                reg = <0xF0900 0x100
                                       0xF0B00 0x100>;
                                };
                        };
                };
+
+               crypto_sram0: sa-sram0 {
+                       compatible = "mmio-sram";
+                       reg = <MBUS_ID(0x09, 0x09) 0 0x800>;
+                       clocks = <&gateclk 23>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 MBUS_ID(0x09, 0x09) 0 0x800>;
+               };
+
+               crypto_sram1: sa-sram1 {
+                       compatible = "mmio-sram";
+                       reg = <MBUS_ID(0x09, 0x05) 0 0x800>;
+                       clocks = <&gateclk 23>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 MBUS_ID(0x09, 0x05) 0 0x800>;
+               };
+
+               bm_bppi: bm-bppi {
+                       compatible = "mmio-sram";
+                       reg = <MBUS_ID(0x0c, 0x04) 0 0x100000>;
+                       ranges = <0 MBUS_ID(0x0c, 0x04) 0 0x100000>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       clocks = <&gateclk 13>;
+                       no-memory-wc;
+                       status = "disabled";
+               };
        };
 
        clocks {
        };
 };
 
+&i2c0 {
+       compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
+       reg = <0x11000 0x100>;
+};
+
+&i2c1 {
+       compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
+       reg = <0x11100 0x100>;
+};
+
+&mpic {
+       reg = <0x20a00 0x2d0>, <0x21070 0x58>;
+};
+
+&timer {
+       compatible = "marvell,armada-xp-timer";
+       clocks = <&coreclk 2>, <&refclk>;
+       clock-names = "nbclk", "fixed";
+};
+
+&watchdog {
+       compatible = "marvell,armada-xp-wdt";
+       clocks = <&coreclk 2>, <&refclk>;
+       clock-names = "nbclk", "fixed";
+};
+
+&cpurst {
+       reg = <0x20800 0x20>;
+};
+
+&usb0 {
+       clocks = <&gateclk 18>;
+};
+
+&usb1 {
+       clocks = <&gateclk 19>;
+};
+
 &pinctrl {
        ge0_gmii_pins: ge0-gmii-pins {
                marvell,pins =
                marvell,function = "spi0";
        };
 
+       spi1_pins: spi1-pins {
+               marvell,pins = "mpp13", "mpp14",
+                              "mpp16", "mpp17";
+               marvell,function = "spi1";
+       };
+
        uart2_pins: uart2-pins {
                marvell,pins = "mpp42", "mpp43";
                marvell,function = "uart2";
                marvell,function = "uart3";
        };
 };
+
+&spi0 {
+       compatible = "marvell,armada-xp-spi", "marvell,orion-spi";
+       pinctrl-0 = <&spi0_pins>;
+       pinctrl-names = "default";
+};
+
+&spi1 {
+       compatible = "marvell,armada-xp-spi", "marvell,orion-spi";
+       pinctrl-0 = <&spi1_pins>;
+       pinctrl-names = "default";
+};
diff --git a/arch/arm/dts/at91sam9g25-gardena-smart-gateway-u-boot.dtsi b/arch/arm/dts/at91sam9g25-gardena-smart-gateway-u-boot.dtsi
new file mode 100644 (file)
index 0000000..732dee6
--- /dev/null
@@ -0,0 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+&dbgu {
+       u-boot,dm-pre-reloc;
+};
diff --git a/arch/arm/dts/at91sam9g25-gardena-smart-gateway.dts b/arch/arm/dts/at91sam9g25-gardena-smart-gateway.dts
new file mode 100644 (file)
index 0000000..e2f8d80
--- /dev/null
@@ -0,0 +1,120 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Device Tree file for the GARDENA smart Gateway (AT91SAM)
+ *
+ *  Copyright (C) 2012 Atmel,
+ *                2012 Nicolas Ferre <nicolas.ferre@atmel.com>
+ */
+
+/dts-v1/;
+
+#include "at91sam9g25.dtsi"
+
+/ {
+       model = "GARDENA smart Gateway (AT91SAM)";
+       compatible = "gardena,smart-gateway-at91sam", "atmel,at91sam9";
+
+       aliases {
+               serial0 = &dbgu;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory {
+               reg = <0x20000000 0x8000000>;
+       };
+
+       clocks {
+               slow_xtal {
+                       clock-frequency = <32768>;
+               };
+
+               main_xtal {
+                       clock-frequency = <12000000>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               power_blue {
+                       label = "smartgw:power:blue";
+                       gpios = <&pioC 21 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               power_green {
+                       label = "smartgw:power:green";
+                       gpios = <&pioC 20 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
+               };
+
+               power_red {
+                       label = "smartgw:power:red";
+                       gpios = <&pioC 19 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               radio_blue {
+                       label = "smartgw:radio:blue";
+                       gpios = <&pioC 18 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               radio_green {
+                       label = "smartgw:radio:green";
+                       gpios = <&pioC 17 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               radio_red {
+                       label = "smartgw:radio:red";
+                       gpios = <&pioC 16 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               internet_blue {
+                       label = "smartgw:internet:blue";
+                       gpios = <&pioC 15 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               internet_green {
+                       label = "smartgw:internet:green";
+                       gpios = <&pioC 14 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+
+               internet_red {
+                       label = "smartgw:internet:red";
+                       gpios = <&pioC 13 GPIO_ACTIVE_HIGH>;
+                       default-state = "off";
+               };
+       };
+};
+
+&dbgu {
+       status = "okay";
+};
+
+&macb0 {
+       phy-mode = "rmii";
+       status = "okay";
+};
+
+&nand0 {
+       nand-bus-width = <8>;
+       nand-ecc-mode = "hw";
+       atmel,has-pmecc;        /* Enable PMECC */
+       atmel,pmecc-cap = <2>;
+       atmel,pmecc-sector-size = <512>;
+       nand-on-flash-bbt;
+       status = "okay";
+};
+
+&watchdog {
+       status = "okay";
+       timeout-sec = <16>;
+};
index ea319cc18b2d593f73c6e9d5622425afff7cc5df..bd4abe00d6f70f79d2cea109e9d6a7261cb09bb5 100644 (file)
                                };
                        };
 
-                       watchdog@fffffe40 {
+                       watchdog: watchdog@fffffe40 {
                                compatible = "atmel,at91sam9260-wdt";
                                reg = <0xfffffe40 0x10>;
                                interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
index ab1de77954035d98fed19f6dbf03a45b2ba04934..ab9368b9d3a6a0b0c125d243d62b9dd4f1b26a88 100644 (file)
@@ -6,6 +6,24 @@
  * Copyright (C) Adam Ford
  */
 
+/ {
+       soc@1c00000 {
+               u-boot,dm-spl;
+       };
+};
+
 &flash {
        compatible = "m25p64", "spi-flash";
 };
+
+&mmc0 {
+       u-boot,dm-spl;
+};
+
+&serial2 {
+       u-boot,dm-spl;
+};
+
+&spi1 {
+       u-boot,dm-spl;
+};
index 0f982d8b44addc3a201d84128112a492e5823ff1..fd1aea0b1b1617b6c4fa08d03c13204c6da61334 100644 (file)
                                                pbias_mmc_reg: pbias_mmc_omap5 {
                                                        regulator-name = "pbias_mmc_omap5";
                                                        regulator-min-microvolt = <1800000>;
-                                                       regulator-max-microvolt = <3000000>;
+                                                       regulator-max-microvolt = <3300000>;
                                                };
                                        };
 
index 41c9132eb550d07dd686a85eda0296bbfad0b6f7..64363f75c01ad507ce40c32bd2e4a756190a608e 100644 (file)
 
                regulator-name = "vddshv8";
                regulator-min-microvolt = <1800000>;
-               regulator-max-microvolt = <3000000>;
+               regulator-max-microvolt = <3300000>;
                regulator-boot-on;
                vin-supply = <&evm_5v0>;
 
                gpios = <&gpio7 11 GPIO_ACTIVE_HIGH>;
                states = <1800000 0x0
-                         3000000 0x1>;
+                         3300000 0x1>;
        };
 
        evm_1v8_sw: fixedregulator-evm_1v8 {
diff --git a/arch/arm/dts/imx53-kp-u-boot.dtsi b/arch/arm/dts/imx53-kp-u-boot.dtsi
new file mode 100644 (file)
index 0000000..acab9b3
--- /dev/null
@@ -0,0 +1,10 @@
+/*
+ * Copyright 2019
+ * Lukasz Majewski, DENX Software Engineering, lukma@denx.de
+ *
+ * SPDX-License-Identifier:     GPL-2.0+ or X11
+ */
+
+&pmic {
+       u-boot,i2c-transaction-bytes = <3>;
+};
index 8d7b47f9dfbf4e43f15b821c92649b594788103a..1f591ef8bb9e0e9a95a43e1380dd21c1e6f6e217 100644 (file)
@@ -7,7 +7,7 @@
 
 &cbass_wakeup {
        dmsc: dmsc {
-               compatible = "ti,k2g-sci";
+               compatible = "ti,am654-sci";
                ti,host-id = <12>;
                #address-cells = <1>;
                #size-cells = <1>;
index 143eb6d63092bb9c7e1f2a3dde85b0d165abe543..c5d23d0203abc755eea97b7b90405033ec9ce339 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include <dt-bindings/pinctrl/k3-am65.h>
+#include <dt-bindings/dma/k3-udma.h>
 
 / {
        chosen {
                pinctrl-single,register-width = <32>;
                pinctrl-single,function-mask = <0xffffffff>;
        };
+
+       navss_mcu: navss-mcu {
+               compatible = "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               ti,sci-dev-id = <119>;
+
+               mcu_ringacc: ringacc@2b800000 {
+                       compatible = "ti,am654-navss-ringacc";
+                       reg =   <0x0 0x2b800000 0x0 0x400000>,
+                               <0x0 0x2b000000 0x0 0x400000>,
+                               <0x0 0x28590000 0x0 0x100>,
+                               <0x0 0x2a500000 0x0 0x40000>;
+                       reg-names = "rt", "fifos",
+                                   "proxy_gcfg", "proxy_target";
+                       ti,num-rings = <286>;
+                       ti,sci-rm-range-gp-rings = <0x2>; /* GP ring range */
+                       ti,dma-ring-reset-quirk;
+                       ti,sci = <&dmsc>;
+                       ti,sci-dev-id = <195>;
+               };
+
+               mcu_udmap: udmap@285c0000 {
+                       compatible = "ti,k3-navss-udmap";
+                       reg =   <0x0 0x285c0000 0x0 0x100>,
+                               <0x0 0x2a800000 0x0 0x40000>,
+                               <0x0 0x2aa00000 0x0 0x40000>;
+                       reg-names = "gcfg", "rchanrt", "tchanrt";
+                       #dma-cells = <3>;
+
+                       ti,ringacc = <&mcu_ringacc>;
+                       ti,psil-base = <0x6000>;
+
+                       ti,sci = <&dmsc>;
+                       ti,sci-dev-id = <194>;
+
+                       ti,sci-rm-range-tchan = <0x1>, /* TX_HCHAN */
+                                               <0x2>; /* TX_CHAN */
+                       ti,sci-rm-range-rchan = <0x3>, /* RX_HCHAN */
+                                               <0x4>; /* RX_CHAN */
+                       ti,sci-rm-range-rflow = <0x5>; /* GP RFLOW */
+                       dma-coherent;
+               };
+       };
 };
 
 &cbass_wakeup {
index 6c9de25b9447499e1060ba5b90e941e30fd3f52f..4820c7e50da780bf0fe1a7488bd05fdee2a4ca7f 100644 (file)
@@ -29,7 +29,6 @@
        status = "okay";
        ethphy0: ethernet-phy@0 {
                reg = <0>;
-               phy-mode = "rgmii-id";
        };
 };
 
index 698338b93d27b343fe5efd2a6661eb6e05a958e5..b67332fed5b2286a164882995b12eb39f84fc5ec 100644 (file)
@@ -7,6 +7,7 @@
 /dts-v1/;
 
 #include "keystone-k2g.dtsi"
+#include <dt-bindings/net/ti-dp83867.h>
 
 / {
        compatible = "ti,k2g-ice", "ti,k2g", "ti,keystone";
                };
        };
 };
+
+&qmss {
+       status = "okay";
+};
+
+&knav_dmas {
+       status = "okay";
+};
+
+&netcp {
+       pinctrl-names = "default";
+       //pinctrl-0 = <&emac_pins>;
+       status = "okay";
+};
+
+&mdio {
+       pinctrl-names = "default";
+       //pinctrl-0 = <&mdio_pins>;
+       status = "okay";
+       ethphy0: ethernet-phy@0 {
+               reg = <0>;
+               ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_25_NS>;
+               ti,tx-internal-delay = <DP83867_RGMIIDCTL_250_PS>;
+               ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_8_B_NIB>;
+               ti,min-output-impedance;
+               ti,dp83867-rxctrl-strap-quirk;
+       };
+};
+
+&gbe0 {
+       phy-handle = <&ethphy0>;
+       phy-mode = "rgmii-id";
+       status = "okay";
+};
index 50312e752e2fae3dc42c6a0c6b45b78b0db7dcf1..7b9508e83d46c54df2d2b424a63f3ae9db1cdc87 100644 (file)
 };
 
 &lvds1 {
-       status = "okay";
-
        ports {
                port@1 {
                        lvds_connector: endpoint {
index a13a92c2664507ee49d1ef8d0b3f5d80dbeffc5d..7a7d3b84d1a6b21d1ddccd4afd2ac55747de5689 100644 (file)
@@ -94,9 +94,8 @@
        status = "okay";
 
        clocks = <&cpg CPG_MOD 724>, <&cpg CPG_MOD 723>, <&cpg CPG_MOD 722>,
-                <&cpg CPG_MOD 726>, <&cpg CPG_MOD 725>,
                 <&osc1_clk>;
-       clock-names = "du.0", "du.1", "du.2", "lvds.0", "lvds.1", "dclkin.0";
+       clock-names = "du.0", "du.1", "du.2", "dclkin.0";
 
        ports {
                port@0 {
                                remote-endpoint = <&adv7511_in>;
                        };
                };
+       };
+};
+
+&lvds0 {
+       ports {
                port@1 {
                        lvds_connector0: endpoint {
                        };
                };
-               port@2 {
+       };
+};
+
+&lvds1 {
+       ports {
+               port@1 {
                        lvds_connector1: endpoint {
                        };
                };
                interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
                interrupt-controller;
 
+               onkey {
+                       compatible = "dlg,da9063-onkey";
+               };
+
                rtc {
                        compatible = "dlg,da9063-rtc";
                };
index 0925bdca438feedaa8ee956f8109fcca75dbbe1f..5a2747758f676a4b526231658fb728aae93d2fe9 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Device Tree Source for the r8a7790 SoC
+ * Device Tree Source for the R-Car H2 (R8A77900) SoC
  *
  * Copyright (C) 2015 Renesas Electronics Corporation
  * Copyright (C) 2013-2014 Renesas Solutions Corp.
                sata0: sata@ee300000 {
                        compatible = "renesas,sata-r8a7790",
                                     "renesas,rcar-gen2-sata";
-                       reg = <0 0xee300000 0 0x2000>;
+                       reg = <0 0xee300000 0 0x200000>;
                        interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 815>;
                        power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
                sata1: sata@ee500000 {
                        compatible = "renesas,sata-r8a7790",
                                     "renesas,rcar-gen2-sata";
-                       reg = <0 0xee500000 0 0x2000>;
+                       reg = <0 0xee500000 0 0x200000>;
                        interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 814>;
                        power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
index ce22db01fbbaafb4689cc736cc357f8ec7f7f335..e6580aa0cea3573fd3c7b52e560f4a076f6e58cb 100644 (file)
 };
 
 &lvds0 {
-       status = "okay";
-
        ports {
                port@1 {
                        lvds_connector: endpoint {
index f02036e5de015a95feec05c47ead06e91cb3daee..fefdf8238bbe900226f338c60753e0f68919258e 100644 (file)
 };
 
 &lvds0 {
-       status = "okay";
-
        ports {
                port@1 {
                        lvds_connector: endpoint {
index 991ac6feedd5beb6123f7a12f98c8799d89f9565..6f875502453cf40a52df7337e53e4933c7a8053f 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Device Tree Source for the r8a7791 SoC
+ * Device Tree Source for the R-Car M2-W (R8A77910) SoC
  *
  * Copyright (C) 2013-2015 Renesas Electronics Corporation
  * Copyright (C) 2013-2014 Renesas Solutions Corp.
                sata0: sata@ee300000 {
                        compatible = "renesas,sata-r8a7791",
                                     "renesas,rcar-gen2-sata";
-                       reg = <0 0xee300000 0 0x2000>;
+                       reg = <0 0xee300000 0 0x200000>;
                        interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 815>;
                        power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
                sata1: sata@ee500000 {
                        compatible = "renesas,sata-r8a7791",
                                     "renesas,rcar-gen2-sata";
-                       reg = <0 0xee500000 0 0x2000>;
+                       reg = <0 0xee500000 0 0x200000>;
                        interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 814>;
                        power-domains = <&sysc R8A7791_PD_ALWAYS_ON>;
index 63a978ec81cc09f0a4d989fff7171d893ba07387..8e9eb4b704d32f2a23179435f158030772ca2365 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Device Tree Source for the r8a7792 SoC
+ * Device Tree Source for the R-Car V2H (R8A77920) SoC
  *
  * Copyright (C) 2016 Cogent Embedded Inc.
  */
                du: display@feb00000 {
                        compatible = "renesas,du-r8a7792";
                        reg = <0 0xfeb00000 0 0x40000>;
-                       reg-names = "du";
                        interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 724>,
index 6b2f3a4fd13d646c35e48fc46a7efa31ab42035e..f51601af89a2f4d5324e891a85944a6d57d2b074 100644 (file)
        status = "okay";
 };
 
+&cpu0 {
+       cpu0-supply = <&vdd_dvfs>;
+};
+
 &rwdt {
        timeout-sec = <60>;
        status = "okay";
                        compatible = "dlg,da9063-watchdog";
                };
        };
+
+       vdd_dvfs: regulator@68 {
+               compatible = "dlg,da9210";
+               reg = <0x68>;
+               interrupt-parent = <&irqc0>;
+               interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
+
+               regulator-min-microvolt = <1000000>;
+               regulator-max-microvolt = <1000000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
 };
 
 &i2c4 {
index 620a570307ffcffa0ac2cc42918684882952b4b2..bf05110fac4e23beb7b5dff259d44b317a49c0db 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Device Tree Source for the r8a7793 SoC
+ * Device Tree Source for the R-Car M2-N (R8A77930) SoC
  *
  * Copyright (C) 2014-2015 Renesas Electronics Corporation
  */
index 14cd39297e6f1e425b5821c50bfff6523c3a835d..29b0e32d14fc2ec4d9d5eb4b4186ad3f9062c9e0 100644 (file)
        clock-frequency = <100000>;
 };
 
+&pci0 {
+       status = "okay";
+       pinctrl-0 = <&usb0_pins>;
+       pinctrl-names = "default";
+};
+
+&pci1 {
+       status = "okay";
+       pinctrl-0 = <&usb1_pins>;
+       pinctrl-names = "default";
+};
+
+&pfc {
+       usb0_pins: usb0 {
+               groups = "usb0";
+               function = "usb0";
+       };
+
+       usb1_pins: usb1 {
+               groups = "usb1";
+               function = "usb1";
+       };
+};
+
 &scif2 {
        u-boot,dm-pre-reloc;
 };
@@ -23,3 +47,7 @@
                spi-rx-bus-width = <1>;
        };
 };
+
+&usbphy {
+       status = "okay";
+};
index daec965889d3e5fe18e764daaf77758e24aacd0c..60e91ebfa65dc5b3d76cd28218b51aa4fceb8c17 100644 (file)
        clock-frequency = <400000>;
 };
 
+&i2c7 {
+       status = "okay";
+       clock-frequency = <100000>;
+
+       pmic@58 {
+               compatible = "dlg,da9063";
+               reg = <0x58>;
+               interrupt-parent = <&gpio3>;
+               interrupts = <31 IRQ_TYPE_LEVEL_LOW>;
+               interrupt-controller;
+
+               onkey {
+                       compatible = "dlg,da9063-onkey";
+               };
+
+               rtc {
+                       compatible = "dlg,da9063-rtc";
+               };
+
+               wdt {
+                       compatible = "dlg,da9063-watchdog";
+               };
+       };
+};
+
 &mmcif0 {
        pinctrl-0 = <&mmcif0_pins>;
        pinctrl-names = "default";
index ea2ca4bdaf1c129c3932644a45bce1145ebabfb6..8d797d34816e3625e1c3a56aa7e6af8cadc219dc 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Device Tree Source for the r8a7794 SoC
+ * Device Tree Source for the R-Car E2 (R8A77940) SoC
  *
  * Copyright (C) 2014 Renesas Electronics Corporation
  * Copyright (C) 2014 Ulrich Hecht
                du: display@feb00000 {
                        compatible = "renesas,du-r8a7794";
                        reg = <0 0xfeb00000 0 0x40000>;
-                       reg-names = "du";
                        interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 724>, <&cpg CPG_MOD 723>;
index 3de640724dfd768de94786297017a4ecf1876850..dda339bd30848694202d4a52e5114af5cefe999e 100644 (file)
        };
 };
 
-&vcc_sdhi0 {
-       u-boot,off-on-delay-us = <20000>;
-};
-
-&sdhi2_pins {
-       groups = "sdhi2_data8", "sdhi2_ctrl", "sdhi2_ds";
-       power-source = <1800>;
-};
-
-&sdhi2_pins_uhs {
-       groups = "sdhi2_data8", "sdhi2_ctrl", "sdhi2_ds";
-};
-
 &sdhi0 {
        sd-uhs-sdr12;
        sd-uhs-sdr25;
index df50bf46406e6e904f31541e1767a1dfe8b4b25a..54515eaf0310f1727f4e695196b74b5bd7354645 100644 (file)
                 <&cpg CPG_MOD 723>,
                 <&cpg CPG_MOD 722>,
                 <&cpg CPG_MOD 721>,
-                <&cpg CPG_MOD 727>,
                 <&versaclock5 1>,
                 <&versaclock5 3>,
                 <&versaclock5 4>,
                 <&versaclock5 2>;
-       clock-names = "du.0", "du.1", "du.2", "du.3", "lvds.0",
+       clock-names = "du.0", "du.1", "du.2", "du.3",
                      "dclkin.0", "dclkin.1", "dclkin.2", "dclkin.3";
 };
index a22028bb3184b662257411bd33d6df8cfed7ddc1..66b608a0f1a9ab84f450c6cb2e760806bf42a54f 100644 (file)
@@ -8,23 +8,6 @@
 #include "r8a7795-salvator-x.dts"
 #include "r8a7795-u-boot.dtsi"
 
-&vcc_sdhi0 {
-       u-boot,off-on-delay-us = <20000>;
-};
-
-&vcc_sdhi3 {
-       u-boot,off-on-delay-us = <20000>;
-};
-
-&sdhi2_pins {
-       groups = "sdhi2_data8", "sdhi2_ctrl", "sdhi2_ds";
-       power-source = <1800>;
-};
-
-&sdhi2_pins_uhs {
-       groups = "sdhi2_data8", "sdhi2_ctrl", "sdhi2_ds";
-};
-
 &sdhi0 {
        sd-uhs-sdr12;
        sd-uhs-sdr25;
index 446822f5751c77e8a78fe599c8f818a7db8d51f5..d2d48b33b37f471b504b289bd909e6ab772b7c37 100644 (file)
                 <&cpg CPG_MOD 723>,
                 <&cpg CPG_MOD 722>,
                 <&cpg CPG_MOD 721>,
-                <&cpg CPG_MOD 727>,
                 <&versaclock5 1>,
                 <&x21_clk>,
                 <&x22_clk>,
                 <&versaclock5 2>;
-       clock-names = "du.0", "du.1", "du.2", "du.3", "lvds.0",
+       clock-names = "du.0", "du.1", "du.2", "du.3",
                      "dclkin.0", "dclkin.1", "dclkin.2", "dclkin.3";
 };
 
        ports {
                /* rsnd_port0 is on salvator-common */
                rsnd_port1: port@1 {
+                       reg = <1>;
                        rsnd_endpoint1: endpoint {
                                remote-endpoint = <&dw_hdmi0_snd_in>;
 
                        };
                };
                rsnd_port2: port@2 {
+                       reg = <2>;
                        rsnd_endpoint2: endpoint {
                                remote-endpoint = <&dw_hdmi1_snd_in>;
 
index cc22c57ae3199d5bf09e2af90cb87c43105b4124..3f4b1f5acc913f766071471ef083382106c38020 100644 (file)
        u-boot,dm-pre-reloc;
 };
 
-&soc {
-       rpc: rpc@0xee200000 {
-               compatible = "renesas,rpc-r8a7795", "renesas,rpc";
-               reg = <0 0xee200000 0 0x100>, <0 0x08000000 0 0>;
-               clocks = <&cpg CPG_MOD 917>;
-               bank-width = <2>;
-               status = "disabled";
+/ {
+       soc {
+               rpc: rpc@0xee200000 {
+                       compatible = "renesas,rpc-r8a7795", "renesas,rpc";
+                       reg = <0 0xee200000 0 0x100>, <0 0x08000000 0 0>;
+                       clocks = <&cpg CPG_MOD 917>;
+                       bank-width = <2>;
+                       status = "disabled";
+               };
        };
 };
index c87eed77de2c110189e0789b488aa63ec3dad589..abeac3059383969c1329406b3cbbf6bc582e7936 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Device Tree Source for the r8a7795 SoC
+ * Device Tree Source for the R-Car H3 (R8A77950) SoC
  *
  * Copyright (C) 2015 Renesas Electronics Corp.
  */
                #address-cells = <1>;
                #size-cells = <0>;
 
+               cpu-map {
+                       cluster0 {
+                               core0 {
+                                       cpu = <&a57_0>;
+                               };
+                               core1 {
+                                       cpu = <&a57_1>;
+                               };
+                               core2 {
+                                       cpu = <&a57_2>;
+                               };
+                               core3 {
+                                       cpu = <&a57_3>;
+                               };
+                       };
+
+                       cluster1 {
+                               core0 {
+                                       cpu = <&a53_0>;
+                               };
+                               core1 {
+                                       cpu = <&a53_1>;
+                               };
+                               core2 {
+                                       cpu = <&a53_2>;
+                               };
+                               core3 {
+                                       cpu = <&a53_3>;
+                               };
+                       };
+               };
+
                a57_0: cpu@0 {
-                       compatible = "arm,cortex-a57", "arm,armv8";
+                       compatible = "arm,cortex-a57";
                        reg = <0x0>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A7795_PD_CA57_CPU0>;
                        next-level-cache = <&L2_CA57>;
                        enable-method = "psci";
-                       clocks =<&cpg CPG_CORE R8A7795_CLK_Z>;
+                       clocks = <&cpg CPG_CORE R8A7795_CLK_Z>;
                        operating-points-v2 = <&cluster0_opp>;
+                       capacity-dmips-mhz = <1024>;
                        #cooling-cells = <2>;
                };
 
                a57_1: cpu@1 {
-                       compatible = "arm,cortex-a57", "arm,armv8";
+                       compatible = "arm,cortex-a57";
                        reg = <0x1>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A7795_PD_CA57_CPU1>;
                        next-level-cache = <&L2_CA57>;
                        enable-method = "psci";
-                       clocks =<&cpg CPG_CORE R8A7795_CLK_Z>;
+                       clocks = <&cpg CPG_CORE R8A7795_CLK_Z>;
                        operating-points-v2 = <&cluster0_opp>;
+                       capacity-dmips-mhz = <1024>;
                        #cooling-cells = <2>;
                };
 
                a57_2: cpu@2 {
-                       compatible = "arm,cortex-a57", "arm,armv8";
+                       compatible = "arm,cortex-a57";
                        reg = <0x2>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A7795_PD_CA57_CPU2>;
                        next-level-cache = <&L2_CA57>;
                        enable-method = "psci";
-                       clocks =<&cpg CPG_CORE R8A7795_CLK_Z>;
+                       clocks = <&cpg CPG_CORE R8A7795_CLK_Z>;
                        operating-points-v2 = <&cluster0_opp>;
+                       capacity-dmips-mhz = <1024>;
                        #cooling-cells = <2>;
                };
 
                a57_3: cpu@3 {
-                       compatible = "arm,cortex-a57", "arm,armv8";
+                       compatible = "arm,cortex-a57";
                        reg = <0x3>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A7795_PD_CA57_CPU3>;
                        next-level-cache = <&L2_CA57>;
                        enable-method = "psci";
-                       clocks =<&cpg CPG_CORE R8A7795_CLK_Z>;
+                       clocks = <&cpg CPG_CORE R8A7795_CLK_Z>;
                        operating-points-v2 = <&cluster0_opp>;
+                       capacity-dmips-mhz = <1024>;
                        #cooling-cells = <2>;
                };
 
                a53_0: cpu@100 {
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x100>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A7795_PD_CA53_CPU0>;
                        next-level-cache = <&L2_CA53>;
                        enable-method = "psci";
-                       clocks =<&cpg CPG_CORE R8A7795_CLK_Z2>;
+                       clocks = <&cpg CPG_CORE R8A7795_CLK_Z2>;
                        operating-points-v2 = <&cluster1_opp>;
+                       capacity-dmips-mhz = <535>;
                };
 
                a53_1: cpu@101 {
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x101>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A7795_PD_CA53_CPU1>;
                        next-level-cache = <&L2_CA53>;
                        enable-method = "psci";
-                       clocks =<&cpg CPG_CORE R8A7795_CLK_Z2>;
+                       clocks = <&cpg CPG_CORE R8A7795_CLK_Z2>;
                        operating-points-v2 = <&cluster1_opp>;
+                       capacity-dmips-mhz = <535>;
                };
 
                a53_2: cpu@102 {
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x102>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A7795_PD_CA53_CPU2>;
                        next-level-cache = <&L2_CA53>;
                        enable-method = "psci";
-                       clocks =<&cpg CPG_CORE R8A7795_CLK_Z2>;
+                       clocks = <&cpg CPG_CORE R8A7795_CLK_Z2>;
                        operating-points-v2 = <&cluster1_opp>;
+                       capacity-dmips-mhz = <535>;
                };
 
                a53_3: cpu@103 {
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x103>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A7795_PD_CA53_CPU3>;
                        next-level-cache = <&L2_CA53>;
                        enable-method = "psci";
-                       clocks =<&cpg CPG_CORE R8A7795_CLK_Z2>;
+                       clocks = <&cpg CPG_CORE R8A7795_CLK_Z2>;
                        operating-points-v2 = <&cluster1_opp>;
+                       capacity-dmips-mhz = <535>;
                };
 
                L2_CA57: cache-controller-0 {
                        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
                        resets = <&cpg 522>;
                        #thermal-sensor-cells = <1>;
-                       status = "okay";
                };
 
                intc_ex: interrupt-controller@e61c0000 {
                        status = "disabled";
                };
 
-               arm_cc630p: crypto@e6601000 {
-                       compatible = "arm,cryptocell-630p-ree";
-                       interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
-                       reg = <0x0 0xe6601000 0 0x1000>;
-                       clocks = <&cpg CPG_MOD 229>;
-                       resets = <&cpg 229>;
-                       power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-               };
-
                i2c3: i2c@e66d0000 {
                        #address-cells = <1>;
                        #size-cells = <0>;
                hsusb: usb@e6590000 {
                        compatible = "renesas,usbhs-r8a7795",
                                     "renesas,rcar-gen3-usbhs";
-                       reg = <0 0xe6590000 0 0x100>;
+                       reg = <0 0xe6590000 0 0x200>;
                        interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 704>;
+                       clocks = <&cpg CPG_MOD 704>, <&cpg CPG_MOD 703>;
                        dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
                               <&usb_dmac1 0>, <&usb_dmac1 1>;
                        dma-names = "ch0", "ch1", "ch2", "ch3";
                        phys = <&usb2_phy0>;
                        phy-names = "usb";
                        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-                       resets = <&cpg 704>;
+                       resets = <&cpg 704>, <&cpg 703>;
                        status = "disabled";
                };
 
                hsusb3: usb@e659c000 {
                        compatible = "renesas,usbhs-r8a7795",
                                     "renesas,rcar-gen3-usbhs";
-                       reg = <0 0xe659c000 0 0x100>;
+                       reg = <0 0xe659c000 0 0x200>;
                        interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 705>;
+                       clocks = <&cpg CPG_MOD 705>, <&cpg CPG_MOD 700>;
                        dmas = <&usb_dmac2 0>, <&usb_dmac2 1>,
                               <&usb_dmac3 0>, <&usb_dmac3 1>;
                        dma-names = "ch0", "ch1", "ch2", "ch3";
                        phys = <&usb2_phy3>;
                        phy-names = "usb";
                        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-                       resets = <&cpg 705>;
+                       resets = <&cpg 705>, <&cpg 700>;
                        status = "disabled";
                };
 
                        status = "disabled";
                };
 
+               arm_cc630p: crypto@e6601000 {
+                       compatible = "arm,cryptocell-630p-ree";
+                       interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+                       reg = <0x0 0xe6601000 0 0x1000>;
+                       clocks = <&cpg CPG_MOD 229>;
+                       resets = <&cpg 229>;
+                       power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
+               };
+
                dmac0: dma-controller@e6700000 {
                        compatible = "renesas,dmac-r8a7795",
                                     "renesas,rcar-dmac";
 
                                        vin0csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin0>;
+                                               remote-endpoint = <&csi20vin0>;
                                        };
                                        vin0csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin0>;
+                                               remote-endpoint = <&csi40vin0>;
                                        };
                                };
                        };
 
                                        vin1csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin1>;
+                                               remote-endpoint = <&csi20vin1>;
                                        };
                                        vin1csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin1>;
+                                               remote-endpoint = <&csi40vin1>;
                                        };
                                };
                        };
 
                                        vin2csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin2>;
+                                               remote-endpoint = <&csi20vin2>;
                                        };
                                        vin2csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin2>;
+                                               remote-endpoint = <&csi40vin2>;
                                        };
                                };
                        };
 
                                        vin3csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin3>;
+                                               remote-endpoint = <&csi20vin3>;
                                        };
                                        vin3csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin3>;
+                                               remote-endpoint = <&csi40vin3>;
                                        };
                                };
                        };
 
                                        vin4csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin4>;
+                                               remote-endpoint = <&csi20vin4>;
                                        };
                                        vin4csi41: endpoint@3 {
                                                reg = <3>;
-                                               remote-endpoint= <&csi41vin4>;
+                                               remote-endpoint = <&csi41vin4>;
                                        };
                                };
                        };
 
                                        vin5csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin5>;
+                                               remote-endpoint = <&csi20vin5>;
                                        };
                                        vin5csi41: endpoint@3 {
                                                reg = <3>;
-                                               remote-endpoint= <&csi41vin5>;
+                                               remote-endpoint = <&csi41vin5>;
                                        };
                                };
                        };
 
                                        vin6csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin6>;
+                                               remote-endpoint = <&csi20vin6>;
                                        };
                                        vin6csi41: endpoint@3 {
                                                reg = <3>;
-                                               remote-endpoint= <&csi41vin6>;
+                                               remote-endpoint = <&csi41vin6>;
                                        };
                                };
                        };
 
                                        vin7csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin7>;
+                                               remote-endpoint = <&csi20vin7>;
                                        };
                                        vin7csi41: endpoint@3 {
                                                reg = <3>;
-                                               remote-endpoint= <&csi41vin7>;
+                                               remote-endpoint = <&csi41vin7>;
                                        };
                                };
                        };
                                };
                        };
 
+                       rcar_sound,ssiu {
+                               ssiu00: ssiu-0 {
+                                       dmas = <&audma0 0x15>, <&audma1 0x16>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu01: ssiu-1 {
+                                       dmas = <&audma0 0x35>, <&audma1 0x36>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu02: ssiu-2 {
+                                       dmas = <&audma0 0x37>, <&audma1 0x38>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu03: ssiu-3 {
+                                       dmas = <&audma0 0x47>, <&audma1 0x48>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu04: ssiu-4 {
+                                       dmas = <&audma0 0x3F>, <&audma1 0x40>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu05: ssiu-5 {
+                                       dmas = <&audma0 0x43>, <&audma1 0x44>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu06: ssiu-6 {
+                                       dmas = <&audma0 0x4F>, <&audma1 0x50>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu07: ssiu-7 {
+                                       dmas = <&audma0 0x53>, <&audma1 0x54>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu10: ssiu-8 {
+                                       dmas = <&audma0 0x49>, <&audma1 0x4a>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu11: ssiu-9 {
+                                       dmas = <&audma0 0x4B>, <&audma1 0x4C>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu12: ssiu-10 {
+                                       dmas = <&audma0 0x57>, <&audma1 0x58>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu13: ssiu-11 {
+                                       dmas = <&audma0 0x59>, <&audma1 0x5A>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu14: ssiu-12 {
+                                       dmas = <&audma0 0x5F>, <&audma1 0x60>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu15: ssiu-13 {
+                                       dmas = <&audma0 0xC3>, <&audma1 0xC4>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu16: ssiu-14 {
+                                       dmas = <&audma0 0xC7>, <&audma1 0xC8>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu17: ssiu-15 {
+                                       dmas = <&audma0 0xCB>, <&audma1 0xCC>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu20: ssiu-16 {
+                                       dmas = <&audma0 0x63>, <&audma1 0x64>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu21: ssiu-17 {
+                                       dmas = <&audma0 0x67>, <&audma1 0x68>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu22: ssiu-18 {
+                                       dmas = <&audma0 0x6B>, <&audma1 0x6C>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu23: ssiu-19 {
+                                       dmas = <&audma0 0x6D>, <&audma1 0x6E>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu24: ssiu-20 {
+                                       dmas = <&audma0 0xCF>, <&audma1 0xCE>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu25: ssiu-21 {
+                                       dmas = <&audma0 0xEB>, <&audma1 0xEC>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu26: ssiu-22 {
+                                       dmas = <&audma0 0xED>, <&audma1 0xEE>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu27: ssiu-23 {
+                                       dmas = <&audma0 0xEF>, <&audma1 0xF0>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu30: ssiu-24 {
+                                       dmas = <&audma0 0x6f>, <&audma1 0x70>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu31: ssiu-25 {
+                                       dmas = <&audma0 0x21>, <&audma1 0x22>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu32: ssiu-26 {
+                                       dmas = <&audma0 0x23>, <&audma1 0x24>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu33: ssiu-27 {
+                                       dmas = <&audma0 0x25>, <&audma1 0x26>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu34: ssiu-28 {
+                                       dmas = <&audma0 0x27>, <&audma1 0x28>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu35: ssiu-29 {
+                                       dmas = <&audma0 0x29>, <&audma1 0x2A>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu36: ssiu-30 {
+                                       dmas = <&audma0 0x2B>, <&audma1 0x2C>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu37: ssiu-31 {
+                                       dmas = <&audma0 0x2D>, <&audma1 0x2E>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu40: ssiu-32 {
+                                       dmas =  <&audma0 0x71>, <&audma1 0x72>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu41: ssiu-33 {
+                                       dmas = <&audma0 0x17>, <&audma1 0x18>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu42: ssiu-34 {
+                                       dmas = <&audma0 0x19>, <&audma1 0x1A>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu43: ssiu-35 {
+                                       dmas = <&audma0 0x1B>, <&audma1 0x1C>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu44: ssiu-36 {
+                                       dmas = <&audma0 0x1D>, <&audma1 0x1E>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu45: ssiu-37 {
+                                       dmas = <&audma0 0x1F>, <&audma1 0x20>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu46: ssiu-38 {
+                                       dmas = <&audma0 0x31>, <&audma1 0x32>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu47: ssiu-39 {
+                                       dmas = <&audma0 0x33>, <&audma1 0x34>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu50: ssiu-40 {
+                                       dmas = <&audma0 0x73>, <&audma1 0x74>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu60: ssiu-41 {
+                                       dmas = <&audma0 0x75>, <&audma1 0x76>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu70: ssiu-42 {
+                                       dmas = <&audma0 0x79>, <&audma1 0x7a>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu80: ssiu-43 {
+                                       dmas = <&audma0 0x7b>, <&audma1 0x7c>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu90: ssiu-44 {
+                                       dmas = <&audma0 0x7d>, <&audma1 0x7e>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu91: ssiu-45 {
+                                       dmas = <&audma0 0x7F>, <&audma1 0x80>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu92: ssiu-46 {
+                                       dmas = <&audma0 0x81>, <&audma1 0x82>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu93: ssiu-47 {
+                                       dmas = <&audma0 0x83>, <&audma1 0x84>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu94: ssiu-48 {
+                                       dmas = <&audma0 0xA3>, <&audma1 0xA4>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu95: ssiu-49 {
+                                       dmas = <&audma0 0xA5>, <&audma1 0xA6>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu96: ssiu-50 {
+                                       dmas = <&audma0 0xA7>, <&audma1 0xA8>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu97: ssiu-51 {
+                                       dmas = <&audma0 0xA9>, <&audma1 0xAA>;
+                                       dma-names = "rx", "tx";
+                               };
+                       };
+
                        rcar_sound,ssi {
                                ssi0: ssi-0 {
                                        interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x01>, <&audma1 0x02>, <&audma0 0x15>, <&audma1 0x16>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x01>, <&audma1 0x02>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi1: ssi-1 {
                                         interrupts = <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x03>, <&audma1 0x04>, <&audma0 0x49>, <&audma1 0x4a>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x03>, <&audma1 0x04>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi2: ssi-2 {
                                        interrupts = <GIC_SPI 372 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x05>, <&audma1 0x06>, <&audma0 0x63>, <&audma1 0x64>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x05>, <&audma1 0x06>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi3: ssi-3 {
                                        interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x07>, <&audma1 0x08>, <&audma0 0x6f>, <&audma1 0x70>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x07>, <&audma1 0x08>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi4: ssi-4 {
                                        interrupts = <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x09>, <&audma1 0x0a>, <&audma0 0x71>, <&audma1 0x72>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x09>, <&audma1 0x0a>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi5: ssi-5 {
                                        interrupts = <GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x0b>, <&audma1 0x0c>, <&audma0 0x73>, <&audma1 0x74>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x0b>, <&audma1 0x0c>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi6: ssi-6 {
                                        interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x0d>, <&audma1 0x0e>, <&audma0 0x75>, <&audma1 0x76>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x0d>, <&audma1 0x0e>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi7: ssi-7 {
                                        interrupts = <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x0f>, <&audma1 0x10>, <&audma0 0x79>, <&audma1 0x7a>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x0f>, <&audma1 0x10>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi8: ssi-8 {
                                        interrupts = <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x11>, <&audma1 0x12>, <&audma0 0x7b>, <&audma1 0x7c>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x11>, <&audma1 0x12>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi9: ssi-9 {
                                        interrupts = <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x13>, <&audma1 0x14>, <&audma0 0x7d>, <&audma1 0x7e>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
-                               };
-                       };
-
-                       ports {
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-                               port@0 {
-                                       reg = <0>;
-                               };
-                               port@1 {
-                                       reg = <1>;
-                               };
-                               port@2 {
-                                       reg = <2>;
+                                       dmas = <&audma0 0x13>, <&audma1 0x14>;
+                                       dma-names = "rx", "tx";
                                };
                        };
                };
                        compatible = "generic-ohci";
                        reg = <0 0xee080000 0 0x100>;
                        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 703>;
+                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
                        phys = <&usb2_phy0>;
                        phy-names = "usb";
                        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-                       resets = <&cpg 703>;
+                       resets = <&cpg 703>, <&cpg 704>;
                        status = "disabled";
                };
 
                        compatible = "generic-ohci";
                        reg = <0 0xee0e0000 0 0x100>;
                        interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 700>;
+                       clocks = <&cpg CPG_MOD 700>, <&cpg CPG_MOD 705>;
                        phys = <&usb2_phy3>;
                        phy-names = "usb";
                        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-                       resets = <&cpg 700>;
+                       resets = <&cpg 700>, <&cpg 705>;
                        status = "disabled";
                };
 
                        compatible = "generic-ehci";
                        reg = <0 0xee080100 0 0x100>;
                        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 703>;
+                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
                        phys = <&usb2_phy0>;
                        phy-names = "usb";
                        companion = <&ohci0>;
                        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-                       resets = <&cpg 703>;
+                       resets = <&cpg 703>, <&cpg 704>;
                        status = "disabled";
                };
 
                        compatible = "generic-ehci";
                        reg = <0 0xee0e0100 0 0x100>;
                        interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 700>;
+                       clocks = <&cpg CPG_MOD 700>, <&cpg CPG_MOD 705>;
                        phys = <&usb2_phy3>;
                        phy-names = "usb";
                        companion = <&ohci3>;
                        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-                       resets = <&cpg 700>;
+                       resets = <&cpg 700>, <&cpg 705>;
                        status = "disabled";
                };
 
                                     "renesas,rcar-gen3-usb2-phy";
                        reg = <0 0xee080200 0 0x700>;
                        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 703>;
+                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
                        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-                       resets = <&cpg 703>;
+                       resets = <&cpg 703>, <&cpg 704>;
                        #phy-cells = <0>;
                        status = "disabled";
                };
                                     "renesas,rcar-gen3-usb2-phy";
                        reg = <0 0xee0e0200 0 0x700>;
                        interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 700>;
+                       clocks = <&cpg CPG_MOD 700>, <&cpg CPG_MOD 705>;
                        power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
-                       resets = <&cpg 700>;
+                       resets = <&cpg 700>, <&cpg 705>;
                        #phy-cells = <0>;
                        status = "disabled";
                };
 
                du: display@feb00000 {
                        compatible = "renesas,du-r8a7795";
-                       reg = <0 0xfeb00000 0 0x80000>,
-                             <0 0xfeb90000 0 0x14>;
-                       reg-names = "du", "lvds.0";
+                       reg = <0 0xfeb00000 0 0x80000>;
                        interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 269 IRQ_TYPE_LEVEL_HIGH>,
                        clocks = <&cpg CPG_MOD 724>,
                                 <&cpg CPG_MOD 723>,
                                 <&cpg CPG_MOD 722>,
-                                <&cpg CPG_MOD 721>,
-                                <&cpg CPG_MOD 727>;
-                       clock-names = "du.0", "du.1", "du.2", "du.3", "lvds.0";
+                                <&cpg CPG_MOD 721>;
+                       clock-names = "du.0", "du.1", "du.2", "du.3";
                        vsps = <&vspd0 0 &vspd1 0 &vspd2 0 &vspd0 1>;
                        status = "disabled";
 
                                port@3 {
                                        reg = <3>;
                                        du_out_lvds0: endpoint {
+                                               remote-endpoint = <&lvds0_in>;
+                                       };
+                               };
+                       };
+               };
+
+               lvds0: lvds@feb90000 {
+                       compatible = "renesas,r8a7795-lvds";
+                       reg = <0 0xfeb90000 0 0x14>;
+                       clocks = <&cpg CPG_MOD 727>;
+                       power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
+                       resets = <&cpg 727>;
+                       status = "disabled";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@0 {
+                                       reg = <0>;
+                                       lvds0_in: endpoint {
+                                               remote-endpoint = <&du_out_lvds0>;
+                                       };
+                               };
+                               port@1 {
+                                       reg = <1>;
+                                       lvds0_out: endpoint {
                                        };
                                };
                        };
                        cooling-maps {
                                map0 {
                                        trip = <&sensor1_passive>;
-                                       cooling-device = <&a57_0 4 4>;
+                                       cooling-device = <&a57_0 4 4>,
+                                                        <&a57_1 4 4>,
+                                                        <&a57_2 4 4>,
+                                                        <&a57_3 4 4>;
                                };
                        };
                };
                        cooling-maps {
                                map0 {
                                        trip = <&sensor2_passive>;
-                                       cooling-device = <&a57_0 4 4>;
+                                       cooling-device = <&a57_0 4 4>,
+                                                        <&a57_1 4 4>,
+                                                        <&a57_2 4 4>,
+                                                        <&a57_3 4 4>;
                                };
                        };
                };
                        cooling-maps {
                                map0 {
                                        trip = <&sensor3_passive>;
-                                       cooling-device = <&a57_0 4 4>;
+                                       cooling-device = <&a57_0 4 4>,
+                                                        <&a57_1 4 4>,
+                                                        <&a57_2 4 4>,
+                                                        <&a57_3 4 4>;
                                };
                        };
                };
index 612cc87c71045137dc16c1e11ea0a445f1d5d843..1defe84f9812abdf2b2580a9230790d0a0b3078b 100644 (file)
        };
 };
 
-&vcc_sdhi0 {
-       u-boot,off-on-delay-us = <20000>;
-};
-
-&sdhi2_pins {
-       groups = "sdhi2_data8", "sdhi2_ctrl", "sdhi2_ds";
-       power-source = <1800>;
-};
-
-&sdhi2_pins_uhs {
-       groups = "sdhi2_data8", "sdhi2_ctrl", "sdhi2_ds";
-};
-
 &sdhi0 {
        sd-uhs-sdr12;
        sd-uhs-sdr25;
index cbd8acbf537e634ab461bd03c9459203440bfbd0..9e4594c27fa6c5534d074eae609ece05eec8538e 100644 (file)
        clocks = <&cpg CPG_MOD 724>,
                 <&cpg CPG_MOD 723>,
                 <&cpg CPG_MOD 722>,
-                <&cpg CPG_MOD 727>,
                 <&versaclock5 1>,
                 <&versaclock5 3>,
                 <&versaclock5 2>;
-       clock-names = "du.0", "du.1", "du.2", "lvds.0",
+       clock-names = "du.0", "du.1", "du.2",
                      "dclkin.0", "dclkin.1", "dclkin.2";
 };
index c730b90a42c5d8bd30c5da18dadcd0a91320be06..2610f8baa84dd7a3ad8d398cbacfe5a0c401d55f 100644 (file)
@@ -8,23 +8,6 @@
 #include "r8a7796-salvator-x.dts"
 #include "r8a7796-u-boot.dtsi"
 
-&vcc_sdhi0 {
-       u-boot,off-on-delay-us = <20000>;
-};
-
-&vcc_sdhi3 {
-       u-boot,off-on-delay-us = <20000>;
-};
-
-&sdhi2_pins {
-       groups = "sdhi2_data8", "sdhi2_ctrl", "sdhi2_ds";
-       power-source = <1800>;
-};
-
-&sdhi2_pins_uhs {
-       groups = "sdhi2_data8", "sdhi2_ctrl", "sdhi2_ds";
-};
-
 &sdhi0 {
        sd-uhs-sdr12;
        sd-uhs-sdr25;
index 052d72acc862b83c659f0056deeb9fe720d875a6..b4f9567cb9f86312164fd4d2302a926974df75a6 100644 (file)
        clocks = <&cpg CPG_MOD 724>,
                 <&cpg CPG_MOD 723>,
                 <&cpg CPG_MOD 722>,
-                <&cpg CPG_MOD 727>,
                 <&versaclock5 1>,
                 <&x21_clk>,
                 <&versaclock5 2>;
-       clock-names = "du.0", "du.1", "du.2", "lvds.0",
+       clock-names = "du.0", "du.1", "du.2",
                      "dclkin.0", "dclkin.1", "dclkin.2";
 };
 
index 4655259afe1a92b048c2a63f8f6de91dfe2db7cd..622105486b58deb19d698ce03a7a2a07142779a2 100644 (file)
        u-boot,dm-pre-reloc;
 };
 
-&soc {
-       rpc: rpc@0xee200000 {
-               compatible = "renesas,rpc-r8a7796", "renesas,rpc";
-               reg = <0 0xee200000 0 0x100>, <0 0x08000000 0 0>;
-               clocks = <&cpg CPG_MOD 917>;
-               bank-width = <2>;
-               status = "disabled";
+/ {
+       soc {
+               rpc: rpc@0xee200000 {
+                       compatible = "renesas,rpc-r8a7796", "renesas,rpc";
+                       reg = <0 0xee200000 0 0x100>, <0 0x08000000 0 0>;
+                       clocks = <&cpg CPG_MOD 917>;
+                       bank-width = <2>;
+                       status = "disabled";
+               };
        };
 };
index bf860f06d6c0f4ccf45258d4b8c67a96fa7b14d7..cdf784899cf8c06876888c5cfcd510bf645085ea 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Device Tree Source for the r8a7796 SoC
+ * Device Tree Source for the R-Car M3-W (R8A77960) SoC
  *
  * Copyright (C) 2016-2017 Renesas Electronics Corp.
  */
                #address-cells = <1>;
                #size-cells = <0>;
 
+               cpu-map {
+                       cluster0 {
+                               core0 {
+                                       cpu = <&a57_0>;
+                               };
+                               core1 {
+                                       cpu = <&a57_1>;
+                               };
+                       };
+
+                       cluster1 {
+                               core0 {
+                                       cpu = <&a53_0>;
+                               };
+                               core1 {
+                                       cpu = <&a53_1>;
+                               };
+                               core2 {
+                                       cpu = <&a53_2>;
+                               };
+                               core3 {
+                                       cpu = <&a53_3>;
+                               };
+                       };
+               };
+
                a57_0: cpu@0 {
-                       compatible = "arm,cortex-a57", "arm,armv8";
+                       compatible = "arm,cortex-a57";
                        reg = <0x0>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A7796_PD_CA57_CPU0>;
                        next-level-cache = <&L2_CA57>;
                        enable-method = "psci";
-                       clocks =<&cpg CPG_CORE R8A7796_CLK_Z>;
+                       clocks = <&cpg CPG_CORE R8A7796_CLK_Z>;
                        operating-points-v2 = <&cluster0_opp>;
+                       capacity-dmips-mhz = <1024>;
                        #cooling-cells = <2>;
                };
 
                a57_1: cpu@1 {
-                       compatible = "arm,cortex-a57", "arm,armv8";
+                       compatible = "arm,cortex-a57";
                        reg = <0x1>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A7796_PD_CA57_CPU1>;
                        next-level-cache = <&L2_CA57>;
                        enable-method = "psci";
-                       clocks =<&cpg CPG_CORE R8A7796_CLK_Z>;
+                       clocks = <&cpg CPG_CORE R8A7796_CLK_Z>;
                        operating-points-v2 = <&cluster0_opp>;
+                       capacity-dmips-mhz = <1024>;
                        #cooling-cells = <2>;
                };
 
                a53_0: cpu@100 {
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x100>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A7796_PD_CA53_CPU0>;
                        next-level-cache = <&L2_CA53>;
                        enable-method = "psci";
-                       clocks =<&cpg CPG_CORE R8A7796_CLK_Z2>;
+                       clocks = <&cpg CPG_CORE R8A7796_CLK_Z2>;
                        operating-points-v2 = <&cluster1_opp>;
+                       capacity-dmips-mhz = <535>;
                };
 
                a53_1: cpu@101 {
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x101>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A7796_PD_CA53_CPU1>;
                        next-level-cache = <&L2_CA53>;
                        enable-method = "psci";
-                       clocks =<&cpg CPG_CORE R8A7796_CLK_Z2>;
+                       clocks = <&cpg CPG_CORE R8A7796_CLK_Z2>;
                        operating-points-v2 = <&cluster1_opp>;
+                       capacity-dmips-mhz = <535>;
                };
 
                a53_2: cpu@102 {
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x102>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A7796_PD_CA53_CPU2>;
                        next-level-cache = <&L2_CA53>;
                        enable-method = "psci";
-                       clocks =<&cpg CPG_CORE R8A7796_CLK_Z2>;
+                       clocks = <&cpg CPG_CORE R8A7796_CLK_Z2>;
                        operating-points-v2 = <&cluster1_opp>;
+                       capacity-dmips-mhz = <535>;
                };
 
                a53_3: cpu@103 {
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x103>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A7796_PD_CA53_CPU3>;
                        next-level-cache = <&L2_CA53>;
                        enable-method = "psci";
-                       clocks =<&cpg CPG_CORE R8A7796_CLK_Z2>;
+                       clocks = <&cpg CPG_CORE R8A7796_CLK_Z2>;
                        operating-points-v2 = <&cluster1_opp>;
+                       capacity-dmips-mhz = <535>;
                };
 
                L2_CA57: cache-controller-0 {
                clock-frequency = <0>;
        };
 
-       soc: soc {
+       soc {
                compatible = "simple-bus";
                interrupt-parent = <&gic>;
                #address-cells = <2>;
                        reg = <0 0xe6060000 0 0x50c>;
                };
 
+               cmt0: timer@e60f0000 {
+                       compatible = "renesas,r8a7796-cmt0",
+                                    "renesas,rcar-gen3-cmt0";
+                       reg = <0 0xe60f0000 0 0x1004>;
+                       interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 303>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
+                       resets = <&cpg 303>;
+                       status = "disabled";
+               };
+
+               cmt1: timer@e6130000 {
+                       compatible = "renesas,r8a7796-cmt1",
+                                    "renesas,rcar-gen3-cmt1";
+                       reg = <0 0xe6130000 0 0x1004>;
+                       interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 302>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
+                       resets = <&cpg 302>;
+                       status = "disabled";
+               };
+
+               cmt2: timer@e6140000 {
+                       compatible = "renesas,r8a7796-cmt1",
+                                    "renesas,rcar-gen3-cmt1";
+                       reg = <0 0xe6140000 0 0x1004>;
+                       interrupts = <GIC_SPI 398 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 399 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 400 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 401 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 402 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 403 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 404 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 405 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 301>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
+                       resets = <&cpg 301>;
+                       status = "disabled";
+               };
+
+               cmt3: timer@e6148000 {
+                       compatible = "renesas,r8a7796-cmt1",
+                                    "renesas,rcar-gen3-cmt1";
+                       reg = <0 0xe6148000 0 0x1004>;
+                       interrupts = <GIC_SPI 470 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 471 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 472 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 473 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 474 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 475 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 476 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 477 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 300>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
+                       resets = <&cpg 300>;
+                       status = "disabled";
+               };
+
                cpg: clock-controller@e6150000 {
                        compatible = "renesas,r8a7796-cpg-mssr";
                        reg = <0 0xe6150000 0 0x1000>;
                        power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
                        resets = <&cpg 522>;
                        #thermal-sensor-cells = <1>;
-                       status = "okay";
                };
 
                intc_ex: interrupt-controller@e61c0000 {
                hsusb: usb@e6590000 {
                        compatible = "renesas,usbhs-r8a7796",
                                     "renesas,rcar-gen3-usbhs";
-                       reg = <0 0xe6590000 0 0x100>;
+                       reg = <0 0xe6590000 0 0x200>;
                        interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 704>;
+                       clocks = <&cpg CPG_MOD 704>, <&cpg CPG_MOD 703>;
                        dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
                               <&usb_dmac1 0>, <&usb_dmac1 1>;
                        dma-names = "ch0", "ch1", "ch2", "ch3";
                        phys = <&usb2_phy0>;
                        phy-names = "usb";
                        power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
-                       resets = <&cpg 704>;
+                       resets = <&cpg 704>, <&cpg 703>;
                        status = "disabled";
                };
 
                                 <&cpg CPG_CORE R8A7796_CLK_S3D1>,
                                 <&scif_clk>;
                        clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac1 0x13>, <&dmac1 0x12>,
+                              <&dmac2 0x13>, <&dmac2 0x12>;
+                       dma-names = "tx", "rx", "tx", "rx";
                        power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
                        resets = <&cpg 310>;
                        status = "disabled";
 
                                        vin0csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin0>;
+                                               remote-endpoint = <&csi20vin0>;
                                        };
                                        vin0csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin0>;
+                                               remote-endpoint = <&csi40vin0>;
                                        };
                                };
                        };
 
                                        vin1csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin1>;
+                                               remote-endpoint = <&csi20vin1>;
                                        };
                                        vin1csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin1>;
+                                               remote-endpoint = <&csi40vin1>;
                                        };
                                };
                        };
 
                                        vin2csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin2>;
+                                               remote-endpoint = <&csi20vin2>;
                                        };
                                        vin2csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin2>;
+                                               remote-endpoint = <&csi40vin2>;
                                        };
                                };
                        };
 
                                        vin3csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin3>;
+                                               remote-endpoint = <&csi20vin3>;
                                        };
                                        vin3csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin3>;
+                                               remote-endpoint = <&csi40vin3>;
                                        };
                                };
                        };
 
                                        vin4csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin4>;
+                                               remote-endpoint = <&csi20vin4>;
                                        };
                                        vin4csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin4>;
+                                               remote-endpoint = <&csi40vin4>;
                                        };
                                };
                        };
 
                                        vin5csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin5>;
+                                               remote-endpoint = <&csi20vin5>;
                                        };
                                        vin5csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin5>;
+                                               remote-endpoint = <&csi40vin5>;
                                        };
                                };
                        };
 
                                        vin6csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin6>;
+                                               remote-endpoint = <&csi20vin6>;
                                        };
                                        vin6csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin6>;
+                                               remote-endpoint = <&csi40vin6>;
                                        };
                                };
                        };
 
                                        vin7csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin7>;
+                                               remote-endpoint = <&csi20vin7>;
                                        };
                                        vin7csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin7>;
+                                               remote-endpoint = <&csi40vin7>;
                                        };
                                };
                        };
                                };
                        };
 
+                       rcar_sound,ssiu {
+                               ssiu00: ssiu-0 {
+                                       dmas = <&audma0 0x15>, <&audma1 0x16>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu01: ssiu-1 {
+                                       dmas = <&audma0 0x35>, <&audma1 0x36>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu02: ssiu-2 {
+                                       dmas = <&audma0 0x37>, <&audma1 0x38>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu03: ssiu-3 {
+                                       dmas = <&audma0 0x47>, <&audma1 0x48>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu04: ssiu-4 {
+                                       dmas = <&audma0 0x3F>, <&audma1 0x40>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu05: ssiu-5 {
+                                       dmas = <&audma0 0x43>, <&audma1 0x44>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu06: ssiu-6 {
+                                       dmas = <&audma0 0x4F>, <&audma1 0x50>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu07: ssiu-7 {
+                                       dmas = <&audma0 0x53>, <&audma1 0x54>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu10: ssiu-8 {
+                                       dmas = <&audma0 0x49>, <&audma1 0x4a>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu11: ssiu-9 {
+                                       dmas = <&audma0 0x4B>, <&audma1 0x4C>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu12: ssiu-10 {
+                                       dmas = <&audma0 0x57>, <&audma1 0x58>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu13: ssiu-11 {
+                                       dmas = <&audma0 0x59>, <&audma1 0x5A>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu14: ssiu-12 {
+                                       dmas = <&audma0 0x5F>, <&audma1 0x60>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu15: ssiu-13 {
+                                       dmas = <&audma0 0xC3>, <&audma1 0xC4>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu16: ssiu-14 {
+                                       dmas = <&audma0 0xC7>, <&audma1 0xC8>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu17: ssiu-15 {
+                                       dmas = <&audma0 0xCB>, <&audma1 0xCC>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu20: ssiu-16 {
+                                       dmas = <&audma0 0x63>, <&audma1 0x64>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu21: ssiu-17 {
+                                       dmas = <&audma0 0x67>, <&audma1 0x68>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu22: ssiu-18 {
+                                       dmas = <&audma0 0x6B>, <&audma1 0x6C>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu23: ssiu-19 {
+                                       dmas = <&audma0 0x6D>, <&audma1 0x6E>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu24: ssiu-20 {
+                                       dmas = <&audma0 0xCF>, <&audma1 0xCE>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu25: ssiu-21 {
+                                       dmas = <&audma0 0xEB>, <&audma1 0xEC>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu26: ssiu-22 {
+                                       dmas = <&audma0 0xED>, <&audma1 0xEE>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu27: ssiu-23 {
+                                       dmas = <&audma0 0xEF>, <&audma1 0xF0>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu30: ssiu-24 {
+                                       dmas = <&audma0 0x6f>, <&audma1 0x70>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu31: ssiu-25 {
+                                       dmas = <&audma0 0x21>, <&audma1 0x22>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu32: ssiu-26 {
+                                       dmas = <&audma0 0x23>, <&audma1 0x24>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu33: ssiu-27 {
+                                       dmas = <&audma0 0x25>, <&audma1 0x26>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu34: ssiu-28 {
+                                       dmas = <&audma0 0x27>, <&audma1 0x28>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu35: ssiu-29 {
+                                       dmas = <&audma0 0x29>, <&audma1 0x2A>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu36: ssiu-30 {
+                                       dmas = <&audma0 0x2B>, <&audma1 0x2C>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu37: ssiu-31 {
+                                       dmas = <&audma0 0x2D>, <&audma1 0x2E>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu40: ssiu-32 {
+                                       dmas =  <&audma0 0x71>, <&audma1 0x72>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu41: ssiu-33 {
+                                       dmas = <&audma0 0x17>, <&audma1 0x18>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu42: ssiu-34 {
+                                       dmas = <&audma0 0x19>, <&audma1 0x1A>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu43: ssiu-35 {
+                                       dmas = <&audma0 0x1B>, <&audma1 0x1C>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu44: ssiu-36 {
+                                       dmas = <&audma0 0x1D>, <&audma1 0x1E>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu45: ssiu-37 {
+                                       dmas = <&audma0 0x1F>, <&audma1 0x20>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu46: ssiu-38 {
+                                       dmas = <&audma0 0x31>, <&audma1 0x32>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu47: ssiu-39 {
+                                       dmas = <&audma0 0x33>, <&audma1 0x34>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu50: ssiu-40 {
+                                       dmas = <&audma0 0x73>, <&audma1 0x74>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu60: ssiu-41 {
+                                       dmas = <&audma0 0x75>, <&audma1 0x76>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu70: ssiu-42 {
+                                       dmas = <&audma0 0x79>, <&audma1 0x7a>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu80: ssiu-43 {
+                                       dmas = <&audma0 0x7b>, <&audma1 0x7c>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu90: ssiu-44 {
+                                       dmas = <&audma0 0x7d>, <&audma1 0x7e>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu91: ssiu-45 {
+                                       dmas = <&audma0 0x7F>, <&audma1 0x80>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu92: ssiu-46 {
+                                       dmas = <&audma0 0x81>, <&audma1 0x82>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu93: ssiu-47 {
+                                       dmas = <&audma0 0x83>, <&audma1 0x84>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu94: ssiu-48 {
+                                       dmas = <&audma0 0xA3>, <&audma1 0xA4>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu95: ssiu-49 {
+                                       dmas = <&audma0 0xA5>, <&audma1 0xA6>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu96: ssiu-50 {
+                                       dmas = <&audma0 0xA7>, <&audma1 0xA8>;
+                                       dma-names = "rx", "tx";
+                               };
+                               ssiu97: ssiu-51 {
+                                       dmas = <&audma0 0xA9>, <&audma1 0xAA>;
+                                       dma-names = "rx", "tx";
+                               };
+                       };
+
                        rcar_sound,ssi {
                                ssi0: ssi-0 {
                                        interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x01>, <&audma1 0x02>, <&audma0 0x15>, <&audma1 0x16>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x01>, <&audma1 0x02>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi1: ssi-1 {
                                        interrupts = <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x03>, <&audma1 0x04>, <&audma0 0x49>, <&audma1 0x4a>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x03>, <&audma1 0x04>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi2: ssi-2 {
                                        interrupts = <GIC_SPI 372 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x05>, <&audma1 0x06>, <&audma0 0x63>, <&audma1 0x64>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x05>, <&audma1 0x06>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi3: ssi-3 {
                                        interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x07>, <&audma1 0x08>, <&audma0 0x6f>, <&audma1 0x70>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x07>, <&audma1 0x08>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi4: ssi-4 {
                                        interrupts = <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x09>, <&audma1 0x0a>, <&audma0 0x71>, <&audma1 0x72>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x09>, <&audma1 0x0a>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi5: ssi-5 {
                                        interrupts = <GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x0b>, <&audma1 0x0c>, <&audma0 0x73>, <&audma1 0x74>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x0b>, <&audma1 0x0c>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi6: ssi-6 {
                                        interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x0d>, <&audma1 0x0e>, <&audma0 0x75>, <&audma1 0x76>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x0d>, <&audma1 0x0e>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi7: ssi-7 {
                                        interrupts = <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x0f>, <&audma1 0x10>, <&audma0 0x79>, <&audma1 0x7a>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x0f>, <&audma1 0x10>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi8: ssi-8 {
                                        interrupts = <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x11>, <&audma1 0x12>, <&audma0 0x7b>, <&audma1 0x7c>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x11>, <&audma1 0x12>;
+                                       dma-names = "rx", "tx";
                                };
                                ssi9: ssi-9 {
                                        interrupts = <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH>;
-                                       dmas = <&audma0 0x13>, <&audma1 0x14>, <&audma0 0x7d>, <&audma1 0x7e>;
-                                       dma-names = "rx", "tx", "rxu", "txu";
+                                       dmas = <&audma0 0x13>, <&audma1 0x14>;
+                                       dma-names = "rx", "tx";
                                };
                        };
 
                        compatible = "generic-ohci";
                        reg = <0 0xee080000 0 0x100>;
                        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 703>;
+                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
                        phys = <&usb2_phy0>;
                        phy-names = "usb";
                        power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
-                       resets = <&cpg 703>;
+                       resets = <&cpg 703>, <&cpg 704>;
                        status = "disabled";
                };
 
                        compatible = "generic-ehci";
                        reg = <0 0xee080100 0 0x100>;
                        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 703>;
+                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
                        phys = <&usb2_phy0>;
                        phy-names = "usb";
-                       companion= <&ohci0>;
+                       companion = <&ohci0>;
                        power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
-                       resets = <&cpg 703>;
+                       resets = <&cpg 703>, <&cpg 704>;
                        status = "disabled";
                };
 
                        clocks = <&cpg CPG_MOD 702>;
                        phys = <&usb2_phy1>;
                        phy-names = "usb";
-                       companion= <&ohci1>;
+                       companion = <&ohci1>;
                        power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
                        resets = <&cpg 702>;
                        status = "disabled";
                                     "renesas,rcar-gen3-usb2-phy";
                        reg = <0 0xee080200 0 0x700>;
                        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 703>;
+                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
                        power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
-                       resets = <&cpg 703>;
+                       resets = <&cpg 703>, <&cpg 704>;
                        #phy-cells = <0>;
                        status = "disabled";
                };
 
                du: display@feb00000 {
                        compatible = "renesas,du-r8a7796";
-                       reg = <0 0xfeb00000 0 0x70000>,
-                             <0 0xfeb90000 0 0x14>;
-                       reg-names = "du", "lvds.0";
+                       reg = <0 0xfeb00000 0 0x70000>;
                        interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>,
                                     <GIC_SPI 269 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&cpg CPG_MOD 724>,
                                 <&cpg CPG_MOD 723>,
-                                <&cpg CPG_MOD 722>,
-                                <&cpg CPG_MOD 727>;
-                       clock-names = "du.0", "du.1", "du.2", "lvds.0";
+                                <&cpg CPG_MOD 722>;
+                       clock-names = "du.0", "du.1", "du.2";
                        status = "disabled";
 
                        vsps = <&vspd0 &vspd1 &vspd2>;
                                port@2 {
                                        reg = <2>;
                                        du_out_lvds0: endpoint {
+                                               remote-endpoint = <&lvds0_in>;
+                                       };
+                               };
+                       };
+               };
+
+               lvds0: lvds@feb90000 {
+                       compatible = "renesas,r8a7796-lvds";
+                       reg = <0 0xfeb90000 0 0x14>;
+                       clocks = <&cpg CPG_MOD 727>;
+                       power-domains = <&sysc R8A7796_PD_ALWAYS_ON>;
+                       resets = <&cpg 727>;
+                       status = "disabled";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@0 {
+                                       reg = <0>;
+                                       lvds0_in: endpoint {
+                                               remote-endpoint = <&du_out_lvds0>;
+                                       };
+                               };
+                               port@1 {
+                                       reg = <1>;
+                                       lvds0_out: endpoint {
                                        };
                                };
                        };
                        cooling-maps {
                                map0 {
                                        trip = <&sensor1_passive>;
-                                       cooling-device = <&a57_0 5 5>;
+                                       cooling-device = <&a57_0 5 5>, <&a57_1 5 5>;
                                };
                        };
                };
                        cooling-maps {
                                map0 {
                                        trip = <&sensor2_passive>;
-                                       cooling-device = <&a57_0 5 5>;
+                                       cooling-device = <&a57_0 5 5>, <&a57_1 5 5>;
                                };
                        };
                };
                        cooling-maps {
                                map0 {
                                        trip = <&sensor3_passive>;
-                                       cooling-device = <&a57_0 5 5>;
+                                       cooling-device = <&a57_0 5 5>, <&a57_1 5 5>;
                                };
                        };
                };
diff --git a/arch/arm/dts/r8a77965-m3nulcb-u-boot.dts b/arch/arm/dts/r8a77965-m3nulcb-u-boot.dts
new file mode 100644 (file)
index 0000000..8ecfc7a
--- /dev/null
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source extras for U-Boot for the ULCB board
+ *
+ * Copyright (C) 2018 Marek Vasut <marek.vasut@gmail.com>
+ */
+
+#include "r8a77965-m3nulcb.dts"
+#include "r8a77965-u-boot.dtsi"
+
+/ {
+       cpld {
+               compatible = "renesas,ulcb-cpld";
+               status = "okay";
+               gpio-sck = <&gpio6 8 0>;
+               gpio-mosi = <&gpio6 7 0>;
+               gpio-miso = <&gpio6 10 0>;
+               gpio-sstbz = <&gpio2 3 0>;
+       };
+};
+
+&sdhi0 {
+       sd-uhs-sdr12;
+       sd-uhs-sdr25;
+       sd-uhs-sdr104;
+       max-frequency = <208000000>;
+       status = "okay";
+};
+
+&sdhi2 {
+       mmc-hs400-1_8v;
+       max-frequency = <200000000>;
+       status = "okay";
+};
diff --git a/arch/arm/dts/r8a77965-m3nulcb.dts b/arch/arm/dts/r8a77965-m3nulcb.dts
new file mode 100644 (file)
index 0000000..964078b
--- /dev/null
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Device Tree Source for the M3NULCB (R-Car Starter Kit Pro) board
+ *
+ * Copyright (C) 2018 Renesas Electronics Corp.
+ * Copyright (C) 2018 Cogent Embedded, Inc.
+ */
+
+/dts-v1/;
+#include "r8a77965.dtsi"
+#include "ulcb.dtsi"
+
+/ {
+       model = "Renesas M3NULCB board based on r8a77965";
+       compatible = "renesas,m3nulcb", "renesas,r8a77965";
+
+       memory@48000000 {
+               device_type = "memory";
+               /* first 128MB is reserved for secure area. */
+               reg = <0x0 0x48000000 0x0 0x78000000>;
+       };
+};
+
+&du {
+       clocks = <&cpg CPG_MOD 724>,
+                <&cpg CPG_MOD 723>,
+                <&cpg CPG_MOD 721>,
+                <&versaclock5 1>,
+                <&versaclock5 3>,
+                <&versaclock5 2>;
+       clock-names = "du.0", "du.1", "du.3",
+                     "dclkin.0", "dclkin.1", "dclkin.3";
+};
index cfc0f74081592580e0e5a490d3a0c5d176da0ef3..208ed56bd1194c05719af6071a1e8c4fa58524be 100644 (file)
@@ -8,23 +8,6 @@
 #include "r8a77965-salvator-x.dts"
 #include "r8a77965-u-boot.dtsi"
 
-&vcc_sdhi0 {
-       u-boot,off-on-delay-us = <20000>;
-};
-
-&vcc_sdhi3 {
-       u-boot,off-on-delay-us = <20000>;
-};
-
-&sdhi2_pins {
-       groups = "sdhi2_data8", "sdhi2_ctrl", "sdhi2_ds";
-       power-source = <1800>;
-};
-
-&sdhi2_pins_uhs {
-       groups = "sdhi2_data8", "sdhi2_ctrl", "sdhi2_ds";
-};
-
 &sdhi0 {
        sd-uhs-sdr12;
        sd-uhs-sdr25;
index ca80ef8f29ee98265b7f2c4b0565e196c24c9b20..81ee0961e26b889f6b58e5b66930216389bd22a2 100644 (file)
        u-boot,dm-pre-reloc;
 };
 
-&soc {
-       rpc: rpc@0xee200000 {
-               compatible = "renesas,rpc-r8a77965", "renesas,rpc";
-               reg = <0 0xee200000 0 0x100>, <0 0x08000000 0 0>;
-               clocks = <&cpg CPG_MOD 917>;
-               bank-width = <2>;
-               status = "disabled";
+/ {
+       soc {
+               rpc: rpc@0xee200000 {
+                       compatible = "renesas,rpc-r8a77965", "renesas,rpc";
+                       reg = <0 0xee200000 0 0x100>, <0 0x08000000 0 0>;
+                       clocks = <&cpg CPG_MOD 917>;
+                       bank-width = <2>;
+                       status = "disabled";
+               };
        };
 };
index ef8cdc6a16b4f4bfbbd458bf5f236fc64dd63bd5..9763d108e183b13d1067eac9c8d08af1f3ed24a4 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Device Tree Source for the r8a77965 SoC
+ * Device Tree Source for the R-Car M3-N (R8A77965) SoC
  *
  * Copyright (C) 2018 Jacopo Mondi <jacopo+renesas@jmondi.org>
  *
@@ -12,7 +12,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/power/r8a77965-sysc.h>
 
-#define CPG_AUDIO_CLK_I                10
+#define CPG_AUDIO_CLK_I                R8A77965_CLK_S0D4
 
 / {
        compatible = "renesas,r8a77965";
                clock-frequency = <0>;
        };
 
+       cluster0_opp: opp_table0 {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp-500000000 {
+                       opp-hz = /bits/ 64 <500000000>;
+                       opp-microvolt = <830000>;
+                       clock-latency-ns = <300000>;
+               };
+               opp-1000000000 {
+                       opp-hz = /bits/ 64 <1000000000>;
+                       opp-microvolt = <830000>;
+                       clock-latency-ns = <300000>;
+               };
+               opp-1500000000 {
+                       opp-hz = /bits/ 64 <1500000000>;
+                       opp-microvolt = <830000>;
+                       clock-latency-ns = <300000>;
+                       opp-suspend;
+               };
+               opp-1600000000 {
+                       opp-hz = /bits/ 64 <1600000000>;
+                       opp-microvolt = <900000>;
+                       clock-latency-ns = <300000>;
+                       turbo-mode;
+               };
+               opp-1700000000 {
+                       opp-hz = /bits/ 64 <1700000000>;
+                       opp-microvolt = <900000>;
+                       clock-latency-ns = <300000>;
+                       turbo-mode;
+               };
+               opp-1800000000 {
+                       opp-hz = /bits/ 64 <1800000000>;
+                       opp-microvolt = <960000>;
+                       clock-latency-ns = <300000>;
+                       turbo-mode;
+               };
+       };
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
 
                a57_0: cpu@0 {
-                       compatible = "arm,cortex-a57", "arm,armv8";
+                       compatible = "arm,cortex-a57";
                        reg = <0x0>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A77965_PD_CA57_CPU0>;
                        next-level-cache = <&L2_CA57>;
                        enable-method = "psci";
+                       clocks = <&cpg CPG_CORE R8A77965_CLK_Z>;
+                       operating-points-v2 = <&cluster0_opp>;
                };
 
                a57_1: cpu@1 {
-                       compatible = "arm,cortex-a57", "arm,armv8";
+                       compatible = "arm,cortex-a57";
                        reg = <0x1>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A77965_PD_CA57_CPU1>;
                        next-level-cache = <&L2_CA57>;
                        enable-method = "psci";
+                       clocks = <&cpg CPG_CORE R8A77965_CLK_Z>;
+                       operating-points-v2 = <&cluster0_opp>;
                };
 
                L2_CA57: cache-controller-0 {
                clock-frequency = <0>;
        };
 
-       soc: soc {
+       soc {
                compatible = "simple-bus";
                interrupt-parent = <&gic>;
                #address-cells = <2>;
                        power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
                        resets = <&cpg 522>;
                        #thermal-sensor-cells = <1>;
-                       status = "okay";
                };
 
                intc_ex: interrupt-controller@e61c0000 {
                };
 
                hsusb: usb@e6590000 {
-                       compatible = "renesas,usbhs-r8a7796",
+                       compatible = "renesas,usbhs-r8a77965",
                                     "renesas,rcar-gen3-usbhs";
-                       reg = <0 0xe6590000 0 0x100>;
+                       reg = <0 0xe6590000 0 0x200>;
                        interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 704>;
+                       clocks = <&cpg CPG_MOD 704>, <&cpg CPG_MOD 703>;
                        dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
                               <&usb_dmac1 0>, <&usb_dmac1 1>;
                        dma-names = "ch0", "ch1", "ch2", "ch3";
                        phys = <&usb2_phy0>;
                        phy-names = "usb";
                        power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
-                       resets = <&cpg 704>;
+                       resets = <&cpg 704>, <&cpg 703>;
                        status = "disabled";
                };
 
                        resets = <&cpg 219>;
                        #dma-cells = <1>;
                        dma-channels = <16>;
+                       iommus = <&ipmmu_ds0 0>, <&ipmmu_ds0 1>,
+                              <&ipmmu_ds0 2>, <&ipmmu_ds0 3>,
+                              <&ipmmu_ds0 4>, <&ipmmu_ds0 5>,
+                              <&ipmmu_ds0 6>, <&ipmmu_ds0 7>,
+                              <&ipmmu_ds0 8>, <&ipmmu_ds0 9>,
+                              <&ipmmu_ds0 10>, <&ipmmu_ds0 11>,
+                              <&ipmmu_ds0 12>, <&ipmmu_ds0 13>,
+                              <&ipmmu_ds0 14>, <&ipmmu_ds0 15>;
                };
 
                dmac1: dma-controller@e7300000 {
                        resets = <&cpg 218>;
                        #dma-cells = <1>;
                        dma-channels = <16>;
+                       iommus = <&ipmmu_ds1 0>, <&ipmmu_ds1 1>,
+                              <&ipmmu_ds1 2>, <&ipmmu_ds1 3>,
+                              <&ipmmu_ds1 4>, <&ipmmu_ds1 5>,
+                              <&ipmmu_ds1 6>, <&ipmmu_ds1 7>,
+                              <&ipmmu_ds1 8>, <&ipmmu_ds1 9>,
+                              <&ipmmu_ds1 10>, <&ipmmu_ds1 11>,
+                              <&ipmmu_ds1 12>, <&ipmmu_ds1 13>,
+                              <&ipmmu_ds1 14>, <&ipmmu_ds1 15>;
                };
 
                dmac2: dma-controller@e7310000 {
                        resets = <&cpg 217>;
                        #dma-cells = <1>;
                        dma-channels = <16>;
+                       iommus = <&ipmmu_ds1 16>, <&ipmmu_ds1 17>,
+                              <&ipmmu_ds1 18>, <&ipmmu_ds1 19>,
+                              <&ipmmu_ds1 20>, <&ipmmu_ds1 21>,
+                              <&ipmmu_ds1 22>, <&ipmmu_ds1 23>,
+                              <&ipmmu_ds1 24>, <&ipmmu_ds1 25>,
+                              <&ipmmu_ds1 26>, <&ipmmu_ds1 27>,
+                              <&ipmmu_ds1 28>, <&ipmmu_ds1 29>,
+                              <&ipmmu_ds1 30>, <&ipmmu_ds1 31>;
                };
 
                ipmmu_ds0: mmu@e6740000 {
                        #iommu-cells = <1>;
                };
 
-               ipmmu_ir: mmu@ff8b0000 {
-                       compatible = "renesas,ipmmu-r8a77965";
-                       reg = <0 0xff8b0000 0 0x1000>;
-                       renesas,ipmmu-main = <&ipmmu_mm 3>;
-                       power-domains = <&sysc R8A77965_PD_A3IR>;
-                       #iommu-cells = <1>;
-               };
-
                ipmmu_mm: mmu@e67b0000 {
                        compatible = "renesas,ipmmu-r8a77965";
                        reg = <0 0xe67b0000 0 0x1000>;
                        power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
                        resets = <&cpg 812>;
                        phy-mode = "rgmii";
+                       iommus = <&ipmmu_ds0 16>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disabled";
                };
 
+               can0: can@e6c30000 {
+                       compatible = "renesas,can-r8a77965",
+                                    "renesas,rcar-gen3-can";
+                       reg = <0 0xe6c30000 0 0x1000>;
+                       interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 916>,
+                              <&cpg CPG_CORE R8A77965_CLK_CANFD>,
+                              <&can_clk>;
+                       clock-names = "clkp1", "clkp2", "can_clk";
+                       assigned-clocks = <&cpg CPG_CORE R8A77965_CLK_CANFD>;
+                       assigned-clock-rates = <40000000>;
+                       power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
+                       resets = <&cpg 916>;
+                       status = "disabled";
+               };
+
+               can1: can@e6c38000 {
+                       compatible = "renesas,can-r8a77965",
+                                    "renesas,rcar-gen3-can";
+                       reg = <0 0xe6c38000 0 0x1000>;
+                       interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 915>,
+                              <&cpg CPG_CORE R8A77965_CLK_CANFD>,
+                              <&can_clk>;
+                       clock-names = "clkp1", "clkp2", "can_clk";
+                       assigned-clocks = <&cpg CPG_CORE R8A77965_CLK_CANFD>;
+                       assigned-clock-rates = <40000000>;
+                       power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
+                       resets = <&cpg 915>;
+                       status = "disabled";
+               };
+
+               canfd: can@e66c0000 {
+                       compatible = "renesas,r8a77965-canfd",
+                                    "renesas,rcar-gen3-canfd";
+                       reg = <0 0xe66c0000 0 0x8000>;
+                       interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 914>,
+                              <&cpg CPG_CORE R8A77965_CLK_CANFD>,
+                              <&can_clk>;
+                       clock-names = "fck", "canfd", "can_clk";
+                       assigned-clocks = <&cpg CPG_CORE R8A77965_CLK_CANFD>;
+                       assigned-clock-rates = <40000000>;
+                       power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
+                       resets = <&cpg 914>;
+                       status = "disabled";
+
+                       channel0 {
+                               status = "disabled";
+                       };
+
+                       channel1 {
+                               status = "disabled";
+                       };
+               };
+
                pwm0: pwm@e6e30000 {
                        compatible = "renesas,pwm-r8a77965", "renesas,pwm-rcar";
                        reg = <0 0xe6e30000 0 8>;
                                 <&cpg CPG_CORE R8A77965_CLK_S3D1>,
                                 <&scif_clk>;
                        clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac1 0x13>, <&dmac1 0x12>,
+                              <&dmac2 0x13>, <&dmac2 0x12>;
+                       dma-names = "tx", "rx", "tx", "rx";
                        power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
                        resets = <&cpg 310>;
                        status = "disabled";
 
                                        vin0csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin0>;
+                                               remote-endpoint = <&csi20vin0>;
                                        };
                                        vin0csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin0>;
+                                               remote-endpoint = <&csi40vin0>;
                                        };
                                };
                        };
 
                                        vin1csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin1>;
+                                               remote-endpoint = <&csi20vin1>;
                                        };
                                        vin1csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin1>;
+                                               remote-endpoint = <&csi40vin1>;
                                        };
                                };
                        };
 
                                        vin2csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin2>;
+                                               remote-endpoint = <&csi20vin2>;
                                        };
                                        vin2csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin2>;
+                                               remote-endpoint = <&csi40vin2>;
                                        };
                                };
                        };
 
                                        vin3csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin3>;
+                                               remote-endpoint = <&csi20vin3>;
                                        };
                                        vin3csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin3>;
+                                               remote-endpoint = <&csi40vin3>;
                                        };
                                };
                        };
 
                                        vin4csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin4>;
+                                               remote-endpoint = <&csi20vin4>;
                                        };
                                        vin4csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin4>;
+                                               remote-endpoint = <&csi40vin4>;
                                        };
                                };
                        };
 
                                        vin5csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin5>;
+                                               remote-endpoint = <&csi20vin5>;
                                        };
                                        vin5csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin5>;
+                                               remote-endpoint = <&csi40vin5>;
                                        };
                                };
                        };
 
                                        vin6csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin6>;
+                                               remote-endpoint = <&csi20vin6>;
                                        };
                                        vin6csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin6>;
+                                               remote-endpoint = <&csi40vin6>;
                                        };
                                };
                        };
 
                                        vin7csi20: endpoint@0 {
                                                reg = <0>;
-                                               remote-endpoint= <&csi20vin7>;
+                                               remote-endpoint = <&csi20vin7>;
                                        };
                                        vin7csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin7>;
+                                               remote-endpoint = <&csi40vin7>;
                                        };
                                };
                        };
                };
 
                rcar_sound: sound@ec500000 {
+                       /*
+                        * #sound-dai-cells is required
+                        *
+                        * Single DAI : #sound-dai-cells = <0>; <&rcar_sound>;
+                        * Multi  DAI : #sound-dai-cells = <1>; <&rcar_sound N>;
+                        */
+                       /*
+                        * #clock-cells is required for audio_clkout0/1/2/3
+                        *
+                        * clkout       : #clock-cells = <0>;   <&rcar_sound>;
+                        * clkout0/1/2/3: #clock-cells = <1>;   <&rcar_sound N>;
+                        */
+                       compatible =  "renesas,rcar_sound-r8a77965", "renesas,rcar_sound-gen3";
                        reg =   <0 0xec500000 0 0x1000>, /* SCU */
                                <0 0xec5a0000 0 0x100>,  /* ADG */
                                <0 0xec540000 0 0x1000>, /* SSIU */
                                <0 0xec541000 0 0x280>,  /* SSI */
                                <0 0xec740000 0 0x200>;  /* Audio DMAC peri peri*/
-                       /* placeholder */
+                       reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
+
+                       clocks = <&cpg CPG_MOD 1005>,
+                                <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>,
+                                <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>,
+                                <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>,
+                                <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>,
+                                <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>,
+                                <&cpg CPG_MOD 1022>, <&cpg CPG_MOD 1023>,
+                                <&cpg CPG_MOD 1024>, <&cpg CPG_MOD 1025>,
+                                <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>,
+                                <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>,
+                                <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>,
+                                <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>,
+                                <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>,
+                                <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
+                                <&audio_clk_a>, <&audio_clk_b>,
+                                <&audio_clk_c>,
+                                <&cpg CPG_CORE R8A77965_CLK_S0D4>;
+                       clock-names = "ssi-all",
+                                     "ssi.9", "ssi.8", "ssi.7", "ssi.6",
+                                     "ssi.5", "ssi.4", "ssi.3", "ssi.2",
+                                     "ssi.1", "ssi.0",
+                                     "src.9", "src.8", "src.7", "src.6",
+                                     "src.5", "src.4", "src.3", "src.2",
+                                     "src.1", "src.0",
+                                     "mix.1", "mix.0",
+                                     "ctu.1", "ctu.0",
+                                     "dvc.0", "dvc.1",
+                                     "clk_a", "clk_b", "clk_c", "clk_i";
+                       power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
+                       resets = <&cpg 1005>,
+                                <&cpg 1006>, <&cpg 1007>,
+                                <&cpg 1008>, <&cpg 1009>,
+                                <&cpg 1010>, <&cpg 1011>,
+                                <&cpg 1012>, <&cpg 1013>,
+                                <&cpg 1014>, <&cpg 1015>;
+                       reset-names = "ssi-all",
+                                     "ssi.9", "ssi.8", "ssi.7", "ssi.6",
+                                     "ssi.5", "ssi.4", "ssi.3", "ssi.2",
+                                     "ssi.1", "ssi.0";
+                       status = "disabled";
 
                        rcar_sound,dvc {
                                dvc0: dvc-0 {
+                                       dmas = <&audma1 0xbc>;
+                                       dma-names = "tx";
                                };
                                dvc1: dvc-1 {
+                                       dmas = <&audma1 0xbe>;
+                                       dma-names = "tx";
                                };
                        };
 
+                       rcar_sound,mix {
+                               mix0: mix-0 { };
+                               mix1: mix-1 { };
+                       };
+
+                       rcar_sound,ctu {
+                               ctu00: ctu-0 { };
+                               ctu01: ctu-1 { };
+                               ctu02: ctu-2 { };
+                               ctu03: ctu-3 { };
+                               ctu10: ctu-4 { };
+                               ctu11: ctu-5 { };
+                               ctu12: ctu-6 { };
+                               ctu13: ctu-7 { };
+                       };
+
                        rcar_sound,src {
                                src0: src-0 {
+                                       interrupts = <GIC_SPI 352 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x85>, <&audma1 0x9a>;
+                                       dma-names = "rx", "tx";
                                };
                                src1: src-1 {
+                                       interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x87>, <&audma1 0x9c>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src2: src-2 {
+                                       interrupts = <GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x89>, <&audma1 0x9e>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src3: src-3 {
+                                       interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x8b>, <&audma1 0xa0>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src4: src-4 {
+                                       interrupts = <GIC_SPI 356 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x8d>, <&audma1 0xb0>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src5: src-5 {
+                                       interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x8f>, <&audma1 0xb2>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src6: src-6 {
+                                       interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x91>, <&audma1 0xb4>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src7: src-7 {
+                                       interrupts = <GIC_SPI 359 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x93>, <&audma1 0xb6>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src8: src-8 {
+                                       interrupts = <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x95>, <&audma1 0xb8>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src9: src-9 {
+                                       interrupts = <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x97>, <&audma1 0xba>;
+                                       dma-names = "rx", "tx";
                                };
                        };
 
                        rcar_sound,ssi {
                                ssi0: ssi-0 {
+                                       interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x01>, <&audma1 0x02>, <&audma0 0x15>, <&audma1 0x16>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
                                };
                                ssi1: ssi-1 {
+                                       interrupts = <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x03>, <&audma1 0x04>, <&audma0 0x49>, <&audma1 0x4a>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
                                };
-                       };
-
-                       ports {
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-                               port@0 {
-                                       reg = <0>;
+                               ssi2: ssi-2 {
+                                       interrupts = <GIC_SPI 372 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x05>, <&audma1 0x06>, <&audma0 0x63>, <&audma1 0x64>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
                                };
-                               port@1 {
-                                       reg = <1>;
+                               ssi3: ssi-3 {
+                                       interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x07>, <&audma1 0x08>, <&audma0 0x6f>, <&audma1 0x70>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
+                               };
+                               ssi4: ssi-4 {
+                                       interrupts = <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x09>, <&audma1 0x0a>, <&audma0 0x71>, <&audma1 0x72>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
+                               };
+                               ssi5: ssi-5 {
+                                       interrupts = <GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x0b>, <&audma1 0x0c>, <&audma0 0x73>, <&audma1 0x74>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
+                               };
+                               ssi6: ssi-6 {
+                                       interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x0d>, <&audma1 0x0e>, <&audma0 0x75>, <&audma1 0x76>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
+                               };
+                               ssi7: ssi-7 {
+                                       interrupts = <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x0f>, <&audma1 0x10>, <&audma0 0x79>, <&audma1 0x7a>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
+                               };
+                               ssi8: ssi-8 {
+                                       interrupts = <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x11>, <&audma1 0x12>, <&audma0 0x7b>, <&audma1 0x7c>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
+                               };
+                               ssi9: ssi-9 {
+                                       interrupts = <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x13>, <&audma1 0x14>, <&audma0 0x7d>, <&audma1 0x7e>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
                                };
                        };
                };
 
+               audma0: dma-controller@ec700000 {
+                       compatible = "renesas,dmac-r8a77965",
+                                    "renesas,rcar-dmac";
+                       reg = <0 0xec700000 0 0x10000>;
+                       interrupts = <GIC_SPI 350 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 333 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "error",
+                                       "ch0", "ch1", "ch2", "ch3",
+                                       "ch4", "ch5", "ch6", "ch7",
+                                       "ch8", "ch9", "ch10", "ch11",
+                                       "ch12", "ch13", "ch14", "ch15";
+                       clocks = <&cpg CPG_MOD 502>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
+                       resets = <&cpg 502>;
+                       #dma-cells = <1>;
+                       dma-channels = <16>;
+               };
+
+               audma1: dma-controller@ec720000 {
+                       compatible = "renesas,dmac-r8a77965",
+                                    "renesas,rcar-dmac";
+                       reg = <0 0xec720000 0 0x10000>;
+                       interrupts = <GIC_SPI 351 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 338 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 339 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 342 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 343 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 344 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 345 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 348 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 349 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 382 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 383 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "error",
+                                       "ch0", "ch1", "ch2", "ch3",
+                                       "ch4", "ch5", "ch6", "ch7",
+                                       "ch8", "ch9", "ch10", "ch11",
+                                       "ch12", "ch13", "ch14", "ch15";
+                       clocks = <&cpg CPG_MOD 501>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
+                       resets = <&cpg 501>;
+                       #dma-cells = <1>;
+                       dma-channels = <16>;
+               };
+
                xhci0: usb@ee000000 {
                        compatible = "renesas,xhci-r8a77965",
                                     "renesas,rcar-gen3-xhci";
                        compatible = "generic-ohci";
                        reg = <0 0xee080000 0 0x100>;
                        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 703>;
+                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
                        phys = <&usb2_phy0>;
                        phy-names = "usb";
                        power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
-                       resets = <&cpg 703>;
+                       resets = <&cpg 703>, <&cpg 704>;
                        status = "disabled";
                };
 
                        compatible = "generic-ehci";
                        reg = <0 0xee080100 0 0x100>;
                        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 703>;
+                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
                        phys = <&usb2_phy0>;
                        phy-names = "usb";
                        companion = <&ohci0>;
                        power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
-                       resets = <&cpg 703>;
+                       resets = <&cpg 703>, <&cpg 704>;
                        status = "disabled";
                };
 
                                     "renesas,rcar-gen3-usb2-phy";
                        reg = <0 0xee080200 0 0x700>;
                        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 703>;
+                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
                        power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
-                       resets = <&cpg 703>;
+                       resets = <&cpg 703>, <&cpg 704>;
                        #phy-cells = <0>;
                        status = "disabled";
                };
                        compatible = "renesas,usb2-phy-r8a77965",
                                     "renesas,rcar-gen3-usb2-phy";
                        reg = <0 0xee0a0200 0 0x700>;
-                       clocks = <&cpg CPG_MOD 703>;
+                       clocks = <&cpg CPG_MOD 702>;
                        power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
-                       resets = <&cpg 703>;
+                       resets = <&cpg 702>;
                        #phy-cells = <0>;
                        status = "disabled";
                };
                        status = "disabled";
                };
 
+               sata: sata@ee300000 {
+                       compatible = "renesas,sata-r8a77965",
+                                    "renesas,rcar-gen3-sata";
+                       reg = <0 0xee300000 0 0x200000>;
+                       interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 815>;
+                       power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
+                       resets = <&cpg 815>;
+                       status = "disabled";
+               };
+
                gic: interrupt-controller@f1010000 {
                        compatible = "arm,gic-400";
                        #interrupt-cells = <3>;
                        status = "disabled";
                };
 
+               fdp1@fe940000 {
+                       compatible = "renesas,fdp1";
+                       reg = <0 0xfe940000 0 0x2400>;
+                       interrupts = <GIC_SPI 262 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 119>;
+                       power-domains = <&sysc R8A77965_PD_A3VP>;
+                       resets = <&cpg 119>;
+                       renesas,fcp = <&fcpf0>;
+               };
+
                fcpf0: fcp@fe950000 {
                        compatible = "renesas,fcpf";
                        reg = <0 0xfe950000 0 0x200>;
                                port@2 {
                                        reg = <2>;
                                        du_out_lvds0: endpoint {
+                                               remote-endpoint = <&lvds0_in>;
+                                       };
+                               };
+                       };
+               };
+
+               lvds0: lvds@feb90000 {
+                       compatible = "renesas,r8a77965-lvds";
+                       reg = <0 0xfeb90000 0 0x14>;
+                       clocks = <&cpg CPG_MOD 727>;
+                       power-domains = <&sysc R8A77965_PD_ALWAYS_ON>;
+                       resets = <&cpg 727>;
+                       status = "disabled";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@0 {
+                                       reg = <0>;
+                                       lvds0_in: endpoint {
+                                               remote-endpoint = <&du_out_lvds0>;
+                                       };
+                               };
+                               port@1 {
+                                       reg = <1>;
+                                       lvds0_out: endpoint {
                                        };
                                };
                        };
                };
        };
 
-       timer {
-               compatible = "arm,armv8-timer";
-               interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
-                                     <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
-                                     <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
-                                     <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>;
-       };
-
        thermal-zones {
                sensor_thermal1: sensor-thermal1 {
                        polling-delay-passive = <250>;
                };
        };
 
+       timer {
+               compatible = "arm,armv8-timer";
+               interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+                                     <&gic GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+                                     <&gic GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
+                                     <&gic GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>;
+       };
+
        /* External USB clocks - can be overridden by the board */
        usb3s0_clk: usb3s0 {
                compatible = "fixed-clock";
index 2903fdb52371bb340d414ef3e28dd489b2ae7839..eabab7ce5823197cea46b9a8b236e3deea74b317 100644 (file)
        u-boot,dm-pre-reloc;
 };
 
-&soc {
-       rpc: rpc@0xee200000 {
-               compatible = "renesas,rpc-r8a77970", "renesas,rpc";
-               reg = <0 0xee200000 0 0x100>, <0 0x08000000 0 0>;
-               clocks = <&cpg CPG_MOD 917>;
-               bank-width = <2>;
-               status = "disabled";
+/ {
+       soc {
+               rpc: rpc@0xee200000 {
+                       compatible = "renesas,rpc-r8a77970", "renesas,rpc";
+                       reg = <0 0xee200000 0 0x100>, <0 0x08000000 0 0>;
+                       clocks = <&cpg CPG_MOD 917>;
+                       bank-width = <2>;
+                       status = "disabled";
+               };
        };
 };
index a0808c90ab84c8d5d87360bf28018784ef55a3e0..5b6164d4b8e3630dee473449e53c07d8d85901d2 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Device Tree Source for the r8a77970 SoC
+ * Device Tree Source for the R-Car V3M (R8A77970) SoC
  *
  * Copyright (C) 2016-2017 Renesas Electronics Corp.
  * Copyright (C) 2017 Cogent Embedded, Inc.
                i2c4 = &i2c4;
        };
 
+       /* External CAN clock - to be overridden by boards that provide it */
+       can_clk: can {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <0>;
+       };
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
 
                a53_0: cpu@0 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0>;
                        clocks = <&cpg CPG_CORE R8A77970_CLK_Z2>;
                        power-domains = <&sysc R8A77970_PD_CA53_CPU0>;
@@ -40,7 +47,7 @@
 
                a53_1: cpu@1 {
                        device_type = "cpu";
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <1>;
                        clocks = <&cpg CPG_CORE R8A77970_CLK_Z2>;
                        power-domains = <&sysc R8A77970_PD_CA53_CPU1>;
                method = "smc";
        };
 
-       /* External CAN clock - to be overridden by boards that provide it */
-       can_clk: can {
-               compatible = "fixed-clock";
-               #clock-cells = <0>;
-               clock-frequency = <0>;
-       };
-
        /* External SCIF clock - to be overridden by boards that provide it */
        scif_clk: scif {
                compatible = "fixed-clock";
@@ -96,7 +96,7 @@
                clock-frequency = <0>;
        };
 
-       soc: soc {
+       soc {
                compatible = "simple-bus";
                interrupt-parent = <&gic>;
 
                        reg = <0 0xe6060000 0 0x504>;
                };
 
+               cmt0: timer@e60f0000 {
+                       compatible = "renesas,r8a77970-cmt0",
+                                    "renesas,rcar-gen3-cmt0";
+                       reg = <0 0xe60f0000 0 0x1004>;
+                       interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 303>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 303>;
+                       status = "disabled";
+               };
+
+               cmt1: timer@e6130000 {
+                       compatible = "renesas,r8a77970-cmt1",
+                                    "renesas,rcar-gen3-cmt1";
+                       reg = <0 0xe6130000 0 0x1004>;
+                       interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 124 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 302>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 302>;
+                       status = "disabled";
+               };
+
+               cmt2: timer@e6140000 {
+                       compatible = "renesas,r8a77970-cmt1",
+                                    "renesas,rcar-gen3-cmt1";
+                       reg = <0 0xe6140000 0 0x1004>;
+                       interrupts = <GIC_SPI 258 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 259 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 262 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 263 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 264 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 301>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 301>;
+                       status = "disabled";
+               };
+
+               cmt3: timer@e6148000 {
+                       compatible = "renesas,r8a77970-cmt1",
+                                    "renesas,rcar-gen3-cmt1";
+                       reg = <0 0xe6148000 0 0x1004>;
+                       interrupts = <GIC_SPI 273 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 274 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 275 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 276 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 277 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 278 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 279 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 280 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 300>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 300>;
+                       status = "disabled";
+               };
+
                cpg: clock-controller@e6150000 {
                        compatible = "renesas,r8a77970-cpg-mssr";
                        reg = <0 0xe6150000 0 0x1000>;
                        #power-domain-cells = <1>;
                };
 
+               thermal: thermal@e6190000 {
+                       compatible = "renesas,thermal-r8a77970";
+                       reg =  <0 0xe6190000 0 0x10
+                               0 0xe6190100 0 0x120>;
+                       interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 522>;
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 522>;
+                       #thermal-sensor-cells = <0>;
+               };
+
                intc_ex: interrupt-controller@e61c0000 {
                        compatible = "renesas,intc-ex-r8a77970", "renesas,irqc";
                        #interrupt-cells = <2>;
                        resets = <&cpg 407>;
                };
 
+               tmu0: timer@e61e0000 {
+                       compatible = "renesas,tmu-r8a77970", "renesas,tmu";
+                       reg = <0 0xe61e0000 0 0x30>;
+                       interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 125>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 125>;
+                       status = "disabled";
+               };
+
+               tmu1: timer@e6fc0000 {
+                       compatible = "renesas,tmu-r8a77970", "renesas,tmu";
+                       reg = <0 0xe6fc0000 0 0x30>;
+                       interrupts = <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 124>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 124>;
+                       status = "disabled";
+               };
+
+               tmu2: timer@e6fd0000 {
+                       compatible = "renesas,tmu-r8a77970", "renesas,tmu";
+                       reg = <0 0xe6fd0000 0 0x30>;
+                       interrupts = <GIC_SPI 303 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 304 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 305 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 123>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 123>;
+                       status = "disabled";
+               };
+
+               tmu3: timer@e6fe0000 {
+                       compatible = "renesas,tmu-r8a77970", "renesas,tmu";
+                       reg = <0 0xe6fe0000 0 0x30>;
+                       interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 132 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 122>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 122>;
+                       status = "disabled";
+               };
+
+               tmu4: timer@ffc00000 {
+                       compatible = "renesas,tmu-r8a77970", "renesas,tmu";
+                       reg = <0 0xffc00000 0 0x30>;
+                       interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 121>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 121>;
+                       status = "disabled";
+               };
+
                i2c0: i2c@e6500000 {
                        compatible = "renesas,i2c-r8a77970",
                                     "renesas,rcar-gen3-i2c";
                        status = "disabled";
                };
 
+               pwm0: pwm@e6e30000 {
+                       compatible = "renesas,pwm-r8a77970", "renesas,pwm-rcar";
+                       reg = <0 0xe6e30000 0 8>;
+                       #pwm-cells = <2>;
+                       clocks = <&cpg CPG_MOD 523>;
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 523>;
+                       status = "disabled";
+               };
+
+               pwm1: pwm@e6e31000 {
+                       compatible = "renesas,pwm-r8a77970", "renesas,pwm-rcar";
+                       reg = <0 0xe6e31000 0 8>;
+                       #pwm-cells = <2>;
+                       clocks = <&cpg CPG_MOD 523>;
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 523>;
+                       status = "disabled";
+               };
+
+               pwm2: pwm@e6e32000 {
+                       compatible = "renesas,pwm-r8a77970", "renesas,pwm-rcar";
+                       reg = <0 0xe6e32000 0 8>;
+                       #pwm-cells = <2>;
+                       clocks = <&cpg CPG_MOD 523>;
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 523>;
+                       status = "disabled";
+               };
+
+               pwm3: pwm@e6e33000 {
+                       compatible = "renesas,pwm-r8a7790", "renesas,pwm-rcar";
+                       reg = <0 0xe6e33000 0 8>;
+                       #pwm-cells = <2>;
+                       clocks = <&cpg CPG_MOD 523>;
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 523>;
+                       status = "disabled";
+               };
+
+               pwm4: pwm@e6e34000 {
+                       compatible = "renesas,pwm-r8a77970", "renesas,pwm-rcar";
+                       reg = <0 0xe6e34000 0 8>;
+                       #pwm-cells = <2>;
+                       clocks = <&cpg CPG_MOD 523>;
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 523>;
+                       status = "disabled";
+               };
+
                scif0: serial@e6e60000 {
                        compatible = "renesas,scif-r8a77970",
                                     "renesas,rcar-gen3-scif",
                        status = "disabled";
                };
 
+               tpu: pwm@e6e80000 {
+                       compatible = "renesas,tpu-r8a77970", "renesas,tpu";
+                       reg = <0 0xe6e80000 0 0x148>;
+                       interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 304>;
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 304>;
+                       #pwm-cells = <3>;
+                       status = "disabled";
+               };
+
+               msiof0: spi@e6e90000 {
+                       compatible = "renesas,msiof-r8a77970",
+                                    "renesas,rcar-gen3-msiof";
+                       reg = <0 0xe6e90000 0 0x64>;
+                       interrupts = <GIC_SPI 156 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 211>;
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 211>;
+                       dmas = <&dmac1 0x41>, <&dmac1 0x40>,
+                              <&dmac2 0x41>, <&dmac2 0x40>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
+               msiof1: spi@e6ea0000 {
+                       compatible = "renesas,msiof-r8a77970",
+                                    "renesas,rcar-gen3-msiof";
+                       reg = <0 0xe6ea0000 0 0x0064>;
+                       interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 210>;
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 210>;
+                       dmas = <&dmac1 0x43>, <&dmac1 0x42>,
+                              <&dmac2 0x43>, <&dmac2 0x42>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
+               msiof2: spi@e6c00000 {
+                       compatible = "renesas,msiof-r8a77970",
+                                    "renesas,rcar-gen3-msiof";
+                       reg = <0 0xe6c00000 0 0x0064>;
+                       interrupts = <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 209>;
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 209>;
+                       dmas = <&dmac1 0x45>, <&dmac1 0x44>,
+                              <&dmac2 0x45>, <&dmac2 0x44>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
+               msiof3: spi@e6c10000 {
+                       compatible = "renesas,msiof-r8a77970",
+                                    "renesas,rcar-gen3-msiof";
+                       reg = <0 0xe6c10000 0 0x0064>;
+                       interrupts = <GIC_SPI 159 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 208>;
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 208>;
+                       dmas = <&dmac1 0x47>, <&dmac1 0x46>,
+                              <&dmac2 0x47>, <&dmac2 0x46>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
 
                vin0: video@e6ef0000 {
                        compatible = "renesas,vin-r8a77970";
 
                                        vin0csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin0>;
+                                               remote-endpoint = <&csi40vin0>;
                                        };
                                };
                        };
 
                                        vin1csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin1>;
+                                               remote-endpoint = <&csi40vin1>;
                                        };
                                };
                        };
 
                                        vin2csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin2>;
+                                               remote-endpoint = <&csi40vin2>;
                                        };
                                };
                        };
 
                                        vin3csi40: endpoint@2 {
                                                reg = <2>;
-                                               remote-endpoint= <&csi40vin3>;
+                                               remote-endpoint = <&csi40vin3>;
                                        };
                                };
                        };
                        #iommu-cells = <1>;
                };
 
+               mmc0: mmc@ee140000 {
+                       compatible = "renesas,sdhi-r8a77970",
+                                    "renesas,rcar-gen3-sdhi";
+                       reg = <0 0xee140000 0 0x2000>;
+                       interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 314>;
+                       power-domains = <&sysc R8A77970_PD_ALWAYS_ON>;
+                       resets = <&cpg 314>;
+                       max-frequency = <200000000>;
+                       status = "disabled";
+               };
+
                gic: interrupt-controller@f1010000 {
                        compatible = "arm,gic-400";
                        #interrupt-cells = <3>;
                };
        };
 
+       thermal-zones {
+               cpu-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+                       thermal-sensors = <&thermal>;
+
+                       trips {
+                               cpu-crit {
+                                       temperature = <120000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+
+                       cooling-maps {
+                       };
+               };
+       };
+
        timer {
                compatible = "arm,armv8-timer";
                interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
index 4c1669e022cc6599fe2600b7aa6d0ef93e8152c8..1ce22e5c0f773ee1f6b654e3c1ce3d59d4140cd4 100644 (file)
 #include "r8a77990-ebisu.dts"
 #include "r8a77990-u-boot.dtsi"
 
-/ {
-       reg_1p8v: regulator0 {
-               compatible = "regulator-fixed";
-               regulator-name = "fixed-1.8V";
-               regulator-min-microvolt = <1800000>;
-               regulator-max-microvolt = <1800000>;
-               regulator-boot-on;
-               regulator-always-on;
-       };
-
-       reg_3p3v: regulator1 {
-               compatible = "regulator-fixed";
-               regulator-name = "fixed-3.3V";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-               regulator-boot-on;
-               regulator-always-on;
-       };
-
-       vcc_sdhi0: regulator-vcc-sdhi0 {
-               compatible = "regulator-fixed";
-
-               regulator-name = "SDHI0 Vcc";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-
-               gpio = <&gpio5 17 GPIO_ACTIVE_HIGH>;
-               enable-active-high;
-               u-boot,off-on-delay-us = <20000>;
-       };
-
-       vccq_sdhi0: regulator-vccq-sdhi0 {
-               compatible = "regulator-gpio";
-
-               regulator-name = "SDHI0 VccQ";
-               regulator-min-microvolt = <1800000>;
-               regulator-max-microvolt = <3300000>;
-
-               gpios = <&gpio5 18 GPIO_ACTIVE_HIGH>;
-               gpios-states = <1>;
-               states = <3300000 1
-                         1800000 0>;
-       };
-
-       vcc_sdhi1: regulator-vcc-sdhi1 {
-               compatible = "regulator-fixed";
-
-               regulator-name = "SDHI1 Vcc";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-
-               gpio = <&gpio0 4 GPIO_ACTIVE_HIGH>;
-               enable-active-high;
-               u-boot,off-on-delay-us = <20000>;
-       };
-
-       vccq_sdhi1: regulator-vccq-sdhi1 {
-               compatible = "regulator-gpio";
-
-               regulator-name = "SDHI1 VccQ";
-               regulator-min-microvolt = <1800000>;
-               regulator-max-microvolt = <3300000>;
-
-               gpios = <&gpio3 15 GPIO_ACTIVE_HIGH>;
-               gpios-states = <1>;
-               states = <3300000 1
-                         1800000 0>;
-       };
-};
-
 &pfc {
        pinctrl-0 = <&scif_clk_pins>;
        pinctrl-names = "default";
 
-       scif2_pins: scif2 {
-               groups = "scif2_data_a";
-               function = "scif2";
-       };
-
        scif_clk_pins: scif_clk {
                groups = "scif_clk_a";
                function = "scif_clk";
        };
-
-       sdhi0_pins: sd0 {
-               groups = "sdhi0_data4", "sdhi0_ctrl";
-               function = "sdhi0";
-               power-source = <3300>;
-       };
-
-       sdhi0_pins_uhs: sd0_uhs {
-               groups = "sdhi0_data4", "sdhi0_ctrl";
-               function = "sdhi0";
-               power-source = <1800>;
-       };
-
-       sdhi1_pins: sd1 {
-               groups = "sdhi1_data4", "sdhi1_ctrl";
-               function = "sdhi1";
-               power-source = <3300>;
-       };
-
-       sdhi1_pins_uhs: sd1_uhs {
-               groups = "sdhi1_data4", "sdhi1_ctrl";
-               function = "sdhi1";
-               power-source = <1800>;
-       };
-
-       sdhi3_pins: sd2 {
-               groups = "sdhi3_data8", "sdhi3_ctrl", "sdhi3_ds";
-               function = "sdhi3";
-               power-source = <1800>;
-       };
-
-       sdhi3_pins_uhs: sd2_uhs {
-               groups = "sdhi3_data8", "sdhi3_ctrl", "sdhi3_ds";
-               function = "sdhi3";
-               power-source = <1800>;
-       };
-};
-
-&scif2 {
-       pinctrl-0 = <&scif2_pins>;
-       pinctrl-names = "default";
-       status = "okay";
 };
 
 &sdhi0 {
-       /* full size SD */
-       pinctrl-0 = <&sdhi0_pins>;
-       pinctrl-1 = <&sdhi0_pins_uhs>;
-       pinctrl-names = "default", "state_uhs";
-
-       vmmc-supply = <&vcc_sdhi0>;
-       vqmmc-supply = <&vccq_sdhi0>;
-       cd-gpios = <&gpio3 12 GPIO_ACTIVE_LOW>;
-       wp-gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>;
-       bus-width = <4>;
        sd-uhs-sdr12;
        sd-uhs-sdr25;
-       sd-uhs-sdr50;
-       sd-uhs-sdr104;
-       status = "okay";
        max-frequency = <208000000>;
 };
 
 &sdhi1 {
-       /* microSD */
-       pinctrl-0 = <&sdhi1_pins>;
-       pinctrl-1 = <&sdhi1_pins_uhs>;
-       pinctrl-names = "default", "state_uhs";
-
-       vmmc-supply = <&vcc_sdhi1>;
-       vqmmc-supply = <&vccq_sdhi1>;
-       cd-gpios = <&gpio3 14 GPIO_ACTIVE_LOW>;
-       bus-width = <4>;
        sd-uhs-sdr12;
        sd-uhs-sdr25;
-       sd-uhs-sdr50;
-       sd-uhs-sdr104;
-       status = "okay";
        max-frequency = <208000000>;
 };
-
-&sdhi3 {
-       /* used for on-board 8bit eMMC */
-       pinctrl-0 = <&sdhi3_pins>;
-       pinctrl-1 = <&sdhi3_pins_uhs>;
-       pinctrl-names = "default", "state_uhs";
-
-       vmmc-supply = <&reg_3p3v>;
-       vqmmc-supply = <&reg_1p8v>;
-       bus-width = <8>;
-       mmc-hs200-1_8v;
-       mmc-hs400-1_8v;
-       non-removable;
-       status = "okay";
-};
index 2bc3a4884b0031f713391f046dabc2712f54f0aa..144c0820cf60c73178b43279ca73772c341b7554 100644 (file)
                /* first 128MB is reserved for secure area. */
                reg = <0x0 0x48000000 0x0 0x38000000>;
        };
+
+       audio_clkout: audio-clkout {
+               /*
+                * This is same as <&rcar_sound 0>
+                * but needed to avoid cs2000/rcar_sound probe dead-lock
+                */
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <11289600>;
+       };
+
+       backlight: backlight {
+               compatible = "pwm-backlight";
+               pwms = <&pwm3 0 50000>;
+
+               brightness-levels = <512 511 505 494 473 440 392 327 241 133 0>;
+               default-brightness-level = <10>;
+
+               power-supply = <&reg_12p0v>;
+       };
+
+       cvbs-in {
+               compatible = "composite-video-connector";
+               label = "CVBS IN";
+
+               port {
+                       cvbs_con: endpoint {
+                               remote-endpoint = <&adv7482_ain7>;
+                       };
+               };
+       };
+
+       hdmi-in {
+               compatible = "hdmi-connector";
+               label = "HDMI IN";
+               type = "a";
+
+               port {
+                       hdmi_in_con: endpoint {
+                               remote-endpoint = <&adv7482_hdmi>;
+                       };
+               };
+       };
+
+       hdmi-out {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con_out: endpoint {
+                               remote-endpoint = <&adv7511_out>;
+                       };
+               };
+       };
+
+       lvds-decoder {
+               compatible = "thine,thc63lvd1024";
+               vcc-supply = <&reg_3p3v>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               thc63lvd1024_in: endpoint {
+                                       remote-endpoint = <&lvds0_out>;
+                               };
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               thc63lvd1024_out: endpoint {
+                                       remote-endpoint = <&adv7511_in>;
+                               };
+                       };
+               };
+       };
+
+       vga {
+               compatible = "vga-connector";
+
+               port {
+                       vga_in: endpoint {
+                               remote-endpoint = <&adv7123_out>;
+                       };
+               };
+       };
+
+       vga-encoder {
+               compatible = "adi,adv7123";
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               adv7123_in: endpoint {
+                                       remote-endpoint = <&du_out_rgb>;
+                               };
+                       };
+                       port@1 {
+                               reg = <1>;
+                               adv7123_out: endpoint {
+                                       remote-endpoint = <&vga_in>;
+                               };
+                       };
+               };
+       };
+
+       reg_1p8v: regulator0 {
+               compatible = "regulator-fixed";
+               regulator-name = "fixed-1.8V";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       reg_3p3v: regulator1 {
+               compatible = "regulator-fixed";
+               regulator-name = "fixed-3.3V";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       vbus0_usb2: regulator-vbus0-usb2 {
+               compatible = "regulator-fixed";
+
+               regulator-name = "USB20_VBUS_CN";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+
+               gpio = <&gpio6 4 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+
+       rsnd_ak4613: sound {
+               compatible = "simple-audio-card";
+
+               simple-audio-card,name = "rsnd-ak4613";
+               simple-audio-card,format = "left_j";
+               simple-audio-card,bitclock-master = <&sndcpu>;
+               simple-audio-card,frame-master = <&sndcpu>;
+
+               sndcpu: simple-audio-card,cpu {
+                       sound-dai = <&rcar_sound>;
+               };
+
+               sndcodec: simple-audio-card,codec {
+                       sound-dai = <&ak4613>;
+               };
+       };
+
+       x12_clk: x12 {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <24576000>;
+       };
+
+       reg_12p0v: regulator2 {
+               compatible = "regulator-fixed";
+               regulator-name = "D12.0V";
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       x13_clk: x13 {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <74250000>;
+       };
+
+       vcc_sdhi0: regulator-vcc-sdhi0 {
+               compatible = "regulator-fixed";
+
+               regulator-name = "SDHI0 Vcc";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+
+               gpio = <&gpio5 17 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+
+       vccq_sdhi0: regulator-vccq-sdhi0 {
+               compatible = "regulator-gpio";
+
+               regulator-name = "SDHI0 VccQ";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <3300000>;
+
+               gpios = <&gpio5 18 GPIO_ACTIVE_HIGH>;
+               gpios-states = <1>;
+               states = <3300000 1
+                         1800000 0>;
+       };
+
+       vcc_sdhi1: regulator-vcc-sdhi1 {
+               compatible = "regulator-fixed";
+
+               regulator-name = "SDHI1 Vcc";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+
+               gpio = <&gpio0 4 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+       };
+
+       vccq_sdhi1: regulator-vccq-sdhi1 {
+               compatible = "regulator-gpio";
+
+               regulator-name = "SDHI1 VccQ";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <3300000>;
+
+               gpios = <&gpio3 15 GPIO_ACTIVE_HIGH>;
+               gpios-states = <1>;
+               states = <3300000 1
+                         1800000 0>;
+       };
+};
+
+&audio_clk_a {
+       clock-frequency = <22579200>;
 };
 
 &avb {
        pinctrl-names = "default";
        renesas,no-ether-link;
        phy-handle = <&phy0>;
-       phy-mode = "rgmii-txid";
        status = "okay";
 
        phy0: ethernet-phy@0 {
        };
 };
 
+&canfd {
+       pinctrl-0 = <&canfd0_pins>;
+       pinctrl-names = "default";
+       status = "okay";
+
+       channel0 {
+               status = "okay";
+       };
+};
+
+&csi40 {
+       status = "okay";
+
+       ports {
+               port@0 {
+                       reg = <0>;
+
+                       csi40_in: endpoint {
+                               clock-lanes = <0>;
+                               data-lanes = <1 2>;
+                               remote-endpoint = <&adv7482_txa>;
+                       };
+               };
+       };
+};
+
+&du {
+       pinctrl-0 = <&du_pins>;
+       pinctrl-names = "default";
+       status = "okay";
+
+       clocks = <&cpg CPG_MOD 724>,
+                <&cpg CPG_MOD 723>,
+                <&x13_clk>;
+       clock-names = "du.0", "du.1", "dclkin.0";
+
+       ports {
+               port@0 {
+                       endpoint {
+                               remote-endpoint = <&adv7123_in>;
+                       };
+               };
+       };
+};
+
 &ehci0 {
+       dr_mode = "otg";
        status = "okay";
 };
 
        clock-frequency = <48000000>;
 };
 
+&hsusb {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&i2c0 {
+       status = "okay";
+
+       hdmi-encoder@39 {
+               compatible = "adi,adv7511w";
+               reg = <0x39>;
+               interrupt-parent = <&gpio1>;
+               interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
+
+               adi,input-depth = <8>;
+               adi,input-colorspace = "rgb";
+               adi,input-clock = "1x";
+               adi,input-style = <1>;
+               adi,input-justification = "evenly";
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               adv7511_in: endpoint {
+                                       remote-endpoint = <&thc63lvd1024_out>;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               adv7511_out: endpoint {
+                                       remote-endpoint = <&hdmi_con_out>;
+                               };
+                       };
+               };
+       };
+
+       video-receiver@70 {
+               compatible = "adi,adv7482";
+               reg = <0x70>;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               interrupt-parent = <&gpio0>;
+               interrupt-names = "intrq1", "intrq2";
+               interrupts = <7 IRQ_TYPE_LEVEL_LOW>,
+                            <17 IRQ_TYPE_LEVEL_LOW>;
+
+               port@7 {
+                       reg = <7>;
+
+                       adv7482_ain7: endpoint {
+                               remote-endpoint = <&cvbs_con>;
+                       };
+               };
+
+               port@8 {
+                       reg = <8>;
+
+                       adv7482_hdmi: endpoint {
+                               remote-endpoint = <&hdmi_in_con>;
+                       };
+               };
+
+               port@a {
+                       reg = <0xa>;
+
+                       adv7482_txa: endpoint {
+                               clock-lanes = <0>;
+                               data-lanes = <1 2>;
+                               remote-endpoint = <&csi40_in>;
+                       };
+               };
+       };
+};
+
+&i2c3 {
+       status = "okay";
+
+       ak4613: codec@10 {
+               compatible = "asahi-kasei,ak4613";
+               #sound-dai-cells = <0>;
+               reg = <0x10>;
+               clocks = <&rcar_sound 3>;
+
+               asahi-kasei,in1-single-end;
+               asahi-kasei,in2-single-end;
+               asahi-kasei,out1-single-end;
+               asahi-kasei,out2-single-end;
+               asahi-kasei,out3-single-end;
+               asahi-kasei,out4-single-end;
+               asahi-kasei,out5-single-end;
+               asahi-kasei,out6-single-end;
+       };
+
+       cs2000: clk-multiplier@4f {
+               #clock-cells = <0>;
+               compatible = "cirrus,cs2000-cp";
+               reg = <0x4f>;
+               clocks = <&audio_clkout>, <&x12_clk>;
+               clock-names = "clk_in", "ref_clk";
+
+               assigned-clocks = <&cs2000>;
+               assigned-clock-rates = <24576000>; /* 1/1 divide */
+       };
+};
+
+&lvds0 {
+       status = "okay";
+
+       clocks = <&cpg CPG_MOD 727>,
+                <&x13_clk>,
+                <&extal_clk>;
+       clock-names = "fck", "dclkin.0", "extal";
+
+       ports {
+               port@1 {
+                       lvds0_out: endpoint {
+                               remote-endpoint = <&thc63lvd1024_in>;
+                       };
+               };
+       };
+};
+
+&lvds1 {
+       clocks = <&cpg CPG_MOD 727>,
+                <&x13_clk>,
+                <&extal_clk>;
+       clock-names = "fck", "dclkin.0", "extal";
+};
+
 &ohci0 {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&pcie_bus_clk {
+       clock-frequency = <100000000>;
+};
+
+&pciec0 {
        status = "okay";
 };
 
                };
        };
 
+       canfd0_pins: canfd0 {
+               groups = "canfd0_data";
+               function = "canfd0";
+       };
+
+       du_pins: du {
+               groups = "du_rgb888", "du_sync", "du_disp", "du_clk_out_0";
+               function = "du";
+       };
+
+       pwm3_pins: pwm3 {
+               groups = "pwm3_b";
+               function = "pwm3";
+       };
+
+       pwm5_pins: pwm5 {
+               groups = "pwm5_a";
+               function = "pwm5";
+       };
+
+       sdhi0_pins: sd0 {
+               groups = "sdhi0_data4", "sdhi0_ctrl";
+               function = "sdhi0";
+               power-source = <3300>;
+       };
+
+       sdhi0_pins_uhs: sd0_uhs {
+               groups = "sdhi0_data4", "sdhi0_ctrl";
+               function = "sdhi0";
+               power-source = <1800>;
+       };
+
+       sdhi1_pins: sd1 {
+               groups = "sdhi1_data4", "sdhi1_ctrl";
+               function = "sdhi1";
+               power-source = <3300>;
+       };
+
+       sdhi1_pins_uhs: sd1_uhs {
+               groups = "sdhi1_data4", "sdhi1_ctrl";
+               function = "sdhi1";
+               power-source = <1800>;
+       };
+
+       sdhi3_pins: sd3 {
+               groups = "sdhi3_data8", "sdhi3_ctrl", "sdhi3_ds";
+               function = "sdhi3";
+               power-source = <1800>;
+       };
+
+       sound_pins: sound {
+               groups = "ssi01239_ctrl", "ssi0_data", "ssi1_data";
+               function = "ssi";
+       };
+
+       sound_clk_pins: sound_clk {
+               groups = "audio_clk_a", "audio_clk_b_a", "audio_clk_c_a",
+                        "audio_clkout_a", "audio_clkout1_a";
+               function = "audio_clk";
+       };
+
+       scif2_pins: scif2 {
+               groups = "scif2_data_a";
+               function = "scif2";
+       };
+
        usb0_pins: usb {
-               groups = "usb0_b";
+               groups = "usb0_b", "usb0_id";
                function = "usb0";
        };
 
        };
 };
 
+&pwm3 {
+       pinctrl-0 = <&pwm3_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+};
+
+&pwm5 {
+       pinctrl-0 = <&pwm5_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+};
+
+&rcar_sound {
+       pinctrl-0 = <&sound_pins &sound_clk_pins>;
+       pinctrl-names = "default";
+
+       /* Single DAI */
+       #sound-dai-cells = <0>;
+
+       /* audio_clkout0/1/2/3 */
+       #clock-cells = <1>;
+       clock-frequency = <12288000 11289600>;
+       clkout-lr-synchronous;
+
+       status = "okay";
+
+       /* update <audio_clk_b> to <cs2000> */
+       clocks = <&cpg CPG_MOD 1005>,
+                <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>,
+                <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>,
+                <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>,
+                <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>,
+                <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>,
+                <&cpg CPG_MOD 1022>, <&cpg CPG_MOD 1023>,
+                <&cpg CPG_MOD 1024>, <&cpg CPG_MOD 1025>,
+                <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>,
+                <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>,
+                <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>,
+                <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>,
+                <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>,
+                <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
+                <&audio_clk_a>, <&cs2000>, <&audio_clk_c>,
+                <&cpg CPG_CORE R8A77990_CLK_ZA2>;
+
+       rcar_sound,dai {
+               dai0 {
+                       playback = <&ssi0 &src0 &dvc0>;
+                       capture  = <&ssi1 &src1 &dvc1>;
+               };
+       };
+
+};
+
 &rwdt {
        timeout-sec = <60>;
        status = "okay";
 };
 
 &scif2 {
+       pinctrl-0 = <&scif2_pins>;
+       pinctrl-names = "default";
+
        status = "okay";
 };
 
+&ssi1 {
+       shared-pin;
+};
+
 &usb2_phy0 {
        pinctrl-0 = <&usb0_pins>;
        pinctrl-names = "default";
 
+       vbus-supply = <&vbus0_usb2>;
+       status = "okay";
+};
+
+&usb3_peri0 {
+       companion = <&xhci0>;
+       status = "okay";
+};
+
+&vin4 {
        status = "okay";
 };
 
 
        status = "okay";
 };
+
+&sdhi0 {
+       pinctrl-0 = <&sdhi0_pins>;
+       pinctrl-1 = <&sdhi0_pins_uhs>;
+       pinctrl-names = "default", "state_uhs";
+
+       vmmc-supply = <&vcc_sdhi0>;
+       vqmmc-supply = <&vccq_sdhi0>;
+       cd-gpios = <&gpio3 12 GPIO_ACTIVE_LOW>;
+       wp-gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>;
+       bus-width = <4>;
+       sd-uhs-sdr50;
+       sd-uhs-sdr104;
+       status = "okay";
+};
+
+&sdhi1 {
+       pinctrl-0 = <&sdhi1_pins>;
+       pinctrl-1 = <&sdhi1_pins_uhs>;
+       pinctrl-names = "default", "state_uhs";
+
+       vmmc-supply = <&vcc_sdhi1>;
+       vqmmc-supply = <&vccq_sdhi1>;
+       cd-gpios = <&gpio3 14 GPIO_ACTIVE_LOW>;
+       bus-width = <4>;
+       sd-uhs-sdr50;
+       sd-uhs-sdr104;
+       status = "okay";
+};
+
+&sdhi3 {
+       /* used for on-board 8bit eMMC */
+       pinctrl-0 = <&sdhi3_pins>;
+       pinctrl-1 = <&sdhi3_pins>;
+       pinctrl-names = "default", "state_uhs";
+
+       vmmc-supply = <&reg_3p3v>;
+       vqmmc-supply = <&reg_1p8v>;
+       mmc-hs200-1_8v;
+       mmc-hs400-1_8v;
+       bus-width = <8>;
+       non-removable;
+       status = "okay";
+};
index 288e57e4bca0511c6c68df523995d08f86bc5c19..ddf8b626271513e2abc4a01b5ffe9b084772769f 100644 (file)
@@ -7,36 +7,14 @@
 
 #include "r8a779x-u-boot.dtsi"
 
-&soc {
-       rpc: rpc@0xee200000 {
-               compatible = "renesas,rpc-r8a77990", "renesas,rpc";
-               reg = <0 0xee200000 0 0x100>, <0 0x08000000 0 0>;
-               clocks = <&cpg CPG_MOD 917>;
-               bank-width = <2>;
-               status = "disabled";
-       };
-
-       sdhi0: sd@ee100000 {
-               compatible = "renesas,sdhi-r8a77990";
-               reg = <0 0xee100000 0 0x2000>;
-               clocks = <&cpg CPG_MOD 314>;
-               max-frequency = <200000000>;
-               status = "disabled";
-       };
-
-       sdhi1: sd@ee120000 {
-               compatible = "renesas,sdhi-r8a77990";
-               reg = <0 0xee120000 0 0x2000>;
-               clocks = <&cpg CPG_MOD 313>;
-               max-frequency = <200000000>;
-               status = "disabled";
-       };
-
-       sdhi3: sd@ee160000 {
-               compatible = "renesas,sdhi-r8a77990";
-               reg = <0 0xee160000 0 0x2000>;
-               clocks = <&cpg CPG_MOD 311>;
-               max-frequency = <200000000>;
-               status = "disabled";
+/ {
+       soc {
+               rpc: rpc@0xee200000 {
+                       compatible = "renesas,rpc-r8a77990", "renesas,rpc";
+                       reg = <0 0xee200000 0 0x100>, <0 0x08000000 0 0>;
+                       clocks = <&cpg CPG_MOD 917>;
+                       bank-width = <2>;
+                       status = "disabled";
+               };
        };
 };
index ae89260baad9fd4d3ad1ec6dbef9c6a7bf1e118f..d2ad665fe2d925db040e50d2d9341b5535ddd167 100644 (file)
@@ -1,11 +1,11 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * Device Tree Source for the r8a77990 SoC
+ * Device Tree Source for the R-Car E3 (R8A77990) SoC
  *
- * Copyright (C) 2018 Renesas Electronics Corp.
+ * Copyright (C) 2018-2019 Renesas Electronics Corp.
  */
 
-#include <dt-bindings/clock/renesas-cpg-mssr.h>
+#include <dt-bindings/clock/r8a77990-cpg-mssr.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/power/r8a77990-sysc.h>
 
        #address-cells = <2>;
        #size-cells = <2>;
 
+       aliases {
+               i2c0 = &i2c0;
+               i2c1 = &i2c1;
+               i2c2 = &i2c2;
+               i2c3 = &i2c3;
+               i2c4 = &i2c4;
+               i2c5 = &i2c5;
+               i2c6 = &i2c6;
+               i2c7 = &i2c7;
+       };
+
+       /*
+        * The external audio clocks are configured as 0 Hz fixed frequency
+        * clocks by default.
+        * Boards that provide audio clocks should override them.
+        */
+       audio_clk_a: audio_clk_a {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <0>;
+       };
+
+       audio_clk_b: audio_clk_b {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <0>;
+       };
+
+       audio_clk_c: audio_clk_c {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <0>;
+       };
+
+       /* External CAN clock - to be overridden by boards that provide it */
+       can_clk: can {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <0>;
+       };
+
+       cluster1_opp: opp_table10 {
+               compatible = "operating-points-v2";
+               opp-shared;
+               opp-800000000 {
+                       opp-hz = /bits/ 64 <800000000>;
+                       opp-microvolt = <820000>;
+                       clock-latency-ns = <300000>;
+               };
+               opp-1000000000 {
+                       opp-hz = /bits/ 64 <1000000000>;
+                       opp-microvolt = <820000>;
+                       clock-latency-ns = <300000>;
+               };
+               opp-1200000000 {
+                       opp-hz = /bits/ 64 <1200000000>;
+                       opp-microvolt = <820000>;
+                       clock-latency-ns = <300000>;
+                       opp-suspend;
+               };
+       };
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
 
                a53_0: cpu@0 {
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0>;
                        device_type = "cpu";
-                       power-domains = <&sysc 5>;
+                       power-domains = <&sysc R8A77990_PD_CA53_CPU0>;
                        next-level-cache = <&L2_CA53>;
                        enable-method = "psci";
+                       clocks =<&cpg CPG_CORE R8A77990_CLK_Z2>;
+                       operating-points-v2 = <&cluster1_opp>;
                };
 
                a53_1: cpu@1 {
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <1>;
                        device_type = "cpu";
-                       power-domains = <&sysc 6>;
+                       power-domains = <&sysc R8A77990_PD_CA53_CPU1>;
                        next-level-cache = <&L2_CA53>;
                        enable-method = "psci";
+                       clocks =<&cpg CPG_CORE R8A77990_CLK_Z2>;
+                       operating-points-v2 = <&cluster1_opp>;
                };
 
                L2_CA53: cache-controller-0 {
                        compatible = "cache";
-                       power-domains = <&sysc 21>;
+                       power-domains = <&sysc R8A77990_PD_CA53_SCU>;
                        cache-unified;
                        cache-level = <2>;
                };
                clock-frequency = <0>;
        };
 
+       /* External PCIe clock - can be overridden by the board */
+       pcie_bus_clk: pcie_bus {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <0>;
+       };
+
        pmu_a53 {
                compatible = "arm,cortex-a53-pmu";
                interrupts-extended = <&gic GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>,
                method = "smc";
        };
 
+       /* External SCIF clock - to be overridden by boards that provide it */
+       scif_clk: scif {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <0>;
+       };
+
        soc: soc {
                compatible = "simple-bus";
                interrupt-parent = <&gic>;
                                     "renesas,rcar-gen3-wdt";
                        reg = <0 0xe6020000 0 0x0c>;
                        clocks = <&cpg CPG_MOD 402>;
-                       power-domains = <&sysc 32>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
                        resets = <&cpg 402>;
                        status = "disabled";
                };
                        #interrupt-cells = <2>;
                        interrupt-controller;
                        clocks = <&cpg CPG_MOD 912>;
-                       power-domains = <&sysc 32>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
                        resets = <&cpg 912>;
                };
 
                        #interrupt-cells = <2>;
                        interrupt-controller;
                        clocks = <&cpg CPG_MOD 911>;
-                       power-domains = <&sysc 32>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
                        resets = <&cpg 911>;
                };
 
                        #interrupt-cells = <2>;
                        interrupt-controller;
                        clocks = <&cpg CPG_MOD 910>;
-                       power-domains = <&sysc 32>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
                        resets = <&cpg 910>;
                };
 
                        #interrupt-cells = <2>;
                        interrupt-controller;
                        clocks = <&cpg CPG_MOD 909>;
-                       power-domains = <&sysc 32>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
                        resets = <&cpg 909>;
                };
 
                        #interrupt-cells = <2>;
                        interrupt-controller;
                        clocks = <&cpg CPG_MOD 908>;
-                       power-domains = <&sysc 32>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
                        resets = <&cpg 908>;
                };
 
                        #interrupt-cells = <2>;
                        interrupt-controller;
                        clocks = <&cpg CPG_MOD 907>;
-                       power-domains = <&sysc 32>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
                        resets = <&cpg 907>;
                };
 
                        #interrupt-cells = <2>;
                        interrupt-controller;
                        clocks = <&cpg CPG_MOD 906>;
-                       power-domains = <&sysc 32>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
                        resets = <&cpg 906>;
                };
 
                        reg = <0 0xe6060000 0 0x508>;
                };
 
+               i2c_dvfs: i2c@e60b0000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "renesas,iic-r8a77990";
+                       reg = <0 0xe60b0000 0 0x15>;
+                       interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 926>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 926>;
+                       dmas = <&dmac0 0x11>, <&dmac0 0x10>;
+                       dma-names = "tx", "rx";
+                       status = "disabled";
+               };
+
                cpg: clock-controller@e6150000 {
                        compatible = "renesas,r8a77990-cpg-mssr";
                        reg = <0 0xe6150000 0 0x1000>;
                        #power-domain-cells = <1>;
                };
 
+               thermal: thermal@e6190000 {
+                       compatible = "renesas,thermal-r8a77990";
+                       reg = <0 0xe6190000 0 0x10>, <0 0xe6190100 0 0x38>;
+                       interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 522>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 522>;
+                       #thermal-sensor-cells = <0>;
+               };
+
+               intc_ex: interrupt-controller@e61c0000 {
+                       compatible = "renesas,intc-ex-r8a77990", "renesas,irqc";
+                       #interrupt-cells = <2>;
+                       interrupt-controller;
+                       reg = <0 0xe61c0000 0 0x200>;
+                       interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 407>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 407>;
+               };
+
+               i2c0: i2c@e6500000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "renesas,i2c-r8a77990",
+                                    "renesas,rcar-gen3-i2c";
+                       reg = <0 0xe6500000 0 0x40>;
+                       interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 931>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 931>;
+                       dmas = <&dmac1 0x91>, <&dmac1 0x90>,
+                              <&dmac2 0x91>, <&dmac2 0x90>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       i2c-scl-internal-delay-ns = <110>;
+                       status = "disabled";
+               };
+
+               i2c1: i2c@e6508000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "renesas,i2c-r8a77990",
+                                    "renesas,rcar-gen3-i2c";
+                       reg = <0 0xe6508000 0 0x40>;
+                       interrupts = <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 930>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 930>;
+                       dmas = <&dmac1 0x93>, <&dmac1 0x92>,
+                              <&dmac2 0x93>, <&dmac2 0x92>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       i2c-scl-internal-delay-ns = <6>;
+                       status = "disabled";
+               };
+
+               i2c2: i2c@e6510000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "renesas,i2c-r8a77990",
+                                    "renesas,rcar-gen3-i2c";
+                       reg = <0 0xe6510000 0 0x40>;
+                       interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 929>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 929>;
+                       dmas = <&dmac1 0x95>, <&dmac1 0x94>,
+                              <&dmac2 0x95>, <&dmac2 0x94>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       i2c-scl-internal-delay-ns = <6>;
+                       status = "disabled";
+               };
+
+               i2c3: i2c@e66d0000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "renesas,i2c-r8a77990",
+                                    "renesas,rcar-gen3-i2c";
+                       reg = <0 0xe66d0000 0 0x40>;
+                       interrupts = <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 928>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 928>;
+                       dmas = <&dmac0 0x97>, <&dmac0 0x96>;
+                       dma-names = "tx", "rx";
+                       i2c-scl-internal-delay-ns = <110>;
+                       status = "disabled";
+               };
+
+               i2c4: i2c@e66d8000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "renesas,i2c-r8a77990",
+                                    "renesas,rcar-gen3-i2c";
+                       reg = <0 0xe66d8000 0 0x40>;
+                       interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 927>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 927>;
+                       dmas = <&dmac0 0x99>, <&dmac0 0x98>;
+                       dma-names = "tx", "rx";
+                       i2c-scl-internal-delay-ns = <6>;
+                       status = "disabled";
+               };
+
+               i2c5: i2c@e66e0000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "renesas,i2c-r8a77990",
+                                    "renesas,rcar-gen3-i2c";
+                       reg = <0 0xe66e0000 0 0x40>;
+                       interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 919>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 919>;
+                       dmas = <&dmac0 0x9b>, <&dmac0 0x9a>;
+                       dma-names = "tx", "rx";
+                       i2c-scl-internal-delay-ns = <6>;
+                       status = "disabled";
+               };
+
+               i2c6: i2c@e66e8000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "renesas,i2c-r8a77990",
+                                    "renesas,rcar-gen3-i2c";
+                       reg = <0 0xe66e8000 0 0x40>;
+                       interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 918>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 918>;
+                       dmas = <&dmac0 0x9d>, <&dmac0 0x9c>;
+                       dma-names = "tx", "rx";
+                       i2c-scl-internal-delay-ns = <6>;
+                       status = "disabled";
+               };
+
+               i2c7: i2c@e6690000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "renesas,i2c-r8a77990",
+                                    "renesas,rcar-gen3-i2c";
+                       reg = <0 0xe6690000 0 0x40>;
+                       interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 1003>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 1003>;
+                       i2c-scl-internal-delay-ns = <6>;
+                       status = "disabled";
+               };
+
+               hscif0: serial@e6540000 {
+                       compatible = "renesas,hscif-r8a77990",
+                                    "renesas,rcar-gen3-hscif",
+                                    "renesas,hscif";
+                       reg = <0 0xe6540000 0 0x60>;
+                       interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 520>,
+                                <&cpg CPG_CORE R8A77990_CLK_S3D1C>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac1 0x31>, <&dmac1 0x30>,
+                              <&dmac2 0x31>, <&dmac2 0x30>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 520>;
+                       status = "disabled";
+               };
+
+               hscif1: serial@e6550000 {
+                       compatible = "renesas,hscif-r8a77990",
+                                    "renesas,rcar-gen3-hscif",
+                                    "renesas,hscif";
+                       reg = <0 0xe6550000 0 0x60>;
+                       interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 519>,
+                                <&cpg CPG_CORE R8A77990_CLK_S3D1C>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac1 0x33>, <&dmac1 0x32>,
+                              <&dmac2 0x33>, <&dmac2 0x32>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 519>;
+                       status = "disabled";
+               };
+
+               hscif2: serial@e6560000 {
+                       compatible = "renesas,hscif-r8a77990",
+                                    "renesas,rcar-gen3-hscif",
+                                    "renesas,hscif";
+                       reg = <0 0xe6560000 0 0x60>;
+                       interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 518>,
+                                <&cpg CPG_CORE R8A77990_CLK_S3D1C>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac1 0x35>, <&dmac1 0x34>,
+                              <&dmac2 0x35>, <&dmac2 0x34>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 518>;
+                       status = "disabled";
+               };
+
+               hscif3: serial@e66a0000 {
+                       compatible = "renesas,hscif-r8a77990",
+                                    "renesas,rcar-gen3-hscif",
+                                    "renesas,hscif";
+                       reg = <0 0xe66a0000 0 0x60>;
+                       interrupts = <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 517>,
+                                <&cpg CPG_CORE R8A77990_CLK_S3D1C>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac0 0x37>, <&dmac0 0x36>;
+                       dma-names = "tx", "rx";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 517>;
+                       status = "disabled";
+               };
+
+               hscif4: serial@e66b0000 {
+                       compatible = "renesas,hscif-r8a77990",
+                                    "renesas,rcar-gen3-hscif",
+                                    "renesas,hscif";
+                       reg = <0 0xe66b0000 0 0x60>;
+                       interrupts = <GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 516>,
+                                <&cpg CPG_CORE R8A77990_CLK_S3D1C>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac0 0x39>, <&dmac0 0x38>;
+                       dma-names = "tx", "rx";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 516>;
+                       status = "disabled";
+               };
+
+               hsusb: usb@e6590000 {
+                       compatible = "renesas,usbhs-r8a77990",
+                                    "renesas,rcar-gen3-usbhs";
+                       reg = <0 0xe6590000 0 0x200>;
+                       interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 704>, <&cpg CPG_MOD 703>;
+                       dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
+                              <&usb_dmac1 0>, <&usb_dmac1 1>;
+                       dma-names = "ch0", "ch1", "ch2", "ch3";
+                       renesas,buswait = <11>;
+                       phys = <&usb2_phy0>;
+                       phy-names = "usb";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 704>, <&cpg 703>;
+                       status = "disabled";
+               };
+
+               usb_dmac0: dma-controller@e65a0000 {
+                       compatible = "renesas,r8a77990-usb-dmac",
+                                    "renesas,usb-dmac";
+                       reg = <0 0xe65a0000 0 0x100>;
+                       interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "ch0", "ch1";
+                       clocks = <&cpg CPG_MOD 330>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 330>;
+                       #dma-cells = <1>;
+                       dma-channels = <2>;
+               };
+
+               usb_dmac1: dma-controller@e65b0000 {
+                       compatible = "renesas,r8a77990-usb-dmac",
+                                    "renesas,usb-dmac";
+                       reg = <0 0xe65b0000 0 0x100>;
+                       interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "ch0", "ch1";
+                       clocks = <&cpg CPG_MOD 331>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 331>;
+                       #dma-cells = <1>;
+                       dma-channels = <2>;
+               };
+
+               dmac0: dma-controller@e6700000 {
+                       compatible = "renesas,dmac-r8a77990",
+                                    "renesas,rcar-dmac";
+                       reg = <0 0xe6700000 0 0x10000>;
+                       interrupts = <GIC_SPI 199 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 200 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 201 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 202 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 203 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 204 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 213 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 214 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 215 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "error",
+                                       "ch0", "ch1", "ch2", "ch3",
+                                       "ch4", "ch5", "ch6", "ch7",
+                                       "ch8", "ch9", "ch10", "ch11",
+                                       "ch12", "ch13", "ch14", "ch15";
+                       clocks = <&cpg CPG_MOD 219>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 219>;
+                       #dma-cells = <1>;
+                       dma-channels = <16>;
+                       iommus = <&ipmmu_ds0 0>, <&ipmmu_ds0 1>,
+                              <&ipmmu_ds0 2>, <&ipmmu_ds0 3>,
+                              <&ipmmu_ds0 4>, <&ipmmu_ds0 5>,
+                              <&ipmmu_ds0 6>, <&ipmmu_ds0 7>,
+                              <&ipmmu_ds0 8>, <&ipmmu_ds0 9>,
+                              <&ipmmu_ds0 10>, <&ipmmu_ds0 11>,
+                              <&ipmmu_ds0 12>, <&ipmmu_ds0 13>,
+                              <&ipmmu_ds0 14>, <&ipmmu_ds0 15>;
+               };
+
+               dmac1: dma-controller@e7300000 {
+                       compatible = "renesas,dmac-r8a77990",
+                                    "renesas,rcar-dmac";
+                       reg = <0 0xe7300000 0 0x10000>;
+                       interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 219 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 312 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 313 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 319 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "error",
+                                       "ch0", "ch1", "ch2", "ch3",
+                                       "ch4", "ch5", "ch6", "ch7",
+                                       "ch8", "ch9", "ch10", "ch11",
+                                       "ch12", "ch13", "ch14", "ch15";
+                       clocks = <&cpg CPG_MOD 218>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 218>;
+                       #dma-cells = <1>;
+                       dma-channels = <16>;
+                       iommus = <&ipmmu_ds1 0>, <&ipmmu_ds1 1>,
+                              <&ipmmu_ds1 2>, <&ipmmu_ds1 3>,
+                              <&ipmmu_ds1 4>, <&ipmmu_ds1 5>,
+                              <&ipmmu_ds1 6>, <&ipmmu_ds1 7>,
+                              <&ipmmu_ds1 8>, <&ipmmu_ds1 9>,
+                              <&ipmmu_ds1 10>, <&ipmmu_ds1 11>,
+                              <&ipmmu_ds1 12>, <&ipmmu_ds1 13>,
+                              <&ipmmu_ds1 14>, <&ipmmu_ds1 15>;
+               };
+
+               dmac2: dma-controller@e7310000 {
+                       compatible = "renesas,dmac-r8a77990",
+                                    "renesas,rcar-dmac";
+                       reg = <0 0xe7310000 0 0x10000>;
+                       interrupts = <GIC_SPI 416 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 417 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 418 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 419 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 420 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 421 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 422 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 423 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 424 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 425 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 426 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 427 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 428 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 429 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 430 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 431 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 397 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "error",
+                                       "ch0", "ch1", "ch2", "ch3",
+                                       "ch4", "ch5", "ch6", "ch7",
+                                       "ch8", "ch9", "ch10", "ch11",
+                                       "ch12", "ch13", "ch14", "ch15";
+                       clocks = <&cpg CPG_MOD 217>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 217>;
+                       #dma-cells = <1>;
+                       dma-channels = <16>;
+                       iommus = <&ipmmu_ds1 16>, <&ipmmu_ds1 17>,
+                              <&ipmmu_ds1 18>, <&ipmmu_ds1 19>,
+                              <&ipmmu_ds1 20>, <&ipmmu_ds1 21>,
+                              <&ipmmu_ds1 22>, <&ipmmu_ds1 23>,
+                              <&ipmmu_ds1 24>, <&ipmmu_ds1 25>,
+                              <&ipmmu_ds1 26>, <&ipmmu_ds1 27>,
+                              <&ipmmu_ds1 28>, <&ipmmu_ds1 29>,
+                              <&ipmmu_ds1 30>, <&ipmmu_ds1 31>;
+               };
+
                ipmmu_ds0: mmu@e6740000 {
                        compatible = "renesas,ipmmu-r8a77990";
                        reg = <0 0xe6740000 0 0x1000>;
                                          "ch20", "ch21", "ch22", "ch23",
                                          "ch24";
                        clocks = <&cpg CPG_MOD 812>;
-                       power-domains = <&sysc 32>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
                        resets = <&cpg 812>;
                        phy-mode = "rgmii";
+                       iommus = <&ipmmu_ds0 16>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        status = "disabled";
                };
 
+               can0: can@e6c30000 {
+                       compatible = "renesas,can-r8a77990",
+                                    "renesas,rcar-gen3-can";
+                       reg = <0 0xe6c30000 0 0x1000>;
+                       interrupts = <GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 916>,
+                              <&cpg CPG_CORE R8A77990_CLK_CANFD>,
+                              <&can_clk>;
+                       clock-names = "clkp1", "clkp2", "can_clk";
+                       assigned-clocks = <&cpg CPG_CORE R8A77990_CLK_CANFD>;
+                       assigned-clock-rates = <40000000>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 916>;
+                       status = "disabled";
+               };
+
+               can1: can@e6c38000 {
+                       compatible = "renesas,can-r8a77990",
+                                    "renesas,rcar-gen3-can";
+                       reg = <0 0xe6c38000 0 0x1000>;
+                       interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 915>,
+                              <&cpg CPG_CORE R8A77990_CLK_CANFD>,
+                              <&can_clk>;
+                       clock-names = "clkp1", "clkp2", "can_clk";
+                       assigned-clocks = <&cpg CPG_CORE R8A77990_CLK_CANFD>;
+                       assigned-clock-rates = <40000000>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 915>;
+                       status = "disabled";
+               };
+
+               canfd: can@e66c0000 {
+                       compatible = "renesas,r8a77990-canfd",
+                                    "renesas,rcar-gen3-canfd";
+                       reg = <0 0xe66c0000 0 0x8000>;
+                       interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>,
+                                  <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 914>,
+                              <&cpg CPG_CORE R8A77990_CLK_CANFD>,
+                              <&can_clk>;
+                       clock-names = "fck", "canfd", "can_clk";
+                       assigned-clocks = <&cpg CPG_CORE R8A77990_CLK_CANFD>;
+                       assigned-clock-rates = <40000000>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 914>;
+                       status = "disabled";
+
+                       channel0 {
+                               status = "disabled";
+                       };
+
+                       channel1 {
+                               status = "disabled";
+                       };
+               };
+
+               pwm0: pwm@e6e30000 {
+                       compatible = "renesas,pwm-r8a77990", "renesas,pwm-rcar";
+                       reg = <0 0xe6e30000 0 0x8>;
+                       clocks = <&cpg CPG_MOD 523>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 523>;
+                       #pwm-cells = <2>;
+                       status = "disabled";
+               };
+
+               pwm1: pwm@e6e31000 {
+                       compatible = "renesas,pwm-r8a77990", "renesas,pwm-rcar";
+                       reg = <0 0xe6e31000 0 0x8>;
+                       clocks = <&cpg CPG_MOD 523>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 523>;
+                       #pwm-cells = <2>;
+                       status = "disabled";
+               };
+
+               pwm2: pwm@e6e32000 {
+                       compatible = "renesas,pwm-r8a77990", "renesas,pwm-rcar";
+                       reg = <0 0xe6e32000 0 0x8>;
+                       clocks = <&cpg CPG_MOD 523>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 523>;
+                       #pwm-cells = <2>;
+                       status = "disabled";
+               };
+
+               pwm3: pwm@e6e33000 {
+                       compatible = "renesas,pwm-r8a77990", "renesas,pwm-rcar";
+                       reg = <0 0xe6e33000 0 0x8>;
+                       clocks = <&cpg CPG_MOD 523>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 523>;
+                       #pwm-cells = <2>;
+                       status = "disabled";
+               };
+
+               pwm4: pwm@e6e34000 {
+                       compatible = "renesas,pwm-r8a77990", "renesas,pwm-rcar";
+                       reg = <0 0xe6e34000 0 0x8>;
+                       clocks = <&cpg CPG_MOD 523>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 523>;
+                       #pwm-cells = <2>;
+                       status = "disabled";
+               };
+
+               pwm5: pwm@e6e35000 {
+                       compatible = "renesas,pwm-r8a77990", "renesas,pwm-rcar";
+                       reg = <0 0xe6e35000 0 0x8>;
+                       clocks = <&cpg CPG_MOD 523>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 523>;
+                       #pwm-cells = <2>;
+                       status = "disabled";
+               };
+
+               pwm6: pwm@e6e36000 {
+                       compatible = "renesas,pwm-r8a77990", "renesas,pwm-rcar";
+                       reg = <0 0xe6e36000 0 0x8>;
+                       clocks = <&cpg CPG_MOD 523>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 523>;
+                       #pwm-cells = <2>;
+                       status = "disabled";
+               };
+
+               scif0: serial@e6e60000 {
+                       compatible = "renesas,scif-r8a77990",
+                                    "renesas,rcar-gen3-scif", "renesas,scif";
+                       reg = <0 0xe6e60000 0 64>;
+                       interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 207>,
+                                <&cpg CPG_CORE R8A77990_CLK_S3D1C>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac1 0x51>, <&dmac1 0x50>,
+                              <&dmac2 0x51>, <&dmac2 0x50>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 207>;
+                       status = "disabled";
+               };
+
+               scif1: serial@e6e68000 {
+                       compatible = "renesas,scif-r8a77990",
+                                    "renesas,rcar-gen3-scif", "renesas,scif";
+                       reg = <0 0xe6e68000 0 64>;
+                       interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 206>,
+                                <&cpg CPG_CORE R8A77990_CLK_S3D1C>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac1 0x53>, <&dmac1 0x52>,
+                              <&dmac2 0x53>, <&dmac2 0x52>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 206>;
+                       status = "disabled";
+               };
+
                scif2: serial@e6e88000 {
                        compatible = "renesas,scif-r8a77990",
                                     "renesas,rcar-gen3-scif", "renesas,scif";
                        reg = <0 0xe6e88000 0 64>;
                        interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 310>;
-                       clock-names = "fck";
-                       power-domains = <&sysc 32>;
+                       clocks = <&cpg CPG_MOD 310>,
+                                <&cpg CPG_CORE R8A77990_CLK_S3D1C>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac1 0x13>, <&dmac1 0x12>,
+                              <&dmac2 0x13>, <&dmac2 0x12>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
                        resets = <&cpg 310>;
                        status = "disabled";
                };
 
+               scif3: serial@e6c50000 {
+                       compatible = "renesas,scif-r8a77990",
+                                    "renesas,rcar-gen3-scif", "renesas,scif";
+                       reg = <0 0xe6c50000 0 64>;
+                       interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 204>,
+                                <&cpg CPG_CORE R8A77990_CLK_S3D1C>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac0 0x57>, <&dmac0 0x56>;
+                       dma-names = "tx", "rx";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 204>;
+                       status = "disabled";
+               };
+
+               scif4: serial@e6c40000 {
+                       compatible = "renesas,scif-r8a77990",
+                                    "renesas,rcar-gen3-scif", "renesas,scif";
+                       reg = <0 0xe6c40000 0 64>;
+                       interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 203>,
+                                <&cpg CPG_CORE R8A77990_CLK_S3D1C>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac0 0x59>, <&dmac0 0x58>;
+                       dma-names = "tx", "rx";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 203>;
+                       status = "disabled";
+               };
+
+               scif5: serial@e6f30000 {
+                       compatible = "renesas,scif-r8a77990",
+                                    "renesas,rcar-gen3-scif", "renesas,scif";
+                       reg = <0 0xe6f30000 0 64>;
+                       interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 202>,
+                                <&cpg CPG_CORE R8A77990_CLK_S3D1C>,
+                                <&scif_clk>;
+                       clock-names = "fck", "brg_int", "scif_clk";
+                       dmas = <&dmac0 0x5b>, <&dmac0 0x5a>;
+                       dma-names = "tx", "rx";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 202>;
+                       status = "disabled";
+               };
+
+               msiof0: spi@e6e90000 {
+                       compatible = "renesas,msiof-r8a77990",
+                                    "renesas,rcar-gen3-msiof";
+                       reg = <0 0xe6e90000 0 0x0064>;
+                       interrupts = <GIC_SPI 156 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 211>;
+                       dmas = <&dmac1 0x41>, <&dmac1 0x40>,
+                              <&dmac2 0x41>, <&dmac2 0x40>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 211>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
+               msiof1: spi@e6ea0000 {
+                       compatible = "renesas,msiof-r8a77990",
+                                    "renesas,rcar-gen3-msiof";
+                       reg = <0 0xe6ea0000 0 0x0064>;
+                       interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 210>;
+                       dmas = <&dmac1 0x43>, <&dmac1 0x42>,
+                              <&dmac2 0x43>, <&dmac2 0x42>;
+                       dma-names = "tx", "rx", "tx", "rx";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 210>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
+               msiof2: spi@e6c00000 {
+                       compatible = "renesas,msiof-r8a77990",
+                                    "renesas,rcar-gen3-msiof";
+                       reg = <0 0xe6c00000 0 0x0064>;
+                       interrupts = <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 209>;
+                       dmas = <&dmac0 0x45>, <&dmac0 0x44>;
+                       dma-names = "tx", "rx";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 209>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
+               msiof3: spi@e6c10000 {
+                       compatible = "renesas,msiof-r8a77990",
+                                    "renesas,rcar-gen3-msiof";
+                       reg = <0 0xe6c10000 0 0x0064>;
+                       interrupts = <GIC_SPI 159 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 208>;
+                       dmas = <&dmac0 0x47>, <&dmac0 0x46>;
+                       dma-names = "tx", "rx";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 208>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+               };
+
+               vin4: video@e6ef4000 {
+                       compatible = "renesas,vin-r8a77990";
+                       reg = <0 0xe6ef4000 0 0x1000>;
+                       interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 807>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 807>;
+                       renesas,id = <4>;
+                       status = "disabled";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@1 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       reg = <1>;
+
+                                       vin4csi40: endpoint@2 {
+                                               reg = <2>;
+                                               remote-endpoint= <&csi40vin4>;
+                                       };
+                               };
+                       };
+               };
+
+               vin5: video@e6ef5000 {
+                       compatible = "renesas,vin-r8a77990";
+                       reg = <0 0xe6ef5000 0 0x1000>;
+                       interrupts = <GIC_SPI 175 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 806>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 806>;
+                       renesas,id = <5>;
+                       status = "disabled";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@1 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       reg = <1>;
+
+                                       vin5csi40: endpoint@2 {
+                                               reg = <2>;
+                                               remote-endpoint= <&csi40vin5>;
+                                       };
+                               };
+                       };
+               };
+
+               rcar_sound: sound@ec500000 {
+                       /*
+                        * #sound-dai-cells is required
+                        *
+                        * Single DAI : #sound-dai-cells = <0>; <&rcar_sound>;
+                        * Multi  DAI : #sound-dai-cells = <1>; <&rcar_sound N>;
+                        */
+                       /*
+                        * #clock-cells is required for audio_clkout0/1/2/3
+                        *
+                        * clkout       : #clock-cells = <0>;   <&rcar_sound>;
+                        * clkout0/1/2/3: #clock-cells = <1>;   <&rcar_sound N>;
+                        */
+                       compatible =  "renesas,rcar_sound-r8a77990", "renesas,rcar_sound-gen3";
+                       reg =   <0 0xec500000 0 0x1000>, /* SCU */
+                               <0 0xec5a0000 0 0x100>,  /* ADG */
+                               <0 0xec540000 0 0x1000>, /* SSIU */
+                               <0 0xec541000 0 0x280>,  /* SSI */
+                               <0 0xec760000 0 0x200>;  /* Audio DMAC peri peri*/
+                       reg-names = "scu", "adg", "ssiu", "ssi", "audmapp";
+
+                       clocks = <&cpg CPG_MOD 1005>,
+                                <&cpg CPG_MOD 1006>, <&cpg CPG_MOD 1007>,
+                                <&cpg CPG_MOD 1008>, <&cpg CPG_MOD 1009>,
+                                <&cpg CPG_MOD 1010>, <&cpg CPG_MOD 1011>,
+                                <&cpg CPG_MOD 1012>, <&cpg CPG_MOD 1013>,
+                                <&cpg CPG_MOD 1014>, <&cpg CPG_MOD 1015>,
+                                <&cpg CPG_MOD 1022>, <&cpg CPG_MOD 1023>,
+                                <&cpg CPG_MOD 1024>, <&cpg CPG_MOD 1025>,
+                                <&cpg CPG_MOD 1026>, <&cpg CPG_MOD 1027>,
+                                <&cpg CPG_MOD 1028>, <&cpg CPG_MOD 1029>,
+                                <&cpg CPG_MOD 1030>, <&cpg CPG_MOD 1031>,
+                                <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>,
+                                <&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>,
+                                <&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
+                                <&audio_clk_a>, <&audio_clk_b>,
+                                <&audio_clk_c>,
+                                <&cpg CPG_CORE R8A77990_CLK_ZA2>;
+                       clock-names = "ssi-all",
+                                     "ssi.9", "ssi.8", "ssi.7", "ssi.6",
+                                     "ssi.5", "ssi.4", "ssi.3", "ssi.2",
+                                     "ssi.1", "ssi.0",
+                                     "src.9", "src.8", "src.7", "src.6",
+                                     "src.5", "src.4", "src.3", "src.2",
+                                     "src.1", "src.0",
+                                     "mix.1", "mix.0",
+                                     "ctu.1", "ctu.0",
+                                     "dvc.0", "dvc.1",
+                                     "clk_a", "clk_b", "clk_c", "clk_i";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 1005>,
+                                <&cpg 1006>, <&cpg 1007>,
+                                <&cpg 1008>, <&cpg 1009>,
+                                <&cpg 1010>, <&cpg 1011>,
+                                <&cpg 1012>, <&cpg 1013>,
+                                <&cpg 1014>, <&cpg 1015>;
+                       reset-names = "ssi-all",
+                                     "ssi.9", "ssi.8", "ssi.7", "ssi.6",
+                                     "ssi.5", "ssi.4", "ssi.3", "ssi.2",
+                                     "ssi.1", "ssi.0";
+                       status = "disabled";
+
+                       rcar_sound,dvc {
+                               dvc0: dvc-0 {
+                                       dmas = <&audma0 0xbc>;
+                                       dma-names = "tx";
+                               };
+                               dvc1: dvc-1 {
+                                       dmas = <&audma0 0xbe>;
+                                       dma-names = "tx";
+                               };
+                       };
+
+                       rcar_sound,mix {
+                               mix0: mix-0 { };
+                               mix1: mix-1 { };
+                       };
+
+                       rcar_sound,ctu {
+                               ctu00: ctu-0 { };
+                               ctu01: ctu-1 { };
+                               ctu02: ctu-2 { };
+                               ctu03: ctu-3 { };
+                               ctu10: ctu-4 { };
+                               ctu11: ctu-5 { };
+                               ctu12: ctu-6 { };
+                               ctu13: ctu-7 { };
+                       };
+
+                       rcar_sound,src {
+                               src0: src-0 {
+                                       interrupts = <GIC_SPI 352 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x85>, <&audma0 0x9a>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src1: src-1 {
+                                       interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x87>, <&audma0 0x9c>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src2: src-2 {
+                                       interrupts = <GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x89>, <&audma0 0x9e>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src3: src-3 {
+                                       interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x8b>, <&audma0 0xa0>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src4: src-4 {
+                                       interrupts = <GIC_SPI 356 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x8d>, <&audma0 0xb0>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src5: src-5 {
+                                       interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x8f>, <&audma0 0xb2>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src6: src-6 {
+                                       interrupts = <GIC_SPI 358 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x91>, <&audma0 0xb4>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src7: src-7 {
+                                       interrupts = <GIC_SPI 359 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x93>, <&audma0 0xb6>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src8: src-8 {
+                                       interrupts = <GIC_SPI 360 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x95>, <&audma0 0xb8>;
+                                       dma-names = "rx", "tx";
+                               };
+                               src9: src-9 {
+                                       interrupts = <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x97>, <&audma0 0xba>;
+                                       dma-names = "rx", "tx";
+                               };
+                       };
+
+                       rcar_sound,ssi {
+                               ssi0: ssi-0 {
+                                       interrupts = <GIC_SPI 370 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x01>, <&audma0 0x02>,
+                                              <&audma0 0x15>, <&audma0 0x16>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
+                               };
+                               ssi1: ssi-1 {
+                                       interrupts = <GIC_SPI 371 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x03>, <&audma0 0x04>,
+                                              <&audma0 0x49>, <&audma0 0x4a>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
+                               };
+                               ssi2: ssi-2 {
+                                       interrupts = <GIC_SPI 372 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x05>, <&audma0 0x06>,
+                                              <&audma0 0x63>, <&audma0 0x64>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
+                               };
+                               ssi3: ssi-3 {
+                                       interrupts = <GIC_SPI 373 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x07>, <&audma0 0x08>,
+                                              <&audma0 0x6f>, <&audma0 0x70>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
+                               };
+                               ssi4: ssi-4 {
+                                       interrupts = <GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x09>, <&audma0 0x0a>,
+                                              <&audma0 0x71>, <&audma0 0x72>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
+                               };
+                               ssi5: ssi-5 {
+                                       interrupts = <GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x0b>, <&audma0 0x0c>,
+                                              <&audma0 0x73>, <&audma0 0x74>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
+                               };
+                               ssi6: ssi-6 {
+                                       interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x0d>, <&audma0 0x0e>,
+                                              <&audma0 0x75>, <&audma0 0x76>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
+                               };
+                               ssi7: ssi-7 {
+                                       interrupts = <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x0f>, <&audma0 0x10>,
+                                              <&audma0 0x79>, <&audma0 0x7a>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
+                               };
+                               ssi8: ssi-8 {
+                                       interrupts = <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x11>, <&audma0 0x12>,
+                                              <&audma0 0x7b>, <&audma0 0x7c>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
+                               };
+                               ssi9: ssi-9 {
+                                       interrupts = <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmas = <&audma0 0x13>, <&audma0 0x14>,
+                                              <&audma0 0x7d>, <&audma0 0x7e>;
+                                       dma-names = "rx", "tx", "rxu", "txu";
+                               };
+                       };
+               };
+
+               audma0: dma-controller@ec700000 {
+                       compatible = "renesas,dmac-r8a77990",
+                                    "renesas,rcar-dmac";
+                       reg = <0 0xec700000 0 0x10000>;
+                       interrupts = <GIC_SPI 350 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 320 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 322 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 324 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 328 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 332 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 333 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "error",
+                                       "ch0", "ch1", "ch2", "ch3",
+                                       "ch4", "ch5", "ch6", "ch7",
+                                       "ch8", "ch9", "ch10", "ch11",
+                                       "ch12", "ch13", "ch14", "ch15";
+                       clocks = <&cpg CPG_MOD 502>;
+                       clock-names = "fck";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 502>;
+                       #dma-cells = <1>;
+                       dma-channels = <16>;
+                       iommus = <&ipmmu_mp 0>, <&ipmmu_mp 1>,
+                                <&ipmmu_mp 2>, <&ipmmu_mp 3>,
+                                <&ipmmu_mp 4>, <&ipmmu_mp 5>,
+                                <&ipmmu_mp 6>, <&ipmmu_mp 7>,
+                                <&ipmmu_mp 8>, <&ipmmu_mp 9>,
+                                <&ipmmu_mp 10>, <&ipmmu_mp 11>,
+                                <&ipmmu_mp 12>, <&ipmmu_mp 13>,
+                                <&ipmmu_mp 14>, <&ipmmu_mp 15>;
+               };
+
                xhci0: usb@ee000000 {
                        compatible = "renesas,xhci-r8a77990",
                                     "renesas,rcar-gen3-xhci";
                        status = "disabled";
                };
 
+               usb3_peri0: usb@ee020000 {
+                       compatible = "renesas,r8a77990-usb3-peri",
+                                    "renesas,rcar-gen3-usb3-peri";
+                       reg = <0 0xee020000 0 0x400>;
+                       interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 328>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 328>;
+                       status = "disabled";
+               };
+
                ohci0: usb@ee080000 {
                        compatible = "generic-ohci";
                        reg = <0 0xee080000 0 0x100>;
                        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 703>;
+                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
                        phys = <&usb2_phy0>;
                        phy-names = "usb";
-                       power-domains = <&sysc 32>;
-                       resets = <&cpg 703>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 703>, <&cpg 704>;
                        status = "disabled";
                };
 
                        compatible = "generic-ehci";
                        reg = <0 0xee080100 0 0x100>;
                        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 703>;
+                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
                        phys = <&usb2_phy0>;
                        phy-names = "usb";
                        companion = <&ohci0>;
-                       power-domains = <&sysc 32>;
-                       resets = <&cpg 703>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 703>, <&cpg 704>;
                        status = "disabled";
                };
 
                                     "renesas,rcar-gen3-usb2-phy";
                        reg = <0 0xee080200 0 0x700>;
                        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 703>;
-                       power-domains = <&sysc 32>;
-                       resets = <&cpg 703>;
+                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 703>, <&cpg 704>;
                        #phy-cells = <0>;
                        status = "disabled";
                };
 
+               sdhi0: sd@ee100000 {
+                       compatible = "renesas,sdhi-r8a77990",
+                                    "renesas,rcar-gen3-sdhi";
+                       reg = <0 0xee100000 0 0x2000>;
+                       interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 314>;
+                       max-frequency = <200000000>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 314>;
+                       status = "disabled";
+               };
+
+               sdhi1: sd@ee120000 {
+                       compatible = "renesas,sdhi-r8a77990",
+                                    "renesas,rcar-gen3-sdhi";
+                       reg = <0 0xee120000 0 0x2000>;
+                       interrupts = <GIC_SPI 166 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 313>;
+                       max-frequency = <200000000>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 313>;
+                       status = "disabled";
+               };
+
+               sdhi3: sd@ee160000 {
+                       compatible = "renesas,sdhi-r8a77990",
+                                    "renesas,rcar-gen3-sdhi";
+                       reg = <0 0xee160000 0 0x2000>;
+                       interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 311>;
+                       max-frequency = <200000000>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 311>;
+                       status = "disabled";
+               };
+
                gic: interrupt-controller@f1010000 {
                        compatible = "arm,gic-400";
                        #interrupt-cells = <3>;
                                        (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_HIGH)>;
                        clocks = <&cpg CPG_MOD 408>;
                        clock-names = "clk";
-                       power-domains = <&sysc 32>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
                        resets = <&cpg 408>;
                };
 
+               pciec0: pcie@fe000000 {
+                       compatible = "renesas,pcie-r8a77990",
+                                    "renesas,pcie-rcar-gen3";
+                       reg = <0 0xfe000000 0 0x80000>;
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       bus-range = <0x00 0xff>;
+                       device_type = "pci";
+                       ranges = <0x01000000 0 0x00000000 0 0xfe100000 0 0x00100000
+                                 0x02000000 0 0xfe200000 0 0xfe200000 0 0x00200000
+                                 0x02000000 0 0x30000000 0 0x30000000 0 0x08000000
+                                 0x42000000 0 0x38000000 0 0x38000000 0 0x08000000>;
+                       /* Map all possible DDR as inbound ranges */
+                       dma-ranges = <0x42000000 0 0x40000000 0 0x40000000 0 0x40000000>;
+                       interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>;
+                       #interrupt-cells = <1>;
+                       interrupt-map-mask = <0 0 0 0>;
+                       interrupt-map = <0 0 0 0 &gic GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 319>, <&pcie_bus_clk>;
+                       clock-names = "pcie", "pcie_bus";
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 319>;
+                       status = "disabled";
+               };
+
+               vspb0: vsp@fe960000 {
+                       compatible = "renesas,vsp2";
+                       reg = <0 0xfe960000 0 0x8000>;
+                       interrupts = <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 626>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 626>;
+                       renesas,fcp = <&fcpvb0>;
+               };
+
+               fcpvb0: fcp@fe96f000 {
+                       compatible = "renesas,fcpv";
+                       reg = <0 0xfe96f000 0 0x200>;
+                       clocks = <&cpg CPG_MOD 607>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 607>;
+                       iommus = <&ipmmu_vp0 5>;
+               };
+
+               vspi0: vsp@fe9a0000 {
+                       compatible = "renesas,vsp2";
+                       reg = <0 0xfe9a0000 0 0x8000>;
+                       interrupts = <GIC_SPI 444 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 631>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 631>;
+                       renesas,fcp = <&fcpvi0>;
+               };
+
+               fcpvi0: fcp@fe9af000 {
+                       compatible = "renesas,fcpv";
+                       reg = <0 0xfe9af000 0 0x200>;
+                       clocks = <&cpg CPG_MOD 611>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 611>;
+                       iommus = <&ipmmu_vp0 8>;
+               };
+
+               vspd0: vsp@fea20000 {
+                       compatible = "renesas,vsp2";
+                       reg = <0 0xfea20000 0 0x7000>;
+                       interrupts = <GIC_SPI 466 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 623>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 623>;
+                       renesas,fcp = <&fcpvd0>;
+               };
+
+               fcpvd0: fcp@fea27000 {
+                       compatible = "renesas,fcpv";
+                       reg = <0 0xfea27000 0 0x200>;
+                       clocks = <&cpg CPG_MOD 603>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 603>;
+                       iommus = <&ipmmu_vi0 8>;
+               };
+
+               vspd1: vsp@fea28000 {
+                       compatible = "renesas,vsp2";
+                       reg = <0 0xfea28000 0 0x7000>;
+                       interrupts = <GIC_SPI 467 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 622>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 622>;
+                       renesas,fcp = <&fcpvd1>;
+               };
+
+               fcpvd1: fcp@fea2f000 {
+                       compatible = "renesas,fcpv";
+                       reg = <0 0xfea2f000 0 0x200>;
+                       clocks = <&cpg CPG_MOD 602>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 602>;
+                       iommus = <&ipmmu_vi0 9>;
+               };
+
+               csi40: csi2@feaa0000 {
+                       compatible = "renesas,r8a77990-csi2", "renesas,rcar-gen3-csi2";
+                       reg = <0 0xfeaa0000 0 0x10000>;
+                       interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 716>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 716>;
+                       status = "disabled";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@1 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       reg = <1>;
+
+                                       csi40vin4: endpoint@0 {
+                                               reg = <0>;
+                                               remote-endpoint = <&vin4csi40>;
+                                       };
+                                       csi40vin5: endpoint@1 {
+                                               reg = <1>;
+                                               remote-endpoint = <&vin5csi40>;
+                                       };
+                               };
+                       };
+               };
+
+               du: display@feb00000 {
+                       compatible = "renesas,du-r8a77990";
+                       reg = <0 0xfeb00000 0 0x80000>;
+                       interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 724>,
+                                <&cpg CPG_MOD 723>;
+                       clock-names = "du.0", "du.1";
+                       vsps = <&vspd0 0 &vspd1 0>;
+                       status = "disabled";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@0 {
+                                       reg = <0>;
+                                       du_out_rgb: endpoint {
+                                       };
+                               };
+
+                               port@1 {
+                                       reg = <1>;
+                                       du_out_lvds0: endpoint {
+                                               remote-endpoint = <&lvds0_in>;
+                                       };
+                               };
+
+                               port@2 {
+                                       reg = <2>;
+                                       du_out_lvds1: endpoint {
+                                               remote-endpoint = <&lvds1_in>;
+                                       };
+                               };
+                       };
+               };
+
+               lvds0: lvds-encoder@feb90000 {
+                       compatible = "renesas,r8a77990-lvds";
+                       reg = <0 0xfeb90000 0 0x20>;
+                       clocks = <&cpg CPG_MOD 727>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 727>;
+                       status = "disabled";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@0 {
+                                       reg = <0>;
+                                       lvds0_in: endpoint {
+                                               remote-endpoint = <&du_out_lvds0>;
+                                       };
+                               };
+
+                               port@1 {
+                                       reg = <1>;
+                                       lvds0_out: endpoint {
+                                       };
+                               };
+                       };
+               };
+
+               lvds1: lvds-encoder@feb90100 {
+                       compatible = "renesas,r8a77990-lvds";
+                       reg = <0 0xfeb90100 0 0x20>;
+                       clocks = <&cpg CPG_MOD 727>;
+                       power-domains = <&sysc R8A77990_PD_ALWAYS_ON>;
+                       resets = <&cpg 726>;
+                       status = "disabled";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@0 {
+                                       reg = <0>;
+                                       lvds1_in: endpoint {
+                                               remote-endpoint = <&du_out_lvds1>;
+                                       };
+                               };
+
+                               port@1 {
+                                       reg = <1>;
+                                       lvds1_out: endpoint {
+                                       };
+                               };
+                       };
+               };
+
                prr: chipid@fff00044 {
                        compatible = "renesas,prr";
                        reg = <0 0xfff00044 0 4>;
                };
        };
 
+       thermal-zones {
+               cpu-thermal {
+                       polling-delay-passive = <250>;
+                       polling-delay = <1000>;
+                       thermal-sensors = <&thermal>;
+
+                       trips {
+                               cpu-crit {
+                                       temperature = <120000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+
+                       cooling-maps {
+                       };
+               };
+       };
+
        timer {
                compatible = "arm,armv8-timer";
                interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | IRQ_TYPE_LEVEL_LOW)>,
index a8e8f2669d4c53ae7492dc489107d3fbac30eebe..db2bed1751b8d308c814fc25c4e96000a819a6f1 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * Device Tree Source for the Draak board
  *
- * Copyright (C) 2016 Renesas Electronics Corp.
+ * Copyright (C) 2016-2018 Renesas Electronics Corp.
  * Copyright (C) 2017 Glider bvba
  */
 
                stdout-path = "serial0:115200n8";
        };
 
-       vga {
-               compatible = "vga-connector";
+       backlight: backlight {
+               compatible = "pwm-backlight";
+               pwms = <&pwm1 0 50000>;
 
-               port {
-                       vga_in: endpoint {
-                               remote-endpoint = <&adv7123_out>;
-                       };
-               };
-       };
-
-       vga-encoder {
-               compatible = "adi,adv7123";
+               brightness-levels = <512 511 505 494 473 440 392 327 241 133 0>;
+               default-brightness-level = <10>;
 
-               ports {
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-
-                       port@0 {
-                               reg = <0>;
-                               adv7123_in: endpoint {
-                                       remote-endpoint = <&du_out_rgb>;
-                               };
-                       };
-                       port@1 {
-                               reg = <1>;
-                               adv7123_out: endpoint {
-                                       remote-endpoint = <&vga_in>;
-                               };
-                       };
-               };
+               power-supply = <&reg_12p0v>;
+               enable-gpios = <&gpio4 0 GPIO_ACTIVE_HIGH>;
        };
 
        composite-in {
                };
        };
 
+       hdmi-out {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con_out: endpoint {
+                               remote-endpoint = <&adv7511_out>;
+                       };
+               };
+       };
+
+       lvds-decoder {
+               compatible = "thine,thc63lvd1024";
+               vcc-supply = <&reg_3p3v>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               thc63lvd1024_in: endpoint {
+                                       remote-endpoint = <&lvds0_out>;
+                               };
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               thc63lvd1024_out: endpoint {
+                                       remote-endpoint = <&adv7511_in>;
+                               };
+                       };
+               };
+       };
+
        memory@48000000 {
                device_type = "memory";
                /* first 128MB is reserved for secure area. */
                regulator-always-on;
        };
 
-       x12_clk: x12 {
-               compatible = "fixed-clock";
-               #clock-cells = <0>;
-               clock-frequency = <74250000>;
+       reg_12p0v: regulator1 {
+               compatible = "regulator-fixed";
+               regulator-name = "D12.0V";
+               regulator-min-microvolt = <12000000>;
+               regulator-max-microvolt = <12000000>;
+               regulator-boot-on;
+               regulator-always-on;
        };
-};
 
-&extal_clk {
-       clock-frequency = <48000000>;
-};
+       vga {
+               compatible = "vga-connector";
 
-&pfc {
-       avb0_pins: avb {
-               mux {
-                       groups = "avb0_link", "avb0_mdio", "avb0_mii";
-                       function = "avb0";
+               port {
+                       vga_in: endpoint {
+                               remote-endpoint = <&adv7123_out>;
+                       };
                };
        };
 
-       du_pins: du {
-               groups = "du_rgb888", "du_sync", "du_disp", "du_clk_out_0";
-               function = "du";
-       };
+       vga-encoder {
+               compatible = "adi,adv7123";
 
-       i2c0_pins: i2c0 {
-               groups = "i2c0";
-               function = "i2c0";
-       };
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
 
-       i2c1_pins: i2c1 {
-               groups = "i2c1";
-               function = "i2c1";
+                       port@0 {
+                               reg = <0>;
+                               adv7123_in: endpoint {
+                                       remote-endpoint = <&du_out_rgb>;
+                               };
+                       };
+                       port@1 {
+                               reg = <1>;
+                               adv7123_out: endpoint {
+                                       remote-endpoint = <&vga_in>;
+                               };
+                       };
+               };
        };
 
-       pwm0_pins: pwm0 {
-               groups = "pwm0_c";
-               function = "pwm0";
+       x12_clk: x12 {
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <74250000>;
        };
+};
 
-       pwm1_pins: pwm1 {
-               groups = "pwm1_c";
-               function = "pwm1";
-       };
+&avb {
+       pinctrl-0 = <&avb0_pins>;
+       pinctrl-names = "default";
+       renesas,no-ether-link;
+       phy-handle = <&phy0>;
+       phy-mode = "rgmii-txid";
+       status = "okay";
 
-       scif2_pins: scif2 {
-               groups = "scif2_data";
-               function = "scif2";
+       phy0: ethernet-phy@0 {
+               rxc-skew-ps = <1500>;
+               reg = <0>;
+               interrupt-parent = <&gpio5>;
+               interrupts = <19 IRQ_TYPE_LEVEL_LOW>;
        };
+};
 
-       sdhi2_pins: sd2 {
-               groups = "mmc_data8", "mmc_ctrl";
-               function = "mmc";
-               power-source = <1800>;
-       };
+&du {
+       pinctrl-0 = <&du_pins>;
+       pinctrl-names = "default";
+       status = "okay";
 
-       sdhi2_pins_uhs: sd2_uhs {
-               groups = "mmc_data8", "mmc_ctrl";
-               function = "mmc";
-               power-source = <1800>;
-       };
+       clocks = <&cpg CPG_MOD 724>,
+                <&cpg CPG_MOD 723>,
+                <&x12_clk>;
+       clock-names = "du.0", "du.1", "dclkin.0";
 
-       usb0_pins: usb0 {
-               groups = "usb0";
-               function = "usb0";
+       ports {
+               port@0 {
+                       endpoint {
+                               remote-endpoint = <&adv7123_in>;
+                       };
+               };
        };
+};
 
-       vin4_pins_cvbs: vin4 {
-               groups = "vin4_data8", "vin4_sync", "vin4_clk";
-               function = "vin4";
-       };
+&ehci0 {
+       dr_mode = "host";
+       status = "okay";
+};
+
+&extal_clk {
+       clock-frequency = <48000000>;
+};
+
+&hsusb {
+       dr_mode = "host";
+       status = "okay";
 };
 
 &i2c0 {
        pinctrl-names = "default";
        status = "okay";
 
-       eeprom@50 {
-               compatible = "rohm,br24t01", "atmel,24c01";
-               reg = <0x50>;
-               pagesize = <8>;
-       };
-
        composite-in@20 {
                compatible = "adi,adv7180cp";
                reg = <0x20>;
 
-               port {
+               ports {
                        #address-cells = <1>;
                        #size-cells = <0>;
 
 
        };
 
+       hdmi-encoder@39 {
+               compatible = "adi,adv7511w";
+               reg = <0x39>, <0x3f>, <0x38>, <0x3c>;
+               reg-names = "main", "edid", "packet", "cec";
+               interrupt-parent = <&gpio1>;
+               interrupts = <28 IRQ_TYPE_LEVEL_LOW>;
+
+               /* Depends on LVDS */
+               max-clock = <135000000>;
+               min-vrefresh = <50>;
+
+               adi,input-depth = <8>;
+               adi,input-colorspace = "rgb";
+               adi,input-clock = "1x";
+               adi,input-style = <1>;
+               adi,input-justification = "evenly";
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               adv7511_in: endpoint {
+                                       remote-endpoint = <&thc63lvd1024_out>;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               adv7511_out: endpoint {
+                                       remote-endpoint = <&hdmi_con_out>;
+                               };
+                       };
+               };
+       };
+
        hdmi-decoder@4c {
                compatible = "adi,adv7612";
                reg = <0x4c>;
                        };
                };
        };
+
+       eeprom@50 {
+               compatible = "rohm,br24t01", "atmel,24c01";
+               reg = <0x50>;
+               pagesize = <8>;
+       };
 };
 
 &i2c1 {
        status = "okay";
 };
 
-&du {
-       pinctrl-0 = <&du_pins>;
-       pinctrl-names = "default";
+&lvds0 {
        status = "okay";
 
-       clocks = <&cpg CPG_MOD 724>,
-                <&cpg CPG_MOD 723>,
-                <&x12_clk>;
-       clock-names = "du.0", "du.1", "dclkin.0";
+       clocks = <&cpg CPG_MOD 727>,
+                <&x12_clk>,
+                <&extal_clk>;
+       clock-names = "fck", "dclkin.0", "extal";
 
        ports {
-               port@0 {
-                       endpoint {
-                               remote-endpoint = <&adv7123_in>;
+               port@1 {
+                       lvds0_out: endpoint {
+                               remote-endpoint = <&thc63lvd1024_in>;
                        };
                };
        };
 };
 
-&ehci0 {
-       status = "okay";
+&lvds1 {
+       clocks = <&cpg CPG_MOD 727>,
+                <&x12_clk>,
+                <&extal_clk>;
+       clock-names = "fck", "dclkin.0", "extal";
 };
 
 &ohci0 {
+       dr_mode = "host";
        status = "okay";
 };
 
-&avb {
-       pinctrl-0 = <&avb0_pins>;
+&pfc {
+       avb0_pins: avb {
+               mux {
+                       groups = "avb0_link", "avb0_mdio", "avb0_mii";
+                       function = "avb0";
+               };
+       };
+
+       du_pins: du {
+               groups = "du_rgb888", "du_sync", "du_disp", "du_clk_out_0";
+               function = "du";
+       };
+
+       i2c0_pins: i2c0 {
+               groups = "i2c0";
+               function = "i2c0";
+       };
+
+       i2c1_pins: i2c1 {
+               groups = "i2c1";
+               function = "i2c1";
+       };
+
+       pwm0_pins: pwm0 {
+               groups = "pwm0_c";
+               function = "pwm0";
+       };
+
+       pwm1_pins: pwm1 {
+               groups = "pwm1_c";
+               function = "pwm1";
+       };
+
+       scif2_pins: scif2 {
+               groups = "scif2_data";
+               function = "scif2";
+       };
+
+       sdhi2_pins: sd2 {
+               groups = "mmc_data8", "mmc_ctrl";
+               function = "mmc";
+               power-source = <1800>;
+       };
+
+       sdhi2_pins_uhs: sd2_uhs {
+               groups = "mmc_data8", "mmc_ctrl";
+               function = "mmc";
+               power-source = <1800>;
+       };
+
+       usb0_pins: usb0 {
+               groups = "usb0";
+               function = "usb0";
+       };
+
+       vin4_pins_cvbs: vin4 {
+               groups = "vin4_data8", "vin4_sync", "vin4_clk";
+               function = "vin4";
+       };
+};
+
+&pwm0 {
+       pinctrl-0 = <&pwm0_pins>;
        pinctrl-names = "default";
-       renesas,no-ether-link;
-       phy-handle = <&phy0>;
-       phy-mode = "rgmii-txid";
+
        status = "okay";
+};
 
-       phy0: ethernet-phy@0 {
-               rxc-skew-ps = <1500>;
-               reg = <0>;
-               interrupt-parent = <&gpio5>;
-               interrupts = <19 IRQ_TYPE_LEVEL_LOW>;
-       };
+&pwm1 {
+       pinctrl-0 = <&pwm1_pins>;
+       pinctrl-names = "default";
+
+       status = "okay";
+};
+
+&rwdt {
+       timeout-sec = <60>;
+       status = "okay";
 };
 
 &scif2 {
        pinctrl-0 = <&usb0_pins>;
        pinctrl-names = "default";
 
-       status = "okay";
-};
-
-&pwm0 {
-       pinctrl-0 = <&pwm0_pins>;
-       pinctrl-names = "default";
-
-       status = "okay";
-};
-
-&pwm1 {
-       pinctrl-0 = <&pwm1_pins>;
-       pinctrl-names = "default";
-
-       status = "okay";
-};
-
-&rwdt {
-       timeout-sec = <60>;
+       renesas,no-otg-pins;
        status = "okay";
 };
 
index 1f6efafb8b4519f3bc69060de92cea22b145cef3..8e9f6b7a7d5e60d376f2ae851e309aba9e83080f 100644 (file)
@@ -7,12 +7,14 @@
 
 #include "r8a779x-u-boot.dtsi"
 
-&soc {
-       rpc: rpc@0xee200000 {
-               compatible = "renesas,rpc-r8a77995", "renesas,rpc";
-               reg = <0 0xee200000 0 0x100>, <0 0x08000000 0 0>;
-               clocks = <&cpg CPG_MOD 917>;
-               bank-width = <2>;
-               status = "disabled";
+/ {
+       soc {
+               rpc: rpc@0xee200000 {
+                       compatible = "renesas,rpc-r8a77995", "renesas,rpc";
+                       reg = <0 0xee200000 0 0x100>, <0 0x08000000 0 0>;
+                       clocks = <&cpg CPG_MOD 917>;
+                       bank-width = <2>;
+                       status = "disabled";
+               };
        };
 };
index 1efef62182d1c38d05ba5ba1907c55313769583c..5bf3af246e14c29f313899df7d75c02dc7799010 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Device Tree Source for the r8a77995 SoC
+ * Device Tree Source for the R-Car D3 (R8A77995) SoC
  *
  * Copyright (C) 2016 Renesas Electronics Corp.
  * Copyright (C) 2017 Glider bvba
@@ -27,7 +27,7 @@
                #size-cells = <0>;
 
                a53_0: cpu@0 {
-                       compatible = "arm,cortex-a53", "arm,armv8";
+                       compatible = "arm,cortex-a53";
                        reg = <0x0>;
                        device_type = "cpu";
                        power-domains = <&sysc R8A77995_PD_CA53_CPU0>;
@@ -66,7 +66,7 @@
                clock-frequency = <0>;
        };
 
-       soc: soc {
+       soc {
                compatible = "simple-bus";
                interrupt-parent = <&gic>;
                #address-cells = <2>;
                        status = "disabled";
                };
 
+               hsusb: usb@e6590000 {
+                       compatible = "renesas,usbhs-r8a77995",
+                                    "renesas,rcar-gen3-usbhs";
+                       reg = <0 0xe6590000 0 0x200>;
+                       interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&cpg CPG_MOD 704>, <&cpg CPG_MOD 703>;
+                       dmas = <&usb_dmac0 0>, <&usb_dmac0 1>,
+                              <&usb_dmac1 0>, <&usb_dmac1 1>;
+                       dma-names = "ch0", "ch1", "ch2", "ch3";
+                       renesas,buswait = <11>;
+                       phys = <&usb2_phy0>;
+                       phy-names = "usb";
+                       power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+                       resets = <&cpg 704>, <&cpg 703>;
+                       status = "disabled";
+               };
+
+               usb_dmac0: dma-controller@e65a0000 {
+                       compatible = "renesas,r8a77995-usb-dmac",
+                                    "renesas,usb-dmac";
+                       reg = <0 0xe65a0000 0 0x100>;
+                       interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "ch0", "ch1";
+                       clocks = <&cpg CPG_MOD 330>;
+                       power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+                       resets = <&cpg 330>;
+                       #dma-cells = <1>;
+                       dma-channels = <2>;
+               };
+
+               usb_dmac1: dma-controller@e65b0000 {
+                       compatible = "renesas,r8a77995-usb-dmac",
+                                    "renesas,usb-dmac";
+                       reg = <0 0xe65b0000 0 0x100>;
+                       interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH
+                                     GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "ch0", "ch1";
+                       clocks = <&cpg CPG_MOD 331>;
+                       power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+                       resets = <&cpg 331>;
+                       #dma-cells = <1>;
+                       dma-channels = <2>;
+               };
+
                canfd: can@e66c0000 {
                        compatible = "renesas,r8a77995-canfd",
                                     "renesas,rcar-gen3-canfd";
                        resets = <&cpg 219>;
                        #dma-cells = <1>;
                        dma-channels = <8>;
+                       iommus = <&ipmmu_ds0 0>, <&ipmmu_ds0 1>,
+                              <&ipmmu_ds0 2>, <&ipmmu_ds0 3>,
+                              <&ipmmu_ds0 4>, <&ipmmu_ds0 5>,
+                              <&ipmmu_ds0 6>, <&ipmmu_ds0 7>;
                };
 
                dmac1: dma-controller@e7300000 {
                        resets = <&cpg 218>;
                        #dma-cells = <1>;
                        dma-channels = <8>;
+                       iommus = <&ipmmu_ds1 0>, <&ipmmu_ds1 1>,
+                              <&ipmmu_ds1 2>, <&ipmmu_ds1 3>,
+                              <&ipmmu_ds1 4>, <&ipmmu_ds1 5>,
+                              <&ipmmu_ds1 6>, <&ipmmu_ds1 7>;
                };
 
                dmac2: dma-controller@e7310000 {
                        resets = <&cpg 217>;
                        #dma-cells = <1>;
                        dma-channels = <8>;
+                       iommus = <&ipmmu_ds1 16>, <&ipmmu_ds1 17>,
+                              <&ipmmu_ds1 18>, <&ipmmu_ds1 19>,
+                              <&ipmmu_ds1 20>, <&ipmmu_ds1 21>,
+                              <&ipmmu_ds1 22>, <&ipmmu_ds1 23>;
                };
 
                ipmmu_ds0: mmu@e6740000 {
                        compatible = "generic-ohci";
                        reg = <0 0xee080000 0 0x100>;
                        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 703>;
+                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
                        phys = <&usb2_phy0>;
                        phy-names = "usb";
                        power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
-                       resets = <&cpg 703>;
+                       resets = <&cpg 703>, <&cpg 704>;
                        status = "disabled";
                };
 
                        compatible = "generic-ehci";
                        reg = <0 0xee080100 0 0x100>;
                        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 703>;
+                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
                        phys = <&usb2_phy0>;
                        phy-names = "usb";
                        companion = <&ohci0>;
                        power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
-                       resets = <&cpg 703>;
+                       resets = <&cpg 703>, <&cpg 704>;
                        status = "disabled";
                };
 
                                     "renesas,rcar-gen3-usb2-phy";
                        reg = <0 0xee080200 0 0x700>;
                        interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&cpg CPG_MOD 703>;
+                       clocks = <&cpg CPG_MOD 703>, <&cpg CPG_MOD 704>;
                        power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
-                       resets = <&cpg 703>;
+                       resets = <&cpg 703>, <&cpg 704>;
                        #phy-cells = <0>;
                        status = "disabled";
                };
                                port@1 {
                                        reg = <1>;
                                        du_out_lvds0: endpoint {
+                                               remote-endpoint = <&lvds0_in>;
                                        };
                                };
 
                                port@2 {
                                        reg = <2>;
                                        du_out_lvds1: endpoint {
+                                               remote-endpoint = <&lvds1_in>;
+                                       };
+                               };
+                       };
+               };
+
+               lvds0: lvds-encoder@feb90000 {
+                       compatible = "renesas,r8a77995-lvds";
+                       reg = <0 0xfeb90000 0 0x20>;
+                       clocks = <&cpg CPG_MOD 727>;
+                       power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+                       resets = <&cpg 727>;
+                       status = "disabled";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@0 {
+                                       reg = <0>;
+                                       lvds0_in: endpoint {
+                                               remote-endpoint = <&du_out_lvds0>;
+                                       };
+                               };
+
+                               port@1 {
+                                       reg = <1>;
+                                       lvds0_out: endpoint {
+                                       };
+                               };
+                       };
+               };
+
+               lvds1: lvds-encoder@feb90100 {
+                       compatible = "renesas,r8a77995-lvds";
+                       reg = <0 0xfeb90100 0 0x20>;
+                       clocks = <&cpg CPG_MOD 727>;
+                       power-domains = <&sysc R8A77995_PD_ALWAYS_ON>;
+                       resets = <&cpg 726>;
+                       status = "disabled";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@0 {
+                                       reg = <0>;
+                                       lvds1_in: endpoint {
+                                               remote-endpoint = <&du_out_lvds1>;
+                                       };
+                               };
+
+                               port@1 {
+                                       reg = <1>;
+                                       lvds1_out: endpoint {
                                        };
                                };
                        };
index 7d3d866a006352ac196b52002c9c9ce8899f5208..a225c2457274763fd558ad3aa72153c228afa51a 100644 (file)
 
        video-receiver@70 {
                compatible = "adi,adv7482";
-               reg = <0x70>;
+               reg = <0x70 0x71 0x72 0x73 0x74 0x75
+                      0x60 0x61 0x62 0x63 0x64 0x65>;
+               reg-names = "main", "dpll", "cp", "hdmi", "edid", "repeater",
+                           "infoframe", "cbus", "cec", "sdp", "txa", "txb" ;
 
                #address-cells = <1>;
                #size-cells = <0>;
 &i2c_dvfs {
        status = "okay";
 
+       clock-frequency = <400000>;
+
        pmic: pmic@30 {
                pinctrl-0 = <&irq0_pins>;
                pinctrl-names = "default";
        };
 
        sdhi2_pins: sd2 {
-               groups = "sdhi2_data8", "sdhi2_ctrl", "sdhi2_ds";
-               function = "sdhi2";
-               power-source = <3300>;
-       };
-
-       sdhi2_pins_uhs: sd2_uhs {
                groups = "sdhi2_data8", "sdhi2_ctrl", "sdhi2_ds";
                function = "sdhi2";
                power-source = <1800>;
                 <&cpg CPG_CORE CPG_AUDIO_CLK_I>;
 
        ports {
+               #address-cells = <1>;
+               #size-cells = <0>;
                rsnd_port0: port@0 {
+                       reg = <0>;
                        rsnd_endpoint0: endpoint {
                                remote-endpoint = <&ak4613_endpoint>;
 
        wp-gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>;
        bus-width = <4>;
        sd-uhs-sdr50;
+       sd-uhs-sdr104;
        status = "okay";
 };
 
 &sdhi2 {
        /* used for on-board 8bit eMMC */
        pinctrl-0 = <&sdhi2_pins>;
-       pinctrl-1 = <&sdhi2_pins_uhs>;
+       pinctrl-1 = <&sdhi2_pins>;
        pinctrl-names = "default", "state_uhs";
 
        vmmc-supply = <&reg_3p3v>;
        vqmmc-supply = <&reg_1p8v>;
        bus-width = <8>;
        mmc-hs200-1_8v;
+       mmc-hs400-1_8v;
        non-removable;
        fixed-emmc-driver-type = <1>;
        status = "okay";
        wp-gpios = <&gpio4 16 GPIO_ACTIVE_HIGH>;
        bus-width = <4>;
        sd-uhs-sdr50;
+       sd-uhs-sdr104;
        status = "okay";
 };
 
        phys = <&usb3_phy0>;
        phy-names = "usb";
 
+       companion = <&xhci0>;
+
        status = "okay";
 };
 
index 0ead552d7eae9678cda710c897b84b3f45964c13..e70e1bac2be408d2df1434adf609e65a29807816 100644 (file)
@@ -6,6 +6,14 @@
  * Copyright (C) 2016 Cogent Embedded, Inc.
  */
 
+/*
+ * SSI-AK4613
+ *     aplay   -D plughw:0,0 xxx.wav
+ *     arecord -D plughw:0,0 xxx.wav
+ * SSI-HDMI
+ *     aplay   -D plughw:0,1 xxx.wav
+ */
+
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 
@@ -18,6 +26,7 @@
        };
 
        chosen {
+               bootargs = "ignore_loglevel rw root=/dev/nfs ip=dhcp";
                stdout-path = "serial0:115200n8";
        };
 
                regulator-always-on;
        };
 
-       rsnd_ak4613: sound {
-               compatible = "simple-audio-card";
-
-               simple-audio-card,format = "left_j";
-               simple-audio-card,bitclock-master = <&sndcpu>;
-               simple-audio-card,frame-master = <&sndcpu>;
+       sound_card: sound {
+               compatible = "audio-graph-card";
+               label = "rcar-sound";
 
-               sndcpu: simple-audio-card,cpu {
-                       sound-dai = <&rcar_sound>;
-               };
-
-               sndcodec: simple-audio-card,codec {
-                       sound-dai = <&ak4613>;
-               };
+               dais = <&rsnd_port0     /* ak4613 */
+                       &rsnd_port1     /* HDMI0  */
+                       >;
        };
 
        vcc_sdhi0: regulator-vcc-sdhi0 {
                                remote-endpoint = <&hdmi0_con>;
                        };
                };
+               port@2 {
+                       reg = <2>;
+                       dw_hdmi0_snd_in: endpoint {
+                               remote-endpoint = <&rsnd_for_hdmi>;
+                       };
+               };
        };
 };
 
                asahi-kasei,out4-single-end;
                asahi-kasei,out5-single-end;
                asahi-kasei,out6-single-end;
+
+               port {
+                       ak4613_endpoint: endpoint {
+                               remote-endpoint = <&rsnd_for_ak4613>;
+                       };
+               };
        };
 
        cs2000: clk-multiplier@4f {
 &i2c_dvfs {
        status = "okay";
 
+       clock-frequency = <400000>;
+
        pmic: pmic@30 {
                pinctrl-0 = <&irq0_pins>;
                pinctrl-names = "default";
        };
 
        sdhi2_pins: sd2 {
-               groups = "sdhi2_data8", "sdhi2_ctrl", "sdhi2_ds";
-               function = "sdhi2";
-               power-source = <3300>;
-       };
-
-       sdhi2_pins_uhs: sd2_uhs {
                groups = "sdhi2_data8", "sdhi2_ctrl", "sdhi2_ds";
                function = "sdhi2";
                power-source = <1800>;
                 <&audio_clk_c>,
                 <&cpg CPG_CORE CPG_AUDIO_CLK_I>;
 
-       rcar_sound,dai {
-               dai0 {
-                       playback = <&ssi0 &src0 &dvc0>;
-                       capture  = <&ssi1 &src1 &dvc1>;
+       ports {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               rsnd_port0: port@0 {
+                       reg = <0>;
+                       rsnd_for_ak4613: endpoint {
+                               remote-endpoint = <&ak4613_endpoint>;
+
+                               dai-format = "left_j";
+                               bitclock-master = <&rsnd_for_ak4613>;
+                               frame-master = <&rsnd_for_ak4613>;
+
+                               playback = <&ssi0 &src0 &dvc0>;
+                               capture  = <&ssi1 &src1 &dvc1>;
+                       };
+               };
+               rsnd_port1: port@1 {
+                       reg = <1>;
+                       rsnd_for_hdmi: endpoint {
+                               remote-endpoint = <&dw_hdmi0_snd_in>;
+
+                               dai-format = "i2s";
+                               bitclock-master = <&rsnd_for_hdmi>;
+                               frame-master = <&rsnd_for_hdmi>;
+
+                               playback = <&ssi2>;
+                       };
                };
        };
 };
        cd-gpios = <&gpio3 12 GPIO_ACTIVE_LOW>;
        bus-width = <4>;
        sd-uhs-sdr50;
+       sd-uhs-sdr104;
        status = "okay";
 };
 
 &sdhi2 {
        /* used for on-board 8bit eMMC */
        pinctrl-0 = <&sdhi2_pins>;
-       pinctrl-1 = <&sdhi2_pins_uhs>;
+       pinctrl-1 = <&sdhi2_pins>;
        pinctrl-names = "default", "state_uhs";
 
        vmmc-supply = <&reg_3p3v>;
        vqmmc-supply = <&reg_1p8v>;
        bus-width = <8>;
        mmc-hs200-1_8v;
+       mmc-hs400-1_8v;
        non-removable;
        status = "okay";
 };
index d8ddecc0bd2f4a9356164196116ee2d53cebe8ff..15a5b641ffa259d3f525520bc2efec1e4e47702a 100644 (file)
 #define MT41K128MJT187E_PHY_FIFO_WE            0x100
 #define MT41K128MJT187E_IOCTRL_VALUE           0x18B
 
+/* Micron MT41K128M16JT-125 IT:K (256 MB) at 400MHz */
+#define MT41K128M16JT125K_EMIF_READ_LATENCY     0x07
+#define MT41K128M16JT125K_EMIF_TIM1             0x0AAAD4DB
+#define MT41K128M16JT125K_EMIF_TIM2             0x2A437FDA
+#define MT41K128M16JT125K_EMIF_TIM3             0x501F83FF
+#define MT41K128M16JT125K_EMIF_SDCFG            0x61A052B2
+#define MT41K128M16JT125K_EMIF_SDREF            0x00000C30
+#define MT41K128M16JT125K_ZQ_CFG                0x50074BE4
+#define MT41K128M16JT125K_RATIO                 0x80
+#define MT41K128M16JT125K_INVERT_CLKOUT         0x0
+#define MT41K128M16JT125K_RD_DQS                0x38
+#define MT41K128M16JT125K_WR_DQS                0x46
+#define MT41K128M16JT125K_PHY_WR_DATA           0x7D
+#define MT41K128M16JT125K_PHY_FIFO_WE           0x9B
+#define MT41K128M16JT125K_IOCTRL_VALUE          0x18B
+
 /* Micron MT41J64M16JT-125 */
 #define MT41J64MJT125_EMIF_SDCFG               0x61C04A32
 
index a6329dc0220973c094cea2ccf4cb7a7c7426bbfd..a089e9439ec72a2781debc51e794f8f1a851ca68 100644 (file)
@@ -147,6 +147,13 @@ config TARGET_AT91SAM9X5EK
        select BOARD_LATE_INIT
        select SUPPORT_SPL
 
+config TARGET_GARDENA_SMART_GATEWAY_AT91SAM
+       bool "GARDENA smart Gateway (AT91SAM)"
+       select AT91SAM9X5
+       select BOARD_EARLY_INIT_F
+       select BOARD_LATE_INIT
+       select SUPPORT_SPL
+
 config TARGET_SAMA5D2_PTC_EK
        bool "SAMA5D2 PTC EK board"
        select BOARD_EARLY_INIT_F
@@ -283,6 +290,7 @@ source "board/bluewater/snapper9260/Kconfig"
 source "board/calao/usb_a9263/Kconfig"
 source "board/egnite/ethernut5/Kconfig"
 source "board/esd/meesc/Kconfig"
+source "board/gardena/smart-gateway-at91sam/Kconfig"
 source "board/l+g/vinco/Kconfig"
 source "board/mini-box/picosam9g45/Kconfig"
 source "board/ronetix/pm9261/Kconfig"
index 0639d7ea1e7f0ca4593a12f164f8517b7a688c19..6b0b28957af593c815e27b7001f798d7a4029c2d 100644 (file)
@@ -24,8 +24,10 @@ obj-y        += timer.o
 endif
 
 ifndef CONFIG_SKIP_LOWLEVEL_INIT
+ifndef CONFIG_SKIP_LOWLEVEL_INIT_ONLY
 obj-y  += lowlevel_init.o
 endif
+endif
 
 ifdef CONFIG_$(SPL_)SYS_THUMB_BUILD
 ifndef CONFIG_HAS_THUMB2
index f18b17dc931c39a5bdba15d0ae8a628de78ab858..3955bea23a1241efbb538f36527cefd85eae783d 100644 (file)
@@ -39,6 +39,8 @@ SECTIONS
                *(.__end)
        } >.sram
 
+       _image_binary_end = .;
+
        .bss :
        {
                . = ALIGN(4);
index 6432f66c825797546187b9cc474104aff49cc893..59a0c449132817e85d930118158e8609c1351973 100644 (file)
@@ -9,7 +9,7 @@
 #include <asm/arch/clk.h>
 #include <asm/arch/sama5d2.h>
 
-int cpu_is_sama5d2(void)
+int _cpu_is_sama5d2(void)
 {
        unsigned int chip_id = get_chip_id();
 
index 64cbc3d1ed4c066746b320063c8e4f13cf1b573a..1d3df2c09de0dcd3345fc3f8faf651a0b094aa81 100644 (file)
@@ -5,12 +5,17 @@
  */
 
 #include <common.h>
+#include <dm.h>
+#include <wdt.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_wdt.h>
 
 #define EN_UPLL_TIMEOUT                500
 
+static struct udevice *watchdog_dev __attribute__((section(".data"))) = NULL;
+
 void at91_periph_clk_enable(int id)
 {
        struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
@@ -118,3 +123,46 @@ void at91_pllicpr_init(u32 icpr)
 
        writel(icpr, &pmc->pllicpr);
 }
+
+/* Called by macro WATCHDOG_RESET */
+void watchdog_reset(void)
+{
+       static ulong next_reset;
+       ulong now;
+
+       if (!watchdog_dev)
+               return;
+
+       now = get_timer(0);
+
+       /* Do not reset the watchdog too often */
+       if (now > next_reset) {
+               next_reset = now + 1000;        /* reset every 1000ms */
+               wdt_reset(watchdog_dev);
+       }
+}
+
+int arch_early_init_r(void)
+{
+       struct at91_wdt_priv *priv;
+
+       /* Init watchdog */
+       if (uclass_get_device_by_seq(UCLASS_WDT, 0, &watchdog_dev)) {
+               debug("Watchdog: Not found by seq!\n");
+               if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev)) {
+                       puts("Watchdog: Not found!\n");
+                       return 0;
+               }
+       }
+
+       priv = dev_get_priv(watchdog_dev);
+       if (!priv) {
+               printf("Watchdog: priv not available!\n");
+               return 0;
+       }
+
+       wdt_start(watchdog_dev, priv->timeout * 1000, 0);
+       printf("Watchdog: Started\n");
+
+       return 0;
+}
index cd2272367b53a0df87e1cffee681270493dd353f..a8fc73b3d1ea94de3bd6e7e21cd3342b811d4fde 100644 (file)
@@ -25,6 +25,12 @@ typedef struct at91_wdt {
        u32     sr;
 } at91_wdt_t;
 
+struct at91_wdt_priv {
+       void __iomem *regs;
+       u32 regval;
+       u32 timeout;
+};
+
 #endif
 
 /* Watchdog Control Register */
@@ -43,4 +49,8 @@ typedef struct at91_wdt {
 #define AT91_WDT_MR_WDDBGHLT           0x10000000
 #define AT91_WDT_MR_WDIDLEHLT          0x20000000
 
+/* Hardware timeout in seconds */
+#define WDT_MAX_TIMEOUT                16
+#define WDT_DEFAULT_TIMEOUT    2
+
 #endif
index 37806cbf345917948ca5e2cb7bc27d126d57ec0b..c7d9bb5ad31454ed54f0bb31363ed0abf5e461f0 100644 (file)
 #define ARCH_EXID_SAMA5D27C_D1G                0x00000033
 #define ARCH_EXID_SAMA5D28C_D1G                0x00000013
 
+/* Checked if defined in ethernet driver macb */
+#define cpu_is_sama5d2 _cpu_is_sama5d2
+
 /* PIT Timer(PIT_PIIR) */
 #define CONFIG_SYS_TIMER_COUNTER       0xf804803c
 
 #ifndef __ASSEMBLY__
 unsigned int get_chip_id(void);
 unsigned int get_extension_chip_id(void);
-int cpu_is_sama5d2(void);
+int _cpu_is_sama5d2(void);
 unsigned int has_lcdc(void);
 char *get_cpu_name(void);
 #endif
index 23ebaa99b169507efd6f14d9fab1ada91fd5dfa2..1065f090e0102d06686409ccf7d477524fa042af 100644 (file)
@@ -75,6 +75,16 @@ void __weak spl_board_init(void)
 
 void board_init_f(ulong dummy)
 {
+#if CONFIG_IS_ENABLED(OF_CONTROL)
+       int ret;
+
+       ret = spl_early_init();
+       if (ret) {
+               debug("spl_early_init() failed: %d\n", ret);
+               hang();
+       }
+#endif
+
        lowlevel_clock_init();
 #if !defined(CONFIG_WDT_AT91)
        at91_disable_wdt();
index a5553190b431e7292452aeed154cc4540e3e2f80..77cd15f388c40cb68b006dd27f9bd2d040ae3f53 100644 (file)
@@ -83,10 +83,8 @@ void board_init_f(ulong dummy)
 
 #ifdef CONFIG_K3_AM654_DDRSS
        ret = uclass_get_device(UCLASS_RAM, 0, &dev);
-       if (ret) {
-               printf("DRAM init failed: %d\n", ret);
-               return;
-       }
+       if (ret)
+               panic("DRAM init failed: %d\n", ret);
 #endif
 }
 
index 5909bbfa8f5ac5dce697c496edec86aa2543a457..03f01d07eacf7c551f234c873a0d8a78a4e3e0ce 100644 (file)
 #include "common.h"
 #include <dm.h>
 #include <remoteproc.h>
+#include <linux/soc/ti/ti_sci_protocol.h>
+#include <fdt_support.h>
+
+struct ti_sci_handle *get_ti_sci_handle(void)
+{
+       struct udevice *dev;
+       int ret;
+
+       ret = uclass_get_device_by_name(UCLASS_FIRMWARE, "dmsc", &dev);
+       if (ret)
+               panic("Failed to get SYSFW (%d)\n", ret);
+
+       return (struct ti_sci_handle *)ti_sci_get_handle_from_sysfw(dev);
+}
 
 #ifdef CONFIG_SYS_K3_SPL_ATF
 void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
@@ -42,3 +56,77 @@ void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
                asm volatile("wfe");
 }
 #endif
+
+#if defined(CONFIG_OF_LIBFDT)
+int fdt_fixup_msmc_ram(void *blob, char *parent_path, char *node_name)
+{
+       u64 msmc_start = 0, msmc_end = 0, msmc_size, reg[2];
+       struct ti_sci_handle *ti_sci = get_ti_sci_handle();
+       int ret, node, subnode, len, prev_node;
+       u32 range[4], addr, size;
+       const fdt32_t *sub_reg;
+
+       ti_sci->ops.core_ops.query_msmc(ti_sci, &msmc_start, &msmc_end);
+       msmc_size = msmc_end - msmc_start + 1;
+       debug("%s: msmc_start = 0x%llx, msmc_size = 0x%llx\n", __func__,
+             msmc_start, msmc_size);
+
+       /* find or create "msmc_sram node */
+       ret = fdt_path_offset(blob, parent_path);
+       if (ret < 0)
+               return ret;
+
+       node = fdt_find_or_add_subnode(blob, ret, node_name);
+       if (node < 0)
+               return node;
+
+       ret = fdt_setprop_string(blob, node, "compatible", "mmio-sram");
+       if (ret < 0)
+               return ret;
+
+       reg[0] = cpu_to_fdt64(msmc_start);
+       reg[1] = cpu_to_fdt64(msmc_size);
+       ret = fdt_setprop(blob, node, "reg", reg, sizeof(reg));
+       if (ret < 0)
+               return ret;
+
+       fdt_setprop_cell(blob, node, "#address-cells", 1);
+       fdt_setprop_cell(blob, node, "#size-cells", 1);
+
+       range[0] = 0;
+       range[1] = cpu_to_fdt32(msmc_start >> 32);
+       range[2] = cpu_to_fdt32(msmc_start & 0xffffffff);
+       range[3] = cpu_to_fdt32(msmc_size);
+       ret = fdt_setprop(blob, node, "ranges", range, sizeof(range));
+       if (ret < 0)
+               return ret;
+
+       subnode = fdt_first_subnode(blob, node);
+       prev_node = 0;
+
+       /* Look for invalid subnodes and delete them */
+       while (subnode >= 0) {
+               sub_reg = fdt_getprop(blob, subnode, "reg", &len);
+               addr = fdt_read_number(sub_reg, 1);
+               sub_reg++;
+               size = fdt_read_number(sub_reg, 1);
+               debug("%s: subnode = %d, addr = 0x%x. size = 0x%x\n", __func__,
+                     subnode, addr, size);
+               if (addr + size > msmc_size ||
+                   !strncmp(fdt_get_name(blob, subnode, &len), "sysfw", 5) ||
+                   !strncmp(fdt_get_name(blob, subnode, &len), "l3cache", 7)) {
+                       fdt_del_node(blob, subnode);
+                       debug("%s: deleting subnode %d\n", __func__, subnode);
+                       if (!prev_node)
+                               subnode = fdt_first_subnode(blob, node);
+                       else
+                               subnode = fdt_next_subnode(blob, prev_node);
+               } else {
+                       prev_node = subnode;
+                       subnode = fdt_next_subnode(blob, prev_node);
+               }
+       }
+
+       return 0;
+}
+#endif
index 0b2007981a498648742bcdf3185f49cda5e72955..018725b4d128fbafd46df8317ac52c5be333201c 100644 (file)
@@ -10,5 +10,6 @@
 void sdelay(unsigned long loops);
 u32 wait_on_value(u32 read_bit_mask, u32 match_value, void *read_addr,
                  u32 bound);
-
+struct ti_sci_handle *get_ti_sci_handle(void);
+int fdt_fixup_msmc_ram(void *blob, char *parent_path, char *node_name);
 #endif
index d24596eccb0dfd7a94ef6622242e005907c5c21a..e06eba5aea1fb25c27528559326f1514855ef607 100644 (file)
@@ -9,18 +9,24 @@ config TARGET_K2HK_EVM
        select SPL_BOARD_INIT if SPL
        select CMD_DDR3
        imply DM_I2C
+       imply SOC_TI
+       imply TI_KEYSTONE_SERDES
 
 config TARGET_K2E_EVM
        bool "TI Keystone 2 Edison EVM"
        select SPL_BOARD_INIT if SPL
        select CMD_DDR3
        imply DM_I2C
+       imply SOC_TI
+       imply TI_KEYSTONE_SERDES
 
 config TARGET_K2L_EVM
        bool "TI Keystone 2 Lamar EVM"
        select SPL_BOARD_INIT if SPL
        select CMD_DDR3
        imply DM_I2C
+       imply SOC_TI
+       imply TI_KEYSTONE_SERDES
 
 config TARGET_K2G_EVM
        bool "TI Keystone 2 Galileo EVM"
@@ -29,6 +35,8 @@ config TARGET_K2G_EVM
         select TI_I2C_BOARD_DETECT
        select CMD_DDR3
        imply DM_I2C
+       imply SOC_TI
+       imply TI_KEYSTONE_SERDES
 
 endchoice
 
index 8b902641ec9ac84cf0add25555451448512cea0f..971c081bb3c3b9303ae05ab3fcacf1162280366f 100644 (file)
 
 #define K2G_GPIO0_BASE                 0X02603000
 #define K2G_GPIO1_BASE                 0X0260a000
+#define K2G_GPIO0_BANK0_BASE           K2G_GPIO0_BASE + 0x10
 #define K2G_GPIO1_BANK2_BASE           K2G_GPIO1_BASE + 0x38
 #define K2G_GPIO_DIR_OFFSET            0x0
+#define K2G_GPIO_OUTDATA_OFFSET                0x4
 #define K2G_GPIO_SETDATA_OFFSET                0x8
+#define K2G_GPIO_CLRDATA_OFFSET                0xC
 
 /* BOOTCFG RESETMUX8 */
 #define KS2_RSTMUX8                    (KS2_DEVICE_STATE_CTRL_BASE + 0x328)
index 809b72d5bf9dd08dc3eab825b0d5e9f03b6f9d15..67d47f8172167ea30423c0bff401793bbb537d43 100644 (file)
 #define PIN_PTU        (1 << 17) /* pull up */
 #define PIN_PTD        (0 << 17) /* pull down */
 
+#define BUFFER_CLASS_B (0 << 19)
+#define BUFFER_CLASS_C (1 << 19)
+#define BUFFER_CLASS_D (2 << 19)
+#define BUFFER_CLASS_E (3 << 19)
+
 #define MODE(m)        ((m) & 0x7)
 #define MAX_PIN_N      260
 
index d54de53f31dc049c785bd3ca7c043aa790f02f56..8f8e3003854c213d7b04c2e974058230f90b605b 100644 (file)
@@ -46,69 +46,31 @@ unsigned int kw_winctrl_calcsize(unsigned int sizeval)
        return (0x0000ffff & j);
 }
 
-/*
- * kw_config_adr_windows - Configure address Windows
- *
- * There are 8 address windows supported by Kirkwood Soc to addess different
- * devices. Each window can be configured for size, BAR and remap addr
- * Below configuration is standard for most of the cases
- *
- * If remap function not used, remap_lo must be set as base
- *
- * Reference Documentation:
- * Mbus-L to Mbus Bridge Registers Configuration.
- * (Sec 25.1 and 25.3 of Datasheet)
- */
-int kw_config_adr_windows(void)
-{
-       struct kwwin_registers *winregs =
-               (struct kwwin_registers *)KW_CPU_WIN_BASE;
-
+static struct mbus_win windows[] = {
        /* Window 0: PCIE MEM address space */
-       writel(KWCPU_WIN_CTRL_DATA(1024 * 1024 * 256, KWCPU_TARGET_PCIE,
-               KWCPU_ATTR_PCIE_MEM, KWCPU_WIN_ENABLE), &winregs[0].ctrl);
-
-       writel(KW_DEFADR_PCI_MEM, &winregs[0].base);
-       writel(KW_DEFADR_PCI_MEM, &winregs[0].remap_lo);
-       writel(0x0, &winregs[0].remap_hi);
+       { KW_DEFADR_PCI_MEM, 1024 * 1024 * 256,
+         KWCPU_TARGET_PCIE, KWCPU_ATTR_PCIE_MEM },
 
        /* Window 1: PCIE IO address space */
-       writel(KWCPU_WIN_CTRL_DATA(1024 * 64, KWCPU_TARGET_PCIE,
-               KWCPU_ATTR_PCIE_IO, KWCPU_WIN_ENABLE), &winregs[1].ctrl);
-       writel(KW_DEFADR_PCI_IO, &winregs[1].base);
-       writel(KW_DEFADR_PCI_IO_REMAP, &winregs[1].remap_lo);
-       writel(0x0, &winregs[1].remap_hi);
+       { KW_DEFADR_PCI_IO, 1024 * 64,
+         KWCPU_TARGET_PCIE, KWCPU_ATTR_PCIE_IO },
 
        /* Window 2: NAND Flash address space */
-       writel(KWCPU_WIN_CTRL_DATA(1024 * 1024 * 128, KWCPU_TARGET_MEMORY,
-               KWCPU_ATTR_NANDFLASH, KWCPU_WIN_ENABLE), &winregs[2].ctrl);
-       writel(KW_DEFADR_NANDF, &winregs[2].base);
-       writel(KW_DEFADR_NANDF, &winregs[2].remap_lo);
-       writel(0x0, &winregs[2].remap_hi);
+       { KW_DEFADR_NANDF, 1024 * 1024 * 128,
+         KWCPU_TARGET_MEMORY, KWCPU_ATTR_NANDFLASH },
 
        /* Window 3: SPI Flash address space */
-       writel(KWCPU_WIN_CTRL_DATA(1024 * 1024 * 128, KWCPU_TARGET_MEMORY,
-               KWCPU_ATTR_SPIFLASH, KWCPU_WIN_ENABLE), &winregs[3].ctrl);
-       writel(KW_DEFADR_SPIF, &winregs[3].base);
-       writel(KW_DEFADR_SPIF, &winregs[3].remap_lo);
-       writel(0x0, &winregs[3].remap_hi);
+       { KW_DEFADR_SPIF, 1024 * 1024 * 128,
+         KWCPU_TARGET_MEMORY, KWCPU_ATTR_SPIFLASH },
 
        /* Window 4: BOOT Memory address space */
-       writel(KWCPU_WIN_CTRL_DATA(1024 * 1024 * 128, KWCPU_TARGET_MEMORY,
-               KWCPU_ATTR_BOOTROM, KWCPU_WIN_ENABLE), &winregs[4].ctrl);
-       writel(KW_DEFADR_BOOTROM, &winregs[4].base);
+       { KW_DEFADR_BOOTROM, 1024 * 1024 * 128,
+         KWCPU_TARGET_MEMORY, KWCPU_ATTR_BOOTROM },
 
        /* Window 5: Security SRAM address space */
-       writel(KWCPU_WIN_CTRL_DATA(1024 * 64, KWCPU_TARGET_SASRAM,
-               KWCPU_ATTR_SASRAM, KWCPU_WIN_ENABLE), &winregs[5].ctrl);
-       writel(KW_DEFADR_SASRAM, &winregs[5].base);
-
-       /* Window 6-7: Disabled */
-       writel(KWCPU_WIN_DISABLE, &winregs[6].ctrl);
-       writel(KWCPU_WIN_DISABLE, &winregs[7].ctrl);
-
-       return 0;
-}
+       { KW_DEFADR_SASRAM, 1024 * 64,
+         KWCPU_TARGET_SASRAM, KWCPU_ATTR_SASRAM },
+};
 
 /*
  * SYSRSTn Duration Counter Support
@@ -221,15 +183,13 @@ int arch_cpu_init(void)
        struct kwcpu_registers *cpureg =
                (struct kwcpu_registers *)KW_CPU_REG_BASE;
 
-       /* Linux expects` the internal registers to be at 0xf1000000 */
+       /* Linux expects the internal registers to be at 0xf1000000 */
        writel(KW_REGS_PHY_BASE, KW_OFFSET_REG);
 
        /* Enable and invalidate L2 cache in write through mode */
        writel(readl(&cpureg->l2_cfg) | 0x18, &cpureg->l2_cfg);
        invalidate_l2_cache();
 
-       kw_config_adr_windows();
-
 #ifdef CONFIG_KIRKWOOD_RGMII_PAD_1V8
        /*
         * Configures the I/O voltage of the pads connected to Egigabit
@@ -291,11 +251,13 @@ int arch_misc_init(void)
        temp |= (1 << 22);
        writefr_extra_feature_reg(temp);
 
-       icache_enable();
        /* Change reset vector to address 0x0 */
        temp = get_cr();
        set_cr(temp & ~CR_V);
 
+       /* Configure mbus windows */
+       mvebu_mbus_probe(windows, ARRAY_SIZE(windows));
+
        /* checks and execute resset to factory event */
        kw_sysrst_check();
 
index 91d21518d852fd816fc344dc796dbc9c8c10339c..ea42182cf9c609332bc5d88c5c829f28468a9f07 100644 (file)
@@ -63,12 +63,18 @@ enum kwcpu_attrib {
  */
 #define KW_DEFADR_PCI_MEM      0x90000000
 #define KW_DEFADR_PCI_IO       0xC0000000
-#define KW_DEFADR_PCI_IO_REMAP 0xC0000000
 #define KW_DEFADR_SASRAM       0xC8010000
 #define KW_DEFADR_NANDF                0xD8000000
 #define KW_DEFADR_SPIF         0xE8000000
 #define KW_DEFADR_BOOTROM      0xF8000000
 
+struct mbus_win {
+       u32 base;
+       u32 size;
+       u8 target;
+       u8 attr;
+};
+
 /*
  * read feroceon/sheeva core extra feature register
  * using co-proc instruction
@@ -135,13 +141,16 @@ struct kwgpio_registers {
        u32 irq_level;
 };
 
+/* Needed for dynamic (board-specific) mbus configuration */
+extern struct mvebu_mbus_state mbus_state;
+
 /*
  * functions
  */
 unsigned int mvebu_sdram_bar(enum memory_bank bank);
 unsigned int mvebu_sdram_bs(enum memory_bank bank);
 void mvebu_sdram_size_adjust(enum memory_bank bank);
-int kw_config_adr_windows(void);
+int mvebu_mbus_probe(struct mbus_win windows[], int count);
 void mvebu_config_gpio(unsigned int gpp0_oe_val, unsigned int gpp1_oe_val,
                unsigned int gpp0_oe, unsigned int gpp1_oe);
 int kw_config_mpp(unsigned int mpp0_7, unsigned int mpp8_15,
index 227707ae4c95c7afd47313766f268298951c5a79..1d7f2828cd38288d2937ea81756faad65c7406ef 100644 (file)
@@ -31,7 +31,7 @@
 #define KW_RTC_BASE                    (KW_REGISTER(0x10300))
 #define KW_NANDF_BASE                  (KW_REGISTER(0x10418))
 #define MVEBU_SPI_BASE                 (KW_REGISTER(0x10600))
-#define KW_CPU_WIN_BASE                        (KW_REGISTER(0x20000))
+#define MVEBU_CPU_WIN_BASE                     (KW_REGISTER(0x20000))
 #define KW_CPU_REG_BASE                        (KW_REGISTER(0x20100))
 #define MVEBU_TIMER_BASE                       (KW_REGISTER(0x20300))
 #define KW_REG_PCIE_BASE               (KW_REGISTER(0x40000))
index 7dda04e0e34e11f24c2218e76a9ecc12647f8c66..f5fd60d784560336ddd4170e10ffaff83f0c8f8c 100644 (file)
@@ -9,10 +9,10 @@ config ARMADA_32BIT
        select ARCH_MISC_INIT
        select BOARD_EARLY_INIT_F
        select CPU_V7A
-       select SPL_DM
-       select SPL_DM_SEQ_ALIAS
-       select SPL_OF_CONTROL
-       select SPL_SIMPLE_BUS
+       select SPL_DM if SPL
+       select SPL_DM_SEQ_ALIAS if SPL
+       select SPL_OF_CONTROL if SPL
+       select SPL_SIMPLE_BUS if SPL
        select SUPPORT_SPL
 
 config ARMADA_64BIT
@@ -46,7 +46,7 @@ config ARMADA_8K
 # Armada PLL frequency (used for NAND clock generation)
 config SYS_MVEBU_PLL_CLOCK
        int
-       default "2000000000" if ARMADA_XP || ARMADA_3700 || ARMADA_8K
+       default "2000000000" if ARMADA_XP || ARMADA_3700 || ARMADA_8K || ARMADA_MSYS
        default "1000000000" if ARMADA_38X || ARMADA_375
 
 # Armada XP/38x SoC types...
@@ -63,6 +63,22 @@ config MV78460
        bool
        select ARMADA_XP
 
+config ARMADA_MSYS
+       bool
+       select ARMADA_32BIT
+
+config 98DX4251
+       bool
+       select ARMADA_MSYS
+
+config 98DX3336
+       bool
+       select ARMADA_MSYS
+
+config 98DX3236
+       bool
+       select ARMADA_MSYS
+
 config 88F6820
        bool
        select ARMADA_38X
@@ -136,6 +152,10 @@ config TARGET_X530
        bool "Support Allied Telesis x530"
        select 88F6820
 
+config TARGET_DB_XC3_24G4XG
+       bool "Support DB-XC3-24G4XG"
+       select 98DX3336
+
 endchoice
 
 config SYS_BOARD
@@ -154,6 +174,7 @@ config SYS_BOARD
        default "theadorable" if TARGET_THEADORABLE
        default "a38x" if TARGET_CONTROLCENTERDC
        default "x530" if TARGET_X530
+       default "db-xc3-24g4xg" if TARGET_DB_XC3_24G4XG
 
 config SYS_CONFIG_NAME
        default "clearfog" if TARGET_CLEARFOG
@@ -171,6 +192,7 @@ config SYS_CONFIG_NAME
        default "turris_mox" if TARGET_TURRIS_MOX
        default "controlcenterdc" if TARGET_CONTROLCENTERDC
        default "x530" if TARGET_X530
+       default "db-xc3-24g4xg" if TARGET_DB_XC3_24G4XG
 
 config SYS_VENDOR
        default "Marvell" if TARGET_DB_MV784MP_GP
@@ -179,6 +201,8 @@ config SYS_VENDOR
        default "Marvell" if TARGET_DB_88F6820_GP
        default "Marvell" if TARGET_DB_88F6820_AMC
        default "Marvell" if TARGET_MVEBU_ARMADA_8K
+       default "Marvell" if TARGET_DB_XC3_24G4XG
+       default "Marvell" if TARGET_MVEBU_DB_88F7040
        default "solidrun" if TARGET_CLEARFOG
        default "kobol" if TARGET_HELIOS4
        default "Synology" if TARGET_DS414
index ee2eca91348483fbd0f81ee990ae211ddb8ffd4c..02d3ce27ee74189ac0d156f39b56a98a0764d24f 100644 (file)
@@ -14,6 +14,7 @@ ifdef CONFIG_KIRKWOOD
 
 obj-y  = dram.o
 obj-y  += gpio.o
+obj-y  += mbus.o
 obj-y  += timer.o
 
 else # CONFIG_KIRKWOOD
@@ -24,6 +25,7 @@ ifndef CONFIG_SPL_BUILD
 obj-$(CONFIG_ARMADA_375) += ../../../drivers/ddr/marvell/axp/xor.o
 obj-$(CONFIG_ARMADA_38X) += ../../../drivers/ddr/marvell/a38x/xor.o
 obj-$(CONFIG_ARMADA_XP) += ../../../drivers/ddr/marvell/axp/xor.o
+obj-$(CONFIG_ARMADA_MSYS) += ../../../drivers/ddr/marvell/axp/xor.o
 obj-$(CONFIG_MVEBU_EFUSE) += efuse.o
 
 extra-y += kwbimage.cfg
index 919d05c88c7724113c512e53ae5f97a427dba1c0..c5b3df46aab765076a19fa6b43e67366f7e92156 100644 (file)
@@ -23,6 +23,11 @@ static struct mbus_win windows[] = {
        /* NOR */
        { MBUS_BOOTROM_BASE, MBUS_BOOTROM_SIZE,
          CPU_TARGET_DEVICEBUS_BOOTROM_SPI, CPU_ATTR_BOOTROM },
+
+#ifdef CONFIG_ARMADA_MSYS
+       /* DFX */
+       { MBUS_DFX_BASE, MBUS_DFX_SIZE, CPU_TARGET_DFX, 0 },
+#endif
 };
 
 void lowlevel_init(void)
@@ -121,6 +126,14 @@ static const struct sar_freq_modes sar_freq_tab[] = {
        { 0x13,  0x0, 2000, 1000, 933 },
        { 0xff, 0xff,    0,    0,   0 } /* 0xff marks end of array */
 };
+#elif defined(CONFIG_ARMADA_MSYS)
+static const struct sar_freq_modes sar_freq_tab[] = {
+       {  0x0, 0x0,  400,  400, 400 },
+       {  0x2, 0x0,  667,  333, 667 },
+       {  0x3, 0x0,  800,  400, 800 },
+       {  0x5, 0x0,  800,  400, 800 },
+       { 0xff, 0xff,    0,   0,   0 }  /* 0xff marks end of array */
+};
 #else
 /* SAR frequency values for Armada XP */
 static const struct sar_freq_modes sar_freq_tab[] = {
@@ -144,7 +157,7 @@ void get_sar_freq(struct sar_freq_modes *sar_freq)
        u32 freq;
        int i;
 
-#if defined(CONFIG_ARMADA_375)
+#if defined(CONFIG_ARMADA_375) || defined(CONFIG_ARMADA_MSYS)
        val = readl(CONFIG_SAR2_REG);   /* SAR - Sample At Reset */
 #else
        val = readl(CONFIG_SAR_REG);    /* SAR - Sample At Reset */
@@ -160,7 +173,7 @@ void get_sar_freq(struct sar_freq_modes *sar_freq)
 #endif
        for (i = 0; sar_freq_tab[i].val != 0xff; i++) {
                if (sar_freq_tab[i].val == freq) {
-#if defined(CONFIG_ARMADA_375) || defined(CONFIG_ARMADA_38X)
+#if defined(CONFIG_ARMADA_375) || defined(CONFIG_ARMADA_38X) || defined(CONFIG_ARMADA_MSYS)
                        *sar_freq = sar_freq_tab[i];
                        return;
 #else
@@ -270,6 +283,20 @@ int print_cpuinfo(void)
                }
        }
 
+       if (mvebu_soc_family() == MVEBU_SOC_MSYS) {
+               switch (revid) {
+               case 3:
+                       puts("A0");
+                       break;
+               case 4:
+                       puts("A1");
+                       break;
+               default:
+                       printf("?? (%x)", revid);
+                       break;
+               }
+       }
+
        get_sar_freq(&sar_freq);
        printf(" at %d MHz\n", sar_freq.p_clk);
 
@@ -472,6 +499,8 @@ u32 mvebu_get_nand_clock(void)
 
        if (mvebu_soc_family() == MVEBU_SOC_A38X)
                reg = MVEBU_DFX_DIV_CLK_CTRL(1);
+       else if (mvebu_soc_family() == MVEBU_SOC_MSYS)
+               reg = MVEBU_DFX_DIV_CLK_CTRL(8);
        else
                reg = MVEBU_CORE_DIV_CLK_CTRL(1);
 
@@ -501,7 +530,6 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
-#ifdef CONFIG_SCSI_AHCI_PLAT
 #define AHCI_VENDOR_SPECIFIC_0_ADDR    0xa0
 #define AHCI_VENDOR_SPECIFIC_0_DATA    0xa4
 
@@ -545,11 +573,19 @@ static void ahci_mvebu_regret_option(void __iomem *base)
        writel(0x80, base + AHCI_VENDOR_SPECIFIC_0_DATA);
 }
 
-void scsi_init(void)
+int board_ahci_enable(void)
 {
-       printf("MVEBU SATA INIT\n");
        ahci_mvebu_mbus_config((void __iomem *)MVEBU_SATA0_BASE);
        ahci_mvebu_regret_option((void __iomem *)MVEBU_SATA0_BASE);
+
+       return 0;
+}
+
+#ifdef CONFIG_SCSI_AHCI_PLAT
+void scsi_init(void)
+{
+       printf("MVEBU SATA INIT\n");
+       board_ahci_enable();
        ahci_init((void __iomem *)MVEBU_SATA0_BASE);
 }
 #endif
index 71c4f70efc9e56b0cde72e5b636f735ed9cee539..bbcfcfd1419b01464ce688001d57ed04a715410f 100644 (file)
@@ -17,7 +17,7 @@
 #include <asm/arch/soc.h>
 
 #if defined(CONFIG_ARMADA_XP) || defined(CONFIG_ARMADA_375) \
-       || defined(CONFIG_ARMADA_38X)
+       || defined(CONFIG_ARMADA_38X) || defined(CONFIG_ARMADA_MSYS)
 /*
  * Set this for the common xor register definitions needed in dram.c
  * for A38x as well here.
index 9e23043a4857bc9ba91ffd00f6e12e3e29ffb069..b9153d86c669378242dc791eeb10c0c00cd4a644 100644 (file)
@@ -34,6 +34,7 @@ enum cpu_target {
        CPU_TARGET_PCIE02 = 0x4,
        CPU_TARGET_ETH01 = 0x7,
        CPU_TARGET_PCIE13 = 0x8,
+       CPU_TARGET_DFX = 0x8,
        CPU_TARGET_SASRAM = 0x9,
        CPU_TARGET_SATA01 = 0xa, /* A38X */
        CPU_TARGET_NAND = 0xd,
@@ -79,6 +80,8 @@ enum {
 #define MBUS_PCI_IO_SIZE       (64 << 10)
 #define MBUS_SPI_BASE          0xF4000000
 #define MBUS_SPI_SIZE          (8 << 20)
+#define MBUS_DFX_BASE          0xF6000000
+#define MBUS_DFX_SIZE          (1 << 20)
 #define MBUS_BOOTROM_BASE      0xF8000000
 #define MBUS_BOOTROM_SIZE      (8 << 20)
 
index 01577f469b0e6bbc44a486ce59fa4639e612a816..f666ee24243b4cd06ced9b5291c2488d1e43fb03 100644 (file)
 #define MVEBU_NAND_BASE                (MVEBU_REGISTER(0xd0000))
 #define MVEBU_SDIO_BASE                (MVEBU_REGISTER(0xd8000))
 #define MVEBU_LCD_BASE         (MVEBU_REGISTER(0xe0000))
+#ifdef CONFIG_ARMADA_MSYS
+#define MVEBU_DFX_BASE         (MBUS_DFX_BASE)
+#else
 #define MVEBU_DFX_BASE         (MVEBU_REGISTER(0xe4000))
+#endif
 
 #define SOC_COHERENCY_FABRIC_CTRL_REG  (MVEBU_REGISTER(0x20200))
 #define MBUS_ERR_PROP_EN       (1 << 8)
 #define SPI_PUP_EN             BIT(5)
 
 #define MVEBU_CORE_DIV_CLK_CTRL(i)     (MVEBU_CLOCK_BASE + ((i) * 0x8))
+#ifdef CONFIG_ARMADA_MSYS
+#define MVEBU_DFX_DIV_CLK_CTRL(i)      (MVEBU_DFX_BASE + 0xf8000 + 0x250 + ((i) * 0x4))
+#define NAND_ECC_DIVCKL_RATIO_OFFS     6
+#define NAND_ECC_DIVCKL_RATIO_MASK     (0xF << NAND_ECC_DIVCKL_RATIO_OFFS)
+#else
 #define MVEBU_DFX_DIV_CLK_CTRL(i)      (MVEBU_DFX_BASE + 0x250 + ((i) * 0x4))
+#endif
+#ifdef CONFIG_ARMADA_MSYS
+#define NAND_ECC_DIVCKL_RATIO_OFFS     6
+#define NAND_ECC_DIVCKL_RATIO_MASK     (0xF << NAND_ECC_DIVCKL_RATIO_OFFS)
+#else
 #define NAND_ECC_DIVCKL_RATIO_OFFS     8
 #define NAND_ECC_DIVCKL_RATIO_MASK     (0x3F << NAND_ECC_DIVCKL_RATIO_OFFS)
+#endif
 
 #define SDRAM_MAX_CS           4
 #define SDRAM_ADDR_MASK                0xFF000000
 #define BOOT_FROM_SPI          0x32
 #define BOOT_FROM_MMC          0x30
 #define BOOT_FROM_MMC_ALT      0x31
+#elif defined(CONFIG_ARMADA_MSYS)
+/* SAR values for MSYS */
+#define CONFIG_SAR_REG         (MBUS_DFX_BASE  + 0xf8200)
+#define CONFIG_SAR2_REG                (MBUS_DFX_BASE  + 0xf8204)
+
+#define SAR_CPU_FREQ_OFFS      18
+#define SAR_CPU_FREQ_MASK      (0x7 << SAR_CPU_FREQ_OFFS)
+#define SAR_BOOT_DEVICE_OFFS   11
+#define SAR_BOOT_DEVICE_MASK   (0x7 << SAR_BOOT_DEVICE_OFFS)
+
+#define BOOT_DEV_SEL_OFFS      11
+#define BOOT_DEV_SEL_MASK      (0x7 << BOOT_DEV_SEL_OFFS)
+
+#define BOOT_FROM_NAND         0x1
+#define BOOT_FROM_UART         0x2
+#define BOOT_FROM_SPI          0x3
 #else
 /* SAR values for Armada XP */
 #define CONFIG_SAR_REG         (MVEBU_REGISTER(0x18230))
index df4c5cb2d71825dfd128a83090e6dd4e72de3644..c68e93ba10070e17ac2c4e2acea754abbf8f91a6 100644 (file)
@@ -344,6 +344,11 @@ static void mvebu_mbus_default_setup_cpu_target(struct mvebu_mbus_state *mbus)
                }
        }
        mbus_dram_info.num_cs = cs;
+
+#if defined(CONFIG_ARMADA_MSYS)
+       /* Disable MBUS Err Prop - in order to avoid data aborts */
+       clrbits_le32(mbus->mbuswins_base + 0x200, BIT(8));
+#endif
 }
 
 static const struct mvebu_mbus_soc_data
@@ -405,6 +410,7 @@ int mvebu_mbus_del_window(phys_addr_t base, size_t size)
        return 0;
 }
 
+#ifndef CONFIG_KIRKWOOD
 static void mvebu_mbus_get_lowest_base(struct mvebu_mbus_state *mbus,
                                       phys_addr_t *base)
 {
@@ -451,6 +457,7 @@ static void mvebu_config_mbus_bridge(struct mvebu_mbus_state *mbus)
        val = (size / (64 << 10)) - 1;
        writel((val << 16) | 0x1, MBUS_BRIDGE_WIN_CTRL_REG);
 }
+#endif
 
 int mbus_dt_setup_win(struct mvebu_mbus_state *mbus,
                      u32 base, u32 size, u8 target, u8 attr)
@@ -471,12 +478,14 @@ int mbus_dt_setup_win(struct mvebu_mbus_state *mbus,
                        return -ENOMEM;
        }
 
+#ifndef CONFIG_KIRKWOOD
        /*
         * Re-configure the mbus bridge registers each time this function
         * is called. Since it may get called from the board code in
         * later boot stages as well.
         */
        mvebu_config_mbus_bridge(mbus);
+#endif
 
        return 0;
 }
index 569840ff47186da2b38c2ce7f83c50479f7e4c1b..c8c92988645f27e4f6c02f8f3cd9c72408b28983 100644 (file)
@@ -35,7 +35,7 @@ int pex_local_dev_num_set(u32 pex_if, u32 dev_num);
 #define        ETM_MODULE_DETECT               2
 
 #define PEX_MODE_GET(satr)             ((satr & 0x6) >> 1)
-#define PEX_CAPABILITY_GET(satr)       (satr & 1)
+#define PEX_CAPABILITY_GET(satr, port) ((satr >> port) & 1)
 #define MV_PEX_UNIT_TO_IF(pex_unit)    ((pex_unit < 3) ? (pex_unit * 4) : 9)
 
 /* Static parametes */
@@ -176,7 +176,7 @@ u8 board_cpu_freq_get(void)
        return ((sar_msb & 0x100000) >> 17) | ((sar & 0xe00000) >> 21);
 }
 
-__weak MV_BIN_SERDES_CFG *board_serdes_cfg_get(u8 pex_mode)
+__weak MV_BIN_SERDES_CFG *board_serdes_cfg_get(void)
 {
        u32 board_id;
        u32 serdes_cfg_val = 0; /* default */
@@ -352,7 +352,7 @@ int serdes_phy_config(void)
                DEBUG_WR_REG(CPU_AVS_CONTROL2_REG, cpu_avs);
        }
 
-       info = board_serdes_cfg_get(PEX_MODE_GET(satr11));
+       info = board_serdes_cfg_get();
 
        if (info == NULL) {
                DEBUG_INIT_S("Hight speed PHY Error #1\n");
@@ -675,7 +675,7 @@ int serdes_phy_config(void)
                                tmp |= (0x1 << 4);
                        if (info->pex_mode[pex_unit] == PEX_BUS_MODE_X4)
                                tmp |= (0x4 << 4);
-                       if (0 == PEX_CAPABILITY_GET(satr11))
+                       if (0 == PEX_CAPABILITY_GET(satr11, pex_unit))
                                tmp |= 0x1;
                        else
                                tmp |= 0x2;
index 1cac4437d72c9d6c3d13ae988622495ebfa2ccc3..d29f1ca0b58b250f817681f53a7bd57d60a51a67 100644 (file)
@@ -167,21 +167,6 @@ config TI_SECURE_EMIF_PROTECTED_REGION_SIZE
          using hardware memory firewalls. This value must be smaller than the
          TI_SECURE_EMIF_TOTAL_REGION_SIZE value.
 
-if AM43XX || AM33XX || OMAP54XX
-config ISW_ENTRY_ADDR
-       hex "Address in memory or XIP address of bootloader entry point"
-       default 0x402F4000 if AM43XX
-       default 0x402F0400 if AM33XX
-       default 0x40301350 if OMAP54XX
-       help
-         After any reset, the boot ROM searches the boot media for a valid
-         boot image. For non-XIP devices, the ROM then copies the image into
-         internal memory. For all boot modes, after the ROM processes the
-         boot image it eventually computes the entry point address depending
-         on the device type (secure/non-secure), boot media (xip/non-xip) and
-         image headers.
-endif
-
 source "arch/arm/mach-omap2/omap3/Kconfig"
 
 source "arch/arm/mach-omap2/omap4/Kconfig"
index 85ea8946b0fd1a2f1808222d8c44a285c9f8f02e..500df1aa11d1990b7a1180de46299477c8e26068 100644 (file)
@@ -87,6 +87,13 @@ config TARGET_AM335X_SHC
        imply CMD_DM
        imply CMD_SPL
 
+config TARGET_AM335X_GUARDIAN
+       bool "Support am335x based guardian board from bosch"
+       select DM
+       select DM_SERIAL
+       select DM_GPIO
+       select DM_USB
+
 config TARGET_AM335X_SL50
        bool "Support am335x_sl50"
        select BOARD_LATE_INIT
index b2ac1cdad717cc0f61a58352081407a050694620..27d29f797fc4a35e4965ebf4f5a811bcf1306203 100644 (file)
@@ -12,6 +12,11 @@ config R8A7796
        imply CLK_R8A7796
        imply PINCTRL_PFC_R8A7796
 
+config R8A77965
+       bool "Renesas SoC R8A77965"
+       imply CLK_R8A77965
+       imply PINCTRL_PFC_R8A77965
+
 config R8A77970
        bool "Renesas SoC R8A77970"
        imply CLK_R8A77970
@@ -55,6 +60,10 @@ config TARGET_SALVATOR_X
        bool "Salvator-X board"
        imply R8A7795
        imply R8A7796
+       imply R8A77965
+       imply SYS_MALLOC_F
+       imply MULTI_DTB_FIT
+       imply MULTI_DTB_FIT_USER_DEFINED_AREA
        help
           Support for Renesas R-Car Gen3 platform
 
@@ -62,6 +71,10 @@ config TARGET_ULCB
        bool "ULCB board"
        imply R8A7795
        imply R8A7796
+       imply R8A77965
+       imply SYS_MALLOC_F
+       imply MULTI_DTB_FIT
+       imply MULTI_DTB_FIT_USER_DEFINED_AREA
        help
           Support for Renesas R-Car Gen3 ULCB platform
 
@@ -76,4 +89,15 @@ source "board/renesas/ebisu/Kconfig"
 source "board/renesas/salvator-x/Kconfig"
 source "board/renesas/ulcb/Kconfig"
 
+config MULTI_DTB_FIT_UNCOMPRESS_SZ
+       default 0x80000 if TARGET_SALVATOR_X
+       default 0x80000 if TARGET_ULCB
+
+config MULTI_DTB_FIT_USER_DEF_ADDR
+       default 0x49000000 if TARGET_SALVATOR_X
+       default 0x49000000 if TARGET_ULCB
+
+config SYS_MALLOC_F_LEN
+       default 0x8000 if RCAR_GEN3
+
 endif
index f42b53fd88ace9fe49e75651df05e2a184de8553..213ec143e2774cf1c48a60feb566610ee3b81375 100644 (file)
 #include <linux/linkage.h>
 #include <asm/macro.h>
 
+.align 8
+.globl rcar_atf_boot_args
+rcar_atf_boot_args:
+       .dword 0
+       .dword 0
+       .dword 0
+       .dword 0
+
+ENTRY(save_boot_params)
+       adr     x8, rcar_atf_boot_args
+       stp     x0, x1, [x8], #16
+       stp     x2, x3, [x8], #16
+       b       save_boot_params_ret
+ENDPROC(save_boot_params)
+
 ENTRY(lowlevel_init)
        mov     x29, lr                 /* Save LR */
 
index 36512a8995005062b48e538bbae5db553a613f0a..ae8ff7b765786841971eedfa06cb4257418e375d 100644 (file)
@@ -109,6 +109,24 @@ config SIFIVE_CLINT
          The SiFive CLINT block holds memory-mapped control and status registers
          associated with software and timer interrupts.
 
+config ANDES_PLIC
+       bool
+       depends on RISCV_MMODE
+       select REGMAP
+       select SYSCON
+       help
+         The Andes PLIC block holds memory-mapped claim and pending registers
+         associated with software interrupt.
+
+config ANDES_PLMT
+       bool
+       depends on RISCV_MMODE
+       select REGMAP
+       select SYSCON
+       help
+         The Andes PLMT block holds memory-mapped mtime register
+         associated with timer tick.
+
 config RISCV_RDTIME
        bool
        default y if RISCV_SMODE
@@ -120,4 +138,32 @@ config RISCV_RDTIME
 config SYS_MALLOC_F_LEN
        default 0x1000
 
+config SMP
+       bool "Symmetric Multi-Processing"
+       help
+         This enables support for systems with more than one CPU. If
+         you say N here, U-Boot will run on single and multiprocessor
+         machines, but will use only one CPU of a multiprocessor
+         machine. If you say Y here, U-Boot will run on many, but not
+         all, single processor machines.
+
+config NR_CPUS
+       int "Maximum number of CPUs (2-32)"
+       range 2 32
+       depends on SMP
+       default 8
+       help
+         On multiprocessor machines, U-Boot sets up a stack for each CPU.
+         Stack memory is pre-allocated. U-Boot must therefore know the
+         maximum number of CPUs that may be present.
+
+config SBI_IPI
+       bool
+       default y if RISCV_SMODE
+       depends on SMP
+
+config STACK_SIZE_SHIFT
+       int
+       default 13
+
 endmenu
index e9dbca2faeadac5cf6a2adbae1762c48d377922c..6b4b92e6921612828ba6665a3a9e63ae59f5fb83 100644 (file)
@@ -1,5 +1,11 @@
 config RISCV_NDS
        bool
+       select ARCH_EARLY_INIT_R
+       imply CPU
+       imply CPU_RISCV
+       imply RISCV_TIMER
+       imply ANDES_PLIC if RISCV_MMODE
+       imply ANDES_PLMT if RISCV_MMODE
        help
          Run U-Boot on AndeStar V5 platforms and use some specific features
          which are provided by Andes Technology AndeStar V5 families.
@@ -8,6 +14,7 @@ if RISCV_NDS
 
 config RISCV_NDS_CACHE
        bool "AndeStar V5 families specific cache support"
+       depends on RISCV_MMODE
        help
          Provide Andes Technology AndeStar V5 families specific cache support.
 
index e662140427a563caaef8c1ffe5c2e710db4811ca..c32de8a4c3e64acec63b86dc8845683e6192fbc2 100644 (file)
 #include <dm/uclass-internal.h>
 
 /*
- * prior_stage_fdt_address must be stored in the data section since it is used
+ * The variables here must be stored in the data section since they are used
  * before the bss section is available.
  */
 phys_addr_t prior_stage_fdt_address __attribute__((section(".data")));
+u32 hart_lottery __attribute__((section(".data"))) = 0;
+
+/*
+ * The main hart running U-Boot has acquired available_harts_lock until it has
+ * finished initialization of global data.
+ */
+u32 available_harts_lock = 1;
 
 static inline bool supports_extension(char ext)
 {
index 81ea52b170f7f898e56b32c2ace08a602609ecf8..a4433fbd6ba1b3689961c8bc64b4c2f0f0aa26c5 100644 (file)
@@ -13,6 +13,7 @@
 #include <config.h>
 #include <common.h>
 #include <elf.h>
+#include <asm/csr.h>
 #include <asm/encoding.h>
 #include <generated/asm-offsets.h>
 
 #define SYM_SIZE               0x18
 #endif
 
+.section .data
+secondary_harts_relocation_error:
+       .ascii "Relocation of secondary harts has failed, error %d\n"
+
 .section .text
 .globl _start
 _start:
+#ifdef CONFIG_RISCV_MMODE
+       csrr    a0, mhartid
+#endif
+
        /* save hart id and dtb pointer */
-       mv      s0, a0
+       mv      tp, a0
        mv      s1, a1
 
        la      t0, trap_entry
@@ -45,9 +54,22 @@ _start:
        /* mask all interrupts */
        csrw    MODE_PREFIX(ie), zero
 
-       /* Enable cache */
-       jal     icache_enable
-       jal     dcache_enable
+#ifdef CONFIG_SMP
+       /* check if hart is within range */
+       /* tp: hart id */
+       li      t0, CONFIG_NR_CPUS
+       bge     tp, t0, hart_out_of_bounds_loop
+#endif
+
+#ifdef CONFIG_SMP
+       /* set xSIE bit to receive IPIs */
+#ifdef CONFIG_RISCV_MMODE
+       li      t0, MIE_MSIE
+#else
+       li      t0, SIE_SSIE
+#endif
+       csrs    MODE_PREFIX(ie), t0
+#endif
 
 /*
  * Set stackpointer in internal/ex RAM to call board_init_f
@@ -57,14 +79,33 @@ call_board_init_f:
        li      t1, CONFIG_SYS_INIT_SP_ADDR
        and     sp, t1, t0              /* force 16 byte alignment */
 
-#ifdef CONFIG_DEBUG_UART
-       jal     debug_uart_init
-#endif
-
 call_board_init_f_0:
        mv      a0, sp
        jal     board_init_f_alloc_reserve
+
+       /*
+        * Set global data pointer here for all harts, uninitialized at this
+        * point.
+        */
+       mv      gp, a0
+
+       /* setup stack */
+#ifdef CONFIG_SMP
+       /* tp: hart id */
+       slli    t0, tp, CONFIG_STACK_SIZE_SHIFT
+       sub     sp, a0, t0
+#else
        mv      sp, a0
+#endif
+
+       /*
+        * Pick hart to initialize global data and run U-Boot. The other harts
+        * wait for initialization to complete.
+        */
+       la      t0, hart_lottery
+       li      s2, 1
+       amoswap.w s2, t1, 0(t0)
+       bnez    s2, wait_for_gd_init
 
        la      t0, prior_stage_fdt_address
        SREG    s1, 0(t0)
@@ -72,7 +113,42 @@ call_board_init_f_0:
        jal     board_init_f_init_reserve
 
        /* save the boot hart id to global_data */
-       SREG    s0, GD_BOOT_HART(gp)
+       SREG    tp, GD_BOOT_HART(gp)
+
+       la      t0, available_harts_lock
+       fence   rw, w
+       amoswap.w zero, zero, 0(t0)
+
+wait_for_gd_init:
+       la      t0, available_harts_lock
+       li      t1, 1
+1:     amoswap.w t1, t1, 0(t0)
+       fence   r, rw
+       bnez    t1, 1b
+
+       /* register available harts in the available_harts mask */
+       li      t1, 1
+       sll     t1, t1, tp
+       LREG    t2, GD_AVAILABLE_HARTS(gp)
+       or      t2, t2, t1
+       SREG    t2, GD_AVAILABLE_HARTS(gp)
+
+       fence   rw, w
+       amoswap.w zero, zero, 0(t0)
+
+       /*
+        * Continue on hart lottery winner, others branch to
+        * secondary_hart_loop.
+        */
+       bnez    s2, secondary_hart_loop
+
+       /* Enable cache */
+       jal     icache_enable
+       jal     dcache_enable
+
+#ifdef CONFIG_DEBUG_UART
+       jal     debug_uart_init
+#endif
 
        mv      a0, zero                /* a0 <-- boot_flags = 0 */
        la      t5, board_init_f
@@ -95,7 +171,14 @@ relocate_code:
  *Set up the stack
  */
 stack_setup:
+#ifdef CONFIG_SMP
+       /* tp: hart id */
+       slli    t0, tp, CONFIG_STACK_SIZE_SHIFT
+       sub     sp, s2, t0
+#else
        mv      sp, s2
+#endif
+
        la      t0, _start
        sub     t6, s4, t0              /* t6 <- relocation offset */
        beq     t0, s4, clear_bss       /* skip relocation */
@@ -175,13 +258,37 @@ clear_bss:
        add     t0, t0, t6              /* t0 <- rel __bss_start in RAM */
        la      t1, __bss_end           /* t1 <- rel __bss_end in FLASH */
        add     t1, t1, t6              /* t1 <- rel __bss_end in RAM */
-       beq     t0, t1, call_board_init_r
+       beq     t0, t1, relocate_secondary_harts
 
 clbss_l:
        SREG    zero, 0(t0)             /* clear loop... */
        addi    t0, t0, REGBYTES
        bne     t0, t1, clbss_l
 
+relocate_secondary_harts:
+#ifdef CONFIG_SMP
+       /* send relocation IPI */
+       la      t0, secondary_hart_relocate
+       add     a0, t0, t6
+
+       /* store relocation offset */
+       mv      s5, t6
+
+       mv      a1, s2
+       mv      a2, s3
+       jal     smp_call_function
+
+       /* hang if relocation of secondary harts has failed */
+       beqz    a0, 1f
+       mv      a1, a0
+       la      a0, secondary_harts_relocation_error
+       jal     printf
+       jal     hang
+
+       /* restore relocation offset */
+1:     mv      t6, s5
+#endif
+
 /*
  * We are done. Do not return, instead branch to second part of board
  * initialization, now running from RAM.
@@ -202,3 +309,43 @@ call_board_init_r:
  * jump to it ...
  */
        jr      t4                      /* jump to board_init_r() */
+
+#ifdef CONFIG_SMP
+hart_out_of_bounds_loop:
+       /* Harts in this loop are out of bounds, increase CONFIG_NR_CPUS. */
+       wfi
+       j       hart_out_of_bounds_loop
+#endif
+
+#ifdef CONFIG_SMP
+/* SMP relocation entry */
+secondary_hart_relocate:
+       /* a1: new sp */
+       /* a2: new gd */
+       /* tp: hart id */
+
+       /* setup stack */
+       slli    t0, tp, CONFIG_STACK_SIZE_SHIFT
+       sub     sp, a1, t0
+
+       /* update global data pointer */
+       mv      gp, a2
+#endif
+
+secondary_hart_loop:
+       wfi
+
+#ifdef CONFIG_SMP
+       csrr    t0, MODE_PREFIX(ip)
+#ifdef CONFIG_RISCV_MMODE
+       andi    t0, t0, MIE_MSIE
+#else
+       andi    t0, t0, SIE_SSIE
+#endif
+       beqz    t0, secondary_hart_loop
+
+       mv      a0, tp
+       jal     handle_ipi
+#endif
+
+       j       secondary_hart_loop
index b400defb380cc33a88afe3e0edc474e65357bc9d..f9cd606a9aaf030aeccc27fd28ccdcf704c5eacf 100644 (file)
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+dtb-$(CONFIG_TARGET_AX25_AE350) += ae350_32.dtb ae350_64.dtb
+
 targets += $(dtb-y)
 
 DTC_FLAGS += -R 4 -p 0x1000
index 0679827313827d7008ce514bac731f440c22ada0..2ec01a5ce795656efd3ef3001682e2bb2e6e3f9f 100644 (file)
                        status = "okay";
                        compatible = "riscv";
                        riscv,isa = "rv32imafdc";
+                       riscv,priv-major = <1>;
+                       riscv,priv-minor = <10>;
                        mmu-type = "riscv,sv32";
                        clock-frequency = <60000000>;
+                       i-cache-size = <0x8000>;
+                       i-cache-line-size = <32>;
                        d-cache-size = <0x8000>;
                        d-cache-line-size = <32>;
+                       next-level-cache = <&L2>;
                        CPU0_intc: interrupt-controller {
                                #interrupt-cells = <1>;
                                interrupt-controller;
                                compatible = "riscv,cpu-intc";
                        };
                };
+               CPU1: cpu@1 {
+                       device_type = "cpu";
+                       reg = <1>;
+                       status = "okay";
+                       compatible = "riscv";
+                       riscv,isa = "rv32imafdc";
+                       riscv,priv-major = <1>;
+                       riscv,priv-minor = <10>;
+                       mmu-type = "riscv,sv32";
+                       clock-frequency = <60000000>;
+                       i-cache-size = <0x8000>;
+                       i-cache-line-size = <32>;
+                       d-cache-size = <0x8000>;
+                       d-cache-line-size = <32>;
+                       next-level-cache = <&L2>;
+                       CPU1_intc: interrupt-controller {
+                               #interrupt-cells = <1>;
+                               interrupt-controller;
+                               compatible = "riscv,cpu-intc";
+                       };
+               };
+
+               L2: l2-cache@e0500000 {
+                       compatible = "cache";
+                       cache-level = <2>;
+                       cache-size = <0x40000>;
+                       reg = <0x0 0xe0500000 0x0 0x40000>;
+               };
        };
 
        memory@0 {
        soc {
                #address-cells = <1>;
                #size-cells = <1>;
-               compatible = "andestech,riscv-ae350-soc";
+               compatible = "simple-bus";
                ranges;
 
-       plic0: interrupt-controller@e4000000 {
-               compatible = "riscv,plic0";
-               #address-cells = <1>;
-               #interrupt-cells = <1>;
-               interrupt-controller;
-               reg = <0xe4000000 0x2000000>;
-               riscv,ndev=<71>;
-               interrupts-extended = <&CPU0_intc 11 &CPU0_intc 9>;
-       };
+               plic0: interrupt-controller@e4000000 {
+                       compatible = "riscv,plic0";
+                       #address-cells = <1>;
+                       #interrupt-cells = <1>;
+                       interrupt-controller;
+                       reg = <0xe4000000 0x2000000>;
+                       riscv,ndev=<71>;
+                       interrupts-extended = <&CPU0_intc 11 &CPU0_intc 9 &CPU1_intc 11 &CPU1_intc 9>;
+               };
 
-       plic1: interrupt-controller@e6400000 {
-               compatible = "riscv,plic1";
-               #address-cells = <1>;
-               #interrupt-cells = <1>;
-               interrupt-controller;
-               reg = <0xe6400000 0x400000>;
-               riscv,ndev=<1>;
-               interrupts-extended = <&CPU0_intc 3>;
-       };
+               plic1: interrupt-controller@e6400000 {
+                       compatible = "riscv,plic1";
+                       #address-cells = <1>;
+                       #interrupt-cells = <1>;
+                       interrupt-controller;
+                       reg = <0xe6400000 0x400000>;
+                       riscv,ndev=<2>;
+                       interrupts-extended = <&CPU0_intc 3 &CPU1_intc 3>;
+               };
 
-       plmt0@e6000000 {
-               compatible = "riscv,plmt0";
-                       interrupts-extended = <&CPU0_intc 7>;
+               plmt0@e6000000 {
+                       compatible = "riscv,plmt0";
+                       interrupts-extended = <&CPU0_intc 7 &CPU1_intc 7>;
                        reg = <0xe6000000 0x100000>;
                };
        };
                interrupt-parent = <&plic0>;
        };
 
+       pmu {
+               compatible = "riscv,base-pmu";
+       };
+
        virtio_mmio@fe007000 {
                interrupts = <0x17 0x4>;
                interrupt-parent = <0x2>;
index e48c29864524a661f73e05a3b4939d5b4a326feb..cde5cdeff83ae793eb6ecaf011b3f16fe62f37af 100644 (file)
                        status = "okay";
                        compatible = "riscv";
                        riscv,isa = "rv64imafdc";
+                       riscv,priv-major = <1>;
+                       riscv,priv-minor = <10>;
                        mmu-type = "riscv,sv39";
                        clock-frequency = <60000000>;
+                       i-cache-size = <0x8000>;
+                       i-cache-line-size = <32>;
                        d-cache-size = <0x8000>;
                        d-cache-line-size = <32>;
+                       next-level-cache = <&L2>;
                        CPU0_intc: interrupt-controller {
                                #interrupt-cells = <1>;
                                interrupt-controller;
                                compatible = "riscv,cpu-intc";
                        };
                };
+               CPU1: cpu@1 {
+                       device_type = "cpu";
+                       reg = <1>;
+                       status = "okay";
+                       compatible = "riscv";
+                       riscv,isa = "rv64imafdc";
+                       riscv,priv-major = <1>;
+                       riscv,priv-minor = <10>;
+                       mmu-type = "riscv,sv39";
+                       clock-frequency = <60000000>;
+                       i-cache-size = <0x8000>;
+                       i-cache-line-size = <32>;
+                       d-cache-size = <0x8000>;
+                       d-cache-line-size = <32>;
+                       next-level-cache = <&L2>;
+                       CPU1_intc: interrupt-controller {
+                               #interrupt-cells = <1>;
+                               interrupt-controller;
+                               compatible = "riscv,cpu-intc";
+                       };
+               };
+
+               L2: l2-cache@e0500000 {
+                       compatible = "cache";
+                       cache-level = <2>;
+                       cache-size = <0x40000>;
+                       reg = <0x0 0xe0500000 0x0 0x40000>;
+               };
        };
 
        memory@0 {
        soc {
                #address-cells = <2>;
                #size-cells = <2>;
-               compatible = "andestech,riscv-ae350-soc";
+               compatible = "simple-bus";
                ranges;
 
-       plic0: interrupt-controller@e4000000 {
-               compatible = "riscv,plic0";
-               #address-cells = <2>;
-               #interrupt-cells = <2>;
-               interrupt-controller;
-               reg = <0x0 0xe4000000 0x0 0x2000000>;
-               riscv,ndev=<71>;
-               interrupts-extended = <&CPU0_intc 11 &CPU0_intc 9>;
-       };
+               plic0: interrupt-controller@e4000000 {
+                       compatible = "riscv,plic0";
+                       #address-cells = <2>;
+                       #interrupt-cells = <2>;
+                       interrupt-controller;
+                       reg = <0x0 0xe4000000 0x0 0x2000000>;
+                       riscv,ndev=<71>;
+                       interrupts-extended = <&CPU0_intc 11 &CPU0_intc 9 &CPU1_intc 11 &CPU1_intc 9>;
+               };
 
-       plic1: interrupt-controller@e6400000 {
-               compatible = "riscv,plic1";
-               #address-cells = <2>;
-               #interrupt-cells = <2>;
-               interrupt-controller;
-               reg = <0x0 0xe6400000 0x0 0x400000>;
-               riscv,ndev=<1>;
-               interrupts-extended = <&CPU0_intc 3>;
-       };
+               plic1: interrupt-controller@e6400000 {
+                       compatible = "riscv,plic1";
+                       #address-cells = <2>;
+                       #interrupt-cells = <2>;
+                       interrupt-controller;
+                       reg = <0x0 0xe6400000 0x0 0x400000>;
+                       riscv,ndev=<2>;
+                       interrupts-extended = <&CPU0_intc 3 &CPU1_intc 3>;
+               };
 
-       plmt0@e6000000 {
-               compatible = "riscv,plmt0";
-                       interrupts-extended = <&CPU0_intc 7>;
+               plmt0@e6000000 {
+                       compatible = "riscv,plmt0";
+                       interrupts-extended = <&CPU0_intc 7 &CPU1_intc 7>;
                        reg = <0x0 0xe6000000 0x0 0x100000>;
                };
        };
                interrupt-parent = <&plic0>;
        };
 
+       pmu {
+               compatible = "riscv,base-pmu";
+       };
+
        virtio_mmio@fe007000 {
                interrupts = <0x17 0x4>;
                interrupt-parent = <0x2>;
index 86136f542c7aac89e7221b429a912206d890e8db..644e6baa1579787bf562b404ee2fcdc1ff595a04 100644 (file)
@@ -46,6 +46,7 @@
 #endif
 
 /* Interrupt Enable and Interrupt Pending flags */
+#define MIE_MSIE       _AC(0x00000008, UL) /* Software Interrupt Enable */
 #define SIE_SSIE       _AC(0x00000002, UL) /* Software Interrupt Enable */
 #define SIE_STIE       _AC(0x00000020, UL) /* Timer Interrupt Enable */
 
index a3a342c6e1cbe106ad78137b781537a061c1770d..dffcd45bf01393888509db20c1bea2021ede3a32 100644 (file)
 #ifndef        __ASM_GBL_DATA_H
 #define __ASM_GBL_DATA_H
 
+#include <asm/smp.h>
+
 /* Architecture-specific global data */
 struct arch_global_data {
        long boot_hart;         /* boot hart id */
 #ifdef CONFIG_SIFIVE_CLINT
        void __iomem *clint;    /* clint base address */
 #endif
+#ifdef CONFIG_ANDES_PLIC
+       void __iomem *plic;     /* plic base address */
+#endif
+#ifdef CONFIG_ANDES_PLMT
+       void __iomem *plmt;     /* plmt base address */
+#endif
+#ifdef CONFIG_SMP
+       struct ipi_data ipi[CONFIG_NR_CPUS];
+#endif
+       ulong available_harts;
 };
 
 #include <asm-generic/global_data.h>
diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h
new file mode 100644 (file)
index 0000000..ced57de
--- /dev/null
@@ -0,0 +1,94 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2015 Regents of the University of California
+ *
+ * Taken from Linux arch/riscv/include/asm/sbi.h
+ */
+
+#ifndef _ASM_RISCV_SBI_H
+#define _ASM_RISCV_SBI_H
+
+#include <linux/types.h>
+
+#define SBI_SET_TIMER 0
+#define SBI_CONSOLE_PUTCHAR 1
+#define SBI_CONSOLE_GETCHAR 2
+#define SBI_CLEAR_IPI 3
+#define SBI_SEND_IPI 4
+#define SBI_REMOTE_FENCE_I 5
+#define SBI_REMOTE_SFENCE_VMA 6
+#define SBI_REMOTE_SFENCE_VMA_ASID 7
+#define SBI_SHUTDOWN 8
+
+#define SBI_CALL(which, arg0, arg1, arg2) ({                   \
+       register uintptr_t a0 asm ("a0") = (uintptr_t)(arg0);   \
+       register uintptr_t a1 asm ("a1") = (uintptr_t)(arg1);   \
+       register uintptr_t a2 asm ("a2") = (uintptr_t)(arg2);   \
+       register uintptr_t a7 asm ("a7") = (uintptr_t)(which);  \
+       asm volatile ("ecall"                                   \
+                     : "+r" (a0)                               \
+                     : "r" (a1), "r" (a2), "r" (a7)            \
+                     : "memory");                              \
+       a0;                                                     \
+})
+
+/* Lazy implementations until SBI is finalized */
+#define SBI_CALL_0(which) SBI_CALL(which, 0, 0, 0)
+#define SBI_CALL_1(which, arg0) SBI_CALL(which, arg0, 0, 0)
+#define SBI_CALL_2(which, arg0, arg1) SBI_CALL(which, arg0, arg1, 0)
+
+static inline void sbi_console_putchar(int ch)
+{
+       SBI_CALL_1(SBI_CONSOLE_PUTCHAR, ch);
+}
+
+static inline int sbi_console_getchar(void)
+{
+       return SBI_CALL_0(SBI_CONSOLE_GETCHAR);
+}
+
+static inline void sbi_set_timer(uint64_t stime_value)
+{
+#if __riscv_xlen == 32
+       SBI_CALL_2(SBI_SET_TIMER, stime_value, stime_value >> 32);
+#else
+       SBI_CALL_1(SBI_SET_TIMER, stime_value);
+#endif
+}
+
+static inline void sbi_shutdown(void)
+{
+       SBI_CALL_0(SBI_SHUTDOWN);
+}
+
+static inline void sbi_clear_ipi(void)
+{
+       SBI_CALL_0(SBI_CLEAR_IPI);
+}
+
+static inline void sbi_send_ipi(const unsigned long *hart_mask)
+{
+       SBI_CALL_1(SBI_SEND_IPI, hart_mask);
+}
+
+static inline void sbi_remote_fence_i(const unsigned long *hart_mask)
+{
+       SBI_CALL_1(SBI_REMOTE_FENCE_I, hart_mask);
+}
+
+static inline void sbi_remote_sfence_vma(const unsigned long *hart_mask,
+                                        unsigned long start,
+                                        unsigned long size)
+{
+       SBI_CALL_1(SBI_REMOTE_SFENCE_VMA, hart_mask);
+}
+
+static inline void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask,
+                                             unsigned long start,
+                                             unsigned long size,
+                                             unsigned long asid)
+{
+       SBI_CALL_1(SBI_REMOTE_SFENCE_VMA_ASID, hart_mask);
+}
+
+#endif
diff --git a/arch/riscv/include/asm/smp.h b/arch/riscv/include/asm/smp.h
new file mode 100644 (file)
index 0000000..bc863fd
--- /dev/null
@@ -0,0 +1,53 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 Fraunhofer AISEC,
+ * Lukas Auer <lukas.auer@aisec.fraunhofer.de>
+ */
+
+#ifndef _ASM_RISCV_SMP_H
+#define _ASM_RISCV_SMP_H
+
+/**
+ * struct ipi_data - Inter-processor interrupt (IPI) data structure
+ *
+ * IPIs are used for SMP support to communicate to other harts what function to
+ * call. Functions are in the form
+ * void (*addr)(ulong hart, ulong arg0, ulong arg1).
+ *
+ * The function address and the two arguments, arg0 and arg1, are stored in the
+ * IPI data structure. The hart ID is inserted by the hart handling the IPI and
+ * calling the function.
+ *
+ * @addr: Address of function
+ * @arg0: First argument of function
+ * @arg1: Second argument of function
+ */
+struct ipi_data {
+       ulong addr;
+       ulong arg0;
+       ulong arg1;
+};
+
+/**
+ * handle_ipi() - interrupt handler for software interrupts
+ *
+ * The IPI interrupt handler must be called to handle software interrupts. It
+ * calls the function specified in the hart's IPI data structure.
+ *
+ * @hart: Hart ID of the current hart
+ */
+void handle_ipi(ulong hart);
+
+/**
+ * smp_call_function() - Call a function on all other harts
+ *
+ * Send IPIs with the specified function call to all harts.
+ *
+ * @addr: Address of function
+ * @arg0: First argument of function
+ * @arg1: Second argument of function
+ * @return 0 if OK, -ve on error
+ */
+int smp_call_function(ulong addr, ulong arg0, ulong arg1);
+
+#endif
index d311ee6b45fa2f3d04c00df9cf6a7cfd99a04596..26a008ca59948393674ef9b9843b588b16fb7d89 100644 (file)
@@ -8,12 +8,12 @@
 
 /*
  * System controllers in a RISC-V system
- *
- * So far only SiFive's Core Local Interruptor (CLINT) is defined.
  */
 enum {
        RISCV_NONE,
        RISCV_SYSCON_CLINT,     /* Core Local Interruptor (CLINT) */
+       RISCV_SYSCON_PLIC,      /* Platform Level Interrupt Controller (PLIC) */
+       RISCV_SYSCON_PLMT,      /* Platform Level Machine Timer (PLMT) */
 };
 
 #endif /* _ASM_SYSCON_H */
index edfa61690c7db86c8dac8d4bfca08d48097ef5d0..1c332db436a9db87de191e31c482a59e528d6dfa 100644 (file)
@@ -11,9 +11,13 @@ obj-$(CONFIG_CMD_GO) += boot.o
 obj-y  += cache.o
 obj-$(CONFIG_RISCV_RDTIME) += rdtime.o
 obj-$(CONFIG_SIFIVE_CLINT) += sifive_clint.o
+obj-$(CONFIG_ANDES_PLIC) += andes_plic.o
+obj-$(CONFIG_ANDES_PLMT) += andes_plmt.o
 obj-y  += interrupts.o
 obj-y  += reset.o
+obj-$(CONFIG_SBI_IPI) += sbi_ipi.o
 obj-y   += setjmp.o
+obj-$(CONFIG_SMP) += smp.o
 
 # For building EFI apps
 CFLAGS_$(EFI_CRT0) := $(CFLAGS_EFI)
diff --git a/arch/riscv/lib/andes_plic.c b/arch/riscv/lib/andes_plic.c
new file mode 100644 (file)
index 0000000..2ffe49a
--- /dev/null
@@ -0,0 +1,113 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019, Rick Chen <rick@andestech.com>
+ *
+ * U-Boot syscon driver for Andes's Platform Level Interrupt Controller (PLIC).
+ * The PLIC block holds memory-mapped claim and pending registers
+ * associated with software interrupt.
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <dm/device-internal.h>
+#include <dm/lists.h>
+#include <dm/uclass-internal.h>
+#include <regmap.h>
+#include <syscon.h>
+#include <asm/io.h>
+#include <asm/syscon.h>
+#include <cpu.h>
+
+/* pending register */
+#define PENDING_REG(base, hart)        ((ulong)(base) + 0x1000 + (hart) * 8)
+/* enable register */
+#define ENABLE_REG(base, hart) ((ulong)(base) + 0x2000 + (hart) * 0x80)
+/* claim register */
+#define CLAIM_REG(base, hart)  ((ulong)(base) + 0x200004 + (hart) * 0x1000)
+
+#define ENABLE_HART_IPI         (0x80808080)
+#define SEND_IPI_TO_HART(hart)  (0x80 >> (hart))
+
+DECLARE_GLOBAL_DATA_PTR;
+static int init_plic(void);
+
+#define PLIC_BASE_GET(void)                                            \
+       do {                                                            \
+               long *ret;                                              \
+                                                                       \
+               if (!gd->arch.plic) {                                   \
+                       ret = syscon_get_first_range(RISCV_SYSCON_PLIC); \
+                       if (IS_ERR(ret))                                \
+                               return PTR_ERR(ret);                    \
+                       gd->arch.plic = ret;                            \
+                       init_plic();                                    \
+               }                                                       \
+       } while (0)
+
+static int enable_ipi(int harts)
+{
+       int i;
+       int en = ENABLE_HART_IPI;
+
+       for (i = 0; i < harts; i++) {
+               en = en >> i;
+               writel(en, (void __iomem *)ENABLE_REG(gd->arch.plic, i));
+       }
+
+       return 0;
+}
+
+static int init_plic(void)
+{
+       struct udevice *dev;
+       int ret;
+
+       ret = uclass_find_first_device(UCLASS_CPU, &dev);
+       if (ret)
+               return ret;
+
+       if (ret == 0 && dev) {
+               ret = cpu_get_count(dev);
+               if (ret < 0)
+                       return ret;
+
+               enable_ipi(ret);
+               return 0;
+       }
+
+       return -ENODEV;
+}
+
+int riscv_send_ipi(int hart)
+{
+       PLIC_BASE_GET();
+
+       writel(SEND_IPI_TO_HART(hart),
+              (void __iomem *)PENDING_REG(gd->arch.plic, gd->arch.boot_hart));
+
+       return 0;
+}
+
+int riscv_clear_ipi(int hart)
+{
+       u32 source_id;
+
+       PLIC_BASE_GET();
+
+       source_id = readl((void __iomem *)CLAIM_REG(gd->arch.plic, hart));
+       writel(source_id, (void __iomem *)CLAIM_REG(gd->arch.plic, hart));
+
+       return 0;
+}
+
+static const struct udevice_id andes_plic_ids[] = {
+       { .compatible = "riscv,plic1", .data = RISCV_SYSCON_PLIC },
+       { }
+};
+
+U_BOOT_DRIVER(andes_plic) = {
+       .name           = "andes_plic",
+       .id             = UCLASS_SYSCON,
+       .of_match       = andes_plic_ids,
+       .flags          = DM_FLAG_PRE_RELOC,
+};
diff --git a/arch/riscv/lib/andes_plmt.c b/arch/riscv/lib/andes_plmt.c
new file mode 100644 (file)
index 0000000..84f4607
--- /dev/null
@@ -0,0 +1,53 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019, Rick Chen <rick@andestech.com>
+ *
+ * U-Boot syscon driver for Andes's Platform Level Machine Timer (PLMT).
+ * The PLMT block holds memory-mapped mtime register
+ * associated with timer tick.
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <regmap.h>
+#include <syscon.h>
+#include <asm/io.h>
+#include <asm/syscon.h>
+
+/* mtime register */
+#define MTIME_REG(base)                        ((ulong)(base))
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define PLMT_BASE_GET(void)                                            \
+       do {                                                            \
+               long *ret;                                              \
+                                                                       \
+               if (!gd->arch.plmt) {                                   \
+                       ret = syscon_get_first_range(RISCV_SYSCON_PLMT); \
+                       if (IS_ERR(ret))                                \
+                               return PTR_ERR(ret);                    \
+                       gd->arch.plmt = ret;                            \
+               }                                                       \
+       } while (0)
+
+int riscv_get_time(u64 *time)
+{
+       PLMT_BASE_GET();
+
+       *time = readq((void __iomem *)MTIME_REG(gd->arch.plmt));
+
+       return 0;
+}
+
+static const struct udevice_id andes_plmt_ids[] = {
+       { .compatible = "riscv,plmt0", .data = RISCV_SYSCON_PLMT },
+       { }
+};
+
+U_BOOT_DRIVER(andes_plmt) = {
+       .name           = "andes_plmt",
+       .id             = UCLASS_SYSCON,
+       .of_match       = andes_plmt_ids,
+       .flags          = DM_FLAG_PRE_RELOC,
+};
index e0b71f569191ad95e1ecdc51f8e2385e04bcde94..f998402bd1bf398f7b6b757f8e921dffb3727a06 100644 (file)
@@ -14,6 +14,7 @@
 int main(void)
 {
        DEFINE(GD_BOOT_HART, offsetof(gd_t, arch.boot_hart));
+       DEFINE(GD_AVAILABLE_HARTS, offsetof(gd_t, arch.available_harts));
 
        return 0;
 }
index f36b8702ef3d3067f034bf5dd5b55004896f6610..efbd3e23e7a570e3f693eca1645118ebb9c7277f 100644 (file)
@@ -13,6 +13,7 @@
 #include <image.h>
 #include <asm/byteorder.h>
 #include <asm/csr.h>
+#include <asm/smp.h>
 #include <dm/device.h>
 #include <dm/root.h>
 #include <u-boot/zlib.h>
@@ -81,6 +82,9 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
 {
        void (*kernel)(ulong hart, void *dtb);
        int fake = (flag & BOOTM_STATE_OS_FAKE_GO);
+#ifdef CONFIG_SMP
+       int ret;
+#endif
 
        kernel = (void (*)(ulong, void *))images->ep;
 
@@ -92,8 +96,15 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
        announce_and_cleanup(fake);
 
        if (!fake) {
-               if (IMAGE_ENABLE_OF_LIBFDT && images->ft_len)
+               if (IMAGE_ENABLE_OF_LIBFDT && images->ft_len) {
+#ifdef CONFIG_SMP
+                       ret = smp_call_function(images->ep,
+                                               (ulong)images->ft_addr, 0);
+                       if (ret)
+                               hang();
+#endif
                        kernel(gd->arch.boot_hart, images->ft_addr);
+               }
        }
 }
 
diff --git a/arch/riscv/lib/sbi_ipi.c b/arch/riscv/lib/sbi_ipi.c
new file mode 100644 (file)
index 0000000..170346d
--- /dev/null
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Fraunhofer AISEC,
+ * Lukas Auer <lukas.auer@aisec.fraunhofer.de>
+ */
+
+#include <common.h>
+#include <asm/sbi.h>
+
+int riscv_send_ipi(int hart)
+{
+       ulong mask;
+
+       mask = 1UL << hart;
+       sbi_send_ipi(&mask);
+
+       return 0;
+}
+
+int riscv_clear_ipi(int hart)
+{
+       sbi_clear_ipi();
+
+       return 0;
+}
diff --git a/arch/riscv/lib/smp.c b/arch/riscv/lib/smp.c
new file mode 100644 (file)
index 0000000..caa292c
--- /dev/null
@@ -0,0 +1,118 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2019 Fraunhofer AISEC,
+ * Lukas Auer <lukas.auer@aisec.fraunhofer.de>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <asm/barrier.h>
+#include <asm/smp.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/**
+ * riscv_send_ipi() - Send inter-processor interrupt (IPI)
+ *
+ * Platform code must provide this function.
+ *
+ * @hart: Hart ID of receiving hart
+ * @return 0 if OK, -ve on error
+ */
+extern int riscv_send_ipi(int hart);
+
+/**
+ * riscv_clear_ipi() - Clear inter-processor interrupt (IPI)
+ *
+ * Platform code must provide this function.
+ *
+ * @hart: Hart ID of hart to be cleared
+ * @return 0 if OK, -ve on error
+ */
+extern int riscv_clear_ipi(int hart);
+
+static int send_ipi_many(struct ipi_data *ipi)
+{
+       ofnode node, cpus;
+       u32 reg;
+       int ret;
+
+       cpus = ofnode_path("/cpus");
+       if (!ofnode_valid(cpus)) {
+               pr_err("Can't find cpus node!\n");
+               return -EINVAL;
+       }
+
+       ofnode_for_each_subnode(node, cpus) {
+               /* skip if hart is marked as not available in the device tree */
+               if (!ofnode_is_available(node))
+                       continue;
+
+               /* read hart ID of CPU */
+               ret = ofnode_read_u32(node, "reg", &reg);
+               if (ret)
+                       continue;
+
+               /* skip if it is the hart we are running on */
+               if (reg == gd->arch.boot_hart)
+                       continue;
+
+               if (reg >= CONFIG_NR_CPUS) {
+                       pr_err("Hart ID %d is out of range, increase CONFIG_NR_CPUS\n",
+                              reg);
+                       continue;
+               }
+
+               /* skip if hart is not available */
+               if (!(gd->arch.available_harts & (1 << reg)))
+                       continue;
+
+               gd->arch.ipi[reg].addr = ipi->addr;
+               gd->arch.ipi[reg].arg0 = ipi->arg0;
+               gd->arch.ipi[reg].arg1 = ipi->arg1;
+
+               ret = riscv_send_ipi(reg);
+               if (ret) {
+                       pr_err("Cannot send IPI to hart %d\n", reg);
+                       return ret;
+               }
+       }
+
+       return 0;
+}
+
+void handle_ipi(ulong hart)
+{
+       int ret;
+       void (*smp_function)(ulong hart, ulong arg0, ulong arg1);
+
+       if (hart >= CONFIG_NR_CPUS)
+               return;
+
+       ret = riscv_clear_ipi(hart);
+       if (ret) {
+               pr_err("Cannot clear IPI of hart %ld\n", hart);
+               return;
+       }
+
+       __smp_mb();
+
+       smp_function = (void (*)(ulong, ulong, ulong))gd->arch.ipi[hart].addr;
+       invalidate_icache_all();
+
+       smp_function(hart, gd->arch.ipi[hart].arg0, gd->arch.ipi[hart].arg1);
+}
+
+int smp_call_function(ulong addr, ulong arg0, ulong arg1)
+{
+       int ret = 0;
+       struct ipi_data ipi;
+
+       ipi.addr = addr;
+       ipi.arg0 = arg0;
+       ipi.arg1 = arg1;
+
+       ret = send_ipi_many(&ipi);
+
+       return ret;
+}
index 44cb302f708cd15d3c6b0e8e45334f411de53fec..5e682b679d8aa536ee5370a37a74653e2b1ceb22 100644 (file)
@@ -24,5 +24,6 @@ config ENV_OFFSET
 config BOARD_SPECIFIC_OPTIONS # dummy
        def_bool y
        select RISCV_NDS
+       imply SMP
 
 endif
index c7f6479a0cf040e4bedcc8cb3f680aad6e875492..c21d2f3ffa67f8304f470dbead2aa20fbd53059d 100644 (file)
@@ -379,7 +379,7 @@ int board_init(void)
                puts("Cannot find Armada 385 watchdog!\n");
        } else {
                puts("Enabling Armada 385 watchdog.\n");
-               wdt_start(watchdog_dev, (u32) 25000000 * 120, 0);
+               wdt_start(watchdog_dev, 120000, 0);
        }
 # endif
 
diff --git a/board/Marvell/db-xc3-24g4xg/.gitignore b/board/Marvell/db-xc3-24g4xg/.gitignore
new file mode 100644 (file)
index 0000000..775b934
--- /dev/null
@@ -0,0 +1 @@
+kwbimage.cfg
diff --git a/board/Marvell/db-xc3-24g4xg/MAINTAINERS b/board/Marvell/db-xc3-24g4xg/MAINTAINERS
new file mode 100644 (file)
index 0000000..2b27e48
--- /dev/null
@@ -0,0 +1,7 @@
+DB-XC3-24G4XG BOARD
+M:     Chris Packham <chris.packham@alliedtelesis.co.nz>
+S:     Maintained
+F:     board/Marvell/db-xc3-24g4xg/
+F:     include/configs/db-xc3-24g4xg.h
+F:     configs/db-xc3-24g4xg_defconfig
+F:     arch/arm/dts/armada-xp-db-xc3-24g4xg.dts
diff --git a/board/Marvell/db-xc3-24g4xg/Makefile b/board/Marvell/db-xc3-24g4xg/Makefile
new file mode 100644 (file)
index 0000000..4dd5790
--- /dev/null
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2015 Stefan Roese <sr@denx.de>
+
+obj-y  := db-xc3-24g4xg.o
+extra-y        := kwbimage.cfg
+
+quiet_cmd_sed = SED     $@
+      cmd_sed = sed $(SEDFLAGS_$(@F)) $< >$(dir $<)$(@F)
+
+SEDFLAGS_kwbimage.cfg =-e "s|^BINARY.*|BINARY $(srctree)/$(@D)/binary.0 0000005b 00000068|"
+$(src)/kwbimage.cfg: $(src)/kwbimage.cfg.in include/autoconf.mk \
+               include/config/auto.conf
+         $(call if_changed,sed)
diff --git a/board/Marvell/db-xc3-24g4xg/README b/board/Marvell/db-xc3-24g4xg/README
new file mode 100644 (file)
index 0000000..5e479b4
--- /dev/null
@@ -0,0 +1,4 @@
+To generate binary.0 from Marvell's bin_hdr.elf use the following command
+
+    arm-softfloat-linux-gnueabi-objcopy -S -O binary bin_hdr.elf \
+       board/Marvell/db-xc3-24g4xg/binary.0
diff --git a/board/Marvell/db-xc3-24g4xg/binary.0 b/board/Marvell/db-xc3-24g4xg/binary.0
new file mode 100644 (file)
index 0000000..8dd6872
--- /dev/null
@@ -0,0 +1,11 @@
+--------
+WARNING:
+--------
+This file should contain the bin_hdr generated by the original Marvell
+U-Boot implementation. As this is currently not included in this
+U-Boot version, we have added this placeholder, so that the U-Boot
+image can be generated without errors.
+
+If you have a known to be working bin_hdr for your board, then you
+just need to replace this text file here with the binary header
+and recompile U-Boot.
diff --git a/board/Marvell/db-xc3-24g4xg/db-xc3-24g4xg.c b/board/Marvell/db-xc3-24g4xg/db-xc3-24g4xg.c
new file mode 100644 (file)
index 0000000..cae428f
--- /dev/null
@@ -0,0 +1,68 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2015 Stefan Roese <sr@denx.de>
+ */
+
+#include <common.h>
+#include <i2c.h>
+#include <asm/gpio.h>
+#include <linux/mbus.h>
+#include <linux/io.h>
+#include <asm/arch/cpu.h>
+#include <asm/arch/soc.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * These values and defines are taken from the Marvell U-Boot version
+ * "u-boot-2013.01-2016_T1.0.eng_drop_v6"
+ */
+#define DB_DX_AC3_GPP_OUT_ENA_LOW      (~(BIT(0) | BIT(2) | BIT(3) | BIT(4) | BIT(6) | BIT(12) \
+                                       | BIT(13) | BIT(16) | BIT(17) | BIT(20) | BIT(29)  | BIT(30)))
+#define DB_DX_AC3_GPP_OUT_ENA_MID      (~(0))
+#define DB_DX_AC3_GPP_OUT_VAL_LOW      (BIT(0) | BIT(2) | BIT(3) | BIT(4) | BIT(6) | BIT(12) \
+                                       | BIT(13) | BIT(16) | BIT(17) | BIT(20) | BIT(29)  | BIT(30))
+#define DB_DX_AC3_GPP_OUT_VAL_MID      0x0
+#define DB_DX_AC3_GPP_POL_LOW          0x0
+#define DB_DX_AC3_GPP_POL_MID          0x0
+
+int board_early_init_f(void)
+{
+       /* Configure MPP */
+       writel(0x00142222, MVEBU_MPP_BASE + 0x00);
+       writel(0x11122000, MVEBU_MPP_BASE + 0x04);
+       writel(0x44444004, MVEBU_MPP_BASE + 0x08);
+       writel(0x14444444, MVEBU_MPP_BASE + 0x0c);
+       writel(0x00000001, MVEBU_MPP_BASE + 0x10);
+
+       /* Set GPP Out value */
+       writel(DB_DX_AC3_GPP_OUT_VAL_LOW, MVEBU_GPIO0_BASE + 0x00);
+       writel(DB_DX_AC3_GPP_OUT_VAL_MID, MVEBU_GPIO1_BASE + 0x00);
+
+       /* Set GPP Polarity */
+       writel(DB_DX_AC3_GPP_POL_LOW, MVEBU_GPIO0_BASE + 0x0c);
+       writel(DB_DX_AC3_GPP_POL_MID, MVEBU_GPIO1_BASE + 0x0c);
+
+       /* Set GPP Out Enable */
+       writel(DB_DX_AC3_GPP_OUT_ENA_LOW, MVEBU_GPIO0_BASE + 0x04);
+       writel(DB_DX_AC3_GPP_OUT_ENA_MID, MVEBU_GPIO1_BASE + 0x04);
+
+       return 0;
+}
+
+int board_init(void)
+{
+       /* address of boot parameters */
+       gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
+
+       return 0;
+}
+
+#ifdef CONFIG_DISPLAY_BOARDINFO
+int checkboard(void)
+{
+       puts("Board: " CONFIG_SYS_BOARD "\n");
+
+       return 0;
+}
+#endif
diff --git a/board/Marvell/db-xc3-24g4xg/kwbimage.cfg.in b/board/Marvell/db-xc3-24g4xg/kwbimage.cfg.in
new file mode 100644 (file)
index 0000000..b8bb7a6
--- /dev/null
@@ -0,0 +1,12 @@
+#
+# Copyright (C) 2014 Stefan Roese <sr@denx.de>
+#
+
+# Armada XP uses version 1 image format
+VERSION                1
+
+# Boot Media configurations
+BOOT_FROM      spi
+
+# Binary Header (bin_hdr) with DDR3 training code
+BINARY board/Marvell/db-xc3-24g4xg/binary.0 0000005b 00000068
index eb3694ea6e7c23eae75a3008b2cd01700513e149..d23e97c9b9165b3aafe2f8983538a4d1a7d73275 100644 (file)
@@ -115,14 +115,14 @@ MV_DRAM_MODES *ddr3_get_static_ddr_mode(void)
        return &ds414_ddr_modes[0];
 }
 
-MV_BIN_SERDES_CFG *board_serdes_cfg_get(u8 pex_mode)
+MV_BIN_SERDES_CFG *board_serdes_cfg_get(void)
 {
        return &ds414_serdes_cfg[0];
 }
 
 u8 board_sat_r_get(u8 dev_num, u8 reg)
 {
-       return (0x1 << 1 | 1);
+       return 0xf;     /* All PEX ports support PCIe Gen2 */
 }
 
 int board_early_init_f(void)
index d7d1942fe686aa59138894cff4a881c4a879e8eb..6934fd80173072c8ef5d1bf0624ff8819d7845ed 100644 (file)
@@ -7,6 +7,7 @@
 #include <command.h>
 #include <dm.h>
 #include <i2c.h>
+#include <wdt.h>
 #include <asm/gpio.h>
 #include <linux/mbus.h>
 #include <linux/io.h>
@@ -24,6 +25,10 @@ DECLARE_GLOBAL_DATA_PTR;
 #define CONFIG_NVS_LOCATION            0xf4800000
 #define CONFIG_NVS_SIZE                        (512 << 10)
 
+#ifdef CONFIG_WATCHDOG
+static struct udevice *watchdog_dev;
+#endif
+
 static struct serdes_map board_serdes_map[] = {
        {PEX0, SERDES_SPEED_5_GBPS, PEX_ROOT_COMPLEX_X1, 0, 0},
        {DEFAULT_SERDES, SERDES_SPEED_5_GBPS, SERDES_DEFAULT_MODE, 0, 0},
@@ -75,6 +80,10 @@ struct mv_ddr_topology_map *mv_ddr_topology_map_get(void)
 
 int board_early_init_f(void)
 {
+#ifdef CONFIG_WATCHDOG
+       watchdog_dev = NULL;
+#endif
+
        /* Configure MPP */
        writel(0x00001111, MVEBU_MPP_BASE + 0x00);
        writel(0x00000000, MVEBU_MPP_BASE + 0x04);
@@ -88,6 +97,17 @@ int board_early_init_f(void)
        return 0;
 }
 
+void spl_board_init(void)
+{
+#ifdef CONFIG_WATCHDOG
+       int ret;
+
+       ret = uclass_get_device(UCLASS_WDT, 0, &watchdog_dev);
+       if (!ret)
+               wdt_start(watchdog_dev, 120000, 0);
+#endif
+}
+
 int board_init(void)
 {
        /* address of boot parameters */
@@ -100,9 +120,37 @@ int board_init(void)
        /* DEV_READYn is not needed for NVS, ignore it when accessing CS1 */
        writel(0x00004001, MVEBU_DEV_BUS_BASE + 0xc8);
 
+       spl_board_init();
+
        return 0;
 }
 
+void arch_preboot_os(void)
+{
+#ifdef CONFIG_WATCHDOG
+       wdt_stop(watchdog_dev);
+#endif
+}
+
+#ifdef CONFIG_WATCHDOG
+void watchdog_reset(void)
+{
+       static ulong next_reset = 0;
+       ulong now;
+
+       if (!watchdog_dev)
+               return;
+
+       now = timer_get_us();
+
+       /* Do not reset the watchdog too often */
+       if (now > next_reset) {
+               wdt_reset(watchdog_dev);
+               next_reset = now + 1000;
+       }
+}
+#endif
+
 static int led_7seg_init(unsigned int segments)
 {
        int node;
diff --git a/board/bosch/guardian/Kconfig b/board/bosch/guardian/Kconfig
new file mode 100644 (file)
index 0000000..1417da6
--- /dev/null
@@ -0,0 +1,15 @@
+if TARGET_AM335X_GUARDIAN
+
+config SYS_BOARD
+       default "guardian"
+
+config SYS_VENDOR
+       default "bosch"
+
+config SYS_SOC
+       default "am33xx"
+
+config SYS_CONFIG_NAME
+       default "am335x_guardian"
+
+endif
diff --git a/board/bosch/guardian/MAINTAINERS b/board/bosch/guardian/MAINTAINERS
new file mode 100644 (file)
index 0000000..8d16ec0
--- /dev/null
@@ -0,0 +1,6 @@
+Guardian BOARD
+M:     Sjoerd Simons <sjoerd.simons@collabora.co.uk>
+S:     Maintained
+F:     board/bosch/guardian/
+F:     include/configs/am335x_guardian.h
+F:     configs/am335x_guardian_defconfig
diff --git a/board/bosch/guardian/Makefile b/board/bosch/guardian/Makefile
new file mode 100644 (file)
index 0000000..11625c9
--- /dev/null
@@ -0,0 +1,12 @@
+# SPDX-License-Identifier:     GPL-2.0+
+#
+# Makefile
+#
+# Copyright (C) 2018 Robert Bosch Power Tools GmbH
+#
+
+ifeq ($(CONFIG_SKIP_LOWLEVEL_INIT),)
+obj-y  := mux.o
+endif
+
+obj-y  += board.o
diff --git a/board/bosch/guardian/board.c b/board/bosch/guardian/board.c
new file mode 100644 (file)
index 0000000..86ab180
--- /dev/null
@@ -0,0 +1,186 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * board.c
+ *
+ * Board functions for Bosch Guardian
+ *
+ * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
+ * Copyright (C) 2018 Robert Bosch Power Tools GmbH
+ */
+
+#include <common.h>
+#include <cpsw.h>
+#include <dm.h>
+#include <environment.h>
+#include <environment.h>
+#include <errno.h>
+#include <i2c.h>
+#include <miiphy.h>
+#include <panel.h>
+#include <power/tps65217.h>
+#include <power/tps65910.h>
+#include <spl.h>
+#include <watchdog.h>
+#include <asm/arch/clock.h>
+#include <asm/arch/cpu.h>
+#include <asm/arch/ddr_defs.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/mem.h>
+#include <asm/arch/mmc_host_def.h>
+#include <asm/arch/omap.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/emif.h>
+#include <asm/gpio.h>
+#include <asm/io.h>
+#include "board.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
+
+static const struct ddr_data ddr3_data = {
+       .datardsratio0 = MT41K128M16JT125K_RD_DQS,
+       .datawdsratio0 = MT41K128M16JT125K_WR_DQS,
+       .datafwsratio0 = MT41K128M16JT125K_PHY_FIFO_WE,
+       .datawrsratio0 = MT41K128M16JT125K_PHY_WR_DATA,
+};
+
+static const struct cmd_control ddr3_cmd_ctrl_data = {
+       .cmd0csratio = MT41K128M16JT125K_RATIO,
+       .cmd0iclkout = MT41K128M16JT125K_INVERT_CLKOUT,
+
+       .cmd1csratio = MT41K128M16JT125K_RATIO,
+       .cmd1iclkout = MT41K128M16JT125K_INVERT_CLKOUT,
+
+       .cmd2csratio = MT41K128M16JT125K_RATIO,
+       .cmd2iclkout = MT41K128M16JT125K_INVERT_CLKOUT,
+};
+
+static struct emif_regs ddr3_emif_reg_data = {
+       .sdram_config = MT41K128M16JT125K_EMIF_SDCFG,
+       .ref_ctrl = MT41K128M16JT125K_EMIF_SDREF,
+       .sdram_tim1 = MT41K128M16JT125K_EMIF_TIM1,
+       .sdram_tim2 = MT41K128M16JT125K_EMIF_TIM2,
+       .sdram_tim3 = MT41K128M16JT125K_EMIF_TIM3,
+       .zq_config = MT41K128M16JT125K_ZQ_CFG,
+       .emif_ddr_phy_ctlr_1 = MT41K128M16JT125K_EMIF_READ_LATENCY,
+};
+
+#define OSC    (V_OSCK / 1000000)
+const struct dpll_params dpll_ddr = {
+               400, OSC - 1, 1, -1, -1, -1, -1};
+
+void am33xx_spl_board_init(void)
+{
+       int mpu_vdd;
+       int usb_cur_lim;
+
+       /* Get the frequency */
+       dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev);
+
+       if (i2c_probe(TPS65217_CHIP_PM))
+               return;
+
+       /*
+        * Increase USB current limit to 1300mA or 1800mA and set
+        * the MPU voltage controller as needed.
+        */
+       if (dpll_mpu_opp100.m == MPUPLL_M_1000) {
+               usb_cur_lim = TPS65217_USB_INPUT_CUR_LIMIT_1800MA;
+               mpu_vdd = TPS65217_DCDC_VOLT_SEL_1325MV;
+       } else {
+               usb_cur_lim = TPS65217_USB_INPUT_CUR_LIMIT_1300MA;
+               mpu_vdd = TPS65217_DCDC_VOLT_SEL_1275MV;
+       }
+
+       if (tps65217_reg_write(TPS65217_PROT_LEVEL_NONE,
+                              TPS65217_POWER_PATH,
+                              usb_cur_lim,
+                              TPS65217_USB_INPUT_CUR_LIMIT_MASK))
+               puts("tps65217_reg_write failure\n");
+
+       /* Set DCDC3 (CORE) voltage to 1.125V */
+       if (tps65217_voltage_update(TPS65217_DEFDCDC3,
+                                   TPS65217_DCDC_VOLT_SEL_1125MV)) {
+               puts("tps65217_voltage_update failure\n");
+               return;
+       }
+
+       /* Set CORE Frequencies to OPP100 */
+       do_setup_dpll(&dpll_core_regs, &dpll_core_opp100);
+
+       /* Set DCDC2 (MPU) voltage */
+       if (tps65217_voltage_update(TPS65217_DEFDCDC2, mpu_vdd)) {
+               puts("tps65217_voltage_update failure\n");
+               return;
+       }
+
+       /*
+        * Set LDO3 to 1.8V and LDO4 to 3.3V
+        */
+       if (tps65217_reg_write(TPS65217_PROT_LEVEL_2,
+                              TPS65217_DEFLS1,
+                              TPS65217_LDO_VOLTAGE_OUT_1_8,
+                              TPS65217_LDO_MASK))
+               puts("tps65217_reg_write failure\n");
+
+       if (tps65217_reg_write(TPS65217_PROT_LEVEL_2,
+                              TPS65217_DEFLS2,
+                              TPS65217_LDO_VOLTAGE_OUT_3_3,
+                              TPS65217_LDO_MASK))
+               puts("tps65217_reg_write failure\n");
+
+       /* Set MPU Frequency to what we detected now that voltages are set */
+       do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100);
+}
+
+const struct dpll_params *get_dpll_ddr_params(void)
+{
+       enable_i2c0_pin_mux();
+       i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
+
+       return &dpll_ddr;
+}
+
+void set_uart_mux_conf(void)
+{
+       enable_uart0_pin_mux();
+}
+
+void set_mux_conf_regs(void)
+{
+       enable_board_pin_mux();
+}
+
+const struct ctrl_ioregs ioregs = {
+       .cm0ioctl               = MT41K128M16JT125K_IOCTRL_VALUE,
+       .cm1ioctl               = MT41K128M16JT125K_IOCTRL_VALUE,
+       .cm2ioctl               = MT41K128M16JT125K_IOCTRL_VALUE,
+       .dt0ioctl               = MT41K128M16JT125K_IOCTRL_VALUE,
+       .dt1ioctl               = MT41K128M16JT125K_IOCTRL_VALUE,
+};
+
+void sdram_init(void)
+{
+       config_ddr(400, &ioregs,
+                  &ddr3_data,
+                  &ddr3_cmd_ctrl_data,
+                  &ddr3_emif_reg_data, 0);
+}
+#endif
+
+int board_init(void)
+{
+#if defined(CONFIG_HW_WATCHDOG)
+       hw_watchdog_init();
+#endif
+
+       gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+
+#ifdef CONFIG_NAND
+       gpmc_init();
+#endif
+       return 0;
+}
diff --git a/board/bosch/guardian/board.h b/board/bosch/guardian/board.h
new file mode 100644 (file)
index 0000000..b301caf
--- /dev/null
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * board.h
+ *
+ * Board header for Bosch Guardian
+ *
+ * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
+ * Copyright (C) 2018 Robert Bosch Power Tools GmbH
+ */
+
+#ifndef _BOARD_H_
+#define _BOARD_H_
+
+void enable_uart0_pin_mux(void);
+void enable_i2c0_pin_mux(void);
+void enable_board_pin_mux(void);
+#endif
diff --git a/board/bosch/guardian/mux.c b/board/bosch/guardian/mux.c
new file mode 100644 (file)
index 0000000..708c3e7
--- /dev/null
@@ -0,0 +1,99 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * mux.c
+ *
+ * Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
+ * Copyright (C) 2018 Robert Bosch Power Tools GmbH
+ */
+
+#include <common.h>
+#include <i2c.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/mux.h>
+#include <asm/arch/sys_proto.h>
+#include <asm/io.h>
+#include "board.h"
+
+static struct module_pin_mux uart0_pin_mux[] = {
+       {OFFSET(uart0_rxd), (MODE(0) | PULLUP_EN | RXACTIVE)},
+       {OFFSET(uart0_txd), (MODE(0) | PULLUDEN)},
+       {-1},
+};
+
+static struct module_pin_mux i2c0_pin_mux[] = {
+       {OFFSET(i2c0_sda), (MODE(0) | RXACTIVE | PULLUDEN | SLEWCTRL)},
+       {OFFSET(i2c0_scl), (MODE(0) | RXACTIVE | PULLUDEN | SLEWCTRL)},
+       {-1},
+};
+
+static struct module_pin_mux adc_voltages_en[] = {
+       {OFFSET(mcasp0_ahclkx), (MODE(7) | PULLUP_EN)},
+       {-1},
+};
+
+static struct module_pin_mux asp_power_en[] = {
+       {OFFSET(mcasp0_aclkx), (MODE(7) | PULLUP_EN)},
+       {-1},
+};
+
+static struct module_pin_mux switch_off_3v6_pin_mux[] = {
+       {OFFSET(mii1_txd0), (MODE(7) | PULLUP_EN)},
+       /*
+        * The uart1 lines are made floating inputs, based on the Guardian
+        * A2 Sample Power Supply Schematics
+        */
+       {OFFSET(uart1_rxd), (MODE(7) | PULLUDDIS)},
+       {OFFSET(uart1_txd), (MODE(7) | PULLUDDIS)},
+       {-1},
+};
+
+#ifdef CONFIG_NAND
+static struct module_pin_mux nand_pin_mux[] = {
+       {OFFSET(gpmc_ad0),      (MODE(0) | PULLUDDIS | RXACTIVE)},
+       {OFFSET(gpmc_ad1),      (MODE(0) | PULLUDDIS | RXACTIVE)},
+       {OFFSET(gpmc_ad2),      (MODE(0) | PULLUDDIS | RXACTIVE)},
+       {OFFSET(gpmc_ad3),      (MODE(0) | PULLUDDIS | RXACTIVE)},
+       {OFFSET(gpmc_ad4),      (MODE(0) | PULLUDDIS | RXACTIVE)},
+       {OFFSET(gpmc_ad5),      (MODE(0) | PULLUDDIS | RXACTIVE)},
+       {OFFSET(gpmc_ad6),      (MODE(0) | PULLUDDIS | RXACTIVE)},
+       {OFFSET(gpmc_ad7),      (MODE(0) | PULLUDDIS | RXACTIVE)},
+#ifdef CONFIG_SYS_NAND_BUSWIDTH_16BIT
+       {OFFSET(gpmc_ad8),      (MODE(0) | PULLUDDIS | RXACTIVE)},
+       {OFFSET(gpmc_ad9),      (MODE(0) | PULLUDDIS | RXACTIVE)},
+       {OFFSET(gpmc_ad10),     (MODE(0) | PULLUDDIS | RXACTIVE)},
+       {OFFSET(gpmc_ad11),     (MODE(0) | PULLUDDIS | RXACTIVE)},
+       {OFFSET(gpmc_ad12),     (MODE(0) | PULLUDDIS | RXACTIVE)},
+       {OFFSET(gpmc_ad13),     (MODE(0) | PULLUDDIS | RXACTIVE)},
+       {OFFSET(gpmc_ad14),     (MODE(0) | PULLUDDIS | RXACTIVE)},
+       {OFFSET(gpmc_ad15),     (MODE(0) | PULLUDDIS | RXACTIVE)},
+#endif
+       {OFFSET(gpmc_wait0),    (MODE(0) | PULLUP_EN | RXACTIVE)},
+       {OFFSET(gpmc_wpn),      (MODE(7) | PULLUP_EN)},
+       {OFFSET(gpmc_csn0),     (MODE(0) | PULLUP_EN)},
+       {OFFSET(gpmc_wen),      (MODE(0) | PULLDOWN_EN)},
+       {OFFSET(gpmc_oen_ren),  (MODE(0) | PULLDOWN_EN)},
+       {OFFSET(gpmc_advn_ale), (MODE(0) | PULLDOWN_EN)},
+       {OFFSET(gpmc_be0n_cle), (MODE(0) | PULLDOWN_EN)},
+       {-1},
+};
+#endif
+
+void enable_uart0_pin_mux(void)
+{
+       configure_module_pin_mux(uart0_pin_mux);
+}
+
+void enable_i2c0_pin_mux(void)
+{
+       configure_module_pin_mux(i2c0_pin_mux);
+}
+
+void enable_board_pin_mux(void)
+{
+#ifdef CONFIG_NAND
+       configure_module_pin_mux(nand_pin_mux);
+#endif
+       configure_module_pin_mux(adc_voltages_en);
+       configure_module_pin_mux(asp_power_en);
+       configure_module_pin_mux(switch_off_3v6_pin_mux);
+}
index b0b29b3887f54eb69d70be2a92357561a03f2a10..e8ec553f99ef124f7be1dd6d32301d8b847a1095 100644 (file)
@@ -49,33 +49,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define CFG_MAC_ADDR_OFFSET    (flash->size - SZ_64K)
 
-#ifdef CONFIG_SPL_BUILD
-#include <ns16550.h>
-#include <dm/platform_data/spi_davinci.h>
-
-static const struct ns16550_platdata da850evm_serial = {
-       .base = DAVINCI_UART2_BASE,
-       .reg_shift = 2,
-       .clock = 150000000,
-       .fcr = UART_FCR_DEFVAL,
-};
-
-U_BOOT_DEVICE(da850evm_uart) = {
-       .name = "ns16550_serial",
-       .platdata = &da850evm_serial,
-};
-
-static const struct davinci_spi_platdata davinci_spi_data = {
-        .regs = (struct davinci_spi_regs *)0x01f0e000,
-        .num_cs = 4,
-};
-
-U_BOOT_DEVICE(davinci_spi) = {
-        .name = "davinci_spi",
-        .platdata = &davinci_spi_data,
-};
-#endif
-
 #ifdef CONFIG_MAC_ADDR_IN_SPIFLASH
 static int get_mac_addr(u8 *addr)
 {
index 7b5fab7756cb524ee545a14555cd266d83a9b499..8f04911306bc4127cea744fefcf73f9056e0630e 100644 (file)
@@ -10,6 +10,9 @@
 MEMORY { .sram : ORIGIN = IMAGE_TEXT_BASE,\
                LENGTH = CONFIG_SPL_MAX_FOOTPRINT }
 
+MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR, \
+                LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
+
 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
 OUTPUT_ARCH(arm)
 ENTRY(_start)
@@ -42,6 +45,15 @@ SECTIONS
                __rel_dyn_end = .;
        } >.sram
 
+       __image_copy_end = .;
+
+       .end :
+       {
+               *(.__end)
+       }
+
+       _image_binary_end = .;
+
        .bss :
        {
                . = ALIGN(4);
@@ -49,12 +61,5 @@ SECTIONS
                *(.bss*)
                . = ALIGN(4);
                __bss_end = .;
-       } >.sram
-
-       __image_copy_end = .;
-
-       .end :
-       {
-               *(.__end)
-       }
+       } >.sdram
 }
index 88d07d568e7f602298d972fdd26787330519fa41..cf057e7de6a20913181c07ac1241d4b8439cb9d0 100644 (file)
@@ -34,5 +34,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy
        imply BOARD_LATE_INIT
        imply OF_BOARD_SETUP
        imply SIFIVE_SERIAL
+       imply SMP
 
 endif
diff --git a/board/gardena/smart-gateway-at91sam/Kconfig b/board/gardena/smart-gateway-at91sam/Kconfig
new file mode 100644 (file)
index 0000000..ea2b5ff
--- /dev/null
@@ -0,0 +1,12 @@
+if TARGET_GARDENA_SMART_GATEWAY_AT91SAM
+
+config SYS_BOARD
+       default "smart-gateway-at91sam"
+
+config SYS_VENDOR
+       default "gardena"
+
+config SYS_CONFIG_NAME
+       default "gardena-smart-gateway-at91sam"
+
+endif
diff --git a/board/gardena/smart-gateway-at91sam/MAINTAINERS b/board/gardena/smart-gateway-at91sam/MAINTAINERS
new file mode 100644 (file)
index 0000000..a5e4c71
--- /dev/null
@@ -0,0 +1,7 @@
+GARDENA_SMART_GATEWAY_AT91SAM BOARD
+M:     Stefan Roese <sr@denx.de>
+S:     Maintained
+F:     board/gardena/smart-gateway-at91sam/
+F:     include/configs/gardena-smart-gateway-at91sam.h
+F:     configs/gardena-smart-gateway-at91sam_defconfig
+F:     arch/arm/dts/gardena-smart-gateway-at91sam.dts
diff --git a/board/gardena/smart-gateway-at91sam/Makefile b/board/gardena/smart-gateway-at91sam/Makefile
new file mode 100644 (file)
index 0000000..a2ed79f
--- /dev/null
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+obj-y += board.o
+
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o
+endif
diff --git a/board/gardena/smart-gateway-at91sam/board.c b/board/gardena/smart-gateway-at91sam/board.c
new file mode 100644 (file)
index 0000000..6a1389e
--- /dev/null
@@ -0,0 +1,59 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2012 Atmel Corporation
+ * Copyright (C) 2019 Stefan Roese <sr@denx.de>
+ */
+
+#include <common.h>
+#include <debug_uart.h>
+#include <led.h>
+#include <asm/arch/at91_common.h>
+#include <asm/arch/clk.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static void at91_prepare_cpu_var(void)
+{
+       env_set("cpu", get_cpu_name());
+}
+
+int board_late_init(void)
+{
+       at91_prepare_cpu_var();
+
+       if (IS_ENABLED(CONFIG_LED))
+               led_default_state();
+
+       return 0;
+}
+
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
+{
+       at91_seriald_hw_init();
+}
+#endif
+
+int board_early_init_f(void)
+{
+#ifdef CONFIG_DEBUG_UART
+       debug_uart_init();
+#endif
+       return 0;
+}
+
+int board_init(void)
+{
+       /* Address of boot parameters */
+       gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+
+       return 0;
+}
+
+int dram_init(void)
+{
+       gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
+                                   CONFIG_SYS_SDRAM_SIZE);
+
+       return 0;
+}
diff --git a/board/gardena/smart-gateway-at91sam/spl.c b/board/gardena/smart-gateway-at91sam/spl.c
new file mode 100644 (file)
index 0000000..3ab6760
--- /dev/null
@@ -0,0 +1,135 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2012 Atmel Corporation
+ * Copyright (C) 2019 Stefan Roese <sr@denx.de>
+ */
+
+#include <common.h>
+#include <nand.h>
+#include <spl.h>
+#include <asm/arch/at91sam9x5_matrix.h>
+#include <asm/arch/at91sam9_smc.h>
+#include <asm/arch/atmel_mpddrc.h>
+#include <asm/arch/clk.h>
+#include <asm/arch/gpio.h>
+
+static void at91sam9x5ek_nand_hw_init(void)
+{
+       struct at91_smc *smc = (struct at91_smc *)ATMEL_BASE_SMC;
+       struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX;
+       unsigned long csa;
+
+       /* Enable CS3 */
+       csa = readl(&matrix->ebicsa);
+       csa |= AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA;
+
+       /* NAND flash on D16 */
+       csa |= AT91_MATRIX_NFD0_ON_D16;
+
+       /* Configure IO drive */
+       csa &= ~AT91_MATRIX_EBI_EBI_IOSR_NORMAL;
+
+       writel(csa, &matrix->ebicsa);
+
+       /* Configure SMC CS3 for NAND/SmartMedia */
+       writel(AT91_SMC_SETUP_NWE(1) | AT91_SMC_SETUP_NCS_WR(0) |
+              AT91_SMC_SETUP_NRD(1) | AT91_SMC_SETUP_NCS_RD(0),
+              &smc->cs[3].setup);
+       writel(AT91_SMC_PULSE_NWE(3) | AT91_SMC_PULSE_NCS_WR(5) |
+              AT91_SMC_PULSE_NRD(4) | AT91_SMC_PULSE_NCS_RD(6),
+              &smc->cs[3].pulse);
+       writel(AT91_SMC_CYCLE_NWE(5) | AT91_SMC_CYCLE_NRD(6),
+              &smc->cs[3].cycle);
+       writel(AT91_SMC_MODE_RM_NRD | AT91_SMC_MODE_WM_NWE |
+              AT91_SMC_MODE_EXNW_DISABLE |
+#ifdef CONFIG_SYS_NAND_DBW_16
+              AT91_SMC_MODE_DBW_16 |
+#else /* CONFIG_SYS_NAND_DBW_8 */
+              AT91_SMC_MODE_DBW_8 |
+#endif
+              AT91_SMC_MODE_TDF_CYCLE(1),
+              &smc->cs[3].mode);
+
+       at91_periph_clk_enable(ATMEL_ID_PIOCD);
+
+       /* Configure RDY/BSY */
+       at91_set_gpio_input(CONFIG_SYS_NAND_READY_PIN, 1);
+
+       /* Enable NandFlash */
+       at91_set_gpio_output(CONFIG_SYS_NAND_ENABLE_PIN, 1);
+
+       at91_pio3_set_a_periph(AT91_PIO_PORTD, 0, 1);   /* NAND OE */
+       at91_pio3_set_a_periph(AT91_PIO_PORTD, 1, 1);   /* NAND WE */
+       at91_pio3_set_a_periph(AT91_PIO_PORTD, 2, 1);   /* NAND ALE */
+       at91_pio3_set_a_periph(AT91_PIO_PORTD, 3, 1);   /* NAND CLE */
+       at91_pio3_set_a_periph(AT91_PIO_PORTD, 6, 1);
+       at91_pio3_set_a_periph(AT91_PIO_PORTD, 7, 1);
+       at91_pio3_set_a_periph(AT91_PIO_PORTD, 8, 1);
+       at91_pio3_set_a_periph(AT91_PIO_PORTD, 9, 1);
+       at91_pio3_set_a_periph(AT91_PIO_PORTD, 10, 1);
+       at91_pio3_set_a_periph(AT91_PIO_PORTD, 11, 1);
+       at91_pio3_set_a_periph(AT91_PIO_PORTD, 12, 1);
+       at91_pio3_set_a_periph(AT91_PIO_PORTD, 13, 1);
+}
+
+void at91_spl_board_init(void)
+{
+       at91sam9x5ek_nand_hw_init();
+}
+
+static void ddr2_conf(struct atmel_mpddrc_config *ddr2)
+{
+       ddr2->md = (ATMEL_MPDDRC_MD_DBW_16_BITS | ATMEL_MPDDRC_MD_DDR2_SDRAM);
+
+       ddr2->cr = (ATMEL_MPDDRC_CR_NC_COL_10 |
+                   ATMEL_MPDDRC_CR_NR_ROW_13 |
+                   ATMEL_MPDDRC_CR_CAS_DDR_CAS3 |
+                   ATMEL_MPDDRC_CR_NB_8BANKS |
+                   ATMEL_MPDDRC_CR_DECOD_INTERLEAVED);
+
+       ddr2->rtr = 0x411;
+
+       ddr2->tpr0 = (6 << ATMEL_MPDDRC_TPR0_TRAS_OFFSET |
+                     2 << ATMEL_MPDDRC_TPR0_TRCD_OFFSET |
+                     2 << ATMEL_MPDDRC_TPR0_TWR_OFFSET |
+                     8 << ATMEL_MPDDRC_TPR0_TRC_OFFSET |
+                     2 << ATMEL_MPDDRC_TPR0_TRP_OFFSET |
+                     2 << ATMEL_MPDDRC_TPR0_TRRD_OFFSET |
+                     2 << ATMEL_MPDDRC_TPR0_TWTR_OFFSET |
+                     2 << ATMEL_MPDDRC_TPR0_TMRD_OFFSET);
+
+       ddr2->tpr1 = (2 << ATMEL_MPDDRC_TPR1_TXP_OFFSET |
+                     200 << ATMEL_MPDDRC_TPR1_TXSRD_OFFSET |
+                     19 << ATMEL_MPDDRC_TPR1_TXSNR_OFFSET |
+                     18 << ATMEL_MPDDRC_TPR1_TRFC_OFFSET);
+
+       ddr2->tpr2 = (7 << ATMEL_MPDDRC_TPR2_TFAW_OFFSET |
+                     2 << ATMEL_MPDDRC_TPR2_TRTP_OFFSET |
+                     3 << ATMEL_MPDDRC_TPR2_TRPA_OFFSET |
+                     7 << ATMEL_MPDDRC_TPR2_TXARDS_OFFSET |
+                     2 << ATMEL_MPDDRC_TPR2_TXARD_OFFSET);
+}
+
+void mem_init(void)
+{
+       struct at91_matrix *matrix = (struct at91_matrix *)ATMEL_BASE_MATRIX;
+       struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+       struct atmel_mpddrc_config ddr2;
+       unsigned long csa;
+
+       ddr2_conf(&ddr2);
+
+       /* Enable DDR2 clock */
+       writel(AT91_PMC_DDR, &pmc->scer);
+
+       /* Chip select 1 is for DDR2/SDRAM */
+       csa = readl(&matrix->ebicsa);
+       csa |= AT91_MATRIX_EBI_CS1A_SDRAMC;
+       csa &= ~AT91_MATRIX_EBI_DBPU_OFF;
+       csa |= AT91_MATRIX_EBI_DBPD_OFF;
+       csa |= AT91_MATRIX_EBI_EBI_IOSR_NORMAL;
+       writel(csa, &matrix->ebicsa);
+
+       /* DDRAM2 Controller initialize */
+       ddr2_init(ATMEL_BASE_DDRSDRC, ATMEL_BASE_CS1, &ddr2);
+}
index 6f728398c38dff1c6b8301574b2c9e6fb0cc225b..10031a48018fc9b13960fe0094756a0ee6b2ac78 100644 (file)
@@ -37,6 +37,15 @@ DECLARE_GLOBAL_DATA_PTR;
 #define CPGMACSS_SW_RST                (1 << 1)
 #define PHY_GPIO               30
 
+#if defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_SPL_OS_BOOT)
+int spl_start_uboot(void)
+{
+       /* break into full u-boot on 'c' */
+       return serial_tstc() && serial_getc() == 'c';
+}
+#endif
+#endif
 
 /*
  * Routine: board_init
index e8f8f7ba5b4775826ec4a190f46f74804f50625e..395904f8c87861648c214156c785736c6812e0f4 100644 (file)
@@ -95,7 +95,7 @@ MV_DRAM_MODES *ddr3_get_static_ddr_mode(void)
        return &maxbcm_ddr_modes[0];
 }
 
-MV_BIN_SERDES_CFG *board_serdes_cfg_get(u8 pex_mode)
+MV_BIN_SERDES_CFG *board_serdes_cfg_get(void)
 {
        return &maxbcm_serdes_cfg[0];
 }
index 1129f4bf0c08b4d8369eccb795e74e6a1b519371..1ce6e2eac1bf5f47ea78b04ea76a966833fb21d3 100644 (file)
@@ -8,57 +8,4 @@
  */
 
 #include <common.h>
-#include <asm/io.h>
-#include <asm/arch/sys_proto.h>
 #include <asm/arch/rmobile.h>
-#include <asm/arch/rcar-mstp.h>
-
-#define TSTR0          0x04
-#define TSTR0_STR0     0x01
-
-static struct mstp_ctl mstptbl[] = {
-       { SMSTPCR0, MSTP0_BITS, CONFIG_SMSTP0_ENA,
-               RMSTPCR0, MSTP0_BITS, CONFIG_RMSTP0_ENA },
-       { SMSTPCR1, MSTP1_BITS, CONFIG_SMSTP1_ENA,
-               RMSTPCR1, MSTP1_BITS, CONFIG_RMSTP1_ENA },
-       { SMSTPCR2, MSTP2_BITS, CONFIG_SMSTP2_ENA,
-               RMSTPCR2, MSTP2_BITS, CONFIG_RMSTP2_ENA },
-       { SMSTPCR3, MSTP3_BITS, CONFIG_SMSTP3_ENA,
-               RMSTPCR3, MSTP3_BITS, CONFIG_RMSTP3_ENA },
-       { SMSTPCR4, MSTP4_BITS, CONFIG_SMSTP4_ENA,
-               RMSTPCR4, MSTP4_BITS, CONFIG_RMSTP4_ENA },
-       { SMSTPCR5, MSTP5_BITS, CONFIG_SMSTP5_ENA,
-               RMSTPCR5, MSTP5_BITS, CONFIG_RMSTP5_ENA },
-#ifdef CONFIG_RCAR_GEN3
-       { SMSTPCR6, MSTP6_BITS, CONFIG_SMSTP6_ENA,
-               RMSTPCR6, MSTP6_BITS, CONFIG_RMSTP6_ENA },
-#endif
-       { SMSTPCR7, MSTP7_BITS, CONFIG_SMSTP7_ENA,
-               RMSTPCR7, MSTP7_BITS, CONFIG_RMSTP7_ENA },
-       { SMSTPCR8, MSTP8_BITS, CONFIG_SMSTP8_ENA,
-               RMSTPCR8, MSTP8_BITS, CONFIG_RMSTP8_ENA },
-       { SMSTPCR9, MSTP9_BITS, CONFIG_SMSTP9_ENA,
-               RMSTPCR9, MSTP9_BITS, CONFIG_RMSTP9_ENA },
-       { SMSTPCR10, MSTP10_BITS, CONFIG_SMSTP10_ENA,
-                RMSTPCR10, MSTP10_BITS, CONFIG_RMSTP10_ENA },
-       { SMSTPCR11, MSTP11_BITS, CONFIG_SMSTP1_ENA,
-                RMSTPCR11, MSTP11_BITS, CONFIG_RMSTP11_ENA },
-};
-
-void arch_preboot_os(void)
-{
-       int i;
-
-       /* stop TMU0 */
-       mstp_clrbits_le32(TMU_BASE + TSTR0, TMU_BASE + TSTR0, TSTR0_STR0);
-
-       /* Stop module clock */
-       for (i = 0; i < ARRAY_SIZE(mstptbl); i++) {
-               mstp_setclrbits_le32((uintptr_t)mstptbl[i].s_addr,
-                                    mstptbl[i].s_dis,
-                                    mstptbl[i].s_ena);
-               mstp_setclrbits_le32((uintptr_t)mstptbl[i].r_addr,
-                                    mstptbl[i].r_dis,
-                                    mstptbl[i].r_ena);
-       }
-}
index e7cdc5217fb1b1ee37cb5c6d5142b297e6fefdc2..8549f543f481d2efaca5d2471e7daafed12501f0 100644 (file)
@@ -5,3 +5,4 @@ F:      board/renesas/ulcb/
 F:     include/configs/ulcb.h
 F:     configs/r8a7795_ulcb_defconfig
 F:     configs/r8a7796_ulcb_defconfig
+F:     configs/r8a77965_ulcb_defconfig
index 81d6f8f6f20772518ad64376f74c02a567be815d..9785107e56bba5f197dbe735e6d1ab89e38fadca 100644 (file)
@@ -97,6 +97,10 @@ int board_fit_config_name_match(const char *name)
            !strcmp(name, "r8a7796-m3ulcb-u-boot"))
                return 0;
 
+       if ((cpu_type == RMOBILE_CPU_TYPE_R8A77965) &&
+           !strcmp(name, "r8a77965-m3nulcb-u-boot"))
+               return 0;
+
        return -1;
 }
 #endif
index 17e520a9e96356d49db3f5d85eb1aaf55978159b..c5d28c61e2d714dc91375e2ee6fa95ffe704ceae 100644 (file)
@@ -124,7 +124,7 @@ int board_init(void)
        /* arch number of AT91SAM9M10G45EK-Board */
        gd->bd->bi_arch_number = MACH_TYPE_PM9G45;
        /* adress of boot parameters */
-       gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
+       gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
 #ifdef CONFIG_CMD_NAND
        pm9g45_nand_hw_init();
@@ -139,15 +139,15 @@ int board_init(void)
 int dram_init(void)
 {
        /* dram_init must store complete ramsize in gd->ram_size */
-       gd->ram_size = get_ram_size((void *)PHYS_SDRAM,
-                               PHYS_SDRAM_SIZE);
+       gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE,
+                                   CONFIG_SYS_SDRAM_SIZE);
        return 0;
 }
 
 int dram_init_banksize(void)
 {
-       gd->bd->bi_dram[0].start = PHYS_SDRAM;
-       gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
+       gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
+       gd->bd->bi_dram[0].size = CONFIG_SYS_SDRAM_SIZE;
 
        return 0;
 }
index 6be3d881446313f3de0c9bc5b2d20fba04797689..f46437901d129fc4bb1e108ff4988354fb02540f 100644 (file)
@@ -38,5 +38,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy
        imply PHY_LIB
        imply PHY_MSCC
        imply SIFIVE_SERIAL
+       imply SMP
 
 endif
index a7bc0d4e23fbe5946edd448830bc476e5ddd72a6..0b0e98de90a0b8905efe922b74d795b6ccf9780a 100644 (file)
@@ -17,6 +17,29 @@ $ sudo dd if=u-boot-spl.kwb of=/dev/sdX bs=512 seek=1
 Please use the correct device node for your setup instead
 of "/dev/sdX" here!
 
+Install U-Boot on eMMC:
+-----------------------
+
+The ROM loads the bootloader from eMMC first boot partition at offset 0. This
+is unlike load from SD card that is at offset 512. As a result, the offset of
+the main U-Boot image on the eMMC boot partition changes. Set
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR to 0x140 for SPL to load U-Boot from
+the correct location.
+
+To make SPL load the main U-Boot image from the eMMC boot partition enable
+eMMC boot acknowledgement and boot partition with the following U-Boot
+command:
+
+  mmc partconf 0 1 1 0
+
+Install U-Boot on eMMC boot partition from Linux running on Clearfog:
+
+  echo 0 > /sys/block/mmcblk0boot0/force_ro
+  dd if=u-boot-spl.kwb of=/dev/mmcblk0boot0
+
+Note that the SD card is not accessible when the Clearfog SOM has eMMC.
+Consider initial boot from UART (see below).
+
 Boot selection:
 ---------------
 
index dd6def5e6e7910aea9d1ea0b96fbfcb5f6a4797a..d42350319cc4f2c9905443a143135a4c191ffc3c 100644 (file)
@@ -1,11 +1,15 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright (C) 2015-2016 Stefan Roese <sr@denx.de>
+ * Copyright (C) 2015-2019 Stefan Roese <sr@denx.de>
  */
 
 #include <common.h>
+#include <console.h>
 #include <i2c.h>
 #include <pci.h>
+#if !defined(CONFIG_SPL_BUILD)
+#include <bootcount.h>
+#endif
 #include <asm/gpio.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
@@ -42,6 +46,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #define STM_I2C_BUS    1
 #define STM_I2C_ADDR   0x27
 #define REBOOT_DELAY   1000            /* reboot-delay in ms */
+#define ABORT_TIMEOUT  3000            /* 3 seconds reboot abort timeout */
 
 /* DDR3 static configuration */
 static MV_DRAM_MC_INIT ddr3_theadorable[MV_MAX_DDR3_STATIC_SIZE] = {
@@ -127,15 +132,15 @@ MV_DRAM_MODES *ddr3_get_static_ddr_mode(void)
        return &board_ddr_modes[0];
 }
 
-MV_BIN_SERDES_CFG *board_serdes_cfg_get(u8 pex_mode)
+MV_BIN_SERDES_CFG *board_serdes_cfg_get(void)
 {
        return &theadorable_serdes_cfg[0];
 }
 
 u8 board_sat_r_get(u8 dev_num, u8 reg)
 {
-       /* Bit 0 enables PCI 2.0 link capabilities instead of PCI 1.x */
-       return 0x01;
+       /* Bit x enables PCI 2.0 link capabilities instead of PCI 1.x */
+       return 0xe;     /* PEX port 0 is PCIe Gen1, PEX port 1..3 PCIe Gen2 */
 }
 
 int board_early_init_f(void)
@@ -218,7 +223,7 @@ int board_eth_init(bd_t *bis)
 }
 #endif
 
-#ifdef CONFIG_BOARD_LATE_INIT
+#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_BOARD_LATE_INIT)
 int board_late_init(void)
 {
        pci_dev_t bdf;
@@ -232,6 +237,7 @@ int board_late_init(void)
         */
        bdf = pci_find_device(PCI_VENDOR_ID_PLX, 0x8619, 0);
        if (bdf == -1) {
+               unsigned long start_time = get_timer(0);
                u8 i2c_buf[8];
                int ret;
 
@@ -239,6 +245,28 @@ int board_late_init(void)
                bootcount = bootcount_load();
                printf("Failed to find PLX PEX-switch (bootcount=%ld)\n",
                       bootcount);
+
+               /*
+                * The user can exit this boot-loop in the error case by
+                * hitting Ctrl-C. So wait some time for this key here.
+                */
+               printf("Continue booting with Ctrl-C, otherwise rebooting\n");
+               do {
+                       /* Handle control-c and timeouts */
+                       if (ctrlc()) {
+                               printf("PEX error boot-loop aborted!\n");
+                               return 0;
+                       }
+               } while (get_timer(start_time) < ABORT_TIMEOUT);
+
+
+               /*
+                * At this stage the bootcounter has not been incremented
+                * yet. We need to do this manually here to get an actually
+                * working bootcounter in this error case.
+                */
+               bootcount_inc();
+
                if (bootcount > PEX_SWITCH_NOT_FOUNT_LIMIT) {
                        printf("Issuing power-switch via uC!\n");
 
index d67f94ad47baec593946f51f4beffe9384915af8..2c32b92d940667916250585ca34b976cc51a562c 100644 (file)
@@ -875,157 +875,55 @@ int board_late_init(void)
 }
 #endif
 
-#ifndef CONFIG_DM_ETH
-
-#if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \
-       (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD))
-static void cpsw_control(int enabled)
-{
-       /* VTP can be added here */
-
-       return;
-}
-
-static struct cpsw_slave_data cpsw_slaves[] = {
+/* CPSW platdata */
+#if !CONFIG_IS_ENABLED(OF_CONTROL)
+struct cpsw_slave_data slave_data[] = {
        {
-               .slave_reg_ofs  = 0x208,
-               .sliver_reg_ofs = 0xd80,
-               .phy_addr       = 0,
+               .slave_reg_ofs  = CPSW_SLAVE0_OFFSET,
+               .sliver_reg_ofs = CPSW_SLIVER0_OFFSET,
+               .phy_addr       = 0,
        },
        {
-               .slave_reg_ofs  = 0x308,
-               .sliver_reg_ofs = 0xdc0,
-               .phy_addr       = 1,
+               .slave_reg_ofs  = CPSW_SLAVE1_OFFSET,
+               .sliver_reg_ofs = CPSW_SLIVER1_OFFSET,
+               .phy_addr       = 1,
        },
 };
 
-static struct cpsw_platform_data cpsw_data = {
-       .mdio_base              = CPSW_MDIO_BASE,
+struct cpsw_platform_data am335_eth_data = {
        .cpsw_base              = CPSW_BASE,
-       .mdio_div               = 0xff,
+       .version                = CPSW_CTRL_VERSION_2,
+       .bd_ram_ofs             = CPSW_BD_OFFSET,
+       .ale_reg_ofs            = CPSW_ALE_OFFSET,
+       .cpdma_reg_ofs          = CPSW_CPDMA_OFFSET,
+       .mdio_div               = CPSW_MDIO_DIV,
+       .host_port_reg_ofs      = CPSW_HOST_PORT_OFFSET,
        .channels               = 8,
-       .cpdma_reg_ofs          = 0x800,
-       .slaves                 = 1,
-       .slave_data             = cpsw_slaves,
-       .ale_reg_ofs            = 0xd00,
+       .slaves                 = 2,
+       .slave_data             = slave_data,
        .ale_entries            = 1024,
-       .host_port_reg_ofs      = 0x108,
-       .hw_stats_reg_ofs       = 0x900,
        .bd_ram_ofs             = 0x2000,
-       .mac_control            = (1 << 5),
-       .control                = cpsw_control,
-       .host_port_num          = 0,
-       .version                = CPSW_CTRL_VERSION_2,
+       .mac_control            = 0x20,
+       .active_slave           = 0,
+       .mdio_base              = 0x4a101000,
+       .gmii_sel               = 0x44e10650,
+       .phy_sel_compat         = "ti,am3352-cpsw-phy-sel",
+       .syscon_addr            = 0x44e10630,
+       .macid_sel_compat       = "cpsw,am33xx",
 };
-#endif
-
-#if ((defined(CONFIG_SPL_ETH_SUPPORT) || defined(CONFIG_SPL_USB_ETHER)) &&\
-       defined(CONFIG_SPL_BUILD)) || \
-       ((defined(CONFIG_DRIVER_TI_CPSW) || \
-         defined(CONFIG_USB_ETHER) && defined(CONFIG_MUSB_GADGET)) && \
-        !defined(CONFIG_SPL_BUILD))
 
-/*
- * This function will:
- * Read the eFuse for MAC addresses, and set ethaddr/eth1addr/usbnet_devaddr
- * in the environment
- * Perform fixups to the PHY present on certain boards.  We only need this
- * function in:
- * - SPL with either CPSW or USB ethernet support
- * - Full U-Boot, with either CPSW or USB ethernet
- * Build in only these cases to avoid warnings about unused variables
- * when we build an SPL that has neither option but full U-Boot will.
- */
-int board_eth_init(bd_t *bis)
-{
-       int rv, n = 0;
-#if defined(CONFIG_USB_ETHER) && \
-       (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_USB_ETHER))
-       uint8_t mac_addr[6];
-       uint32_t mac_hi, mac_lo;
-
-       /*
-        * use efuse mac address for USB ethernet as we know that
-        * both CPSW and USB ethernet will never be active at the same time
-        */
-       mac_lo = readl(&cdev->macid0l);
-       mac_hi = readl(&cdev->macid0h);
-       mac_addr[0] = mac_hi & 0xFF;
-       mac_addr[1] = (mac_hi & 0xFF00) >> 8;
-       mac_addr[2] = (mac_hi & 0xFF0000) >> 16;
-       mac_addr[3] = (mac_hi & 0xFF000000) >> 24;
-       mac_addr[4] = mac_lo & 0xFF;
-       mac_addr[5] = (mac_lo & 0xFF00) >> 8;
-#endif
-
-
-#if (defined(CONFIG_DRIVER_TI_CPSW) && !defined(CONFIG_SPL_BUILD)) || \
-       (defined(CONFIG_SPL_ETH_SUPPORT) && defined(CONFIG_SPL_BUILD))
-
-#ifdef CONFIG_DRIVER_TI_CPSW
-       if (board_is_bone() || board_is_bone_lt() || board_is_bben() ||
-           board_is_idk()) {
-               writel(MII_MODE_ENABLE, &cdev->miisel);
-               cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if =
-                               PHY_INTERFACE_MODE_MII;
-       } else if (board_is_icev2()) {
-               writel(RMII_MODE_ENABLE | RMII_CHIPCKL_ENABLE, &cdev->miisel);
-               cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RMII;
-               cpsw_slaves[1].phy_if = PHY_INTERFACE_MODE_RMII;
-               cpsw_slaves[0].phy_addr = 1;
-               cpsw_slaves[1].phy_addr = 3;
-       } else {
-               writel((RGMII_MODE_ENABLE | RGMII_INT_DELAY), &cdev->miisel);
-               cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if =
-                               PHY_INTERFACE_MODE_RGMII;
-       }
-
-       rv = cpsw_register(&cpsw_data);
-       if (rv < 0)
-               printf("Error %d registering CPSW switch\n", rv);
-       else
-               n += rv;
-#endif
+struct eth_pdata cpsw_pdata = {
+       .iobase = 0x4a100000,
+       .phy_interface = 0,
+       .priv_pdata = &am335_eth_data,
+};
 
-       /*
-        *
-        * CPSW RGMII Internal Delay Mode is not supported in all PVT
-        * operating points.  So we must set the TX clock delay feature
-        * in the AR8051 PHY.  Since we only support a single ethernet
-        * device in U-Boot, we only do this for the first instance.
-        */
-#define AR8051_PHY_DEBUG_ADDR_REG      0x1d
-#define AR8051_PHY_DEBUG_DATA_REG      0x1e
-#define AR8051_DEBUG_RGMII_CLK_DLY_REG 0x5
-#define AR8051_RGMII_TX_CLK_DLY                0x100
-
-       if (board_is_evm_sk() || board_is_gp_evm() || board_is_bben()) {
-               const char *devname;
-               devname = miiphy_get_current_dev();
-
-               miiphy_write(devname, 0x0, AR8051_PHY_DEBUG_ADDR_REG,
-                               AR8051_DEBUG_RGMII_CLK_DLY_REG);
-               miiphy_write(devname, 0x0, AR8051_PHY_DEBUG_DATA_REG,
-                               AR8051_RGMII_TX_CLK_DLY);
-       }
-#endif
-#if defined(CONFIG_USB_ETHER) && \
-       (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_USB_ETHER))
-       if (is_valid_ethaddr(mac_addr))
-               eth_env_set_enetaddr("usbnet_devaddr", mac_addr);
-
-       rv = usb_eth_initialize(bis);
-       if (rv < 0)
-               printf("Error %d registering USB_ETHER\n", rv);
-       else
-               n += rv;
-#endif
-       return n;
-}
+U_BOOT_DEVICE(am335x_eth) = {
+       .name = "eth_cpsw",
+       .platdata = &cpsw_pdata,
+};
 #endif
 
-#endif /* CONFIG_DM_ETH */
-
 #ifdef CONFIG_SPL_LOAD_FIT
 int board_fit_config_name_match(const char *name)
 {
index 784b2b0191d49e3e9adae36cc04d593638f293ae..52f5d6b11e3a7a2b797afc01a50993d15a67d533 100644 (file)
@@ -10,6 +10,7 @@
 #include <common.h>
 #include <asm/io.h>
 #include <spl.h>
+#include <asm/arch/sys_proto.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -66,3 +67,16 @@ int board_fit_config_name_match(const char *name)
        return -1;
 }
 #endif
+
+#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
+int ft_board_setup(void *blob, bd_t *bd)
+{
+       int ret;
+
+       ret = fdt_fixup_msmc_ram(blob, "/interconnect@100000", "sram@70000000");
+       if (ret)
+               printf("%s: fixing up msmc ram failed %d\n", __func__, ret);
+
+       return ret;
+}
+#endif
index 060c47103261da9a209d395812d57dd27b3096cf..179adc2fff0ec97eb07abc120346a56128485600 100644 (file)
@@ -27,6 +27,7 @@
 #include <environment.h>
 #include <dwc3-uboot.h>
 #include <dwc3-omap-uboot.h>
+#include <i2c.h>
 #include <ti-usb-phy-uboot.h>
 #include <miiphy.h>
 
@@ -55,6 +56,10 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define SYSINFO_BOARD_NAME_MAX_LEN     37
 
+/* I2C I/O Expander */
+#define NAND_PCF8575_ADDR      0x21
+#define NAND_PCF8575_I2C_BUS_NUM       0
+
 const struct omap_sysinfo sysinfo = {
        "Board: UNKNOWN(DRA7 EVM) REV UNKNOWN\n"
 };
@@ -777,6 +782,44 @@ void set_muxconf_regs(void)
                     early_padconf, ARRAY_SIZE(early_padconf));
 }
 
+#if defined(CONFIG_NAND)
+static int nand_sw_detect(void)
+{
+       int rc;
+       uchar data[2];
+       struct udevice *dev;
+
+       rc = i2c_get_chip_for_busnum(NAND_PCF8575_I2C_BUS_NUM,
+                                    NAND_PCF8575_ADDR, 0, &dev);
+       if (rc)
+               return -1;
+
+       rc = dm_i2c_read(dev, 0, (uint8_t *)&data, sizeof(data));
+       if (rc)
+               return -1;
+
+       /* We are only interested in P10 and P11 on PCF8575 which is equal to
+        * bits 8 and 9.
+        */
+       data[1] = data[1] & 0x3;
+
+       /* Ensure only P11 is set and P10 is cleared. This ensures only
+        * NAND (P10) is configured and not NOR (P11) which are both low
+        * true signals. NAND and NOR settings should not be enabled at
+        * the same time.
+        */
+       if (data[1] == 0x2)
+               return 0;
+
+       return -1;
+}
+#else
+int nand_sw_detect(void)
+{
+       return -1;
+}
+#endif
+
 #ifdef CONFIG_IODELAY_RECALIBRATION
 void recalibrate_iodelay(void)
 {
@@ -796,6 +839,19 @@ void recalibrate_iodelay(void)
                        npads = ARRAY_SIZE(dra71x_core_padconf_array);
                        iodelay = dra71_iodelay_cfg_array;
                        niodelays = ARRAY_SIZE(dra71_iodelay_cfg_array);
+                       /* If SW8 on the EVM is set to enable NAND then
+                        * overwrite the pins used by VOUT3 with NAND.
+                        */
+                       if (!nand_sw_detect()) {
+                               delta_pads = dra71x_nand_padconf_array;
+                               delta_npads =
+                                       ARRAY_SIZE(dra71x_nand_padconf_array);
+                       } else {
+                               delta_pads = dra71x_vout3_padconf_array;
+                               delta_npads =
+                                       ARRAY_SIZE(dra71x_vout3_padconf_array);
+                       }
+
                } else if (board_is_dra72x_revc_or_later()) {
                        delta_pads = dra72x_rgmii_padconf_array_revc;
                        delta_npads =
index f1f6bd5316757168933844ef57a861e134ce5e96..75da5cb608f5a6aa6d7b6f29dcf6eaf2ebe3678f 100644 (file)
@@ -220,22 +220,6 @@ const struct pad_conf_entry dra72x_rgmii_padconf_array_revc[] = {
 };
 
 const struct pad_conf_entry dra71x_core_padconf_array[] = {
-       {GPMC_AD0, (M3 | PIN_INPUT)},   /* gpmc_ad0.vout3_d0 */
-       {GPMC_AD1, (M3 | PIN_INPUT)},   /* gpmc_ad1.vout3_d1 */
-       {GPMC_AD2, (M3 | PIN_INPUT)},   /* gpmc_ad2.vout3_d2 */
-       {GPMC_AD3, (M3 | PIN_INPUT)},   /* gpmc_ad3.vout3_d3 */
-       {GPMC_AD4, (M3 | PIN_INPUT)},   /* gpmc_ad4.vout3_d4 */
-       {GPMC_AD5, (M3 | PIN_INPUT)},   /* gpmc_ad5.vout3_d5 */
-       {GPMC_AD6, (M3 | PIN_INPUT)},   /* gpmc_ad6.vout3_d6 */
-       {GPMC_AD7, (M3 | PIN_INPUT)},   /* gpmc_ad7.vout3_d7 */
-       {GPMC_AD8, (M3 | PIN_INPUT)},   /* gpmc_ad8.vout3_d8 */
-       {GPMC_AD9, (M3 | PIN_INPUT)},   /* gpmc_ad9.vout3_d9 */
-       {GPMC_AD10, (M3 | PIN_INPUT)},  /* gpmc_ad10.vout3_d10 */
-       {GPMC_AD11, (M3 | PIN_INPUT)},  /* gpmc_ad11.vout3_d11 */
-       {GPMC_AD12, (M3 | PIN_INPUT)},  /* gpmc_ad12.vout3_d12 */
-       {GPMC_AD13, (M3 | PIN_INPUT)},  /* gpmc_ad13.vout3_d13 */
-       {GPMC_AD14, (M3 | PIN_INPUT)},  /* gpmc_ad14.vout3_d14 */
-       {GPMC_AD15, (M3 | PIN_INPUT)},  /* gpmc_ad15.vout3_d15 */
        {GPMC_A0, (M3 | PIN_INPUT_PULLDOWN)},   /* gpmc_a0.vout3_d16 */
        {GPMC_A1, (M3 | PIN_INPUT_PULLDOWN)},   /* gpmc_a1.vout3_d17 */
        {GPMC_A2, (M3 | PIN_INPUT_PULLDOWN)},   /* gpmc_a2.vout3_d18 */
@@ -370,6 +354,50 @@ const struct pad_conf_entry dra71x_core_padconf_array[] = {
        {WAKEUP3, (M1 | PULL_ENA | PULL_UP)},   /* Wakeup3.sys_nirq1 */
 };
 
+const struct pad_conf_entry dra71x_vout3_padconf_array[] = {
+       {GPMC_AD0, (M3 | PIN_INPUT)},   /* gpmc_ad0.vout3_d0 */
+       {GPMC_AD1, (M3 | PIN_INPUT)},   /* gpmc_ad1.vout3_d1 */
+       {GPMC_AD2, (M3 | PIN_INPUT)},   /* gpmc_ad2.vout3_d2 */
+       {GPMC_AD3, (M3 | PIN_INPUT)},   /* gpmc_ad3.vout3_d3 */
+       {GPMC_AD4, (M3 | PIN_INPUT)},   /* gpmc_ad4.vout3_d4 */
+       {GPMC_AD5, (M3 | PIN_INPUT)},   /* gpmc_ad5.vout3_d5 */
+       {GPMC_AD6, (M3 | PIN_INPUT)},   /* gpmc_ad6.vout3_d6 */
+       {GPMC_AD7, (M3 | PIN_INPUT)},   /* gpmc_ad7.vout3_d7 */
+       {GPMC_AD8, (M3 | PIN_INPUT)},   /* gpmc_ad8.vout3_d8 */
+       {GPMC_AD9, (M3 | PIN_INPUT)},   /* gpmc_ad9.vout3_d9 */
+       {GPMC_AD10, (M3 | PIN_INPUT)},  /* gpmc_ad10.vout3_d10 */
+       {GPMC_AD11, (M3 | PIN_INPUT)},  /* gpmc_ad11.vout3_d11 */
+       {GPMC_AD12, (M3 | PIN_INPUT)},  /* gpmc_ad12.vout3_d12 */
+       {GPMC_AD13, (M3 | PIN_INPUT)},  /* gpmc_ad13.vout3_d13 */
+       {GPMC_AD14, (M3 | PIN_INPUT)},  /* gpmc_ad14.vout3_d14 */
+       {GPMC_AD15, (M3 | PIN_INPUT)},  /* gpmc_ad15.vout3_d15 */
+};
+
+const struct pad_conf_entry dra71x_nand_padconf_array[] = {
+       {GPMC_AD0, (M0 | PIN_INPUT)},   /* gpmc_ad0.gpmc_ad0 */
+       {GPMC_AD1, (M0 | PIN_INPUT)},   /* gpmc_ad1.gpmc_ad1 */
+       {GPMC_AD2, (M0 | PIN_INPUT)},   /* gpmc_ad2.gpmc_ad2 */
+       {GPMC_AD3, (M0 | PIN_INPUT)},   /* gpmc_ad3.gpmc_ad3 */
+       {GPMC_AD4, (M0 | PIN_INPUT)},   /* gpmc_ad4.gpmc_ad4 */
+       {GPMC_AD5, (M0 | PIN_INPUT)},   /* gpmc_ad5.gpmc_ad5 */
+       {GPMC_AD6, (M0 | PIN_INPUT)},   /* gpmc_ad6.gpmc_ad6 */
+       {GPMC_AD7, (M0 | PIN_INPUT)},   /* gpmc_ad7.gpmc_ad7 */
+       {GPMC_AD8, (M0 | PIN_INPUT)},   /* gpmc_ad8.gpmc_ad8 */
+       {GPMC_AD9, (M0 | PIN_INPUT)},   /* gpmc_ad9.gpmc_ad9 */
+       {GPMC_AD10, (M0 | PIN_INPUT)},  /* gpmc_ad10.gpmc_ad10 */
+       {GPMC_AD11, (M0 | PIN_INPUT)},  /* gpmc_ad11.gpmc_ad11 */
+       {GPMC_AD12, (M0 | PIN_INPUT)},  /* gpmc_ad12.gpmc_ad12 */
+       {GPMC_AD13, (M0 | PIN_INPUT)},  /* gpmc_ad13.gpmc_ad13 */
+       {GPMC_AD14, (M0 | PIN_INPUT)},  /* gpmc_ad14.gpmc_ad14 */
+       {GPMC_AD15, (M0 | PIN_INPUT)},  /* gpmc_ad15.gpmc_ad15 */
+       {GPMC_CS0, (M0 | PIN_INPUT_PULLUP)},    /* gpmc_cs0.gpmc_cs0 */
+       {GPMC_ADVN_ALE, (M0 | PIN_INPUT_PULLDOWN)},     /* gpmc_advn_ale.gpmc_advn_ale */
+       {GPMC_OEN_REN, (M0 | PIN_INPUT_PULLUP)},        /* gpmc_oen_ren.gpmc_oen_ren */
+       {GPMC_WEN, (M0 | PIN_INPUT_PULLUP)},    /* gpmc_wen.gpmc_wen */
+       {GPMC_BEN0, (M0 | PIN_INPUT_PULLDOWN)}, /* gpmc_ben0.gpmc_ben0 */
+       {GPMC_WAIT0, (M0 | PIN_INPUT_PULLUP | SLEWCONTROL)},    /* gpmc_wait0.gpmc_wait0 */
+};
+
 const struct pad_conf_entry early_padconf[] = {
        {UART1_RXD, (PIN_INPUT_SLEW | M0)}, /* UART1_RXD */
        {UART1_TXD, (PIN_INPUT_SLEW | M0)}, /* UART1_TXD */
index 39a782e47960ee13412e2864cdef788c8d5b3c9c..6d0fc21c67acc29f05b411fd608633a327ed0de4 100644 (file)
@@ -315,6 +315,21 @@ int embedded_dtb_select(void)
                             BIT(9));
                setbits_le32(K2G_GPIO1_BANK2_BASE + K2G_GPIO_SETDATA_OFFSET,
                             BIT(9));
+       } else if (board_is_k2g_ice()) {
+               /* GBE Phy workaround. For Phy to latch the input
+                * configuration, a GPIO reset is asserted at the
+                * Phy reset pin to latch configuration correctly after SoC
+                * reset. GPIO0 Pin 10 (Ball AA20) is used for this on ICE
+                * board. Just do a low to high transition.
+                */
+               clrbits_le32(K2G_GPIO0_BANK0_BASE + K2G_GPIO_DIR_OFFSET,
+                            BIT(10));
+               setbits_le32(K2G_GPIO0_BANK0_BASE + K2G_GPIO_CLRDATA_OFFSET,
+                            BIT(10));
+               /* Delay just to get a transition to high */
+               udelay(100);
+               setbits_le32(K2G_GPIO0_BANK0_BASE + K2G_GPIO_SETDATA_OFFSET,
+                            BIT(10));
        }
 
        return 0;
index 706fb7e83817a126c44d8d92424e01389d05e238..89c49f9e4fcde8ee42e309fe2ba37643bc4252a7 100644 (file)
@@ -125,21 +125,23 @@ struct pin_cfg k2g_evm_pin_cfg[] = {
        { 70,   MODE(0) },      /* SOC_MMC1_SDWP */
        { 71,   MODE(0) },      /* MMC1POW TP124 */
 
-       /* RGMII */
-       { 72,   MODE(1) | PIN_IEN },    /* SOC_RGMII_RXCLK */
-       { 77,   MODE(1) | PIN_IEN },    /* SOC_RGMII_RXD3 */
-       { 78,   MODE(1) | PIN_IEN },    /* SOC_RGMII_RXD2 */
-       { 79,   MODE(1) | PIN_IEN },    /* SOC_RGMII_RXD1 */
-       { 80,   MODE(1) | PIN_IEN },    /* SOC_RGMII_RXD0 */
-       { 81,   MODE(1) | PIN_IEN },    /* SOC_RGMII_RXCTL */
-       { 85,   MODE(1) },      /* SOC_RGMII_TXCLK */
-       { 91,   MODE(1) },      /* SOC_RGMII_TXD3 */
-       { 92,   MODE(1) },      /* SOC_RGMII_TXD2 */
-       { 93,   MODE(1) },      /* SOC_RGMII_TXD1 */
-       { 94,   MODE(1) },      /* SOC_RGMII_TXD0 */
-       { 95,   MODE(1) },      /* SOC_RGMII_TXCTL */
-       { 98,   MODE(0) },      /* SOC_MDIO_DATA */
-       { 99,   MODE(0) },      /* SOC_MDIO_CLK */
+               /* EMAC */
+       { 79,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_RXD1 */
+       { 78,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_RXD2 */
+       { 77,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_RXD3 */
+       { 80,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_RXD0 */
+       { 94,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_TXD0 */
+       { 93,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_TXD1 */
+       { 92,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_TXD2 */
+       { 91,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_TXD3 */
+       { 85,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_TXC */
+       { 95,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_TXCTL */
+       { 72,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_RXC */
+       { 81,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_RXCTL */
+
+       /* MDIO */
+       { 99,   BUFFER_CLASS_B | PIN_PDIS | MODE(0) },  /* MDIO_CLK */
+       { 98,   BUFFER_CLASS_B | PIN_PDIS | MODE(0) },  /* MDIO_DATA */
 
        /* PWM */
        { 73,   MODE(4) },      /* SOC_EHRPWM3A */
@@ -346,6 +348,25 @@ struct pin_cfg k2g_ice_evm_pin_cfg[] = {
        { 133,  MODE(0) },      /* SOC_QSPI_D2 */
        { 134,  MODE(0) },      /* SOC_QSPI_D3 */
        { 135,  MODE(0) },      /* SOC_QSPI_CSN0 */
+
+       /* EMAC */
+       { 79,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_RXD1 */
+       { 78,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_RXD2 */
+       { 77,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_RXD3 */
+       { 80,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_RXD0 */
+       { 94,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_TXD0 */
+       { 93,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_TXD1 */
+       { 92,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_TXD2 */
+       { 91,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_TXD3 */
+       { 85,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_TXC */
+       { 95,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_TXCTL */
+       { 72,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_RXC */
+       { 81,   BUFFER_CLASS_D | PIN_PDIS | MODE(1) },  /* RGMII_RXCTL */
+
+       /* MDIO */
+       { 99,   BUFFER_CLASS_B | PIN_PDIS | MODE(0) },  /* MDIO_CLK */
+       { 98,   BUFFER_CLASS_B | PIN_PDIS | MODE(0) },  /* MDIO_DATA */
+
        { MAX_PIN_N, }
 };
 
index 0b07b3b9d777c246bfcd413337396fdd5db20dca..2bdbfcb3d09106a2c5b500e68ae0564a321dce1a 100644 (file)
@@ -1101,6 +1101,12 @@ config CMD_VIRTIO
        help
          VirtIO block device support
 
+config CMD_WDT
+       bool "wdt"
+       depends on WDT
+       help
+         This provides commands to control the watchdog timer devices.
+
 config CMD_AXI
        bool "axi"
        depends on AXI
index acb85f49fba87cc00774e419afdb2b1ab192a9e2..6b1c6b094e6daf610fadcc2ec700ce22b4878217 100644 (file)
@@ -142,6 +142,7 @@ obj-$(CONFIG_CMD_UBIFS) += ubifs.o
 obj-$(CONFIG_CMD_UNIVERSE) += universe.o
 obj-$(CONFIG_CMD_UNZIP) += unzip.o
 obj-$(CONFIG_CMD_VIRTIO) += virtio.o
+obj-$(CONFIG_CMD_WDT) += wdt.o
 obj-$(CONFIG_CMD_LZMADEC) += lzmadec.o
 
 obj-$(CONFIG_CMD_USB) += usb.o disk.o
index 94467671be846cacfc123d676871d196f2a0dfa6..aaafbf9b52b2e09dc8f2c857748470a09e5876ae 100644 (file)
--- a/cmd/fs.c
+++ b/cmd/fs.c
@@ -76,6 +76,20 @@ U_BOOT_CMD(
        "      device type 'interface' instance 'dev'."
 )
 
+static int do_ln_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
+                        char * const argv[])
+{
+       return do_ln(cmdtp, flag, argc, argv, FS_TYPE_ANY);
+}
+
+U_BOOT_CMD(
+       ln,     5,      1,      do_ln_wrapper,
+       "Create a symbolic link",
+       "<interface> <dev[:part]> target linkname\n"
+       "    - create a symbolic link to 'target' with the name 'linkname' on\n"
+       "      device type 'interface' instance 'dev'."
+)
+
 static int do_fstype_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
                                char * const argv[])
 {
index 0ccb1b51483cb57d5c69cf995e8e468bceaf6548..dd9ac0bc9761d1fbb593256f042b2a2d7b20ba64 100644 (file)
--- a/cmd/usb.c
+++ b/cmd/usb.c
@@ -316,26 +316,18 @@ static struct usb_device *usb_find_device(int devnum)
        return NULL;
 }
 
-static inline char *portspeed(int speed)
+static inline const char *portspeed(int speed)
 {
-       char *speed_str;
-
        switch (speed) {
        case USB_SPEED_SUPER:
-               speed_str = "5 Gb/s";
-               break;
+               return "5 Gb/s";
        case USB_SPEED_HIGH:
-               speed_str = "480 Mb/s";
-               break;
+               return "480 Mb/s";
        case USB_SPEED_LOW:
-               speed_str = "1.5 Mb/s";
-               break;
+               return "1.5 Mb/s";
        default:
-               speed_str = "12 Mb/s";
-               break;
+               return "12 Mb/s";
        }
-
-       return speed_str;
 }
 
 /* shows the device tree recursively */
diff --git a/cmd/wdt.c b/cmd/wdt.c
new file mode 100644 (file)
index 0000000..647d989
--- /dev/null
+++ b/cmd/wdt.c
@@ -0,0 +1,174 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Watchdog commands
+ *
+ * Copyright (c) 2019 Michael Walle <michael@walle.cc>
+ */
+
+#include <common.h>
+#include <command.h>
+#include <dm.h>
+#include <wdt.h>
+
+static struct udevice *currdev;
+
+static int do_wdt_list(cmd_tbl_t *cmdtp, int flag, int argc,
+                      char *const argv[])
+{
+       struct udevice *dev;
+       struct uclass *uc;
+       int ret;
+
+       ret = uclass_get(UCLASS_WDT, &uc);
+       if (ret)
+               return CMD_RET_FAILURE;
+
+       uclass_foreach_dev(dev, uc)
+               printf("%s (%s)\n", dev->name, dev->driver->name);
+
+       return CMD_RET_SUCCESS;
+}
+
+static int do_wdt_dev(cmd_tbl_t *cmdtp, int flag, int argc,
+                     char *const argv[])
+{
+       int ret;
+
+       if (argc > 1) {
+               ret = uclass_get_device_by_name(UCLASS_WDT, argv[1], &currdev);
+               if (ret) {
+                       printf("Can't get the watchdog timer: %s\n", argv[1]);
+                       return CMD_RET_FAILURE;
+               }
+       } else {
+               if (!currdev) {
+                       printf("No watchdog timer device set!\n");
+                       return CMD_RET_FAILURE;
+               }
+               printf("dev: %s\n", currdev->name);
+       }
+
+       return CMD_RET_SUCCESS;
+}
+
+static int check_currdev(void)
+{
+       if (!currdev) {
+               printf("No device set, use 'wdt dev' first\n");
+               return CMD_RET_FAILURE;
+       }
+       return 0;
+}
+
+static int do_wdt_start(cmd_tbl_t *cmdtp, int flag, int argc,
+                       char *const argv[])
+{
+       int ret;
+       u64 timeout;
+       ulong flags = 0;
+
+       if (argc < 2)
+               return CMD_RET_USAGE;
+
+       ret = check_currdev();
+       if (ret)
+               return ret;
+
+       timeout = simple_strtoull(argv[1], NULL, 0);
+       if (argc > 2)
+               flags = simple_strtoul(argv[2], NULL, 0);
+
+       ret = wdt_start(currdev, timeout, flags);
+       if (ret == -ENOSYS) {
+               printf("Starting watchdog timer not supported.\n");
+               return CMD_RET_FAILURE;
+       } else if (ret) {
+               printf("Starting watchdog timer failed (%d)\n", ret);
+               return CMD_RET_FAILURE;
+       }
+
+       return CMD_RET_SUCCESS;
+}
+
+static int do_wdt_stop(cmd_tbl_t *cmdtp, int flag, int argc,
+                      char *const argv[])
+{
+       int ret;
+
+       ret = check_currdev();
+       if (ret)
+               return ret;
+
+       ret = wdt_stop(currdev);
+       if (ret == -ENOSYS) {
+               printf("Stopping watchdog timer not supported.\n");
+               return CMD_RET_FAILURE;
+       } else if (ret) {
+               printf("Stopping watchdog timer failed (%d)\n", ret);
+               return CMD_RET_FAILURE;
+       }
+
+       return CMD_RET_SUCCESS;
+}
+
+static int do_wdt_reset(cmd_tbl_t *cmdtp, int flag, int argc,
+                       char *const argv[])
+{
+       int ret;
+
+       ret = check_currdev();
+       if (ret)
+               return ret;
+
+       ret = wdt_reset(currdev);
+       if (ret == -ENOSYS) {
+               printf("Resetting watchdog timer not supported.\n");
+               return CMD_RET_FAILURE;
+       } else if (ret) {
+               printf("Resetting watchdog timer failed (%d)\n", ret);
+               return CMD_RET_FAILURE;
+       }
+
+       return CMD_RET_SUCCESS;
+}
+
+static int do_wdt_expire(cmd_tbl_t *cmdtp, int flag, int argc,
+                        char *const argv[])
+{
+       int ret;
+       ulong flags = 0;
+
+       ret = check_currdev();
+       if (ret)
+               return ret;
+
+       if (argc > 1)
+               flags = simple_strtoul(argv[1], NULL, 0);
+
+       ret = wdt_expire_now(currdev, flags);
+       if (ret == -ENOSYS) {
+               printf("Expiring watchdog timer not supported.\n");
+               return CMD_RET_FAILURE;
+       } else if (ret) {
+               printf("Expiring watchdog timer failed (%d)\n", ret);
+               return CMD_RET_FAILURE;
+       }
+
+       return CMD_RET_SUCCESS;
+}
+
+static char wdt_help_text[] =
+       "list - list watchdog devices\n"
+       "wdt dev [<name>] - get/set current watchdog device\n"
+       "wdt start <timeout ms> [flags] - start watchdog timer\n"
+       "wdt stop - stop watchdog timer\n"
+       "wdt reset - reset watchdog timer\n"
+       "wdt expire [flags] - expire watchdog timer immediately\n";
+
+U_BOOT_CMD_WITH_SUBCMDS(wdt, "Watchdog sub-system", wdt_help_text,
+       U_BOOT_SUBCMD_MKENT(list, 1, 1, do_wdt_list),
+       U_BOOT_SUBCMD_MKENT(dev, 2, 1, do_wdt_dev),
+       U_BOOT_SUBCMD_MKENT(start, 3, 1, do_wdt_start),
+       U_BOOT_SUBCMD_MKENT(stop, 1, 1, do_wdt_stop),
+       U_BOOT_SUBCMD_MKENT(reset, 1, 1, do_wdt_reset),
+       U_BOOT_SUBCMD_MKENT(expire, 2, 1, do_wdt_expire));
index 577fdc69afe08078cec7a0386dd06d9f53bf50c9..25226e9a33565d0c1d14076e187a38b63094d664 100644 (file)
@@ -75,7 +75,7 @@ static int spl_ymodem_load_image(struct spl_image_info *spl_image,
        int ret;
        connection_info_t info;
        char buf[BUF_SIZE];
-       struct image_header *ih;
+       struct image_header *ih = NULL;
        ulong addr = 0;
 
        info.mode = xyzModem_ymodem;
@@ -111,7 +111,7 @@ static int spl_ymodem_load_image(struct spl_image_info *spl_image,
                ih = (struct image_header *)buf;
                ret = spl_parse_image_header(spl_image, ih);
                if (ret)
-                       return ret;
+                       goto end_stream;
 #ifdef CONFIG_SPL_GZIP
                if (ih->ih_comp == IH_COMP_GZIP)
                        addr = CONFIG_SYS_LOAD_ADDR;
@@ -128,18 +128,6 @@ static int spl_ymodem_load_image(struct spl_image_info *spl_image,
                        size += res;
                        addr += res;
                }
-
-#ifdef CONFIG_SPL_GZIP
-               if (ih->ih_comp == IH_COMP_GZIP) {
-                       if (gunzip((void *)(spl_image->load_addr + sizeof(*ih)),
-                                  CONFIG_SYS_BOOTM_LEN,
-                                  (void *)(CONFIG_SYS_LOAD_ADDR + sizeof(*ih)),
-                                  &size)) {
-                               puts("Uncompressing error\n");
-                               return -EIO;
-                       }
-               }
-#endif
        }
 
 end_stream:
@@ -147,6 +135,21 @@ end_stream:
        xyzModem_stream_terminate(false, &getcymodem);
 
        printf("Loaded %lu bytes\n", size);
-       return 0;
+
+#ifdef CONFIG_SPL_GZIP
+       if (!(IS_ENABLED(CONFIG_SPL_LOAD_FIT) &&
+             image_get_magic((struct image_header *)buf) == FDT_MAGIC) &&
+           (ih->ih_comp == IH_COMP_GZIP)) {
+               if (gunzip((void *)(spl_image->load_addr + sizeof(*ih)),
+                          CONFIG_SYS_BOOTM_LEN,
+                          (void *)(CONFIG_SYS_LOAD_ADDR + sizeof(*ih)),
+                          &size)) {
+                       puts("Uncompressing error\n");
+                       return -EIO;
+               }
+       }
+#endif
+
+       return ret;
 }
 SPL_LOAD_IMAGE_METHOD("UART", 0, BOOT_DEVICE_UART, spl_ymodem_load_image);
index 33aaeb8e4452a030b103781af0a97dd4115c4f76..9069f4b33aa191284f023fc67baf8af020067a47 100644 (file)
@@ -233,26 +233,18 @@ static struct usb_hub_device *usb_hub_allocate(void)
 
 #define MAX_TRIES 5
 
-static inline char *portspeed(int portstatus)
+static inline const char *portspeed(int portstatus)
 {
-       char *speed_str;
-
        switch (portstatus & USB_PORT_STAT_SPEED_MASK) {
        case USB_PORT_STAT_SUPER_SPEED:
-               speed_str = "5 Gb/s";
-               break;
+               return "5 Gb/s";
        case USB_PORT_STAT_HIGH_SPEED:
-               speed_str = "480 Mb/s";
-               break;
+               return "480 Mb/s";
        case USB_PORT_STAT_LOW_SPEED:
-               speed_str = "1.5 Mb/s";
-               break;
+               return "1.5 Mb/s";
        default:
-               speed_str = "12 Mb/s";
-               break;
+               return "12 Mb/s";
        }
-
-       return speed_str;
 }
 
 /**
index 6e0be88d7c946edd3a10aca553cd38c8aa4ec60a..f02945599f55f76d9fabce162723f231a8530a19 100644 (file)
@@ -34,4 +34,3 @@ CONFIG_BAUDRATE=38400
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_ATCSPI200_SPI=y
-CONFIG_ATCPIT100_TIMER=y
index b472a76d17463723127cad710fbafd5fc9bc17ed..98635a2ff90ea0c4f71d5615c7beadc6e917daf4 100644 (file)
@@ -35,4 +35,3 @@ CONFIG_BAUDRATE=38400
 CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_ATCSPI200_SPI=y
-CONFIG_ATCPIT100_TIMER=y
index a6a237f7839bd58b06ac4fe98b725e685d9023da..a396a3931050f83d6843b53a453797234e70c2f5 100644 (file)
@@ -7,14 +7,16 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd"
+CONFIG_LOGLEVEL=3
 CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_ARCH_MISC_INIT=y
+CONFIG_SPL_ETH_SUPPORT=y
 # CONFIG_SPL_FS_EXT4 is not set
 CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_MUSB_NEW_SUPPORT=y
 CONFIG_SPL_NET_SUPPORT=y
-CONFIG_SPL_NET_VCI_STRING="AM33xx U-Boot SPL"
+CONFIG_SPL_NET_VCI_STRING="AM335x U-Boot SPL"
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_USB_GADGET=y
 CONFIG_SPL_USB_ETHER=y
@@ -31,6 +33,7 @@ CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="am335x-evm"
 CONFIG_OF_LIST="am335x-evm am335x-bone am335x-boneblack am335x-evmsk am335x-bonegreen am335x-icev2"
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
+CONFIG_SPL_ENV_IS_NOWHERE=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_NAND=y
@@ -39,6 +42,7 @@ CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_DM_I2C=y
 CONFIG_MISC=y
 CONFIG_DM_MMC=y
+# CONFIG_MMC_HW_PARTITIONING is not set
 CONFIG_MMC_OMAP_HS=y
 CONFIG_NAND=y
 CONFIG_DM_SPI_FLASH=y
@@ -46,7 +50,6 @@ CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_SPEED=24000000
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_DM_ETH=y
-CONFIG_PHY_GIGE=y
 CONFIG_MII=y
 CONFIG_DRIVER_TI_CPSW=y
 CONFIG_SPI=y
@@ -70,3 +73,4 @@ CONFIG_USB_ETHER=y
 CONFIG_DYNAMIC_CRC_TABLE=y
 CONFIG_RSA=y
 CONFIG_LZO=y
+# CONFIG_OF_LIBFDT_OVERLAY is not set
diff --git a/configs/am335x_guardian_defconfig b/configs/am335x_guardian_defconfig
new file mode 100644 (file)
index 0000000..c25a1a9
--- /dev/null
@@ -0,0 +1,90 @@
+CONFIG_ARM=y
+CONFIG_ARCH_OMAP2PLUS=y
+CONFIG_SPL_GPIO_SUPPORT=y
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_AM33XX=y
+CONFIG_TARGET_AM335X_GUARDIAN=y
+CONFIG_SPL_MMC_SUPPORT=y
+CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
+CONFIG_SPL=y
+CONFIG_SPL_LIBDISK_SUPPORT=y
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_BOOTSTAGE_STASH_ADDR=0x0
+CONFIG_CONSOLE_MUX=y
+CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_VERSION_VARIABLE=y
+CONFIG_ARCH_MISC_INIT=y
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_ENV_SUPPORT=y
+CONFIG_SPL_ETH_SUPPORT=y
+CONFIG_SPL_I2C_SUPPORT=y
+CONFIG_SPL_MUSB_NEW_SUPPORT=y
+CONFIG_SPL_NET_SUPPORT=y
+CONFIG_SPL_NET_VCI_STRING="Guardian U-Boot SPL"
+CONFIG_SPL_POWER_SUPPORT=y
+CONFIG_SPL_USB_GADGET=y
+CONFIG_SPL_USB_ETHER=y
+CONFIG_SPL_WATCHDOG_SUPPORT=y
+CONFIG_SPL_YMODEM_SUPPORT=y
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
+CONFIG_AUTOBOOT_DELAY_STR="d"
+CONFIG_AUTOBOOT_STOP_STR=" "
+CONFIG_CMD_SPL=y
+CONFIG_CMD_SPL_NAND_OFS=0x0
+CONFIG_CMD_ASKENV=y
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_MTD=y
+CONFIG_CMD_NAND=y
+CONFIG_CMD_USB=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDPARTS_DEFAULT="mtdparts=nand.0:256k(SPL),256k(SPL.backup1),256k(SPL.backup2),256k(SPL.backup3),1m(u-boot),1m(u-boot.backup1),256k(u-boot-env),256k(u-boot-env.backup1),-(UBI)"
+CONFIG_CMD_UBI=y
+# CONFIG_SPL_DOS_PARTITION is not set
+# CONFIG_ISO_PARTITION is not set
+# CONFIG_SPL_EFI_PARTITION is not set
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="am335x-guardian"
+CONFIG_ENV_IS_IN_NAND=y
+CONFIG_SPL_ENV_IS_NOWHERE=y
+CONFIG_SPL_DM=y
+CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_ENV=y
+CONFIG_MISC=y
+CONFIG_DM_MMC=y
+CONFIG_MMC_OMAP_HS=y
+CONFIG_MTD=y
+CONFIG_NAND=y
+CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
+CONFIG_SYS_NAND_U_BOOT_OFFS=0x100000
+CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND=0x200000
+CONFIG_MTD_UBI_FASTMAP=y
+CONFIG_PHYLIB=y
+CONFIG_DM_ETH=y
+CONFIG_PHY=y
+CONFIG_NOP_PHY=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_SINGLE=y
+CONFIG_USB=y
+CONFIG_DM_USB_GADGET=y
+CONFIG_SPL_DM_USB_GADGET=y
+CONFIG_USB_MUSB_HOST=y
+CONFIG_USB_MUSB_GADGET=y
+CONFIG_USB_MUSB_TI=y
+CONFIG_USB_MUSB_DSPS=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="Texas Instruments"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0451
+CONFIG_USB_GADGET_PRODUCT_NUM=0xd022
+CONFIG_USB_ETHER=y
+CONFIG_FAT_WRITE=y
index 3d710202251bc9599ee56e63526278ed53513f35..e5de83386f3a3d0ebfe54b73d9a04b1feb32d592 100644 (file)
@@ -40,9 +40,13 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DM=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_SPL_REGMAP=y
+CONFIG_SPL_SYSCON=y
+CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_DWC_AHCI=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
+CONFIG_DFU_SF=y
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x82000000
 CONFIG_FASTBOOT_BUF_SIZE=0x2F000000
index 8f6fd25531b425d0e32e7ca3f76c91a08c4b2785..724b4bc09ff5550b7f0725804ab7af47d5f4790b 100644 (file)
@@ -15,6 +15,7 @@ CONFIG_DISTRO_DEFAULTS=y
 CONFIG_NR_DRAM_BANKS=2
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
+CONFIG_OF_BOARD_SETUP=y
 CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run get_kern_${boot}; run get_fdt_${boot}; run run_kern"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
@@ -48,10 +49,11 @@ CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_CLK=y
 CONFIG_SPL_CLK=y
 CONFIG_CLK_TI_SCI=y
+CONFIG_DMA_CHANNELS=y
+CONFIG_TI_K3_NAVSS_UDMA=y
 CONFIG_TI_SCI_PROTOCOL=y
 CONFIG_DM_MAILBOX=y
 CONFIG_K3_SEC_PROXY=y
-CONFIG_MISC=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_K3_ARASAN=y
@@ -67,5 +69,6 @@ CONFIG_REMOTEPROC_K3=y
 CONFIG_DM_RESET=y
 CONFIG_RESET_TI_SCI=y
 CONFIG_DM_SERIAL=y
+CONFIG_SOC_TI=y
 CONFIG_SYSRESET=y
 CONFIG_SYSRESET_TI_SCI=y
index 3ee79432ca8c6d69d337792fb8db6415fcc14916..4083dcbae69bc58b0acf03d264bbaeac291a46ab 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_SYS_THUMB_BUILD=y
 CONFIG_ARCH_DAVINCI=y
 CONFIG_SYS_TEXT_BASE=0xc1080000
 CONFIG_TARGET_DA850EVM=y
@@ -13,6 +14,7 @@ CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SYS_EXTRA_OPTIONS="MAC_ADDR_IN_SPIFLASH"
 CONFIG_BOOTDELAY=3
+CONFIG_DEFAULT_FDT_FILE="da850-evm.dtb"
 CONFIG_MISC_INIT_R=y
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
@@ -20,6 +22,7 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot > "
@@ -39,7 +42,6 @@ CONFIG_CMD_DIAG=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="da850-evm"
-CONFIG_SPL_OF_PLATDATA=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=0
@@ -47,6 +49,8 @@ CONFIG_USE_ENV_SPI_MODE=y
 CONFIG_ENV_SPI_MODE=0
 CONFIG_DM=y
 CONFIG_SPL_DM=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_DM_GPIO=y
 CONFIG_DA8XX_GPIO=y
 CONFIG_DM_I2C=y
index 48b7c2a97a115d32a6f4997757f1987710df8967..af5ba813c27936bc3dd5abef3c726a566c8e6517 100644 (file)
@@ -1,4 +1,5 @@
 CONFIG_ARM=y
+CONFIG_SYS_THUMB_BUILD=y
 CONFIG_ARCH_DAVINCI=y
 CONFIG_SYS_TEXT_BASE=0xc1080000
 CONFIG_TARGET_DA850EVM=y
@@ -12,12 +13,14 @@ CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_SYS_EXTRA_OPTIONS="MAC_ADDR_IN_SPIFLASH"
 CONFIG_BOOTDELAY=3
+CONFIG_DEFAULT_FDT_FILE="da850-evm.dtb"
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_HUSH_PARSER=y
@@ -37,13 +40,15 @@ CONFIG_CMD_DIAG=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="da850-evm"
-CONFIG_SPL_OF_PLATDATA=y
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DM=y
 CONFIG_SPL_DM=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_DM_GPIO=y
 CONFIG_DA8XX_GPIO=y
 CONFIG_DM_I2C=y
+CONFIG_DM_MMC=y
 CONFIG_NAND=y
 CONFIG_NAND_DAVINCI=y
 CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
index dcf2a25395e22714e83106beb9f3acda27aaa961..e8ba5184c4d7f86622d158b53f1d93d150eaa6ef 100644 (file)
@@ -41,7 +41,7 @@ CONFIG_CMD_FS_GENERIC=y
 CONFIG_EFI_PARTITION=y
 # CONFIG_PARTITION_UUIDS is not set
 # CONFIG_SPL_PARTITION_UUIDS is not set
-CONFIG_DEFAULT_DEVICE_TREE="armada-385-amc"
+CONFIG_DEFAULT_DEVICE_TREE="armada-385-db-88f6820-amc"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=50000000
index 98e47ee956361c7ecd0fac20f93340efe5b94519..078bd230504eef4e4fd101bc37e51c4cd08df2b0 100644 (file)
@@ -46,6 +46,7 @@ CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=50000000
 CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_SATA_MV=y
+CONFIG_BLK=y
 # CONFIG_MMC is not set
 CONFIG_NAND=y
 CONFIG_NAND_PXA3XX=y
diff --git a/configs/db-xc3-24g4xg_defconfig b/configs/db-xc3-24g4xg_defconfig
new file mode 100644 (file)
index 0000000..0285cca
--- /dev/null
@@ -0,0 +1,55 @@
+CONFIG_ARM=y
+CONFIG_ARCH_MVEBU=y
+CONFIG_SYS_TEXT_BASE=0x00800000
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_TARGET_DB_XC3_24G4XG=y
+CONFIG_BUILD_TARGET="u-boot.kwb"
+CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_SYS_ALT_MEMTEST=y
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_I2C=y
+CONFIG_CMD_SF=y
+CONFIG_CMD_SPI=y
+CONFIG_CMD_USB=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_TFTPPUT=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_TIME=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_UBI=y
+CONFIG_DEFAULT_DEVICE_TREE="armada-xp-db-xc3-24g4xg"
+CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_SPL_OF_TRANSLATE=y
+CONFIG_BLK=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_MVTWSI=y
+# CONFIG_MMC is not set
+CONFIG_MTD=y
+CONFIG_MTD_DEVICE=y
+CONFIG_NAND=y
+CONFIG_NAND_PXA3XX=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_SFDP_SUPPORT=y
+CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_SPI_FLASH_SST=y
+# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set
+CONFIG_PCI=y
+CONFIG_PCI_MVEBU=y
+CONFIG_SYS_NS16550=y
+CONFIG_KIRKWOOD_SPI=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
+CONFIG_USB_HOST_ETHER=y
+CONFIG_USB_ETHER_ASIX=y
+CONFIG_USB_ETHER_RTL8152=y
+CONFIG_USB_ETHER_SMSC95XX=y
index 5a766981603a3e22f74c5612b1e797a5b9121155..ba8b053680b9df42ae3cfc32a6fa89aa789cd508 100644 (file)
@@ -30,6 +30,7 @@ CONFIG_DEFAULT_DEVICE_TREE="kirkwood-dns325"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DM=y
 CONFIG_MVSATA_IDE=y
+CONFIG_BLK=y
 # CONFIG_MMC is not set
 CONFIG_MVGBE=y
 CONFIG_MII=y
@@ -37,5 +38,6 @@ CONFIG_DM_RTC=y
 CONFIG_RTC_MV=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
index 598a2a380f36816b76d859c9528c6c69fad94197..072582c865d49033c96e77b05a91cfe9327784b6 100644 (file)
@@ -23,12 +23,15 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_DMA_SUPPORT=y
-# CONFIG_SPL_NAND_SUPPORT is not set
 CONFIG_SPL_OS_BOOT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_CMD_SPL=y
 # CONFIG_CMD_FLASH is not set
+CONFIG_CMD_NAND=y
 # CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nand0=nand.0"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=nand.0:256k(NAND.SPL),256k(NAND.SPL.backup1),256k(NAND.SPL.backup2),256k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),2m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)"
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="dra7-evm"
@@ -66,6 +69,8 @@ CONFIG_MMC_UHS_SUPPORT=y
 CONFIG_MMC_HS200_SUPPORT=y
 CONFIG_SPL_MMC_HS200_SUPPORT=y
 CONFIG_MMC_OMAP_HS=y
+CONFIG_NAND=y
+CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
index d8541542448986c88e7a3000403e89efab3941a1..60329c71e47b223ee6336753d22b059c25aa7014 100644 (file)
@@ -32,7 +32,10 @@ CONFIG_SPL_DMA_SUPPORT=y
 # CONFIG_SPL_NAND_SUPPORT is not set
 CONFIG_SPL_SPI_LOAD=y
 # CONFIG_CMD_FLASH is not set
-# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_NAND=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nand0=nand.0"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=nand.0:256k(NAND.SPL),256k(NAND.SPL.backup1),256k(NAND.SPL.backup2),256k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),2m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)"
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="dra7-evm"
@@ -70,6 +73,8 @@ CONFIG_MMC_UHS_SUPPORT=y
 CONFIG_MMC_HS200_SUPPORT=y
 CONFIG_SPL_MMC_HS200_SUPPORT=y
 CONFIG_MMC_OMAP_HS=y
+CONFIG_NAND=y
+CONFIG_SYS_NAND_BUSWIDTH_16BIT=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SF_DEFAULT_MODE=0
index 8202848ebf72018dfcc7e4673f63f3a1a283a8b8..eae36f9c0eb39e9a0b92a42a2a50d79d26b9dd55 100644 (file)
@@ -27,6 +27,7 @@ CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=50000000
 CONFIG_DM=y
 CONFIG_MVSATA_IDE=y
+CONFIG_BLK=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
@@ -40,5 +41,6 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_KIRKWOOD_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
index 29d5f98d76cbf73f2e9f9cce4099b000a04701d2..22996e893d6b75cb84ed2512d0cf03037c879be5 100644 (file)
@@ -22,6 +22,7 @@ CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=50000000
 CONFIG_DM=y
 CONFIG_MVSATA_IDE=y
+CONFIG_BLK=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MVTWSI=y
 # CONFIG_MMC is not set
@@ -37,5 +38,6 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_KIRKWOOD_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_FS_EXT4=y
index 62cad538883b57b8ff27a1024e65df9ffbc4dc24..9e936494b2b1c0c0096c57b87eb53e58ed7d1e1a 100644 (file)
@@ -43,6 +43,7 @@ CONFIG_USE_ENV_SPI_MAX_HZ=y
 CONFIG_ENV_SPI_MAX_HZ=50000000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_OF_TRANSLATE=y
+CONFIG_BLK=y
 # CONFIG_MMC is not set
 CONFIG_MTD_DEVICE=y
 CONFIG_SPI_FLASH=y
diff --git a/configs/gardena-smart-gateway-at91sam_defconfig b/configs/gardena-smart-gateway-at91sam_defconfig
new file mode 100644 (file)
index 0000000..b395a5a
--- /dev/null
@@ -0,0 +1,83 @@
+CONFIG_ARM=y
+CONFIG_SYS_THUMB_BUILD=y
+CONFIG_ARCH_AT91=y
+CONFIG_SYS_TEXT_BASE=0x22900000
+CONFIG_TARGET_GARDENA_SMART_GATEWAY_AT91SAM=y
+CONFIG_SPL_GPIO_SUPPORT=y
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SPL_SERIAL_SUPPORT=y
+CONFIG_SPL_SYS_MALLOC_F_LEN=0x1000
+CONFIG_SPL=y
+CONFIG_DEBUG_UART_BOARD_INIT=y
+CONFIG_DEBUG_UART_BASE=0xfffff200
+CONFIG_DEBUG_UART_CLOCK=132000000
+CONFIG_SMBIOS_PRODUCT_NAME="at91sam9x5ek"
+CONFIG_DEBUG_UART=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_FIT=y
+CONFIG_NAND_BOOT=y
+CONFIG_BOOTDELAY=3
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,768k(uboot)ro,256k(env_redundant),256k(env),512k(dtb),6M(kernel)ro,-(rootfs) rootfstype=ubifs ubi.mtd=6 root=ubi0:rootfs rw"
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
+CONFIG_SYS_CONSOLE_INFO_QUIET=y
+CONFIG_ARCH_EARLY_INIT_R=y
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+CONFIG_SPL_SEPARATE_BSS=y
+# CONFIG_TPL_BANNER_PRINT is not set
+# CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR is not set
+CONFIG_SPL_NAND_SUPPORT=y
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_DM=y
+# CONFIG_CMD_FLASH is not set
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_MTD=y
+CONFIG_CMD_NAND=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_CACHE=y
+CONFIG_CMD_TIME=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nand0=nand0"
+CONFIG_MTDPARTS_DEFAULT="nand0:1536k(uboot),1024k(unused),512k(dtb_old),4608k(kernel_old),86528k(ubi),-(rootfs_old)"
+CONFIG_CMD_UBI=y
+CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="at91sam9g25-gardena-smart-gateway"
+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clocks clock-names interrupts interrupt-parent interrupts-extended dmas dma-names"
+CONFIG_ENV_IS_IN_UBI=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DM=y
+CONFIG_SPL_DM=y
+CONFIG_BLK=y
+CONFIG_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
+# CONFIG_MMC is not set
+CONFIG_NAND_ATMEL=y
+CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER=y
+# CONFIG_CONFIG_UBI_SILENCE_MSG is not set
+CONFIG_DM_ETH=y
+CONFIG_MACB=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_ATMEL_USART=y
+CONFIG_TIMER=y
+CONFIG_SPL_TIMER=y
+CONFIG_ATMEL_PIT_TIMER=y
+# CONFIG_SYS_WHITE_ON_BLACK is not set
+CONFIG_WATCHDOG=y
+CONFIG_WDT=y
+CONFIG_WDT_AT91=y
+# CONFIG_UBIFS_SILENCE_MSG is not set
+CONFIG_USE_TINY_PRINTF=y
index c04bf0ea57429a7907e704948116927f12c57690..568b74fd830601ede429e5d69fd0967c8d21be1b 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_DEFAULT_DEVICE_TREE="kirkwood-goflexnet"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DM=y
 CONFIG_MVSATA_IDE=y
+CONFIG_BLK=y
 # CONFIG_MMC is not set
 CONFIG_MVGBE=y
 CONFIG_MII=y
@@ -38,5 +39,6 @@ CONFIG_DM_RTC=y
 CONFIG_RTC_MV=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
index 9998e48ab9c26e71ffc8a9f93cd48e79133fbead..8ae7e20bafd9620199a62bf1fca92048e3e1437e 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_DEFAULT_DEVICE_TREE="kirkwood-guruplug-server-plus"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DM=y
 CONFIG_MVSATA_IDE=y
+CONFIG_BLK=y
 # CONFIG_MMC is not set
 CONFIG_MVGBE=y
 CONFIG_MII=y
@@ -38,6 +39,7 @@ CONFIG_DM_RTC=y
 CONFIG_RTC_MV=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_LZMA=y
index 6123daded330ed3343a5fdd6e6b319da8f3151b5..fb006dcda96c3a6fb98c63f8ba047194e137ea26 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_KEYSTONE=y
+CONFIG_ISW_ENTRY_ADDR=0xC100000
 CONFIG_SYS_TEXT_BASE=0xC000000
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
index 11c9fda985df040705eb7f8512dbdec58b8f9c91..449e66452ea6c12e18ca7ebd4196bac2dc95ef39 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_KEYSTONE=y
+CONFIG_ISW_ENTRY_ADDR=0xC100000
 CONFIG_TI_SECURE_DEVICE=y
 CONFIG_SYS_TEXT_BASE=0xC000060
 CONFIG_TI_COMMON_CMD_OPTIONS=y
index 4ff9c138c0296851e5a15a42b472da026a631f93..38db43e1c03b735b4f34c1bcef1a0c47f27479d6 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_KEYSTONE=y
+CONFIG_ISW_ENTRY_ADDR=0xC0A0000
 CONFIG_SYS_TEXT_BASE=0xC000000
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
@@ -72,3 +73,4 @@ CONFIG_USB_DWC3_GENERIC=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_SDP=y
+CONFIG_PHY_TI=y
index 990c7f6317e1ee98b6f5bddd5ca852989d73f185..9c7e3ca3ec009d73391949535699cecf52d9b165 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_KEYSTONE=y
 CONFIG_TI_SECURE_DEVICE=y
+CONFIG_ISW_ENTRY_ADDR=0xC0A0000
 CONFIG_SYS_TEXT_BASE=0xC000060
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_TARGET_K2G_EVM=y
index 6835874384215cea4c26eab3c389935293174337..39aa9336f40f1d68f201811c80735a96efab109f 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_KEYSTONE=y
+CONFIG_ISW_ENTRY_ADDR=0xC200000
 CONFIG_SYS_TEXT_BASE=0xC000000
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
index e14f901fb77452e4d48a5a9dccf14fc57a0f4be9..94bc70a82d22960af144470b36f439d817f74e49 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_KEYSTONE=y
+CONFIG_ISW_ENTRY_ADDR=0xC200000
 CONFIG_TI_SECURE_DEVICE=y
 CONFIG_SYS_TEXT_BASE=0xC000060
 CONFIG_TI_COMMON_CMD_OPTIONS=y
index 0e2f73acd97a410f230cf70204e3f7457133a06a..c37a0ce5194e36d724ea4808b1f5fc13119a5b43 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_KEYSTONE=y
+CONFIG_ISW_ENTRY_ADDR=0xC100000
 CONFIG_SYS_TEXT_BASE=0xC000000
 CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
index 1f7a93e5a95b718de921bf180929366738a426ea..443758cab576d598d9aa87bb6e1c3c2572b6de33 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_KEYSTONE=y
+CONFIG_ISW_ENTRY_ADDR=0xC100000
 CONFIG_TI_SECURE_DEVICE=y
 CONFIG_SYS_TEXT_BASE=0xC000060
 CONFIG_TI_COMMON_CMD_OPTIONS=y
index 16d9c9226f020ed5339fb9b3f9d057c3f8d3cf73..c550798bcd4a9e609376ffdad7ca3da32024b0ee 100644 (file)
@@ -16,7 +16,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_MISC_INIT_R=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 # CONFIG_CMD_FLASH is not set
-CONFIG_CMD_IDE=y
+CONFIG_CMD_SATA=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
@@ -26,7 +26,8 @@ CONFIG_DEFAULT_DEVICE_TREE="kirkwood-lschlv2"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
-CONFIG_MVSATA_IDE=y
+CONFIG_SATA_MV=y
+CONFIG_BLK=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
@@ -39,4 +40,5 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_KIRKWOOD_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
index b6eba4a4ba12490b0c2029bc44a58717bf292b08..efcce455a4871495a5b9c3af17fb202d198ac42b 100644 (file)
@@ -16,7 +16,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y
 CONFIG_MISC_INIT_R=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 # CONFIG_CMD_FLASH is not set
-CONFIG_CMD_IDE=y
+CONFIG_CMD_SATA=y
 CONFIG_CMD_SF=y
 CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
@@ -26,7 +26,8 @@ CONFIG_DEFAULT_DEVICE_TREE="kirkwood-lsxhl"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_DM=y
-CONFIG_MVSATA_IDE=y
+CONFIG_SATA_MV=y
+CONFIG_BLK=y
 # CONFIG_MMC is not set
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
@@ -39,4 +40,5 @@ CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_KIRKWOOD_SPI=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
index 6bd308bb826431252b3b33aeeb650ae626ff2e9e..a244b8d69168ff76dd63ef7fdfc73451d8f43357 100644 (file)
@@ -31,6 +31,7 @@ CONFIG_DEFAULT_DEVICE_TREE="kirkwood-blackarmor-nas220"
 CONFIG_ENV_IS_IN_NAND=y
 CONFIG_DM=y
 CONFIG_MVSATA_IDE=y
+CONFIG_BLK=y
 # CONFIG_MMC is not set
 CONFIG_MVGBE=y
 CONFIG_MII=y
@@ -38,5 +39,6 @@ CONFIG_DM_RTC=y
 CONFIG_RTC_MV=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
index 928e446c3f4fa952315fb7fb14260c9ac2d12771..c3f7e1408da765e32a5df2a7aa93ffa7d5b2f9eb 100644 (file)
@@ -2,27 +2,57 @@ CONFIG_ARM=y
 CONFIG_ARCH_AT91=y
 CONFIG_SYS_TEXT_BASE=0x73f00000
 CONFIG_TARGET_PM9G45=y
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_DEBUG_UART_BOARD_INIT=y
+CONFIG_DEBUG_UART_BASE=0xffffee00
+CONFIG_DEBUG_UART_CLOCK=132000000
+CONFIG_DEBUG_UART=y
 CONFIG_NR_DRAM_BANKS=1
-CONFIG_SYS_EXTRA_OPTIONS="AT91SAM9G45"
+CONFIG_NAND_BOOT=y
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="fbcon=rotate:3 console=tty0 console=ttyS0,115200 root=/dev/mtdblock4 mtdparts=atmel_nand:128k(bootstrap)ro,256k(uboot)ro,1664k(env),2M(linux)ro,-(root) rw rootfstype=jffs2"
-# CONFIG_DISPLAY_CPUINFO is not set
+# CONFIG_CONSOLE_MUX is not set
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
 # CONFIG_DISPLAY_BOARDINFO is not set
-CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PROMPT="U-Boot> "
+# CONFIG_CMD_BDI is not set
+CONFIG_CMD_BOOTZ=y
+# CONFIG_CMD_IMI is not set
 # CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_LOADS is not set
+CONFIG_CMD_MMC=y
 CONFIG_CMD_NAND=y
 CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
-CONFIG_CMD_CACHE=y
-CONFIG_CMD_JFFS2=y
+CONFIG_CMD_FAT=y
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="at91sam9m10g45ek"
 CONFIG_ENV_IS_IN_NAND=y
-# CONFIG_MMC is not set
-CONFIG_NAND=y
+CONFIG_DM=y
+CONFIG_CLK=y
+CONFIG_CLK_AT91=y
+CONFIG_DM_GPIO=y
+CONFIG_AT91_GPIO=y
+CONFIG_DM_MMC=y
+CONFIG_GENERIC_ATMEL_MCI=y
 CONFIG_NAND_ATMEL=y
+CONFIG_DM_ETH=y
+CONFIG_MACB=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AT91=y
+CONFIG_DM_SERIAL=y
+CONFIG_DEBUG_UART_ATMEL=y
+CONFIG_DEBUG_UART_ANNOUNCE=y
+CONFIG_ATMEL_USART=y
+CONFIG_TIMER=y
+CONFIG_ATMEL_PIT_TIMER=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
index 019e72eac1791c10187aa378a1de65cb7cb1c27d..8c5c9ed0c4bda2ff757bfdef3476d8ae6caa4083 100644 (file)
@@ -1,7 +1,6 @@
 CONFIG_ARM=y
 CONFIG_ARCH_RMOBILE=y
 CONFIG_SYS_TEXT_BASE=0x50000000
-CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_RCAR_GEN3=y
 CONFIG_TARGET_SALVATOR_X=y
 CONFIG_SMBIOS_PRODUCT_NAME=""
@@ -29,7 +28,8 @@ CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="r8a7795-salvator-x-u-boot"
 CONFIG_OF_LIST="r8a7795-salvator-x-u-boot r8a7796-salvator-x-u-boot r8a77965-salvator-x-u-boot"
-CONFIG_MULTI_DTB_FIT=y
+CONFIG_MULTI_DTB_FIT_LZO=y
+CONFIG_MULTI_DTB_FIT_USER_DEFINED_AREA=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
index b2f1dfe50b86ec108addc87a78639c76a9de7c53..8dc0c3fda910d502fd23516fed8066db7c708ffc 100644 (file)
@@ -28,8 +28,9 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="r8a7795-h3ulcb-u-boot"
-CONFIG_OF_LIST="r8a7795-h3ulcb-u-boot r8a7796-m3ulcb-u-boot"
-CONFIG_MULTI_DTB_FIT=y
+CONFIG_OF_LIST="r8a7795-h3ulcb-u-boot r8a7796-m3ulcb-u-boot r8a77965-m3nulcb-u-boot"
+CONFIG_MULTI_DTB_FIT_LZO=y
+CONFIG_MULTI_DTB_FIT_USER_DEFINED_AREA=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
index b34fddda1cb8a790a3d775a939b6b0bda2b0bd29..228d848c239b0b9d83ae091025e90d7ab3f5b801 100644 (file)
@@ -29,7 +29,8 @@ CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="r8a77965-salvator-x-u-boot"
 CONFIG_OF_LIST="r8a7795-salvator-x-u-boot r8a7796-salvator-x-u-boot r8a77965-salvator-x-u-boot"
-CONFIG_MULTI_DTB_FIT=y
+CONFIG_MULTI_DTB_FIT_LZO=y
+CONFIG_MULTI_DTB_FIT_USER_DEFINED_AREA=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
diff --git a/configs/r8a77965_ulcb_defconfig b/configs/r8a77965_ulcb_defconfig
new file mode 100644 (file)
index 0000000..5cbc161
--- /dev/null
@@ -0,0 +1,67 @@
+CONFIG_ARM=y
+CONFIG_ARCH_RMOBILE=y
+CONFIG_SYS_TEXT_BASE=0x50000000
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_RCAR_GEN3=y
+CONFIG_TARGET_ULCB=y
+CONFIG_SMBIOS_PRODUCT_NAME=""
+CONFIG_FIT=y
+# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=192.168.0.1:/export/rfs ip=192.168.0.20"
+CONFIG_SUPPORT_RAW_INITRD=y
+CONFIG_DEFAULT_FDT_FILE="r8a77965-m3nulcb.dtb"
+CONFIG_VERSION_VARIABLE=y
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_MII=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_EXT2=y
+CONFIG_CMD_EXT4=y
+CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_OF_CONTROL=y
+CONFIG_DEFAULT_DEVICE_TREE="r8a77965-m3nulcb-u-boot"
+CONFIG_OF_LIST="r8a7795-h3ulcb-u-boot r8a7796-m3ulcb-u-boot r8a77965-m3nulcb-u-boot"
+CONFIG_MULTI_DTB_FIT_LZO=y
+CONFIG_MULTI_DTB_FIT_USER_DEFINED_AREA=y
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_CLK=y
+CONFIG_CLK_RENESAS=y
+CONFIG_DM_GPIO=y
+CONFIG_RCAR_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_RCAR_IIC=y
+CONFIG_DM_MMC=y
+CONFIG_MMC_IO_VOLTAGE=y
+CONFIG_MMC_UHS_SUPPORT=y
+CONFIG_MMC_HS400_SUPPORT=y
+CONFIG_RENESAS_SDHI=y
+CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ90X1=y
+CONFIG_DM_ETH=y
+CONFIG_RENESAS_RAVB=y
+CONFIG_PINCTRL=y
+CONFIG_PINCONF=y
+CONFIG_PINCTRL_PFC=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_SCIF_CONSOLE=y
+CONFIG_SYSRESET=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_STORAGE=y
+CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_SMBIOS_MANUFACTURER=""
index 6a9c1bdc0c04112066b43e10392faa501fc82465..67d3b517f4643f9dd9642dcec7ff5ec73567a648 100644 (file)
@@ -29,7 +29,8 @@ CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="r8a7796-salvator-x-u-boot"
 CONFIG_OF_LIST="r8a7795-salvator-x-u-boot r8a7796-salvator-x-u-boot r8a77965-salvator-x-u-boot"
-CONFIG_MULTI_DTB_FIT=y
+CONFIG_MULTI_DTB_FIT_LZO=y
+CONFIG_MULTI_DTB_FIT_USER_DEFINED_AREA=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
index aff4c9cb6153ca6076e555c373dd3ff8641764d4..ab395d58581d39600fe0051687e3ee5b590fc720 100644 (file)
@@ -28,8 +28,9 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="r8a7796-m3ulcb-u-boot"
-CONFIG_OF_LIST="r8a7795-h3ulcb-u-boot r8a7796-m3ulcb-u-boot"
-CONFIG_MULTI_DTB_FIT=y
+CONFIG_OF_LIST="r8a7795-h3ulcb-u-boot r8a7796-m3ulcb-u-boot r8a77965-m3nulcb-u-boot"
+CONFIG_MULTI_DTB_FIT_LZO=y
+CONFIG_MULTI_DTB_FIT_USER_DEFINED_AREA=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
index 04b00cdea9d4643eb5968a6b023c6c839a7b2826..ec527fceb6f579e3a30cf2e6dfc3996b38266ccf 100644 (file)
@@ -39,6 +39,7 @@ CONFIG_DM_RTC=y
 CONFIG_RTC_MV=y
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_LZMA=y
index 7c7220afc81b2732c01353f9f2f9fa019199f20f..807a5691210b4b2eca4e16de2ffd729b83e6dbc1 100644 (file)
@@ -59,6 +59,5 @@ CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_MCS7830=y
 CONFIG_WDT=y
 CONFIG_WDT_AT91=y
-CONFIG_AT91_HW_WDT_TIMEOUT=y
 CONFIG_SPL_TINY_MEMSET=y
 # CONFIG_EFI_LOADER is not set
index 022b0b6da194c530dc6d4fc6ea386eb78e8809f0..d69f4895eff3309a7d2b2b4e31faee7ad8297b8e 100644 (file)
@@ -62,5 +62,4 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x02d2
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_WDT=y
 CONFIG_WDT_AT91=y
-CONFIG_AT91_HW_WDT_TIMEOUT=y
 CONFIG_USE_TINY_PRINTF=y
index fb9307aaf58014f2b7f0fd5ea34c60ecaa654132..3736aec537dbd13324b2c466b8b3c02f802659f6 100644 (file)
@@ -51,6 +51,7 @@ CONFIG_ENV_SPI_MAX_HZ=50000000
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_SATA_MV=y
+CONFIG_BLK=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_RAM=y
 CONFIG_FPGA_ALTERA=y
index c406b257533e4bae66497cb39b0ef53823967aa8..85f214148a8ebcd2e4214e1474964621212ecf80 100644 (file)
@@ -43,6 +43,7 @@ CONFIG_ATSHA204A=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_MV=y
 CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_PHY_MARVELL=y
 CONFIG_PHY_GIGE=y
 CONFIG_MVNETA=y
index cd18e9eb454b61539ad17d6f318a8484c32058ec..c893c44452b185153dc8854494c32754d780bc93 100644 (file)
@@ -19,6 +19,8 @@ CONFIG_SILENT_CONSOLE=y
 CONFIG_SILENT_U_BOOT_ONLY=y
 CONFIG_SILENT_CONSOLE_UPDATE_ON_RELOC=y
 CONFIG_MISC_INIT_R=y
+CONFIG_SPL_BOARD_INIT=y
+CONFIG_SPL_WATCHDOG_SUPPORT=y
 CONFIG_CMD_MEMINFO=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -72,3 +74,6 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
 CONFIG_USB_ETHER_ASIX88179=y
+CONFIG_WATCHDOG=y
+CONFIG_WDT=y
+CONFIG_WDT_ORION=y
index f1bca54520a2e73d0792e30438053339c266ab28..ea170a25a6913fa1a15da4f19a326f53af404c40 100644 (file)
@@ -32,6 +32,7 @@ Currently the following boards are supported:
 | R8A7796  M3-W | Renesas Electronics ULCB               | r8a7796_ulcb
 |---------------+----------------------------------------+-------------------
 | R8A77965 M3-N | Renesas Electronics Salvator-XS        | r8a77965_salvator-x_defconfig
+| R8A77965 M3-N | Renesas Electronics ULCB               | r8a77965_ulcb
 |---------------+----------------------------------------+-------------------
 | R8A77970 V3M  | Renesas Electronics Eagle              | r8a77970_eagle_defconfig
 |---------------+----------------------------------------+-------------------
index de818d4713f0c6f77f6a63ed0eb315ec5e66e746..9698e4899b54c8135a863e78ef1cdca74a2bb9b5 100644 (file)
@@ -12,6 +12,10 @@ property which allows the chip offset length to be selected.
 Optional properties:
 - u-boot,i2c-offset-len - length of chip offset in bytes. If omitted the
     default value of 1 is used.
+- u-boot,i2c-transaction-bytes - the length of single I2C transaction on
+    the bus. Some devices require more than single byte transmission
+    (e.g. mc34708 mfd). This information is necessary to correctly
+     initialize (put into idle state) I2C bus after soft reset.
 - gpios = <sda ...>, <scl ...>;
   pinctrl-names = "default", "gpio";
   pinctrl-0 = <&i2c_xfer>;
@@ -28,6 +32,7 @@ i2c4: i2c@12ca0000 {
                compatible = "google,cros-ec";
                i2c-max-frequency = <100000>;
                u-boot,i2c-offset-len = <0>;
+               u-boot,i2c-transaction-bytes = <3>;
                ec-interrupt = <&gpx1 6 GPIO_ACTIVE_LOW>;
        };
 };
index b75ebab02bab2ac934b2ace0f736631513aea623..ec6d8bf8f4feadd112aceed6d31202342f999d9e 100644 (file)
@@ -26,7 +26,6 @@ alias iwamatsu       Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
 alias jaehoon        Jaehoon Chung <jh80.chung@samsung.com>
 alias jagan          Jagan Teki <jagan@openedev.com>
 alias jhersh         Joe Hershberger <joe.hershberger@ni.com>
-alias luka           Luka Perkov <luka.perkov@sartura.hr>
 alias lukma          Lukasz Majewski <lukma@denx.de>
 alias macpaul        Macpaul Lin <macpaul@andestech.com>
 alias marex          Marek Vasut <marex@denx.de>
@@ -35,7 +34,6 @@ alias masahiro       Masahiro Yamada <yamada.masahiro@socionext.com>
 alias mateusz        Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
 alias maxime         Maxime Ripard <maxime.ripard@free-electrons.com>
 alias monstr         Michal Simek <monstr@monstr.eu>
-alias prafulla       Prafulla Wadaskar <prafulla@marvell.com>
 alias prom           Minkyu Kang <mk7.kang@samsung.com>
 alias ptomsich       Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
 alias sbabic         Stefano Babic <sbabic@denx.de>
@@ -56,7 +54,7 @@ alias arm            uboot, aaribaud, trini
 alias at91           uboot, abiessmann
 alias davinci        ti
 alias imx            uboot, sbabic
-alias kirkwood       uboot, prafulla, luka, stroese
+alias kirkwood       uboot, stroese
 alias omap           ti
 alias pxa            uboot, marex
 alias rmobile        uboot, iwamatsu
index f24351ac4f1d2d5e72a9dbfad86f15aa7eb608ec..e6702eced46c26acf411dfc7ab39dee9d1bba262 100644 (file)
@@ -98,6 +98,8 @@ source "drivers/smem/Kconfig"
 
 source "drivers/sound/Kconfig"
 
+source "drivers/soc/Kconfig"
+
 source "drivers/spi/Kconfig"
 
 source "drivers/spmi/Kconfig"
index 49a056e9416a55333004d03c6e5d27ea63261267..7ebee75c0a5ba82c4befa854f6d8488c148ce70e 100644 (file)
@@ -81,7 +81,9 @@ config MVSATA_IDE
 
 config SATA_MV
        bool "Enable Marvell SATA controller driver support"
+       select AHCI
        select LIBATA
+       depends on BLK
        help
          Enable this driver to support the SATA controller found in
          some Marvell SoCs.
index 6e3f17ee276d9c19c69c3058205c2a2c20a02a4a..48a9d00d1479c174d8dd97fb42f38ade24b3a743 100644 (file)
@@ -44,6 +44,7 @@ static int mvebu_ahci_probe(struct udevice *dev)
 }
 
 static const struct udevice_id mvebu_ahci_ids[] = {
+       { .compatible = "marvell,armada-380-ahci" },
        { .compatible = "marvell,armada-3700-ahci" },
        { .compatible = "marvell,armada-8k-ahci" },
        { }
index a168196fd4d2868f71986472e3cfec770da3df51..2a630d46c142f97da1c3a8ff4f5c3a62512cf5ba 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) Excito Elektronik i SkÃ¥ne AB, 2010.
  * Author: Tor Krill <tor@excito.com>
  *
- * Copyright (C) 2015 Stefan Roese <sr@denx.de>
+ * Copyright (C) 2015, 2019 Stefan Roese <sr@denx.de>
  */
 
 /*
  */
 
 #include <common.h>
+#include <ahci.h>
+#include <dm.h>
+#include <dm/device-internal.h>
+#include <dm/lists.h>
 #include <fis.h>
 #include <libata.h>
 #include <malloc.h>
 #include <asm/io.h>
 #include <linux/mbus.h>
 
+#include <asm/arch/soc.h>
 #if defined(CONFIG_KIRKWOOD)
-#include <asm/arch/kirkwood.h>
 #define SATAHC_BASE            KW_SATA_BASE
 #else
-#include <asm/arch/soc.h>
 #define SATAHC_BASE            MVEBU_AXP_SATA_BASE
 #endif
 
@@ -214,8 +217,8 @@ struct crqb {
 #define CRQB_SECTCOUNT_COUNT_EXP_MASK  (0xff << 8)
 #define CRQB_SECTCOUNT_COUNT_EXP_SHIFT 8
 
-#define MVSATA_WIN_CONTROL(w)  (MVEBU_AXP_SATA_BASE + 0x30 + ((w) << 4))
-#define MVSATA_WIN_BASE(w)     (MVEBU_AXP_SATA_BASE + 0x34 + ((w) << 4))
+#define MVSATA_WIN_CONTROL(w)  (SATAHC_BASE + 0x30 + ((w) << 4))
+#define MVSATA_WIN_BASE(w)     (SATAHC_BASE + 0x34 + ((w) << 4))
 
 struct eprd {
        u32 phyaddr_low;
@@ -256,6 +259,7 @@ struct mv_priv {
        u16 pio;
        u16 mwdma;
        u16 udma;
+       int dev_nr;
 
        void *crqb_alloc;
        struct crqb *request;
@@ -278,9 +282,9 @@ static int ata_wait_register(u32 *addr, u32 mask, u32 val, u32 timeout_msec)
 }
 
 /* Cut from sata_mv in linux kernel */
-static int mv_stop_edma_engine(int port)
+static int mv_stop_edma_engine(struct udevice *dev, int port)
 {
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[port].priv;
+       struct mv_priv *priv = dev_get_platdata(dev);
        int i;
 
        /* Disable eDMA. The disable bit auto clears. */
@@ -299,9 +303,9 @@ static int mv_stop_edma_engine(int port)
        return -1;
 }
 
-static int mv_start_edma_engine(int port)
+static int mv_start_edma_engine(struct udevice *dev, int port)
 {
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[port].priv;
+       struct mv_priv *priv = dev_get_platdata(dev);
        u32 tmp;
 
        /* Check preconditions */
@@ -351,12 +355,12 @@ static int mv_start_edma_engine(int port)
        return 0;
 }
 
-static int mv_reset_channel(int port)
+static int mv_reset_channel(struct udevice *dev, int port)
 {
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[port].priv;
+       struct mv_priv *priv = dev_get_platdata(dev);
 
        /* Make sure edma is stopped  */
-       mv_stop_edma_engine(port);
+       mv_stop_edma_engine(dev, port);
 
        out_le32(priv->regbase + EDMA_CMD, EDMA_CMD_ATARST);
        udelay(25);             /* allow reset propagation */
@@ -366,11 +370,11 @@ static int mv_reset_channel(int port)
        return 0;
 }
 
-static void mv_reset_port(int port)
+static void mv_reset_port(struct udevice *dev, int port)
 {
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[port].priv;
+       struct mv_priv *priv = dev_get_platdata(dev);
 
-       mv_reset_channel(port);
+       mv_reset_channel(dev, port);
 
        out_le32(priv->regbase + EDMA_CMD, 0x0);
        out_le32(priv->regbase + EDMA_CFG, 0x101f);
@@ -392,9 +396,9 @@ static void mv_reset_one_hc(void)
        out_le32(SATAHC_BASE + SATAHC_ICR, 0x00);
 }
 
-static int probe_port(int port)
+static int probe_port(struct udevice *dev, int port)
 {
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[port].priv;
+       struct mv_priv *priv = dev_get_platdata(dev);
        int tries, tries2, set15 = 0;
        u32 tmp;
 
@@ -446,7 +450,7 @@ static int probe_port(int port)
                        tmp &= ~SIR_CFG_GEN2EN;
                        out_le32(priv->regbase + SIR_ICFG, tmp);
 
-                       mv_reset_channel(port);
+                       mv_reset_channel(dev, port);
                }
        }
 
@@ -455,9 +459,9 @@ static int probe_port(int port)
 }
 
 /* Get request queue in pointer */
-static int get_reqip(int port)
+static int get_reqip(struct udevice *dev, int port)
 {
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[port].priv;
+       struct mv_priv *priv = dev_get_platdata(dev);
        u32 tmp;
 
        tmp = in_le32(priv->regbase + EDMA_RQIPR) & EDMA_RQIPR_IPMASK;
@@ -466,9 +470,9 @@ static int get_reqip(int port)
        return tmp;
 }
 
-static void set_reqip(int port, int reqin)
+static void set_reqip(struct udevice *dev, int port, int reqin)
 {
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[port].priv;
+       struct mv_priv *priv = dev_get_platdata(dev);
        u32 tmp;
 
        tmp = in_le32(priv->regbase + EDMA_RQIPR) & ~EDMA_RQIPR_IPMASK;
@@ -477,17 +481,17 @@ static void set_reqip(int port, int reqin)
 }
 
 /* Get next available slot, ignoring possible overwrite */
-static int get_next_reqip(int port)
+static int get_next_reqip(struct udevice *dev, int port)
 {
-       int slot = get_reqip(port);
+       int slot = get_reqip(dev, port);
        slot = (slot + 1) % REQUEST_QUEUE_SIZE;
        return slot;
 }
 
 /* Get response queue in pointer */
-static int get_rspip(int port)
+static int get_rspip(struct udevice *dev, int port)
 {
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[port].priv;
+       struct mv_priv *priv = dev_get_platdata(dev);
        u32 tmp;
 
        tmp = in_le32(priv->regbase + EDMA_RSIPR) & EDMA_RSIPR_IPMASK;
@@ -497,9 +501,9 @@ static int get_rspip(int port)
 }
 
 /* Get response queue out pointer */
-static int get_rspop(int port)
+static int get_rspop(struct udevice *dev, int port)
 {
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[port].priv;
+       struct mv_priv *priv = dev_get_platdata(dev);
        u32 tmp;
 
        tmp = in_le32(priv->regbase + EDMA_RSOPR) & EDMA_RSOPR_OPMASK;
@@ -508,15 +512,15 @@ static int get_rspop(int port)
 }
 
 /* Get next response queue pointer  */
-static int get_next_rspop(int port)
+static int get_next_rspop(struct udevice *dev, int port)
 {
-       return (get_rspop(port) + 1) % RESPONSE_QUEUE_SIZE;
+       return (get_rspop(dev, port) + 1) % RESPONSE_QUEUE_SIZE;
 }
 
 /* Set response queue pointer */
-static void set_rspop(int port, int reqin)
+static void set_rspop(struct udevice *dev, int port, int reqin)
 {
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[port].priv;
+       struct mv_priv *priv = dev_get_platdata(dev);
        u32 tmp;
 
        tmp = in_le32(priv->regbase + EDMA_RSOPR) & ~EDMA_RSOPR_OPMASK;
@@ -525,7 +529,8 @@ static void set_rspop(int port, int reqin)
        out_le32(priv->regbase + EDMA_RSOPR, tmp);
 }
 
-static int wait_dma_completion(int port, int index, u32 timeout_msec)
+static int wait_dma_completion(struct udevice *dev, int port, int index,
+                              u32 timeout_msec)
 {
        u32 tmp, res;
 
@@ -538,13 +543,13 @@ static int wait_dma_completion(int port, int index, u32 timeout_msec)
        return res;
 }
 
-static void process_responses(int port)
+static void process_responses(struct udevice *dev, int port)
 {
 #ifdef DEBUG
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[port].priv;
+       struct mv_priv *priv = dev_get_platdata(dev);
 #endif
        u32 tmp;
-       u32 outind = get_rspop(port);
+       u32 outind = get_rspop(dev, port);
 
        /* Ack interrupts */
        tmp = in_le32(SATAHC_BASE + SATAHC_ICR);
@@ -555,20 +560,21 @@ static void process_responses(int port)
        tmp &= ~(BIT(4));
        out_le32(SATAHC_BASE + SATAHC_ICR, tmp);
 
-       while (get_rspip(port) != outind) {
+       while (get_rspip(dev, port) != outind) {
 #ifdef DEBUG
                debug("Response index %d flags %08x on port %d\n", outind,
                      priv->response[outind].flags, port);
 #endif
-               outind = get_next_rspop(port);
-               set_rspop(port, outind);
+               outind = get_next_rspop(dev, port);
+               set_rspop(dev, port, outind);
        }
 }
 
-static int mv_ata_exec_ata_cmd(int port, struct sata_fis_h2d *cfis,
+static int mv_ata_exec_ata_cmd(struct udevice *dev, int port,
+                              struct sata_fis_h2d *cfis,
                               u8 *buffer, u32 len, u32 iswrite)
 {
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[port].priv;
+       struct mv_priv *priv = dev_get_platdata(dev);
        struct crqb *req;
        int slot;
        u32 start;
@@ -579,7 +585,7 @@ static int mv_ata_exec_ata_cmd(int port, struct sata_fis_h2d *cfis,
        }
 
        /* Initialize request */
-       slot = get_reqip(port);
+       slot = get_reqip(dev, port);
        memset(&priv->request[slot], 0, sizeof(struct crqb));
        req = &priv->request[slot];
 
@@ -633,16 +639,16 @@ static int mv_ata_exec_ata_cmd(int port, struct sata_fis_h2d *cfis,
                           start + ALIGN(sizeof(*req), ARCH_DMA_MINALIGN));
 
        /* Trigger operation */
-       slot = get_next_reqip(port);
-       set_reqip(port, slot);
+       slot = get_next_reqip(dev, port);
+       set_reqip(dev, port, slot);
 
        /* Wait for completion */
-       if (wait_dma_completion(port, slot, 10000)) {
+       if (wait_dma_completion(dev, port, slot, 10000)) {
                printf("ATA operation timed out\n");
                return -1;
        }
 
-       process_responses(port);
+       process_responses(dev, port);
 
        /* Invalidate data on read */
        if (buffer && len) {
@@ -654,7 +660,8 @@ static int mv_ata_exec_ata_cmd(int port, struct sata_fis_h2d *cfis,
        return len;
 }
 
-static u32 mv_sata_rw_cmd_ext(int port, lbaint_t start, u32 blkcnt,
+static u32 mv_sata_rw_cmd_ext(struct udevice *dev, int port, lbaint_t start,
+                             u32 blkcnt,
                              u8 *buffer, int is_write)
 {
        struct sata_fis_h2d cfis;
@@ -678,14 +685,14 @@ static u32 mv_sata_rw_cmd_ext(int port, lbaint_t start, u32 blkcnt,
        cfis.sector_count_exp = (blkcnt >> 8) & 0xff;
        cfis.sector_count = blkcnt & 0xff;
 
-       res = mv_ata_exec_ata_cmd(port, &cfis, buffer, ATA_SECT_SIZE * blkcnt,
-                                 is_write);
+       res = mv_ata_exec_ata_cmd(dev, port, &cfis, buffer,
+                                 ATA_SECT_SIZE * blkcnt, is_write);
 
        return res >= 0 ? blkcnt : res;
 }
 
-static u32 mv_sata_rw_cmd(int port, lbaint_t start, u32 blkcnt, u8 *buffer,
-                         int is_write)
+static u32 mv_sata_rw_cmd(struct udevice *dev, int port, lbaint_t start,
+                         u32 blkcnt, u8 *buffer, int is_write)
 {
        struct sata_fis_h2d cfis;
        lbaint_t block;
@@ -705,20 +712,21 @@ static u32 mv_sata_rw_cmd(int port, lbaint_t start, u32 blkcnt, u8 *buffer,
        cfis.lba_low = block & 0xff;
        cfis.sector_count = (u8)(blkcnt & 0xff);
 
-       res = mv_ata_exec_ata_cmd(port, &cfis, buffer, ATA_SECT_SIZE * blkcnt,
-                                 is_write);
+       res = mv_ata_exec_ata_cmd(dev, port, &cfis, buffer,
+                                 ATA_SECT_SIZE * blkcnt, is_write);
 
        return res >= 0 ? blkcnt : res;
 }
 
-static u32 ata_low_level_rw(int dev, lbaint_t blknr, lbaint_t blkcnt,
-                           void *buffer, int is_write)
+static u32 ata_low_level_rw(struct udevice *dev, int port, lbaint_t blknr,
+                           lbaint_t blkcnt, void *buffer, int is_write)
 {
+       struct blk_desc *desc = dev_get_uclass_platdata(dev);
        lbaint_t start, blks;
        u8 *addr;
        int max_blks;
 
-       debug("%s: %ld %ld\n", __func__, blknr, blkcnt);
+       debug("%s: " LBAFU " " LBAFU "\n", __func__, blknr, blkcnt);
 
        start = blknr;
        blks = blkcnt;
@@ -727,22 +735,22 @@ static u32 ata_low_level_rw(int dev, lbaint_t blknr, lbaint_t blkcnt,
        max_blks = MV_ATA_MAX_SECTORS;
        do {
                if (blks > max_blks) {
-                       if (sata_dev_desc[dev].lba48) {
-                               mv_sata_rw_cmd_ext(dev, start, max_blks, addr,
-                                                  is_write);
+                       if (desc->lba48) {
+                               mv_sata_rw_cmd_ext(dev, port, start, max_blks,
+                                                  addr, is_write);
                        } else {
-                               mv_sata_rw_cmd(dev, start, max_blks, addr,
-                                              is_write);
+                               mv_sata_rw_cmd(dev, port, start, max_blks,
+                                              addr, is_write);
                        }
                        start += max_blks;
                        blks -= max_blks;
                        addr += ATA_SECT_SIZE * max_blks;
                } else {
-                       if (sata_dev_desc[dev].lba48) {
-                               mv_sata_rw_cmd_ext(dev, start, blks, addr,
+                       if (desc->lba48) {
+                               mv_sata_rw_cmd_ext(dev, port, start, blks, addr,
                                                   is_write);
                        } else {
-                               mv_sata_rw_cmd(dev, start, blks, addr,
+                               mv_sata_rw_cmd(dev, port, start, blks, addr,
                                               is_write);
                        }
                        start += blks;
@@ -754,11 +762,11 @@ static u32 ata_low_level_rw(int dev, lbaint_t blknr, lbaint_t blkcnt,
        return blkcnt;
 }
 
-static int mv_ata_exec_ata_cmd_nondma(int port,
+static int mv_ata_exec_ata_cmd_nondma(struct udevice *dev, int port,
                                      struct sata_fis_h2d *cfis, u8 *buffer,
                                      u32 len, u32 iswrite)
 {
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[port].priv;
+       struct mv_priv *priv = dev_get_platdata(dev);
        int i;
        u16 *tp;
 
@@ -791,7 +799,7 @@ static int mv_ata_exec_ata_cmd_nondma(int port,
        return len;
 }
 
-static int mv_sata_identify(int port, u16 *id)
+static int mv_sata_identify(struct udevice *dev, int port, u16 *id)
 {
        struct sata_fis_h2d h2d;
 
@@ -803,13 +811,13 @@ static int mv_sata_identify(int port, u16 *id)
        /* Give device time to get operational */
        mdelay(10);
 
-       return mv_ata_exec_ata_cmd_nondma(port, &h2d, (u8 *)id,
+       return mv_ata_exec_ata_cmd_nondma(dev, port, &h2d, (u8 *)id,
                                          ATA_ID_WORDS * 2, READ_CMD);
 }
 
-static void mv_sata_xfer_mode(int port, u16 *id)
+static void mv_sata_xfer_mode(struct udevice *dev, int port, u16 *id)
 {
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[port].priv;
+       struct mv_priv *priv = dev_get_platdata(dev);
 
        priv->pio = id[ATA_ID_PIO_MODES];
        priv->mwdma = id[ATA_ID_MWDMA_MODES];
@@ -818,9 +826,9 @@ static void mv_sata_xfer_mode(int port, u16 *id)
              priv->udma);
 }
 
-static void mv_sata_set_features(int port)
+static void mv_sata_set_features(struct udevice *dev, int port)
 {
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[port].priv;
+       struct mv_priv *priv = dev_get_platdata(dev);
        struct sata_fis_h2d cfis;
        u8 udma_cap;
 
@@ -842,53 +850,7 @@ static void mv_sata_set_features(int port)
        if (udma_cap == ATA_UDMA3)
                cfis.sector_count = XFER_UDMA_3;
 
-       mv_ata_exec_ata_cmd_nondma(port, &cfis, NULL, 0, READ_CMD);
-}
-
-int mv_sata_spin_down(int dev)
-{
-       struct sata_fis_h2d cfis;
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[dev].priv;
-
-       if (priv->link == 0) {
-               debug("No device on port: %d\n", dev);
-               return 1;
-       }
-
-       memset(&cfis, 0, sizeof(struct sata_fis_h2d));
-
-       cfis.fis_type = SATA_FIS_TYPE_REGISTER_H2D;
-       cfis.command = ATA_CMD_STANDBY;
-
-       return mv_ata_exec_ata_cmd_nondma(dev, &cfis, NULL, 0, READ_CMD);
-}
-
-int mv_sata_spin_up(int dev)
-{
-       struct sata_fis_h2d cfis;
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[dev].priv;
-
-       if (priv->link == 0) {
-               debug("No device on port: %d\n", dev);
-               return 1;
-       }
-
-       memset(&cfis, 0, sizeof(struct sata_fis_h2d));
-
-       cfis.fis_type = SATA_FIS_TYPE_REGISTER_H2D;
-       cfis.command = ATA_CMD_IDLE;
-
-       return mv_ata_exec_ata_cmd_nondma(dev, &cfis, NULL, 0, READ_CMD);
-}
-
-ulong sata_read(int dev, ulong blknr, lbaint_t blkcnt, void *buffer)
-{
-       return ata_low_level_rw(dev, blknr, blkcnt, buffer, READ_CMD);
-}
-
-ulong sata_write(int dev, ulong blknr, lbaint_t blkcnt, const void *buffer)
-{
-       return ata_low_level_rw(dev, blknr, blkcnt, (void *)buffer, WRITE_CMD);
+       mv_ata_exec_ata_cmd_nondma(dev, port, &cfis, NULL, 0, READ_CMD);
 }
 
 /*
@@ -916,25 +878,17 @@ static void mvsata_ide_conf_mbus_windows(void)
        }
 }
 
-int init_sata(int dev)
+static int sata_mv_init_sata(struct udevice *dev, int port)
 {
-       struct mv_priv *priv;
+       struct mv_priv *priv = dev_get_platdata(dev);
 
-       debug("Initialize sata dev: %d\n", dev);
+       debug("Initialize sata dev: %d\n", port);
 
-       if (dev < 0 || dev >= CONFIG_SYS_SATA_MAX_DEVICE) {
-               printf("Invalid sata device %d\n", dev);
+       if (port < 0 || port >= CONFIG_SYS_SATA_MAX_DEVICE) {
+               printf("Invalid sata device %d\n", port);
                return -1;
        }
 
-       priv = (struct mv_priv *)malloc(sizeof(struct mv_priv));
-       if (!priv) {
-               printf("Failed to allocate memory for private sata data\n");
-               return -ENOMEM;
-       }
-
-       memset((void *)priv, 0, sizeof(struct mv_priv));
-
        /* Allocate and align request buffer */
        priv->crqb_alloc = malloc(sizeof(struct crqb) * REQUEST_QUEUE_SIZE +
                                  CRQB_ALIGN);
@@ -959,11 +913,9 @@ int init_sata(int dev)
        priv->response = (struct crpb *)(((u32) priv->crpb_alloc + CRPB_ALIGN) &
                                         ~(CRPB_ALIGN - 1));
 
-       sata_dev_desc[dev].priv = (void *)priv;
-
-       sprintf(priv->name, "SATA%d", dev);
+       sprintf(priv->name, "SATA%d", port);
 
-       priv->regbase = dev == 0 ? SATA0_BASE : SATA1_BASE;
+       priv->regbase = port == 0 ? SATA0_BASE : SATA1_BASE;
 
        if (!hw_init) {
                debug("Initialize sata hw\n");
@@ -972,9 +924,9 @@ int init_sata(int dev)
                mvsata_ide_conf_mbus_windows();
        }
 
-       mv_reset_port(dev);
+       mv_reset_port(dev, port);
 
-       if (probe_port(dev)) {
+       if (probe_port(dev, port)) {
                priv->link = 0;
                return -ENODEV;
        }
@@ -983,19 +935,15 @@ int init_sata(int dev)
        return 0;
 }
 
-int reset_sata(int dev)
-{
-       return 0;
-}
-
-int scan_sata(int port)
+static int sata_mv_scan_sata(struct udevice *dev, int port)
 {
+       struct blk_desc *desc = dev_get_uclass_platdata(dev);
+       struct mv_priv *priv = dev_get_platdata(dev);
        unsigned char serial[ATA_ID_SERNO_LEN + 1];
        unsigned char firmware[ATA_ID_FW_REV_LEN + 1];
        unsigned char product[ATA_ID_PROD_LEN + 1];
        u64 n_sectors;
        u16 *id;
-       struct mv_priv *priv = (struct mv_priv *)sata_dev_desc[port].priv;
 
        if (!priv->link)
                return -ENODEV;
@@ -1006,7 +954,7 @@ int scan_sata(int port)
                return -ENOMEM;
        }
 
-       mv_sata_identify(port, id);
+       mv_sata_identify(dev, port, id);
        ata_swap_buf_le16(id, ATA_ID_WORDS);
 #ifdef DEBUG
        ata_dump_id(id);
@@ -1014,23 +962,23 @@ int scan_sata(int port)
 
        /* Serial number */
        ata_id_c_string(id, serial, ATA_ID_SERNO, sizeof(serial));
-       memcpy(sata_dev_desc[port].product, serial, sizeof(serial));
+       memcpy(desc->product, serial, sizeof(serial));
 
        /* Firmware version */
        ata_id_c_string(id, firmware, ATA_ID_FW_REV, sizeof(firmware));
-       memcpy(sata_dev_desc[port].revision, firmware, sizeof(firmware));
+       memcpy(desc->revision, firmware, sizeof(firmware));
 
        /* Product model */
        ata_id_c_string(id, product, ATA_ID_PROD, sizeof(product));
-       memcpy(sata_dev_desc[port].vendor, product, sizeof(product));
+       memcpy(desc->vendor, product, sizeof(product));
 
        /* Total sectors */
        n_sectors = ata_id_n_sectors(id);
-       sata_dev_desc[port].lba = n_sectors;
+       desc->lba = n_sectors;
 
        /* Check if support LBA48 */
        if (ata_id_has_lba48(id)) {
-               sata_dev_desc[port].lba48 = 1;
+               desc->lba48 = 1;
                debug("Device support LBA48\n");
        }
 
@@ -1038,13 +986,111 @@ int scan_sata(int port)
        priv->queue_depth = ata_id_queue_depth(id);
 
        /* Get the xfer mode from device */
-       mv_sata_xfer_mode(port, id);
+       mv_sata_xfer_mode(dev, port, id);
 
        /* Set the xfer mode to highest speed */
-       mv_sata_set_features(port);
+       mv_sata_set_features(dev, port);
 
        /* Start up */
-       mv_start_edma_engine(port);
+       mv_start_edma_engine(dev, port);
+
+       return 0;
+}
+
+static ulong sata_mv_read(struct udevice *blk, lbaint_t blknr,
+                         lbaint_t blkcnt, void *buffer)
+{
+       struct mv_priv *priv = dev_get_platdata(blk);
+
+       return ata_low_level_rw(blk, priv->dev_nr, blknr, blkcnt,
+                               buffer, READ_CMD);
+}
+
+static ulong sata_mv_write(struct udevice *blk, lbaint_t blknr,
+                          lbaint_t blkcnt, const void *buffer)
+{
+       struct mv_priv *priv = dev_get_platdata(blk);
+
+       return ata_low_level_rw(blk, priv->dev_nr, blknr, blkcnt,
+                               (void *)buffer, WRITE_CMD);
+}
+
+static const struct blk_ops sata_mv_blk_ops = {
+       .read   = sata_mv_read,
+       .write  = sata_mv_write,
+};
+
+U_BOOT_DRIVER(sata_mv_driver) = {
+       .name = "sata_mv_blk",
+       .id = UCLASS_BLK,
+       .ops = &sata_mv_blk_ops,
+       .platdata_auto_alloc_size = sizeof(struct mv_priv),
+};
+
+static int sata_mv_probe(struct udevice *dev)
+{
+       const void *blob = gd->fdt_blob;
+       int node = dev_of_offset(dev);
+       struct mv_priv *priv;
+       struct udevice *blk;
+       int nr_ports;
+       int ret;
+       int i;
+
+       /* Get number of ports of this SATA controller */
+       nr_ports = min(fdtdec_get_int(blob, node, "nr-ports", -1),
+                      CONFIG_SYS_SATA_MAX_DEVICE);
+
+       for (i = 0; i < nr_ports; i++) {
+               ret = blk_create_devicef(dev, "sata_mv_blk", "blk",
+                                        IF_TYPE_SATA, -1, 512, 0, &blk);
+               if (ret) {
+                       debug("Can't create device\n");
+                       return ret;
+               }
+
+               priv = dev_get_platdata(blk);
+               priv->dev_nr = i;
+
+               /* Init SATA port */
+               ret = sata_mv_init_sata(blk, i);
+               if (ret) {
+                       debug("%s: Failed to init bus\n", __func__);
+                       return ret;
+               }
+
+               /* Scan SATA port */
+               ret = sata_mv_scan_sata(blk, i);
+               if (ret) {
+                       debug("%s: Failed to scan bus\n", __func__);
+                       return ret;
+               }
+       }
+
+       return 0;
+}
+
+static int sata_mv_scan(struct udevice *dev)
+{
+       /* Nothing to do here */
 
        return 0;
 }
+
+static const struct udevice_id sata_mv_ids[] = {
+       { .compatible = "marvell,armada-370-sata" },
+       { .compatible = "marvell,orion-sata" },
+       { }
+};
+
+struct ahci_ops sata_mv_ahci_ops = {
+       .scan = sata_mv_scan,
+};
+
+U_BOOT_DRIVER(sata_mv_ahci) = {
+       .name = "sata_mv_ahci",
+       .id = UCLASS_AHCI,
+       .of_match = sata_mv_ids,
+       .ops = &sata_mv_ahci_ops,
+       .probe = sata_mv_probe,
+};
index e062eccdae1e8a1ac3e1cc7e0e6742e8d702e295..3862c1b8482707def8a0a9cf268e5f5880d97d50 100644 (file)
@@ -60,6 +60,12 @@ config CLK_R8A7796
        help
          Enable this to support the clocks on Renesas R8A7796 SoC.
 
+config CLK_R8A77965
+       bool "Renesas R8A77965 clock driver"
+       depends on CLK_RCAR_GEN3
+       help
+         Enable this to support the clocks on Renesas R8A77965 SoC.
+
 config CLK_R8A77970
        bool "Renesas R8A77970 clock driver"
        depends on CLK_RCAR_GEN3
index 22a817a91910844306f9d3c02910e19af879d846..26b343994cdbf29b78489b929ee873e8ea7065d3 100644 (file)
@@ -8,6 +8,7 @@ obj-$(CONFIG_CLK_R8A7794) += r8a7794-cpg-mssr.o
 obj-$(CONFIG_CLK_RCAR_GEN3) += clk-rcar-gen3.o
 obj-$(CONFIG_CLK_R8A7795) += r8a7795-cpg-mssr.o
 obj-$(CONFIG_CLK_R8A7796) += r8a7796-cpg-mssr.o
+obj-$(CONFIG_CLK_R8A77965) += r8a77965-cpg-mssr.o
 obj-$(CONFIG_CLK_R8A77970) += r8a77970-cpg-mssr.o
 obj-$(CONFIG_CLK_R8A77990) += r8a77990-cpg-mssr.o
 obj-$(CONFIG_CLK_R8A77995) += r8a77995-cpg-mssr.o
index 0529fc8763c622a7c88b10014d3369a3c14f2f0c..a2011dd37c5f50a7e4d898c791715a822644b1f2 100644 (file)
@@ -96,7 +96,7 @@ static int gen3_clk_get_parent(struct gen3_clk_priv *priv, struct clk *clk,
                if (ret)
                        return ret;
 
-               if (core->type == CLK_TYPE_GEN3_PE) {
+               if (core->type == CLK_TYPE_GEN3_MDSEL) {
                        parent->dev = clk->dev;
                        parent->id = core->parent >> (priv->sscg ? 16 : 0);
                        parent->id &= 0xffff;
@@ -257,7 +257,7 @@ static u64 gen3_clk_get_rate64(struct clk *clk)
                      core->parent, core->mult, core->div, rate);
                return rate;
 
-       case CLK_TYPE_GEN3_PE:
+       case CLK_TYPE_GEN3_MDSEL:
                div = (core->div >> (priv->sscg ? 16 : 0)) & 0xffff;
                rate = gen3_clk_get_rate64(&parent) / div;
                debug("%s[%i] PE clk: parent=%i div=%u => rate=%llu\n",
index 360c02c5fda51213e570175d5af9a9b796b1a517..b62b8753cd4e64e6f9bc0c1de19ad79e14ae3792 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a7790 Clock Pulse Generator / Module Standby and Software Reset
  *
@@ -6,10 +7,6 @@
  * Based on clk-rcar-gen2.c
  *
  * Copyright (C) 2013 Ideas On Board SPRL
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <common.h>
@@ -139,6 +136,7 @@ static const struct mssr_mod_clk r8a7790_mod_clks[] = {
        DEF_MOD("cmt1",                  329,   R8A7790_CLK_R),
        DEF_MOD("usbhs-dmac0",           330,   R8A7790_CLK_HP),
        DEF_MOD("usbhs-dmac1",           331,   R8A7790_CLK_HP),
+       DEF_MOD("rwdt",                  402,   R8A7790_CLK_R),
        DEF_MOD("irqc",                  407,   R8A7790_CLK_CP),
        DEF_MOD("intc-sys",              408,   R8A7790_CLK_ZS),
        DEF_MOD("audio-dmac1",           501,   R8A7790_CLK_HP),
index 160877a27fa3a318001baeefc838201babcf0e00..e11c02e6e8272bb0bf48dc9a4093b4d81cb017cd 100644 (file)
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Renesas R8A7791 CPG MSSR driver
  *
@@ -6,8 +6,11 @@
  *
  * Based on the following driver from Linux kernel:
  * r8a7791 Clock Pulse Generator / Module Standby and Software Reset
+ *
  * Copyright (C) 2015-2017 Glider bvba
+ *
  * Based on clk-rcar-gen2.c
+ *
  * Copyright (C) 2013 Ideas On Board SPRL
  */
 
@@ -54,7 +57,6 @@ static const struct cpg_core_clk r8a7791_core_clks[] = {
 
        /* Core Clock Outputs */
        DEF_BASE("z",    R8A7791_CLK_Z,    CLK_TYPE_GEN2_Z,    CLK_PLL0),
-       DEF_BASE("lb",   R8A7791_CLK_LB,   CLK_TYPE_GEN2_LB,   CLK_PLL1),
        DEF_BASE("adsp", R8A7791_CLK_ADSP, CLK_TYPE_GEN2_ADSP, CLK_PLL1),
        DEF_BASE("sdh",  R8A7791_CLK_SDH,  CLK_TYPE_GEN2_SDH,  CLK_PLL1),
        DEF_BASE("sd0",  R8A7791_CLK_SD0,  CLK_TYPE_GEN2_SD0,  CLK_PLL1),
@@ -67,6 +69,7 @@ static const struct cpg_core_clk r8a7791_core_clks[] = {
        DEF_FIXED("hp",     R8A7791_CLK_HP,    CLK_PLL1,         12, 1),
        DEF_FIXED("i",      R8A7791_CLK_I,     CLK_PLL1,          2, 1),
        DEF_FIXED("b",      R8A7791_CLK_B,     CLK_PLL1,         12, 1),
+       DEF_FIXED("lb",     R8A7791_CLK_LB,    CLK_PLL1,         24, 1),
        DEF_FIXED("p",      R8A7791_CLK_P,     CLK_PLL1,         24, 1),
        DEF_FIXED("cl",     R8A7791_CLK_CL,    CLK_PLL1,         48, 1),
        DEF_FIXED("m2",     R8A7791_CLK_M2,    CLK_PLL1,          8, 1),
@@ -125,6 +128,7 @@ static const struct mssr_mod_clk r8a7791_mod_clks[] = {
        DEF_MOD("cmt1",                  329,   R8A7791_CLK_R),
        DEF_MOD("usbhs-dmac0",           330,   R8A7791_CLK_HP),
        DEF_MOD("usbhs-dmac1",           331,   R8A7791_CLK_HP),
+       DEF_MOD("rwdt",                  402,   R8A7791_CLK_R),
        DEF_MOD("irqc",                  407,   R8A7791_CLK_CP),
        DEF_MOD("intc-sys",              408,   R8A7791_CLK_ZS),
        DEF_MOD("audio-dmac1",           501,   R8A7791_CLK_HP),
index 46dd3c9c9161eedbb0691172d067d2bd836b0f1c..fb18ee7aedf06625d2f430c954b8821736a49c00 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a7792 Clock Pulse Generator / Module Standby and Software Reset
  *
@@ -6,10 +7,6 @@
  * Based on clk-rcar-gen2.c
  *
  * Copyright (C) 2013 Ideas On Board SPRL
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <common.h>
@@ -52,7 +49,6 @@ static const struct cpg_core_clk r8a7792_core_clks[] = {
        DEF_FIXED(".pll1_div2", CLK_PLL1_DIV2, CLK_PLL1, 2, 1),
 
        /* Core Clock Outputs */
-       DEF_BASE("lb",   R8A7792_CLK_LB,   CLK_TYPE_GEN2_LB,   CLK_PLL1),
        DEF_BASE("qspi", R8A7792_CLK_QSPI, CLK_TYPE_GEN2_QSPI, CLK_PLL1_DIV2),
 
        DEF_FIXED("z",      R8A7792_CLK_Z,     CLK_PLL0,          1, 1),
@@ -62,6 +58,7 @@ static const struct cpg_core_clk r8a7792_core_clks[] = {
        DEF_FIXED("hp",     R8A7792_CLK_HP,    CLK_PLL1,         12, 1),
        DEF_FIXED("i",      R8A7792_CLK_I,     CLK_PLL1,          3, 1),
        DEF_FIXED("b",      R8A7792_CLK_B,     CLK_PLL1,         12, 1),
+       DEF_FIXED("lb",     R8A7792_CLK_LB,    CLK_PLL1,         24, 1),
        DEF_FIXED("p",      R8A7792_CLK_P,     CLK_PLL1,         24, 1),
        DEF_FIXED("cl",     R8A7792_CLK_CL,    CLK_PLL1,         48, 1),
        DEF_FIXED("m2",     R8A7792_CLK_M2,    CLK_PLL1,          8, 1),
@@ -97,6 +94,7 @@ static const struct mssr_mod_clk r8a7792_mod_clks[] = {
        DEF_MOD("tpu0",                  304,   R8A7792_CLK_CP),
        DEF_MOD("sdhi0",                 314,   R8A7792_CLK_SD),
        DEF_MOD("cmt1",                  329,   R8A7792_CLK_R),
+       DEF_MOD("rwdt",                  402,   R8A7792_CLK_R),
        DEF_MOD("irqc",                  407,   R8A7792_CLK_CP),
        DEF_MOD("intc-sys",              408,   R8A7792_CLK_ZS),
        DEF_MOD("audio-dmac0",           502,   R8A7792_CLK_HP),
index e8f57c3d015041438709e998d0587fbb16eef6b0..b6be1bc0323d41a04617905bf9d14305710cef1f 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a7794 Clock Pulse Generator / Module Standby and Software Reset
  *
@@ -6,10 +7,6 @@
  * Based on clk-rcar-gen2.c
  *
  * Copyright (C) 2013 Ideas On Board SPRL
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <common.h>
@@ -54,7 +51,6 @@ static const struct cpg_core_clk r8a7794_core_clks[] = {
        DEF_FIXED(".pll1_div2", CLK_PLL1_DIV2, CLK_PLL1, 2, 1),
 
        /* Core Clock Outputs */
-       DEF_BASE("lb",   R8A7794_CLK_LB,   CLK_TYPE_GEN2_LB,   CLK_PLL1),
        DEF_BASE("adsp", R8A7794_CLK_ADSP, CLK_TYPE_GEN2_ADSP, CLK_PLL1),
        DEF_BASE("sdh",  R8A7794_CLK_SDH,  CLK_TYPE_GEN2_SDH,  CLK_PLL1),
        DEF_BASE("sd0",  R8A7794_CLK_SD0,  CLK_TYPE_GEN2_SD0,  CLK_PLL1),
@@ -68,6 +64,7 @@ static const struct cpg_core_clk r8a7794_core_clks[] = {
        DEF_FIXED("hp",     R8A7794_CLK_HP,    CLK_PLL1,         12, 1),
        DEF_FIXED("i",      R8A7794_CLK_I,     CLK_PLL1,          2, 1),
        DEF_FIXED("b",      R8A7794_CLK_B,     CLK_PLL1,         12, 1),
+       DEF_FIXED("lb",     R8A7794_CLK_LB,    CLK_PLL1,         24, 1),
        DEF_FIXED("p",      R8A7794_CLK_P,     CLK_PLL1,         24, 1),
        DEF_FIXED("cl",     R8A7794_CLK_CL,    CLK_PLL1,         48, 1),
        DEF_FIXED("cp",     R8A7794_CLK_CP,    CLK_PLL1,         48, 1),
@@ -120,6 +117,7 @@ static const struct mssr_mod_clk r8a7794_mod_clks[] = {
        DEF_MOD("cmt1",                  329,   R8A7794_CLK_R),
        DEF_MOD("usbhs-dmac0",           330,   R8A7794_CLK_HP),
        DEF_MOD("usbhs-dmac1",           331,   R8A7794_CLK_HP),
+       DEF_MOD("rwdt",                  402,   R8A7794_CLK_R),
        DEF_MOD("irqc",                  407,   R8A7794_CLK_CP),
        DEF_MOD("intc-sys",              408,   R8A7794_CLK_ZS),
        DEF_MOD("audio-dmac0",           502,   R8A7794_CLK_HP),
index 16a10243a64cc2625f4e2e95e14e8d297deb60b4..ab4747ee14be7b73fe615a05fb5e5b46a1d12c3f 100644 (file)
@@ -1,13 +1,12 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: GPL-2.0
 /*
- * Renesas R8A7795 CPG MSSR driver
+ * r8a7795 Clock Pulse Generator / Module Standby and Software Reset
  *
- * Copyright (C) 2017-2018 Marek Vasut <marek.vasut@gmail.com>
+ * Copyright (C) 2015 Glider bvba
  *
- * Based on the following driver from Linux kernel:
- * r8a7796 Clock Pulse Generator / Module Standby and Software Reset
+ * Based on clk-rcar-gen3.c
  *
- * Copyright (C) 2016 Glider bvba
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 
 #include <common.h>
@@ -71,7 +70,11 @@ static const struct cpg_core_clk r8a7795_core_clks[] = {
        DEF_FIXED(".sdsrc",     CLK_SDSRC,         CLK_PLL1_DIV2,  2, 1),
        DEF_FIXED(".rpcsrc",    CLK_RPCSRC,        CLK_PLL1,       2, 1),
 
+       DEF_GEN3_OSC(".r",      CLK_RINT,          CLK_EXTAL,      32),
+
        /* Core Clock Outputs */
+       DEF_BASE("z",           R8A7795_CLK_Z,     CLK_TYPE_GEN3_Z, CLK_PLL0),
+       DEF_BASE("z2",          R8A7795_CLK_Z2,    CLK_TYPE_GEN3_Z2, CLK_PLL2),
        DEF_FIXED("ztr",        R8A7795_CLK_ZTR,   CLK_PLL1_DIV2,  6, 1),
        DEF_FIXED("ztrd2",      R8A7795_CLK_ZTRD2, CLK_PLL1_DIV2, 12, 1),
        DEF_FIXED("zt",         R8A7795_CLK_ZT,    CLK_PLL1_DIV2,  4, 1),
@@ -101,9 +104,16 @@ static const struct cpg_core_clk r8a7795_core_clks[] = {
        DEF_GEN3_RPC("rpc",     R8A7795_CLK_RPC,   CLK_RPCSRC,    0x238),
 
        DEF_FIXED("cl",         R8A7795_CLK_CL,    CLK_PLL1_DIV2, 48, 1),
+       DEF_FIXED("cr",         R8A7795_CLK_CR,    CLK_PLL1_DIV4,  2, 1),
        DEF_FIXED("cp",         R8A7795_CLK_CP,    CLK_EXTAL,      2, 1),
+       DEF_FIXED("cpex",       R8A7795_CLK_CPEX,  CLK_EXTAL,      2, 1),
+
+       DEF_DIV6P1("canfd",     R8A7795_CLK_CANFD, CLK_PLL1_DIV4, 0x244),
+       DEF_DIV6P1("csi0",      R8A7795_CLK_CSI0,  CLK_PLL1_DIV4, 0x00c),
+       DEF_DIV6P1("mso",       R8A7795_CLK_MSO,   CLK_PLL1_DIV4, 0x014),
+       DEF_DIV6P1("hdmi",      R8A7795_CLK_HDMI,  CLK_PLL1_DIV4, 0x250),
 
-       /* NOTE: HDMI, CSI, CAN etc. clock are missing */
+       DEF_GEN3_OSC("osc",     R8A7795_CLK_OSC,   CLK_EXTAL,     8),
 
        DEF_BASE("r",           R8A7795_CLK_R,     CLK_TYPE_GEN3_R, CLK_RINT),
 };
@@ -124,6 +134,7 @@ static const struct mssr_mod_clk r8a7795_mod_clks[] = {
        DEF_MOD("sys-dmac2",             217,   R8A7795_CLK_S0D3),
        DEF_MOD("sys-dmac1",             218,   R8A7795_CLK_S0D3),
        DEF_MOD("sys-dmac0",             219,   R8A7795_CLK_S0D3),
+       DEF_MOD("sceg-pub",              229,   R8A7795_CLK_CR),
        DEF_MOD("cmt3",                  300,   R8A7795_CLK_R),
        DEF_MOD("cmt2",                  301,   R8A7795_CLK_R),
        DEF_MOD("cmt1",                  302,   R8A7795_CLK_R),
@@ -143,7 +154,7 @@ static const struct mssr_mod_clk r8a7795_mod_clks[] = {
        DEF_MOD("usb-dmac1",             331,   R8A7795_CLK_S3D1),
        DEF_MOD("rwdt",                  402,   R8A7795_CLK_R),
        DEF_MOD("intc-ex",               407,   R8A7795_CLK_CP),
-       DEF_MOD("intc-ap",               408,   R8A7795_CLK_S3D1),
+       DEF_MOD("intc-ap",               408,   R8A7795_CLK_S0D3),
        DEF_MOD("audmac1",               501,   R8A7795_CLK_S0D3),
        DEF_MOD("audmac0",               502,   R8A7795_CLK_S0D3),
        DEF_MOD("drif7",                 508,   R8A7795_CLK_S3D2),
@@ -269,25 +280,25 @@ static const struct mssr_mod_clk r8a7795_mod_clks[] = {
  */
 
 /*
- *   MD                EXTAL           PLL0    PLL1    PLL2    PLL3    PLL4
+ *   MD                EXTAL           PLL0    PLL1    PLL2    PLL3    PLL4    OSC
  * 14 13 19 17 (MHz)
- *-------------------------------------------------------------------
- * 0  0  0  0  16.66 x 1       x180    x192    x144    x192    x144
- * 0  0  0  1  16.66 x 1       x180    x192    x144    x128    x144
+ *-------------------------------------------------------------------------
+ * 0  0  0  0  16.66 x 1       x180    x192    x144    x192    x144    /16
+ * 0  0  0  1  16.66 x 1       x180    x192    x144    x128    x144    /16
  * 0  0  1  0  Prohibited setting
- * 0  0  1  1  16.66 x 1       x180    x192    x144    x192    x144
- * 0  1  0  0  20    x 1       x150    x160    x120    x160    x120
- * 0  1  0  1  20    x 1       x150    x160    x120    x106    x120
+ * 0  0  1  1  16.66 x 1       x180    x192    x144    x192    x144    /16
+ * 0  1  0  0  20    x 1       x150    x160    x120    x160    x120    /19
+ * 0  1  0  1  20    x 1       x150    x160    x120    x106    x120    /19
  * 0  1  1  0  Prohibited setting
- * 0  1  1  1  20    x 1       x150    x160    x120    x160    x120
- * 1  0  0  0  25    x 1       x120    x128    x96     x128    x96
- * 1  0  0  1  25    x 1       x120    x128    x96     x84     x96
+ * 0  1  1  1  20    x 1       x150    x160    x120    x160    x120    /19
+ * 1  0  0  0  25    x 1       x120    x128    x96     x128    x96     /24
+ * 1  0  0  1  25    x 1       x120    x128    x96     x84     x96     /24
  * 1  0  1  0  Prohibited setting
- * 1  0  1  1  25    x 1       x120    x128    x96     x128    x96
- * 1  1  0  0  33.33 / 2       x180    x192    x144    x192    x144
- * 1  1  0  1  33.33 / 2       x180    x192    x144    x128    x144
+ * 1  0  1  1  25    x 1       x120    x128    x96     x128    x96     /24
+ * 1  1  0  0  33.33 / 2       x180    x192    x144    x192    x144    /32
+ * 1  1  0  1  33.33 / 2       x180    x192    x144    x128    x144    /32
  * 1  1  1  0  Prohibited setting
- * 1  1  1  1  33.33 / 2       x180    x192    x144    x192    x144
+ * 1  1  1  1  33.33 / 2       x180    x192    x144    x192    x144    /32
  */
 #define CPG_PLL_CONFIG_INDEX(md)       ((((md) & BIT(14)) >> 11) | \
                                         (((md) & BIT(13)) >> 11) | \
@@ -295,23 +306,23 @@ static const struct mssr_mod_clk r8a7795_mod_clks[] = {
                                         (((md) & BIT(17)) >> 17))
 
 static const struct rcar_gen3_cpg_pll_config cpg_pll_configs[16] = {
-       /* EXTAL div    PLL1 mult/div   PLL3 mult/div */
-       { 1,            192,    1,      192,    1,      },
-       { 1,            192,    1,      128,    1,      },
-       { 0, /* Prohibited setting */                   },
-       { 1,            192,    1,      192,    1,      },
-       { 1,            160,    1,      160,    1,      },
-       { 1,            160,    1,      106,    1,      },
-       { 0, /* Prohibited setting */                   },
-       { 1,            160,    1,      160,    1,      },
-       { 1,            128,    1,      128,    1,      },
-       { 1,            128,    1,      84,     1,      },
-       { 0, /* Prohibited setting */                   },
-       { 1,            128,    1,      128,    1,      },
-       { 2,            192,    1,      192,    1,      },
-       { 2,            192,    1,      128,    1,      },
-       { 0, /* Prohibited setting */                   },
-       { 2,            192,    1,      192,    1,      },
+       /* EXTAL div    PLL1 mult/div   PLL3 mult/div   OSC prediv */
+       { 1,            192,    1,      192,    1,      16,     },
+       { 1,            192,    1,      128,    1,      16,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            192,    1,      192,    1,      16,     },
+       { 1,            160,    1,      160,    1,      19,     },
+       { 1,            160,    1,      106,    1,      19,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            160,    1,      160,    1,      19,     },
+       { 1,            128,    1,      128,    1,      24,     },
+       { 1,            128,    1,      84,     1,      24,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            128,    1,      128,    1,      24,     },
+       { 2,            192,    1,      192,    1,      32,     },
+       { 2,            192,    1,      128,    1,      32,     },
+       { 0, /* Prohibited setting */                           },
+       { 2,            192,    1,      192,    1,      32,     },
 };
 
 static const struct mstp_stop_table r8a7795_mstp_table[] = {
index 8115c65eb9f341757b13d4e10bee4933ba9209e3..253a9143b7a49d29637620e3f11ce5ff0562acad 100644 (file)
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Renesas R8A7796 CPG MSSR driver
  *
@@ -8,6 +8,11 @@
  * r8a7796 Clock Pulse Generator / Module Standby and Software Reset
  *
  * Copyright (C) 2016 Glider bvba
+ *
+ * Based on r8a7795-cpg-mssr.c
+ *
+ * Copyright (C) 2015 Glider bvba
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 
 #include <common.h>
@@ -71,7 +76,11 @@ static const struct cpg_core_clk r8a7796_core_clks[] = {
        DEF_FIXED(".sdsrc",     CLK_SDSRC,         CLK_PLL1_DIV2,  2, 1),
        DEF_FIXED(".rpcsrc",    CLK_RPCSRC,        CLK_PLL1,       2, 1),
 
+       DEF_GEN3_OSC(".r",      CLK_RINT,          CLK_EXTAL,      32),
+
        /* Core Clock Outputs */
+       DEF_BASE("z",           R8A7796_CLK_Z,     CLK_TYPE_GEN3_Z, CLK_PLL0),
+       DEF_BASE("z2",          R8A7796_CLK_Z2,    CLK_TYPE_GEN3_Z2, CLK_PLL2),
        DEF_FIXED("ztr",        R8A7796_CLK_ZTR,   CLK_PLL1_DIV2,  6, 1),
        DEF_FIXED("ztrd2",      R8A7796_CLK_ZTRD2, CLK_PLL1_DIV2, 12, 1),
        DEF_FIXED("zt",         R8A7796_CLK_ZT,    CLK_PLL1_DIV2,  4, 1),
@@ -102,13 +111,20 @@ static const struct cpg_core_clk r8a7796_core_clks[] = {
 
        DEF_FIXED("cl",         R8A7796_CLK_CL,    CLK_PLL1_DIV2, 48, 1),
        DEF_FIXED("cp",         R8A7796_CLK_CP,    CLK_EXTAL,      2, 1),
+       DEF_FIXED("cpex",       R8A7796_CLK_CPEX,  CLK_EXTAL,      2, 1),
 
-       /* NOTE: HDMI, CSI, CAN etc. clock are missing */
+       DEF_DIV6P1("canfd",     R8A7796_CLK_CANFD, CLK_PLL1_DIV4, 0x244),
+       DEF_DIV6P1("csi0",      R8A7796_CLK_CSI0,  CLK_PLL1_DIV4, 0x00c),
+       DEF_DIV6P1("mso",       R8A7796_CLK_MSO,   CLK_PLL1_DIV4, 0x014),
+       DEF_DIV6P1("hdmi",      R8A7796_CLK_HDMI,  CLK_PLL1_DIV4, 0x250),
+
+       DEF_GEN3_OSC("osc",     R8A7796_CLK_OSC,   CLK_EXTAL,     8),
 
        DEF_BASE("r",           R8A7796_CLK_R,     CLK_TYPE_GEN3_R, CLK_RINT),
 };
 
 static const struct mssr_mod_clk r8a7796_mod_clks[] = {
+       DEF_MOD("fdp1-0",                119,   R8A7796_CLK_S0D1),
        DEF_MOD("scif5",                 202,   R8A7796_CLK_S3D4),
        DEF_MOD("scif4",                 203,   R8A7796_CLK_S3D4),
        DEF_MOD("scif3",                 204,   R8A7796_CLK_S3D4),
@@ -137,7 +153,7 @@ static const struct mssr_mod_clk r8a7796_mod_clks[] = {
        DEF_MOD("usb-dmac1",             331,   R8A7796_CLK_S3D1),
        DEF_MOD("rwdt",                  402,   R8A7796_CLK_R),
        DEF_MOD("intc-ex",               407,   R8A7796_CLK_CP),
-       DEF_MOD("intc-ap",               408,   R8A7796_CLK_S3D1),
+       DEF_MOD("intc-ap",               408,   R8A7796_CLK_S0D3),
        DEF_MOD("audmac1",               501,   R8A7796_CLK_S0D3),
        DEF_MOD("audmac0",               502,   R8A7796_CLK_S0D3),
        DEF_MOD("drif7",                 508,   R8A7796_CLK_S3D2),
@@ -242,25 +258,25 @@ static const struct mssr_mod_clk r8a7796_mod_clks[] = {
  */
 
 /*
- *   MD                EXTAL           PLL0    PLL1    PLL2    PLL3    PLL4
+ *   MD                EXTAL           PLL0    PLL1    PLL2    PLL3    PLL4    OSC
  * 14 13 19 17 (MHz)
- *-------------------------------------------------------------------
- * 0  0  0  0  16.66 x 1       x180    x192    x144    x192    x144
- * 0  0  0  1  16.66 x 1       x180    x192    x144    x128    x144
+ *-------------------------------------------------------------------------
+ * 0  0  0  0  16.66 x 1       x180    x192    x144    x192    x144    /16
+ * 0  0  0  1  16.66 x 1       x180    x192    x144    x128    x144    /16
  * 0  0  1  0  Prohibited setting
- * 0  0  1  1  16.66 x 1       x180    x192    x144    x192    x144
- * 0  1  0  0  20    x 1       x150    x160    x120    x160    x120
- * 0  1  0  1  20    x 1       x150    x160    x120    x106    x120
+ * 0  0  1  1  16.66 x 1       x180    x192    x144    x192    x144    /16
+ * 0  1  0  0  20    x 1       x150    x160    x120    x160    x120    /19
+ * 0  1  0  1  20    x 1       x150    x160    x120    x106    x120    /19
  * 0  1  1  0  Prohibited setting
- * 0  1  1  1  20    x 1       x150    x160    x120    x160    x120
- * 1  0  0  0  25    x 1       x120    x128    x96     x128    x96
- * 1  0  0  1  25    x 1       x120    x128    x96     x84     x96
+ * 0  1  1  1  20    x 1       x150    x160    x120    x160    x120    /19
+ * 1  0  0  0  25    x 1       x120    x128    x96     x128    x96     /24
+ * 1  0  0  1  25    x 1       x120    x128    x96     x84     x96     /24
  * 1  0  1  0  Prohibited setting
- * 1  0  1  1  25    x 1       x120    x128    x96     x128    x96
- * 1  1  0  0  33.33 / 2       x180    x192    x144    x192    x144
- * 1  1  0  1  33.33 / 2       x180    x192    x144    x128    x144
+ * 1  0  1  1  25    x 1       x120    x128    x96     x128    x96     /24
+ * 1  1  0  0  33.33 / 2       x180    x192    x144    x192    x144    /32
+ * 1  1  0  1  33.33 / 2       x180    x192    x144    x128    x144    /32
  * 1  1  1  0  Prohibited setting
- * 1  1  1  1  33.33 / 2       x180    x192    x144    x192    x144
+ * 1  1  1  1  33.33 / 2       x180    x192    x144    x192    x144    /32
  */
 #define CPG_PLL_CONFIG_INDEX(md)       ((((md) & BIT(14)) >> 11) | \
                                         (((md) & BIT(13)) >> 11) | \
@@ -268,23 +284,23 @@ static const struct mssr_mod_clk r8a7796_mod_clks[] = {
                                         (((md) & BIT(17)) >> 17))
 
 static const struct rcar_gen3_cpg_pll_config cpg_pll_configs[16] = {
-       /* EXTAL div    PLL1 mult/div   PLL3 mult/div */
-       { 1,            192,    1,      192,    1,      },
-       { 1,            192,    1,      128,    1,      },
-       { 0, /* Prohibited setting */                   },
-       { 1,            192,    1,      192,    1,      },
-       { 1,            160,    1,      160,    1,      },
-       { 1,            160,    1,      106,    1,      },
-       { 0, /* Prohibited setting */                   },
-       { 1,            160,    1,      160,    1,      },
-       { 1,            128,    1,      128,    1,      },
-       { 1,            128,    1,      84,     1,      },
-       { 0, /* Prohibited setting */                   },
-       { 1,            128,    1,      128,    1,      },
-       { 2,            192,    1,      192,    1,      },
-       { 2,            192,    1,      128,    1,      },
-       { 0, /* Prohibited setting */                   },
-       { 2,            192,    1,      192,    1,      },
+       /* EXTAL div    PLL1 mult/div   PLL3 mult/div   OSC prediv */
+       { 1,            192,    1,      192,    1,      16,     },
+       { 1,            192,    1,      128,    1,      16,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            192,    1,      192,    1,      16,     },
+       { 1,            160,    1,      160,    1,      19,     },
+       { 1,            160,    1,      106,    1,      19,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            160,    1,      160,    1,      19,     },
+       { 1,            128,    1,      128,    1,      24,     },
+       { 1,            128,    1,      84,     1,      24,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            128,    1,      128,    1,      24,     },
+       { 2,            192,    1,      192,    1,      32,     },
+       { 2,            192,    1,      128,    1,      32,     },
+       { 0, /* Prohibited setting */                           },
+       { 2,            192,    1,      192,    1,      32,     },
 };
 
 static const struct mstp_stop_table r8a7796_mstp_table[] = {
@@ -322,30 +338,11 @@ static const struct cpg_mssr_info r8a7796_cpg_mssr_info = {
        .get_pll_config         = r8a7796_get_pll_config,
 };
 
-static const struct cpg_mssr_info r8a77965_cpg_mssr_info = {
-       .core_clk               = r8a7796_core_clks,
-       .core_clk_size          = ARRAY_SIZE(r8a7796_core_clks),
-       .mod_clk                = r8a7796_mod_clks,
-       .mod_clk_size           = ARRAY_SIZE(r8a7796_mod_clks),
-       .mstp_table             = r8a7796_mstp_table,
-       .mstp_table_size        = ARRAY_SIZE(r8a7796_mstp_table),
-       .reset_node             = "renesas,r8a77965-rst",
-       .extalr_node            = "extalr",
-       .mod_clk_base           = MOD_CLK_BASE,
-       .clk_extal_id           = CLK_EXTAL,
-       .clk_extalr_id          = CLK_EXTALR,
-       .get_pll_config         = r8a7796_get_pll_config,
-};
-
 static const struct udevice_id r8a7796_clk_ids[] = {
        {
                .compatible     = "renesas,r8a7796-cpg-mssr",
                .data           = (ulong)&r8a7796_cpg_mssr_info,
        },
-       {
-               .compatible     = "renesas,r8a77965-cpg-mssr",
-               .data           = (ulong)&r8a77965_cpg_mssr_info,
-       },
        { }
 };
 
diff --git a/drivers/clk/renesas/r8a77965-cpg-mssr.c b/drivers/clk/renesas/r8a77965-cpg-mssr.c
new file mode 100644 (file)
index 0000000..bd36ea3
--- /dev/null
@@ -0,0 +1,355 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * r8a77965 Clock Pulse Generator / Module Standby and Software Reset
+ *
+ * Copyright (C) 2018 Jacopo Mondi <jacopo+renesas@jmondi.org>
+ *
+ * Based on r8a7795-cpg-mssr.c
+ *
+ * Copyright (C) 2015 Glider bvba
+ * Copyright (C) 2015 Renesas Electronics Corp.
+ */
+
+#include <common.h>
+#include <clk-uclass.h>
+#include <dm.h>
+
+#include <dt-bindings/clock/r8a77965-cpg-mssr.h>
+
+#include "renesas-cpg-mssr.h"
+#include "rcar-gen3-cpg.h"
+
+enum clk_ids {
+       /* Core Clock Outputs exported to DT */
+       LAST_DT_CORE_CLK = R8A77965_CLK_OSC,
+
+       /* External Input Clocks */
+       CLK_EXTAL,
+       CLK_EXTALR,
+
+       /* Internal Core Clocks */
+       CLK_MAIN,
+       CLK_PLL0,
+       CLK_PLL1,
+       CLK_PLL3,
+       CLK_PLL4,
+       CLK_PLL1_DIV2,
+       CLK_PLL1_DIV4,
+       CLK_S0,
+       CLK_S1,
+       CLK_S2,
+       CLK_S3,
+       CLK_SDSRC,
+       CLK_RPCSRC,
+       CLK_SSPSRC,
+       CLK_RINT,
+
+       /* Module Clocks */
+       MOD_CLK_BASE
+};
+
+static const struct cpg_core_clk r8a77965_core_clks[] = {
+       /* External Clock Inputs */
+       DEF_INPUT("extal",      CLK_EXTAL),
+       DEF_INPUT("extalr",     CLK_EXTALR),
+
+       /* Internal Core Clocks */
+       DEF_BASE(".main",       CLK_MAIN, CLK_TYPE_GEN3_MAIN, CLK_EXTAL),
+       DEF_BASE(".pll0",       CLK_PLL0, CLK_TYPE_GEN3_PLL0, CLK_MAIN),
+       DEF_BASE(".pll1",       CLK_PLL1, CLK_TYPE_GEN3_PLL1, CLK_MAIN),
+       DEF_BASE(".pll3",       CLK_PLL3, CLK_TYPE_GEN3_PLL3, CLK_MAIN),
+       DEF_BASE(".pll4",       CLK_PLL4, CLK_TYPE_GEN3_PLL4, CLK_MAIN),
+
+       DEF_FIXED(".pll1_div2", CLK_PLL1_DIV2,          CLK_PLL1,       2, 1),
+       DEF_FIXED(".pll1_div4", CLK_PLL1_DIV4,          CLK_PLL1_DIV2,  2, 1),
+       DEF_FIXED(".s0",        CLK_S0,                 CLK_PLL1_DIV2,  2, 1),
+       DEF_FIXED(".s1",        CLK_S1,                 CLK_PLL1_DIV2,  3, 1),
+       DEF_FIXED(".s2",        CLK_S2,                 CLK_PLL1_DIV2,  4, 1),
+       DEF_FIXED(".s3",        CLK_S3,                 CLK_PLL1_DIV2,  6, 1),
+       DEF_FIXED(".sdsrc",     CLK_SDSRC,              CLK_PLL1_DIV2,  2, 1),
+       DEF_FIXED(".rpcsrc",    CLK_RPCSRC,             CLK_PLL1,       2, 1),
+
+       DEF_GEN3_OSC(".r",      CLK_RINT,               CLK_EXTAL,      32),
+
+       /* Core Clock Outputs */
+       DEF_BASE("z",           R8A77965_CLK_Z,         CLK_TYPE_GEN3_Z, CLK_PLL0),
+       DEF_FIXED("ztr",        R8A77965_CLK_ZTR,       CLK_PLL1_DIV2,  6, 1),
+       DEF_FIXED("ztrd2",      R8A77965_CLK_ZTRD2,     CLK_PLL1_DIV2,  12, 1),
+       DEF_FIXED("zt",         R8A77965_CLK_ZT,        CLK_PLL1_DIV2,  4, 1),
+       DEF_FIXED("zx",         R8A77965_CLK_ZX,        CLK_PLL1_DIV2,  2, 1),
+       DEF_FIXED("s0d1",       R8A77965_CLK_S0D1,      CLK_S0,         1, 1),
+       DEF_FIXED("s0d2",       R8A77965_CLK_S0D2,      CLK_S0,         2, 1),
+       DEF_FIXED("s0d3",       R8A77965_CLK_S0D3,      CLK_S0,         3, 1),
+       DEF_FIXED("s0d4",       R8A77965_CLK_S0D4,      CLK_S0,         4, 1),
+       DEF_FIXED("s0d6",       R8A77965_CLK_S0D6,      CLK_S0,         6, 1),
+       DEF_FIXED("s0d8",       R8A77965_CLK_S0D8,      CLK_S0,         8, 1),
+       DEF_FIXED("s0d12",      R8A77965_CLK_S0D12,     CLK_S0,         12, 1),
+       DEF_FIXED("s1d1",       R8A77965_CLK_S1D1,      CLK_S1,         1, 1),
+       DEF_FIXED("s1d2",       R8A77965_CLK_S1D2,      CLK_S1,         2, 1),
+       DEF_FIXED("s1d4",       R8A77965_CLK_S1D4,      CLK_S1,         4, 1),
+       DEF_FIXED("s2d1",       R8A77965_CLK_S2D1,      CLK_S2,         1, 1),
+       DEF_FIXED("s2d2",       R8A77965_CLK_S2D2,      CLK_S2,         2, 1),
+       DEF_FIXED("s2d4",       R8A77965_CLK_S2D4,      CLK_S2,         4, 1),
+       DEF_FIXED("s3d1",       R8A77965_CLK_S3D1,      CLK_S3,         1, 1),
+       DEF_FIXED("s3d2",       R8A77965_CLK_S3D2,      CLK_S3,         2, 1),
+       DEF_FIXED("s3d4",       R8A77965_CLK_S3D4,      CLK_S3,         4, 1),
+
+       DEF_GEN3_SD("sd0",      R8A77965_CLK_SD0,       CLK_SDSRC,      0x074),
+       DEF_GEN3_SD("sd1",      R8A77965_CLK_SD1,       CLK_SDSRC,      0x078),
+       DEF_GEN3_SD("sd2",      R8A77965_CLK_SD2,       CLK_SDSRC,      0x268),
+       DEF_GEN3_SD("sd3",      R8A77965_CLK_SD3,       CLK_SDSRC,      0x26c),
+
+       DEF_GEN3_RPC("rpc",     R8A77965_CLK_RPC,       CLK_RPCSRC,     0x238),
+
+       DEF_FIXED("cl",         R8A77965_CLK_CL,        CLK_PLL1_DIV2,  48, 1),
+       DEF_FIXED("cp",         R8A77965_CLK_CP,        CLK_EXTAL,      2, 1),
+       DEF_FIXED("cpex",       R8A77965_CLK_CPEX,      CLK_EXTAL,      2, 1),
+
+       DEF_DIV6P1("canfd",     R8A77965_CLK_CANFD,     CLK_PLL1_DIV4,  0x244),
+       DEF_DIV6P1("csi0",      R8A77965_CLK_CSI0,      CLK_PLL1_DIV4,  0x00c),
+       DEF_DIV6P1("mso",       R8A77965_CLK_MSO,       CLK_PLL1_DIV4,  0x014),
+       DEF_DIV6P1("hdmi",      R8A77965_CLK_HDMI,      CLK_PLL1_DIV4,  0x250),
+
+       DEF_GEN3_OSC("osc",     R8A77965_CLK_OSC,       CLK_EXTAL,      8),
+
+       DEF_BASE("r",           R8A77965_CLK_R, CLK_TYPE_GEN3_R, CLK_RINT),
+};
+
+static const struct mssr_mod_clk r8a77965_mod_clks[] = {
+       DEF_MOD("fdp1-0",               119,    R8A77965_CLK_S0D1),
+       DEF_MOD("scif5",                202,    R8A77965_CLK_S3D4),
+       DEF_MOD("scif4",                203,    R8A77965_CLK_S3D4),
+       DEF_MOD("scif3",                204,    R8A77965_CLK_S3D4),
+       DEF_MOD("scif1",                206,    R8A77965_CLK_S3D4),
+       DEF_MOD("scif0",                207,    R8A77965_CLK_S3D4),
+       DEF_MOD("msiof3",               208,    R8A77965_CLK_MSO),
+       DEF_MOD("msiof2",               209,    R8A77965_CLK_MSO),
+       DEF_MOD("msiof1",               210,    R8A77965_CLK_MSO),
+       DEF_MOD("msiof0",               211,    R8A77965_CLK_MSO),
+       DEF_MOD("sys-dmac2",            217,    R8A77965_CLK_S0D3),
+       DEF_MOD("sys-dmac1",            218,    R8A77965_CLK_S0D3),
+       DEF_MOD("sys-dmac0",            219,    R8A77965_CLK_S0D3),
+
+       DEF_MOD("cmt3",                 300,    R8A77965_CLK_R),
+       DEF_MOD("cmt2",                 301,    R8A77965_CLK_R),
+       DEF_MOD("cmt1",                 302,    R8A77965_CLK_R),
+       DEF_MOD("cmt0",                 303,    R8A77965_CLK_R),
+       DEF_MOD("scif2",                310,    R8A77965_CLK_S3D4),
+       DEF_MOD("sdif3",                311,    R8A77965_CLK_SD3),
+       DEF_MOD("sdif2",                312,    R8A77965_CLK_SD2),
+       DEF_MOD("sdif1",                313,    R8A77965_CLK_SD1),
+       DEF_MOD("sdif0",                314,    R8A77965_CLK_SD0),
+       DEF_MOD("pcie1",                318,    R8A77965_CLK_S3D1),
+       DEF_MOD("pcie0",                319,    R8A77965_CLK_S3D1),
+       DEF_MOD("usb3-if0",             328,    R8A77965_CLK_S3D1),
+       DEF_MOD("usb-dmac0",            330,    R8A77965_CLK_S3D1),
+       DEF_MOD("usb-dmac1",            331,    R8A77965_CLK_S3D1),
+
+       DEF_MOD("rwdt",                 402,    R8A77965_CLK_R),
+       DEF_MOD("intc-ex",              407,    R8A77965_CLK_CP),
+       DEF_MOD("intc-ap",              408,    R8A77965_CLK_S0D3),
+
+       DEF_MOD("audmac1",              501,    R8A77965_CLK_S0D3),
+       DEF_MOD("audmac0",              502,    R8A77965_CLK_S0D3),
+       DEF_MOD("drif7",                508,    R8A77965_CLK_S3D2),
+       DEF_MOD("drif6",                509,    R8A77965_CLK_S3D2),
+       DEF_MOD("drif5",                510,    R8A77965_CLK_S3D2),
+       DEF_MOD("drif4",                511,    R8A77965_CLK_S3D2),
+       DEF_MOD("drif3",                512,    R8A77965_CLK_S3D2),
+       DEF_MOD("drif2",                513,    R8A77965_CLK_S3D2),
+       DEF_MOD("drif1",                514,    R8A77965_CLK_S3D2),
+       DEF_MOD("drif0",                515,    R8A77965_CLK_S3D2),
+       DEF_MOD("hscif4",               516,    R8A77965_CLK_S3D1),
+       DEF_MOD("hscif3",               517,    R8A77965_CLK_S3D1),
+       DEF_MOD("hscif2",               518,    R8A77965_CLK_S3D1),
+       DEF_MOD("hscif1",               519,    R8A77965_CLK_S3D1),
+       DEF_MOD("hscif0",               520,    R8A77965_CLK_S3D1),
+       DEF_MOD("thermal",              522,    R8A77965_CLK_CP),
+       DEF_MOD("pwm",                  523,    R8A77965_CLK_S0D12),
+
+       DEF_MOD("fcpvd1",               602,    R8A77965_CLK_S0D2),
+       DEF_MOD("fcpvd0",               603,    R8A77965_CLK_S0D2),
+       DEF_MOD("fcpvb0",               607,    R8A77965_CLK_S0D1),
+       DEF_MOD("fcpvi0",               611,    R8A77965_CLK_S0D1),
+       DEF_MOD("fcpf0",                615,    R8A77965_CLK_S0D1),
+       DEF_MOD("fcpcs",                619,    R8A77965_CLK_S0D2),
+       DEF_MOD("vspd1",                622,    R8A77965_CLK_S0D2),
+       DEF_MOD("vspd0",                623,    R8A77965_CLK_S0D2),
+       DEF_MOD("vspb",                 626,    R8A77965_CLK_S0D1),
+       DEF_MOD("vspi0",                631,    R8A77965_CLK_S0D1),
+
+       DEF_MOD("ehci1",                702,    R8A77965_CLK_S3D4),
+       DEF_MOD("ehci0",                703,    R8A77965_CLK_S3D4),
+       DEF_MOD("hsusb",                704,    R8A77965_CLK_S3D4),
+       DEF_MOD("csi20",                714,    R8A77965_CLK_CSI0),
+       DEF_MOD("csi40",                716,    R8A77965_CLK_CSI0),
+       DEF_MOD("du3",                  721,    R8A77965_CLK_S2D1),
+       DEF_MOD("du1",                  723,    R8A77965_CLK_S2D1),
+       DEF_MOD("du0",                  724,    R8A77965_CLK_S2D1),
+       DEF_MOD("lvds",                 727,    R8A77965_CLK_S2D1),
+       DEF_MOD("hdmi0",                729,    R8A77965_CLK_HDMI),
+
+       DEF_MOD("vin7",                 804,    R8A77965_CLK_S0D2),
+       DEF_MOD("vin6",                 805,    R8A77965_CLK_S0D2),
+       DEF_MOD("vin5",                 806,    R8A77965_CLK_S0D2),
+       DEF_MOD("vin4",                 807,    R8A77965_CLK_S0D2),
+       DEF_MOD("vin3",                 808,    R8A77965_CLK_S0D2),
+       DEF_MOD("vin2",                 809,    R8A77965_CLK_S0D2),
+       DEF_MOD("vin1",                 810,    R8A77965_CLK_S0D2),
+       DEF_MOD("vin0",                 811,    R8A77965_CLK_S0D2),
+       DEF_MOD("etheravb",             812,    R8A77965_CLK_S0D6),
+       DEF_MOD("sata0",                815,    R8A77965_CLK_S3D2),
+       DEF_MOD("imr1",                 822,    R8A77965_CLK_S0D2),
+       DEF_MOD("imr0",                 823,    R8A77965_CLK_S0D2),
+
+       DEF_MOD("gpio7",                905,    R8A77965_CLK_S3D4),
+       DEF_MOD("gpio6",                906,    R8A77965_CLK_S3D4),
+       DEF_MOD("gpio5",                907,    R8A77965_CLK_S3D4),
+       DEF_MOD("gpio4",                908,    R8A77965_CLK_S3D4),
+       DEF_MOD("gpio3",                909,    R8A77965_CLK_S3D4),
+       DEF_MOD("gpio2",                910,    R8A77965_CLK_S3D4),
+       DEF_MOD("gpio1",                911,    R8A77965_CLK_S3D4),
+       DEF_MOD("gpio0",                912,    R8A77965_CLK_S3D4),
+       DEF_MOD("can-fd",               914,    R8A77965_CLK_S3D2),
+       DEF_MOD("can-if1",              915,    R8A77965_CLK_S3D4),
+       DEF_MOD("can-if0",              916,    R8A77965_CLK_S3D4),
+       DEF_MOD("rpc",                  917,    R8A77965_CLK_RPC),
+       DEF_MOD("i2c6",                 918,    R8A77965_CLK_S0D6),
+       DEF_MOD("i2c5",                 919,    R8A77965_CLK_S0D6),
+       DEF_MOD("i2c-dvfs",             926,    R8A77965_CLK_CP),
+       DEF_MOD("i2c4",                 927,    R8A77965_CLK_S0D6),
+       DEF_MOD("i2c3",                 928,    R8A77965_CLK_S0D6),
+       DEF_MOD("i2c2",                 929,    R8A77965_CLK_S3D2),
+       DEF_MOD("i2c1",                 930,    R8A77965_CLK_S3D2),
+       DEF_MOD("i2c0",                 931,    R8A77965_CLK_S3D2),
+
+       DEF_MOD("ssi-all",              1005,   R8A77965_CLK_S3D4),
+       DEF_MOD("ssi9",                 1006,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi8",                 1007,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi7",                 1008,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi6",                 1009,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi5",                 1010,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi4",                 1011,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi3",                 1012,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi2",                 1013,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi1",                 1014,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi0",                 1015,   MOD_CLK_ID(1005)),
+       DEF_MOD("scu-all",              1017,   R8A77965_CLK_S3D4),
+       DEF_MOD("scu-dvc1",             1018,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-dvc0",             1019,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-ctu1-mix1",        1020,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-ctu0-mix0",        1021,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src9",             1022,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src8",             1023,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src7",             1024,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src6",             1025,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src5",             1026,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src4",             1027,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src3",             1028,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src2",             1029,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src1",             1030,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src0",             1031,   MOD_CLK_ID(1017)),
+};
+
+/*
+ * CPG Clock Data
+ */
+
+/*
+ *   MD                EXTAL           PLL0    PLL1    PLL3    PLL4    OSC
+ * 14 13 19 17 (MHz)
+ *-----------------------------------------------------------------
+ * 0  0  0  0  16.66 x 1       x180    x192    x192    x144    /16
+ * 0  0  0  1  16.66 x 1       x180    x192    x128    x144    /16
+ * 0  0  1  0  Prohibited setting
+ * 0  0  1  1  16.66 x 1       x180    x192    x192    x144    /16
+ * 0  1  0  0  20    x 1       x150    x160    x160    x120    /19
+ * 0  1  0  1  20    x 1       x150    x160    x106    x120    /19
+ * 0  1  1  0  Prohibited setting
+ * 0  1  1  1  20    x 1       x150    x160    x160    x120    /19
+ * 1  0  0  0  25    x 1       x120    x128    x128    x96     /24
+ * 1  0  0  1  25    x 1       x120    x128    x84     x96     /24
+ * 1  0  1  0  Prohibited setting
+ * 1  0  1  1  25    x 1       x120    x128    x128    x96     /24
+ * 1  1  0  0  33.33 / 2       x180    x192    x192    x144    /32
+ * 1  1  0  1  33.33 / 2       x180    x192    x128    x144    /32
+ * 1  1  1  0  Prohibited setting
+ * 1  1  1  1  33.33 / 2       x180    x192    x192    x144    /32
+ */
+#define CPG_PLL_CONFIG_INDEX(md)       ((((md) & BIT(14)) >> 11) | \
+                                        (((md) & BIT(13)) >> 11) | \
+                                        (((md) & BIT(19)) >> 18) | \
+                                        (((md) & BIT(17)) >> 17))
+
+static const struct rcar_gen3_cpg_pll_config cpg_pll_configs[16] = {
+       /* EXTAL div    PLL1 mult/div   PLL3 mult/div   OSC prediv */
+       { 1,            192,    1,      192,    1,      16,     },
+       { 1,            192,    1,      128,    1,      16,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            192,    1,      192,    1,      16,     },
+       { 1,            160,    1,      160,    1,      19,     },
+       { 1,            160,    1,      106,    1,      19,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            160,    1,      160,    1,      19,     },
+       { 1,            128,    1,      128,    1,      24,     },
+       { 1,            128,    1,      84,     1,      24,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            128,    1,      128,    1,      24,     },
+       { 2,            192,    1,      192,    1,      32,     },
+       { 2,            192,    1,      128,    1,      32,     },
+       { 0, /* Prohibited setting */                           },
+       { 2,            192,    1,      192,    1,      32,     },
+};
+
+static const struct mstp_stop_table r8a77965_mstp_table[] = {
+       { 0x00200000, 0x0, 0x00200000, 0 },
+       { 0xFFFFFFFF, 0x0, 0xFFFFFFFF, 0 },
+       { 0x340E2FDC, 0x2040, 0x340E2FDC, 0 },
+       { 0xFFFFFFDF, 0x400, 0xFFFFFFDF, 0 },
+       { 0x80000184, 0x180, 0x80000184, 0 },
+       { 0xC3FFFFFF, 0x0, 0xC3FFFFFF, 0 },
+       { 0xFFFFFFFF, 0x0, 0xFFFFFFFF, 0 },
+       { 0xFFFFFFFF, 0x0, 0xFFFFFFFF, 0 },
+       { 0x01F1FFF7, 0x0, 0x01F1FFF7, 0 },
+       { 0xFFFFFFFE, 0x0, 0xFFFFFFFE, 0 },
+       { 0xFFFEFFE0, 0x0, 0xFFFEFFE0, 0 },
+       { 0x000000B7, 0x0, 0x000000B7, 0 },
+};
+
+static const void *r8a77965_get_pll_config(const u32 cpg_mode)
+{
+       return &cpg_pll_configs[CPG_PLL_CONFIG_INDEX(cpg_mode)];
+}
+
+static const struct cpg_mssr_info r8a77965_cpg_mssr_info = {
+       .core_clk               = r8a77965_core_clks,
+       .core_clk_size          = ARRAY_SIZE(r8a77965_core_clks),
+       .mod_clk                = r8a77965_mod_clks,
+       .mod_clk_size           = ARRAY_SIZE(r8a77965_mod_clks),
+       .mstp_table             = r8a77965_mstp_table,
+       .mstp_table_size        = ARRAY_SIZE(r8a77965_mstp_table),
+       .reset_node             = "renesas,r8a77965-rst",
+       .extalr_node            = "extalr",
+       .mod_clk_base           = MOD_CLK_BASE,
+       .clk_extal_id           = CLK_EXTAL,
+       .clk_extalr_id          = CLK_EXTALR,
+       .get_pll_config         = r8a77965_get_pll_config,
+};
+
+static const struct udevice_id r8a77965_clk_ids[] = {
+       {
+               .compatible     = "renesas,r8a77965-cpg-mssr",
+               .data           = (ulong)&r8a77965_cpg_mssr_info,
+       },
+       { }
+};
+
+U_BOOT_DRIVER(clk_r8a77965) = {
+       .name           = "clk_r8a77965",
+       .id             = UCLASS_CLK,
+       .of_match       = r8a77965_clk_ids,
+       .priv_auto_alloc_size = sizeof(struct gen3_clk_priv),
+       .ops            = &gen3_clk_ops,
+       .probe          = gen3_clk_probe,
+       .remove         = gen3_clk_remove,
+};
index 1198ec5cbfcd892ae8145a2db0c0a5216bf0665f..3168de20f91d61b3adc351e8396e75e3b519975c 100644 (file)
@@ -1,13 +1,13 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: GPL-2.0
 /*
- * Renesas R8A77990 CPG MSSR driver
+ * r8a77990 Clock Pulse Generator / Module Standby and Software Reset
  *
- * Copyright (C) 2017-2018 Marek Vasut <marek.vasut@gmail.com>
+ * Copyright (C) 2018 Renesas Electronics Corp.
  *
- * Based on the following driver from Linux kernel:
- * r8a7796 Clock Pulse Generator / Module Standby and Software Reset
+ * Based on r8a7795-cpg-mssr.c
  *
- * Copyright (C) 2016 Glider bvba
+ * Copyright (C) 2015 Glider bvba
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 
 #include <common.h>
@@ -44,6 +44,8 @@ enum clk_ids {
        CLK_S3,
        CLK_SDSRC,
        CLK_RPCSRC,
+       CLK_RINT,
+       CLK_OCO,
 
        /* Module Clocks */
        MOD_CLK_BASE
@@ -73,6 +75,10 @@ static const struct cpg_core_clk r8a77990_core_clks[] = {
        DEF_FIXED(".sdsrc",    CLK_SDSRC,          CLK_PLL1,       2, 1),
        DEF_FIXED(".rpcsrc",   CLK_RPCSRC,         CLK_PLL1,       2, 1),
 
+       DEF_DIV6_RO(".r",      CLK_RINT,           CLK_EXTAL, CPG_RCKCR, 32),
+
+       DEF_RATE(".oco",       CLK_OCO,            8 * 1000 * 1000),
+
        /* Core Clock Outputs */
        DEF_FIXED("za2",       R8A77990_CLK_ZA2,   CLK_PLL0D24,    1, 1),
        DEF_FIXED("za8",       R8A77990_CLK_ZA8,   CLK_PLL0D8,     1, 1),
@@ -103,10 +109,10 @@ static const struct cpg_core_clk r8a77990_core_clks[] = {
        DEF_FIXED("cl",        R8A77990_CLK_CL,    CLK_PLL1,      48, 1),
        DEF_FIXED("cp",        R8A77990_CLK_CP,    CLK_EXTAL,      2, 1),
        DEF_FIXED("cpex",      R8A77990_CLK_CPEX,  CLK_EXTAL,      4, 1),
-       DEF_FIXED("osc",       R8A77990_CLK_OSC,   CLK_EXTAL,    384, 1),
-       DEF_FIXED("r",         R8A77990_CLK_R,     CLK_EXTAL,   1536, 1),
 
-       DEF_GEN3_PE("s0d6c",   R8A77990_CLK_S0D6C, CLK_S0, 6, CLK_PE, 6),
+       DEF_DIV6_RO("osc",     R8A77990_CLK_OSC,   CLK_EXTAL, CPG_RCKCR,  8),
+
+       DEF_GEN3_PE("s0d6c",   R8A77990_CLK_S0D6C, CLK_S0, 6, CLK_PE, 2),
        DEF_GEN3_PE("s3d1c",   R8A77990_CLK_S3D1C, CLK_S3, 1, CLK_PE, 1),
        DEF_GEN3_PE("s3d2c",   R8A77990_CLK_S3D2C, CLK_S3, 2, CLK_PE, 2),
        DEF_GEN3_PE("s3d4c",   R8A77990_CLK_S3D4C, CLK_S3, 4, CLK_PE, 4),
@@ -114,6 +120,8 @@ static const struct cpg_core_clk r8a77990_core_clks[] = {
        DEF_DIV6P1("canfd",    R8A77990_CLK_CANFD, CLK_PLL0D6, 0x244),
        DEF_DIV6P1("csi0",     R8A77990_CLK_CSI0,  CLK_PLL1D2, 0x00c),
        DEF_DIV6P1("mso",      R8A77990_CLK_MSO,   CLK_PLL1D2, 0x014),
+
+       DEF_GEN3_RCKSEL("r",   R8A77990_CLK_R, CLK_RINT, 1, CLK_OCO, 61 * 4),
 };
 
 static const struct mssr_mod_clk r8a77990_mod_clks[] = {
@@ -178,12 +186,10 @@ static const struct mssr_mod_clk r8a77990_mod_clks[] = {
        DEF_MOD("ehci0",                 703,   R8A77990_CLK_S3D4),
        DEF_MOD("hsusb",                 704,   R8A77990_CLK_S3D4),
        DEF_MOD("csi40",                 716,   R8A77990_CLK_CSI0),
-       DEF_MOD("du1",                   723,   R8A77990_CLK_S2D1),
-       DEF_MOD("du0",                   724,   R8A77990_CLK_S2D1),
+       DEF_MOD("du1",                   723,   R8A77990_CLK_S1D1),
+       DEF_MOD("du0",                   724,   R8A77990_CLK_S1D1),
        DEF_MOD("lvds",                  727,   R8A77990_CLK_S2D1),
 
-       DEF_MOD("vin7",                  804,   R8A77990_CLK_S1D2),
-       DEF_MOD("vin6",                  805,   R8A77990_CLK_S1D2),
        DEF_MOD("vin5",                  806,   R8A77990_CLK_S1D2),
        DEF_MOD("vin4",                  807,   R8A77990_CLK_S1D2),
        DEF_MOD("etheravb",              812,   R8A77990_CLK_S3D2),
@@ -208,6 +214,7 @@ static const struct mssr_mod_clk r8a77990_mod_clks[] = {
        DEF_MOD("i2c1",                  930,   R8A77990_CLK_S3D2),
        DEF_MOD("i2c0",                  931,   R8A77990_CLK_S3D2),
 
+       DEF_MOD("i2c7",                 1003,   R8A77990_CLK_S3D2),
        DEF_MOD("ssi-all",              1005,   R8A77990_CLK_S3D4),
        DEF_MOD("ssi9",                 1006,   MOD_CLK_ID(1005)),
        DEF_MOD("ssi8",                 1007,   MOD_CLK_ID(1005)),
@@ -243,8 +250,8 @@ static const struct mssr_mod_clk r8a77990_mod_clks[] = {
 /*
  * MD19                EXTAL (MHz)     PLL0            PLL1            PLL3
  *--------------------------------------------------------------------
- * 0           48 x 1          x100/4          x100/3          x100/3
- * 1           48 x 1          x100/4          x100/3           x58/3
+ * 0           48 x 1          x100/1          x100/3          x100/3
+ * 1           48 x 1          x100/1          x100/3           x58/3
  */
 #define CPG_PLL_CONFIG_INDEX(md)       (((md) & BIT(19)) >> 19)
 
index e9c3aec96074a3bc0e8c943b9178a0692a6a4e63..1c793709822777ba5db3939cf186c0d585c7d978 100644 (file)
@@ -1,13 +1,13 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: GPL-2.0
 /*
- * Renesas R8A77995 CPG MSSR driver
+ * r8a77995 Clock Pulse Generator / Module Standby and Software Reset
  *
- * Copyright (C) 2017-2018 Marek Vasut <marek.vasut@gmail.com>
+ * Copyright (C) 2017 Glider bvba
  *
- * Based on the following driver from Linux kernel:
- * r8a7796 Clock Pulse Generator / Module Standby and Software Reset
+ * Based on r8a7795-cpg-mssr.c
  *
- * Copyright (C) 2016 Glider bvba
+ * Copyright (C) 2015 Glider bvba
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 
 #include <common.h>
@@ -21,7 +21,7 @@
 
 enum clk_ids {
        /* Core Clock Outputs exported to DT */
-       LAST_DT_CORE_CLK = R8A77995_CLK_CP,
+       LAST_DT_CORE_CLK = R8A77995_CLK_CPEX,
 
        /* External Input Clocks */
        CLK_EXTAL,
@@ -42,7 +42,8 @@ enum clk_ids {
        CLK_S3,
        CLK_SDSRC,
        CLK_RPCSRC,
-       CLK_SSPSRC,
+       CLK_RINT,
+       CLK_OCO,
 
        /* Module Clocks */
        MOD_CLK_BASE
@@ -70,6 +71,10 @@ static const struct cpg_core_clk r8a77995_core_clks[] = {
        DEF_FIXED(".sdsrc",    CLK_SDSRC,          CLK_PLL1,       2, 1),
        DEF_FIXED(".rpcsrc",   CLK_RPCSRC,         CLK_PLL1,       2, 1),
 
+       DEF_DIV6_RO(".r",      CLK_RINT,           CLK_EXTAL, CPG_RCKCR, 32),
+
+       DEF_RATE(".oco",       CLK_OCO,            8 * 1000 * 1000),
+
        /* Core Clock Outputs */
        DEF_FIXED("z2",        R8A77995_CLK_Z2,    CLK_PLL0D3,     1, 1),
        DEF_FIXED("ztr",       R8A77995_CLK_ZTR,   CLK_PLL1,       6, 1),
@@ -88,8 +93,9 @@ static const struct cpg_core_clk r8a77995_core_clks[] = {
 
        DEF_FIXED("cl",        R8A77995_CLK_CL,    CLK_PLL1,      48, 1),
        DEF_FIXED("cp",        R8A77995_CLK_CP,    CLK_EXTAL,      2, 1),
-       DEF_FIXED("osc",       R8A77995_CLK_OSC,   CLK_EXTAL,    384, 1),
-       DEF_FIXED("r",         R8A77995_CLK_R,     CLK_EXTAL,   1536, 1),
+       DEF_FIXED("cpex",      R8A77995_CLK_CPEX,  CLK_EXTAL,      4, 1),
+
+       DEF_DIV6_RO("osc",     R8A77995_CLK_OSC,   CLK_EXTAL, CPG_RCKCR,  8),
 
        DEF_GEN3_RPC("rpc",    R8A77995_CLK_RPC,   CLK_RPCSRC,    0x238),
 
@@ -99,6 +105,11 @@ static const struct cpg_core_clk r8a77995_core_clks[] = {
        DEF_GEN3_PE("s3d4c",   R8A77995_CLK_S3D4C, CLK_S3, 4, CLK_PE, 4),
 
        DEF_GEN3_SD("sd0",     R8A77995_CLK_SD0,   CLK_SDSRC,     0x268),
+
+       DEF_DIV6P1("canfd",    R8A77995_CLK_CANFD, CLK_PLL0D3,    0x244),
+       DEF_DIV6P1("mso",      R8A77995_CLK_MSO,   CLK_PLL1D2,    0x014),
+
+       DEF_GEN3_RCKSEL("r",   R8A77995_CLK_R, CLK_RINT, 1, CLK_OCO, 61 * 4),
 };
 
 static const struct mssr_mod_clk r8a77995_mod_clks[] = {
@@ -124,7 +135,7 @@ static const struct mssr_mod_clk r8a77995_mod_clks[] = {
        DEF_MOD("usb-dmac1",             331,   R8A77995_CLK_S3D1),
        DEF_MOD("rwdt",                  402,   R8A77995_CLK_R),
        DEF_MOD("intc-ex",               407,   R8A77995_CLK_CP),
-       DEF_MOD("intc-ap",               408,   R8A77995_CLK_S3D1),
+       DEF_MOD("intc-ap",               408,   R8A77995_CLK_S1D2),
        DEF_MOD("audmac0",               502,   R8A77995_CLK_S3D1),
        DEF_MOD("hscif3",                517,   R8A77995_CLK_S3D1C),
        DEF_MOD("hscif0",                520,   R8A77995_CLK_S3D1C),
@@ -138,12 +149,9 @@ static const struct mssr_mod_clk r8a77995_mod_clks[] = {
        DEF_MOD("vspbs",                 627,   R8A77995_CLK_S0D1),
        DEF_MOD("ehci0",                 703,   R8A77995_CLK_S3D2),
        DEF_MOD("hsusb",                 704,   R8A77995_CLK_S3D2),
-       DEF_MOD("du1",                   723,   R8A77995_CLK_S2D1),
-       DEF_MOD("du0",                   724,   R8A77995_CLK_S2D1),
+       DEF_MOD("du1",                   723,   R8A77995_CLK_S1D1),
+       DEF_MOD("du0",                   724,   R8A77995_CLK_S1D1),
        DEF_MOD("lvds",                  727,   R8A77995_CLK_S2D1),
-       DEF_MOD("vin7",                  804,   R8A77995_CLK_S1D2),
-       DEF_MOD("vin6",                  805,   R8A77995_CLK_S1D2),
-       DEF_MOD("vin5",                  806,   R8A77995_CLK_S1D2),
        DEF_MOD("vin4",                  807,   R8A77995_CLK_S1D2),
        DEF_MOD("etheravb",              812,   R8A77995_CLK_S3D2),
        DEF_MOD("imr0",                  823,   R8A77995_CLK_S1D2),
@@ -182,14 +190,14 @@ static const struct mssr_mod_clk r8a77995_mod_clks[] = {
  * MD19                EXTAL (MHz)     PLL0            PLL1            PLL3
  *--------------------------------------------------------------------
  * 0           48 x 1          x250/4          x100/3          x100/3
- * 1           48 x 1          x250/4          x100/3          x116/6
+ * 1           48 x 1          x250/4          x100/3          x58/3
  */
 #define CPG_PLL_CONFIG_INDEX(md)       (((md) & BIT(19)) >> 19)
 
 static const struct rcar_gen3_cpg_pll_config cpg_pll_configs[2] = {
        /* EXTAL div    PLL1 mult/div   PLL3 mult/div */
        { 1,            100,    3,      100,    3,      },
-       { 1,            100,    3,      116,    6,      },
+       { 1,            100,    3,      58,     3,      },
 };
 
 static const struct mstp_stop_table r8a77995_mstp_table[] = {
index 58e71f363c895e957c387f30f0a85ae6e7f2527f..7b1b2422155917e96467b3debe48dadd1aa994c3 100644 (file)
@@ -19,21 +19,43 @@ enum rcar_gen3_clk_types {
        CLK_TYPE_GEN3_PLL3,
        CLK_TYPE_GEN3_PLL4,
        CLK_TYPE_GEN3_SD,
-       CLK_TYPE_GEN3_RPC,
        CLK_TYPE_GEN3_R,
-       CLK_TYPE_GEN3_PE,
+       CLK_TYPE_GEN3_MDSEL,    /* Select parent/divider using mode pin */
+       CLK_TYPE_GEN3_Z,
        CLK_TYPE_GEN3_Z2,
+       CLK_TYPE_GEN3_OSC,      /* OSC EXTAL predivider and fixed divider */
+       CLK_TYPE_GEN3_RCKSEL,   /* Select parent/divider using RCKCR.CKSEL */
+       CLK_TYPE_GEN3_RPCSRC,
+       CLK_TYPE_GEN3_RPC,
+       CLK_TYPE_GEN3_RPCD2,
+
+       /* SoC specific definitions start here */
+       CLK_TYPE_GEN3_SOC_BASE,
 };
 
 #define DEF_GEN3_SD(_name, _id, _parent, _offset)      \
        DEF_BASE(_name, _id, CLK_TYPE_GEN3_SD, _parent, .offset = _offset)
+
 #define DEF_GEN3_RPC(_name, _id, _parent, _offset)     \
        DEF_BASE(_name, _id, CLK_TYPE_GEN3_RPC, _parent, .offset = _offset)
+
+#define DEF_GEN3_MDSEL(_name, _id, _md, _parent0, _div0, _parent1, _div1) \
+       DEF_BASE(_name, _id, CLK_TYPE_GEN3_MDSEL,       \
+                (_parent0) << 16 | (_parent1),         \
+                .div = (_div0) << 16 | (_div1), .offset = _md)
+
 #define DEF_GEN3_PE(_name, _id, _parent_sscg, _div_sscg, _parent_clean, \
                    _div_clean) \
-       DEF_BASE(_name, _id, CLK_TYPE_GEN3_PE,                  \
-                (_parent_sscg) << 16 | (_parent_clean),        \
-                .div = (_div_sscg) << 16 | (_div_clean))
+       DEF_GEN3_MDSEL(_name, _id, 12, _parent_sscg, _div_sscg, \
+                      _parent_clean, _div_clean)
+
+#define DEF_GEN3_OSC(_name, _id, _parent, _div)                \
+       DEF_BASE(_name, _id, CLK_TYPE_GEN3_OSC, _parent, .div = _div)
+
+#define DEF_GEN3_RCKSEL(_name, _id, _parent0, _div0, _parent1, _div1) \
+       DEF_BASE(_name, _id, CLK_TYPE_GEN3_RCKSEL,      \
+                (_parent0) << 16 | (_parent1), .div = (_div0) << 16 | (_div1))
+
 
 struct rcar_gen3_cpg_pll_config {
        u8 extal_div;
@@ -41,8 +63,10 @@ struct rcar_gen3_cpg_pll_config {
        u8 pll1_div;
        u8 pll3_mult;
        u8 pll3_div;
+       u8 osc_prediv;
 };
 
+#define CPG_RPCCKCR    0x238
 #define CPG_RCKCR      0x240
 
 struct gen3_clk_priv {
index bad393878511c88d6343d28f8a96d9dee61e1e77..5b7012d37c633b52f3a83ad70b0cc46c7d6bf19d 100644 (file)
@@ -57,6 +57,7 @@ enum clk_types {
        CLK_TYPE_FF,            /* Fixed Factor Clock */
        CLK_TYPE_DIV6P1,        /* DIV6 Clock with 1 parent clock */
        CLK_TYPE_DIV6_RO,       /* DIV6 Clock read only with extra divisor */
+       CLK_TYPE_FR,            /* Fixed Rate Clock */
 
        /* Custom definitions start here */
        CLK_TYPE_CUSTOM,
@@ -75,6 +76,8 @@ enum clk_types {
        DEF_BASE(_name, _id, CLK_TYPE_DIV6P1, _parent, .offset = _offset)
 #define DEF_DIV6_RO(_name, _id, _parent, _offset, _div)        \
        DEF_BASE(_name, _id, CLK_TYPE_DIV6_RO, _parent, .offset = _offset, .div = _div, .mult = 1)
+#define DEF_RATE(_name, _id, _rate)    \
+       DEF_TYPE(_name, _id, CLK_TYPE_FR, .mult = _rate)
 
 /*
  * Definitions of Module Clocks
index db5c41967393a261ce2d02455e1fd127a8f82269..d779e564189a68a5ef49ec4cf005aa690843b6d8 100644 (file)
 #define XOR_UNIT(chan)                 ((chan) >> 1)
 #define XOR_CHAN(chan)                 ((chan) & 1)
 
+#ifdef CONFIG_ARMADA_MSYS
+#define MV_XOR_REGS_OFFSET(unit)       (0xF0800)
+#else
 #define MV_XOR_REGS_OFFSET(unit)       (0x60900)
+#endif
 #define MV_XOR_REGS_BASE(unit)         (MV_XOR_REGS_OFFSET(unit))
 
 /* XOR Engine Control Register Map */
index 1820676d7a18d089571c7c4f38fc1b996604e82c..4f37ba7d35eb9776f7a8aff341693e40eff432bd 100644 (file)
@@ -57,4 +57,6 @@ config APBH_DMA_BURST8
 
 endif
 
+source "drivers/dma/ti/Kconfig"
+
 endmenu # menu "DMA Support"
index b5f9147e0a54a0868f4ab639c4495a5c02885ff1..afab324461b906c560e139b8e811bacc8ca70cd3 100644 (file)
@@ -13,3 +13,5 @@ obj-$(CONFIG_SANDBOX_DMA) += sandbox-dma-test.o
 obj-$(CONFIG_TI_KSNAV) += keystone_nav.o keystone_nav_cfg.o
 obj-$(CONFIG_TI_EDMA3) += ti-edma3.o
 obj-$(CONFIG_DMA_LPC32XX) += lpc32xx_dma.o
+
+obj-y += ti/
diff --git a/drivers/dma/ti/Kconfig b/drivers/dma/ti/Kconfig
new file mode 100644 (file)
index 0000000..3d54983
--- /dev/null
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+if ARCH_K3
+
+config TI_K3_NAVSS_UDMA
+        bool "Texas Instruments UDMA"
+        depends on ARCH_K3
+        select DMA
+        select TI_K3_NAVSS_RINGACC
+        select TI_K3_NAVSS_PSILCFG
+        default n
+        help
+          Support for UDMA used in K3 devices.
+endif
diff --git a/drivers/dma/ti/Makefile b/drivers/dma/ti/Makefile
new file mode 100644 (file)
index 0000000..de2f9ac
--- /dev/null
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+obj-$(CONFIG_TI_K3_NAVSS_UDMA) += k3-udma.o
diff --git a/drivers/dma/ti/k3-udma-hwdef.h b/drivers/dma/ti/k3-udma-hwdef.h
new file mode 100644 (file)
index 0000000..c88399a
--- /dev/null
@@ -0,0 +1,184 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ *  Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#ifndef K3_NAVSS_UDMA_HWDEF_H_
+#define K3_NAVSS_UDMA_HWDEF_H_
+
+#define UDMA_PSIL_DST_THREAD_ID_OFFSET 0x8000
+
+/* Global registers */
+#define UDMA_REV_REG                   0x0
+#define UDMA_PERF_CTL_REG              0x4
+#define UDMA_EMU_CTL_REG               0x8
+#define UDMA_PSIL_TO_REG               0x10
+#define UDMA_UTC_CTL_REG               0x1c
+#define UDMA_CAP_REG(i)                        (0x20 + (i * 4))
+#define UDMA_RX_FLOW_ID_FW_OES_REG     0x80
+#define UDMA_RX_FLOW_ID_FW_STATUS_REG  0x88
+
+/* RX Flow regs */
+#define UDMA_RFLOW_RFA_REG             0x0
+#define UDMA_RFLOW_RFB_REG             0x4
+#define UDMA_RFLOW_RFC_REG             0x8
+#define UDMA_RFLOW_RFD_REG             0xc
+#define UDMA_RFLOW_RFE_REG             0x10
+#define UDMA_RFLOW_RFF_REG             0x14
+#define UDMA_RFLOW_RFG_REG             0x18
+#define UDMA_RFLOW_RFH_REG             0x1c
+
+#define UDMA_RFLOW_REG(x) (UDMA_RFLOW_RF##x##_REG)
+
+/* TX chan regs */
+#define UDMA_TCHAN_TCFG_REG            0x0
+#define UDMA_TCHAN_TCREDIT_REG         0x4
+#define UDMA_TCHAN_TCQ_REG             0x14
+#define UDMA_TCHAN_TOES_REG(i)         (0x20 + (i) * 4)
+#define UDMA_TCHAN_TEOES_REG           0x60
+#define UDMA_TCHAN_TPRI_CTRL_REG       0x64
+#define UDMA_TCHAN_THREAD_ID_REG       0x68
+#define UDMA_TCHAN_TFIFO_DEPTH_REG     0x70
+#define UDMA_TCHAN_TST_SCHED_REG       0x80
+
+/* RX chan regs */
+#define UDMA_RCHAN_RCFG_REG            0x0
+#define UDMA_RCHAN_RCQ_REG             0x14
+#define UDMA_RCHAN_ROES_REG(i)         (0x20 + (i) * 4)
+#define UDMA_RCHAN_REOES_REG           0x60
+#define UDMA_RCHAN_RPRI_CTRL_REG       0x64
+#define UDMA_RCHAN_THREAD_ID_REG       0x68
+#define UDMA_RCHAN_RST_SCHED_REG       0x80
+#define UDMA_RCHAN_RFLOW_RNG_REG       0xf0
+
+/* TX chan RT regs */
+#define UDMA_TCHAN_RT_CTL_REG          0x0
+#define UDMA_TCHAN_RT_SWTRIG_REG       0x8
+#define UDMA_TCHAN_RT_STDATA_REG       0x80
+
+#define UDMA_TCHAN_RT_PEERn_REG(i)     (0x200 + (i * 0x4))
+#define UDMA_TCHAN_RT_PEER_STATIC_TR_XY_REG    \
+       UDMA_TCHAN_RT_PEERn_REG(0)      /* PSI-L: 0x400 */
+#define UDMA_TCHAN_RT_PEER_STATIC_TR_Z_REG     \
+       UDMA_TCHAN_RT_PEERn_REG(1)      /* PSI-L: 0x401 */
+#define UDMA_TCHAN_RT_PEER_BCNT_REG            \
+       UDMA_TCHAN_RT_PEERn_REG(4)      /* PSI-L: 0x404 */
+#define UDMA_TCHAN_RT_PEER_RT_EN_REG           \
+       UDMA_TCHAN_RT_PEERn_REG(8)      /* PSI-L: 0x408 */
+
+#define UDMA_TCHAN_RT_PCNT_REG         0x400
+#define UDMA_TCHAN_RT_BCNT_REG         0x408
+#define UDMA_TCHAN_RT_SBCNT_REG                0x410
+
+/* RX chan RT regs */
+#define UDMA_RCHAN_RT_CTL_REG          0x0
+#define UDMA_RCHAN_RT_SWTRIG_REG       0x8
+#define UDMA_RCHAN_RT_STDATA_REG       0x80
+
+#define UDMA_RCHAN_RT_PEERn_REG(i)     (0x200 + (i * 0x4))
+#define UDMA_RCHAN_RT_PEER_STATIC_TR_XY_REG    \
+       UDMA_RCHAN_RT_PEERn_REG(0)      /* PSI-L: 0x400 */
+#define UDMA_RCHAN_RT_PEER_STATIC_TR_Z_REG     \
+       UDMA_RCHAN_RT_PEERn_REG(1)      /* PSI-L: 0x401 */
+#define UDMA_RCHAN_RT_PEER_BCNT_REG            \
+       UDMA_RCHAN_RT_PEERn_REG(4)      /* PSI-L: 0x404 */
+#define UDMA_RCHAN_RT_PEER_RT_EN_REG           \
+       UDMA_RCHAN_RT_PEERn_REG(8)      /* PSI-L: 0x408 */
+
+#define UDMA_RCHAN_RT_PCNT_REG         0x400
+#define UDMA_RCHAN_RT_BCNT_REG         0x408
+#define UDMA_RCHAN_RT_SBCNT_REG                0x410
+
+/* UDMA_TCHAN_TCFG_REG/UDMA_RCHAN_RCFG_REG */
+#define UDMA_CHAN_CFG_PAUSE_ON_ERR             BIT(31)
+#define UDMA_TCHAN_CFG_FILT_EINFO              BIT(30)
+#define UDMA_TCHAN_CFG_FILT_PSWORDS            BIT(29)
+#define UDMA_CHAN_CFG_ATYPE_MASK               GENMASK(25, 24)
+#define UDMA_CHAN_CFG_ATYPE_SHIFT              24
+#define UDMA_CHAN_CFG_CHAN_TYPE_MASK           GENMASK(19, 16)
+#define UDMA_CHAN_CFG_CHAN_TYPE_SHIFT          16
+/*
+ * PBVR - using pass by value rings
+ * PBRR - using pass by reference rings
+ * 3RDP - Third Party DMA
+ * BC - Block Copy
+ * SB - single buffer packet mode enabled
+ */
+#define UDMA_CHAN_CFG_CHAN_TYPE_PACKET_PBRR \
+       (2 << UDMA_CHAN_CFG_CHAN_TYPE_SHIFT)
+#define UDMA_CHAN_CFG_CHAN_TYPE_PACKET_SB_PBRR \
+       (3 << UDMA_CHAN_CFG_CHAN_TYPE_SHIFT)
+#define UDMA_CHAN_CFG_CHAN_TYPE_3RDP_PBRR \
+       (10 << UDMA_CHAN_CFG_CHAN_TYPE_SHIFT)
+#define UDMA_CHAN_CFG_CHAN_TYPE_3RDP_PBVR \
+       (11 << UDMA_CHAN_CFG_CHAN_TYPE_SHIFT)
+#define UDMA_CHAN_CFG_CHAN_TYPE_3RDP_BC_PBRR \
+       (12 << UDMA_CHAN_CFG_CHAN_TYPE_SHIFT)
+#define UDMA_RCHAN_CFG_IGNORE_SHORT            BIT(15)
+#define UDMA_RCHAN_CFG_IGNORE_LONG             BIT(14)
+#define UDMA_TCHAN_CFG_SUPR_TDPKT              BIT(8)
+#define UDMA_CHAN_CFG_FETCH_SIZE_MASK          GENMASK(6, 0)
+#define UDMA_CHAN_CFG_FETCH_SIZE_SHIFT         0
+
+/* UDMA_TCHAN_RT_CTL_REG/UDMA_RCHAN_RT_CTL_REG */
+#define UDMA_CHAN_RT_CTL_EN    BIT(31)
+#define UDMA_CHAN_RT_CTL_TDOWN BIT(30)
+#define UDMA_CHAN_RT_CTL_PAUSE BIT(29)
+#define UDMA_CHAN_RT_CTL_FTDOWN        BIT(28)
+#define UDMA_CHAN_RT_CTL_ERROR BIT(0)
+
+/* UDMA_TCHAN_RT_PEER_RT_EN_REG/UDMA_RCHAN_RT_PEER_RT_EN_REG (PSI-L: 0x408) */
+#define UDMA_PEER_RT_EN_ENABLE         BIT(31)
+#define UDMA_PEER_RT_EN_TEARDOWN       BIT(30)
+#define UDMA_PEER_RT_EN_PAUSE          BIT(29)
+#define UDMA_PEER_RT_EN_FLUSH          BIT(28)
+#define UDMA_PEER_RT_EN_IDLE           BIT(1)
+
+/* RX Flow reg RFA */
+#define UDMA_RFLOW_RFA_EINFO                   BIT(30)
+#define UDMA_RFLOW_RFA_PSINFO                  BIT(29)
+#define UDMA_RFLOW_RFA_ERR_HANDLING            BIT(28)
+#define UDMA_RFLOW_RFA_DESC_TYPE_MASK          GENMASK(27, 26)
+#define UDMA_RFLOW_RFA_DESC_TYPE_SHIFT         26
+#define UDMA_RFLOW_RFA_PS_LOC                  BIT(25)
+#define UDMA_RFLOW_RFA_SOP_OFF_MASK            GENMASK(24, 16)
+#define UDMA_RFLOW_RFA_SOP_OFF_SHIFT           16
+#define UDMA_RFLOW_RFA_DEST_QNUM_MASK          GENMASK(15, 0)
+#define UDMA_RFLOW_RFA_DEST_QNUM_SHIFT         0
+
+/* RX Flow reg RFC */
+#define UDMA_RFLOW_RFC_SRC_TAG_HI_SEL_SHIFT    28
+#define UDMA_RFLOW_RFC_SRC_TAG_LO_SEL_SHIFT    24
+#define UDMA_RFLOW_RFC_DST_TAG_HI_SEL_SHIFT    20
+#define UDMA_RFLOW_RFC_DST_TAG_LO_SE_SHIFT     16
+
+/*
+ * UDMA_TCHAN_RT_PEER_STATIC_TR_XY_REG /
+ * UDMA_RCHAN_RT_PEER_STATIC_TR_XY_REG
+ */
+#define PDMA_STATIC_TR_X_MASK          GENMASK(26, 24)
+#define PDMA_STATIC_TR_X_SHIFT         (24)
+#define PDMA_STATIC_TR_Y_MASK          GENMASK(11, 0)
+#define PDMA_STATIC_TR_Y_SHIFT         (0)
+
+#define PDMA_STATIC_TR_Y(x)    \
+       (((x) << PDMA_STATIC_TR_Y_SHIFT) & PDMA_STATIC_TR_Y_MASK)
+#define PDMA_STATIC_TR_X(x)    \
+       (((x) << PDMA_STATIC_TR_X_SHIFT) & PDMA_STATIC_TR_X_MASK)
+
+/*
+ * UDMA_TCHAN_RT_PEER_STATIC_TR_Z_REG /
+ * UDMA_RCHAN_RT_PEER_STATIC_TR_Z_REG
+ */
+#define PDMA_STATIC_TR_Z_MASK          GENMASK(11, 0)
+#define PDMA_STATIC_TR_Z_SHIFT         (0)
+#define PDMA_STATIC_TR_Z(x)    \
+       (((x) << PDMA_STATIC_TR_Z_SHIFT) & PDMA_STATIC_TR_Z_MASK)
+
+#endif /* K3_NAVSS_UDMA_HWDEF_H_ */
diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
new file mode 100644 (file)
index 0000000..f78a01a
--- /dev/null
@@ -0,0 +1,1730 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ *  Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com
+ *  Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
+ */
+#define pr_fmt(fmt) "udma: " fmt
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/bitops.h>
+#include <malloc.h>
+#include <asm/dma-mapping.h>
+#include <dm.h>
+#include <dm/read.h>
+#include <dm/of_access.h>
+#include <dma.h>
+#include <dma-uclass.h>
+#include <linux/delay.h>
+#include <dt-bindings/dma/k3-udma.h>
+#include <linux/soc/ti/k3-navss-ringacc.h>
+#include <linux/soc/ti/cppi5.h>
+#include <linux/soc/ti/ti-udma.h>
+#include <linux/soc/ti/ti_sci_protocol.h>
+
+#include "k3-udma-hwdef.h"
+
+#if BITS_PER_LONG == 64
+#define RINGACC_RING_USE_PROXY (0)
+#else
+#define RINGACC_RING_USE_PROXY (1)
+#endif
+
+struct udma_chan;
+
+enum udma_mmr {
+       MMR_GCFG = 0,
+       MMR_RCHANRT,
+       MMR_TCHANRT,
+       MMR_LAST,
+};
+
+static const char * const mmr_names[] = {
+       "gcfg", "rchanrt", "tchanrt"
+};
+
+struct udma_tchan {
+       void __iomem *reg_rt;
+
+       int id;
+       struct k3_nav_ring *t_ring; /* Transmit ring */
+       struct k3_nav_ring *tc_ring; /* Transmit Completion ring */
+};
+
+struct udma_rchan {
+       void __iomem *reg_rt;
+
+       int id;
+       struct k3_nav_ring *fd_ring; /* Free Descriptor ring */
+       struct k3_nav_ring *r_ring; /* Receive ring*/
+};
+
+struct udma_rflow {
+       int id;
+};
+
+struct udma_dev {
+       struct device *dev;
+       void __iomem *mmrs[MMR_LAST];
+
+       struct k3_nav_ringacc *ringacc;
+
+       u32 features;
+
+       int tchan_cnt;
+       int echan_cnt;
+       int rchan_cnt;
+       int rflow_cnt;
+       unsigned long *tchan_map;
+       unsigned long *rchan_map;
+       unsigned long *rflow_map;
+
+       struct udma_tchan *tchans;
+       struct udma_rchan *rchans;
+       struct udma_rflow *rflows;
+
+       struct udma_chan *channels;
+       u32 psil_base;
+
+       u32 ch_count;
+       const struct ti_sci_handle *tisci;
+       const struct ti_sci_rm_udmap_ops *tisci_udmap_ops;
+       const struct ti_sci_rm_psil_ops *tisci_psil_ops;
+       u32  tisci_dev_id;
+       u32  tisci_navss_dev_id;
+       bool is_coherent;
+};
+
+struct udma_chan {
+       struct udma_dev *ud;
+       char name[20];
+
+       struct udma_tchan *tchan;
+       struct udma_rchan *rchan;
+       struct udma_rflow *rflow;
+
+       u32 bcnt; /* number of bytes completed since the start of the channel */
+
+       bool pkt_mode; /* TR or packet */
+       bool needs_epib; /* EPIB is needed for the communication or not */
+       u32 psd_size; /* size of Protocol Specific Data */
+       u32 metadata_size; /* (needs_epib ? 16:0) + psd_size */
+       int slave_thread_id;
+       u32 src_thread;
+       u32 dst_thread;
+       u32 static_tr_type;
+
+       u32 id;
+       enum dma_direction dir;
+
+       struct cppi5_host_desc_t *desc_tx;
+       u32 hdesc_size;
+       bool in_use;
+       void    *desc_rx;
+       u32     num_rx_bufs;
+       u32     desc_rx_cur;
+
+};
+
+#define UDMA_CH_1000(ch)               (ch * 0x1000)
+#define UDMA_CH_100(ch)                        (ch * 0x100)
+#define UDMA_CH_40(ch)                 (ch * 0x40)
+
+#ifdef PKTBUFSRX
+#define UDMA_RX_DESC_NUM PKTBUFSRX
+#else
+#define UDMA_RX_DESC_NUM 4
+#endif
+
+/* Generic register access functions */
+static inline u32 udma_read(void __iomem *base, int reg)
+{
+       u32 v;
+
+       v = __raw_readl(base + reg);
+       pr_debug("READL(32): v(%08X)<--reg(%p)\n", v, base + reg);
+       return v;
+}
+
+static inline void udma_write(void __iomem *base, int reg, u32 val)
+{
+       pr_debug("WRITEL(32): v(%08X)-->reg(%p)\n", val, base + reg);
+       __raw_writel(val, base + reg);
+}
+
+static inline void udma_update_bits(void __iomem *base, int reg,
+                                   u32 mask, u32 val)
+{
+       u32 tmp, orig;
+
+       orig = udma_read(base, reg);
+       tmp = orig & ~mask;
+       tmp |= (val & mask);
+
+       if (tmp != orig)
+               udma_write(base, reg, tmp);
+}
+
+/* TCHANRT */
+static inline u32 udma_tchanrt_read(struct udma_tchan *tchan, int reg)
+{
+       if (!tchan)
+               return 0;
+       return udma_read(tchan->reg_rt, reg);
+}
+
+static inline void udma_tchanrt_write(struct udma_tchan *tchan,
+                                     int reg, u32 val)
+{
+       if (!tchan)
+               return;
+       udma_write(tchan->reg_rt, reg, val);
+}
+
+/* RCHANRT */
+static inline u32 udma_rchanrt_read(struct udma_rchan *rchan, int reg)
+{
+       if (!rchan)
+               return 0;
+       return udma_read(rchan->reg_rt, reg);
+}
+
+static inline void udma_rchanrt_write(struct udma_rchan *rchan,
+                                     int reg, u32 val)
+{
+       if (!rchan)
+               return;
+       udma_write(rchan->reg_rt, reg, val);
+}
+
+static inline int udma_navss_psil_pair(struct udma_dev *ud, u32 src_thread,
+                                      u32 dst_thread)
+{
+       dst_thread |= UDMA_PSIL_DST_THREAD_ID_OFFSET;
+       return ud->tisci_psil_ops->pair(ud->tisci,
+                                       ud->tisci_navss_dev_id,
+                                       src_thread, dst_thread);
+}
+
+static inline int udma_navss_psil_unpair(struct udma_dev *ud, u32 src_thread,
+                                        u32 dst_thread)
+{
+       dst_thread |= UDMA_PSIL_DST_THREAD_ID_OFFSET;
+       return ud->tisci_psil_ops->unpair(ud->tisci,
+                                         ud->tisci_navss_dev_id,
+                                         src_thread, dst_thread);
+}
+
+static inline char *udma_get_dir_text(enum dma_direction dir)
+{
+       switch (dir) {
+       case DMA_DEV_TO_MEM:
+               return "DEV_TO_MEM";
+       case DMA_MEM_TO_DEV:
+               return "MEM_TO_DEV";
+       case DMA_MEM_TO_MEM:
+               return "MEM_TO_MEM";
+       case DMA_DEV_TO_DEV:
+               return "DEV_TO_DEV";
+       default:
+               break;
+       }
+
+       return "invalid";
+}
+
+static inline bool udma_is_chan_running(struct udma_chan *uc)
+{
+       u32 trt_ctl = 0;
+       u32 rrt_ctl = 0;
+
+       switch (uc->dir) {
+       case DMA_DEV_TO_MEM:
+               rrt_ctl = udma_rchanrt_read(uc->rchan, UDMA_RCHAN_RT_CTL_REG);
+               pr_debug("%s: rrt_ctl: 0x%08x (peer: 0x%08x)\n",
+                        __func__, rrt_ctl,
+                        udma_rchanrt_read(uc->rchan,
+                                          UDMA_RCHAN_RT_PEER_RT_EN_REG));
+               break;
+       case DMA_MEM_TO_DEV:
+               trt_ctl = udma_tchanrt_read(uc->tchan, UDMA_TCHAN_RT_CTL_REG);
+               pr_debug("%s: trt_ctl: 0x%08x (peer: 0x%08x)\n",
+                        __func__, trt_ctl,
+                        udma_tchanrt_read(uc->tchan,
+                                          UDMA_TCHAN_RT_PEER_RT_EN_REG));
+               break;
+       case DMA_MEM_TO_MEM:
+               trt_ctl = udma_tchanrt_read(uc->tchan, UDMA_TCHAN_RT_CTL_REG);
+               rrt_ctl = udma_rchanrt_read(uc->rchan, UDMA_RCHAN_RT_CTL_REG);
+               break;
+       default:
+               break;
+       }
+
+       if (trt_ctl & UDMA_CHAN_RT_CTL_EN || rrt_ctl & UDMA_CHAN_RT_CTL_EN)
+               return true;
+
+       return false;
+}
+
+static int udma_is_coherent(struct udma_chan *uc)
+{
+       return uc->ud->is_coherent;
+}
+
+static int udma_pop_from_ring(struct udma_chan *uc, dma_addr_t *addr)
+{
+       struct k3_nav_ring *ring = NULL;
+       int ret = -ENOENT;
+
+       switch (uc->dir) {
+       case DMA_DEV_TO_MEM:
+               ring = uc->rchan->r_ring;
+               break;
+       case DMA_MEM_TO_DEV:
+               ring = uc->tchan->tc_ring;
+               break;
+       case DMA_MEM_TO_MEM:
+               ring = uc->tchan->tc_ring;
+               break;
+       default:
+               break;
+       }
+
+       if (ring && k3_nav_ringacc_ring_get_occ(ring))
+               ret = k3_nav_ringacc_ring_pop(ring, addr);
+
+       return ret;
+}
+
+static void udma_reset_rings(struct udma_chan *uc)
+{
+       struct k3_nav_ring *ring1 = NULL;
+       struct k3_nav_ring *ring2 = NULL;
+
+       switch (uc->dir) {
+       case DMA_DEV_TO_MEM:
+               ring1 = uc->rchan->fd_ring;
+               ring2 = uc->rchan->r_ring;
+               break;
+       case DMA_MEM_TO_DEV:
+               ring1 = uc->tchan->t_ring;
+               ring2 = uc->tchan->tc_ring;
+               break;
+       case DMA_MEM_TO_MEM:
+               ring1 = uc->tchan->t_ring;
+               ring2 = uc->tchan->tc_ring;
+               break;
+       default:
+               break;
+       }
+
+       if (ring1)
+               k3_nav_ringacc_ring_reset_dma(ring1, 0);
+       if (ring2)
+               k3_nav_ringacc_ring_reset(ring2);
+}
+
+static void udma_reset_counters(struct udma_chan *uc)
+{
+       u32 val;
+
+       if (uc->tchan) {
+               val = udma_tchanrt_read(uc->tchan, UDMA_TCHAN_RT_BCNT_REG);
+               udma_tchanrt_write(uc->tchan, UDMA_TCHAN_RT_BCNT_REG, val);
+
+               val = udma_tchanrt_read(uc->tchan, UDMA_TCHAN_RT_SBCNT_REG);
+               udma_tchanrt_write(uc->tchan, UDMA_TCHAN_RT_SBCNT_REG, val);
+
+               val = udma_tchanrt_read(uc->tchan, UDMA_TCHAN_RT_PCNT_REG);
+               udma_tchanrt_write(uc->tchan, UDMA_TCHAN_RT_PCNT_REG, val);
+
+               val = udma_tchanrt_read(uc->tchan, UDMA_TCHAN_RT_PEER_BCNT_REG);
+               udma_tchanrt_write(uc->tchan, UDMA_TCHAN_RT_PEER_BCNT_REG, val);
+       }
+
+       if (uc->rchan) {
+               val = udma_rchanrt_read(uc->rchan, UDMA_RCHAN_RT_BCNT_REG);
+               udma_rchanrt_write(uc->rchan, UDMA_RCHAN_RT_BCNT_REG, val);
+
+               val = udma_rchanrt_read(uc->rchan, UDMA_RCHAN_RT_SBCNT_REG);
+               udma_rchanrt_write(uc->rchan, UDMA_RCHAN_RT_SBCNT_REG, val);
+
+               val = udma_rchanrt_read(uc->rchan, UDMA_RCHAN_RT_PCNT_REG);
+               udma_rchanrt_write(uc->rchan, UDMA_RCHAN_RT_PCNT_REG, val);
+
+               val = udma_rchanrt_read(uc->rchan, UDMA_RCHAN_RT_PEER_BCNT_REG);
+               udma_rchanrt_write(uc->rchan, UDMA_RCHAN_RT_PEER_BCNT_REG, val);
+       }
+
+       uc->bcnt = 0;
+}
+
+static inline int udma_stop_hard(struct udma_chan *uc)
+{
+       pr_debug("%s: ENTER (chan%d)\n", __func__, uc->id);
+
+       switch (uc->dir) {
+       case DMA_DEV_TO_MEM:
+               udma_rchanrt_write(uc->rchan, UDMA_RCHAN_RT_PEER_RT_EN_REG, 0);
+               udma_rchanrt_write(uc->rchan, UDMA_RCHAN_RT_CTL_REG, 0);
+               break;
+       case DMA_MEM_TO_DEV:
+               udma_tchanrt_write(uc->tchan, UDMA_TCHAN_RT_CTL_REG, 0);
+               udma_tchanrt_write(uc->tchan, UDMA_TCHAN_RT_PEER_RT_EN_REG, 0);
+               break;
+       case DMA_MEM_TO_MEM:
+               udma_rchanrt_write(uc->rchan, UDMA_RCHAN_RT_CTL_REG, 0);
+               udma_tchanrt_write(uc->tchan, UDMA_TCHAN_RT_CTL_REG, 0);
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
+static int udma_start(struct udma_chan *uc)
+{
+       /* Channel is already running, no need to proceed further */
+       if (udma_is_chan_running(uc))
+               goto out;
+
+       pr_debug("%s: chan:%d dir:%s (static_tr_type: %d)\n",
+                __func__, uc->id, udma_get_dir_text(uc->dir),
+                uc->static_tr_type);
+
+       /* Make sure that we clear the teardown bit, if it is set */
+       udma_stop_hard(uc);
+
+       /* Reset all counters */
+       udma_reset_counters(uc);
+
+       switch (uc->dir) {
+       case DMA_DEV_TO_MEM:
+               udma_rchanrt_write(uc->rchan, UDMA_RCHAN_RT_CTL_REG,
+                                  UDMA_CHAN_RT_CTL_EN);
+
+               /* Enable remote */
+               udma_rchanrt_write(uc->rchan, UDMA_RCHAN_RT_PEER_RT_EN_REG,
+                                  UDMA_PEER_RT_EN_ENABLE);
+
+               pr_debug("%s(rx): RT_CTL:0x%08x PEER RT_ENABLE:0x%08x\n",
+                        __func__,
+                        udma_rchanrt_read(uc->rchan,
+                                          UDMA_RCHAN_RT_CTL_REG),
+                        udma_rchanrt_read(uc->rchan,
+                                          UDMA_RCHAN_RT_PEER_RT_EN_REG));
+               break;
+       case DMA_MEM_TO_DEV:
+               /* Enable remote */
+               udma_tchanrt_write(uc->tchan, UDMA_TCHAN_RT_PEER_RT_EN_REG,
+                                  UDMA_PEER_RT_EN_ENABLE);
+
+               udma_tchanrt_write(uc->tchan, UDMA_TCHAN_RT_CTL_REG,
+                                  UDMA_CHAN_RT_CTL_EN);
+
+               pr_debug("%s(tx): RT_CTL:0x%08x PEER RT_ENABLE:0x%08x\n",
+                        __func__,
+                        udma_rchanrt_read(uc->rchan,
+                                          UDMA_TCHAN_RT_CTL_REG),
+                        udma_rchanrt_read(uc->rchan,
+                                          UDMA_TCHAN_RT_PEER_RT_EN_REG));
+               break;
+       case DMA_MEM_TO_MEM:
+               udma_rchanrt_write(uc->rchan, UDMA_RCHAN_RT_CTL_REG,
+                                  UDMA_CHAN_RT_CTL_EN);
+               udma_tchanrt_write(uc->tchan, UDMA_TCHAN_RT_CTL_REG,
+                                  UDMA_CHAN_RT_CTL_EN);
+
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       pr_debug("%s: DONE chan:%d\n", __func__, uc->id);
+out:
+       return 0;
+}
+
+static inline void udma_stop_mem2dev(struct udma_chan *uc, bool sync)
+{
+       int i = 0;
+       u32 val;
+
+       udma_tchanrt_write(uc->tchan, UDMA_TCHAN_RT_CTL_REG,
+                          UDMA_CHAN_RT_CTL_EN |
+                          UDMA_CHAN_RT_CTL_TDOWN);
+
+       val = udma_tchanrt_read(uc->tchan, UDMA_TCHAN_RT_CTL_REG);
+
+       while (sync && (val & UDMA_CHAN_RT_CTL_EN)) {
+               val = udma_tchanrt_read(uc->tchan, UDMA_TCHAN_RT_CTL_REG);
+               udelay(1);
+               if (i > 1000) {
+                       printf(" %s TIMEOUT !\n", __func__);
+                       break;
+               }
+               i++;
+       }
+
+       val = udma_tchanrt_read(uc->tchan, UDMA_TCHAN_RT_PEER_RT_EN_REG);
+       if (val & UDMA_PEER_RT_EN_ENABLE)
+               printf("%s: peer not stopped TIMEOUT !\n", __func__);
+}
+
+static inline void udma_stop_dev2mem(struct udma_chan *uc, bool sync)
+{
+       int i = 0;
+       u32 val;
+
+       udma_rchanrt_write(uc->rchan, UDMA_RCHAN_RT_PEER_RT_EN_REG,
+                          UDMA_PEER_RT_EN_ENABLE |
+                          UDMA_PEER_RT_EN_TEARDOWN);
+
+       val = udma_rchanrt_read(uc->rchan, UDMA_RCHAN_RT_CTL_REG);
+
+       while (sync && (val & UDMA_CHAN_RT_CTL_EN)) {
+               val = udma_rchanrt_read(uc->rchan, UDMA_RCHAN_RT_CTL_REG);
+               udelay(1);
+               if (i > 1000) {
+                       printf("%s TIMEOUT !\n", __func__);
+                       break;
+               }
+               i++;
+       }
+
+       val = udma_rchanrt_read(uc->rchan, UDMA_RCHAN_RT_PEER_RT_EN_REG);
+       if (val & UDMA_PEER_RT_EN_ENABLE)
+               printf("%s: peer not stopped TIMEOUT !\n", __func__);
+}
+
+static inline int udma_stop(struct udma_chan *uc)
+{
+       pr_debug("%s: chan:%d dir:%s\n",
+                __func__, uc->id, udma_get_dir_text(uc->dir));
+
+       udma_reset_counters(uc);
+       switch (uc->dir) {
+       case DMA_DEV_TO_MEM:
+               udma_stop_dev2mem(uc, true);
+               break;
+       case DMA_MEM_TO_DEV:
+               udma_stop_mem2dev(uc, true);
+               break;
+       case DMA_MEM_TO_MEM:
+               udma_rchanrt_write(uc->rchan, UDMA_RCHAN_RT_CTL_REG, 0);
+               udma_tchanrt_write(uc->tchan, UDMA_TCHAN_RT_CTL_REG, 0);
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
+static void udma_poll_completion(struct udma_chan *uc, dma_addr_t *paddr)
+{
+       int i = 1;
+
+       while (udma_pop_from_ring(uc, paddr)) {
+               udelay(1);
+               if (!(i % 1000000))
+                       printf(".");
+               i++;
+       }
+}
+
+#define UDMA_RESERVE_RESOURCE(res)                                     \
+static struct udma_##res *__udma_reserve_##res(struct udma_dev *ud,    \
+                                              int id)                  \
+{                                                                      \
+       if (id >= 0) {                                                  \
+               if (test_bit(id, ud->res##_map)) {                      \
+                       dev_err(ud->dev, "res##%d is in use\n", id);    \
+                       return ERR_PTR(-ENOENT);                        \
+               }                                                       \
+       } else {                                                        \
+               id = find_first_zero_bit(ud->res##_map, ud->res##_cnt); \
+               if (id == ud->res##_cnt) {                              \
+                       return ERR_PTR(-ENOENT);                        \
+               }                                                       \
+       }                                                               \
+                                                                       \
+       __set_bit(id, ud->res##_map);                                   \
+       return &ud->res##s[id];                                         \
+}
+
+UDMA_RESERVE_RESOURCE(tchan);
+UDMA_RESERVE_RESOURCE(rchan);
+UDMA_RESERVE_RESOURCE(rflow);
+
+static int udma_get_tchan(struct udma_chan *uc)
+{
+       struct udma_dev *ud = uc->ud;
+
+       if (uc->tchan) {
+               dev_dbg(ud->dev, "chan%d: already have tchan%d allocated\n",
+                       uc->id, uc->tchan->id);
+               return 0;
+       }
+
+       uc->tchan = __udma_reserve_tchan(ud, -1);
+       if (IS_ERR(uc->tchan))
+               return PTR_ERR(uc->tchan);
+
+       pr_debug("chan%d: got tchan%d\n", uc->id, uc->tchan->id);
+
+       if (udma_is_chan_running(uc)) {
+               dev_warn(ud->dev, "chan%d: tchan%d is running!\n", uc->id,
+                        uc->tchan->id);
+               udma_stop(uc);
+               if (udma_is_chan_running(uc))
+                       dev_err(ud->dev, "chan%d: won't stop!\n", uc->id);
+       }
+
+       return 0;
+}
+
+static int udma_get_rchan(struct udma_chan *uc)
+{
+       struct udma_dev *ud = uc->ud;
+
+       if (uc->rchan) {
+               dev_dbg(ud->dev, "chan%d: already have rchan%d allocated\n",
+                       uc->id, uc->rchan->id);
+               return 0;
+       }
+
+       uc->rchan = __udma_reserve_rchan(ud, -1);
+       if (IS_ERR(uc->rchan))
+               return PTR_ERR(uc->rchan);
+
+       pr_debug("chan%d: got rchan%d\n", uc->id, uc->rchan->id);
+
+       if (udma_is_chan_running(uc)) {
+               dev_warn(ud->dev, "chan%d: rchan%d is running!\n", uc->id,
+                        uc->rchan->id);
+               udma_stop(uc);
+               if (udma_is_chan_running(uc))
+                       dev_err(ud->dev, "chan%d: won't stop!\n", uc->id);
+       }
+
+       return 0;
+}
+
+static int udma_get_chan_pair(struct udma_chan *uc)
+{
+       struct udma_dev *ud = uc->ud;
+       int chan_id, end;
+
+       if ((uc->tchan && uc->rchan) && uc->tchan->id == uc->rchan->id) {
+               dev_info(ud->dev, "chan%d: already have %d pair allocated\n",
+                        uc->id, uc->tchan->id);
+               return 0;
+       }
+
+       if (uc->tchan) {
+               dev_err(ud->dev, "chan%d: already have tchan%d allocated\n",
+                       uc->id, uc->tchan->id);
+               return -EBUSY;
+       } else if (uc->rchan) {
+               dev_err(ud->dev, "chan%d: already have rchan%d allocated\n",
+                       uc->id, uc->rchan->id);
+               return -EBUSY;
+       }
+
+       /* Can be optimized, but let's have it like this for now */
+       end = min(ud->tchan_cnt, ud->rchan_cnt);
+       for (chan_id = 0; chan_id < end; chan_id++) {
+               if (!test_bit(chan_id, ud->tchan_map) &&
+                   !test_bit(chan_id, ud->rchan_map))
+                       break;
+       }
+
+       if (chan_id == end)
+               return -ENOENT;
+
+       __set_bit(chan_id, ud->tchan_map);
+       __set_bit(chan_id, ud->rchan_map);
+       uc->tchan = &ud->tchans[chan_id];
+       uc->rchan = &ud->rchans[chan_id];
+
+       pr_debug("chan%d: got t/rchan%d pair\n", uc->id, chan_id);
+
+       if (udma_is_chan_running(uc)) {
+               dev_warn(ud->dev, "chan%d: t/rchan%d pair is running!\n",
+                        uc->id, chan_id);
+               udma_stop(uc);
+               if (udma_is_chan_running(uc))
+                       dev_err(ud->dev, "chan%d: won't stop!\n", uc->id);
+       }
+
+       return 0;
+}
+
+static int udma_get_rflow(struct udma_chan *uc, int flow_id)
+{
+       struct udma_dev *ud = uc->ud;
+
+       if (uc->rflow) {
+               dev_dbg(ud->dev, "chan%d: already have rflow%d allocated\n",
+                       uc->id, uc->rflow->id);
+               return 0;
+       }
+
+       if (!uc->rchan)
+               dev_warn(ud->dev, "chan%d: does not have rchan??\n", uc->id);
+
+       uc->rflow = __udma_reserve_rflow(ud, flow_id);
+       if (IS_ERR(uc->rflow))
+               return PTR_ERR(uc->rflow);
+
+       pr_debug("chan%d: got rflow%d\n", uc->id, uc->rflow->id);
+       return 0;
+}
+
+static void udma_put_rchan(struct udma_chan *uc)
+{
+       struct udma_dev *ud = uc->ud;
+
+       if (uc->rchan) {
+               dev_dbg(ud->dev, "chan%d: put rchan%d\n", uc->id,
+                       uc->rchan->id);
+               __clear_bit(uc->rchan->id, ud->rchan_map);
+               uc->rchan = NULL;
+       }
+}
+
+static void udma_put_tchan(struct udma_chan *uc)
+{
+       struct udma_dev *ud = uc->ud;
+
+       if (uc->tchan) {
+               dev_dbg(ud->dev, "chan%d: put tchan%d\n", uc->id,
+                       uc->tchan->id);
+               __clear_bit(uc->tchan->id, ud->tchan_map);
+               uc->tchan = NULL;
+       }
+}
+
+static void udma_put_rflow(struct udma_chan *uc)
+{
+       struct udma_dev *ud = uc->ud;
+
+       if (uc->rflow) {
+               dev_dbg(ud->dev, "chan%d: put rflow%d\n", uc->id,
+                       uc->rflow->id);
+               __clear_bit(uc->rflow->id, ud->rflow_map);
+               uc->rflow = NULL;
+       }
+}
+
+static void udma_free_tx_resources(struct udma_chan *uc)
+{
+       if (!uc->tchan)
+               return;
+
+       k3_nav_ringacc_ring_free(uc->tchan->t_ring);
+       k3_nav_ringacc_ring_free(uc->tchan->tc_ring);
+       uc->tchan->t_ring = NULL;
+       uc->tchan->tc_ring = NULL;
+
+       udma_put_tchan(uc);
+}
+
+static int udma_alloc_tx_resources(struct udma_chan *uc)
+{
+       struct k3_nav_ring_cfg ring_cfg;
+       struct udma_dev *ud = uc->ud;
+       int ret;
+
+       ret = udma_get_tchan(uc);
+       if (ret)
+               return ret;
+
+       uc->tchan->t_ring = k3_nav_ringacc_request_ring(
+                               ud->ringacc, uc->tchan->id,
+                               RINGACC_RING_USE_PROXY);
+       if (!uc->tchan->t_ring) {
+               ret = -EBUSY;
+               goto err_tx_ring;
+       }
+
+       uc->tchan->tc_ring = k3_nav_ringacc_request_ring(
+                               ud->ringacc, -1, RINGACC_RING_USE_PROXY);
+       if (!uc->tchan->tc_ring) {
+               ret = -EBUSY;
+               goto err_txc_ring;
+       }
+
+       memset(&ring_cfg, 0, sizeof(ring_cfg));
+       ring_cfg.size = 16;
+       ring_cfg.elm_size = K3_NAV_RINGACC_RING_ELSIZE_8;
+       ring_cfg.mode = K3_NAV_RINGACC_RING_MODE_MESSAGE;
+
+       ret = k3_nav_ringacc_ring_cfg(uc->tchan->t_ring, &ring_cfg);
+       ret |= k3_nav_ringacc_ring_cfg(uc->tchan->tc_ring, &ring_cfg);
+
+       if (ret)
+               goto err_ringcfg;
+
+       return 0;
+
+err_ringcfg:
+       k3_nav_ringacc_ring_free(uc->tchan->tc_ring);
+       uc->tchan->tc_ring = NULL;
+err_txc_ring:
+       k3_nav_ringacc_ring_free(uc->tchan->t_ring);
+       uc->tchan->t_ring = NULL;
+err_tx_ring:
+       udma_put_tchan(uc);
+
+       return ret;
+}
+
+static void udma_free_rx_resources(struct udma_chan *uc)
+{
+       if (!uc->rchan)
+               return;
+
+       k3_nav_ringacc_ring_free(uc->rchan->fd_ring);
+       k3_nav_ringacc_ring_free(uc->rchan->r_ring);
+       uc->rchan->fd_ring = NULL;
+       uc->rchan->r_ring = NULL;
+
+       udma_put_rflow(uc);
+       udma_put_rchan(uc);
+}
+
+static int udma_alloc_rx_resources(struct udma_chan *uc)
+{
+       struct k3_nav_ring_cfg ring_cfg;
+       struct udma_dev *ud = uc->ud;
+       int fd_ring_id;
+       int ret;
+
+       ret = udma_get_rchan(uc);
+       if (ret)
+               return ret;
+
+       /* For MEM_TO_MEM we don't need rflow or rings */
+       if (uc->dir == DMA_MEM_TO_MEM)
+               return 0;
+
+       ret = udma_get_rflow(uc, uc->rchan->id);
+       if (ret) {
+               ret = -EBUSY;
+               goto err_rflow;
+       }
+
+       fd_ring_id = ud->tchan_cnt + ud->echan_cnt + uc->rchan->id;
+
+       uc->rchan->fd_ring = k3_nav_ringacc_request_ring(
+                               ud->ringacc, fd_ring_id,
+                               RINGACC_RING_USE_PROXY);
+       if (!uc->rchan->fd_ring) {
+               ret = -EBUSY;
+               goto err_rx_ring;
+       }
+
+       uc->rchan->r_ring = k3_nav_ringacc_request_ring(
+                               ud->ringacc, -1, RINGACC_RING_USE_PROXY);
+       if (!uc->rchan->r_ring) {
+               ret = -EBUSY;
+               goto err_rxc_ring;
+       }
+
+       memset(&ring_cfg, 0, sizeof(ring_cfg));
+       ring_cfg.size = 16;
+       ring_cfg.elm_size = K3_NAV_RINGACC_RING_ELSIZE_8;
+       ring_cfg.mode = K3_NAV_RINGACC_RING_MODE_MESSAGE;
+
+       ret = k3_nav_ringacc_ring_cfg(uc->rchan->fd_ring, &ring_cfg);
+       ret |= k3_nav_ringacc_ring_cfg(uc->rchan->r_ring, &ring_cfg);
+
+       if (ret)
+               goto err_ringcfg;
+
+       return 0;
+
+err_ringcfg:
+       k3_nav_ringacc_ring_free(uc->rchan->r_ring);
+       uc->rchan->r_ring = NULL;
+err_rxc_ring:
+       k3_nav_ringacc_ring_free(uc->rchan->fd_ring);
+       uc->rchan->fd_ring = NULL;
+err_rx_ring:
+       udma_put_rflow(uc);
+err_rflow:
+       udma_put_rchan(uc);
+
+       return ret;
+}
+
+static int udma_alloc_tchan_sci_req(struct udma_chan *uc)
+{
+       struct udma_dev *ud = uc->ud;
+       int tc_ring = k3_nav_ringacc_get_ring_id(uc->tchan->tc_ring);
+       struct ti_sci_msg_rm_udmap_tx_ch_cfg req;
+       u32 mode;
+       int ret;
+
+       if (uc->pkt_mode)
+               mode = TI_SCI_RM_UDMAP_CHAN_TYPE_PKT_PBRR;
+       else
+               mode = TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_BCOPY_PBRR;
+
+       req.valid_params = TI_SCI_MSG_VALUE_RM_UDMAP_CH_CHAN_TYPE_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_CH_FETCH_SIZE_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_CH_CQ_QNUM_VALID;
+       req.nav_id = ud->tisci_dev_id;
+       req.index = uc->tchan->id;
+       req.tx_chan_type = mode;
+       if (uc->dir == DMA_MEM_TO_MEM)
+               req.tx_fetch_size = sizeof(struct cppi5_desc_hdr_t) >> 2;
+       else
+               req.tx_fetch_size = cppi5_hdesc_calc_size(uc->needs_epib,
+                                                         uc->psd_size,
+                                                         0) >> 2;
+       req.txcq_qnum = tc_ring;
+
+       ret = ud->tisci_udmap_ops->tx_ch_cfg(ud->tisci, &req);
+       if (ret)
+               dev_err(ud->dev, "tisci tx alloc failed %d\n", ret);
+
+       return ret;
+}
+
+static int udma_alloc_rchan_sci_req(struct udma_chan *uc)
+{
+       struct udma_dev *ud = uc->ud;
+       int fd_ring = k3_nav_ringacc_get_ring_id(uc->rchan->fd_ring);
+       int rx_ring = k3_nav_ringacc_get_ring_id(uc->rchan->r_ring);
+       int tc_ring = k3_nav_ringacc_get_ring_id(uc->tchan->tc_ring);
+       struct ti_sci_msg_rm_udmap_rx_ch_cfg req = { 0 };
+       struct ti_sci_msg_rm_udmap_flow_cfg flow_req = { 0 };
+       u32 mode;
+       int ret;
+
+       if (uc->pkt_mode)
+               mode = TI_SCI_RM_UDMAP_CHAN_TYPE_PKT_PBRR;
+       else
+               mode = TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_BCOPY_PBRR;
+
+       req.valid_params = TI_SCI_MSG_VALUE_RM_UDMAP_CH_FETCH_SIZE_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_CH_CQ_QNUM_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_CH_CHAN_TYPE_VALID;
+       req.nav_id = ud->tisci_dev_id;
+       req.index = uc->rchan->id;
+       req.rx_chan_type = mode;
+       if (uc->dir == DMA_MEM_TO_MEM) {
+               req.rx_fetch_size = sizeof(struct cppi5_desc_hdr_t) >> 2;
+               req.rxcq_qnum = tc_ring;
+       } else {
+               req.rx_fetch_size = cppi5_hdesc_calc_size(uc->needs_epib,
+                                                         uc->psd_size,
+                                                         0) >> 2;
+               req.rxcq_qnum = rx_ring;
+       }
+       if (uc->rflow->id != uc->rchan->id && uc->dir != DMA_MEM_TO_MEM) {
+               req.flowid_start = uc->rflow->id;
+               req.flowid_cnt = 1;
+               req.valid_params |=
+                       TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_FLOWID_START_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_FLOWID_CNT_VALID;
+       }
+
+       ret = ud->tisci_udmap_ops->rx_ch_cfg(ud->tisci, &req);
+       if (ret) {
+               dev_err(ud->dev, "tisci rx %u cfg failed %d\n",
+                       uc->rchan->id, ret);
+               return ret;
+       }
+       if (uc->dir == DMA_MEM_TO_MEM)
+               return ret;
+
+       flow_req.valid_params =
+                       TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_EINFO_PRESENT_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_PSINFO_PRESENT_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_ERROR_HANDLING_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DESC_TYPE_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_QNUM_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_HI_SEL_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_LO_SEL_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_HI_SEL_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_LO_SEL_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ0_SZ0_QNUM_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ1_QNUM_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ2_QNUM_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ3_QNUM_VALID |
+                       TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_PS_LOCATION_VALID;
+
+       flow_req.nav_id = ud->tisci_dev_id;
+       flow_req.flow_index = uc->rflow->id;
+
+       if (uc->needs_epib)
+               flow_req.rx_einfo_present = 1;
+       else
+               flow_req.rx_einfo_present = 0;
+
+       if (uc->psd_size)
+               flow_req.rx_psinfo_present = 1;
+       else
+               flow_req.rx_psinfo_present = 0;
+
+       flow_req.rx_error_handling = 0;
+       flow_req.rx_desc_type = 0;
+       flow_req.rx_dest_qnum = rx_ring;
+       flow_req.rx_src_tag_hi_sel = 2;
+       flow_req.rx_src_tag_lo_sel = 4;
+       flow_req.rx_dest_tag_hi_sel = 5;
+       flow_req.rx_dest_tag_lo_sel = 4;
+       flow_req.rx_fdq0_sz0_qnum = fd_ring;
+       flow_req.rx_fdq1_qnum = fd_ring;
+       flow_req.rx_fdq2_qnum = fd_ring;
+       flow_req.rx_fdq3_qnum = fd_ring;
+       flow_req.rx_ps_location = 0;
+
+       ret = ud->tisci_udmap_ops->rx_flow_cfg(ud->tisci, &flow_req);
+       if (ret)
+               dev_err(ud->dev, "tisci rx %u flow %u cfg failed %d\n",
+                       uc->rchan->id, uc->rflow->id, ret);
+
+       return ret;
+}
+
+static int udma_alloc_chan_resources(struct udma_chan *uc)
+{
+       struct udma_dev *ud = uc->ud;
+       int ret;
+
+       pr_debug("%s: chan:%d as %s\n",
+                __func__, uc->id, udma_get_dir_text(uc->dir));
+
+       switch (uc->dir) {
+       case DMA_MEM_TO_MEM:
+               /* Non synchronized - mem to mem type of transfer */
+               ret = udma_get_chan_pair(uc);
+               if (ret)
+                       return ret;
+
+               ret = udma_alloc_tx_resources(uc);
+               if (ret)
+                       goto err_free_res;
+
+               ret = udma_alloc_rx_resources(uc);
+               if (ret)
+                       goto err_free_res;
+
+               uc->src_thread = ud->psil_base + uc->tchan->id;
+               uc->dst_thread = (ud->psil_base + uc->rchan->id) | 0x8000;
+               break;
+       case DMA_MEM_TO_DEV:
+               /* Slave transfer synchronized - mem to dev (TX) trasnfer */
+               ret = udma_alloc_tx_resources(uc);
+               if (ret)
+                       goto err_free_res;
+
+               uc->src_thread = ud->psil_base + uc->tchan->id;
+               uc->dst_thread = uc->slave_thread_id;
+               if (!(uc->dst_thread & 0x8000))
+                       uc->dst_thread |= 0x8000;
+
+               break;
+       case DMA_DEV_TO_MEM:
+               /* Slave transfer synchronized - dev to mem (RX) trasnfer */
+               ret = udma_alloc_rx_resources(uc);
+               if (ret)
+                       goto err_free_res;
+
+               uc->src_thread = uc->slave_thread_id;
+               uc->dst_thread = (ud->psil_base + uc->rchan->id) | 0x8000;
+
+               break;
+       default:
+               /* Can not happen */
+               pr_debug("%s: chan:%d invalid direction (%u)\n",
+                        __func__, uc->id, uc->dir);
+               return -EINVAL;
+       }
+
+       /* We have channel indexes and rings */
+       if (uc->dir == DMA_MEM_TO_MEM) {
+               ret = udma_alloc_tchan_sci_req(uc);
+               if (ret)
+                       goto err_free_res;
+
+               ret = udma_alloc_rchan_sci_req(uc);
+               if (ret)
+                       goto err_free_res;
+       } else {
+               /* Slave transfer */
+               if (uc->dir == DMA_MEM_TO_DEV) {
+                       ret = udma_alloc_tchan_sci_req(uc);
+                       if (ret)
+                               goto err_free_res;
+               } else {
+                       ret = udma_alloc_rchan_sci_req(uc);
+                       if (ret)
+                               goto err_free_res;
+               }
+       }
+
+       /* PSI-L pairing */
+       ret = udma_navss_psil_pair(ud, uc->src_thread, uc->dst_thread);
+       if (ret) {
+               dev_err(ud->dev, "k3_nav_psil_request_link fail\n");
+               goto err_free_res;
+       }
+
+       return 0;
+
+err_free_res:
+       udma_free_tx_resources(uc);
+       udma_free_rx_resources(uc);
+       uc->slave_thread_id = -1;
+       return ret;
+}
+
+static void udma_free_chan_resources(struct udma_chan *uc)
+{
+       /* Some configuration to UDMA-P channel: disable, reset, whatever */
+
+       /* Release PSI-L pairing */
+       udma_navss_psil_unpair(uc->ud, uc->src_thread, uc->dst_thread);
+
+       /* Reset the rings for a new start */
+       udma_reset_rings(uc);
+       udma_free_tx_resources(uc);
+       udma_free_rx_resources(uc);
+
+       uc->slave_thread_id = -1;
+       uc->dir = DMA_MEM_TO_MEM;
+}
+
+static int udma_get_mmrs(struct udevice *dev)
+{
+       struct udma_dev *ud = dev_get_priv(dev);
+       int i;
+
+       for (i = 0; i < MMR_LAST; i++) {
+               ud->mmrs[i] = (uint32_t *)devfdt_get_addr_name(dev,
+                               mmr_names[i]);
+               if (!ud->mmrs[i])
+                       return -EINVAL;
+       }
+
+       return 0;
+}
+
+#define UDMA_MAX_CHANNELS      192
+
+static int udma_probe(struct udevice *dev)
+{
+       struct dma_dev_priv *uc_priv = dev_get_uclass_priv(dev);
+       struct udma_dev *ud = dev_get_priv(dev);
+       int i, ret;
+       u32 cap2, cap3;
+       struct udevice *tmp;
+       struct udevice *tisci_dev = NULL;
+
+       ret = udma_get_mmrs(dev);
+       if (ret)
+               return ret;
+
+       ret = uclass_get_device_by_phandle(UCLASS_MISC, dev,
+                                          "ti,ringacc", &tmp);
+       ud->ringacc = dev_get_priv(tmp);
+       if (IS_ERR(ud->ringacc))
+               return PTR_ERR(ud->ringacc);
+
+       ud->psil_base = dev_read_u32_default(dev, "ti,psil-base", 0);
+       if (!ud->psil_base) {
+               dev_info(dev,
+                        "Missing ti,psil-base property, using %d.\n", ret);
+               return -EINVAL;
+       }
+
+       ret = uclass_get_device_by_name(UCLASS_FIRMWARE, "dmsc", &tisci_dev);
+       if (ret) {
+               debug("TISCI RA RM get failed (%d)\n", ret);
+               ud->tisci = NULL;
+               return 0;
+       }
+       ud->tisci = (struct ti_sci_handle *)
+                        (ti_sci_get_handle_from_sysfw(tisci_dev));
+
+       ret = dev_read_u32_default(dev, "ti,sci", 0);
+       if (!ret) {
+               dev_err(dev, "TISCI RA RM disabled\n");
+               ud->tisci = NULL;
+       }
+
+       if (ud->tisci) {
+               ofnode navss_ofnode = ofnode_get_parent(dev_ofnode(dev));
+
+               ud->tisci_dev_id = -1;
+               ret = dev_read_u32(dev, "ti,sci-dev-id", &ud->tisci_dev_id);
+               if (ret) {
+                       dev_err(dev, "ti,sci-dev-id read failure %d\n", ret);
+                       return ret;
+               }
+
+               ud->tisci_navss_dev_id = -1;
+               ret = ofnode_read_u32(navss_ofnode, "ti,sci-dev-id",
+                                     &ud->tisci_navss_dev_id);
+               if (ret) {
+                       dev_err(dev, "navss sci-dev-id read failure %d\n", ret);
+                       return ret;
+               }
+
+               ud->tisci_udmap_ops = &ud->tisci->ops.rm_udmap_ops;
+               ud->tisci_psil_ops = &ud->tisci->ops.rm_psil_ops;
+       }
+
+       ud->is_coherent = dev_read_bool(dev, "dma-coherent");
+
+       cap2 = udma_read(ud->mmrs[MMR_GCFG], 0x28);
+       cap3 = udma_read(ud->mmrs[MMR_GCFG], 0x2c);
+
+       ud->rflow_cnt = cap3 & 0x3fff;
+       ud->tchan_cnt = cap2 & 0x1ff;
+       ud->echan_cnt = (cap2 >> 9) & 0x1ff;
+       ud->rchan_cnt = (cap2 >> 18) & 0x1ff;
+       ud->ch_count  = ud->tchan_cnt + ud->rchan_cnt;
+
+       dev_info(dev,
+                "Number of channels: %u (tchan: %u, echan: %u, rchan: %u dev-id %u)\n",
+                ud->ch_count, ud->tchan_cnt, ud->echan_cnt, ud->rchan_cnt,
+                ud->tisci_dev_id);
+       dev_info(dev, "Number of rflows: %u\n", ud->rflow_cnt);
+
+       ud->channels = devm_kcalloc(dev, ud->ch_count, sizeof(*ud->channels),
+                                   GFP_KERNEL);
+       ud->tchan_map = devm_kcalloc(dev, BITS_TO_LONGS(ud->tchan_cnt),
+                                    sizeof(unsigned long), GFP_KERNEL);
+       ud->tchans = devm_kcalloc(dev, ud->tchan_cnt,
+                                 sizeof(*ud->tchans), GFP_KERNEL);
+       ud->rchan_map = devm_kcalloc(dev, BITS_TO_LONGS(ud->rchan_cnt),
+                                    sizeof(unsigned long), GFP_KERNEL);
+       ud->rchans = devm_kcalloc(dev, ud->rchan_cnt,
+                                 sizeof(*ud->rchans), GFP_KERNEL);
+       ud->rflow_map = devm_kcalloc(dev, BITS_TO_LONGS(ud->rflow_cnt),
+                                    sizeof(unsigned long), GFP_KERNEL);
+       ud->rflows = devm_kcalloc(dev, ud->rflow_cnt,
+                                 sizeof(*ud->rflows), GFP_KERNEL);
+
+       if (!ud->channels || !ud->tchan_map || !ud->rchan_map ||
+           !ud->rflow_map || !ud->tchans || !ud->rchans || !ud->rflows)
+               return -ENOMEM;
+
+       for (i = 0; i < ud->tchan_cnt; i++) {
+               struct udma_tchan *tchan = &ud->tchans[i];
+
+               tchan->id = i;
+               tchan->reg_rt = ud->mmrs[MMR_TCHANRT] + UDMA_CH_1000(i);
+       }
+
+       for (i = 0; i < ud->rchan_cnt; i++) {
+               struct udma_rchan *rchan = &ud->rchans[i];
+
+               rchan->id = i;
+               rchan->reg_rt = ud->mmrs[MMR_RCHANRT] + UDMA_CH_1000(i);
+       }
+
+       for (i = 0; i < ud->rflow_cnt; i++) {
+               struct udma_rflow *rflow = &ud->rflows[i];
+
+               rflow->id = i;
+       }
+
+       for (i = 0; i < ud->ch_count; i++) {
+               struct udma_chan *uc = &ud->channels[i];
+
+               uc->ud = ud;
+               uc->id = i;
+               uc->slave_thread_id = -1;
+               uc->tchan = NULL;
+               uc->rchan = NULL;
+               uc->dir = DMA_MEM_TO_MEM;
+               sprintf(uc->name, "UDMA chan%d\n", i);
+               if (!i)
+                       uc->in_use = true;
+       }
+
+       pr_debug("UDMA(rev: 0x%08x) CAP0-3: 0x%08x, 0x%08x, 0x%08x, 0x%08x\n",
+                udma_read(ud->mmrs[MMR_GCFG], 0),
+                udma_read(ud->mmrs[MMR_GCFG], 0x20),
+                udma_read(ud->mmrs[MMR_GCFG], 0x24),
+                udma_read(ud->mmrs[MMR_GCFG], 0x28),
+                udma_read(ud->mmrs[MMR_GCFG], 0x2c));
+
+       uc_priv->supported = DMA_SUPPORTS_MEM_TO_MEM | DMA_SUPPORTS_MEM_TO_DEV;
+
+       return ret;
+}
+
+static int *udma_prep_dma_memcpy(struct udma_chan *uc, dma_addr_t dest,
+                                dma_addr_t src, size_t len)
+{
+       u32 tc_ring_id = k3_nav_ringacc_get_ring_id(uc->tchan->tc_ring);
+       struct cppi5_tr_type15_t *tr_req;
+       int num_tr;
+       size_t tr_size = sizeof(struct cppi5_tr_type15_t);
+       u16 tr0_cnt0, tr0_cnt1, tr1_cnt0;
+       unsigned long dummy;
+       void *tr_desc;
+       size_t desc_size;
+
+       if (len < SZ_64K) {
+               num_tr = 1;
+               tr0_cnt0 = len;
+               tr0_cnt1 = 1;
+       } else {
+               unsigned long align_to = __ffs(src | dest);
+
+               if (align_to > 3)
+                       align_to = 3;
+               /*
+                * Keep simple: tr0: SZ_64K-alignment blocks,
+                *              tr1: the remaining
+                */
+               num_tr = 2;
+               tr0_cnt0 = (SZ_64K - BIT(align_to));
+               if (len / tr0_cnt0 >= SZ_64K) {
+                       dev_err(uc->ud->dev, "size %zu is not supported\n",
+                               len);
+                       return NULL;
+               }
+
+               tr0_cnt1 = len / tr0_cnt0;
+               tr1_cnt0 = len % tr0_cnt0;
+       }
+
+       desc_size = cppi5_trdesc_calc_size(num_tr, tr_size);
+       tr_desc = dma_alloc_coherent(desc_size, &dummy);
+       if (!tr_desc)
+               return NULL;
+       memset(tr_desc, 0, desc_size);
+
+       cppi5_trdesc_init(tr_desc, num_tr, tr_size, 0, 0);
+       cppi5_desc_set_pktids(tr_desc, uc->id, 0x3fff);
+       cppi5_desc_set_retpolicy(tr_desc, 0, tc_ring_id);
+
+       tr_req = tr_desc + tr_size;
+
+       cppi5_tr_init(&tr_req[0].flags, CPPI5_TR_TYPE15, false, true,
+                     CPPI5_TR_EVENT_SIZE_COMPLETION, 1);
+       cppi5_tr_csf_set(&tr_req[0].flags, CPPI5_TR_CSF_SUPR_EVT);
+
+       tr_req[0].addr = src;
+       tr_req[0].icnt0 = tr0_cnt0;
+       tr_req[0].icnt1 = tr0_cnt1;
+       tr_req[0].icnt2 = 1;
+       tr_req[0].icnt3 = 1;
+       tr_req[0].dim1 = tr0_cnt0;
+
+       tr_req[0].daddr = dest;
+       tr_req[0].dicnt0 = tr0_cnt0;
+       tr_req[0].dicnt1 = tr0_cnt1;
+       tr_req[0].dicnt2 = 1;
+       tr_req[0].dicnt3 = 1;
+       tr_req[0].ddim1 = tr0_cnt0;
+
+       if (num_tr == 2) {
+               cppi5_tr_init(&tr_req[1].flags, CPPI5_TR_TYPE15, false, true,
+                             CPPI5_TR_EVENT_SIZE_COMPLETION, 0);
+               cppi5_tr_csf_set(&tr_req[1].flags, CPPI5_TR_CSF_SUPR_EVT);
+
+               tr_req[1].addr = src + tr0_cnt1 * tr0_cnt0;
+               tr_req[1].icnt0 = tr1_cnt0;
+               tr_req[1].icnt1 = 1;
+               tr_req[1].icnt2 = 1;
+               tr_req[1].icnt3 = 1;
+
+               tr_req[1].daddr = dest + tr0_cnt1 * tr0_cnt0;
+               tr_req[1].dicnt0 = tr1_cnt0;
+               tr_req[1].dicnt1 = 1;
+               tr_req[1].dicnt2 = 1;
+               tr_req[1].dicnt3 = 1;
+       }
+
+       cppi5_tr_csf_set(&tr_req[num_tr - 1].flags, CPPI5_TR_CSF_EOP);
+
+       if (!udma_is_coherent(uc)) {
+               flush_dcache_range((u64)tr_desc,
+                                  ALIGN((u64)tr_desc + desc_size,
+                                        ARCH_DMA_MINALIGN));
+       }
+
+       k3_nav_ringacc_ring_push(uc->tchan->t_ring, &tr_desc);
+
+       return 0;
+}
+
+static int udma_transfer(struct udevice *dev, int direction,
+                        void *dst, void *src, size_t len)
+{
+       struct udma_dev *ud = dev_get_priv(dev);
+       /* Channel0 is reserved for memcpy */
+       struct udma_chan *uc = &ud->channels[0];
+       dma_addr_t paddr = 0;
+       int ret;
+
+       ret = udma_alloc_chan_resources(uc);
+       if (ret)
+               return ret;
+
+       udma_prep_dma_memcpy(uc, (dma_addr_t)dst, (dma_addr_t)src, len);
+       udma_start(uc);
+       udma_poll_completion(uc, &paddr);
+       udma_stop(uc);
+
+       udma_free_chan_resources(uc);
+       return 0;
+}
+
+static int udma_request(struct dma *dma)
+{
+       struct udma_dev *ud = dev_get_priv(dma->dev);
+       struct udma_chan *uc;
+       unsigned long dummy;
+       int ret;
+
+       if (dma->id >= (ud->rchan_cnt + ud->tchan_cnt)) {
+               dev_err(dma->dev, "invalid dma ch_id %lu\n", dma->id);
+               return -EINVAL;
+       }
+
+       uc = &ud->channels[dma->id];
+       ret = udma_alloc_chan_resources(uc);
+       if (ret) {
+               dev_err(dma->dev, "alloc dma res failed %d\n", ret);
+               return -EINVAL;
+       }
+
+       uc->hdesc_size = cppi5_hdesc_calc_size(uc->needs_epib,
+                                              uc->psd_size, 0);
+       uc->hdesc_size = ALIGN(uc->hdesc_size, ARCH_DMA_MINALIGN);
+
+       if (uc->dir == DMA_MEM_TO_DEV) {
+               uc->desc_tx = dma_alloc_coherent(uc->hdesc_size, &dummy);
+               memset(uc->desc_tx, 0, uc->hdesc_size);
+       } else {
+               uc->desc_rx = dma_alloc_coherent(
+                               uc->hdesc_size * UDMA_RX_DESC_NUM, &dummy);
+               memset(uc->desc_rx, 0, uc->hdesc_size * UDMA_RX_DESC_NUM);
+       }
+
+       uc->in_use = true;
+       uc->desc_rx_cur = 0;
+       uc->num_rx_bufs = 0;
+
+       return 0;
+}
+
+static int udma_free(struct dma *dma)
+{
+       struct udma_dev *ud = dev_get_priv(dma->dev);
+       struct udma_chan *uc;
+
+       if (dma->id >= (ud->rchan_cnt + ud->tchan_cnt)) {
+               dev_err(dma->dev, "invalid dma ch_id %lu\n", dma->id);
+               return -EINVAL;
+       }
+       uc = &ud->channels[dma->id];
+
+       if (udma_is_chan_running(uc))
+               udma_stop(uc);
+       udma_free_chan_resources(uc);
+
+       uc->in_use = false;
+
+       return 0;
+}
+
+static int udma_enable(struct dma *dma)
+{
+       struct udma_dev *ud = dev_get_priv(dma->dev);
+       struct udma_chan *uc;
+       int ret;
+
+       if (dma->id >= (ud->rchan_cnt + ud->tchan_cnt)) {
+               dev_err(dma->dev, "invalid dma ch_id %lu\n", dma->id);
+               return -EINVAL;
+       }
+       uc = &ud->channels[dma->id];
+
+       ret = udma_start(uc);
+
+       return ret;
+}
+
+static int udma_disable(struct dma *dma)
+{
+       struct udma_dev *ud = dev_get_priv(dma->dev);
+       struct udma_chan *uc;
+       int ret = 0;
+
+       if (dma->id >= (ud->rchan_cnt + ud->tchan_cnt)) {
+               dev_err(dma->dev, "invalid dma ch_id %lu\n", dma->id);
+               return -EINVAL;
+       }
+       uc = &ud->channels[dma->id];
+
+       if (udma_is_chan_running(uc))
+               ret = udma_stop(uc);
+       else
+               dev_err(dma->dev, "%s not running\n", __func__);
+
+       return ret;
+}
+
+static int udma_send(struct dma *dma, void *src, size_t len, void *metadata)
+{
+       struct udma_dev *ud = dev_get_priv(dma->dev);
+       struct cppi5_host_desc_t *desc_tx;
+       dma_addr_t dma_src = (dma_addr_t)src;
+       struct ti_udma_drv_packet_data packet_data = { 0 };
+       dma_addr_t paddr;
+       struct udma_chan *uc;
+       u32 tc_ring_id;
+       int ret;
+
+       if (!metadata)
+               packet_data = *((struct ti_udma_drv_packet_data *)metadata);
+
+       if (dma->id >= (ud->rchan_cnt + ud->tchan_cnt)) {
+               dev_err(dma->dev, "invalid dma ch_id %lu\n", dma->id);
+               return -EINVAL;
+       }
+       uc = &ud->channels[dma->id];
+
+       if (uc->dir != DMA_MEM_TO_DEV)
+               return -EINVAL;
+
+       tc_ring_id = k3_nav_ringacc_get_ring_id(uc->tchan->tc_ring);
+
+       desc_tx = uc->desc_tx;
+
+       cppi5_hdesc_reset_hbdesc(desc_tx);
+
+       cppi5_hdesc_init(desc_tx,
+                        uc->needs_epib ? CPPI5_INFO0_HDESC_EPIB_PRESENT : 0,
+                        uc->psd_size);
+       cppi5_hdesc_set_pktlen(desc_tx, len);
+       cppi5_hdesc_attach_buf(desc_tx, dma_src, len, dma_src, len);
+       cppi5_desc_set_pktids(&desc_tx->hdr, uc->id, 0x3fff);
+       cppi5_desc_set_retpolicy(&desc_tx->hdr, 0, tc_ring_id);
+       /* pass below information from caller */
+       cppi5_hdesc_set_pkttype(desc_tx, packet_data.pkt_type);
+       cppi5_desc_set_tags_ids(&desc_tx->hdr, 0, packet_data.dest_tag);
+
+       if (!udma_is_coherent(uc)) {
+               flush_dcache_range((u64)dma_src,
+                                  ALIGN((u64)dma_src + len,
+                                        ARCH_DMA_MINALIGN));
+               flush_dcache_range((u64)desc_tx,
+                                  ALIGN((u64)desc_tx + uc->hdesc_size,
+                                        ARCH_DMA_MINALIGN));
+       }
+
+       ret = k3_nav_ringacc_ring_push(uc->tchan->t_ring, &uc->desc_tx);
+       if (ret) {
+               dev_err(dma->dev, "TX dma push fail ch_id %lu %d\n",
+                       dma->id, ret);
+               return ret;
+       }
+
+       udma_poll_completion(uc, &paddr);
+
+       return 0;
+}
+
+static int udma_receive(struct dma *dma, void **dst, void *metadata)
+{
+       struct udma_dev *ud = dev_get_priv(dma->dev);
+       struct cppi5_host_desc_t *desc_rx;
+       dma_addr_t buf_dma;
+       struct udma_chan *uc;
+       u32 buf_dma_len, pkt_len;
+       u32 port_id = 0;
+       int ret;
+
+       if (dma->id >= (ud->rchan_cnt + ud->tchan_cnt)) {
+               dev_err(dma->dev, "invalid dma ch_id %lu\n", dma->id);
+               return -EINVAL;
+       }
+       uc = &ud->channels[dma->id];
+
+       if (uc->dir != DMA_DEV_TO_MEM)
+               return -EINVAL;
+       if (!uc->num_rx_bufs)
+               return -EINVAL;
+
+       ret = k3_nav_ringacc_ring_pop(uc->rchan->r_ring, &desc_rx);
+       if (ret && ret != -ENODATA) {
+               dev_err(dma->dev, "rx dma fail ch_id:%lu %d\n", dma->id, ret);
+               return ret;
+       } else if (ret == -ENODATA) {
+               return 0;
+       }
+
+       /* invalidate cache data */
+       if (!udma_is_coherent(uc)) {
+               invalidate_dcache_range((ulong)desc_rx,
+                                       (ulong)(desc_rx + uc->hdesc_size));
+       }
+
+       cppi5_hdesc_get_obuf(desc_rx, &buf_dma, &buf_dma_len);
+       pkt_len = cppi5_hdesc_get_pktlen(desc_rx);
+
+       /* invalidate cache data */
+       if (!udma_is_coherent(uc)) {
+               invalidate_dcache_range((ulong)buf_dma,
+                                       (ulong)(buf_dma + buf_dma_len));
+       }
+
+       cppi5_desc_get_tags_ids(&desc_rx->hdr, &port_id, NULL);
+
+       *dst = (void *)buf_dma;
+       uc->num_rx_bufs--;
+
+       return pkt_len;
+}
+
+static int udma_of_xlate(struct dma *dma, struct ofnode_phandle_args *args)
+{
+       struct udma_dev *ud = dev_get_priv(dma->dev);
+       struct udma_chan *uc = &ud->channels[0];
+       ofnode chconf_node, slave_node;
+       char prop[50];
+       u32 val;
+
+       for (val = 0; val < ud->ch_count; val++) {
+               uc = &ud->channels[val];
+               if (!uc->in_use)
+                       break;
+       }
+
+       if (val == ud->ch_count)
+               return -EBUSY;
+
+       uc->dir = DMA_DEV_TO_MEM;
+       if (args->args[2] == UDMA_DIR_TX)
+               uc->dir = DMA_MEM_TO_DEV;
+
+       slave_node = ofnode_get_by_phandle(args->args[0]);
+       if (!ofnode_valid(slave_node)) {
+               dev_err(ud->dev, "slave node is missing\n");
+               return -EINVAL;
+       }
+
+       snprintf(prop, sizeof(prop), "ti,psil-config%u", args->args[1]);
+       chconf_node = ofnode_find_subnode(slave_node, prop);
+       if (!ofnode_valid(chconf_node)) {
+               dev_err(ud->dev, "Channel configuration node is missing\n");
+               return -EINVAL;
+       }
+
+       if (!ofnode_read_u32(chconf_node, "linux,udma-mode", &val)) {
+               if (val == UDMA_PKT_MODE)
+                       uc->pkt_mode = true;
+       }
+
+       if (!ofnode_read_u32(chconf_node, "statictr-type", &val))
+               uc->static_tr_type = val;
+
+       uc->needs_epib = ofnode_read_bool(chconf_node, "ti,needs-epib");
+       if (!ofnode_read_u32(chconf_node, "ti,psd-size", &val))
+               uc->psd_size = val;
+       uc->metadata_size = (uc->needs_epib ? 16 : 0) + uc->psd_size;
+
+       if (ofnode_read_u32(slave_node, "ti,psil-base", &val)) {
+               dev_err(ud->dev, "ti,psil-base is missing\n");
+               return -EINVAL;
+       }
+
+       uc->slave_thread_id = val + args->args[1];
+
+       dma->id = uc->id;
+       pr_debug("Allocated dma chn:%lu epib:%d psdata:%u meta:%u thread_id:%x\n",
+                dma->id, uc->needs_epib,
+                uc->psd_size, uc->metadata_size,
+                uc->slave_thread_id);
+
+       return 0;
+}
+
+int udma_prepare_rcv_buf(struct dma *dma, void *dst, size_t size)
+{
+       struct udma_dev *ud = dev_get_priv(dma->dev);
+       struct cppi5_host_desc_t *desc_rx;
+       dma_addr_t dma_dst;
+       struct udma_chan *uc;
+       u32 desc_num;
+
+       if (dma->id >= (ud->rchan_cnt + ud->tchan_cnt)) {
+               dev_err(dma->dev, "invalid dma ch_id %lu\n", dma->id);
+               return -EINVAL;
+       }
+       uc = &ud->channels[dma->id];
+
+       if (uc->dir != DMA_DEV_TO_MEM)
+               return -EINVAL;
+
+       if (uc->num_rx_bufs >= UDMA_RX_DESC_NUM)
+               return -EINVAL;
+
+       desc_num = uc->desc_rx_cur % UDMA_RX_DESC_NUM;
+       desc_rx = uc->desc_rx + (desc_num * uc->hdesc_size);
+       dma_dst = (dma_addr_t)dst;
+
+       cppi5_hdesc_reset_hbdesc(desc_rx);
+
+       cppi5_hdesc_init(desc_rx,
+                        uc->needs_epib ? CPPI5_INFO0_HDESC_EPIB_PRESENT : 0,
+                        uc->psd_size);
+       cppi5_hdesc_set_pktlen(desc_rx, size);
+       cppi5_hdesc_attach_buf(desc_rx, dma_dst, size, dma_dst, size);
+
+       if (!udma_is_coherent(uc)) {
+               flush_dcache_range((u64)desc_rx,
+                                  ALIGN((u64)desc_rx + uc->hdesc_size,
+                                        ARCH_DMA_MINALIGN));
+       }
+
+       k3_nav_ringacc_ring_push(uc->rchan->fd_ring, &desc_rx);
+
+       uc->num_rx_bufs++;
+       uc->desc_rx_cur++;
+
+       return 0;
+}
+
+static const struct dma_ops udma_ops = {
+       .transfer       = udma_transfer,
+       .of_xlate       = udma_of_xlate,
+       .request        = udma_request,
+       .free           = udma_free,
+       .enable         = udma_enable,
+       .disable        = udma_disable,
+       .send           = udma_send,
+       .receive        = udma_receive,
+       .prepare_rcv_buf = udma_prepare_rcv_buf,
+};
+
+static const struct udevice_id udma_ids[] = {
+       { .compatible = "ti,k3-navss-udmap" },
+       { }
+};
+
+U_BOOT_DRIVER(ti_edma3) = {
+       .name   = "ti-udma",
+       .id     = UCLASS_DMA,
+       .of_match = udma_ids,
+       .ops    = &udma_ops,
+       .probe  = udma_probe,
+       .priv_auto_alloc_size = sizeof(struct udma_dev),
+};
index 91481260411aa5a0b7f13ad823089f98a1da2236..d47d22fff3e4661e36bbbd876f1cd10815257411 100644 (file)
@@ -12,6 +12,7 @@
 #include <errno.h>
 #include <mailbox.h>
 #include <dm/device.h>
+#include <linux/compat.h>
 #include <linux/err.h>
 #include <linux/soc/ti/k3-sec-proxy.h>
 #include <linux/soc/ti/ti_sci_protocol.h>
@@ -31,16 +32,37 @@ struct ti_sci_xfer {
        u8 rx_len;
 };
 
+/**
+ * struct ti_sci_rm_type_map - Structure representing TISCI Resource
+ *                             management representation of dev_ids.
+ * @dev_id:    TISCI device ID
+ * @type:      Corresponding id as identified by TISCI RM.
+ *
+ * Note: This is used only as a work around for using RM range apis
+ *     for AM654 SoC. For future SoCs dev_id will be used as type
+ *     for RM range APIs. In order to maintain ABI backward compatibility
+ *     type is not being changed for AM654 SoC.
+ */
+struct ti_sci_rm_type_map {
+       u32 dev_id;
+       u16 type;
+};
+
 /**
  * struct ti_sci_desc - Description of SoC integration
- * @host_id:           Host identifier representing the compute entity
- * @max_rx_timeout_us: Timeout for communication with SoC (in Microseconds)
- * @max_msg_size:      Maximum size of data per message that can be handled.
+ * @default_host_id:   Host identifier representing the compute entity
+ * @max_rx_timeout_ms: Timeout for communication with SoC (in Milliseconds)
+ * @max_msgs: Maximum number of messages that can be pending
+ *               simultaneously in the system
+ * @max_msg_size: Maximum size of data per message that can be handled.
+ * @rm_type_map: RM resource type mapping structure.
  */
 struct ti_sci_desc {
-       u8 host_id;
-       int max_rx_timeout_us;
+       u8 default_host_id;
+       int max_rx_timeout_ms;
+       int max_msgs;
        int max_msg_size;
+       struct ti_sci_rm_type_map *rm_type_map;
 };
 
 /**
@@ -136,7 +158,7 @@ static inline int ti_sci_get_response(struct ti_sci_info *info,
        int ret;
 
        /* Receive the response */
-       ret = mbox_recv(chan, msg, info->desc->max_rx_timeout_us);
+       ret = mbox_recv(chan, msg, info->desc->max_rx_timeout_ms);
        if (ret) {
                dev_err(info->dev, "%s: Message receive failed. ret = %d\n",
                        __func__, ret);
@@ -1441,6 +1463,199 @@ static int ti_sci_cmd_core_reboot(const struct ti_sci_handle *handle)
        return ret;
 }
 
+static int ti_sci_get_resource_type(struct ti_sci_info *info, u16 dev_id,
+                                   u16 *type)
+{
+       struct ti_sci_rm_type_map *rm_type_map = info->desc->rm_type_map;
+       bool found = false;
+       int i;
+
+       /* If map is not provided then assume dev_id is used as type */
+       if (!rm_type_map) {
+               *type = dev_id;
+               return 0;
+       }
+
+       for (i = 0; rm_type_map[i].dev_id; i++) {
+               if (rm_type_map[i].dev_id == dev_id) {
+                       *type = rm_type_map[i].type;
+                       found = true;
+                       break;
+               }
+       }
+
+       if (!found)
+               return -EINVAL;
+
+       return 0;
+}
+
+/**
+ * ti_sci_get_resource_range - Helper to get a range of resources assigned
+ *                            to a host. Resource is uniquely identified by
+ *                            type and subtype.
+ * @handle:            Pointer to TISCI handle.
+ * @dev_id:            TISCI device ID.
+ * @subtype:           Resource assignment subtype that is being requested
+ *                     from the given device.
+ * @s_host:            Host processor ID to which the resources are allocated
+ * @range_start:       Start index of the resource range
+ * @range_num:         Number of resources in the range
+ *
+ * Return: 0 if all went fine, else return appropriate error.
+ */
+static int ti_sci_get_resource_range(const struct ti_sci_handle *handle,
+                                    u32 dev_id, u8 subtype, u8 s_host,
+                                    u16 *range_start, u16 *range_num)
+{
+       struct ti_sci_msg_resp_get_resource_range *resp;
+       struct ti_sci_msg_req_get_resource_range req;
+       struct ti_sci_xfer *xfer;
+       struct ti_sci_info *info;
+       u16 type;
+       int ret = 0;
+
+       if (IS_ERR(handle))
+               return PTR_ERR(handle);
+       if (!handle)
+               return -EINVAL;
+
+       info = handle_to_ti_sci_info(handle);
+
+       xfer = ti_sci_setup_one_xfer(info, TI_SCI_MSG_GET_RESOURCE_RANGE,
+                                    TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+                                    (u32 *)&req, sizeof(req), sizeof(*resp));
+       if (IS_ERR(xfer)) {
+               ret = PTR_ERR(xfer);
+               dev_err(dev, "Message alloc failed(%d)\n", ret);
+               return ret;
+       }
+
+       ret = ti_sci_get_resource_type(info, dev_id, &type);
+       if (ret) {
+               dev_err(dev, "rm type lookup failed for %u\n", dev_id);
+               goto fail;
+       }
+
+       req.secondary_host = s_host;
+       req.type = type & MSG_RM_RESOURCE_TYPE_MASK;
+       req.subtype = subtype & MSG_RM_RESOURCE_SUBTYPE_MASK;
+
+       ret = ti_sci_do_xfer(info, xfer);
+       if (ret) {
+               dev_err(dev, "Mbox send fail %d\n", ret);
+               goto fail;
+       }
+
+       resp = (struct ti_sci_msg_resp_get_resource_range *)xfer->tx_message.buf;
+       if (!ti_sci_is_response_ack(resp)) {
+               ret = -ENODEV;
+       } else if (!resp->range_start && !resp->range_num) {
+               ret = -ENODEV;
+       } else {
+               *range_start = resp->range_start;
+               *range_num = resp->range_num;
+       };
+
+fail:
+       return ret;
+}
+
+/**
+ * ti_sci_cmd_get_resource_range - Get a range of resources assigned to host
+ *                                that is same as ti sci interface host.
+ * @handle:            Pointer to TISCI handle.
+ * @dev_id:            TISCI device ID.
+ * @subtype:           Resource assignment subtype that is being requested
+ *                     from the given device.
+ * @range_start:       Start index of the resource range
+ * @range_num:         Number of resources in the range
+ *
+ * Return: 0 if all went fine, else return appropriate error.
+ */
+static int ti_sci_cmd_get_resource_range(const struct ti_sci_handle *handle,
+                                        u32 dev_id, u8 subtype,
+                                        u16 *range_start, u16 *range_num)
+{
+       return ti_sci_get_resource_range(handle, dev_id, subtype,
+                                        TI_SCI_IRQ_SECONDARY_HOST_INVALID,
+                                        range_start, range_num);
+}
+
+/**
+ * ti_sci_cmd_get_resource_range_from_shost - Get a range of resources
+ *                                           assigned to a specified host.
+ * @handle:            Pointer to TISCI handle.
+ * @dev_id:            TISCI device ID.
+ * @subtype:           Resource assignment subtype that is being requested
+ *                     from the given device.
+ * @s_host:            Host processor ID to which the resources are allocated
+ * @range_start:       Start index of the resource range
+ * @range_num:         Number of resources in the range
+ *
+ * Return: 0 if all went fine, else return appropriate error.
+ */
+static
+int ti_sci_cmd_get_resource_range_from_shost(const struct ti_sci_handle *handle,
+                                            u32 dev_id, u8 subtype, u8 s_host,
+                                            u16 *range_start, u16 *range_num)
+{
+       return ti_sci_get_resource_range(handle, dev_id, subtype, s_host,
+                                        range_start, range_num);
+}
+
+/**
+ * ti_sci_cmd_query_msmc() - Command to query currently available msmc memory
+ * @handle:            pointer to TI SCI handle
+ * @msms_start:                MSMC start as returned by tisci
+ * @msmc_end:          MSMC end as returned by tisci
+ *
+ * Return: 0 if all went well, else returns appropriate error value.
+ */
+static int ti_sci_cmd_query_msmc(const struct ti_sci_handle *handle,
+                                u64 *msmc_start, u64 *msmc_end)
+{
+       struct ti_sci_msg_resp_query_msmc *resp;
+       struct ti_sci_msg_hdr req;
+       struct ti_sci_info *info;
+       struct ti_sci_xfer *xfer;
+       int ret = 0;
+
+       if (IS_ERR(handle))
+               return PTR_ERR(handle);
+       if (!handle)
+               return -EINVAL;
+
+       info = handle_to_ti_sci_info(handle);
+
+       xfer = ti_sci_setup_one_xfer(info, TISCI_MSG_QUERY_MSMC,
+                                    TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+                                    (u32 *)&req, sizeof(req), sizeof(*resp));
+       if (IS_ERR(xfer)) {
+               ret = PTR_ERR(xfer);
+               dev_err(info->dev, "Message alloc failed(%d)\n", ret);
+               return ret;
+       }
+
+       ret = ti_sci_do_xfer(info, xfer);
+       if (ret) {
+               dev_err(dev, "Mbox send fail %d\n", ret);
+               return ret;
+       }
+
+       resp = (struct ti_sci_msg_resp_query_msmc *)xfer->tx_message.buf;
+
+       if (!ti_sci_is_response_ack(resp))
+               return -ENODEV;
+
+       *msmc_start = ((u64)resp->msmc_start_high << TISCI_ADDR_HIGH_SHIFT) |
+                       resp->msmc_start_low;
+       *msmc_end = ((u64)resp->msmc_end_high << TISCI_ADDR_HIGH_SHIFT) |
+                       resp->msmc_end_low;
+
+       return ret;
+}
+
 /**
  * ti_sci_cmd_proc_request() - Command to request a physical processor control
  * @handle:    Pointer to TI SCI handle
@@ -1803,6 +2018,416 @@ static int ti_sci_cmd_get_proc_boot_status(const struct ti_sci_handle *handle,
        return ret;
 }
 
+/**
+ * ti_sci_cmd_ring_config() - configure RA ring
+ * @handle:    pointer to TI SCI handle
+ * @valid_params: Bitfield defining validity of ring configuration parameters.
+ * @nav_id: Device ID of Navigator Subsystem from which the ring is allocated
+ * @index: Ring index.
+ * @addr_lo: The ring base address lo 32 bits
+ * @addr_hi: The ring base address hi 32 bits
+ * @count: Number of ring elements.
+ * @mode: The mode of the ring
+ * @size: The ring element size.
+ * @order_id: Specifies the ring's bus order ID.
+ *
+ * Return: 0 if all went well, else returns appropriate error value.
+ *
+ * See @ti_sci_msg_rm_ring_cfg_req for more info.
+ */
+static int ti_sci_cmd_ring_config(const struct ti_sci_handle *handle,
+                                 u32 valid_params, u16 nav_id, u16 index,
+                                 u32 addr_lo, u32 addr_hi, u32 count,
+                                 u8 mode, u8 size, u8 order_id)
+{
+       struct ti_sci_msg_rm_ring_cfg_resp *resp;
+       struct ti_sci_msg_rm_ring_cfg_req req;
+       struct ti_sci_xfer *xfer;
+       struct ti_sci_info *info;
+       int ret = 0;
+
+       if (IS_ERR(handle))
+               return PTR_ERR(handle);
+       if (!handle)
+               return -EINVAL;
+
+       info = handle_to_ti_sci_info(handle);
+
+       xfer = ti_sci_setup_one_xfer(info, TI_SCI_MSG_RM_RING_CFG,
+                                    TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+                                    (u32 *)&req, sizeof(req), sizeof(*resp));
+       if (IS_ERR(xfer)) {
+               ret = PTR_ERR(xfer);
+               dev_err(info->dev, "RM_RA:Message config failed(%d)\n", ret);
+               return ret;
+       }
+       req.valid_params = valid_params;
+       req.nav_id = nav_id;
+       req.index = index;
+       req.addr_lo = addr_lo;
+       req.addr_hi = addr_hi;
+       req.count = count;
+       req.mode = mode;
+       req.size = size;
+       req.order_id = order_id;
+
+       ret = ti_sci_do_xfer(info, xfer);
+       if (ret) {
+               dev_err(info->dev, "RM_RA:Mbox config send fail %d\n", ret);
+               goto fail;
+       }
+
+       resp = (struct ti_sci_msg_rm_ring_cfg_resp *)xfer->tx_message.buf;
+
+       ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV;
+
+fail:
+       dev_dbg(info->dev, "RM_RA:config ring %u ret:%d\n", index, ret);
+       return ret;
+}
+
+/**
+ * ti_sci_cmd_ring_get_config() - get RA ring configuration
+ * @handle:    pointer to TI SCI handle
+ * @nav_id: Device ID of Navigator Subsystem from which the ring is allocated
+ * @index: Ring index.
+ * @addr_lo: returns ring's base address lo 32 bits
+ * @addr_hi: returns ring's base address hi 32 bits
+ * @count: returns number of ring elements.
+ * @mode: returns mode of the ring
+ * @size: returns ring element size.
+ * @order_id: returns ring's bus order ID.
+ *
+ * Return: 0 if all went well, else returns appropriate error value.
+ *
+ * See @ti_sci_msg_rm_ring_get_cfg_req for more info.
+ */
+static int ti_sci_cmd_ring_get_config(const struct ti_sci_handle *handle,
+                                     u32 nav_id, u32 index, u8 *mode,
+                                     u32 *addr_lo, u32 *addr_hi,
+                                     u32 *count, u8 *size, u8 *order_id)
+{
+       struct ti_sci_msg_rm_ring_get_cfg_resp *resp;
+       struct ti_sci_msg_rm_ring_get_cfg_req req;
+       struct ti_sci_xfer *xfer;
+       struct ti_sci_info *info;
+       int ret = 0;
+
+       if (IS_ERR(handle))
+               return PTR_ERR(handle);
+       if (!handle)
+               return -EINVAL;
+
+       info = handle_to_ti_sci_info(handle);
+
+       xfer = ti_sci_setup_one_xfer(info, TI_SCI_MSG_RM_RING_GET_CFG,
+                                    TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+                                    (u32 *)&req, sizeof(req), sizeof(*resp));
+       if (IS_ERR(xfer)) {
+               ret = PTR_ERR(xfer);
+               dev_err(info->dev,
+                       "RM_RA:Message get config failed(%d)\n", ret);
+               return ret;
+       }
+       req.nav_id = nav_id;
+       req.index = index;
+
+       ret = ti_sci_do_xfer(info, xfer);
+       if (ret) {
+               dev_err(info->dev, "RM_RA:Mbox get config send fail %d\n", ret);
+               goto fail;
+       }
+
+       resp = (struct ti_sci_msg_rm_ring_get_cfg_resp *)xfer->tx_message.buf;
+
+       if (!ti_sci_is_response_ack(resp)) {
+               ret = -ENODEV;
+       } else {
+               if (mode)
+                       *mode = resp->mode;
+               if (addr_lo)
+                       *addr_lo = resp->addr_lo;
+               if (addr_hi)
+                       *addr_hi = resp->addr_hi;
+               if (count)
+                       *count = resp->count;
+               if (size)
+                       *size = resp->size;
+               if (order_id)
+                       *order_id = resp->order_id;
+       };
+
+fail:
+       dev_dbg(info->dev, "RM_RA:get config ring %u ret:%d\n", index, ret);
+       return ret;
+}
+
+static int ti_sci_cmd_rm_psil_pair(const struct ti_sci_handle *handle,
+                                  u32 nav_id, u32 src_thread, u32 dst_thread)
+{
+       struct ti_sci_msg_hdr *resp;
+       struct ti_sci_msg_psil_pair req;
+       struct ti_sci_xfer *xfer;
+       struct ti_sci_info *info;
+       int ret = 0;
+
+       if (IS_ERR(handle))
+               return PTR_ERR(handle);
+       if (!handle)
+               return -EINVAL;
+
+       info = handle_to_ti_sci_info(handle);
+
+       xfer = ti_sci_setup_one_xfer(info, TI_SCI_MSG_RM_PSIL_PAIR,
+                                    TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+                                    (u32 *)&req, sizeof(req), sizeof(*resp));
+       if (IS_ERR(xfer)) {
+               ret = PTR_ERR(xfer);
+               dev_err(info->dev, "RM_PSIL:Message alloc failed(%d)\n", ret);
+               return ret;
+       }
+       req.nav_id = nav_id;
+       req.src_thread = src_thread;
+       req.dst_thread = dst_thread;
+
+       ret = ti_sci_do_xfer(info, xfer);
+       if (ret) {
+               dev_err(info->dev, "RM_PSIL:Mbox send fail %d\n", ret);
+               goto fail;
+       }
+
+       resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
+       ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV;
+
+fail:
+       dev_dbg(info->dev, "RM_PSIL: nav: %u link pair %u->%u ret:%u\n",
+               nav_id, src_thread, dst_thread, ret);
+       return ret;
+}
+
+static int ti_sci_cmd_rm_psil_unpair(const struct ti_sci_handle *handle,
+                                    u32 nav_id, u32 src_thread, u32 dst_thread)
+{
+       struct ti_sci_msg_hdr *resp;
+       struct ti_sci_msg_psil_unpair req;
+       struct ti_sci_xfer *xfer;
+       struct ti_sci_info *info;
+       int ret = 0;
+
+       if (IS_ERR(handle))
+               return PTR_ERR(handle);
+       if (!handle)
+               return -EINVAL;
+
+       info = handle_to_ti_sci_info(handle);
+
+       xfer = ti_sci_setup_one_xfer(info, TI_SCI_MSG_RM_PSIL_UNPAIR,
+                                    TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+                                    (u32 *)&req, sizeof(req), sizeof(*resp));
+       if (IS_ERR(xfer)) {
+               ret = PTR_ERR(xfer);
+               dev_err(info->dev, "RM_PSIL:Message alloc failed(%d)\n", ret);
+               return ret;
+       }
+       req.nav_id = nav_id;
+       req.src_thread = src_thread;
+       req.dst_thread = dst_thread;
+
+       ret = ti_sci_do_xfer(info, xfer);
+       if (ret) {
+               dev_err(info->dev, "RM_PSIL:Mbox send fail %d\n", ret);
+               goto fail;
+       }
+
+       resp = (struct ti_sci_msg_hdr *)xfer->tx_message.buf;
+       ret = ti_sci_is_response_ack(resp) ? 0 : -ENODEV;
+
+fail:
+       dev_dbg(info->dev, "RM_PSIL: link unpair %u->%u ret:%u\n",
+               src_thread, dst_thread, ret);
+       return ret;
+}
+
+static int ti_sci_cmd_rm_udmap_tx_ch_cfg(
+                       const struct ti_sci_handle *handle,
+                       const struct ti_sci_msg_rm_udmap_tx_ch_cfg *params)
+{
+       struct ti_sci_msg_rm_udmap_tx_ch_cfg_resp *resp;
+       struct ti_sci_msg_rm_udmap_tx_ch_cfg_req req;
+       struct ti_sci_xfer *xfer;
+       struct ti_sci_info *info;
+       int ret = 0;
+
+       if (IS_ERR(handle))
+               return PTR_ERR(handle);
+       if (!handle)
+               return -EINVAL;
+
+       info = handle_to_ti_sci_info(handle);
+
+       xfer = ti_sci_setup_one_xfer(info, TISCI_MSG_RM_UDMAP_TX_CH_CFG,
+                                    TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+                                    (u32 *)&req, sizeof(req), sizeof(*resp));
+       if (IS_ERR(xfer)) {
+               ret = PTR_ERR(xfer);
+               dev_err(info->dev, "Message TX_CH_CFG alloc failed(%d)\n", ret);
+               return ret;
+       }
+       req.valid_params = params->valid_params;
+       req.nav_id = params->nav_id;
+       req.index = params->index;
+       req.tx_pause_on_err = params->tx_pause_on_err;
+       req.tx_filt_einfo = params->tx_filt_einfo;
+       req.tx_filt_pswords = params->tx_filt_pswords;
+       req.tx_atype = params->tx_atype;
+       req.tx_chan_type = params->tx_chan_type;
+       req.tx_supr_tdpkt = params->tx_supr_tdpkt;
+       req.tx_fetch_size = params->tx_fetch_size;
+       req.tx_credit_count = params->tx_credit_count;
+       req.txcq_qnum = params->txcq_qnum;
+       req.tx_priority = params->tx_priority;
+       req.tx_qos = params->tx_qos;
+       req.tx_orderid = params->tx_orderid;
+       req.fdepth = params->fdepth;
+       req.tx_sched_priority = params->tx_sched_priority;
+
+       ret = ti_sci_do_xfer(info, xfer);
+       if (ret) {
+               dev_err(info->dev, "Mbox send TX_CH_CFG fail %d\n", ret);
+               goto fail;
+       }
+
+       resp =
+             (struct ti_sci_msg_rm_udmap_tx_ch_cfg_resp *)xfer->tx_message.buf;
+       ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL;
+
+fail:
+       dev_dbg(info->dev, "TX_CH_CFG: chn %u ret:%u\n", params->index, ret);
+       return ret;
+}
+
+static int ti_sci_cmd_rm_udmap_rx_ch_cfg(
+                       const struct ti_sci_handle *handle,
+                       const struct ti_sci_msg_rm_udmap_rx_ch_cfg *params)
+{
+       struct ti_sci_msg_rm_udmap_rx_ch_cfg_resp *resp;
+       struct ti_sci_msg_rm_udmap_rx_ch_cfg_req req;
+       struct ti_sci_xfer *xfer;
+       struct ti_sci_info *info;
+       int ret = 0;
+
+       if (IS_ERR(handle))
+               return PTR_ERR(handle);
+       if (!handle)
+               return -EINVAL;
+
+       info = handle_to_ti_sci_info(handle);
+
+       xfer = ti_sci_setup_one_xfer(info, TISCI_MSG_RM_UDMAP_RX_CH_CFG,
+                                    TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+                                    (u32 *)&req, sizeof(req), sizeof(*resp));
+       if (IS_ERR(xfer)) {
+               ret = PTR_ERR(xfer);
+               dev_err(info->dev, "Message RX_CH_CFG alloc failed(%d)\n", ret);
+               return ret;
+       }
+
+       req.valid_params = params->valid_params;
+       req.nav_id = params->nav_id;
+       req.index = params->index;
+       req.rx_fetch_size = params->rx_fetch_size;
+       req.rxcq_qnum = params->rxcq_qnum;
+       req.rx_priority = params->rx_priority;
+       req.rx_qos = params->rx_qos;
+       req.rx_orderid = params->rx_orderid;
+       req.rx_sched_priority = params->rx_sched_priority;
+       req.flowid_start = params->flowid_start;
+       req.flowid_cnt = params->flowid_cnt;
+       req.rx_pause_on_err = params->rx_pause_on_err;
+       req.rx_atype = params->rx_atype;
+       req.rx_chan_type = params->rx_chan_type;
+       req.rx_ignore_short = params->rx_ignore_short;
+       req.rx_ignore_long = params->rx_ignore_long;
+
+       ret = ti_sci_do_xfer(info, xfer);
+       if (ret) {
+               dev_err(info->dev, "Mbox send RX_CH_CFG fail %d\n", ret);
+               goto fail;
+       }
+
+       resp =
+             (struct ti_sci_msg_rm_udmap_rx_ch_cfg_resp *)xfer->tx_message.buf;
+       ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL;
+
+fail:
+       dev_dbg(info->dev, "RX_CH_CFG: chn %u ret:%d\n", params->index, ret);
+       return ret;
+}
+
+static int ti_sci_cmd_rm_udmap_rx_flow_cfg(
+                       const struct ti_sci_handle *handle,
+                       const struct ti_sci_msg_rm_udmap_flow_cfg *params)
+{
+       struct ti_sci_msg_rm_udmap_flow_cfg_resp *resp;
+       struct ti_sci_msg_rm_udmap_flow_cfg_req req;
+       struct ti_sci_xfer *xfer;
+       struct ti_sci_info *info;
+       int ret = 0;
+
+       if (IS_ERR(handle))
+               return PTR_ERR(handle);
+       if (!handle)
+               return -EINVAL;
+
+       info = handle_to_ti_sci_info(handle);
+
+       xfer = ti_sci_setup_one_xfer(info, TISCI_MSG_RM_UDMAP_FLOW_CFG,
+                                    TI_SCI_FLAG_REQ_ACK_ON_PROCESSED,
+                                    (u32 *)&req, sizeof(req), sizeof(*resp));
+       if (IS_ERR(xfer)) {
+               ret = PTR_ERR(xfer);
+               dev_err(dev, "RX_FL_CFG: Message alloc failed(%d)\n", ret);
+               return ret;
+       }
+
+       req.valid_params = params->valid_params;
+       req.nav_id = params->nav_id;
+       req.flow_index = params->flow_index;
+       req.rx_einfo_present = params->rx_einfo_present;
+       req.rx_psinfo_present = params->rx_psinfo_present;
+       req.rx_error_handling = params->rx_error_handling;
+       req.rx_desc_type = params->rx_desc_type;
+       req.rx_sop_offset = params->rx_sop_offset;
+       req.rx_dest_qnum = params->rx_dest_qnum;
+       req.rx_src_tag_hi = params->rx_src_tag_hi;
+       req.rx_src_tag_lo = params->rx_src_tag_lo;
+       req.rx_dest_tag_hi = params->rx_dest_tag_hi;
+       req.rx_dest_tag_lo = params->rx_dest_tag_lo;
+       req.rx_src_tag_hi_sel = params->rx_src_tag_hi_sel;
+       req.rx_src_tag_lo_sel = params->rx_src_tag_lo_sel;
+       req.rx_dest_tag_hi_sel = params->rx_dest_tag_hi_sel;
+       req.rx_dest_tag_lo_sel = params->rx_dest_tag_lo_sel;
+       req.rx_fdq0_sz0_qnum = params->rx_fdq0_sz0_qnum;
+       req.rx_fdq1_qnum = params->rx_fdq1_qnum;
+       req.rx_fdq2_qnum = params->rx_fdq2_qnum;
+       req.rx_fdq3_qnum = params->rx_fdq3_qnum;
+       req.rx_ps_location = params->rx_ps_location;
+
+       ret = ti_sci_do_xfer(info, xfer);
+       if (ret) {
+               dev_err(dev, "RX_FL_CFG: Mbox send fail %d\n", ret);
+               goto fail;
+       }
+
+       resp =
+              (struct ti_sci_msg_rm_udmap_flow_cfg_resp *)xfer->tx_message.buf;
+       ret = ti_sci_is_response_ack(resp) ? 0 : -EINVAL;
+
+fail:
+       dev_dbg(info->dev, "RX_FL_CFG: %u ret:%d\n", params->flow_index, ret);
+       return ret;
+}
+
 /*
  * ti_sci_setup_ops() - Setup the operations structures
  * @info:      pointer to TISCI pointer
@@ -1814,7 +2439,11 @@ static void ti_sci_setup_ops(struct ti_sci_info *info)
        struct ti_sci_dev_ops *dops = &ops->dev_ops;
        struct ti_sci_clk_ops *cops = &ops->clk_ops;
        struct ti_sci_core_ops *core_ops = &ops->core_ops;
+       struct ti_sci_rm_core_ops *rm_core_ops = &ops->rm_core_ops;
        struct ti_sci_proc_ops *pops = &ops->proc_ops;
+       struct ti_sci_rm_ringacc_ops *rops = &ops->rm_ring_ops;
+       struct ti_sci_rm_psil_ops *psilops = &ops->rm_psil_ops;
+       struct ti_sci_rm_udmap_ops *udmap_ops = &ops->rm_udmap_ops;
 
        bops->board_config = ti_sci_cmd_set_board_config;
        bops->board_config_rm = ti_sci_cmd_set_board_config_rm;
@@ -1849,6 +2478,11 @@ static void ti_sci_setup_ops(struct ti_sci_info *info)
        cops->get_freq = ti_sci_cmd_clk_get_freq;
 
        core_ops->reboot_device = ti_sci_cmd_core_reboot;
+       core_ops->query_msmc = ti_sci_cmd_query_msmc;
+
+       rm_core_ops->get_range = ti_sci_cmd_get_resource_range;
+       rm_core_ops->get_range_from_shost =
+               ti_sci_cmd_get_resource_range_from_shost;
 
        pops->proc_request = ti_sci_cmd_proc_request;
        pops->proc_release = ti_sci_cmd_proc_release;
@@ -1857,6 +2491,16 @@ static void ti_sci_setup_ops(struct ti_sci_info *info)
        pops->set_proc_boot_ctrl = ti_sci_cmd_set_proc_boot_ctrl;
        pops->proc_auth_boot_image = ti_sci_cmd_proc_auth_boot_image;
        pops->get_proc_boot_status = ti_sci_cmd_get_proc_boot_status;
+
+       rops->config = ti_sci_cmd_ring_config;
+       rops->get_config = ti_sci_cmd_ring_get_config;
+
+       psilops->pair = ti_sci_cmd_rm_psil_pair;
+       psilops->unpair = ti_sci_cmd_rm_psil_unpair;
+
+       udmap_ops->tx_ch_cfg = ti_sci_cmd_rm_udmap_tx_ch_cfg;
+       udmap_ops->rx_ch_cfg = ti_sci_cmd_rm_udmap_rx_ch_cfg;
+       udmap_ops->rx_flow_cfg = ti_sci_cmd_rm_udmap_rx_flow_cfg;
 }
 
 /**
@@ -1969,7 +2613,7 @@ static int ti_sci_of_to_info(struct udevice *dev, struct ti_sci_info *info)
        }
 
        info->host_id = dev_read_u32_default(dev, "ti,host-id",
-                                            info->desc->host_id);
+                                            info->desc->default_host_id);
 
        info->is_secure = dev_read_bool(dev, "ti,secure-host");
 
@@ -2009,17 +2653,164 @@ static int ti_sci_probe(struct udevice *dev)
        return ret;
 }
 
+/*
+ * ti_sci_get_free_resource() - Get a free resource from TISCI resource.
+ * @res:       Pointer to the TISCI resource
+ *
+ * Return: resource num if all went ok else TI_SCI_RESOURCE_NULL.
+ */
+u16 ti_sci_get_free_resource(struct ti_sci_resource *res)
+{
+       u16 set, free_bit;
+
+       for (set = 0; set < res->sets; set++) {
+               free_bit = find_first_zero_bit(res->desc[set].res_map,
+                                              res->desc[set].num);
+               if (free_bit != res->desc[set].num) {
+                       set_bit(free_bit, res->desc[set].res_map);
+                       return res->desc[set].start + free_bit;
+               }
+       }
+
+       return TI_SCI_RESOURCE_NULL;
+}
+
+/**
+ * ti_sci_release_resource() - Release a resource from TISCI resource.
+ * @res:       Pointer to the TISCI resource
+ */
+void ti_sci_release_resource(struct ti_sci_resource *res, u16 id)
+{
+       u16 set;
+
+       for (set = 0; set < res->sets; set++) {
+               if (res->desc[set].start <= id &&
+                   (res->desc[set].num + res->desc[set].start) > id)
+                       clear_bit(id - res->desc[set].start,
+                                 res->desc[set].res_map);
+       }
+}
+
+/**
+ * devm_ti_sci_get_of_resource() - Get a TISCI resource assigned to a device
+ * @handle:    TISCI handle
+ * @dev:       Device pointer to which the resource is assigned
+ * @of_prop:   property name by which the resource are represented
+ *
+ * Note: This function expects of_prop to be in the form of tuples
+ *     <type, subtype>. Allocates and initializes ti_sci_resource structure
+ *     for each of_prop. Client driver can directly call
+ *     ti_sci_(get_free, release)_resource apis for handling the resource.
+ *
+ * Return: Pointer to ti_sci_resource if all went well else appropriate
+ *        error pointer.
+ */
+struct ti_sci_resource *
+devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle,
+                           struct udevice *dev, u32 dev_id, char *of_prop)
+{
+       u32 resource_subtype;
+       u16 resource_type;
+       struct ti_sci_resource *res;
+       int sets, i, ret;
+       u32 *temp;
+
+       res = devm_kzalloc(dev, sizeof(*res), GFP_KERNEL);
+       if (!res)
+               return ERR_PTR(-ENOMEM);
+
+       sets = dev_read_size(dev, of_prop);
+       if (sets < 0) {
+               dev_err(dev, "%s resource type ids not available\n", of_prop);
+               return ERR_PTR(sets);
+       }
+       temp = malloc(sets);
+       sets /= sizeof(u32);
+       res->sets = sets;
+
+       res->desc = devm_kcalloc(dev, res->sets, sizeof(*res->desc),
+                                GFP_KERNEL);
+       if (!res->desc)
+               return ERR_PTR(-ENOMEM);
+
+       ret = ti_sci_get_resource_type(handle_to_ti_sci_info(handle), dev_id,
+                                      &resource_type);
+       if (ret) {
+               dev_err(dev, "No valid resource type for %u\n", dev_id);
+               return ERR_PTR(-EINVAL);
+       }
+
+       ret = dev_read_u32_array(dev, of_prop, temp, res->sets);
+       if (ret)
+               return ERR_PTR(-EINVAL);
+
+       for (i = 0; i < res->sets; i++) {
+               resource_subtype = temp[i];
+               ret = handle->ops.rm_core_ops.get_range(handle, dev_id,
+                                                       resource_subtype,
+                                                       &res->desc[i].start,
+                                                       &res->desc[i].num);
+               if (ret) {
+                       dev_err(dev, "type %d subtype %d not allocated for host %d\n",
+                               resource_type, resource_subtype,
+                               handle_to_ti_sci_info(handle)->host_id);
+                       return ERR_PTR(ret);
+               }
+
+               dev_dbg(dev, "res type = %d, subtype = %d, start = %d, num = %d\n",
+                       resource_type, resource_subtype, res->desc[i].start,
+                       res->desc[i].num);
+
+               res->desc[i].res_map =
+                       devm_kzalloc(dev, BITS_TO_LONGS(res->desc[i].num) *
+                                    sizeof(*res->desc[i].res_map), GFP_KERNEL);
+               if (!res->desc[i].res_map)
+                       return ERR_PTR(-ENOMEM);
+       }
+
+       return res;
+}
+
+/* Description for K2G */
+static const struct ti_sci_desc ti_sci_pmmc_k2g_desc = {
+       .default_host_id = 2,
+       /* Conservative duration */
+       .max_rx_timeout_ms = 10000,
+       /* Limited by MBOX_TX_QUEUE_LEN. K2G can handle upto 128 messages! */
+       .max_msgs = 20,
+       .max_msg_size = 64,
+       .rm_type_map = NULL,
+};
+
+static struct ti_sci_rm_type_map ti_sci_am654_rm_type_map[] = {
+       {.dev_id = 56, .type = 0x00b}, /* GIC_IRQ */
+       {.dev_id = 179, .type = 0x000}, /* MAIN_NAV_UDMASS_IA0 */
+       {.dev_id = 187, .type = 0x009}, /* MAIN_NAV_RA */
+       {.dev_id = 188, .type = 0x006}, /* MAIN_NAV_UDMAP */
+       {.dev_id = 194, .type = 0x007}, /* MCU_NAV_UDMAP */
+       {.dev_id = 195, .type = 0x00a}, /* MCU_NAV_RA */
+       {.dev_id = 0, .type = 0x000}, /* end of table */
+};
+
 /* Description for AM654 */
-static const struct ti_sci_desc ti_sci_sysfw_am654_desc = {
-       .host_id = 4,
-       .max_rx_timeout_us = 1000000,
+static const struct ti_sci_desc ti_sci_pmmc_am654_desc = {
+       .default_host_id = 12,
+       /* Conservative duration */
+       .max_rx_timeout_ms = 10000,
+       /* Limited by MBOX_TX_QUEUE_LEN. K2G can handle upto 128 messages! */
+       .max_msgs = 20,
        .max_msg_size = 60,
+       .rm_type_map = ti_sci_am654_rm_type_map,
 };
 
 static const struct udevice_id ti_sci_ids[] = {
        {
                .compatible = "ti,k2g-sci",
-               .data = (ulong)&ti_sci_sysfw_am654_desc
+               .data = (ulong)&ti_sci_pmmc_k2g_desc
+       },
+       {
+               .compatible = "ti,am654-sci",
+               .data = (ulong)&ti_sci_pmmc_am654_desc
        },
        { /* Sentinel */ },
 };
index 81591fb0c71f784094ce6e31d694e2ba1eeffce9..2d87cdd2cf96a0d66c31bdb6cee9f9acf97c5cb2 100644 (file)
@@ -25,6 +25,7 @@
 #define TI_SCI_MSG_BOARD_CONFIG_RM     0x000c
 #define TI_SCI_MSG_BOARD_CONFIG_SECURITY  0x000d
 #define TI_SCI_MSG_BOARD_CONFIG_PM     0x000e
+#define TISCI_MSG_QUERY_MSMC           0x0020
 
 /* Device requests */
 #define TI_SCI_MSG_SET_DEVICE_STATE    0x0200
 #define TISCI_MSG_PROC_AUTH_BOOT_IMIAGE        0xc120
 #define TISCI_MSG_GET_PROC_BOOT_STATUS 0xc400
 
+/* Resource Management Requests */
+#define TI_SCI_MSG_GET_RESOURCE_RANGE  0x1500
+
+/* NAVSS resource management */
+/* Ringacc requests */
+#define TI_SCI_MSG_RM_RING_CFG                 0x1110
+#define TI_SCI_MSG_RM_RING_GET_CFG             0x1111
+
+/* PSI-L requests */
+#define TI_SCI_MSG_RM_PSIL_PAIR                        0x1280
+#define TI_SCI_MSG_RM_PSIL_UNPAIR              0x1281
+
+#define TI_SCI_MSG_RM_UDMAP_TX_ALLOC           0x1200
+#define TI_SCI_MSG_RM_UDMAP_TX_FREE            0x1201
+#define TI_SCI_MSG_RM_UDMAP_RX_ALLOC           0x1210
+#define TI_SCI_MSG_RM_UDMAP_RX_FREE            0x1211
+#define TI_SCI_MSG_RM_UDMAP_FLOW_CFG           0x1220
+#define TI_SCI_MSG_RM_UDMAP_OPT_FLOW_CFG       0x1221
+
+#define TISCI_MSG_RM_UDMAP_TX_CH_CFG           0x1205
+#define TISCI_MSG_RM_UDMAP_TX_CH_GET_CFG       0x1206
+#define TISCI_MSG_RM_UDMAP_RX_CH_CFG           0x1215
+#define TISCI_MSG_RM_UDMAP_RX_CH_GET_CFG       0x1216
+#define TISCI_MSG_RM_UDMAP_FLOW_CFG            0x1230
+#define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_CFG        0x1231
+#define TISCI_MSG_RM_UDMAP_FLOW_GET_CFG                0x1232
+#define TISCI_MSG_RM_UDMAP_FLOW_SIZE_THRESH_GET_CFG    0x1233
+
 /**
  * struct ti_sci_msg_hdr - Generic Message Header for All messages and responses
  * @type:      Type of messages: One of TI_SCI_MSG* values
@@ -133,6 +162,24 @@ struct ti_sci_msg_board_config {
        u16 boardcfg_size;
 } __packed;
 
+/**
+ * struct ti_sci_msg_resp_query_msmc - Query msmc message response structure
+ * @hdr:               Generic Header
+ * @msmc_start_low:    Lower 32 bit of msmc start
+ * @msmc_start_high:   Upper 32 bit of msmc start
+ * @msmc_end_low:      Lower 32 bit of msmc end
+ * @msmc_end_high:     Upper 32 bit of msmc end
+ *
+ * Response to a generic message with message type TISCI_MSG_QUERY_MSMC
+ */
+struct ti_sci_msg_resp_query_msmc {
+       struct ti_sci_msg_hdr hdr;
+       u32 msmc_start_low;
+       u32 msmc_start_high;
+       u32 msmc_end_low;
+       u32 msmc_end_high;
+} __packed;
+
 /**
  * struct ti_sci_msg_req_set_device_state - Set the desired state of the device
  * @hdr:               Generic header
@@ -505,6 +552,45 @@ struct ti_sci_msg_resp_get_clock_freq {
        u64 freq_hz;
 } __packed;
 
+#define TI_SCI_IRQ_SECONDARY_HOST_INVALID      0xff
+
+/**
+ * struct ti_sci_msg_req_get_resource_range - Request to get a host's assigned
+ *                                           range of resources.
+ * @hdr:               Generic Header
+ * @type:              Unique resource assignment type
+ * @subtype:           Resource assignment subtype within the resource type.
+ * @secondary_host:    Host processing entity to which the resources are
+ *                     allocated. This is required only when the destination
+ *                     host id id different from ti sci interface host id,
+ *                     else TI_SCI_IRQ_SECONDARY_HOST_INVALID can be passed.
+ *
+ * Request type is TI_SCI_MSG_GET_RESOURCE_RANGE. Responded with requested
+ * resource range which is of type TI_SCI_MSG_GET_RESOURCE_RANGE.
+ */
+struct ti_sci_msg_req_get_resource_range {
+       struct ti_sci_msg_hdr hdr;
+#define MSG_RM_RESOURCE_TYPE_MASK      GENMASK(9, 0)
+#define MSG_RM_RESOURCE_SUBTYPE_MASK   GENMASK(5, 0)
+       u16 type;
+       u8 subtype;
+       u8 secondary_host;
+} __packed;
+
+/**
+ * struct ti_sci_msg_resp_get_resource_range - Response to resource get range.
+ * @hdr:               Generic Header
+ * @range_start:       Start index of the resource range.
+ * @range_num:         Number of resources in the range.
+ *
+ * Response to request TI_SCI_MSG_GET_RESOURCE_RANGE.
+ */
+struct ti_sci_msg_resp_get_resource_range {
+       struct ti_sci_msg_hdr hdr;
+       u16 range_start;
+       u16 range_num;
+} __packed;
+
 #define TISCI_ADDR_LOW_MASK            GENMASK_ULL(31, 0)
 #define TISCI_ADDR_HIGH_MASK           GENMASK_ULL(63, 32)
 #define TISCI_ADDR_HIGH_SHIFT          32
@@ -677,4 +763,579 @@ struct ti_sci_msg_resp_get_proc_boot_status {
        u32 status_flags;
 } __packed;
 
+/**
+ * struct ti_sci_msg_rm_ring_cfg_req - Configure a Navigator Subsystem ring
+ *
+ * Configures the non-real-time registers of a Navigator Subsystem ring.
+ * @hdr:       Generic Header
+ * @valid_params: Bitfield defining validity of ring configuration parameters.
+ *     The ring configuration fields are not valid, and will not be used for
+ *     ring configuration, if their corresponding valid bit is zero.
+ *     Valid bit usage:
+ *     0 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_lo
+ *     1 - Valid bit for @tisci_msg_rm_ring_cfg_req addr_hi
+ *     2 - Valid bit for @tisci_msg_rm_ring_cfg_req count
+ *     3 - Valid bit for @tisci_msg_rm_ring_cfg_req mode
+ *     4 - Valid bit for @tisci_msg_rm_ring_cfg_req size
+ *     5 - Valid bit for @tisci_msg_rm_ring_cfg_req order_id
+ * @nav_id: Device ID of Navigator Subsystem from which the ring is allocated
+ * @index: ring index to be configured.
+ * @addr_lo: 32 LSBs of ring base address to be programmed into the ring's
+ *     RING_BA_LO register
+ * @addr_hi: 16 MSBs of ring base address to be programmed into the ring's
+ *     RING_BA_HI register.
+ * @count: Number of ring elements. Must be even if mode is CREDENTIALS or QM
+ *     modes.
+ * @mode: Specifies the mode the ring is to be configured.
+ * @size: Specifies encoded ring element size. To calculate the encoded size use
+ *     the formula (log2(size_bytes) - 2), where size_bytes cannot be
+ *     greater than 256.
+ * @order_id: Specifies the ring's bus order ID.
+ */
+struct ti_sci_msg_rm_ring_cfg_req {
+       struct ti_sci_msg_hdr hdr;
+       u32 valid_params;
+       u16 nav_id;
+       u16 index;
+       u32 addr_lo;
+       u32 addr_hi;
+       u32 count;
+       u8 mode;
+       u8 size;
+       u8 order_id;
+} __packed;
+
+/**
+ * struct ti_sci_msg_rm_ring_cfg_resp - Response to configuring a ring.
+ *
+ * @hdr:       Generic Header
+ */
+struct ti_sci_msg_rm_ring_cfg_resp {
+       struct ti_sci_msg_hdr hdr;
+} __packed;
+
+/**
+ * struct ti_sci_msg_rm_ring_get_cfg_req - Get RA ring's configuration
+ *
+ * Gets the configuration of the non-real-time register fields of a ring.  The
+ * host, or a supervisor of the host, who owns the ring must be the requesting
+ * host.  The values of the non-real-time registers are returned in
+ * @ti_sci_msg_rm_ring_get_cfg_resp.
+ *
+ * @hdr: Generic Header
+ * @nav_id: Device ID of Navigator Subsystem from which the ring is allocated
+ * @index: ring index.
+ */
+struct ti_sci_msg_rm_ring_get_cfg_req {
+       struct ti_sci_msg_hdr hdr;
+       u16 nav_id;
+       u16 index;
+} __packed;
+
+/**
+ * struct ti_sci_msg_rm_ring_get_cfg_resp -  Ring get configuration response
+ *
+ * Response received by host processor after RM has handled
+ * @ti_sci_msg_rm_ring_get_cfg_req. The response contains the ring's
+ * non-real-time register values.
+ *
+ * @hdr: Generic Header
+ * @addr_lo: Ring 32 LSBs of base address
+ * @addr_hi: Ring 16 MSBs of base address.
+ * @count: Ring number of elements.
+ * @mode: Ring mode.
+ * @size: encoded Ring element size
+ * @order_id: ing order ID.
+ */
+struct ti_sci_msg_rm_ring_get_cfg_resp {
+       struct ti_sci_msg_hdr hdr;
+       u32 addr_lo;
+       u32 addr_hi;
+       u32 count;
+       u8 mode;
+       u8 size;
+       u8 order_id;
+} __packed;
+
+/**
+ * struct ti_sci_msg_psil_pair - Pairs a PSI-L source thread to a destination
+ *                              thread
+ * @hdr:       Generic Header
+ * @nav_id:    SoC Navigator Subsystem device ID whose PSI-L config proxy is
+ *             used to pair the source and destination threads.
+ * @src_thread:        PSI-L source thread ID within the PSI-L System thread map.
+ *
+ * UDMAP transmit channels mapped to source threads will have their
+ * TCHAN_THRD_ID register programmed with the destination thread if the pairing
+ * is successful.
+
+ * @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.
+ * PSI-L destination threads start at index 0x8000.  The request is NACK'd if
+ * the destination thread is not greater than or equal to 0x8000.
+ *
+ * UDMAP receive channels mapped to destination threads will have their
+ * RCHAN_THRD_ID register programmed with the source thread if the pairing
+ * is successful.
+ *
+ * Request type is TI_SCI_MSG_RM_PSIL_PAIR, response is a generic ACK or NACK
+ * message.
+ */
+struct ti_sci_msg_psil_pair {
+       struct ti_sci_msg_hdr hdr;
+       u32 nav_id;
+       u32 src_thread;
+       u32 dst_thread;
+} __packed;
+
+/**
+ * struct ti_sci_msg_psil_unpair - Unpairs a PSI-L source thread from a
+ *                                destination thread
+ * @hdr:       Generic Header
+ * @nav_id:    SoC Navigator Subsystem device ID whose PSI-L config proxy is
+ *             used to unpair the source and destination threads.
+ * @src_thread:        PSI-L source thread ID within the PSI-L System thread map.
+ *
+ * UDMAP transmit channels mapped to source threads will have their
+ * TCHAN_THRD_ID register cleared if the unpairing is successful.
+ *
+ * @dst_thread: PSI-L destination thread ID within the PSI-L System thread map.
+ * PSI-L destination threads start at index 0x8000.  The request is NACK'd if
+ * the destination thread is not greater than or equal to 0x8000.
+ *
+ * UDMAP receive channels mapped to destination threads will have their
+ * RCHAN_THRD_ID register cleared if the unpairing is successful.
+ *
+ * Request type is TI_SCI_MSG_RM_PSIL_UNPAIR, response is a generic ACK or NACK
+ * message.
+ */
+struct ti_sci_msg_psil_unpair {
+       struct ti_sci_msg_hdr hdr;
+       u32 nav_id;
+       u32 src_thread;
+       u32 dst_thread;
+} __packed;
+
+/**
+ * Configures a Navigator Subsystem UDMAP transmit channel
+ *
+ * Configures the non-real-time registers of a Navigator Subsystem UDMAP
+ * transmit channel.  The channel index must be assigned to the host defined
+ * in the TISCI header via the RM board configuration resource assignment
+ * range list.
+ *
+ * @hdr: Generic Header
+ *
+ * @valid_params: Bitfield defining validity of tx channel configuration
+ * parameters. The tx channel configuration fields are not valid, and will not
+ * be used for ch configuration, if their corresponding valid bit is zero.
+ * Valid bit usage:
+ *    0 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_pause_on_err
+ *    1 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_atype
+ *    2 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_chan_type
+ *    3 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_fetch_size
+ *    4 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::txcq_qnum
+ *    5 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_priority
+ *    6 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_qos
+ *    7 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_orderid
+ *    8 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_sched_priority
+ *    9 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_einfo
+ *   10 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_filt_pswords
+ *   11 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_supr_tdpkt
+ *   12 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::tx_credit_count
+ *   13 - Valid bit for @ref ti_sci_msg_rm_udmap_tx_ch_cfg::fdepth
+ *
+ * @nav_id: SoC device ID of Navigator Subsystem where tx channel is located
+ *
+ * @index: UDMAP transmit channel index.
+ *
+ * @tx_pause_on_err: UDMAP transmit channel pause on error configuration to
+ * be programmed into the tx_pause_on_err field of the channel's TCHAN_TCFG
+ * register.
+ *
+ * @tx_filt_einfo: UDMAP transmit channel extended packet information passing
+ * configuration to be programmed into the tx_filt_einfo field of the
+ * channel's TCHAN_TCFG register.
+ *
+ * @tx_filt_pswords: UDMAP transmit channel protocol specific word passing
+ * configuration to be programmed into the tx_filt_pswords field of the
+ * channel's TCHAN_TCFG register.
+ *
+ * @tx_atype: UDMAP transmit channel non Ring Accelerator access pointer
+ * interpretation configuration to be programmed into the tx_atype field of
+ * the channel's TCHAN_TCFG register.
+ *
+ * @tx_chan_type: UDMAP transmit channel functional channel type and work
+ * passing mechanism configuration to be programmed into the tx_chan_type
+ * field of the channel's TCHAN_TCFG register.
+ *
+ * @tx_supr_tdpkt: UDMAP transmit channel teardown packet generation suppression
+ * configuration to be programmed into the tx_supr_tdpkt field of the channel's
+ * TCHAN_TCFG register.
+ *
+ * @tx_fetch_size: UDMAP transmit channel number of 32-bit descriptor words to
+ * fetch configuration to be programmed into the tx_fetch_size field of the
+ * channel's TCHAN_TCFG register.  The user must make sure to set the maximum
+ * word count that can pass through the channel for any allowed descriptor type.
+ *
+ * @tx_credit_count: UDMAP transmit channel transfer request credit count
+ * configuration to be programmed into the count field of the TCHAN_TCREDIT
+ * register.  Specifies how many credits for complete TRs are available.
+ *
+ * @txcq_qnum: UDMAP transmit channel completion queue configuration to be
+ * programmed into the txcq_qnum field of the TCHAN_TCQ register. The specified
+ * completion queue must be assigned to the host, or a subordinate of the host,
+ * requesting configuration of the transmit channel.
+ *
+ * @tx_priority: UDMAP transmit channel transmit priority value to be programmed
+ * into the priority field of the channel's TCHAN_TPRI_CTRL register.
+ *
+ * @tx_qos: UDMAP transmit channel transmit qos value to be programmed into the
+ * qos field of the channel's TCHAN_TPRI_CTRL register.
+ *
+ * @tx_orderid: UDMAP transmit channel bus order id value to be programmed into
+ * the orderid field of the channel's TCHAN_TPRI_CTRL register.
+ *
+ * @fdepth: UDMAP transmit channel FIFO depth configuration to be programmed
+ * into the fdepth field of the TCHAN_TFIFO_DEPTH register. Sets the number of
+ * Tx FIFO bytes which are allowed to be stored for the channel. Check the UDMAP
+ * section of the TRM for restrictions regarding this parameter.
+ *
+ * @tx_sched_priority: UDMAP transmit channel tx scheduling priority
+ * configuration to be programmed into the priority field of the channel's
+ * TCHAN_TST_SCHED register.
+ */
+struct ti_sci_msg_rm_udmap_tx_ch_cfg_req {
+       struct ti_sci_msg_hdr hdr;
+       u32 valid_params;
+       u16 nav_id;
+       u16 index;
+       u8 tx_pause_on_err;
+       u8 tx_filt_einfo;
+       u8 tx_filt_pswords;
+       u8 tx_atype;
+       u8 tx_chan_type;
+       u8 tx_supr_tdpkt;
+       u16 tx_fetch_size;
+       u8 tx_credit_count;
+       u16 txcq_qnum;
+       u8 tx_priority;
+       u8 tx_qos;
+       u8 tx_orderid;
+       u16 fdepth;
+       u8 tx_sched_priority;
+} __packed;
+
+/**
+ *  Response to configuring a UDMAP transmit channel.
+ *
+ * @hdr: Standard TISCI header
+ */
+struct ti_sci_msg_rm_udmap_tx_ch_cfg_resp {
+       struct ti_sci_msg_hdr hdr;
+} __packed;
+
+/**
+ * Configures a Navigator Subsystem UDMAP receive channel
+ *
+ * Configures the non-real-time registers of a Navigator Subsystem UDMAP
+ * receive channel.  The channel index must be assigned to the host defined
+ * in the TISCI header via the RM board configuration resource assignment
+ * range list.
+ *
+ * @hdr: Generic Header
+ *
+ * @valid_params: Bitfield defining validity of rx channel configuration
+ * parameters.
+ * The rx channel configuration fields are not valid, and will not be used for
+ * ch configuration, if their corresponding valid bit is zero.
+ * Valid bit usage:
+ *    0 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_pause_on_err
+ *    1 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_atype
+ *    2 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_chan_type
+ *    3 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_fetch_size
+ *    4 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rxcq_qnum
+ *    5 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_priority
+ *    6 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_qos
+ *    7 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_orderid
+ *    8 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_sched_priority
+ *    9 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_start
+ *   10 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::flowid_cnt
+ *   11 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_short
+ *   12 - Valid bit for @ti_sci_msg_rm_udmap_rx_ch_cfg_req::rx_ignore_long
+ *
+ * @nav_id: SoC device ID of Navigator Subsystem where rx channel is located
+ *
+ * @index: UDMAP receive channel index.
+ *
+ * @rx_fetch_size: UDMAP receive channel number of 32-bit descriptor words to
+ * fetch configuration to be programmed into the rx_fetch_size field of the
+ * channel's RCHAN_RCFG register.
+ *
+ * @rxcq_qnum: UDMAP receive channel completion queue configuration to be
+ * programmed into the rxcq_qnum field of the RCHAN_RCQ register.
+ * The specified completion queue must be assigned to the host, or a subordinate
+ * of the host, requesting configuration of the receive channel.
+ *
+ * @rx_priority: UDMAP receive channel receive priority value to be programmed
+ * into the priority field of the channel's RCHAN_RPRI_CTRL register.
+ *
+ * @rx_qos: UDMAP receive channel receive qos value to be programmed into the
+ * qos field of the channel's RCHAN_RPRI_CTRL register.
+ *
+ * @rx_orderid: UDMAP receive channel bus order id value to be programmed into
+ * the orderid field of the channel's RCHAN_RPRI_CTRL register.
+ *
+ * @rx_sched_priority: UDMAP receive channel rx scheduling priority
+ * configuration to be programmed into the priority field of the channel's
+ * RCHAN_RST_SCHED register.
+ *
+ * @flowid_start: UDMAP receive channel additional flows starting index
+ * configuration to program into the flow_start field of the RCHAN_RFLOW_RNG
+ * register. Specifies the starting index for flow IDs the receive channel is to
+ * make use of beyond the default flow. flowid_start and @ref flowid_cnt must be
+ * set as valid and configured together. The starting flow ID set by
+ * @ref flowid_cnt must be a flow index within the Navigator Subsystem's subset
+ * of flows beyond the default flows statically mapped to receive channels.
+ * The additional flows must be assigned to the host, or a subordinate of the
+ * host, requesting configuration of the receive channel.
+ *
+ * @flowid_cnt: UDMAP receive channel additional flows count configuration to
+ * program into the flowid_cnt field of the RCHAN_RFLOW_RNG register.
+ * This field specifies how many flow IDs are in the additional contiguous range
+ * of legal flow IDs for the channel.  @ref flowid_start and flowid_cnt must be
+ * set as valid and configured together. Disabling the valid_params field bit
+ * for flowid_cnt indicates no flow IDs other than the default are to be
+ * allocated and used by the receive channel. @ref flowid_start plus flowid_cnt
+ * cannot be greater than the number of receive flows in the receive channel's
+ * Navigator Subsystem.  The additional flows must be assigned to the host, or a
+ * subordinate of the host, requesting configuration of the receive channel.
+ *
+ * @rx_pause_on_err: UDMAP receive channel pause on error configuration to be
+ * programmed into the rx_pause_on_err field of the channel's RCHAN_RCFG
+ * register.
+ *
+ * @rx_atype: UDMAP receive channel non Ring Accelerator access pointer
+ * interpretation configuration to be programmed into the rx_atype field of the
+ * channel's RCHAN_RCFG register.
+ *
+ * @rx_chan_type: UDMAP receive channel functional channel type and work passing
+ * mechanism configuration to be programmed into the rx_chan_type field of the
+ * channel's RCHAN_RCFG register.
+ *
+ * @rx_ignore_short: UDMAP receive channel short packet treatment configuration
+ * to be programmed into the rx_ignore_short field of the RCHAN_RCFG register.
+ *
+ * @rx_ignore_long: UDMAP receive channel long packet treatment configuration to
+ * be programmed into the rx_ignore_long field of the RCHAN_RCFG register.
+ */
+struct ti_sci_msg_rm_udmap_rx_ch_cfg_req {
+       struct ti_sci_msg_hdr hdr;
+       u32 valid_params;
+       u16 nav_id;
+       u16 index;
+       u16 rx_fetch_size;
+       u16 rxcq_qnum;
+       u8 rx_priority;
+       u8 rx_qos;
+       u8 rx_orderid;
+       u8 rx_sched_priority;
+       u16 flowid_start;
+       u16 flowid_cnt;
+       u8 rx_pause_on_err;
+       u8 rx_atype;
+       u8 rx_chan_type;
+       u8 rx_ignore_short;
+       u8 rx_ignore_long;
+} __packed;
+
+/**
+ * Response to configuring a UDMAP receive channel.
+ *
+ * @hdr: Standard TISCI header
+ */
+struct ti_sci_msg_rm_udmap_rx_ch_cfg_resp {
+       struct ti_sci_msg_hdr hdr;
+} __packed;
+
+/**
+ * Configures a Navigator Subsystem UDMAP receive flow
+ *
+ * Configures a Navigator Subsystem UDMAP receive flow's registers.
+ * Configuration does not include the flow registers which handle size-based
+ * free descriptor queue routing.
+ *
+ * The flow index must be assigned to the host defined in the TISCI header via
+ * the RM board configuration resource assignment range list.
+ *
+ * @hdr: Standard TISCI header
+ *
+ * @valid_params
+ * Bitfield defining validity of rx flow configuration parameters.  The
+ * rx flow configuration fields are not valid, and will not be used for flow
+ * configuration, if their corresponding valid bit is zero.  Valid bit usage:
+ *     0 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_einfo_present
+ *     1 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_psinfo_present
+ *     2 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_error_handling
+ *     3 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_desc_type
+ *     4 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_sop_offset
+ *     5 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_qnum
+ *     6 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi
+ *     7 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo
+ *     8 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi
+ *     9 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo
+ *    10 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_hi_sel
+ *    11 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_src_tag_lo_sel
+ *    12 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi_sel
+ *    13 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo_sel
+ *    14 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq0_sz0_qnum
+ *    15 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq1_sz0_qnum
+ *    16 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq2_sz0_qnum
+ *    17 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_fdq3_sz0_qnum
+ *    18 - Valid bit for @tisci_msg_rm_udmap_flow_cfg_req::rx_ps_location
+ *
+ * @nav_id: SoC device ID of Navigator Subsystem from which the receive flow is
+ * allocated
+ *
+ * @flow_index: UDMAP receive flow index for non-optional configuration.
+ *
+ * @rx_einfo_present:
+ * UDMAP receive flow extended packet info present configuration to be
+ * programmed into the rx_einfo_present field of the flow's RFLOW_RFA register.
+ *
+ * @rx_psinfo_present:
+ * UDMAP receive flow PS words present configuration to be programmed into the
+ * rx_psinfo_present field of the flow's RFLOW_RFA register.
+ *
+ * @rx_error_handling:
+ * UDMAP receive flow error handling configuration to be programmed into the
+ * rx_error_handling field of the flow's RFLOW_RFA register.
+ *
+ * @rx_desc_type:
+ * UDMAP receive flow descriptor type configuration to be programmed into the
+ * rx_desc_type field field of the flow's RFLOW_RFA register.
+ *
+ * @rx_sop_offset:
+ * UDMAP receive flow start of packet offset configuration to be programmed
+ * into the rx_sop_offset field of the RFLOW_RFA register.  See the UDMAP
+ * section of the TRM for more information on this setting.  Valid values for
+ * this field are 0-255 bytes.
+ *
+ * @rx_dest_qnum:
+ * UDMAP receive flow destination queue configuration to be programmed into the
+ * rx_dest_qnum field of the flow's RFLOW_RFA register.  The specified
+ * destination queue must be valid within the Navigator Subsystem and must be
+ * owned by the host, or a subordinate of the host, requesting allocation and
+ * configuration of the receive flow.
+ *
+ * @rx_src_tag_hi:
+ * UDMAP receive flow source tag high byte constant configuration to be
+ * programmed into the rx_src_tag_hi field of the flow's RFLOW_RFB register.
+ * See the UDMAP section of the TRM for more information on this setting.
+ *
+ * @rx_src_tag_lo:
+ * UDMAP receive flow source tag low byte constant configuration to be
+ * programmed into the rx_src_tag_lo field of the flow's RFLOW_RFB register.
+ * See the UDMAP section of the TRM for more information on this setting.
+ *
+ * @rx_dest_tag_hi:
+ * UDMAP receive flow destination tag high byte constant configuration to be
+ * programmed into the rx_dest_tag_hi field of the flow's RFLOW_RFB register.
+ * See the UDMAP section of the TRM for more information on this setting.
+ *
+ * @rx_dest_tag_lo:
+ * UDMAP receive flow destination tag low byte constant configuration to be
+ * programmed into the rx_dest_tag_lo field of the flow's RFLOW_RFB register.
+ * See the UDMAP section of the TRM for more information on this setting.
+ *
+ * @rx_src_tag_hi_sel:
+ * UDMAP receive flow source tag high byte selector configuration to be
+ * programmed into the rx_src_tag_hi_sel field of the RFLOW_RFC register.  See
+ * the UDMAP section of the TRM for more information on this setting.
+ *
+ * @rx_src_tag_lo_sel:
+ * UDMAP receive flow source tag low byte selector configuration to be
+ * programmed into the rx_src_tag_lo_sel field of the RFLOW_RFC register.  See
+ * the UDMAP section of the TRM for more information on this setting.
+ *
+ * @rx_dest_tag_hi_sel:
+ * UDMAP receive flow destination tag high byte selector configuration to be
+ * programmed into the rx_dest_tag_hi_sel field of the RFLOW_RFC register.  See
+ * the UDMAP section of the TRM for more information on this setting.
+ *
+ * @rx_dest_tag_lo_sel:
+ * UDMAP receive flow destination tag low byte selector configuration to be
+ * programmed into the rx_dest_tag_lo_sel field of the RFLOW_RFC register.  See
+ * the UDMAP section of the TRM for more information on this setting.
+ *
+ * @rx_fdq0_sz0_qnum:
+ * UDMAP receive flow free descriptor queue 0 configuration to be programmed
+ * into the rx_fdq0_sz0_qnum field of the flow's RFLOW_RFD register.  See the
+ * UDMAP section of the TRM for more information on this setting. The specified
+ * free queue must be valid within the Navigator Subsystem and must be owned
+ * by the host, or a subordinate of the host, requesting allocation and
+ * configuration of the receive flow.
+ *
+ * @rx_fdq1_qnum:
+ * UDMAP receive flow free descriptor queue 1 configuration to be programmed
+ * into the rx_fdq1_qnum field of the flow's RFLOW_RFD register.  See the
+ * UDMAP section of the TRM for more information on this setting.  The specified
+ * free queue must be valid within the Navigator Subsystem and must be owned
+ * by the host, or a subordinate of the host, requesting allocation and
+ * configuration of the receive flow.
+ *
+ * @rx_fdq2_qnum:
+ * UDMAP receive flow free descriptor queue 2 configuration to be programmed
+ * into the rx_fdq2_qnum field of the flow's RFLOW_RFE register.  See the
+ * UDMAP section of the TRM for more information on this setting.  The specified
+ * free queue must be valid within the Navigator Subsystem and must be owned
+ * by the host, or a subordinate of the host, requesting allocation and
+ * configuration of the receive flow.
+ *
+ * @rx_fdq3_qnum:
+ * UDMAP receive flow free descriptor queue 3 configuration to be programmed
+ * into the rx_fdq3_qnum field of the flow's RFLOW_RFE register.  See the
+ * UDMAP section of the TRM for more information on this setting.  The specified
+ * free queue must be valid within the Navigator Subsystem and must be owned
+ * by the host, or a subordinate of the host, requesting allocation and
+ * configuration of the receive flow.
+ *
+ * @rx_ps_location:
+ * UDMAP receive flow PS words location configuration to be programmed into the
+ * rx_ps_location field of the flow's RFLOW_RFA register.
+ */
+struct ti_sci_msg_rm_udmap_flow_cfg_req {
+       struct ti_sci_msg_hdr hdr;
+       u32 valid_params;
+       u16 nav_id;
+       u16 flow_index;
+       u8 rx_einfo_present;
+       u8 rx_psinfo_present;
+       u8 rx_error_handling;
+       u8 rx_desc_type;
+       u16 rx_sop_offset;
+       u16 rx_dest_qnum;
+       u8 rx_src_tag_hi;
+       u8 rx_src_tag_lo;
+       u8 rx_dest_tag_hi;
+       u8 rx_dest_tag_lo;
+       u8 rx_src_tag_hi_sel;
+       u8 rx_src_tag_lo_sel;
+       u8 rx_dest_tag_hi_sel;
+       u8 rx_dest_tag_lo_sel;
+       u16 rx_fdq0_sz0_qnum;
+       u16 rx_fdq1_qnum;
+       u16 rx_fdq2_qnum;
+       u16 rx_fdq3_qnum;
+       u8 rx_ps_location;
+} __packed;
+
+/**
+ *  Response to configuring a Navigator Subsystem UDMAP receive flow
+ *
+ * @hdr: Standard TISCI header
+ */
+struct ti_sci_msg_rm_udmap_flow_cfg_resp {
+       struct ti_sci_msg_hdr hdr;
+} __packed;
+
 #endif /* __TI_SCI_H */
index 49e23a0a4bf20d1662abfecf30cfe90c843bed59..e47abf18333f4452b31c8662e4160358ab4b575f 100644 (file)
@@ -593,6 +593,29 @@ int i2c_chip_ofdata_to_platdata(struct udevice *dev, struct dm_i2c_chip *chip)
 }
 #endif
 
+static int i2c_pre_probe(struct udevice *dev)
+{
+#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
+       struct dm_i2c_bus *i2c = dev_get_uclass_priv(dev);
+       unsigned int max = 0;
+       ofnode node;
+       int ret;
+
+       i2c->max_transaction_bytes = 0;
+       dev_for_each_subnode(node, dev) {
+               ret = ofnode_read_u32(node,
+                                     "u-boot,i2c-transaction-bytes",
+                                     &max);
+               if (!ret && max > i2c->max_transaction_bytes)
+                       i2c->max_transaction_bytes = max;
+       }
+
+       debug("%s: I2C bus: %s max transaction bytes: %d\n", __func__,
+             dev->name, i2c->max_transaction_bytes);
+#endif
+       return 0;
+}
+
 static int i2c_post_probe(struct udevice *dev)
 {
 #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
@@ -674,6 +697,7 @@ UCLASS_DRIVER(i2c) = {
        .post_bind      = i2c_post_bind,
        .init           = i2c_uclass_init,
        .priv_auto_alloc_size = sizeof(struct i2c_priv),
+       .pre_probe      = i2c_pre_probe,
        .post_probe     = i2c_post_probe,
        .per_device_auto_alloc_size = sizeof(struct dm_i2c_bus),
        .per_child_platdata_auto_alloc_size = sizeof(struct dm_i2c_chip),
index b0da67ce2c6b592009fb52200a30e39d19f11eaa..68f15261be771ca24fbe2d1c19776d69e4daf9af 100644 (file)
@@ -29,11 +29,12 @@ config I2C_MUX_PCA954x
        tristate "TI PCA954x I2C Mux/switches"
        depends on I2C_MUX
        help
-         If you say yes here you get support for the TI PCA954x
-         I2C mux/switch devices. It is x width I2C multiplexer which enables to
-         partitioning I2C bus and connect multiple devices with the same address
-         to the same I2C controller where driver handles proper routing to
-         target i2c device. PCA9544 and PCA9548 are supported.
+         If you say yes here you get support for the TI PCA954x I2C mux/switch
+         devices. It is x width I2C multiplexer which enables to partitioning
+         I2C bus and connect multiple devices with the same address to the same
+         I2C controller where driver handles proper routing to target i2c
+         device. Supported chips are PCA9543, PCA9544, PCA9547, PCA9548 and
+         PCA9646.
 
 config I2C_MUX_GPIO
         tristate "GPIO-based I2C multiplexer"
index bd4e9abe5f3c0ca6d913aed522e3dcc868ff6e25..a630ce991d04e3c5407e0a1bc23add78af2a442c 100644 (file)
@@ -15,6 +15,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 enum pca_type {
+       PCA9543,
        PCA9544,
        PCA9547,
        PCA9548,
@@ -22,7 +23,7 @@ enum pca_type {
 };
 
 struct chip_desc {
-       u8 enable;
+       u8 enable; /* Enable mask in ctl register (used for muxes only) */
        enum muxtype {
                pca954x_ismux = 0,
                pca954x_isswi,
@@ -37,6 +38,10 @@ struct pca954x_priv {
 };
 
 static const struct chip_desc chips[] = {
+       [PCA9543] = {
+               .muxtype = pca954x_isswi,
+               .width = 2,
+       },
        [PCA9544] = {
                .enable = 0x4,
                .muxtype = pca954x_ismux,
@@ -48,12 +53,10 @@ static const struct chip_desc chips[] = {
                .width = 8,
        },
        [PCA9548] = {
-               .enable = 0x8,
                .muxtype = pca954x_isswi,
                .width = 8,
        },
        [PCA9646] = {
-               .enable = 0x0,
                .muxtype = pca954x_isswi,
                .width = 4,
        },
@@ -89,6 +92,7 @@ static const struct i2c_mux_ops pca954x_ops = {
 };
 
 static const struct udevice_id pca954x_ids[] = {
+       { .compatible = "nxp,pca9543", .data = PCA9543 },
        { .compatible = "nxp,pca9544", .data = PCA9544 },
        { .compatible = "nxp,pca9547", .data = PCA9547 },
        { .compatible = "nxp,pca9548", .data = PCA9548 },
index 9999d9fe5e4bd01fd5155a307b91017f0328eabe..5420afbc8e0de91b7f7529a94217ca1c2643dd52 100644 (file)
@@ -354,9 +354,10 @@ int i2c_idle_bus(struct mxc_i2c_bus *i2c_bus)
 int i2c_idle_bus(struct mxc_i2c_bus *i2c_bus)
 {
        struct udevice *bus = i2c_bus->bus;
+       struct dm_i2c_bus *i2c = dev_get_uclass_priv(bus);
        struct gpio_desc *scl_gpio = &i2c_bus->scl_gpio;
        struct gpio_desc *sda_gpio = &i2c_bus->sda_gpio;
-       int sda, scl;
+       int sda, scl, idle_sclks;
        int i, ret = 0;
        ulong elapsed, start_time;
 
@@ -380,8 +381,22 @@ int i2c_idle_bus(struct mxc_i2c_bus *i2c_bus)
        if ((sda & scl) == 1)
                goto exit;              /* Bus is idle already */
 
+       /*
+        * In most cases it is just enough to generate 8 + 1 SCLK
+        * clocks to recover I2C slave device from 'stuck' state
+        * (when for example SW reset was performed, in the middle of
+        * I2C transmission).
+        *
+        * However, there are devices which send data in packets of
+        * N bytes (N > 1). In such case we do need N * 8 + 1 SCLK
+        * clocks.
+        */
+       idle_sclks = 8 + 1;
+
+       if (i2c->max_transaction_bytes > 0)
+               idle_sclks = i2c->max_transaction_bytes * 8 + 1;
        /* Send high and low on the SCL line */
-       for (i = 0; i < 9; i++) {
+       for (i = 0; i < idle_sclks; i++) {
                dm_gpio_set_dir_flags(scl_gpio, GPIOD_IS_OUT);
                dm_gpio_set_value(scl_gpio, 0);
                udelay(50);
index 29ad87c1d7b4b865e8c8170e8f83541f4da5ccd4..f25d0540075d55db29ba8eb256034146fbcd24a7 100644 (file)
@@ -5,6 +5,7 @@
 
 #include <common.h>
 #include <linux/err.h>
+#include <linux/kernel.h>
 #include <dm.h>
 #include <i2c.h>
 #include <i2c_eeprom.h>
@@ -38,7 +39,24 @@ static int i2c_eeprom_std_read(struct udevice *dev, int offset, uint8_t *buf,
 static int i2c_eeprom_std_write(struct udevice *dev, int offset,
                                const uint8_t *buf, int size)
 {
-       return -ENODEV;
+       struct i2c_eeprom *priv = dev_get_priv(dev);
+       int ret;
+
+       while (size > 0) {
+               int write_size = min_t(int, size, priv->pagesize);
+
+               ret = dm_i2c_write(dev, offset, buf, write_size);
+               if (ret)
+                       return ret;
+
+               offset += write_size;
+               buf += write_size;
+               size -= write_size;
+
+               udelay(10000);
+       }
+
+       return 0;
 }
 
 static const struct i2c_eeprom_ops i2c_eeprom_std_ops = {
@@ -50,6 +68,12 @@ static int i2c_eeprom_std_ofdata_to_platdata(struct udevice *dev)
 {
        struct i2c_eeprom *priv = dev_get_priv(dev);
        u64 data = dev_get_driver_data(dev);
+       u32 pagesize;
+
+       if (dev_read_u32(dev, "pagesize", &pagesize) == 0) {
+               priv->pagesize = pagesize;
+               return 0;
+       }
 
        /* 6 bit -> page size of up to 2^63 (should be sufficient) */
        priv->pagewidth = data & 0x3F;
index 826a39fad7256703471df372f14179b2db4f8a44..133cdc135278884798ddd8c83f0012c516704437 100644 (file)
@@ -264,7 +264,7 @@ static unsigned char mmc_board_init(struct mmc *mmc)
        !CONFIG_IS_ENABLED(DM_REGULATOR)
        /* PBIAS config needed for MMC1 only */
        if (mmc_get_blk_desc(mmc)->devnum == 0)
-               vmmc_pbias_config(LDO_VOLT_3V0);
+               vmmc_pbias_config(LDO_VOLT_3V3);
 #endif
 
        return 0;
@@ -418,7 +418,7 @@ static void omap_hsmmc_conf_bus_power(struct mmc *mmc, uint signal_voltage)
 
        switch (signal_voltage) {
        case MMC_SIGNAL_VOLTAGE_330:
-               hctl |= SDVS_3V0;
+               hctl |= SDVS_3V3;
                break;
        case MMC_SIGNAL_VOLTAGE_180:
                hctl |= SDVS_1V8;
@@ -514,10 +514,9 @@ static int omap_hsmmc_set_signal_voltage(struct mmc *mmc)
                return -EINVAL;
 
        if (mmc->signal_voltage == MMC_SIGNAL_VOLTAGE_330) {
-               /* Use 3.0V rather than 3.3V */
-               mv = 3000;
-               capa_mask = VS30_3V0SUP;
-               palmas_ldo_volt = LDO_VOLT_3V0;
+               mv = 3300;
+               capa_mask = VS33_3V3SUP;
+               palmas_ldo_volt = LDO_VOLT_3V3;
        } else if (mmc->signal_voltage == MMC_SIGNAL_VOLTAGE_180) {
                capa_mask = VS18_1V8SUP;
                palmas_ldo_volt = LDO_VOLT_1V8;
@@ -556,13 +555,13 @@ static uint32_t omap_hsmmc_set_capabilities(struct mmc *mmc)
        val = readl(&mmc_base->capa);
 
        if (priv->controller_flags & OMAP_HSMMC_SUPPORTS_DUAL_VOLT) {
-               val |= (VS30_3V0SUP | VS18_1V8SUP);
+               val |= (VS33_3V3SUP | VS18_1V8SUP);
        } else if (priv->controller_flags & OMAP_HSMMC_NO_1_8_V) {
-               val |= VS30_3V0SUP;
+               val |= VS33_3V3SUP;
                val &= ~VS18_1V8SUP;
        } else {
                val |= VS18_1V8SUP;
-               val &= ~VS30_3V0SUP;
+               val &= ~VS33_3V3SUP;
        }
 
        writel(val, &mmc_base->capa);
@@ -842,11 +841,11 @@ static int omap_hsmmc_init_setup(struct mmc *mmc)
 
 #if CONFIG_IS_ENABLED(DM_MMC)
        reg_val = omap_hsmmc_set_capabilities(mmc);
-       omap_hsmmc_conf_bus_power(mmc, (reg_val & VS30_3V0SUP) ?
+       omap_hsmmc_conf_bus_power(mmc, (reg_val & VS33_3V3SUP) ?
                          MMC_SIGNAL_VOLTAGE_330 : MMC_SIGNAL_VOLTAGE_180);
 #else
        writel(DTW_1_BITMODE | SDBP_PWROFF | SDVS_3V0, &mmc_base->hctl);
-       writel(readl(&mmc_base->capa) | VS30_3V0SUP | VS18_1V8SUP,
+       writel(readl(&mmc_base->capa) | VS33_3V3SUP | VS18_1V8SUP,
                &mmc_base->capa);
 #endif
 
index 8ad0c62733fac6eb14e7754780eddf44cccc7388..2c2faaf1b4dcc069f40139cb1efded2ab76df05d 100644 (file)
@@ -18,6 +18,7 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr);
 
 #include <hexdump.h>
 
+#ifndef __UBOOT__
 #define ubi_assert(expr)  do {                                               \
        if (unlikely(!(expr))) {                                             \
                pr_crit("UBI assert failed in %s at %u (pid %d)\n",          \
@@ -25,6 +26,15 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr);
                dump_stack();                                                \
        }                                                                    \
 } while (0)
+#else
+#define ubi_assert(expr)  do {                                               \
+       if (unlikely(!(expr))) {                                             \
+               pr_debug("UBI assert failed in %s at %u\n",                  \
+                      __func__, __LINE__);                                  \
+               dump_stack();                                                \
+       }                                                                    \
+} while (0)
+#endif
 
 #define ubi_dbg_print_hex_dump(ps, pt, r, g, b, len, a)                      \
                print_hex_dump(ps, pt, r, g, b, len, a)
index 182331f61d15a9ae38755a5ecc803c0e182249ad..72614164e9c7c36c283ece131a334468d78cc9f4 100644 (file)
@@ -550,8 +550,14 @@ static int macb_phy_init(struct macb_device *macb, const char *name)
 
                for (i = 0; i < MACB_AUTONEG_TIMEOUT / 100; i++) {
                        status = macb_mdio_read(macb, MII_BMSR);
-                       if (status & BMSR_LSTATUS)
+                       if (status & BMSR_LSTATUS) {
+                               /*
+                                * Delay a bit after the link is established,
+                                * so that the next xfer does not fail
+                                */
+                               mdelay(10);
                                break;
+                       }
                        udelay(100);
                }
        }
index 2e1123c488a37ee8eed544a20f65abf872adcf55..4646f2ba4ec4ae213109f5cd588f2b1a408840ea 100644 (file)
@@ -769,19 +769,9 @@ static int sh_ether_start(struct udevice *dev)
        struct sh_eth_dev *eth = &priv->shdev;
        int ret;
 
-       ret = clk_enable(&priv->clk);
-       if (ret)
-               return ret;
-
        ret = sh_eth_init_common(eth, pdata->enetaddr);
        if (ret)
-               goto err_clk;
-
-       ret = sh_eth_phy_config(dev);
-       if (ret) {
-               printf(SHETHER_NAME ": phy config timeout\n");
-               goto err_start;
-       }
+               return ret;
 
        ret = sh_eth_start_common(eth);
        if (ret)
@@ -792,17 +782,17 @@ static int sh_ether_start(struct udevice *dev)
 err_start:
        sh_eth_tx_desc_free(eth);
        sh_eth_rx_desc_free(eth);
-err_clk:
-       clk_disable(&priv->clk);
        return ret;
 }
 
 static void sh_ether_stop(struct udevice *dev)
 {
        struct sh_ether_priv *priv = dev_get_priv(dev);
+       struct sh_eth_dev *eth = &priv->shdev;
+       struct sh_eth_info *port_info = &eth->port_info[eth->port];
 
+       phy_shutdown(port_info->phydev);
        sh_eth_stop(&priv->shdev);
-       clk_disable(&priv->clk);
 }
 
 static int sh_ether_probe(struct udevice *udev)
@@ -853,8 +843,20 @@ static int sh_ether_probe(struct udevice *udev)
        eth->port_info[eth->port].iobase =
                (void __iomem *)(BASE_IO_ADDR + 0x800 * eth->port);
 
+       ret = clk_enable(&priv->clk);
+       if (ret)
+               goto err_mdio_register;
+
+       ret = sh_eth_phy_config(udev);
+       if (ret) {
+               printf(SHETHER_NAME ": phy config timeout\n");
+               goto err_phy_config;
+       }
+
        return 0;
 
+err_phy_config:
+       clk_disable(&priv->clk);
 err_mdio_register:
        mdio_free(mdiodev);
        return ret;
@@ -866,6 +868,7 @@ static int sh_ether_remove(struct udevice *udev)
        struct sh_eth_dev *eth = &priv->shdev;
        struct sh_eth_info *port_info = &eth->port_info[eth->port];
 
+       clk_disable(&priv->clk);
        free(port_info->phydev);
        mdio_unregister(priv->bus);
        mdio_free(priv->bus);
index 6c8ddbd93618b913e9c2eec08032f671b049f438..ac12cfe9b86bd989777943915c5e1f34f94d7a00 100644 (file)
@@ -16,35 +16,11 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define CTRL_MAC_REG(offset, id) ((offset) + 0x8 * (id))
 
-static int davinci_emac_3517_get_macid(struct udevice *dev, u16 offset,
-                                      int slave, u8 *mac_addr)
+static void davinci_emac_3517_get_macid(u32 addr, u8 *mac_addr)
 {
-       void *fdt = (void *)gd->fdt_blob;
-       int node = dev_of_offset(dev);
-       u32 macid_lsb;
-       u32 macid_msb;
-       fdt32_t gmii = 0;
-       int syscon;
-       u32 addr;
-
-       syscon = fdtdec_lookup_phandle(fdt, node, "syscon");
-       if (syscon < 0) {
-               pr_err("Syscon offset not found\n");
-               return -ENOENT;
-       }
-
-       addr = (u32)map_physmem(fdt_translate_address(fdt, syscon, &gmii),
-                               sizeof(u32), MAP_NOCACHE);
-       if (addr == FDT_ADDR_T_NONE) {
-               pr_err("Not able to get syscon address to get mac efuse address\n");
-               return -ENOENT;
-       }
-
-       addr += CTRL_MAC_REG(offset, slave);
-
        /* try reading mac address from efuse */
-       macid_lsb = readl(addr);
-       macid_msb = readl(addr + 4);
+       u32 macid_lsb = readl(addr);
+       u32 macid_msb = readl(addr + 4);
 
        mac_addr[0] = (macid_msb >> 16) & 0xff;
        mac_addr[1] = (macid_msb >> 8)  & 0xff;
@@ -52,20 +28,62 @@ static int davinci_emac_3517_get_macid(struct udevice *dev, u16 offset,
        mac_addr[3] = (macid_lsb >> 16) & 0xff;
        mac_addr[4] = (macid_lsb >> 8)  & 0xff;
        mac_addr[5] = macid_lsb & 0xff;
+}
 
-       return 0;
+static void cpsw_am33xx_cm_get_macid(u32 addr, u8 *mac_addr)
+{
+       /* try reading mac address from efuse */
+       u32 macid_lo = readl(addr);
+       u32 macid_hi = readl(addr + 4);
+
+       mac_addr[5] = (macid_lo >> 8) & 0xff;
+       mac_addr[4] = macid_lo & 0xff;
+       mac_addr[3] = (macid_hi >> 24) & 0xff;
+       mac_addr[2] = (macid_hi >> 16) & 0xff;
+       mac_addr[1] = (macid_hi >> 8) & 0xff;
+       mac_addr[0] = macid_hi & 0xff;
+}
+
+void ti_cm_get_macid(struct udevice *dev, struct cpsw_platform_data *data,
+                    u8 *mac_addr)
+{
+       if (!strcmp(data->macid_sel_compat, "cpsw,am33xx"))
+               cpsw_am33xx_cm_get_macid(data->syscon_addr, mac_addr);
+       else if (!strcmp(data->macid_sel_compat, "davinci,emac"))
+               davinci_emac_3517_get_macid(data->syscon_addr, mac_addr);
 }
 
-static int cpsw_am33xx_cm_get_macid(struct udevice *dev, u16 offset, int slave,
-                                   u8 *mac_addr)
+int ti_cm_get_macid_addr(struct udevice *dev, int slave,
+                        struct cpsw_platform_data *data)
 {
        void *fdt = (void *)gd->fdt_blob;
        int node = dev_of_offset(dev);
-       u32 macid_lo;
-       u32 macid_hi;
        fdt32_t gmii = 0;
        int syscon;
-       u32 addr;
+       u16 offset;
+
+       if (of_machine_is_compatible("ti,dm8148")) {
+               offset = 0x630;
+               data->macid_sel_compat = "cpsw,am33xx";
+       } else if (of_machine_is_compatible("ti,am33xx")) {
+               offset = 0x630;
+               data->macid_sel_compat = "cpsw,am33xx";
+       } else if (device_is_compatible(dev, "ti,am3517-emac")) {
+               offset = 0x110;
+               data->macid_sel_compat = "davinci,emac";
+       } else if (device_is_compatible(dev, "ti,dm816-emac")) {
+               offset = 0x30;
+               data->macid_sel_compat = "cpsw,am33xx";
+       } else if (of_machine_is_compatible("ti,am43")) {
+               offset = 0x630;
+               data->macid_sel_compat = "cpsw,am33xx";
+       } else if (of_machine_is_compatible("ti,dra7")) {
+               offset = 0x514;
+               data->macid_sel_compat = "davinci,emac";
+       } else {
+               dev_err(dev, "incompatible machine/device type for reading mac address\n");
+               return -ENOENT;
+       }
 
        syscon = fdtdec_lookup_phandle(fdt, node, "syscon");
        if (syscon < 0) {
@@ -73,49 +91,16 @@ static int cpsw_am33xx_cm_get_macid(struct udevice *dev, u16 offset, int slave,
                return -ENOENT;
        }
 
-       addr = (u32)map_physmem(fdt_translate_address(fdt, syscon, &gmii),
-                               sizeof(u32), MAP_NOCACHE);
-       if (addr == FDT_ADDR_T_NONE) {
+       data->syscon_addr = (u32)map_physmem(fdt_translate_address(fdt, syscon,
+                                                                  &gmii),
+                                            sizeof(u32), MAP_NOCACHE);
+       if (data->syscon_addr == FDT_ADDR_T_NONE) {
                pr_err("Not able to get syscon address to get mac efuse address\n");
                return -ENOENT;
        }
 
-       addr += CTRL_MAC_REG(offset, slave);
-
-       /* try reading mac address from efuse */
-       macid_lo = readl(addr);
-       macid_hi = readl(addr + 4);
-
-       mac_addr[5] = (macid_lo >> 8) & 0xff;
-       mac_addr[4] = macid_lo & 0xff;
-       mac_addr[3] = (macid_hi >> 24) & 0xff;
-       mac_addr[2] = (macid_hi >> 16) & 0xff;
-       mac_addr[1] = (macid_hi >> 8) & 0xff;
-       mac_addr[0] = macid_hi & 0xff;
+       data->syscon_addr += CTRL_MAC_REG(offset, slave);
 
        return 0;
-}
-
-int ti_cm_get_macid(struct udevice *dev, int slave, u8 *mac_addr)
-{
-       if (of_machine_is_compatible("ti,dm8148"))
-               return cpsw_am33xx_cm_get_macid(dev, 0x630, slave, mac_addr);
-
-       if (of_machine_is_compatible("ti,am33xx"))
-               return cpsw_am33xx_cm_get_macid(dev, 0x630, slave, mac_addr);
-
-       if (device_is_compatible(dev, "ti,am3517-emac"))
-               return davinci_emac_3517_get_macid(dev, 0x110, slave, mac_addr);
-
-       if (device_is_compatible(dev, "ti,dm816-emac"))
-               return cpsw_am33xx_cm_get_macid(dev, 0x30, slave, mac_addr);
-
-       if (of_machine_is_compatible("ti,am43"))
-               return cpsw_am33xx_cm_get_macid(dev, 0x630, slave, mac_addr);
-
-       if (of_machine_is_compatible("ti,dra7"))
-               return davinci_emac_3517_get_macid(dev, 0x514, slave, mac_addr);
 
-       dev_err(dev, "incompatible machine/device type for reading mac address\n");
-       return -ENOENT;
 }
index f5fd02efe1af47b398f684e6e1c5b9577b0656c6..20ddb44dd89460989d1f16d0e2b01c6f110fc38a 100644 (file)
@@ -33,24 +33,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #define GIGABITEN              BIT(7)
 #define FULLDUPLEXEN           BIT(0)
 #define MIIEN                  BIT(15)
-
-/* reg offset */
-#define CPSW_HOST_PORT_OFFSET  0x108
-#define CPSW_SLAVE0_OFFSET     0x208
-#define CPSW_SLAVE1_OFFSET     0x308
-#define CPSW_SLAVE_SIZE                0x100
-#define CPSW_CPDMA_OFFSET      0x800
-#define CPSW_HW_STATS          0x900
-#define CPSW_STATERAM_OFFSET   0xa00
-#define CPSW_CPTS_OFFSET       0xc00
-#define CPSW_ALE_OFFSET                0xd00
-#define CPSW_SLIVER0_OFFSET    0xd80
-#define CPSW_SLIVER1_OFFSET    0xdc0
-#define CPSW_BD_OFFSET         0x2000
-#define CPSW_MDIO_DIV          0xff
-
-#define AM335X_GMII_SEL_OFFSET 0x630
-
 /* DMA Registers */
 #define CPDMA_TXCONTROL                0x004
 #define CPDMA_RXCONTROL                0x014
@@ -209,10 +191,10 @@ struct cpdma_chan {
 #define chan_read_ptr(chan, fld)       ((void *)__raw_readl((chan)->fld))
 
 #define for_active_slave(slave, priv) \
-       slave = (priv)->slaves + (priv)->data.active_slave; if (slave)
+       slave = (priv)->slaves + ((priv)->data)->active_slave; if (slave)
 #define for_each_slave(slave, priv) \
        for (slave = (priv)->slaves; slave != (priv)->slaves + \
-                               (priv)->data.slaves; slave++)
+                               ((priv)->data)->slaves; slave++)
 
 struct cpsw_priv {
 #ifdef CONFIG_DM_ETH
@@ -220,7 +202,7 @@ struct cpsw_priv {
 #else
        struct eth_device               *dev;
 #endif
-       struct cpsw_platform_data       data;
+       struct cpsw_platform_data       *data;
        int                             host_port;
 
        struct cpsw_regs                *regs;
@@ -327,7 +309,7 @@ static int cpsw_ale_match_addr(struct cpsw_priv *priv, const u8 *addr)
        u32 ale_entry[ALE_ENTRY_WORDS];
        int type, idx;
 
-       for (idx = 0; idx < priv->data.ale_entries; idx++) {
+       for (idx = 0; idx < priv->data->ale_entries; idx++) {
                u8 entry_addr[6];
 
                cpsw_ale_read(priv, idx, ale_entry);
@@ -346,7 +328,7 @@ static int cpsw_ale_match_free(struct cpsw_priv *priv)
        u32 ale_entry[ALE_ENTRY_WORDS];
        int type, idx;
 
-       for (idx = 0; idx < priv->data.ale_entries; idx++) {
+       for (idx = 0; idx < priv->data->ale_entries; idx++) {
                cpsw_ale_read(priv, idx, ale_entry);
                type = cpsw_ale_get_entry_type(ale_entry);
                if (type == ALE_TYPE_FREE)
@@ -360,7 +342,7 @@ static int cpsw_ale_find_ageable(struct cpsw_priv *priv)
        u32 ale_entry[ALE_ENTRY_WORDS];
        int type, idx;
 
-       for (idx = 0; idx < priv->data.ale_entries; idx++) {
+       for (idx = 0; idx < priv->data->ale_entries; idx++) {
                cpsw_ale_read(priv, idx, ale_entry);
                type = cpsw_ale_get_entry_type(ale_entry);
                if (type != ALE_TYPE_ADDR && type != ALE_TYPE_VLAN_ADDR)
@@ -500,7 +482,7 @@ static int cpsw_slave_update_link(struct cpsw_slave *slave,
                *link = phy->link;
 
        if (phy->link) { /* link up */
-               mac_control = priv->data.mac_control;
+               mac_control = priv->data->mac_control;
                if (phy->speed == 1000)
                        mac_control |= GIGABITEN;
                if (phy->duplex == DUPLEX_FULL)
@@ -710,7 +692,7 @@ static int _cpsw_init(struct cpsw_priv *priv, u8 *enetaddr)
        priv->desc_free = &priv->descs[0];
 
        /* initialize channels */
-       if (priv->data.version == CPSW_CTRL_VERSION_2) {
+       if (priv->data->version == CPSW_CTRL_VERSION_2) {
                memset(&priv->rx_chan, 0, sizeof(struct cpdma_chan));
                priv->rx_chan.hdp       = priv->dma_regs + CPDMA_RXHDP_VER2;
                priv->rx_chan.cp        = priv->dma_regs + CPDMA_RXCP_VER2;
@@ -733,8 +715,8 @@ static int _cpsw_init(struct cpsw_priv *priv, u8 *enetaddr)
        /* clear dma state */
        setbit_and_wait_for_clear32(priv->dma_regs + CPDMA_SOFTRESET);
 
-       if (priv->data.version == CPSW_CTRL_VERSION_2) {
-               for (i = 0; i < priv->data.channels; i++) {
+       if (priv->data->version == CPSW_CTRL_VERSION_2) {
+               for (i = 0; i < priv->data->channels; i++) {
                        __raw_writel(0, priv->dma_regs + CPDMA_RXHDP_VER2 + 4
                                        * i);
                        __raw_writel(0, priv->dma_regs + CPDMA_RXFREE + 4
@@ -747,7 +729,7 @@ static int _cpsw_init(struct cpsw_priv *priv, u8 *enetaddr)
                                        * i);
                }
        } else {
-               for (i = 0; i < priv->data.channels; i++) {
+               for (i = 0; i < priv->data->channels; i++) {
                        __raw_writel(0, priv->dma_regs + CPDMA_RXHDP_VER1 + 4
                                        * i);
                        __raw_writel(0, priv->dma_regs + CPDMA_RXFREE + 4
@@ -843,7 +825,7 @@ static void cpsw_slave_setup(struct cpsw_slave *slave, int slave_num,
                            struct cpsw_priv *priv)
 {
        void                    *regs = priv->regs;
-       struct cpsw_slave_data  *data = priv->data.slave_data + slave_num;
+       struct cpsw_slave_data  *data = priv->data->slave_data + slave_num;
        slave->slave_num = slave_num;
        slave->data     = data;
        slave->regs     = regs + data->slave_reg_ofs;
@@ -879,7 +861,7 @@ static int cpsw_phy_init(struct cpsw_priv *priv, struct cpsw_slave *slave)
 
 static void cpsw_phy_addr_update(struct cpsw_priv *priv)
 {
-       struct cpsw_platform_data *data = &priv->data;
+       struct cpsw_platform_data *data = priv->data;
        u16 alive = cpsw_mdio_get_alive(priv->bus);
        int active = data->active_slave;
        int new_addr = ffs(alive) - 1;
@@ -899,7 +881,7 @@ static void cpsw_phy_addr_update(struct cpsw_priv *priv)
 int _cpsw_register(struct cpsw_priv *priv)
 {
        struct cpsw_slave       *slave;
-       struct cpsw_platform_data *data = &priv->data;
+       struct cpsw_platform_data *data = priv->data;
        void                    *regs = (void *)data->cpsw_base;
 
        priv->slaves = malloc(sizeof(struct cpsw_slave) * data->slaves);
@@ -988,7 +970,7 @@ int cpsw_register(struct cpsw_platform_data *data)
        }
 
        priv->dev = dev;
-       priv->data = *data;
+       priv->data = data;
 
        strcpy(dev->name, "cpsw");
        dev->iobase     = 0;
@@ -1048,16 +1030,6 @@ static void cpsw_eth_stop(struct udevice *dev)
        return _cpsw_halt(priv);
 }
 
-
-static int cpsw_eth_probe(struct udevice *dev)
-{
-       struct cpsw_priv *priv = dev_get_priv(dev);
-
-       priv->dev = dev;
-
-       return _cpsw_register(priv);
-}
-
 static const struct eth_ops cpsw_eth_ops = {
        .start          = cpsw_eth_start,
        .send           = cpsw_eth_send,
@@ -1079,9 +1051,9 @@ static void cpsw_gmii_sel_am3352(struct cpsw_priv *priv,
        u32 mask;
        u32 mode = 0;
        bool rgmii_id = false;
-       int slave = priv->data.active_slave;
+       int slave = priv->data->active_slave;
 
-       reg = readl(priv->data.gmii_sel);
+       reg = readl(priv->data->gmii_sel);
 
        switch (phy_mode) {
        case PHY_INTERFACE_MODE_RMII:
@@ -1107,7 +1079,7 @@ static void cpsw_gmii_sel_am3352(struct cpsw_priv *priv,
        mask = GMII_SEL_MODE_MASK << (slave * 2) | BIT(slave + 6);
        mode <<= slave * 2;
 
-       if (priv->data.rmii_clock_external) {
+       if (priv->data->rmii_clock_external) {
                if (slave == 0)
                        mode |= AM33XX_GMII_SEL_RMII1_IO_CLK_EN;
                else
@@ -1124,7 +1096,7 @@ static void cpsw_gmii_sel_am3352(struct cpsw_priv *priv,
        reg &= ~mask;
        reg |= mode;
 
-       writel(reg, priv->data.gmii_sel);
+       writel(reg, priv->data->gmii_sel);
 }
 
 static void cpsw_gmii_sel_dra7xx(struct cpsw_priv *priv,
@@ -1133,9 +1105,9 @@ static void cpsw_gmii_sel_dra7xx(struct cpsw_priv *priv,
        u32 reg;
        u32 mask;
        u32 mode = 0;
-       int slave = priv->data.active_slave;
+       int slave = priv->data->active_slave;
 
-       reg = readl(priv->data.gmii_sel);
+       reg = readl(priv->data->gmii_sel);
 
        switch (phy_mode) {
        case PHY_INTERFACE_MODE_RMII:
@@ -1168,13 +1140,13 @@ static void cpsw_gmii_sel_dra7xx(struct cpsw_priv *priv,
                return;
        }
 
-       if (priv->data.rmii_clock_external)
+       if (priv->data->rmii_clock_external)
                dev_err(priv->dev, "RMII External clock is not supported\n");
 
        reg &= ~mask;
        reg |= mode;
 
-       writel(reg, priv->data.gmii_sel);
+       writel(reg, priv->data->gmii_sel);
 }
 
 static void cpsw_phy_sel(struct cpsw_priv *priv, const char *compat,
@@ -1188,13 +1160,28 @@ static void cpsw_phy_sel(struct cpsw_priv *priv, const char *compat,
                cpsw_gmii_sel_dra7xx(priv, phy_mode);
 }
 
+static int cpsw_eth_probe(struct udevice *dev)
+{
+       struct cpsw_priv *priv = dev_get_priv(dev);
+       struct eth_pdata *pdata = dev_get_platdata(dev);
+
+       priv->dev = dev;
+       priv->data = pdata->priv_pdata;
+       ti_cm_get_macid(dev, priv->data, pdata->enetaddr);
+       /* Select phy interface in control module */
+       cpsw_phy_sel(priv, priv->data->phy_sel_compat,
+                    pdata->phy_interface);
+
+       return _cpsw_register(priv);
+}
+
+#if CONFIG_IS_ENABLED(OF_CONTROL)
 static int cpsw_eth_ofdata_to_platdata(struct udevice *dev)
 {
        struct eth_pdata *pdata = dev_get_platdata(dev);
-       struct cpsw_priv *priv = dev_get_priv(dev);
+       struct cpsw_platform_data *data;
        struct gpio_desc *mode_gpios;
        const char *phy_mode;
-       const char *phy_sel_compat = NULL;
        const void *fdt = gd->fdt_blob;
        int node = dev_of_offset(dev);
        int subnode;
@@ -1203,45 +1190,47 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev)
        int num_mode_gpios;
        int ret;
 
+       data = calloc(1, sizeof(struct cpsw_platform_data));
+       pdata->priv_pdata = data;
        pdata->iobase = devfdt_get_addr(dev);
-       priv->data.version = CPSW_CTRL_VERSION_2;
-       priv->data.bd_ram_ofs = CPSW_BD_OFFSET;
-       priv->data.ale_reg_ofs = CPSW_ALE_OFFSET;
-       priv->data.cpdma_reg_ofs = CPSW_CPDMA_OFFSET;
-       priv->data.mdio_div = CPSW_MDIO_DIV;
-       priv->data.host_port_reg_ofs = CPSW_HOST_PORT_OFFSET,
+       data->version = CPSW_CTRL_VERSION_2;
+       data->bd_ram_ofs = CPSW_BD_OFFSET;
+       data->ale_reg_ofs = CPSW_ALE_OFFSET;
+       data->cpdma_reg_ofs = CPSW_CPDMA_OFFSET;
+       data->mdio_div = CPSW_MDIO_DIV;
+       data->host_port_reg_ofs = CPSW_HOST_PORT_OFFSET,
 
        pdata->phy_interface = -1;
 
-       priv->data.cpsw_base = pdata->iobase;
-       priv->data.channels = fdtdec_get_int(fdt, node, "cpdma_channels", -1);
-       if (priv->data.channels <= 0) {
+       data->cpsw_base = pdata->iobase;
+       data->channels = fdtdec_get_int(fdt, node, "cpdma_channels", -1);
+       if (data->channels <= 0) {
                printf("error: cpdma_channels not found in dt\n");
                return -ENOENT;
        }
 
-       priv->data.slaves = fdtdec_get_int(fdt, node, "slaves", -1);
-       if (priv->data.slaves <= 0) {
+       data->slaves = fdtdec_get_int(fdt, node, "slaves", -1);
+       if (data->slaves <= 0) {
                printf("error: slaves not found in dt\n");
                return -ENOENT;
        }
-       priv->data.slave_data = malloc(sizeof(struct cpsw_slave_data) *
-                                      priv->data.slaves);
+       data->slave_data = malloc(sizeof(struct cpsw_slave_data) *
+                                      data->slaves);
 
-       priv->data.ale_entries = fdtdec_get_int(fdt, node, "ale_entries", -1);
-       if (priv->data.ale_entries <= 0) {
+       data->ale_entries = fdtdec_get_int(fdt, node, "ale_entries", -1);
+       if (data->ale_entries <= 0) {
                printf("error: ale_entries not found in dt\n");
                return -ENOENT;
        }
 
-       priv->data.bd_ram_ofs = fdtdec_get_int(fdt, node, "bd_ram_size", -1);
-       if (priv->data.bd_ram_ofs <= 0) {
+       data->bd_ram_ofs = fdtdec_get_int(fdt, node, "bd_ram_size", -1);
+       if (data->bd_ram_ofs <= 0) {
                printf("error: bd_ram_size not found in dt\n");
                return -ENOENT;
        }
 
-       priv->data.mac_control = fdtdec_get_int(fdt, node, "mac_control", -1);
-       if (priv->data.mac_control <= 0) {
+       data->mac_control = fdtdec_get_int(fdt, node, "mac_control", -1);
+       if (data->mac_control <= 0) {
                printf("error: ale_entries not found in dt\n");
                return -ENOENT;
        }
@@ -1256,7 +1245,7 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev)
        }
 
        active_slave = fdtdec_get_int(fdt, node, "active_slave", 0);
-       priv->data.active_slave = active_slave;
+       data->active_slave = active_slave;
 
        fdt_for_each_subnode(subnode, fdt, node) {
                int len;
@@ -1271,108 +1260,107 @@ static int cpsw_eth_ofdata_to_platdata(struct udevice *dev)
                                pr_err("Not able to get MDIO address space\n");
                                return -ENOENT;
                        }
-                       priv->data.mdio_base = mdio_base;
+                       data->mdio_base = mdio_base;
                }
 
                if (!strncmp(name, "slave", 5)) {
                        u32 phy_id[2];
 
-                       if (slave_index >= priv->data.slaves)
+                       if (slave_index >= data->slaves)
                                continue;
                        phy_mode = fdt_getprop(fdt, subnode, "phy-mode", NULL);
                        if (phy_mode)
-                               priv->data.slave_data[slave_index].phy_if =
+                               data->slave_data[slave_index].phy_if =
                                        phy_get_interface_by_name(phy_mode);
 
-                       priv->data.slave_data[slave_index].phy_of_handle =
+                       data->slave_data[slave_index].phy_of_handle =
                                fdtdec_lookup_phandle(fdt, subnode,
                                                      "phy-handle");
 
-                       if (priv->data.slave_data[slave_index].phy_of_handle >= 0) {
-                               priv->data.slave_data[slave_index].phy_addr =
+                       if (data->slave_data[slave_index].phy_of_handle >= 0) {
+                               data->slave_data[slave_index].phy_addr =
                                                fdtdec_get_int(gd->fdt_blob,
-                                                              priv->data.slave_data[slave_index].phy_of_handle,
+                                               data->slave_data[slave_index].phy_of_handle,
                                                               "reg", -1);
                        } else {
                                fdtdec_get_int_array(fdt, subnode, "phy_id",
                                                     phy_id, 2);
-                               priv->data.slave_data[slave_index].phy_addr =
+                               data->slave_data[slave_index].phy_addr =
                                                phy_id[1];
                        }
                        slave_index++;
                }
 
                if (!strncmp(name, "cpsw-phy-sel", 12)) {
-                       priv->data.gmii_sel = cpsw_get_addr_by_node(fdt,
-                                                                   subnode);
+                       data->gmii_sel = cpsw_get_addr_by_node(fdt, subnode);
 
-                       if (priv->data.gmii_sel == FDT_ADDR_T_NONE) {
+                       if (data->gmii_sel == FDT_ADDR_T_NONE) {
                                pr_err("Not able to get gmii_sel reg address\n");
                                return -ENOENT;
                        }
 
                        if (fdt_get_property(fdt, subnode, "rmii-clock-ext",
                                             NULL))
-                               priv->data.rmii_clock_external = true;
+                               data->rmii_clock_external = true;
 
-                       phy_sel_compat = fdt_getprop(fdt, subnode, "compatible",
-                                                    NULL);
-                       if (!phy_sel_compat) {
+                       data->phy_sel_compat = fdt_getprop(fdt, subnode,
+                                                          "compatible", NULL);
+                       if (!data->phy_sel_compat) {
                                pr_err("Not able to get gmii_sel compatible\n");
                                return -ENOENT;
                        }
                }
        }
 
-       priv->data.slave_data[0].slave_reg_ofs = CPSW_SLAVE0_OFFSET;
-       priv->data.slave_data[0].sliver_reg_ofs = CPSW_SLIVER0_OFFSET;
+       data->slave_data[0].slave_reg_ofs = CPSW_SLAVE0_OFFSET;
+       data->slave_data[0].sliver_reg_ofs = CPSW_SLIVER0_OFFSET;
 
-       if (priv->data.slaves == 2) {
-               priv->data.slave_data[1].slave_reg_ofs = CPSW_SLAVE1_OFFSET;
-               priv->data.slave_data[1].sliver_reg_ofs = CPSW_SLIVER1_OFFSET;
+       if (data->slaves == 2) {
+               data->slave_data[1].slave_reg_ofs = CPSW_SLAVE1_OFFSET;
+               data->slave_data[1].sliver_reg_ofs = CPSW_SLIVER1_OFFSET;
        }
 
-       ret = ti_cm_get_macid(dev, active_slave, pdata->enetaddr);
+       ret = ti_cm_get_macid_addr(dev, active_slave, data);
        if (ret < 0) {
                pr_err("cpsw read efuse mac failed\n");
                return ret;
        }
 
-       pdata->phy_interface = priv->data.slave_data[active_slave].phy_if;
+       pdata->phy_interface = data->slave_data[active_slave].phy_if;
        if (pdata->phy_interface == -1) {
                debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
                return -EINVAL;
        }
 
-       /* Select phy interface in control module */
-       cpsw_phy_sel(priv, phy_sel_compat, pdata->phy_interface);
-
        return 0;
 }
 
+static const struct udevice_id cpsw_eth_ids[] = {
+       { .compatible = "ti,cpsw" },
+       { .compatible = "ti,am335x-cpsw" },
+       { }
+};
+#endif
+
 int cpsw_get_slave_phy_addr(struct udevice *dev, int slave)
 {
        struct cpsw_priv *priv = dev_get_priv(dev);
-       struct cpsw_platform_data *data = &priv->data;
+       struct cpsw_platform_data *data = priv->data;
 
        return data->slave_data[slave].phy_addr;
 }
 
-static const struct udevice_id cpsw_eth_ids[] = {
-       { .compatible = "ti,cpsw" },
-       { .compatible = "ti,am335x-cpsw" },
-       { }
-};
-
 U_BOOT_DRIVER(eth_cpsw) = {
        .name   = "eth_cpsw",
        .id     = UCLASS_ETH,
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        .of_match = cpsw_eth_ids,
        .ofdata_to_platdata = cpsw_eth_ofdata_to_platdata,
+       .platdata_auto_alloc_size = sizeof(struct eth_pdata),
+#endif
        .probe  = cpsw_eth_probe,
        .ops    = &cpsw_eth_ops,
        .priv_auto_alloc_size = sizeof(struct cpsw_priv),
-       .platdata_auto_alloc_size = sizeof(struct eth_pdata),
-       .flags = DM_FLAG_ALLOC_PRIV_DMA,
+       .flags = DM_FLAG_ALLOC_PRIV_DMA | DM_FLAG_PRE_RELOC,
 };
 #endif /* CONFIG_DM_ETH */
index a3ba91cc3f5600a8bc928908ffae4b4d33f62ac0..4baeeb83f109cb551cc748c520b2f05e6264010c 100644 (file)
@@ -88,6 +88,7 @@ struct ks2_eth_priv {
        struct mii_dev                  *mdio_bus;
        int                             phy_addr;
        phy_interface_t                 phy_if;
+       int                             phy_of_handle;
        int                             sgmii_link_type;
        void                            *mdio_base;
        struct rx_buff_desc             net_rx_buffs;
@@ -588,6 +589,10 @@ static int ks2_eth_probe(struct udevice *dev)
        if (priv->has_mdio) {
                priv->phydev = phy_connect(priv->mdio_bus, priv->phy_addr,
                                           dev, priv->phy_if);
+#ifdef CONFIG_DM_ETH
+       if (priv->phy_of_handle)
+               priv->phydev->node = offset_to_ofnode(priv->phy_of_handle);
+#endif
                phy_config(priv->phydev);
        }
 
@@ -679,6 +684,7 @@ static int ks2_eth_parse_slave_interface(int netcp, int slave,
        int phy;
        int dma_count;
        u32 dma_channel[8];
+       const char *phy_mode;
 
        priv->slave_port = fdtdec_get_int(fdt, slave, "slave-port", -1);
        priv->net_rx_buffs.rx_flow = priv->slave_port * 8;
@@ -700,7 +706,9 @@ static int ks2_eth_parse_slave_interface(int netcp, int slave,
        priv->link_type = fdtdec_get_int(fdt, slave, "link-interface", -1);
 
        phy = fdtdec_lookup_phandle(fdt, slave, "phy-handle");
+
        if (phy >= 0) {
+               priv->phy_of_handle = phy;
                priv->phy_addr = fdtdec_get_int(fdt, phy, "reg", -1);
 
                mdio = fdt_parent_offset(fdt, phy);
@@ -717,7 +725,19 @@ static int ks2_eth_parse_slave_interface(int netcp, int slave,
                priv->sgmii_link_type = SGMII_LINK_MAC_PHY;
                priv->has_mdio = true;
        } else if (priv->link_type == LINK_TYPE_RGMII_LINK_MAC_PHY) {
-               priv->phy_if = PHY_INTERFACE_MODE_RGMII;
+               phy_mode = fdt_getprop(fdt, slave, "phy-mode", NULL);
+               if (phy_mode) {
+                       priv->phy_if = phy_get_interface_by_name(phy_mode);
+                       if (priv->phy_if != PHY_INTERFACE_MODE_RGMII &&
+                           priv->phy_if != PHY_INTERFACE_MODE_RGMII_ID &&
+                           priv->phy_if != PHY_INTERFACE_MODE_RGMII_RXID &&
+                           priv->phy_if != PHY_INTERFACE_MODE_RGMII_TXID) {
+                               pr_err("invalid phy-mode\n");
+                               return -EINVAL;
+                       }
+               } else {
+                       priv->phy_if = PHY_INTERFACE_MODE_RGMII;
+               }
                pdata->phy_interface = priv->phy_if;
                priv->has_mdio = true;
        }
index 4bdad62dc906cf48a7cad7416ebc63e19a96bf7d..27f274ff022416a6d66e895b92a0239fedefc5fe 100644 (file)
@@ -37,6 +37,9 @@ struct at91_pinctrl_priv {
 #define OUTPUT                 BIT(7)
 #define OUTPUT_VAL_SHIFT       8
 #define OUTPUT_VAL             (0x1 << OUTPUT_VAL_SHIFT)
+#define SLEWRATE_SHIFT 9
+#define SLEWRATE_MASK  0x1
+#define SLEWRATE       (SLEWRATE_MASK << SLEWRATE_SHIFT)
 #define DEBOUNCE               BIT(16)
 #define DEBOUNCE_VAL_SHIFT     17
 #define DEBOUNCE_VAL           (0x3fff << DEBOUNCE_VAL_SHIFT)
@@ -50,10 +53,22 @@ struct at91_pinctrl_priv {
  * DRIVE_STRENGTH_DEFAULT is just a placeholder to avoid changing the drive
  * strength when there is no dt config for it.
  */
-#define DRIVE_STRENGTH_DEFAULT (0 << DRIVE_STRENGTH_SHIFT)
-#define DRIVE_STRENGTH_LOW     (1 << DRIVE_STRENGTH_SHIFT)
-#define DRIVE_STRENGTH_MED     (2 << DRIVE_STRENGTH_SHIFT)
-#define DRIVE_STRENGTH_HI      (3 << DRIVE_STRENGTH_SHIFT)
+enum drive_strength_bit {
+       DRIVE_STRENGTH_BIT_DEF,
+       DRIVE_STRENGTH_BIT_LOW,
+       DRIVE_STRENGTH_BIT_MED,
+       DRIVE_STRENGTH_BIT_HI,
+};
+
+#define DRIVE_STRENGTH_BIT_MSK(name)   (DRIVE_STRENGTH_BIT_##name << \
+                                        DRIVE_STRENGTH_SHIFT)
+
+enum slewrate_bit {
+       SLEWRATE_BIT_DIS,
+       SLEWRATE_BIT_ENA,
+};
+
+#define SLEWRATE_BIT_MSK(name)         (SLEWRATE_BIT_##name << SLEWRATE_SHIFT)
 
 enum at91_mux {
        AT91_MUX_GPIO = 0,
@@ -90,6 +105,7 @@ struct at91_pinctrl_mux_ops {
        void (*disable_schmitt_trig)(struct at91_port *pio, u32 mask);
        void (*set_drivestrength)(struct at91_port *pio, u32 pin,
                                  u32 strength);
+       void (*set_slewrate)(struct at91_port *pio, u32 pin, u32 slewrate);
 };
 
 static u32 two_bit_pin_value_shift_amount(u32 pin)
@@ -238,11 +254,52 @@ static void at91_mux_sam9x5_set_drivestrength(struct at91_port *pio,
 
        /* strength is inverse on SAM9x5s with our defines
         * 0 = hi, 1 = med, 2 = low, 3 = rsvd */
-       setting = DRIVE_STRENGTH_HI - setting;
+       setting = DRIVE_STRENGTH_BIT_MSK(HI) - setting;
 
        set_drive_strength(reg, pin, setting);
 }
 
+static void at91_mux_sam9x60_set_drivestrength(struct at91_port *pio, u32 pin,
+                                              u32 setting)
+{
+       void *reg = &pio->driver12;
+       u32 tmp;
+
+       if (setting <= DRIVE_STRENGTH_BIT_DEF ||
+           setting == DRIVE_STRENGTH_BIT_MED ||
+           setting > DRIVE_STRENGTH_BIT_HI)
+               return;
+
+       tmp = readl(reg);
+
+       /* Strength is 0: low, 1: hi */
+       if (setting == DRIVE_STRENGTH_BIT_LOW)
+               tmp &= ~BIT(pin);
+       else
+               tmp |= BIT(pin);
+
+       writel(tmp, reg);
+}
+
+static void at91_mux_sam9x60_set_slewrate(struct at91_port *pio, u32 pin,
+                                         u32 setting)
+{
+       void *reg = &pio->reserved12[3];
+       u32 tmp;
+
+       if (setting < SLEWRATE_BIT_DIS || setting > SLEWRATE_BIT_ENA)
+               return;
+
+       tmp = readl(reg);
+
+       if (setting == SLEWRATE_BIT_DIS)
+               tmp &= ~BIT(pin);
+       else
+               tmp |= BIT(pin);
+
+       writel(tmp, reg);
+}
+
 static struct at91_pinctrl_mux_ops at91rm9200_ops = {
        .mux_A_periph   = at91_mux_set_A_periph,
        .mux_B_periph   = at91_mux_set_B_periph,
@@ -273,6 +330,19 @@ static struct at91_pinctrl_mux_ops sama5d3_ops = {
        .set_drivestrength = at91_mux_sama5d3_set_drivestrength,
 };
 
+static struct at91_pinctrl_mux_ops sam9x60_ops = {
+       .mux_A_periph   = at91_mux_pio3_set_A_periph,
+       .mux_B_periph   = at91_mux_pio3_set_B_periph,
+       .mux_C_periph   = at91_mux_pio3_set_C_periph,
+       .mux_D_periph   = at91_mux_pio3_set_D_periph,
+       .set_deglitch   = at91_mux_pio3_set_deglitch,
+       .set_debounce   = at91_mux_pio3_set_debounce,
+       .set_pulldown   = at91_mux_pio3_set_pulldown,
+       .disable_schmitt_trig = at91_mux_pio3_disable_schmitt_trig,
+       .set_drivestrength = at91_mux_sam9x60_set_drivestrength,
+       .set_slewrate   = at91_mux_sam9x60_set_slewrate,
+};
+
 static void at91_mux_gpio_disable(struct at91_port *pio, u32 mask)
 {
        writel(mask, &pio->pdr);
@@ -339,6 +409,9 @@ static int at91_pinconf_set(struct at91_pinctrl_mux_ops *ops,
        if (ops->set_drivestrength)
                ops->set_drivestrength(pio, pin,
                        (config & DRIVE_STRENGTH) >> DRIVE_STRENGTH_SHIFT);
+       if (ops->set_slewrate)
+               ops->set_slewrate(pio, pin,
+                       (config & SLEWRATE) >> SLEWRATE_SHIFT);
 
        return 0;
 }
@@ -440,6 +513,7 @@ static const struct udevice_id at91_pinctrl_match[] = {
        { .compatible = "atmel,sama5d3-pinctrl", .data = (ulong)&sama5d3_ops },
        { .compatible = "atmel,at91sam9x5-pinctrl", .data = (ulong)&at91sam9x5_ops },
        { .compatible = "atmel,at91rm9200-pinctrl", .data = (ulong)&at91rm9200_ops },
+       { .compatible = "microchip,sam9x60-pinctrl", .data = (ulong)&sam9x60_ops },
        {}
 };
 
index 0cb577037c3b36eb2d47e79e977828af6f17cde0..152414ce31c03689004182c357997fd4bf9f1fd5 100644 (file)
@@ -76,6 +76,16 @@ config PINCTRL_PFC_R8A7796
          the GPIO definitions and pin control functions for each available
          multiplex function.
 
+config PINCTRL_PFC_R8A77965
+       bool "Renesas RCar Gen3 R8A77965 pin control driver"
+       depends on PINCTRL_PFC
+       help
+         Support pin multiplexing control on Renesas RCar Gen3 R8A77965 SoCs.
+
+         The driver is controlled by a device tree node which contains both
+         the GPIO definitions and pin control functions for each available
+         multiplex function.
+
 config PINCTRL_PFC_R8A77970
        bool "Renesas RCar Gen3 R8A77970 pin control driver"
        depends on PINCTRL_PFC
index 62bc40b8c10cc94a4dc82addeab77cbea030af3b..596b0023a3aee48a91b7fcb6436f67c3ff4815ea 100644 (file)
@@ -6,6 +6,7 @@ obj-$(CONFIG_PINCTRL_PFC_R8A7793) += pfc-r8a7791.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7794) += pfc-r8a7794.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7795) += pfc-r8a7795.o
 obj-$(CONFIG_PINCTRL_PFC_R8A7796) += pfc-r8a7796.o
+obj-$(CONFIG_PINCTRL_PFC_R8A77965) += pfc-r8a77965.o
 obj-$(CONFIG_PINCTRL_PFC_R8A77970) += pfc-r8a77970.o
 obj-$(CONFIG_PINCTRL_PFC_R8A77990) += pfc-r8a77990.o
 obj-$(CONFIG_PINCTRL_PFC_R8A77995) += pfc-r8a77995.o
index ad492b5366b261c568999d831fcd40808a34f7f6..ef23ca278ab3ccd9bf1ac2d047bc0873e5506032 100644 (file)
@@ -5694,7 +5694,18 @@ static int r8a7790_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *poc
        return 31 - (pin & 0x1f);
 }
 
+static int r8a7790_pinmux_soc_init(struct sh_pfc *pfc)
+{
+       /* Initialize TDSEL on old revisions */
+       if ((rmobile_get_cpu_rev_integer() == 1) &&
+           (rmobile_get_cpu_rev_fraction() == 0))
+               sh_pfc_write(pfc, 0xe6060088, 0x00155554);
+
+       return 0;
+}
+
 static const struct sh_pfc_soc_operations r8a7790_pinmux_ops = {
+       .init = r8a7790_pinmux_soc_init,
        .pin_to_pocctrl = r8a7790_pin_to_pocctrl,
 };
 
index 0b6a1b0c1ddc8f87c0d55f9b17d6438461cd6a8e..81669554597bd75d866a5c51b47909de31c9516a 100644 (file)
@@ -3221,8 +3221,7 @@ static const unsigned int qspi_data4_b_pins[] = {
        RCAR_GP_PIN(6, 4),
 };
 static const unsigned int qspi_data4_b_mux[] = {
-       SPCLK_B_MARK, MOSI_IO0_B_MARK, MISO_IO1_B_MARK,
-       IO2_B_MARK, IO3_B_MARK, SSL_B_MARK,
+       MOSI_IO0_B_MARK, MISO_IO1_B_MARK, IO2_B_MARK, IO3_B_MARK,
 };
 /* - SCIF0 ------------------------------------------------------------------ */
 static const unsigned int scif0_data_pins[] = {
@@ -4322,7 +4321,7 @@ static const unsigned int vin1_clk_pins[] = {
 static const unsigned int vin1_clk_mux[] = {
        VI1_CLK_MARK,
 };
-static const union vin_data vin1_b_data_pins = {
+static const union vin_data vin1_data_b_pins = {
        .data24 = {
                /* B */
                RCAR_GP_PIN(3, 0), RCAR_GP_PIN(3, 1),
@@ -4341,7 +4340,7 @@ static const union vin_data vin1_b_data_pins = {
                RCAR_GP_PIN(2, 19), RCAR_GP_PIN(2, 20),
        },
 };
-static const union vin_data vin1_b_data_mux = {
+static const union vin_data vin1_data_b_mux = {
        .data24 = {
                /* B */
                VI1_DATA0_B_MARK, VI1_DATA1_B_MARK,
@@ -4360,7 +4359,7 @@ static const union vin_data vin1_b_data_mux = {
                VI1_R6_B_MARK, VI1_R7_B_MARK,
        },
 };
-static const unsigned int vin1_b_data18_pins[] = {
+static const unsigned int vin1_data18_b_pins[] = {
        /* B */
        RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
        RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
@@ -4374,47 +4373,44 @@ static const unsigned int vin1_b_data18_pins[] = {
        RCAR_GP_PIN(2, 17), RCAR_GP_PIN(2, 18),
        RCAR_GP_PIN(2, 19), RCAR_GP_PIN(2, 20),
 };
-static const unsigned int vin1_b_data18_mux[] = {
+static const unsigned int vin1_data18_b_mux[] = {
        /* B */
-       VI1_DATA0_B_MARK, VI1_DATA1_B_MARK,
        VI1_DATA2_B_MARK, VI1_DATA3_B_MARK,
        VI1_DATA4_B_MARK, VI1_DATA5_B_MARK,
        VI1_DATA6_B_MARK, VI1_DATA7_B_MARK,
        /* G */
-       VI1_G0_B_MARK, VI1_G1_B_MARK,
        VI1_G2_B_MARK, VI1_G3_B_MARK,
        VI1_G4_B_MARK, VI1_G5_B_MARK,
        VI1_G6_B_MARK, VI1_G7_B_MARK,
        /* R */
-       VI1_R0_B_MARK, VI1_R1_B_MARK,
        VI1_R2_B_MARK, VI1_R3_B_MARK,
        VI1_R4_B_MARK, VI1_R5_B_MARK,
        VI1_R6_B_MARK, VI1_R7_B_MARK,
 };
-static const unsigned int vin1_b_sync_pins[] = {
+static const unsigned int vin1_sync_b_pins[] = {
        RCAR_GP_PIN(3, 17), /* HSYNC */
        RCAR_GP_PIN(3, 18), /* VSYNC */
 };
-static const unsigned int vin1_b_sync_mux[] = {
+static const unsigned int vin1_sync_b_mux[] = {
        VI1_HSYNC_N_B_MARK,
        VI1_VSYNC_N_B_MARK,
 };
-static const unsigned int vin1_b_field_pins[] = {
+static const unsigned int vin1_field_b_pins[] = {
        RCAR_GP_PIN(3, 20),
 };
-static const unsigned int vin1_b_field_mux[] = {
+static const unsigned int vin1_field_b_mux[] = {
        VI1_FIELD_B_MARK,
 };
-static const unsigned int vin1_b_clkenb_pins[] = {
+static const unsigned int vin1_clkenb_b_pins[] = {
        RCAR_GP_PIN(3, 19),
 };
-static const unsigned int vin1_b_clkenb_mux[] = {
+static const unsigned int vin1_clkenb_b_mux[] = {
        VI1_CLKENB_B_MARK,
 };
-static const unsigned int vin1_b_clk_pins[] = {
+static const unsigned int vin1_clk_b_pins[] = {
        RCAR_GP_PIN(3, 16),
 };
-static const unsigned int vin1_b_clk_mux[] = {
+static const unsigned int vin1_clk_b_mux[] = {
        VI1_CLK_B_MARK,
 };
 /* - VIN2 ----------------------------------------------------------------- */
@@ -4459,7 +4455,7 @@ static const unsigned int vin2_clk_mux[] = {
 
 static const struct {
        struct sh_pfc_pin_group common[346];
-       struct sh_pfc_pin_group r8a779x[9];
+       struct sh_pfc_pin_group automotive[9];
 } pinmux_groups = {
        .common = {
                SH_PFC_PIN_GROUP(audio_clk_a),
@@ -4792,24 +4788,24 @@ static const struct {
                SH_PFC_PIN_GROUP(vin1_field),
                SH_PFC_PIN_GROUP(vin1_clkenb),
                SH_PFC_PIN_GROUP(vin1_clk),
-               VIN_DATA_PIN_GROUP(vin1_b_data, 24),
-               VIN_DATA_PIN_GROUP(vin1_b_data, 20),
-               SH_PFC_PIN_GROUP(vin1_b_data18),
-               VIN_DATA_PIN_GROUP(vin1_b_data, 16),
-               VIN_DATA_PIN_GROUP(vin1_b_data, 12),
-               VIN_DATA_PIN_GROUP(vin1_b_data, 10),
-               VIN_DATA_PIN_GROUP(vin1_b_data, 8),
-               SH_PFC_PIN_GROUP(vin1_b_sync),
-               SH_PFC_PIN_GROUP(vin1_b_field),
-               SH_PFC_PIN_GROUP(vin1_b_clkenb),
-               SH_PFC_PIN_GROUP(vin1_b_clk),
+               VIN_DATA_PIN_GROUP(vin1_data, 24, _b),
+               VIN_DATA_PIN_GROUP(vin1_data, 20, _b),
+               SH_PFC_PIN_GROUP(vin1_data18_b),
+               VIN_DATA_PIN_GROUP(vin1_data, 16, _b),
+               VIN_DATA_PIN_GROUP(vin1_data, 12, _b),
+               VIN_DATA_PIN_GROUP(vin1_data, 10, _b),
+               VIN_DATA_PIN_GROUP(vin1_data, 8, _b),
+               SH_PFC_PIN_GROUP(vin1_sync_b),
+               SH_PFC_PIN_GROUP(vin1_field_b),
+               SH_PFC_PIN_GROUP(vin1_clkenb_b),
+               SH_PFC_PIN_GROUP(vin1_clk_b),
                SH_PFC_PIN_GROUP(vin2_data8),
                SH_PFC_PIN_GROUP(vin2_sync),
                SH_PFC_PIN_GROUP(vin2_field),
                SH_PFC_PIN_GROUP(vin2_clkenb),
                SH_PFC_PIN_GROUP(vin2_clk),
        },
-       .r8a779x = {
+       .automotive = {
                SH_PFC_PIN_GROUP(adi_common),
                SH_PFC_PIN_GROUP(adi_chsel0),
                SH_PFC_PIN_GROUP(adi_chsel1),
@@ -5244,7 +5240,7 @@ static const char * const scifb2_groups[] = {
        "scifb2_data_b",
        "scifb2_clk_b",
        "scifb2_ctrl_b",
-       "scifb0_data_c",
+       "scifb2_data_c",
        "scifb2_clk_c",
        "scifb2_data_d",
 };
@@ -5343,17 +5339,17 @@ static const char * const vin1_groups[] = {
        "vin1_field",
        "vin1_clkenb",
        "vin1_clk",
-       "vin1_b_data24",
-       "vin1_b_data20",
-       "vin1_b_data18",
-       "vin1_b_data16",
-       "vin1_b_data12",
-       "vin1_b_data10",
-       "vin1_b_data8",
-       "vin1_b_sync",
-       "vin1_b_field",
-       "vin1_b_clkenb",
-       "vin1_b_clk",
+       "vin1_data24_b",
+       "vin1_data20_b",
+       "vin1_data18_b",
+       "vin1_data16_b",
+       "vin1_data12_b",
+       "vin1_data10_b",
+       "vin1_data8_b",
+       "vin1_sync_b",
+       "vin1_field_b",
+       "vin1_clkenb_b",
+       "vin1_clk_b",
 };
 
 static const char * const vin2_groups[] = {
@@ -5366,7 +5362,7 @@ static const char * const vin2_groups[] = {
 
 static const struct {
        struct sh_pfc_function common[58];
-       struct sh_pfc_function r8a779x[2];
+       struct sh_pfc_function automotive[2];
 } pinmux_functions = {
        .common = {
                SH_PFC_FUNCTION(audio_clk),
@@ -5428,7 +5424,7 @@ static const struct {
                SH_PFC_FUNCTION(vin1),
                SH_PFC_FUNCTION(vin2),
        },
-       .r8a779x = {
+       .automotive = {
                SH_PFC_FUNCTION(adi),
                SH_PFC_FUNCTION(mlb),
        }
@@ -6635,6 +6631,28 @@ const struct sh_pfc_soc_info r8a7743_pinmux_info = {
 };
 #endif
 
+#ifdef CONFIG_PINCTRL_PFC_R8A7744
+const struct sh_pfc_soc_info r8a7744_pinmux_info = {
+       .name = "r8a77440_pfc",
+       .ops = &r8a7791_pinmux_ops,
+       .unlock_reg = 0xe6060000, /* PMMR */
+
+       .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
+
+       .pins = pinmux_pins,
+       .nr_pins = ARRAY_SIZE(pinmux_pins),
+       .groups = pinmux_groups.common,
+       .nr_groups = ARRAY_SIZE(pinmux_groups.common),
+       .functions = pinmux_functions.common,
+       .nr_functions = ARRAY_SIZE(pinmux_functions.common),
+
+       .cfg_regs = pinmux_config_regs,
+
+       .pinmux_data = pinmux_data,
+       .pinmux_data_size = ARRAY_SIZE(pinmux_data),
+};
+#endif
+
 #ifdef CONFIG_PINCTRL_PFC_R8A7791
 const struct sh_pfc_soc_info r8a7791_pinmux_info = {
        .name = "r8a77910_pfc",
@@ -6647,10 +6665,10 @@ const struct sh_pfc_soc_info r8a7791_pinmux_info = {
        .nr_pins = ARRAY_SIZE(pinmux_pins),
        .groups = pinmux_groups.common,
        .nr_groups = ARRAY_SIZE(pinmux_groups.common) +
-                    ARRAY_SIZE(pinmux_groups.r8a779x),
+                    ARRAY_SIZE(pinmux_groups.automotive),
        .functions = pinmux_functions.common,
        .nr_functions = ARRAY_SIZE(pinmux_functions.common) +
-                       ARRAY_SIZE(pinmux_functions.r8a779x),
+                       ARRAY_SIZE(pinmux_functions.automotive),
 
        .cfg_regs = pinmux_config_regs,
 
@@ -6671,10 +6689,10 @@ const struct sh_pfc_soc_info r8a7793_pinmux_info = {
        .nr_pins = ARRAY_SIZE(pinmux_pins),
        .groups = pinmux_groups.common,
        .nr_groups = ARRAY_SIZE(pinmux_groups.common) +
-                    ARRAY_SIZE(pinmux_groups.r8a779x),
+                    ARRAY_SIZE(pinmux_groups.automotive),
        .functions = pinmux_functions.common,
        .nr_functions = ARRAY_SIZE(pinmux_functions.common) +
-                       ARRAY_SIZE(pinmux_functions.r8a779x),
+                       ARRAY_SIZE(pinmux_functions.automotive),
 
        .cfg_regs = pinmux_config_regs,
 
index d0063c06bf02235d408c2ab344ba83c89bcd342d..95bb5237d92235b4132ba1bf4f289e8ef49871c7 100644 (file)
@@ -1477,7 +1477,7 @@ static const unsigned int vin1_clk_mux[] = {
        VI1_CLK_MARK,
 };
 /* - VIN2 ------------------------------------------------------------------- */
-static const union vin_data vin2_data_pins = {
+static const union vin_data16 vin2_data_pins = {
        .data16 = {
                RCAR_GP_PIN(6, 4), RCAR_GP_PIN(6, 5),
                RCAR_GP_PIN(6, 6), RCAR_GP_PIN(6, 7),
@@ -1489,7 +1489,7 @@ static const union vin_data vin2_data_pins = {
                RCAR_GP_PIN(8, 11), RCAR_GP_PIN(8, 12),
        },
 };
-static const union vin_data vin2_data_mux = {
+static const union vin_data16 vin2_data_mux = {
        .data16 = {
                VI2_D0_C0_MARK, VI2_D1_C1_MARK,
                VI2_D2_C2_MARK, VI2_D3_C3_MARK,
@@ -1527,7 +1527,7 @@ static const unsigned int vin2_clk_mux[] = {
        VI2_CLK_MARK,
 };
 /* - VIN3 ------------------------------------------------------------------- */
-static const union vin_data vin3_data_pins = {
+static const union vin_data16 vin3_data_pins = {
        .data16 = {
                RCAR_GP_PIN(7, 4), RCAR_GP_PIN(7, 5),
                RCAR_GP_PIN(7, 6), RCAR_GP_PIN(7, 7),
@@ -1539,7 +1539,7 @@ static const union vin_data vin3_data_pins = {
                RCAR_GP_PIN(8, 15), RCAR_GP_PIN(8, 16),
        },
 };
-static const union vin_data vin3_data_mux = {
+static const union vin_data16 vin3_data_mux = {
        .data16 = {
                VI3_D0_C0_MARK, VI3_D1_C1_MARK,
                VI3_D2_C2_MARK, VI3_D3_C3_MARK,
@@ -1577,7 +1577,7 @@ static const unsigned int vin3_clk_mux[] = {
        VI3_CLK_MARK,
 };
 /* - VIN4 ------------------------------------------------------------------- */
-static const union vin_data vin4_data_pins = {
+static const union vin_data12 vin4_data_pins = {
        .data12 = {
                RCAR_GP_PIN(8, 4), RCAR_GP_PIN(8, 5),
                RCAR_GP_PIN(8, 6), RCAR_GP_PIN(8, 7),
@@ -1587,7 +1587,7 @@ static const union vin_data vin4_data_pins = {
                RCAR_GP_PIN(8, 14), RCAR_GP_PIN(8, 15),
        },
 };
-static const union vin_data vin4_data_mux = {
+static const union vin_data12 vin4_data_mux = {
        .data12 = {
                VI4_D0_C0_MARK, VI4_D1_C1_MARK,
                VI4_D2_C2_MARK, VI4_D3_C3_MARK,
@@ -1623,7 +1623,7 @@ static const unsigned int vin4_clk_mux[] = {
        VI4_CLK_MARK,
 };
 /* - VIN5 ------------------------------------------------------------------- */
-static const union vin_data vin5_data_pins = {
+static const union vin_data12 vin5_data_pins = {
        .data12 = {
                RCAR_GP_PIN(9, 4), RCAR_GP_PIN(9, 5),
                RCAR_GP_PIN(9, 6), RCAR_GP_PIN(9, 7),
@@ -1633,7 +1633,7 @@ static const union vin_data vin5_data_pins = {
                RCAR_GP_PIN(9, 14), RCAR_GP_PIN(9, 15),
        },
 };
-static const union vin_data vin5_data_mux = {
+static const union vin_data12 vin5_data_mux = {
        .data12 = {
                VI5_D0_C0_MARK, VI5_D1_C1_MARK,
                VI5_D2_C2_MARK, VI5_D3_C3_MARK,
@@ -1747,10 +1747,10 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
        VIN_DATA_PIN_GROUP(vin1_data, 12),
        VIN_DATA_PIN_GROUP(vin1_data, 10),
        VIN_DATA_PIN_GROUP(vin1_data, 8),
-       VIN_DATA_PIN_GROUP(vin1_data_b, 24),
-       VIN_DATA_PIN_GROUP(vin1_data_b, 20),
+       VIN_DATA_PIN_GROUP(vin1_data, 24, _b),
+       VIN_DATA_PIN_GROUP(vin1_data, 20, _b),
        SH_PFC_PIN_GROUP(vin1_data18_b),
-       VIN_DATA_PIN_GROUP(vin1_data_b, 16),
+       VIN_DATA_PIN_GROUP(vin1_data, 16, _b),
        SH_PFC_PIN_GROUP(vin1_sync),
        SH_PFC_PIN_GROUP(vin1_field),
        SH_PFC_PIN_GROUP(vin1_clkenb),
@@ -1916,6 +1916,7 @@ static const char * const vin1_groups[] = {
        "vin1_data8",
        "vin1_data24_b",
        "vin1_data20_b",
+       "vin1_data18_b",
        "vin1_data16_b",
        "vin1_sync",
        "vin1_field",
index 7264c70e85f3e9823dea13d6e10c87c450a5d1fa..657ebca783bb6adf1a9d6160baaebad7816f8a50 100644 (file)
@@ -3707,7 +3707,7 @@ static const unsigned int vin0_clk_mux[] = {
        VI0_CLK_MARK,
 };
 /* - VIN1 ------------------------------------------------------------------- */
-static const union vin_data vin1_data_pins = {
+static const union vin_data12 vin1_data_pins = {
        .data12 = {
                RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
                RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
@@ -3717,7 +3717,7 @@ static const union vin_data vin1_data_pins = {
                RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
        },
 };
-static const union vin_data vin1_data_mux = {
+static const union vin_data12 vin1_data_mux = {
        .data12 = {
                VI1_DATA0_MARK, VI1_DATA1_MARK,
                VI1_DATA2_MARK, VI1_DATA3_MARK,
@@ -5215,7 +5215,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
                FN_AVB_MDC, FN_SSI_SDATA6_B, 0, 0, }
        },
        { PINMUX_CFG_REG_VAR("IPSR9", 0xE6060044, 32,
-                            1, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3, 3) {
+                            1, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3) {
                /* IP9_31 [1] */
                0, 0,
                /* IP9_30_28 [3] */
@@ -5563,7 +5563,18 @@ static int r8a7794_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *poc
        return -EINVAL;
 }
 
+static int r8a7794_pinmux_soc_init(struct sh_pfc *pfc)
+{
+       /* Initialize TDSEL on old revisions */
+       if ((rmobile_get_cpu_rev_integer() == 1) &&
+           (rmobile_get_cpu_rev_fraction() == 0))
+               sh_pfc_write(pfc, 0xe6060068, 0x55555500);
+
+       return 0;
+}
+
 static const struct sh_pfc_soc_operations r8a7794_pinmux_ops = {
+       .init = r8a7794_pinmux_soc_init,
        .pin_to_pocctrl = r8a7794_pin_to_pocctrl,
 };
 
index b60134351cbd62ed1a82d46a48b7c027b6036057..89ae6f6ed7dfc441680a082643cf0f9c2c3e3f71 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * R8A7795 ES2.0+ processor support - PFC hardware block.
  *
- * Copyright (C) 2015-2019 Renesas Electronics Corporation
+ * Copyright (C) 2015-2017 Renesas Electronics Corporation
  */
 
 #include <common.h>
 #define GPSR6_0                F_(SSI_SCK01239,                IP14_23_20)
 
 /* GPSR7 */
-#define GPSR7_3                FM(GP7_03)
-#define GPSR7_2                FM(GP7_02)
+#define GPSR7_3                FM(HDMI1_CEC)
+#define GPSR7_2                FM(HDMI0_CEC)
 #define GPSR7_1                FM(AVS2)
 #define GPSR7_0                FM(AVS1)
 
 #define IP16_23_20     FM(SSI_SDATA7)          FM(HCTS2_N_B)   FM(MSIOF1_RXD_C)        F_(0, 0)                        F_(0, 0)        FM(TS_SDEN1_A)  FM(STP_ISEN_1_A)        FM(RIF1_D0_A)   FM(RIF3_D0_A)           F_(0, 0)        FM(TCLK2_A)     F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP16_27_24     FM(SSI_SDATA8)          FM(HRTS2_N_B)   FM(MSIOF1_TXD_C)        F_(0, 0)                        F_(0, 0)        FM(TS_SPSYNC1_A)FM(STP_ISSYNC_1_A)      FM(RIF1_D1_A)   FM(RIF3_D1_A)           F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP16_31_28     FM(SSI_SDATA9_A)        FM(HSCK2_B)     FM(MSIOF1_SS1_C)        FM(HSCK1_A)                     FM(SSI_WS1_B)   FM(SCK1)        FM(STP_IVCXO27_1_A)     FM(SCK5_A)      F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP17_3_0       FM(AUDIO_CLKA_A)        F_(0, 0)        F_(0, 0)                F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP17_3_0       FM(AUDIO_CLKA_A)        F_(0, 0)        F_(0, 0)                F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        FM(CC5_OSCOUT)  F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP17_7_4       FM(AUDIO_CLKB_B)        FM(SCIF_CLK_A)  F_(0, 0)                F_(0, 0)                        F_(0, 0)        F_(0, 0)        FM(STP_IVCXO27_1_D)     FM(REMOCON_A)   F_(0, 0)                F_(0, 0)        FM(TCLK1_A)     F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP17_11_8      FM(USB0_PWEN)           F_(0, 0)        F_(0, 0)                FM(SIM0_RST_C)                  F_(0, 0)        FM(TS_SCK1_D)   FM(STP_ISCLK_1_D)       FM(BPFCLK_B)    FM(RIF3_CLK_B)          F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) FM(HSCK2_C) F_(0, 0) F_(0, 0)
 #define IP17_15_12     FM(USB0_OVC)            F_(0, 0)        F_(0, 0)                FM(SIM0_D_C)                    F_(0, 0)        FM(TS_SDAT1_D)  FM(STP_ISD_1_D)         F_(0, 0)        FM(RIF3_SYNC_B)         F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) FM(HRX2_C) F_(0, 0) F_(0, 0)
@@ -463,7 +463,7 @@ FM(IP16_31_28)      IP16_31_28      FM(IP17_31_28)  IP17_31_28
 #define MOD_SEL0_9_8           FM(SEL_DRIF1_0)         FM(SEL_DRIF1_1)         FM(SEL_DRIF1_2)         F_(0, 0)
 #define MOD_SEL0_7_6           FM(SEL_DRIF0_0)         FM(SEL_DRIF0_1)         FM(SEL_DRIF0_2)         F_(0, 0)
 #define MOD_SEL0_5             FM(SEL_CANFD0_0)        FM(SEL_CANFD0_1)
-#define MOD_SEL0_4_3           FM(SEL_ADGA_0)          FM(SEL_ADGA_1)          FM(SEL_ADGA_2)          FM(SEL_ADGA_3)
+#define MOD_SEL0_4_3           FM(SEL_ADG_A_0)         FM(SEL_ADG_A_1)         FM(SEL_ADG_A_2)         FM(SEL_ADG_A_3)
 
 /* MOD_SEL1 */                 /* 0 */                 /* 1 */                 /* 2 */                 /* 3 */                 /* 4 */                 /* 5 */                 /* 6 */                 /* 7 */
 #define MOD_SEL1_31_30         FM(SEL_TSIF1_0)         FM(SEL_TSIF1_1)         FM(SEL_TSIF1_2)         FM(SEL_TSIF1_3)
@@ -499,8 +499,8 @@ FM(IP16_31_28)      IP16_31_28      FM(IP17_31_28)  IP17_31_28
 #define MOD_SEL2_21            FM(SEL_SSI2_0)          FM(SEL_SSI2_1)
 #define MOD_SEL2_20            FM(SEL_SSI9_0)          FM(SEL_SSI9_1)
 #define MOD_SEL2_19            FM(SEL_TIMER_TMU2_0)    FM(SEL_TIMER_TMU2_1)
-#define MOD_SEL2_18            FM(SEL_ADGB_0)          FM(SEL_ADGB_1)
-#define MOD_SEL2_17            FM(SEL_ADGC_0)          FM(SEL_ADGC_1)
+#define MOD_SEL2_18            FM(SEL_ADG_B_0)         FM(SEL_ADG_B_1)
+#define MOD_SEL2_17            FM(SEL_ADG_C_0)         FM(SEL_ADG_C_1)
 #define MOD_SEL2_0             FM(SEL_VIN4_0)          FM(SEL_VIN4_1)
 
 #define PINMUX_MOD_SELS        \
@@ -552,6 +552,9 @@ MOD_SEL0_4_3                MOD_SEL1_4 \
        FM(DU_DOTCLKIN0) FM(DU_DOTCLKIN1) FM(DU_DOTCLKIN2) FM(DU_DOTCLKIN3) \
        FM(TMS) FM(TDO) FM(ASEBRK) FM(MLB_REF) FM(TDI) FM(TCK) FM(TRST) FM(EXTALR)
 
+#define PINMUX_PHYS \
+       FM(SCL0) FM(SDA0) FM(SCL3) FM(SDA3) FM(SCL5) FM(SDA5)
+
 enum {
        PINMUX_RESERVED = 0,
 
@@ -577,6 +580,7 @@ enum {
        PINMUX_IPSR
        PINMUX_MOD_SELS
        PINMUX_STATIC
+       PINMUX_PHYS
        PINMUX_MARK_END,
 #undef F_
 #undef FM
@@ -588,11 +592,8 @@ static const u16 pinmux_data[] = {
        PINMUX_SINGLE(AVS1),
        PINMUX_SINGLE(AVS2),
        PINMUX_SINGLE(CLKOUT),
-       PINMUX_SINGLE(GP7_02),
-       PINMUX_SINGLE(GP7_03),
-       PINMUX_SINGLE(I2C_SEL_0_1),
-       PINMUX_SINGLE(I2C_SEL_3_1),
-       PINMUX_SINGLE(I2C_SEL_5_1),
+       PINMUX_SINGLE(HDMI0_CEC),
+       PINMUX_SINGLE(HDMI1_CEC),
        PINMUX_SINGLE(MSIOF0_RXD),
        PINMUX_SINGLE(MSIOF0_SCK),
        PINMUX_SINGLE(MSIOF0_TXD),
@@ -616,14 +617,16 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_MSEL(IP0_15_12,     MSIOF2_SCK_C,           SEL_MSIOF2_2),
        PINMUX_IPSR_MSEL(IP0_15_12,     TX4_A,                  SEL_SCIF4_0),
 
-       PINMUX_IPSR_MSEL(IP0_19_16,     AVB_AVTP_MATCH_A,       SEL_ETHERAVB_0),
-       PINMUX_IPSR_MSEL(IP0_19_16,     MSIOF2_RXD_C,           SEL_MSIOF2_2),
-       PINMUX_IPSR_MSEL(IP0_19_16,     CTS4_N_A,               SEL_SCIF4_0),
-       PINMUX_IPSR_GPSR(IP0_19_16,     FSCLKST2_N_A),
+       PINMUX_IPSR_PHYS_MSEL(IP0_19_16, AVB_AVTP_MATCH_A,      I2C_SEL_5_0,    SEL_ETHERAVB_0),
+       PINMUX_IPSR_PHYS_MSEL(IP0_19_16, MSIOF2_RXD_C,          I2C_SEL_5_0,    SEL_MSIOF2_2),
+       PINMUX_IPSR_PHYS_MSEL(IP0_19_16, CTS4_N_A,              I2C_SEL_5_0,    SEL_SCIF4_0),
+       PINMUX_IPSR_MSEL(IP0_19_16,     FSCLKST2_N_A,           I2C_SEL_5_0),
+       PINMUX_IPSR_PHYS(IP0_19_16,     SCL5,                   I2C_SEL_5_1),
 
-       PINMUX_IPSR_MSEL(IP0_23_20,     AVB_AVTP_CAPTURE_A,     SEL_ETHERAVB_0),
-       PINMUX_IPSR_MSEL(IP0_23_20,     MSIOF2_TXD_C,           SEL_MSIOF2_2),
-       PINMUX_IPSR_MSEL(IP0_23_20,     RTS4_N_A,               SEL_SCIF4_0),
+       PINMUX_IPSR_PHYS_MSEL(IP0_23_20, AVB_AVTP_CAPTURE_A,    I2C_SEL_5_0,    SEL_ETHERAVB_0),
+       PINMUX_IPSR_PHYS_MSEL(IP0_23_20, MSIOF2_TXD_C,          I2C_SEL_5_0,    SEL_MSIOF2_2),
+       PINMUX_IPSR_PHYS_MSEL(IP0_23_20, RTS4_N_A,              I2C_SEL_5_0,    SEL_SCIF4_0),
+       PINMUX_IPSR_PHYS(IP0_23_20,     SDA5,                   I2C_SEL_5_1),
 
        PINMUX_IPSR_GPSR(IP0_27_24,     IRQ0),
        PINMUX_IPSR_GPSR(IP0_27_24,     QPOLB),
@@ -676,14 +679,16 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_MSEL(IP1_19_16,     VI4_DATA6_B,            SEL_VIN4_1),
        PINMUX_IPSR_MSEL(IP1_19_16,     IECLK_B,                SEL_IEBUS_1),
 
-       PINMUX_IPSR_MSEL(IP1_23_20,     PWM1_A,                 SEL_PWM1_0),
-       PINMUX_IPSR_MSEL(IP1_23_20,     HRX3_D,                 SEL_HSCIF3_3),
-       PINMUX_IPSR_MSEL(IP1_23_20,     VI4_DATA7_B,            SEL_VIN4_1),
-       PINMUX_IPSR_MSEL(IP1_23_20,     IERX_B,                 SEL_IEBUS_1),
+       PINMUX_IPSR_PHYS_MSEL(IP1_23_20, PWM1_A,                I2C_SEL_3_0,    SEL_PWM1_0),
+       PINMUX_IPSR_PHYS_MSEL(IP1_23_20, HRX3_D,                I2C_SEL_3_0,    SEL_HSCIF3_3),
+       PINMUX_IPSR_PHYS_MSEL(IP1_23_20, VI4_DATA7_B,           I2C_SEL_3_0,    SEL_VIN4_1),
+       PINMUX_IPSR_PHYS_MSEL(IP1_23_20, IERX_B,                I2C_SEL_3_0,    SEL_IEBUS_1),
+       PINMUX_IPSR_PHYS(IP0_23_20,     SCL3,                   I2C_SEL_3_1),
 
-       PINMUX_IPSR_MSEL(IP1_27_24,     PWM2_A,                 SEL_PWM2_0),
-       PINMUX_IPSR_MSEL(IP1_27_24,     HTX3_D,                 SEL_HSCIF3_3),
-       PINMUX_IPSR_MSEL(IP1_27_24,     IETX_B,                 SEL_IEBUS_1),
+       PINMUX_IPSR_PHYS_MSEL(IP1_27_24, PWM2_A,                I2C_SEL_3_0,    SEL_PWM2_0),
+       PINMUX_IPSR_PHYS_MSEL(IP1_27_24, HTX3_D,                I2C_SEL_3_0,    SEL_HSCIF3_3),
+       PINMUX_IPSR_PHYS_MSEL(IP1_27_24, IETX_B,                I2C_SEL_3_0,    SEL_IEBUS_1),
+       PINMUX_IPSR_PHYS(IP1_27_24,     SDA3,                   I2C_SEL_3_1),
 
        PINMUX_IPSR_GPSR(IP1_31_28,     A0),
        PINMUX_IPSR_GPSR(IP1_31_28,     LCDOUT16),
@@ -1115,16 +1120,18 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_GPSR(IP11_15_12,    SD0_WP),
        PINMUX_IPSR_MSEL(IP11_15_12,    SDA2_B,                 SEL_I2C2_1),
 
-       PINMUX_IPSR_GPSR(IP11_19_16,    SD1_CD),
-       PINMUX_IPSR_MSEL(IP11_19_16,    SIM0_CLK_B,             SEL_SIMCARD_1),
+       PINMUX_IPSR_MSEL(IP11_19_16,    SD1_CD,                 I2C_SEL_0_0),
+       PINMUX_IPSR_PHYS_MSEL(IP11_19_16, SIM0_CLK_B,           I2C_SEL_0_0,    SEL_SIMCARD_1),
+       PINMUX_IPSR_PHYS(IP11_19_16,    SCL0,                   I2C_SEL_0_1),
 
-       PINMUX_IPSR_GPSR(IP11_23_20,    SD1_WP),
-       PINMUX_IPSR_MSEL(IP11_23_20,    SIM0_D_B,               SEL_SIMCARD_1),
+       PINMUX_IPSR_MSEL(IP11_23_20,    SD1_WP,                 I2C_SEL_0_0),
+       PINMUX_IPSR_PHYS_MSEL(IP11_23_20, SIM0_D_B,             I2C_SEL_0_0,    SEL_SIMCARD_1),
+       PINMUX_IPSR_PHYS(IP11_23_20,    SDA0,                   I2C_SEL_0_1),
 
        PINMUX_IPSR_GPSR(IP11_27_24,    SCK0),
        PINMUX_IPSR_MSEL(IP11_27_24,    HSCK1_B,                SEL_HSCIF1_1),
        PINMUX_IPSR_MSEL(IP11_27_24,    MSIOF1_SS2_B,           SEL_MSIOF1_1),
-       PINMUX_IPSR_MSEL(IP11_27_24,    AUDIO_CLKC_B,           SEL_ADGC_1),
+       PINMUX_IPSR_MSEL(IP11_27_24,    AUDIO_CLKC_B,           SEL_ADG_C_1),
        PINMUX_IPSR_MSEL(IP11_27_24,    SDA2_A,                 SEL_I2C2_0),
        PINMUX_IPSR_MSEL(IP11_27_24,    SIM0_RST_B,             SEL_SIMCARD_1),
        PINMUX_IPSR_MSEL(IP11_27_24,    STP_OPWM_0_C,           SEL_SSP1_0_2),
@@ -1157,7 +1164,7 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_GPSR(IP12_11_8,     RTS0_N),
        PINMUX_IPSR_MSEL(IP12_11_8,     HRTS1_N_B,              SEL_HSCIF1_1),
        PINMUX_IPSR_MSEL(IP12_11_8,     MSIOF1_SS1_B,           SEL_MSIOF1_1),
-       PINMUX_IPSR_MSEL(IP12_11_8,     AUDIO_CLKA_B,           SEL_ADGA_1),
+       PINMUX_IPSR_MSEL(IP12_11_8,     AUDIO_CLKA_B,           SEL_ADG_A_1),
        PINMUX_IPSR_MSEL(IP12_11_8,     SCL2_A,                 SEL_I2C2_0),
        PINMUX_IPSR_MSEL(IP12_11_8,     STP_IVCXO27_1_C,        SEL_SSP1_1_2),
        PINMUX_IPSR_MSEL(IP12_11_8,     RIF0_SYNC_B,            SEL_DRIF0_1),
@@ -1216,7 +1223,7 @@ static const u16 pinmux_data[] = {
 
        PINMUX_IPSR_GPSR(IP13_11_8,     HSCK0),
        PINMUX_IPSR_MSEL(IP13_11_8,     MSIOF1_SCK_D,           SEL_MSIOF1_3),
-       PINMUX_IPSR_MSEL(IP13_11_8,     AUDIO_CLKB_A,           SEL_ADGB_0),
+       PINMUX_IPSR_MSEL(IP13_11_8,     AUDIO_CLKB_A,           SEL_ADG_B_0),
        PINMUX_IPSR_MSEL(IP13_11_8,     SSI_SDATA1_B,           SEL_SSI1_1),
        PINMUX_IPSR_MSEL(IP13_11_8,     TS_SCK0_D,              SEL_TSIF0_3),
        PINMUX_IPSR_MSEL(IP13_11_8,     STP_ISCLK_0_D,          SEL_SSP1_0_3),
@@ -1263,7 +1270,7 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_GPSR(IP14_3_0,      MSIOF0_SS1),
        PINMUX_IPSR_MSEL(IP14_3_0,      RX5_A,                  SEL_SCIF5_0),
        PINMUX_IPSR_GPSR(IP14_3_0,      NFWP_N_A),
-       PINMUX_IPSR_MSEL(IP14_3_0,      AUDIO_CLKA_C,           SEL_ADGA_2),
+       PINMUX_IPSR_MSEL(IP14_3_0,      AUDIO_CLKA_C,           SEL_ADG_A_2),
        PINMUX_IPSR_MSEL(IP14_3_0,      SSI_SCK2_A,             SEL_SSI2_0),
        PINMUX_IPSR_MSEL(IP14_3_0,      STP_IVCXO27_0_C,        SEL_SSP1_0_2),
        PINMUX_IPSR_GPSR(IP14_3_0,      AUDIO_CLKOUT3_A),
@@ -1272,7 +1279,7 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_GPSR(IP14_7_4,      MSIOF0_SS2),
        PINMUX_IPSR_MSEL(IP14_7_4,      TX5_A,                  SEL_SCIF5_0),
        PINMUX_IPSR_MSEL(IP14_7_4,      MSIOF1_SS2_D,           SEL_MSIOF1_3),
-       PINMUX_IPSR_MSEL(IP14_7_4,      AUDIO_CLKC_A,           SEL_ADGC_0),
+       PINMUX_IPSR_MSEL(IP14_7_4,      AUDIO_CLKC_A,           SEL_ADG_C_0),
        PINMUX_IPSR_MSEL(IP14_7_4,      SSI_WS2_A,              SEL_SSI2_0),
        PINMUX_IPSR_MSEL(IP14_7_4,      STP_OPWM_0_D,           SEL_SSP1_0_3),
        PINMUX_IPSR_GPSR(IP14_7_4,      AUDIO_CLKOUT_D),
@@ -1403,9 +1410,10 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_MSEL(IP16_31_28,    SCK5_A,                 SEL_SCIF5_0),
 
        /* IPSR17 */
-       PINMUX_IPSR_MSEL(IP17_3_0,      AUDIO_CLKA_A,           SEL_ADGA_0),
+       PINMUX_IPSR_MSEL(IP17_3_0,      AUDIO_CLKA_A,           SEL_ADG_A_0),
+       PINMUX_IPSR_GPSR(IP17_3_0,      CC5_OSCOUT),
 
-       PINMUX_IPSR_MSEL(IP17_7_4,      AUDIO_CLKB_B,           SEL_ADGB_1),
+       PINMUX_IPSR_MSEL(IP17_7_4,      AUDIO_CLKB_B,           SEL_ADG_B_1),
        PINMUX_IPSR_MSEL(IP17_7_4,      SCIF_CLK_A,             SEL_SCIF_0),
        PINMUX_IPSR_MSEL(IP17_7_4,      STP_IVCXO27_1_D,        SEL_SSP1_1_3),
        PINMUX_IPSR_MSEL(IP17_7_4,      REMOCON_A,              SEL_REMOCON_0),
@@ -1491,10 +1499,10 @@ static const u16 pinmux_data[] = {
 
 /*
  * Static pins can not be muxed between different functions but
- * still needs a mark entry in the pinmux list. Add each static
+ * still need mark entries in the pinmux list. Add each static
  * pin to the list without an associated function. The sh-pfc
- * core will do the right thing and skip trying to mux then pin
- * while still applying configuration to it
+ * core will do the right thing and skip trying to mux the pin
+ * while still applying configuration to it.
  */
 #define FM(x)  PINMUX_DATA(x##_MARK, 0),
        PINMUX_STATIC
@@ -2125,23 +2133,20 @@ static const unsigned int du_disp_mux[] = {
        DU_DISP_MARK,
 };
 
-/* - GP7_02/03 -------------------------------------------------------------- */
-static const unsigned int gp7_02_pins[] = {
-       /* GP7_02 */
+/* - HDMI ------------------------------------------------------------------- */
+static const unsigned int hdmi0_cec_pins[] = {
+       /* HDMI0_CEC */
        RCAR_GP_PIN(7, 2),
 };
-
-static const unsigned int gp7_02_mux[] = {
-       GP7_02_MARK,
+static const unsigned int hdmi0_cec_mux[] = {
+       HDMI0_CEC_MARK,
 };
-
-static const unsigned int gp7_03_pins[] = {
-       /* GP7_03 */
+static const unsigned int hdmi1_cec_pins[] = {
+       /* HDMI1_CEC */
        RCAR_GP_PIN(7, 3),
 };
-
-static const unsigned int gp7_03_mux[] = {
-       GP7_03_MARK,
+static const unsigned int hdmi1_cec_mux[] = {
+       HDMI1_CEC_MARK,
 };
 
 /* - HSCIF0 ----------------------------------------------------------------- */
@@ -2352,6 +2357,15 @@ static const unsigned int hscif4_data_b_mux[] = {
 };
 
 /* - I2C -------------------------------------------------------------------- */
+static const unsigned int i2c0_pins[] = {
+       /* SCL, SDA */
+       RCAR_GP_PIN(3, 14), RCAR_GP_PIN(3, 15),
+};
+
+static const unsigned int i2c0_mux[] = {
+       SCL0_MARK, SDA0_MARK,
+};
+
 static const unsigned int i2c1_a_pins[] = {
        /* SDA, SCL */
        RCAR_GP_PIN(5, 11), RCAR_GP_PIN(5, 10),
@@ -2380,6 +2394,25 @@ static const unsigned int i2c2_b_pins[] = {
 static const unsigned int i2c2_b_mux[] = {
        SDA2_B_MARK, SCL2_B_MARK,
 };
+
+static const unsigned int i2c3_pins[] = {
+       /* SCL, SDA */
+       RCAR_GP_PIN(2, 7), RCAR_GP_PIN(2, 8),
+};
+
+static const unsigned int i2c3_mux[] = {
+       SCL3_MARK, SDA3_MARK,
+};
+
+static const unsigned int i2c5_pins[] = {
+       /* SCL, SDA */
+       RCAR_GP_PIN(2, 13), RCAR_GP_PIN(2, 14),
+};
+
+static const unsigned int i2c5_mux[] = {
+       SCL5_MARK, SDA5_MARK,
+};
+
 static const unsigned int i2c6_a_pins[] = {
        /* SDA, SCL */
        RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 11),
@@ -3123,7 +3156,7 @@ static const unsigned int msiof3_ss1_e_mux[] = {
        MSIOF3_SS1_E_MARK,
 };
 static const unsigned int msiof3_ss2_e_pins[] = {
-       /* SS1 */
+       /* SS2 */
        RCAR_GP_PIN(2, 0),
 };
 static const unsigned int msiof3_ss2_e_mux[] = {
@@ -4067,67 +4100,29 @@ static const unsigned int vin4_clk_mux[] = {
 };
 
 /* - VIN5 ------------------------------------------------------------------- */
-static const unsigned int vin5_data8_pins[] = {
-       RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1),
-       RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
-       RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
-       RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
-};
-static const unsigned int vin5_data8_mux[] = {
-       VI5_DATA0_MARK, VI5_DATA1_MARK,
-       VI5_DATA2_MARK, VI5_DATA3_MARK,
-       VI5_DATA4_MARK, VI5_DATA5_MARK,
-       VI5_DATA6_MARK, VI5_DATA7_MARK,
-};
-static const unsigned int vin5_data10_pins[] = {
-       RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1),
-       RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
-       RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
-       RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
-       RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
-};
-static const unsigned int vin5_data10_mux[] = {
-       VI5_DATA0_MARK, VI5_DATA1_MARK,
-       VI5_DATA2_MARK, VI5_DATA3_MARK,
-       VI5_DATA4_MARK, VI5_DATA5_MARK,
-       VI5_DATA6_MARK, VI5_DATA7_MARK,
-       VI5_DATA8_MARK,  VI5_DATA9_MARK,
-};
-static const unsigned int vin5_data12_pins[] = {
-       RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1),
-       RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
-       RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
-       RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
-       RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
-       RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 15),
-};
-static const unsigned int vin5_data12_mux[] = {
-       VI5_DATA0_MARK, VI5_DATA1_MARK,
-       VI5_DATA2_MARK, VI5_DATA3_MARK,
-       VI5_DATA4_MARK, VI5_DATA5_MARK,
-       VI5_DATA6_MARK, VI5_DATA7_MARK,
-       VI5_DATA8_MARK,  VI5_DATA9_MARK,
-       VI5_DATA10_MARK, VI5_DATA11_MARK,
-};
-static const unsigned int vin5_data16_pins[] = {
-       RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1),
-       RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
-       RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
-       RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
-       RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
-       RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 15),
-       RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5),
-       RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7),
+static const union vin_data16 vin5_data_pins = {
+       .data16 = {
+               RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1),
+               RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
+               RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
+               RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
+               RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
+               RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 15),
+               RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5),
+               RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7),
+       },
 };
-static const unsigned int vin5_data16_mux[] = {
-       VI5_DATA0_MARK, VI5_DATA1_MARK,
-       VI5_DATA2_MARK, VI5_DATA3_MARK,
-       VI5_DATA4_MARK, VI5_DATA5_MARK,
-       VI5_DATA6_MARK, VI5_DATA7_MARK,
-       VI5_DATA8_MARK,  VI5_DATA9_MARK,
-       VI5_DATA10_MARK, VI5_DATA11_MARK,
-       VI5_DATA12_MARK, VI5_DATA13_MARK,
-       VI5_DATA14_MARK, VI5_DATA15_MARK,
+static const union vin_data16 vin5_data_mux = {
+       .data16 = {
+               VI5_DATA0_MARK, VI5_DATA1_MARK,
+               VI5_DATA2_MARK, VI5_DATA3_MARK,
+               VI5_DATA4_MARK, VI5_DATA5_MARK,
+               VI5_DATA6_MARK, VI5_DATA7_MARK,
+               VI5_DATA8_MARK,  VI5_DATA9_MARK,
+               VI5_DATA10_MARK, VI5_DATA11_MARK,
+               VI5_DATA12_MARK, VI5_DATA13_MARK,
+               VI5_DATA14_MARK, VI5_DATA15_MARK,
+       },
 };
 static const unsigned int vin5_sync_pins[] = {
        /* HSYNC#, VSYNC# */
@@ -4232,8 +4227,8 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
        SH_PFC_PIN_GROUP(du_oddf),
        SH_PFC_PIN_GROUP(du_cde),
        SH_PFC_PIN_GROUP(du_disp),
-       SH_PFC_PIN_GROUP(gp7_02),
-       SH_PFC_PIN_GROUP(gp7_03),
+       SH_PFC_PIN_GROUP(hdmi0_cec),
+       SH_PFC_PIN_GROUP(hdmi1_cec),
        SH_PFC_PIN_GROUP(hscif0_data),
        SH_PFC_PIN_GROUP(hscif0_clk),
        SH_PFC_PIN_GROUP(hscif0_ctrl),
@@ -4262,10 +4257,13 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
        SH_PFC_PIN_GROUP(hscif4_clk),
        SH_PFC_PIN_GROUP(hscif4_ctrl),
        SH_PFC_PIN_GROUP(hscif4_data_b),
+       SH_PFC_PIN_GROUP(i2c0),
        SH_PFC_PIN_GROUP(i2c1_a),
        SH_PFC_PIN_GROUP(i2c1_b),
        SH_PFC_PIN_GROUP(i2c2_a),
        SH_PFC_PIN_GROUP(i2c2_b),
+       SH_PFC_PIN_GROUP(i2c3),
+       SH_PFC_PIN_GROUP(i2c5),
        SH_PFC_PIN_GROUP(i2c6_a),
        SH_PFC_PIN_GROUP(i2c6_b),
        SH_PFC_PIN_GROUP(i2c6_c),
@@ -4478,28 +4476,28 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
        SH_PFC_PIN_GROUP(usb2),
        SH_PFC_PIN_GROUP(usb2_ch3),
        SH_PFC_PIN_GROUP(usb30),
-       VIN_DATA_PIN_GROUP(vin4_data_a, 8),
-       VIN_DATA_PIN_GROUP(vin4_data_a, 10),
-       VIN_DATA_PIN_GROUP(vin4_data_a, 12),
-       VIN_DATA_PIN_GROUP(vin4_data_a, 16),
+       VIN_DATA_PIN_GROUP(vin4_data, 8, _a),
+       VIN_DATA_PIN_GROUP(vin4_data, 10, _a),
+       VIN_DATA_PIN_GROUP(vin4_data, 12, _a),
+       VIN_DATA_PIN_GROUP(vin4_data, 16, _a),
        SH_PFC_PIN_GROUP(vin4_data18_a),
-       VIN_DATA_PIN_GROUP(vin4_data_a, 20),
-       VIN_DATA_PIN_GROUP(vin4_data_a, 24),
-       VIN_DATA_PIN_GROUP(vin4_data_b, 8),
-       VIN_DATA_PIN_GROUP(vin4_data_b, 10),
-       VIN_DATA_PIN_GROUP(vin4_data_b, 12),
-       VIN_DATA_PIN_GROUP(vin4_data_b, 16),
+       VIN_DATA_PIN_GROUP(vin4_data, 20, _a),
+       VIN_DATA_PIN_GROUP(vin4_data, 24, _a),
+       VIN_DATA_PIN_GROUP(vin4_data, 8, _b),
+       VIN_DATA_PIN_GROUP(vin4_data, 10, _b),
+       VIN_DATA_PIN_GROUP(vin4_data, 12, _b),
+       VIN_DATA_PIN_GROUP(vin4_data, 16, _b),
        SH_PFC_PIN_GROUP(vin4_data18_b),
-       VIN_DATA_PIN_GROUP(vin4_data_b, 20),
-       VIN_DATA_PIN_GROUP(vin4_data_b, 24),
+       VIN_DATA_PIN_GROUP(vin4_data, 20, _b),
+       VIN_DATA_PIN_GROUP(vin4_data, 24, _b),
        SH_PFC_PIN_GROUP(vin4_sync),
        SH_PFC_PIN_GROUP(vin4_field),
        SH_PFC_PIN_GROUP(vin4_clkenb),
        SH_PFC_PIN_GROUP(vin4_clk),
-       SH_PFC_PIN_GROUP(vin5_data8),
-       SH_PFC_PIN_GROUP(vin5_data10),
-       SH_PFC_PIN_GROUP(vin5_data12),
-       SH_PFC_PIN_GROUP(vin5_data16),
+       VIN_DATA_PIN_GROUP(vin5_data, 8),
+       VIN_DATA_PIN_GROUP(vin5_data, 10),
+       VIN_DATA_PIN_GROUP(vin5_data, 12),
+       VIN_DATA_PIN_GROUP(vin5_data, 16),
        SH_PFC_PIN_GROUP(vin5_sync),
        SH_PFC_PIN_GROUP(vin5_field),
        SH_PFC_PIN_GROUP(vin5_clkenb),
@@ -4615,12 +4613,12 @@ static const char * const du_groups[] = {
        "du_disp",
 };
 
-static const char * const gp7_02_groups[] = {
-       "gp7_02",
+static const char * const hdmi0_groups[] = {
+       "hdmi0_cec",
 };
 
-static const char * const gp7_03_groups[] = {
-       "gp7_03",
+static const char * const hdmi1_groups[] = {
+       "hdmi1_cec",
 };
 
 static const char * const hscif0_groups[] = {
@@ -4666,6 +4664,10 @@ static const char * const hscif4_groups[] = {
        "hscif4_data_b",
 };
 
+static const char * const i2c0_groups[] = {
+       "i2c0",
+};
+
 static const char * const i2c1_groups[] = {
        "i2c1_a",
        "i2c1_b",
@@ -4676,6 +4678,14 @@ static const char * const i2c2_groups[] = {
        "i2c2_b",
 };
 
+static const char * const i2c3_groups[] = {
+       "i2c3",
+};
+
+static const char * const i2c5_groups[] = {
+       "i2c5",
+};
+
 static const char * const i2c6_groups[] = {
        "i2c6_a",
        "i2c6_b",
@@ -5029,15 +5039,18 @@ static const struct sh_pfc_function pinmux_functions[] = {
        SH_PFC_FUNCTION(drif2),
        SH_PFC_FUNCTION(drif3),
        SH_PFC_FUNCTION(du),
-       SH_PFC_FUNCTION(gp7_02),
-       SH_PFC_FUNCTION(gp7_03),
+       SH_PFC_FUNCTION(hdmi0),
+       SH_PFC_FUNCTION(hdmi1),
        SH_PFC_FUNCTION(hscif0),
        SH_PFC_FUNCTION(hscif1),
        SH_PFC_FUNCTION(hscif2),
        SH_PFC_FUNCTION(hscif3),
        SH_PFC_FUNCTION(hscif4),
+       SH_PFC_FUNCTION(i2c0),
        SH_PFC_FUNCTION(i2c1),
        SH_PFC_FUNCTION(i2c2),
+       SH_PFC_FUNCTION(i2c3),
+       SH_PFC_FUNCTION(i2c5),
        SH_PFC_FUNCTION(i2c6),
        SH_PFC_FUNCTION(intc_ex),
        SH_PFC_FUNCTION(msiof0),
@@ -5751,8 +5764,8 @@ static const struct pinmux_drive_reg pinmux_drive_regs[] = {
                { RCAR_GP_PIN(0, 15),   24, 3 },        /* D15 */
                { RCAR_GP_PIN(7,  0),   20, 3 },        /* AVS1 */
                { RCAR_GP_PIN(7,  1),   16, 3 },        /* AVS2 */
-               { RCAR_GP_PIN(7,  2),   12, 3 },        /* GP7_02 */
-               { RCAR_GP_PIN(7,  3),    8, 3 },        /* GP7_03 */
+               { RCAR_GP_PIN(7,  2),   12, 3 },        /* HDMI0_CEC */
+               { RCAR_GP_PIN(7,  3),    8, 3 },        /* HDMI1_CEC */
                { PIN_A_NUMBER('P', 7),  4, 2 },        /* DU_DOTCLKIN0 */
                { PIN_A_NUMBER('P', 8),  0, 2 },        /* DU_DOTCLKIN1 */
        } },
@@ -6006,8 +6019,8 @@ static const struct pinmux_bias_reg pinmux_bias_regs[] = {
                [25] = RCAR_GP_PIN(0, 15),      /* D15 */
                [26] = RCAR_GP_PIN(7,  0),      /* AVS1 */
                [27] = RCAR_GP_PIN(7,  1),      /* AVS2 */
-               [28] = RCAR_GP_PIN(7,  2),      /* GP7_02 */
-               [29] = RCAR_GP_PIN(7,  3),      /* GP7_03 */
+               [28] = RCAR_GP_PIN(7,  2),      /* HDMI0_CEC */
+               [29] = RCAR_GP_PIN(7,  3),      /* HDMI1_CEC */
                [30] = PIN_A_NUMBER('P', 7),    /* DU_DOTCLKIN0 */
                [31] = PIN_A_NUMBER('P', 8),    /* DU_DOTCLKIN1 */
        } },
index 90dbf3994a68c85713c1d029cf721fe1f19de5ce..24fbbf19aa967d81a04ca75253cacf31ee35f8c4 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * R8A7796 processor support - PFC hardware block.
  *
- * Copyright (C) 2016 Renesas Electronics Corp.
+ * Copyright (C) 2016-2017 Renesas Electronics Corp.
  *
  * This file is based on the drivers/pinctrl/sh-pfc/pfc-r8a7795.c
  *
 
 /* GPSR7 */
 #define GPSR7_3                FM(GP7_03)
-#define GPSR7_2                FM(GP7_02)
+#define GPSR7_2                FM(HDMI0_CEC)
 #define GPSR7_1                FM(AVS2)
 #define GPSR7_0                FM(AVS1)
 
 #define IP16_23_20     FM(SSI_SDATA7)          FM(HCTS2_N_B)   FM(MSIOF1_RXD_C)        F_(0, 0)                        F_(0, 0)        FM(TS_SDEN1_A)  FM(STP_ISEN_1_A)        FM(RIF1_D0_A)   FM(RIF3_D0_A)           F_(0, 0)        FM(TCLK2_A)     F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP16_27_24     FM(SSI_SDATA8)          FM(HRTS2_N_B)   FM(MSIOF1_TXD_C)        F_(0, 0)                        F_(0, 0)        FM(TS_SPSYNC1_A)FM(STP_ISSYNC_1_A)      FM(RIF1_D1_A)   FM(RIF3_D1_A)           F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP16_31_28     FM(SSI_SDATA9_A)        FM(HSCK2_B)     FM(MSIOF1_SS1_C)        FM(HSCK1_A)                     FM(SSI_WS1_B)   FM(SCK1)        FM(STP_IVCXO27_1_A)     FM(SCK5_A)      F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP17_3_0       FM(AUDIO_CLKA_A)        F_(0, 0)        F_(0, 0)                F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP17_3_0       FM(AUDIO_CLKA_A)        F_(0, 0)        F_(0, 0)                F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        FM(CC5_OSCOUT)  F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP17_7_4       FM(AUDIO_CLKB_B)        FM(SCIF_CLK_A)  F_(0, 0)                F_(0, 0)                        F_(0, 0)        F_(0, 0)        FM(STP_IVCXO27_1_D)     FM(REMOCON_A)   F_(0, 0)                F_(0, 0)        FM(TCLK1_A)     F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP17_11_8      FM(USB0_PWEN)           F_(0, 0)        F_(0, 0)                FM(SIM0_RST_C)                  F_(0, 0)        FM(TS_SCK1_D)   FM(STP_ISCLK_1_D)       FM(BPFCLK_B)    FM(RIF3_CLK_B)          F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) FM(HSCK2_C) F_(0, 0) F_(0, 0)
 #define IP17_15_12     FM(USB0_OVC)            F_(0, 0)        F_(0, 0)                FM(SIM0_D_C)                    F_(0, 0)        FM(TS_SDAT1_D)  FM(STP_ISD_1_D)         F_(0, 0)        FM(RIF3_SYNC_B)         F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) FM(HRX2_C) F_(0, 0) F_(0, 0)
@@ -469,7 +469,7 @@ FM(IP16_31_28)      IP16_31_28      FM(IP17_31_28)  IP17_31_28
 #define MOD_SEL0_9_8           FM(SEL_DRIF1_0)         FM(SEL_DRIF1_1)         FM(SEL_DRIF1_2)         F_(0, 0)
 #define MOD_SEL0_7_6           FM(SEL_DRIF0_0)         FM(SEL_DRIF0_1)         FM(SEL_DRIF0_2)         F_(0, 0)
 #define MOD_SEL0_5             FM(SEL_CANFD0_0)        FM(SEL_CANFD0_1)
-#define MOD_SEL0_4_3           FM(SEL_ADGA_0)          FM(SEL_ADGA_1)          FM(SEL_ADGA_2)          FM(SEL_ADGA_3)
+#define MOD_SEL0_4_3           FM(SEL_ADG_A_0)         FM(SEL_ADG_A_1)         FM(SEL_ADG_A_2)         FM(SEL_ADG_A_3)
 
 /* MOD_SEL1 */                 /* 0 */                 /* 1 */                 /* 2 */                 /* 3 */                 /* 4 */                 /* 5 */                 /* 6 */                 /* 7 */
 #define MOD_SEL1_31_30         FM(SEL_TSIF1_0)         FM(SEL_TSIF1_1)         FM(SEL_TSIF1_2)         FM(SEL_TSIF1_3)
@@ -502,12 +502,12 @@ FM(IP16_31_28)    IP16_31_28      FM(IP17_31_28)  IP17_31_28
 #define MOD_SEL2_28_27         FM(SEL_FM_0)            FM(SEL_FM_1)            FM(SEL_FM_2)            FM(SEL_FM_3)
 #define MOD_SEL2_26            FM(SEL_SCIF5_0)         FM(SEL_SCIF5_1)
 #define MOD_SEL2_25_24_23      FM(SEL_I2C6_0)          FM(SEL_I2C6_1)          FM(SEL_I2C6_2)          F_(0, 0)                F_(0, 0)                F_(0, 0)                F_(0, 0)                F_(0, 0)
-#define MOD_SEL2_22            FM(SEL_NDF_0)           FM(SEL_NDF_1)
+#define MOD_SEL2_22            FM(SEL_NDFC_0)          FM(SEL_NDFC_1)
 #define MOD_SEL2_21            FM(SEL_SSI2_0)          FM(SEL_SSI2_1)
 #define MOD_SEL2_20            FM(SEL_SSI9_0)          FM(SEL_SSI9_1)
 #define MOD_SEL2_19            FM(SEL_TIMER_TMU2_0)    FM(SEL_TIMER_TMU2_1)
-#define MOD_SEL2_18            FM(SEL_ADGB_0)          FM(SEL_ADGB_1)
-#define MOD_SEL2_17            FM(SEL_ADGC_0)          FM(SEL_ADGC_1)
+#define MOD_SEL2_18            FM(SEL_ADG_B_0)         FM(SEL_ADG_B_1)
+#define MOD_SEL2_17            FM(SEL_ADG_C_0)         FM(SEL_ADG_C_1)
 #define MOD_SEL2_0             FM(SEL_VIN4_0)          FM(SEL_VIN4_1)
 
 #define PINMUX_MOD_SELS        \
@@ -559,6 +559,9 @@ MOD_SEL0_4_3                MOD_SEL1_4 \
        FM(DU_DOTCLKIN0) FM(DU_DOTCLKIN1) FM(DU_DOTCLKIN2) \
        FM(TMS) FM(TDO) FM(ASEBRK) FM(MLB_REF) FM(TDI) FM(TCK) FM(TRST) FM(EXTALR)
 
+#define PINMUX_PHYS \
+       FM(SCL0) FM(SDA0) FM(SCL3) FM(SDA3) FM(SCL5) FM(SDA5)
+
 enum {
        PINMUX_RESERVED = 0,
 
@@ -584,6 +587,7 @@ enum {
        PINMUX_IPSR
        PINMUX_MOD_SELS
        PINMUX_STATIC
+       PINMUX_PHYS
        PINMUX_MARK_END,
 #undef F_
 #undef FM
@@ -596,7 +600,7 @@ static const u16 pinmux_data[] = {
        PINMUX_SINGLE(AVS2),
        PINMUX_SINGLE(CLKOUT),
        PINMUX_SINGLE(GP7_03),
-       PINMUX_SINGLE(GP7_02),
+       PINMUX_SINGLE(HDMI0_CEC),
        PINMUX_SINGLE(MSIOF0_RXD),
        PINMUX_SINGLE(MSIOF0_SCK),
        PINMUX_SINGLE(MSIOF0_TXD),
@@ -620,13 +624,15 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_MSEL(IP0_15_12,     MSIOF2_SCK_C,           SEL_MSIOF2_2),
        PINMUX_IPSR_MSEL(IP0_15_12,     TX4_A,                  SEL_SCIF4_0),
 
-       PINMUX_IPSR_MSEL(IP0_19_16,     AVB_AVTP_MATCH_A,       SEL_ETHERAVB_0),
-       PINMUX_IPSR_MSEL(IP0_19_16,     MSIOF2_RXD_C,           SEL_MSIOF2_2),
-       PINMUX_IPSR_MSEL(IP0_19_16,     CTS4_N_A,               SEL_SCIF4_0),
+       PINMUX_IPSR_PHYS_MSEL(IP0_19_16, AVB_AVTP_MATCH_A,      I2C_SEL_5_0,    SEL_ETHERAVB_0),
+       PINMUX_IPSR_PHYS_MSEL(IP0_19_16, MSIOF2_RXD_C,          I2C_SEL_5_0,    SEL_MSIOF2_2),
+       PINMUX_IPSR_PHYS_MSEL(IP0_19_16, CTS4_N_A,              I2C_SEL_5_0,    SEL_SCIF4_0),
+       PINMUX_IPSR_PHYS(IP0_19_16,     SCL5,                   I2C_SEL_5_1),
 
-       PINMUX_IPSR_MSEL(IP0_23_20,     AVB_AVTP_CAPTURE_A,     SEL_ETHERAVB_0),
-       PINMUX_IPSR_MSEL(IP0_23_20,     MSIOF2_TXD_C,           SEL_MSIOF2_2),
-       PINMUX_IPSR_MSEL(IP0_23_20,     RTS4_N_A,               SEL_SCIF4_0),
+       PINMUX_IPSR_PHYS_MSEL(IP0_23_20, AVB_AVTP_CAPTURE_A,    I2C_SEL_5_0,    SEL_ETHERAVB_0),
+       PINMUX_IPSR_PHYS_MSEL(IP0_23_20, MSIOF2_TXD_C,          I2C_SEL_5_0,    SEL_MSIOF2_2),
+       PINMUX_IPSR_PHYS_MSEL(IP0_23_20, RTS4_N_A,              I2C_SEL_5_0,    SEL_SCIF4_0),
+       PINMUX_IPSR_PHYS(IP0_23_20,     SDA5,                   I2C_SEL_5_1),
 
        PINMUX_IPSR_GPSR(IP0_27_24,     IRQ0),
        PINMUX_IPSR_GPSR(IP0_27_24,     QPOLB),
@@ -678,14 +684,16 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_MSEL(IP1_19_16,     VI4_DATA6_B,            SEL_VIN4_1),
        PINMUX_IPSR_MSEL(IP1_19_16,     IECLK_B,                SEL_IEBUS_1),
 
-       PINMUX_IPSR_MSEL(IP1_23_20,     PWM1_A,                 SEL_PWM1_0),
-       PINMUX_IPSR_MSEL(IP1_23_20,     HRX3_D,                 SEL_HSCIF3_3),
-       PINMUX_IPSR_MSEL(IP1_23_20,     VI4_DATA7_B,            SEL_VIN4_1),
-       PINMUX_IPSR_MSEL(IP1_23_20,     IERX_B,                 SEL_IEBUS_1),
+       PINMUX_IPSR_PHYS_MSEL(IP1_23_20, PWM1_A,                I2C_SEL_3_0,    SEL_PWM1_0),
+       PINMUX_IPSR_PHYS_MSEL(IP1_23_20, HRX3_D,                I2C_SEL_3_0,    SEL_HSCIF3_3),
+       PINMUX_IPSR_PHYS_MSEL(IP1_23_20, VI4_DATA7_B,           I2C_SEL_3_0,    SEL_VIN4_1),
+       PINMUX_IPSR_PHYS_MSEL(IP1_23_20, IERX_B,                I2C_SEL_3_0,    SEL_IEBUS_1),
+       PINMUX_IPSR_PHYS(IP0_23_20,     SCL3,                   I2C_SEL_3_1),
 
-       PINMUX_IPSR_MSEL(IP1_27_24,     PWM2_A,                 SEL_PWM2_0),
-       PINMUX_IPSR_MSEL(IP1_27_24,     HTX3_D,                 SEL_HSCIF3_3),
-       PINMUX_IPSR_MSEL(IP1_27_24,     IETX_B,                 SEL_IEBUS_1),
+       PINMUX_IPSR_PHYS_MSEL(IP1_27_24, PWM2_A,                I2C_SEL_3_0,    SEL_PWM2_0),
+       PINMUX_IPSR_PHYS_MSEL(IP1_27_24, HTX3_D,                I2C_SEL_3_0,    SEL_HSCIF3_3),
+       PINMUX_IPSR_PHYS_MSEL(IP1_27_24, IETX_B,                I2C_SEL_3_0,    SEL_IEBUS_1),
+       PINMUX_IPSR_PHYS(IP1_27_24,     SDA3,                   I2C_SEL_3_1),
 
        PINMUX_IPSR_GPSR(IP1_31_28,     A0),
        PINMUX_IPSR_GPSR(IP1_31_28,     LCDOUT16),
@@ -1016,35 +1024,35 @@ static const u16 pinmux_data[] = {
 
        PINMUX_IPSR_GPSR(IP8_15_12,     SD1_CMD),
        PINMUX_IPSR_MSEL(IP8_15_12,     MSIOF1_SYNC_G,          SEL_MSIOF1_6),
-       PINMUX_IPSR_MSEL(IP8_15_12,     NFCE_N_B,               SEL_NDF_1),
+       PINMUX_IPSR_MSEL(IP8_15_12,     NFCE_N_B,               SEL_NDFC_1),
        PINMUX_IPSR_MSEL(IP8_15_12,     SIM0_D_A,               SEL_SIMCARD_0),
        PINMUX_IPSR_MSEL(IP8_15_12,     STP_IVCXO27_1_B,        SEL_SSP1_1_1),
 
        PINMUX_IPSR_GPSR(IP8_19_16,     SD1_DAT0),
        PINMUX_IPSR_GPSR(IP8_19_16,     SD2_DAT4),
        PINMUX_IPSR_MSEL(IP8_19_16,     MSIOF1_RXD_G,           SEL_MSIOF1_6),
-       PINMUX_IPSR_MSEL(IP8_19_16,     NFWP_N_B,               SEL_NDF_1),
+       PINMUX_IPSR_MSEL(IP8_19_16,     NFWP_N_B,               SEL_NDFC_1),
        PINMUX_IPSR_MSEL(IP8_19_16,     TS_SCK1_B,              SEL_TSIF1_1),
        PINMUX_IPSR_MSEL(IP8_19_16,     STP_ISCLK_1_B,          SEL_SSP1_1_1),
 
        PINMUX_IPSR_GPSR(IP8_23_20,     SD1_DAT1),
        PINMUX_IPSR_GPSR(IP8_23_20,     SD2_DAT5),
        PINMUX_IPSR_MSEL(IP8_23_20,     MSIOF1_TXD_G,           SEL_MSIOF1_6),
-       PINMUX_IPSR_MSEL(IP8_23_20,     NFDATA14_B,             SEL_NDF_1),
+       PINMUX_IPSR_MSEL(IP8_23_20,     NFDATA14_B,             SEL_NDFC_1),
        PINMUX_IPSR_MSEL(IP8_23_20,     TS_SPSYNC1_B,           SEL_TSIF1_1),
        PINMUX_IPSR_MSEL(IP8_23_20,     STP_ISSYNC_1_B,         SEL_SSP1_1_1),
 
        PINMUX_IPSR_GPSR(IP8_27_24,     SD1_DAT2),
        PINMUX_IPSR_GPSR(IP8_27_24,     SD2_DAT6),
        PINMUX_IPSR_MSEL(IP8_27_24,     MSIOF1_SS1_G,           SEL_MSIOF1_6),
-       PINMUX_IPSR_MSEL(IP8_27_24,     NFDATA15_B,             SEL_NDF_1),
+       PINMUX_IPSR_MSEL(IP8_27_24,     NFDATA15_B,             SEL_NDFC_1),
        PINMUX_IPSR_MSEL(IP8_27_24,     TS_SDAT1_B,             SEL_TSIF1_1),
        PINMUX_IPSR_MSEL(IP8_27_24,     STP_ISD_1_B,            SEL_SSP1_1_1),
 
        PINMUX_IPSR_GPSR(IP8_31_28,     SD1_DAT3),
        PINMUX_IPSR_GPSR(IP8_31_28,     SD2_DAT7),
        PINMUX_IPSR_MSEL(IP8_31_28,     MSIOF1_SS2_G,           SEL_MSIOF1_6),
-       PINMUX_IPSR_MSEL(IP8_31_28,     NFRB_N_B,               SEL_NDF_1),
+       PINMUX_IPSR_MSEL(IP8_31_28,     NFRB_N_B,               SEL_NDFC_1),
        PINMUX_IPSR_MSEL(IP8_31_28,     TS_SDEN1_B,             SEL_TSIF1_1),
        PINMUX_IPSR_MSEL(IP8_31_28,     STP_ISEN_1_B,           SEL_SSP1_1_1),
 
@@ -1110,26 +1118,28 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_GPSR(IP11_7_4,      NFCLE),
 
        PINMUX_IPSR_GPSR(IP11_11_8,     SD0_CD),
-       PINMUX_IPSR_MSEL(IP11_11_8,     NFDATA14_A,             SEL_NDF_0),
+       PINMUX_IPSR_MSEL(IP11_11_8,     NFDATA14_A,             SEL_NDFC_0),
        PINMUX_IPSR_MSEL(IP11_11_8,     SCL2_B,                 SEL_I2C2_1),
        PINMUX_IPSR_MSEL(IP11_11_8,     SIM0_RST_A,             SEL_SIMCARD_0),
 
        PINMUX_IPSR_GPSR(IP11_15_12,    SD0_WP),
-       PINMUX_IPSR_MSEL(IP11_15_12,    NFDATA15_A,             SEL_NDF_0),
+       PINMUX_IPSR_MSEL(IP11_15_12,    NFDATA15_A,             SEL_NDFC_0),
        PINMUX_IPSR_MSEL(IP11_15_12,    SDA2_B,                 SEL_I2C2_1),
 
-       PINMUX_IPSR_GPSR(IP11_19_16,    SD1_CD),
-       PINMUX_IPSR_MSEL(IP11_19_16,    NFRB_N_A,               SEL_NDF_0),
-       PINMUX_IPSR_MSEL(IP11_19_16,    SIM0_CLK_B,             SEL_SIMCARD_1),
+       PINMUX_IPSR_MSEL(IP11_19_16,    SD1_CD,                 I2C_SEL_0_0),
+       PINMUX_IPSR_PHYS_MSEL(IP11_19_16, NFRB_N_A,             I2C_SEL_0_0,    SEL_NDFC_0),
+       PINMUX_IPSR_PHYS_MSEL(IP11_19_16, SIM0_CLK_B,           I2C_SEL_0_0,    SEL_SIMCARD_1),
+       PINMUX_IPSR_PHYS(IP11_19_16,    SCL0,                   I2C_SEL_0_1),
 
-       PINMUX_IPSR_GPSR(IP11_23_20,    SD1_WP),
-       PINMUX_IPSR_MSEL(IP11_23_20,    NFCE_N_A,               SEL_NDF_0),
-       PINMUX_IPSR_MSEL(IP11_23_20,    SIM0_D_B,               SEL_SIMCARD_1),
+       PINMUX_IPSR_MSEL(IP11_23_20,    SD1_WP,                 I2C_SEL_0_0),
+       PINMUX_IPSR_PHYS_MSEL(IP11_23_20, NFCE_N_A,             I2C_SEL_0_0,    SEL_NDFC_0),
+       PINMUX_IPSR_PHYS_MSEL(IP11_23_20, SIM0_D_B,             I2C_SEL_0_0,    SEL_SIMCARD_1),
+       PINMUX_IPSR_PHYS(IP11_23_20,    SDA0,                   I2C_SEL_0_1),
 
        PINMUX_IPSR_GPSR(IP11_27_24,    SCK0),
        PINMUX_IPSR_MSEL(IP11_27_24,    HSCK1_B,                SEL_HSCIF1_1),
        PINMUX_IPSR_MSEL(IP11_27_24,    MSIOF1_SS2_B,           SEL_MSIOF1_1),
-       PINMUX_IPSR_MSEL(IP11_27_24,    AUDIO_CLKC_B,           SEL_ADGC_1),
+       PINMUX_IPSR_MSEL(IP11_27_24,    AUDIO_CLKC_B,           SEL_ADG_C_1),
        PINMUX_IPSR_MSEL(IP11_27_24,    SDA2_A,                 SEL_I2C2_0),
        PINMUX_IPSR_MSEL(IP11_27_24,    SIM0_RST_B,             SEL_SIMCARD_1),
        PINMUX_IPSR_MSEL(IP11_27_24,    STP_OPWM_0_C,           SEL_SSP1_0_2),
@@ -1162,7 +1172,7 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_GPSR(IP12_11_8,     RTS0_N),
        PINMUX_IPSR_MSEL(IP12_11_8,     HRTS1_N_B,              SEL_HSCIF1_1),
        PINMUX_IPSR_MSEL(IP12_11_8,     MSIOF1_SS1_B,           SEL_MSIOF1_1),
-       PINMUX_IPSR_MSEL(IP12_11_8,     AUDIO_CLKA_B,           SEL_ADGA_1),
+       PINMUX_IPSR_MSEL(IP12_11_8,     AUDIO_CLKA_B,           SEL_ADG_A_1),
        PINMUX_IPSR_MSEL(IP12_11_8,     SCL2_A,                 SEL_I2C2_0),
        PINMUX_IPSR_MSEL(IP12_11_8,     STP_IVCXO27_1_C,        SEL_SSP1_1_2),
        PINMUX_IPSR_MSEL(IP12_11_8,     RIF0_SYNC_B,            SEL_DRIF0_1),
@@ -1221,7 +1231,7 @@ static const u16 pinmux_data[] = {
 
        PINMUX_IPSR_GPSR(IP13_11_8,     HSCK0),
        PINMUX_IPSR_MSEL(IP13_11_8,     MSIOF1_SCK_D,           SEL_MSIOF1_3),
-       PINMUX_IPSR_MSEL(IP13_11_8,     AUDIO_CLKB_A,           SEL_ADGB_0),
+       PINMUX_IPSR_MSEL(IP13_11_8,     AUDIO_CLKB_A,           SEL_ADG_B_0),
        PINMUX_IPSR_MSEL(IP13_11_8,     SSI_SDATA1_B,           SEL_SSI1_1),
        PINMUX_IPSR_MSEL(IP13_11_8,     TS_SCK0_D,              SEL_TSIF0_3),
        PINMUX_IPSR_MSEL(IP13_11_8,     STP_ISCLK_0_D,          SEL_SSP1_0_3),
@@ -1267,8 +1277,8 @@ static const u16 pinmux_data[] = {
        /* IPSR14 */
        PINMUX_IPSR_GPSR(IP14_3_0,      MSIOF0_SS1),
        PINMUX_IPSR_MSEL(IP14_3_0,      RX5_A,                  SEL_SCIF5_0),
-       PINMUX_IPSR_MSEL(IP14_3_0,      NFWP_N_A,               SEL_NDF_0),
-       PINMUX_IPSR_MSEL(IP14_3_0,      AUDIO_CLKA_C,           SEL_ADGA_2),
+       PINMUX_IPSR_MSEL(IP14_3_0,      NFWP_N_A,               SEL_NDFC_0),
+       PINMUX_IPSR_MSEL(IP14_3_0,      AUDIO_CLKA_C,           SEL_ADG_A_2),
        PINMUX_IPSR_MSEL(IP14_3_0,      SSI_SCK2_A,             SEL_SSI2_0),
        PINMUX_IPSR_MSEL(IP14_3_0,      STP_IVCXO27_0_C,        SEL_SSP1_0_2),
        PINMUX_IPSR_GPSR(IP14_3_0,      AUDIO_CLKOUT3_A),
@@ -1277,7 +1287,7 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_GPSR(IP14_7_4,      MSIOF0_SS2),
        PINMUX_IPSR_MSEL(IP14_7_4,      TX5_A,                  SEL_SCIF5_0),
        PINMUX_IPSR_MSEL(IP14_7_4,      MSIOF1_SS2_D,           SEL_MSIOF1_3),
-       PINMUX_IPSR_MSEL(IP14_7_4,      AUDIO_CLKC_A,           SEL_ADGC_0),
+       PINMUX_IPSR_MSEL(IP14_7_4,      AUDIO_CLKC_A,           SEL_ADG_C_0),
        PINMUX_IPSR_MSEL(IP14_7_4,      SSI_WS2_A,              SEL_SSI2_0),
        PINMUX_IPSR_MSEL(IP14_7_4,      STP_OPWM_0_D,           SEL_SSP1_0_3),
        PINMUX_IPSR_GPSR(IP14_7_4,      AUDIO_CLKOUT_D),
@@ -1405,9 +1415,10 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_MSEL(IP16_31_28,    SCK5_A,                 SEL_SCIF5_0),
 
        /* IPSR17 */
-       PINMUX_IPSR_MSEL(IP17_3_0,      AUDIO_CLKA_A,           SEL_ADGA_0),
+       PINMUX_IPSR_MSEL(IP17_3_0,      AUDIO_CLKA_A,           SEL_ADG_A_0),
+       PINMUX_IPSR_GPSR(IP17_3_0,      CC5_OSCOUT),
 
-       PINMUX_IPSR_MSEL(IP17_7_4,      AUDIO_CLKB_B,           SEL_ADGB_1),
+       PINMUX_IPSR_MSEL(IP17_7_4,      AUDIO_CLKB_B,           SEL_ADG_B_1),
        PINMUX_IPSR_MSEL(IP17_7_4,      SCIF_CLK_A,             SEL_SCIF_0),
        PINMUX_IPSR_MSEL(IP17_7_4,      STP_IVCXO27_1_D,        SEL_SSP1_1_3),
        PINMUX_IPSR_MSEL(IP17_7_4,      REMOCON_A,              SEL_REMOCON_0),
@@ -1498,10 +1509,10 @@ static const u16 pinmux_data[] = {
 
 /*
  * Static pins can not be muxed between different functions but
- * still needs a mark entry in the pinmux list. Add each static
+ * still need mark entries in the pinmux list. Add each static
  * pin to the list without an associated function. The sh-pfc
- * core will do the right thing and skip trying to mux then pin
- * while still applying configuration to it
+ * core will do the right thing and skip trying to mux the pin
+ * while still applying configuration to it.
  */
 #define FM(x)   PINMUX_DATA(x##_MARK, 0),
        PINMUX_STATIC
@@ -2132,23 +2143,13 @@ static const unsigned int du_disp_mux[] = {
        DU_DISP_MARK,
 };
 
-/* - GP7_02/03 -------------------------------------------------------------- */
-static const unsigned int gp7_02_pins[] = {
-       /* GP7_02 */
+/* - HDMI ------------------------------------------------------------------- */
+static const unsigned int hdmi0_cec_pins[] = {
+       /* HDMI0_CEC */
        RCAR_GP_PIN(7, 2),
 };
-
-static const unsigned int gp7_02_mux[] = {
-       GP7_02_MARK,
-};
-
-static const unsigned int gp7_03_pins[] = {
-       /* GP7_03 */
-       RCAR_GP_PIN(7, 3),
-};
-
-static const unsigned int gp7_03_mux[] = {
-       GP7_03_MARK,
+static const unsigned int hdmi0_cec_mux[] = {
+       HDMI0_CEC_MARK,
 };
 
 /* - HSCIF0 ----------------------------------------------------------------- */
@@ -2359,6 +2360,15 @@ static const unsigned int hscif4_data_b_mux[] = {
 };
 
 /* - I2C -------------------------------------------------------------------- */
+static const unsigned int i2c0_pins[] = {
+       /* SCL, SDA */
+       RCAR_GP_PIN(3, 14), RCAR_GP_PIN(3, 15),
+};
+
+static const unsigned int i2c0_mux[] = {
+       SCL0_MARK, SDA0_MARK,
+};
+
 static const unsigned int i2c1_a_pins[] = {
        /* SDA, SCL */
        RCAR_GP_PIN(5, 11), RCAR_GP_PIN(5, 10),
@@ -2387,6 +2397,25 @@ static const unsigned int i2c2_b_pins[] = {
 static const unsigned int i2c2_b_mux[] = {
        SDA2_B_MARK, SCL2_B_MARK,
 };
+
+static const unsigned int i2c3_pins[] = {
+       /* SCL, SDA */
+       RCAR_GP_PIN(2, 7), RCAR_GP_PIN(2, 8),
+};
+
+static const unsigned int i2c3_mux[] = {
+       SCL3_MARK, SDA3_MARK,
+};
+
+static const unsigned int i2c5_pins[] = {
+       /* SCL, SDA */
+       RCAR_GP_PIN(2, 13), RCAR_GP_PIN(2, 14),
+};
+
+static const unsigned int i2c5_mux[] = {
+       SCL5_MARK, SDA5_MARK,
+};
+
 static const unsigned int i2c6_a_pins[] = {
        /* SDA, SCL */
        RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 11),
@@ -3131,7 +3160,7 @@ static const unsigned int msiof3_ss1_e_mux[] = {
        MSIOF3_SS1_E_MARK,
 };
 static const unsigned int msiof3_ss2_e_pins[] = {
-       /* SS1 */
+       /* SS2 */
        RCAR_GP_PIN(2, 0),
 };
 static const unsigned int msiof3_ss2_e_mux[] = {
@@ -4044,67 +4073,29 @@ static const unsigned int vin4_clk_mux[] = {
 };
 
 /* - VIN5 ------------------------------------------------------------------- */
-static const unsigned int vin5_data8_pins[] = {
-       RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1),
-       RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
-       RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
-       RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
-};
-static const unsigned int vin5_data8_mux[] = {
-       VI5_DATA0_MARK, VI5_DATA1_MARK,
-       VI5_DATA2_MARK, VI5_DATA3_MARK,
-       VI5_DATA4_MARK, VI5_DATA5_MARK,
-       VI5_DATA6_MARK, VI5_DATA7_MARK,
-};
-static const unsigned int vin5_data10_pins[] = {
-       RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1),
-       RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
-       RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
-       RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
-       RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
-};
-static const unsigned int vin5_data10_mux[] = {
-       VI5_DATA0_MARK, VI5_DATA1_MARK,
-       VI5_DATA2_MARK, VI5_DATA3_MARK,
-       VI5_DATA4_MARK, VI5_DATA5_MARK,
-       VI5_DATA6_MARK, VI5_DATA7_MARK,
-       VI5_DATA8_MARK,  VI5_DATA9_MARK,
-};
-static const unsigned int vin5_data12_pins[] = {
-       RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1),
-       RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
-       RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
-       RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
-       RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
-       RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 15),
-};
-static const unsigned int vin5_data12_mux[] = {
-       VI5_DATA0_MARK, VI5_DATA1_MARK,
-       VI5_DATA2_MARK, VI5_DATA3_MARK,
-       VI5_DATA4_MARK, VI5_DATA5_MARK,
-       VI5_DATA6_MARK, VI5_DATA7_MARK,
-       VI5_DATA8_MARK,  VI5_DATA9_MARK,
-       VI5_DATA10_MARK, VI5_DATA11_MARK,
-};
-static const unsigned int vin5_data16_pins[] = {
-       RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1),
-       RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
-       RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
-       RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
-       RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
-       RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 15),
-       RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5),
-       RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7),
+static const union vin_data16 vin5_data_pins = {
+       .data16 = {
+               RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1),
+               RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
+               RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
+               RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
+               RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
+               RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 15),
+               RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5),
+               RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7),
+       },
 };
-static const unsigned int vin5_data16_mux[] = {
-       VI5_DATA0_MARK, VI5_DATA1_MARK,
-       VI5_DATA2_MARK, VI5_DATA3_MARK,
-       VI5_DATA4_MARK, VI5_DATA5_MARK,
-       VI5_DATA6_MARK, VI5_DATA7_MARK,
-       VI5_DATA8_MARK,  VI5_DATA9_MARK,
-       VI5_DATA10_MARK, VI5_DATA11_MARK,
-       VI5_DATA12_MARK, VI5_DATA13_MARK,
-       VI5_DATA14_MARK, VI5_DATA15_MARK,
+static const union vin_data16 vin5_data_mux = {
+       .data16 = {
+               VI5_DATA0_MARK, VI5_DATA1_MARK,
+               VI5_DATA2_MARK, VI5_DATA3_MARK,
+               VI5_DATA4_MARK, VI5_DATA5_MARK,
+               VI5_DATA6_MARK, VI5_DATA7_MARK,
+               VI5_DATA8_MARK,  VI5_DATA9_MARK,
+               VI5_DATA10_MARK, VI5_DATA11_MARK,
+               VI5_DATA12_MARK, VI5_DATA13_MARK,
+               VI5_DATA14_MARK, VI5_DATA15_MARK,
+       },
 };
 static const unsigned int vin5_sync_pins[] = {
        /* HSYNC#, VSYNC# */
@@ -4135,348 +4126,357 @@ static const unsigned int vin5_clk_mux[] = {
        VI5_CLK_MARK,
 };
 
-static const struct sh_pfc_pin_group pinmux_groups[] = {
-       SH_PFC_PIN_GROUP(audio_clk_a_a),
-       SH_PFC_PIN_GROUP(audio_clk_a_b),
-       SH_PFC_PIN_GROUP(audio_clk_a_c),
-       SH_PFC_PIN_GROUP(audio_clk_b_a),
-       SH_PFC_PIN_GROUP(audio_clk_b_b),
-       SH_PFC_PIN_GROUP(audio_clk_c_a),
-       SH_PFC_PIN_GROUP(audio_clk_c_b),
-       SH_PFC_PIN_GROUP(audio_clkout_a),
-       SH_PFC_PIN_GROUP(audio_clkout_b),
-       SH_PFC_PIN_GROUP(audio_clkout_c),
-       SH_PFC_PIN_GROUP(audio_clkout_d),
-       SH_PFC_PIN_GROUP(audio_clkout1_a),
-       SH_PFC_PIN_GROUP(audio_clkout1_b),
-       SH_PFC_PIN_GROUP(audio_clkout2_a),
-       SH_PFC_PIN_GROUP(audio_clkout2_b),
-       SH_PFC_PIN_GROUP(audio_clkout3_a),
-       SH_PFC_PIN_GROUP(audio_clkout3_b),
-       SH_PFC_PIN_GROUP(avb_link),
-       SH_PFC_PIN_GROUP(avb_magic),
-       SH_PFC_PIN_GROUP(avb_phy_int),
-       SH_PFC_PIN_GROUP_ALIAS(avb_mdc, avb_mdio),      /* Deprecated */
-       SH_PFC_PIN_GROUP(avb_mdio),
-       SH_PFC_PIN_GROUP(avb_mii),
-       SH_PFC_PIN_GROUP(avb_avtp_pps),
-       SH_PFC_PIN_GROUP(avb_avtp_match_a),
-       SH_PFC_PIN_GROUP(avb_avtp_capture_a),
-       SH_PFC_PIN_GROUP(avb_avtp_match_b),
-       SH_PFC_PIN_GROUP(avb_avtp_capture_b),
-       SH_PFC_PIN_GROUP(can0_data_a),
-       SH_PFC_PIN_GROUP(can0_data_b),
-       SH_PFC_PIN_GROUP(can1_data),
-       SH_PFC_PIN_GROUP(can_clk),
-       SH_PFC_PIN_GROUP(canfd0_data_a),
-       SH_PFC_PIN_GROUP(canfd0_data_b),
-       SH_PFC_PIN_GROUP(canfd1_data),
-       SH_PFC_PIN_GROUP(drif0_ctrl_a),
-       SH_PFC_PIN_GROUP(drif0_data0_a),
-       SH_PFC_PIN_GROUP(drif0_data1_a),
-       SH_PFC_PIN_GROUP(drif0_ctrl_b),
-       SH_PFC_PIN_GROUP(drif0_data0_b),
-       SH_PFC_PIN_GROUP(drif0_data1_b),
-       SH_PFC_PIN_GROUP(drif0_ctrl_c),
-       SH_PFC_PIN_GROUP(drif0_data0_c),
-       SH_PFC_PIN_GROUP(drif0_data1_c),
-       SH_PFC_PIN_GROUP(drif1_ctrl_a),
-       SH_PFC_PIN_GROUP(drif1_data0_a),
-       SH_PFC_PIN_GROUP(drif1_data1_a),
-       SH_PFC_PIN_GROUP(drif1_ctrl_b),
-       SH_PFC_PIN_GROUP(drif1_data0_b),
-       SH_PFC_PIN_GROUP(drif1_data1_b),
-       SH_PFC_PIN_GROUP(drif1_ctrl_c),
-       SH_PFC_PIN_GROUP(drif1_data0_c),
-       SH_PFC_PIN_GROUP(drif1_data1_c),
-       SH_PFC_PIN_GROUP(drif2_ctrl_a),
-       SH_PFC_PIN_GROUP(drif2_data0_a),
-       SH_PFC_PIN_GROUP(drif2_data1_a),
-       SH_PFC_PIN_GROUP(drif2_ctrl_b),
-       SH_PFC_PIN_GROUP(drif2_data0_b),
-       SH_PFC_PIN_GROUP(drif2_data1_b),
-       SH_PFC_PIN_GROUP(drif3_ctrl_a),
-       SH_PFC_PIN_GROUP(drif3_data0_a),
-       SH_PFC_PIN_GROUP(drif3_data1_a),
-       SH_PFC_PIN_GROUP(drif3_ctrl_b),
-       SH_PFC_PIN_GROUP(drif3_data0_b),
-       SH_PFC_PIN_GROUP(drif3_data1_b),
-       SH_PFC_PIN_GROUP(du_rgb666),
-       SH_PFC_PIN_GROUP(du_rgb888),
-       SH_PFC_PIN_GROUP(du_clk_out_0),
-       SH_PFC_PIN_GROUP(du_clk_out_1),
-       SH_PFC_PIN_GROUP(du_sync),
-       SH_PFC_PIN_GROUP(du_oddf),
-       SH_PFC_PIN_GROUP(du_cde),
-       SH_PFC_PIN_GROUP(du_disp),
-       SH_PFC_PIN_GROUP(gp7_02),
-       SH_PFC_PIN_GROUP(gp7_03),
-       SH_PFC_PIN_GROUP(hscif0_data),
-       SH_PFC_PIN_GROUP(hscif0_clk),
-       SH_PFC_PIN_GROUP(hscif0_ctrl),
-       SH_PFC_PIN_GROUP(hscif1_data_a),
-       SH_PFC_PIN_GROUP(hscif1_clk_a),
-       SH_PFC_PIN_GROUP(hscif1_ctrl_a),
-       SH_PFC_PIN_GROUP(hscif1_data_b),
-       SH_PFC_PIN_GROUP(hscif1_clk_b),
-       SH_PFC_PIN_GROUP(hscif1_ctrl_b),
-       SH_PFC_PIN_GROUP(hscif2_data_a),
-       SH_PFC_PIN_GROUP(hscif2_clk_a),
-       SH_PFC_PIN_GROUP(hscif2_ctrl_a),
-       SH_PFC_PIN_GROUP(hscif2_data_b),
-       SH_PFC_PIN_GROUP(hscif2_clk_b),
-       SH_PFC_PIN_GROUP(hscif2_ctrl_b),
-       SH_PFC_PIN_GROUP(hscif2_data_c),
-       SH_PFC_PIN_GROUP(hscif2_clk_c),
-       SH_PFC_PIN_GROUP(hscif2_ctrl_c),
-       SH_PFC_PIN_GROUP(hscif3_data_a),
-       SH_PFC_PIN_GROUP(hscif3_clk),
-       SH_PFC_PIN_GROUP(hscif3_ctrl),
-       SH_PFC_PIN_GROUP(hscif3_data_b),
-       SH_PFC_PIN_GROUP(hscif3_data_c),
-       SH_PFC_PIN_GROUP(hscif3_data_d),
-       SH_PFC_PIN_GROUP(hscif4_data_a),
-       SH_PFC_PIN_GROUP(hscif4_clk),
-       SH_PFC_PIN_GROUP(hscif4_ctrl),
-       SH_PFC_PIN_GROUP(hscif4_data_b),
-       SH_PFC_PIN_GROUP(i2c1_a),
-       SH_PFC_PIN_GROUP(i2c1_b),
-       SH_PFC_PIN_GROUP(i2c2_a),
-       SH_PFC_PIN_GROUP(i2c2_b),
-       SH_PFC_PIN_GROUP(i2c6_a),
-       SH_PFC_PIN_GROUP(i2c6_b),
-       SH_PFC_PIN_GROUP(i2c6_c),
-       SH_PFC_PIN_GROUP(intc_ex_irq0),
-       SH_PFC_PIN_GROUP(intc_ex_irq1),
-       SH_PFC_PIN_GROUP(intc_ex_irq2),
-       SH_PFC_PIN_GROUP(intc_ex_irq3),
-       SH_PFC_PIN_GROUP(intc_ex_irq4),
-       SH_PFC_PIN_GROUP(intc_ex_irq5),
-       SH_PFC_PIN_GROUP(msiof0_clk),
-       SH_PFC_PIN_GROUP(msiof0_sync),
-       SH_PFC_PIN_GROUP(msiof0_ss1),
-       SH_PFC_PIN_GROUP(msiof0_ss2),
-       SH_PFC_PIN_GROUP(msiof0_txd),
-       SH_PFC_PIN_GROUP(msiof0_rxd),
-       SH_PFC_PIN_GROUP(msiof1_clk_a),
-       SH_PFC_PIN_GROUP(msiof1_sync_a),
-       SH_PFC_PIN_GROUP(msiof1_ss1_a),
-       SH_PFC_PIN_GROUP(msiof1_ss2_a),
-       SH_PFC_PIN_GROUP(msiof1_txd_a),
-       SH_PFC_PIN_GROUP(msiof1_rxd_a),
-       SH_PFC_PIN_GROUP(msiof1_clk_b),
-       SH_PFC_PIN_GROUP(msiof1_sync_b),
-       SH_PFC_PIN_GROUP(msiof1_ss1_b),
-       SH_PFC_PIN_GROUP(msiof1_ss2_b),
-       SH_PFC_PIN_GROUP(msiof1_txd_b),
-       SH_PFC_PIN_GROUP(msiof1_rxd_b),
-       SH_PFC_PIN_GROUP(msiof1_clk_c),
-       SH_PFC_PIN_GROUP(msiof1_sync_c),
-       SH_PFC_PIN_GROUP(msiof1_ss1_c),
-       SH_PFC_PIN_GROUP(msiof1_ss2_c),
-       SH_PFC_PIN_GROUP(msiof1_txd_c),
-       SH_PFC_PIN_GROUP(msiof1_rxd_c),
-       SH_PFC_PIN_GROUP(msiof1_clk_d),
-       SH_PFC_PIN_GROUP(msiof1_sync_d),
-       SH_PFC_PIN_GROUP(msiof1_ss1_d),
-       SH_PFC_PIN_GROUP(msiof1_ss2_d),
-       SH_PFC_PIN_GROUP(msiof1_txd_d),
-       SH_PFC_PIN_GROUP(msiof1_rxd_d),
-       SH_PFC_PIN_GROUP(msiof1_clk_e),
-       SH_PFC_PIN_GROUP(msiof1_sync_e),
-       SH_PFC_PIN_GROUP(msiof1_ss1_e),
-       SH_PFC_PIN_GROUP(msiof1_ss2_e),
-       SH_PFC_PIN_GROUP(msiof1_txd_e),
-       SH_PFC_PIN_GROUP(msiof1_rxd_e),
-       SH_PFC_PIN_GROUP(msiof1_clk_f),
-       SH_PFC_PIN_GROUP(msiof1_sync_f),
-       SH_PFC_PIN_GROUP(msiof1_ss1_f),
-       SH_PFC_PIN_GROUP(msiof1_ss2_f),
-       SH_PFC_PIN_GROUP(msiof1_txd_f),
-       SH_PFC_PIN_GROUP(msiof1_rxd_f),
-       SH_PFC_PIN_GROUP(msiof1_clk_g),
-       SH_PFC_PIN_GROUP(msiof1_sync_g),
-       SH_PFC_PIN_GROUP(msiof1_ss1_g),
-       SH_PFC_PIN_GROUP(msiof1_ss2_g),
-       SH_PFC_PIN_GROUP(msiof1_txd_g),
-       SH_PFC_PIN_GROUP(msiof1_rxd_g),
-       SH_PFC_PIN_GROUP(msiof2_clk_a),
-       SH_PFC_PIN_GROUP(msiof2_sync_a),
-       SH_PFC_PIN_GROUP(msiof2_ss1_a),
-       SH_PFC_PIN_GROUP(msiof2_ss2_a),
-       SH_PFC_PIN_GROUP(msiof2_txd_a),
-       SH_PFC_PIN_GROUP(msiof2_rxd_a),
-       SH_PFC_PIN_GROUP(msiof2_clk_b),
-       SH_PFC_PIN_GROUP(msiof2_sync_b),
-       SH_PFC_PIN_GROUP(msiof2_ss1_b),
-       SH_PFC_PIN_GROUP(msiof2_ss2_b),
-       SH_PFC_PIN_GROUP(msiof2_txd_b),
-       SH_PFC_PIN_GROUP(msiof2_rxd_b),
-       SH_PFC_PIN_GROUP(msiof2_clk_c),
-       SH_PFC_PIN_GROUP(msiof2_sync_c),
-       SH_PFC_PIN_GROUP(msiof2_ss1_c),
-       SH_PFC_PIN_GROUP(msiof2_ss2_c),
-       SH_PFC_PIN_GROUP(msiof2_txd_c),
-       SH_PFC_PIN_GROUP(msiof2_rxd_c),
-       SH_PFC_PIN_GROUP(msiof2_clk_d),
-       SH_PFC_PIN_GROUP(msiof2_sync_d),
-       SH_PFC_PIN_GROUP(msiof2_ss1_d),
-       SH_PFC_PIN_GROUP(msiof2_ss2_d),
-       SH_PFC_PIN_GROUP(msiof2_txd_d),
-       SH_PFC_PIN_GROUP(msiof2_rxd_d),
-       SH_PFC_PIN_GROUP(msiof3_clk_a),
-       SH_PFC_PIN_GROUP(msiof3_sync_a),
-       SH_PFC_PIN_GROUP(msiof3_ss1_a),
-       SH_PFC_PIN_GROUP(msiof3_ss2_a),
-       SH_PFC_PIN_GROUP(msiof3_txd_a),
-       SH_PFC_PIN_GROUP(msiof3_rxd_a),
-       SH_PFC_PIN_GROUP(msiof3_clk_b),
-       SH_PFC_PIN_GROUP(msiof3_sync_b),
-       SH_PFC_PIN_GROUP(msiof3_ss1_b),
-       SH_PFC_PIN_GROUP(msiof3_ss2_b),
-       SH_PFC_PIN_GROUP(msiof3_txd_b),
-       SH_PFC_PIN_GROUP(msiof3_rxd_b),
-       SH_PFC_PIN_GROUP(msiof3_clk_c),
-       SH_PFC_PIN_GROUP(msiof3_sync_c),
-       SH_PFC_PIN_GROUP(msiof3_txd_c),
-       SH_PFC_PIN_GROUP(msiof3_rxd_c),
-       SH_PFC_PIN_GROUP(msiof3_clk_d),
-       SH_PFC_PIN_GROUP(msiof3_sync_d),
-       SH_PFC_PIN_GROUP(msiof3_ss1_d),
-       SH_PFC_PIN_GROUP(msiof3_txd_d),
-       SH_PFC_PIN_GROUP(msiof3_rxd_d),
-       SH_PFC_PIN_GROUP(msiof3_clk_e),
-       SH_PFC_PIN_GROUP(msiof3_sync_e),
-       SH_PFC_PIN_GROUP(msiof3_ss1_e),
-       SH_PFC_PIN_GROUP(msiof3_ss2_e),
-       SH_PFC_PIN_GROUP(msiof3_txd_e),
-       SH_PFC_PIN_GROUP(msiof3_rxd_e),
-       SH_PFC_PIN_GROUP(pwm0),
-       SH_PFC_PIN_GROUP(pwm1_a),
-       SH_PFC_PIN_GROUP(pwm1_b),
-       SH_PFC_PIN_GROUP(pwm2_a),
-       SH_PFC_PIN_GROUP(pwm2_b),
-       SH_PFC_PIN_GROUP(pwm3_a),
-       SH_PFC_PIN_GROUP(pwm3_b),
-       SH_PFC_PIN_GROUP(pwm4_a),
-       SH_PFC_PIN_GROUP(pwm4_b),
-       SH_PFC_PIN_GROUP(pwm5_a),
-       SH_PFC_PIN_GROUP(pwm5_b),
-       SH_PFC_PIN_GROUP(pwm6_a),
-       SH_PFC_PIN_GROUP(pwm6_b),
-       SH_PFC_PIN_GROUP(scif0_data),
-       SH_PFC_PIN_GROUP(scif0_clk),
-       SH_PFC_PIN_GROUP(scif0_ctrl),
-       SH_PFC_PIN_GROUP(scif1_data_a),
-       SH_PFC_PIN_GROUP(scif1_clk),
-       SH_PFC_PIN_GROUP(scif1_ctrl),
-       SH_PFC_PIN_GROUP(scif1_data_b),
-       SH_PFC_PIN_GROUP(scif2_data_a),
-       SH_PFC_PIN_GROUP(scif2_clk),
-       SH_PFC_PIN_GROUP(scif2_data_b),
-       SH_PFC_PIN_GROUP(scif3_data_a),
-       SH_PFC_PIN_GROUP(scif3_clk),
-       SH_PFC_PIN_GROUP(scif3_ctrl),
-       SH_PFC_PIN_GROUP(scif3_data_b),
-       SH_PFC_PIN_GROUP(scif4_data_a),
-       SH_PFC_PIN_GROUP(scif4_clk_a),
-       SH_PFC_PIN_GROUP(scif4_ctrl_a),
-       SH_PFC_PIN_GROUP(scif4_data_b),
-       SH_PFC_PIN_GROUP(scif4_clk_b),
-       SH_PFC_PIN_GROUP(scif4_ctrl_b),
-       SH_PFC_PIN_GROUP(scif4_data_c),
-       SH_PFC_PIN_GROUP(scif4_clk_c),
-       SH_PFC_PIN_GROUP(scif4_ctrl_c),
-       SH_PFC_PIN_GROUP(scif5_data_a),
-       SH_PFC_PIN_GROUP(scif5_clk_a),
-       SH_PFC_PIN_GROUP(scif5_data_b),
-       SH_PFC_PIN_GROUP(scif5_clk_b),
-       SH_PFC_PIN_GROUP(scif_clk_a),
-       SH_PFC_PIN_GROUP(scif_clk_b),
-       SH_PFC_PIN_GROUP(sdhi0_data1),
-       SH_PFC_PIN_GROUP(sdhi0_data4),
-       SH_PFC_PIN_GROUP(sdhi0_ctrl),
-       SH_PFC_PIN_GROUP(sdhi0_cd),
-       SH_PFC_PIN_GROUP(sdhi0_wp),
-       SH_PFC_PIN_GROUP(sdhi1_data1),
-       SH_PFC_PIN_GROUP(sdhi1_data4),
-       SH_PFC_PIN_GROUP(sdhi1_ctrl),
-       SH_PFC_PIN_GROUP(sdhi1_cd),
-       SH_PFC_PIN_GROUP(sdhi1_wp),
-       SH_PFC_PIN_GROUP(sdhi2_data1),
-       SH_PFC_PIN_GROUP(sdhi2_data4),
-       SH_PFC_PIN_GROUP(sdhi2_data8),
-       SH_PFC_PIN_GROUP(sdhi2_ctrl),
-       SH_PFC_PIN_GROUP(sdhi2_cd_a),
-       SH_PFC_PIN_GROUP(sdhi2_wp_a),
-       SH_PFC_PIN_GROUP(sdhi2_cd_b),
-       SH_PFC_PIN_GROUP(sdhi2_wp_b),
-       SH_PFC_PIN_GROUP(sdhi2_ds),
-       SH_PFC_PIN_GROUP(sdhi3_data1),
-       SH_PFC_PIN_GROUP(sdhi3_data4),
-       SH_PFC_PIN_GROUP(sdhi3_data8),
-       SH_PFC_PIN_GROUP(sdhi3_ctrl),
-       SH_PFC_PIN_GROUP(sdhi3_cd),
-       SH_PFC_PIN_GROUP(sdhi3_wp),
-       SH_PFC_PIN_GROUP(sdhi3_ds),
-       SH_PFC_PIN_GROUP(ssi0_data),
-       SH_PFC_PIN_GROUP(ssi01239_ctrl),
-       SH_PFC_PIN_GROUP(ssi1_data_a),
-       SH_PFC_PIN_GROUP(ssi1_data_b),
-       SH_PFC_PIN_GROUP(ssi1_ctrl_a),
-       SH_PFC_PIN_GROUP(ssi1_ctrl_b),
-       SH_PFC_PIN_GROUP(ssi2_data_a),
-       SH_PFC_PIN_GROUP(ssi2_data_b),
-       SH_PFC_PIN_GROUP(ssi2_ctrl_a),
-       SH_PFC_PIN_GROUP(ssi2_ctrl_b),
-       SH_PFC_PIN_GROUP(ssi3_data),
-       SH_PFC_PIN_GROUP(ssi349_ctrl),
-       SH_PFC_PIN_GROUP(ssi4_data),
-       SH_PFC_PIN_GROUP(ssi4_ctrl),
-       SH_PFC_PIN_GROUP(ssi5_data),
-       SH_PFC_PIN_GROUP(ssi5_ctrl),
-       SH_PFC_PIN_GROUP(ssi6_data),
-       SH_PFC_PIN_GROUP(ssi6_ctrl),
-       SH_PFC_PIN_GROUP(ssi7_data),
-       SH_PFC_PIN_GROUP(ssi78_ctrl),
-       SH_PFC_PIN_GROUP(ssi8_data),
-       SH_PFC_PIN_GROUP(ssi9_data_a),
-       SH_PFC_PIN_GROUP(ssi9_data_b),
-       SH_PFC_PIN_GROUP(ssi9_ctrl_a),
-       SH_PFC_PIN_GROUP(ssi9_ctrl_b),
-       SH_PFC_PIN_GROUP(tmu_tclk1_a),
-       SH_PFC_PIN_GROUP(tmu_tclk1_b),
-       SH_PFC_PIN_GROUP(tmu_tclk2_a),
-       SH_PFC_PIN_GROUP(tmu_tclk2_b),
-       SH_PFC_PIN_GROUP(usb0),
-       SH_PFC_PIN_GROUP(usb1),
-       SH_PFC_PIN_GROUP(usb30),
-       VIN_DATA_PIN_GROUP(vin4_data_a, 8),
-       VIN_DATA_PIN_GROUP(vin4_data_a, 10),
-       VIN_DATA_PIN_GROUP(vin4_data_a, 12),
-       VIN_DATA_PIN_GROUP(vin4_data_a, 16),
-       SH_PFC_PIN_GROUP(vin4_data18_a),
-       VIN_DATA_PIN_GROUP(vin4_data_a, 20),
-       VIN_DATA_PIN_GROUP(vin4_data_a, 24),
-       VIN_DATA_PIN_GROUP(vin4_data_b, 8),
-       VIN_DATA_PIN_GROUP(vin4_data_b, 10),
-       VIN_DATA_PIN_GROUP(vin4_data_b, 12),
-       VIN_DATA_PIN_GROUP(vin4_data_b, 16),
-       SH_PFC_PIN_GROUP(vin4_data18_b),
-       VIN_DATA_PIN_GROUP(vin4_data_b, 20),
-       VIN_DATA_PIN_GROUP(vin4_data_b, 24),
-       SH_PFC_PIN_GROUP(vin4_sync),
-       SH_PFC_PIN_GROUP(vin4_field),
-       SH_PFC_PIN_GROUP(vin4_clkenb),
-       SH_PFC_PIN_GROUP(vin4_clk),
-       SH_PFC_PIN_GROUP(vin5_data8),
-       SH_PFC_PIN_GROUP(vin5_data10),
-       SH_PFC_PIN_GROUP(vin5_data12),
-       SH_PFC_PIN_GROUP(vin5_data16),
-       SH_PFC_PIN_GROUP(vin5_sync),
-       SH_PFC_PIN_GROUP(vin5_field),
-       SH_PFC_PIN_GROUP(vin5_clkenb),
-       SH_PFC_PIN_GROUP(vin5_clk),
+static const struct {
+       struct sh_pfc_pin_group common[310];
+       struct sh_pfc_pin_group automotive[33];
+} pinmux_groups = {
+       .common = {
+               SH_PFC_PIN_GROUP(audio_clk_a_a),
+               SH_PFC_PIN_GROUP(audio_clk_a_b),
+               SH_PFC_PIN_GROUP(audio_clk_a_c),
+               SH_PFC_PIN_GROUP(audio_clk_b_a),
+               SH_PFC_PIN_GROUP(audio_clk_b_b),
+               SH_PFC_PIN_GROUP(audio_clk_c_a),
+               SH_PFC_PIN_GROUP(audio_clk_c_b),
+               SH_PFC_PIN_GROUP(audio_clkout_a),
+               SH_PFC_PIN_GROUP(audio_clkout_b),
+               SH_PFC_PIN_GROUP(audio_clkout_c),
+               SH_PFC_PIN_GROUP(audio_clkout_d),
+               SH_PFC_PIN_GROUP(audio_clkout1_a),
+               SH_PFC_PIN_GROUP(audio_clkout1_b),
+               SH_PFC_PIN_GROUP(audio_clkout2_a),
+               SH_PFC_PIN_GROUP(audio_clkout2_b),
+               SH_PFC_PIN_GROUP(audio_clkout3_a),
+               SH_PFC_PIN_GROUP(audio_clkout3_b),
+               SH_PFC_PIN_GROUP(avb_link),
+               SH_PFC_PIN_GROUP(avb_magic),
+               SH_PFC_PIN_GROUP(avb_phy_int),
+               SH_PFC_PIN_GROUP_ALIAS(avb_mdc, avb_mdio), /* Deprecated */
+               SH_PFC_PIN_GROUP(avb_mdio),
+               SH_PFC_PIN_GROUP(avb_mii),
+               SH_PFC_PIN_GROUP(avb_avtp_pps),
+               SH_PFC_PIN_GROUP(avb_avtp_match_a),
+               SH_PFC_PIN_GROUP(avb_avtp_capture_a),
+               SH_PFC_PIN_GROUP(avb_avtp_match_b),
+               SH_PFC_PIN_GROUP(avb_avtp_capture_b),
+               SH_PFC_PIN_GROUP(can0_data_a),
+               SH_PFC_PIN_GROUP(can0_data_b),
+               SH_PFC_PIN_GROUP(can1_data),
+               SH_PFC_PIN_GROUP(can_clk),
+               SH_PFC_PIN_GROUP(du_rgb666),
+               SH_PFC_PIN_GROUP(du_rgb888),
+               SH_PFC_PIN_GROUP(du_clk_out_0),
+               SH_PFC_PIN_GROUP(du_clk_out_1),
+               SH_PFC_PIN_GROUP(du_sync),
+               SH_PFC_PIN_GROUP(du_oddf),
+               SH_PFC_PIN_GROUP(du_cde),
+               SH_PFC_PIN_GROUP(du_disp),
+               SH_PFC_PIN_GROUP(hdmi0_cec),
+               SH_PFC_PIN_GROUP(hscif0_data),
+               SH_PFC_PIN_GROUP(hscif0_clk),
+               SH_PFC_PIN_GROUP(hscif0_ctrl),
+               SH_PFC_PIN_GROUP(hscif1_data_a),
+               SH_PFC_PIN_GROUP(hscif1_clk_a),
+               SH_PFC_PIN_GROUP(hscif1_ctrl_a),
+               SH_PFC_PIN_GROUP(hscif1_data_b),
+               SH_PFC_PIN_GROUP(hscif1_clk_b),
+               SH_PFC_PIN_GROUP(hscif1_ctrl_b),
+               SH_PFC_PIN_GROUP(hscif2_data_a),
+               SH_PFC_PIN_GROUP(hscif2_clk_a),
+               SH_PFC_PIN_GROUP(hscif2_ctrl_a),
+               SH_PFC_PIN_GROUP(hscif2_data_b),
+               SH_PFC_PIN_GROUP(hscif2_clk_b),
+               SH_PFC_PIN_GROUP(hscif2_ctrl_b),
+               SH_PFC_PIN_GROUP(hscif2_data_c),
+               SH_PFC_PIN_GROUP(hscif2_clk_c),
+               SH_PFC_PIN_GROUP(hscif2_ctrl_c),
+               SH_PFC_PIN_GROUP(hscif3_data_a),
+               SH_PFC_PIN_GROUP(hscif3_clk),
+               SH_PFC_PIN_GROUP(hscif3_ctrl),
+               SH_PFC_PIN_GROUP(hscif3_data_b),
+               SH_PFC_PIN_GROUP(hscif3_data_c),
+               SH_PFC_PIN_GROUP(hscif3_data_d),
+               SH_PFC_PIN_GROUP(hscif4_data_a),
+               SH_PFC_PIN_GROUP(hscif4_clk),
+               SH_PFC_PIN_GROUP(hscif4_ctrl),
+               SH_PFC_PIN_GROUP(hscif4_data_b),
+               SH_PFC_PIN_GROUP(i2c0),
+               SH_PFC_PIN_GROUP(i2c1_a),
+               SH_PFC_PIN_GROUP(i2c1_b),
+               SH_PFC_PIN_GROUP(i2c2_a),
+               SH_PFC_PIN_GROUP(i2c2_b),
+               SH_PFC_PIN_GROUP(i2c3),
+               SH_PFC_PIN_GROUP(i2c5),
+               SH_PFC_PIN_GROUP(i2c6_a),
+               SH_PFC_PIN_GROUP(i2c6_b),
+               SH_PFC_PIN_GROUP(i2c6_c),
+               SH_PFC_PIN_GROUP(intc_ex_irq0),
+               SH_PFC_PIN_GROUP(intc_ex_irq1),
+               SH_PFC_PIN_GROUP(intc_ex_irq2),
+               SH_PFC_PIN_GROUP(intc_ex_irq3),
+               SH_PFC_PIN_GROUP(intc_ex_irq4),
+               SH_PFC_PIN_GROUP(intc_ex_irq5),
+               SH_PFC_PIN_GROUP(msiof0_clk),
+               SH_PFC_PIN_GROUP(msiof0_sync),
+               SH_PFC_PIN_GROUP(msiof0_ss1),
+               SH_PFC_PIN_GROUP(msiof0_ss2),
+               SH_PFC_PIN_GROUP(msiof0_txd),
+               SH_PFC_PIN_GROUP(msiof0_rxd),
+               SH_PFC_PIN_GROUP(msiof1_clk_a),
+               SH_PFC_PIN_GROUP(msiof1_sync_a),
+               SH_PFC_PIN_GROUP(msiof1_ss1_a),
+               SH_PFC_PIN_GROUP(msiof1_ss2_a),
+               SH_PFC_PIN_GROUP(msiof1_txd_a),
+               SH_PFC_PIN_GROUP(msiof1_rxd_a),
+               SH_PFC_PIN_GROUP(msiof1_clk_b),
+               SH_PFC_PIN_GROUP(msiof1_sync_b),
+               SH_PFC_PIN_GROUP(msiof1_ss1_b),
+               SH_PFC_PIN_GROUP(msiof1_ss2_b),
+               SH_PFC_PIN_GROUP(msiof1_txd_b),
+               SH_PFC_PIN_GROUP(msiof1_rxd_b),
+               SH_PFC_PIN_GROUP(msiof1_clk_c),
+               SH_PFC_PIN_GROUP(msiof1_sync_c),
+               SH_PFC_PIN_GROUP(msiof1_ss1_c),
+               SH_PFC_PIN_GROUP(msiof1_ss2_c),
+               SH_PFC_PIN_GROUP(msiof1_txd_c),
+               SH_PFC_PIN_GROUP(msiof1_rxd_c),
+               SH_PFC_PIN_GROUP(msiof1_clk_d),
+               SH_PFC_PIN_GROUP(msiof1_sync_d),
+               SH_PFC_PIN_GROUP(msiof1_ss1_d),
+               SH_PFC_PIN_GROUP(msiof1_ss2_d),
+               SH_PFC_PIN_GROUP(msiof1_txd_d),
+               SH_PFC_PIN_GROUP(msiof1_rxd_d),
+               SH_PFC_PIN_GROUP(msiof1_clk_e),
+               SH_PFC_PIN_GROUP(msiof1_sync_e),
+               SH_PFC_PIN_GROUP(msiof1_ss1_e),
+               SH_PFC_PIN_GROUP(msiof1_ss2_e),
+               SH_PFC_PIN_GROUP(msiof1_txd_e),
+               SH_PFC_PIN_GROUP(msiof1_rxd_e),
+               SH_PFC_PIN_GROUP(msiof1_clk_f),
+               SH_PFC_PIN_GROUP(msiof1_sync_f),
+               SH_PFC_PIN_GROUP(msiof1_ss1_f),
+               SH_PFC_PIN_GROUP(msiof1_ss2_f),
+               SH_PFC_PIN_GROUP(msiof1_txd_f),
+               SH_PFC_PIN_GROUP(msiof1_rxd_f),
+               SH_PFC_PIN_GROUP(msiof1_clk_g),
+               SH_PFC_PIN_GROUP(msiof1_sync_g),
+               SH_PFC_PIN_GROUP(msiof1_ss1_g),
+               SH_PFC_PIN_GROUP(msiof1_ss2_g),
+               SH_PFC_PIN_GROUP(msiof1_txd_g),
+               SH_PFC_PIN_GROUP(msiof1_rxd_g),
+               SH_PFC_PIN_GROUP(msiof2_clk_a),
+               SH_PFC_PIN_GROUP(msiof2_sync_a),
+               SH_PFC_PIN_GROUP(msiof2_ss1_a),
+               SH_PFC_PIN_GROUP(msiof2_ss2_a),
+               SH_PFC_PIN_GROUP(msiof2_txd_a),
+               SH_PFC_PIN_GROUP(msiof2_rxd_a),
+               SH_PFC_PIN_GROUP(msiof2_clk_b),
+               SH_PFC_PIN_GROUP(msiof2_sync_b),
+               SH_PFC_PIN_GROUP(msiof2_ss1_b),
+               SH_PFC_PIN_GROUP(msiof2_ss2_b),
+               SH_PFC_PIN_GROUP(msiof2_txd_b),
+               SH_PFC_PIN_GROUP(msiof2_rxd_b),
+               SH_PFC_PIN_GROUP(msiof2_clk_c),
+               SH_PFC_PIN_GROUP(msiof2_sync_c),
+               SH_PFC_PIN_GROUP(msiof2_ss1_c),
+               SH_PFC_PIN_GROUP(msiof2_ss2_c),
+               SH_PFC_PIN_GROUP(msiof2_txd_c),
+               SH_PFC_PIN_GROUP(msiof2_rxd_c),
+               SH_PFC_PIN_GROUP(msiof2_clk_d),
+               SH_PFC_PIN_GROUP(msiof2_sync_d),
+               SH_PFC_PIN_GROUP(msiof2_ss1_d),
+               SH_PFC_PIN_GROUP(msiof2_ss2_d),
+               SH_PFC_PIN_GROUP(msiof2_txd_d),
+               SH_PFC_PIN_GROUP(msiof2_rxd_d),
+               SH_PFC_PIN_GROUP(msiof3_clk_a),
+               SH_PFC_PIN_GROUP(msiof3_sync_a),
+               SH_PFC_PIN_GROUP(msiof3_ss1_a),
+               SH_PFC_PIN_GROUP(msiof3_ss2_a),
+               SH_PFC_PIN_GROUP(msiof3_txd_a),
+               SH_PFC_PIN_GROUP(msiof3_rxd_a),
+               SH_PFC_PIN_GROUP(msiof3_clk_b),
+               SH_PFC_PIN_GROUP(msiof3_sync_b),
+               SH_PFC_PIN_GROUP(msiof3_ss1_b),
+               SH_PFC_PIN_GROUP(msiof3_ss2_b),
+               SH_PFC_PIN_GROUP(msiof3_txd_b),
+               SH_PFC_PIN_GROUP(msiof3_rxd_b),
+               SH_PFC_PIN_GROUP(msiof3_clk_c),
+               SH_PFC_PIN_GROUP(msiof3_sync_c),
+               SH_PFC_PIN_GROUP(msiof3_txd_c),
+               SH_PFC_PIN_GROUP(msiof3_rxd_c),
+               SH_PFC_PIN_GROUP(msiof3_clk_d),
+               SH_PFC_PIN_GROUP(msiof3_sync_d),
+               SH_PFC_PIN_GROUP(msiof3_ss1_d),
+               SH_PFC_PIN_GROUP(msiof3_txd_d),
+               SH_PFC_PIN_GROUP(msiof3_rxd_d),
+               SH_PFC_PIN_GROUP(msiof3_clk_e),
+               SH_PFC_PIN_GROUP(msiof3_sync_e),
+               SH_PFC_PIN_GROUP(msiof3_ss1_e),
+               SH_PFC_PIN_GROUP(msiof3_ss2_e),
+               SH_PFC_PIN_GROUP(msiof3_txd_e),
+               SH_PFC_PIN_GROUP(msiof3_rxd_e),
+               SH_PFC_PIN_GROUP(pwm0),
+               SH_PFC_PIN_GROUP(pwm1_a),
+               SH_PFC_PIN_GROUP(pwm1_b),
+               SH_PFC_PIN_GROUP(pwm2_a),
+               SH_PFC_PIN_GROUP(pwm2_b),
+               SH_PFC_PIN_GROUP(pwm3_a),
+               SH_PFC_PIN_GROUP(pwm3_b),
+               SH_PFC_PIN_GROUP(pwm4_a),
+               SH_PFC_PIN_GROUP(pwm4_b),
+               SH_PFC_PIN_GROUP(pwm5_a),
+               SH_PFC_PIN_GROUP(pwm5_b),
+               SH_PFC_PIN_GROUP(pwm6_a),
+               SH_PFC_PIN_GROUP(pwm6_b),
+               SH_PFC_PIN_GROUP(scif0_data),
+               SH_PFC_PIN_GROUP(scif0_clk),
+               SH_PFC_PIN_GROUP(scif0_ctrl),
+               SH_PFC_PIN_GROUP(scif1_data_a),
+               SH_PFC_PIN_GROUP(scif1_clk),
+               SH_PFC_PIN_GROUP(scif1_ctrl),
+               SH_PFC_PIN_GROUP(scif1_data_b),
+               SH_PFC_PIN_GROUP(scif2_data_a),
+               SH_PFC_PIN_GROUP(scif2_clk),
+               SH_PFC_PIN_GROUP(scif2_data_b),
+               SH_PFC_PIN_GROUP(scif3_data_a),
+               SH_PFC_PIN_GROUP(scif3_clk),
+               SH_PFC_PIN_GROUP(scif3_ctrl),
+               SH_PFC_PIN_GROUP(scif3_data_b),
+               SH_PFC_PIN_GROUP(scif4_data_a),
+               SH_PFC_PIN_GROUP(scif4_clk_a),
+               SH_PFC_PIN_GROUP(scif4_ctrl_a),
+               SH_PFC_PIN_GROUP(scif4_data_b),
+               SH_PFC_PIN_GROUP(scif4_clk_b),
+               SH_PFC_PIN_GROUP(scif4_ctrl_b),
+               SH_PFC_PIN_GROUP(scif4_data_c),
+               SH_PFC_PIN_GROUP(scif4_clk_c),
+               SH_PFC_PIN_GROUP(scif4_ctrl_c),
+               SH_PFC_PIN_GROUP(scif5_data_a),
+               SH_PFC_PIN_GROUP(scif5_clk_a),
+               SH_PFC_PIN_GROUP(scif5_data_b),
+               SH_PFC_PIN_GROUP(scif5_clk_b),
+               SH_PFC_PIN_GROUP(scif_clk_a),
+               SH_PFC_PIN_GROUP(scif_clk_b),
+               SH_PFC_PIN_GROUP(sdhi0_data1),
+               SH_PFC_PIN_GROUP(sdhi0_data4),
+               SH_PFC_PIN_GROUP(sdhi0_ctrl),
+               SH_PFC_PIN_GROUP(sdhi0_cd),
+               SH_PFC_PIN_GROUP(sdhi0_wp),
+               SH_PFC_PIN_GROUP(sdhi1_data1),
+               SH_PFC_PIN_GROUP(sdhi1_data4),
+               SH_PFC_PIN_GROUP(sdhi1_ctrl),
+               SH_PFC_PIN_GROUP(sdhi1_cd),
+               SH_PFC_PIN_GROUP(sdhi1_wp),
+               SH_PFC_PIN_GROUP(sdhi2_data1),
+               SH_PFC_PIN_GROUP(sdhi2_data4),
+               SH_PFC_PIN_GROUP(sdhi2_data8),
+               SH_PFC_PIN_GROUP(sdhi2_ctrl),
+               SH_PFC_PIN_GROUP(sdhi2_cd_a),
+               SH_PFC_PIN_GROUP(sdhi2_wp_a),
+               SH_PFC_PIN_GROUP(sdhi2_cd_b),
+               SH_PFC_PIN_GROUP(sdhi2_wp_b),
+               SH_PFC_PIN_GROUP(sdhi2_ds),
+               SH_PFC_PIN_GROUP(sdhi3_data1),
+               SH_PFC_PIN_GROUP(sdhi3_data4),
+               SH_PFC_PIN_GROUP(sdhi3_data8),
+               SH_PFC_PIN_GROUP(sdhi3_ctrl),
+               SH_PFC_PIN_GROUP(sdhi3_cd),
+               SH_PFC_PIN_GROUP(sdhi3_wp),
+               SH_PFC_PIN_GROUP(sdhi3_ds),
+               SH_PFC_PIN_GROUP(ssi0_data),
+               SH_PFC_PIN_GROUP(ssi01239_ctrl),
+               SH_PFC_PIN_GROUP(ssi1_data_a),
+               SH_PFC_PIN_GROUP(ssi1_data_b),
+               SH_PFC_PIN_GROUP(ssi1_ctrl_a),
+               SH_PFC_PIN_GROUP(ssi1_ctrl_b),
+               SH_PFC_PIN_GROUP(ssi2_data_a),
+               SH_PFC_PIN_GROUP(ssi2_data_b),
+               SH_PFC_PIN_GROUP(ssi2_ctrl_a),
+               SH_PFC_PIN_GROUP(ssi2_ctrl_b),
+               SH_PFC_PIN_GROUP(ssi3_data),
+               SH_PFC_PIN_GROUP(ssi349_ctrl),
+               SH_PFC_PIN_GROUP(ssi4_data),
+               SH_PFC_PIN_GROUP(ssi4_ctrl),
+               SH_PFC_PIN_GROUP(ssi5_data),
+               SH_PFC_PIN_GROUP(ssi5_ctrl),
+               SH_PFC_PIN_GROUP(ssi6_data),
+               SH_PFC_PIN_GROUP(ssi6_ctrl),
+               SH_PFC_PIN_GROUP(ssi7_data),
+               SH_PFC_PIN_GROUP(ssi78_ctrl),
+               SH_PFC_PIN_GROUP(ssi8_data),
+               SH_PFC_PIN_GROUP(ssi9_data_a),
+               SH_PFC_PIN_GROUP(ssi9_data_b),
+               SH_PFC_PIN_GROUP(ssi9_ctrl_a),
+               SH_PFC_PIN_GROUP(ssi9_ctrl_b),
+               SH_PFC_PIN_GROUP(tmu_tclk1_a),
+               SH_PFC_PIN_GROUP(tmu_tclk1_b),
+               SH_PFC_PIN_GROUP(tmu_tclk2_a),
+               SH_PFC_PIN_GROUP(tmu_tclk2_b),
+               SH_PFC_PIN_GROUP(usb0),
+               SH_PFC_PIN_GROUP(usb1),
+               SH_PFC_PIN_GROUP(usb30),
+               VIN_DATA_PIN_GROUP(vin4_data, 8, _a),
+               VIN_DATA_PIN_GROUP(vin4_data, 10, _a),
+               VIN_DATA_PIN_GROUP(vin4_data, 12, _a),
+               VIN_DATA_PIN_GROUP(vin4_data, 16, _a),
+               SH_PFC_PIN_GROUP(vin4_data18_a),
+               VIN_DATA_PIN_GROUP(vin4_data, 20, _a),
+               VIN_DATA_PIN_GROUP(vin4_data, 24, _a),
+               VIN_DATA_PIN_GROUP(vin4_data, 8, _b),
+               VIN_DATA_PIN_GROUP(vin4_data, 10, _b),
+               VIN_DATA_PIN_GROUP(vin4_data, 12, _b),
+               VIN_DATA_PIN_GROUP(vin4_data, 16, _b),
+               SH_PFC_PIN_GROUP(vin4_data18_b),
+               VIN_DATA_PIN_GROUP(vin4_data, 20, _b),
+               VIN_DATA_PIN_GROUP(vin4_data, 24, _b),
+               SH_PFC_PIN_GROUP(vin4_sync),
+               SH_PFC_PIN_GROUP(vin4_field),
+               SH_PFC_PIN_GROUP(vin4_clkenb),
+               SH_PFC_PIN_GROUP(vin4_clk),
+               VIN_DATA_PIN_GROUP(vin5_data, 8),
+               VIN_DATA_PIN_GROUP(vin5_data, 10),
+               VIN_DATA_PIN_GROUP(vin5_data, 12),
+               VIN_DATA_PIN_GROUP(vin5_data, 16),
+               SH_PFC_PIN_GROUP(vin5_sync),
+               SH_PFC_PIN_GROUP(vin5_field),
+               SH_PFC_PIN_GROUP(vin5_clkenb),
+               SH_PFC_PIN_GROUP(vin5_clk),
+       },
+       .automotive = {
+               SH_PFC_PIN_GROUP(canfd0_data_a),
+               SH_PFC_PIN_GROUP(canfd0_data_b),
+               SH_PFC_PIN_GROUP(canfd1_data),
+               SH_PFC_PIN_GROUP(drif0_ctrl_a),
+               SH_PFC_PIN_GROUP(drif0_data0_a),
+               SH_PFC_PIN_GROUP(drif0_data1_a),
+               SH_PFC_PIN_GROUP(drif0_ctrl_b),
+               SH_PFC_PIN_GROUP(drif0_data0_b),
+               SH_PFC_PIN_GROUP(drif0_data1_b),
+               SH_PFC_PIN_GROUP(drif0_ctrl_c),
+               SH_PFC_PIN_GROUP(drif0_data0_c),
+               SH_PFC_PIN_GROUP(drif0_data1_c),
+               SH_PFC_PIN_GROUP(drif1_ctrl_a),
+               SH_PFC_PIN_GROUP(drif1_data0_a),
+               SH_PFC_PIN_GROUP(drif1_data1_a),
+               SH_PFC_PIN_GROUP(drif1_ctrl_b),
+               SH_PFC_PIN_GROUP(drif1_data0_b),
+               SH_PFC_PIN_GROUP(drif1_data1_b),
+               SH_PFC_PIN_GROUP(drif1_ctrl_c),
+               SH_PFC_PIN_GROUP(drif1_data0_c),
+               SH_PFC_PIN_GROUP(drif1_data1_c),
+               SH_PFC_PIN_GROUP(drif2_ctrl_a),
+               SH_PFC_PIN_GROUP(drif2_data0_a),
+               SH_PFC_PIN_GROUP(drif2_data1_a),
+               SH_PFC_PIN_GROUP(drif2_ctrl_b),
+               SH_PFC_PIN_GROUP(drif2_data0_b),
+               SH_PFC_PIN_GROUP(drif2_data1_b),
+               SH_PFC_PIN_GROUP(drif3_ctrl_a),
+               SH_PFC_PIN_GROUP(drif3_data0_a),
+               SH_PFC_PIN_GROUP(drif3_data1_a),
+               SH_PFC_PIN_GROUP(drif3_ctrl_b),
+               SH_PFC_PIN_GROUP(drif3_data0_b),
+               SH_PFC_PIN_GROUP(drif3_data1_b),
+       }
 };
 
 static const char * const audio_clk_groups[] = {
@@ -4588,12 +4588,8 @@ static const char * const du_groups[] = {
        "du_disp",
 };
 
-static const char * const gp7_02_groups[] = {
-       "gp7_02",
-};
-
-static const char * const gp7_03_groups[] = {
-       "gp7_03",
+static const char * const hdmi0_groups[] = {
+       "hdmi0_cec",
 };
 
 static const char * const hscif0_groups[] = {
@@ -4639,6 +4635,10 @@ static const char * const hscif4_groups[] = {
        "hscif4_data_b",
 };
 
+static const char * const i2c0_groups[] = {
+       "i2c0",
+};
+
 static const char * const i2c1_groups[] = {
        "i2c1_a",
        "i2c1_b",
@@ -4649,6 +4649,14 @@ static const char * const i2c2_groups[] = {
        "i2c2_b",
 };
 
+static const char * const i2c3_groups[] = {
+       "i2c3",
+};
+
+static const char * const i2c5_groups[] = {
+       "i2c5",
+};
+
 static const char * const i2c6_groups[] = {
        "i2c6_a",
        "i2c6_b",
@@ -4976,59 +4984,68 @@ static const char * const vin5_groups[] = {
        "vin5_clk",
 };
 
-static const struct sh_pfc_function pinmux_functions[] = {
-       SH_PFC_FUNCTION(audio_clk),
-       SH_PFC_FUNCTION(avb),
-       SH_PFC_FUNCTION(can0),
-       SH_PFC_FUNCTION(can1),
-       SH_PFC_FUNCTION(can_clk),
-       SH_PFC_FUNCTION(canfd0),
-       SH_PFC_FUNCTION(canfd1),
-       SH_PFC_FUNCTION(drif0),
-       SH_PFC_FUNCTION(drif1),
-       SH_PFC_FUNCTION(drif2),
-       SH_PFC_FUNCTION(drif3),
-       SH_PFC_FUNCTION(du),
-       SH_PFC_FUNCTION(gp7_02),
-       SH_PFC_FUNCTION(gp7_03),
-       SH_PFC_FUNCTION(hscif0),
-       SH_PFC_FUNCTION(hscif1),
-       SH_PFC_FUNCTION(hscif2),
-       SH_PFC_FUNCTION(hscif3),
-       SH_PFC_FUNCTION(hscif4),
-       SH_PFC_FUNCTION(i2c1),
-       SH_PFC_FUNCTION(i2c2),
-       SH_PFC_FUNCTION(i2c6),
-       SH_PFC_FUNCTION(intc_ex),
-       SH_PFC_FUNCTION(msiof0),
-       SH_PFC_FUNCTION(msiof1),
-       SH_PFC_FUNCTION(msiof2),
-       SH_PFC_FUNCTION(msiof3),
-       SH_PFC_FUNCTION(pwm0),
-       SH_PFC_FUNCTION(pwm1),
-       SH_PFC_FUNCTION(pwm2),
-       SH_PFC_FUNCTION(pwm3),
-       SH_PFC_FUNCTION(pwm4),
-       SH_PFC_FUNCTION(pwm5),
-       SH_PFC_FUNCTION(pwm6),
-       SH_PFC_FUNCTION(scif0),
-       SH_PFC_FUNCTION(scif1),
-       SH_PFC_FUNCTION(scif2),
-       SH_PFC_FUNCTION(scif3),
-       SH_PFC_FUNCTION(scif4),
-       SH_PFC_FUNCTION(scif5),
-       SH_PFC_FUNCTION(scif_clk),
-       SH_PFC_FUNCTION(sdhi0),
-       SH_PFC_FUNCTION(sdhi1),
-       SH_PFC_FUNCTION(sdhi2),
-       SH_PFC_FUNCTION(sdhi3),
-       SH_PFC_FUNCTION(ssi),
-       SH_PFC_FUNCTION(tmu),
-       SH_PFC_FUNCTION(usb0),
-       SH_PFC_FUNCTION(usb1),
-       SH_PFC_FUNCTION(usb30),
-       SH_PFC_FUNCTION(vin4),
-       SH_PFC_FUNCTION(vin5),
+static const struct {
+       struct sh_pfc_function common[48];
+       struct sh_pfc_function automotive[6];
+} pinmux_functions = {
+       .common = {
+               SH_PFC_FUNCTION(audio_clk),
+               SH_PFC_FUNCTION(avb),
+               SH_PFC_FUNCTION(can0),
+               SH_PFC_FUNCTION(can1),
+               SH_PFC_FUNCTION(can_clk),
+               SH_PFC_FUNCTION(du),
+               SH_PFC_FUNCTION(hdmi0),
+               SH_PFC_FUNCTION(hscif0),
+               SH_PFC_FUNCTION(hscif1),
+               SH_PFC_FUNCTION(hscif2),
+               SH_PFC_FUNCTION(hscif3),
+               SH_PFC_FUNCTION(hscif4),
+               SH_PFC_FUNCTION(i2c0),
+               SH_PFC_FUNCTION(i2c1),
+               SH_PFC_FUNCTION(i2c2),
+               SH_PFC_FUNCTION(i2c3),
+               SH_PFC_FUNCTION(i2c5),
+               SH_PFC_FUNCTION(i2c6),
+               SH_PFC_FUNCTION(intc_ex),
+               SH_PFC_FUNCTION(msiof0),
+               SH_PFC_FUNCTION(msiof1),
+               SH_PFC_FUNCTION(msiof2),
+               SH_PFC_FUNCTION(msiof3),
+               SH_PFC_FUNCTION(pwm0),
+               SH_PFC_FUNCTION(pwm1),
+               SH_PFC_FUNCTION(pwm2),
+               SH_PFC_FUNCTION(pwm3),
+               SH_PFC_FUNCTION(pwm4),
+               SH_PFC_FUNCTION(pwm5),
+               SH_PFC_FUNCTION(pwm6),
+               SH_PFC_FUNCTION(scif0),
+               SH_PFC_FUNCTION(scif1),
+               SH_PFC_FUNCTION(scif2),
+               SH_PFC_FUNCTION(scif3),
+               SH_PFC_FUNCTION(scif4),
+               SH_PFC_FUNCTION(scif5),
+               SH_PFC_FUNCTION(scif_clk),
+               SH_PFC_FUNCTION(sdhi0),
+               SH_PFC_FUNCTION(sdhi1),
+               SH_PFC_FUNCTION(sdhi2),
+               SH_PFC_FUNCTION(sdhi3),
+               SH_PFC_FUNCTION(ssi),
+               SH_PFC_FUNCTION(tmu),
+               SH_PFC_FUNCTION(usb0),
+               SH_PFC_FUNCTION(usb1),
+               SH_PFC_FUNCTION(usb30),
+               SH_PFC_FUNCTION(vin4),
+               SH_PFC_FUNCTION(vin5),
+       },
+       .automotive = {
+               SH_PFC_FUNCTION(canfd0),
+               SH_PFC_FUNCTION(canfd1),
+               SH_PFC_FUNCTION(drif0),
+               SH_PFC_FUNCTION(drif1),
+               SH_PFC_FUNCTION(drif2),
+               SH_PFC_FUNCTION(drif3),
+       }
 };
 
 static const struct pinmux_cfg_reg pinmux_config_regs[] = {
@@ -5707,7 +5724,7 @@ static const struct pinmux_drive_reg pinmux_drive_regs[] = {
                { RCAR_GP_PIN(0, 15),   24, 3 },        /* D15 */
                { RCAR_GP_PIN(7,  0),   20, 3 },        /* AVS1 */
                { RCAR_GP_PIN(7,  1),   16, 3 },        /* AVS2 */
-               { RCAR_GP_PIN(7,  2),   12, 3 },        /* GP7_02 */
+               { RCAR_GP_PIN(7,  2),   12, 3 },        /* HDMI0_CEC */
                { RCAR_GP_PIN(7,  3),    8, 3 },        /* GP7_03 */
                { PIN_A_NUMBER('P', 7),  4, 2 },        /* DU_DOTCLKIN0 */
                { PIN_A_NUMBER('P', 8),  0, 2 },        /* DU_DOTCLKIN1 */
@@ -5961,7 +5978,7 @@ static const struct pinmux_bias_reg pinmux_bias_regs[] = {
                [25] = RCAR_GP_PIN(0, 15),      /* D15 */
                [26] = RCAR_GP_PIN(7,  0),      /* AVS1 */
                [27] = RCAR_GP_PIN(7,  1),      /* AVS2 */
-               [28] = RCAR_GP_PIN(7,  2),      /* GP7_02 */
+               [28] = RCAR_GP_PIN(7,  2),      /* HDMI0_CEC */
                [29] = RCAR_GP_PIN(7,  3),      /* GP7_03 */
                [30] = PIN_A_NUMBER('P', 7),    /* DU_DOTCLKIN0 */
                [31] = PIN_A_NUMBER('P', 8),    /* DU_DOTCLKIN1 */
@@ -6152,6 +6169,32 @@ static const struct sh_pfc_soc_operations r8a7796_pinmux_ops = {
        .set_bias = r8a7796_pinmux_set_bias,
 };
 
+#ifdef CONFIG_PINCTRL_PFC_R8A774A1
+const struct sh_pfc_soc_info r8a774a1_pinmux_info = {
+       .name = "r8a774a1_pfc",
+       .ops = &r8a7796_pinmux_ops,
+       .unlock_reg = 0xe6060000, /* PMMR */
+
+       .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
+
+       .pins = pinmux_pins,
+       .nr_pins = ARRAY_SIZE(pinmux_pins),
+       .groups = pinmux_groups.common,
+       .nr_groups = ARRAY_SIZE(pinmux_groups.common),
+       .functions = pinmux_functions.common,
+       .nr_functions = ARRAY_SIZE(pinmux_functions.common),
+
+       .cfg_regs = pinmux_config_regs,
+       .drive_regs = pinmux_drive_regs,
+       .bias_regs = pinmux_bias_regs,
+       .ioctrl_regs = pinmux_ioctrl_regs,
+
+       .pinmux_data = pinmux_data,
+       .pinmux_data_size = ARRAY_SIZE(pinmux_data),
+};
+#endif
+
+#ifdef CONFIG_PINCTRL_PFC_R8A7796
 const struct sh_pfc_soc_info r8a7796_pinmux_info = {
        .name = "r8a77960_pfc",
        .ops = &r8a7796_pinmux_ops,
@@ -6161,10 +6204,12 @@ const struct sh_pfc_soc_info r8a7796_pinmux_info = {
 
        .pins = pinmux_pins,
        .nr_pins = ARRAY_SIZE(pinmux_pins),
-       .groups = pinmux_groups,
-       .nr_groups = ARRAY_SIZE(pinmux_groups),
-       .functions = pinmux_functions,
-       .nr_functions = ARRAY_SIZE(pinmux_functions),
+       .groups = pinmux_groups.common,
+       .nr_groups = ARRAY_SIZE(pinmux_groups.common) +
+               ARRAY_SIZE(pinmux_groups.automotive),
+       .functions = pinmux_functions.common,
+       .nr_functions = ARRAY_SIZE(pinmux_functions.common) +
+               ARRAY_SIZE(pinmux_functions.automotive),
 
        .cfg_regs = pinmux_config_regs,
        .drive_regs = pinmux_drive_regs,
@@ -6174,3 +6219,4 @@ const struct sh_pfc_soc_info r8a7796_pinmux_info = {
        .pinmux_data = pinmux_data,
        .pinmux_data_size = ARRAY_SIZE(pinmux_data),
 };
+#endif
diff --git a/drivers/pinctrl/renesas/pfc-r8a77965.c b/drivers/pinctrl/renesas/pfc-r8a77965.c
new file mode 100644 (file)
index 0000000..7c24836
--- /dev/null
@@ -0,0 +1,6350 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * R8A77965 processor support - PFC hardware block.
+ *
+ * Copyright (C) 2018 Jacopo Mondi <jacopo+renesas@jmondi.org>
+ * Copyright (C) 2016 Renesas Electronics Corp.
+ *
+ * This file is based on the drivers/pinctrl/sh-pfc/pfc-r8a7796.c
+ *
+ * R-Car Gen3 processor support - PFC hardware block.
+ *
+ * Copyright (C) 2015  Renesas Electronics Corporation
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <errno.h>
+#include <dm/pinctrl.h>
+#include <linux/kernel.h>
+
+#include "sh_pfc.h"
+
+#define CFG_FLAGS (SH_PFC_PIN_CFG_DRIVE_STRENGTH | \
+                  SH_PFC_PIN_CFG_PULL_UP | \
+                  SH_PFC_PIN_CFG_PULL_DOWN)
+
+#define CPU_ALL_PORT(fn, sfx)                                          \
+       PORT_GP_CFG_16(0, fn, sfx, CFG_FLAGS),  \
+       PORT_GP_CFG_29(1, fn, sfx, CFG_FLAGS),  \
+       PORT_GP_CFG_15(2, fn, sfx, CFG_FLAGS),  \
+       PORT_GP_CFG_12(3, fn, sfx, CFG_FLAGS | SH_PFC_PIN_CFG_IO_VOLTAGE),      \
+       PORT_GP_CFG_1(3, 12, fn, sfx, CFG_FLAGS),       \
+       PORT_GP_CFG_1(3, 13, fn, sfx, CFG_FLAGS),       \
+       PORT_GP_CFG_1(3, 14, fn, sfx, CFG_FLAGS),       \
+       PORT_GP_CFG_1(3, 15, fn, sfx, CFG_FLAGS),       \
+       PORT_GP_CFG_18(4, fn, sfx, CFG_FLAGS | SH_PFC_PIN_CFG_IO_VOLTAGE),      \
+       PORT_GP_CFG_26(5, fn, sfx, CFG_FLAGS),  \
+       PORT_GP_CFG_32(6, fn, sfx, CFG_FLAGS),  \
+       PORT_GP_CFG_4(7, fn, sfx, CFG_FLAGS)
+/*
+ * F_() : just information
+ * FM() : macro for FN_xxx / xxx_MARK
+ */
+
+/* GPSR0 */
+#define GPSR0_15       F_(D15,                 IP7_11_8)
+#define GPSR0_14       F_(D14,                 IP7_7_4)
+#define GPSR0_13       F_(D13,                 IP7_3_0)
+#define GPSR0_12       F_(D12,                 IP6_31_28)
+#define GPSR0_11       F_(D11,                 IP6_27_24)
+#define GPSR0_10       F_(D10,                 IP6_23_20)
+#define GPSR0_9                F_(D9,                  IP6_19_16)
+#define GPSR0_8                F_(D8,                  IP6_15_12)
+#define GPSR0_7                F_(D7,                  IP6_11_8)
+#define GPSR0_6                F_(D6,                  IP6_7_4)
+#define GPSR0_5                F_(D5,                  IP6_3_0)
+#define GPSR0_4                F_(D4,                  IP5_31_28)
+#define GPSR0_3                F_(D3,                  IP5_27_24)
+#define GPSR0_2                F_(D2,                  IP5_23_20)
+#define GPSR0_1                F_(D1,                  IP5_19_16)
+#define GPSR0_0                F_(D0,                  IP5_15_12)
+
+/* GPSR1 */
+#define GPSR1_28       FM(CLKOUT)
+#define GPSR1_27       F_(EX_WAIT0_A,          IP5_11_8)
+#define GPSR1_26       F_(WE1_N,               IP5_7_4)
+#define GPSR1_25       F_(WE0_N,               IP5_3_0)
+#define GPSR1_24       F_(RD_WR_N,             IP4_31_28)
+#define GPSR1_23       F_(RD_N,                IP4_27_24)
+#define GPSR1_22       F_(BS_N,                IP4_23_20)
+#define GPSR1_21       F_(CS1_N,               IP4_19_16)
+#define GPSR1_20       F_(CS0_N,               IP4_15_12)
+#define GPSR1_19       F_(A19,                 IP4_11_8)
+#define GPSR1_18       F_(A18,                 IP4_7_4)
+#define GPSR1_17       F_(A17,                 IP4_3_0)
+#define GPSR1_16       F_(A16,                 IP3_31_28)
+#define GPSR1_15       F_(A15,                 IP3_27_24)
+#define GPSR1_14       F_(A14,                 IP3_23_20)
+#define GPSR1_13       F_(A13,                 IP3_19_16)
+#define GPSR1_12       F_(A12,                 IP3_15_12)
+#define GPSR1_11       F_(A11,                 IP3_11_8)
+#define GPSR1_10       F_(A10,                 IP3_7_4)
+#define GPSR1_9                F_(A9,                  IP3_3_0)
+#define GPSR1_8                F_(A8,                  IP2_31_28)
+#define GPSR1_7                F_(A7,                  IP2_27_24)
+#define GPSR1_6                F_(A6,                  IP2_23_20)
+#define GPSR1_5                F_(A5,                  IP2_19_16)
+#define GPSR1_4                F_(A4,                  IP2_15_12)
+#define GPSR1_3                F_(A3,                  IP2_11_8)
+#define GPSR1_2                F_(A2,                  IP2_7_4)
+#define GPSR1_1                F_(A1,                  IP2_3_0)
+#define GPSR1_0                F_(A0,                  IP1_31_28)
+
+/* GPSR2 */
+#define GPSR2_14       F_(AVB_AVTP_CAPTURE_A,  IP0_23_20)
+#define GPSR2_13       F_(AVB_AVTP_MATCH_A,    IP0_19_16)
+#define GPSR2_12       F_(AVB_LINK,            IP0_15_12)
+#define GPSR2_11       F_(AVB_PHY_INT,         IP0_11_8)
+#define GPSR2_10       F_(AVB_MAGIC,           IP0_7_4)
+#define GPSR2_9                F_(AVB_MDC,             IP0_3_0)
+#define GPSR2_8                F_(PWM2_A,              IP1_27_24)
+#define GPSR2_7                F_(PWM1_A,              IP1_23_20)
+#define GPSR2_6                F_(PWM0,                IP1_19_16)
+#define GPSR2_5                F_(IRQ5,                IP1_15_12)
+#define GPSR2_4                F_(IRQ4,                IP1_11_8)
+#define GPSR2_3                F_(IRQ3,                IP1_7_4)
+#define GPSR2_2                F_(IRQ2,                IP1_3_0)
+#define GPSR2_1                F_(IRQ1,                IP0_31_28)
+#define GPSR2_0                F_(IRQ0,                IP0_27_24)
+
+/* GPSR3 */
+#define GPSR3_15       F_(SD1_WP,              IP11_23_20)
+#define GPSR3_14       F_(SD1_CD,              IP11_19_16)
+#define GPSR3_13       F_(SD0_WP,              IP11_15_12)
+#define GPSR3_12       F_(SD0_CD,              IP11_11_8)
+#define GPSR3_11       F_(SD1_DAT3,            IP8_31_28)
+#define GPSR3_10       F_(SD1_DAT2,            IP8_27_24)
+#define GPSR3_9                F_(SD1_DAT1,            IP8_23_20)
+#define GPSR3_8                F_(SD1_DAT0,            IP8_19_16)
+#define GPSR3_7                F_(SD1_CMD,             IP8_15_12)
+#define GPSR3_6                F_(SD1_CLK,             IP8_11_8)
+#define GPSR3_5                F_(SD0_DAT3,            IP8_7_4)
+#define GPSR3_4                F_(SD0_DAT2,            IP8_3_0)
+#define GPSR3_3                F_(SD0_DAT1,            IP7_31_28)
+#define GPSR3_2                F_(SD0_DAT0,            IP7_27_24)
+#define GPSR3_1                F_(SD0_CMD,             IP7_23_20)
+#define GPSR3_0                F_(SD0_CLK,             IP7_19_16)
+
+/* GPSR4 */
+#define GPSR4_17       F_(SD3_DS,              IP11_7_4)
+#define GPSR4_16       F_(SD3_DAT7,            IP11_3_0)
+#define GPSR4_15       F_(SD3_DAT6,            IP10_31_28)
+#define GPSR4_14       F_(SD3_DAT5,            IP10_27_24)
+#define GPSR4_13       F_(SD3_DAT4,            IP10_23_20)
+#define GPSR4_12       F_(SD3_DAT3,            IP10_19_16)
+#define GPSR4_11       F_(SD3_DAT2,            IP10_15_12)
+#define GPSR4_10       F_(SD3_DAT1,            IP10_11_8)
+#define GPSR4_9                F_(SD3_DAT0,            IP10_7_4)
+#define GPSR4_8                F_(SD3_CMD,             IP10_3_0)
+#define GPSR4_7                F_(SD3_CLK,             IP9_31_28)
+#define GPSR4_6                F_(SD2_DS,              IP9_27_24)
+#define GPSR4_5                F_(SD2_DAT3,            IP9_23_20)
+#define GPSR4_4                F_(SD2_DAT2,            IP9_19_16)
+#define GPSR4_3                F_(SD2_DAT1,            IP9_15_12)
+#define GPSR4_2                F_(SD2_DAT0,            IP9_11_8)
+#define GPSR4_1                F_(SD2_CMD,             IP9_7_4)
+#define GPSR4_0                F_(SD2_CLK,             IP9_3_0)
+
+/* GPSR5 */
+#define GPSR5_25       F_(MLB_DAT,             IP14_19_16)
+#define GPSR5_24       F_(MLB_SIG,             IP14_15_12)
+#define GPSR5_23       F_(MLB_CLK,             IP14_11_8)
+#define GPSR5_22       FM(MSIOF0_RXD)
+#define GPSR5_21       F_(MSIOF0_SS2,          IP14_7_4)
+#define GPSR5_20       FM(MSIOF0_TXD)
+#define GPSR5_19       F_(MSIOF0_SS1,          IP14_3_0)
+#define GPSR5_18       F_(MSIOF0_SYNC,         IP13_31_28)
+#define GPSR5_17       FM(MSIOF0_SCK)
+#define GPSR5_16       F_(HRTS0_N,             IP13_27_24)
+#define GPSR5_15       F_(HCTS0_N,             IP13_23_20)
+#define GPSR5_14       F_(HTX0,                IP13_19_16)
+#define GPSR5_13       F_(HRX0,                IP13_15_12)
+#define GPSR5_12       F_(HSCK0,               IP13_11_8)
+#define GPSR5_11       F_(RX2_A,               IP13_7_4)
+#define GPSR5_10       F_(TX2_A,               IP13_3_0)
+#define GPSR5_9                F_(SCK2,                IP12_31_28)
+#define GPSR5_8                F_(RTS1_N,              IP12_27_24)
+#define GPSR5_7                F_(CTS1_N,              IP12_23_20)
+#define GPSR5_6                F_(TX1_A,               IP12_19_16)
+#define GPSR5_5                F_(RX1_A,               IP12_15_12)
+#define GPSR5_4                F_(RTS0_N,              IP12_11_8)
+#define GPSR5_3                F_(CTS0_N,              IP12_7_4)
+#define GPSR5_2                F_(TX0,                 IP12_3_0)
+#define GPSR5_1                F_(RX0,                 IP11_31_28)
+#define GPSR5_0                F_(SCK0,                IP11_27_24)
+
+/* GPSR6 */
+#define GPSR6_31       F_(GP6_31,              IP18_7_4)
+#define GPSR6_30       F_(GP6_30,              IP18_3_0)
+#define GPSR6_29       F_(USB30_OVC,           IP17_31_28)
+#define GPSR6_28       F_(USB30_PWEN,          IP17_27_24)
+#define GPSR6_27       F_(USB1_OVC,            IP17_23_20)
+#define GPSR6_26       F_(USB1_PWEN,           IP17_19_16)
+#define GPSR6_25       F_(USB0_OVC,            IP17_15_12)
+#define GPSR6_24       F_(USB0_PWEN,           IP17_11_8)
+#define GPSR6_23       F_(AUDIO_CLKB_B,        IP17_7_4)
+#define GPSR6_22       F_(AUDIO_CLKA_A,        IP17_3_0)
+#define GPSR6_21       F_(SSI_SDATA9_A,        IP16_31_28)
+#define GPSR6_20       F_(SSI_SDATA8,          IP16_27_24)
+#define GPSR6_19       F_(SSI_SDATA7,          IP16_23_20)
+#define GPSR6_18       F_(SSI_WS78,            IP16_19_16)
+#define GPSR6_17       F_(SSI_SCK78,           IP16_15_12)
+#define GPSR6_16       F_(SSI_SDATA6,          IP16_11_8)
+#define GPSR6_15       F_(SSI_WS6,             IP16_7_4)
+#define GPSR6_14       F_(SSI_SCK6,            IP16_3_0)
+#define GPSR6_13       FM(SSI_SDATA5)
+#define GPSR6_12       FM(SSI_WS5)
+#define GPSR6_11       FM(SSI_SCK5)
+#define GPSR6_10       F_(SSI_SDATA4,          IP15_31_28)
+#define GPSR6_9                F_(SSI_WS4,             IP15_27_24)
+#define GPSR6_8                F_(SSI_SCK4,            IP15_23_20)
+#define GPSR6_7                F_(SSI_SDATA3,          IP15_19_16)
+#define GPSR6_6                F_(SSI_WS349,           IP15_15_12)
+#define GPSR6_5                F_(SSI_SCK349,          IP15_11_8)
+#define GPSR6_4                F_(SSI_SDATA2_A,        IP15_7_4)
+#define GPSR6_3                F_(SSI_SDATA1_A,        IP15_3_0)
+#define GPSR6_2                F_(SSI_SDATA0,          IP14_31_28)
+#define GPSR6_1                F_(SSI_WS01239,         IP14_27_24)
+#define GPSR6_0                F_(SSI_SCK01239,        IP14_23_20)
+
+/* GPSR7 */
+#define GPSR7_3                FM(GP7_03)
+#define GPSR7_2                FM(HDMI0_CEC)
+#define GPSR7_1                FM(AVS2)
+#define GPSR7_0                FM(AVS1)
+
+
+/* IPSRx */            /* 0 */                 /* 1 */         /* 2 */                 /* 3 */                         /* 4 */         /* 5 */         /* 6 */                 /* 7 */         /* 8 */                 /* 9 */         /* A */         /* B */         /* C - F */
+#define IP0_3_0                FM(AVB_MDC)             F_(0, 0)        FM(MSIOF2_SS2_C)        F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP0_7_4                FM(AVB_MAGIC)           F_(0, 0)        FM(MSIOF2_SS1_C)        FM(SCK4_A)                      F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP0_11_8       FM(AVB_PHY_INT)         F_(0, 0)        FM(MSIOF2_SYNC_C)       FM(RX4_A)                       F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP0_15_12      FM(AVB_LINK)            F_(0, 0)        FM(MSIOF2_SCK_C)        FM(TX4_A)                       F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP0_19_16      FM(AVB_AVTP_MATCH_A)    F_(0, 0)        FM(MSIOF2_RXD_C)        FM(CTS4_N_A)                    F_(0, 0)        FM(FSCLKST2_N_A) F_(0, 0)               F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP0_23_20      FM(AVB_AVTP_CAPTURE_A)  F_(0, 0)        FM(MSIOF2_TXD_C)        FM(RTS4_N_A)                    F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP0_27_24      FM(IRQ0)                FM(QPOLB)       F_(0, 0)                FM(DU_CDE)                      FM(VI4_DATA0_B) FM(CAN0_TX_B)   FM(CANFD0_TX_B)         FM(MSIOF3_SS2_E) F_(0, 0)               F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP0_31_28      FM(IRQ1)                FM(QPOLA)       F_(0, 0)                FM(DU_DISP)                     FM(VI4_DATA1_B) FM(CAN0_RX_B)   FM(CANFD0_RX_B)         FM(MSIOF3_SS1_E) F_(0, 0)               F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP1_3_0                FM(IRQ2)                FM(QCPV_QDE)    F_(0, 0)                FM(DU_EXODDF_DU_ODDF_DISP_CDE)  FM(VI4_DATA2_B) F_(0, 0)        F_(0, 0)                FM(MSIOF3_SYNC_E) F_(0, 0)              FM(PWM3_B)      F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP1_7_4                FM(IRQ3)                FM(QSTVB_QVE)   F_(0, 0)                FM(DU_DOTCLKOUT1)               FM(VI4_DATA3_B) F_(0, 0)        F_(0, 0)                FM(MSIOF3_SCK_E) F_(0, 0)               FM(PWM4_B)      F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP1_11_8       FM(IRQ4)                FM(QSTH_QHS)    F_(0, 0)                FM(DU_EXHSYNC_DU_HSYNC)         FM(VI4_DATA4_B) F_(0, 0)        F_(0, 0)                FM(MSIOF3_RXD_E) F_(0, 0)               FM(PWM5_B)      F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP1_15_12      FM(IRQ5)                FM(QSTB_QHE)    F_(0, 0)                FM(DU_EXVSYNC_DU_VSYNC)         FM(VI4_DATA5_B) FM(FSCLKST2_N_B) F_(0, 0)               FM(MSIOF3_TXD_E) F_(0, 0)               FM(PWM6_B)      F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP1_19_16      FM(PWM0)                FM(AVB_AVTP_PPS)F_(0, 0)                F_(0, 0)                        FM(VI4_DATA6_B) F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                FM(IECLK_B)     F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP1_23_20      FM(PWM1_A)              F_(0, 0)        F_(0, 0)                FM(HRX3_D)                      FM(VI4_DATA7_B) F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                FM(IERX_B)      F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP1_27_24      FM(PWM2_A)              F_(0, 0)        F_(0, 0)                FM(HTX3_D)                      F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                FM(IETX_B)      F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP1_31_28      FM(A0)                  FM(LCDOUT16)    FM(MSIOF3_SYNC_B)       F_(0, 0)                        FM(VI4_DATA8)   F_(0, 0)        FM(DU_DB0)              F_(0, 0)        F_(0, 0)                FM(PWM3_A)      F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP2_3_0                FM(A1)                  FM(LCDOUT17)    FM(MSIOF3_TXD_B)        F_(0, 0)                        FM(VI4_DATA9)   F_(0, 0)        FM(DU_DB1)              F_(0, 0)        F_(0, 0)                FM(PWM4_A)      F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP2_7_4                FM(A2)                  FM(LCDOUT18)    FM(MSIOF3_SCK_B)        F_(0, 0)                        FM(VI4_DATA10)  F_(0, 0)        FM(DU_DB2)              F_(0, 0)        F_(0, 0)                FM(PWM5_A)      F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP2_11_8       FM(A3)                  FM(LCDOUT19)    FM(MSIOF3_RXD_B)        F_(0, 0)                        FM(VI4_DATA11)  F_(0, 0)        FM(DU_DB3)              F_(0, 0)        F_(0, 0)                FM(PWM6_A)      F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP2_15_12      FM(A4)                  FM(LCDOUT20)    FM(MSIOF3_SS1_B)        F_(0, 0)                        FM(VI4_DATA12)  FM(VI5_DATA12)  FM(DU_DB4)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP2_19_16      FM(A5)                  FM(LCDOUT21)    FM(MSIOF3_SS2_B)        FM(SCK4_B)                      FM(VI4_DATA13)  FM(VI5_DATA13)  FM(DU_DB5)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP2_23_20      FM(A6)                  FM(LCDOUT22)    FM(MSIOF2_SS1_A)        FM(RX4_B)                       FM(VI4_DATA14)  FM(VI5_DATA14)  FM(DU_DB6)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP2_27_24      FM(A7)                  FM(LCDOUT23)    FM(MSIOF2_SS2_A)        FM(TX4_B)                       FM(VI4_DATA15)  FM(VI5_DATA15)  FM(DU_DB7)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP2_31_28      FM(A8)                  FM(RX3_B)       FM(MSIOF2_SYNC_A)       FM(HRX4_B)                      F_(0, 0)        F_(0, 0)        F_(0, 0)                FM(SDA6_A)      FM(AVB_AVTP_MATCH_B)    FM(PWM1_B)      F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP3_3_0                FM(A9)                  F_(0, 0)        FM(MSIOF2_SCK_A)        FM(CTS4_N_B)                    F_(0, 0)        FM(VI5_VSYNC_N) F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP3_7_4                FM(A10)                 F_(0, 0)        FM(MSIOF2_RXD_A)        FM(RTS4_N_B)                    F_(0, 0)        FM(VI5_HSYNC_N) F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP3_11_8       FM(A11)                 FM(TX3_B)       FM(MSIOF2_TXD_A)        FM(HTX4_B)                      FM(HSCK4)       FM(VI5_FIELD)   F_(0, 0)                FM(SCL6_A)      FM(AVB_AVTP_CAPTURE_B)  FM(PWM2_B)      F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+
+/* IPSRx */            /* 0 */                 /* 1 */         /* 2 */                 /* 3 */                         /* 4 */         /* 5 */         /* 6 */                 /* 7 */         /* 8 */                 /* 9 */         /* A */         /* B */         /* C - F */
+#define IP3_15_12      FM(A12)                 FM(LCDOUT12)    FM(MSIOF3_SCK_C)        F_(0, 0)                        FM(HRX4_A)      FM(VI5_DATA8)   FM(DU_DG4)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP3_19_16      FM(A13)                 FM(LCDOUT13)    FM(MSIOF3_SYNC_C)       F_(0, 0)                        FM(HTX4_A)      FM(VI5_DATA9)   FM(DU_DG5)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP3_23_20      FM(A14)                 FM(LCDOUT14)    FM(MSIOF3_RXD_C)        F_(0, 0)                        FM(HCTS4_N)     FM(VI5_DATA10)  FM(DU_DG6)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP3_27_24      FM(A15)                 FM(LCDOUT15)    FM(MSIOF3_TXD_C)        F_(0, 0)                        FM(HRTS4_N)     FM(VI5_DATA11)  FM(DU_DG7)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP3_31_28      FM(A16)                 FM(LCDOUT8)     F_(0, 0)                F_(0, 0)                        FM(VI4_FIELD)   F_(0, 0)        FM(DU_DG0)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP4_3_0                FM(A17)                 FM(LCDOUT9)     F_(0, 0)                F_(0, 0)                        FM(VI4_VSYNC_N) F_(0, 0)        FM(DU_DG1)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP4_7_4                FM(A18)                 FM(LCDOUT10)    F_(0, 0)                F_(0, 0)                        FM(VI4_HSYNC_N) F_(0, 0)        FM(DU_DG2)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP4_11_8       FM(A19)                 FM(LCDOUT11)    F_(0, 0)                F_(0, 0)                        FM(VI4_CLKENB)  F_(0, 0)        FM(DU_DG3)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP4_15_12      FM(CS0_N)               F_(0, 0)        F_(0, 0)                F_(0, 0)                        F_(0, 0)        FM(VI5_CLKENB)  F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP4_19_16      FM(CS1_N)               F_(0, 0)        F_(0, 0)                F_(0, 0)                        F_(0, 0)        FM(VI5_CLK)     F_(0, 0)                FM(EX_WAIT0_B)  F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP4_23_20      FM(BS_N)                FM(QSTVA_QVS)   FM(MSIOF3_SCK_D)        FM(SCK3)                        FM(HSCK3)       F_(0, 0)        F_(0, 0)                F_(0, 0)        FM(CAN1_TX)             FM(CANFD1_TX)   FM(IETX_A)      F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP4_27_24      FM(RD_N)                F_(0, 0)        FM(MSIOF3_SYNC_D)       FM(RX3_A)                       FM(HRX3_A)      F_(0, 0)        F_(0, 0)                F_(0, 0)        FM(CAN0_TX_A)           FM(CANFD0_TX_A) F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP4_31_28      FM(RD_WR_N)             F_(0, 0)        FM(MSIOF3_RXD_D)        FM(TX3_A)                       FM(HTX3_A)      F_(0, 0)        F_(0, 0)                F_(0, 0)        FM(CAN0_RX_A)           FM(CANFD0_RX_A) F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP5_3_0                FM(WE0_N)               F_(0, 0)        FM(MSIOF3_TXD_D)        FM(CTS3_N)                      FM(HCTS3_N)     F_(0, 0)        F_(0, 0)                FM(SCL6_B)      FM(CAN_CLK)             F_(0, 0)        FM(IECLK_A)     F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP5_7_4                FM(WE1_N)               F_(0, 0)        FM(MSIOF3_SS1_D)        FM(RTS3_N)                      FM(HRTS3_N)     F_(0, 0)        F_(0, 0)                FM(SDA6_B)      FM(CAN1_RX)             FM(CANFD1_RX)   FM(IERX_A)      F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP5_11_8       FM(EX_WAIT0_A)          FM(QCLK)        F_(0, 0)                F_(0, 0)                        FM(VI4_CLK)     F_(0, 0)        FM(DU_DOTCLKOUT0)       F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP5_15_12      FM(D0)                  FM(MSIOF2_SS1_B)FM(MSIOF3_SCK_A)        F_(0, 0)                        FM(VI4_DATA16)  FM(VI5_DATA0)   F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP5_19_16      FM(D1)                  FM(MSIOF2_SS2_B)FM(MSIOF3_SYNC_A)       F_(0, 0)                        FM(VI4_DATA17)  FM(VI5_DATA1)   F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP5_23_20      FM(D2)                  F_(0, 0)        FM(MSIOF3_RXD_A)        F_(0, 0)                        FM(VI4_DATA18)  FM(VI5_DATA2)   F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP5_27_24      FM(D3)                  F_(0, 0)        FM(MSIOF3_TXD_A)        F_(0, 0)                        FM(VI4_DATA19)  FM(VI5_DATA3)   F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP5_31_28      FM(D4)                  FM(MSIOF2_SCK_B)F_(0, 0)                F_(0, 0)                        FM(VI4_DATA20)  FM(VI5_DATA4)   F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP6_3_0                FM(D5)                  FM(MSIOF2_SYNC_B)F_(0, 0)               F_(0, 0)                        FM(VI4_DATA21)  FM(VI5_DATA5)   F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP6_7_4                FM(D6)                  FM(MSIOF2_RXD_B)F_(0, 0)                F_(0, 0)                        FM(VI4_DATA22)  FM(VI5_DATA6)   F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP6_11_8       FM(D7)                  FM(MSIOF2_TXD_B)F_(0, 0)                F_(0, 0)                        FM(VI4_DATA23)  FM(VI5_DATA7)   F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP6_15_12      FM(D8)                  FM(LCDOUT0)     FM(MSIOF2_SCK_D)        FM(SCK4_C)                      FM(VI4_DATA0_A) F_(0, 0)        FM(DU_DR0)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP6_19_16      FM(D9)                  FM(LCDOUT1)     FM(MSIOF2_SYNC_D)       F_(0, 0)                        FM(VI4_DATA1_A) F_(0, 0)        FM(DU_DR1)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP6_23_20      FM(D10)                 FM(LCDOUT2)     FM(MSIOF2_RXD_D)        FM(HRX3_B)                      FM(VI4_DATA2_A) FM(CTS4_N_C)    FM(DU_DR2)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP6_27_24      FM(D11)                 FM(LCDOUT3)     FM(MSIOF2_TXD_D)        FM(HTX3_B)                      FM(VI4_DATA3_A) FM(RTS4_N_C)    FM(DU_DR3)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP6_31_28      FM(D12)                 FM(LCDOUT4)     FM(MSIOF2_SS1_D)        FM(RX4_C)                       FM(VI4_DATA4_A) F_(0, 0)        FM(DU_DR4)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+
+/* IPSRx */            /* 0 */                 /* 1 */         /* 2 */                 /* 3 */                         /* 4 */         /* 5 */         /* 6 */                 /* 7 */         /* 8 */                 /* 9 */         /* A */         /* B */         /* C - F */
+#define IP7_3_0                FM(D13)                 FM(LCDOUT5)     FM(MSIOF2_SS2_D)        FM(TX4_C)                       FM(VI4_DATA5_A) F_(0, 0)        FM(DU_DR5)              F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP7_7_4                FM(D14)                 FM(LCDOUT6)     FM(MSIOF3_SS1_A)        FM(HRX3_C)                      FM(VI4_DATA6_A) F_(0, 0)        FM(DU_DR6)              FM(SCL6_C)      F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP7_11_8       FM(D15)                 FM(LCDOUT7)     FM(MSIOF3_SS2_A)        FM(HTX3_C)                      FM(VI4_DATA7_A) F_(0, 0)        FM(DU_DR7)              FM(SDA6_C)      F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP7_19_16      FM(SD0_CLK)             F_(0, 0)        FM(MSIOF1_SCK_E)        F_(0, 0)                        F_(0, 0)        F_(0, 0)        FM(STP_OPWM_0_B)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP7_23_20      FM(SD0_CMD)             F_(0, 0)        FM(MSIOF1_SYNC_E)       F_(0, 0)                        F_(0, 0)        F_(0, 0)        FM(STP_IVCXO27_0_B)     F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP7_27_24      FM(SD0_DAT0)            F_(0, 0)        FM(MSIOF1_RXD_E)        F_(0, 0)                        F_(0, 0)        FM(TS_SCK0_B)   FM(STP_ISCLK_0_B)       F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP7_31_28      FM(SD0_DAT1)            F_(0, 0)        FM(MSIOF1_TXD_E)        F_(0, 0)                        F_(0, 0)        FM(TS_SPSYNC0_B)FM(STP_ISSYNC_0_B)      F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP8_3_0                FM(SD0_DAT2)            F_(0, 0)        FM(MSIOF1_SS1_E)        F_(0, 0)                        F_(0, 0)        FM(TS_SDAT0_B)  FM(STP_ISD_0_B)         F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP8_7_4                FM(SD0_DAT3)            F_(0, 0)        FM(MSIOF1_SS2_E)        F_(0, 0)                        F_(0, 0)        FM(TS_SDEN0_B)  FM(STP_ISEN_0_B)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP8_11_8       FM(SD1_CLK)             F_(0, 0)        FM(MSIOF1_SCK_G)        F_(0, 0)                        F_(0, 0)        FM(SIM0_CLK_A)  F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP8_15_12      FM(SD1_CMD)             F_(0, 0)        FM(MSIOF1_SYNC_G)       FM(NFCE_N_B)                    F_(0, 0)        FM(SIM0_D_A)    FM(STP_IVCXO27_1_B)     F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP8_19_16      FM(SD1_DAT0)            FM(SD2_DAT4)    FM(MSIOF1_RXD_G)        FM(NFWP_N_B)                    F_(0, 0)        FM(TS_SCK1_B)   FM(STP_ISCLK_1_B)       F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP8_23_20      FM(SD1_DAT1)            FM(SD2_DAT5)    FM(MSIOF1_TXD_G)        FM(NFDATA14_B)                  F_(0, 0)        FM(TS_SPSYNC1_B)FM(STP_ISSYNC_1_B)      F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP8_27_24      FM(SD1_DAT2)            FM(SD2_DAT6)    FM(MSIOF1_SS1_G)        FM(NFDATA15_B)                  F_(0, 0)        FM(TS_SDAT1_B)  FM(STP_ISD_1_B)         F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP8_31_28      FM(SD1_DAT3)            FM(SD2_DAT7)    FM(MSIOF1_SS2_G)        FM(NFRB_N_B)                    F_(0, 0)        FM(TS_SDEN1_B)  FM(STP_ISEN_1_B)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP9_3_0                FM(SD2_CLK)             F_(0, 0)        FM(NFDATA8)             F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP9_7_4                FM(SD2_CMD)             F_(0, 0)        FM(NFDATA9)             F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP9_11_8       FM(SD2_DAT0)            F_(0, 0)        FM(NFDATA10)            F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP9_15_12      FM(SD2_DAT1)            F_(0, 0)        FM(NFDATA11)            F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP9_19_16      FM(SD2_DAT2)            F_(0, 0)        FM(NFDATA12)            F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP9_23_20      FM(SD2_DAT3)            F_(0, 0)        FM(NFDATA13)            F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP9_27_24      FM(SD2_DS)              F_(0, 0)        FM(NFALE)               F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        FM(SATA_DEVSLP_B)       F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP9_31_28      FM(SD3_CLK)             F_(0, 0)        FM(NFWE_N)              F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP10_3_0       FM(SD3_CMD)             F_(0, 0)        FM(NFRE_N)              F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP10_7_4       FM(SD3_DAT0)            F_(0, 0)        FM(NFDATA0)             F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP10_11_8      FM(SD3_DAT1)            F_(0, 0)        FM(NFDATA1)             F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP10_15_12     FM(SD3_DAT2)            F_(0, 0)        FM(NFDATA2)             F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP10_19_16     FM(SD3_DAT3)            F_(0, 0)        FM(NFDATA3)             F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP10_23_20     FM(SD3_DAT4)            FM(SD2_CD_A)    FM(NFDATA4)             F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP10_27_24     FM(SD3_DAT5)            FM(SD2_WP_A)    FM(NFDATA5)             F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP10_31_28     FM(SD3_DAT6)            FM(SD3_CD)      FM(NFDATA6)             F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP11_3_0       FM(SD3_DAT7)            FM(SD3_WP)      FM(NFDATA7)             F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP11_7_4       FM(SD3_DS)              F_(0, 0)        FM(NFCLE)               F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP11_11_8      FM(SD0_CD)              F_(0, 0)        FM(NFDATA14_A)          F_(0, 0)                        FM(SCL2_B)      FM(SIM0_RST_A)  F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+
+/* IPSRx */            /* 0 */                 /* 1 */         /* 2 */                 /* 3 */                         /* 4 */         /* 5 */         /* 6 */                 /* 7 */         /* 8 */                 /* 9 */         /* A */         /* B */         /* C - F */
+#define IP11_15_12     FM(SD0_WP)              F_(0, 0)        FM(NFDATA15_A)          F_(0, 0)                        FM(SDA2_B)      F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP11_19_16     FM(SD1_CD)              F_(0, 0)        FM(NFRB_N_A)            F_(0, 0)                        F_(0, 0)        FM(SIM0_CLK_B)  F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP11_23_20     FM(SD1_WP)              F_(0, 0)        FM(NFCE_N_A)            F_(0, 0)                        F_(0, 0)        FM(SIM0_D_B)    F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP11_27_24     FM(SCK0)                FM(HSCK1_B)     FM(MSIOF1_SS2_B)        FM(AUDIO_CLKC_B)                FM(SDA2_A)      FM(SIM0_RST_B)  FM(STP_OPWM_0_C)        FM(RIF0_CLK_B)  F_(0, 0)                FM(ADICHS2)     FM(SCK5_B)      F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP11_31_28     FM(RX0)                 FM(HRX1_B)      F_(0, 0)                F_(0, 0)                        F_(0, 0)        FM(TS_SCK0_C)   FM(STP_ISCLK_0_C)       FM(RIF0_D0_B)   F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP12_3_0       FM(TX0)                 FM(HTX1_B)      F_(0, 0)                F_(0, 0)                        F_(0, 0)        FM(TS_SPSYNC0_C)FM(STP_ISSYNC_0_C)      FM(RIF0_D1_B)   F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP12_7_4       FM(CTS0_N)              FM(HCTS1_N_B)   FM(MSIOF1_SYNC_B)       F_(0, 0)                        F_(0, 0)        FM(TS_SPSYNC1_C)FM(STP_ISSYNC_1_C)      FM(RIF1_SYNC_B) FM(AUDIO_CLKOUT_C)      FM(ADICS_SAMP)  F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP12_11_8      FM(RTS0_N)              FM(HRTS1_N_B)   FM(MSIOF1_SS1_B)        FM(AUDIO_CLKA_B)                FM(SCL2_A)      F_(0, 0)        FM(STP_IVCXO27_1_C)     FM(RIF0_SYNC_B) F_(0, 0)                FM(ADICHS1)     F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP12_15_12     FM(RX1_A)               FM(HRX1_A)      F_(0, 0)                F_(0, 0)                        F_(0, 0)        FM(TS_SDAT0_C)  FM(STP_ISD_0_C)         FM(RIF1_CLK_C)  F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP12_19_16     FM(TX1_A)               FM(HTX1_A)      F_(0, 0)                F_(0, 0)                        F_(0, 0)        FM(TS_SDEN0_C)  FM(STP_ISEN_0_C)        FM(RIF1_D0_C)   F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP12_23_20     FM(CTS1_N)              FM(HCTS1_N_A)   FM(MSIOF1_RXD_B)        F_(0, 0)                        F_(0, 0)        FM(TS_SDEN1_C)  FM(STP_ISEN_1_C)        FM(RIF1_D0_B)   F_(0, 0)                FM(ADIDATA)     F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP12_27_24     FM(RTS1_N)              FM(HRTS1_N_A)   FM(MSIOF1_TXD_B)        F_(0, 0)                        F_(0, 0)        FM(TS_SDAT1_C)  FM(STP_ISD_1_C)         FM(RIF1_D1_B)   F_(0, 0)                FM(ADICHS0)     F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP12_31_28     FM(SCK2)                FM(SCIF_CLK_B)  FM(MSIOF1_SCK_B)        F_(0, 0)                        F_(0, 0)        FM(TS_SCK1_C)   FM(STP_ISCLK_1_C)       FM(RIF1_CLK_B)  F_(0, 0)                FM(ADICLK)      F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP13_3_0       FM(TX2_A)               F_(0, 0)        F_(0, 0)                FM(SD2_CD_B)                    FM(SCL1_A)      F_(0, 0)        FM(FMCLK_A)             FM(RIF1_D1_C)   F_(0, 0)                FM(FSO_CFE_0_N) F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP13_7_4       FM(RX2_A)               F_(0, 0)        F_(0, 0)                FM(SD2_WP_B)                    FM(SDA1_A)      F_(0, 0)        FM(FMIN_A)              FM(RIF1_SYNC_C) F_(0, 0)                FM(FSO_CFE_1_N) F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP13_11_8      FM(HSCK0)               F_(0, 0)        FM(MSIOF1_SCK_D)        FM(AUDIO_CLKB_A)                FM(SSI_SDATA1_B)FM(TS_SCK0_D)   FM(STP_ISCLK_0_D)       FM(RIF0_CLK_C)  F_(0, 0)                F_(0, 0)        FM(RX5_B)       F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP13_15_12     FM(HRX0)                F_(0, 0)        FM(MSIOF1_RXD_D)        F_(0, 0)                        FM(SSI_SDATA2_B)FM(TS_SDEN0_D)  FM(STP_ISEN_0_D)        FM(RIF0_D0_C)   F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP13_19_16     FM(HTX0)                F_(0, 0)        FM(MSIOF1_TXD_D)        F_(0, 0)                        FM(SSI_SDATA9_B)FM(TS_SDAT0_D)  FM(STP_ISD_0_D)         FM(RIF0_D1_C)   F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP13_23_20     FM(HCTS0_N)             FM(RX2_B)       FM(MSIOF1_SYNC_D)       F_(0, 0)                        FM(SSI_SCK9_A)  FM(TS_SPSYNC0_D)FM(STP_ISSYNC_0_D)      FM(RIF0_SYNC_C) FM(AUDIO_CLKOUT1_A)     F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP13_27_24     FM(HRTS0_N)             FM(TX2_B)       FM(MSIOF1_SS1_D)        F_(0, 0)                        FM(SSI_WS9_A)   F_(0, 0)        FM(STP_IVCXO27_0_D)     FM(BPFCLK_A)    FM(AUDIO_CLKOUT2_A)     F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP13_31_28     FM(MSIOF0_SYNC)         F_(0, 0)        F_(0, 0)                F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        FM(AUDIO_CLKOUT_A)      F_(0, 0)        FM(TX5_B)       F_(0, 0)        F_(0, 0) FM(BPFCLK_D) F_(0, 0) F_(0, 0)
+#define IP14_3_0       FM(MSIOF0_SS1)          FM(RX5_A)       FM(NFWP_N_A)            FM(AUDIO_CLKA_C)                FM(SSI_SCK2_A)  F_(0, 0)        FM(STP_IVCXO27_0_C)     F_(0, 0)        FM(AUDIO_CLKOUT3_A)     F_(0, 0)        FM(TCLK1_B)     F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP14_7_4       FM(MSIOF0_SS2)          FM(TX5_A)       FM(MSIOF1_SS2_D)        FM(AUDIO_CLKC_A)                FM(SSI_WS2_A)   F_(0, 0)        FM(STP_OPWM_0_D)        F_(0, 0)        FM(AUDIO_CLKOUT_D)      F_(0, 0)        FM(SPEEDIN_B)   F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP14_11_8      FM(MLB_CLK)             F_(0, 0)        FM(MSIOF1_SCK_F)        F_(0, 0)                        FM(SCL1_B)      F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP14_15_12     FM(MLB_SIG)             FM(RX1_B)       FM(MSIOF1_SYNC_F)       F_(0, 0)                        FM(SDA1_B)      F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP14_19_16     FM(MLB_DAT)             FM(TX1_B)       FM(MSIOF1_RXD_F)        F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP14_23_20     FM(SSI_SCK01239)        F_(0, 0)        FM(MSIOF1_TXD_F)        F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP14_27_24     FM(SSI_WS01239)         F_(0, 0)        FM(MSIOF1_SS1_F)        F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+
+/* IPSRx */            /* 0 */                 /* 1 */         /* 2 */                 /* 3 */                         /* 4 */         /* 5 */         /* 6 */                 /* 7 */         /* 8 */                 /* 9 */         /* A */         /* B */         /* C - F */
+#define IP14_31_28     FM(SSI_SDATA0)          F_(0, 0)        FM(MSIOF1_SS2_F)        F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP15_3_0       FM(SSI_SDATA1_A)        F_(0, 0)        F_(0, 0)                F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP15_7_4       FM(SSI_SDATA2_A)        F_(0, 0)        F_(0, 0)                F_(0, 0)                        FM(SSI_SCK1_B)  F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP15_11_8      FM(SSI_SCK349)          F_(0, 0)        FM(MSIOF1_SS1_A)        F_(0, 0)                        F_(0, 0)        F_(0, 0)        FM(STP_OPWM_0_A)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP15_15_12     FM(SSI_WS349)           FM(HCTS2_N_A)   FM(MSIOF1_SS2_A)        F_(0, 0)                        F_(0, 0)        F_(0, 0)        FM(STP_IVCXO27_0_A)     F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP15_19_16     FM(SSI_SDATA3)          FM(HRTS2_N_A)   FM(MSIOF1_TXD_A)        F_(0, 0)                        F_(0, 0)        FM(TS_SCK0_A)   FM(STP_ISCLK_0_A)       FM(RIF0_D1_A)   FM(RIF2_D0_A)           F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP15_23_20     FM(SSI_SCK4)            FM(HRX2_A)      FM(MSIOF1_SCK_A)        F_(0, 0)                        F_(0, 0)        FM(TS_SDAT0_A)  FM(STP_ISD_0_A)         FM(RIF0_CLK_A)  FM(RIF2_CLK_A)          F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP15_27_24     FM(SSI_WS4)             FM(HTX2_A)      FM(MSIOF1_SYNC_A)       F_(0, 0)                        F_(0, 0)        FM(TS_SDEN0_A)  FM(STP_ISEN_0_A)        FM(RIF0_SYNC_A) FM(RIF2_SYNC_A)         F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP15_31_28     FM(SSI_SDATA4)          FM(HSCK2_A)     FM(MSIOF1_RXD_A)        F_(0, 0)                        F_(0, 0)        FM(TS_SPSYNC0_A)FM(STP_ISSYNC_0_A)      FM(RIF0_D0_A)   FM(RIF2_D1_A)           F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP16_3_0       FM(SSI_SCK6)            F_(0, 0)        F_(0, 0)                FM(SIM0_RST_D)                  F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP16_7_4       FM(SSI_WS6)             F_(0, 0)        F_(0, 0)                FM(SIM0_D_D)                    F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP16_11_8      FM(SSI_SDATA6)          F_(0, 0)        F_(0, 0)                FM(SIM0_CLK_D)                  F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        FM(SATA_DEVSLP_A)       F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP16_15_12     FM(SSI_SCK78)           FM(HRX2_B)      FM(MSIOF1_SCK_C)        F_(0, 0)                        F_(0, 0)        FM(TS_SCK1_A)   FM(STP_ISCLK_1_A)       FM(RIF1_CLK_A)  FM(RIF3_CLK_A)          F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP16_19_16     FM(SSI_WS78)            FM(HTX2_B)      FM(MSIOF1_SYNC_C)       F_(0, 0)                        F_(0, 0)        FM(TS_SDAT1_A)  FM(STP_ISD_1_A)         FM(RIF1_SYNC_A) FM(RIF3_SYNC_A)         F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP16_23_20     FM(SSI_SDATA7)          FM(HCTS2_N_B)   FM(MSIOF1_RXD_C)        F_(0, 0)                        F_(0, 0)        FM(TS_SDEN1_A)  FM(STP_ISEN_1_A)        FM(RIF1_D0_A)   FM(RIF3_D0_A)           F_(0, 0)        FM(TCLK2_A)     F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP16_27_24     FM(SSI_SDATA8)          FM(HRTS2_N_B)   FM(MSIOF1_TXD_C)        F_(0, 0)                        F_(0, 0)        FM(TS_SPSYNC1_A)FM(STP_ISSYNC_1_A)      FM(RIF1_D1_A)   FM(RIF3_D1_A)           F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP16_31_28     FM(SSI_SDATA9_A)        FM(HSCK2_B)     FM(MSIOF1_SS1_C)        FM(HSCK1_A)                     FM(SSI_WS1_B)   FM(SCK1)        FM(STP_IVCXO27_1_A)     FM(SCK5_A)      F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP17_3_0       FM(AUDIO_CLKA_A)        F_(0, 0)        F_(0, 0)                F_(0, 0)                        F_(0, 0)        F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)                F_(0, 0)        F_(0, 0)        FM(CC5_OSCOUT)  F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP17_7_4       FM(AUDIO_CLKB_B)        FM(SCIF_CLK_A)  F_(0, 0)                F_(0, 0)                        F_(0, 0)        F_(0, 0)        FM(STP_IVCXO27_1_D)     FM(REMOCON_A)   F_(0, 0)                F_(0, 0)        FM(TCLK1_A)     F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP17_11_8      FM(USB0_PWEN)           F_(0, 0)        F_(0, 0)                FM(SIM0_RST_C)                  F_(0, 0)        FM(TS_SCK1_D)   FM(STP_ISCLK_1_D)       FM(BPFCLK_B)    FM(RIF3_CLK_B)          F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) FM(HSCK2_C) F_(0, 0) F_(0, 0)
+#define IP17_15_12     FM(USB0_OVC)            F_(0, 0)        F_(0, 0)                FM(SIM0_D_C)                    F_(0, 0)        FM(TS_SDAT1_D)  FM(STP_ISD_1_D)         F_(0, 0)        FM(RIF3_SYNC_B)         F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) FM(HRX2_C) F_(0, 0) F_(0, 0)
+#define IP17_19_16     FM(USB1_PWEN)           F_(0, 0)        F_(0, 0)                FM(SIM0_CLK_C)                  FM(SSI_SCK1_A)  FM(TS_SCK0_E)   FM(STP_ISCLK_0_E)       FM(FMCLK_B)     FM(RIF2_CLK_B)          F_(0, 0)        FM(SPEEDIN_A)   F_(0, 0)        F_(0, 0) FM(HTX2_C) F_(0, 0) F_(0, 0)
+#define IP17_23_20     FM(USB1_OVC)            F_(0, 0)        FM(MSIOF1_SS2_C)        F_(0, 0)                        FM(SSI_WS1_A)   FM(TS_SDAT0_E)  FM(STP_ISD_0_E)         FM(FMIN_B)      FM(RIF2_SYNC_B)         F_(0, 0)        FM(REMOCON_B)   F_(0, 0)        F_(0, 0) FM(HCTS2_N_C) F_(0, 0) F_(0, 0)
+#define IP17_27_24     FM(USB30_PWEN)          F_(0, 0)        F_(0, 0)                FM(AUDIO_CLKOUT_B)              FM(SSI_SCK2_B)  FM(TS_SDEN1_D)  FM(STP_ISEN_1_D)        FM(STP_OPWM_0_E)FM(RIF3_D0_B)           F_(0, 0)        FM(TCLK2_B)     FM(TPU0TO0)     FM(BPFCLK_C) FM(HRTS2_N_C) F_(0, 0) F_(0, 0)
+#define IP17_31_28     FM(USB30_OVC)           F_(0, 0)        F_(0, 0)                FM(AUDIO_CLKOUT1_B)             FM(SSI_WS2_B)   FM(TS_SPSYNC1_D)FM(STP_ISSYNC_1_D)      FM(STP_IVCXO27_0_E)FM(RIF3_D1_B)        F_(0, 0)        FM(FSO_TOE_N)   FM(TPU0TO1)     F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP18_3_0       FM(GP6_30)              F_(0, 0)        F_(0, 0)                FM(AUDIO_CLKOUT2_B)             FM(SSI_SCK9_B)  FM(TS_SDEN0_E)  FM(STP_ISEN_0_E)        F_(0, 0)        FM(RIF2_D0_B)           F_(0, 0)        F_(0, 0)        FM(TPU0TO2)     FM(FMCLK_C) FM(FMCLK_D) F_(0, 0) F_(0, 0)
+#define IP18_7_4       FM(GP6_31)              F_(0, 0)        F_(0, 0)                FM(AUDIO_CLKOUT3_B)             FM(SSI_WS9_B)   FM(TS_SPSYNC0_E)FM(STP_ISSYNC_0_E)      F_(0, 0)        FM(RIF2_D1_B)           F_(0, 0)        F_(0, 0)        FM(TPU0TO3)     FM(FMIN_C) FM(FMIN_D) F_(0, 0) F_(0, 0)
+
+#define PINMUX_GPSR    \
+\
+                                                                                               GPSR6_31 \
+                                                                                               GPSR6_30 \
+                                                                                               GPSR6_29 \
+               GPSR1_28                                                                        GPSR6_28 \
+               GPSR1_27                                                                        GPSR6_27 \
+               GPSR1_26                                                                        GPSR6_26 \
+               GPSR1_25                                                        GPSR5_25        GPSR6_25 \
+               GPSR1_24                                                        GPSR5_24        GPSR6_24 \
+               GPSR1_23                                                        GPSR5_23        GPSR6_23 \
+               GPSR1_22                                                        GPSR5_22        GPSR6_22 \
+               GPSR1_21                                                        GPSR5_21        GPSR6_21 \
+               GPSR1_20                                                        GPSR5_20        GPSR6_20 \
+               GPSR1_19                                                        GPSR5_19        GPSR6_19 \
+               GPSR1_18                                                        GPSR5_18        GPSR6_18 \
+               GPSR1_17                                        GPSR4_17        GPSR5_17        GPSR6_17 \
+               GPSR1_16                                        GPSR4_16        GPSR5_16        GPSR6_16 \
+GPSR0_15       GPSR1_15                        GPSR3_15        GPSR4_15        GPSR5_15        GPSR6_15 \
+GPSR0_14       GPSR1_14        GPSR2_14        GPSR3_14        GPSR4_14        GPSR5_14        GPSR6_14 \
+GPSR0_13       GPSR1_13        GPSR2_13        GPSR3_13        GPSR4_13        GPSR5_13        GPSR6_13 \
+GPSR0_12       GPSR1_12        GPSR2_12        GPSR3_12        GPSR4_12        GPSR5_12        GPSR6_12 \
+GPSR0_11       GPSR1_11        GPSR2_11        GPSR3_11        GPSR4_11        GPSR5_11        GPSR6_11 \
+GPSR0_10       GPSR1_10        GPSR2_10        GPSR3_10        GPSR4_10        GPSR5_10        GPSR6_10 \
+GPSR0_9                GPSR1_9         GPSR2_9         GPSR3_9         GPSR4_9         GPSR5_9         GPSR6_9 \
+GPSR0_8                GPSR1_8         GPSR2_8         GPSR3_8         GPSR4_8         GPSR5_8         GPSR6_8 \
+GPSR0_7                GPSR1_7         GPSR2_7         GPSR3_7         GPSR4_7         GPSR5_7         GPSR6_7 \
+GPSR0_6                GPSR1_6         GPSR2_6         GPSR3_6         GPSR4_6         GPSR5_6         GPSR6_6 \
+GPSR0_5                GPSR1_5         GPSR2_5         GPSR3_5         GPSR4_5         GPSR5_5         GPSR6_5 \
+GPSR0_4                GPSR1_4         GPSR2_4         GPSR3_4         GPSR4_4         GPSR5_4         GPSR6_4 \
+GPSR0_3                GPSR1_3         GPSR2_3         GPSR3_3         GPSR4_3         GPSR5_3         GPSR6_3         GPSR7_3 \
+GPSR0_2                GPSR1_2         GPSR2_2         GPSR3_2         GPSR4_2         GPSR5_2         GPSR6_2         GPSR7_2 \
+GPSR0_1                GPSR1_1         GPSR2_1         GPSR3_1         GPSR4_1         GPSR5_1         GPSR6_1         GPSR7_1 \
+GPSR0_0                GPSR1_0         GPSR2_0         GPSR3_0         GPSR4_0         GPSR5_0         GPSR6_0         GPSR7_0
+
+#define PINMUX_IPSR                            \
+\
+FM(IP0_3_0)    IP0_3_0         FM(IP1_3_0)     IP1_3_0         FM(IP2_3_0)     IP2_3_0         FM(IP3_3_0)     IP3_3_0 \
+FM(IP0_7_4)    IP0_7_4         FM(IP1_7_4)     IP1_7_4         FM(IP2_7_4)     IP2_7_4         FM(IP3_7_4)     IP3_7_4 \
+FM(IP0_11_8)   IP0_11_8        FM(IP1_11_8)    IP1_11_8        FM(IP2_11_8)    IP2_11_8        FM(IP3_11_8)    IP3_11_8 \
+FM(IP0_15_12)  IP0_15_12       FM(IP1_15_12)   IP1_15_12       FM(IP2_15_12)   IP2_15_12       FM(IP3_15_12)   IP3_15_12 \
+FM(IP0_19_16)  IP0_19_16       FM(IP1_19_16)   IP1_19_16       FM(IP2_19_16)   IP2_19_16       FM(IP3_19_16)   IP3_19_16 \
+FM(IP0_23_20)  IP0_23_20       FM(IP1_23_20)   IP1_23_20       FM(IP2_23_20)   IP2_23_20       FM(IP3_23_20)   IP3_23_20 \
+FM(IP0_27_24)  IP0_27_24       FM(IP1_27_24)   IP1_27_24       FM(IP2_27_24)   IP2_27_24       FM(IP3_27_24)   IP3_27_24 \
+FM(IP0_31_28)  IP0_31_28       FM(IP1_31_28)   IP1_31_28       FM(IP2_31_28)   IP2_31_28       FM(IP3_31_28)   IP3_31_28 \
+\
+FM(IP4_3_0)    IP4_3_0         FM(IP5_3_0)     IP5_3_0         FM(IP6_3_0)     IP6_3_0         FM(IP7_3_0)     IP7_3_0 \
+FM(IP4_7_4)    IP4_7_4         FM(IP5_7_4)     IP5_7_4         FM(IP6_7_4)     IP6_7_4         FM(IP7_7_4)     IP7_7_4 \
+FM(IP4_11_8)   IP4_11_8        FM(IP5_11_8)    IP5_11_8        FM(IP6_11_8)    IP6_11_8        FM(IP7_11_8)    IP7_11_8 \
+FM(IP4_15_12)  IP4_15_12       FM(IP5_15_12)   IP5_15_12       FM(IP6_15_12)   IP6_15_12 \
+FM(IP4_19_16)  IP4_19_16       FM(IP5_19_16)   IP5_19_16       FM(IP6_19_16)   IP6_19_16       FM(IP7_19_16)   IP7_19_16 \
+FM(IP4_23_20)  IP4_23_20       FM(IP5_23_20)   IP5_23_20       FM(IP6_23_20)   IP6_23_20       FM(IP7_23_20)   IP7_23_20 \
+FM(IP4_27_24)  IP4_27_24       FM(IP5_27_24)   IP5_27_24       FM(IP6_27_24)   IP6_27_24       FM(IP7_27_24)   IP7_27_24 \
+FM(IP4_31_28)  IP4_31_28       FM(IP5_31_28)   IP5_31_28       FM(IP6_31_28)   IP6_31_28       FM(IP7_31_28)   IP7_31_28 \
+\
+FM(IP8_3_0)    IP8_3_0         FM(IP9_3_0)     IP9_3_0         FM(IP10_3_0)    IP10_3_0        FM(IP11_3_0)    IP11_3_0 \
+FM(IP8_7_4)    IP8_7_4         FM(IP9_7_4)     IP9_7_4         FM(IP10_7_4)    IP10_7_4        FM(IP11_7_4)    IP11_7_4 \
+FM(IP8_11_8)   IP8_11_8        FM(IP9_11_8)    IP9_11_8        FM(IP10_11_8)   IP10_11_8       FM(IP11_11_8)   IP11_11_8 \
+FM(IP8_15_12)  IP8_15_12       FM(IP9_15_12)   IP9_15_12       FM(IP10_15_12)  IP10_15_12      FM(IP11_15_12)  IP11_15_12 \
+FM(IP8_19_16)  IP8_19_16       FM(IP9_19_16)   IP9_19_16       FM(IP10_19_16)  IP10_19_16      FM(IP11_19_16)  IP11_19_16 \
+FM(IP8_23_20)  IP8_23_20       FM(IP9_23_20)   IP9_23_20       FM(IP10_23_20)  IP10_23_20      FM(IP11_23_20)  IP11_23_20 \
+FM(IP8_27_24)  IP8_27_24       FM(IP9_27_24)   IP9_27_24       FM(IP10_27_24)  IP10_27_24      FM(IP11_27_24)  IP11_27_24 \
+FM(IP8_31_28)  IP8_31_28       FM(IP9_31_28)   IP9_31_28       FM(IP10_31_28)  IP10_31_28      FM(IP11_31_28)  IP11_31_28 \
+\
+FM(IP12_3_0)   IP12_3_0        FM(IP13_3_0)    IP13_3_0        FM(IP14_3_0)    IP14_3_0        FM(IP15_3_0)    IP15_3_0 \
+FM(IP12_7_4)   IP12_7_4        FM(IP13_7_4)    IP13_7_4        FM(IP14_7_4)    IP14_7_4        FM(IP15_7_4)    IP15_7_4 \
+FM(IP12_11_8)  IP12_11_8       FM(IP13_11_8)   IP13_11_8       FM(IP14_11_8)   IP14_11_8       FM(IP15_11_8)   IP15_11_8 \
+FM(IP12_15_12) IP12_15_12      FM(IP13_15_12)  IP13_15_12      FM(IP14_15_12)  IP14_15_12      FM(IP15_15_12)  IP15_15_12 \
+FM(IP12_19_16) IP12_19_16      FM(IP13_19_16)  IP13_19_16      FM(IP14_19_16)  IP14_19_16      FM(IP15_19_16)  IP15_19_16 \
+FM(IP12_23_20) IP12_23_20      FM(IP13_23_20)  IP13_23_20      FM(IP14_23_20)  IP14_23_20      FM(IP15_23_20)  IP15_23_20 \
+FM(IP12_27_24) IP12_27_24      FM(IP13_27_24)  IP13_27_24      FM(IP14_27_24)  IP14_27_24      FM(IP15_27_24)  IP15_27_24 \
+FM(IP12_31_28) IP12_31_28      FM(IP13_31_28)  IP13_31_28      FM(IP14_31_28)  IP14_31_28      FM(IP15_31_28)  IP15_31_28 \
+\
+FM(IP16_3_0)   IP16_3_0        FM(IP17_3_0)    IP17_3_0        FM(IP18_3_0)    IP18_3_0 \
+FM(IP16_7_4)   IP16_7_4        FM(IP17_7_4)    IP17_7_4        FM(IP18_7_4)    IP18_7_4 \
+FM(IP16_11_8)  IP16_11_8       FM(IP17_11_8)   IP17_11_8 \
+FM(IP16_15_12) IP16_15_12      FM(IP17_15_12)  IP17_15_12 \
+FM(IP16_19_16) IP16_19_16      FM(IP17_19_16)  IP17_19_16 \
+FM(IP16_23_20) IP16_23_20      FM(IP17_23_20)  IP17_23_20 \
+FM(IP16_27_24) IP16_27_24      FM(IP17_27_24)  IP17_27_24 \
+FM(IP16_31_28) IP16_31_28      FM(IP17_31_28)  IP17_31_28
+
+/* MOD_SEL0 */                 /* 0 */                 /* 1 */                 /* 2 */                 /* 3 */                 /* 4 */                 /* 5 */                 /* 6 */                 /* 7 */
+#define MOD_SEL0_31_30_29      FM(SEL_MSIOF3_0)        FM(SEL_MSIOF3_1)        FM(SEL_MSIOF3_2)        FM(SEL_MSIOF3_3)        FM(SEL_MSIOF3_4)        F_(0, 0)                F_(0, 0)                F_(0, 0)
+#define MOD_SEL0_28_27         FM(SEL_MSIOF2_0)        FM(SEL_MSIOF2_1)        FM(SEL_MSIOF2_2)        FM(SEL_MSIOF2_3)
+#define MOD_SEL0_26_25_24      FM(SEL_MSIOF1_0)        FM(SEL_MSIOF1_1)        FM(SEL_MSIOF1_2)        FM(SEL_MSIOF1_3)        FM(SEL_MSIOF1_4)        FM(SEL_MSIOF1_5)        FM(SEL_MSIOF1_6)        F_(0, 0)
+#define MOD_SEL0_23            FM(SEL_LBSC_0)          FM(SEL_LBSC_1)
+#define MOD_SEL0_22            FM(SEL_IEBUS_0)         FM(SEL_IEBUS_1)
+#define MOD_SEL0_21            FM(SEL_I2C2_0)          FM(SEL_I2C2_1)
+#define MOD_SEL0_20            FM(SEL_I2C1_0)          FM(SEL_I2C1_1)
+#define MOD_SEL0_19            FM(SEL_HSCIF4_0)        FM(SEL_HSCIF4_1)
+#define MOD_SEL0_18_17         FM(SEL_HSCIF3_0)        FM(SEL_HSCIF3_1)        FM(SEL_HSCIF3_2)        FM(SEL_HSCIF3_3)
+#define MOD_SEL0_16            FM(SEL_HSCIF1_0)        FM(SEL_HSCIF1_1)
+#define MOD_SEL0_14_13         FM(SEL_HSCIF2_0)        FM(SEL_HSCIF2_1)        FM(SEL_HSCIF2_2)        F_(0, 0)
+#define MOD_SEL0_12            FM(SEL_ETHERAVB_0)      FM(SEL_ETHERAVB_1)
+#define MOD_SEL0_11            FM(SEL_DRIF3_0)         FM(SEL_DRIF3_1)
+#define MOD_SEL0_10            FM(SEL_DRIF2_0)         FM(SEL_DRIF2_1)
+#define MOD_SEL0_9_8           FM(SEL_DRIF1_0)         FM(SEL_DRIF1_1)         FM(SEL_DRIF1_2)         F_(0, 0)
+#define MOD_SEL0_7_6           FM(SEL_DRIF0_0)         FM(SEL_DRIF0_1)         FM(SEL_DRIF0_2)         F_(0, 0)
+#define MOD_SEL0_5             FM(SEL_CANFD0_0)        FM(SEL_CANFD0_1)
+#define MOD_SEL0_4_3           FM(SEL_ADG_A_0)         FM(SEL_ADG_A_1)         FM(SEL_ADG_A_2)         FM(SEL_ADG_A_3)
+
+/* MOD_SEL1 */                 /* 0 */                 /* 1 */                 /* 2 */                 /* 3 */                 /* 4 */                 /* 5 */                 /* 6 */                 /* 7 */
+#define MOD_SEL1_31_30         FM(SEL_TSIF1_0)         FM(SEL_TSIF1_1)         FM(SEL_TSIF1_2)         FM(SEL_TSIF1_3)
+#define MOD_SEL1_29_28_27      FM(SEL_TSIF0_0)         FM(SEL_TSIF0_1)         FM(SEL_TSIF0_2)         FM(SEL_TSIF0_3)         FM(SEL_TSIF0_4)         F_(0, 0)                F_(0, 0)                F_(0, 0)
+#define MOD_SEL1_26            FM(SEL_TIMER_TMU_0)     FM(SEL_TIMER_TMU_1)
+#define MOD_SEL1_25_24         FM(SEL_SSP1_1_0)        FM(SEL_SSP1_1_1)        FM(SEL_SSP1_1_2)        FM(SEL_SSP1_1_3)
+#define MOD_SEL1_23_22_21      FM(SEL_SSP1_0_0)        FM(SEL_SSP1_0_1)        FM(SEL_SSP1_0_2)        FM(SEL_SSP1_0_3)        FM(SEL_SSP1_0_4)        F_(0, 0)                F_(0, 0)                F_(0, 0)
+#define MOD_SEL1_20            FM(SEL_SSI1_0)          FM(SEL_SSI1_1)
+#define MOD_SEL1_19            FM(SEL_SPEED_PULSE_0)   FM(SEL_SPEED_PULSE_1)
+#define MOD_SEL1_18_17         FM(SEL_SIMCARD_0)       FM(SEL_SIMCARD_1)       FM(SEL_SIMCARD_2)       FM(SEL_SIMCARD_3)
+#define MOD_SEL1_16            FM(SEL_SDHI2_0)         FM(SEL_SDHI2_1)
+#define MOD_SEL1_15_14         FM(SEL_SCIF4_0)         FM(SEL_SCIF4_1)         FM(SEL_SCIF4_2)         F_(0, 0)
+#define MOD_SEL1_13            FM(SEL_SCIF3_0)         FM(SEL_SCIF3_1)
+#define MOD_SEL1_12            FM(SEL_SCIF2_0)         FM(SEL_SCIF2_1)
+#define MOD_SEL1_11            FM(SEL_SCIF1_0)         FM(SEL_SCIF1_1)
+#define MOD_SEL1_10            FM(SEL_SCIF_0)          FM(SEL_SCIF_1)
+#define MOD_SEL1_9             FM(SEL_REMOCON_0)       FM(SEL_REMOCON_1)
+#define MOD_SEL1_6             FM(SEL_RCAN0_0)         FM(SEL_RCAN0_1)
+#define MOD_SEL1_5             FM(SEL_PWM6_0)          FM(SEL_PWM6_1)
+#define MOD_SEL1_4             FM(SEL_PWM5_0)          FM(SEL_PWM5_1)
+#define MOD_SEL1_3             FM(SEL_PWM4_0)          FM(SEL_PWM4_1)
+#define MOD_SEL1_2             FM(SEL_PWM3_0)          FM(SEL_PWM3_1)
+#define MOD_SEL1_1             FM(SEL_PWM2_0)          FM(SEL_PWM2_1)
+#define MOD_SEL1_0             FM(SEL_PWM1_0)          FM(SEL_PWM1_1)
+
+/* MOD_SEL2 */                 /* 0 */                 /* 1 */                 /* 2 */                 /* 3 */                 /* 4 */                 /* 5 */                 /* 6 */                 /* 7 */
+#define MOD_SEL2_31            FM(I2C_SEL_5_0)         FM(I2C_SEL_5_1)
+#define MOD_SEL2_30            FM(I2C_SEL_3_0)         FM(I2C_SEL_3_1)
+#define MOD_SEL2_29            FM(I2C_SEL_0_0)         FM(I2C_SEL_0_1)
+#define MOD_SEL2_28_27         FM(SEL_FM_0)            FM(SEL_FM_1)            FM(SEL_FM_2)            FM(SEL_FM_3)
+#define MOD_SEL2_26            FM(SEL_SCIF5_0)         FM(SEL_SCIF5_1)
+#define MOD_SEL2_25_24_23      FM(SEL_I2C6_0)          FM(SEL_I2C6_1)          FM(SEL_I2C6_2)          F_(0, 0)                F_(0, 0)                F_(0, 0)                F_(0, 0)                F_(0, 0)
+#define MOD_SEL2_22            FM(SEL_NDFC_0)          FM(SEL_NDFC_1)
+#define MOD_SEL2_21            FM(SEL_SSI2_0)          FM(SEL_SSI2_1)
+#define MOD_SEL2_20            FM(SEL_SSI9_0)          FM(SEL_SSI9_1)
+#define MOD_SEL2_19            FM(SEL_TIMER_TMU2_0)    FM(SEL_TIMER_TMU2_1)
+#define MOD_SEL2_18            FM(SEL_ADG_B_0)         FM(SEL_ADG_B_1)
+#define MOD_SEL2_17            FM(SEL_ADG_C_0)         FM(SEL_ADG_C_1)
+#define MOD_SEL2_0             FM(SEL_VIN4_0)          FM(SEL_VIN4_1)
+
+#define PINMUX_MOD_SELS        \
+\
+MOD_SEL0_31_30_29      MOD_SEL1_31_30          MOD_SEL2_31 \
+                                               MOD_SEL2_30 \
+                       MOD_SEL1_29_28_27       MOD_SEL2_29 \
+MOD_SEL0_28_27                                 MOD_SEL2_28_27 \
+MOD_SEL0_26_25_24      MOD_SEL1_26             MOD_SEL2_26 \
+                       MOD_SEL1_25_24          MOD_SEL2_25_24_23 \
+MOD_SEL0_23            MOD_SEL1_23_22_21 \
+MOD_SEL0_22                                    MOD_SEL2_22 \
+MOD_SEL0_21                                    MOD_SEL2_21 \
+MOD_SEL0_20            MOD_SEL1_20             MOD_SEL2_20 \
+MOD_SEL0_19            MOD_SEL1_19             MOD_SEL2_19 \
+MOD_SEL0_18_17         MOD_SEL1_18_17          MOD_SEL2_18 \
+                                               MOD_SEL2_17 \
+MOD_SEL0_16            MOD_SEL1_16 \
+                       MOD_SEL1_15_14 \
+MOD_SEL0_14_13 \
+                       MOD_SEL1_13 \
+MOD_SEL0_12            MOD_SEL1_12 \
+MOD_SEL0_11            MOD_SEL1_11 \
+MOD_SEL0_10            MOD_SEL1_10 \
+MOD_SEL0_9_8           MOD_SEL1_9 \
+MOD_SEL0_7_6 \
+                       MOD_SEL1_6 \
+MOD_SEL0_5             MOD_SEL1_5 \
+MOD_SEL0_4_3           MOD_SEL1_4 \
+                       MOD_SEL1_3 \
+                       MOD_SEL1_2 \
+                       MOD_SEL1_1 \
+                       MOD_SEL1_0              MOD_SEL2_0
+
+/*
+ * These pins are not able to be muxed but have other properties
+ * that can be set, such as drive-strength or pull-up/pull-down enable.
+ */
+#define PINMUX_STATIC \
+       FM(QSPI0_SPCLK) FM(QSPI0_SSL) FM(QSPI0_MOSI_IO0) FM(QSPI0_MISO_IO1) \
+       FM(QSPI0_IO2) FM(QSPI0_IO3) \
+       FM(QSPI1_SPCLK) FM(QSPI1_SSL) FM(QSPI1_MOSI_IO0) FM(QSPI1_MISO_IO1) \
+       FM(QSPI1_IO2) FM(QSPI1_IO3) \
+       FM(RPC_INT) FM(RPC_WP) FM(RPC_RESET) \
+       FM(AVB_TX_CTL) FM(AVB_TXC) FM(AVB_TD0) FM(AVB_TD1) FM(AVB_TD2) FM(AVB_TD3) \
+       FM(AVB_RX_CTL) FM(AVB_RXC) FM(AVB_RD0) FM(AVB_RD1) FM(AVB_RD2) FM(AVB_RD3) \
+       FM(AVB_TXCREFCLK) FM(AVB_MDIO) \
+       FM(PRESETOUT) \
+       FM(DU_DOTCLKIN0) FM(DU_DOTCLKIN1) FM(DU_DOTCLKIN3) \
+       FM(TMS) FM(TDO) FM(ASEBRK) FM(MLB_REF) FM(TDI) FM(TCK) FM(TRST) FM(EXTALR)
+
+enum {
+       PINMUX_RESERVED = 0,
+
+       PINMUX_DATA_BEGIN,
+       GP_ALL(DATA),
+       PINMUX_DATA_END,
+
+#define F_(x, y)
+#define FM(x)  FN_##x,
+       PINMUX_FUNCTION_BEGIN,
+       GP_ALL(FN),
+       PINMUX_GPSR
+       PINMUX_IPSR
+       PINMUX_MOD_SELS
+       PINMUX_FUNCTION_END,
+#undef F_
+#undef FM
+
+#define F_(x, y)
+#define FM(x)  x##_MARK,
+       PINMUX_MARK_BEGIN,
+       PINMUX_GPSR
+       PINMUX_IPSR
+       PINMUX_MOD_SELS
+       PINMUX_STATIC
+       PINMUX_MARK_END,
+#undef F_
+#undef FM
+};
+
+static const u16 pinmux_data[] = {
+       PINMUX_DATA_GP_ALL(),
+
+       PINMUX_SINGLE(AVS1),
+       PINMUX_SINGLE(AVS2),
+       PINMUX_SINGLE(CLKOUT),
+       PINMUX_SINGLE(GP7_03),
+       PINMUX_SINGLE(HDMI0_CEC),
+       PINMUX_SINGLE(MSIOF0_RXD),
+       PINMUX_SINGLE(MSIOF0_SCK),
+       PINMUX_SINGLE(MSIOF0_TXD),
+       PINMUX_SINGLE(SSI_SCK5),
+       PINMUX_SINGLE(SSI_SDATA5),
+       PINMUX_SINGLE(SSI_WS5),
+
+       /* IPSR0 */
+       PINMUX_IPSR_GPSR(IP0_3_0,       AVB_MDC),
+       PINMUX_IPSR_MSEL(IP0_3_0,       MSIOF2_SS2_C,           SEL_MSIOF2_2),
+
+       PINMUX_IPSR_GPSR(IP0_7_4,       AVB_MAGIC),
+       PINMUX_IPSR_MSEL(IP0_7_4,       MSIOF2_SS1_C,           SEL_MSIOF2_2),
+       PINMUX_IPSR_MSEL(IP0_7_4,       SCK4_A,                 SEL_SCIF4_0),
+
+       PINMUX_IPSR_GPSR(IP0_11_8,      AVB_PHY_INT),
+       PINMUX_IPSR_MSEL(IP0_11_8,      MSIOF2_SYNC_C,          SEL_MSIOF2_2),
+       PINMUX_IPSR_MSEL(IP0_11_8,      RX4_A,                  SEL_SCIF4_0),
+
+       PINMUX_IPSR_GPSR(IP0_15_12,     AVB_LINK),
+       PINMUX_IPSR_MSEL(IP0_15_12,     MSIOF2_SCK_C,           SEL_MSIOF2_2),
+       PINMUX_IPSR_MSEL(IP0_15_12,     TX4_A,                  SEL_SCIF4_0),
+       PINMUX_IPSR_GPSR(IP0_19_16,     FSCLKST2_N_A),
+
+       PINMUX_IPSR_MSEL(IP0_19_16,     AVB_AVTP_MATCH_A,       SEL_ETHERAVB_0),
+       PINMUX_IPSR_MSEL(IP0_19_16,     MSIOF2_RXD_C,           SEL_MSIOF2_2),
+       PINMUX_IPSR_MSEL(IP0_19_16,     CTS4_N_A,               SEL_SCIF4_0),
+
+       PINMUX_IPSR_MSEL(IP0_23_20,     AVB_AVTP_CAPTURE_A,     SEL_ETHERAVB_0),
+       PINMUX_IPSR_MSEL(IP0_23_20,     MSIOF2_TXD_C,           SEL_MSIOF2_2),
+       PINMUX_IPSR_MSEL(IP0_23_20,     RTS4_N_A,               SEL_SCIF4_0),
+
+       PINMUX_IPSR_GPSR(IP0_27_24,     IRQ0),
+       PINMUX_IPSR_GPSR(IP0_27_24,     QPOLB),
+       PINMUX_IPSR_GPSR(IP0_27_24,     DU_CDE),
+       PINMUX_IPSR_MSEL(IP0_27_24,     VI4_DATA0_B,            SEL_VIN4_1),
+       PINMUX_IPSR_MSEL(IP0_27_24,     CAN0_TX_B,              SEL_RCAN0_1),
+       PINMUX_IPSR_MSEL(IP0_27_24,     CANFD0_TX_B,            SEL_CANFD0_1),
+       PINMUX_IPSR_MSEL(IP0_27_24,     MSIOF3_SS2_E,           SEL_MSIOF3_4),
+
+       PINMUX_IPSR_GPSR(IP0_31_28,     IRQ1),
+       PINMUX_IPSR_GPSR(IP0_31_28,     QPOLA),
+       PINMUX_IPSR_GPSR(IP0_31_28,     DU_DISP),
+       PINMUX_IPSR_MSEL(IP0_31_28,     VI4_DATA1_B,            SEL_VIN4_1),
+       PINMUX_IPSR_MSEL(IP0_31_28,     CAN0_RX_B,              SEL_RCAN0_1),
+       PINMUX_IPSR_MSEL(IP0_31_28,     CANFD0_RX_B,            SEL_CANFD0_1),
+       PINMUX_IPSR_MSEL(IP0_31_28,     MSIOF3_SS1_E,           SEL_MSIOF3_4),
+
+       /* IPSR1 */
+       PINMUX_IPSR_GPSR(IP1_3_0,       IRQ2),
+       PINMUX_IPSR_GPSR(IP1_3_0,       QCPV_QDE),
+       PINMUX_IPSR_GPSR(IP1_3_0,       DU_EXODDF_DU_ODDF_DISP_CDE),
+       PINMUX_IPSR_MSEL(IP1_3_0,       VI4_DATA2_B,            SEL_VIN4_1),
+       PINMUX_IPSR_MSEL(IP1_3_0,       PWM3_B,                 SEL_PWM3_1),
+       PINMUX_IPSR_MSEL(IP1_3_0,       MSIOF3_SYNC_E,          SEL_MSIOF3_4),
+
+       PINMUX_IPSR_GPSR(IP1_7_4,       IRQ3),
+       PINMUX_IPSR_GPSR(IP1_7_4,       QSTVB_QVE),
+       PINMUX_IPSR_GPSR(IP1_7_4,       DU_DOTCLKOUT1),
+       PINMUX_IPSR_MSEL(IP1_7_4,       VI4_DATA3_B,            SEL_VIN4_1),
+       PINMUX_IPSR_MSEL(IP1_7_4,       PWM4_B,                 SEL_PWM4_1),
+       PINMUX_IPSR_MSEL(IP1_7_4,       MSIOF3_SCK_E,           SEL_MSIOF3_4),
+
+       PINMUX_IPSR_GPSR(IP1_11_8,      IRQ4),
+       PINMUX_IPSR_GPSR(IP1_11_8,      QSTH_QHS),
+       PINMUX_IPSR_GPSR(IP1_11_8,      DU_EXHSYNC_DU_HSYNC),
+       PINMUX_IPSR_MSEL(IP1_11_8,      VI4_DATA4_B,            SEL_VIN4_1),
+       PINMUX_IPSR_MSEL(IP1_11_8,      PWM5_B,                 SEL_PWM5_1),
+       PINMUX_IPSR_MSEL(IP1_11_8,      MSIOF3_RXD_E,           SEL_MSIOF3_4),
+
+       PINMUX_IPSR_GPSR(IP1_15_12,     IRQ5),
+       PINMUX_IPSR_GPSR(IP1_15_12,     QSTB_QHE),
+       PINMUX_IPSR_GPSR(IP1_15_12,     DU_EXVSYNC_DU_VSYNC),
+       PINMUX_IPSR_MSEL(IP1_15_12,     VI4_DATA5_B,            SEL_VIN4_1),
+       PINMUX_IPSR_MSEL(IP1_15_12,     PWM6_B,                 SEL_PWM6_1),
+       PINMUX_IPSR_GPSR(IP1_15_12,     FSCLKST2_N_B),
+       PINMUX_IPSR_MSEL(IP1_15_12,     MSIOF3_TXD_E,           SEL_MSIOF3_4),
+
+       PINMUX_IPSR_GPSR(IP1_19_16,     PWM0),
+       PINMUX_IPSR_GPSR(IP1_19_16,     AVB_AVTP_PPS),
+       PINMUX_IPSR_MSEL(IP1_19_16,     VI4_DATA6_B,            SEL_VIN4_1),
+       PINMUX_IPSR_MSEL(IP1_19_16,     IECLK_B,                SEL_IEBUS_1),
+
+       PINMUX_IPSR_MSEL(IP1_23_20,     PWM1_A,                 SEL_PWM1_0),
+       PINMUX_IPSR_MSEL(IP1_23_20,     HRX3_D,                 SEL_HSCIF3_3),
+       PINMUX_IPSR_MSEL(IP1_23_20,     VI4_DATA7_B,            SEL_VIN4_1),
+       PINMUX_IPSR_MSEL(IP1_23_20,     IERX_B,                 SEL_IEBUS_1),
+
+       PINMUX_IPSR_MSEL(IP1_27_24,     PWM2_A,                 SEL_PWM2_0),
+       PINMUX_IPSR_MSEL(IP1_27_24,     HTX3_D,                 SEL_HSCIF3_3),
+       PINMUX_IPSR_MSEL(IP1_27_24,     IETX_B,                 SEL_IEBUS_1),
+
+       PINMUX_IPSR_GPSR(IP1_31_28,     A0),
+       PINMUX_IPSR_GPSR(IP1_31_28,     LCDOUT16),
+       PINMUX_IPSR_MSEL(IP1_31_28,     MSIOF3_SYNC_B,          SEL_MSIOF3_1),
+       PINMUX_IPSR_GPSR(IP1_31_28,     VI4_DATA8),
+       PINMUX_IPSR_GPSR(IP1_31_28,     DU_DB0),
+       PINMUX_IPSR_MSEL(IP1_31_28,     PWM3_A,                 SEL_PWM3_0),
+
+       /* IPSR2 */
+       PINMUX_IPSR_GPSR(IP2_3_0,       A1),
+       PINMUX_IPSR_GPSR(IP2_3_0,       LCDOUT17),
+       PINMUX_IPSR_MSEL(IP2_3_0,       MSIOF3_TXD_B,           SEL_MSIOF3_1),
+       PINMUX_IPSR_GPSR(IP2_3_0,       VI4_DATA9),
+       PINMUX_IPSR_GPSR(IP2_3_0,       DU_DB1),
+       PINMUX_IPSR_MSEL(IP2_3_0,       PWM4_A,                 SEL_PWM4_0),
+
+       PINMUX_IPSR_GPSR(IP2_7_4,       A2),
+       PINMUX_IPSR_GPSR(IP2_7_4,       LCDOUT18),
+       PINMUX_IPSR_MSEL(IP2_7_4,       MSIOF3_SCK_B,           SEL_MSIOF3_1),
+       PINMUX_IPSR_GPSR(IP2_7_4,       VI4_DATA10),
+       PINMUX_IPSR_GPSR(IP2_7_4,       DU_DB2),
+       PINMUX_IPSR_MSEL(IP2_7_4,       PWM5_A,                 SEL_PWM5_0),
+
+       PINMUX_IPSR_GPSR(IP2_11_8,      A3),
+       PINMUX_IPSR_GPSR(IP2_11_8,      LCDOUT19),
+       PINMUX_IPSR_MSEL(IP2_11_8,      MSIOF3_RXD_B,           SEL_MSIOF3_1),
+       PINMUX_IPSR_GPSR(IP2_11_8,      VI4_DATA11),
+       PINMUX_IPSR_GPSR(IP2_11_8,      DU_DB3),
+       PINMUX_IPSR_MSEL(IP2_11_8,      PWM6_A,                 SEL_PWM6_0),
+
+       PINMUX_IPSR_GPSR(IP2_15_12,     A4),
+       PINMUX_IPSR_GPSR(IP2_15_12,     LCDOUT20),
+       PINMUX_IPSR_MSEL(IP2_15_12,     MSIOF3_SS1_B,           SEL_MSIOF3_1),
+       PINMUX_IPSR_GPSR(IP2_15_12,     VI4_DATA12),
+       PINMUX_IPSR_GPSR(IP2_15_12,     VI5_DATA12),
+       PINMUX_IPSR_GPSR(IP2_15_12,     DU_DB4),
+
+       PINMUX_IPSR_GPSR(IP2_19_16,     A5),
+       PINMUX_IPSR_GPSR(IP2_19_16,     LCDOUT21),
+       PINMUX_IPSR_MSEL(IP2_19_16,     MSIOF3_SS2_B,           SEL_MSIOF3_1),
+       PINMUX_IPSR_MSEL(IP2_19_16,     SCK4_B,                 SEL_SCIF4_1),
+       PINMUX_IPSR_GPSR(IP2_19_16,     VI4_DATA13),
+       PINMUX_IPSR_GPSR(IP2_19_16,     VI5_DATA13),
+       PINMUX_IPSR_GPSR(IP2_19_16,     DU_DB5),
+
+       PINMUX_IPSR_GPSR(IP2_23_20,     A6),
+       PINMUX_IPSR_GPSR(IP2_23_20,     LCDOUT22),
+       PINMUX_IPSR_MSEL(IP2_23_20,     MSIOF2_SS1_A,           SEL_MSIOF2_0),
+       PINMUX_IPSR_MSEL(IP2_23_20,     RX4_B,                  SEL_SCIF4_1),
+       PINMUX_IPSR_GPSR(IP2_23_20,     VI4_DATA14),
+       PINMUX_IPSR_GPSR(IP2_23_20,     VI5_DATA14),
+       PINMUX_IPSR_GPSR(IP2_23_20,     DU_DB6),
+
+       PINMUX_IPSR_GPSR(IP2_27_24,     A7),
+       PINMUX_IPSR_GPSR(IP2_27_24,     LCDOUT23),
+       PINMUX_IPSR_MSEL(IP2_27_24,     MSIOF2_SS2_A,           SEL_MSIOF2_0),
+       PINMUX_IPSR_MSEL(IP2_27_24,     TX4_B,                  SEL_SCIF4_1),
+       PINMUX_IPSR_GPSR(IP2_27_24,     VI4_DATA15),
+       PINMUX_IPSR_GPSR(IP2_27_24,     VI5_DATA15),
+       PINMUX_IPSR_GPSR(IP2_27_24,     DU_DB7),
+
+       PINMUX_IPSR_GPSR(IP2_31_28,     A8),
+       PINMUX_IPSR_MSEL(IP2_31_28,     RX3_B,                  SEL_SCIF3_1),
+       PINMUX_IPSR_MSEL(IP2_31_28,     MSIOF2_SYNC_A,          SEL_MSIOF2_0),
+       PINMUX_IPSR_MSEL(IP2_31_28,     HRX4_B,                 SEL_HSCIF4_1),
+       PINMUX_IPSR_MSEL(IP2_31_28,     SDA6_A,                 SEL_I2C6_0),
+       PINMUX_IPSR_MSEL(IP2_31_28,     AVB_AVTP_MATCH_B,       SEL_ETHERAVB_1),
+       PINMUX_IPSR_MSEL(IP2_31_28,     PWM1_B,                 SEL_PWM1_1),
+
+       /* IPSR3 */
+       PINMUX_IPSR_GPSR(IP3_3_0,       A9),
+       PINMUX_IPSR_MSEL(IP3_3_0,       MSIOF2_SCK_A,           SEL_MSIOF2_0),
+       PINMUX_IPSR_MSEL(IP3_3_0,       CTS4_N_B,               SEL_SCIF4_1),
+       PINMUX_IPSR_GPSR(IP3_3_0,       VI5_VSYNC_N),
+
+       PINMUX_IPSR_GPSR(IP3_7_4,       A10),
+       PINMUX_IPSR_MSEL(IP3_7_4,       MSIOF2_RXD_A,           SEL_MSIOF2_0),
+       PINMUX_IPSR_MSEL(IP3_7_4,       RTS4_N_B,               SEL_SCIF4_1),
+       PINMUX_IPSR_GPSR(IP3_7_4,       VI5_HSYNC_N),
+
+       PINMUX_IPSR_GPSR(IP3_11_8,      A11),
+       PINMUX_IPSR_MSEL(IP3_11_8,      TX3_B,                  SEL_SCIF3_1),
+       PINMUX_IPSR_MSEL(IP3_11_8,      MSIOF2_TXD_A,           SEL_MSIOF2_0),
+       PINMUX_IPSR_MSEL(IP3_11_8,      HTX4_B,                 SEL_HSCIF4_1),
+       PINMUX_IPSR_GPSR(IP3_11_8,      HSCK4),
+       PINMUX_IPSR_GPSR(IP3_11_8,      VI5_FIELD),
+       PINMUX_IPSR_MSEL(IP3_11_8,      SCL6_A,                 SEL_I2C6_0),
+       PINMUX_IPSR_MSEL(IP3_11_8,      AVB_AVTP_CAPTURE_B,     SEL_ETHERAVB_1),
+       PINMUX_IPSR_MSEL(IP3_11_8,      PWM2_B,                 SEL_PWM2_1),
+
+       PINMUX_IPSR_GPSR(IP3_15_12,     A12),
+       PINMUX_IPSR_GPSR(IP3_15_12,     LCDOUT12),
+       PINMUX_IPSR_MSEL(IP3_15_12,     MSIOF3_SCK_C,           SEL_MSIOF3_2),
+       PINMUX_IPSR_MSEL(IP3_15_12,     HRX4_A,                 SEL_HSCIF4_0),
+       PINMUX_IPSR_GPSR(IP3_15_12,     VI5_DATA8),
+       PINMUX_IPSR_GPSR(IP3_15_12,     DU_DG4),
+
+       PINMUX_IPSR_GPSR(IP3_19_16,     A13),
+       PINMUX_IPSR_GPSR(IP3_19_16,     LCDOUT13),
+       PINMUX_IPSR_MSEL(IP3_19_16,     MSIOF3_SYNC_C,          SEL_MSIOF3_2),
+       PINMUX_IPSR_MSEL(IP3_19_16,     HTX4_A,                 SEL_HSCIF4_0),
+       PINMUX_IPSR_GPSR(IP3_19_16,     VI5_DATA9),
+       PINMUX_IPSR_GPSR(IP3_19_16,     DU_DG5),
+
+       PINMUX_IPSR_GPSR(IP3_23_20,     A14),
+       PINMUX_IPSR_GPSR(IP3_23_20,     LCDOUT14),
+       PINMUX_IPSR_MSEL(IP3_23_20,     MSIOF3_RXD_C,           SEL_MSIOF3_2),
+       PINMUX_IPSR_GPSR(IP3_23_20,     HCTS4_N),
+       PINMUX_IPSR_GPSR(IP3_23_20,     VI5_DATA10),
+       PINMUX_IPSR_GPSR(IP3_23_20,     DU_DG6),
+
+       PINMUX_IPSR_GPSR(IP3_27_24,     A15),
+       PINMUX_IPSR_GPSR(IP3_27_24,     LCDOUT15),
+       PINMUX_IPSR_MSEL(IP3_27_24,     MSIOF3_TXD_C,           SEL_MSIOF3_2),
+       PINMUX_IPSR_GPSR(IP3_27_24,     HRTS4_N),
+       PINMUX_IPSR_GPSR(IP3_27_24,     VI5_DATA11),
+       PINMUX_IPSR_GPSR(IP3_27_24,     DU_DG7),
+
+       PINMUX_IPSR_GPSR(IP3_31_28,     A16),
+       PINMUX_IPSR_GPSR(IP3_31_28,     LCDOUT8),
+       PINMUX_IPSR_GPSR(IP3_31_28,     VI4_FIELD),
+       PINMUX_IPSR_GPSR(IP3_31_28,     DU_DG0),
+
+       /* IPSR4 */
+       PINMUX_IPSR_GPSR(IP4_3_0,       A17),
+       PINMUX_IPSR_GPSR(IP4_3_0,       LCDOUT9),
+       PINMUX_IPSR_GPSR(IP4_3_0,       VI4_VSYNC_N),
+       PINMUX_IPSR_GPSR(IP4_3_0,       DU_DG1),
+
+       PINMUX_IPSR_GPSR(IP4_7_4,       A18),
+       PINMUX_IPSR_GPSR(IP4_7_4,       LCDOUT10),
+       PINMUX_IPSR_GPSR(IP4_7_4,       VI4_HSYNC_N),
+       PINMUX_IPSR_GPSR(IP4_7_4,       DU_DG2),
+
+       PINMUX_IPSR_GPSR(IP4_11_8,      A19),
+       PINMUX_IPSR_GPSR(IP4_11_8,      LCDOUT11),
+       PINMUX_IPSR_GPSR(IP4_11_8,      VI4_CLKENB),
+       PINMUX_IPSR_GPSR(IP4_11_8,      DU_DG3),
+
+       PINMUX_IPSR_GPSR(IP4_15_12,     CS0_N),
+       PINMUX_IPSR_GPSR(IP4_15_12,     VI5_CLKENB),
+
+       PINMUX_IPSR_GPSR(IP4_19_16,     CS1_N),
+       PINMUX_IPSR_GPSR(IP4_19_16,     VI5_CLK),
+       PINMUX_IPSR_MSEL(IP4_19_16,     EX_WAIT0_B,             SEL_LBSC_1),
+
+       PINMUX_IPSR_GPSR(IP4_23_20,     BS_N),
+       PINMUX_IPSR_GPSR(IP4_23_20,     QSTVA_QVS),
+       PINMUX_IPSR_MSEL(IP4_23_20,     MSIOF3_SCK_D,           SEL_MSIOF3_3),
+       PINMUX_IPSR_GPSR(IP4_23_20,     SCK3),
+       PINMUX_IPSR_GPSR(IP4_23_20,     HSCK3),
+       PINMUX_IPSR_GPSR(IP4_23_20,     CAN1_TX),
+       PINMUX_IPSR_GPSR(IP4_23_20,     CANFD1_TX),
+       PINMUX_IPSR_MSEL(IP4_23_20,     IETX_A,                 SEL_IEBUS_0),
+
+       PINMUX_IPSR_GPSR(IP4_27_24,     RD_N),
+       PINMUX_IPSR_MSEL(IP4_27_24,     MSIOF3_SYNC_D,          SEL_MSIOF3_3),
+       PINMUX_IPSR_MSEL(IP4_27_24,     RX3_A,                  SEL_SCIF3_0),
+       PINMUX_IPSR_MSEL(IP4_27_24,     HRX3_A,                 SEL_HSCIF3_0),
+       PINMUX_IPSR_MSEL(IP4_27_24,     CAN0_TX_A,              SEL_RCAN0_0),
+       PINMUX_IPSR_MSEL(IP4_27_24,     CANFD0_TX_A,            SEL_CANFD0_0),
+
+       PINMUX_IPSR_GPSR(IP4_31_28,     RD_WR_N),
+       PINMUX_IPSR_MSEL(IP4_31_28,     MSIOF3_RXD_D,           SEL_MSIOF3_3),
+       PINMUX_IPSR_MSEL(IP4_31_28,     TX3_A,                  SEL_SCIF3_0),
+       PINMUX_IPSR_MSEL(IP4_31_28,     HTX3_A,                 SEL_HSCIF3_0),
+       PINMUX_IPSR_MSEL(IP4_31_28,     CAN0_RX_A,              SEL_RCAN0_0),
+       PINMUX_IPSR_MSEL(IP4_31_28,     CANFD0_RX_A,            SEL_CANFD0_0),
+
+       /* IPSR5 */
+       PINMUX_IPSR_GPSR(IP5_3_0,       WE0_N),
+       PINMUX_IPSR_MSEL(IP5_3_0,       MSIOF3_TXD_D,           SEL_MSIOF3_3),
+       PINMUX_IPSR_GPSR(IP5_3_0,       CTS3_N),
+       PINMUX_IPSR_GPSR(IP5_3_0,       HCTS3_N),
+       PINMUX_IPSR_MSEL(IP5_3_0,       SCL6_B,                 SEL_I2C6_1),
+       PINMUX_IPSR_GPSR(IP5_3_0,       CAN_CLK),
+       PINMUX_IPSR_MSEL(IP5_3_0,       IECLK_A,                SEL_IEBUS_0),
+
+       PINMUX_IPSR_GPSR(IP5_7_4,       WE1_N),
+       PINMUX_IPSR_MSEL(IP5_7_4,       MSIOF3_SS1_D,           SEL_MSIOF3_3),
+       PINMUX_IPSR_GPSR(IP5_7_4,       RTS3_N),
+       PINMUX_IPSR_GPSR(IP5_7_4,       HRTS3_N),
+       PINMUX_IPSR_MSEL(IP5_7_4,       SDA6_B,                 SEL_I2C6_1),
+       PINMUX_IPSR_GPSR(IP5_7_4,       CAN1_RX),
+       PINMUX_IPSR_GPSR(IP5_7_4,       CANFD1_RX),
+       PINMUX_IPSR_MSEL(IP5_7_4,       IERX_A,                 SEL_IEBUS_0),
+
+       PINMUX_IPSR_MSEL(IP5_11_8,      EX_WAIT0_A,             SEL_LBSC_0),
+       PINMUX_IPSR_GPSR(IP5_11_8,      QCLK),
+       PINMUX_IPSR_GPSR(IP5_11_8,      VI4_CLK),
+       PINMUX_IPSR_GPSR(IP5_11_8,      DU_DOTCLKOUT0),
+
+       PINMUX_IPSR_GPSR(IP5_15_12,     D0),
+       PINMUX_IPSR_MSEL(IP5_15_12,     MSIOF2_SS1_B,           SEL_MSIOF2_1),
+       PINMUX_IPSR_MSEL(IP5_15_12,     MSIOF3_SCK_A,           SEL_MSIOF3_0),
+       PINMUX_IPSR_GPSR(IP5_15_12,     VI4_DATA16),
+       PINMUX_IPSR_GPSR(IP5_15_12,     VI5_DATA0),
+
+       PINMUX_IPSR_GPSR(IP5_19_16,     D1),
+       PINMUX_IPSR_MSEL(IP5_19_16,     MSIOF2_SS2_B,           SEL_MSIOF2_1),
+       PINMUX_IPSR_MSEL(IP5_19_16,     MSIOF3_SYNC_A,          SEL_MSIOF3_0),
+       PINMUX_IPSR_GPSR(IP5_19_16,     VI4_DATA17),
+       PINMUX_IPSR_GPSR(IP5_19_16,     VI5_DATA1),
+
+       PINMUX_IPSR_GPSR(IP5_23_20,     D2),
+       PINMUX_IPSR_MSEL(IP5_23_20,     MSIOF3_RXD_A,           SEL_MSIOF3_0),
+       PINMUX_IPSR_GPSR(IP5_23_20,     VI4_DATA18),
+       PINMUX_IPSR_GPSR(IP5_23_20,     VI5_DATA2),
+
+       PINMUX_IPSR_GPSR(IP5_27_24,     D3),
+       PINMUX_IPSR_MSEL(IP5_27_24,     MSIOF3_TXD_A,           SEL_MSIOF3_0),
+       PINMUX_IPSR_GPSR(IP5_27_24,     VI4_DATA19),
+       PINMUX_IPSR_GPSR(IP5_27_24,     VI5_DATA3),
+
+       PINMUX_IPSR_GPSR(IP5_31_28,     D4),
+       PINMUX_IPSR_MSEL(IP5_31_28,     MSIOF2_SCK_B,           SEL_MSIOF2_1),
+       PINMUX_IPSR_GPSR(IP5_31_28,     VI4_DATA20),
+       PINMUX_IPSR_GPSR(IP5_31_28,     VI5_DATA4),
+
+       /* IPSR6 */
+       PINMUX_IPSR_GPSR(IP6_3_0,       D5),
+       PINMUX_IPSR_MSEL(IP6_3_0,       MSIOF2_SYNC_B,          SEL_MSIOF2_1),
+       PINMUX_IPSR_GPSR(IP6_3_0,       VI4_DATA21),
+       PINMUX_IPSR_GPSR(IP6_3_0,       VI5_DATA5),
+
+       PINMUX_IPSR_GPSR(IP6_7_4,       D6),
+       PINMUX_IPSR_MSEL(IP6_7_4,       MSIOF2_RXD_B,           SEL_MSIOF2_1),
+       PINMUX_IPSR_GPSR(IP6_7_4,       VI4_DATA22),
+       PINMUX_IPSR_GPSR(IP6_7_4,       VI5_DATA6),
+
+       PINMUX_IPSR_GPSR(IP6_11_8,      D7),
+       PINMUX_IPSR_MSEL(IP6_11_8,      MSIOF2_TXD_B,           SEL_MSIOF2_1),
+       PINMUX_IPSR_GPSR(IP6_11_8,      VI4_DATA23),
+       PINMUX_IPSR_GPSR(IP6_11_8,      VI5_DATA7),
+
+       PINMUX_IPSR_GPSR(IP6_15_12,     D8),
+       PINMUX_IPSR_GPSR(IP6_15_12,     LCDOUT0),
+       PINMUX_IPSR_MSEL(IP6_15_12,     MSIOF2_SCK_D,           SEL_MSIOF2_3),
+       PINMUX_IPSR_MSEL(IP6_15_12,     SCK4_C,                 SEL_SCIF4_2),
+       PINMUX_IPSR_MSEL(IP6_15_12,     VI4_DATA0_A,            SEL_VIN4_0),
+       PINMUX_IPSR_GPSR(IP6_15_12,     DU_DR0),
+
+       PINMUX_IPSR_GPSR(IP6_19_16,     D9),
+       PINMUX_IPSR_GPSR(IP6_19_16,     LCDOUT1),
+       PINMUX_IPSR_MSEL(IP6_19_16,     MSIOF2_SYNC_D,          SEL_MSIOF2_3),
+       PINMUX_IPSR_MSEL(IP6_19_16,     VI4_DATA1_A,            SEL_VIN4_0),
+       PINMUX_IPSR_GPSR(IP6_19_16,     DU_DR1),
+
+       PINMUX_IPSR_GPSR(IP6_23_20,     D10),
+       PINMUX_IPSR_GPSR(IP6_23_20,     LCDOUT2),
+       PINMUX_IPSR_MSEL(IP6_23_20,     MSIOF2_RXD_D,           SEL_MSIOF2_3),
+       PINMUX_IPSR_MSEL(IP6_23_20,     HRX3_B,                 SEL_HSCIF3_1),
+       PINMUX_IPSR_MSEL(IP6_23_20,     VI4_DATA2_A,            SEL_VIN4_0),
+       PINMUX_IPSR_MSEL(IP6_23_20,     CTS4_N_C,               SEL_SCIF4_2),
+       PINMUX_IPSR_GPSR(IP6_23_20,     DU_DR2),
+
+       PINMUX_IPSR_GPSR(IP6_27_24,     D11),
+       PINMUX_IPSR_GPSR(IP6_27_24,     LCDOUT3),
+       PINMUX_IPSR_MSEL(IP6_27_24,     MSIOF2_TXD_D,           SEL_MSIOF2_3),
+       PINMUX_IPSR_MSEL(IP6_27_24,     HTX3_B,                 SEL_HSCIF3_1),
+       PINMUX_IPSR_MSEL(IP6_27_24,     VI4_DATA3_A,            SEL_VIN4_0),
+       PINMUX_IPSR_MSEL(IP6_27_24,     RTS4_N_C,               SEL_SCIF4_2),
+       PINMUX_IPSR_GPSR(IP6_27_24,     DU_DR3),
+
+       PINMUX_IPSR_GPSR(IP6_31_28,     D12),
+       PINMUX_IPSR_GPSR(IP6_31_28,     LCDOUT4),
+       PINMUX_IPSR_MSEL(IP6_31_28,     MSIOF2_SS1_D,           SEL_MSIOF2_3),
+       PINMUX_IPSR_MSEL(IP6_31_28,     RX4_C,                  SEL_SCIF4_2),
+       PINMUX_IPSR_MSEL(IP6_31_28,     VI4_DATA4_A,            SEL_VIN4_0),
+       PINMUX_IPSR_GPSR(IP6_31_28,     DU_DR4),
+
+       /* IPSR7 */
+       PINMUX_IPSR_GPSR(IP7_3_0,       D13),
+       PINMUX_IPSR_GPSR(IP7_3_0,       LCDOUT5),
+       PINMUX_IPSR_MSEL(IP7_3_0,       MSIOF2_SS2_D,           SEL_MSIOF2_3),
+       PINMUX_IPSR_MSEL(IP7_3_0,       TX4_C,                  SEL_SCIF4_2),
+       PINMUX_IPSR_MSEL(IP7_3_0,       VI4_DATA5_A,            SEL_VIN4_0),
+       PINMUX_IPSR_GPSR(IP7_3_0,       DU_DR5),
+
+       PINMUX_IPSR_GPSR(IP7_7_4,       D14),
+       PINMUX_IPSR_GPSR(IP7_7_4,       LCDOUT6),
+       PINMUX_IPSR_MSEL(IP7_7_4,       MSIOF3_SS1_A,           SEL_MSIOF3_0),
+       PINMUX_IPSR_MSEL(IP7_7_4,       HRX3_C,                 SEL_HSCIF3_2),
+       PINMUX_IPSR_MSEL(IP7_7_4,       VI4_DATA6_A,            SEL_VIN4_0),
+       PINMUX_IPSR_GPSR(IP7_7_4,       DU_DR6),
+       PINMUX_IPSR_MSEL(IP7_7_4,       SCL6_C,                 SEL_I2C6_2),
+
+       PINMUX_IPSR_GPSR(IP7_11_8,      D15),
+       PINMUX_IPSR_GPSR(IP7_11_8,      LCDOUT7),
+       PINMUX_IPSR_MSEL(IP7_11_8,      MSIOF3_SS2_A,           SEL_MSIOF3_0),
+       PINMUX_IPSR_MSEL(IP7_11_8,      HTX3_C,                 SEL_HSCIF3_2),
+       PINMUX_IPSR_MSEL(IP7_11_8,      VI4_DATA7_A,            SEL_VIN4_0),
+       PINMUX_IPSR_GPSR(IP7_11_8,      DU_DR7),
+       PINMUX_IPSR_MSEL(IP7_11_8,      SDA6_C,                 SEL_I2C6_2),
+
+       PINMUX_IPSR_GPSR(IP7_19_16,     SD0_CLK),
+       PINMUX_IPSR_MSEL(IP7_19_16,     MSIOF1_SCK_E,           SEL_MSIOF1_4),
+       PINMUX_IPSR_MSEL(IP7_19_16,     STP_OPWM_0_B,           SEL_SSP1_0_1),
+
+       PINMUX_IPSR_GPSR(IP7_23_20,     SD0_CMD),
+       PINMUX_IPSR_MSEL(IP7_23_20,     MSIOF1_SYNC_E,          SEL_MSIOF1_4),
+       PINMUX_IPSR_MSEL(IP7_23_20,     STP_IVCXO27_0_B,        SEL_SSP1_0_1),
+
+       PINMUX_IPSR_GPSR(IP7_27_24,     SD0_DAT0),
+       PINMUX_IPSR_MSEL(IP7_27_24,     MSIOF1_RXD_E,           SEL_MSIOF1_4),
+       PINMUX_IPSR_MSEL(IP7_27_24,     TS_SCK0_B,              SEL_TSIF0_1),
+       PINMUX_IPSR_MSEL(IP7_27_24,     STP_ISCLK_0_B,          SEL_SSP1_0_1),
+
+       PINMUX_IPSR_GPSR(IP7_31_28,     SD0_DAT1),
+       PINMUX_IPSR_MSEL(IP7_31_28,     MSIOF1_TXD_E,           SEL_MSIOF1_4),
+       PINMUX_IPSR_MSEL(IP7_31_28,     TS_SPSYNC0_B,           SEL_TSIF0_1),
+       PINMUX_IPSR_MSEL(IP7_31_28,     STP_ISSYNC_0_B,         SEL_SSP1_0_1),
+
+       /* IPSR8 */
+       PINMUX_IPSR_GPSR(IP8_3_0,       SD0_DAT2),
+       PINMUX_IPSR_MSEL(IP8_3_0,       MSIOF1_SS1_E,           SEL_MSIOF1_4),
+       PINMUX_IPSR_MSEL(IP8_3_0,       TS_SDAT0_B,             SEL_TSIF0_1),
+       PINMUX_IPSR_MSEL(IP8_3_0,       STP_ISD_0_B,            SEL_SSP1_0_1),
+
+       PINMUX_IPSR_GPSR(IP8_7_4,       SD0_DAT3),
+       PINMUX_IPSR_MSEL(IP8_7_4,       MSIOF1_SS2_E,           SEL_MSIOF1_4),
+       PINMUX_IPSR_MSEL(IP8_7_4,       TS_SDEN0_B,             SEL_TSIF0_1),
+       PINMUX_IPSR_MSEL(IP8_7_4,       STP_ISEN_0_B,           SEL_SSP1_0_1),
+
+       PINMUX_IPSR_GPSR(IP8_11_8,      SD1_CLK),
+       PINMUX_IPSR_MSEL(IP8_11_8,      MSIOF1_SCK_G,           SEL_MSIOF1_6),
+       PINMUX_IPSR_MSEL(IP8_11_8,      SIM0_CLK_A,             SEL_SIMCARD_0),
+
+       PINMUX_IPSR_GPSR(IP8_15_12,     SD1_CMD),
+       PINMUX_IPSR_MSEL(IP8_15_12,     MSIOF1_SYNC_G,          SEL_MSIOF1_6),
+       PINMUX_IPSR_MSEL(IP8_15_12,     NFCE_N_B,               SEL_NDFC_1),
+       PINMUX_IPSR_MSEL(IP8_15_12,     SIM0_D_A,               SEL_SIMCARD_0),
+       PINMUX_IPSR_MSEL(IP8_15_12,     STP_IVCXO27_1_B,        SEL_SSP1_1_1),
+
+       PINMUX_IPSR_GPSR(IP8_19_16,     SD1_DAT0),
+       PINMUX_IPSR_GPSR(IP8_19_16,     SD2_DAT4),
+       PINMUX_IPSR_MSEL(IP8_19_16,     MSIOF1_RXD_G,           SEL_MSIOF1_6),
+       PINMUX_IPSR_MSEL(IP8_19_16,     NFWP_N_B,               SEL_NDFC_1),
+       PINMUX_IPSR_MSEL(IP8_19_16,     TS_SCK1_B,              SEL_TSIF1_1),
+       PINMUX_IPSR_MSEL(IP8_19_16,     STP_ISCLK_1_B,          SEL_SSP1_1_1),
+
+       PINMUX_IPSR_GPSR(IP8_23_20,     SD1_DAT1),
+       PINMUX_IPSR_GPSR(IP8_23_20,     SD2_DAT5),
+       PINMUX_IPSR_MSEL(IP8_23_20,     MSIOF1_TXD_G,           SEL_MSIOF1_6),
+       PINMUX_IPSR_MSEL(IP8_23_20,     NFDATA14_B,             SEL_NDFC_1),
+       PINMUX_IPSR_MSEL(IP8_23_20,     TS_SPSYNC1_B,           SEL_TSIF1_1),
+       PINMUX_IPSR_MSEL(IP8_23_20,     STP_ISSYNC_1_B,         SEL_SSP1_1_1),
+
+       PINMUX_IPSR_GPSR(IP8_27_24,     SD1_DAT2),
+       PINMUX_IPSR_GPSR(IP8_27_24,     SD2_DAT6),
+       PINMUX_IPSR_MSEL(IP8_27_24,     MSIOF1_SS1_G,           SEL_MSIOF1_6),
+       PINMUX_IPSR_MSEL(IP8_27_24,     NFDATA15_B,             SEL_NDFC_1),
+       PINMUX_IPSR_MSEL(IP8_27_24,     TS_SDAT1_B,             SEL_TSIF1_1),
+       PINMUX_IPSR_MSEL(IP8_27_24,     STP_ISD_1_B,            SEL_SSP1_1_1),
+
+       PINMUX_IPSR_GPSR(IP8_31_28,     SD1_DAT3),
+       PINMUX_IPSR_GPSR(IP8_31_28,     SD2_DAT7),
+       PINMUX_IPSR_MSEL(IP8_31_28,     MSIOF1_SS2_G,           SEL_MSIOF1_6),
+       PINMUX_IPSR_MSEL(IP8_31_28,     NFRB_N_B,               SEL_NDFC_1),
+       PINMUX_IPSR_MSEL(IP8_31_28,     TS_SDEN1_B,             SEL_TSIF1_1),
+       PINMUX_IPSR_MSEL(IP8_31_28,     STP_ISEN_1_B,           SEL_SSP1_1_1),
+
+       /* IPSR9 */
+       PINMUX_IPSR_GPSR(IP9_3_0,       SD2_CLK),
+       PINMUX_IPSR_GPSR(IP9_3_0,       NFDATA8),
+
+       PINMUX_IPSR_GPSR(IP9_7_4,       SD2_CMD),
+       PINMUX_IPSR_GPSR(IP9_7_4,       NFDATA9),
+
+       PINMUX_IPSR_GPSR(IP9_11_8,      SD2_DAT0),
+       PINMUX_IPSR_GPSR(IP9_11_8,      NFDATA10),
+
+       PINMUX_IPSR_GPSR(IP9_15_12,     SD2_DAT1),
+       PINMUX_IPSR_GPSR(IP9_15_12,     NFDATA11),
+
+       PINMUX_IPSR_GPSR(IP9_19_16,     SD2_DAT2),
+       PINMUX_IPSR_GPSR(IP9_19_16,     NFDATA12),
+
+       PINMUX_IPSR_GPSR(IP9_23_20,     SD2_DAT3),
+       PINMUX_IPSR_GPSR(IP9_23_20,     NFDATA13),
+
+       PINMUX_IPSR_GPSR(IP9_27_24,     SD2_DS),
+       PINMUX_IPSR_GPSR(IP9_27_24,     NFALE),
+       PINMUX_IPSR_GPSR(IP9_27_24,     SATA_DEVSLP_B),
+
+       PINMUX_IPSR_GPSR(IP9_31_28,     SD3_CLK),
+       PINMUX_IPSR_GPSR(IP9_31_28,     NFWE_N),
+
+       /* IPSR10 */
+       PINMUX_IPSR_GPSR(IP10_3_0,      SD3_CMD),
+       PINMUX_IPSR_GPSR(IP10_3_0,      NFRE_N),
+
+       PINMUX_IPSR_GPSR(IP10_7_4,      SD3_DAT0),
+       PINMUX_IPSR_GPSR(IP10_7_4,      NFDATA0),
+
+       PINMUX_IPSR_GPSR(IP10_11_8,     SD3_DAT1),
+       PINMUX_IPSR_GPSR(IP10_11_8,     NFDATA1),
+
+       PINMUX_IPSR_GPSR(IP10_15_12,    SD3_DAT2),
+       PINMUX_IPSR_GPSR(IP10_15_12,    NFDATA2),
+
+       PINMUX_IPSR_GPSR(IP10_19_16,    SD3_DAT3),
+       PINMUX_IPSR_GPSR(IP10_19_16,    NFDATA3),
+
+       PINMUX_IPSR_GPSR(IP10_23_20,    SD3_DAT4),
+       PINMUX_IPSR_MSEL(IP10_23_20,    SD2_CD_A,               SEL_SDHI2_0),
+       PINMUX_IPSR_GPSR(IP10_23_20,    NFDATA4),
+
+       PINMUX_IPSR_GPSR(IP10_27_24,    SD3_DAT5),
+       PINMUX_IPSR_MSEL(IP10_27_24,    SD2_WP_A,               SEL_SDHI2_0),
+       PINMUX_IPSR_GPSR(IP10_27_24,    NFDATA5),
+
+       PINMUX_IPSR_GPSR(IP10_31_28,    SD3_DAT6),
+       PINMUX_IPSR_GPSR(IP10_31_28,    SD3_CD),
+       PINMUX_IPSR_GPSR(IP10_31_28,    NFDATA6),
+
+       /* IPSR11 */
+       PINMUX_IPSR_GPSR(IP11_3_0,      SD3_DAT7),
+       PINMUX_IPSR_GPSR(IP11_3_0,      SD3_WP),
+       PINMUX_IPSR_GPSR(IP11_3_0,      NFDATA7),
+
+       PINMUX_IPSR_GPSR(IP11_7_4,      SD3_DS),
+       PINMUX_IPSR_GPSR(IP11_7_4,      NFCLE),
+
+       PINMUX_IPSR_GPSR(IP11_11_8,     SD0_CD),
+       PINMUX_IPSR_MSEL(IP11_11_8,     NFDATA14_A,             SEL_NDFC_0),
+       PINMUX_IPSR_MSEL(IP11_11_8,     SCL2_B,                 SEL_I2C2_1),
+       PINMUX_IPSR_MSEL(IP11_11_8,     SIM0_RST_A,             SEL_SIMCARD_0),
+
+       PINMUX_IPSR_GPSR(IP11_15_12,    SD0_WP),
+       PINMUX_IPSR_MSEL(IP11_15_12,    NFDATA15_A,             SEL_NDFC_0),
+       PINMUX_IPSR_MSEL(IP11_15_12,    SDA2_B,                 SEL_I2C2_1),
+
+       PINMUX_IPSR_GPSR(IP11_19_16,    SD1_CD),
+       PINMUX_IPSR_MSEL(IP11_19_16,    NFRB_N_A,               SEL_NDFC_0),
+       PINMUX_IPSR_MSEL(IP11_19_16,    SIM0_CLK_B,             SEL_SIMCARD_1),
+
+       PINMUX_IPSR_GPSR(IP11_23_20,    SD1_WP),
+       PINMUX_IPSR_MSEL(IP11_23_20,    NFCE_N_A,               SEL_NDFC_0),
+       PINMUX_IPSR_MSEL(IP11_23_20,    SIM0_D_B,               SEL_SIMCARD_1),
+
+       PINMUX_IPSR_GPSR(IP11_27_24,    SCK0),
+       PINMUX_IPSR_MSEL(IP11_27_24,    HSCK1_B,                SEL_HSCIF1_1),
+       PINMUX_IPSR_MSEL(IP11_27_24,    MSIOF1_SS2_B,           SEL_MSIOF1_1),
+       PINMUX_IPSR_MSEL(IP11_27_24,    AUDIO_CLKC_B,           SEL_ADG_C_1),
+       PINMUX_IPSR_MSEL(IP11_27_24,    SDA2_A,                 SEL_I2C2_0),
+       PINMUX_IPSR_MSEL(IP11_27_24,    SIM0_RST_B,             SEL_SIMCARD_1),
+       PINMUX_IPSR_MSEL(IP11_27_24,    STP_OPWM_0_C,           SEL_SSP1_0_2),
+       PINMUX_IPSR_MSEL(IP11_27_24,    RIF0_CLK_B,             SEL_DRIF0_1),
+       PINMUX_IPSR_GPSR(IP11_27_24,    ADICHS2),
+       PINMUX_IPSR_MSEL(IP11_27_24,    SCK5_B,                 SEL_SCIF5_1),
+
+       PINMUX_IPSR_GPSR(IP11_31_28,    RX0),
+       PINMUX_IPSR_MSEL(IP11_31_28,    HRX1_B,                 SEL_HSCIF1_1),
+       PINMUX_IPSR_MSEL(IP11_31_28,    TS_SCK0_C,              SEL_TSIF0_2),
+       PINMUX_IPSR_MSEL(IP11_31_28,    STP_ISCLK_0_C,          SEL_SSP1_0_2),
+       PINMUX_IPSR_MSEL(IP11_31_28,    RIF0_D0_B,              SEL_DRIF0_1),
+
+       /* IPSR12 */
+       PINMUX_IPSR_GPSR(IP12_3_0,      TX0),
+       PINMUX_IPSR_MSEL(IP12_3_0,      HTX1_B,                 SEL_HSCIF1_1),
+       PINMUX_IPSR_MSEL(IP12_3_0,      TS_SPSYNC0_C,           SEL_TSIF0_2),
+       PINMUX_IPSR_MSEL(IP12_3_0,      STP_ISSYNC_0_C,         SEL_SSP1_0_2),
+       PINMUX_IPSR_MSEL(IP12_3_0,      RIF0_D1_B,              SEL_DRIF0_1),
+
+       PINMUX_IPSR_GPSR(IP12_7_4,      CTS0_N),
+       PINMUX_IPSR_MSEL(IP12_7_4,      HCTS1_N_B,              SEL_HSCIF1_1),
+       PINMUX_IPSR_MSEL(IP12_7_4,      MSIOF1_SYNC_B,          SEL_MSIOF1_1),
+       PINMUX_IPSR_MSEL(IP12_7_4,      TS_SPSYNC1_C,           SEL_TSIF1_2),
+       PINMUX_IPSR_MSEL(IP12_7_4,      STP_ISSYNC_1_C,         SEL_SSP1_1_2),
+       PINMUX_IPSR_MSEL(IP12_7_4,      RIF1_SYNC_B,            SEL_DRIF1_1),
+       PINMUX_IPSR_GPSR(IP12_7_4,      AUDIO_CLKOUT_C),
+       PINMUX_IPSR_GPSR(IP12_7_4,      ADICS_SAMP),
+
+       PINMUX_IPSR_GPSR(IP12_11_8,     RTS0_N),
+       PINMUX_IPSR_MSEL(IP12_11_8,     HRTS1_N_B,              SEL_HSCIF1_1),
+       PINMUX_IPSR_MSEL(IP12_11_8,     MSIOF1_SS1_B,           SEL_MSIOF1_1),
+       PINMUX_IPSR_MSEL(IP12_11_8,     AUDIO_CLKA_B,           SEL_ADG_A_1),
+       PINMUX_IPSR_MSEL(IP12_11_8,     SCL2_A,                 SEL_I2C2_0),
+       PINMUX_IPSR_MSEL(IP12_11_8,     STP_IVCXO27_1_C,        SEL_SSP1_1_2),
+       PINMUX_IPSR_MSEL(IP12_11_8,     RIF0_SYNC_B,            SEL_DRIF0_1),
+       PINMUX_IPSR_GPSR(IP12_11_8,     ADICHS1),
+
+       PINMUX_IPSR_MSEL(IP12_15_12,    RX1_A,                  SEL_SCIF1_0),
+       PINMUX_IPSR_MSEL(IP12_15_12,    HRX1_A,                 SEL_HSCIF1_0),
+       PINMUX_IPSR_MSEL(IP12_15_12,    TS_SDAT0_C,             SEL_TSIF0_2),
+       PINMUX_IPSR_MSEL(IP12_15_12,    STP_ISD_0_C,            SEL_SSP1_0_2),
+       PINMUX_IPSR_MSEL(IP12_15_12,    RIF1_CLK_C,             SEL_DRIF1_2),
+
+       PINMUX_IPSR_MSEL(IP12_19_16,    TX1_A,                  SEL_SCIF1_0),
+       PINMUX_IPSR_MSEL(IP12_19_16,    HTX1_A,                 SEL_HSCIF1_0),
+       PINMUX_IPSR_MSEL(IP12_19_16,    TS_SDEN0_C,             SEL_TSIF0_2),
+       PINMUX_IPSR_MSEL(IP12_19_16,    STP_ISEN_0_C,           SEL_SSP1_0_2),
+       PINMUX_IPSR_MSEL(IP12_19_16,    RIF1_D0_C,              SEL_DRIF1_2),
+
+       PINMUX_IPSR_GPSR(IP12_23_20,    CTS1_N),
+       PINMUX_IPSR_MSEL(IP12_23_20,    HCTS1_N_A,              SEL_HSCIF1_0),
+       PINMUX_IPSR_MSEL(IP12_23_20,    MSIOF1_RXD_B,           SEL_MSIOF1_1),
+       PINMUX_IPSR_MSEL(IP12_23_20,    TS_SDEN1_C,             SEL_TSIF1_2),
+       PINMUX_IPSR_MSEL(IP12_23_20,    STP_ISEN_1_C,           SEL_SSP1_1_2),
+       PINMUX_IPSR_MSEL(IP12_23_20,    RIF1_D0_B,              SEL_DRIF1_1),
+       PINMUX_IPSR_GPSR(IP12_23_20,    ADIDATA),
+
+       PINMUX_IPSR_GPSR(IP12_27_24,    RTS1_N),
+       PINMUX_IPSR_MSEL(IP12_27_24,    HRTS1_N_A,              SEL_HSCIF1_0),
+       PINMUX_IPSR_MSEL(IP12_27_24,    MSIOF1_TXD_B,           SEL_MSIOF1_1),
+       PINMUX_IPSR_MSEL(IP12_27_24,    TS_SDAT1_C,             SEL_TSIF1_2),
+       PINMUX_IPSR_MSEL(IP12_27_24,    STP_ISD_1_C,            SEL_SSP1_1_2),
+       PINMUX_IPSR_MSEL(IP12_27_24,    RIF1_D1_B,              SEL_DRIF1_1),
+       PINMUX_IPSR_GPSR(IP12_27_24,    ADICHS0),
+
+       PINMUX_IPSR_GPSR(IP12_31_28,    SCK2),
+       PINMUX_IPSR_MSEL(IP12_31_28,    SCIF_CLK_B,             SEL_SCIF_1),
+       PINMUX_IPSR_MSEL(IP12_31_28,    MSIOF1_SCK_B,           SEL_MSIOF1_1),
+       PINMUX_IPSR_MSEL(IP12_31_28,    TS_SCK1_C,              SEL_TSIF1_2),
+       PINMUX_IPSR_MSEL(IP12_31_28,    STP_ISCLK_1_C,          SEL_SSP1_1_2),
+       PINMUX_IPSR_MSEL(IP12_31_28,    RIF1_CLK_B,             SEL_DRIF1_1),
+       PINMUX_IPSR_GPSR(IP12_31_28,    ADICLK),
+
+       /* IPSR13 */
+       PINMUX_IPSR_MSEL(IP13_3_0,      TX2_A,                  SEL_SCIF2_0),
+       PINMUX_IPSR_MSEL(IP13_3_0,      SD2_CD_B,               SEL_SDHI2_1),
+       PINMUX_IPSR_MSEL(IP13_3_0,      SCL1_A,                 SEL_I2C1_0),
+       PINMUX_IPSR_MSEL(IP13_3_0,      FMCLK_A,                SEL_FM_0),
+       PINMUX_IPSR_MSEL(IP13_3_0,      RIF1_D1_C,              SEL_DRIF1_2),
+       PINMUX_IPSR_GPSR(IP13_3_0,      FSO_CFE_0_N),
+
+       PINMUX_IPSR_MSEL(IP13_7_4,      RX2_A,                  SEL_SCIF2_0),
+       PINMUX_IPSR_MSEL(IP13_7_4,      SD2_WP_B,               SEL_SDHI2_1),
+       PINMUX_IPSR_MSEL(IP13_7_4,      SDA1_A,                 SEL_I2C1_0),
+       PINMUX_IPSR_MSEL(IP13_7_4,      FMIN_A,                 SEL_FM_0),
+       PINMUX_IPSR_MSEL(IP13_7_4,      RIF1_SYNC_C,            SEL_DRIF1_2),
+       PINMUX_IPSR_GPSR(IP13_7_4,      FSO_CFE_1_N),
+
+       PINMUX_IPSR_GPSR(IP13_11_8,     HSCK0),
+       PINMUX_IPSR_MSEL(IP13_11_8,     MSIOF1_SCK_D,           SEL_MSIOF1_3),
+       PINMUX_IPSR_MSEL(IP13_11_8,     AUDIO_CLKB_A,           SEL_ADG_B_0),
+       PINMUX_IPSR_MSEL(IP13_11_8,     SSI_SDATA1_B,           SEL_SSI1_1),
+       PINMUX_IPSR_MSEL(IP13_11_8,     TS_SCK0_D,              SEL_TSIF0_3),
+       PINMUX_IPSR_MSEL(IP13_11_8,     STP_ISCLK_0_D,          SEL_SSP1_0_3),
+       PINMUX_IPSR_MSEL(IP13_11_8,     RIF0_CLK_C,             SEL_DRIF0_2),
+       PINMUX_IPSR_MSEL(IP13_11_8,     RX5_B,                  SEL_SCIF5_1),
+
+       PINMUX_IPSR_GPSR(IP13_15_12,    HRX0),
+       PINMUX_IPSR_MSEL(IP13_15_12,    MSIOF1_RXD_D,           SEL_MSIOF1_3),
+       PINMUX_IPSR_MSEL(IP13_15_12,    SSI_SDATA2_B,           SEL_SSI2_1),
+       PINMUX_IPSR_MSEL(IP13_15_12,    TS_SDEN0_D,             SEL_TSIF0_3),
+       PINMUX_IPSR_MSEL(IP13_15_12,    STP_ISEN_0_D,           SEL_SSP1_0_3),
+       PINMUX_IPSR_MSEL(IP13_15_12,    RIF0_D0_C,              SEL_DRIF0_2),
+
+       PINMUX_IPSR_GPSR(IP13_19_16,    HTX0),
+       PINMUX_IPSR_MSEL(IP13_19_16,    MSIOF1_TXD_D,           SEL_MSIOF1_3),
+       PINMUX_IPSR_MSEL(IP13_19_16,    SSI_SDATA9_B,           SEL_SSI9_1),
+       PINMUX_IPSR_MSEL(IP13_19_16,    TS_SDAT0_D,             SEL_TSIF0_3),
+       PINMUX_IPSR_MSEL(IP13_19_16,    STP_ISD_0_D,            SEL_SSP1_0_3),
+       PINMUX_IPSR_MSEL(IP13_19_16,    RIF0_D1_C,              SEL_DRIF0_2),
+
+       PINMUX_IPSR_GPSR(IP13_23_20,    HCTS0_N),
+       PINMUX_IPSR_MSEL(IP13_23_20,    RX2_B,                  SEL_SCIF2_1),
+       PINMUX_IPSR_MSEL(IP13_23_20,    MSIOF1_SYNC_D,          SEL_MSIOF1_3),
+       PINMUX_IPSR_MSEL(IP13_23_20,    SSI_SCK9_A,             SEL_SSI9_0),
+       PINMUX_IPSR_MSEL(IP13_23_20,    TS_SPSYNC0_D,           SEL_TSIF0_3),
+       PINMUX_IPSR_MSEL(IP13_23_20,    STP_ISSYNC_0_D,         SEL_SSP1_0_3),
+       PINMUX_IPSR_MSEL(IP13_23_20,    RIF0_SYNC_C,            SEL_DRIF0_2),
+       PINMUX_IPSR_GPSR(IP13_23_20,    AUDIO_CLKOUT1_A),
+
+       PINMUX_IPSR_GPSR(IP13_27_24,    HRTS0_N),
+       PINMUX_IPSR_MSEL(IP13_27_24,    TX2_B,                  SEL_SCIF2_1),
+       PINMUX_IPSR_MSEL(IP13_27_24,    MSIOF1_SS1_D,           SEL_MSIOF1_3),
+       PINMUX_IPSR_MSEL(IP13_27_24,    SSI_WS9_A,              SEL_SSI9_0),
+       PINMUX_IPSR_MSEL(IP13_27_24,    STP_IVCXO27_0_D,        SEL_SSP1_0_3),
+       PINMUX_IPSR_MSEL(IP13_27_24,    BPFCLK_A,               SEL_FM_0),
+       PINMUX_IPSR_GPSR(IP13_27_24,    AUDIO_CLKOUT2_A),
+
+       PINMUX_IPSR_GPSR(IP13_31_28,    MSIOF0_SYNC),
+       PINMUX_IPSR_GPSR(IP13_31_28,    AUDIO_CLKOUT_A),
+       PINMUX_IPSR_MSEL(IP13_31_28,    TX5_B,                  SEL_SCIF5_1),
+       PINMUX_IPSR_MSEL(IP13_31_28,    BPFCLK_D,               SEL_FM_3),
+
+       /* IPSR14 */
+       PINMUX_IPSR_GPSR(IP14_3_0,      MSIOF0_SS1),
+       PINMUX_IPSR_MSEL(IP14_3_0,      RX5_A,                  SEL_SCIF5_0),
+       PINMUX_IPSR_MSEL(IP14_3_0,      NFWP_N_A,               SEL_NDFC_0),
+       PINMUX_IPSR_MSEL(IP14_3_0,      AUDIO_CLKA_C,           SEL_ADG_A_2),
+       PINMUX_IPSR_MSEL(IP14_3_0,      SSI_SCK2_A,             SEL_SSI2_0),
+       PINMUX_IPSR_MSEL(IP14_3_0,      STP_IVCXO27_0_C,        SEL_SSP1_0_2),
+       PINMUX_IPSR_GPSR(IP14_3_0,      AUDIO_CLKOUT3_A),
+       PINMUX_IPSR_MSEL(IP14_3_0,      TCLK1_B,                SEL_TIMER_TMU_1),
+
+       PINMUX_IPSR_GPSR(IP14_7_4,      MSIOF0_SS2),
+       PINMUX_IPSR_MSEL(IP14_7_4,      TX5_A,                  SEL_SCIF5_0),
+       PINMUX_IPSR_MSEL(IP14_7_4,      MSIOF1_SS2_D,           SEL_MSIOF1_3),
+       PINMUX_IPSR_MSEL(IP14_7_4,      AUDIO_CLKC_A,           SEL_ADG_C_0),
+       PINMUX_IPSR_MSEL(IP14_7_4,      SSI_WS2_A,              SEL_SSI2_0),
+       PINMUX_IPSR_MSEL(IP14_7_4,      STP_OPWM_0_D,           SEL_SSP1_0_3),
+       PINMUX_IPSR_GPSR(IP14_7_4,      AUDIO_CLKOUT_D),
+       PINMUX_IPSR_MSEL(IP14_7_4,      SPEEDIN_B,              SEL_SPEED_PULSE_1),
+
+       PINMUX_IPSR_GPSR(IP14_11_8,     MLB_CLK),
+       PINMUX_IPSR_MSEL(IP14_11_8,     MSIOF1_SCK_F,           SEL_MSIOF1_5),
+       PINMUX_IPSR_MSEL(IP14_11_8,     SCL1_B,                 SEL_I2C1_1),
+
+       PINMUX_IPSR_GPSR(IP14_15_12,    MLB_SIG),
+       PINMUX_IPSR_MSEL(IP14_15_12,    RX1_B,                  SEL_SCIF1_1),
+       PINMUX_IPSR_MSEL(IP14_15_12,    MSIOF1_SYNC_F,          SEL_MSIOF1_5),
+       PINMUX_IPSR_MSEL(IP14_15_12,    SDA1_B,                 SEL_I2C1_1),
+
+       PINMUX_IPSR_GPSR(IP14_19_16,    MLB_DAT),
+       PINMUX_IPSR_MSEL(IP14_19_16,    TX1_B,                  SEL_SCIF1_1),
+       PINMUX_IPSR_MSEL(IP14_19_16,    MSIOF1_RXD_F,           SEL_MSIOF1_5),
+
+       PINMUX_IPSR_GPSR(IP14_23_20,    SSI_SCK01239),
+       PINMUX_IPSR_MSEL(IP14_23_20,    MSIOF1_TXD_F,           SEL_MSIOF1_5),
+
+       PINMUX_IPSR_GPSR(IP14_27_24,    SSI_WS01239),
+       PINMUX_IPSR_MSEL(IP14_27_24,    MSIOF1_SS1_F,           SEL_MSIOF1_5),
+
+       PINMUX_IPSR_GPSR(IP14_31_28,    SSI_SDATA0),
+       PINMUX_IPSR_MSEL(IP14_31_28,    MSIOF1_SS2_F,           SEL_MSIOF1_5),
+
+       /* IPSR15 */
+       PINMUX_IPSR_MSEL(IP15_3_0,      SSI_SDATA1_A,           SEL_SSI1_0),
+
+       PINMUX_IPSR_MSEL(IP15_7_4,      SSI_SDATA2_A,           SEL_SSI2_0),
+       PINMUX_IPSR_MSEL(IP15_7_4,      SSI_SCK1_B,             SEL_SSI1_1),
+
+       PINMUX_IPSR_GPSR(IP15_11_8,     SSI_SCK349),
+       PINMUX_IPSR_MSEL(IP15_11_8,     MSIOF1_SS1_A,           SEL_MSIOF1_0),
+       PINMUX_IPSR_MSEL(IP15_11_8,     STP_OPWM_0_A,           SEL_SSP1_0_0),
+
+       PINMUX_IPSR_GPSR(IP15_15_12,    SSI_WS349),
+       PINMUX_IPSR_MSEL(IP15_15_12,    HCTS2_N_A,              SEL_HSCIF2_0),
+       PINMUX_IPSR_MSEL(IP15_15_12,    MSIOF1_SS2_A,           SEL_MSIOF1_0),
+       PINMUX_IPSR_MSEL(IP15_15_12,    STP_IVCXO27_0_A,        SEL_SSP1_0_0),
+
+       PINMUX_IPSR_GPSR(IP15_19_16,    SSI_SDATA3),
+       PINMUX_IPSR_MSEL(IP15_19_16,    HRTS2_N_A,              SEL_HSCIF2_0),
+       PINMUX_IPSR_MSEL(IP15_19_16,    MSIOF1_TXD_A,           SEL_MSIOF1_0),
+       PINMUX_IPSR_MSEL(IP15_19_16,    TS_SCK0_A,              SEL_TSIF0_0),
+       PINMUX_IPSR_MSEL(IP15_19_16,    STP_ISCLK_0_A,          SEL_SSP1_0_0),
+       PINMUX_IPSR_MSEL(IP15_19_16,    RIF0_D1_A,              SEL_DRIF0_0),
+       PINMUX_IPSR_MSEL(IP15_19_16,    RIF2_D0_A,              SEL_DRIF2_0),
+
+       PINMUX_IPSR_GPSR(IP15_23_20,    SSI_SCK4),
+       PINMUX_IPSR_MSEL(IP15_23_20,    HRX2_A,                 SEL_HSCIF2_0),
+       PINMUX_IPSR_MSEL(IP15_23_20,    MSIOF1_SCK_A,           SEL_MSIOF1_0),
+       PINMUX_IPSR_MSEL(IP15_23_20,    TS_SDAT0_A,             SEL_TSIF0_0),
+       PINMUX_IPSR_MSEL(IP15_23_20,    STP_ISD_0_A,            SEL_SSP1_0_0),
+       PINMUX_IPSR_MSEL(IP15_23_20,    RIF0_CLK_A,             SEL_DRIF0_0),
+       PINMUX_IPSR_MSEL(IP15_23_20,    RIF2_CLK_A,             SEL_DRIF2_0),
+
+       PINMUX_IPSR_GPSR(IP15_27_24,    SSI_WS4),
+       PINMUX_IPSR_MSEL(IP15_27_24,    HTX2_A,                 SEL_HSCIF2_0),
+       PINMUX_IPSR_MSEL(IP15_27_24,    MSIOF1_SYNC_A,          SEL_MSIOF1_0),
+       PINMUX_IPSR_MSEL(IP15_27_24,    TS_SDEN0_A,             SEL_TSIF0_0),
+       PINMUX_IPSR_MSEL(IP15_27_24,    STP_ISEN_0_A,           SEL_SSP1_0_0),
+       PINMUX_IPSR_MSEL(IP15_27_24,    RIF0_SYNC_A,            SEL_DRIF0_0),
+       PINMUX_IPSR_MSEL(IP15_27_24,    RIF2_SYNC_A,            SEL_DRIF2_0),
+
+       PINMUX_IPSR_GPSR(IP15_31_28,    SSI_SDATA4),
+       PINMUX_IPSR_MSEL(IP15_31_28,    HSCK2_A,                SEL_HSCIF2_0),
+       PINMUX_IPSR_MSEL(IP15_31_28,    MSIOF1_RXD_A,           SEL_MSIOF1_0),
+       PINMUX_IPSR_MSEL(IP15_31_28,    TS_SPSYNC0_A,           SEL_TSIF0_0),
+       PINMUX_IPSR_MSEL(IP15_31_28,    STP_ISSYNC_0_A,         SEL_SSP1_0_0),
+       PINMUX_IPSR_MSEL(IP15_31_28,    RIF0_D0_A,              SEL_DRIF0_0),
+       PINMUX_IPSR_MSEL(IP15_31_28,    RIF2_D1_A,              SEL_DRIF2_0),
+
+       /* IPSR16 */
+       PINMUX_IPSR_GPSR(IP16_3_0,      SSI_SCK6),
+       PINMUX_IPSR_MSEL(IP16_3_0,      SIM0_RST_D,             SEL_SIMCARD_3),
+
+       PINMUX_IPSR_GPSR(IP16_7_4,      SSI_WS6),
+       PINMUX_IPSR_MSEL(IP16_7_4,      SIM0_D_D,               SEL_SIMCARD_3),
+
+       PINMUX_IPSR_GPSR(IP16_11_8,     SSI_SDATA6),
+       PINMUX_IPSR_MSEL(IP16_11_8,     SIM0_CLK_D,             SEL_SIMCARD_3),
+       PINMUX_IPSR_GPSR(IP16_11_8,     SATA_DEVSLP_A),
+
+       PINMUX_IPSR_GPSR(IP16_15_12,    SSI_SCK78),
+       PINMUX_IPSR_MSEL(IP16_15_12,    HRX2_B,                 SEL_HSCIF2_1),
+       PINMUX_IPSR_MSEL(IP16_15_12,    MSIOF1_SCK_C,           SEL_MSIOF1_2),
+       PINMUX_IPSR_MSEL(IP16_15_12,    TS_SCK1_A,              SEL_TSIF1_0),
+       PINMUX_IPSR_MSEL(IP16_15_12,    STP_ISCLK_1_A,          SEL_SSP1_1_0),
+       PINMUX_IPSR_MSEL(IP16_15_12,    RIF1_CLK_A,             SEL_DRIF1_0),
+       PINMUX_IPSR_MSEL(IP16_15_12,    RIF3_CLK_A,             SEL_DRIF3_0),
+
+       PINMUX_IPSR_GPSR(IP16_19_16,    SSI_WS78),
+       PINMUX_IPSR_MSEL(IP16_19_16,    HTX2_B,                 SEL_HSCIF2_1),
+       PINMUX_IPSR_MSEL(IP16_19_16,    MSIOF1_SYNC_C,          SEL_MSIOF1_2),
+       PINMUX_IPSR_MSEL(IP16_19_16,    TS_SDAT1_A,             SEL_TSIF1_0),
+       PINMUX_IPSR_MSEL(IP16_19_16,    STP_ISD_1_A,            SEL_SSP1_1_0),
+       PINMUX_IPSR_MSEL(IP16_19_16,    RIF1_SYNC_A,            SEL_DRIF1_0),
+       PINMUX_IPSR_MSEL(IP16_19_16,    RIF3_SYNC_A,            SEL_DRIF3_0),
+
+       PINMUX_IPSR_GPSR(IP16_23_20,    SSI_SDATA7),
+       PINMUX_IPSR_MSEL(IP16_23_20,    HCTS2_N_B,              SEL_HSCIF2_1),
+       PINMUX_IPSR_MSEL(IP16_23_20,    MSIOF1_RXD_C,           SEL_MSIOF1_2),
+       PINMUX_IPSR_MSEL(IP16_23_20,    TS_SDEN1_A,             SEL_TSIF1_0),
+       PINMUX_IPSR_MSEL(IP16_23_20,    STP_ISEN_1_A,           SEL_SSP1_1_0),
+       PINMUX_IPSR_MSEL(IP16_23_20,    RIF1_D0_A,              SEL_DRIF1_0),
+       PINMUX_IPSR_MSEL(IP16_23_20,    RIF3_D0_A,              SEL_DRIF3_0),
+       PINMUX_IPSR_MSEL(IP16_23_20,    TCLK2_A,                SEL_TIMER_TMU2_0),
+
+       PINMUX_IPSR_GPSR(IP16_27_24,    SSI_SDATA8),
+       PINMUX_IPSR_MSEL(IP16_27_24,    HRTS2_N_B,              SEL_HSCIF2_1),
+       PINMUX_IPSR_MSEL(IP16_27_24,    MSIOF1_TXD_C,           SEL_MSIOF1_2),
+       PINMUX_IPSR_MSEL(IP16_27_24,    TS_SPSYNC1_A,           SEL_TSIF1_0),
+       PINMUX_IPSR_MSEL(IP16_27_24,    STP_ISSYNC_1_A,         SEL_SSP1_1_0),
+       PINMUX_IPSR_MSEL(IP16_27_24,    RIF1_D1_A,              SEL_DRIF1_0),
+       PINMUX_IPSR_MSEL(IP16_27_24,    RIF3_D1_A,              SEL_DRIF3_0),
+
+       PINMUX_IPSR_MSEL(IP16_31_28,    SSI_SDATA9_A,           SEL_SSI9_0),
+       PINMUX_IPSR_MSEL(IP16_31_28,    HSCK2_B,                SEL_HSCIF2_1),
+       PINMUX_IPSR_MSEL(IP16_31_28,    MSIOF1_SS1_C,           SEL_MSIOF1_2),
+       PINMUX_IPSR_MSEL(IP16_31_28,    HSCK1_A,                SEL_HSCIF1_0),
+       PINMUX_IPSR_MSEL(IP16_31_28,    SSI_WS1_B,              SEL_SSI1_1),
+       PINMUX_IPSR_GPSR(IP16_31_28,    SCK1),
+       PINMUX_IPSR_MSEL(IP16_31_28,    STP_IVCXO27_1_A,        SEL_SSP1_1_0),
+       PINMUX_IPSR_MSEL(IP16_31_28,    SCK5_A,                 SEL_SCIF5_0),
+
+       /* IPSR17 */
+       PINMUX_IPSR_MSEL(IP17_3_0,      AUDIO_CLKA_A,           SEL_ADG_A_0),
+       PINMUX_IPSR_GPSR(IP17_3_0,      CC5_OSCOUT),
+
+       PINMUX_IPSR_MSEL(IP17_7_4,      AUDIO_CLKB_B,           SEL_ADG_B_1),
+       PINMUX_IPSR_MSEL(IP17_7_4,      SCIF_CLK_A,             SEL_SCIF_0),
+       PINMUX_IPSR_MSEL(IP17_7_4,      STP_IVCXO27_1_D,        SEL_SSP1_1_3),
+       PINMUX_IPSR_MSEL(IP17_7_4,      REMOCON_A,              SEL_REMOCON_0),
+       PINMUX_IPSR_MSEL(IP17_7_4,      TCLK1_A,                SEL_TIMER_TMU_0),
+
+       PINMUX_IPSR_GPSR(IP17_11_8,     USB0_PWEN),
+       PINMUX_IPSR_MSEL(IP17_11_8,     SIM0_RST_C,             SEL_SIMCARD_2),
+       PINMUX_IPSR_MSEL(IP17_11_8,     TS_SCK1_D,              SEL_TSIF1_3),
+       PINMUX_IPSR_MSEL(IP17_11_8,     STP_ISCLK_1_D,          SEL_SSP1_1_3),
+       PINMUX_IPSR_MSEL(IP17_11_8,     BPFCLK_B,               SEL_FM_1),
+       PINMUX_IPSR_MSEL(IP17_11_8,     RIF3_CLK_B,             SEL_DRIF3_1),
+       PINMUX_IPSR_MSEL(IP17_11_8,     HSCK2_C,                SEL_HSCIF2_2),
+
+       PINMUX_IPSR_GPSR(IP17_15_12,    USB0_OVC),
+       PINMUX_IPSR_MSEL(IP17_15_12,    SIM0_D_C,               SEL_SIMCARD_2),
+       PINMUX_IPSR_MSEL(IP17_15_12,    TS_SDAT1_D,             SEL_TSIF1_3),
+       PINMUX_IPSR_MSEL(IP17_15_12,    STP_ISD_1_D,            SEL_SSP1_1_3),
+       PINMUX_IPSR_MSEL(IP17_15_12,    RIF3_SYNC_B,            SEL_DRIF3_1),
+       PINMUX_IPSR_MSEL(IP17_15_12,    HRX2_C,                 SEL_HSCIF2_2),
+
+       PINMUX_IPSR_GPSR(IP17_19_16,    USB1_PWEN),
+       PINMUX_IPSR_MSEL(IP17_19_16,    SIM0_CLK_C,             SEL_SIMCARD_2),
+       PINMUX_IPSR_MSEL(IP17_19_16,    SSI_SCK1_A,             SEL_SSI1_0),
+       PINMUX_IPSR_MSEL(IP17_19_16,    TS_SCK0_E,              SEL_TSIF0_4),
+       PINMUX_IPSR_MSEL(IP17_19_16,    STP_ISCLK_0_E,          SEL_SSP1_0_4),
+       PINMUX_IPSR_MSEL(IP17_19_16,    FMCLK_B,                SEL_FM_1),
+       PINMUX_IPSR_MSEL(IP17_19_16,    RIF2_CLK_B,             SEL_DRIF2_1),
+       PINMUX_IPSR_MSEL(IP17_19_16,    SPEEDIN_A,              SEL_SPEED_PULSE_0),
+       PINMUX_IPSR_MSEL(IP17_19_16,    HTX2_C,                 SEL_HSCIF2_2),
+
+       PINMUX_IPSR_GPSR(IP17_23_20,    USB1_OVC),
+       PINMUX_IPSR_MSEL(IP17_23_20,    MSIOF1_SS2_C,           SEL_MSIOF1_2),
+       PINMUX_IPSR_MSEL(IP17_23_20,    SSI_WS1_A,              SEL_SSI1_0),
+       PINMUX_IPSR_MSEL(IP17_23_20,    TS_SDAT0_E,             SEL_TSIF0_4),
+       PINMUX_IPSR_MSEL(IP17_23_20,    STP_ISD_0_E,            SEL_SSP1_0_4),
+       PINMUX_IPSR_MSEL(IP17_23_20,    FMIN_B,                 SEL_FM_1),
+       PINMUX_IPSR_MSEL(IP17_23_20,    RIF2_SYNC_B,            SEL_DRIF2_1),
+       PINMUX_IPSR_MSEL(IP17_23_20,    REMOCON_B,              SEL_REMOCON_1),
+       PINMUX_IPSR_MSEL(IP17_23_20,    HCTS2_N_C,              SEL_HSCIF2_2),
+
+       PINMUX_IPSR_GPSR(IP17_27_24,    USB30_PWEN),
+       PINMUX_IPSR_GPSR(IP17_27_24,    AUDIO_CLKOUT_B),
+       PINMUX_IPSR_MSEL(IP17_27_24,    SSI_SCK2_B,             SEL_SSI2_1),
+       PINMUX_IPSR_MSEL(IP17_27_24,    TS_SDEN1_D,             SEL_TSIF1_3),
+       PINMUX_IPSR_MSEL(IP17_27_24,    STP_ISEN_1_D,           SEL_SSP1_1_3),
+       PINMUX_IPSR_MSEL(IP17_27_24,    STP_OPWM_0_E,           SEL_SSP1_0_4),
+       PINMUX_IPSR_MSEL(IP17_27_24,    RIF3_D0_B,              SEL_DRIF3_1),
+       PINMUX_IPSR_MSEL(IP17_27_24,    TCLK2_B,                SEL_TIMER_TMU2_1),
+       PINMUX_IPSR_GPSR(IP17_27_24,    TPU0TO0),
+       PINMUX_IPSR_MSEL(IP17_27_24,    BPFCLK_C,               SEL_FM_2),
+       PINMUX_IPSR_MSEL(IP17_27_24,    HRTS2_N_C,              SEL_HSCIF2_2),
+
+       PINMUX_IPSR_GPSR(IP17_31_28,    USB30_OVC),
+       PINMUX_IPSR_GPSR(IP17_31_28,    AUDIO_CLKOUT1_B),
+       PINMUX_IPSR_MSEL(IP17_31_28,    SSI_WS2_B,              SEL_SSI2_1),
+       PINMUX_IPSR_MSEL(IP17_31_28,    TS_SPSYNC1_D,           SEL_TSIF1_3),
+       PINMUX_IPSR_MSEL(IP17_31_28,    STP_ISSYNC_1_D,         SEL_SSP1_1_3),
+       PINMUX_IPSR_MSEL(IP17_31_28,    STP_IVCXO27_0_E,        SEL_SSP1_0_4),
+       PINMUX_IPSR_MSEL(IP17_31_28,    RIF3_D1_B,              SEL_DRIF3_1),
+       PINMUX_IPSR_GPSR(IP17_31_28,    FSO_TOE_N),
+       PINMUX_IPSR_GPSR(IP17_31_28,    TPU0TO1),
+
+       /* IPSR18 */
+       PINMUX_IPSR_GPSR(IP18_3_0,      GP6_30),
+       PINMUX_IPSR_GPSR(IP18_3_0,      AUDIO_CLKOUT2_B),
+       PINMUX_IPSR_MSEL(IP18_3_0,      SSI_SCK9_B,             SEL_SSI9_1),
+       PINMUX_IPSR_MSEL(IP18_3_0,      TS_SDEN0_E,             SEL_TSIF0_4),
+       PINMUX_IPSR_MSEL(IP18_3_0,      STP_ISEN_0_E,           SEL_SSP1_0_4),
+       PINMUX_IPSR_MSEL(IP18_3_0,      RIF2_D0_B,              SEL_DRIF2_1),
+       PINMUX_IPSR_GPSR(IP18_3_0,      TPU0TO2),
+       PINMUX_IPSR_MSEL(IP18_3_0,      FMCLK_C,                SEL_FM_2),
+       PINMUX_IPSR_MSEL(IP18_3_0,      FMCLK_D,                SEL_FM_3),
+
+       PINMUX_IPSR_GPSR(IP18_7_4,      GP6_31),
+       PINMUX_IPSR_GPSR(IP18_7_4,      AUDIO_CLKOUT3_B),
+       PINMUX_IPSR_MSEL(IP18_7_4,      SSI_WS9_B,              SEL_SSI9_1),
+       PINMUX_IPSR_MSEL(IP18_7_4,      TS_SPSYNC0_E,           SEL_TSIF0_4),
+       PINMUX_IPSR_MSEL(IP18_7_4,      STP_ISSYNC_0_E,         SEL_SSP1_0_4),
+       PINMUX_IPSR_MSEL(IP18_7_4,      RIF2_D1_B,              SEL_DRIF2_1),
+       PINMUX_IPSR_GPSR(IP18_7_4,      TPU0TO3),
+       PINMUX_IPSR_MSEL(IP18_7_4,      FMIN_C,                 SEL_FM_2),
+       PINMUX_IPSR_MSEL(IP18_7_4,      FMIN_D,                 SEL_FM_3),
+
+       /* I2C */
+       PINMUX_IPSR_NOGP(0,             I2C_SEL_0_1),
+       PINMUX_IPSR_NOGP(0,             I2C_SEL_3_1),
+       PINMUX_IPSR_NOGP(0,             I2C_SEL_5_1),
+
+/*
+ * Static pins can not be muxed between different functions but
+ * still need mark entries in the pinmux list. Add each static
+ * pin to the list without an associated function. The sh-pfc
+ * core will do the right thing and skip trying to mux the pin
+ * while still applying configuration to it.
+ */
+#define FM(x)   PINMUX_DATA(x##_MARK, 0),
+       PINMUX_STATIC
+#undef FM
+};
+
+/*
+ * R8A77965 has 8 banks with 32 GPIOs in each => 256 GPIOs.
+ * Physical layout rows: A - AW, cols: 1 - 39.
+ */
+#define ROW_GROUP_A(r) ('Z' - 'A' + 1 + (r))
+#define PIN_NUMBER(r, c) (((r) - 'A') * 39 + (c) + 300)
+#define PIN_A_NUMBER(r, c) PIN_NUMBER(ROW_GROUP_A(r), c)
+#define PIN_NONE U16_MAX
+
+static const struct sh_pfc_pin pinmux_pins[] = {
+       PINMUX_GPIO_GP_ALL(),
+
+       /*
+        * Pins not associated with a GPIO port.
+        *
+        * The pin positions are different between different r8a77965
+        * packages, all that is needed for the pfc driver is a unique
+        * number for each pin. To this end use the pin layout from
+        * R-Car M3SiP to calculate a unique number for each pin.
+        */
+       SH_PFC_PIN_NAMED_CFG('A',  8, AVB_TX_CTL, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('A',  9, AVB_MDIO, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('A', 12, AVB_TXCREFCLK, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('A', 13, AVB_RD0, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('A', 14, AVB_RD2, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('A', 16, AVB_RX_CTL, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('A', 17, AVB_TD2, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('A', 18, AVB_TD0, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('A', 19, AVB_TXC, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('B', 13, AVB_RD1, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('B', 14, AVB_RD3, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('B', 17, AVB_TD3, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('B', 18, AVB_TD1, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('B', 19, AVB_RXC, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('C',  1, PRESETOUT#, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('H', 37, MLB_REF, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('V',  3, QSPI1_SPCLK, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('V',  5, QSPI1_SSL, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('V',  6, RPC_WP#, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('V',  7, RPC_RESET#, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('W',  3, QSPI0_SPCLK, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('Y',  3, QSPI0_SSL, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('Y',  6, QSPI0_IO2, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG('Y',  7, RPC_INT#, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('B'),  4, QSPI0_MISO_IO1, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('B'),  6, QSPI0_IO3, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'),  3, QSPI1_IO3, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'),  5, QSPI0_MOSI_IO0, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('C'),  7, QSPI1_MOSI_IO0, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 38, FSCLKST, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 39, EXTALR, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('E'),  4, QSPI1_IO2, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('E'),  5, QSPI1_MISO_IO1, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('P'),  7, DU_DOTCLKIN0, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('P'),  8, DU_DOTCLKIN1, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'),  8, DU_DOTCLKIN3, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 26, TRST#, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 29, TDI, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('R'), 30, TMS, CFG_FLAGS),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 27, TCK, SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 28, TDO, SH_PFC_PIN_CFG_DRIVE_STRENGTH),
+       SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('T'), 30, ASEBRK, CFG_FLAGS),
+};
+
+/* - AUDIO CLOCK ------------------------------------------------------------ */
+static const unsigned int audio_clk_a_a_pins[] = {
+       /* CLK A */
+       RCAR_GP_PIN(6, 22),
+};
+static const unsigned int audio_clk_a_a_mux[] = {
+       AUDIO_CLKA_A_MARK,
+};
+static const unsigned int audio_clk_a_b_pins[] = {
+       /* CLK A */
+       RCAR_GP_PIN(5, 4),
+};
+static const unsigned int audio_clk_a_b_mux[] = {
+       AUDIO_CLKA_B_MARK,
+};
+static const unsigned int audio_clk_a_c_pins[] = {
+       /* CLK A */
+       RCAR_GP_PIN(5, 19),
+};
+static const unsigned int audio_clk_a_c_mux[] = {
+       AUDIO_CLKA_C_MARK,
+};
+static const unsigned int audio_clk_b_a_pins[] = {
+       /* CLK B */
+       RCAR_GP_PIN(5, 12),
+};
+static const unsigned int audio_clk_b_a_mux[] = {
+       AUDIO_CLKB_A_MARK,
+};
+static const unsigned int audio_clk_b_b_pins[] = {
+       /* CLK B */
+       RCAR_GP_PIN(6, 23),
+};
+static const unsigned int audio_clk_b_b_mux[] = {
+       AUDIO_CLKB_B_MARK,
+};
+static const unsigned int audio_clk_c_a_pins[] = {
+       /* CLK C */
+       RCAR_GP_PIN(5, 21),
+};
+static const unsigned int audio_clk_c_a_mux[] = {
+       AUDIO_CLKC_A_MARK,
+};
+static const unsigned int audio_clk_c_b_pins[] = {
+       /* CLK C */
+       RCAR_GP_PIN(5, 0),
+};
+static const unsigned int audio_clk_c_b_mux[] = {
+       AUDIO_CLKC_B_MARK,
+};
+static const unsigned int audio_clkout_a_pins[] = {
+       /* CLKOUT */
+       RCAR_GP_PIN(5, 18),
+};
+static const unsigned int audio_clkout_a_mux[] = {
+       AUDIO_CLKOUT_A_MARK,
+};
+static const unsigned int audio_clkout_b_pins[] = {
+       /* CLKOUT */
+       RCAR_GP_PIN(6, 28),
+};
+static const unsigned int audio_clkout_b_mux[] = {
+       AUDIO_CLKOUT_B_MARK,
+};
+static const unsigned int audio_clkout_c_pins[] = {
+       /* CLKOUT */
+       RCAR_GP_PIN(5, 3),
+};
+static const unsigned int audio_clkout_c_mux[] = {
+       AUDIO_CLKOUT_C_MARK,
+};
+static const unsigned int audio_clkout_d_pins[] = {
+       /* CLKOUT */
+       RCAR_GP_PIN(5, 21),
+};
+static const unsigned int audio_clkout_d_mux[] = {
+       AUDIO_CLKOUT_D_MARK,
+};
+static const unsigned int audio_clkout1_a_pins[] = {
+       /* CLKOUT1 */
+       RCAR_GP_PIN(5, 15),
+};
+static const unsigned int audio_clkout1_a_mux[] = {
+       AUDIO_CLKOUT1_A_MARK,
+};
+static const unsigned int audio_clkout1_b_pins[] = {
+       /* CLKOUT1 */
+       RCAR_GP_PIN(6, 29),
+};
+static const unsigned int audio_clkout1_b_mux[] = {
+       AUDIO_CLKOUT1_B_MARK,
+};
+static const unsigned int audio_clkout2_a_pins[] = {
+       /* CLKOUT2 */
+       RCAR_GP_PIN(5, 16),
+};
+static const unsigned int audio_clkout2_a_mux[] = {
+       AUDIO_CLKOUT2_A_MARK,
+};
+static const unsigned int audio_clkout2_b_pins[] = {
+       /* CLKOUT2 */
+       RCAR_GP_PIN(6, 30),
+};
+static const unsigned int audio_clkout2_b_mux[] = {
+       AUDIO_CLKOUT2_B_MARK,
+};
+
+static const unsigned int audio_clkout3_a_pins[] = {
+       /* CLKOUT3 */
+       RCAR_GP_PIN(5, 19),
+};
+static const unsigned int audio_clkout3_a_mux[] = {
+       AUDIO_CLKOUT3_A_MARK,
+};
+static const unsigned int audio_clkout3_b_pins[] = {
+       /* CLKOUT3 */
+       RCAR_GP_PIN(6, 31),
+};
+static const unsigned int audio_clkout3_b_mux[] = {
+       AUDIO_CLKOUT3_B_MARK,
+};
+
+/* - EtherAVB --------------------------------------------------------------- */
+static const unsigned int avb_link_pins[] = {
+       /* AVB_LINK */
+       RCAR_GP_PIN(2, 12),
+};
+static const unsigned int avb_link_mux[] = {
+       AVB_LINK_MARK,
+};
+static const unsigned int avb_magic_pins[] = {
+       /* AVB_MAGIC_ */
+       RCAR_GP_PIN(2, 10),
+};
+static const unsigned int avb_magic_mux[] = {
+       AVB_MAGIC_MARK,
+};
+static const unsigned int avb_phy_int_pins[] = {
+       /* AVB_PHY_INT */
+       RCAR_GP_PIN(2, 11),
+};
+static const unsigned int avb_phy_int_mux[] = {
+       AVB_PHY_INT_MARK,
+};
+static const unsigned int avb_mdio_pins[] = {
+       /* AVB_MDC, AVB_MDIO */
+       RCAR_GP_PIN(2, 9), PIN_NUMBER('A', 9),
+};
+static const unsigned int avb_mdio_mux[] = {
+       AVB_MDC_MARK, AVB_MDIO_MARK,
+};
+static const unsigned int avb_mii_pins[] = {
+       /*
+        * AVB_TX_CTL, AVB_TXC, AVB_TD0,
+        * AVB_TD1, AVB_TD2, AVB_TD3,
+        * AVB_RX_CTL, AVB_RXC, AVB_RD0,
+        * AVB_RD1, AVB_RD2, AVB_RD3,
+        * AVB_TXCREFCLK
+        */
+       PIN_NUMBER('A', 8), PIN_NUMBER('A', 19), PIN_NUMBER('A', 18),
+       PIN_NUMBER('B', 18), PIN_NUMBER('A', 17), PIN_NUMBER('B', 17),
+       PIN_NUMBER('A', 16), PIN_NUMBER('B', 19), PIN_NUMBER('A', 13),
+       PIN_NUMBER('B', 13), PIN_NUMBER('A', 14), PIN_NUMBER('B', 14),
+       PIN_NUMBER('A', 12),
+
+};
+static const unsigned int avb_mii_mux[] = {
+       AVB_TX_CTL_MARK, AVB_TXC_MARK, AVB_TD0_MARK,
+       AVB_TD1_MARK, AVB_TD2_MARK, AVB_TD3_MARK,
+       AVB_RX_CTL_MARK, AVB_RXC_MARK, AVB_RD0_MARK,
+       AVB_RD1_MARK, AVB_RD2_MARK, AVB_RD3_MARK,
+       AVB_TXCREFCLK_MARK,
+};
+static const unsigned int avb_avtp_pps_pins[] = {
+       /* AVB_AVTP_PPS */
+       RCAR_GP_PIN(2, 6),
+};
+static const unsigned int avb_avtp_pps_mux[] = {
+       AVB_AVTP_PPS_MARK,
+};
+static const unsigned int avb_avtp_match_a_pins[] = {
+       /* AVB_AVTP_MATCH_A */
+       RCAR_GP_PIN(2, 13),
+};
+static const unsigned int avb_avtp_match_a_mux[] = {
+       AVB_AVTP_MATCH_A_MARK,
+};
+static const unsigned int avb_avtp_capture_a_pins[] = {
+       /* AVB_AVTP_CAPTURE_A */
+       RCAR_GP_PIN(2, 14),
+};
+static const unsigned int avb_avtp_capture_a_mux[] = {
+       AVB_AVTP_CAPTURE_A_MARK,
+};
+static const unsigned int avb_avtp_match_b_pins[] = {
+       /*  AVB_AVTP_MATCH_B */
+       RCAR_GP_PIN(1, 8),
+};
+static const unsigned int avb_avtp_match_b_mux[] = {
+       AVB_AVTP_MATCH_B_MARK,
+};
+static const unsigned int avb_avtp_capture_b_pins[] = {
+       /* AVB_AVTP_CAPTURE_B */
+       RCAR_GP_PIN(1, 11),
+};
+static const unsigned int avb_avtp_capture_b_mux[] = {
+       AVB_AVTP_CAPTURE_B_MARK,
+};
+
+/* - CAN ------------------------------------------------------------------ */
+static const unsigned int can0_data_a_pins[] = {
+       /* TX, RX */
+       RCAR_GP_PIN(1, 23),     RCAR_GP_PIN(1, 24),
+};
+
+static const unsigned int can0_data_a_mux[] = {
+       CAN0_TX_A_MARK,         CAN0_RX_A_MARK,
+};
+
+static const unsigned int can0_data_b_pins[] = {
+       /* TX, RX */
+       RCAR_GP_PIN(2, 0),      RCAR_GP_PIN(2, 1),
+};
+
+static const unsigned int can0_data_b_mux[] = {
+       CAN0_TX_B_MARK,         CAN0_RX_B_MARK,
+};
+
+static const unsigned int can1_data_pins[] = {
+       /* TX, RX */
+       RCAR_GP_PIN(1, 22),     RCAR_GP_PIN(1, 26),
+};
+
+static const unsigned int can1_data_mux[] = {
+       CAN1_TX_MARK,           CAN1_RX_MARK,
+};
+
+/* - CAN Clock -------------------------------------------------------------- */
+static const unsigned int can_clk_pins[] = {
+       /* CLK */
+       RCAR_GP_PIN(1, 25),
+};
+
+static const unsigned int can_clk_mux[] = {
+       CAN_CLK_MARK,
+};
+
+/* - CAN FD --------------------------------------------------------------- */
+static const unsigned int canfd0_data_a_pins[] = {
+       /* TX, RX */
+       RCAR_GP_PIN(1, 23),     RCAR_GP_PIN(1, 24),
+};
+
+static const unsigned int canfd0_data_a_mux[] = {
+       CANFD0_TX_A_MARK,       CANFD0_RX_A_MARK,
+};
+
+static const unsigned int canfd0_data_b_pins[] = {
+       /* TX, RX */
+       RCAR_GP_PIN(2, 0),      RCAR_GP_PIN(2, 1),
+};
+
+static const unsigned int canfd0_data_b_mux[] = {
+       CANFD0_TX_B_MARK,       CANFD0_RX_B_MARK,
+};
+
+static const unsigned int canfd1_data_pins[] = {
+       /* TX, RX */
+       RCAR_GP_PIN(1, 22),     RCAR_GP_PIN(1, 26),
+};
+
+static const unsigned int canfd1_data_mux[] = {
+       CANFD1_TX_MARK,         CANFD1_RX_MARK,
+};
+
+/* - DRIF0 --------------------------------------------------------------- */
+static const unsigned int drif0_ctrl_a_pins[] = {
+       /* CLK, SYNC */
+       RCAR_GP_PIN(6, 8), RCAR_GP_PIN(6, 9),
+};
+
+static const unsigned int drif0_ctrl_a_mux[] = {
+       RIF0_CLK_A_MARK, RIF0_SYNC_A_MARK,
+};
+
+static const unsigned int drif0_data0_a_pins[] = {
+       /* D0 */
+       RCAR_GP_PIN(6, 10),
+};
+
+static const unsigned int drif0_data0_a_mux[] = {
+       RIF0_D0_A_MARK,
+};
+
+static const unsigned int drif0_data1_a_pins[] = {
+       /* D1 */
+       RCAR_GP_PIN(6, 7),
+};
+
+static const unsigned int drif0_data1_a_mux[] = {
+       RIF0_D1_A_MARK,
+};
+
+static const unsigned int drif0_ctrl_b_pins[] = {
+       /* CLK, SYNC */
+       RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 4),
+};
+
+static const unsigned int drif0_ctrl_b_mux[] = {
+       RIF0_CLK_B_MARK, RIF0_SYNC_B_MARK,
+};
+
+static const unsigned int drif0_data0_b_pins[] = {
+       /* D0 */
+       RCAR_GP_PIN(5, 1),
+};
+
+static const unsigned int drif0_data0_b_mux[] = {
+       RIF0_D0_B_MARK,
+};
+
+static const unsigned int drif0_data1_b_pins[] = {
+       /* D1 */
+       RCAR_GP_PIN(5, 2),
+};
+
+static const unsigned int drif0_data1_b_mux[] = {
+       RIF0_D1_B_MARK,
+};
+
+static const unsigned int drif0_ctrl_c_pins[] = {
+       /* CLK, SYNC */
+       RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 15),
+};
+
+static const unsigned int drif0_ctrl_c_mux[] = {
+       RIF0_CLK_C_MARK, RIF0_SYNC_C_MARK,
+};
+
+static const unsigned int drif0_data0_c_pins[] = {
+       /* D0 */
+       RCAR_GP_PIN(5, 13),
+};
+
+static const unsigned int drif0_data0_c_mux[] = {
+       RIF0_D0_C_MARK,
+};
+
+static const unsigned int drif0_data1_c_pins[] = {
+       /* D1 */
+       RCAR_GP_PIN(5, 14),
+};
+
+static const unsigned int drif0_data1_c_mux[] = {
+       RIF0_D1_C_MARK,
+};
+
+/* - DRIF1 --------------------------------------------------------------- */
+static const unsigned int drif1_ctrl_a_pins[] = {
+       /* CLK, SYNC */
+       RCAR_GP_PIN(6, 17), RCAR_GP_PIN(6, 18),
+};
+
+static const unsigned int drif1_ctrl_a_mux[] = {
+       RIF1_CLK_A_MARK, RIF1_SYNC_A_MARK,
+};
+
+static const unsigned int drif1_data0_a_pins[] = {
+       /* D0 */
+       RCAR_GP_PIN(6, 19),
+};
+
+static const unsigned int drif1_data0_a_mux[] = {
+       RIF1_D0_A_MARK,
+};
+
+static const unsigned int drif1_data1_a_pins[] = {
+       /* D1 */
+       RCAR_GP_PIN(6, 20),
+};
+
+static const unsigned int drif1_data1_a_mux[] = {
+       RIF1_D1_A_MARK,
+};
+
+static const unsigned int drif1_ctrl_b_pins[] = {
+       /* CLK, SYNC */
+       RCAR_GP_PIN(5, 9), RCAR_GP_PIN(5, 3),
+};
+
+static const unsigned int drif1_ctrl_b_mux[] = {
+       RIF1_CLK_B_MARK, RIF1_SYNC_B_MARK,
+};
+
+static const unsigned int drif1_data0_b_pins[] = {
+       /* D0 */
+       RCAR_GP_PIN(5, 7),
+};
+
+static const unsigned int drif1_data0_b_mux[] = {
+       RIF1_D0_B_MARK,
+};
+
+static const unsigned int drif1_data1_b_pins[] = {
+       /* D1 */
+       RCAR_GP_PIN(5, 8),
+};
+
+static const unsigned int drif1_data1_b_mux[] = {
+       RIF1_D1_B_MARK,
+};
+
+static const unsigned int drif1_ctrl_c_pins[] = {
+       /* CLK, SYNC */
+       RCAR_GP_PIN(5, 5), RCAR_GP_PIN(5, 11),
+};
+
+static const unsigned int drif1_ctrl_c_mux[] = {
+       RIF1_CLK_C_MARK, RIF1_SYNC_C_MARK,
+};
+
+static const unsigned int drif1_data0_c_pins[] = {
+       /* D0 */
+       RCAR_GP_PIN(5, 6),
+};
+
+static const unsigned int drif1_data0_c_mux[] = {
+       RIF1_D0_C_MARK,
+};
+
+static const unsigned int drif1_data1_c_pins[] = {
+       /* D1 */
+       RCAR_GP_PIN(5, 10),
+};
+
+static const unsigned int drif1_data1_c_mux[] = {
+       RIF1_D1_C_MARK,
+};
+
+/* - DRIF2 --------------------------------------------------------------- */
+static const unsigned int drif2_ctrl_a_pins[] = {
+       /* CLK, SYNC */
+       RCAR_GP_PIN(6, 8), RCAR_GP_PIN(6, 9),
+};
+
+static const unsigned int drif2_ctrl_a_mux[] = {
+       RIF2_CLK_A_MARK, RIF2_SYNC_A_MARK,
+};
+
+static const unsigned int drif2_data0_a_pins[] = {
+       /* D0 */
+       RCAR_GP_PIN(6, 7),
+};
+
+static const unsigned int drif2_data0_a_mux[] = {
+       RIF2_D0_A_MARK,
+};
+
+static const unsigned int drif2_data1_a_pins[] = {
+       /* D1 */
+       RCAR_GP_PIN(6, 10),
+};
+
+static const unsigned int drif2_data1_a_mux[] = {
+       RIF2_D1_A_MARK,
+};
+
+static const unsigned int drif2_ctrl_b_pins[] = {
+       /* CLK, SYNC */
+       RCAR_GP_PIN(6, 26), RCAR_GP_PIN(6, 27),
+};
+
+static const unsigned int drif2_ctrl_b_mux[] = {
+       RIF2_CLK_B_MARK, RIF2_SYNC_B_MARK,
+};
+
+static const unsigned int drif2_data0_b_pins[] = {
+       /* D0 */
+       RCAR_GP_PIN(6, 30),
+};
+
+static const unsigned int drif2_data0_b_mux[] = {
+       RIF2_D0_B_MARK,
+};
+
+static const unsigned int drif2_data1_b_pins[] = {
+       /* D1 */
+       RCAR_GP_PIN(6, 31),
+};
+
+static const unsigned int drif2_data1_b_mux[] = {
+       RIF2_D1_B_MARK,
+};
+
+/* - DRIF3 --------------------------------------------------------------- */
+static const unsigned int drif3_ctrl_a_pins[] = {
+       /* CLK, SYNC */
+       RCAR_GP_PIN(6, 17), RCAR_GP_PIN(6, 18),
+};
+
+static const unsigned int drif3_ctrl_a_mux[] = {
+       RIF3_CLK_A_MARK, RIF3_SYNC_A_MARK,
+};
+
+static const unsigned int drif3_data0_a_pins[] = {
+       /* D0 */
+       RCAR_GP_PIN(6, 19),
+};
+
+static const unsigned int drif3_data0_a_mux[] = {
+       RIF3_D0_A_MARK,
+};
+
+static const unsigned int drif3_data1_a_pins[] = {
+       /* D1 */
+       RCAR_GP_PIN(6, 20),
+};
+
+static const unsigned int drif3_data1_a_mux[] = {
+       RIF3_D1_A_MARK,
+};
+
+static const unsigned int drif3_ctrl_b_pins[] = {
+       /* CLK, SYNC */
+       RCAR_GP_PIN(6, 24), RCAR_GP_PIN(6, 25),
+};
+
+static const unsigned int drif3_ctrl_b_mux[] = {
+       RIF3_CLK_B_MARK, RIF3_SYNC_B_MARK,
+};
+
+static const unsigned int drif3_data0_b_pins[] = {
+       /* D0 */
+       RCAR_GP_PIN(6, 28),
+};
+
+static const unsigned int drif3_data0_b_mux[] = {
+       RIF3_D0_B_MARK,
+};
+
+static const unsigned int drif3_data1_b_pins[] = {
+       /* D1 */
+       RCAR_GP_PIN(6, 29),
+};
+
+static const unsigned int drif3_data1_b_mux[] = {
+       RIF3_D1_B_MARK,
+};
+
+/* - DU --------------------------------------------------------------------- */
+static const unsigned int du_rgb666_pins[] = {
+       /* R[7:2], G[7:2], B[7:2] */
+       RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 13),
+       RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 11), RCAR_GP_PIN(0, 10),
+       RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 13),
+       RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 18),
+       RCAR_GP_PIN(1, 7),  RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 5),
+       RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 2),
+};
+
+static const unsigned int du_rgb666_mux[] = {
+       DU_DR7_MARK, DU_DR6_MARK, DU_DR5_MARK, DU_DR4_MARK,
+       DU_DR3_MARK, DU_DR2_MARK,
+       DU_DG7_MARK, DU_DG6_MARK, DU_DG5_MARK, DU_DG4_MARK,
+       DU_DG3_MARK, DU_DG2_MARK,
+       DU_DB7_MARK, DU_DB6_MARK, DU_DB5_MARK, DU_DB4_MARK,
+       DU_DB3_MARK, DU_DB2_MARK,
+};
+
+static const unsigned int du_rgb888_pins[] = {
+       /* R[7:0], G[7:0], B[7:0] */
+       RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 13),
+       RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 11), RCAR_GP_PIN(0, 10),
+       RCAR_GP_PIN(0, 9),  RCAR_GP_PIN(0, 8),
+       RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 13),
+       RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 18),
+       RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 16),
+       RCAR_GP_PIN(1, 7),  RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 5),
+       RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 2),
+       RCAR_GP_PIN(1, 1),  RCAR_GP_PIN(1, 0),
+};
+
+static const unsigned int du_rgb888_mux[] = {
+       DU_DR7_MARK, DU_DR6_MARK, DU_DR5_MARK, DU_DR4_MARK,
+       DU_DR3_MARK, DU_DR2_MARK, DU_DR1_MARK, DU_DR0_MARK,
+       DU_DG7_MARK, DU_DG6_MARK, DU_DG5_MARK, DU_DG4_MARK,
+       DU_DG3_MARK, DU_DG2_MARK, DU_DG1_MARK, DU_DG0_MARK,
+       DU_DB7_MARK, DU_DB6_MARK, DU_DB5_MARK, DU_DB4_MARK,
+       DU_DB3_MARK, DU_DB2_MARK, DU_DB1_MARK, DU_DB0_MARK,
+};
+
+static const unsigned int du_clk_out_0_pins[] = {
+       /* CLKOUT */
+       RCAR_GP_PIN(1, 27),
+};
+
+static const unsigned int du_clk_out_0_mux[] = {
+       DU_DOTCLKOUT0_MARK
+};
+
+static const unsigned int du_clk_out_1_pins[] = {
+       /* CLKOUT */
+       RCAR_GP_PIN(2, 3),
+};
+
+static const unsigned int du_clk_out_1_mux[] = {
+       DU_DOTCLKOUT1_MARK
+};
+
+static const unsigned int du_sync_pins[] = {
+       /* EXVSYNC/VSYNC, EXHSYNC/HSYNC */
+       RCAR_GP_PIN(2, 5), RCAR_GP_PIN(2, 4),
+};
+
+static const unsigned int du_sync_mux[] = {
+       DU_EXVSYNC_DU_VSYNC_MARK, DU_EXHSYNC_DU_HSYNC_MARK
+};
+
+static const unsigned int du_oddf_pins[] = {
+       /* EXDISP/EXODDF/EXCDE */
+       RCAR_GP_PIN(2, 2),
+};
+
+static const unsigned int du_oddf_mux[] = {
+       DU_EXODDF_DU_ODDF_DISP_CDE_MARK,
+};
+
+static const unsigned int du_cde_pins[] = {
+       /* CDE */
+       RCAR_GP_PIN(2, 0),
+};
+
+static const unsigned int du_cde_mux[] = {
+       DU_CDE_MARK,
+};
+
+static const unsigned int du_disp_pins[] = {
+       /* DISP */
+       RCAR_GP_PIN(2, 1),
+};
+
+static const unsigned int du_disp_mux[] = {
+       DU_DISP_MARK,
+};
+
+/* - HSCIF0 ----------------------------------------------------------------- */
+static const unsigned int hscif0_data_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(5, 13), RCAR_GP_PIN(5, 14),
+};
+
+static const unsigned int hscif0_data_mux[] = {
+       HRX0_MARK, HTX0_MARK,
+};
+
+static const unsigned int hscif0_clk_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(5, 12),
+};
+
+static const unsigned int hscif0_clk_mux[] = {
+       HSCK0_MARK,
+};
+
+static const unsigned int hscif0_ctrl_pins[] = {
+       /* RTS, CTS */
+       RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 15),
+};
+
+static const unsigned int hscif0_ctrl_mux[] = {
+       HRTS0_N_MARK, HCTS0_N_MARK,
+};
+
+/* - HSCIF1 ----------------------------------------------------------------- */
+static const unsigned int hscif1_data_a_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(5, 5), RCAR_GP_PIN(5, 6),
+};
+
+static const unsigned int hscif1_data_a_mux[] = {
+       HRX1_A_MARK, HTX1_A_MARK,
+};
+
+static const unsigned int hscif1_clk_a_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(6, 21),
+};
+
+static const unsigned int hscif1_clk_a_mux[] = {
+       HSCK1_A_MARK,
+};
+
+static const unsigned int hscif1_ctrl_a_pins[] = {
+       /* RTS, CTS */
+       RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 7),
+};
+
+static const unsigned int hscif1_ctrl_a_mux[] = {
+       HRTS1_N_A_MARK, HCTS1_N_A_MARK,
+};
+
+static const unsigned int hscif1_data_b_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
+};
+
+static const unsigned int hscif1_data_b_mux[] = {
+       HRX1_B_MARK, HTX1_B_MARK,
+};
+
+static const unsigned int hscif1_clk_b_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(5, 0),
+};
+
+static const unsigned int hscif1_clk_b_mux[] = {
+       HSCK1_B_MARK,
+};
+
+static const unsigned int hscif1_ctrl_b_pins[] = {
+       /* RTS, CTS */
+       RCAR_GP_PIN(5, 4), RCAR_GP_PIN(5, 3),
+};
+
+static const unsigned int hscif1_ctrl_b_mux[] = {
+       HRTS1_N_B_MARK, HCTS1_N_B_MARK,
+};
+
+/* - HSCIF2 ----------------------------------------------------------------- */
+static const unsigned int hscif2_data_a_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(6, 8), RCAR_GP_PIN(6, 9),
+};
+
+static const unsigned int hscif2_data_a_mux[] = {
+       HRX2_A_MARK, HTX2_A_MARK,
+};
+
+static const unsigned int hscif2_clk_a_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(6, 10),
+};
+
+static const unsigned int hscif2_clk_a_mux[] = {
+       HSCK2_A_MARK,
+};
+
+static const unsigned int hscif2_ctrl_a_pins[] = {
+       /* RTS, CTS */
+       RCAR_GP_PIN(6, 7), RCAR_GP_PIN(6, 6),
+};
+
+static const unsigned int hscif2_ctrl_a_mux[] = {
+       HRTS2_N_A_MARK, HCTS2_N_A_MARK,
+};
+
+static const unsigned int hscif2_data_b_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(6, 17), RCAR_GP_PIN(6, 18),
+};
+
+static const unsigned int hscif2_data_b_mux[] = {
+       HRX2_B_MARK, HTX2_B_MARK,
+};
+
+static const unsigned int hscif2_clk_b_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(6, 21),
+};
+
+static const unsigned int hscif2_clk_b_mux[] = {
+       HSCK2_B_MARK,
+};
+
+static const unsigned int hscif2_ctrl_b_pins[] = {
+       /* RTS, CTS */
+       RCAR_GP_PIN(6, 20), RCAR_GP_PIN(6, 19),
+};
+
+static const unsigned int hscif2_ctrl_b_mux[] = {
+       HRTS2_N_B_MARK, HCTS2_N_B_MARK,
+};
+
+static const unsigned int hscif2_data_c_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(6, 25), RCAR_GP_PIN(6, 26),
+};
+
+static const unsigned int hscif2_data_c_mux[] = {
+       HRX2_C_MARK, HTX2_C_MARK,
+};
+
+static const unsigned int hscif2_clk_c_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(6, 24),
+};
+
+static const unsigned int hscif2_clk_c_mux[] = {
+       HSCK2_C_MARK,
+};
+
+static const unsigned int hscif2_ctrl_c_pins[] = {
+       /* RTS, CTS */
+       RCAR_GP_PIN(6, 28), RCAR_GP_PIN(6, 27),
+};
+
+static const unsigned int hscif2_ctrl_c_mux[] = {
+       HRTS2_N_C_MARK, HCTS2_N_C_MARK,
+};
+
+/* - HSCIF3 ----------------------------------------------------------------- */
+static const unsigned int hscif3_data_a_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(1, 23), RCAR_GP_PIN(1, 24),
+};
+
+static const unsigned int hscif3_data_a_mux[] = {
+       HRX3_A_MARK, HTX3_A_MARK,
+};
+
+static const unsigned int hscif3_clk_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(1, 22),
+};
+
+static const unsigned int hscif3_clk_mux[] = {
+       HSCK3_MARK,
+};
+
+static const unsigned int hscif3_ctrl_pins[] = {
+       /* RTS, CTS */
+       RCAR_GP_PIN(1, 26), RCAR_GP_PIN(1, 25),
+};
+
+static const unsigned int hscif3_ctrl_mux[] = {
+       HRTS3_N_MARK, HCTS3_N_MARK,
+};
+
+static const unsigned int hscif3_data_b_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(0, 10), RCAR_GP_PIN(0, 11),
+};
+
+static const unsigned int hscif3_data_b_mux[] = {
+       HRX3_B_MARK, HTX3_B_MARK,
+};
+
+static const unsigned int hscif3_data_c_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 15),
+};
+
+static const unsigned int hscif3_data_c_mux[] = {
+       HRX3_C_MARK, HTX3_C_MARK,
+};
+
+static const unsigned int hscif3_data_d_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(2, 7), RCAR_GP_PIN(2, 8),
+};
+
+static const unsigned int hscif3_data_d_mux[] = {
+       HRX3_D_MARK, HTX3_D_MARK,
+};
+
+/* - HSCIF4 ----------------------------------------------------------------- */
+static const unsigned int hscif4_data_a_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
+};
+
+static const unsigned int hscif4_data_a_mux[] = {
+       HRX4_A_MARK, HTX4_A_MARK,
+};
+
+static const unsigned int hscif4_clk_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(1, 11),
+};
+
+static const unsigned int hscif4_clk_mux[] = {
+       HSCK4_MARK,
+};
+
+static const unsigned int hscif4_ctrl_pins[] = {
+       /* RTS, CTS */
+       RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 14),
+};
+
+static const unsigned int hscif4_ctrl_mux[] = {
+       HRTS4_N_MARK, HCTS4_N_MARK,
+};
+
+static const unsigned int hscif4_data_b_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 11),
+};
+
+static const unsigned int hscif4_data_b_mux[] = {
+       HRX4_B_MARK, HTX4_B_MARK,
+};
+
+/* - I2C -------------------------------------------------------------------- */
+static const unsigned int i2c1_a_pins[] = {
+       /* SDA, SCL */
+       RCAR_GP_PIN(5, 11), RCAR_GP_PIN(5, 10),
+};
+static const unsigned int i2c1_a_mux[] = {
+       SDA1_A_MARK, SCL1_A_MARK,
+};
+static const unsigned int i2c1_b_pins[] = {
+       /* SDA, SCL */
+       RCAR_GP_PIN(5, 24), RCAR_GP_PIN(5, 23),
+};
+static const unsigned int i2c1_b_mux[] = {
+       SDA1_B_MARK, SCL1_B_MARK,
+};
+static const unsigned int i2c2_a_pins[] = {
+       /* SDA, SCL */
+       RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 4),
+};
+static const unsigned int i2c2_a_mux[] = {
+       SDA2_A_MARK, SCL2_A_MARK,
+};
+static const unsigned int i2c2_b_pins[] = {
+       /* SDA, SCL */
+       RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 12),
+};
+static const unsigned int i2c2_b_mux[] = {
+       SDA2_B_MARK, SCL2_B_MARK,
+};
+static const unsigned int i2c6_a_pins[] = {
+       /* SDA, SCL */
+       RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 11),
+};
+static const unsigned int i2c6_a_mux[] = {
+       SDA6_A_MARK, SCL6_A_MARK,
+};
+static const unsigned int i2c6_b_pins[] = {
+       /* SDA, SCL */
+       RCAR_GP_PIN(1, 26), RCAR_GP_PIN(1, 25),
+};
+static const unsigned int i2c6_b_mux[] = {
+       SDA6_B_MARK, SCL6_B_MARK,
+};
+static const unsigned int i2c6_c_pins[] = {
+       /* SDA, SCL */
+       RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 14),
+};
+static const unsigned int i2c6_c_mux[] = {
+       SDA6_C_MARK, SCL6_C_MARK,
+};
+
+/* - INTC-EX ---------------------------------------------------------------- */
+static const unsigned int intc_ex_irq0_pins[] = {
+       /* IRQ0 */
+       RCAR_GP_PIN(2, 0),
+};
+static const unsigned int intc_ex_irq0_mux[] = {
+       IRQ0_MARK,
+};
+static const unsigned int intc_ex_irq1_pins[] = {
+       /* IRQ1 */
+       RCAR_GP_PIN(2, 1),
+};
+static const unsigned int intc_ex_irq1_mux[] = {
+       IRQ1_MARK,
+};
+static const unsigned int intc_ex_irq2_pins[] = {
+       /* IRQ2 */
+       RCAR_GP_PIN(2, 2),
+};
+static const unsigned int intc_ex_irq2_mux[] = {
+       IRQ2_MARK,
+};
+static const unsigned int intc_ex_irq3_pins[] = {
+       /* IRQ3 */
+       RCAR_GP_PIN(2, 3),
+};
+static const unsigned int intc_ex_irq3_mux[] = {
+       IRQ3_MARK,
+};
+static const unsigned int intc_ex_irq4_pins[] = {
+       /* IRQ4 */
+       RCAR_GP_PIN(2, 4),
+};
+static const unsigned int intc_ex_irq4_mux[] = {
+       IRQ4_MARK,
+};
+static const unsigned int intc_ex_irq5_pins[] = {
+       /* IRQ5 */
+       RCAR_GP_PIN(2, 5),
+};
+static const unsigned int intc_ex_irq5_mux[] = {
+       IRQ5_MARK,
+};
+
+/* - MSIOF0 ----------------------------------------------------------------- */
+static const unsigned int msiof0_clk_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(5, 17),
+};
+static const unsigned int msiof0_clk_mux[] = {
+       MSIOF0_SCK_MARK,
+};
+static const unsigned int msiof0_sync_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(5, 18),
+};
+static const unsigned int msiof0_sync_mux[] = {
+       MSIOF0_SYNC_MARK,
+};
+static const unsigned int msiof0_ss1_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(5, 19),
+};
+static const unsigned int msiof0_ss1_mux[] = {
+       MSIOF0_SS1_MARK,
+};
+static const unsigned int msiof0_ss2_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(5, 21),
+};
+static const unsigned int msiof0_ss2_mux[] = {
+       MSIOF0_SS2_MARK,
+};
+static const unsigned int msiof0_txd_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(5, 20),
+};
+static const unsigned int msiof0_txd_mux[] = {
+       MSIOF0_TXD_MARK,
+};
+static const unsigned int msiof0_rxd_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(5, 22),
+};
+static const unsigned int msiof0_rxd_mux[] = {
+       MSIOF0_RXD_MARK,
+};
+/* - MSIOF1 ----------------------------------------------------------------- */
+static const unsigned int msiof1_clk_a_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(6, 8),
+};
+static const unsigned int msiof1_clk_a_mux[] = {
+       MSIOF1_SCK_A_MARK,
+};
+static const unsigned int msiof1_sync_a_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(6, 9),
+};
+static const unsigned int msiof1_sync_a_mux[] = {
+       MSIOF1_SYNC_A_MARK,
+};
+static const unsigned int msiof1_ss1_a_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(6, 5),
+};
+static const unsigned int msiof1_ss1_a_mux[] = {
+       MSIOF1_SS1_A_MARK,
+};
+static const unsigned int msiof1_ss2_a_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(6, 6),
+};
+static const unsigned int msiof1_ss2_a_mux[] = {
+       MSIOF1_SS2_A_MARK,
+};
+static const unsigned int msiof1_txd_a_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(6, 7),
+};
+static const unsigned int msiof1_txd_a_mux[] = {
+       MSIOF1_TXD_A_MARK,
+};
+static const unsigned int msiof1_rxd_a_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(6, 10),
+};
+static const unsigned int msiof1_rxd_a_mux[] = {
+       MSIOF1_RXD_A_MARK,
+};
+static const unsigned int msiof1_clk_b_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(5, 9),
+};
+static const unsigned int msiof1_clk_b_mux[] = {
+       MSIOF1_SCK_B_MARK,
+};
+static const unsigned int msiof1_sync_b_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(5, 3),
+};
+static const unsigned int msiof1_sync_b_mux[] = {
+       MSIOF1_SYNC_B_MARK,
+};
+static const unsigned int msiof1_ss1_b_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(5, 4),
+};
+static const unsigned int msiof1_ss1_b_mux[] = {
+       MSIOF1_SS1_B_MARK,
+};
+static const unsigned int msiof1_ss2_b_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(5, 0),
+};
+static const unsigned int msiof1_ss2_b_mux[] = {
+       MSIOF1_SS2_B_MARK,
+};
+static const unsigned int msiof1_txd_b_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(5, 8),
+};
+static const unsigned int msiof1_txd_b_mux[] = {
+       MSIOF1_TXD_B_MARK,
+};
+static const unsigned int msiof1_rxd_b_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(5, 7),
+};
+static const unsigned int msiof1_rxd_b_mux[] = {
+       MSIOF1_RXD_B_MARK,
+};
+static const unsigned int msiof1_clk_c_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(6, 17),
+};
+static const unsigned int msiof1_clk_c_mux[] = {
+       MSIOF1_SCK_C_MARK,
+};
+static const unsigned int msiof1_sync_c_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(6, 18),
+};
+static const unsigned int msiof1_sync_c_mux[] = {
+       MSIOF1_SYNC_C_MARK,
+};
+static const unsigned int msiof1_ss1_c_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(6, 21),
+};
+static const unsigned int msiof1_ss1_c_mux[] = {
+       MSIOF1_SS1_C_MARK,
+};
+static const unsigned int msiof1_ss2_c_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(6, 27),
+};
+static const unsigned int msiof1_ss2_c_mux[] = {
+       MSIOF1_SS2_C_MARK,
+};
+static const unsigned int msiof1_txd_c_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(6, 20),
+};
+static const unsigned int msiof1_txd_c_mux[] = {
+       MSIOF1_TXD_C_MARK,
+};
+static const unsigned int msiof1_rxd_c_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(6, 19),
+};
+static const unsigned int msiof1_rxd_c_mux[] = {
+       MSIOF1_RXD_C_MARK,
+};
+static const unsigned int msiof1_clk_d_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(5, 12),
+};
+static const unsigned int msiof1_clk_d_mux[] = {
+       MSIOF1_SCK_D_MARK,
+};
+static const unsigned int msiof1_sync_d_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(5, 15),
+};
+static const unsigned int msiof1_sync_d_mux[] = {
+       MSIOF1_SYNC_D_MARK,
+};
+static const unsigned int msiof1_ss1_d_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(5, 16),
+};
+static const unsigned int msiof1_ss1_d_mux[] = {
+       MSIOF1_SS1_D_MARK,
+};
+static const unsigned int msiof1_ss2_d_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(5, 21),
+};
+static const unsigned int msiof1_ss2_d_mux[] = {
+       MSIOF1_SS2_D_MARK,
+};
+static const unsigned int msiof1_txd_d_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(5, 14),
+};
+static const unsigned int msiof1_txd_d_mux[] = {
+       MSIOF1_TXD_D_MARK,
+};
+static const unsigned int msiof1_rxd_d_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(5, 13),
+};
+static const unsigned int msiof1_rxd_d_mux[] = {
+       MSIOF1_RXD_D_MARK,
+};
+static const unsigned int msiof1_clk_e_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(3, 0),
+};
+static const unsigned int msiof1_clk_e_mux[] = {
+       MSIOF1_SCK_E_MARK,
+};
+static const unsigned int msiof1_sync_e_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(3, 1),
+};
+static const unsigned int msiof1_sync_e_mux[] = {
+       MSIOF1_SYNC_E_MARK,
+};
+static const unsigned int msiof1_ss1_e_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(3, 4),
+};
+static const unsigned int msiof1_ss1_e_mux[] = {
+       MSIOF1_SS1_E_MARK,
+};
+static const unsigned int msiof1_ss2_e_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(3, 5),
+};
+static const unsigned int msiof1_ss2_e_mux[] = {
+       MSIOF1_SS2_E_MARK,
+};
+static const unsigned int msiof1_txd_e_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(3, 3),
+};
+static const unsigned int msiof1_txd_e_mux[] = {
+       MSIOF1_TXD_E_MARK,
+};
+static const unsigned int msiof1_rxd_e_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(3, 2),
+};
+static const unsigned int msiof1_rxd_e_mux[] = {
+       MSIOF1_RXD_E_MARK,
+};
+static const unsigned int msiof1_clk_f_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(5, 23),
+};
+static const unsigned int msiof1_clk_f_mux[] = {
+       MSIOF1_SCK_F_MARK,
+};
+static const unsigned int msiof1_sync_f_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(5, 24),
+};
+static const unsigned int msiof1_sync_f_mux[] = {
+       MSIOF1_SYNC_F_MARK,
+};
+static const unsigned int msiof1_ss1_f_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(6, 1),
+};
+static const unsigned int msiof1_ss1_f_mux[] = {
+       MSIOF1_SS1_F_MARK,
+};
+static const unsigned int msiof1_ss2_f_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(6, 2),
+};
+static const unsigned int msiof1_ss2_f_mux[] = {
+       MSIOF1_SS2_F_MARK,
+};
+static const unsigned int msiof1_txd_f_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(6, 0),
+};
+static const unsigned int msiof1_txd_f_mux[] = {
+       MSIOF1_TXD_F_MARK,
+};
+static const unsigned int msiof1_rxd_f_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(5, 25),
+};
+static const unsigned int msiof1_rxd_f_mux[] = {
+       MSIOF1_RXD_F_MARK,
+};
+static const unsigned int msiof1_clk_g_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(3, 6),
+};
+static const unsigned int msiof1_clk_g_mux[] = {
+       MSIOF1_SCK_G_MARK,
+};
+static const unsigned int msiof1_sync_g_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(3, 7),
+};
+static const unsigned int msiof1_sync_g_mux[] = {
+       MSIOF1_SYNC_G_MARK,
+};
+static const unsigned int msiof1_ss1_g_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(3, 10),
+};
+static const unsigned int msiof1_ss1_g_mux[] = {
+       MSIOF1_SS1_G_MARK,
+};
+static const unsigned int msiof1_ss2_g_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(3, 11),
+};
+static const unsigned int msiof1_ss2_g_mux[] = {
+       MSIOF1_SS2_G_MARK,
+};
+static const unsigned int msiof1_txd_g_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(3, 9),
+};
+static const unsigned int msiof1_txd_g_mux[] = {
+       MSIOF1_TXD_G_MARK,
+};
+static const unsigned int msiof1_rxd_g_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(3, 8),
+};
+static const unsigned int msiof1_rxd_g_mux[] = {
+       MSIOF1_RXD_G_MARK,
+};
+/* - MSIOF2 ----------------------------------------------------------------- */
+static const unsigned int msiof2_clk_a_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(1, 9),
+};
+static const unsigned int msiof2_clk_a_mux[] = {
+       MSIOF2_SCK_A_MARK,
+};
+static const unsigned int msiof2_sync_a_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(1, 8),
+};
+static const unsigned int msiof2_sync_a_mux[] = {
+       MSIOF2_SYNC_A_MARK,
+};
+static const unsigned int msiof2_ss1_a_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(1, 6),
+};
+static const unsigned int msiof2_ss1_a_mux[] = {
+       MSIOF2_SS1_A_MARK,
+};
+static const unsigned int msiof2_ss2_a_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(1, 7),
+};
+static const unsigned int msiof2_ss2_a_mux[] = {
+       MSIOF2_SS2_A_MARK,
+};
+static const unsigned int msiof2_txd_a_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(1, 11),
+};
+static const unsigned int msiof2_txd_a_mux[] = {
+       MSIOF2_TXD_A_MARK,
+};
+static const unsigned int msiof2_rxd_a_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(1, 10),
+};
+static const unsigned int msiof2_rxd_a_mux[] = {
+       MSIOF2_RXD_A_MARK,
+};
+static const unsigned int msiof2_clk_b_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(0, 4),
+};
+static const unsigned int msiof2_clk_b_mux[] = {
+       MSIOF2_SCK_B_MARK,
+};
+static const unsigned int msiof2_sync_b_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(0, 5),
+};
+static const unsigned int msiof2_sync_b_mux[] = {
+       MSIOF2_SYNC_B_MARK,
+};
+static const unsigned int msiof2_ss1_b_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(0, 0),
+};
+static const unsigned int msiof2_ss1_b_mux[] = {
+       MSIOF2_SS1_B_MARK,
+};
+static const unsigned int msiof2_ss2_b_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(0, 1),
+};
+static const unsigned int msiof2_ss2_b_mux[] = {
+       MSIOF2_SS2_B_MARK,
+};
+static const unsigned int msiof2_txd_b_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(0, 7),
+};
+static const unsigned int msiof2_txd_b_mux[] = {
+       MSIOF2_TXD_B_MARK,
+};
+static const unsigned int msiof2_rxd_b_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(0, 6),
+};
+static const unsigned int msiof2_rxd_b_mux[] = {
+       MSIOF2_RXD_B_MARK,
+};
+static const unsigned int msiof2_clk_c_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(2, 12),
+};
+static const unsigned int msiof2_clk_c_mux[] = {
+       MSIOF2_SCK_C_MARK,
+};
+static const unsigned int msiof2_sync_c_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(2, 11),
+};
+static const unsigned int msiof2_sync_c_mux[] = {
+       MSIOF2_SYNC_C_MARK,
+};
+static const unsigned int msiof2_ss1_c_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(2, 10),
+};
+static const unsigned int msiof2_ss1_c_mux[] = {
+       MSIOF2_SS1_C_MARK,
+};
+static const unsigned int msiof2_ss2_c_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(2, 9),
+};
+static const unsigned int msiof2_ss2_c_mux[] = {
+       MSIOF2_SS2_C_MARK,
+};
+static const unsigned int msiof2_txd_c_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(2, 14),
+};
+static const unsigned int msiof2_txd_c_mux[] = {
+       MSIOF2_TXD_C_MARK,
+};
+static const unsigned int msiof2_rxd_c_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(2, 13),
+};
+static const unsigned int msiof2_rxd_c_mux[] = {
+       MSIOF2_RXD_C_MARK,
+};
+static const unsigned int msiof2_clk_d_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(0, 8),
+};
+static const unsigned int msiof2_clk_d_mux[] = {
+       MSIOF2_SCK_D_MARK,
+};
+static const unsigned int msiof2_sync_d_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(0, 9),
+};
+static const unsigned int msiof2_sync_d_mux[] = {
+       MSIOF2_SYNC_D_MARK,
+};
+static const unsigned int msiof2_ss1_d_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(0, 12),
+};
+static const unsigned int msiof2_ss1_d_mux[] = {
+       MSIOF2_SS1_D_MARK,
+};
+static const unsigned int msiof2_ss2_d_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(0, 13),
+};
+static const unsigned int msiof2_ss2_d_mux[] = {
+       MSIOF2_SS2_D_MARK,
+};
+static const unsigned int msiof2_txd_d_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(0, 11),
+};
+static const unsigned int msiof2_txd_d_mux[] = {
+       MSIOF2_TXD_D_MARK,
+};
+static const unsigned int msiof2_rxd_d_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(0, 10),
+};
+static const unsigned int msiof2_rxd_d_mux[] = {
+       MSIOF2_RXD_D_MARK,
+};
+/* - MSIOF3 ----------------------------------------------------------------- */
+static const unsigned int msiof3_clk_a_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(0, 0),
+};
+static const unsigned int msiof3_clk_a_mux[] = {
+       MSIOF3_SCK_A_MARK,
+};
+static const unsigned int msiof3_sync_a_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(0, 1),
+};
+static const unsigned int msiof3_sync_a_mux[] = {
+       MSIOF3_SYNC_A_MARK,
+};
+static const unsigned int msiof3_ss1_a_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(0, 14),
+};
+static const unsigned int msiof3_ss1_a_mux[] = {
+       MSIOF3_SS1_A_MARK,
+};
+static const unsigned int msiof3_ss2_a_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(0, 15),
+};
+static const unsigned int msiof3_ss2_a_mux[] = {
+       MSIOF3_SS2_A_MARK,
+};
+static const unsigned int msiof3_txd_a_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(0, 3),
+};
+static const unsigned int msiof3_txd_a_mux[] = {
+       MSIOF3_TXD_A_MARK,
+};
+static const unsigned int msiof3_rxd_a_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(0, 2),
+};
+static const unsigned int msiof3_rxd_a_mux[] = {
+       MSIOF3_RXD_A_MARK,
+};
+static const unsigned int msiof3_clk_b_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(1, 2),
+};
+static const unsigned int msiof3_clk_b_mux[] = {
+       MSIOF3_SCK_B_MARK,
+};
+static const unsigned int msiof3_sync_b_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(1, 0),
+};
+static const unsigned int msiof3_sync_b_mux[] = {
+       MSIOF3_SYNC_B_MARK,
+};
+static const unsigned int msiof3_ss1_b_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(1, 4),
+};
+static const unsigned int msiof3_ss1_b_mux[] = {
+       MSIOF3_SS1_B_MARK,
+};
+static const unsigned int msiof3_ss2_b_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(1, 5),
+};
+static const unsigned int msiof3_ss2_b_mux[] = {
+       MSIOF3_SS2_B_MARK,
+};
+static const unsigned int msiof3_txd_b_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(1, 1),
+};
+static const unsigned int msiof3_txd_b_mux[] = {
+       MSIOF3_TXD_B_MARK,
+};
+static const unsigned int msiof3_rxd_b_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(1, 3),
+};
+static const unsigned int msiof3_rxd_b_mux[] = {
+       MSIOF3_RXD_B_MARK,
+};
+static const unsigned int msiof3_clk_c_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(1, 12),
+};
+static const unsigned int msiof3_clk_c_mux[] = {
+       MSIOF3_SCK_C_MARK,
+};
+static const unsigned int msiof3_sync_c_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(1, 13),
+};
+static const unsigned int msiof3_sync_c_mux[] = {
+       MSIOF3_SYNC_C_MARK,
+};
+static const unsigned int msiof3_txd_c_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(1, 15),
+};
+static const unsigned int msiof3_txd_c_mux[] = {
+       MSIOF3_TXD_C_MARK,
+};
+static const unsigned int msiof3_rxd_c_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(1, 14),
+};
+static const unsigned int msiof3_rxd_c_mux[] = {
+       MSIOF3_RXD_C_MARK,
+};
+static const unsigned int msiof3_clk_d_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(1, 22),
+};
+static const unsigned int msiof3_clk_d_mux[] = {
+       MSIOF3_SCK_D_MARK,
+};
+static const unsigned int msiof3_sync_d_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(1, 23),
+};
+static const unsigned int msiof3_sync_d_mux[] = {
+       MSIOF3_SYNC_D_MARK,
+};
+static const unsigned int msiof3_ss1_d_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(1, 26),
+};
+static const unsigned int msiof3_ss1_d_mux[] = {
+       MSIOF3_SS1_D_MARK,
+};
+static const unsigned int msiof3_txd_d_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(1, 25),
+};
+static const unsigned int msiof3_txd_d_mux[] = {
+       MSIOF3_TXD_D_MARK,
+};
+static const unsigned int msiof3_rxd_d_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(1, 24),
+};
+static const unsigned int msiof3_rxd_d_mux[] = {
+       MSIOF3_RXD_D_MARK,
+};
+static const unsigned int msiof3_clk_e_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(2, 3),
+};
+static const unsigned int msiof3_clk_e_mux[] = {
+       MSIOF3_SCK_E_MARK,
+};
+static const unsigned int msiof3_sync_e_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(2, 2),
+};
+static const unsigned int msiof3_sync_e_mux[] = {
+       MSIOF3_SYNC_E_MARK,
+};
+static const unsigned int msiof3_ss1_e_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(2, 1),
+};
+static const unsigned int msiof3_ss1_e_mux[] = {
+       MSIOF3_SS1_E_MARK,
+};
+static const unsigned int msiof3_ss2_e_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(2, 0),
+};
+static const unsigned int msiof3_ss2_e_mux[] = {
+       MSIOF3_SS2_E_MARK,
+};
+static const unsigned int msiof3_txd_e_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(2, 5),
+};
+static const unsigned int msiof3_txd_e_mux[] = {
+       MSIOF3_TXD_E_MARK,
+};
+static const unsigned int msiof3_rxd_e_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(2, 4),
+};
+static const unsigned int msiof3_rxd_e_mux[] = {
+       MSIOF3_RXD_E_MARK,
+};
+
+/* - PWM0 --------------------------------------------------------------------*/
+static const unsigned int pwm0_pins[] = {
+       /* PWM */
+       RCAR_GP_PIN(2, 6),
+};
+static const unsigned int pwm0_mux[] = {
+       PWM0_MARK,
+};
+/* - PWM1 --------------------------------------------------------------------*/
+static const unsigned int pwm1_a_pins[] = {
+       /* PWM */
+       RCAR_GP_PIN(2, 7),
+};
+static const unsigned int pwm1_a_mux[] = {
+       PWM1_A_MARK,
+};
+static const unsigned int pwm1_b_pins[] = {
+       /* PWM */
+       RCAR_GP_PIN(1, 8),
+};
+static const unsigned int pwm1_b_mux[] = {
+       PWM1_B_MARK,
+};
+/* - PWM2 --------------------------------------------------------------------*/
+static const unsigned int pwm2_a_pins[] = {
+       /* PWM */
+       RCAR_GP_PIN(2, 8),
+};
+static const unsigned int pwm2_a_mux[] = {
+       PWM2_A_MARK,
+};
+static const unsigned int pwm2_b_pins[] = {
+       /* PWM */
+       RCAR_GP_PIN(1, 11),
+};
+static const unsigned int pwm2_b_mux[] = {
+       PWM2_B_MARK,
+};
+/* - PWM3 --------------------------------------------------------------------*/
+static const unsigned int pwm3_a_pins[] = {
+       /* PWM */
+       RCAR_GP_PIN(1, 0),
+};
+static const unsigned int pwm3_a_mux[] = {
+       PWM3_A_MARK,
+};
+static const unsigned int pwm3_b_pins[] = {
+       /* PWM */
+       RCAR_GP_PIN(2, 2),
+};
+static const unsigned int pwm3_b_mux[] = {
+       PWM3_B_MARK,
+};
+/* - PWM4 --------------------------------------------------------------------*/
+static const unsigned int pwm4_a_pins[] = {
+       /* PWM */
+       RCAR_GP_PIN(1, 1),
+};
+static const unsigned int pwm4_a_mux[] = {
+       PWM4_A_MARK,
+};
+static const unsigned int pwm4_b_pins[] = {
+       /* PWM */
+       RCAR_GP_PIN(2, 3),
+};
+static const unsigned int pwm4_b_mux[] = {
+       PWM4_B_MARK,
+};
+/* - PWM5 --------------------------------------------------------------------*/
+static const unsigned int pwm5_a_pins[] = {
+       /* PWM */
+       RCAR_GP_PIN(1, 2),
+};
+static const unsigned int pwm5_a_mux[] = {
+       PWM5_A_MARK,
+};
+static const unsigned int pwm5_b_pins[] = {
+       /* PWM */
+       RCAR_GP_PIN(2, 4),
+};
+static const unsigned int pwm5_b_mux[] = {
+       PWM5_B_MARK,
+};
+/* - PWM6 --------------------------------------------------------------------*/
+static const unsigned int pwm6_a_pins[] = {
+       /* PWM */
+       RCAR_GP_PIN(1, 3),
+};
+static const unsigned int pwm6_a_mux[] = {
+       PWM6_A_MARK,
+};
+static const unsigned int pwm6_b_pins[] = {
+       /* PWM */
+       RCAR_GP_PIN(2, 5),
+};
+static const unsigned int pwm6_b_mux[] = {
+       PWM6_B_MARK,
+};
+
+/* - SATA --------------------------------------------------------------------*/
+static const unsigned int sata0_devslp_a_pins[] = {
+       /* DEVSLP */
+       RCAR_GP_PIN(6, 16),
+};
+
+static const unsigned int sata0_devslp_a_mux[] = {
+       SATA_DEVSLP_A_MARK,
+};
+
+static const unsigned int sata0_devslp_b_pins[] = {
+       /* DEVSLP */
+       RCAR_GP_PIN(4, 6),
+};
+
+static const unsigned int sata0_devslp_b_mux[] = {
+       SATA_DEVSLP_B_MARK,
+};
+
+/* - SCIF0 ------------------------------------------------------------------ */
+static const unsigned int scif0_data_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
+};
+static const unsigned int scif0_data_mux[] = {
+       RX0_MARK, TX0_MARK,
+};
+static const unsigned int scif0_clk_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(5, 0),
+};
+static const unsigned int scif0_clk_mux[] = {
+       SCK0_MARK,
+};
+static const unsigned int scif0_ctrl_pins[] = {
+       /* RTS, CTS */
+       RCAR_GP_PIN(5, 4), RCAR_GP_PIN(5, 3),
+};
+static const unsigned int scif0_ctrl_mux[] = {
+       RTS0_N_MARK, CTS0_N_MARK,
+};
+/* - SCIF1 ------------------------------------------------------------------ */
+static const unsigned int scif1_data_a_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(5, 5), RCAR_GP_PIN(5, 6),
+};
+static const unsigned int scif1_data_a_mux[] = {
+       RX1_A_MARK, TX1_A_MARK,
+};
+static const unsigned int scif1_clk_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(6, 21),
+};
+static const unsigned int scif1_clk_mux[] = {
+       SCK1_MARK,
+};
+static const unsigned int scif1_ctrl_pins[] = {
+       /* RTS, CTS */
+       RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 7),
+};
+static const unsigned int scif1_ctrl_mux[] = {
+       RTS1_N_MARK, CTS1_N_MARK,
+};
+static const unsigned int scif1_data_b_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(5, 24), RCAR_GP_PIN(5, 25),
+};
+static const unsigned int scif1_data_b_mux[] = {
+       RX1_B_MARK, TX1_B_MARK,
+};
+/* - SCIF2 ------------------------------------------------------------------ */
+static const unsigned int scif2_data_a_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(5, 11), RCAR_GP_PIN(5, 10),
+};
+static const unsigned int scif2_data_a_mux[] = {
+       RX2_A_MARK, TX2_A_MARK,
+};
+static const unsigned int scif2_clk_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(5, 9),
+};
+static const unsigned int scif2_clk_mux[] = {
+       SCK2_MARK,
+};
+static const unsigned int scif2_data_b_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(5, 15), RCAR_GP_PIN(5, 16),
+};
+static const unsigned int scif2_data_b_mux[] = {
+       RX2_B_MARK, TX2_B_MARK,
+};
+/* - SCIF3 ------------------------------------------------------------------ */
+static const unsigned int scif3_data_a_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(1, 23), RCAR_GP_PIN(1, 24),
+};
+static const unsigned int scif3_data_a_mux[] = {
+       RX3_A_MARK, TX3_A_MARK,
+};
+static const unsigned int scif3_clk_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(1, 22),
+};
+static const unsigned int scif3_clk_mux[] = {
+       SCK3_MARK,
+};
+static const unsigned int scif3_ctrl_pins[] = {
+       /* RTS, CTS */
+       RCAR_GP_PIN(1, 26), RCAR_GP_PIN(1, 25),
+};
+static const unsigned int scif3_ctrl_mux[] = {
+       RTS3_N_MARK, CTS3_N_MARK,
+};
+static const unsigned int scif3_data_b_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 11),
+};
+static const unsigned int scif3_data_b_mux[] = {
+       RX3_B_MARK, TX3_B_MARK,
+};
+/* - SCIF4 ------------------------------------------------------------------ */
+static const unsigned int scif4_data_a_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(2, 11), RCAR_GP_PIN(2, 12),
+};
+static const unsigned int scif4_data_a_mux[] = {
+       RX4_A_MARK, TX4_A_MARK,
+};
+static const unsigned int scif4_clk_a_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(2, 10),
+};
+static const unsigned int scif4_clk_a_mux[] = {
+       SCK4_A_MARK,
+};
+static const unsigned int scif4_ctrl_a_pins[] = {
+       /* RTS, CTS */
+       RCAR_GP_PIN(2, 14), RCAR_GP_PIN(2, 13),
+};
+static const unsigned int scif4_ctrl_a_mux[] = {
+       RTS4_N_A_MARK, CTS4_N_A_MARK,
+};
+static const unsigned int scif4_data_b_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7),
+};
+static const unsigned int scif4_data_b_mux[] = {
+       RX4_B_MARK, TX4_B_MARK,
+};
+static const unsigned int scif4_clk_b_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(1, 5),
+};
+static const unsigned int scif4_clk_b_mux[] = {
+       SCK4_B_MARK,
+};
+static const unsigned int scif4_ctrl_b_pins[] = {
+       /* RTS, CTS */
+       RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 9),
+};
+static const unsigned int scif4_ctrl_b_mux[] = {
+       RTS4_N_B_MARK, CTS4_N_B_MARK,
+};
+static const unsigned int scif4_data_c_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
+};
+static const unsigned int scif4_data_c_mux[] = {
+       RX4_C_MARK, TX4_C_MARK,
+};
+static const unsigned int scif4_clk_c_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(0, 8),
+};
+static const unsigned int scif4_clk_c_mux[] = {
+       SCK4_C_MARK,
+};
+static const unsigned int scif4_ctrl_c_pins[] = {
+       /* RTS, CTS */
+       RCAR_GP_PIN(0, 11), RCAR_GP_PIN(0, 10),
+};
+static const unsigned int scif4_ctrl_c_mux[] = {
+       RTS4_N_C_MARK, CTS4_N_C_MARK,
+};
+/* - SCIF5 ------------------------------------------------------------------ */
+static const unsigned int scif5_data_a_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(5, 19), RCAR_GP_PIN(5, 21),
+};
+static const unsigned int scif5_data_a_mux[] = {
+       RX5_A_MARK, TX5_A_MARK,
+};
+static const unsigned int scif5_clk_a_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(6, 21),
+};
+static const unsigned int scif5_clk_a_mux[] = {
+       SCK5_A_MARK,
+};
+static const unsigned int scif5_data_b_pins[] = {
+       /* RX, TX */
+       RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 18),
+};
+static const unsigned int scif5_data_b_mux[] = {
+       RX5_B_MARK, TX5_B_MARK,
+};
+static const unsigned int scif5_clk_b_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(5, 0),
+};
+static const unsigned int scif5_clk_b_mux[] = {
+       SCK5_B_MARK,
+};
+/* - SCIF Clock ------------------------------------------------------------- */
+static const unsigned int scif_clk_a_pins[] = {
+       /* SCIF_CLK */
+       RCAR_GP_PIN(6, 23),
+};
+static const unsigned int scif_clk_a_mux[] = {
+       SCIF_CLK_A_MARK,
+};
+static const unsigned int scif_clk_b_pins[] = {
+       /* SCIF_CLK */
+       RCAR_GP_PIN(5, 9),
+};
+static const unsigned int scif_clk_b_mux[] = {
+       SCIF_CLK_B_MARK,
+};
+
+/* - SDHI0 ------------------------------------------------------------------ */
+static const unsigned int sdhi0_data1_pins[] = {
+       /* D0 */
+       RCAR_GP_PIN(3, 2),
+};
+
+static const unsigned int sdhi0_data1_mux[] = {
+       SD0_DAT0_MARK,
+};
+
+static const unsigned int sdhi0_data4_pins[] = {
+       /* D[0:3] */
+       RCAR_GP_PIN(3, 2), RCAR_GP_PIN(3, 3),
+       RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
+};
+
+static const unsigned int sdhi0_data4_mux[] = {
+       SD0_DAT0_MARK, SD0_DAT1_MARK,
+       SD0_DAT2_MARK, SD0_DAT3_MARK,
+};
+
+static const unsigned int sdhi0_ctrl_pins[] = {
+       /* CLK, CMD */
+       RCAR_GP_PIN(3, 0), RCAR_GP_PIN(3, 1),
+};
+
+static const unsigned int sdhi0_ctrl_mux[] = {
+       SD0_CLK_MARK, SD0_CMD_MARK,
+};
+
+static const unsigned int sdhi0_cd_pins[] = {
+       /* CD */
+       RCAR_GP_PIN(3, 12),
+};
+
+static const unsigned int sdhi0_cd_mux[] = {
+       SD0_CD_MARK,
+};
+
+static const unsigned int sdhi0_wp_pins[] = {
+       /* WP */
+       RCAR_GP_PIN(3, 13),
+};
+
+static const unsigned int sdhi0_wp_mux[] = {
+       SD0_WP_MARK,
+};
+
+/* - SDHI1 ------------------------------------------------------------------ */
+static const unsigned int sdhi1_data1_pins[] = {
+       /* D0 */
+       RCAR_GP_PIN(3, 8),
+};
+
+static const unsigned int sdhi1_data1_mux[] = {
+       SD1_DAT0_MARK,
+};
+
+static const unsigned int sdhi1_data4_pins[] = {
+       /* D[0:3] */
+       RCAR_GP_PIN(3, 8),  RCAR_GP_PIN(3, 9),
+       RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
+};
+
+static const unsigned int sdhi1_data4_mux[] = {
+       SD1_DAT0_MARK, SD1_DAT1_MARK,
+       SD1_DAT2_MARK, SD1_DAT3_MARK,
+};
+
+static const unsigned int sdhi1_ctrl_pins[] = {
+       /* CLK, CMD */
+       RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
+};
+
+static const unsigned int sdhi1_ctrl_mux[] = {
+       SD1_CLK_MARK, SD1_CMD_MARK,
+};
+
+static const unsigned int sdhi1_cd_pins[] = {
+       /* CD */
+       RCAR_GP_PIN(3, 14),
+};
+
+static const unsigned int sdhi1_cd_mux[] = {
+       SD1_CD_MARK,
+};
+
+static const unsigned int sdhi1_wp_pins[] = {
+       /* WP */
+       RCAR_GP_PIN(3, 15),
+};
+
+static const unsigned int sdhi1_wp_mux[] = {
+       SD1_WP_MARK,
+};
+
+/* - SDHI2 ------------------------------------------------------------------ */
+static const unsigned int sdhi2_data1_pins[] = {
+       /* D0 */
+       RCAR_GP_PIN(4, 2),
+};
+
+static const unsigned int sdhi2_data1_mux[] = {
+       SD2_DAT0_MARK,
+};
+
+static const unsigned int sdhi2_data4_pins[] = {
+       /* D[0:3] */
+       RCAR_GP_PIN(4, 2), RCAR_GP_PIN(4, 3),
+       RCAR_GP_PIN(4, 4), RCAR_GP_PIN(4, 5),
+};
+
+static const unsigned int sdhi2_data4_mux[] = {
+       SD2_DAT0_MARK, SD2_DAT1_MARK,
+       SD2_DAT2_MARK, SD2_DAT3_MARK,
+};
+
+static const unsigned int sdhi2_data8_pins[] = {
+       /* D[0:7] */
+       RCAR_GP_PIN(4, 2),  RCAR_GP_PIN(4, 3),
+       RCAR_GP_PIN(4, 4),  RCAR_GP_PIN(4, 5),
+       RCAR_GP_PIN(3, 8),  RCAR_GP_PIN(3, 9),
+       RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
+};
+
+static const unsigned int sdhi2_data8_mux[] = {
+       SD2_DAT0_MARK, SD2_DAT1_MARK,
+       SD2_DAT2_MARK, SD2_DAT3_MARK,
+       SD2_DAT4_MARK, SD2_DAT5_MARK,
+       SD2_DAT6_MARK, SD2_DAT7_MARK,
+};
+
+static const unsigned int sdhi2_ctrl_pins[] = {
+       /* CLK, CMD */
+       RCAR_GP_PIN(4, 0), RCAR_GP_PIN(4, 1),
+};
+
+static const unsigned int sdhi2_ctrl_mux[] = {
+       SD2_CLK_MARK, SD2_CMD_MARK,
+};
+
+static const unsigned int sdhi2_cd_a_pins[] = {
+       /* CD */
+       RCAR_GP_PIN(4, 13),
+};
+
+static const unsigned int sdhi2_cd_a_mux[] = {
+       SD2_CD_A_MARK,
+};
+
+static const unsigned int sdhi2_cd_b_pins[] = {
+       /* CD */
+       RCAR_GP_PIN(5, 10),
+};
+
+static const unsigned int sdhi2_cd_b_mux[] = {
+       SD2_CD_B_MARK,
+};
+
+static const unsigned int sdhi2_wp_a_pins[] = {
+       /* WP */
+       RCAR_GP_PIN(4, 14),
+};
+
+static const unsigned int sdhi2_wp_a_mux[] = {
+       SD2_WP_A_MARK,
+};
+
+static const unsigned int sdhi2_wp_b_pins[] = {
+       /* WP */
+       RCAR_GP_PIN(5, 11),
+};
+
+static const unsigned int sdhi2_wp_b_mux[] = {
+       SD2_WP_B_MARK,
+};
+
+static const unsigned int sdhi2_ds_pins[] = {
+       /* DS */
+       RCAR_GP_PIN(4, 6),
+};
+
+static const unsigned int sdhi2_ds_mux[] = {
+       SD2_DS_MARK,
+};
+
+/* - SDHI3 ------------------------------------------------------------------ */
+static const unsigned int sdhi3_data1_pins[] = {
+       /* D0 */
+       RCAR_GP_PIN(4, 9),
+};
+
+static const unsigned int sdhi3_data1_mux[] = {
+       SD3_DAT0_MARK,
+};
+
+static const unsigned int sdhi3_data4_pins[] = {
+       /* D[0:3] */
+       RCAR_GP_PIN(4, 9),  RCAR_GP_PIN(4, 10),
+       RCAR_GP_PIN(4, 11), RCAR_GP_PIN(4, 12),
+};
+
+static const unsigned int sdhi3_data4_mux[] = {
+       SD3_DAT0_MARK, SD3_DAT1_MARK,
+       SD3_DAT2_MARK, SD3_DAT3_MARK,
+};
+
+static const unsigned int sdhi3_data8_pins[] = {
+       /* D[0:7] */
+       RCAR_GP_PIN(4, 9),  RCAR_GP_PIN(4, 10),
+       RCAR_GP_PIN(4, 11), RCAR_GP_PIN(4, 12),
+       RCAR_GP_PIN(4, 13), RCAR_GP_PIN(4, 14),
+       RCAR_GP_PIN(4, 15), RCAR_GP_PIN(4, 16),
+};
+
+static const unsigned int sdhi3_data8_mux[] = {
+       SD3_DAT0_MARK, SD3_DAT1_MARK,
+       SD3_DAT2_MARK, SD3_DAT3_MARK,
+       SD3_DAT4_MARK, SD3_DAT5_MARK,
+       SD3_DAT6_MARK, SD3_DAT7_MARK,
+};
+
+static const unsigned int sdhi3_ctrl_pins[] = {
+       /* CLK, CMD */
+       RCAR_GP_PIN(4, 7), RCAR_GP_PIN(4, 8),
+};
+
+static const unsigned int sdhi3_ctrl_mux[] = {
+       SD3_CLK_MARK, SD3_CMD_MARK,
+};
+
+static const unsigned int sdhi3_cd_pins[] = {
+       /* CD */
+       RCAR_GP_PIN(4, 15),
+};
+
+static const unsigned int sdhi3_cd_mux[] = {
+       SD3_CD_MARK,
+};
+
+static const unsigned int sdhi3_wp_pins[] = {
+       /* WP */
+       RCAR_GP_PIN(4, 16),
+};
+
+static const unsigned int sdhi3_wp_mux[] = {
+       SD3_WP_MARK,
+};
+
+static const unsigned int sdhi3_ds_pins[] = {
+       /* DS */
+       RCAR_GP_PIN(4, 17),
+};
+
+static const unsigned int sdhi3_ds_mux[] = {
+       SD3_DS_MARK,
+};
+
+/* - SSI -------------------------------------------------------------------- */
+static const unsigned int ssi0_data_pins[] = {
+       /* SDATA */
+       RCAR_GP_PIN(6, 2),
+};
+static const unsigned int ssi0_data_mux[] = {
+       SSI_SDATA0_MARK,
+};
+static const unsigned int ssi01239_ctrl_pins[] = {
+       /* SCK, WS */
+       RCAR_GP_PIN(6, 0), RCAR_GP_PIN(6, 1),
+};
+static const unsigned int ssi01239_ctrl_mux[] = {
+       SSI_SCK01239_MARK, SSI_WS01239_MARK,
+};
+static const unsigned int ssi1_data_a_pins[] = {
+       /* SDATA */
+       RCAR_GP_PIN(6, 3),
+};
+static const unsigned int ssi1_data_a_mux[] = {
+       SSI_SDATA1_A_MARK,
+};
+static const unsigned int ssi1_data_b_pins[] = {
+       /* SDATA */
+       RCAR_GP_PIN(5, 12),
+};
+static const unsigned int ssi1_data_b_mux[] = {
+       SSI_SDATA1_B_MARK,
+};
+static const unsigned int ssi1_ctrl_a_pins[] = {
+       /* SCK, WS */
+       RCAR_GP_PIN(6, 26), RCAR_GP_PIN(6, 27),
+};
+static const unsigned int ssi1_ctrl_a_mux[] = {
+       SSI_SCK1_A_MARK, SSI_WS1_A_MARK,
+};
+static const unsigned int ssi1_ctrl_b_pins[] = {
+       /* SCK, WS */
+       RCAR_GP_PIN(6, 4), RCAR_GP_PIN(6, 21),
+};
+static const unsigned int ssi1_ctrl_b_mux[] = {
+       SSI_SCK1_B_MARK, SSI_WS1_B_MARK,
+};
+static const unsigned int ssi2_data_a_pins[] = {
+       /* SDATA */
+       RCAR_GP_PIN(6, 4),
+};
+static const unsigned int ssi2_data_a_mux[] = {
+       SSI_SDATA2_A_MARK,
+};
+static const unsigned int ssi2_data_b_pins[] = {
+       /* SDATA */
+       RCAR_GP_PIN(5, 13),
+};
+static const unsigned int ssi2_data_b_mux[] = {
+       SSI_SDATA2_B_MARK,
+};
+static const unsigned int ssi2_ctrl_a_pins[] = {
+       /* SCK, WS */
+       RCAR_GP_PIN(5, 19), RCAR_GP_PIN(5, 21),
+};
+static const unsigned int ssi2_ctrl_a_mux[] = {
+       SSI_SCK2_A_MARK, SSI_WS2_A_MARK,
+};
+static const unsigned int ssi2_ctrl_b_pins[] = {
+       /* SCK, WS */
+       RCAR_GP_PIN(6, 28), RCAR_GP_PIN(6, 29),
+};
+static const unsigned int ssi2_ctrl_b_mux[] = {
+       SSI_SCK2_B_MARK, SSI_WS2_B_MARK,
+};
+static const unsigned int ssi3_data_pins[] = {
+       /* SDATA */
+       RCAR_GP_PIN(6, 7),
+};
+static const unsigned int ssi3_data_mux[] = {
+       SSI_SDATA3_MARK,
+};
+static const unsigned int ssi349_ctrl_pins[] = {
+       /* SCK, WS */
+       RCAR_GP_PIN(6, 5), RCAR_GP_PIN(6, 6),
+};
+static const unsigned int ssi349_ctrl_mux[] = {
+       SSI_SCK349_MARK, SSI_WS349_MARK,
+};
+static const unsigned int ssi4_data_pins[] = {
+       /* SDATA */
+       RCAR_GP_PIN(6, 10),
+};
+static const unsigned int ssi4_data_mux[] = {
+       SSI_SDATA4_MARK,
+};
+static const unsigned int ssi4_ctrl_pins[] = {
+       /* SCK, WS */
+       RCAR_GP_PIN(6, 8), RCAR_GP_PIN(6, 9),
+};
+static const unsigned int ssi4_ctrl_mux[] = {
+       SSI_SCK4_MARK, SSI_WS4_MARK,
+};
+static const unsigned int ssi5_data_pins[] = {
+       /* SDATA */
+       RCAR_GP_PIN(6, 13),
+};
+static const unsigned int ssi5_data_mux[] = {
+       SSI_SDATA5_MARK,
+};
+static const unsigned int ssi5_ctrl_pins[] = {
+       /* SCK, WS */
+       RCAR_GP_PIN(6, 11), RCAR_GP_PIN(6, 12),
+};
+static const unsigned int ssi5_ctrl_mux[] = {
+       SSI_SCK5_MARK, SSI_WS5_MARK,
+};
+static const unsigned int ssi6_data_pins[] = {
+       /* SDATA */
+       RCAR_GP_PIN(6, 16),
+};
+static const unsigned int ssi6_data_mux[] = {
+       SSI_SDATA6_MARK,
+};
+static const unsigned int ssi6_ctrl_pins[] = {
+       /* SCK, WS */
+       RCAR_GP_PIN(6, 14), RCAR_GP_PIN(6, 15),
+};
+static const unsigned int ssi6_ctrl_mux[] = {
+       SSI_SCK6_MARK, SSI_WS6_MARK,
+};
+static const unsigned int ssi7_data_pins[] = {
+       /* SDATA */
+       RCAR_GP_PIN(6, 19),
+};
+static const unsigned int ssi7_data_mux[] = {
+       SSI_SDATA7_MARK,
+};
+static const unsigned int ssi78_ctrl_pins[] = {
+       /* SCK, WS */
+       RCAR_GP_PIN(6, 17), RCAR_GP_PIN(6, 18),
+};
+static const unsigned int ssi78_ctrl_mux[] = {
+       SSI_SCK78_MARK, SSI_WS78_MARK,
+};
+static const unsigned int ssi8_data_pins[] = {
+       /* SDATA */
+       RCAR_GP_PIN(6, 20),
+};
+static const unsigned int ssi8_data_mux[] = {
+       SSI_SDATA8_MARK,
+};
+static const unsigned int ssi9_data_a_pins[] = {
+       /* SDATA */
+       RCAR_GP_PIN(6, 21),
+};
+static const unsigned int ssi9_data_a_mux[] = {
+       SSI_SDATA9_A_MARK,
+};
+static const unsigned int ssi9_data_b_pins[] = {
+       /* SDATA */
+       RCAR_GP_PIN(5, 14),
+};
+static const unsigned int ssi9_data_b_mux[] = {
+       SSI_SDATA9_B_MARK,
+};
+static const unsigned int ssi9_ctrl_a_pins[] = {
+       /* SCK, WS */
+       RCAR_GP_PIN(5, 15), RCAR_GP_PIN(5, 16),
+};
+static const unsigned int ssi9_ctrl_a_mux[] = {
+       SSI_SCK9_A_MARK, SSI_WS9_A_MARK,
+};
+static const unsigned int ssi9_ctrl_b_pins[] = {
+       /* SCK, WS */
+       RCAR_GP_PIN(6, 30), RCAR_GP_PIN(6, 31),
+};
+static const unsigned int ssi9_ctrl_b_mux[] = {
+       SSI_SCK9_B_MARK, SSI_WS9_B_MARK,
+};
+
+/* - TMU -------------------------------------------------------------------- */
+static const unsigned int tmu_tclk1_a_pins[] = {
+       /* TCLK */
+       RCAR_GP_PIN(6, 23),
+};
+
+static const unsigned int tmu_tclk1_a_mux[] = {
+       TCLK1_A_MARK,
+};
+
+static const unsigned int tmu_tclk1_b_pins[] = {
+       /* TCLK */
+       RCAR_GP_PIN(5, 19),
+};
+
+static const unsigned int tmu_tclk1_b_mux[] = {
+       TCLK1_B_MARK,
+};
+
+static const unsigned int tmu_tclk2_a_pins[] = {
+       /* TCLK */
+       RCAR_GP_PIN(6, 19),
+};
+
+static const unsigned int tmu_tclk2_a_mux[] = {
+       TCLK2_A_MARK,
+};
+
+static const unsigned int tmu_tclk2_b_pins[] = {
+       /* TCLK */
+       RCAR_GP_PIN(6, 28),
+};
+
+static const unsigned int tmu_tclk2_b_mux[] = {
+       TCLK2_B_MARK,
+};
+
+/* - USB0 ------------------------------------------------------------------- */
+static const unsigned int usb0_pins[] = {
+       /* PWEN, OVC */
+       RCAR_GP_PIN(6, 24), RCAR_GP_PIN(6, 25),
+};
+
+static const unsigned int usb0_mux[] = {
+       USB0_PWEN_MARK, USB0_OVC_MARK,
+};
+
+/* - USB1 ------------------------------------------------------------------- */
+static const unsigned int usb1_pins[] = {
+       /* PWEN, OVC */
+       RCAR_GP_PIN(6, 26), RCAR_GP_PIN(6, 27),
+};
+
+static const unsigned int usb1_mux[] = {
+       USB1_PWEN_MARK, USB1_OVC_MARK,
+};
+
+/* - USB30 ------------------------------------------------------------------ */
+static const unsigned int usb30_pins[] = {
+       /* PWEN, OVC */
+       RCAR_GP_PIN(6, 28), RCAR_GP_PIN(6, 29),
+};
+
+static const unsigned int usb30_mux[] = {
+       USB30_PWEN_MARK, USB30_OVC_MARK,
+};
+
+/* - VIN4 ------------------------------------------------------------------- */
+static const unsigned int vin4_data18_a_pins[] = {
+       RCAR_GP_PIN(0, 10), RCAR_GP_PIN(0, 11),
+       RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
+       RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 15),
+       RCAR_GP_PIN(1, 2),  RCAR_GP_PIN(1, 3),
+       RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
+       RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
+       RCAR_GP_PIN(0, 2),  RCAR_GP_PIN(0, 3),
+       RCAR_GP_PIN(0, 4),  RCAR_GP_PIN(0, 5),
+       RCAR_GP_PIN(0, 6),  RCAR_GP_PIN(0, 7),
+};
+
+static const unsigned int vin4_data18_a_mux[] = {
+       VI4_DATA2_A_MARK, VI4_DATA3_A_MARK,
+       VI4_DATA4_A_MARK, VI4_DATA5_A_MARK,
+       VI4_DATA6_A_MARK, VI4_DATA7_A_MARK,
+       VI4_DATA10_MARK,  VI4_DATA11_MARK,
+       VI4_DATA12_MARK,  VI4_DATA13_MARK,
+       VI4_DATA14_MARK,  VI4_DATA15_MARK,
+       VI4_DATA18_MARK,  VI4_DATA19_MARK,
+       VI4_DATA20_MARK,  VI4_DATA21_MARK,
+       VI4_DATA22_MARK,  VI4_DATA23_MARK,
+};
+
+static const union vin_data vin4_data_a_pins = {
+       .data24 = {
+               RCAR_GP_PIN(0, 8),  RCAR_GP_PIN(0, 9),
+               RCAR_GP_PIN(0, 10), RCAR_GP_PIN(0, 11),
+               RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
+               RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 15),
+               RCAR_GP_PIN(1, 0),  RCAR_GP_PIN(1, 1),
+               RCAR_GP_PIN(1, 2),  RCAR_GP_PIN(1, 3),
+               RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
+               RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
+               RCAR_GP_PIN(0, 0),  RCAR_GP_PIN(0, 1),
+               RCAR_GP_PIN(0, 2),  RCAR_GP_PIN(0, 3),
+               RCAR_GP_PIN(0, 4),  RCAR_GP_PIN(0, 5),
+               RCAR_GP_PIN(0, 6),  RCAR_GP_PIN(0, 7),
+       },
+};
+
+static const union vin_data vin4_data_a_mux = {
+       .data24 = {
+               VI4_DATA0_A_MARK, VI4_DATA1_A_MARK,
+               VI4_DATA2_A_MARK, VI4_DATA3_A_MARK,
+               VI4_DATA4_A_MARK, VI4_DATA5_A_MARK,
+               VI4_DATA6_A_MARK, VI4_DATA7_A_MARK,
+               VI4_DATA8_MARK,   VI4_DATA9_MARK,
+               VI4_DATA10_MARK,  VI4_DATA11_MARK,
+               VI4_DATA12_MARK,  VI4_DATA13_MARK,
+               VI4_DATA14_MARK,  VI4_DATA15_MARK,
+               VI4_DATA16_MARK,  VI4_DATA17_MARK,
+               VI4_DATA18_MARK,  VI4_DATA19_MARK,
+               VI4_DATA20_MARK,  VI4_DATA21_MARK,
+               VI4_DATA22_MARK,  VI4_DATA23_MARK,
+       },
+};
+
+static const unsigned int vin4_data18_b_pins[] = {
+       RCAR_GP_PIN(2, 2), RCAR_GP_PIN(2, 3),
+       RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
+       RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
+       RCAR_GP_PIN(1, 2), RCAR_GP_PIN(1, 3),
+       RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5),
+       RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7),
+       RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
+       RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
+       RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
+};
+
+static const unsigned int vin4_data18_b_mux[] = {
+       VI4_DATA2_B_MARK, VI4_DATA3_B_MARK,
+       VI4_DATA4_B_MARK, VI4_DATA5_B_MARK,
+       VI4_DATA6_B_MARK, VI4_DATA7_B_MARK,
+       VI4_DATA10_MARK,  VI4_DATA11_MARK,
+       VI4_DATA12_MARK,  VI4_DATA13_MARK,
+       VI4_DATA14_MARK,  VI4_DATA15_MARK,
+       VI4_DATA18_MARK,  VI4_DATA19_MARK,
+       VI4_DATA20_MARK,  VI4_DATA21_MARK,
+       VI4_DATA22_MARK,  VI4_DATA23_MARK,
+};
+
+static const union vin_data vin4_data_b_pins = {
+       .data24 = {
+               RCAR_GP_PIN(2, 0), RCAR_GP_PIN(2, 1),
+               RCAR_GP_PIN(2, 2), RCAR_GP_PIN(2, 3),
+               RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
+               RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
+               RCAR_GP_PIN(1, 0), RCAR_GP_PIN(1, 1),
+               RCAR_GP_PIN(1, 2), RCAR_GP_PIN(1, 3),
+               RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 5),
+               RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7),
+               RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1),
+               RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
+               RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
+               RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
+       },
+};
+
+static const union vin_data vin4_data_b_mux = {
+       .data24 = {
+               VI4_DATA0_B_MARK, VI4_DATA1_B_MARK,
+               VI4_DATA2_B_MARK, VI4_DATA3_B_MARK,
+               VI4_DATA4_B_MARK, VI4_DATA5_B_MARK,
+               VI4_DATA6_B_MARK, VI4_DATA7_B_MARK,
+               VI4_DATA8_MARK,   VI4_DATA9_MARK,
+               VI4_DATA10_MARK,  VI4_DATA11_MARK,
+               VI4_DATA12_MARK,  VI4_DATA13_MARK,
+               VI4_DATA14_MARK,  VI4_DATA15_MARK,
+               VI4_DATA16_MARK,  VI4_DATA17_MARK,
+               VI4_DATA18_MARK,  VI4_DATA19_MARK,
+               VI4_DATA20_MARK,  VI4_DATA21_MARK,
+               VI4_DATA22_MARK,  VI4_DATA23_MARK,
+       },
+};
+
+static const unsigned int vin4_sync_pins[] = {
+       /* VSYNC_N, HSYNC_N */
+       RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
+};
+
+static const unsigned int vin4_sync_mux[] = {
+       VI4_HSYNC_N_MARK, VI4_VSYNC_N_MARK,
+};
+
+static const unsigned int vin4_field_pins[] = {
+       RCAR_GP_PIN(1, 16),
+};
+
+static const unsigned int vin4_field_mux[] = {
+       VI4_FIELD_MARK,
+};
+
+static const unsigned int vin4_clkenb_pins[] = {
+       RCAR_GP_PIN(1, 19),
+};
+
+static const unsigned int vin4_clkenb_mux[] = {
+       VI4_CLKENB_MARK,
+};
+
+static const unsigned int vin4_clk_pins[] = {
+       RCAR_GP_PIN(1, 27),
+};
+
+static const unsigned int vin4_clk_mux[] = {
+       VI4_CLK_MARK,
+};
+
+/* - VIN5 ------------------------------------------------------------------- */
+static const union vin_data16 vin5_data_pins = {
+       .data16 = {
+               RCAR_GP_PIN(0, 0), RCAR_GP_PIN(0, 1),
+               RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
+               RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 5),
+               RCAR_GP_PIN(0, 6), RCAR_GP_PIN(0, 7),
+               RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
+               RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 15),
+               RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
+               RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
+       },
+};
+
+static const union vin_data16 vin5_data_mux = {
+       .data16 = {
+               VI5_DATA0_MARK, VI5_DATA1_MARK,
+               VI5_DATA2_MARK, VI5_DATA3_MARK,
+               VI5_DATA4_MARK, VI5_DATA5_MARK,
+               VI5_DATA6_MARK, VI5_DATA7_MARK,
+               VI5_DATA8_MARK,  VI5_DATA9_MARK,
+               VI5_DATA10_MARK, VI5_DATA11_MARK,
+               VI5_DATA12_MARK, VI5_DATA13_MARK,
+               VI5_DATA14_MARK, VI5_DATA15_MARK,
+       },
+};
+
+static const unsigned int vin5_sync_pins[] = {
+       /* VSYNC_N, HSYNC_N */
+       RCAR_GP_PIN(1, 9), RCAR_GP_PIN(1, 10),
+};
+
+static const unsigned int vin5_sync_mux[] = {
+       VI5_HSYNC_N_MARK, VI5_VSYNC_N_MARK,
+};
+
+static const unsigned int vin5_field_pins[] = {
+       RCAR_GP_PIN(1, 11),
+};
+
+static const unsigned int vin5_field_mux[] = {
+       VI5_FIELD_MARK,
+};
+
+static const unsigned int vin5_clkenb_pins[] = {
+       RCAR_GP_PIN(1, 20),
+};
+
+static const unsigned int vin5_clkenb_mux[] = {
+       VI5_CLKENB_MARK,
+};
+
+static const unsigned int vin5_clk_pins[] = {
+       RCAR_GP_PIN(1, 21),
+};
+
+static const unsigned int vin5_clk_mux[] = {
+       VI5_CLK_MARK,
+};
+
+static const struct sh_pfc_pin_group pinmux_groups[] = {
+       SH_PFC_PIN_GROUP(audio_clk_a_a),
+       SH_PFC_PIN_GROUP(audio_clk_a_b),
+       SH_PFC_PIN_GROUP(audio_clk_a_c),
+       SH_PFC_PIN_GROUP(audio_clk_b_a),
+       SH_PFC_PIN_GROUP(audio_clk_b_b),
+       SH_PFC_PIN_GROUP(audio_clk_c_a),
+       SH_PFC_PIN_GROUP(audio_clk_c_b),
+       SH_PFC_PIN_GROUP(audio_clkout_a),
+       SH_PFC_PIN_GROUP(audio_clkout_b),
+       SH_PFC_PIN_GROUP(audio_clkout_c),
+       SH_PFC_PIN_GROUP(audio_clkout_d),
+       SH_PFC_PIN_GROUP(audio_clkout1_a),
+       SH_PFC_PIN_GROUP(audio_clkout1_b),
+       SH_PFC_PIN_GROUP(audio_clkout2_a),
+       SH_PFC_PIN_GROUP(audio_clkout2_b),
+       SH_PFC_PIN_GROUP(audio_clkout3_a),
+       SH_PFC_PIN_GROUP(audio_clkout3_b),
+       SH_PFC_PIN_GROUP(avb_link),
+       SH_PFC_PIN_GROUP(avb_magic),
+       SH_PFC_PIN_GROUP(avb_phy_int),
+       SH_PFC_PIN_GROUP_ALIAS(avb_mdc, avb_mdio),      /* Deprecated */
+       SH_PFC_PIN_GROUP(avb_mdio),
+       SH_PFC_PIN_GROUP(avb_mii),
+       SH_PFC_PIN_GROUP(avb_avtp_pps),
+       SH_PFC_PIN_GROUP(avb_avtp_match_a),
+       SH_PFC_PIN_GROUP(avb_avtp_capture_a),
+       SH_PFC_PIN_GROUP(avb_avtp_match_b),
+       SH_PFC_PIN_GROUP(avb_avtp_capture_b),
+       SH_PFC_PIN_GROUP(can0_data_a),
+       SH_PFC_PIN_GROUP(can0_data_b),
+       SH_PFC_PIN_GROUP(can1_data),
+       SH_PFC_PIN_GROUP(can_clk),
+       SH_PFC_PIN_GROUP(canfd0_data_a),
+       SH_PFC_PIN_GROUP(canfd0_data_b),
+       SH_PFC_PIN_GROUP(canfd1_data),
+       SH_PFC_PIN_GROUP(drif0_ctrl_a),
+       SH_PFC_PIN_GROUP(drif0_data0_a),
+       SH_PFC_PIN_GROUP(drif0_data1_a),
+       SH_PFC_PIN_GROUP(drif0_ctrl_b),
+       SH_PFC_PIN_GROUP(drif0_data0_b),
+       SH_PFC_PIN_GROUP(drif0_data1_b),
+       SH_PFC_PIN_GROUP(drif0_ctrl_c),
+       SH_PFC_PIN_GROUP(drif0_data0_c),
+       SH_PFC_PIN_GROUP(drif0_data1_c),
+       SH_PFC_PIN_GROUP(drif1_ctrl_a),
+       SH_PFC_PIN_GROUP(drif1_data0_a),
+       SH_PFC_PIN_GROUP(drif1_data1_a),
+       SH_PFC_PIN_GROUP(drif1_ctrl_b),
+       SH_PFC_PIN_GROUP(drif1_data0_b),
+       SH_PFC_PIN_GROUP(drif1_data1_b),
+       SH_PFC_PIN_GROUP(drif1_ctrl_c),
+       SH_PFC_PIN_GROUP(drif1_data0_c),
+       SH_PFC_PIN_GROUP(drif1_data1_c),
+       SH_PFC_PIN_GROUP(drif2_ctrl_a),
+       SH_PFC_PIN_GROUP(drif2_data0_a),
+       SH_PFC_PIN_GROUP(drif2_data1_a),
+       SH_PFC_PIN_GROUP(drif2_ctrl_b),
+       SH_PFC_PIN_GROUP(drif2_data0_b),
+       SH_PFC_PIN_GROUP(drif2_data1_b),
+       SH_PFC_PIN_GROUP(drif3_ctrl_a),
+       SH_PFC_PIN_GROUP(drif3_data0_a),
+       SH_PFC_PIN_GROUP(drif3_data1_a),
+       SH_PFC_PIN_GROUP(drif3_ctrl_b),
+       SH_PFC_PIN_GROUP(drif3_data0_b),
+       SH_PFC_PIN_GROUP(drif3_data1_b),
+       SH_PFC_PIN_GROUP(du_rgb666),
+       SH_PFC_PIN_GROUP(du_rgb888),
+       SH_PFC_PIN_GROUP(du_clk_out_0),
+       SH_PFC_PIN_GROUP(du_clk_out_1),
+       SH_PFC_PIN_GROUP(du_sync),
+       SH_PFC_PIN_GROUP(du_oddf),
+       SH_PFC_PIN_GROUP(du_cde),
+       SH_PFC_PIN_GROUP(du_disp),
+       SH_PFC_PIN_GROUP(hscif0_data),
+       SH_PFC_PIN_GROUP(hscif0_clk),
+       SH_PFC_PIN_GROUP(hscif0_ctrl),
+       SH_PFC_PIN_GROUP(hscif1_data_a),
+       SH_PFC_PIN_GROUP(hscif1_clk_a),
+       SH_PFC_PIN_GROUP(hscif1_ctrl_a),
+       SH_PFC_PIN_GROUP(hscif1_data_b),
+       SH_PFC_PIN_GROUP(hscif1_clk_b),
+       SH_PFC_PIN_GROUP(hscif1_ctrl_b),
+       SH_PFC_PIN_GROUP(hscif2_data_a),
+       SH_PFC_PIN_GROUP(hscif2_clk_a),
+       SH_PFC_PIN_GROUP(hscif2_ctrl_a),
+       SH_PFC_PIN_GROUP(hscif2_data_b),
+       SH_PFC_PIN_GROUP(hscif2_clk_b),
+       SH_PFC_PIN_GROUP(hscif2_ctrl_b),
+       SH_PFC_PIN_GROUP(hscif2_data_c),
+       SH_PFC_PIN_GROUP(hscif2_clk_c),
+       SH_PFC_PIN_GROUP(hscif2_ctrl_c),
+       SH_PFC_PIN_GROUP(hscif3_data_a),
+       SH_PFC_PIN_GROUP(hscif3_clk),
+       SH_PFC_PIN_GROUP(hscif3_ctrl),
+       SH_PFC_PIN_GROUP(hscif3_data_b),
+       SH_PFC_PIN_GROUP(hscif3_data_c),
+       SH_PFC_PIN_GROUP(hscif3_data_d),
+       SH_PFC_PIN_GROUP(hscif4_data_a),
+       SH_PFC_PIN_GROUP(hscif4_clk),
+       SH_PFC_PIN_GROUP(hscif4_ctrl),
+       SH_PFC_PIN_GROUP(hscif4_data_b),
+       SH_PFC_PIN_GROUP(i2c1_a),
+       SH_PFC_PIN_GROUP(i2c1_b),
+       SH_PFC_PIN_GROUP(i2c2_a),
+       SH_PFC_PIN_GROUP(i2c2_b),
+       SH_PFC_PIN_GROUP(i2c6_a),
+       SH_PFC_PIN_GROUP(i2c6_b),
+       SH_PFC_PIN_GROUP(i2c6_c),
+       SH_PFC_PIN_GROUP(intc_ex_irq0),
+       SH_PFC_PIN_GROUP(intc_ex_irq1),
+       SH_PFC_PIN_GROUP(intc_ex_irq2),
+       SH_PFC_PIN_GROUP(intc_ex_irq3),
+       SH_PFC_PIN_GROUP(intc_ex_irq4),
+       SH_PFC_PIN_GROUP(intc_ex_irq5),
+       SH_PFC_PIN_GROUP(msiof0_clk),
+       SH_PFC_PIN_GROUP(msiof0_sync),
+       SH_PFC_PIN_GROUP(msiof0_ss1),
+       SH_PFC_PIN_GROUP(msiof0_ss2),
+       SH_PFC_PIN_GROUP(msiof0_txd),
+       SH_PFC_PIN_GROUP(msiof0_rxd),
+       SH_PFC_PIN_GROUP(msiof1_clk_a),
+       SH_PFC_PIN_GROUP(msiof1_sync_a),
+       SH_PFC_PIN_GROUP(msiof1_ss1_a),
+       SH_PFC_PIN_GROUP(msiof1_ss2_a),
+       SH_PFC_PIN_GROUP(msiof1_txd_a),
+       SH_PFC_PIN_GROUP(msiof1_rxd_a),
+       SH_PFC_PIN_GROUP(msiof1_clk_b),
+       SH_PFC_PIN_GROUP(msiof1_sync_b),
+       SH_PFC_PIN_GROUP(msiof1_ss1_b),
+       SH_PFC_PIN_GROUP(msiof1_ss2_b),
+       SH_PFC_PIN_GROUP(msiof1_txd_b),
+       SH_PFC_PIN_GROUP(msiof1_rxd_b),
+       SH_PFC_PIN_GROUP(msiof1_clk_c),
+       SH_PFC_PIN_GROUP(msiof1_sync_c),
+       SH_PFC_PIN_GROUP(msiof1_ss1_c),
+       SH_PFC_PIN_GROUP(msiof1_ss2_c),
+       SH_PFC_PIN_GROUP(msiof1_txd_c),
+       SH_PFC_PIN_GROUP(msiof1_rxd_c),
+       SH_PFC_PIN_GROUP(msiof1_clk_d),
+       SH_PFC_PIN_GROUP(msiof1_sync_d),
+       SH_PFC_PIN_GROUP(msiof1_ss1_d),
+       SH_PFC_PIN_GROUP(msiof1_ss2_d),
+       SH_PFC_PIN_GROUP(msiof1_txd_d),
+       SH_PFC_PIN_GROUP(msiof1_rxd_d),
+       SH_PFC_PIN_GROUP(msiof1_clk_e),
+       SH_PFC_PIN_GROUP(msiof1_sync_e),
+       SH_PFC_PIN_GROUP(msiof1_ss1_e),
+       SH_PFC_PIN_GROUP(msiof1_ss2_e),
+       SH_PFC_PIN_GROUP(msiof1_txd_e),
+       SH_PFC_PIN_GROUP(msiof1_rxd_e),
+       SH_PFC_PIN_GROUP(msiof1_clk_f),
+       SH_PFC_PIN_GROUP(msiof1_sync_f),
+       SH_PFC_PIN_GROUP(msiof1_ss1_f),
+       SH_PFC_PIN_GROUP(msiof1_ss2_f),
+       SH_PFC_PIN_GROUP(msiof1_txd_f),
+       SH_PFC_PIN_GROUP(msiof1_rxd_f),
+       SH_PFC_PIN_GROUP(msiof1_clk_g),
+       SH_PFC_PIN_GROUP(msiof1_sync_g),
+       SH_PFC_PIN_GROUP(msiof1_ss1_g),
+       SH_PFC_PIN_GROUP(msiof1_ss2_g),
+       SH_PFC_PIN_GROUP(msiof1_txd_g),
+       SH_PFC_PIN_GROUP(msiof1_rxd_g),
+       SH_PFC_PIN_GROUP(msiof2_clk_a),
+       SH_PFC_PIN_GROUP(msiof2_sync_a),
+       SH_PFC_PIN_GROUP(msiof2_ss1_a),
+       SH_PFC_PIN_GROUP(msiof2_ss2_a),
+       SH_PFC_PIN_GROUP(msiof2_txd_a),
+       SH_PFC_PIN_GROUP(msiof2_rxd_a),
+       SH_PFC_PIN_GROUP(msiof2_clk_b),
+       SH_PFC_PIN_GROUP(msiof2_sync_b),
+       SH_PFC_PIN_GROUP(msiof2_ss1_b),
+       SH_PFC_PIN_GROUP(msiof2_ss2_b),
+       SH_PFC_PIN_GROUP(msiof2_txd_b),
+       SH_PFC_PIN_GROUP(msiof2_rxd_b),
+       SH_PFC_PIN_GROUP(msiof2_clk_c),
+       SH_PFC_PIN_GROUP(msiof2_sync_c),
+       SH_PFC_PIN_GROUP(msiof2_ss1_c),
+       SH_PFC_PIN_GROUP(msiof2_ss2_c),
+       SH_PFC_PIN_GROUP(msiof2_txd_c),
+       SH_PFC_PIN_GROUP(msiof2_rxd_c),
+       SH_PFC_PIN_GROUP(msiof2_clk_d),
+       SH_PFC_PIN_GROUP(msiof2_sync_d),
+       SH_PFC_PIN_GROUP(msiof2_ss1_d),
+       SH_PFC_PIN_GROUP(msiof2_ss2_d),
+       SH_PFC_PIN_GROUP(msiof2_txd_d),
+       SH_PFC_PIN_GROUP(msiof2_rxd_d),
+       SH_PFC_PIN_GROUP(msiof3_clk_a),
+       SH_PFC_PIN_GROUP(msiof3_sync_a),
+       SH_PFC_PIN_GROUP(msiof3_ss1_a),
+       SH_PFC_PIN_GROUP(msiof3_ss2_a),
+       SH_PFC_PIN_GROUP(msiof3_txd_a),
+       SH_PFC_PIN_GROUP(msiof3_rxd_a),
+       SH_PFC_PIN_GROUP(msiof3_clk_b),
+       SH_PFC_PIN_GROUP(msiof3_sync_b),
+       SH_PFC_PIN_GROUP(msiof3_ss1_b),
+       SH_PFC_PIN_GROUP(msiof3_ss2_b),
+       SH_PFC_PIN_GROUP(msiof3_txd_b),
+       SH_PFC_PIN_GROUP(msiof3_rxd_b),
+       SH_PFC_PIN_GROUP(msiof3_clk_c),
+       SH_PFC_PIN_GROUP(msiof3_sync_c),
+       SH_PFC_PIN_GROUP(msiof3_txd_c),
+       SH_PFC_PIN_GROUP(msiof3_rxd_c),
+       SH_PFC_PIN_GROUP(msiof3_clk_d),
+       SH_PFC_PIN_GROUP(msiof3_sync_d),
+       SH_PFC_PIN_GROUP(msiof3_ss1_d),
+       SH_PFC_PIN_GROUP(msiof3_txd_d),
+       SH_PFC_PIN_GROUP(msiof3_rxd_d),
+       SH_PFC_PIN_GROUP(msiof3_clk_e),
+       SH_PFC_PIN_GROUP(msiof3_sync_e),
+       SH_PFC_PIN_GROUP(msiof3_ss1_e),
+       SH_PFC_PIN_GROUP(msiof3_ss2_e),
+       SH_PFC_PIN_GROUP(msiof3_txd_e),
+       SH_PFC_PIN_GROUP(msiof3_rxd_e),
+       SH_PFC_PIN_GROUP(pwm0),
+       SH_PFC_PIN_GROUP(pwm1_a),
+       SH_PFC_PIN_GROUP(pwm1_b),
+       SH_PFC_PIN_GROUP(pwm2_a),
+       SH_PFC_PIN_GROUP(pwm2_b),
+       SH_PFC_PIN_GROUP(pwm3_a),
+       SH_PFC_PIN_GROUP(pwm3_b),
+       SH_PFC_PIN_GROUP(pwm4_a),
+       SH_PFC_PIN_GROUP(pwm4_b),
+       SH_PFC_PIN_GROUP(pwm5_a),
+       SH_PFC_PIN_GROUP(pwm5_b),
+       SH_PFC_PIN_GROUP(pwm6_a),
+       SH_PFC_PIN_GROUP(pwm6_b),
+       SH_PFC_PIN_GROUP(sata0_devslp_a),
+       SH_PFC_PIN_GROUP(sata0_devslp_b),
+       SH_PFC_PIN_GROUP(scif0_data),
+       SH_PFC_PIN_GROUP(scif0_clk),
+       SH_PFC_PIN_GROUP(scif0_ctrl),
+       SH_PFC_PIN_GROUP(scif1_data_a),
+       SH_PFC_PIN_GROUP(scif1_clk),
+       SH_PFC_PIN_GROUP(scif1_ctrl),
+       SH_PFC_PIN_GROUP(scif1_data_b),
+       SH_PFC_PIN_GROUP(scif2_data_a),
+       SH_PFC_PIN_GROUP(scif2_clk),
+       SH_PFC_PIN_GROUP(scif2_data_b),
+       SH_PFC_PIN_GROUP(scif3_data_a),
+       SH_PFC_PIN_GROUP(scif3_clk),
+       SH_PFC_PIN_GROUP(scif3_ctrl),
+       SH_PFC_PIN_GROUP(scif3_data_b),
+       SH_PFC_PIN_GROUP(scif4_data_a),
+       SH_PFC_PIN_GROUP(scif4_clk_a),
+       SH_PFC_PIN_GROUP(scif4_ctrl_a),
+       SH_PFC_PIN_GROUP(scif4_data_b),
+       SH_PFC_PIN_GROUP(scif4_clk_b),
+       SH_PFC_PIN_GROUP(scif4_ctrl_b),
+       SH_PFC_PIN_GROUP(scif4_data_c),
+       SH_PFC_PIN_GROUP(scif4_clk_c),
+       SH_PFC_PIN_GROUP(scif4_ctrl_c),
+       SH_PFC_PIN_GROUP(scif5_data_a),
+       SH_PFC_PIN_GROUP(scif5_clk_a),
+       SH_PFC_PIN_GROUP(scif5_data_b),
+       SH_PFC_PIN_GROUP(scif5_clk_b),
+       SH_PFC_PIN_GROUP(scif_clk_a),
+       SH_PFC_PIN_GROUP(scif_clk_b),
+       SH_PFC_PIN_GROUP(sdhi0_data1),
+       SH_PFC_PIN_GROUP(sdhi0_data4),
+       SH_PFC_PIN_GROUP(sdhi0_ctrl),
+       SH_PFC_PIN_GROUP(sdhi0_cd),
+       SH_PFC_PIN_GROUP(sdhi0_wp),
+       SH_PFC_PIN_GROUP(sdhi1_data1),
+       SH_PFC_PIN_GROUP(sdhi1_data4),
+       SH_PFC_PIN_GROUP(sdhi1_ctrl),
+       SH_PFC_PIN_GROUP(sdhi1_cd),
+       SH_PFC_PIN_GROUP(sdhi1_wp),
+       SH_PFC_PIN_GROUP(sdhi2_data1),
+       SH_PFC_PIN_GROUP(sdhi2_data4),
+       SH_PFC_PIN_GROUP(sdhi2_data8),
+       SH_PFC_PIN_GROUP(sdhi2_ctrl),
+       SH_PFC_PIN_GROUP(sdhi2_cd_a),
+       SH_PFC_PIN_GROUP(sdhi2_wp_a),
+       SH_PFC_PIN_GROUP(sdhi2_cd_b),
+       SH_PFC_PIN_GROUP(sdhi2_wp_b),
+       SH_PFC_PIN_GROUP(sdhi2_ds),
+       SH_PFC_PIN_GROUP(sdhi3_data1),
+       SH_PFC_PIN_GROUP(sdhi3_data4),
+       SH_PFC_PIN_GROUP(sdhi3_data8),
+       SH_PFC_PIN_GROUP(sdhi3_ctrl),
+       SH_PFC_PIN_GROUP(sdhi3_cd),
+       SH_PFC_PIN_GROUP(sdhi3_wp),
+       SH_PFC_PIN_GROUP(sdhi3_ds),
+       SH_PFC_PIN_GROUP(ssi0_data),
+       SH_PFC_PIN_GROUP(ssi01239_ctrl),
+       SH_PFC_PIN_GROUP(ssi1_data_a),
+       SH_PFC_PIN_GROUP(ssi1_data_b),
+       SH_PFC_PIN_GROUP(ssi1_ctrl_a),
+       SH_PFC_PIN_GROUP(ssi1_ctrl_b),
+       SH_PFC_PIN_GROUP(ssi2_data_a),
+       SH_PFC_PIN_GROUP(ssi2_data_b),
+       SH_PFC_PIN_GROUP(ssi2_ctrl_a),
+       SH_PFC_PIN_GROUP(ssi2_ctrl_b),
+       SH_PFC_PIN_GROUP(ssi3_data),
+       SH_PFC_PIN_GROUP(ssi349_ctrl),
+       SH_PFC_PIN_GROUP(ssi4_data),
+       SH_PFC_PIN_GROUP(ssi4_ctrl),
+       SH_PFC_PIN_GROUP(ssi5_data),
+       SH_PFC_PIN_GROUP(ssi5_ctrl),
+       SH_PFC_PIN_GROUP(ssi6_data),
+       SH_PFC_PIN_GROUP(ssi6_ctrl),
+       SH_PFC_PIN_GROUP(ssi7_data),
+       SH_PFC_PIN_GROUP(ssi78_ctrl),
+       SH_PFC_PIN_GROUP(ssi8_data),
+       SH_PFC_PIN_GROUP(ssi9_data_a),
+       SH_PFC_PIN_GROUP(ssi9_data_b),
+       SH_PFC_PIN_GROUP(ssi9_ctrl_a),
+       SH_PFC_PIN_GROUP(ssi9_ctrl_b),
+       SH_PFC_PIN_GROUP(tmu_tclk1_a),
+       SH_PFC_PIN_GROUP(tmu_tclk1_b),
+       SH_PFC_PIN_GROUP(tmu_tclk2_a),
+       SH_PFC_PIN_GROUP(tmu_tclk2_b),
+       SH_PFC_PIN_GROUP(usb0),
+       SH_PFC_PIN_GROUP(usb1),
+       SH_PFC_PIN_GROUP(usb30),
+       VIN_DATA_PIN_GROUP(vin4_data, 8, _a),
+       VIN_DATA_PIN_GROUP(vin4_data, 10, _a),
+       VIN_DATA_PIN_GROUP(vin4_data, 12, _a),
+       VIN_DATA_PIN_GROUP(vin4_data, 16, _a),
+       SH_PFC_PIN_GROUP(vin4_data18_a),
+       VIN_DATA_PIN_GROUP(vin4_data, 20, _a),
+       VIN_DATA_PIN_GROUP(vin4_data, 24, _a),
+       VIN_DATA_PIN_GROUP(vin4_data, 8, _b),
+       VIN_DATA_PIN_GROUP(vin4_data, 10, _b),
+       VIN_DATA_PIN_GROUP(vin4_data, 12, _b),
+       VIN_DATA_PIN_GROUP(vin4_data, 16, _b),
+       SH_PFC_PIN_GROUP(vin4_data18_b),
+       VIN_DATA_PIN_GROUP(vin4_data, 20, _b),
+       VIN_DATA_PIN_GROUP(vin4_data, 24, _b),
+       SH_PFC_PIN_GROUP(vin4_sync),
+       SH_PFC_PIN_GROUP(vin4_field),
+       SH_PFC_PIN_GROUP(vin4_clkenb),
+       SH_PFC_PIN_GROUP(vin4_clk),
+       VIN_DATA_PIN_GROUP(vin5_data, 8),
+       VIN_DATA_PIN_GROUP(vin5_data, 10),
+       VIN_DATA_PIN_GROUP(vin5_data, 12),
+       VIN_DATA_PIN_GROUP(vin5_data, 16),
+       SH_PFC_PIN_GROUP(vin5_sync),
+       SH_PFC_PIN_GROUP(vin5_field),
+       SH_PFC_PIN_GROUP(vin5_clkenb),
+       SH_PFC_PIN_GROUP(vin5_clk),
+};
+
+static const char * const audio_clk_groups[] = {
+       "audio_clk_a_a",
+       "audio_clk_a_b",
+       "audio_clk_a_c",
+       "audio_clk_b_a",
+       "audio_clk_b_b",
+       "audio_clk_c_a",
+       "audio_clk_c_b",
+       "audio_clkout_a",
+       "audio_clkout_b",
+       "audio_clkout_c",
+       "audio_clkout_d",
+       "audio_clkout1_a",
+       "audio_clkout1_b",
+       "audio_clkout2_a",
+       "audio_clkout2_b",
+       "audio_clkout3_a",
+       "audio_clkout3_b",
+};
+
+static const char * const avb_groups[] = {
+       "avb_link",
+       "avb_magic",
+       "avb_phy_int",
+       "avb_mdc",      /* Deprecated, please use "avb_mdio" instead */
+       "avb_mdio",
+       "avb_mii",
+       "avb_avtp_pps",
+       "avb_avtp_match_a",
+       "avb_avtp_capture_a",
+       "avb_avtp_match_b",
+       "avb_avtp_capture_b",
+};
+
+static const char * const can0_groups[] = {
+       "can0_data_a",
+       "can0_data_b",
+};
+
+static const char * const can1_groups[] = {
+       "can1_data",
+};
+
+static const char * const can_clk_groups[] = {
+       "can_clk",
+};
+
+static const char * const canfd0_groups[] = {
+       "canfd0_data_a",
+       "canfd0_data_b",
+};
+
+static const char * const canfd1_groups[] = {
+       "canfd1_data",
+};
+
+static const char * const drif0_groups[] = {
+       "drif0_ctrl_a",
+       "drif0_data0_a",
+       "drif0_data1_a",
+       "drif0_ctrl_b",
+       "drif0_data0_b",
+       "drif0_data1_b",
+       "drif0_ctrl_c",
+       "drif0_data0_c",
+       "drif0_data1_c",
+};
+
+static const char * const drif1_groups[] = {
+       "drif1_ctrl_a",
+       "drif1_data0_a",
+       "drif1_data1_a",
+       "drif1_ctrl_b",
+       "drif1_data0_b",
+       "drif1_data1_b",
+       "drif1_ctrl_c",
+       "drif1_data0_c",
+       "drif1_data1_c",
+};
+
+static const char * const drif2_groups[] = {
+       "drif2_ctrl_a",
+       "drif2_data0_a",
+       "drif2_data1_a",
+       "drif2_ctrl_b",
+       "drif2_data0_b",
+       "drif2_data1_b",
+};
+
+static const char * const drif3_groups[] = {
+       "drif3_ctrl_a",
+       "drif3_data0_a",
+       "drif3_data1_a",
+       "drif3_ctrl_b",
+       "drif3_data0_b",
+       "drif3_data1_b",
+};
+
+static const char * const du_groups[] = {
+       "du_rgb666",
+       "du_rgb888",
+       "du_clk_out_0",
+       "du_clk_out_1",
+       "du_sync",
+       "du_oddf",
+       "du_cde",
+       "du_disp",
+};
+
+static const char * const hscif0_groups[] = {
+       "hscif0_data",
+       "hscif0_clk",
+       "hscif0_ctrl",
+};
+
+static const char * const hscif1_groups[] = {
+       "hscif1_data_a",
+       "hscif1_clk_a",
+       "hscif1_ctrl_a",
+       "hscif1_data_b",
+       "hscif1_clk_b",
+       "hscif1_ctrl_b",
+};
+
+static const char * const hscif2_groups[] = {
+       "hscif2_data_a",
+       "hscif2_clk_a",
+       "hscif2_ctrl_a",
+       "hscif2_data_b",
+       "hscif2_clk_b",
+       "hscif2_ctrl_b",
+       "hscif2_data_c",
+       "hscif2_clk_c",
+       "hscif2_ctrl_c",
+};
+
+static const char * const hscif3_groups[] = {
+       "hscif3_data_a",
+       "hscif3_clk",
+       "hscif3_ctrl",
+       "hscif3_data_b",
+       "hscif3_data_c",
+       "hscif3_data_d",
+};
+
+static const char * const hscif4_groups[] = {
+       "hscif4_data_a",
+       "hscif4_clk",
+       "hscif4_ctrl",
+       "hscif4_data_b",
+};
+
+static const char * const i2c1_groups[] = {
+       "i2c1_a",
+       "i2c1_b",
+};
+
+static const char * const i2c2_groups[] = {
+       "i2c2_a",
+       "i2c2_b",
+};
+
+static const char * const i2c6_groups[] = {
+       "i2c6_a",
+       "i2c6_b",
+       "i2c6_c",
+};
+
+static const char * const intc_ex_groups[] = {
+       "intc_ex_irq0",
+       "intc_ex_irq1",
+       "intc_ex_irq2",
+       "intc_ex_irq3",
+       "intc_ex_irq4",
+       "intc_ex_irq5",
+};
+
+static const char * const msiof0_groups[] = {
+       "msiof0_clk",
+       "msiof0_sync",
+       "msiof0_ss1",
+       "msiof0_ss2",
+       "msiof0_txd",
+       "msiof0_rxd",
+};
+
+static const char * const msiof1_groups[] = {
+       "msiof1_clk_a",
+       "msiof1_sync_a",
+       "msiof1_ss1_a",
+       "msiof1_ss2_a",
+       "msiof1_txd_a",
+       "msiof1_rxd_a",
+       "msiof1_clk_b",
+       "msiof1_sync_b",
+       "msiof1_ss1_b",
+       "msiof1_ss2_b",
+       "msiof1_txd_b",
+       "msiof1_rxd_b",
+       "msiof1_clk_c",
+       "msiof1_sync_c",
+       "msiof1_ss1_c",
+       "msiof1_ss2_c",
+       "msiof1_txd_c",
+       "msiof1_rxd_c",
+       "msiof1_clk_d",
+       "msiof1_sync_d",
+       "msiof1_ss1_d",
+       "msiof1_ss2_d",
+       "msiof1_txd_d",
+       "msiof1_rxd_d",
+       "msiof1_clk_e",
+       "msiof1_sync_e",
+       "msiof1_ss1_e",
+       "msiof1_ss2_e",
+       "msiof1_txd_e",
+       "msiof1_rxd_e",
+       "msiof1_clk_f",
+       "msiof1_sync_f",
+       "msiof1_ss1_f",
+       "msiof1_ss2_f",
+       "msiof1_txd_f",
+       "msiof1_rxd_f",
+       "msiof1_clk_g",
+       "msiof1_sync_g",
+       "msiof1_ss1_g",
+       "msiof1_ss2_g",
+       "msiof1_txd_g",
+       "msiof1_rxd_g",
+};
+
+static const char * const msiof2_groups[] = {
+       "msiof2_clk_a",
+       "msiof2_sync_a",
+       "msiof2_ss1_a",
+       "msiof2_ss2_a",
+       "msiof2_txd_a",
+       "msiof2_rxd_a",
+       "msiof2_clk_b",
+       "msiof2_sync_b",
+       "msiof2_ss1_b",
+       "msiof2_ss2_b",
+       "msiof2_txd_b",
+       "msiof2_rxd_b",
+       "msiof2_clk_c",
+       "msiof2_sync_c",
+       "msiof2_ss1_c",
+       "msiof2_ss2_c",
+       "msiof2_txd_c",
+       "msiof2_rxd_c",
+       "msiof2_clk_d",
+       "msiof2_sync_d",
+       "msiof2_ss1_d",
+       "msiof2_ss2_d",
+       "msiof2_txd_d",
+       "msiof2_rxd_d",
+};
+
+static const char * const msiof3_groups[] = {
+       "msiof3_clk_a",
+       "msiof3_sync_a",
+       "msiof3_ss1_a",
+       "msiof3_ss2_a",
+       "msiof3_txd_a",
+       "msiof3_rxd_a",
+       "msiof3_clk_b",
+       "msiof3_sync_b",
+       "msiof3_ss1_b",
+       "msiof3_ss2_b",
+       "msiof3_txd_b",
+       "msiof3_rxd_b",
+       "msiof3_clk_c",
+       "msiof3_sync_c",
+       "msiof3_txd_c",
+       "msiof3_rxd_c",
+       "msiof3_clk_d",
+       "msiof3_sync_d",
+       "msiof3_ss1_d",
+       "msiof3_txd_d",
+       "msiof3_rxd_d",
+       "msiof3_clk_e",
+       "msiof3_sync_e",
+       "msiof3_ss1_e",
+       "msiof3_ss2_e",
+       "msiof3_txd_e",
+       "msiof3_rxd_e",
+};
+
+static const char * const pwm0_groups[] = {
+       "pwm0",
+};
+
+static const char * const pwm1_groups[] = {
+       "pwm1_a",
+       "pwm1_b",
+};
+
+static const char * const pwm2_groups[] = {
+       "pwm2_a",
+       "pwm2_b",
+};
+
+static const char * const pwm3_groups[] = {
+       "pwm3_a",
+       "pwm3_b",
+};
+
+static const char * const pwm4_groups[] = {
+       "pwm4_a",
+       "pwm4_b",
+};
+
+static const char * const pwm5_groups[] = {
+       "pwm5_a",
+       "pwm5_b",
+};
+
+static const char * const pwm6_groups[] = {
+       "pwm6_a",
+       "pwm6_b",
+};
+
+static const char * const sata0_groups[] = {
+       "sata0_devslp_a",
+       "sata0_devslp_b",
+};
+
+static const char * const scif0_groups[] = {
+       "scif0_data",
+       "scif0_clk",
+       "scif0_ctrl",
+};
+
+static const char * const scif1_groups[] = {
+       "scif1_data_a",
+       "scif1_clk",
+       "scif1_ctrl",
+       "scif1_data_b",
+};
+static const char * const scif2_groups[] = {
+       "scif2_data_a",
+       "scif2_clk",
+       "scif2_data_b",
+};
+
+static const char * const scif3_groups[] = {
+       "scif3_data_a",
+       "scif3_clk",
+       "scif3_ctrl",
+       "scif3_data_b",
+};
+
+static const char * const scif4_groups[] = {
+       "scif4_data_a",
+       "scif4_clk_a",
+       "scif4_ctrl_a",
+       "scif4_data_b",
+       "scif4_clk_b",
+       "scif4_ctrl_b",
+       "scif4_data_c",
+       "scif4_clk_c",
+       "scif4_ctrl_c",
+};
+
+static const char * const scif5_groups[] = {
+       "scif5_data_a",
+       "scif5_clk_a",
+       "scif5_data_b",
+       "scif5_clk_b",
+};
+
+static const char * const scif_clk_groups[] = {
+       "scif_clk_a",
+       "scif_clk_b",
+};
+
+static const char * const sdhi0_groups[] = {
+       "sdhi0_data1",
+       "sdhi0_data4",
+       "sdhi0_ctrl",
+       "sdhi0_cd",
+       "sdhi0_wp",
+};
+
+static const char * const sdhi1_groups[] = {
+       "sdhi1_data1",
+       "sdhi1_data4",
+       "sdhi1_ctrl",
+       "sdhi1_cd",
+       "sdhi1_wp",
+};
+
+static const char * const sdhi2_groups[] = {
+       "sdhi2_data1",
+       "sdhi2_data4",
+       "sdhi2_data8",
+       "sdhi2_ctrl",
+       "sdhi2_cd_a",
+       "sdhi2_wp_a",
+       "sdhi2_cd_b",
+       "sdhi2_wp_b",
+       "sdhi2_ds",
+};
+
+static const char * const sdhi3_groups[] = {
+       "sdhi3_data1",
+       "sdhi3_data4",
+       "sdhi3_data8",
+       "sdhi3_ctrl",
+       "sdhi3_cd",
+       "sdhi3_wp",
+       "sdhi3_ds",
+};
+
+static const char * const ssi_groups[] = {
+       "ssi0_data",
+       "ssi01239_ctrl",
+       "ssi1_data_a",
+       "ssi1_data_b",
+       "ssi1_ctrl_a",
+       "ssi1_ctrl_b",
+       "ssi2_data_a",
+       "ssi2_data_b",
+       "ssi2_ctrl_a",
+       "ssi2_ctrl_b",
+       "ssi3_data",
+       "ssi349_ctrl",
+       "ssi4_data",
+       "ssi4_ctrl",
+       "ssi5_data",
+       "ssi5_ctrl",
+       "ssi6_data",
+       "ssi6_ctrl",
+       "ssi7_data",
+       "ssi78_ctrl",
+       "ssi8_data",
+       "ssi9_data_a",
+       "ssi9_data_b",
+       "ssi9_ctrl_a",
+       "ssi9_ctrl_b",
+};
+
+static const char * const tmu_groups[] = {
+       "tmu_tclk1_a",
+       "tmu_tclk1_b",
+       "tmu_tclk2_a",
+       "tmu_tclk2_b",
+};
+
+static const char * const usb0_groups[] = {
+       "usb0",
+};
+
+static const char * const usb1_groups[] = {
+       "usb1",
+};
+
+static const char * const usb30_groups[] = {
+       "usb30",
+};
+
+static const char * const vin4_groups[] = {
+       "vin4_data8_a",
+       "vin4_data10_a",
+       "vin4_data12_a",
+       "vin4_data16_a",
+       "vin4_data18_a",
+       "vin4_data20_a",
+       "vin4_data24_a",
+       "vin4_data8_b",
+       "vin4_data10_b",
+       "vin4_data12_b",
+       "vin4_data16_b",
+       "vin4_data18_b",
+       "vin4_data20_b",
+       "vin4_data24_b",
+       "vin4_sync",
+       "vin4_field",
+       "vin4_clkenb",
+       "vin4_clk",
+};
+
+static const char * const vin5_groups[] = {
+       "vin5_data8",
+       "vin5_data10",
+       "vin5_data12",
+       "vin5_data16",
+       "vin5_sync",
+       "vin5_field",
+       "vin5_clkenb",
+       "vin5_clk",
+};
+
+static const struct sh_pfc_function pinmux_functions[] = {
+       SH_PFC_FUNCTION(audio_clk),
+       SH_PFC_FUNCTION(avb),
+       SH_PFC_FUNCTION(can0),
+       SH_PFC_FUNCTION(can1),
+       SH_PFC_FUNCTION(can_clk),
+       SH_PFC_FUNCTION(canfd0),
+       SH_PFC_FUNCTION(canfd1),
+       SH_PFC_FUNCTION(drif0),
+       SH_PFC_FUNCTION(drif1),
+       SH_PFC_FUNCTION(drif2),
+       SH_PFC_FUNCTION(drif3),
+       SH_PFC_FUNCTION(du),
+       SH_PFC_FUNCTION(hscif0),
+       SH_PFC_FUNCTION(hscif1),
+       SH_PFC_FUNCTION(hscif2),
+       SH_PFC_FUNCTION(hscif3),
+       SH_PFC_FUNCTION(hscif4),
+       SH_PFC_FUNCTION(i2c1),
+       SH_PFC_FUNCTION(i2c2),
+       SH_PFC_FUNCTION(i2c6),
+       SH_PFC_FUNCTION(intc_ex),
+       SH_PFC_FUNCTION(msiof0),
+       SH_PFC_FUNCTION(msiof1),
+       SH_PFC_FUNCTION(msiof2),
+       SH_PFC_FUNCTION(msiof3),
+       SH_PFC_FUNCTION(pwm0),
+       SH_PFC_FUNCTION(pwm1),
+       SH_PFC_FUNCTION(pwm2),
+       SH_PFC_FUNCTION(pwm3),
+       SH_PFC_FUNCTION(pwm4),
+       SH_PFC_FUNCTION(pwm5),
+       SH_PFC_FUNCTION(pwm6),
+       SH_PFC_FUNCTION(sata0),
+       SH_PFC_FUNCTION(scif0),
+       SH_PFC_FUNCTION(scif1),
+       SH_PFC_FUNCTION(scif2),
+       SH_PFC_FUNCTION(scif3),
+       SH_PFC_FUNCTION(scif4),
+       SH_PFC_FUNCTION(scif5),
+       SH_PFC_FUNCTION(scif_clk),
+       SH_PFC_FUNCTION(sdhi0),
+       SH_PFC_FUNCTION(sdhi1),
+       SH_PFC_FUNCTION(sdhi2),
+       SH_PFC_FUNCTION(sdhi3),
+       SH_PFC_FUNCTION(ssi),
+       SH_PFC_FUNCTION(tmu),
+       SH_PFC_FUNCTION(usb0),
+       SH_PFC_FUNCTION(usb1),
+       SH_PFC_FUNCTION(usb30),
+       SH_PFC_FUNCTION(vin4),
+       SH_PFC_FUNCTION(vin5),
+};
+
+static const struct pinmux_cfg_reg pinmux_config_regs[] = {
+#define F_(x, y)       FN_##y
+#define FM(x)          FN_##x
+       { PINMUX_CFG_REG("GPSR0", 0xe6060100, 32, 1) {
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               GP_0_15_FN,     GPSR0_15,
+               GP_0_14_FN,     GPSR0_14,
+               GP_0_13_FN,     GPSR0_13,
+               GP_0_12_FN,     GPSR0_12,
+               GP_0_11_FN,     GPSR0_11,
+               GP_0_10_FN,     GPSR0_10,
+               GP_0_9_FN,      GPSR0_9,
+               GP_0_8_FN,      GPSR0_8,
+               GP_0_7_FN,      GPSR0_7,
+               GP_0_6_FN,      GPSR0_6,
+               GP_0_5_FN,      GPSR0_5,
+               GP_0_4_FN,      GPSR0_4,
+               GP_0_3_FN,      GPSR0_3,
+               GP_0_2_FN,      GPSR0_2,
+               GP_0_1_FN,      GPSR0_1,
+               GP_0_0_FN,      GPSR0_0, }
+       },
+       { PINMUX_CFG_REG("GPSR1", 0xe6060104, 32, 1) {
+               0, 0,
+               0, 0,
+               0, 0,
+               GP_1_28_FN,     GPSR1_28,
+               GP_1_27_FN,     GPSR1_27,
+               GP_1_26_FN,     GPSR1_26,
+               GP_1_25_FN,     GPSR1_25,
+               GP_1_24_FN,     GPSR1_24,
+               GP_1_23_FN,     GPSR1_23,
+               GP_1_22_FN,     GPSR1_22,
+               GP_1_21_FN,     GPSR1_21,
+               GP_1_20_FN,     GPSR1_20,
+               GP_1_19_FN,     GPSR1_19,
+               GP_1_18_FN,     GPSR1_18,
+               GP_1_17_FN,     GPSR1_17,
+               GP_1_16_FN,     GPSR1_16,
+               GP_1_15_FN,     GPSR1_15,
+               GP_1_14_FN,     GPSR1_14,
+               GP_1_13_FN,     GPSR1_13,
+               GP_1_12_FN,     GPSR1_12,
+               GP_1_11_FN,     GPSR1_11,
+               GP_1_10_FN,     GPSR1_10,
+               GP_1_9_FN,      GPSR1_9,
+               GP_1_8_FN,      GPSR1_8,
+               GP_1_7_FN,      GPSR1_7,
+               GP_1_6_FN,      GPSR1_6,
+               GP_1_5_FN,      GPSR1_5,
+               GP_1_4_FN,      GPSR1_4,
+               GP_1_3_FN,      GPSR1_3,
+               GP_1_2_FN,      GPSR1_2,
+               GP_1_1_FN,      GPSR1_1,
+               GP_1_0_FN,      GPSR1_0, }
+       },
+       { PINMUX_CFG_REG("GPSR2", 0xe6060108, 32, 1) {
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               GP_2_14_FN,     GPSR2_14,
+               GP_2_13_FN,     GPSR2_13,
+               GP_2_12_FN,     GPSR2_12,
+               GP_2_11_FN,     GPSR2_11,
+               GP_2_10_FN,     GPSR2_10,
+               GP_2_9_FN,      GPSR2_9,
+               GP_2_8_FN,      GPSR2_8,
+               GP_2_7_FN,      GPSR2_7,
+               GP_2_6_FN,      GPSR2_6,
+               GP_2_5_FN,      GPSR2_5,
+               GP_2_4_FN,      GPSR2_4,
+               GP_2_3_FN,      GPSR2_3,
+               GP_2_2_FN,      GPSR2_2,
+               GP_2_1_FN,      GPSR2_1,
+               GP_2_0_FN,      GPSR2_0, }
+       },
+       { PINMUX_CFG_REG("GPSR3", 0xe606010c, 32, 1) {
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               GP_3_15_FN,     GPSR3_15,
+               GP_3_14_FN,     GPSR3_14,
+               GP_3_13_FN,     GPSR3_13,
+               GP_3_12_FN,     GPSR3_12,
+               GP_3_11_FN,     GPSR3_11,
+               GP_3_10_FN,     GPSR3_10,
+               GP_3_9_FN,      GPSR3_9,
+               GP_3_8_FN,      GPSR3_8,
+               GP_3_7_FN,      GPSR3_7,
+               GP_3_6_FN,      GPSR3_6,
+               GP_3_5_FN,      GPSR3_5,
+               GP_3_4_FN,      GPSR3_4,
+               GP_3_3_FN,      GPSR3_3,
+               GP_3_2_FN,      GPSR3_2,
+               GP_3_1_FN,      GPSR3_1,
+               GP_3_0_FN,      GPSR3_0, }
+       },
+       { PINMUX_CFG_REG("GPSR4", 0xe6060110, 32, 1) {
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               GP_4_17_FN,     GPSR4_17,
+               GP_4_16_FN,     GPSR4_16,
+               GP_4_15_FN,     GPSR4_15,
+               GP_4_14_FN,     GPSR4_14,
+               GP_4_13_FN,     GPSR4_13,
+               GP_4_12_FN,     GPSR4_12,
+               GP_4_11_FN,     GPSR4_11,
+               GP_4_10_FN,     GPSR4_10,
+               GP_4_9_FN,      GPSR4_9,
+               GP_4_8_FN,      GPSR4_8,
+               GP_4_7_FN,      GPSR4_7,
+               GP_4_6_FN,      GPSR4_6,
+               GP_4_5_FN,      GPSR4_5,
+               GP_4_4_FN,      GPSR4_4,
+               GP_4_3_FN,      GPSR4_3,
+               GP_4_2_FN,      GPSR4_2,
+               GP_4_1_FN,      GPSR4_1,
+               GP_4_0_FN,      GPSR4_0, }
+       },
+       { PINMUX_CFG_REG("GPSR5", 0xe6060114, 32, 1) {
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               GP_5_25_FN,     GPSR5_25,
+               GP_5_24_FN,     GPSR5_24,
+               GP_5_23_FN,     GPSR5_23,
+               GP_5_22_FN,     GPSR5_22,
+               GP_5_21_FN,     GPSR5_21,
+               GP_5_20_FN,     GPSR5_20,
+               GP_5_19_FN,     GPSR5_19,
+               GP_5_18_FN,     GPSR5_18,
+               GP_5_17_FN,     GPSR5_17,
+               GP_5_16_FN,     GPSR5_16,
+               GP_5_15_FN,     GPSR5_15,
+               GP_5_14_FN,     GPSR5_14,
+               GP_5_13_FN,     GPSR5_13,
+               GP_5_12_FN,     GPSR5_12,
+               GP_5_11_FN,     GPSR5_11,
+               GP_5_10_FN,     GPSR5_10,
+               GP_5_9_FN,      GPSR5_9,
+               GP_5_8_FN,      GPSR5_8,
+               GP_5_7_FN,      GPSR5_7,
+               GP_5_6_FN,      GPSR5_6,
+               GP_5_5_FN,      GPSR5_5,
+               GP_5_4_FN,      GPSR5_4,
+               GP_5_3_FN,      GPSR5_3,
+               GP_5_2_FN,      GPSR5_2,
+               GP_5_1_FN,      GPSR5_1,
+               GP_5_0_FN,      GPSR5_0, }
+       },
+       { PINMUX_CFG_REG("GPSR6", 0xe6060118, 32, 1) {
+               GP_6_31_FN,     GPSR6_31,
+               GP_6_30_FN,     GPSR6_30,
+               GP_6_29_FN,     GPSR6_29,
+               GP_6_28_FN,     GPSR6_28,
+               GP_6_27_FN,     GPSR6_27,
+               GP_6_26_FN,     GPSR6_26,
+               GP_6_25_FN,     GPSR6_25,
+               GP_6_24_FN,     GPSR6_24,
+               GP_6_23_FN,     GPSR6_23,
+               GP_6_22_FN,     GPSR6_22,
+               GP_6_21_FN,     GPSR6_21,
+               GP_6_20_FN,     GPSR6_20,
+               GP_6_19_FN,     GPSR6_19,
+               GP_6_18_FN,     GPSR6_18,
+               GP_6_17_FN,     GPSR6_17,
+               GP_6_16_FN,     GPSR6_16,
+               GP_6_15_FN,     GPSR6_15,
+               GP_6_14_FN,     GPSR6_14,
+               GP_6_13_FN,     GPSR6_13,
+               GP_6_12_FN,     GPSR6_12,
+               GP_6_11_FN,     GPSR6_11,
+               GP_6_10_FN,     GPSR6_10,
+               GP_6_9_FN,      GPSR6_9,
+               GP_6_8_FN,      GPSR6_8,
+               GP_6_7_FN,      GPSR6_7,
+               GP_6_6_FN,      GPSR6_6,
+               GP_6_5_FN,      GPSR6_5,
+               GP_6_4_FN,      GPSR6_4,
+               GP_6_3_FN,      GPSR6_3,
+               GP_6_2_FN,      GPSR6_2,
+               GP_6_1_FN,      GPSR6_1,
+               GP_6_0_FN,      GPSR6_0, }
+       },
+       { PINMUX_CFG_REG("GPSR7", 0xe606011c, 32, 1) {
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               0, 0,
+               GP_7_3_FN, GPSR7_3,
+               GP_7_2_FN, GPSR7_2,
+               GP_7_1_FN, GPSR7_1,
+               GP_7_0_FN, GPSR7_0, }
+       },
+#undef F_
+#undef FM
+
+#define F_(x, y)       x,
+#define FM(x)          FN_##x,
+       { PINMUX_CFG_REG("IPSR0", 0xe6060200, 32, 4) {
+               IP0_31_28
+               IP0_27_24
+               IP0_23_20
+               IP0_19_16
+               IP0_15_12
+               IP0_11_8
+               IP0_7_4
+               IP0_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR1", 0xe6060204, 32, 4) {
+               IP1_31_28
+               IP1_27_24
+               IP1_23_20
+               IP1_19_16
+               IP1_15_12
+               IP1_11_8
+               IP1_7_4
+               IP1_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR2", 0xe6060208, 32, 4) {
+               IP2_31_28
+               IP2_27_24
+               IP2_23_20
+               IP2_19_16
+               IP2_15_12
+               IP2_11_8
+               IP2_7_4
+               IP2_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR3", 0xe606020c, 32, 4) {
+               IP3_31_28
+               IP3_27_24
+               IP3_23_20
+               IP3_19_16
+               IP3_15_12
+               IP3_11_8
+               IP3_7_4
+               IP3_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR4", 0xe6060210, 32, 4) {
+               IP4_31_28
+               IP4_27_24
+               IP4_23_20
+               IP4_19_16
+               IP4_15_12
+               IP4_11_8
+               IP4_7_4
+               IP4_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR5", 0xe6060214, 32, 4) {
+               IP5_31_28
+               IP5_27_24
+               IP5_23_20
+               IP5_19_16
+               IP5_15_12
+               IP5_11_8
+               IP5_7_4
+               IP5_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR6", 0xe6060218, 32, 4) {
+               IP6_31_28
+               IP6_27_24
+               IP6_23_20
+               IP6_19_16
+               IP6_15_12
+               IP6_11_8
+               IP6_7_4
+               IP6_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR7", 0xe606021c, 32, 4) {
+               IP7_31_28
+               IP7_27_24
+               IP7_23_20
+               IP7_19_16
+               /* IP7_15_12 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+               IP7_11_8
+               IP7_7_4
+               IP7_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR8", 0xe6060220, 32, 4) {
+               IP8_31_28
+               IP8_27_24
+               IP8_23_20
+               IP8_19_16
+               IP8_15_12
+               IP8_11_8
+               IP8_7_4
+               IP8_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR9", 0xe6060224, 32, 4) {
+               IP9_31_28
+               IP9_27_24
+               IP9_23_20
+               IP9_19_16
+               IP9_15_12
+               IP9_11_8
+               IP9_7_4
+               IP9_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR10", 0xe6060228, 32, 4) {
+               IP10_31_28
+               IP10_27_24
+               IP10_23_20
+               IP10_19_16
+               IP10_15_12
+               IP10_11_8
+               IP10_7_4
+               IP10_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR11", 0xe606022c, 32, 4) {
+               IP11_31_28
+               IP11_27_24
+               IP11_23_20
+               IP11_19_16
+               IP11_15_12
+               IP11_11_8
+               IP11_7_4
+               IP11_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR12", 0xe6060230, 32, 4) {
+               IP12_31_28
+               IP12_27_24
+               IP12_23_20
+               IP12_19_16
+               IP12_15_12
+               IP12_11_8
+               IP12_7_4
+               IP12_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR13", 0xe6060234, 32, 4) {
+               IP13_31_28
+               IP13_27_24
+               IP13_23_20
+               IP13_19_16
+               IP13_15_12
+               IP13_11_8
+               IP13_7_4
+               IP13_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR14", 0xe6060238, 32, 4) {
+               IP14_31_28
+               IP14_27_24
+               IP14_23_20
+               IP14_19_16
+               IP14_15_12
+               IP14_11_8
+               IP14_7_4
+               IP14_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR15", 0xe606023c, 32, 4) {
+               IP15_31_28
+               IP15_27_24
+               IP15_23_20
+               IP15_19_16
+               IP15_15_12
+               IP15_11_8
+               IP15_7_4
+               IP15_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR16", 0xe6060240, 32, 4) {
+               IP16_31_28
+               IP16_27_24
+               IP16_23_20
+               IP16_19_16
+               IP16_15_12
+               IP16_11_8
+               IP16_7_4
+               IP16_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR17", 0xe6060244, 32, 4) {
+               IP17_31_28
+               IP17_27_24
+               IP17_23_20
+               IP17_19_16
+               IP17_15_12
+               IP17_11_8
+               IP17_7_4
+               IP17_3_0 }
+       },
+       { PINMUX_CFG_REG("IPSR18", 0xe6060248, 32, 4) {
+               /* IP18_31_28 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+               /* IP18_27_24 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+               /* IP18_23_20 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+               /* IP18_19_16 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+               /* IP18_15_12 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+               /* IP18_11_8  */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+               IP18_7_4
+               IP18_3_0 }
+       },
+#undef F_
+#undef FM
+
+#define F_(x, y)       x,
+#define FM(x)          FN_##x,
+       { PINMUX_CFG_REG_VAR("MOD_SEL0", 0xe6060500, 32,
+                            3, 2, 3, 1, 1, 1, 1, 1, 2, 1,
+                            1, 2, 1, 1, 1, 2, 2, 1, 2, 3) {
+               MOD_SEL0_31_30_29
+               MOD_SEL0_28_27
+               MOD_SEL0_26_25_24
+               MOD_SEL0_23
+               MOD_SEL0_22
+               MOD_SEL0_21
+               MOD_SEL0_20
+               MOD_SEL0_19
+               MOD_SEL0_18_17
+               MOD_SEL0_16
+               0, 0, /* RESERVED 15 */
+               MOD_SEL0_14_13
+               MOD_SEL0_12
+               MOD_SEL0_11
+               MOD_SEL0_10
+               MOD_SEL0_9_8
+               MOD_SEL0_7_6
+               MOD_SEL0_5
+               MOD_SEL0_4_3
+               /* RESERVED 2, 1, 0 */
+               0, 0, 0, 0, 0, 0, 0, 0 }
+       },
+       { PINMUX_CFG_REG_VAR("MOD_SEL1", 0xe6060504, 32,
+                            2, 3, 1, 2, 3, 1, 1, 2, 1,
+                            2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1) {
+               MOD_SEL1_31_30
+               MOD_SEL1_29_28_27
+               MOD_SEL1_26
+               MOD_SEL1_25_24
+               MOD_SEL1_23_22_21
+               MOD_SEL1_20
+               MOD_SEL1_19
+               MOD_SEL1_18_17
+               MOD_SEL1_16
+               MOD_SEL1_15_14
+               MOD_SEL1_13
+               MOD_SEL1_12
+               MOD_SEL1_11
+               MOD_SEL1_10
+               MOD_SEL1_9
+               0, 0, 0, 0, /* RESERVED 8, 7 */
+               MOD_SEL1_6
+               MOD_SEL1_5
+               MOD_SEL1_4
+               MOD_SEL1_3
+               MOD_SEL1_2
+               MOD_SEL1_1
+               MOD_SEL1_0 }
+       },
+       { PINMUX_CFG_REG_VAR("MOD_SEL2", 0xe6060508, 32,
+                            1, 1, 1, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1,
+                            4, 4, 4, 3, 1) {
+               MOD_SEL2_31
+               MOD_SEL2_30
+               MOD_SEL2_29
+               MOD_SEL2_28_27
+               MOD_SEL2_26
+               MOD_SEL2_25_24_23
+               MOD_SEL2_22
+               MOD_SEL2_21
+               MOD_SEL2_20
+               MOD_SEL2_19
+               MOD_SEL2_18
+               MOD_SEL2_17
+               /* RESERVED 16 */
+               0, 0,
+               /* RESERVED 15, 14, 13, 12 */
+               0, 0, 0, 0, 0, 0, 0, 0,
+               0, 0, 0, 0, 0, 0, 0, 0,
+               /* RESERVED 11, 10, 9, 8 */
+               0, 0, 0, 0, 0, 0, 0, 0,
+               0, 0, 0, 0, 0, 0, 0, 0,
+               /* RESERVED 7, 6, 5, 4 */
+               0, 0, 0, 0, 0, 0, 0, 0,
+               0, 0, 0, 0, 0, 0, 0, 0,
+               /* RESERVED 3, 2, 1 */
+               0, 0, 0, 0, 0, 0, 0, 0,
+               MOD_SEL2_0 }
+       },
+       { },
+};
+
+static const struct pinmux_drive_reg pinmux_drive_regs[] = {
+       { PINMUX_DRIVE_REG("DRVCTRL0", 0xe6060300) {
+               { PIN_NUMBER('W', 3),   28, 2 },        /* QSPI0_SPCLK */
+               { PIN_A_NUMBER('C', 5), 24, 2 },        /* QSPI0_MOSI_IO0 */
+               { PIN_A_NUMBER('B', 4), 20, 2 },        /* QSPI0_MISO_IO1 */
+               { PIN_NUMBER('Y', 6),   16, 2 },        /* QSPI0_IO2 */
+               { PIN_A_NUMBER('B', 6), 12, 2 },        /* QSPI0_IO3 */
+               { PIN_NUMBER('Y', 3),    8, 2 },        /* QSPI0_SSL */
+               { PIN_NUMBER('V', 3),    4, 2 },        /* QSPI1_SPCLK */
+               { PIN_A_NUMBER('C', 7),  0, 2 },        /* QSPI1_MOSI_IO0 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL1", 0xe6060304) {
+               { PIN_A_NUMBER('E', 5), 28, 2 },        /* QSPI1_MISO_IO1 */
+               { PIN_A_NUMBER('E', 4), 24, 2 },        /* QSPI1_IO2 */
+               { PIN_A_NUMBER('C', 3), 20, 2 },        /* QSPI1_IO3 */
+               { PIN_NUMBER('V', 5),   16, 2 },        /* QSPI1_SSL */
+               { PIN_NUMBER('Y', 7),   12, 2 },        /* RPC_INT# */
+               { PIN_NUMBER('V', 6),    8, 2 },        /* RPC_WP# */
+               { PIN_NUMBER('V', 7),    4, 2 },        /* RPC_RESET# */
+               { PIN_NUMBER('A', 16),   0, 3 },        /* AVB_RX_CTL */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL2", 0xe6060308) {
+               { PIN_NUMBER('B', 19),  28, 3 },        /* AVB_RXC */
+               { PIN_NUMBER('A', 13),  24, 3 },        /* AVB_RD0 */
+               { PIN_NUMBER('B', 13),  20, 3 },        /* AVB_RD1 */
+               { PIN_NUMBER('A', 14),  16, 3 },        /* AVB_RD2 */
+               { PIN_NUMBER('B', 14),  12, 3 },        /* AVB_RD3 */
+               { PIN_NUMBER('A', 8),    8, 3 },        /* AVB_TX_CTL */
+               { PIN_NUMBER('A', 19),   4, 3 },        /* AVB_TXC */
+               { PIN_NUMBER('A', 18),   0, 3 },        /* AVB_TD0 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL3", 0xe606030c) {
+               { PIN_NUMBER('B', 18),  28, 3 },        /* AVB_TD1 */
+               { PIN_NUMBER('A', 17),  24, 3 },        /* AVB_TD2 */
+               { PIN_NUMBER('B', 17),  20, 3 },        /* AVB_TD3 */
+               { PIN_NUMBER('A', 12),  16, 3 },        /* AVB_TXCREFCLK */
+               { PIN_NUMBER('A', 9),   12, 3 },        /* AVB_MDIO */
+               { RCAR_GP_PIN(2,  9),    8, 3 },        /* AVB_MDC */
+               { RCAR_GP_PIN(2, 10),    4, 3 },        /* AVB_MAGIC */
+               { RCAR_GP_PIN(2, 11),    0, 3 },        /* AVB_PHY_INT */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL4", 0xe6060310) {
+               { RCAR_GP_PIN(2, 12), 28, 3 },  /* AVB_LINK */
+               { RCAR_GP_PIN(2, 13), 24, 3 },  /* AVB_AVTP_MATCH */
+               { RCAR_GP_PIN(2, 14), 20, 3 },  /* AVB_AVTP_CAPTURE */
+               { RCAR_GP_PIN(2,  0), 16, 3 },  /* IRQ0 */
+               { RCAR_GP_PIN(2,  1), 12, 3 },  /* IRQ1 */
+               { RCAR_GP_PIN(2,  2),  8, 3 },  /* IRQ2 */
+               { RCAR_GP_PIN(2,  3),  4, 3 },  /* IRQ3 */
+               { RCAR_GP_PIN(2,  4),  0, 3 },  /* IRQ4 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL5", 0xe6060314) {
+               { RCAR_GP_PIN(2,  5), 28, 3 },  /* IRQ5 */
+               { RCAR_GP_PIN(2,  6), 24, 3 },  /* PWM0 */
+               { RCAR_GP_PIN(2,  7), 20, 3 },  /* PWM1 */
+               { RCAR_GP_PIN(2,  8), 16, 3 },  /* PWM2 */
+               { RCAR_GP_PIN(1,  0), 12, 3 },  /* A0 */
+               { RCAR_GP_PIN(1,  1),  8, 3 },  /* A1 */
+               { RCAR_GP_PIN(1,  2),  4, 3 },  /* A2 */
+               { RCAR_GP_PIN(1,  3),  0, 3 },  /* A3 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL6", 0xe6060318) {
+               { RCAR_GP_PIN(1,  4), 28, 3 },  /* A4 */
+               { RCAR_GP_PIN(1,  5), 24, 3 },  /* A5 */
+               { RCAR_GP_PIN(1,  6), 20, 3 },  /* A6 */
+               { RCAR_GP_PIN(1,  7), 16, 3 },  /* A7 */
+               { RCAR_GP_PIN(1,  8), 12, 3 },  /* A8 */
+               { RCAR_GP_PIN(1,  9),  8, 3 },  /* A9 */
+               { RCAR_GP_PIN(1, 10),  4, 3 },  /* A10 */
+               { RCAR_GP_PIN(1, 11),  0, 3 },  /* A11 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL7", 0xe606031c) {
+               { RCAR_GP_PIN(1, 12), 28, 3 },  /* A12 */
+               { RCAR_GP_PIN(1, 13), 24, 3 },  /* A13 */
+               { RCAR_GP_PIN(1, 14), 20, 3 },  /* A14 */
+               { RCAR_GP_PIN(1, 15), 16, 3 },  /* A15 */
+               { RCAR_GP_PIN(1, 16), 12, 3 },  /* A16 */
+               { RCAR_GP_PIN(1, 17),  8, 3 },  /* A17 */
+               { RCAR_GP_PIN(1, 18),  4, 3 },  /* A18 */
+               { RCAR_GP_PIN(1, 19),  0, 3 },  /* A19 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL8", 0xe6060320) {
+               { RCAR_GP_PIN(1, 28), 28, 3 },  /* CLKOUT */
+               { RCAR_GP_PIN(1, 20), 24, 3 },  /* CS0 */
+               { RCAR_GP_PIN(1, 21), 20, 3 },  /* CS1_A26 */
+               { RCAR_GP_PIN(1, 22), 16, 3 },  /* BS */
+               { RCAR_GP_PIN(1, 23), 12, 3 },  /* RD */
+               { RCAR_GP_PIN(1, 24),  8, 3 },  /* RD_WR */
+               { RCAR_GP_PIN(1, 25),  4, 3 },  /* WE0 */
+               { RCAR_GP_PIN(1, 26),  0, 3 },  /* WE1 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL9", 0xe6060324) {
+               { RCAR_GP_PIN(1, 27), 28, 3 },  /* EX_WAIT0 */
+               { PIN_NUMBER('C', 1), 24, 3 },  /* PRESETOUT# */
+               { RCAR_GP_PIN(0,  0), 20, 3 },  /* D0 */
+               { RCAR_GP_PIN(0,  1), 16, 3 },  /* D1 */
+               { RCAR_GP_PIN(0,  2), 12, 3 },  /* D2 */
+               { RCAR_GP_PIN(0,  3),  8, 3 },  /* D3 */
+               { RCAR_GP_PIN(0,  4),  4, 3 },  /* D4 */
+               { RCAR_GP_PIN(0,  5),  0, 3 },  /* D5 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL10", 0xe6060328) {
+               { RCAR_GP_PIN(0,  6), 28, 3 },  /* D6 */
+               { RCAR_GP_PIN(0,  7), 24, 3 },  /* D7 */
+               { RCAR_GP_PIN(0,  8), 20, 3 },  /* D8 */
+               { RCAR_GP_PIN(0,  9), 16, 3 },  /* D9 */
+               { RCAR_GP_PIN(0, 10), 12, 3 },  /* D10 */
+               { RCAR_GP_PIN(0, 11),  8, 3 },  /* D11 */
+               { RCAR_GP_PIN(0, 12),  4, 3 },  /* D12 */
+               { RCAR_GP_PIN(0, 13),  0, 3 },  /* D13 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL11", 0xe606032c) {
+               { RCAR_GP_PIN(0, 14),   28, 3 },        /* D14 */
+               { RCAR_GP_PIN(0, 15),   24, 3 },        /* D15 */
+               { RCAR_GP_PIN(7,  0),   20, 3 },        /* AVS1 */
+               { RCAR_GP_PIN(7,  1),   16, 3 },        /* AVS2 */
+               { RCAR_GP_PIN(7,  2),   12, 3 },        /* HDMI0_CEC */
+               { RCAR_GP_PIN(7,  3),    8, 3 },        /* GP7_03 */
+               { PIN_A_NUMBER('P', 7),  4, 2 },        /* DU_DOTCLKIN0 */
+               { PIN_A_NUMBER('P', 8),  0, 2 },        /* DU_DOTCLKIN1 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL12", 0xe6060330) {
+               { PIN_A_NUMBER('R', 8),  28, 2 },       /* DU_DOTCLKIN3 */
+               { PIN_A_NUMBER('D', 38), 20, 2 },       /* FSCLKST */
+               { PIN_A_NUMBER('R', 30),  4, 2 },       /* TMS */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL13", 0xe6060334) {
+               { PIN_A_NUMBER('T', 28), 28, 2 },       /* TDO */
+               { PIN_A_NUMBER('T', 30), 24, 2 },       /* ASEBRK */
+               { RCAR_GP_PIN(3,  0),    20, 3 },       /* SD0_CLK */
+               { RCAR_GP_PIN(3,  1),    16, 3 },       /* SD0_CMD */
+               { RCAR_GP_PIN(3,  2),    12, 3 },       /* SD0_DAT0 */
+               { RCAR_GP_PIN(3,  3),     8, 3 },       /* SD0_DAT1 */
+               { RCAR_GP_PIN(3,  4),     4, 3 },       /* SD0_DAT2 */
+               { RCAR_GP_PIN(3,  5),     0, 3 },       /* SD0_DAT3 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL14", 0xe6060338) {
+               { RCAR_GP_PIN(3,  6), 28, 3 },  /* SD1_CLK */
+               { RCAR_GP_PIN(3,  7), 24, 3 },  /* SD1_CMD */
+               { RCAR_GP_PIN(3,  8), 20, 3 },  /* SD1_DAT0 */
+               { RCAR_GP_PIN(3,  9), 16, 3 },  /* SD1_DAT1 */
+               { RCAR_GP_PIN(3, 10), 12, 3 },  /* SD1_DAT2 */
+               { RCAR_GP_PIN(3, 11),  8, 3 },  /* SD1_DAT3 */
+               { RCAR_GP_PIN(4,  0),  4, 3 },  /* SD2_CLK */
+               { RCAR_GP_PIN(4,  1),  0, 3 },  /* SD2_CMD */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL15", 0xe606033c) {
+               { RCAR_GP_PIN(4,  2), 28, 3 },  /* SD2_DAT0 */
+               { RCAR_GP_PIN(4,  3), 24, 3 },  /* SD2_DAT1 */
+               { RCAR_GP_PIN(4,  4), 20, 3 },  /* SD2_DAT2 */
+               { RCAR_GP_PIN(4,  5), 16, 3 },  /* SD2_DAT3 */
+               { RCAR_GP_PIN(4,  6), 12, 3 },  /* SD2_DS */
+               { RCAR_GP_PIN(4,  7),  8, 3 },  /* SD3_CLK */
+               { RCAR_GP_PIN(4,  8),  4, 3 },  /* SD3_CMD */
+               { RCAR_GP_PIN(4,  9),  0, 3 },  /* SD3_DAT0 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL16", 0xe6060340) {
+               { RCAR_GP_PIN(4, 10), 28, 3 },  /* SD3_DAT1 */
+               { RCAR_GP_PIN(4, 11), 24, 3 },  /* SD3_DAT2 */
+               { RCAR_GP_PIN(4, 12), 20, 3 },  /* SD3_DAT3 */
+               { RCAR_GP_PIN(4, 13), 16, 3 },  /* SD3_DAT4 */
+               { RCAR_GP_PIN(4, 14), 12, 3 },  /* SD3_DAT5 */
+               { RCAR_GP_PIN(4, 15),  8, 3 },  /* SD3_DAT6 */
+               { RCAR_GP_PIN(4, 16),  4, 3 },  /* SD3_DAT7 */
+               { RCAR_GP_PIN(4, 17),  0, 3 },  /* SD3_DS */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL17", 0xe6060344) {
+               { RCAR_GP_PIN(3, 12), 28, 3 },  /* SD0_CD */
+               { RCAR_GP_PIN(3, 13), 24, 3 },  /* SD0_WP */
+               { RCAR_GP_PIN(3, 14), 20, 3 },  /* SD1_CD */
+               { RCAR_GP_PIN(3, 15), 16, 3 },  /* SD1_WP */
+               { RCAR_GP_PIN(5,  0), 12, 3 },  /* SCK0 */
+               { RCAR_GP_PIN(5,  1),  8, 3 },  /* RX0 */
+               { RCAR_GP_PIN(5,  2),  4, 3 },  /* TX0 */
+               { RCAR_GP_PIN(5,  3),  0, 3 },  /* CTS0 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL18", 0xe6060348) {
+               { RCAR_GP_PIN(5,  4), 28, 3 },  /* RTS0 */
+               { RCAR_GP_PIN(5,  5), 24, 3 },  /* RX1 */
+               { RCAR_GP_PIN(5,  6), 20, 3 },  /* TX1 */
+               { RCAR_GP_PIN(5,  7), 16, 3 },  /* CTS1 */
+               { RCAR_GP_PIN(5,  8), 12, 3 },  /* RTS1 */
+               { RCAR_GP_PIN(5,  9),  8, 3 },  /* SCK2 */
+               { RCAR_GP_PIN(5, 10),  4, 3 },  /* TX2 */
+               { RCAR_GP_PIN(5, 11),  0, 3 },  /* RX2 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL19", 0xe606034c) {
+               { RCAR_GP_PIN(5, 12), 28, 3 },  /* HSCK0 */
+               { RCAR_GP_PIN(5, 13), 24, 3 },  /* HRX0 */
+               { RCAR_GP_PIN(5, 14), 20, 3 },  /* HTX0 */
+               { RCAR_GP_PIN(5, 15), 16, 3 },  /* HCTS0 */
+               { RCAR_GP_PIN(5, 16), 12, 3 },  /* HRTS0 */
+               { RCAR_GP_PIN(5, 17),  8, 3 },  /* MSIOF0_SCK */
+               { RCAR_GP_PIN(5, 18),  4, 3 },  /* MSIOF0_SYNC */
+               { RCAR_GP_PIN(5, 19),  0, 3 },  /* MSIOF0_SS1 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL20", 0xe6060350) {
+               { RCAR_GP_PIN(5, 20), 28, 3 },  /* MSIOF0_TXD */
+               { RCAR_GP_PIN(5, 21), 24, 3 },  /* MSIOF0_SS2 */
+               { RCAR_GP_PIN(5, 22), 20, 3 },  /* MSIOF0_RXD */
+               { RCAR_GP_PIN(5, 23), 16, 3 },  /* MLB_CLK */
+               { RCAR_GP_PIN(5, 24), 12, 3 },  /* MLB_SIG */
+               { RCAR_GP_PIN(5, 25),  8, 3 },  /* MLB_DAT */
+               { PIN_NUMBER('H', 37),  4, 3 }, /* MLB_REF */
+               { RCAR_GP_PIN(6,  0),  0, 3 },  /* SSI_SCK01239 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL21", 0xe6060354) {
+               { RCAR_GP_PIN(6,  1), 28, 3 },  /* SSI_WS01239 */
+               { RCAR_GP_PIN(6,  2), 24, 3 },  /* SSI_SDATA0 */
+               { RCAR_GP_PIN(6,  3), 20, 3 },  /* SSI_SDATA1 */
+               { RCAR_GP_PIN(6,  4), 16, 3 },  /* SSI_SDATA2 */
+               { RCAR_GP_PIN(6,  5), 12, 3 },  /* SSI_SCK349 */
+               { RCAR_GP_PIN(6,  6),  8, 3 },  /* SSI_WS349 */
+               { RCAR_GP_PIN(6,  7),  4, 3 },  /* SSI_SDATA3 */
+               { RCAR_GP_PIN(6,  8),  0, 3 },  /* SSI_SCK4 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL22", 0xe6060358) {
+               { RCAR_GP_PIN(6,  9), 28, 3 },  /* SSI_WS4 */
+               { RCAR_GP_PIN(6, 10), 24, 3 },  /* SSI_SDATA4 */
+               { RCAR_GP_PIN(6, 11), 20, 3 },  /* SSI_SCK5 */
+               { RCAR_GP_PIN(6, 12), 16, 3 },  /* SSI_WS5 */
+               { RCAR_GP_PIN(6, 13), 12, 3 },  /* SSI_SDATA5 */
+               { RCAR_GP_PIN(6, 14),  8, 3 },  /* SSI_SCK6 */
+               { RCAR_GP_PIN(6, 15),  4, 3 },  /* SSI_WS6 */
+               { RCAR_GP_PIN(6, 16),  0, 3 },  /* SSI_SDATA6 */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL23", 0xe606035c) {
+               { RCAR_GP_PIN(6, 17), 28, 3 },  /* SSI_SCK78 */
+               { RCAR_GP_PIN(6, 18), 24, 3 },  /* SSI_WS78 */
+               { RCAR_GP_PIN(6, 19), 20, 3 },  /* SSI_SDATA7 */
+               { RCAR_GP_PIN(6, 20), 16, 3 },  /* SSI_SDATA8 */
+               { RCAR_GP_PIN(6, 21), 12, 3 },  /* SSI_SDATA9 */
+               { RCAR_GP_PIN(6, 22),  8, 3 },  /* AUDIO_CLKA */
+               { RCAR_GP_PIN(6, 23),  4, 3 },  /* AUDIO_CLKB */
+               { RCAR_GP_PIN(6, 24),  0, 3 },  /* USB0_PWEN */
+       } },
+       { PINMUX_DRIVE_REG("DRVCTRL24", 0xe6060360) {
+               { RCAR_GP_PIN(6, 25), 28, 3 },  /* USB0_OVC */
+               { RCAR_GP_PIN(6, 26), 24, 3 },  /* USB1_PWEN */
+               { RCAR_GP_PIN(6, 27), 20, 3 },  /* USB1_OVC */
+               { RCAR_GP_PIN(6, 28), 16, 3 },  /* USB30_PWEN */
+               { RCAR_GP_PIN(6, 29), 12, 3 },  /* USB30_OVC */
+               { RCAR_GP_PIN(6, 30),  8, 3 },  /* GP6_30 */
+               { RCAR_GP_PIN(6, 31),  4, 3 },  /* GP6_31 */
+       } },
+       { },
+};
+
+enum ioctrl_regs {
+       POCCTRL,
+};
+
+static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = {
+       [POCCTRL] = { 0xe6060380, },
+       { /* sentinel */ },
+};
+
+static int r8a77965_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *pocctrl)
+{
+       int bit = -EINVAL;
+
+       *pocctrl = pinmux_ioctrl_regs[POCCTRL].reg;
+
+       if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 11))
+               bit = pin & 0x1f;
+
+       if (pin >= RCAR_GP_PIN(4, 0) && pin <= RCAR_GP_PIN(4, 17))
+               bit = (pin & 0x1f) + 12;
+
+       return bit;
+}
+
+static const struct pinmux_bias_reg pinmux_bias_regs[] = {
+       { PINMUX_BIAS_REG("PUEN0", 0xe6060400, "PUD0", 0xe6060440) {
+               [ 0] = PIN_NUMBER('W', 3),      /* QSPI0_SPCLK */
+               [ 1] = PIN_A_NUMBER('C', 5),    /* QSPI0_MOSI_IO0 */
+               [ 2] = PIN_A_NUMBER('B', 4),    /* QSPI0_MISO_IO1 */
+               [ 3] = PIN_NUMBER('Y', 6),      /* QSPI0_IO2 */
+               [ 4] = PIN_A_NUMBER('B', 6),    /* QSPI0_IO3 */
+               [ 5] = PIN_NUMBER('Y', 3),      /* QSPI0_SSL */
+               [ 6] = PIN_NUMBER('V', 3),      /* QSPI1_SPCLK */
+               [ 7] = PIN_A_NUMBER('C', 7),    /* QSPI1_MOSI_IO0 */
+               [ 8] = PIN_A_NUMBER('E', 5),    /* QSPI1_MISO_IO1 */
+               [ 9] = PIN_A_NUMBER('E', 4),    /* QSPI1_IO2 */
+               [10] = PIN_A_NUMBER('C', 3),    /* QSPI1_IO3 */
+               [11] = PIN_NUMBER('V', 5),      /* QSPI1_SSL */
+               [12] = PIN_NUMBER('Y', 7),      /* RPC_INT# */
+               [13] = PIN_NUMBER('V', 6),      /* RPC_WP# */
+               [14] = PIN_NUMBER('V', 7),      /* RPC_RESET# */
+               [15] = PIN_NUMBER('A', 16),     /* AVB_RX_CTL */
+               [16] = PIN_NUMBER('B', 19),     /* AVB_RXC */
+               [17] = PIN_NUMBER('A', 13),     /* AVB_RD0 */
+               [18] = PIN_NUMBER('B', 13),     /* AVB_RD1 */
+               [19] = PIN_NUMBER('A', 14),     /* AVB_RD2 */
+               [20] = PIN_NUMBER('B', 14),     /* AVB_RD3 */
+               [21] = PIN_NUMBER('A', 8),      /* AVB_TX_CTL */
+               [22] = PIN_NUMBER('A', 19),     /* AVB_TXC */
+               [23] = PIN_NUMBER('A', 18),     /* AVB_TD0 */
+               [24] = PIN_NUMBER('B', 18),     /* AVB_TD1 */
+               [25] = PIN_NUMBER('A', 17),     /* AVB_TD2 */
+               [26] = PIN_NUMBER('B', 17),     /* AVB_TD3 */
+               [27] = PIN_NUMBER('A', 12),     /* AVB_TXCREFCLK */
+               [28] = PIN_NUMBER('A', 9),      /* AVB_MDIO */
+               [29] = RCAR_GP_PIN(2,  9),      /* AVB_MDC */
+               [30] = RCAR_GP_PIN(2, 10),      /* AVB_MAGIC */
+               [31] = RCAR_GP_PIN(2, 11),      /* AVB_PHY_INT */
+       } },
+       { PINMUX_BIAS_REG("PUEN1", 0xe6060404, "PUD1", 0xe6060444) {
+               [ 0] = RCAR_GP_PIN(2, 12),      /* AVB_LINK */
+               [ 1] = RCAR_GP_PIN(2, 13),      /* AVB_AVTP_MATCH_A */
+               [ 2] = RCAR_GP_PIN(2, 14),      /* AVB_AVTP_CAPTURE_A */
+               [ 3] = RCAR_GP_PIN(2,  0),      /* IRQ0 */
+               [ 4] = RCAR_GP_PIN(2,  1),      /* IRQ1 */
+               [ 5] = RCAR_GP_PIN(2,  2),      /* IRQ2 */
+               [ 6] = RCAR_GP_PIN(2,  3),      /* IRQ3 */
+               [ 7] = RCAR_GP_PIN(2,  4),      /* IRQ4 */
+               [ 8] = RCAR_GP_PIN(2,  5),      /* IRQ5 */
+               [ 9] = RCAR_GP_PIN(2,  6),      /* PWM0 */
+               [10] = RCAR_GP_PIN(2,  7),      /* PWM1_A */
+               [11] = RCAR_GP_PIN(2,  8),      /* PWM2_A */
+               [12] = RCAR_GP_PIN(1,  0),      /* A0 */
+               [13] = RCAR_GP_PIN(1,  1),      /* A1 */
+               [14] = RCAR_GP_PIN(1,  2),      /* A2 */
+               [15] = RCAR_GP_PIN(1,  3),      /* A3 */
+               [16] = RCAR_GP_PIN(1,  4),      /* A4 */
+               [17] = RCAR_GP_PIN(1,  5),      /* A5 */
+               [18] = RCAR_GP_PIN(1,  6),      /* A6 */
+               [19] = RCAR_GP_PIN(1,  7),      /* A7 */
+               [20] = RCAR_GP_PIN(1,  8),      /* A8 */
+               [21] = RCAR_GP_PIN(1,  9),      /* A9 */
+               [22] = RCAR_GP_PIN(1, 10),      /* A10 */
+               [23] = RCAR_GP_PIN(1, 11),      /* A11 */
+               [24] = RCAR_GP_PIN(1, 12),      /* A12 */
+               [25] = RCAR_GP_PIN(1, 13),      /* A13 */
+               [26] = RCAR_GP_PIN(1, 14),      /* A14 */
+               [27] = RCAR_GP_PIN(1, 15),      /* A15 */
+               [28] = RCAR_GP_PIN(1, 16),      /* A16 */
+               [29] = RCAR_GP_PIN(1, 17),      /* A17 */
+               [30] = RCAR_GP_PIN(1, 18),      /* A18 */
+               [31] = RCAR_GP_PIN(1, 19),      /* A19 */
+       } },
+       { PINMUX_BIAS_REG("PUEN2", 0xe6060408, "PUD2", 0xe6060448) {
+               [ 0] = RCAR_GP_PIN(1, 28),      /* CLKOUT */
+               [ 1] = RCAR_GP_PIN(1, 20),      /* CS0_N */
+               [ 2] = RCAR_GP_PIN(1, 21),      /* CS1_N */
+               [ 3] = RCAR_GP_PIN(1, 22),      /* BS_N */
+               [ 4] = RCAR_GP_PIN(1, 23),      /* RD_N */
+               [ 5] = RCAR_GP_PIN(1, 24),      /* RD_WR_N */
+               [ 6] = RCAR_GP_PIN(1, 25),      /* WE0_N */
+               [ 7] = RCAR_GP_PIN(1, 26),      /* WE1_N */
+               [ 8] = RCAR_GP_PIN(1, 27),      /* EX_WAIT0_A */
+               [ 9] = PIN_NUMBER('C', 1),      /* PRESETOUT# */
+               [10] = RCAR_GP_PIN(0,  0),      /* D0 */
+               [11] = RCAR_GP_PIN(0,  1),      /* D1 */
+               [12] = RCAR_GP_PIN(0,  2),      /* D2 */
+               [13] = RCAR_GP_PIN(0,  3),      /* D3 */
+               [14] = RCAR_GP_PIN(0,  4),      /* D4 */
+               [15] = RCAR_GP_PIN(0,  5),      /* D5 */
+               [16] = RCAR_GP_PIN(0,  6),      /* D6 */
+               [17] = RCAR_GP_PIN(0,  7),      /* D7 */
+               [18] = RCAR_GP_PIN(0,  8),      /* D8 */
+               [19] = RCAR_GP_PIN(0,  9),      /* D9 */
+               [20] = RCAR_GP_PIN(0, 10),      /* D10 */
+               [21] = RCAR_GP_PIN(0, 11),      /* D11 */
+               [22] = RCAR_GP_PIN(0, 12),      /* D12 */
+               [23] = RCAR_GP_PIN(0, 13),      /* D13 */
+               [24] = RCAR_GP_PIN(0, 14),      /* D14 */
+               [25] = RCAR_GP_PIN(0, 15),      /* D15 */
+               [26] = RCAR_GP_PIN(7,  0),      /* AVS1 */
+               [27] = RCAR_GP_PIN(7,  1),      /* AVS2 */
+               [28] = RCAR_GP_PIN(7,  2),      /* HDMI0_CEC */
+               [29] = RCAR_GP_PIN(7,  3),      /* GP7_03 */
+               [30] = PIN_A_NUMBER('P', 7),    /* DU_DOTCLKIN0 */
+               [31] = PIN_A_NUMBER('P', 8),    /* DU_DOTCLKIN1 */
+       } },
+       { PINMUX_BIAS_REG("PUEN3", 0xe606040c, "PUD3", 0xe606044c) {
+               [ 0] = PIN_A_NUMBER('R', 8),    /* DU_DOTCLKIN3 */
+               [ 1] = PIN_NONE,
+               [ 2] = PIN_A_NUMBER('D', 38),   /* FSCLKST */
+               [ 3] = PIN_A_NUMBER('D', 39),   /* EXTALR*/
+               [ 4] = PIN_A_NUMBER('R', 26),   /* TRST# */
+               [ 5] = PIN_A_NUMBER('T', 27),   /* TCK */
+               [ 6] = PIN_A_NUMBER('R', 30),   /* TMS */
+               [ 7] = PIN_A_NUMBER('R', 29),   /* TDI */
+               [ 8] = PIN_NONE,
+               [ 9] = PIN_A_NUMBER('T', 30),   /* ASEBRK */
+               [10] = RCAR_GP_PIN(3,  0),      /* SD0_CLK */
+               [11] = RCAR_GP_PIN(3,  1),      /* SD0_CMD */
+               [12] = RCAR_GP_PIN(3,  2),      /* SD0_DAT0 */
+               [13] = RCAR_GP_PIN(3,  3),      /* SD0_DAT1 */
+               [14] = RCAR_GP_PIN(3,  4),      /* SD0_DAT2 */
+               [15] = RCAR_GP_PIN(3,  5),      /* SD0_DAT3 */
+               [16] = RCAR_GP_PIN(3,  6),      /* SD1_CLK */
+               [17] = RCAR_GP_PIN(3,  7),      /* SD1_CMD */
+               [18] = RCAR_GP_PIN(3,  8),      /* SD1_DAT0 */
+               [19] = RCAR_GP_PIN(3,  9),      /* SD1_DAT1 */
+               [20] = RCAR_GP_PIN(3, 10),      /* SD1_DAT2 */
+               [21] = RCAR_GP_PIN(3, 11),      /* SD1_DAT3 */
+               [22] = RCAR_GP_PIN(4,  0),      /* SD2_CLK */
+               [23] = RCAR_GP_PIN(4,  1),      /* SD2_CMD */
+               [24] = RCAR_GP_PIN(4,  2),      /* SD2_DAT0 */
+               [25] = RCAR_GP_PIN(4,  3),      /* SD2_DAT1 */
+               [26] = RCAR_GP_PIN(4,  4),      /* SD2_DAT2 */
+               [27] = RCAR_GP_PIN(4,  5),      /* SD2_DAT3 */
+               [28] = RCAR_GP_PIN(4,  6),      /* SD2_DS */
+               [29] = RCAR_GP_PIN(4,  7),      /* SD3_CLK */
+               [30] = RCAR_GP_PIN(4,  8),      /* SD3_CMD */
+               [31] = RCAR_GP_PIN(4,  9),      /* SD3_DAT0 */
+       } },
+       { PINMUX_BIAS_REG("PUEN4", 0xe6060410, "PUD4", 0xe6060450) {
+               [ 0] = RCAR_GP_PIN(4, 10),      /* SD3_DAT1 */
+               [ 1] = RCAR_GP_PIN(4, 11),      /* SD3_DAT2 */
+               [ 2] = RCAR_GP_PIN(4, 12),      /* SD3_DAT3 */
+               [ 3] = RCAR_GP_PIN(4, 13),      /* SD3_DAT4 */
+               [ 4] = RCAR_GP_PIN(4, 14),      /* SD3_DAT5 */
+               [ 5] = RCAR_GP_PIN(4, 15),      /* SD3_DAT6 */
+               [ 6] = RCAR_GP_PIN(4, 16),      /* SD3_DAT7 */
+               [ 7] = RCAR_GP_PIN(4, 17),      /* SD3_DS */
+               [ 8] = RCAR_GP_PIN(3, 12),      /* SD0_CD */
+               [ 9] = RCAR_GP_PIN(3, 13),      /* SD0_WP */
+               [10] = RCAR_GP_PIN(3, 14),      /* SD1_CD */
+               [11] = RCAR_GP_PIN(3, 15),      /* SD1_WP */
+               [12] = RCAR_GP_PIN(5,  0),      /* SCK0 */
+               [13] = RCAR_GP_PIN(5,  1),      /* RX0 */
+               [14] = RCAR_GP_PIN(5,  2),      /* TX0 */
+               [15] = RCAR_GP_PIN(5,  3),      /* CTS0_N */
+               [16] = RCAR_GP_PIN(5,  4),      /* RTS0_N */
+               [17] = RCAR_GP_PIN(5,  5),      /* RX1_A */
+               [18] = RCAR_GP_PIN(5,  6),      /* TX1_A */
+               [19] = RCAR_GP_PIN(5,  7),      /* CTS1_N */
+               [20] = RCAR_GP_PIN(5,  8),      /* RTS1_N */
+               [21] = RCAR_GP_PIN(5,  9),      /* SCK2 */
+               [22] = RCAR_GP_PIN(5, 10),      /* TX2_A */
+               [23] = RCAR_GP_PIN(5, 11),      /* RX2_A */
+               [24] = RCAR_GP_PIN(5, 12),      /* HSCK0 */
+               [25] = RCAR_GP_PIN(5, 13),      /* HRX0 */
+               [26] = RCAR_GP_PIN(5, 14),      /* HTX0 */
+               [27] = RCAR_GP_PIN(5, 15),      /* HCTS0_N */
+               [28] = RCAR_GP_PIN(5, 16),      /* HRTS0_N */
+               [29] = RCAR_GP_PIN(5, 17),      /* MSIOF0_SCK */
+               [30] = RCAR_GP_PIN(5, 18),      /* MSIOF0_SYNC */
+               [31] = RCAR_GP_PIN(5, 19),      /* MSIOF0_SS1 */
+       } },
+       { PINMUX_BIAS_REG("PUEN5", 0xe6060414, "PUD5", 0xe6060454) {
+               [ 0] = RCAR_GP_PIN(5, 20),      /* MSIOF0_TXD */
+               [ 1] = RCAR_GP_PIN(5, 21),      /* MSIOF0_SS2 */
+               [ 2] = RCAR_GP_PIN(5, 22),      /* MSIOF0_RXD */
+               [ 3] = RCAR_GP_PIN(5, 23),      /* MLB_CLK */
+               [ 4] = RCAR_GP_PIN(5, 24),      /* MLB_SIG */
+               [ 5] = RCAR_GP_PIN(5, 25),      /* MLB_DAT */
+               [ 6] = PIN_NUMBER('H', 37),     /* MLB_REF */
+               [ 7] = RCAR_GP_PIN(6,  0),      /* SSI_SCK01239 */
+               [ 8] = RCAR_GP_PIN(6,  1),      /* SSI_WS01239 */
+               [ 9] = RCAR_GP_PIN(6,  2),      /* SSI_SDATA0 */
+               [10] = RCAR_GP_PIN(6,  3),      /* SSI_SDATA1_A */
+               [11] = RCAR_GP_PIN(6,  4),      /* SSI_SDATA2_A */
+               [12] = RCAR_GP_PIN(6,  5),      /* SSI_SCK349 */
+               [13] = RCAR_GP_PIN(6,  6),      /* SSI_WS349 */
+               [14] = RCAR_GP_PIN(6,  7),      /* SSI_SDATA3 */
+               [15] = RCAR_GP_PIN(6,  8),      /* SSI_SCK4 */
+               [16] = RCAR_GP_PIN(6,  9),      /* SSI_WS4 */
+               [17] = RCAR_GP_PIN(6, 10),      /* SSI_SDATA4 */
+               [18] = RCAR_GP_PIN(6, 11),      /* SSI_SCK5 */
+               [19] = RCAR_GP_PIN(6, 12),      /* SSI_WS5 */
+               [20] = RCAR_GP_PIN(6, 13),      /* SSI_SDATA5 */
+               [21] = RCAR_GP_PIN(6, 14),      /* SSI_SCK6 */
+               [22] = RCAR_GP_PIN(6, 15),      /* SSI_WS6 */
+               [23] = RCAR_GP_PIN(6, 16),      /* SSI_SDATA6 */
+               [24] = RCAR_GP_PIN(6, 17),      /* SSI_SCK78 */
+               [25] = RCAR_GP_PIN(6, 18),      /* SSI_WS78 */
+               [26] = RCAR_GP_PIN(6, 19),      /* SSI_SDATA7 */
+               [27] = RCAR_GP_PIN(6, 20),      /* SSI_SDATA8 */
+               [28] = RCAR_GP_PIN(6, 21),      /* SSI_SDATA9_A */
+               [29] = RCAR_GP_PIN(6, 22),      /* AUDIO_CLKA_A */
+               [30] = RCAR_GP_PIN(6, 23),      /* AUDIO_CLKB_B */
+               [31] = RCAR_GP_PIN(6, 24),      /* USB0_PWEN */
+       } },
+       { PINMUX_BIAS_REG("PUEN6", 0xe6060418, "PUD6", 0xe6060458) {
+               [ 0] = RCAR_GP_PIN(6, 25),      /* USB0_OVC */
+               [ 1] = RCAR_GP_PIN(6, 26),      /* USB1_PWEN */
+               [ 2] = RCAR_GP_PIN(6, 27),      /* USB1_OVC */
+               [ 3] = RCAR_GP_PIN(6, 28),      /* USB30_PWEN */
+               [ 4] = RCAR_GP_PIN(6, 29),      /* USB30_OVC */
+               [ 5] = RCAR_GP_PIN(6, 30),      /* GP6_30 */
+               [ 6] = RCAR_GP_PIN(6, 31),      /* GP6_31 */
+               [ 7] = PIN_NONE,
+               [ 8] = PIN_NONE,
+               [ 9] = PIN_NONE,
+               [10] = PIN_NONE,
+               [11] = PIN_NONE,
+               [12] = PIN_NONE,
+               [13] = PIN_NONE,
+               [14] = PIN_NONE,
+               [15] = PIN_NONE,
+               [16] = PIN_NONE,
+               [17] = PIN_NONE,
+               [18] = PIN_NONE,
+               [19] = PIN_NONE,
+               [20] = PIN_NONE,
+               [21] = PIN_NONE,
+               [22] = PIN_NONE,
+               [23] = PIN_NONE,
+               [24] = PIN_NONE,
+               [25] = PIN_NONE,
+               [26] = PIN_NONE,
+               [27] = PIN_NONE,
+               [28] = PIN_NONE,
+               [29] = PIN_NONE,
+               [30] = PIN_NONE,
+               [31] = PIN_NONE,
+       } },
+       { /* sentinel */ },
+};
+
+static unsigned int r8a77965_pinmux_get_bias(struct sh_pfc *pfc,
+                                           unsigned int pin)
+{
+       const struct pinmux_bias_reg *reg;
+       unsigned int bit;
+
+       reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit);
+       if (!reg)
+               return PIN_CONFIG_BIAS_DISABLE;
+
+       if (!(sh_pfc_read(pfc, reg->puen) & BIT(bit)))
+               return PIN_CONFIG_BIAS_DISABLE;
+       else if (sh_pfc_read(pfc, reg->pud) & BIT(bit))
+               return PIN_CONFIG_BIAS_PULL_UP;
+       else
+               return PIN_CONFIG_BIAS_PULL_DOWN;
+}
+
+static void r8a77965_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin,
+                                  unsigned int bias)
+{
+       const struct pinmux_bias_reg *reg;
+       u32 enable, updown;
+       unsigned int bit;
+
+       reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit);
+       if (!reg)
+               return;
+
+       enable = sh_pfc_read(pfc, reg->puen) & ~BIT(bit);
+       if (bias != PIN_CONFIG_BIAS_DISABLE)
+               enable |= BIT(bit);
+
+       updown = sh_pfc_read(pfc, reg->pud) & ~BIT(bit);
+       if (bias == PIN_CONFIG_BIAS_PULL_UP)
+               updown |= BIT(bit);
+
+       sh_pfc_write(pfc, reg->pud, updown);
+       sh_pfc_write(pfc, reg->puen, enable);
+}
+
+static const struct sh_pfc_soc_operations r8a77965_pinmux_ops = {
+       .pin_to_pocctrl = r8a77965_pin_to_pocctrl,
+       .get_bias = r8a77965_pinmux_get_bias,
+       .set_bias = r8a77965_pinmux_set_bias,
+};
+
+const struct sh_pfc_soc_info r8a77965_pinmux_info = {
+       .name = "r8a77965_pfc",
+       .ops = &r8a77965_pinmux_ops,
+       .unlock_reg = 0xe6060000, /* PMMR */
+
+       .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
+
+       .pins = pinmux_pins,
+       .nr_pins = ARRAY_SIZE(pinmux_pins),
+       .groups = pinmux_groups,
+       .nr_groups = ARRAY_SIZE(pinmux_groups),
+       .functions = pinmux_functions,
+       .nr_functions = ARRAY_SIZE(pinmux_functions),
+
+       .cfg_regs = pinmux_config_regs,
+       .drive_regs = pinmux_drive_regs,
+       .bias_regs = pinmux_bias_regs,
+       .ioctrl_regs = pinmux_ioctrl_regs,
+
+       .pinmux_data = pinmux_data,
+       .pinmux_data_size = ARRAY_SIZE(pinmux_data),
+};
index c44e1bc961c268fbd4fbeac19fbe42d2e6e09972..823edb559d6c9fdc8e3ee16a17f927bca1581d80 100644 (file)
@@ -3,6 +3,7 @@
  * R8A77970 processor support - PFC hardware block.
  *
  * Copyright (C) 2016 Renesas Electronics Corp.
+ * Copyright (C) 2017 Cogent Embedded, Inc. <source@cogentembedded.com>
  *
  * This file is based on the drivers/pinctrl/sh-pfc/pfc-r8a7795.c
  *
 #include "sh_pfc.h"
 
 #define CPU_ALL_PORT(fn, sfx)                                          \
-       PORT_GP_CFG_22(0, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH),      \
-       PORT_GP_CFG_28(1, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH),      \
-       PORT_GP_CFG_17(2, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH),      \
-       PORT_GP_CFG_17(3, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH),      \
-       PORT_GP_CFG_6(4, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH),       \
-       PORT_GP_CFG_15(5, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH)
+       PORT_GP_CFG_22(0, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE),          \
+       PORT_GP_28(1, fn, sfx),                                         \
+       PORT_GP_CFG_17(2, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE),          \
+       PORT_GP_CFG_17(3, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE),          \
+       PORT_GP_6(4,  fn, sfx),                                         \
+       PORT_GP_15(5, fn, sfx)
 /*
  * F_() : just information
  * FM() : macro for FN_xxx / xxx_MARK
@@ -1383,6 +1384,56 @@ static const unsigned int pwm4_b_mux[] = {
        PWM4_B_MARK,
 };
 
+/* - QSPI0 ------------------------------------------------------------------ */
+static const unsigned int qspi0_ctrl_pins[] = {
+       /* SPCLK, SSL */
+       RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 5),
+};
+static const unsigned int qspi0_ctrl_mux[] = {
+       QSPI0_SPCLK_MARK, QSPI0_SSL_MARK,
+};
+static const unsigned int qspi0_data2_pins[] = {
+       /* MOSI_IO0, MISO_IO1 */
+       RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
+};
+static const unsigned int qspi0_data2_mux[] = {
+       QSPI0_MOSI_IO0_MARK, QSPI0_MISO_IO1_MARK,
+};
+static const unsigned int qspi0_data4_pins[] = {
+       /* MOSI_IO0, MISO_IO1, IO2, IO3 */
+       RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
+       RCAR_GP_PIN(5, 3), RCAR_GP_PIN(5, 4),
+};
+static const unsigned int qspi0_data4_mux[] = {
+       QSPI0_MOSI_IO0_MARK, QSPI0_MISO_IO1_MARK,
+       QSPI0_IO2_MARK, QSPI0_IO3_MARK
+};
+
+/* - QSPI1 ------------------------------------------------------------------ */
+static const unsigned int qspi1_ctrl_pins[] = {
+       /* SPCLK, SSL */
+       RCAR_GP_PIN(5, 6), RCAR_GP_PIN(5, 11),
+};
+static const unsigned int qspi1_ctrl_mux[] = {
+       QSPI1_SPCLK_MARK, QSPI1_SSL_MARK,
+};
+static const unsigned int qspi1_data2_pins[] = {
+       /* MOSI_IO0, MISO_IO1 */
+       RCAR_GP_PIN(5, 7), RCAR_GP_PIN(5, 8),
+};
+static const unsigned int qspi1_data2_mux[] = {
+       QSPI1_MOSI_IO0_MARK, QSPI1_MISO_IO1_MARK,
+};
+static const unsigned int qspi1_data4_pins[] = {
+       /* MOSI_IO0, MISO_IO1, IO2, IO3 */
+       RCAR_GP_PIN(5, 7), RCAR_GP_PIN(5, 8),
+       RCAR_GP_PIN(5, 9), RCAR_GP_PIN(5, 10),
+};
+static const unsigned int qspi1_data4_mux[] = {
+       QSPI1_MOSI_IO0_MARK, QSPI1_MISO_IO1_MARK,
+       QSPI1_IO2_MARK, QSPI1_IO3_MARK
+};
+
 /* - SCIF Clock ------------------------------------------------------------- */
 static const unsigned int scif_clk_a_pins[] = {
        /* SCIF_CLK */
@@ -1529,47 +1580,25 @@ static const unsigned int tmu_tclk2_b_mux[] = {
 };
 
 /* - VIN0 ------------------------------------------------------------------- */
-static const unsigned int vin0_data8_pins[] = {
-       RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
-       RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
-       RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 9),
-       RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
-};
-static const unsigned int vin0_data8_mux[] = {
-       VI0_DATA0_MARK, VI0_DATA1_MARK,
-       VI0_DATA2_MARK, VI0_DATA3_MARK,
-       VI0_DATA4_MARK, VI0_DATA5_MARK,
-       VI0_DATA6_MARK, VI0_DATA7_MARK,
+static const union vin_data12 vin0_data_pins = {
+       .data12 = {
+               RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
+               RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
+               RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 9),
+               RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
+               RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
+               RCAR_GP_PIN(2, 14), RCAR_GP_PIN(2, 15),
+       },
 };
-static const unsigned int vin0_data10_pins[] = {
-       RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
-       RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
-       RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 9),
-       RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
-       RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
-};
-static const unsigned int vin0_data10_mux[] = {
-       VI0_DATA0_MARK, VI0_DATA1_MARK,
-       VI0_DATA2_MARK, VI0_DATA3_MARK,
-       VI0_DATA4_MARK, VI0_DATA5_MARK,
-       VI0_DATA6_MARK, VI0_DATA7_MARK,
-       VI0_DATA8_MARK,  VI0_DATA9_MARK,
-};
-static const unsigned int vin0_data12_pins[] = {
-       RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
-       RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
-       RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 9),
-       RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
-       RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
-       RCAR_GP_PIN(2, 14), RCAR_GP_PIN(2, 15),
-};
-static const unsigned int vin0_data12_mux[] = {
-       VI0_DATA0_MARK, VI0_DATA1_MARK,
-       VI0_DATA2_MARK, VI0_DATA3_MARK,
-       VI0_DATA4_MARK, VI0_DATA5_MARK,
-       VI0_DATA6_MARK, VI0_DATA7_MARK,
-       VI0_DATA8_MARK,  VI0_DATA9_MARK,
-       VI0_DATA10_MARK, VI0_DATA11_MARK,
+static const union vin_data12 vin0_data_mux = {
+       .data12 = {
+               VI0_DATA0_MARK, VI0_DATA1_MARK,
+               VI0_DATA2_MARK, VI0_DATA3_MARK,
+               VI0_DATA4_MARK, VI0_DATA5_MARK,
+               VI0_DATA6_MARK, VI0_DATA7_MARK,
+               VI0_DATA8_MARK,  VI0_DATA9_MARK,
+               VI0_DATA10_MARK, VI0_DATA11_MARK,
+       },
 };
 static const unsigned int vin0_sync_pins[] = {
        /* HSYNC#, VSYNC# */
@@ -1601,47 +1630,25 @@ static const unsigned int vin0_clk_mux[] = {
 };
 
 /* - VIN1 ------------------------------------------------------------------- */
-static const unsigned int vin1_data8_pins[] = {
-       RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
-       RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
-       RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
-       RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
-};
-static const unsigned int vin1_data8_mux[] = {
-       VI1_DATA0_MARK, VI1_DATA1_MARK,
-       VI1_DATA2_MARK, VI1_DATA3_MARK,
-       VI1_DATA4_MARK, VI1_DATA5_MARK,
-       VI1_DATA6_MARK, VI1_DATA7_MARK,
-};
-static const unsigned int vin1_data10_pins[] = {
-       RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
-       RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
-       RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
-       RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
-       RCAR_GP_PIN(3, 12), RCAR_GP_PIN(3, 13),
-};
-static const unsigned int vin1_data10_mux[] = {
-       VI1_DATA0_MARK, VI1_DATA1_MARK,
-       VI1_DATA2_MARK, VI1_DATA3_MARK,
-       VI1_DATA4_MARK, VI1_DATA5_MARK,
-       VI1_DATA6_MARK, VI1_DATA7_MARK,
-       VI1_DATA8_MARK,  VI1_DATA9_MARK,
-};
-static const unsigned int vin1_data12_pins[] = {
-       RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
-       RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
-       RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
-       RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
-       RCAR_GP_PIN(3, 12), RCAR_GP_PIN(3, 13),
-       RCAR_GP_PIN(3, 14), RCAR_GP_PIN(3, 15),
+static const union vin_data12 vin1_data_pins = {
+       .data12 = {
+               RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
+               RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
+               RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
+               RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
+               RCAR_GP_PIN(3, 12), RCAR_GP_PIN(3, 13),
+               RCAR_GP_PIN(3, 14), RCAR_GP_PIN(3, 15),
+       },
 };
-static const unsigned int vin1_data12_mux[] = {
-       VI1_DATA0_MARK, VI1_DATA1_MARK,
-       VI1_DATA2_MARK, VI1_DATA3_MARK,
-       VI1_DATA4_MARK, VI1_DATA5_MARK,
-       VI1_DATA6_MARK, VI1_DATA7_MARK,
-       VI1_DATA8_MARK,  VI1_DATA9_MARK,
-       VI1_DATA10_MARK, VI1_DATA11_MARK,
+static const union vin_data12 vin1_data_mux = {
+       .data12 = {
+               VI1_DATA0_MARK, VI1_DATA1_MARK,
+               VI1_DATA2_MARK, VI1_DATA3_MARK,
+               VI1_DATA4_MARK, VI1_DATA5_MARK,
+               VI1_DATA6_MARK, VI1_DATA7_MARK,
+               VI1_DATA8_MARK,  VI1_DATA9_MARK,
+               VI1_DATA10_MARK, VI1_DATA11_MARK,
+       },
 };
 static const unsigned int vin1_sync_pins[] = {
        /* HSYNC#, VSYNC# */
@@ -1757,6 +1764,12 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
        SH_PFC_PIN_GROUP(pwm3_b),
        SH_PFC_PIN_GROUP(pwm4_a),
        SH_PFC_PIN_GROUP(pwm4_b),
+       SH_PFC_PIN_GROUP(qspi0_ctrl),
+       SH_PFC_PIN_GROUP(qspi0_data2),
+       SH_PFC_PIN_GROUP(qspi0_data4),
+       SH_PFC_PIN_GROUP(qspi1_ctrl),
+       SH_PFC_PIN_GROUP(qspi1_data2),
+       SH_PFC_PIN_GROUP(qspi1_data4),
        SH_PFC_PIN_GROUP(scif_clk_a),
        SH_PFC_PIN_GROUP(scif_clk_b),
        SH_PFC_PIN_GROUP(scif0_data),
@@ -1776,16 +1789,16 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
        SH_PFC_PIN_GROUP(tmu_tclk1_b),
        SH_PFC_PIN_GROUP(tmu_tclk2_a),
        SH_PFC_PIN_GROUP(tmu_tclk2_b),
-       SH_PFC_PIN_GROUP(vin0_data8),
-       SH_PFC_PIN_GROUP(vin0_data10),
-       SH_PFC_PIN_GROUP(vin0_data12),
+       VIN_DATA_PIN_GROUP(vin0_data, 8),
+       VIN_DATA_PIN_GROUP(vin0_data, 10),
+       VIN_DATA_PIN_GROUP(vin0_data, 12),
        SH_PFC_PIN_GROUP(vin0_sync),
        SH_PFC_PIN_GROUP(vin0_field),
        SH_PFC_PIN_GROUP(vin0_clkenb),
        SH_PFC_PIN_GROUP(vin0_clk),
-       SH_PFC_PIN_GROUP(vin1_data8),
-       SH_PFC_PIN_GROUP(vin1_data10),
-       SH_PFC_PIN_GROUP(vin1_data12),
+       VIN_DATA_PIN_GROUP(vin1_data, 8),
+       VIN_DATA_PIN_GROUP(vin1_data, 10),
+       VIN_DATA_PIN_GROUP(vin1_data, 12),
        SH_PFC_PIN_GROUP(vin1_sync),
        SH_PFC_PIN_GROUP(vin1_field),
        SH_PFC_PIN_GROUP(vin1_clkenb),
@@ -1951,6 +1964,18 @@ static const char * const pwm4_groups[] = {
        "pwm4_b",
 };
 
+static const char * const qspi0_groups[] = {
+       "qspi0_ctrl",
+       "qspi0_data2",
+       "qspi0_data4",
+};
+
+static const char * const qspi1_groups[] = {
+       "qspi1_ctrl",
+       "qspi1_data2",
+       "qspi1_data4",
+};
+
 static const char * const scif_clk_groups[] = {
        "scif_clk_a",
        "scif_clk_b",
@@ -2034,6 +2059,8 @@ static const struct sh_pfc_function pinmux_functions[] = {
        SH_PFC_FUNCTION(pwm2),
        SH_PFC_FUNCTION(pwm3),
        SH_PFC_FUNCTION(pwm4),
+       SH_PFC_FUNCTION(qspi0),
+       SH_PFC_FUNCTION(qspi1),
        SH_PFC_FUNCTION(scif_clk),
        SH_PFC_FUNCTION(scif0),
        SH_PFC_FUNCTION(scif1),
@@ -2352,7 +2379,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
 #define F_(x, y)       x,
 #define FM(x)          FN_##x,
        { PINMUX_CFG_REG_VAR("MOD_SEL0", 0xe6060500, 32,
-                            4, 4, 4, 4,
+                            4, 4, 4, 4, 4,
                             1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) {
                /* RESERVED 31, 30, 29, 28 */
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -2380,18 +2407,31 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
        { },
 };
 
+enum ioctrl_regs {
+       IOCTRL30,
+       IOCTRL31,
+       IOCTRL32,
+};
+
+static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = {
+       [IOCTRL30] = { 0xe6060380 },
+       [IOCTRL31] = { 0xe6060384 },
+       [IOCTRL32] = { 0xe6060388 },
+       { /* sentinel */ },
+};
+
 static int r8a77970_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin,
                                   u32 *pocctrl)
 {
        int bit = pin & 0x1f;
 
-       *pocctrl = 0xe6060380;
+       *pocctrl = pinmux_ioctrl_regs[IOCTRL30].reg;
        if (pin >= RCAR_GP_PIN(0, 0) && pin <= RCAR_GP_PIN(0, 21))
                return bit;
        if (pin >= RCAR_GP_PIN(2, 0) && pin <= RCAR_GP_PIN(2, 9))
                return bit + 22;
 
-       *pocctrl += 4;
+       *pocctrl = pinmux_ioctrl_regs[IOCTRL31].reg;
        if (pin >= RCAR_GP_PIN(2, 10) && pin <= RCAR_GP_PIN(2, 16))
                return bit - 10;
        if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 16))
@@ -2419,6 +2459,7 @@ const struct sh_pfc_soc_info r8a77970_pinmux_info = {
        .nr_functions = ARRAY_SIZE(pinmux_functions),
 
        .cfg_regs = pinmux_config_regs,
+       .ioctrl_regs = pinmux_ioctrl_regs,
 
        .pinmux_data = pinmux_data,
        .pinmux_data_size = ARRAY_SIZE(pinmux_data),
index c708eed686740a790d98a12508f667540d9e7b72..1cf08ae4714c80c9166b745a12e443ef0bb5781f 100644 (file)
@@ -2,13 +2,13 @@
 /*
  * R8A77990 processor support - PFC hardware block.
  *
- * Copyright (C) 2018-2019 Renesas Electronics Corp.
+ * Copyright (C) 2018 Renesas Electronics Corp.
  *
  * This file is based on the drivers/pinctrl/sh-pfc/pfc-r8a7796.c
  *
- * R-Car Gen3 processor support - PFC hardware block.
+ * R8A7796 processor support - PFC hardware block.
  *
- * Copyright (C) 2015  Renesas Electronics Corporation
+ * Copyright (C) 2016-2017 Renesas Electronics Corp.
  */
 
 #include <common.h>
 #define CFG_FLAGS (SH_PFC_PIN_CFG_PULL_UP | \
                   SH_PFC_PIN_CFG_PULL_DOWN)
 
-#define CPU_ALL_PORT(fn, sfx)  \
-       PORT_GP_18(0, fn, sfx), \
-       PORT_GP_23(1, fn, sfx), \
-       PORT_GP_26(2, fn, sfx), \
-       PORT_GP_CFG_12(3, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE),  \
-       PORT_GP_1(3, 12, fn, sfx),      \
-       PORT_GP_1(3, 13, fn, sfx),      \
-       PORT_GP_1(3, 14, fn, sfx),      \
-       PORT_GP_1(3, 15, fn, sfx),      \
-       PORT_GP_CFG_11(4, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE),  \
-       PORT_GP_20(5, fn, sfx), \
-       PORT_GP_18(6, fn, sfx)
+#define CPU_ALL_PORT(fn, sfx) \
+       PORT_GP_CFG_18(0, fn, sfx, CFG_FLAGS), \
+       PORT_GP_CFG_23(1, fn, sfx, CFG_FLAGS), \
+       PORT_GP_CFG_26(2, fn, sfx, CFG_FLAGS), \
+       PORT_GP_CFG_12(3, fn, sfx, CFG_FLAGS | SH_PFC_PIN_CFG_IO_VOLTAGE), \
+       PORT_GP_CFG_1(3, 12, fn, sfx, CFG_FLAGS), \
+       PORT_GP_CFG_1(3, 13, fn, sfx, CFG_FLAGS), \
+       PORT_GP_CFG_1(3, 14, fn, sfx, CFG_FLAGS), \
+       PORT_GP_CFG_1(3, 15, fn, sfx, CFG_FLAGS), \
+       PORT_GP_CFG_11(4, fn, sfx, CFG_FLAGS | SH_PFC_PIN_CFG_IO_VOLTAGE), \
+       PORT_GP_CFG_20(5, fn, sfx, CFG_FLAGS), \
+       PORT_GP_CFG_9(6, fn, sfx, CFG_FLAGS), \
+       PORT_GP_CFG_1(6, 9, fn, sfx, SH_PFC_PIN_CFG_PULL_UP), \
+       PORT_GP_CFG_1(6, 10, fn, sfx, CFG_FLAGS), \
+       PORT_GP_CFG_1(6, 11, fn, sfx, CFG_FLAGS), \
+       PORT_GP_CFG_1(6, 12, fn, sfx, CFG_FLAGS), \
+       PORT_GP_CFG_1(6, 13, fn, sfx, CFG_FLAGS), \
+       PORT_GP_CFG_1(6, 14, fn, sfx, CFG_FLAGS), \
+       PORT_GP_CFG_1(6, 15, fn, sfx, CFG_FLAGS), \
+       PORT_GP_CFG_1(6, 16, fn, sfx, CFG_FLAGS), \
+       PORT_GP_CFG_1(6, 17, fn, sfx, CFG_FLAGS)
 /*
  * F_() : just information
  * FM() : macro for FN_xxx / xxx_MARK
 #define GPSR5_7                F_(SCK2_A,              IP12_7_4)
 #define GPSR5_6                F_(TX1,                 IP12_3_0)
 #define GPSR5_5                F_(RX1,                 IP11_31_28)
-#define GPSR5_4                F_(RTS0_N_A,            IP11_23_20)
+#define GPSR5_4                F_(RTS0_N_TANS_A,       IP11_23_20)
 #define GPSR5_3                F_(CTS0_N_A,            IP11_19_16)
 #define GPSR5_2                F_(TX0_A,               IP11_15_12)
 #define GPSR5_1                F_(RX0_A,               IP11_11_8)
 #define IP3_3_0                FM(A1)                  FM(IRQ1)                FM(PWM3_A)              FM(DU_DOTCLKIN1)        FM(VI5_DATA0_A)         FM(DU_DISP_CDE) FM(SDA6_B)      FM(IETX)        FM(QCPV_QDE)    F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP3_7_4                FM(A2)                  FM(IRQ2)                FM(AVB_AVTP_PPS)        FM(VI4_CLKENB)          FM(VI5_DATA1_A)         FM(DU_DISP)     FM(SCL6_B)      F_(0, 0)        FM(QSTVB_QVE)   F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP3_11_8       FM(A3)                  FM(CTS4_N_A)            FM(PWM4_A)              FM(VI4_DATA12)          F_(0, 0)                FM(DU_DOTCLKOUT0) FM(HTX3_D)    FM(IECLK)       FM(LCDOUT12)    F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP3_15_12      FM(A4)                  FM(RTS4_N_A)            FM(MSIOF3_SYNC_B)       FM(VI4_DATA8)           FM(PWM2_B)              FM(DU_DG4)      FM(RIF2_CLK_B)  F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP3_15_12      FM(A4)                  FM(RTS4_N_TANS_A)       FM(MSIOF3_SYNC_B)       FM(VI4_DATA8)           FM(PWM2_B)              FM(DU_DG4)      FM(RIF2_CLK_B)  F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP3_19_16      FM(A5)                  FM(SCK4_A)              FM(MSIOF3_SCK_B)        FM(VI4_DATA9)           FM(PWM3_B)              F_(0, 0)        FM(RIF2_SYNC_B) F_(0, 0)        FM(QPOLA)       F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP3_23_20      FM(A6)                  FM(RX4_A)               FM(MSIOF3_RXD_B)        FM(VI4_DATA10)          F_(0, 0)                F_(0, 0)        FM(RIF2_D0_B)   F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP3_27_24      FM(A7)                  FM(TX4_A)               FM(MSIOF3_TXD_B)        FM(VI4_DATA11)          F_(0, 0)                F_(0, 0)        FM(RIF2_D1_B)   F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP5_15_12      FM(CS0_N)               FM(SCL5)                F_(0, 0)                F_(0, 0)                F_(0, 0)                FM(DU_DR0)      FM(VI4_DATA2_B) F_(0, 0)        FM(LCDOUT16)    F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP5_19_16      FM(WE0_N)               FM(SDA5)                F_(0, 0)                F_(0, 0)                F_(0, 0)                FM(DU_DR1)      FM(VI4_DATA3_B) F_(0, 0)        FM(LCDOUT17)    F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP5_23_20      FM(D0)                  FM(MSIOF3_SCK_A)        F_(0, 0)                F_(0, 0)                F_(0, 0)                FM(DU_DR2)      FM(CTS4_N_C)    F_(0, 0)        FM(LCDOUT18)    F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP5_27_24      FM(D1)                  FM(MSIOF3_SYNC_A)       FM(SCK3_A)              FM(VI4_DATA23)          FM(VI5_CLKENB_A)        FM(DU_DB7)      FM(RTS4_N_C)    F_(0, 0)        FM(LCDOUT7)     F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP5_27_24      FM(D1)                  FM(MSIOF3_SYNC_A)       FM(SCK3_A)              FM(VI4_DATA23)          FM(VI5_CLKENB_A)        FM(DU_DB7)      FM(RTS4_N_TANS_C) F_(0, 0)      FM(LCDOUT7)     F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP5_31_28      FM(D2)                  FM(MSIOF3_RXD_A)        FM(RX5_C)               F_(0, 0)                FM(VI5_DATA14_A)        FM(DU_DR3)      FM(RX4_C)       F_(0, 0)        FM(LCDOUT19)    F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP6_3_0                FM(D3)                  FM(MSIOF3_TXD_A)        FM(TX5_C)               F_(0, 0)                FM(VI5_DATA15_A)        FM(DU_DR4)      FM(TX4_C)       F_(0, 0)        FM(LCDOUT20)    F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP6_7_4                FM(D4)                  FM(CANFD1_TX)           FM(HSCK3_B)             FM(CAN1_TX)             FM(RTS3_N_A)    FM(MSIOF3_SS2_A) F_(0, 0)       FM(VI5_DATA1_B) F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP6_7_4                FM(D4)                  FM(CANFD1_TX)           FM(HSCK3_B)             FM(CAN1_TX)             FM(RTS3_N_TANS_A)       FM(MSIOF3_SS2_A) F_(0, 0)       FM(VI5_DATA1_B) F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP6_11_8       FM(D5)                  FM(RX3_A)               FM(HRX3_B)              F_(0, 0)                F_(0, 0)                FM(DU_DR5)      FM(VI4_DATA4_B) F_(0, 0)        FM(LCDOUT21)    F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP6_15_12      FM(D6)                  FM(TX3_A)               FM(HTX3_B)              F_(0, 0)                F_(0, 0)                FM(DU_DR6)      FM(VI4_DATA5_B) F_(0, 0)        FM(LCDOUT22)    F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP6_19_16      FM(D7)                  FM(CANFD1_RX)           FM(IRQ5)                FM(CAN1_RX)             FM(CTS3_N_A)            F_(0, 0)        F_(0, 0)        FM(VI5_DATA2_B) F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP11_11_8      FM(RX0_A)               FM(HRX1_A)              FM(SSI_SCK2_A)          FM(RIF1_SYNC)           F_(0, 0)                F_(0, 0)        F_(0, 0)        FM(TS_SCK1)     F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP11_15_12     FM(TX0_A)               FM(HTX1_A)              FM(SSI_WS2_A)           FM(RIF1_D0)             F_(0, 0)                F_(0, 0)        F_(0, 0)        FM(TS_SDAT1)    F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP11_19_16     FM(CTS0_N_A)            FM(NFDATA14_A)          FM(AUDIO_CLKOUT_A)      FM(RIF1_D1)             FM(SCIF_CLK_A)          FM(FMCLK_A)     F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP11_23_20     FM(RTS0_N_A)            FM(NFDATA15_A)          FM(AUDIO_CLKOUT1_A)     FM(RIF1_CLK)            FM(SCL2_A)              FM(FMIN_A)      F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
-#define IP11_27_24     FM(SCK0_A)              FM(HSCK1_A)             FM(USB3HS0_ID)          FM(RTS1_N)              FM(SDA2_A)              FM(FMCLK_C)     F_(0, 0)        F_(0, 0)        FM(USB0_ID)     F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP11_23_20     FM(RTS0_N_TANS_A)       FM(NFDATA15_A)          FM(AUDIO_CLKOUT1_A)     FM(RIF1_CLK)            FM(SCL2_A)              FM(FMIN_A)      F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
+#define IP11_27_24     FM(SCK0_A)              FM(HSCK1_A)             FM(USB3HS0_ID)          FM(RTS1_N_TANS)         FM(SDA2_A)              FM(FMCLK_C)     F_(0, 0)        F_(0, 0)        FM(USB0_ID)     F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 #define IP11_31_28     FM(RX1)                 FM(HRX2_B)              FM(SSI_SCK9_B)          FM(AUDIO_CLKOUT1_B)     F_(0, 0)                F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0)        F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
 
 /* IPSRx */            /* 0 */                 /* 1 */                 /* 2 */                 /* 3 */                 /* 4 */                 /* 5 */         /* 6 */         /* 7 */         /* 8 */         /* 9 - F */
@@ -394,29 +403,33 @@ FM(IP12_23_20)    IP12_23_20      FM(IP13_23_20)  IP13_23_20      FM(IP14_23_20)  IP14_23_20      FM
 FM(IP12_27_24) IP12_27_24      FM(IP13_27_24)  IP13_27_24      FM(IP14_27_24)  IP14_27_24      FM(IP15_27_24)  IP15_27_24 \
 FM(IP12_31_28) IP12_31_28      FM(IP13_31_28)  IP13_31_28      FM(IP14_31_28)  IP14_31_28      FM(IP15_31_28)  IP15_31_28
 
+/* The bit numbering in MOD_SEL fields is reversed */
+#define REV4(f0, f1, f2, f3)                   f0 f2 f1 f3
+#define REV8(f0, f1, f2, f3, f4, f5, f6, f7)   f0 f4 f2 f6 f1 f5 f3 f7
+
 /* MOD_SEL0 */                 /* 0 */                         /* 1 */                         /* 2 */                         /* 3 */                 /* 4 */                 /* 5 */         /* 6 */         /* 7 */
-#define MOD_SEL0_30_29         FM(SEL_ADGB_0)                  FM(SEL_ADGB_1)                  FM(SEL_ADGB_2)                  F_(0, 0)
+#define MOD_SEL0_30_29    REV4(FM(SEL_ADGB_0),                 FM(SEL_ADGB_1),                 FM(SEL_ADGB_2),                 F_(0, 0))
 #define MOD_SEL0_28            FM(SEL_DRIF0_0)                 FM(SEL_DRIF0_1)
-#define MOD_SEL0_27_26         FM(SEL_FM_0)                    FM(SEL_FM_1)                    FM(SEL_FM_2)                    F_(0, 0)
+#define MOD_SEL0_27_26    REV4(FM(SEL_FM_0),                   FM(SEL_FM_1),                   FM(SEL_FM_2),                   F_(0, 0))
 #define MOD_SEL0_25            FM(SEL_FSO_0)                   FM(SEL_FSO_1)
 #define MOD_SEL0_24            FM(SEL_HSCIF0_0)                FM(SEL_HSCIF0_1)
 #define MOD_SEL0_23            FM(SEL_HSCIF1_0)                FM(SEL_HSCIF1_1)
 #define MOD_SEL0_22            FM(SEL_HSCIF2_0)                FM(SEL_HSCIF2_1)
-#define MOD_SEL0_21_20         FM(SEL_I2C1_0)                  FM(SEL_I2C1_1)                  FM(SEL_I2C1_2)                  FM(SEL_I2C1_3)          FM(SEL_I2C1_4)          F_(0, 0)        F_(0, 0)        F_(0, 0)
-#define MOD_SEL0_19_18_17      FM(SEL_I2C2_0)                  FM(SEL_I2C2_1)                  FM(SEL_I2C2_2)                  FM(SEL_I2C2_3)          FM(SEL_I2C2_4)          F_(0, 0)        F_(0, 0)        F_(0, 0)
+#define MOD_SEL0_21_20    REV4(FM(SEL_I2C1_0),                 FM(SEL_I2C1_1),                 FM(SEL_I2C1_2),                 FM(SEL_I2C1_3))
+#define MOD_SEL0_19_18_17  REV8(FM(SEL_I2C2_0),                        FM(SEL_I2C2_1),                 FM(SEL_I2C2_2),                 FM(SEL_I2C2_3),         FM(SEL_I2C2_4),         F_(0, 0),       F_(0, 0),       F_(0, 0))
 #define MOD_SEL0_16            FM(SEL_NDFC_0)                  FM(SEL_NDFC_1)
 #define MOD_SEL0_15            FM(SEL_PWM0_0)                  FM(SEL_PWM0_1)
 #define MOD_SEL0_14            FM(SEL_PWM1_0)                  FM(SEL_PWM1_1)
-#define MOD_SEL0_13_12         FM(SEL_PWM2_0)                  FM(SEL_PWM2_1)                  FM(SEL_PWM2_2)                  F_(0, 0)
-#define MOD_SEL0_11_10         FM(SEL_PWM3_0)                  FM(SEL_PWM3_1)                  FM(SEL_PWM3_2)                  F_(0, 0)
+#define MOD_SEL0_13_12    REV4(FM(SEL_PWM2_0),                 FM(SEL_PWM2_1),                 FM(SEL_PWM2_2),                 F_(0, 0))
+#define MOD_SEL0_11_10    REV4(FM(SEL_PWM3_0),                 FM(SEL_PWM3_1),                 FM(SEL_PWM3_2),                 F_(0, 0))
 #define MOD_SEL0_9             FM(SEL_PWM4_0)                  FM(SEL_PWM4_1)
 #define MOD_SEL0_8             FM(SEL_PWM5_0)                  FM(SEL_PWM5_1)
 #define MOD_SEL0_7             FM(SEL_PWM6_0)                  FM(SEL_PWM6_1)
-#define MOD_SEL0_6_5           FM(SEL_REMOCON_0)               FM(SEL_REMOCON_1)               FM(SEL_REMOCON_2)               F_(0, 0)
+#define MOD_SEL0_6_5      REV4(FM(SEL_REMOCON_0),              FM(SEL_REMOCON_1),              FM(SEL_REMOCON_2),              F_(0, 0))
 #define MOD_SEL0_4             FM(SEL_SCIF_0)                  FM(SEL_SCIF_1)
 #define MOD_SEL0_3             FM(SEL_SCIF0_0)                 FM(SEL_SCIF0_1)
 #define MOD_SEL0_2             FM(SEL_SCIF2_0)                 FM(SEL_SCIF2_1)
-#define MOD_SEL0_1_0           FM(SEL_SPEED_PULSE_IF_0)        FM(SEL_SPEED_PULSE_IF_1)        FM(SEL_SPEED_PULSE_IF_2)        F_(0, 0)
+#define MOD_SEL0_1_0      REV4(FM(SEL_SPEED_PULSE_IF_0),       FM(SEL_SPEED_PULSE_IF_1),       FM(SEL_SPEED_PULSE_IF_2),       F_(0, 0))
 
 /* MOD_SEL1 */                 /* 0 */                         /* 1 */                         /* 2 */                         /* 3 */                 /* 4 */                 /* 5 */         /* 6 */         /* 7 */
 #define MOD_SEL1_31            FM(SEL_SIMCARD_0)               FM(SEL_SIMCARD_1)
@@ -425,18 +438,18 @@ FM(IP12_31_28)    IP12_31_28      FM(IP13_31_28)  IP13_31_28      FM(IP14_31_28)  IP14_31_28      FM
 #define MOD_SEL1_28            FM(SEL_USB_20_CH0_0)            FM(SEL_USB_20_CH0_1)
 #define MOD_SEL1_26            FM(SEL_DRIF2_0)                 FM(SEL_DRIF2_1)
 #define MOD_SEL1_25            FM(SEL_DRIF3_0)                 FM(SEL_DRIF3_1)
-#define MOD_SEL1_24_23_22      FM(SEL_HSCIF3_0)                FM(SEL_HSCIF3_1)                FM(SEL_HSCIF3_2)                FM(SEL_HSCIF3_3)        FM(SEL_HSCIF3_4)        F_(0, 0)        F_(0, 0)        F_(0, 0)
-#define MOD_SEL1_21_20_19      FM(SEL_HSCIF4_0)                FM(SEL_HSCIF4_1)                FM(SEL_HSCIF4_2)                FM(SEL_HSCIF4_3)        FM(SEL_HSCIF4_4)        F_(0, 0)        F_(0, 0)        F_(0, 0)
+#define MOD_SEL1_24_23_22  REV8(FM(SEL_HSCIF3_0),              FM(SEL_HSCIF3_1),               FM(SEL_HSCIF3_2),               FM(SEL_HSCIF3_3),       FM(SEL_HSCIF3_4),       F_(0, 0),       F_(0, 0),       F_(0, 0))
+#define MOD_SEL1_21_20_19  REV8(FM(SEL_HSCIF4_0),              FM(SEL_HSCIF4_1),               FM(SEL_HSCIF4_2),               FM(SEL_HSCIF4_3),       FM(SEL_HSCIF4_4),       F_(0, 0),       F_(0, 0),       F_(0, 0))
 #define MOD_SEL1_18            FM(SEL_I2C6_0)                  FM(SEL_I2C6_1)
 #define MOD_SEL1_17            FM(SEL_I2C7_0)                  FM(SEL_I2C7_1)
 #define MOD_SEL1_16            FM(SEL_MSIOF2_0)                FM(SEL_MSIOF2_1)
 #define MOD_SEL1_15            FM(SEL_MSIOF3_0)                FM(SEL_MSIOF3_1)
-#define MOD_SEL1_14_13         FM(SEL_SCIF3_0)                 FM(SEL_SCIF3_1)                 FM(SEL_SCIF3_2)                 F_(0, 0)
-#define MOD_SEL1_12_11         FM(SEL_SCIF4_0)                 FM(SEL_SCIF4_1)                 FM(SEL_SCIF4_2)                 F_(0, 0)
-#define MOD_SEL1_10_9          FM(SEL_SCIF5_0)                 FM(SEL_SCIF5_1)                 FM(SEL_SCIF5_2)                 F_(0, 0)
+#define MOD_SEL1_14_13    REV4(FM(SEL_SCIF3_0),                FM(SEL_SCIF3_1),                FM(SEL_SCIF3_2),                F_(0, 0))
+#define MOD_SEL1_12_11    REV4(FM(SEL_SCIF4_0),                FM(SEL_SCIF4_1),                FM(SEL_SCIF4_2),                F_(0, 0))
+#define MOD_SEL1_10_9     REV4(FM(SEL_SCIF5_0),                FM(SEL_SCIF5_1),                FM(SEL_SCIF5_2),                F_(0, 0))
 #define MOD_SEL1_8             FM(SEL_VIN4_0)                  FM(SEL_VIN4_1)
 #define MOD_SEL1_7             FM(SEL_VIN5_0)                  FM(SEL_VIN5_1)
-#define MOD_SEL1_6_5           FM(SEL_ADGC_0)                  FM(SEL_ADGC_1)                  FM(SEL_ADGC_2)                  F_(0, 0)
+#define MOD_SEL1_6_5      REV4(FM(SEL_ADGC_0),                 FM(SEL_ADGC_1),                 FM(SEL_ADGC_2),                 F_(0, 0))
 #define MOD_SEL1_4             FM(SEL_SSI9_0)                  FM(SEL_SSI9_1)
 
 #define PINMUX_MOD_SELS        \
@@ -661,7 +674,7 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_GPSR(IP3_11_8,              LCDOUT12),
 
        PINMUX_IPSR_GPSR(IP3_15_12,             A4),
-       PINMUX_IPSR_MSEL(IP3_15_12,             RTS4_N_A,       SEL_SCIF4_0),
+       PINMUX_IPSR_MSEL(IP3_15_12,             RTS4_N_TANS_A,  SEL_SCIF4_0),
        PINMUX_IPSR_MSEL(IP3_15_12,             MSIOF3_SYNC_B,  SEL_MSIOF3_1),
        PINMUX_IPSR_GPSR(IP3_15_12,             VI4_DATA8),
        PINMUX_IPSR_MSEL(IP3_15_12,             PWM2_B,         SEL_PWM2_1),
@@ -811,7 +824,7 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_GPSR(IP5_27_24,             VI4_DATA23),
        PINMUX_IPSR_MSEL(IP5_27_24,             VI5_CLKENB_A,   SEL_VIN5_0),
        PINMUX_IPSR_GPSR(IP5_27_24,             DU_DB7),
-       PINMUX_IPSR_MSEL(IP5_27_24,             RTS4_N_C,       SEL_SCIF4_2),
+       PINMUX_IPSR_MSEL(IP5_27_24,             RTS4_N_TANS_C,  SEL_SCIF4_2),
        PINMUX_IPSR_GPSR(IP5_27_24,             LCDOUT7),
 
        PINMUX_IPSR_GPSR(IP5_31_28,             D2),
@@ -835,7 +848,7 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_GPSR(IP6_7_4,               CANFD1_TX),
        PINMUX_IPSR_MSEL(IP6_7_4,               HSCK3_B,        SEL_HSCIF3_1),
        PINMUX_IPSR_GPSR(IP6_7_4,               CAN1_TX),
-       PINMUX_IPSR_MSEL(IP6_7_4,               RTS3_N_A,       SEL_SCIF3_0),
+       PINMUX_IPSR_MSEL(IP6_7_4,               RTS3_N_TANS_A,  SEL_SCIF3_0),
        PINMUX_IPSR_GPSR(IP6_7_4,               MSIOF3_SS2_A),
        PINMUX_IPSR_MSEL(IP6_7_4,               VI5_DATA1_B,    SEL_VIN5_1),
 
@@ -1027,7 +1040,7 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_GPSR(IP10_23_20,            NFCLE),
 
        PINMUX_IPSR_GPSR(IP10_27_24,            SD0_CD),
-       PINMUX_IPSR_MSEL(IP10_27_24,            NFALE_A,        SEL_NDFC_0),
+       PINMUX_IPSR_GPSR(IP10_27_24,            NFALE_A),
        PINMUX_IPSR_GPSR(IP10_27_24,            SD3_CD),
        PINMUX_IPSR_MSEL(IP10_27_24,            RIF0_CLK_B,     SEL_DRIF0_1),
        PINMUX_IPSR_MSEL(IP10_27_24,            SCL2_B,         SEL_I2C2_1),
@@ -1036,7 +1049,7 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_GPSR(IP10_27_24,            TS_SCK0),
 
        PINMUX_IPSR_GPSR(IP10_31_28,            SD0_WP),
-       PINMUX_IPSR_MSEL(IP10_31_28,            NFRB_N_A,       SEL_NDFC_0),
+       PINMUX_IPSR_GPSR(IP10_31_28,            NFRB_N_A),
        PINMUX_IPSR_GPSR(IP10_31_28,            SD3_WP),
        PINMUX_IPSR_MSEL(IP10_31_28,            RIF0_D0_B,      SEL_DRIF0_1),
        PINMUX_IPSR_MSEL(IP10_31_28,            SDA2_B,         SEL_I2C2_1),
@@ -1076,7 +1089,7 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_MSEL(IP11_19_16,            SCIF_CLK_A,     SEL_SCIF_0),
        PINMUX_IPSR_MSEL(IP11_19_16,            FMCLK_A,        SEL_FM_0),
 
-       PINMUX_IPSR_MSEL(IP11_23_20,            RTS0_N_A,       SEL_SCIF0_0),
+       PINMUX_IPSR_MSEL(IP11_23_20,            RTS0_N_TANS_A,  SEL_SCIF0_0),
        PINMUX_IPSR_MSEL(IP11_23_20,            NFDATA15_A,     SEL_NDFC_0),
        PINMUX_IPSR_GPSR(IP11_23_20,            AUDIO_CLKOUT1_A),
        PINMUX_IPSR_GPSR(IP11_23_20,            RIF1_CLK),
@@ -1086,7 +1099,7 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_MSEL(IP11_27_24,            SCK0_A,         SEL_SCIF0_0),
        PINMUX_IPSR_MSEL(IP11_27_24,            HSCK1_A,        SEL_HSCIF1_0),
        PINMUX_IPSR_GPSR(IP11_27_24,            USB3HS0_ID),
-       PINMUX_IPSR_GPSR(IP11_27_24,            RTS1_N),
+       PINMUX_IPSR_GPSR(IP11_27_24,            RTS1_N_TANS),
        PINMUX_IPSR_MSEL(IP11_27_24,            SDA2_A,         SEL_I2C2_0),
        PINMUX_IPSR_MSEL(IP11_27_24,            FMCLK_C,        SEL_FM_2),
        PINMUX_IPSR_GPSR(IP11_27_24,            USB0_ID),
@@ -1173,7 +1186,7 @@ static const u16 pinmux_data[] = {
        PINMUX_IPSR_MSEL(IP13_19_16,            SIM0_D_A,       SEL_SIMCARD_0),
 
        PINMUX_IPSR_GPSR(IP13_23_20,            MLB_DAT),
-       PINMUX_IPSR_MSEL(IP13_23_20,            TX0_B,          SEL_SCIF0_0),
+       PINMUX_IPSR_MSEL(IP13_23_20,            TX0_B,          SEL_SCIF0_1),
        PINMUX_IPSR_MSEL(IP13_23_20,            RIF0_SYNC_A,    SEL_DRIF0_0),
        PINMUX_IPSR_GPSR(IP13_23_20,            SIM0_CLK_A),
 
@@ -1258,10 +1271,10 @@ static const u16 pinmux_data[] = {
 
 /*
  * Static pins can not be muxed between different functions but
- * still needs a mark entry in the pinmux list. Add each static
+ * still need mark entries in the pinmux list. Add each static
  * pin to the list without an associated function. The sh-pfc
- * core will do the right thing and skip trying to mux then pin
- * while still applying configuration to it
+ * core will do the right thing and skip trying to mux the pin
+ * while still applying configuration to it.
  */
 #define FM(x)   PINMUX_DATA(x##_MARK, 0),
        PINMUX_STATIC
@@ -1792,7 +1805,6 @@ static const unsigned int du_rgb666_pins[] = {
        RCAR_GP_PIN(0, 1),  RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 16),
        RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 13),
 };
-
 static const unsigned int du_rgb666_mux[] = {
        DU_DR7_MARK, DU_DR6_MARK, DU_DR5_MARK, DU_DR4_MARK,
        DU_DR3_MARK, DU_DR2_MARK,
@@ -1801,7 +1813,6 @@ static const unsigned int du_rgb666_mux[] = {
        DU_DB7_MARK, DU_DB6_MARK, DU_DB5_MARK, DU_DB4_MARK,
        DU_DB3_MARK, DU_DB2_MARK,
 };
-
 static const unsigned int du_rgb888_pins[] = {
        /* R[7:0], G[7:0], B[7:0] */
        RCAR_GP_PIN(0, 8),  RCAR_GP_PIN(0, 6),  RCAR_GP_PIN(0, 5),
@@ -1812,9 +1823,8 @@ static const unsigned int du_rgb888_pins[] = {
        RCAR_GP_PIN(0, 10), RCAR_GP_PIN(0, 9),
        RCAR_GP_PIN(0, 1),  RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 16),
        RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 13),
-       RCAR_GP_PIN(1, 18), RCAR_GP_PIN(1, 19),
+       RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 18),
 };
-
 static const unsigned int du_rgb888_mux[] = {
        DU_DR7_MARK, DU_DR6_MARK, DU_DR5_MARK, DU_DR4_MARK,
        DU_DR3_MARK, DU_DR2_MARK, DU_DR1_MARK, DU_DR0_MARK,
@@ -1823,70 +1833,56 @@ static const unsigned int du_rgb888_mux[] = {
        DU_DB7_MARK, DU_DB6_MARK, DU_DB5_MARK, DU_DB4_MARK,
        DU_DB3_MARK, DU_DB2_MARK, DU_DB1_MARK, DU_DB0_MARK,
 };
-
+static const unsigned int du_clk_in_0_pins[] = {
+       /* CLKIN0 */
+       RCAR_GP_PIN(0, 16),
+};
+static const unsigned int du_clk_in_0_mux[] = {
+       DU_DOTCLKIN0_MARK
+};
+static const unsigned int du_clk_in_1_pins[] = {
+       /* CLKIN1 */
+       RCAR_GP_PIN(1, 1),
+};
+static const unsigned int du_clk_in_1_mux[] = {
+       DU_DOTCLKIN1_MARK
+};
 static const unsigned int du_clk_out_0_pins[] = {
        /* CLKOUT */
        RCAR_GP_PIN(1, 3),
 };
-
 static const unsigned int du_clk_out_0_mux[] = {
        DU_DOTCLKOUT0_MARK
 };
-
 static const unsigned int du_sync_pins[] = {
        /* VSYNC, HSYNC */
        RCAR_GP_PIN(1, 11), RCAR_GP_PIN(1, 8),
 };
-
 static const unsigned int du_sync_mux[] = {
        DU_VSYNC_MARK, DU_HSYNC_MARK
 };
-
+static const unsigned int du_disp_cde_pins[] = {
+       /* DISP_CDE */
+       RCAR_GP_PIN(1, 1),
+};
+static const unsigned int du_disp_cde_mux[] = {
+       DU_DISP_CDE_MARK,
+};
 static const unsigned int du_cde_pins[] = {
        /* CDE */
        RCAR_GP_PIN(1, 0),
 };
-
 static const unsigned int du_cde_mux[] = {
        DU_CDE_MARK,
 };
-
 static const unsigned int du_disp_pins[] = {
        /* DISP */
        RCAR_GP_PIN(1, 2),
 };
-
 static const unsigned int du_disp_mux[] = {
        DU_DISP_MARK,
 };
 
-static const unsigned int du_disp_cde_pins[] = {
-       /* DISP/CDE */
-       RCAR_GP_PIN(1, 1),
-};
-
-static const unsigned int du_disp_cde_mux[] = {
-       DU_DISP_CDE_MARK,
-};
-
-static const unsigned int du_clk_in_0_pins[] = {
-       /* DOTCLKIN0 */
-       RCAR_GP_PIN(0, 16),
-};
-
-static const unsigned int du_clk_in_0_mux[] = {
-       DU_DOTCLKIN0_MARK,
-};
-
-static const unsigned int du_clk_in_1_pins[] = {
-       /* DOTCLKIN0 */
-       RCAR_GP_PIN(1, 1),
-};
-
-static const unsigned int du_clk_in_1_mux[] = {
-       DU_DOTCLKIN1_MARK,
-};
-
 /* - HSCIF0 --------------------------------------------------*/
 static const unsigned int hscif0_data_a_pins[] = {
        /* RX, TX */
@@ -2073,7 +2069,7 @@ static const unsigned int hscif3_ctrl_c_mux[] = {
 
 static const unsigned int hscif3_data_d_pins[] = {
        /* RX, TX */
-       RCAR_GP_PIN(1, 3), RCAR_GP_PIN(1, 0),
+       RCAR_GP_PIN(1, 0), RCAR_GP_PIN(1, 3),
 };
 
 static const unsigned int hscif3_data_d_mux[] = {
@@ -2136,7 +2132,7 @@ static const unsigned int hscif4_data_b_mux[] = {
 };
 
 static const unsigned int hscif4_clk_b_pins[] = {
-/* SCK */
+       /* SCK */
        RCAR_GP_PIN(2, 6),
 };
 
@@ -2312,10 +2308,44 @@ static const unsigned int intc_ex_irq0_pins[] = {
        /* IRQ0 */
        RCAR_GP_PIN(1, 0),
 };
-
 static const unsigned int intc_ex_irq0_mux[] = {
        IRQ0_MARK,
 };
+static const unsigned int intc_ex_irq1_pins[] = {
+       /* IRQ1 */
+       RCAR_GP_PIN(1, 1),
+};
+static const unsigned int intc_ex_irq1_mux[] = {
+       IRQ1_MARK,
+};
+static const unsigned int intc_ex_irq2_pins[] = {
+       /* IRQ2 */
+       RCAR_GP_PIN(1, 2),
+};
+static const unsigned int intc_ex_irq2_mux[] = {
+       IRQ2_MARK,
+};
+static const unsigned int intc_ex_irq3_pins[] = {
+       /* IRQ3 */
+       RCAR_GP_PIN(1, 9),
+};
+static const unsigned int intc_ex_irq3_mux[] = {
+       IRQ3_MARK,
+};
+static const unsigned int intc_ex_irq4_pins[] = {
+       /* IRQ4 */
+       RCAR_GP_PIN(1, 10),
+};
+static const unsigned int intc_ex_irq4_mux[] = {
+       IRQ4_MARK,
+};
+static const unsigned int intc_ex_irq5_pins[] = {
+       /* IRQ5 */
+       RCAR_GP_PIN(0, 7),
+};
+static const unsigned int intc_ex_irq5_mux[] = {
+       IRQ5_MARK,
+};
 
 /* - MSIOF0 ----------------------------------------------------------------- */
 static const unsigned int msiof0_clk_pins[] = {
@@ -2812,7 +2842,7 @@ static const unsigned int scif0_ctrl_a_pins[] = {
 };
 
 static const unsigned int scif0_ctrl_a_mux[] = {
-       RTS0_N_A_MARK, CTS0_N_A_MARK,
+       RTS0_N_TANS_A_MARK, CTS0_N_A_MARK,
 };
 
 static const unsigned int scif0_data_b_pins[] = {
@@ -2858,7 +2888,7 @@ static const unsigned int scif1_ctrl_pins[] = {
 };
 
 static const unsigned int scif1_ctrl_mux[] = {
-       RTS1_N_MARK, CTS1_N_MARK,
+       RTS1_N_TANS_MARK, CTS1_N_MARK,
 };
 
 /* - SCIF2 ------------------------------------------------------------------ */
@@ -2914,7 +2944,7 @@ static const unsigned int scif3_ctrl_a_pins[] = {
 };
 
 static const unsigned int scif3_ctrl_a_mux[] = {
-       RTS3_N_A_MARK, CTS3_N_A_MARK,
+       RTS3_N_TANS_A_MARK, CTS3_N_A_MARK,
 };
 
 static const unsigned int scif3_data_b_pins[] = {
@@ -2969,7 +2999,7 @@ static const unsigned int scif4_ctrl_a_pins[] = {
 };
 
 static const unsigned int scif4_ctrl_a_mux[] = {
-       RTS4_N_A_MARK, CTS4_N_A_MARK,
+       RTS4_N_TANS_A_MARK, CTS4_N_A_MARK,
 };
 
 static const unsigned int scif4_data_b_pins[] = {
@@ -3005,7 +3035,7 @@ static const unsigned int scif4_ctrl_c_pins[] = {
 };
 
 static const unsigned int scif4_ctrl_c_mux[] = {
-       RTS4_N_C_MARK, CTS4_N_C_MARK,
+       RTS4_N_TANS_C_MARK, CTS4_N_C_MARK,
 };
 
 /* - SCIF5 ------------------------------------------------------------------ */
@@ -3507,270 +3537,120 @@ static const unsigned int usb30_id_mux[] = {
 };
 
 /* - VIN4 ------------------------------------------------------------------- */
-static const unsigned int vin4_data8_a_pins[] = {
-       RCAR_GP_PIN(2, 6),  RCAR_GP_PIN(2, 7),
+static const unsigned int vin4_data18_a_pins[] = {
        RCAR_GP_PIN(2, 8),  RCAR_GP_PIN(2, 9),
        RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
        RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
-};
-
-static const unsigned int vin4_data8_a_mux[] = {
-       VI4_DATA0_A_MARK, VI4_DATA1_A_MARK,
-       VI4_DATA2_A_MARK, VI4_DATA3_A_MARK,
-       VI4_DATA4_A_MARK, VI4_DATA5_A_MARK,
-       VI4_DATA6_A_MARK, VI4_DATA7_A_MARK,
-};
-
-static const unsigned int vin4_data10_a_pins[] = {
-       RCAR_GP_PIN(2, 6),  RCAR_GP_PIN(2, 7),
-       RCAR_GP_PIN(2, 8),  RCAR_GP_PIN(2, 9),
-       RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
-       RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
-       RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
-};
-
-static const unsigned int vin4_data10_a_mux[] = {
-       VI4_DATA0_A_MARK, VI4_DATA1_A_MARK,
-       VI4_DATA2_A_MARK, VI4_DATA3_A_MARK,
-       VI4_DATA4_A_MARK, VI4_DATA5_A_MARK,
-       VI4_DATA6_A_MARK, VI4_DATA7_A_MARK,
-       VI4_DATA8_MARK,   VI4_DATA9_MARK,
-};
-
-static const unsigned int vin4_data12_a_pins[] = {
-       RCAR_GP_PIN(2, 6),  RCAR_GP_PIN(2, 7),
-       RCAR_GP_PIN(2, 8),  RCAR_GP_PIN(2, 9),
-       RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
-       RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
-       RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
-       RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
-};
-
-static const unsigned int vin4_data12_a_mux[] = {
-       VI4_DATA0_A_MARK, VI4_DATA1_A_MARK,
-       VI4_DATA2_A_MARK, VI4_DATA3_A_MARK,
-       VI4_DATA4_A_MARK, VI4_DATA5_A_MARK,
-       VI4_DATA6_A_MARK, VI4_DATA7_A_MARK,
-       VI4_DATA8_MARK,   VI4_DATA9_MARK,
-       VI4_DATA10_MARK,  VI4_DATA11_MARK,
-};
-
-static const unsigned int vin4_data16_a_pins[] = {
-       RCAR_GP_PIN(2, 6),  RCAR_GP_PIN(2, 7),
-       RCAR_GP_PIN(2, 8),  RCAR_GP_PIN(2, 9),
-       RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
-       RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
-       RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
-       RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
-       RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 10),
-       RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
-};
-
-static const unsigned int vin4_data16_a_mux[] = {
-       VI4_DATA0_A_MARK, VI4_DATA1_A_MARK,
-       VI4_DATA2_A_MARK, VI4_DATA3_A_MARK,
-       VI4_DATA4_A_MARK, VI4_DATA5_A_MARK,
-       VI4_DATA6_A_MARK, VI4_DATA7_A_MARK,
-       VI4_DATA8_MARK,   VI4_DATA9_MARK,
-       VI4_DATA10_MARK,  VI4_DATA11_MARK,
-       VI4_DATA12_MARK,  VI4_DATA13_MARK,
-       VI4_DATA14_MARK,  VI4_DATA15_MARK,
-};
-
-static const unsigned int vin4_data20_a_pins[] = {
-       RCAR_GP_PIN(2, 6),  RCAR_GP_PIN(2, 7),
-       RCAR_GP_PIN(2, 8),  RCAR_GP_PIN(2, 9),
-       RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
-       RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
-       RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
        RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
        RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 10),
        RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
-       RCAR_GP_PIN(1, 9),  RCAR_GP_PIN(1, 12),
-       RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
-};
-
-static const unsigned int vin4_data20_a_mux[] = {
-       VI4_DATA0_A_MARK, VI4_DATA1_A_MARK,
-       VI4_DATA2_A_MARK, VI4_DATA3_A_MARK,
-       VI4_DATA4_A_MARK, VI4_DATA5_A_MARK,
-       VI4_DATA6_A_MARK, VI4_DATA7_A_MARK,
-       VI4_DATA8_MARK,   VI4_DATA9_MARK,
-       VI4_DATA10_MARK,  VI4_DATA11_MARK,
-       VI4_DATA12_MARK,  VI4_DATA13_MARK,
-       VI4_DATA14_MARK,  VI4_DATA15_MARK,
-       VI4_DATA16_MARK,  VI4_DATA17_MARK,
-       VI4_DATA18_MARK,  VI4_DATA19_MARK,
-};
-
-static const unsigned int vin4_data24_a_pins[] = {
-       RCAR_GP_PIN(2, 6),  RCAR_GP_PIN(2, 7),
-       RCAR_GP_PIN(2, 8),  RCAR_GP_PIN(2, 9),
-       RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
-       RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
-       RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
-       RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
-       RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 10),
-       RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
-       RCAR_GP_PIN(1, 9),  RCAR_GP_PIN(1, 12),
        RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
        RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
        RCAR_GP_PIN(1, 19), RCAR_GP_PIN(0, 1),
 };
 
-static const unsigned int vin4_data24_a_mux[] = {
-       VI4_DATA0_A_MARK, VI4_DATA1_A_MARK,
+static const unsigned int vin4_data18_a_mux[] = {
        VI4_DATA2_A_MARK, VI4_DATA3_A_MARK,
        VI4_DATA4_A_MARK, VI4_DATA5_A_MARK,
        VI4_DATA6_A_MARK, VI4_DATA7_A_MARK,
-       VI4_DATA8_MARK,   VI4_DATA9_MARK,
        VI4_DATA10_MARK,  VI4_DATA11_MARK,
        VI4_DATA12_MARK,  VI4_DATA13_MARK,
        VI4_DATA14_MARK,  VI4_DATA15_MARK,
-       VI4_DATA16_MARK,  VI4_DATA17_MARK,
        VI4_DATA18_MARK,  VI4_DATA19_MARK,
        VI4_DATA20_MARK,  VI4_DATA21_MARK,
        VI4_DATA22_MARK,  VI4_DATA23_MARK,
 };
 
-static const unsigned int vin4_data8_b_pins[] = {
-       RCAR_GP_PIN(1, 8),  RCAR_GP_PIN(1, 11),
-       RCAR_GP_PIN(1, 21), RCAR_GP_PIN(1, 22),
-       RCAR_GP_PIN(0, 5),  RCAR_GP_PIN(0, 6),
-       RCAR_GP_PIN(0, 16), RCAR_GP_PIN(0, 17),
-};
-
-static const unsigned int vin4_data8_b_mux[] = {
-       VI4_DATA0_B_MARK, VI4_DATA1_B_MARK,
-       VI4_DATA2_B_MARK, VI4_DATA3_B_MARK,
-       VI4_DATA4_B_MARK, VI4_DATA5_B_MARK,
-       VI4_DATA6_B_MARK, VI4_DATA7_B_MARK,
-};
-
-static const unsigned int vin4_data10_b_pins[] = {
-       RCAR_GP_PIN(1, 8),  RCAR_GP_PIN(1, 11),
-       RCAR_GP_PIN(1, 21), RCAR_GP_PIN(1, 22),
-       RCAR_GP_PIN(0, 5),  RCAR_GP_PIN(0, 6),
-       RCAR_GP_PIN(0, 16), RCAR_GP_PIN(0, 17),
-       RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
-};
-
-static const unsigned int vin4_data10_b_mux[] = {
-       VI4_DATA0_B_MARK, VI4_DATA1_B_MARK,
-       VI4_DATA2_B_MARK, VI4_DATA3_B_MARK,
-       VI4_DATA4_B_MARK, VI4_DATA5_B_MARK,
-       VI4_DATA6_B_MARK, VI4_DATA7_B_MARK,
-       VI4_DATA8_MARK,   VI4_DATA9_MARK,
-};
-
-static const unsigned int vin4_data12_b_pins[] = {
-       RCAR_GP_PIN(1, 8),  RCAR_GP_PIN(1, 11),
-       RCAR_GP_PIN(1, 21), RCAR_GP_PIN(1, 22),
-       RCAR_GP_PIN(0, 5),  RCAR_GP_PIN(0, 6),
-       RCAR_GP_PIN(0, 16), RCAR_GP_PIN(0, 17),
-       RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
-       RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
-};
-
-static const unsigned int vin4_data12_b_mux[] = {
-       VI4_DATA0_B_MARK, VI4_DATA1_B_MARK,
-       VI4_DATA2_B_MARK, VI4_DATA3_B_MARK,
-       VI4_DATA4_B_MARK, VI4_DATA5_B_MARK,
-       VI4_DATA6_B_MARK, VI4_DATA7_B_MARK,
-       VI4_DATA8_MARK,   VI4_DATA9_MARK,
-       VI4_DATA10_MARK,  VI4_DATA11_MARK,
-};
-
-static const unsigned int vin4_data16_b_pins[] = {
-       RCAR_GP_PIN(1, 8),  RCAR_GP_PIN(1, 11),
-       RCAR_GP_PIN(1, 21), RCAR_GP_PIN(1, 22),
-       RCAR_GP_PIN(0, 5),  RCAR_GP_PIN(0, 6),
-       RCAR_GP_PIN(0, 16), RCAR_GP_PIN(0, 17),
-       RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
-       RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
-       RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 10),
-       RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
+static const union vin_data vin4_data_a_pins = {
+       .data24 = {
+               RCAR_GP_PIN(2, 6),  RCAR_GP_PIN(2, 7),
+               RCAR_GP_PIN(2, 8),  RCAR_GP_PIN(2, 9),
+               RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
+               RCAR_GP_PIN(2, 12), RCAR_GP_PIN(2, 13),
+               RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
+               RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
+               RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 10),
+               RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
+               RCAR_GP_PIN(1, 9),  RCAR_GP_PIN(1, 12),
+               RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
+               RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
+               RCAR_GP_PIN(1, 19), RCAR_GP_PIN(0, 1),
+       },
 };
 
-static const unsigned int vin4_data16_b_mux[] = {
-       VI4_DATA0_B_MARK, VI4_DATA1_B_MARK,
-       VI4_DATA2_B_MARK, VI4_DATA3_B_MARK,
-       VI4_DATA4_B_MARK, VI4_DATA5_B_MARK,
-       VI4_DATA6_B_MARK, VI4_DATA7_B_MARK,
-       VI4_DATA8_MARK,   VI4_DATA9_MARK,
-       VI4_DATA10_MARK,  VI4_DATA11_MARK,
-       VI4_DATA12_MARK,  VI4_DATA13_MARK,
-       VI4_DATA14_MARK,  VI4_DATA15_MARK,
+static const union vin_data vin4_data_a_mux = {
+       .data24 = {
+               VI4_DATA0_A_MARK, VI4_DATA1_A_MARK,
+               VI4_DATA2_A_MARK, VI4_DATA3_A_MARK,
+               VI4_DATA4_A_MARK, VI4_DATA5_A_MARK,
+               VI4_DATA6_A_MARK, VI4_DATA7_A_MARK,
+               VI4_DATA8_MARK,   VI4_DATA9_MARK,
+               VI4_DATA10_MARK,  VI4_DATA11_MARK,
+               VI4_DATA12_MARK,  VI4_DATA13_MARK,
+               VI4_DATA14_MARK,  VI4_DATA15_MARK,
+               VI4_DATA16_MARK,  VI4_DATA17_MARK,
+               VI4_DATA18_MARK,  VI4_DATA19_MARK,
+               VI4_DATA20_MARK,  VI4_DATA21_MARK,
+               VI4_DATA22_MARK,  VI4_DATA23_MARK,
+       },
 };
 
-static const unsigned int vin4_data20_b_pins[] = {
-       RCAR_GP_PIN(1, 8),  RCAR_GP_PIN(1, 11),
+static const unsigned int vin4_data18_b_pins[] = {
        RCAR_GP_PIN(1, 21), RCAR_GP_PIN(1, 22),
        RCAR_GP_PIN(0, 5),  RCAR_GP_PIN(0, 6),
        RCAR_GP_PIN(0, 16), RCAR_GP_PIN(0, 17),
-       RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
        RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
        RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 10),
        RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
-       RCAR_GP_PIN(1, 9),  RCAR_GP_PIN(1, 12),
        RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
-};
-
-static const unsigned int vin4_data20_b_mux[] = {
-       VI4_DATA0_B_MARK, VI4_DATA1_B_MARK,
-       VI4_DATA2_B_MARK, VI4_DATA3_B_MARK,
-       VI4_DATA4_B_MARK, VI4_DATA5_B_MARK,
-       VI4_DATA6_B_MARK, VI4_DATA7_B_MARK,
-       VI4_DATA8_MARK,   VI4_DATA9_MARK,
-       VI4_DATA10_MARK,  VI4_DATA11_MARK,
-       VI4_DATA12_MARK,  VI4_DATA13_MARK,
-       VI4_DATA14_MARK,  VI4_DATA15_MARK,
-       VI4_DATA16_MARK,  VI4_DATA17_MARK,
-       VI4_DATA18_MARK,  VI4_DATA19_MARK,
-};
-
-static const unsigned int vin4_data24_b_pins[] = {
-       RCAR_GP_PIN(1, 8),  RCAR_GP_PIN(1, 11),
-       RCAR_GP_PIN(1, 21), RCAR_GP_PIN(1, 22),
-       RCAR_GP_PIN(0, 5),  RCAR_GP_PIN(0, 6),
-       RCAR_GP_PIN(0, 16), RCAR_GP_PIN(0, 17),
-       RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
-       RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
-       RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 10),
-       RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
-       RCAR_GP_PIN(1, 9),  RCAR_GP_PIN(1, 12),
-       RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 15),
        RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
        RCAR_GP_PIN(1, 19), RCAR_GP_PIN(0, 1),
 };
 
-static const unsigned int vin4_data24_b_mux[] = {
-       VI4_DATA0_B_MARK, VI4_DATA1_B_MARK,
+static const unsigned int vin4_data18_b_mux[] = {
        VI4_DATA2_B_MARK, VI4_DATA3_B_MARK,
        VI4_DATA4_B_MARK, VI4_DATA5_B_MARK,
        VI4_DATA6_B_MARK, VI4_DATA7_B_MARK,
-       VI4_DATA8_MARK,   VI4_DATA9_MARK,
        VI4_DATA10_MARK,  VI4_DATA11_MARK,
        VI4_DATA12_MARK,  VI4_DATA13_MARK,
        VI4_DATA14_MARK,  VI4_DATA15_MARK,
-       VI4_DATA16_MARK,  VI4_DATA17_MARK,
        VI4_DATA18_MARK,  VI4_DATA19_MARK,
        VI4_DATA20_MARK,  VI4_DATA21_MARK,
        VI4_DATA22_MARK,  VI4_DATA23_MARK,
 };
 
-static const unsigned int vin4_data8_sft8_pins[] = {
-       RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
-       RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
-       RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 10),
-       RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
+static const union vin_data vin4_data_b_pins = {
+       .data24 = {
+               RCAR_GP_PIN(1, 8),  RCAR_GP_PIN(1, 11),
+               RCAR_GP_PIN(1, 21), RCAR_GP_PIN(1, 22),
+               RCAR_GP_PIN(0, 5),  RCAR_GP_PIN(0, 6),
+               RCAR_GP_PIN(0, 16), RCAR_GP_PIN(0, 17),
+               RCAR_GP_PIN(1, 4),  RCAR_GP_PIN(1, 5),
+               RCAR_GP_PIN(1, 6),  RCAR_GP_PIN(1, 7),
+               RCAR_GP_PIN(1, 3),  RCAR_GP_PIN(1, 10),
+               RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
+               RCAR_GP_PIN(1, 9),  RCAR_GP_PIN(1, 12),
+               RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
+               RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
+               RCAR_GP_PIN(1, 19), RCAR_GP_PIN(0, 1),
+       },
 };
 
-static const unsigned int vin4_data8_sft8_mux[] = {
-       VI4_DATA8_MARK,  VI4_DATA9_MARK,
-       VI4_DATA10_MARK, VI4_DATA11_MARK,
-       VI4_DATA12_MARK, VI4_DATA13_MARK,
-       VI4_DATA14_MARK, VI4_DATA15_MARK,
+static const union vin_data vin4_data_b_mux = {
+       .data24 = {
+               VI4_DATA0_B_MARK, VI4_DATA1_B_MARK,
+               VI4_DATA2_B_MARK, VI4_DATA3_B_MARK,
+               VI4_DATA4_B_MARK, VI4_DATA5_B_MARK,
+               VI4_DATA6_B_MARK, VI4_DATA7_B_MARK,
+               VI4_DATA8_MARK,   VI4_DATA9_MARK,
+               VI4_DATA10_MARK,  VI4_DATA11_MARK,
+               VI4_DATA12_MARK,  VI4_DATA13_MARK,
+               VI4_DATA14_MARK,  VI4_DATA15_MARK,
+               VI4_DATA16_MARK,  VI4_DATA17_MARK,
+               VI4_DATA18_MARK,  VI4_DATA19_MARK,
+               VI4_DATA20_MARK,  VI4_DATA21_MARK,
+               VI4_DATA22_MARK,  VI4_DATA23_MARK,
+       },
 };
 
 static const unsigned int vin4_sync_pins[] = {
@@ -3807,88 +3687,30 @@ static const unsigned int vin4_clk_mux[] = {
 };
 
 /* - VIN5 ------------------------------------------------------------------- */
-static const unsigned int vin5_data8_a_pins[] = {
-       RCAR_GP_PIN(1, 1),  RCAR_GP_PIN(1, 2),
-       RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 12),
-       RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
-       RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
-};
-
-static const unsigned int vin5_data8_a_mux[] = {
-       VI5_DATA0_A_MARK,  VI5_DATA1_A_MARK,
-       VI5_DATA2_A_MARK,  VI5_DATA3_A_MARK,
-       VI5_DATA4_A_MARK,  VI5_DATA5_A_MARK,
-       VI5_DATA6_A_MARK,  VI5_DATA7_A_MARK,
-};
-
-static const unsigned int vin5_data8_sft8_a_pins[] = {
-       RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
-       RCAR_GP_PIN(0, 9),  RCAR_GP_PIN(0, 11),
-       RCAR_GP_PIN(0, 8),  RCAR_GP_PIN(0, 10),
-       RCAR_GP_PIN(0, 2),  RCAR_GP_PIN(0, 3),
-};
-
-static const unsigned int vin5_data8_sft8_a_mux[] = {
-       VI5_DATA8_A_MARK,  VI5_DATA9_A_MARK,
-       VI5_DATA10_A_MARK, VI5_DATA11_A_MARK,
-       VI5_DATA12_A_MARK, VI5_DATA13_A_MARK,
-       VI5_DATA14_A_MARK, VI5_DATA15_A_MARK,
-};
-
-static const unsigned int vin5_data10_a_pins[] = {
-       RCAR_GP_PIN(1, 1),  RCAR_GP_PIN(1, 2),
-       RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 12),
-       RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
-       RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
-       RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
-};
-
-static const unsigned int vin5_data10_a_mux[] = {
-       VI5_DATA0_A_MARK,  VI5_DATA1_A_MARK,
-       VI5_DATA2_A_MARK,  VI5_DATA3_A_MARK,
-       VI5_DATA4_A_MARK,  VI5_DATA5_A_MARK,
-       VI5_DATA6_A_MARK,  VI5_DATA7_A_MARK,
-       VI5_DATA8_A_MARK,  VI5_DATA9_A_MARK,
-};
-
-static const unsigned int vin5_data12_a_pins[] = {
-       RCAR_GP_PIN(1, 1),  RCAR_GP_PIN(1, 2),
-       RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 12),
-       RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
-       RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
-       RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
-       RCAR_GP_PIN(0, 9),  RCAR_GP_PIN(0, 11),
-};
-
-static const unsigned int vin5_data12_a_mux[] = {
-       VI5_DATA0_A_MARK,  VI5_DATA1_A_MARK,
-       VI5_DATA2_A_MARK,  VI5_DATA3_A_MARK,
-       VI5_DATA4_A_MARK,  VI5_DATA5_A_MARK,
-       VI5_DATA6_A_MARK,  VI5_DATA7_A_MARK,
-       VI5_DATA8_A_MARK,  VI5_DATA9_A_MARK,
-       VI5_DATA10_A_MARK, VI5_DATA11_A_MARK,
-};
-
-static const unsigned int vin5_data16_a_pins[] = {
-       RCAR_GP_PIN(1, 1),  RCAR_GP_PIN(1, 2),
-       RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 12),
-       RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
-       RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
-       RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
-       RCAR_GP_PIN(0, 9),  RCAR_GP_PIN(0, 11),
-       RCAR_GP_PIN(0, 8),  RCAR_GP_PIN(0, 10),
-       RCAR_GP_PIN(0, 2),  RCAR_GP_PIN(0, 3),
+static const union vin_data16 vin5_data_a_pins = {
+       .data16 = {
+               RCAR_GP_PIN(1, 1),  RCAR_GP_PIN(1, 2),
+               RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 12),
+               RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 16),
+               RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 18),
+               RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 13),
+               RCAR_GP_PIN(0, 9),  RCAR_GP_PIN(0, 11),
+               RCAR_GP_PIN(0, 8),  RCAR_GP_PIN(0, 10),
+               RCAR_GP_PIN(0, 2),  RCAR_GP_PIN(0, 3),
+       },
 };
 
-static const unsigned int vin5_data16_a_mux[] = {
-       VI5_DATA0_A_MARK,  VI5_DATA1_A_MARK,
-       VI5_DATA2_A_MARK,  VI5_DATA3_A_MARK,
-       VI5_DATA4_A_MARK,  VI5_DATA5_A_MARK,
-       VI5_DATA6_A_MARK,  VI5_DATA7_A_MARK,
-       VI5_DATA8_A_MARK,  VI5_DATA9_A_MARK,
-       VI5_DATA10_A_MARK, VI5_DATA11_A_MARK,
-       VI5_DATA12_A_MARK, VI5_DATA13_A_MARK,
-       VI5_DATA14_A_MARK, VI5_DATA15_A_MARK,
+static const union vin_data16 vin5_data_a_mux = {
+       .data16 = {
+               VI5_DATA0_A_MARK,  VI5_DATA1_A_MARK,
+               VI5_DATA2_A_MARK,  VI5_DATA3_A_MARK,
+               VI5_DATA4_A_MARK,  VI5_DATA5_A_MARK,
+               VI5_DATA6_A_MARK,  VI5_DATA7_A_MARK,
+               VI5_DATA8_A_MARK,  VI5_DATA9_A_MARK,
+               VI5_DATA10_A_MARK, VI5_DATA11_A_MARK,
+               VI5_DATA12_A_MARK, VI5_DATA13_A_MARK,
+               VI5_DATA14_A_MARK, VI5_DATA15_A_MARK,
+       },
 };
 
 static const unsigned int vin5_data8_b_pins[] = {
@@ -3946,270 +3768,282 @@ static const unsigned int vin5_clk_b_mux[] = {
        VI5_CLK_B_MARK,
 };
 
-static const struct sh_pfc_pin_group pinmux_groups[] = {
-       SH_PFC_PIN_GROUP(audio_clk_a),
-       SH_PFC_PIN_GROUP(audio_clk_b_a),
-       SH_PFC_PIN_GROUP(audio_clk_b_b),
-       SH_PFC_PIN_GROUP(audio_clk_b_c),
-       SH_PFC_PIN_GROUP(audio_clk_c_a),
-       SH_PFC_PIN_GROUP(audio_clk_c_b),
-       SH_PFC_PIN_GROUP(audio_clk_c_c),
-       SH_PFC_PIN_GROUP(audio_clkout_a),
-       SH_PFC_PIN_GROUP(audio_clkout_b),
-       SH_PFC_PIN_GROUP(audio_clkout1_a),
-       SH_PFC_PIN_GROUP(audio_clkout1_b),
-       SH_PFC_PIN_GROUP(audio_clkout1_c),
-       SH_PFC_PIN_GROUP(audio_clkout2_a),
-       SH_PFC_PIN_GROUP(audio_clkout2_b),
-       SH_PFC_PIN_GROUP(audio_clkout2_c),
-       SH_PFC_PIN_GROUP(audio_clkout3_a),
-       SH_PFC_PIN_GROUP(audio_clkout3_b),
-       SH_PFC_PIN_GROUP(audio_clkout3_c),
-       SH_PFC_PIN_GROUP(avb_link),
-       SH_PFC_PIN_GROUP(avb_magic),
-       SH_PFC_PIN_GROUP(avb_phy_int),
-       SH_PFC_PIN_GROUP(avb_mii),
-       SH_PFC_PIN_GROUP(avb_avtp_pps),
-       SH_PFC_PIN_GROUP(avb_avtp_match_a),
-       SH_PFC_PIN_GROUP(avb_avtp_capture_a),
-       SH_PFC_PIN_GROUP(can0_data),
-       SH_PFC_PIN_GROUP(can1_data),
-       SH_PFC_PIN_GROUP(can_clk),
-       SH_PFC_PIN_GROUP(canfd0_data),
-       SH_PFC_PIN_GROUP(canfd1_data),
-       SH_PFC_PIN_GROUP(drif0_ctrl_a),
-       SH_PFC_PIN_GROUP(drif0_data0_a),
-       SH_PFC_PIN_GROUP(drif0_data1_a),
-       SH_PFC_PIN_GROUP(drif0_ctrl_b),
-       SH_PFC_PIN_GROUP(drif0_data0_b),
-       SH_PFC_PIN_GROUP(drif0_data1_b),
-       SH_PFC_PIN_GROUP(drif1_ctrl),
-       SH_PFC_PIN_GROUP(drif1_data0),
-       SH_PFC_PIN_GROUP(drif1_data1),
-       SH_PFC_PIN_GROUP(drif2_ctrl_a),
-       SH_PFC_PIN_GROUP(drif2_data0_a),
-       SH_PFC_PIN_GROUP(drif2_data1_a),
-       SH_PFC_PIN_GROUP(drif2_ctrl_b),
-       SH_PFC_PIN_GROUP(drif2_data0_b),
-       SH_PFC_PIN_GROUP(drif2_data1_b),
-       SH_PFC_PIN_GROUP(drif3_ctrl_a),
-       SH_PFC_PIN_GROUP(drif3_data0_a),
-       SH_PFC_PIN_GROUP(drif3_data1_a),
-       SH_PFC_PIN_GROUP(drif3_ctrl_b),
-       SH_PFC_PIN_GROUP(drif3_data0_b),
-       SH_PFC_PIN_GROUP(drif3_data1_b),
-       SH_PFC_PIN_GROUP(du_rgb666),
-       SH_PFC_PIN_GROUP(du_rgb888),
-       SH_PFC_PIN_GROUP(du_clk_out_0),
-       SH_PFC_PIN_GROUP(du_sync),
-       SH_PFC_PIN_GROUP(du_cde),
-       SH_PFC_PIN_GROUP(du_disp),
-       SH_PFC_PIN_GROUP(du_disp_cde),
-       SH_PFC_PIN_GROUP(du_clk_in_0),
-       SH_PFC_PIN_GROUP(du_clk_in_1),
-       SH_PFC_PIN_GROUP(hscif0_data_a),
-       SH_PFC_PIN_GROUP(hscif0_clk_a),
-       SH_PFC_PIN_GROUP(hscif0_ctrl_a),
-       SH_PFC_PIN_GROUP(hscif0_data_b),
-       SH_PFC_PIN_GROUP(hscif0_clk_b),
-       SH_PFC_PIN_GROUP(hscif1_data_a),
-       SH_PFC_PIN_GROUP(hscif1_clk_a),
-       SH_PFC_PIN_GROUP(hscif1_data_b),
-       SH_PFC_PIN_GROUP(hscif1_clk_b),
-       SH_PFC_PIN_GROUP(hscif1_ctrl_b),
-       SH_PFC_PIN_GROUP(hscif2_data_a),
-       SH_PFC_PIN_GROUP(hscif2_clk_a),
-       SH_PFC_PIN_GROUP(hscif2_ctrl_a),
-       SH_PFC_PIN_GROUP(hscif2_data_b),
-       SH_PFC_PIN_GROUP(hscif3_data_a),
-       SH_PFC_PIN_GROUP(hscif3_data_b),
-       SH_PFC_PIN_GROUP(hscif3_clk_b),
-       SH_PFC_PIN_GROUP(hscif3_data_c),
-       SH_PFC_PIN_GROUP(hscif3_clk_c),
-       SH_PFC_PIN_GROUP(hscif3_ctrl_c),
-       SH_PFC_PIN_GROUP(hscif3_data_d),
-       SH_PFC_PIN_GROUP(hscif3_data_e),
-       SH_PFC_PIN_GROUP(hscif3_ctrl_e),
-       SH_PFC_PIN_GROUP(hscif4_data_a),
-       SH_PFC_PIN_GROUP(hscif4_clk_a),
-       SH_PFC_PIN_GROUP(hscif4_ctrl_a),
-       SH_PFC_PIN_GROUP(hscif4_data_b),
-       SH_PFC_PIN_GROUP(hscif4_clk_b),
-       SH_PFC_PIN_GROUP(hscif4_data_c),
-       SH_PFC_PIN_GROUP(hscif4_data_d),
-       SH_PFC_PIN_GROUP(hscif4_data_e),
-       SH_PFC_PIN_GROUP(i2c1_a),
-       SH_PFC_PIN_GROUP(i2c1_b),
-       SH_PFC_PIN_GROUP(i2c1_c),
-       SH_PFC_PIN_GROUP(i2c1_d),
-       SH_PFC_PIN_GROUP(i2c2_a),
-       SH_PFC_PIN_GROUP(i2c2_b),
-       SH_PFC_PIN_GROUP(i2c2_c),
-       SH_PFC_PIN_GROUP(i2c2_d),
-       SH_PFC_PIN_GROUP(i2c2_e),
-       SH_PFC_PIN_GROUP(i2c4),
-       SH_PFC_PIN_GROUP(i2c5),
-       SH_PFC_PIN_GROUP(i2c6_a),
-       SH_PFC_PIN_GROUP(i2c6_b),
-       SH_PFC_PIN_GROUP(i2c7_a),
-       SH_PFC_PIN_GROUP(i2c7_b),
-       SH_PFC_PIN_GROUP(intc_ex_irq0),
-       SH_PFC_PIN_GROUP(msiof0_clk),
-       SH_PFC_PIN_GROUP(msiof0_sync),
-       SH_PFC_PIN_GROUP(msiof0_ss1),
-       SH_PFC_PIN_GROUP(msiof0_ss2),
-       SH_PFC_PIN_GROUP(msiof0_txd),
-       SH_PFC_PIN_GROUP(msiof0_rxd),
-       SH_PFC_PIN_GROUP(msiof1_clk),
-       SH_PFC_PIN_GROUP(msiof1_sync),
-       SH_PFC_PIN_GROUP(msiof1_ss1),
-       SH_PFC_PIN_GROUP(msiof1_ss2),
-       SH_PFC_PIN_GROUP(msiof1_txd),
-       SH_PFC_PIN_GROUP(msiof1_rxd),
-       SH_PFC_PIN_GROUP(msiof2_clk_a),
-       SH_PFC_PIN_GROUP(msiof2_sync_a),
-       SH_PFC_PIN_GROUP(msiof2_ss1_a),
-       SH_PFC_PIN_GROUP(msiof2_ss2_a),
-       SH_PFC_PIN_GROUP(msiof2_txd_a),
-       SH_PFC_PIN_GROUP(msiof2_rxd_a),
-       SH_PFC_PIN_GROUP(msiof2_clk_b),
-       SH_PFC_PIN_GROUP(msiof2_sync_b),
-       SH_PFC_PIN_GROUP(msiof2_ss1_b),
-       SH_PFC_PIN_GROUP(msiof2_ss2_b),
-       SH_PFC_PIN_GROUP(msiof2_txd_b),
-       SH_PFC_PIN_GROUP(msiof2_rxd_b),
-       SH_PFC_PIN_GROUP(msiof3_clk_a),
-       SH_PFC_PIN_GROUP(msiof3_sync_a),
-       SH_PFC_PIN_GROUP(msiof3_ss1_a),
-       SH_PFC_PIN_GROUP(msiof3_ss2_a),
-       SH_PFC_PIN_GROUP(msiof3_txd_a),
-       SH_PFC_PIN_GROUP(msiof3_rxd_a),
-       SH_PFC_PIN_GROUP(msiof3_clk_b),
-       SH_PFC_PIN_GROUP(msiof3_sync_b),
-       SH_PFC_PIN_GROUP(msiof3_ss1_b),
-       SH_PFC_PIN_GROUP(msiof3_txd_b),
-       SH_PFC_PIN_GROUP(msiof3_rxd_b),
-       SH_PFC_PIN_GROUP(pwm0_a),
-       SH_PFC_PIN_GROUP(pwm0_b),
-       SH_PFC_PIN_GROUP(pwm1_a),
-       SH_PFC_PIN_GROUP(pwm1_b),
-       SH_PFC_PIN_GROUP(pwm2_a),
-       SH_PFC_PIN_GROUP(pwm2_b),
-       SH_PFC_PIN_GROUP(pwm2_c),
-       SH_PFC_PIN_GROUP(pwm3_a),
-       SH_PFC_PIN_GROUP(pwm3_b),
-       SH_PFC_PIN_GROUP(pwm3_c),
-       SH_PFC_PIN_GROUP(pwm4_a),
-       SH_PFC_PIN_GROUP(pwm4_b),
-       SH_PFC_PIN_GROUP(pwm5_a),
-       SH_PFC_PIN_GROUP(pwm5_b),
-       SH_PFC_PIN_GROUP(pwm6_a),
-       SH_PFC_PIN_GROUP(pwm6_b),
-       SH_PFC_PIN_GROUP(scif0_data_a),
-       SH_PFC_PIN_GROUP(scif0_clk_a),
-       SH_PFC_PIN_GROUP(scif0_ctrl_a),
-       SH_PFC_PIN_GROUP(scif0_data_b),
-       SH_PFC_PIN_GROUP(scif0_clk_b),
-       SH_PFC_PIN_GROUP(scif1_data),
-       SH_PFC_PIN_GROUP(scif1_clk),
-       SH_PFC_PIN_GROUP(scif1_ctrl),
-       SH_PFC_PIN_GROUP(scif2_data_a),
-       SH_PFC_PIN_GROUP(scif2_clk_a),
-       SH_PFC_PIN_GROUP(scif2_data_b),
-       SH_PFC_PIN_GROUP(scif3_data_a),
-       SH_PFC_PIN_GROUP(scif3_clk_a),
-       SH_PFC_PIN_GROUP(scif3_ctrl_a),
-       SH_PFC_PIN_GROUP(scif3_data_b),
-       SH_PFC_PIN_GROUP(scif3_data_c),
-       SH_PFC_PIN_GROUP(scif3_clk_c),
-       SH_PFC_PIN_GROUP(scif4_data_a),
-       SH_PFC_PIN_GROUP(scif4_clk_a),
-       SH_PFC_PIN_GROUP(scif4_ctrl_a),
-       SH_PFC_PIN_GROUP(scif4_data_b),
-       SH_PFC_PIN_GROUP(scif4_clk_b),
-       SH_PFC_PIN_GROUP(scif4_data_c),
-       SH_PFC_PIN_GROUP(scif4_ctrl_c),
-       SH_PFC_PIN_GROUP(scif5_data_a),
-       SH_PFC_PIN_GROUP(scif5_clk_a),
-       SH_PFC_PIN_GROUP(scif5_data_b),
-       SH_PFC_PIN_GROUP(scif5_data_c),
-       SH_PFC_PIN_GROUP(scif_clk_a),
-       SH_PFC_PIN_GROUP(scif_clk_b),
-       SH_PFC_PIN_GROUP(sdhi0_data1),
-       SH_PFC_PIN_GROUP(sdhi0_data4),
-       SH_PFC_PIN_GROUP(sdhi0_ctrl),
-       SH_PFC_PIN_GROUP(sdhi0_cd),
-       SH_PFC_PIN_GROUP(sdhi0_wp),
-       SH_PFC_PIN_GROUP(sdhi1_data1),
-       SH_PFC_PIN_GROUP(sdhi1_data4),
-       SH_PFC_PIN_GROUP(sdhi1_ctrl),
-       SH_PFC_PIN_GROUP(sdhi1_cd),
-       SH_PFC_PIN_GROUP(sdhi1_wp),
-       SH_PFC_PIN_GROUP(sdhi3_data1),
-       SH_PFC_PIN_GROUP(sdhi3_data4),
-       SH_PFC_PIN_GROUP(sdhi3_data8),
-       SH_PFC_PIN_GROUP(sdhi3_ctrl),
-       SH_PFC_PIN_GROUP(sdhi3_cd),
-       SH_PFC_PIN_GROUP(sdhi3_wp),
-       SH_PFC_PIN_GROUP(sdhi3_ds),
-       SH_PFC_PIN_GROUP(ssi0_data),
-       SH_PFC_PIN_GROUP(ssi01239_ctrl),
-       SH_PFC_PIN_GROUP(ssi1_data),
-       SH_PFC_PIN_GROUP(ssi1_ctrl),
-       SH_PFC_PIN_GROUP(ssi2_data),
-       SH_PFC_PIN_GROUP(ssi2_ctrl_a),
-       SH_PFC_PIN_GROUP(ssi2_ctrl_b),
-       SH_PFC_PIN_GROUP(ssi3_data),
-       SH_PFC_PIN_GROUP(ssi349_ctrl),
-       SH_PFC_PIN_GROUP(ssi4_data),
-       SH_PFC_PIN_GROUP(ssi4_ctrl),
-       SH_PFC_PIN_GROUP(ssi5_data),
-       SH_PFC_PIN_GROUP(ssi5_ctrl),
-       SH_PFC_PIN_GROUP(ssi6_data),
-       SH_PFC_PIN_GROUP(ssi6_ctrl),
-       SH_PFC_PIN_GROUP(ssi7_data),
-       SH_PFC_PIN_GROUP(ssi78_ctrl),
-       SH_PFC_PIN_GROUP(ssi8_data),
-       SH_PFC_PIN_GROUP(ssi9_data),
-       SH_PFC_PIN_GROUP(ssi9_ctrl_a),
-       SH_PFC_PIN_GROUP(ssi9_ctrl_b),
-       SH_PFC_PIN_GROUP(tmu_tclk1_a),
-       SH_PFC_PIN_GROUP(tmu_tclk1_b),
-       SH_PFC_PIN_GROUP(tmu_tclk2_a),
-       SH_PFC_PIN_GROUP(tmu_tclk2_b),
-       SH_PFC_PIN_GROUP(usb0_a),
-       SH_PFC_PIN_GROUP(usb0_b),
-       SH_PFC_PIN_GROUP(usb0_id),
-       SH_PFC_PIN_GROUP(usb30),
-       SH_PFC_PIN_GROUP(usb30_id),
-       SH_PFC_PIN_GROUP(vin4_data8_a),
-       SH_PFC_PIN_GROUP(vin4_data10_a),
-       SH_PFC_PIN_GROUP(vin4_data12_a),
-       SH_PFC_PIN_GROUP(vin4_data16_a),
-       SH_PFC_PIN_GROUP(vin4_data20_a),
-       SH_PFC_PIN_GROUP(vin4_data24_a),
-       SH_PFC_PIN_GROUP(vin4_data8_b),
-       SH_PFC_PIN_GROUP(vin4_data10_b),
-       SH_PFC_PIN_GROUP(vin4_data12_b),
-       SH_PFC_PIN_GROUP(vin4_data16_b),
-       SH_PFC_PIN_GROUP(vin4_data20_b),
-       SH_PFC_PIN_GROUP(vin4_data24_b),
-       SH_PFC_PIN_GROUP(vin4_data8_sft8),
-       SH_PFC_PIN_GROUP(vin4_sync),
-       SH_PFC_PIN_GROUP(vin4_field),
-       SH_PFC_PIN_GROUP(vin4_clkenb),
-       SH_PFC_PIN_GROUP(vin4_clk),
-       SH_PFC_PIN_GROUP(vin5_data8_a),
-       SH_PFC_PIN_GROUP(vin5_data8_sft8_a),
-       SH_PFC_PIN_GROUP(vin5_data10_a),
-       SH_PFC_PIN_GROUP(vin5_data12_a),
-       SH_PFC_PIN_GROUP(vin5_data16_a),
-       SH_PFC_PIN_GROUP(vin5_data8_b),
-       SH_PFC_PIN_GROUP(vin5_sync_a),
-       SH_PFC_PIN_GROUP(vin5_field_a),
-       SH_PFC_PIN_GROUP(vin5_clkenb_a),
-       SH_PFC_PIN_GROUP(vin5_clk_a),
-       SH_PFC_PIN_GROUP(vin5_clk_b),
+static const struct {
+       struct sh_pfc_pin_group common[245];
+       struct sh_pfc_pin_group automotive[23];
+} pinmux_groups = {
+       .common = {
+               SH_PFC_PIN_GROUP(audio_clk_a),
+               SH_PFC_PIN_GROUP(audio_clk_b_a),
+               SH_PFC_PIN_GROUP(audio_clk_b_b),
+               SH_PFC_PIN_GROUP(audio_clk_b_c),
+               SH_PFC_PIN_GROUP(audio_clk_c_a),
+               SH_PFC_PIN_GROUP(audio_clk_c_b),
+               SH_PFC_PIN_GROUP(audio_clk_c_c),
+               SH_PFC_PIN_GROUP(audio_clkout_a),
+               SH_PFC_PIN_GROUP(audio_clkout_b),
+               SH_PFC_PIN_GROUP(audio_clkout1_a),
+               SH_PFC_PIN_GROUP(audio_clkout1_b),
+               SH_PFC_PIN_GROUP(audio_clkout1_c),
+               SH_PFC_PIN_GROUP(audio_clkout2_a),
+               SH_PFC_PIN_GROUP(audio_clkout2_b),
+               SH_PFC_PIN_GROUP(audio_clkout2_c),
+               SH_PFC_PIN_GROUP(audio_clkout3_a),
+               SH_PFC_PIN_GROUP(audio_clkout3_b),
+               SH_PFC_PIN_GROUP(audio_clkout3_c),
+               SH_PFC_PIN_GROUP(avb_link),
+               SH_PFC_PIN_GROUP(avb_magic),
+               SH_PFC_PIN_GROUP(avb_phy_int),
+               SH_PFC_PIN_GROUP(avb_mii),
+               SH_PFC_PIN_GROUP(avb_avtp_pps),
+               SH_PFC_PIN_GROUP(avb_avtp_match_a),
+               SH_PFC_PIN_GROUP(avb_avtp_capture_a),
+               SH_PFC_PIN_GROUP(can0_data),
+               SH_PFC_PIN_GROUP(can1_data),
+               SH_PFC_PIN_GROUP(can_clk),
+               SH_PFC_PIN_GROUP(du_rgb666),
+               SH_PFC_PIN_GROUP(du_rgb888),
+               SH_PFC_PIN_GROUP(du_clk_in_0),
+               SH_PFC_PIN_GROUP(du_clk_in_1),
+               SH_PFC_PIN_GROUP(du_clk_out_0),
+               SH_PFC_PIN_GROUP(du_sync),
+               SH_PFC_PIN_GROUP(du_disp_cde),
+               SH_PFC_PIN_GROUP(du_cde),
+               SH_PFC_PIN_GROUP(du_disp),
+               SH_PFC_PIN_GROUP(hscif0_data_a),
+               SH_PFC_PIN_GROUP(hscif0_clk_a),
+               SH_PFC_PIN_GROUP(hscif0_ctrl_a),
+               SH_PFC_PIN_GROUP(hscif0_data_b),
+               SH_PFC_PIN_GROUP(hscif0_clk_b),
+               SH_PFC_PIN_GROUP(hscif1_data_a),
+               SH_PFC_PIN_GROUP(hscif1_clk_a),
+               SH_PFC_PIN_GROUP(hscif1_data_b),
+               SH_PFC_PIN_GROUP(hscif1_clk_b),
+               SH_PFC_PIN_GROUP(hscif1_ctrl_b),
+               SH_PFC_PIN_GROUP(hscif2_data_a),
+               SH_PFC_PIN_GROUP(hscif2_clk_a),
+               SH_PFC_PIN_GROUP(hscif2_ctrl_a),
+               SH_PFC_PIN_GROUP(hscif2_data_b),
+               SH_PFC_PIN_GROUP(hscif3_data_a),
+               SH_PFC_PIN_GROUP(hscif3_data_b),
+               SH_PFC_PIN_GROUP(hscif3_clk_b),
+               SH_PFC_PIN_GROUP(hscif3_data_c),
+               SH_PFC_PIN_GROUP(hscif3_clk_c),
+               SH_PFC_PIN_GROUP(hscif3_ctrl_c),
+               SH_PFC_PIN_GROUP(hscif3_data_d),
+               SH_PFC_PIN_GROUP(hscif3_data_e),
+               SH_PFC_PIN_GROUP(hscif3_ctrl_e),
+               SH_PFC_PIN_GROUP(hscif4_data_a),
+               SH_PFC_PIN_GROUP(hscif4_clk_a),
+               SH_PFC_PIN_GROUP(hscif4_ctrl_a),
+               SH_PFC_PIN_GROUP(hscif4_data_b),
+               SH_PFC_PIN_GROUP(hscif4_clk_b),
+               SH_PFC_PIN_GROUP(hscif4_data_c),
+               SH_PFC_PIN_GROUP(hscif4_data_d),
+               SH_PFC_PIN_GROUP(hscif4_data_e),
+               SH_PFC_PIN_GROUP(i2c1_a),
+               SH_PFC_PIN_GROUP(i2c1_b),
+               SH_PFC_PIN_GROUP(i2c1_c),
+               SH_PFC_PIN_GROUP(i2c1_d),
+               SH_PFC_PIN_GROUP(i2c2_a),
+               SH_PFC_PIN_GROUP(i2c2_b),
+               SH_PFC_PIN_GROUP(i2c2_c),
+               SH_PFC_PIN_GROUP(i2c2_d),
+               SH_PFC_PIN_GROUP(i2c2_e),
+               SH_PFC_PIN_GROUP(i2c4),
+               SH_PFC_PIN_GROUP(i2c5),
+               SH_PFC_PIN_GROUP(i2c6_a),
+               SH_PFC_PIN_GROUP(i2c6_b),
+               SH_PFC_PIN_GROUP(i2c7_a),
+               SH_PFC_PIN_GROUP(i2c7_b),
+               SH_PFC_PIN_GROUP(intc_ex_irq0),
+               SH_PFC_PIN_GROUP(intc_ex_irq1),
+               SH_PFC_PIN_GROUP(intc_ex_irq2),
+               SH_PFC_PIN_GROUP(intc_ex_irq3),
+               SH_PFC_PIN_GROUP(intc_ex_irq4),
+               SH_PFC_PIN_GROUP(intc_ex_irq5),
+               SH_PFC_PIN_GROUP(msiof0_clk),
+               SH_PFC_PIN_GROUP(msiof0_sync),
+               SH_PFC_PIN_GROUP(msiof0_ss1),
+               SH_PFC_PIN_GROUP(msiof0_ss2),
+               SH_PFC_PIN_GROUP(msiof0_txd),
+               SH_PFC_PIN_GROUP(msiof0_rxd),
+               SH_PFC_PIN_GROUP(msiof1_clk),
+               SH_PFC_PIN_GROUP(msiof1_sync),
+               SH_PFC_PIN_GROUP(msiof1_ss1),
+               SH_PFC_PIN_GROUP(msiof1_ss2),
+               SH_PFC_PIN_GROUP(msiof1_txd),
+               SH_PFC_PIN_GROUP(msiof1_rxd),
+               SH_PFC_PIN_GROUP(msiof2_clk_a),
+               SH_PFC_PIN_GROUP(msiof2_sync_a),
+               SH_PFC_PIN_GROUP(msiof2_ss1_a),
+               SH_PFC_PIN_GROUP(msiof2_ss2_a),
+               SH_PFC_PIN_GROUP(msiof2_txd_a),
+               SH_PFC_PIN_GROUP(msiof2_rxd_a),
+               SH_PFC_PIN_GROUP(msiof2_clk_b),
+               SH_PFC_PIN_GROUP(msiof2_sync_b),
+               SH_PFC_PIN_GROUP(msiof2_ss1_b),
+               SH_PFC_PIN_GROUP(msiof2_ss2_b),
+               SH_PFC_PIN_GROUP(msiof2_txd_b),
+               SH_PFC_PIN_GROUP(msiof2_rxd_b),
+               SH_PFC_PIN_GROUP(msiof3_clk_a),
+               SH_PFC_PIN_GROUP(msiof3_sync_a),
+               SH_PFC_PIN_GROUP(msiof3_ss1_a),
+               SH_PFC_PIN_GROUP(msiof3_ss2_a),
+               SH_PFC_PIN_GROUP(msiof3_txd_a),
+               SH_PFC_PIN_GROUP(msiof3_rxd_a),
+               SH_PFC_PIN_GROUP(msiof3_clk_b),
+               SH_PFC_PIN_GROUP(msiof3_sync_b),
+               SH_PFC_PIN_GROUP(msiof3_ss1_b),
+               SH_PFC_PIN_GROUP(msiof3_txd_b),
+               SH_PFC_PIN_GROUP(msiof3_rxd_b),
+               SH_PFC_PIN_GROUP(pwm0_a),
+               SH_PFC_PIN_GROUP(pwm0_b),
+               SH_PFC_PIN_GROUP(pwm1_a),
+               SH_PFC_PIN_GROUP(pwm1_b),
+               SH_PFC_PIN_GROUP(pwm2_a),
+               SH_PFC_PIN_GROUP(pwm2_b),
+               SH_PFC_PIN_GROUP(pwm2_c),
+               SH_PFC_PIN_GROUP(pwm3_a),
+               SH_PFC_PIN_GROUP(pwm3_b),
+               SH_PFC_PIN_GROUP(pwm3_c),
+               SH_PFC_PIN_GROUP(pwm4_a),
+               SH_PFC_PIN_GROUP(pwm4_b),
+               SH_PFC_PIN_GROUP(pwm5_a),
+               SH_PFC_PIN_GROUP(pwm5_b),
+               SH_PFC_PIN_GROUP(pwm6_a),
+               SH_PFC_PIN_GROUP(pwm6_b),
+               SH_PFC_PIN_GROUP(scif0_data_a),
+               SH_PFC_PIN_GROUP(scif0_clk_a),
+               SH_PFC_PIN_GROUP(scif0_ctrl_a),
+               SH_PFC_PIN_GROUP(scif0_data_b),
+               SH_PFC_PIN_GROUP(scif0_clk_b),
+               SH_PFC_PIN_GROUP(scif1_data),
+               SH_PFC_PIN_GROUP(scif1_clk),
+               SH_PFC_PIN_GROUP(scif1_ctrl),
+               SH_PFC_PIN_GROUP(scif2_data_a),
+               SH_PFC_PIN_GROUP(scif2_clk_a),
+               SH_PFC_PIN_GROUP(scif2_data_b),
+               SH_PFC_PIN_GROUP(scif3_data_a),
+               SH_PFC_PIN_GROUP(scif3_clk_a),
+               SH_PFC_PIN_GROUP(scif3_ctrl_a),
+               SH_PFC_PIN_GROUP(scif3_data_b),
+               SH_PFC_PIN_GROUP(scif3_data_c),
+               SH_PFC_PIN_GROUP(scif3_clk_c),
+               SH_PFC_PIN_GROUP(scif4_data_a),
+               SH_PFC_PIN_GROUP(scif4_clk_a),
+               SH_PFC_PIN_GROUP(scif4_ctrl_a),
+               SH_PFC_PIN_GROUP(scif4_data_b),
+               SH_PFC_PIN_GROUP(scif4_clk_b),
+               SH_PFC_PIN_GROUP(scif4_data_c),
+               SH_PFC_PIN_GROUP(scif4_ctrl_c),
+               SH_PFC_PIN_GROUP(scif5_data_a),
+               SH_PFC_PIN_GROUP(scif5_clk_a),
+               SH_PFC_PIN_GROUP(scif5_data_b),
+               SH_PFC_PIN_GROUP(scif5_data_c),
+               SH_PFC_PIN_GROUP(scif_clk_a),
+               SH_PFC_PIN_GROUP(scif_clk_b),
+               SH_PFC_PIN_GROUP(sdhi0_data1),
+               SH_PFC_PIN_GROUP(sdhi0_data4),
+               SH_PFC_PIN_GROUP(sdhi0_ctrl),
+               SH_PFC_PIN_GROUP(sdhi0_cd),
+               SH_PFC_PIN_GROUP(sdhi0_wp),
+               SH_PFC_PIN_GROUP(sdhi1_data1),
+               SH_PFC_PIN_GROUP(sdhi1_data4),
+               SH_PFC_PIN_GROUP(sdhi1_ctrl),
+               SH_PFC_PIN_GROUP(sdhi1_cd),
+               SH_PFC_PIN_GROUP(sdhi1_wp),
+               SH_PFC_PIN_GROUP(sdhi3_data1),
+               SH_PFC_PIN_GROUP(sdhi3_data4),
+               SH_PFC_PIN_GROUP(sdhi3_data8),
+               SH_PFC_PIN_GROUP(sdhi3_ctrl),
+               SH_PFC_PIN_GROUP(sdhi3_cd),
+               SH_PFC_PIN_GROUP(sdhi3_wp),
+               SH_PFC_PIN_GROUP(sdhi3_ds),
+               SH_PFC_PIN_GROUP(ssi0_data),
+               SH_PFC_PIN_GROUP(ssi01239_ctrl),
+               SH_PFC_PIN_GROUP(ssi1_data),
+               SH_PFC_PIN_GROUP(ssi1_ctrl),
+               SH_PFC_PIN_GROUP(ssi2_data),
+               SH_PFC_PIN_GROUP(ssi2_ctrl_a),
+               SH_PFC_PIN_GROUP(ssi2_ctrl_b),
+               SH_PFC_PIN_GROUP(ssi3_data),
+               SH_PFC_PIN_GROUP(ssi349_ctrl),
+               SH_PFC_PIN_GROUP(ssi4_data),
+               SH_PFC_PIN_GROUP(ssi4_ctrl),
+               SH_PFC_PIN_GROUP(ssi5_data),
+               SH_PFC_PIN_GROUP(ssi5_ctrl),
+               SH_PFC_PIN_GROUP(ssi6_data),
+               SH_PFC_PIN_GROUP(ssi6_ctrl),
+               SH_PFC_PIN_GROUP(ssi7_data),
+               SH_PFC_PIN_GROUP(ssi78_ctrl),
+               SH_PFC_PIN_GROUP(ssi8_data),
+               SH_PFC_PIN_GROUP(ssi9_data),
+               SH_PFC_PIN_GROUP(ssi9_ctrl_a),
+               SH_PFC_PIN_GROUP(ssi9_ctrl_b),
+               SH_PFC_PIN_GROUP(tmu_tclk1_a),
+               SH_PFC_PIN_GROUP(tmu_tclk1_b),
+               SH_PFC_PIN_GROUP(tmu_tclk2_a),
+               SH_PFC_PIN_GROUP(tmu_tclk2_b),
+               SH_PFC_PIN_GROUP(usb0_a),
+               SH_PFC_PIN_GROUP(usb0_b),
+               SH_PFC_PIN_GROUP(usb0_id),
+               SH_PFC_PIN_GROUP(usb30),
+               SH_PFC_PIN_GROUP(usb30_id),
+               VIN_DATA_PIN_GROUP(vin4_data, 8, _a),
+               VIN_DATA_PIN_GROUP(vin4_data, 10, _a),
+               VIN_DATA_PIN_GROUP(vin4_data, 12, _a),
+               VIN_DATA_PIN_GROUP(vin4_data, 16, _a),
+               SH_PFC_PIN_GROUP(vin4_data18_a),
+               VIN_DATA_PIN_GROUP(vin4_data, 20, _a),
+               VIN_DATA_PIN_GROUP(vin4_data, 24, _a),
+               VIN_DATA_PIN_GROUP(vin4_data, 8, _b),
+               VIN_DATA_PIN_GROUP(vin4_data, 10, _b),
+               VIN_DATA_PIN_GROUP(vin4_data, 12, _b),
+               VIN_DATA_PIN_GROUP(vin4_data, 16, _b),
+               SH_PFC_PIN_GROUP(vin4_data18_b),
+               VIN_DATA_PIN_GROUP(vin4_data, 20, _b),
+               VIN_DATA_PIN_GROUP(vin4_data, 24, _b),
+               SH_PFC_PIN_GROUP(vin4_sync),
+               SH_PFC_PIN_GROUP(vin4_field),
+               SH_PFC_PIN_GROUP(vin4_clkenb),
+               SH_PFC_PIN_GROUP(vin4_clk),
+               VIN_DATA_PIN_GROUP(vin5_data, 8, _a),
+               VIN_DATA_PIN_GROUP(vin5_data, 10, _a),
+               VIN_DATA_PIN_GROUP(vin5_data, 12, _a),
+               VIN_DATA_PIN_GROUP(vin5_data, 16, _a),
+               SH_PFC_PIN_GROUP(vin5_data8_b),
+               SH_PFC_PIN_GROUP(vin5_sync_a),
+               SH_PFC_PIN_GROUP(vin5_field_a),
+               SH_PFC_PIN_GROUP(vin5_clkenb_a),
+               SH_PFC_PIN_GROUP(vin5_clk_a),
+               SH_PFC_PIN_GROUP(vin5_clk_b),
+       },
+       .automotive = {
+               SH_PFC_PIN_GROUP(canfd0_data),
+               SH_PFC_PIN_GROUP(canfd1_data),
+               SH_PFC_PIN_GROUP(drif0_ctrl_a),
+               SH_PFC_PIN_GROUP(drif0_data0_a),
+               SH_PFC_PIN_GROUP(drif0_data1_a),
+               SH_PFC_PIN_GROUP(drif0_ctrl_b),
+               SH_PFC_PIN_GROUP(drif0_data0_b),
+               SH_PFC_PIN_GROUP(drif0_data1_b),
+               SH_PFC_PIN_GROUP(drif1_ctrl),
+               SH_PFC_PIN_GROUP(drif1_data0),
+               SH_PFC_PIN_GROUP(drif1_data1),
+               SH_PFC_PIN_GROUP(drif2_ctrl_a),
+               SH_PFC_PIN_GROUP(drif2_data0_a),
+               SH_PFC_PIN_GROUP(drif2_data1_a),
+               SH_PFC_PIN_GROUP(drif2_ctrl_b),
+               SH_PFC_PIN_GROUP(drif2_data0_b),
+               SH_PFC_PIN_GROUP(drif2_data1_b),
+               SH_PFC_PIN_GROUP(drif3_ctrl_a),
+               SH_PFC_PIN_GROUP(drif3_data0_a),
+               SH_PFC_PIN_GROUP(drif3_data1_a),
+               SH_PFC_PIN_GROUP(drif3_ctrl_b),
+               SH_PFC_PIN_GROUP(drif3_data0_b),
+               SH_PFC_PIN_GROUP(drif3_data1_b),
+       }
 };
 
 static const char * const audio_clk_groups[] = {
@@ -4299,13 +4133,13 @@ static const char * const drif3_groups[] = {
 static const char * const du_groups[] = {
        "du_rgb666",
        "du_rgb888",
+       "du_clk_in_0",
+       "du_clk_in_1",
        "du_clk_out_0",
        "du_sync",
+       "du_disp_cde",
        "du_cde",
        "du_disp",
-       "du_disp_cde",
-       "du_clk_in_0",
-       "du_clk_in_1",
 };
 
 static const char * const hscif0_groups[] = {
@@ -4389,6 +4223,11 @@ static const char * const i2c7_groups[] = {
 
 static const char * const intc_ex_groups[] = {
        "intc_ex_irq0",
+       "intc_ex_irq1",
+       "intc_ex_irq2",
+       "intc_ex_irq3",
+       "intc_ex_irq4",
+       "intc_ex_irq5",
 };
 
 static const char * const msiof0_groups[] = {
@@ -4599,15 +4438,16 @@ static const char * const vin4_groups[] = {
        "vin4_data10_a",
        "vin4_data12_a",
        "vin4_data16_a",
+       "vin4_data18_a",
        "vin4_data20_a",
        "vin4_data24_a",
        "vin4_data8_b",
        "vin4_data10_b",
        "vin4_data12_b",
        "vin4_data16_b",
+       "vin4_data18_b",
        "vin4_data20_b",
        "vin4_data24_b",
-       "vin4_data8_sft8",
        "vin4_sync",
        "vin4_field",
        "vin4_clkenb",
@@ -4616,7 +4456,6 @@ static const char * const vin4_groups[] = {
 
 static const char * const vin5_groups[] = {
        "vin5_data8_a",
-       "vin5_data8_sft8_a",
        "vin5_data10_a",
        "vin5_data12_a",
        "vin5_data16_a",
@@ -4628,58 +4467,65 @@ static const char * const vin5_groups[] = {
        "vin5_clk_b",
 };
 
-static const struct sh_pfc_function pinmux_functions[] = {
-       SH_PFC_FUNCTION(audio_clk),
-       SH_PFC_FUNCTION(avb),
-       SH_PFC_FUNCTION(can0),
-       SH_PFC_FUNCTION(can1),
-       SH_PFC_FUNCTION(can_clk),
-       SH_PFC_FUNCTION(canfd0),
-       SH_PFC_FUNCTION(canfd1),
-       SH_PFC_FUNCTION(drif0),
-       SH_PFC_FUNCTION(drif1),
-       SH_PFC_FUNCTION(drif2),
-       SH_PFC_FUNCTION(drif3),
-       SH_PFC_FUNCTION(du),
-       SH_PFC_FUNCTION(hscif0),
-       SH_PFC_FUNCTION(hscif1),
-       SH_PFC_FUNCTION(hscif2),
-       SH_PFC_FUNCTION(hscif3),
-       SH_PFC_FUNCTION(hscif4),
-       SH_PFC_FUNCTION(i2c1),
-       SH_PFC_FUNCTION(i2c2),
-       SH_PFC_FUNCTION(i2c4),
-       SH_PFC_FUNCTION(i2c5),
-       SH_PFC_FUNCTION(i2c6),
-       SH_PFC_FUNCTION(i2c7),
-       SH_PFC_FUNCTION(intc_ex),
-       SH_PFC_FUNCTION(msiof0),
-       SH_PFC_FUNCTION(msiof1),
-       SH_PFC_FUNCTION(msiof2),
-       SH_PFC_FUNCTION(msiof3),
-       SH_PFC_FUNCTION(pwm0),
-       SH_PFC_FUNCTION(pwm1),
-       SH_PFC_FUNCTION(pwm2),
-       SH_PFC_FUNCTION(pwm3),
-       SH_PFC_FUNCTION(pwm4),
-       SH_PFC_FUNCTION(pwm5),
-       SH_PFC_FUNCTION(pwm6),
-       SH_PFC_FUNCTION(scif0),
-       SH_PFC_FUNCTION(scif1),
-       SH_PFC_FUNCTION(scif2),
-       SH_PFC_FUNCTION(scif3),
-       SH_PFC_FUNCTION(scif4),
-       SH_PFC_FUNCTION(scif5),
-       SH_PFC_FUNCTION(scif_clk),
-       SH_PFC_FUNCTION(sdhi0),
-       SH_PFC_FUNCTION(sdhi1),
-       SH_PFC_FUNCTION(sdhi3),
-       SH_PFC_FUNCTION(ssi),
-       SH_PFC_FUNCTION(tmu),
-       SH_PFC_FUNCTION(usb0),
-       SH_PFC_FUNCTION(usb30),
-       SH_PFC_FUNCTION(vin4),
-       SH_PFC_FUNCTION(vin5),
+static const struct {
+       struct sh_pfc_function common[45];
+       struct sh_pfc_function automotive[6];
+} pinmux_functions = {
+       .common = {
+               SH_PFC_FUNCTION(audio_clk),
+               SH_PFC_FUNCTION(avb),
+               SH_PFC_FUNCTION(can0),
+               SH_PFC_FUNCTION(can1),
+               SH_PFC_FUNCTION(can_clk),
+               SH_PFC_FUNCTION(du),
+               SH_PFC_FUNCTION(hscif0),
+               SH_PFC_FUNCTION(hscif1),
+               SH_PFC_FUNCTION(hscif2),
+               SH_PFC_FUNCTION(hscif3),
+               SH_PFC_FUNCTION(hscif4),
+               SH_PFC_FUNCTION(i2c1),
+               SH_PFC_FUNCTION(i2c2),
+               SH_PFC_FUNCTION(i2c4),
+               SH_PFC_FUNCTION(i2c5),
+               SH_PFC_FUNCTION(i2c6),
+               SH_PFC_FUNCTION(i2c7),
+               SH_PFC_FUNCTION(intc_ex),
+               SH_PFC_FUNCTION(msiof0),
+               SH_PFC_FUNCTION(msiof1),
+               SH_PFC_FUNCTION(msiof2),
+               SH_PFC_FUNCTION(msiof3),
+               SH_PFC_FUNCTION(pwm0),
+               SH_PFC_FUNCTION(pwm1),
+               SH_PFC_FUNCTION(pwm2),
+               SH_PFC_FUNCTION(pwm3),
+               SH_PFC_FUNCTION(pwm4),
+               SH_PFC_FUNCTION(pwm5),
+               SH_PFC_FUNCTION(pwm6),
+               SH_PFC_FUNCTION(scif0),
+               SH_PFC_FUNCTION(scif1),
+               SH_PFC_FUNCTION(scif2),
+               SH_PFC_FUNCTION(scif3),
+               SH_PFC_FUNCTION(scif4),
+               SH_PFC_FUNCTION(scif5),
+               SH_PFC_FUNCTION(scif_clk),
+               SH_PFC_FUNCTION(sdhi0),
+               SH_PFC_FUNCTION(sdhi1),
+               SH_PFC_FUNCTION(sdhi3),
+               SH_PFC_FUNCTION(ssi),
+               SH_PFC_FUNCTION(tmu),
+               SH_PFC_FUNCTION(usb0),
+               SH_PFC_FUNCTION(usb30),
+               SH_PFC_FUNCTION(vin4),
+               SH_PFC_FUNCTION(vin5),
+       },
+       .automotive = {
+               SH_PFC_FUNCTION(canfd0),
+               SH_PFC_FUNCTION(canfd1),
+               SH_PFC_FUNCTION(drif0),
+               SH_PFC_FUNCTION(drif1),
+               SH_PFC_FUNCTION(drif2),
+               SH_PFC_FUNCTION(drif3),
+       }
 };
 
 static const struct pinmux_cfg_reg pinmux_config_regs[] = {
@@ -5152,19 +4998,20 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
 };
 
 enum ioctrl_regs {
-       POCCTRL,
+       IOCTRL30,
 };
 
 static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = {
-       [POCCTRL] = { 0xe6060380, },
+       [IOCTRL30] = { 0xe6060380, },
        { /* sentinel */ },
 };
 
-static int r8a77990_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *pocctrl)
+static int r8a77990_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin,
+                                  u32 *pocctrl)
 {
        int bit = -EINVAL;
 
-       *pocctrl = pinmux_ioctrl_regs[POCCTRL].reg;
+       *pocctrl = pinmux_ioctrl_regs[IOCTRL30].reg;
 
        if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 11))
                bit = pin & 0x1f;
@@ -5175,10 +5022,286 @@ static int r8a77990_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *po
        return bit;
 }
 
+static const struct pinmux_bias_reg pinmux_bias_regs[] = {
+       { PINMUX_BIAS_REG("PUEN0", 0xe6060400, "PUD0", 0xe6060440) {
+                [0] = RCAR_GP_PIN(2, 23),      /* RD# */
+                [1] = RCAR_GP_PIN(2, 22),      /* BS# */
+                [2] = RCAR_GP_PIN(2, 21),      /* AVB_PHY_INT */
+                [3] = PIN_NUMBER('P', 5),      /* AVB_MDC */
+                [4] = PIN_NUMBER('P', 4),      /* AVB_MDIO */
+                [5] = RCAR_GP_PIN(2, 20),      /* AVB_TXCREFCLK */
+                [6] = PIN_NUMBER('N', 6),      /* AVB_TD3 */
+                [7] = PIN_NUMBER('N', 5),      /* AVB_TD2 */
+                [8] = PIN_NUMBER('N', 3),      /* AVB_TD1 */
+                [9] = PIN_NUMBER('N', 2),      /* AVB_TD0 */
+               [10] = PIN_NUMBER('N', 1),      /* AVB_TXC */
+               [11] = PIN_NUMBER('P', 3),      /* AVB_TX_CTL */
+               [12] = RCAR_GP_PIN(2, 19),      /* AVB_RD3 */
+               [13] = RCAR_GP_PIN(2, 18),      /* AVB_RD2 */
+               [14] = RCAR_GP_PIN(2, 17),      /* AVB_RD1 */
+               [15] = RCAR_GP_PIN(2, 16),      /* AVB_RD0 */
+               [16] = RCAR_GP_PIN(2, 15),      /* AVB_RXC */
+               [17] = RCAR_GP_PIN(2, 14),      /* AVB_RX_CTL */
+               [18] = RCAR_GP_PIN(2, 13),      /* RPC_RESET# */
+               [19] = RCAR_GP_PIN(2, 12),      /* RPC_INT# */
+               [20] = RCAR_GP_PIN(2, 11),      /* QSPI1_SSL */
+               [21] = RCAR_GP_PIN(2, 10),      /* QSPI1_IO3 */
+               [22] = RCAR_GP_PIN(2,  9),      /* QSPI1_IO2 */
+               [23] = RCAR_GP_PIN(2,  8),      /* QSPI1_MISO/IO1 */
+               [24] = RCAR_GP_PIN(2,  7),      /* QSPI1_MOSI/IO0 */
+               [25] = RCAR_GP_PIN(2,  6),      /* QSPI1_SPCLK */
+               [26] = RCAR_GP_PIN(2,  5),      /* QSPI0_SSL */
+               [27] = RCAR_GP_PIN(2,  4),      /* QSPI0_IO3 */
+               [28] = RCAR_GP_PIN(2,  3),      /* QSPI0_IO2 */
+               [29] = RCAR_GP_PIN(2,  2),      /* QSPI0_MISO/IO1 */
+               [30] = RCAR_GP_PIN(2,  1),      /* QSPI0_MOSI/IO0 */
+               [31] = RCAR_GP_PIN(2,  0),      /* QSPI0_SPCLK */
+       } },
+       { PINMUX_BIAS_REG("PUEN1", 0xe6060404, "PUD1", 0xe6060444) {
+                [0] = RCAR_GP_PIN(0,  4),      /* D4 */
+                [1] = RCAR_GP_PIN(0,  3),      /* D3 */
+                [2] = RCAR_GP_PIN(0,  2),      /* D2 */
+                [3] = RCAR_GP_PIN(0,  1),      /* D1 */
+                [4] = RCAR_GP_PIN(0,  0),      /* D0 */
+                [5] = RCAR_GP_PIN(1, 22),      /* WE0# */
+                [6] = RCAR_GP_PIN(1, 21),      /* CS0# */
+                [7] = RCAR_GP_PIN(1, 20),      /* CLKOUT */
+                [8] = RCAR_GP_PIN(1, 19),      /* A19 */
+                [9] = RCAR_GP_PIN(1, 18),      /* A18 */
+               [10] = RCAR_GP_PIN(1, 17),      /* A17 */
+               [11] = RCAR_GP_PIN(1, 16),      /* A16 */
+               [12] = RCAR_GP_PIN(1, 15),      /* A15 */
+               [13] = RCAR_GP_PIN(1, 14),      /* A14 */
+               [14] = RCAR_GP_PIN(1, 13),      /* A13 */
+               [15] = RCAR_GP_PIN(1, 12),      /* A12 */
+               [16] = RCAR_GP_PIN(1, 11),      /* A11 */
+               [17] = RCAR_GP_PIN(1, 10),      /* A10 */
+               [18] = RCAR_GP_PIN(1,  9),      /* A9 */
+               [19] = RCAR_GP_PIN(1,  8),      /* A8 */
+               [20] = RCAR_GP_PIN(1,  7),      /* A7 */
+               [21] = RCAR_GP_PIN(1,  6),      /* A6 */
+               [22] = RCAR_GP_PIN(1,  5),      /* A5 */
+               [23] = RCAR_GP_PIN(1,  4),      /* A4 */
+               [24] = RCAR_GP_PIN(1,  3),      /* A3 */
+               [25] = RCAR_GP_PIN(1,  2),      /* A2 */
+               [26] = RCAR_GP_PIN(1,  1),      /* A1 */
+               [27] = RCAR_GP_PIN(1,  0),      /* A0 */
+               [28] = PIN_NONE,
+               [29] = PIN_NONE,
+               [30] = RCAR_GP_PIN(2, 25),      /* PUEN_EX_WAIT0 */
+               [31] = RCAR_GP_PIN(2, 24),      /* PUEN_RD/WR# */
+       } },
+       { PINMUX_BIAS_REG("PUEN2", 0xe6060408, "PUD2", 0xe6060448) {
+                [0] = RCAR_GP_PIN(3,  1),      /* SD0_CMD */
+                [1] = RCAR_GP_PIN(3,  0),      /* SD0_CLK */
+                [2] = PIN_NUMBER('H', 1),      /* ASEBRK */
+                [3] = PIN_NONE,
+                [4] = PIN_NUMBER('G', 2),      /* TDI */
+                [5] = PIN_NUMBER('F', 3),      /* TMS */
+                [6] = PIN_NUMBER('F', 4),      /* TCK */
+                [7] = PIN_NUMBER('F', 1),      /* TRST# */
+                [8] = PIN_NONE,
+                [9] = PIN_NONE,
+               [10] = PIN_NONE,
+               [11] = PIN_NONE,
+               [12] = PIN_NONE,
+               [13] = PIN_NONE,
+               [14] = PIN_NONE,
+               [15] = PIN_NUMBER('G', 3),      /* FSCLKST# */
+               [16] = RCAR_GP_PIN(0, 17),      /* SDA4 */
+               [17] = RCAR_GP_PIN(0, 16),      /* SCL4 */
+               [18] = PIN_NONE,
+               [19] = PIN_NONE,
+               [20] = PIN_A_NUMBER('D', 3),    /* PRESETOUT# */
+               [21] = RCAR_GP_PIN(0, 15),      /* D15 */
+               [22] = RCAR_GP_PIN(0, 14),      /* D14 */
+               [23] = RCAR_GP_PIN(0, 13),      /* D13 */
+               [24] = RCAR_GP_PIN(0, 12),      /* D12 */
+               [25] = RCAR_GP_PIN(0, 11),      /* D11 */
+               [26] = RCAR_GP_PIN(0, 10),      /* D10 */
+               [27] = RCAR_GP_PIN(0,  9),      /* D9 */
+               [28] = RCAR_GP_PIN(0,  8),      /* D8 */
+               [29] = RCAR_GP_PIN(0,  7),      /* D7 */
+               [30] = RCAR_GP_PIN(0,  6),      /* D6 */
+               [31] = RCAR_GP_PIN(0,  5),      /* D5 */
+       } },
+       { PINMUX_BIAS_REG("PUEN3", 0xe606040c, "PUD3", 0xe606044c) {
+                [0] = RCAR_GP_PIN(5,  0),      /* SCK0_A */
+                [1] = RCAR_GP_PIN(5,  4),      /* RTS0#/TANS_A */
+                [2] = RCAR_GP_PIN(5,  3),      /* CTS0#_A */
+                [3] = RCAR_GP_PIN(5,  2),      /* TX0_A */
+                [4] = RCAR_GP_PIN(5,  1),      /* RX0_A */
+                [5] = PIN_NONE,
+                [6] = PIN_NONE,
+                [7] = RCAR_GP_PIN(3, 15),      /* SD1_WP */
+                [8] = RCAR_GP_PIN(3, 14),      /* SD1_CD */
+                [9] = RCAR_GP_PIN(3, 13),      /* SD0_WP */
+               [10] = RCAR_GP_PIN(3, 12),      /* SD0_CD */
+               [11] = RCAR_GP_PIN(4, 10),      /* SD3_DS */
+               [12] = RCAR_GP_PIN(4,  9),      /* SD3_DAT7 */
+               [13] = RCAR_GP_PIN(4,  8),      /* SD3_DAT6 */
+               [14] = RCAR_GP_PIN(4,  7),      /* SD3_DAT5 */
+               [15] = RCAR_GP_PIN(4,  6),      /* SD3_DAT4 */
+               [16] = RCAR_GP_PIN(4,  5),      /* SD3_DAT3 */
+               [17] = RCAR_GP_PIN(4,  4),      /* SD3_DAT2 */
+               [18] = RCAR_GP_PIN(4,  3),      /* SD3_DAT1 */
+               [19] = RCAR_GP_PIN(4,  2),      /* SD3_DAT0 */
+               [20] = RCAR_GP_PIN(4,  1),      /* SD3_CMD */
+               [21] = RCAR_GP_PIN(4,  0),      /* SD3_CLK */
+               [22] = RCAR_GP_PIN(3, 11),      /* SD1_DAT3 */
+               [23] = RCAR_GP_PIN(3, 10),      /* SD1_DAT2 */
+               [24] = RCAR_GP_PIN(3,  9),      /* SD1_DAT1 */
+               [25] = RCAR_GP_PIN(3,  8),      /* SD1_DAT0 */
+               [26] = RCAR_GP_PIN(3,  7),      /* SD1_CMD */
+               [27] = RCAR_GP_PIN(3,  6),      /* SD1_CLK */
+               [28] = RCAR_GP_PIN(3,  5),      /* SD0_DAT3 */
+               [29] = RCAR_GP_PIN(3,  4),      /* SD0_DAT2 */
+               [30] = RCAR_GP_PIN(3,  3),      /* SD0_DAT1 */
+               [31] = RCAR_GP_PIN(3,  2),      /* SD0_DAT0 */
+       } },
+       { PINMUX_BIAS_REG("PUEN4", 0xe6060410, "PUD4", 0xe6060450) {
+                [0] = RCAR_GP_PIN(6,  8),      /* AUDIO_CLKA */
+                [1] = RCAR_GP_PIN(6, 16),      /* SSI_SDATA6 */
+                [2] = RCAR_GP_PIN(6, 15),      /* SSI_WS6 */
+                [3] = RCAR_GP_PIN(6, 14),      /* SSI_SCK6 */
+                [4] = RCAR_GP_PIN(6, 13),      /* SSI_SDATA5 */
+                [5] = RCAR_GP_PIN(6, 12),      /* SSI_WS5 */
+                [6] = RCAR_GP_PIN(6, 11),      /* SSI_SCK5 */
+                [7] = RCAR_GP_PIN(6, 10),      /* SSI_SDATA4 */
+                [8] = RCAR_GP_PIN(6,  7),      /* SSI_SDATA3 */
+                [9] = RCAR_GP_PIN(6,  6),      /* SSI_WS349 */
+               [10] = RCAR_GP_PIN(6,  5),      /* SSI_SCK349 */
+               [11] = RCAR_GP_PIN(6,  4),      /* SSI_SDATA2 */
+               [12] = RCAR_GP_PIN(6,  3),      /* SSI_SDATA1 */
+               [13] = RCAR_GP_PIN(6,  2),      /* SSI_SDATA0 */
+               [14] = RCAR_GP_PIN(6,  1),      /* SSI_WS01239 */
+               [15] = RCAR_GP_PIN(6,  0),      /* SSI_SCK01239 */
+               [16] = PIN_NUMBER('T', 21),     /* MLB_REF */
+               [17] = RCAR_GP_PIN(5, 19),      /* MLB_DAT */
+               [18] = RCAR_GP_PIN(5, 18),      /* MLB_SIG */
+               [19] = RCAR_GP_PIN(5, 17),      /* MLB_CLK */
+               [20] = RCAR_GP_PIN(5, 16),      /* SSI_SDATA9 */
+               [21] = RCAR_GP_PIN(5, 15),      /* MSIOF0_SS2 */
+               [22] = RCAR_GP_PIN(5, 14),      /* MSIOF0_SS1 */
+               [23] = RCAR_GP_PIN(5, 13),      /* MSIOF0_SYNC */
+               [24] = RCAR_GP_PIN(5, 12),      /* MSIOF0_TXD */
+               [25] = RCAR_GP_PIN(5, 11),      /* MSIOF0_RXD */
+               [26] = RCAR_GP_PIN(5, 10),      /* MSIOF0_SCK */
+               [27] = RCAR_GP_PIN(5,  9),      /* RX2_A */
+               [28] = RCAR_GP_PIN(5,  8),      /* TX2_A */
+               [29] = RCAR_GP_PIN(5,  7),      /* SCK2_A */
+               [30] = RCAR_GP_PIN(5,  6),      /* TX1 */
+               [31] = RCAR_GP_PIN(5,  5),      /* RX1 */
+       } },
+       { PINMUX_BIAS_REG("PUEN5", 0xe6060414, "PUD5", 0xe6060454) {
+                [0] = PIN_NONE,
+                [1] = PIN_NONE,
+                [2] = PIN_NONE,
+                [3] = PIN_NONE,
+                [4] = PIN_NONE,
+                [5] = PIN_NONE,
+                [6] = PIN_NONE,
+                [7] = PIN_NONE,
+                [8] = PIN_NONE,
+                [9] = PIN_NONE,
+               [10] = PIN_NONE,
+               [11] = PIN_NONE,
+               [12] = PIN_NONE,
+               [13] = PIN_NONE,
+               [14] = PIN_NONE,
+               [15] = PIN_NONE,
+               [16] = PIN_NONE,
+               [17] = PIN_NONE,
+               [18] = PIN_NONE,
+               [19] = PIN_NONE,
+               [20] = PIN_NONE,
+               [21] = PIN_NONE,
+               [22] = PIN_NONE,
+               [23] = PIN_NONE,
+               [24] = PIN_NONE,
+               [25] = PIN_NONE,
+               [26] = PIN_NONE,
+               [27] = PIN_NONE,
+               [28] = PIN_NONE,
+               [29] = PIN_NONE,
+               [30] = RCAR_GP_PIN(6,  9),      /* PUEN_USB30_OVC */
+               [31] = RCAR_GP_PIN(6, 17),      /* PUEN_USB30_PWEN */
+       } },
+       { /* sentinel */ },
+};
+
+static unsigned int r8a77990_pinmux_get_bias(struct sh_pfc *pfc,
+                                            unsigned int pin)
+{
+       const struct pinmux_bias_reg *reg;
+       unsigned int bit;
+
+       reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit);
+       if (!reg)
+               return PIN_CONFIG_BIAS_DISABLE;
+
+       if (!(sh_pfc_read(pfc, reg->puen) & BIT(bit)))
+               return PIN_CONFIG_BIAS_DISABLE;
+       else if (sh_pfc_read(pfc, reg->pud) & BIT(bit))
+               return PIN_CONFIG_BIAS_PULL_UP;
+       else
+               return PIN_CONFIG_BIAS_PULL_DOWN;
+}
+
+static void r8a77990_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin,
+                                    unsigned int bias)
+{
+       const struct pinmux_bias_reg *reg;
+       u32 enable, updown;
+       unsigned int bit;
+
+       reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit);
+       if (!reg)
+               return;
+
+       enable = sh_pfc_read(pfc, reg->puen) & ~BIT(bit);
+       if (bias != PIN_CONFIG_BIAS_DISABLE)
+               enable |= BIT(bit);
+
+       updown = sh_pfc_read(pfc, reg->pud) & ~BIT(bit);
+       if (bias == PIN_CONFIG_BIAS_PULL_UP)
+               updown |= BIT(bit);
+
+       sh_pfc_write(pfc, reg->pud, updown);
+       sh_pfc_write(pfc, reg->puen, enable);
+}
+
 static const struct sh_pfc_soc_operations r8a77990_pinmux_ops = {
        .pin_to_pocctrl = r8a77990_pin_to_pocctrl,
+       .get_bias = r8a77990_pinmux_get_bias,
+       .set_bias = r8a77990_pinmux_set_bias,
+};
+
+#ifdef CONFIG_PINCTRL_PFC_R8A774C0
+const struct sh_pfc_soc_info r8a774c0_pinmux_info = {
+       .name = "r8a774c0_pfc",
+       .ops = &r8a77990_pinmux_ops,
+       .unlock_reg = 0xe6060000, /* PMMR */
+
+       .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
+
+       .pins = pinmux_pins,
+       .nr_pins = ARRAY_SIZE(pinmux_pins),
+       .groups = pinmux_groups.common,
+       .nr_groups = ARRAY_SIZE(pinmux_groups.common),
+       .functions = pinmux_functions.common,
+       .nr_functions = ARRAY_SIZE(pinmux_functions.common),
+
+       .cfg_regs = pinmux_config_regs,
+       .bias_regs = pinmux_bias_regs,
+       .ioctrl_regs = pinmux_ioctrl_regs,
+
+       .pinmux_data = pinmux_data,
+       .pinmux_data_size = ARRAY_SIZE(pinmux_data),
 };
+#endif
 
+#ifdef CONFIG_PINCTRL_PFC_R8A77990
 const struct sh_pfc_soc_info r8a77990_pinmux_info = {
        .name = "r8a77990_pfc",
        .ops = &r8a77990_pinmux_ops,
@@ -5188,14 +5311,18 @@ const struct sh_pfc_soc_info r8a77990_pinmux_info = {
 
        .pins = pinmux_pins,
        .nr_pins = ARRAY_SIZE(pinmux_pins),
-       .groups = pinmux_groups,
-       .nr_groups = ARRAY_SIZE(pinmux_groups),
-       .functions = pinmux_functions,
-       .nr_functions = ARRAY_SIZE(pinmux_functions),
+       .groups = pinmux_groups.common,
+       .nr_groups = ARRAY_SIZE(pinmux_groups.common) +
+               ARRAY_SIZE(pinmux_groups.automotive),
+       .functions = pinmux_functions.common,
+       .nr_functions = ARRAY_SIZE(pinmux_functions.common) +
+               ARRAY_SIZE(pinmux_functions.automotive),
 
        .cfg_regs = pinmux_config_regs,
+       .bias_regs = pinmux_bias_regs,
        .ioctrl_regs = pinmux_ioctrl_regs,
 
        .pinmux_data = pinmux_data,
        .pinmux_data_size = ARRAY_SIZE(pinmux_data),
 };
+#endif
index 97f75a184e442eb58a6b4e8d6e24d88c38e9d8ff..ed678584cb86112133316bab92f4698ff33838b0 100644 (file)
@@ -384,6 +384,9 @@ FM(IP12_23_20)      IP12_23_20 \
 FM(IP12_27_24) IP12_27_24 \
 FM(IP12_31_28) IP12_31_28 \
 
+/* The bit numbering in MOD_SEL fields is reversed */
+#define REV4(f0, f1, f2, f3)                   f0 f2 f1 f3
+
 /* MOD_SEL0 */                 /* 0 */                 /* 1 */                 /* 2 */                 /* 3 */
 #define MOD_SEL0_30            FM(SEL_MSIOF2_0)        FM(SEL_MSIOF2_1)
 #define MOD_SEL0_29            FM(SEL_I2C3_0)          FM(SEL_I2C3_1)
@@ -391,10 +394,10 @@ FM(IP12_31_28)    IP12_31_28 \
 #define MOD_SEL0_27            FM(SEL_MSIOF3_0)        FM(SEL_MSIOF3_1)
 #define MOD_SEL0_26            FM(SEL_HSCIF3_0)        FM(SEL_HSCIF3_1)
 #define MOD_SEL0_25            FM(SEL_SCIF4_0)         FM(SEL_SCIF4_1)
-#define MOD_SEL0_24_23         FM(SEL_PWM0_0)          FM(SEL_PWM0_1)          FM(SEL_PWM0_2)          FM(SEL_PWM0_3)
-#define MOD_SEL0_22_21         FM(SEL_PWM1_0)          FM(SEL_PWM1_1)          FM(SEL_PWM1_2)          FM(SEL_PWM1_3)
-#define MOD_SEL0_20_19         FM(SEL_PWM2_0)          FM(SEL_PWM2_1)          FM(SEL_PWM2_2)          FM(SEL_PWM2_3)
-#define MOD_SEL0_18_17         FM(SEL_PWM3_0)          FM(SEL_PWM3_1)          FM(SEL_PWM3_2)          FM(SEL_PWM3_3)
+#define MOD_SEL0_24_23    REV4(FM(SEL_PWM0_0),         FM(SEL_PWM0_1),         FM(SEL_PWM0_2),         F_(0, 0))
+#define MOD_SEL0_22_21    REV4(FM(SEL_PWM1_0),         FM(SEL_PWM1_1),         FM(SEL_PWM1_2),         F_(0, 0))
+#define MOD_SEL0_20_19    REV4(FM(SEL_PWM2_0),         FM(SEL_PWM2_1),         FM(SEL_PWM2_2),         F_(0, 0))
+#define MOD_SEL0_18_17    REV4(FM(SEL_PWM3_0),         FM(SEL_PWM3_1),         FM(SEL_PWM3_2),         F_(0, 0))
 #define MOD_SEL0_15            FM(SEL_IRQ_0_0)         FM(SEL_IRQ_0_1)
 #define MOD_SEL0_14            FM(SEL_IRQ_1_0)         FM(SEL_IRQ_1_1)
 #define MOD_SEL0_13            FM(SEL_IRQ_2_0)         FM(SEL_IRQ_2_1)
@@ -471,12 +474,6 @@ enum {
 #undef FM
 };
 
-#define PINMUX_IPSR_MSEL2(ipsr, fn, msel1, msel2) \
-       PINMUX_DATA(fn##_MARK, FN_##msel1, FN_##msel2, FN_##fn, FN_##ipsr)
-
-#define PINMUX_IPSR_PHYS(ipsr, fn, msel) \
-       PINMUX_DATA(fn##_MARK, FN_##msel)
-
 static const u16 pinmux_data[] = {
        PINMUX_DATA_GP_ALL(),
 
@@ -520,6 +517,10 @@ static const u16 pinmux_data[] = {
        PINMUX_SINGLE(QSPI0_SPCLK),
        PINMUX_SINGLE(SCL0),
        PINMUX_SINGLE(SDA0),
+       PINMUX_SINGLE(MSIOF0_RXD),
+       PINMUX_SINGLE(MSIOF0_TXD),
+       PINMUX_SINGLE(MSIOF0_SYNC),
+       PINMUX_SINGLE(MSIOF0_SCK),
 
        /* IPSR0 */
        PINMUX_IPSR_MSEL(IP0_3_0,       IRQ0_A, SEL_IRQ_0_0),
@@ -1277,6 +1278,289 @@ static const unsigned int mmc_ctrl_mux[] = {
        MMC_CLK_MARK, MMC_CMD_MARK,
 };
 
+/* - MSIOF0 ----------------------------------------------------------------- */
+static const unsigned int msiof0_clk_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(4, 12),
+};
+
+static const unsigned int msiof0_clk_mux[] = {
+       MSIOF0_SCK_MARK,
+};
+
+static const unsigned int msiof0_sync_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(4, 13),
+};
+
+static const unsigned int msiof0_sync_mux[] = {
+       MSIOF0_SYNC_MARK,
+};
+
+static const unsigned int msiof0_ss1_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(4, 20),
+};
+
+static const unsigned int msiof0_ss1_mux[] = {
+       MSIOF0_SS1_MARK,
+};
+
+static const unsigned int msiof0_ss2_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(4, 21),
+};
+
+static const unsigned int msiof0_ss2_mux[] = {
+       MSIOF0_SS2_MARK,
+};
+
+static const unsigned int msiof0_txd_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(4, 14),
+};
+
+static const unsigned int msiof0_txd_mux[] = {
+       MSIOF0_TXD_MARK,
+};
+
+static const unsigned int msiof0_rxd_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(4, 15),
+};
+
+static const unsigned int msiof0_rxd_mux[] = {
+       MSIOF0_RXD_MARK,
+};
+
+/* - MSIOF1 ----------------------------------------------------------------- */
+static const unsigned int msiof1_clk_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(4, 16),
+};
+
+static const unsigned int msiof1_clk_mux[] = {
+       MSIOF1_SCK_MARK,
+};
+
+static const unsigned int msiof1_sync_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(4, 19),
+};
+
+static const unsigned int msiof1_sync_mux[] = {
+       MSIOF1_SYNC_MARK,
+};
+
+static const unsigned int msiof1_ss1_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(4, 25),
+};
+
+static const unsigned int msiof1_ss1_mux[] = {
+       MSIOF1_SS1_MARK,
+};
+
+static const unsigned int msiof1_ss2_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(4, 22),
+};
+
+static const unsigned int msiof1_ss2_mux[] = {
+       MSIOF1_SS2_MARK,
+};
+
+static const unsigned int msiof1_txd_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(4, 17),
+};
+
+static const unsigned int msiof1_txd_mux[] = {
+       MSIOF1_TXD_MARK,
+};
+
+static const unsigned int msiof1_rxd_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(4, 18),
+};
+
+static const unsigned int msiof1_rxd_mux[] = {
+       MSIOF1_RXD_MARK,
+};
+
+/* - MSIOF2 ----------------------------------------------------------------- */
+static const unsigned int msiof2_clk_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(0, 3),
+};
+
+static const unsigned int msiof2_clk_mux[] = {
+       MSIOF2_SCK_MARK,
+};
+
+static const unsigned int msiof2_sync_a_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(0, 6),
+};
+
+static const unsigned int msiof2_sync_a_mux[] = {
+       MSIOF2_SYNC_A_MARK,
+};
+
+static const unsigned int msiof2_sync_b_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(0, 2),
+};
+
+static const unsigned int msiof2_sync_b_mux[] = {
+       MSIOF2_SYNC_B_MARK,
+};
+
+static const unsigned int msiof2_ss1_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(0, 7),
+};
+
+static const unsigned int msiof2_ss1_mux[] = {
+       MSIOF2_SS1_MARK,
+};
+
+static const unsigned int msiof2_ss2_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(0, 8),
+};
+
+static const unsigned int msiof2_ss2_mux[] = {
+       MSIOF2_SS2_MARK,
+};
+
+static const unsigned int msiof2_txd_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(0, 4),
+};
+
+static const unsigned int msiof2_txd_mux[] = {
+       MSIOF2_TXD_MARK,
+};
+
+static const unsigned int msiof2_rxd_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(0, 5),
+};
+
+static const unsigned int msiof2_rxd_mux[] = {
+       MSIOF2_RXD_MARK,
+};
+
+/* - MSIOF3 ----------------------------------------------------------------- */
+static const unsigned int msiof3_clk_a_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(2, 24),
+};
+
+static const unsigned int msiof3_clk_a_mux[] = {
+       MSIOF3_SCK_A_MARK,
+};
+
+static const unsigned int msiof3_sync_a_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(2, 21),
+};
+
+static const unsigned int msiof3_sync_a_mux[] = {
+       MSIOF3_SYNC_A_MARK,
+};
+
+static const unsigned int msiof3_ss1_a_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(2, 14),
+};
+
+static const unsigned int msiof3_ss1_a_mux[] = {
+       MSIOF3_SS1_A_MARK,
+};
+
+static const unsigned int msiof3_ss2_a_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(2, 10),
+};
+
+static const unsigned int msiof3_ss2_a_mux[] = {
+       MSIOF3_SS2_A_MARK,
+};
+
+static const unsigned int msiof3_txd_a_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(2, 22),
+};
+
+static const unsigned int msiof3_txd_a_mux[] = {
+       MSIOF3_TXD_A_MARK,
+};
+
+static const unsigned int msiof3_rxd_a_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(2, 23),
+};
+
+static const unsigned int msiof3_rxd_a_mux[] = {
+       MSIOF3_RXD_A_MARK,
+};
+
+static const unsigned int msiof3_clk_b_pins[] = {
+       /* SCK */
+       RCAR_GP_PIN(1, 8),
+};
+
+static const unsigned int msiof3_clk_b_mux[] = {
+       MSIOF3_SCK_B_MARK,
+};
+
+static const unsigned int msiof3_sync_b_pins[] = {
+       /* SYNC */
+       RCAR_GP_PIN(1, 9),
+};
+
+static const unsigned int msiof3_sync_b_mux[] = {
+       MSIOF3_SYNC_B_MARK,
+};
+
+static const unsigned int msiof3_ss1_b_pins[] = {
+       /* SS1 */
+       RCAR_GP_PIN(1, 6),
+};
+
+static const unsigned int msiof3_ss1_b_mux[] = {
+       MSIOF3_SS1_B_MARK,
+};
+
+static const unsigned int msiof3_ss2_b_pins[] = {
+       /* SS2 */
+       RCAR_GP_PIN(1, 7),
+};
+
+static const unsigned int msiof3_ss2_b_mux[] = {
+       MSIOF3_SS2_B_MARK,
+};
+
+static const unsigned int msiof3_txd_b_pins[] = {
+       /* TXD */
+       RCAR_GP_PIN(1, 0),
+};
+
+static const unsigned int msiof3_txd_b_mux[] = {
+       MSIOF3_TXD_B_MARK,
+};
+
+static const unsigned int msiof3_rxd_b_pins[] = {
+       /* RXD */
+       RCAR_GP_PIN(1, 1),
+};
+
+static const unsigned int msiof3_rxd_b_mux[] = {
+       MSIOF3_RXD_B_MARK,
+};
+
 /* - PWM0 ------------------------------------------------------------------ */
 static const unsigned int pwm0_a_pins[] = {
        /* PWM */
@@ -1752,6 +2036,37 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
        SH_PFC_PIN_GROUP(mmc_data4),
        SH_PFC_PIN_GROUP(mmc_data8),
        SH_PFC_PIN_GROUP(mmc_ctrl),
+       SH_PFC_PIN_GROUP(msiof0_clk),
+       SH_PFC_PIN_GROUP(msiof0_sync),
+       SH_PFC_PIN_GROUP(msiof0_ss1),
+       SH_PFC_PIN_GROUP(msiof0_ss2),
+       SH_PFC_PIN_GROUP(msiof0_txd),
+       SH_PFC_PIN_GROUP(msiof0_rxd),
+       SH_PFC_PIN_GROUP(msiof1_clk),
+       SH_PFC_PIN_GROUP(msiof1_sync),
+       SH_PFC_PIN_GROUP(msiof1_ss1),
+       SH_PFC_PIN_GROUP(msiof1_ss2),
+       SH_PFC_PIN_GROUP(msiof1_txd),
+       SH_PFC_PIN_GROUP(msiof1_rxd),
+       SH_PFC_PIN_GROUP(msiof2_clk),
+       SH_PFC_PIN_GROUP(msiof2_sync_a),
+       SH_PFC_PIN_GROUP(msiof2_sync_b),
+       SH_PFC_PIN_GROUP(msiof2_ss1),
+       SH_PFC_PIN_GROUP(msiof2_ss2),
+       SH_PFC_PIN_GROUP(msiof2_txd),
+       SH_PFC_PIN_GROUP(msiof2_rxd),
+       SH_PFC_PIN_GROUP(msiof3_clk_a),
+       SH_PFC_PIN_GROUP(msiof3_sync_a),
+       SH_PFC_PIN_GROUP(msiof3_ss1_a),
+       SH_PFC_PIN_GROUP(msiof3_ss2_a),
+       SH_PFC_PIN_GROUP(msiof3_txd_a),
+       SH_PFC_PIN_GROUP(msiof3_rxd_a),
+       SH_PFC_PIN_GROUP(msiof3_clk_b),
+       SH_PFC_PIN_GROUP(msiof3_sync_b),
+       SH_PFC_PIN_GROUP(msiof3_ss1_b),
+       SH_PFC_PIN_GROUP(msiof3_ss2_b),
+       SH_PFC_PIN_GROUP(msiof3_txd_b),
+       SH_PFC_PIN_GROUP(msiof3_rxd_b),
        SH_PFC_PIN_GROUP(pwm0_a),
        SH_PFC_PIN_GROUP(pwm0_b),
        SH_PFC_PIN_GROUP(pwm0_c),
@@ -1982,6 +2297,49 @@ static const char * const vin4_groups[] = {
        "vin4_clk",
 };
 
+static const char * const msiof0_groups[] = {
+       "msiof0_clk",
+       "msiof0_sync",
+       "msiof0_ss1",
+       "msiof0_ss2",
+       "msiof0_txd",
+       "msiof0_rxd",
+};
+
+static const char * const msiof1_groups[] = {
+       "msiof1_clk",
+       "msiof1_sync",
+       "msiof1_ss1",
+       "msiof1_ss2",
+       "msiof1_txd",
+       "msiof1_rxd",
+};
+
+static const char * const msiof2_groups[] = {
+       "msiof2_clk",
+       "msiof2_sync_a",
+       "msiof2_sync_b",
+       "msiof2_ss1",
+       "msiof2_ss2",
+       "msiof2_txd",
+       "msiof2_rxd",
+};
+
+static const char * const msiof3_groups[] = {
+       "msiof3_clk_a",
+       "msiof3_sync_a",
+       "msiof3_ss1_a",
+       "msiof3_ss2_a",
+       "msiof3_txd_a",
+       "msiof3_rxd_a",
+       "msiof3_clk_b",
+       "msiof3_sync_b",
+       "msiof3_ss1_b",
+       "msiof3_ss2_b",
+       "msiof3_txd_b",
+       "msiof3_rxd_b",
+};
+
 static const struct sh_pfc_function pinmux_functions[] = {
        SH_PFC_FUNCTION(audio_clk),
        SH_PFC_FUNCTION(avb0),
@@ -1996,6 +2354,10 @@ static const struct sh_pfc_function pinmux_functions[] = {
        SH_PFC_FUNCTION(i2c2),
        SH_PFC_FUNCTION(i2c3),
        SH_PFC_FUNCTION(mmc),
+       SH_PFC_FUNCTION(msiof0),
+       SH_PFC_FUNCTION(msiof1),
+       SH_PFC_FUNCTION(msiof2),
+       SH_PFC_FUNCTION(msiof3),
        SH_PFC_FUNCTION(pwm0),
        SH_PFC_FUNCTION(pwm1),
        SH_PFC_FUNCTION(pwm2),
index b3a4ff9049d093d00fdf67819700c2ec73c8c587..06359501b7d21a4d31ee906d805383a4eefb4a3e 100644 (file)
@@ -28,6 +28,7 @@ enum sh_pfc_model {
        SH_PFC_R8A7794,
        SH_PFC_R8A7795,
        SH_PFC_R8A7796,
+       SH_PFC_R8A77965,
        SH_PFC_R8A77970,
        SH_PFC_R8A77990,
        SH_PFC_R8A77995,
@@ -808,6 +809,10 @@ static int sh_pfc_pinctrl_probe(struct udevice *dev)
        if (model == SH_PFC_R8A7796)
                priv->pfc.info = &r8a7796_pinmux_info;
 #endif
+#ifdef CONFIG_PINCTRL_PFC_R8A77965
+       if (model == SH_PFC_R8A77965)
+               priv->pfc.info = &r8a77965_pinmux_info;
+#endif
 #ifdef CONFIG_PINCTRL_PFC_R8A77970
        if (model == SH_PFC_R8A77970)
                priv->pfc.info = &r8a77970_pinmux_info;
@@ -869,9 +874,12 @@ static const struct udevice_id sh_pfc_pinctrl_ids[] = {
        {
                .compatible = "renesas,pfc-r8a7796",
                .data = SH_PFC_R8A7796,
-       }, {
+       },
+#endif
+#ifdef CONFIG_PINCTRL_PFC_R8A77965
+       {
                .compatible = "renesas,pfc-r8a77965",
-               .data = SH_PFC_R8A7796,
+               .data = SH_PFC_R8A77965,
        },
 #endif
 #ifdef CONFIG_PINCTRL_PFC_R8A77970
index b98c2f185d26d7e6bf804e560d7512d89e1e3d37..09e11d31b30f81b9a11f10b48bef398cd03cd11b 100644 (file)
@@ -53,18 +53,32 @@ struct sh_pfc_pin_group {
 };
 
 /*
- * Using union vin_data saves memory occupied by the VIN data pins.
- * VIN_DATA_PIN_GROUP() is  a macro  used  to describe the VIN pin groups
- * in this case.
+ * Using union vin_data{,12,16} saves memory occupied by the VIN data pins.
+ * VIN_DATA_PIN_GROUP() is a macro used to describe the VIN pin groups
+ * in this case. It accepts an optional 'version' argument used when the
+ * same group can appear on a different set of pins.
  */
-#define VIN_DATA_PIN_GROUP(n, s)                               \
-       {                                                       \
-               .name = #n#s,                                   \
-               .pins = n##_pins.data##s,                       \
-               .mux = n##_mux.data##s,                         \
-               .nr_pins = ARRAY_SIZE(n##_pins.data##s),        \
+#define VIN_DATA_PIN_GROUP(n, s, ...)                                  \
+       {                                                               \
+               .name = #n#s#__VA_ARGS__,                               \
+               .pins = n##__VA_ARGS__##_pins.data##s,                  \
+               .mux = n##__VA_ARGS__##_mux.data##s,                    \
+               .nr_pins = ARRAY_SIZE(n##__VA_ARGS__##_pins.data##s),   \
        }
 
+union vin_data12 {
+       unsigned int data12[12];
+       unsigned int data10[10];
+       unsigned int data8[8];
+};
+
+union vin_data16 {
+       unsigned int data16[16];
+       unsigned int data12[12];
+       unsigned int data10[10];
+       unsigned int data8[8];
+};
+
 union vin_data {
        unsigned int data24[24];
        unsigned int data20[20];
@@ -270,9 +284,11 @@ extern const struct sh_pfc_soc_info r8a7793_pinmux_info;
 extern const struct sh_pfc_soc_info r8a7794_pinmux_info;
 extern const struct sh_pfc_soc_info r8a7795_pinmux_info;
 extern const struct sh_pfc_soc_info r8a7796_pinmux_info;
+extern const struct sh_pfc_soc_info r8a77965_pinmux_info;
 extern const struct sh_pfc_soc_info r8a77970_pinmux_info;
 extern const struct sh_pfc_soc_info r8a77990_pinmux_info;
 extern const struct sh_pfc_soc_info r8a77995_pinmux_info;
+
 /* -----------------------------------------------------------------------------
  * Helper macros to create pin and port lists
  */
@@ -341,6 +357,28 @@ extern const struct sh_pfc_soc_info r8a77995_pinmux_info;
 #define PINMUX_IPSR_MSEL(ipsr, fn, msel)                               \
        PINMUX_DATA(fn##_MARK, FN_##msel, FN_##fn, FN_##ipsr)
 
+/*
+ * Describe a pinmux configuration similar to PINMUX_IPSR_MSEL, but with
+ * an additional select register that controls physical multiplexing
+ * with another pin.
+ *   - ipsr: IPSR field
+ *   - fn: Function name, also referring to the IPSR field
+ *   - psel: Physical multiplexing selector
+ *   - msel: Module selector
+ */
+#define PINMUX_IPSR_PHYS_MSEL(ipsr, fn, psel, msel) \
+       PINMUX_DATA(fn##_MARK, FN_##psel, FN_##msel, FN_##fn, FN_##ipsr)
+
+/*
+ * Describe a pinmux configuration in which a pin is physically multiplexed
+ * with other pins.
+ *   - ipsr: IPSR field
+ *   - fn: Function name, also referring to the IPSR field
+ *   - psel: Physical multiplexing selector
+ */
+#define PINMUX_IPSR_PHYS(ipsr, fn, psel) \
+       PINMUX_DATA(fn##_MARK, FN_##psel)
+
 /*
  * Describe a pinmux configuration for a single-function pin with GPIO
  * capability.
@@ -388,12 +426,11 @@ extern const struct sh_pfc_soc_info r8a77995_pinmux_info;
 
 #define PORT_GP_CFG_11(bank, fn, sfx, cfg)                             \
        PORT_GP_CFG_10(bank, fn, sfx, cfg),                             \
-       PORT_GP_CFG_1(bank, 10,  fn, sfx, cfg)
+       PORT_GP_CFG_1(bank, 10, fn, sfx, cfg)
 #define PORT_GP_11(bank, fn, sfx)      PORT_GP_CFG_11(bank, fn, sfx, 0)
 
 #define PORT_GP_CFG_12(bank, fn, sfx, cfg)                             \
-       PORT_GP_CFG_10(bank, fn, sfx, cfg),                             \
-       PORT_GP_CFG_1(bank, 10, fn, sfx, cfg),                          \
+       PORT_GP_CFG_11(bank, fn, sfx, cfg),                             \
        PORT_GP_CFG_1(bank, 11, fn, sfx, cfg)
 #define PORT_GP_12(bank, fn, sfx)      PORT_GP_CFG_12(bank, fn, sfx, 0)
 
index 4ed3c94e03115e06286a1bb7f41186bdebfba605..88dc9f273aebed4db07729cc4a082d46c7d1bfe8 100644 (file)
@@ -238,7 +238,7 @@ static int pbias_regulator_set_value(struct udevice *dev, int uV)
        if (rc)
                return rc;
 
-       if (uV == 3000000)
+       if (uV == 3300000)
                reg |= p->vmode;
        else if (uV == 1800000)
                reg &= ~p->vmode;
index 887cd687c027dbbe59820f239ddeb43d01f0c2c0..fcbb0a81edde04a959ee8c10c4ffc5dec6bbd292 100644 (file)
@@ -508,6 +508,15 @@ config ATMEL_USART
          configured in the device tree, and input clock frequency can
          be got from the clk node.
 
+config SPL_UART_CLOCK
+       int "SPL fixed UART input clock"
+       depends on ATMEL_USART && SPL && !SPL_CLK
+       default 132096000 if ARCH_AT91
+       help
+         Provide a fixed clock value as input to the UART controller. This
+         might be needed on platforms which can't enable CONFIG_SPL_CLK
+         because of SPL image size restrictions.
+
 config BCM283X_MU_SERIAL
        bool "Support for BCM283x Mini-UART"
        depends on DM_SERIAL && ARCH_BCM283X
index aa8cdff84082995a7e6c820ab52d9c4c345e72c6..c450a4e08a3dc3f33c15a07829c22fd4950e083b 100644 (file)
@@ -218,6 +218,17 @@ static const struct dm_serial_ops atmel_serial_ops = {
        .setbrg = atmel_serial_setbrg,
 };
 
+#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_CLK)
+static int atmel_serial_enable_clk(struct udevice *dev)
+{
+       struct atmel_serial_priv *priv = dev_get_priv(dev);
+
+       /* Use fixed clock value in SPL */
+       priv->usart_clk_rate = CONFIG_SPL_UART_CLOCK;
+
+       return 0;
+}
+#else
 static int atmel_serial_enable_clk(struct udevice *dev)
 {
        struct atmel_serial_priv *priv = dev_get_priv(dev);
@@ -245,6 +256,7 @@ static int atmel_serial_enable_clk(struct udevice *dev)
 
        return 0;
 }
+#endif
 
 static int atmel_serial_probe(struct udevice *dev)
 {
diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig
new file mode 100644 (file)
index 0000000..7b4e4d6
--- /dev/null
@@ -0,0 +1,5 @@
+menu "SOC (System On Chip) specific Drivers"
+
+source "drivers/soc/ti/Kconfig"
+
+endmenu
index 42037f99d587bbd99f293226e0b6f40d3fca9796..ce253b7aa88612f2425dd0fbe5d8c003693ac365 100644 (file)
@@ -2,4 +2,4 @@
 #
 # Makefile for the U-Boot SOC specific device drivers.
 
-obj-$(CONFIG_ARCH_KEYSTONE)    += keystone/
+obj-$(CONFIG_SOC_TI) += ti/
diff --git a/drivers/soc/keystone/Makefile b/drivers/soc/keystone/Makefile
deleted file mode 100644 (file)
index dfebb14..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0+
-
-obj-$(CONFIG_TI_KEYSTONE_SERDES) += keystone_serdes.o
diff --git a/drivers/soc/keystone/keystone_serdes.c b/drivers/soc/keystone/keystone_serdes.c
deleted file mode 100644 (file)
index 7907e6f..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * TI serdes driver for keystone2.
- *
- * (C) Copyright 2014
- *     Texas Instruments Incorporated, <www.ti.com>
- */
-
-#include <errno.h>
-#include <common.h>
-#include <asm/ti-common/keystone_serdes.h>
-
-#define SERDES_CMU_REGS(x)             (0x0000 + (0x0c00 * (x)))
-#define SERDES_LANE_REGS(x)            (0x0200 + (0x200 * (x)))
-#define SERDES_COMLANE_REGS            0x0a00
-#define SERDES_WIZ_REGS                        0x1fc0
-
-#define SERDES_CMU_REG_000(x)          (SERDES_CMU_REGS(x) + 0x000)
-#define SERDES_CMU_REG_010(x)          (SERDES_CMU_REGS(x) + 0x010)
-#define SERDES_COMLANE_REG_000         (SERDES_COMLANE_REGS + 0x000)
-#define SERDES_LANE_REG_000(x)         (SERDES_LANE_REGS(x) + 0x000)
-#define SERDES_LANE_REG_028(x)         (SERDES_LANE_REGS(x) + 0x028)
-#define SERDES_LANE_CTL_STATUS_REG(x)  (SERDES_WIZ_REGS + 0x0020 + (4 * (x)))
-#define SERDES_PLL_CTL_REG             (SERDES_WIZ_REGS + 0x0034)
-
-#define SERDES_RESET                   BIT(28)
-#define SERDES_LANE_RESET              BIT(29)
-#define SERDES_LANE_LOOPBACK           BIT(30)
-#define SERDES_LANE_EN_VAL(x, y, z)    (x[y] | (z << 26) | (z << 10))
-
-#define SERDES_CMU_CFG_NUM             5
-#define SERDES_COMLANE_CFG_NUM         10
-#define SERDES_LANE_CFG_NUM            10
-
-struct serdes_cfg {
-       u32 ofs;
-       u32 val;
-       u32 mask;
-};
-
-struct cfg_entry {
-       enum ks2_serdes_clock clk;
-       enum ks2_serdes_rate rate;
-       struct serdes_cfg cmu[SERDES_CMU_CFG_NUM];
-       struct serdes_cfg comlane[SERDES_COMLANE_CFG_NUM];
-       struct serdes_cfg lane[SERDES_LANE_CFG_NUM];
-};
-
-/* SERDES PHY lane enable configuration value, indexed by PHY interface */
-static u32 serdes_cfg_lane_enable[] = {
-       0xf000f0c0,     /* SGMII */
-       0xf0e9f038,     /* PCSR */
-};
-
-/* SERDES PHY PLL enable configuration value, indexed by PHY interface  */
-static u32 serdes_cfg_pll_enable[] = {
-       0xe0000000,     /* SGMII */
-       0xee000000,     /* PCSR */
-};
-
-/**
- * Array to hold all possible serdes configurations.
- * Combination for 5 clock settings and 6 baud rates.
- */
-static struct cfg_entry cfgs[] = {
-       {
-               .clk = SERDES_CLOCK_156P25M,
-               .rate = SERDES_RATE_5G,
-               .cmu = {
-                       {0x0000, 0x00800000, 0xffff0000},
-                       {0x0014, 0x00008282, 0x0000ffff},
-                       {0x0060, 0x00142438, 0x00ffffff},
-                       {0x0064, 0x00c3c700, 0x00ffff00},
-                       {0x0078, 0x0000c000, 0x0000ff00}
-               },
-               .comlane = {
-                       {0x0a00, 0x00000800, 0x0000ff00},
-                       {0x0a08, 0x38a20000, 0xffff0000},
-                       {0x0a30, 0x008a8a00, 0x00ffff00},
-                       {0x0a84, 0x00000600, 0x0000ff00},
-                       {0x0a94, 0x10000000, 0xff000000},
-                       {0x0aa0, 0x81000000, 0xff000000},
-                       {0x0abc, 0xff000000, 0xff000000},
-                       {0x0ac0, 0x0000008b, 0x000000ff},
-                       {0x0b08, 0x583f0000, 0xffff0000},
-                       {0x0b0c, 0x0000004e, 0x000000ff}
-               },
-               .lane = {
-                       {0x0004, 0x38000080, 0xff0000ff},
-                       {0x0008, 0x00000000, 0x000000ff},
-                       {0x000c, 0x02000000, 0xff000000},
-                       {0x0010, 0x1b000000, 0xff000000},
-                       {0x0014, 0x00006fb8, 0x0000ffff},
-                       {0x0018, 0x758000e4, 0xffff00ff},
-                       {0x00ac, 0x00004400, 0x0000ff00},
-                       {0x002c, 0x00100800, 0x00ffff00},
-                       {0x0080, 0x00820082, 0x00ff00ff},
-                       {0x0084, 0x1d0f0385, 0xffffffff}
-               },
-       },
-};
-
-static inline void ks2_serdes_rmw(u32 addr, u32 value, u32 mask)
-{
-       writel(((readl(addr) & (~mask)) | (value & mask)), addr);
-}
-
-static void ks2_serdes_cfg_setup(u32 base, struct serdes_cfg *cfg, u32 size)
-{
-       u32 i;
-
-       for (i = 0; i < size; i++)
-               ks2_serdes_rmw(base + cfg[i].ofs, cfg[i].val, cfg[i].mask);
-}
-
-static void ks2_serdes_lane_config(u32 base, struct serdes_cfg *cfg_lane,
-                                  u32 size, u32 lane)
-{
-       u32 i;
-
-       for (i = 0; i < size; i++)
-               ks2_serdes_rmw(base + cfg_lane[i].ofs + SERDES_LANE_REGS(lane),
-                              cfg_lane[i].val, cfg_lane[i].mask);
-}
-
-static int ks2_serdes_init_cfg(u32 base, struct cfg_entry *cfg, u32 num_lanes)
-{
-       u32 i;
-
-       ks2_serdes_cfg_setup(base, cfg->cmu, SERDES_CMU_CFG_NUM);
-       ks2_serdes_cfg_setup(base, cfg->comlane, SERDES_COMLANE_CFG_NUM);
-
-       for (i = 0; i < num_lanes; i++)
-               ks2_serdes_lane_config(base, cfg->lane, SERDES_LANE_CFG_NUM, i);
-
-       return 0;
-}
-
-static void ks2_serdes_cmu_comlane_enable(u32 base, struct ks2_serdes *serdes)
-{
-       /* Bring SerDes out of Reset */
-       ks2_serdes_rmw(base + SERDES_CMU_REG_010(0), 0x0, SERDES_RESET);
-       if (serdes->intf == SERDES_PHY_PCSR)
-               ks2_serdes_rmw(base + SERDES_CMU_REG_010(1), 0x0, SERDES_RESET);
-
-       /* Enable CMU and COMLANE */
-       ks2_serdes_rmw(base + SERDES_CMU_REG_000(0), 0x03, 0x000000ff);
-       if (serdes->intf == SERDES_PHY_PCSR)
-               ks2_serdes_rmw(base + SERDES_CMU_REG_000(1), 0x03, 0x000000ff);
-
-       ks2_serdes_rmw(base + SERDES_COMLANE_REG_000, 0x5f, 0x000000ff);
-}
-
-static void ks2_serdes_pll_enable(u32 base, struct ks2_serdes *serdes)
-{
-       writel(serdes_cfg_pll_enable[serdes->intf],
-              base + SERDES_PLL_CTL_REG);
-}
-
-static void ks2_serdes_lane_reset(u32 base, u32 reset, u32 lane)
-{
-       if (reset)
-               ks2_serdes_rmw(base + SERDES_LANE_REG_028(lane),
-                              0x1, SERDES_LANE_RESET);
-       else
-               ks2_serdes_rmw(base + SERDES_LANE_REG_028(lane),
-                              0x0, SERDES_LANE_RESET);
-}
-
-static void ks2_serdes_lane_enable(u32 base,
-                                  struct ks2_serdes *serdes, u32 lane)
-{
-       /* Bring lane out of reset */
-       ks2_serdes_lane_reset(base, 0, lane);
-
-       writel(SERDES_LANE_EN_VAL(serdes_cfg_lane_enable, serdes->intf,
-                                 serdes->rate_mode),
-              base + SERDES_LANE_CTL_STATUS_REG(lane));
-
-       /* Set NES bit if Loopback Enabled */
-       if (serdes->loopback)
-               ks2_serdes_rmw(base + SERDES_LANE_REG_000(lane),
-                              0x1, SERDES_LANE_LOOPBACK);
-}
-
-int ks2_serdes_init(u32 base, struct ks2_serdes *serdes, u32 num_lanes)
-{
-       int i;
-       int ret = 0;
-
-       for (i = 0; i < ARRAY_SIZE(cfgs); i++)
-               if (serdes->clk == cfgs[i].clk && serdes->rate == cfgs[i].rate)
-                       break;
-
-       if (i >= ARRAY_SIZE(cfgs)) {
-               puts("Cannot find keystone SerDes configuration");
-               return -EINVAL;
-       }
-
-       ks2_serdes_init_cfg(base, &cfgs[i], num_lanes);
-
-       ks2_serdes_cmu_comlane_enable(base, serdes);
-       for (i = 0; i < num_lanes; i++)
-               ks2_serdes_lane_enable(base, serdes, i);
-
-       ks2_serdes_pll_enable(base, serdes);
-
-       return ret;
-}
diff --git a/drivers/soc/ti/Kconfig b/drivers/soc/ti/Kconfig
new file mode 100644 (file)
index 0000000..e4f8834
--- /dev/null
@@ -0,0 +1,26 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+menuconfig SOC_TI
+       bool "TI SOC drivers support"
+
+if SOC_TI
+
+config TI_K3_NAVSS_RINGACC
+       bool "K3 Ring accelerator Sub System"
+       depends on ARCH_K3
+       select MISC
+       help
+         Say y here to support the K3 AM65x Ring accelerator module.
+         The Ring Accelerator (RINGACC or RA)  provides hardware acceleration
+         to enable straightforward passing of work between a producer
+         and a consumer. There is one RINGACC module per NAVSS on TI AM65x SoCs
+         If unsure, say N.
+
+config TI_KEYSTONE_SERDES
+       bool "Keystone SerDes driver for ethernet"
+       depends on ARCH_KEYSTONE
+       help
+        SerDes driver for Keystone SoC used for ethernet support on TI
+        K2 platforms.
+
+endif # SOC_TI
diff --git a/drivers/soc/ti/Makefile b/drivers/soc/ti/Makefile
new file mode 100644 (file)
index 0000000..4ec04ee
--- /dev/null
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+obj-$(CONFIG_TI_K3_NAVSS_RINGACC)      += k3-navss-ringacc.o
+obj-$(CONFIG_TI_KEYSTONE_SERDES)       += keystone_serdes.o
diff --git a/drivers/soc/ti/k3-navss-ringacc.c b/drivers/soc/ti/k3-navss-ringacc.c
new file mode 100644 (file)
index 0000000..fcb84f7
--- /dev/null
@@ -0,0 +1,1057 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * TI K3 AM65x NAVSS Ring accelerator Manager (RA) subsystem driver
+ *
+ * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <malloc.h>
+#include <asm/dma-mapping.h>
+#include <asm/bitops.h>
+#include <dm.h>
+#include <dm/read.h>
+#include <dm/uclass.h>
+#include <linux/compat.h>
+#include <linux/soc/ti/k3-navss-ringacc.h>
+#include <linux/soc/ti/ti_sci_protocol.h>
+
+#define set_bit(bit, bitmap)   __set_bit(bit, bitmap)
+#define clear_bit(bit, bitmap) __clear_bit(bit, bitmap)
+#define dma_free_coherent(dev, size, cpu_addr, dma_handle) \
+       dma_free_coherent(cpu_addr)
+#define dma_zalloc_coherent(dev, size, dma_handle, flag) \
+({ \
+       void    *ring_mem_virt; \
+       ring_mem_virt = dma_alloc_coherent((size), \
+                                          (unsigned long *)(dma_handle)); \
+       if (ring_mem_virt) \
+               memset(ring_mem_virt, 0, (size)); \
+       ring_mem_virt; \
+})
+
+static LIST_HEAD(k3_nav_ringacc_list);
+
+static void ringacc_writel(u32 v, void __iomem *reg)
+{
+       pr_debug("WRITEL(32): v(%08X)-->reg(%p)\n", v, reg);
+       writel(v, reg);
+}
+
+static u32 ringacc_readl(void __iomem *reg)
+{
+       u32 v;
+
+       v = readl(reg);
+       pr_debug("READL(32): v(%08X)<--reg(%p)\n", v, reg);
+       return v;
+}
+
+#define KNAV_RINGACC_CFG_RING_SIZE_ELCNT_MASK          GENMASK(19, 0)
+
+/**
+ * struct k3_nav_ring_rt_regs -  The RA Control/Status Registers region
+ */
+struct k3_nav_ring_rt_regs {
+       u32     resv_16[4];
+       u32     db;             /* RT Ring N Doorbell Register */
+       u32     resv_4[1];
+       u32     occ;            /* RT Ring N Occupancy Register */
+       u32     indx;           /* RT Ring N Current Index Register */
+       u32     hwocc;          /* RT Ring N Hardware Occupancy Register */
+       u32     hwindx;         /* RT Ring N Current Index Register */
+};
+
+#define KNAV_RINGACC_RT_REGS_STEP      0x1000
+
+/**
+ * struct k3_nav_ring_fifo_regs -  The Ring Accelerator Queues Registers region
+ */
+struct k3_nav_ring_fifo_regs {
+       u32     head_data[128];         /* Ring Head Entry Data Registers */
+       u32     tail_data[128];         /* Ring Tail Entry Data Registers */
+       u32     peek_head_data[128];    /* Ring Peek Head Entry Data Regs */
+       u32     peek_tail_data[128];    /* Ring Peek Tail Entry Data Regs */
+};
+
+/**
+ * struct k3_ringacc_proxy_gcfg_regs - RA Proxy Global Config MMIO Region
+ */
+struct k3_ringacc_proxy_gcfg_regs {
+       u32     revision;       /* Revision Register */
+       u32     config;         /* Config Register */
+};
+
+#define K3_RINGACC_PROXY_CFG_THREADS_MASK              GENMASK(15, 0)
+
+/**
+ * struct k3_ringacc_proxy_target_regs -  RA Proxy Datapath MMIO Region
+ */
+struct k3_ringacc_proxy_target_regs {
+       u32     control;        /* Proxy Control Register */
+       u32     status;         /* Proxy Status Register */
+       u8      resv_512[504];
+       u32     data[128];      /* Proxy Data Register */
+};
+
+#define K3_RINGACC_PROXY_TARGET_STEP   0x1000
+#define K3_RINGACC_PROXY_NOT_USED      (-1)
+
+enum k3_ringacc_proxy_access_mode {
+       PROXY_ACCESS_MODE_HEAD = 0,
+       PROXY_ACCESS_MODE_TAIL = 1,
+       PROXY_ACCESS_MODE_PEEK_HEAD = 2,
+       PROXY_ACCESS_MODE_PEEK_TAIL = 3,
+};
+
+#define KNAV_RINGACC_FIFO_WINDOW_SIZE_BYTES  (512U)
+#define KNAV_RINGACC_FIFO_REGS_STEP    0x1000
+#define KNAV_RINGACC_MAX_DB_RING_CNT    (127U)
+
+/**
+ * struct k3_nav_ring_ops -  Ring operations
+ */
+struct k3_nav_ring_ops {
+       int (*push_tail)(struct k3_nav_ring *ring, void *elm);
+       int (*push_head)(struct k3_nav_ring *ring, void *elm);
+       int (*pop_tail)(struct k3_nav_ring *ring, void *elm);
+       int (*pop_head)(struct k3_nav_ring *ring, void *elm);
+};
+
+/**
+ * struct k3_nav_ring - RA Ring descriptor
+ *
+ * @rt - Ring control/status registers
+ * @fifos - Ring queues registers
+ * @proxy - Ring Proxy Datapath registers
+ * @ring_mem_dma - Ring buffer dma address
+ * @ring_mem_virt - Ring buffer virt address
+ * @ops - Ring operations
+ * @size - Ring size in elements
+ * @elm_size - Size of the ring element
+ * @mode - Ring mode
+ * @flags - flags
+ * @free - Number of free elements
+ * @occ - Ring occupancy
+ * @windex - Write index (only for @K3_NAV_RINGACC_RING_MODE_RING)
+ * @rindex - Read index (only for @K3_NAV_RINGACC_RING_MODE_RING)
+ * @ring_id - Ring Id
+ * @parent - Pointer on struct @k3_nav_ringacc
+ * @use_count - Use count for shared rings
+ * @proxy_id - RA Ring Proxy Id (only if @K3_NAV_RINGACC_RING_USE_PROXY)
+ */
+struct k3_nav_ring {
+       struct k3_nav_ring_rt_regs __iomem *rt;
+       struct k3_nav_ring_fifo_regs __iomem *fifos;
+       struct k3_ringacc_proxy_target_regs  __iomem *proxy;
+       dma_addr_t      ring_mem_dma;
+       void            *ring_mem_virt;
+       struct k3_nav_ring_ops *ops;
+       u32             size;
+       enum k3_nav_ring_size elm_size;
+       enum k3_nav_ring_mode mode;
+       u32             flags;
+#define KNAV_RING_FLAG_BUSY    BIT(1)
+#define K3_NAV_RING_FLAG_SHARED        BIT(2)
+       u32             free;
+       u32             occ;
+       u32             windex;
+       u32             rindex;
+       u32             ring_id;
+       struct k3_nav_ringacc   *parent;
+       u32             use_count;
+       int             proxy_id;
+};
+
+/**
+ * struct k3_nav_ringacc - Rings accelerator descriptor
+ *
+ * @dev - pointer on RA device
+ * @proxy_gcfg - RA proxy global config registers
+ * @proxy_target_base - RA proxy datapath region
+ * @num_rings - number of ring in RA
+ * @rm_gp_range - general purpose rings range from tisci
+ * @dma_ring_reset_quirk - DMA reset w/a enable
+ * @num_proxies - number of RA proxies
+ * @rings - array of rings descriptors (struct @k3_nav_ring)
+ * @list - list of RAs in the system
+ * @tisci - pointer ti-sci handle
+ * @tisci_ring_ops - ti-sci rings ops
+ * @tisci_dev_id - ti-sci device id
+ */
+struct k3_nav_ringacc {
+       struct udevice *dev;
+       struct k3_ringacc_proxy_gcfg_regs __iomem *proxy_gcfg;
+       void __iomem *proxy_target_base;
+       u32 num_rings; /* number of rings in Ringacc module */
+       unsigned long *rings_inuse;
+       struct ti_sci_resource *rm_gp_range;
+       bool dma_ring_reset_quirk;
+       u32 num_proxies;
+       unsigned long *proxy_inuse;
+
+       struct k3_nav_ring *rings;
+       struct list_head list;
+
+       const struct ti_sci_handle *tisci;
+       const struct ti_sci_rm_ringacc_ops *tisci_ring_ops;
+       u32  tisci_dev_id;
+};
+
+static long k3_nav_ringacc_ring_get_fifo_pos(struct k3_nav_ring *ring)
+{
+       return KNAV_RINGACC_FIFO_WINDOW_SIZE_BYTES -
+              (4 << ring->elm_size);
+}
+
+static void *k3_nav_ringacc_get_elm_addr(struct k3_nav_ring *ring, u32 idx)
+{
+       return (idx * (4 << ring->elm_size) + ring->ring_mem_virt);
+}
+
+static int k3_nav_ringacc_ring_push_mem(struct k3_nav_ring *ring, void *elem);
+static int k3_nav_ringacc_ring_pop_mem(struct k3_nav_ring *ring, void *elem);
+
+static struct k3_nav_ring_ops k3_nav_mode_ring_ops = {
+               .push_tail = k3_nav_ringacc_ring_push_mem,
+               .pop_head = k3_nav_ringacc_ring_pop_mem,
+};
+
+static int k3_nav_ringacc_ring_push_io(struct k3_nav_ring *ring, void *elem);
+static int k3_nav_ringacc_ring_pop_io(struct k3_nav_ring *ring, void *elem);
+static int k3_nav_ringacc_ring_push_head_io(struct k3_nav_ring *ring,
+                                           void *elem);
+static int k3_nav_ringacc_ring_pop_tail_io(struct k3_nav_ring *ring,
+                                          void *elem);
+
+static struct k3_nav_ring_ops k3_nav_mode_msg_ops = {
+               .push_tail = k3_nav_ringacc_ring_push_io,
+               .push_head = k3_nav_ringacc_ring_push_head_io,
+               .pop_tail = k3_nav_ringacc_ring_pop_tail_io,
+               .pop_head = k3_nav_ringacc_ring_pop_io,
+};
+
+static int k3_ringacc_ring_push_head_proxy(struct k3_nav_ring *ring,
+                                          void *elem);
+static int k3_ringacc_ring_push_tail_proxy(struct k3_nav_ring *ring,
+                                          void *elem);
+static int k3_ringacc_ring_pop_head_proxy(struct k3_nav_ring *ring, void *elem);
+static int k3_ringacc_ring_pop_tail_proxy(struct k3_nav_ring *ring, void *elem);
+
+static struct k3_nav_ring_ops k3_nav_mode_proxy_ops = {
+               .push_tail = k3_ringacc_ring_push_tail_proxy,
+               .push_head = k3_ringacc_ring_push_head_proxy,
+               .pop_tail = k3_ringacc_ring_pop_tail_proxy,
+               .pop_head = k3_ringacc_ring_pop_head_proxy,
+};
+
+struct udevice *k3_nav_ringacc_get_dev(struct k3_nav_ringacc *ringacc)
+{
+       return ringacc->dev;
+}
+
+struct k3_nav_ring *k3_nav_ringacc_request_ring(struct k3_nav_ringacc *ringacc,
+                                               int id, u32 flags)
+{
+       int proxy_id = K3_RINGACC_PROXY_NOT_USED;
+
+       if (id == K3_NAV_RINGACC_RING_ID_ANY) {
+               /* Request for any general purpose ring */
+               struct ti_sci_resource_desc *gp_rings =
+                                       &ringacc->rm_gp_range->desc[0];
+               unsigned long size;
+
+               size = gp_rings->start + gp_rings->num;
+               id = find_next_zero_bit(ringacc->rings_inuse,
+                                       size, gp_rings->start);
+               if (id == size)
+                       goto error;
+       } else if (id < 0) {
+               goto error;
+       }
+
+       if (test_bit(id, ringacc->rings_inuse) &&
+           !(ringacc->rings[id].flags & K3_NAV_RING_FLAG_SHARED))
+               goto error;
+       else if (ringacc->rings[id].flags & K3_NAV_RING_FLAG_SHARED)
+               goto out;
+
+       if (flags & K3_NAV_RINGACC_RING_USE_PROXY) {
+               proxy_id = find_next_zero_bit(ringacc->proxy_inuse,
+                                             ringacc->num_proxies, 0);
+               if (proxy_id == ringacc->num_proxies)
+                       goto error;
+       }
+
+       if (!try_module_get(ringacc->dev->driver->owner))
+               goto error;
+
+       if (proxy_id != K3_RINGACC_PROXY_NOT_USED) {
+               set_bit(proxy_id, ringacc->proxy_inuse);
+               ringacc->rings[id].proxy_id = proxy_id;
+               pr_debug("Giving ring#%d proxy#%d\n",
+                        id, proxy_id);
+       } else {
+               pr_debug("Giving ring#%d\n", id);
+       }
+
+       set_bit(id, ringacc->rings_inuse);
+out:
+       ringacc->rings[id].use_count++;
+       return &ringacc->rings[id];
+
+error:
+       return NULL;
+}
+
+static void k3_ringacc_ring_reset_sci(struct k3_nav_ring *ring)
+{
+       struct k3_nav_ringacc *ringacc = ring->parent;
+       int ret;
+
+       ret = ringacc->tisci_ring_ops->config(
+                       ringacc->tisci,
+                       TI_SCI_MSG_VALUE_RM_RING_COUNT_VALID,
+                       ringacc->tisci_dev_id,
+                       ring->ring_id,
+                       0,
+                       0,
+                       ring->size,
+                       0,
+                       0,
+                       0);
+       if (ret)
+               dev_err(ringacc->dev, "TISCI reset ring fail (%d) ring_idx %d\n",
+                       ret, ring->ring_id);
+}
+
+void k3_nav_ringacc_ring_reset(struct k3_nav_ring *ring)
+{
+       if (!ring || !(ring->flags & KNAV_RING_FLAG_BUSY))
+               return;
+
+       ring->occ = 0;
+       ring->free = 0;
+       ring->rindex = 0;
+       ring->windex = 0;
+
+       k3_ringacc_ring_reset_sci(ring);
+}
+
+static void k3_ringacc_ring_reconfig_qmode_sci(struct k3_nav_ring *ring,
+                                              enum k3_nav_ring_mode mode)
+{
+       struct k3_nav_ringacc *ringacc = ring->parent;
+       int ret;
+
+       ret = ringacc->tisci_ring_ops->config(
+                       ringacc->tisci,
+                       TI_SCI_MSG_VALUE_RM_RING_MODE_VALID,
+                       ringacc->tisci_dev_id,
+                       ring->ring_id,
+                       0,
+                       0,
+                       0,
+                       mode,
+                       0,
+                       0);
+       if (ret)
+               dev_err(ringacc->dev, "TISCI reconf qmode fail (%d) ring_idx %d\n",
+                       ret, ring->ring_id);
+}
+
+void k3_nav_ringacc_ring_reset_dma(struct k3_nav_ring *ring, u32 occ)
+{
+       if (!ring || !(ring->flags & KNAV_RING_FLAG_BUSY))
+               return;
+
+       if (!ring->parent->dma_ring_reset_quirk)
+               return;
+
+       if (!occ)
+               occ = ringacc_readl(&ring->rt->occ);
+
+       if (occ) {
+               u32 db_ring_cnt, db_ring_cnt_cur;
+
+               pr_debug("%s %u occ: %u\n", __func__,
+                        ring->ring_id, occ);
+               /* 2. Reset the ring */
+               k3_ringacc_ring_reset_sci(ring);
+
+               /*
+                * 3. Setup the ring in ring/doorbell mode
+                * (if not already in this mode)
+                */
+               if (ring->mode != K3_NAV_RINGACC_RING_MODE_RING)
+                       k3_ringacc_ring_reconfig_qmode_sci(
+                                       ring, K3_NAV_RINGACC_RING_MODE_RING);
+               /*
+                * 4. Ring the doorbell 2**22 â€“ ringOcc times.
+                * This will wrap the internal UDMAP ring state occupancy
+                * counter (which is 21-bits wide) to 0.
+                */
+               db_ring_cnt = (1U << 22) - occ;
+
+               while (db_ring_cnt != 0) {
+                       /*
+                        * Ring the doorbell with the maximum count each
+                        * iteration if possible to minimize the total
+                        * of writes
+                        */
+                       if (db_ring_cnt > KNAV_RINGACC_MAX_DB_RING_CNT)
+                               db_ring_cnt_cur = KNAV_RINGACC_MAX_DB_RING_CNT;
+                       else
+                               db_ring_cnt_cur = db_ring_cnt;
+
+                       writel(db_ring_cnt_cur, &ring->rt->db);
+                       db_ring_cnt -= db_ring_cnt_cur;
+               }
+
+               /* 5. Restore the original ring mode (if not ring mode) */
+               if (ring->mode != K3_NAV_RINGACC_RING_MODE_RING)
+                       k3_ringacc_ring_reconfig_qmode_sci(ring, ring->mode);
+       }
+
+       /* 2. Reset the ring */
+       k3_nav_ringacc_ring_reset(ring);
+}
+
+static void k3_ringacc_ring_free_sci(struct k3_nav_ring *ring)
+{
+       struct k3_nav_ringacc *ringacc = ring->parent;
+       int ret;
+
+       ret = ringacc->tisci_ring_ops->config(
+                       ringacc->tisci,
+                       TI_SCI_MSG_VALUE_RM_ALL_NO_ORDER,
+                       ringacc->tisci_dev_id,
+                       ring->ring_id,
+                       0,
+                       0,
+                       0,
+                       0,
+                       0,
+                       0);
+       if (ret)
+               dev_err(ringacc->dev, "TISCI ring free fail (%d) ring_idx %d\n",
+                       ret, ring->ring_id);
+}
+
+int k3_nav_ringacc_ring_free(struct k3_nav_ring *ring)
+{
+       struct k3_nav_ringacc *ringacc;
+
+       if (!ring)
+               return -EINVAL;
+
+       ringacc = ring->parent;
+
+       pr_debug("%s flags: 0x%08x\n", __func__, ring->flags);
+
+       if (!test_bit(ring->ring_id, ringacc->rings_inuse))
+               return -EINVAL;
+
+       if (--ring->use_count)
+               goto out;
+
+       if (!(ring->flags & KNAV_RING_FLAG_BUSY))
+               goto no_init;
+
+       k3_ringacc_ring_free_sci(ring);
+
+       dma_free_coherent(ringacc->dev,
+                         ring->size * (4 << ring->elm_size),
+                         ring->ring_mem_virt, ring->ring_mem_dma);
+       ring->flags &= ~KNAV_RING_FLAG_BUSY;
+       ring->ops = NULL;
+       if (ring->proxy_id != K3_RINGACC_PROXY_NOT_USED) {
+               clear_bit(ring->proxy_id, ringacc->proxy_inuse);
+               ring->proxy = NULL;
+               ring->proxy_id = K3_RINGACC_PROXY_NOT_USED;
+       }
+
+no_init:
+       clear_bit(ring->ring_id, ringacc->rings_inuse);
+
+       module_put(ringacc->dev->driver->owner);
+
+out:
+       return 0;
+}
+
+u32 k3_nav_ringacc_get_ring_id(struct k3_nav_ring *ring)
+{
+       if (!ring)
+               return -EINVAL;
+
+       return ring->ring_id;
+}
+
+static int k3_nav_ringacc_ring_cfg_sci(struct k3_nav_ring *ring)
+{
+       struct k3_nav_ringacc *ringacc = ring->parent;
+       u32 ring_idx;
+       int ret;
+
+       if (!ringacc->tisci)
+               return -EINVAL;
+
+       ring_idx = ring->ring_id;
+       ret = ringacc->tisci_ring_ops->config(
+                       ringacc->tisci,
+                       TI_SCI_MSG_VALUE_RM_ALL_NO_ORDER,
+                       ringacc->tisci_dev_id,
+                       ring_idx,
+                       lower_32_bits(ring->ring_mem_dma),
+                       upper_32_bits(ring->ring_mem_dma),
+                       ring->size,
+                       ring->mode,
+                       ring->elm_size,
+                       0);
+       if (ret)
+               dev_err(ringacc->dev, "TISCI config ring fail (%d) ring_idx %d\n",
+                       ret, ring_idx);
+
+       return ret;
+}
+
+int k3_nav_ringacc_ring_cfg(struct k3_nav_ring *ring,
+                           struct k3_nav_ring_cfg *cfg)
+{
+       struct k3_nav_ringacc *ringacc = ring->parent;
+       int ret = 0;
+
+       if (!ring || !cfg)
+               return -EINVAL;
+       if (cfg->elm_size > K3_NAV_RINGACC_RING_ELSIZE_256 ||
+           cfg->mode > K3_NAV_RINGACC_RING_MODE_QM ||
+           cfg->size & ~KNAV_RINGACC_CFG_RING_SIZE_ELCNT_MASK ||
+           !test_bit(ring->ring_id, ringacc->rings_inuse))
+               return -EINVAL;
+
+       if (ring->use_count != 1)
+               return 0;
+
+       ring->size = cfg->size;
+       ring->elm_size = cfg->elm_size;
+       ring->mode = cfg->mode;
+       ring->occ = 0;
+       ring->free = 0;
+       ring->rindex = 0;
+       ring->windex = 0;
+
+       if (ring->proxy_id != K3_RINGACC_PROXY_NOT_USED)
+               ring->proxy = ringacc->proxy_target_base +
+                             ring->proxy_id * K3_RINGACC_PROXY_TARGET_STEP;
+
+       switch (ring->mode) {
+       case K3_NAV_RINGACC_RING_MODE_RING:
+               ring->ops = &k3_nav_mode_ring_ops;
+               break;
+       case K3_NAV_RINGACC_RING_MODE_QM:
+               /*
+                * In Queue mode elm_size can be 8 only and each operation
+                * uses 2 element slots
+                */
+               if (cfg->elm_size != K3_NAV_RINGACC_RING_ELSIZE_8 ||
+                   cfg->size % 2)
+                       goto err_free_proxy;
+       case K3_NAV_RINGACC_RING_MODE_MESSAGE:
+               if (ring->proxy)
+                       ring->ops = &k3_nav_mode_proxy_ops;
+               else
+                       ring->ops = &k3_nav_mode_msg_ops;
+               break;
+       default:
+               ring->ops = NULL;
+               ret = -EINVAL;
+               goto err_free_proxy;
+       };
+
+       ring->ring_mem_virt =
+                       dma_zalloc_coherent(ringacc->dev,
+                                           ring->size * (4 << ring->elm_size),
+                                           &ring->ring_mem_dma, GFP_KERNEL);
+       if (!ring->ring_mem_virt) {
+               dev_err(ringacc->dev, "Failed to alloc ring mem\n");
+               ret = -ENOMEM;
+               goto err_free_ops;
+       }
+
+       ret = k3_nav_ringacc_ring_cfg_sci(ring);
+
+       if (ret)
+               goto err_free_mem;
+
+       ring->flags |= KNAV_RING_FLAG_BUSY;
+       ring->flags |= (cfg->flags & K3_NAV_RINGACC_RING_SHARED) ?
+                       K3_NAV_RING_FLAG_SHARED : 0;
+
+       return 0;
+
+err_free_mem:
+       dma_free_coherent(ringacc->dev,
+                         ring->size * (4 << ring->elm_size),
+                         ring->ring_mem_virt,
+                         ring->ring_mem_dma);
+err_free_ops:
+       ring->ops = NULL;
+err_free_proxy:
+       ring->proxy = NULL;
+       return ret;
+}
+
+u32 k3_nav_ringacc_ring_get_size(struct k3_nav_ring *ring)
+{
+       if (!ring || !(ring->flags & KNAV_RING_FLAG_BUSY))
+               return -EINVAL;
+
+       return ring->size;
+}
+
+u32 k3_nav_ringacc_ring_get_free(struct k3_nav_ring *ring)
+{
+       if (!ring || !(ring->flags & KNAV_RING_FLAG_BUSY))
+               return -EINVAL;
+
+       if (!ring->free)
+               ring->free = ring->size - ringacc_readl(&ring->rt->occ);
+
+       return ring->free;
+}
+
+u32 k3_nav_ringacc_ring_get_occ(struct k3_nav_ring *ring)
+{
+       if (!ring || !(ring->flags & KNAV_RING_FLAG_BUSY))
+               return -EINVAL;
+
+       return ringacc_readl(&ring->rt->occ);
+}
+
+u32 k3_nav_ringacc_ring_is_full(struct k3_nav_ring *ring)
+{
+       return !k3_nav_ringacc_ring_get_free(ring);
+}
+
+enum k3_ringacc_access_mode {
+       K3_RINGACC_ACCESS_MODE_PUSH_HEAD,
+       K3_RINGACC_ACCESS_MODE_POP_HEAD,
+       K3_RINGACC_ACCESS_MODE_PUSH_TAIL,
+       K3_RINGACC_ACCESS_MODE_POP_TAIL,
+       K3_RINGACC_ACCESS_MODE_PEEK_HEAD,
+       K3_RINGACC_ACCESS_MODE_PEEK_TAIL,
+};
+
+static int k3_ringacc_ring_cfg_proxy(struct k3_nav_ring *ring,
+                                    enum k3_ringacc_proxy_access_mode mode)
+{
+       u32 val;
+
+       val = ring->ring_id;
+       val |= mode << 16;
+       val |= ring->elm_size << 24;
+       ringacc_writel(val, &ring->proxy->control);
+       return 0;
+}
+
+static int k3_nav_ringacc_ring_access_proxy(
+                       struct k3_nav_ring *ring, void *elem,
+                       enum k3_ringacc_access_mode access_mode)
+{
+       void __iomem *ptr;
+
+       ptr = (void __iomem *)&ring->proxy->data;
+
+       switch (access_mode) {
+       case K3_RINGACC_ACCESS_MODE_PUSH_HEAD:
+       case K3_RINGACC_ACCESS_MODE_POP_HEAD:
+               k3_ringacc_ring_cfg_proxy(ring, PROXY_ACCESS_MODE_HEAD);
+               break;
+       case K3_RINGACC_ACCESS_MODE_PUSH_TAIL:
+       case K3_RINGACC_ACCESS_MODE_POP_TAIL:
+               k3_ringacc_ring_cfg_proxy(ring, PROXY_ACCESS_MODE_TAIL);
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       ptr += k3_nav_ringacc_ring_get_fifo_pos(ring);
+
+       switch (access_mode) {
+       case K3_RINGACC_ACCESS_MODE_POP_HEAD:
+       case K3_RINGACC_ACCESS_MODE_POP_TAIL:
+               pr_debug("proxy:memcpy_fromio(x): --> ptr(%p), mode:%d\n",
+                        ptr, access_mode);
+               memcpy_fromio(elem, ptr, (4 << ring->elm_size));
+               ring->occ--;
+               break;
+       case K3_RINGACC_ACCESS_MODE_PUSH_TAIL:
+       case K3_RINGACC_ACCESS_MODE_PUSH_HEAD:
+               pr_debug("proxy:memcpy_toio(x): --> ptr(%p), mode:%d\n",
+                        ptr, access_mode);
+               memcpy_toio(ptr, elem, (4 << ring->elm_size));
+               ring->free--;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       pr_debug("proxy: free%d occ%d\n",
+                ring->free, ring->occ);
+       return 0;
+}
+
+static int k3_ringacc_ring_push_head_proxy(struct k3_nav_ring *ring, void *elem)
+{
+       return k3_nav_ringacc_ring_access_proxy(
+                       ring, elem, K3_RINGACC_ACCESS_MODE_PUSH_HEAD);
+}
+
+static int k3_ringacc_ring_push_tail_proxy(struct k3_nav_ring *ring, void *elem)
+{
+       return k3_nav_ringacc_ring_access_proxy(
+                       ring, elem, K3_RINGACC_ACCESS_MODE_PUSH_TAIL);
+}
+
+static int k3_ringacc_ring_pop_head_proxy(struct k3_nav_ring *ring, void *elem)
+{
+       return k3_nav_ringacc_ring_access_proxy(
+                       ring, elem, K3_RINGACC_ACCESS_MODE_POP_HEAD);
+}
+
+static int k3_ringacc_ring_pop_tail_proxy(struct k3_nav_ring *ring, void *elem)
+{
+       return k3_nav_ringacc_ring_access_proxy(
+                       ring, elem, K3_RINGACC_ACCESS_MODE_POP_HEAD);
+}
+
+static int k3_nav_ringacc_ring_access_io(
+               struct k3_nav_ring *ring, void *elem,
+               enum k3_ringacc_access_mode access_mode)
+{
+       void __iomem *ptr;
+
+       switch (access_mode) {
+       case K3_RINGACC_ACCESS_MODE_PUSH_HEAD:
+       case K3_RINGACC_ACCESS_MODE_POP_HEAD:
+               ptr = (void __iomem *)&ring->fifos->head_data;
+               break;
+       case K3_RINGACC_ACCESS_MODE_PUSH_TAIL:
+       case K3_RINGACC_ACCESS_MODE_POP_TAIL:
+               ptr = (void __iomem *)&ring->fifos->tail_data;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       ptr += k3_nav_ringacc_ring_get_fifo_pos(ring);
+
+       switch (access_mode) {
+       case K3_RINGACC_ACCESS_MODE_POP_HEAD:
+       case K3_RINGACC_ACCESS_MODE_POP_TAIL:
+               pr_debug("memcpy_fromio(x): --> ptr(%p), mode:%d\n",
+                        ptr, access_mode);
+               memcpy_fromio(elem, ptr, (4 << ring->elm_size));
+               ring->occ--;
+               break;
+       case K3_RINGACC_ACCESS_MODE_PUSH_TAIL:
+       case K3_RINGACC_ACCESS_MODE_PUSH_HEAD:
+               pr_debug("memcpy_toio(x): --> ptr(%p), mode:%d\n",
+                        ptr, access_mode);
+               memcpy_toio(ptr, elem, (4 << ring->elm_size));
+               ring->free--;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       pr_debug("free%d index%d occ%d index%d\n",
+                ring->free, ring->windex, ring->occ, ring->rindex);
+       return 0;
+}
+
+static int k3_nav_ringacc_ring_push_head_io(struct k3_nav_ring *ring,
+                                           void *elem)
+{
+       return k3_nav_ringacc_ring_access_io(
+                       ring, elem, K3_RINGACC_ACCESS_MODE_PUSH_HEAD);
+}
+
+static int k3_nav_ringacc_ring_push_io(struct k3_nav_ring *ring, void *elem)
+{
+       return k3_nav_ringacc_ring_access_io(
+                       ring, elem, K3_RINGACC_ACCESS_MODE_PUSH_TAIL);
+}
+
+static int k3_nav_ringacc_ring_pop_io(struct k3_nav_ring *ring, void *elem)
+{
+       return k3_nav_ringacc_ring_access_io(
+                       ring, elem, K3_RINGACC_ACCESS_MODE_POP_HEAD);
+}
+
+static int k3_nav_ringacc_ring_pop_tail_io(struct k3_nav_ring *ring, void *elem)
+{
+       return k3_nav_ringacc_ring_access_io(
+                       ring, elem, K3_RINGACC_ACCESS_MODE_POP_HEAD);
+}
+
+static int k3_nav_ringacc_ring_push_mem(struct k3_nav_ring *ring, void *elem)
+{
+       void *elem_ptr;
+
+       elem_ptr = k3_nav_ringacc_get_elm_addr(ring, ring->windex);
+
+       memcpy(elem_ptr, elem, (4 << ring->elm_size));
+
+       ring->windex = (ring->windex + 1) % ring->size;
+       ring->free--;
+       ringacc_writel(1, &ring->rt->db);
+
+       pr_debug("ring_push_mem: free%d index%d\n",
+                ring->free, ring->windex);
+
+       return 0;
+}
+
+static int k3_nav_ringacc_ring_pop_mem(struct k3_nav_ring *ring, void *elem)
+{
+       void *elem_ptr;
+
+       elem_ptr = k3_nav_ringacc_get_elm_addr(ring, ring->rindex);
+
+       memcpy(elem, elem_ptr, (4 << ring->elm_size));
+
+       ring->rindex = (ring->rindex + 1) % ring->size;
+       ring->occ--;
+       ringacc_writel(-1, &ring->rt->db);
+
+       pr_debug("ring_pop_mem: occ%d index%d pos_ptr%p\n",
+                ring->occ, ring->rindex, elem_ptr);
+       return 0;
+}
+
+int k3_nav_ringacc_ring_push(struct k3_nav_ring *ring, void *elem)
+{
+       int ret = -EOPNOTSUPP;
+
+       if (!ring || !(ring->flags & KNAV_RING_FLAG_BUSY))
+               return -EINVAL;
+
+       pr_debug("ring_push%d: free%d index%d\n",
+                ring->ring_id, ring->free, ring->windex);
+
+       if (k3_nav_ringacc_ring_is_full(ring))
+               return -ENOMEM;
+
+       if (ring->ops && ring->ops->push_tail)
+               ret = ring->ops->push_tail(ring, elem);
+
+       return ret;
+}
+
+int k3_nav_ringacc_ring_push_head(struct k3_nav_ring *ring, void *elem)
+{
+       int ret = -EOPNOTSUPP;
+
+       if (!ring || !(ring->flags & KNAV_RING_FLAG_BUSY))
+               return -EINVAL;
+
+       pr_debug("ring_push_head: free%d index%d\n",
+                ring->free, ring->windex);
+
+       if (k3_nav_ringacc_ring_is_full(ring))
+               return -ENOMEM;
+
+       if (ring->ops && ring->ops->push_head)
+               ret = ring->ops->push_head(ring, elem);
+
+       return ret;
+}
+
+int k3_nav_ringacc_ring_pop(struct k3_nav_ring *ring, void *elem)
+{
+       int ret = -EOPNOTSUPP;
+
+       if (!ring || !(ring->flags & KNAV_RING_FLAG_BUSY))
+               return -EINVAL;
+
+       if (!ring->occ)
+               ring->occ = k3_nav_ringacc_ring_get_occ(ring);
+
+       pr_debug("ring_pop%d: occ%d index%d\n",
+                ring->ring_id, ring->occ, ring->rindex);
+
+       if (!ring->occ)
+               return -ENODATA;
+
+       if (ring->ops && ring->ops->pop_head)
+               ret = ring->ops->pop_head(ring, elem);
+
+       return ret;
+}
+
+int k3_nav_ringacc_ring_pop_tail(struct k3_nav_ring *ring, void *elem)
+{
+       int ret = -EOPNOTSUPP;
+
+       if (!ring || !(ring->flags & KNAV_RING_FLAG_BUSY))
+               return -EINVAL;
+
+       if (!ring->occ)
+               ring->occ = k3_nav_ringacc_ring_get_occ(ring);
+
+       pr_debug("ring_pop_tail: occ%d index%d\n",
+                ring->occ, ring->rindex);
+
+       if (!ring->occ)
+               return -ENODATA;
+
+       if (ring->ops && ring->ops->pop_tail)
+               ret = ring->ops->pop_tail(ring, elem);
+
+       return ret;
+}
+
+static int k3_nav_ringacc_probe_dt(struct k3_nav_ringacc *ringacc)
+{
+       struct udevice *dev = ringacc->dev;
+       struct udevice *tisci_dev = NULL;
+       int ret;
+
+       ringacc->num_rings = dev_read_u32_default(dev, "ti,num-rings", 0);
+       if (!ringacc->num_rings) {
+               dev_err(dev, "ti,num-rings read failure %d\n", ret);
+               return -EINVAL;
+       }
+
+       ringacc->dma_ring_reset_quirk =
+                       dev_read_bool(dev, "ti,dma-ring-reset-quirk");
+
+       ret = uclass_get_device_by_name(UCLASS_FIRMWARE, "dmsc", &tisci_dev);
+       if (ret) {
+               pr_debug("TISCI RA RM get failed (%d)\n", ret);
+               ringacc->tisci = NULL;
+               return -ENODEV;
+       }
+       ringacc->tisci = (struct ti_sci_handle *)
+                        (ti_sci_get_handle_from_sysfw(tisci_dev));
+
+       ret = dev_read_u32_default(dev, "ti,sci", 0);
+       if (!ret) {
+               dev_err(dev, "TISCI RA RM disabled\n");
+               ringacc->tisci = NULL;
+               return ret;
+       }
+
+       ret = dev_read_u32(dev, "ti,sci-dev-id", &ringacc->tisci_dev_id);
+       if (ret) {
+               dev_err(dev, "ti,sci-dev-id read failure %d\n", ret);
+               ringacc->tisci = NULL;
+               return ret;
+       }
+
+       ringacc->rm_gp_range = devm_ti_sci_get_of_resource(
+                                       ringacc->tisci, dev,
+                                       ringacc->tisci_dev_id,
+                                       "ti,sci-rm-range-gp-rings");
+       if (IS_ERR(ringacc->rm_gp_range))
+               ret = PTR_ERR(ringacc->rm_gp_range);
+
+       return 0;
+}
+
+static int k3_nav_ringacc_probe(struct udevice *dev)
+{
+       struct k3_nav_ringacc *ringacc;
+       void __iomem *base_fifo, *base_rt;
+       int ret, i;
+
+       ringacc = dev_get_priv(dev);
+       if (!ringacc)
+               return -ENOMEM;
+
+       ringacc->dev = dev;
+
+       ret = k3_nav_ringacc_probe_dt(ringacc);
+       if (ret)
+               return ret;
+
+       base_rt = (uint32_t *)devfdt_get_addr_name(dev, "rt");
+       pr_debug("rt %p\n", base_rt);
+       if (IS_ERR(base_rt))
+               return PTR_ERR(base_rt);
+
+       base_fifo = (uint32_t *)devfdt_get_addr_name(dev, "fifos");
+       pr_debug("fifos %p\n", base_fifo);
+       if (IS_ERR(base_fifo))
+               return PTR_ERR(base_fifo);
+
+       ringacc->proxy_gcfg = (struct k3_ringacc_proxy_gcfg_regs __iomem *)
+               devfdt_get_addr_name(dev, "proxy_gcfg");
+       if (IS_ERR(ringacc->proxy_gcfg))
+               return PTR_ERR(ringacc->proxy_gcfg);
+       ringacc->proxy_target_base =
+               (struct k3_ringacc_proxy_gcfg_regs __iomem *)
+               devfdt_get_addr_name(dev, "proxy_target");
+       if (IS_ERR(ringacc->proxy_target_base))
+               return PTR_ERR(ringacc->proxy_target_base);
+
+       ringacc->num_proxies = ringacc_readl(&ringacc->proxy_gcfg->config) &
+                                        K3_RINGACC_PROXY_CFG_THREADS_MASK;
+
+       ringacc->rings = devm_kzalloc(dev,
+                                     sizeof(*ringacc->rings) *
+                                     ringacc->num_rings,
+                                     GFP_KERNEL);
+       ringacc->rings_inuse = devm_kcalloc(dev,
+                                           BITS_TO_LONGS(ringacc->num_rings),
+                                           sizeof(unsigned long), GFP_KERNEL);
+       ringacc->proxy_inuse = devm_kcalloc(dev,
+                                           BITS_TO_LONGS(ringacc->num_proxies),
+                                           sizeof(unsigned long), GFP_KERNEL);
+
+       if (!ringacc->rings || !ringacc->rings_inuse || !ringacc->proxy_inuse)
+               return -ENOMEM;
+
+       for (i = 0; i < ringacc->num_rings; i++) {
+               ringacc->rings[i].rt = base_rt +
+                                      KNAV_RINGACC_RT_REGS_STEP * i;
+               ringacc->rings[i].fifos = base_fifo +
+                                         KNAV_RINGACC_FIFO_REGS_STEP * i;
+               ringacc->rings[i].parent = ringacc;
+               ringacc->rings[i].ring_id = i;
+               ringacc->rings[i].proxy_id = K3_RINGACC_PROXY_NOT_USED;
+       }
+       dev_set_drvdata(dev, ringacc);
+
+       ringacc->tisci_ring_ops = &ringacc->tisci->ops.rm_ring_ops;
+
+       list_add_tail(&ringacc->list, &k3_nav_ringacc_list);
+
+       dev_info(dev, "Ring Accelerator probed rings:%u, gp-rings[%u,%u] sci-dev-id:%u\n",
+                ringacc->num_rings,
+                ringacc->rm_gp_range->desc[0].start,
+                ringacc->rm_gp_range->desc[0].num,
+                ringacc->tisci_dev_id);
+       dev_info(dev, "dma-ring-reset-quirk: %s\n",
+                ringacc->dma_ring_reset_quirk ? "enabled" : "disabled");
+       dev_info(dev, "RA Proxy rev. %08x, num_proxies:%u\n",
+                ringacc_readl(&ringacc->proxy_gcfg->revision),
+                ringacc->num_proxies);
+       return 0;
+}
+
+static const struct udevice_id knav_ringacc_ids[] = {
+       { .compatible = "ti,am654-navss-ringacc" },
+       {},
+};
+
+U_BOOT_DRIVER(k3_navss_ringacc) = {
+       .name   = "k3-navss-ringacc",
+       .id     = UCLASS_MISC,
+       .of_match = knav_ringacc_ids,
+       .probe = k3_nav_ringacc_probe,
+       .priv_auto_alloc_size = sizeof(struct k3_nav_ringacc),
+};
diff --git a/drivers/soc/ti/keystone_serdes.c b/drivers/soc/ti/keystone_serdes.c
new file mode 100644 (file)
index 0000000..7907e6f
--- /dev/null
@@ -0,0 +1,209 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * TI serdes driver for keystone2.
+ *
+ * (C) Copyright 2014
+ *     Texas Instruments Incorporated, <www.ti.com>
+ */
+
+#include <errno.h>
+#include <common.h>
+#include <asm/ti-common/keystone_serdes.h>
+
+#define SERDES_CMU_REGS(x)             (0x0000 + (0x0c00 * (x)))
+#define SERDES_LANE_REGS(x)            (0x0200 + (0x200 * (x)))
+#define SERDES_COMLANE_REGS            0x0a00
+#define SERDES_WIZ_REGS                        0x1fc0
+
+#define SERDES_CMU_REG_000(x)          (SERDES_CMU_REGS(x) + 0x000)
+#define SERDES_CMU_REG_010(x)          (SERDES_CMU_REGS(x) + 0x010)
+#define SERDES_COMLANE_REG_000         (SERDES_COMLANE_REGS + 0x000)
+#define SERDES_LANE_REG_000(x)         (SERDES_LANE_REGS(x) + 0x000)
+#define SERDES_LANE_REG_028(x)         (SERDES_LANE_REGS(x) + 0x028)
+#define SERDES_LANE_CTL_STATUS_REG(x)  (SERDES_WIZ_REGS + 0x0020 + (4 * (x)))
+#define SERDES_PLL_CTL_REG             (SERDES_WIZ_REGS + 0x0034)
+
+#define SERDES_RESET                   BIT(28)
+#define SERDES_LANE_RESET              BIT(29)
+#define SERDES_LANE_LOOPBACK           BIT(30)
+#define SERDES_LANE_EN_VAL(x, y, z)    (x[y] | (z << 26) | (z << 10))
+
+#define SERDES_CMU_CFG_NUM             5
+#define SERDES_COMLANE_CFG_NUM         10
+#define SERDES_LANE_CFG_NUM            10
+
+struct serdes_cfg {
+       u32 ofs;
+       u32 val;
+       u32 mask;
+};
+
+struct cfg_entry {
+       enum ks2_serdes_clock clk;
+       enum ks2_serdes_rate rate;
+       struct serdes_cfg cmu[SERDES_CMU_CFG_NUM];
+       struct serdes_cfg comlane[SERDES_COMLANE_CFG_NUM];
+       struct serdes_cfg lane[SERDES_LANE_CFG_NUM];
+};
+
+/* SERDES PHY lane enable configuration value, indexed by PHY interface */
+static u32 serdes_cfg_lane_enable[] = {
+       0xf000f0c0,     /* SGMII */
+       0xf0e9f038,     /* PCSR */
+};
+
+/* SERDES PHY PLL enable configuration value, indexed by PHY interface  */
+static u32 serdes_cfg_pll_enable[] = {
+       0xe0000000,     /* SGMII */
+       0xee000000,     /* PCSR */
+};
+
+/**
+ * Array to hold all possible serdes configurations.
+ * Combination for 5 clock settings and 6 baud rates.
+ */
+static struct cfg_entry cfgs[] = {
+       {
+               .clk = SERDES_CLOCK_156P25M,
+               .rate = SERDES_RATE_5G,
+               .cmu = {
+                       {0x0000, 0x00800000, 0xffff0000},
+                       {0x0014, 0x00008282, 0x0000ffff},
+                       {0x0060, 0x00142438, 0x00ffffff},
+                       {0x0064, 0x00c3c700, 0x00ffff00},
+                       {0x0078, 0x0000c000, 0x0000ff00}
+               },
+               .comlane = {
+                       {0x0a00, 0x00000800, 0x0000ff00},
+                       {0x0a08, 0x38a20000, 0xffff0000},
+                       {0x0a30, 0x008a8a00, 0x00ffff00},
+                       {0x0a84, 0x00000600, 0x0000ff00},
+                       {0x0a94, 0x10000000, 0xff000000},
+                       {0x0aa0, 0x81000000, 0xff000000},
+                       {0x0abc, 0xff000000, 0xff000000},
+                       {0x0ac0, 0x0000008b, 0x000000ff},
+                       {0x0b08, 0x583f0000, 0xffff0000},
+                       {0x0b0c, 0x0000004e, 0x000000ff}
+               },
+               .lane = {
+                       {0x0004, 0x38000080, 0xff0000ff},
+                       {0x0008, 0x00000000, 0x000000ff},
+                       {0x000c, 0x02000000, 0xff000000},
+                       {0x0010, 0x1b000000, 0xff000000},
+                       {0x0014, 0x00006fb8, 0x0000ffff},
+                       {0x0018, 0x758000e4, 0xffff00ff},
+                       {0x00ac, 0x00004400, 0x0000ff00},
+                       {0x002c, 0x00100800, 0x00ffff00},
+                       {0x0080, 0x00820082, 0x00ff00ff},
+                       {0x0084, 0x1d0f0385, 0xffffffff}
+               },
+       },
+};
+
+static inline void ks2_serdes_rmw(u32 addr, u32 value, u32 mask)
+{
+       writel(((readl(addr) & (~mask)) | (value & mask)), addr);
+}
+
+static void ks2_serdes_cfg_setup(u32 base, struct serdes_cfg *cfg, u32 size)
+{
+       u32 i;
+
+       for (i = 0; i < size; i++)
+               ks2_serdes_rmw(base + cfg[i].ofs, cfg[i].val, cfg[i].mask);
+}
+
+static void ks2_serdes_lane_config(u32 base, struct serdes_cfg *cfg_lane,
+                                  u32 size, u32 lane)
+{
+       u32 i;
+
+       for (i = 0; i < size; i++)
+               ks2_serdes_rmw(base + cfg_lane[i].ofs + SERDES_LANE_REGS(lane),
+                              cfg_lane[i].val, cfg_lane[i].mask);
+}
+
+static int ks2_serdes_init_cfg(u32 base, struct cfg_entry *cfg, u32 num_lanes)
+{
+       u32 i;
+
+       ks2_serdes_cfg_setup(base, cfg->cmu, SERDES_CMU_CFG_NUM);
+       ks2_serdes_cfg_setup(base, cfg->comlane, SERDES_COMLANE_CFG_NUM);
+
+       for (i = 0; i < num_lanes; i++)
+               ks2_serdes_lane_config(base, cfg->lane, SERDES_LANE_CFG_NUM, i);
+
+       return 0;
+}
+
+static void ks2_serdes_cmu_comlane_enable(u32 base, struct ks2_serdes *serdes)
+{
+       /* Bring SerDes out of Reset */
+       ks2_serdes_rmw(base + SERDES_CMU_REG_010(0), 0x0, SERDES_RESET);
+       if (serdes->intf == SERDES_PHY_PCSR)
+               ks2_serdes_rmw(base + SERDES_CMU_REG_010(1), 0x0, SERDES_RESET);
+
+       /* Enable CMU and COMLANE */
+       ks2_serdes_rmw(base + SERDES_CMU_REG_000(0), 0x03, 0x000000ff);
+       if (serdes->intf == SERDES_PHY_PCSR)
+               ks2_serdes_rmw(base + SERDES_CMU_REG_000(1), 0x03, 0x000000ff);
+
+       ks2_serdes_rmw(base + SERDES_COMLANE_REG_000, 0x5f, 0x000000ff);
+}
+
+static void ks2_serdes_pll_enable(u32 base, struct ks2_serdes *serdes)
+{
+       writel(serdes_cfg_pll_enable[serdes->intf],
+              base + SERDES_PLL_CTL_REG);
+}
+
+static void ks2_serdes_lane_reset(u32 base, u32 reset, u32 lane)
+{
+       if (reset)
+               ks2_serdes_rmw(base + SERDES_LANE_REG_028(lane),
+                              0x1, SERDES_LANE_RESET);
+       else
+               ks2_serdes_rmw(base + SERDES_LANE_REG_028(lane),
+                              0x0, SERDES_LANE_RESET);
+}
+
+static void ks2_serdes_lane_enable(u32 base,
+                                  struct ks2_serdes *serdes, u32 lane)
+{
+       /* Bring lane out of reset */
+       ks2_serdes_lane_reset(base, 0, lane);
+
+       writel(SERDES_LANE_EN_VAL(serdes_cfg_lane_enable, serdes->intf,
+                                 serdes->rate_mode),
+              base + SERDES_LANE_CTL_STATUS_REG(lane));
+
+       /* Set NES bit if Loopback Enabled */
+       if (serdes->loopback)
+               ks2_serdes_rmw(base + SERDES_LANE_REG_000(lane),
+                              0x1, SERDES_LANE_LOOPBACK);
+}
+
+int ks2_serdes_init(u32 base, struct ks2_serdes *serdes, u32 num_lanes)
+{
+       int i;
+       int ret = 0;
+
+       for (i = 0; i < ARRAY_SIZE(cfgs); i++)
+               if (serdes->clk == cfgs[i].clk && serdes->rate == cfgs[i].rate)
+                       break;
+
+       if (i >= ARRAY_SIZE(cfgs)) {
+               puts("Cannot find keystone SerDes configuration");
+               return -EINVAL;
+       }
+
+       ks2_serdes_init_cfg(base, &cfgs[i], num_lanes);
+
+       ks2_serdes_cmu_comlane_enable(base, serdes);
+       for (i = 0; i < num_lanes; i++)
+               ks2_serdes_lane_enable(base, serdes, i);
+
+       ks2_serdes_pll_enable(base, serdes);
+
+       return ret;
+}
index 948394709f7d3d848838b1aeaa4fa6ffde8f28d5..33abfeada07971198bd38e7677e975046a32422e 100644 (file)
@@ -18,6 +18,7 @@
 #include <dm.h>
 #include <asm/mach-types.h>
 #include <power/regulator.h>
+#include <linux/usb/otg.h>
 
 #include "ehci.h"
 
@@ -483,23 +484,23 @@ static int ehci_usb_phy_mode(struct udevice *dev)
 static int ehci_usb_ofdata_to_platdata(struct udevice *dev)
 {
        struct usb_platdata *plat = dev_get_platdata(dev);
-       const char *mode;
+       enum usb_dr_mode dr_mode;
 
-       mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "dr_mode", NULL);
-       if (mode) {
-               if (strcmp(mode, "peripheral") == 0)
-                       plat->init_type = USB_INIT_DEVICE;
-               else if (strcmp(mode, "host") == 0)
-                       plat->init_type = USB_INIT_HOST;
-               else if (strcmp(mode, "otg") == 0)
-                       return ehci_usb_phy_mode(dev);
-               else
-                       return -EINVAL;
+       dr_mode = usb_get_dr_mode(dev_of_offset(dev));
 
-               return 0;
-       }
+       switch (dr_mode) {
+       case USB_DR_MODE_HOST:
+               plat->init_type = USB_INIT_HOST;
+               break;
+       case USB_DR_MODE_PERIPHERAL:
+               plat->init_type = USB_INIT_DEVICE;
+               break;
+       case USB_DR_MODE_OTG:
+       case USB_DR_MODE_UNKNOWN:
+               return ehci_usb_phy_mode(dev);
+       };
 
-       return ehci_usb_phy_mode(dev);
+       return 0;
 }
 
 static int ehci_usb_probe(struct udevice *dev)
index 611ea97a724929903d3ba028b53a42f894c223be..6e118b5a8ffa408fd8b9c7f5595e0ae47b200b58 100644 (file)
@@ -210,7 +210,7 @@ static void usb_scan_bus(struct udevice *bus, bool recurse)
 
        assert(recurse);        /* TODO: Support non-recusive */
 
-       printf("scanning bus %d for devices... ", bus->seq);
+       printf("scanning bus %s for devices... ", bus->name);
        debug("\n");
        ret = usb_scan_device(bus, 0, USB_SPEED_FULL, &dev);
        if (ret)
@@ -242,7 +242,6 @@ int usb_init(void)
        struct usb_bus_priv *priv;
        struct udevice *bus;
        struct uclass *uc;
-       int count = 0;
        int ret;
 
        asynch_allowed = 1;
@@ -255,8 +254,7 @@ int usb_init(void)
 
        uclass_foreach_dev(bus, uc) {
                /* init low_level USB */
-               printf("USB%d:   ", count);
-               count++;
+               printf("Bus %s: ", bus->name);
 
 #ifdef CONFIG_SANDBOX
                /*
@@ -327,10 +325,8 @@ int usb_init(void)
        remove_inactive_children(uc, bus);
 
        /* if we were not able to find at least one working bus, bail out */
-       if (!count)
-               printf("No controllers found\n");
-       else if (controllers_initialized == 0)
-               printf("USB error: all controllers failed lowlevel init\n");
+       if (controllers_initialized == 0)
+               printf("No working controllers found\n");
 
        return usb_started ? 0 : -1;
 }
index 115fc4551ffd0853cb1c4951a6cb885cf145d461..9d7f503b698dc560eb67fd8958b16b1f8f21a0a7 100644 (file)
@@ -97,6 +97,7 @@ config WDT_BCM6345
 config WDT_ORION
        bool "Orion watchdog timer support"
        depends on WDT
+       select CLK
        help
           Select this to enable Orion watchdog timer, which can be found on some
           Marvell Armada chips.
@@ -139,10 +140,6 @@ config WDT_AT91
           Select this to enable Microchip watchdog timer, which can be found on
           some AT91 devices.
 
-config AT91_HW_WDT_TIMEOUT
-       bool "AT91 watchdog timeout specified"
-       depends on WDT_AT91
-
 config WDT_MT7621
        bool "MediaTek MT7621 watchdog timer support"
        depends on WDT && ARCH_MT7620
index 13f8772e4130ac1e273c920d211eefc4491f5eff..000769d46deb280fa55cf208719a845abccf2f82 100644 (file)
@@ -17,6 +17,7 @@
 #include <asm/io.h>
 #include <asm/arch/at91_wdt.h>
 #include <common.h>
+#include <div64.h>
 #include <dm.h>
 #include <errno.h>
 #include <wdt.h>
@@ -30,28 +31,21 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 #define WDT_SEC2TICKS(s)       (((s) << 8) - 1)
 
-/* Hardware timeout in seconds */
-#define WDT_MAX_TIMEOUT 16
-#define WDT_MIN_TIMEOUT 0
-#define WDT_DEFAULT_TIMEOUT 2
-
-struct at91_wdt_priv {
-       void __iomem *regs;
-       u32     regval;
-       u32     timeout;
-};
-
 /*
  * Set the watchdog time interval in 1/256Hz (write-once)
  * Counter is 12 bit.
  */
-static int at91_wdt_start(struct udevice *dev, u64 timeout_s, ulong flags)
+static int at91_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
 {
        struct at91_wdt_priv *priv = dev_get_priv(dev);
-       u32 timeout = WDT_SEC2TICKS(timeout_s);
+       u64 timeout;
+       u32 ticks;
 
-       if (timeout_s > WDT_MAX_TIMEOUT || timeout_s < WDT_MIN_TIMEOUT)
-               timeout = priv->timeout;
+       /* Calculate timeout in seconds and the resulting ticks */
+       timeout = timeout_ms;
+       do_div(timeout, 1000);
+       timeout = min_t(u64, timeout, WDT_MAX_TIMEOUT);
+       ticks = WDT_SEC2TICKS(timeout);
 
        /* Check if disabled */
        if (readl(priv->regs + AT91_WDT_MR) & AT91_WDT_MR_WDDIS) {
@@ -65,12 +59,10 @@ static int at91_wdt_start(struct udevice *dev, u64 timeout_s, ulong flags)
         * Since WDV is a 12-bit counter, the maximum period is
         * 4096 / 256 = 16 seconds.
         */
-
        priv->regval = AT91_WDT_MR_WDRSTEN      /* causes watchdog reset */
                | AT91_WDT_MR_WDDBGHLT          /* disabled in debug mode */
                | AT91_WDT_MR_WDD(0xfff)        /* restart at any time */
-               | AT91_WDT_MR_WDV(timeout);     /* timer value */
-
+               | AT91_WDT_MR_WDV(ticks);       /* timer value */
        writel(priv->regval, priv->regs + AT91_WDT_MR);
 
        return 0;
@@ -115,10 +107,12 @@ static int at91_wdt_probe(struct udevice *dev)
        if (!priv->regs)
                return -EINVAL;
 
-#ifdef CONFIG_AT91_HW_WDT_TIMEOUT
+#if CONFIG_IS_ENABLED(OF_CONTROL)
        priv->timeout = dev_read_u32_default(dev, "timeout-sec",
                                             WDT_DEFAULT_TIMEOUT);
        debug("%s: timeout %d", __func__, priv->timeout);
+#else
+       priv->timeout = WDT_DEFAULT_TIMEOUT;
 #endif
 
        debug("%s: Probing wdt%u\n", __func__, dev->seq);
index a0df02d10382bb369415ecbd1f3335dfce7ee4e6..885821d562ea1ae49eec315a33a6b22144648081 100644 (file)
@@ -14,7 +14,9 @@
 
 #include <common.h>
 #include <dm.h>
+#include <clk.h>
 #include <wdt.h>
+#include <linux/kernel.h>
 #include <asm/io.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/soc.h>
@@ -27,6 +29,8 @@ struct orion_wdt_priv {
        void __iomem *rstout;
        void __iomem *rstout_mask;
        u32 timeout;
+       unsigned long clk_rate;
+       struct clk clk;
 };
 
 #define RSTOUT_ENABLE_BIT              BIT(8)
@@ -44,17 +48,18 @@ static int orion_wdt_reset(struct udevice *dev)
        struct orion_wdt_priv *priv = dev_get_priv(dev);
 
        /* Reload watchdog duration */
-       writel(priv->timeout, priv->reg + priv->wdt_counter_offset);
+       writel(priv->clk_rate * priv->timeout,
+              priv->reg + priv->wdt_counter_offset);
 
        return 0;
 }
 
-static int orion_wdt_start(struct udevice *dev, u64 timeout, ulong flags)
+static int orion_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
 {
        struct orion_wdt_priv *priv = dev_get_priv(dev);
        u32 reg;
 
-       priv->timeout = (u32) timeout;
+       priv->timeout = DIV_ROUND_UP(timeout_ms, 1000);
 
        /* Enable the fixed watchdog clock input */
        reg = readl(priv->reg + TIMER_CTRL);
@@ -62,7 +67,8 @@ static int orion_wdt_start(struct udevice *dev, u64 timeout, ulong flags)
        writel(reg, priv->reg + TIMER_CTRL);
 
        /* Set watchdog duration */
-       writel(priv->timeout, priv->reg + priv->wdt_counter_offset);
+       writel(priv->clk_rate * priv->timeout,
+              priv->reg + priv->wdt_counter_offset);
 
        /* Clear the watchdog expiration bit */
        reg = readl(priv->reg + TIMER_A370_STATUS);
@@ -114,9 +120,7 @@ static inline bool save_reg_from_ofdata(struct udevice *dev, int index,
        fdt_addr_t addr;
        fdt_size_t off;
 
-       addr = fdtdec_get_addr_size_auto_noparent(
-               gd->fdt_blob, dev_of_offset(dev), "reg", index, &off, true);
-
+       addr = devfdt_get_addr_size_index(dev, index, &off);
        if (addr == FDT_ADDR_T_NONE)
                return false;
 
@@ -149,9 +153,18 @@ err:
 
 static int orion_wdt_probe(struct udevice *dev)
 {
+       struct orion_wdt_priv *priv = dev_get_priv(dev);
+       int ret;
+
        debug("%s: Probing wdt%u\n", __func__, dev->seq);
        orion_wdt_stop(dev);
 
+       ret = clk_get_by_name(dev, "fixed", &priv->clk);
+       if (!ret)
+               priv->clk_rate = clk_get_rate(&priv->clk);
+       else
+               priv->clk_rate = 25000000;
+
        return 0;
 }
 
index 3e85914d115399927379abd1ee4fd579a1c6f302..a5f30c8fd03b53559a55190e909b35f0c5cf0527 100644 (file)
@@ -130,6 +130,63 @@ config OF_LIST
          device tree files (without the directory or .dtb suffix)
          separated by <space>.
 
+choice
+       prompt "SPL OF LIST compression"
+       depends on MULTI_DTB_FIT
+       default MULTI_DTB_FIT_NO_COMPRESSION
+
+config MULTI_DTB_FIT_LZO
+       bool "LZO"
+       depends on SYS_MALLOC_F
+       select LZO
+       help
+         Compress the FIT image containing the DTBs available for the SPL
+         using LZO compression. (requires lzop on host).
+
+config MULTI_DTB_FIT_GZIP
+       bool "GZIP"
+       depends on SYS_MALLOC_F
+       select GZIP
+       help
+         Compress the FIT image containing the DTBs available for the SPL
+         using GZIP compression. (requires gzip on host)
+
+config MULTI_DTB_FIT_NO_COMPRESSION
+       bool "No compression"
+       help
+         Do not compress the FIT image containing the DTBs available for the SPL.
+         Use this options only if LZO is not available and the DTBs are very small.
+endchoice
+
+choice
+       prompt "Location of uncompressed DTBs"
+       depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO)
+       default MULTI_DTB_FIT_DYN_ALLOC if SYS_MALLOC_F
+
+config MULTI_DTB_FIT_DYN_ALLOC
+       bool "Dynamically allocate the memory"
+       depends on SYS_MALLOC_F
+
+config MULTI_DTB_FIT_USER_DEFINED_AREA
+       bool "User-defined location"
+endchoice
+
+config MULTI_DTB_FIT_UNCOMPRESS_SZ
+       hex "Size of memory reserved to uncompress the DTBs"
+       depends on (MULTI_DTB_FIT_GZIP || MULTI_DTB_FIT_LZO)
+       default 0x8000
+       help
+          This is the size of this area where the DTBs are uncompressed.
+          If this area is dynamically allocated, make sure that
+          SYS_MALLOC_F_LEN is big enough to contain it.
+
+config MULTI_DTB_FIT_USER_DEF_ADDR
+       hex "Address of memory where dtbs are uncompressed"
+       depends on MULTI_DTB_FIT_USER_DEFINED_AREA
+       help
+          the FIT image containing the DTBs is uncompressed in an area defined
+          at compilation time. This is the address of this area. It must be
+          aligned on 2-byte boundary.
 
 config DTB_RESELECT
        bool "Support swapping dtbs at a later point in boot"
index 09c5e4a491018a35adaf1fba3294b3778f9d70e6..388474a11c750070e444609e2676878db71aa4bd 100644 (file)
@@ -60,7 +60,7 @@ static int env_ext4_save(void)
        }
 
        err = ext4fs_write(CONFIG_ENV_EXT4_FILE, (void *)&env_new,
-                          sizeof(env_t));
+                          sizeof(env_t), FILETYPE_REG);
        ext4fs_close();
 
        if (err == -1) {
index 29eda66fad846eadcd9a412b578f0800449fef19..d0b95f483d34cc4649c39f53355587f3a277fd0c 100644 (file)
@@ -26,7 +26,7 @@
 #if defined(CONFIG_CMD_SAVEENV) && defined(CONFIG_CMD_NAND) && \
                !defined(CONFIG_SPL_BUILD)
 #define CMD_SAVEENV
-#elif defined(CONFIG_ENV_OFFSET_REDUND)
+#elif defined(CONFIG_ENV_OFFSET_REDUND) && !defined(CONFIG_SPL_BUILD)
 #error CONFIG_ENV_OFFSET_REDUND must have CONFIG_CMD_SAVEENV & CONFIG_CMD_NAND
 #endif
 
index 67e2471bd3885f016a226d435d4cb886581db987..464c33d0d74ccbc7c1746b69632f0bdbd73d454a 100644 (file)
@@ -190,7 +190,7 @@ uint32_t ext4fs_div_roundup(uint32_t size, uint32_t n)
        return res;
 }
 
-void put_ext4(uint64_t off, void *buf, uint32_t size)
+void put_ext4(uint64_t off, const void *buf, uint32_t size)
 {
        uint64_t startblock;
        uint64_t remainder;
@@ -510,7 +510,8 @@ restart:
 
 restart_read:
        /* read the block no allocated to a file */
-       first_block_no_of_root = read_allocated_block(g_parent_inode, blk_idx);
+       first_block_no_of_root = read_allocated_block(g_parent_inode, blk_idx,
+                                                     NULL);
        if (first_block_no_of_root <= 0)
                goto fail;
 
@@ -607,7 +608,7 @@ restart_read:
                dir->direntlen = cpu_to_le16(fs->blksz - totalbytes);
 
        dir->namelen = strlen(filename);
-       dir->filetype = FILETYPE_REG;   /* regular file */
+       dir->filetype = file_type;
        temp_dir = (char *)dir;
        temp_dir = temp_dir + sizeof(struct ext2_dirent);
        memcpy(temp_dir, filename, strlen(filename));
@@ -646,7 +647,7 @@ static int search_dir(struct ext2_inode *parent_inode, char *dirname)
 
        /* get the block no allocated to a file */
        for (blk_idx = 0; blk_idx < directory_blocks; blk_idx++) {
-               blknr = read_allocated_block(parent_inode, blk_idx);
+               blknr = read_allocated_block(parent_inode, blk_idx, NULL);
                if (blknr <= 0)
                        goto fail;
 
@@ -943,7 +944,7 @@ int ext4fs_filename_unlink(char *filename)
 
        /* read the block no allocated to a file */
        for (blk_idx = 0; blk_idx < directory_blocks; blk_idx++) {
-               blknr = read_allocated_block(g_parent_inode, blk_idx);
+               blknr = read_allocated_block(g_parent_inode, blk_idx, NULL);
                if (blknr <= 0)
                        break;
                inodeno = unlink_filename(filename, blknr);
@@ -1522,7 +1523,7 @@ void ext4fs_allocate_blocks(struct ext2_inode *file_inode,
 #endif
 
 static struct ext4_extent_header *ext4fs_get_extent_block
-       (struct ext2_data *data, char *buf,
+       (struct ext2_data *data, struct ext_block_cache *cache,
                struct ext4_extent_header *ext_block,
                uint32_t fileblock, int log2_blksz)
 {
@@ -1546,17 +1547,19 @@ static struct ext4_extent_header *ext4fs_get_extent_block
                                break;
                } while (fileblock >= le32_to_cpu(index[i].ei_block));
 
-               if (--i < 0)
-                       return NULL;
+               /*
+                * If first logical block number is higher than requested fileblock,
+                * it is a sparse file. This is handled on upper layer.
+                */
+               if (i > 0)
+                       i--;
 
                block = le16_to_cpu(index[i].ei_leaf_hi);
                block = (block << 32) + le32_to_cpu(index[i].ei_leaf_lo);
-
-               if (ext4fs_devread((lbaint_t)block << log2_blksz, 0, blksz,
-                                  buf))
-                       ext_block = (struct ext4_extent_header *)buf;
-               else
+               block <<= log2_blksz;
+               if (!ext_cache_read(cache, (lbaint_t)block, blksz))
                        return NULL;
+               ext_block = (struct ext4_extent_header *)cache->buf;
        }
 }
 
@@ -1584,7 +1587,7 @@ static int ext4fs_blockgroup
 
 int ext4fs_read_inode(struct ext2_data *data, int ino, struct ext2_inode *inode)
 {
-       struct ext2_block_group blkgrp;
+       struct ext2_block_group *blkgrp;
        struct ext2_sblock *sblock = &data->sblock;
        struct ext_filesystem *fs = get_fs();
        int log2blksz = get_fs()->dev_desc->log2blksz;
@@ -1592,17 +1595,28 @@ int ext4fs_read_inode(struct ext2_data *data, int ino, struct ext2_inode *inode)
        long int blkno;
        unsigned int blkoff;
 
+       /* Allocate blkgrp based on gdsize (for 64-bit support). */
+       blkgrp = zalloc(get_fs()->gdsize);
+       if (!blkgrp)
+               return 0;
+
        /* It is easier to calculate if the first inode is 0. */
        ino--;
        status = ext4fs_blockgroup(data, ino / le32_to_cpu
-                                  (sblock->inodes_per_group), &blkgrp);
-       if (status == 0)
+                                  (sblock->inodes_per_group), blkgrp);
+       if (status == 0) {
+               free(blkgrp);
                return 0;
+       }
 
        inodes_per_block = EXT2_BLOCK_SIZE(data) / fs->inodesz;
-       blkno = ext4fs_bg_get_inode_table_id(&blkgrp, fs) +
+       blkno = ext4fs_bg_get_inode_table_id(blkgrp, fs) +
            (ino % le32_to_cpu(sblock->inodes_per_group)) / inodes_per_block;
        blkoff = (ino % inodes_per_block) * fs->inodesz;
+
+       /* Free blkgrp as it is no longer required. */
+       free(blkgrp);
+
        /* Read the inode. */
        status = ext4fs_devread((lbaint_t)blkno << (LOG2_BLOCK_SIZE(data) -
                                log2blksz), blkoff,
@@ -1613,7 +1627,8 @@ int ext4fs_read_inode(struct ext2_data *data, int ino, struct ext2_inode *inode)
        return 1;
 }
 
-long int read_allocated_block(struct ext2_inode *inode, int fileblock)
+long int read_allocated_block(struct ext2_inode *inode, int fileblock,
+                             struct ext_block_cache *cache)
 {
        long int blknr;
        int blksz;
@@ -1630,20 +1645,26 @@ long int read_allocated_block(struct ext2_inode *inode, int fileblock)
 
        if (le32_to_cpu(inode->flags) & EXT4_EXTENTS_FL) {
                long int startblock, endblock;
-               char *buf = zalloc(blksz);
-               if (!buf)
-                       return -ENOMEM;
+               struct ext_block_cache *c, cd;
                struct ext4_extent_header *ext_block;
                struct ext4_extent *extent;
                int i;
+
+               if (cache) {
+                       c = cache;
+               } else {
+                       c = &cd;
+                       ext_cache_init(c);
+               }
                ext_block =
-                       ext4fs_get_extent_block(ext4fs_root, buf,
+                       ext4fs_get_extent_block(ext4fs_root, c,
                                                (struct ext4_extent_header *)
                                                inode->b.blocks.dir_blocks,
                                                fileblock, log2_blksz);
                if (!ext_block) {
                        printf("invalid extent block\n");
-                       free(buf);
+                       if (!cache)
+                               ext_cache_fini(c);
                        return -EINVAL;
                }
 
@@ -1655,19 +1676,22 @@ long int read_allocated_block(struct ext2_inode *inode, int fileblock)
 
                        if (startblock > fileblock) {
                                /* Sparse file */
-                               free(buf);
+                               if (!cache)
+                                       ext_cache_fini(c);
                                return 0;
 
                        } else if (fileblock < endblock) {
                                start = le16_to_cpu(extent[i].ee_start_hi);
                                start = (start << 32) +
                                        le32_to_cpu(extent[i].ee_start_lo);
-                               free(buf);
+                               if (!cache)
+                                       ext_cache_fini(c);
                                return (fileblock - startblock) + start;
                        }
                }
 
-               free(buf);
+               if (!cache)
+                       ext_cache_fini(c);
                return 0;
        }
 
index 1ee81ab7ce8d51095bad796f6ee2d2fd740a927d..4dff1914d9eca9119714939669a6b53f54be66b4 100644 (file)
@@ -72,7 +72,7 @@ int ext4fs_iget(int inode_no, struct ext2_inode *inode);
 void ext4fs_allocate_blocks(struct ext2_inode *file_inode,
                                unsigned int total_remaining_blocks,
                                unsigned int *total_no_of_block);
-void put_ext4(uint64_t off, void *buf, uint32_t size);
+void put_ext4(uint64_t off, const void *buf, uint32_t size);
 struct ext2_block_group *ext4fs_get_group_descriptor
        (const struct ext_filesystem *fs, uint32_t bg_idx);
 uint64_t ext4fs_bg_get_block_id(const struct ext2_block_group *bg,
index 148593da7fefacc79fb6ce2510e47a807e0c3e4d..6adbab93a68fb96cec282b71c8b22716f83d5593 100644 (file)
@@ -347,7 +347,7 @@ void recover_transaction(int prev_desc_logical_no)
        ext4fs_read_inode(ext4fs_root, EXT2_JOURNAL_INO,
                          (struct ext2_inode *)&inode_journal);
        blknr = read_allocated_block((struct ext2_inode *)
-                                    &inode_journal, i);
+                                    &inode_journal, i, NULL);
        ext4fs_devread((lbaint_t)blknr * fs->sect_perblk, 0, fs->blksz,
                       temp_buff);
        p_jdb = (char *)temp_buff;
@@ -372,7 +372,7 @@ void recover_transaction(int prev_desc_logical_no)
                                be32_to_cpu(jdb->h_sequence)) == 0)
                                continue;
                }
-               blknr = read_allocated_block(&inode_journal, i);
+               blknr = read_allocated_block(&inode_journal, i, NULL);
                ext4fs_devread((lbaint_t)blknr * fs->sect_perblk, 0,
                               fs->blksz, metadata_buff);
                put_ext4((uint64_t)((uint64_t)be32_to_cpu(tag->block) * (uint64_t)fs->blksz),
@@ -419,7 +419,8 @@ int ext4fs_check_journal_state(int recovery_flag)
        }
 
        ext4fs_read_inode(ext4fs_root, EXT2_JOURNAL_INO, &inode_journal);
-       blknr = read_allocated_block(&inode_journal, EXT2_JOURNAL_SUPERBLOCK);
+       blknr = read_allocated_block(&inode_journal, EXT2_JOURNAL_SUPERBLOCK,
+                                    NULL);
        ext4fs_devread((lbaint_t)blknr * fs->sect_perblk, 0, fs->blksz,
                       temp_buff);
        jsb = (struct journal_superblock_t *) temp_buff;
@@ -443,7 +444,7 @@ int ext4fs_check_journal_state(int recovery_flag)
 
        i = be32_to_cpu(jsb->s_first);
        while (1) {
-               blknr = read_allocated_block(&inode_journal, i);
+               blknr = read_allocated_block(&inode_journal, i, NULL);
                memset(temp_buff1, '\0', fs->blksz);
                ext4fs_devread((lbaint_t)blknr * fs->sect_perblk,
                               0, fs->blksz, temp_buff1);
@@ -537,7 +538,7 @@ end:
                ext4_read_superblock((char *)fs->sb);
 
                blknr = read_allocated_block(&inode_journal,
-                                        EXT2_JOURNAL_SUPERBLOCK);
+                                        EXT2_JOURNAL_SUPERBLOCK, NULL);
                put_ext4((uint64_t) ((uint64_t)blknr * (uint64_t)fs->blksz),
                         (struct journal_superblock_t *)temp_buff,
                         (uint32_t) fs->blksz);
@@ -566,7 +567,7 @@ static void update_descriptor_block(long int blknr)
 
        ext4fs_read_inode(ext4fs_root, EXT2_JOURNAL_INO, &inode_journal);
        jsb_blknr = read_allocated_block(&inode_journal,
-                                        EXT2_JOURNAL_SUPERBLOCK);
+                                        EXT2_JOURNAL_SUPERBLOCK, NULL);
        ext4fs_devread((lbaint_t)jsb_blknr * fs->sect_perblk, 0, fs->blksz,
                       temp_buff);
        jsb = (struct journal_superblock_t *) temp_buff;
@@ -618,7 +619,7 @@ static void update_commit_block(long int blknr)
        ext4fs_read_inode(ext4fs_root, EXT2_JOURNAL_INO,
                          &inode_journal);
        jsb_blknr = read_allocated_block(&inode_journal,
-                                        EXT2_JOURNAL_SUPERBLOCK);
+                                        EXT2_JOURNAL_SUPERBLOCK, NULL);
        ext4fs_devread((lbaint_t)jsb_blknr * fs->sect_perblk, 0, fs->blksz,
                       temp_buff);
        jsb = (struct journal_superblock_t *) temp_buff;
@@ -645,16 +646,17 @@ void ext4fs_update_journal(void)
        long int blknr;
        int i;
        ext4fs_read_inode(ext4fs_root, EXT2_JOURNAL_INO, &inode_journal);
-       blknr = read_allocated_block(&inode_journal, jrnl_blk_idx++);
+       blknr = read_allocated_block(&inode_journal, jrnl_blk_idx++, NULL);
        update_descriptor_block(blknr);
        for (i = 0; i < MAX_JOURNAL_ENTRIES; i++) {
                if (journal_ptr[i]->blknr == -1)
                        break;
-               blknr = read_allocated_block(&inode_journal, jrnl_blk_idx++);
+               blknr = read_allocated_block(&inode_journal, jrnl_blk_idx++,
+                                            NULL);
                put_ext4((uint64_t) ((uint64_t)blknr * (uint64_t)fs->blksz),
                         journal_ptr[i]->buf, fs->blksz);
        }
-       blknr = read_allocated_block(&inode_journal, jrnl_blk_idx++);
+       blknr = read_allocated_block(&inode_journal, jrnl_blk_idx++, NULL);
        update_commit_block(blknr);
        printf("update journal finished\n");
 }
index 4eb77c327ef32a9bd4a6f98280b3c660d85e12e6..504d23a8956cc157f843de22a9c15e72c2290595 100644 (file)
@@ -465,6 +465,15 @@ static int ext4fs_delete_file(int inodeno)
        if (le32_to_cpu(inode.size) % fs->blksz)
                no_blocks++;
 
+       /*
+        * special case for symlinks whose target are small enough that
+        *it fits in struct ext2_inode.b.symlink: no block had been allocated
+        */
+       if ((le16_to_cpu(inode.mode) & S_IFLNK) &&
+           le32_to_cpu(inode.size) <= sizeof(inode.b.symlink)) {
+               no_blocks = 0;
+       }
+
        if (le32_to_cpu(inode.flags) & EXT4_EXTENTS_FL) {
                /* FIXME delete extent index blocks, i.e. eh_depth >= 1 */
                struct ext4_extent_header *eh =
@@ -479,7 +488,7 @@ static int ext4fs_delete_file(int inodeno)
 
        /* release data blocks */
        for (i = 0; i < no_blocks; i++) {
-               blknr = read_allocated_block(&inode, i);
+               blknr = read_allocated_block(&inode, i, NULL);
                if (blknr == 0)
                        continue;
                if (blknr < 0)
@@ -695,7 +704,7 @@ void ext4fs_deinit(void)
                ext4fs_read_inode(ext4fs_root, EXT2_JOURNAL_INO,
                                  &inode_journal);
                blknr = read_allocated_block(&inode_journal,
-                                       EXT2_JOURNAL_SUPERBLOCK);
+                                       EXT2_JOURNAL_SUPERBLOCK, NULL);
                ext4fs_devread((lbaint_t)blknr * fs->sect_perblk, 0, fs->blksz,
                               temp_buff);
                jsb = (struct journal_superblock_t *)temp_buff;
@@ -752,7 +761,7 @@ void ext4fs_deinit(void)
  * contigous sectors as ext4fs_read_file
  */
 static int ext4fs_write_file(struct ext2_inode *file_inode,
-                            int pos, unsigned int len, char *buf)
+                            int pos, unsigned int len, const char *buf)
 {
        int i;
        int blockcnt;
@@ -764,7 +773,7 @@ static int ext4fs_write_file(struct ext2_inode *file_inode,
        int delayed_start = 0;
        int delayed_extent = 0;
        int delayed_next = 0;
-       char *delayed_buf = NULL;
+       const char *delayed_buf = NULL;
 
        /* Adjust len so it we can't read past the end of the file. */
        if (len > filesize)
@@ -776,7 +785,7 @@ static int ext4fs_write_file(struct ext2_inode *file_inode,
                long int blknr;
                int blockend = fs->blksz;
                int skipfirst = 0;
-               blknr = read_allocated_block(file_inode, i);
+               blknr = read_allocated_block(file_inode, i, NULL);
                if (blknr <= 0)
                        return -1;
 
@@ -816,7 +825,6 @@ static int ext4fs_write_file(struct ext2_inode *file_inode,
                                         (uint32_t) delayed_extent);
                                previous_block_number = -1;
                        }
-                       memset(buf, 0, fs->blksz - skipfirst);
                }
                buf += fs->blksz - skipfirst;
        }
@@ -830,8 +838,8 @@ static int ext4fs_write_file(struct ext2_inode *file_inode,
        return len;
 }
 
-int ext4fs_write(const char *fname, unsigned char *buffer,
-                                       unsigned long sizebytes)
+int ext4fs_write(const char *fname, const char *buffer,
+                unsigned long sizebytes, int type)
 {
        int ret = 0;
        struct ext2_inode *file_inode = NULL;
@@ -854,8 +862,12 @@ int ext4fs_write(const char *fname, unsigned char *buffer,
        struct ext2_block_group *bgd = NULL;
        struct ext_filesystem *fs = get_fs();
        ALLOC_CACHE_ALIGN_BUFFER(char, filename, 256);
+       bool store_link_in_inode = false;
        memset(filename, 0x00, 256);
 
+       if (type != FILETYPE_REG && type != FILETYPE_SYMLINK)
+               return -1;
+
        g_parent_inode = zalloc(fs->inodesz);
        if (!g_parent_inode)
                goto fail;
@@ -893,8 +905,16 @@ int ext4fs_write(const char *fname, unsigned char *buffer,
                if (ret)
                        goto fail;
        }
-       /* calucalate how many blocks required */
-       bytes_reqd_for_file = sizebytes;
+
+       /* calculate how many blocks required */
+       if (type == FILETYPE_SYMLINK &&
+           sizebytes <= sizeof(file_inode->b.symlink)) {
+               store_link_in_inode = true;
+               bytes_reqd_for_file = 0;
+       } else {
+               bytes_reqd_for_file = sizebytes;
+       }
+
        blks_reqd_for_file = lldiv(bytes_reqd_for_file, fs->blksz);
        if (do_div(bytes_reqd_for_file, fs->blksz) != 0) {
                blks_reqd_for_file++;
@@ -907,7 +927,7 @@ int ext4fs_write(const char *fname, unsigned char *buffer,
                goto fail;
        }
 
-       inodeno = ext4fs_update_parent_dentry(filename, FILETYPE_REG);
+       inodeno = ext4fs_update_parent_dentry(filename, type);
        if (inodeno == -1)
                goto fail;
        /* prepare file inode */
@@ -915,14 +935,23 @@ int ext4fs_write(const char *fname, unsigned char *buffer,
        if (!inode_buffer)
                goto fail;
        file_inode = (struct ext2_inode *)inode_buffer;
-       file_inode->mode = cpu_to_le16(S_IFREG | S_IRWXU |
-           S_IRGRP | S_IROTH | S_IXGRP | S_IXOTH);
+       file_inode->size = cpu_to_le32(sizebytes);
+       if (type == FILETYPE_SYMLINK) {
+               file_inode->mode = cpu_to_le16(S_IFLNK | S_IRWXU | S_IRWXG |
+                                              S_IRWXO);
+               if (store_link_in_inode) {
+                       strncpy(file_inode->b.symlink, buffer, sizebytes);
+                       sizebytes = 0;
+               }
+       } else {
+               file_inode->mode = cpu_to_le16(S_IFREG | S_IRWXU | S_IRGRP |
+                                              S_IROTH | S_IXGRP | S_IXOTH);
+       }
        /* ToDo: Update correct time */
        file_inode->mtime = cpu_to_le32(timestamp);
        file_inode->atime = cpu_to_le32(timestamp);
        file_inode->ctime = cpu_to_le32(timestamp);
        file_inode->nlinks = cpu_to_le16(1);
-       file_inode->size = cpu_to_le32(sizebytes);
 
        /* Allocate data blocks */
        ext4fs_allocate_blocks(file_inode, blocks_remaining,
@@ -949,7 +978,7 @@ int ext4fs_write(const char *fname, unsigned char *buffer,
        if (ext4fs_put_metadata(temp_ptr, itable_blkno))
                goto fail;
        /* copy the file content into data blocks */
-       if (ext4fs_write_file(file_inode, 0, sizebytes, (char *)buffer) == -1) {
+       if (ext4fs_write_file(file_inode, 0, sizebytes, buffer) == -1) {
                printf("Error in copying content\n");
                /* FIXME: Deallocate data blocks */
                goto fail;
@@ -1014,7 +1043,7 @@ int ext4_write_file(const char *filename, void *buf, loff_t offset,
                return -1;
        }
 
-       ret = ext4fs_write(filename, buf, len);
+       ret = ext4fs_write(filename, buf, len, FILETYPE_REG);
        if (ret) {
                printf("** Error ext4fs_write() **\n");
                goto fail;
@@ -1029,3 +1058,8 @@ fail:
 
        return -1;
 }
+
+int ext4fs_create_link(const char *target, const char *fname)
+{
+       return ext4fs_write(fname, target, strlen(target), FILETYPE_SYMLINK);
+}
index 2a28031d14ca1f23a43dc72ac53e8f1e2b731cde..26db677a1f172bde1f10ac5297bf7226b6f6ba15 100644 (file)
@@ -62,6 +62,9 @@ int ext4fs_read_file(struct ext2fs_node *node, loff_t pos,
        lbaint_t delayed_next = 0;
        char *delayed_buf = NULL;
        short status;
+       struct ext_block_cache cache;
+
+       ext_cache_init(&cache);
 
        if (blocksize <= 0)
                return -1;
@@ -77,9 +80,11 @@ int ext4fs_read_file(struct ext2fs_node *node, loff_t pos,
                int blockoff = pos - (blocksize * i);
                int blockend = blocksize;
                int skipfirst = 0;
-               blknr = read_allocated_block(&(node->inode), i);
-               if (blknr < 0)
+               blknr = read_allocated_block(&node->inode, i, &cache);
+               if (blknr < 0) {
+                       ext_cache_fini(&cache);
                        return -1;
+               }
 
                blknr = blknr << log2_fs_blocksize;
 
@@ -109,8 +114,10 @@ int ext4fs_read_file(struct ext2fs_node *node, loff_t pos,
                                                        delayed_skipfirst,
                                                        delayed_extent,
                                                        delayed_buf);
-                                       if (status == 0)
+                                       if (status == 0) {
+                                               ext_cache_fini(&cache);
                                                return -1;
+                                       }
                                        previous_block_number = blknr;
                                        delayed_start = blknr;
                                        delayed_extent = blockend;
@@ -136,8 +143,10 @@ int ext4fs_read_file(struct ext2fs_node *node, loff_t pos,
                                                        delayed_skipfirst,
                                                        delayed_extent,
                                                        delayed_buf);
-                               if (status == 0)
+                               if (status == 0) {
+                                       ext_cache_fini(&cache);
                                        return -1;
+                               }
                                previous_block_number = -1;
                        }
                        /* Zero no more than `len' bytes. */
@@ -153,12 +162,15 @@ int ext4fs_read_file(struct ext2fs_node *node, loff_t pos,
                status = ext4fs_devread(delayed_start,
                                        delayed_skipfirst, delayed_extent,
                                        delayed_buf);
-               if (status == 0)
+               if (status == 0) {
+                       ext_cache_fini(&cache);
                        return -1;
+               }
                previous_block_number = -1;
        }
 
        *actread  = len;
+       ext_cache_fini(&cache);
        return 0;
 }
 
@@ -252,3 +264,32 @@ int ext4fs_uuid(char *uuid_str)
        return -ENOSYS;
 #endif
 }
+
+void ext_cache_init(struct ext_block_cache *cache)
+{
+       memset(cache, 0, sizeof(*cache));
+}
+
+void ext_cache_fini(struct ext_block_cache *cache)
+{
+       free(cache->buf);
+       ext_cache_init(cache);
+}
+
+int ext_cache_read(struct ext_block_cache *cache, lbaint_t block, int size)
+{
+       /* This could be more lenient, but this is simple and enough for now */
+       if (cache->buf && cache->block == block && cache->size == size)
+               return 1;
+       ext_cache_fini(cache);
+       cache->buf = malloc(size);
+       if (!cache->buf)
+               return 0;
+       if (!ext4fs_devread(block, 0, size, cache->buf)) {
+               free(cache->buf);
+               return 0;
+       }
+       cache->block = block;
+       cache->size = size;
+       return 1;
+}
index 6ade4ea54ecd8e227196c13c73e077863801828a..c5997c21735f9714aae7c63486750837cac87688 100644 (file)
@@ -602,8 +602,13 @@ static int get_fs_info(fsdata *mydata)
                mydata->data_begin = mydata->rootdir_sect +
                                        mydata->rootdir_size -
                                        (mydata->clust_size * 2);
-               mydata->root_cluster =
-                       sect_to_clust(mydata, mydata->rootdir_sect);
+
+               /*
+                * The root directory is not cluster-aligned and may be on a
+                * "negative" cluster, this will be handled specially in
+                * next_cluster().
+                */
+               mydata->root_cluster = 0;
        }
 
        mydata->fatbufnum = -1;
@@ -733,20 +738,38 @@ static void fat_itr_child(fat_itr *itr, fat_itr *parent)
        itr->last_cluster = 0;
 }
 
-static void *next_cluster(fat_itr *itr)
+static void *next_cluster(fat_itr *itr, unsigned *nbytes)
 {
        fsdata *mydata = itr->fsdata;  /* for silly macros */
        int ret;
        u32 sect;
+       u32 read_size;
 
        /* have we reached the end? */
        if (itr->last_cluster)
                return NULL;
 
-       sect = clust_to_sect(itr->fsdata, itr->next_clust);
+       if (itr->is_root && itr->fsdata->fatsize != 32) {
+               /*
+                * The root directory is located before the data area and
+                * cannot be indexed using the regular unsigned cluster
+                * numbers (it may start at a "negative" cluster or not at a
+                * cluster boundary at all), so consider itr->next_clust to be
+                * a offset in cluster-sized units from the start of rootdir.
+                */
+               unsigned sect_offset = itr->next_clust * itr->fsdata->clust_size;
+               unsigned remaining_sects = itr->fsdata->rootdir_size - sect_offset;
+               sect = itr->fsdata->rootdir_sect + sect_offset;
+               /* do not read past the end of rootdir */
+               read_size = min_t(u32, itr->fsdata->clust_size,
+                                 remaining_sects);
+       } else {
+               sect = clust_to_sect(itr->fsdata, itr->next_clust);
+               read_size = itr->fsdata->clust_size;
+       }
 
-       debug("FAT read(sect=%d), clust_size=%d, DIRENTSPERBLOCK=%zd\n",
-             sect, itr->fsdata->clust_size, DIRENTSPERBLOCK);
+       debug("FAT read(sect=%d), clust_size=%d, read_size=%u, DIRENTSPERBLOCK=%zd\n",
+             sect, itr->fsdata->clust_size, read_size, DIRENTSPERBLOCK);
 
        /*
         * NOTE: do_fat_read_at() had complicated logic to deal w/
@@ -757,18 +780,17 @@ static void *next_cluster(fat_itr *itr)
         * dent at a time and iteratively constructing the vfat long
         * name.
         */
-       ret = disk_read(sect, itr->fsdata->clust_size,
-                       itr->block);
+       ret = disk_read(sect, read_size, itr->block);
        if (ret < 0) {
                debug("Error: reading block\n");
                return NULL;
        }
 
+       *nbytes = read_size * itr->fsdata->sect_size;
        itr->clust = itr->next_clust;
        if (itr->is_root && itr->fsdata->fatsize != 32) {
                itr->next_clust++;
-               sect = clust_to_sect(itr->fsdata, itr->next_clust);
-               if (sect - itr->fsdata->rootdir_sect >=
+               if (itr->next_clust * itr->fsdata->clust_size >=
                    itr->fsdata->rootdir_size) {
                        debug("nextclust: 0x%x\n", itr->next_clust);
                        itr->last_cluster = 1;
@@ -787,9 +809,8 @@ static void *next_cluster(fat_itr *itr)
 static dir_entry *next_dent(fat_itr *itr)
 {
        if (itr->remaining == 0) {
-               struct dir_entry *dent = next_cluster(itr);
-               unsigned nbytes = itr->fsdata->sect_size *
-                       itr->fsdata->clust_size;
+               unsigned nbytes;
+               struct dir_entry *dent = next_cluster(itr, &nbytes);
 
                /* have we reached the last cluster? */
                if (!dent) {
diff --git a/fs/fs.c b/fs/fs.c
index c5c35ebf5f62bf59f2c43c7a37e43b7dfcf6a21b..736ebef4a93917fc84590d2739a73cc9f2793138 100644 (file)
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -90,6 +90,11 @@ static inline int fs_write_unsupported(const char *filename, void *buf,
        return -1;
 }
 
+static inline int fs_ln_unsupported(const char *filename, const char *target)
+{
+       return -1;
+}
+
 static inline void fs_close_unsupported(void)
 {
 }
@@ -154,6 +159,7 @@ struct fstype_info {
        void (*closedir)(struct fs_dir_stream *dirs);
        int (*unlink)(const char *filename);
        int (*mkdir)(const char *dirname);
+       int (*ln)(const char *filename, const char *target);
 };
 
 static struct fstype_info fstypes[] = {
@@ -181,6 +187,7 @@ static struct fstype_info fstypes[] = {
                .opendir = fat_opendir,
                .readdir = fat_readdir,
                .closedir = fat_closedir,
+               .ln = fs_ln_unsupported,
        },
 #endif
 
@@ -197,8 +204,10 @@ static struct fstype_info fstypes[] = {
                .read = ext4_read_file,
 #ifdef CONFIG_CMD_EXT4_WRITE
                .write = ext4_write_file,
+               .ln = ext4fs_create_link,
 #else
                .write = fs_write_unsupported,
+               .ln = fs_ln_unsupported,
 #endif
                .uuid = ext4fs_uuid,
                .opendir = fs_opendir_unsupported,
@@ -222,6 +231,7 @@ static struct fstype_info fstypes[] = {
                .opendir = fs_opendir_unsupported,
                .unlink = fs_unlink_unsupported,
                .mkdir = fs_mkdir_unsupported,
+               .ln = fs_ln_unsupported,
        },
 #endif
 #ifdef CONFIG_CMD_UBIFS
@@ -240,6 +250,7 @@ static struct fstype_info fstypes[] = {
                .opendir = fs_opendir_unsupported,
                .unlink = fs_unlink_unsupported,
                .mkdir = fs_mkdir_unsupported,
+               .ln = fs_ln_unsupported,
        },
 #endif
 #ifdef CONFIG_FS_BTRFS
@@ -258,6 +269,7 @@ static struct fstype_info fstypes[] = {
                .opendir = fs_opendir_unsupported,
                .unlink = fs_unlink_unsupported,
                .mkdir = fs_mkdir_unsupported,
+               .ln = fs_ln_unsupported,
        },
 #endif
        {
@@ -275,6 +287,7 @@ static struct fstype_info fstypes[] = {
                .opendir = fs_opendir_unsupported,
                .unlink = fs_unlink_unsupported,
                .mkdir = fs_mkdir_unsupported,
+               .ln = fs_ln_unsupported,
        },
 };
 
@@ -602,6 +615,22 @@ int fs_mkdir(const char *dirname)
        return ret;
 }
 
+int fs_ln(const char *fname, const char *target)
+{
+       struct fstype_info *info = fs_get_info(fs_type);
+       int ret;
+
+       ret = info->ln(fname, target);
+
+       if (ret < 0) {
+               printf("** Unable to create link %s -> %s **\n", fname, target);
+               ret = -1;
+       }
+       fs_close();
+
+       return ret;
+}
+
 int do_size(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
                int fstype)
 {
@@ -840,3 +869,18 @@ int do_mkdir(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
 
        return 0;
 }
+
+int do_ln(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
+         int fstype)
+{
+       if (argc != 5)
+               return CMD_RET_USAGE;
+
+       if (fs_set_blk_dev(argv[1], argv[2], fstype))
+               return 1;
+
+       if (fs_ln(argv[3], argv[4]))
+               return 1;
+
+       return 0;
+}
index bad0c67f5dac4b50010995f26458bb9fe317f406..5f6e12702de804b1fb030ba0863427efed05b989 100644 (file)
@@ -167,7 +167,7 @@ struct ubifs_global_debug_info {
 #else
 #define ubifs_assert(expr) do {                                                \
        if (unlikely(!(expr))) {                                               \
-               pr_crit("UBIFS assert failed in %s at %u\n",                   \
+               pr_debug("UBIFS assert failed in %s at %u\n",                  \
                       __func__, __LINE__);                                    \
                dump_stack();                                                  \
        }                                                                      \
@@ -176,7 +176,7 @@ struct ubifs_global_debug_info {
 #define ubifs_assert_cmt_locked(c) do {                                        \
        if (unlikely(down_write_trylock(&(c)->commit_sem))) {                  \
                up_write(&(c)->commit_sem);                                    \
-               pr_crit("commit lock is not locked!\n");                       \
+               pr_debug("commit lock is not locked!\n");                      \
                ubifs_assert(0);                                               \
        }                                                                      \
 } while (0)
index 7ef928bbe14ae07b8e474e317ae9aa4616bc0199..4ed09683b650a08468600dfc3dae3659dd22e100 100644 (file)
@@ -16,7 +16,4 @@
 #define CONFIG_BOOTM_RTEMS 1
 #define CONFIG_BOOTM_VXWORKS 1
 
-#define CONFIG_GZIP 1
-#define CONFIG_ZLIB 1
-
 #endif
index 3f7f379e06c4ff6d87652f9f6ec8f42d10f10910..3a515eef00e03b1a4f308386df755f4b91651e18 100644 (file)
@@ -39,7 +39,8 @@
 #define CONFIG_SYS_CLK_FREQ    RMOBILE_XTAL_CLK
 
 #define CONFIG_EXTRA_ENV_SETTINGS      \
-       "bootm_size=0x10000000\0"
+       "bootm_size=0x10000000\0"       \
+       "usb_pgood_delay=2000\0"
 
 /* SPL support */
 #define CONFIG_SPL_TEXT_BASE           0xe6300000
diff --git a/include/configs/am335x_guardian.h b/include/configs/am335x_guardian.h
new file mode 100644 (file)
index 0000000..8bde198
--- /dev/null
@@ -0,0 +1,111 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * am335x_guardian_.h
+ *
+ * Copyright (C) 2018 Robert Bosch Power Tools GmbH
+ * Copyright (C) 2018 sjoerd Simons <sjoerd.simons@collabora.co.uk>
+ *
+ */
+
+#ifndef __CONFIG_AM335X_GUARDIAN_H
+#define __CONFIG_AM335X_GUARDIAN_H
+
+#include <configs/ti_am335x_common.h>
+
+#ifndef CONFIG_SPL_BUILD
+#define CONFIG_TIMESTAMP
+#endif
+
+/* Clock Defines */
+#define V_OSCK                         24000000  /* Clock output from T2 */
+#define V_SCLK                         (V_OSCK)
+
+#ifndef CONFIG_SPL_BUILD
+
+#define MEM_LAYOUT_ENV_SETTINGS \
+       "scriptaddr=0x80000000\0" \
+       "pxefile_addr_r=0x80100000\0" \
+       "kernel_addr_r=0x82000000\0" \
+       "fdt_addr_r=0x88000000\0" \
+       "ramdisk_addr_r=0x88080000\0" \
+
+#define BOOT_TARGET_DEVICES(func) \
+       func(MMC, mmc, 0) \
+       func(UBIFS, ubifs, 0) \
+       func(PXE, pxe, na) \
+       func(DHCP, dhcp, na)
+
+#define AM335XX_BOARD_FDTFILE "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0"
+
+#include <config_distro_bootcmd.h>
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       AM335XX_BOARD_FDTFILE \
+       MEM_LAYOUT_ENV_SETTINGS \
+       BOOTENV \
+       "bootlimit=3\0" \
+       "altbootcmd=" \
+               "setenv boot_config \"extlinux-rollback.conf\"; " \
+               "run distro_bootcmd\0"
+
+#endif /* CONFIG_SPL_BUILD */
+
+/* NS16550 Configuration */
+#define CONFIG_SYS_NS16550_COM1                0x44e09000      /* UART0 */
+#define CONFIG_SYS_NS16550_COM2                0x48022000      /* UART1 */
+#define CONFIG_SYS_NS16550_COM3                0x48024000      /* UART2 */
+#define CONFIG_SYS_NS16550_COM4                0x481a6000      /* UART3 */
+#define CONFIG_SYS_NS16550_COM5                0x481a8000      /* UART4 */
+#define CONFIG_SYS_NS16550_COM6                0x481aa000      /* UART5 */
+
+/* PMIC support */
+#define CONFIG_POWER_TPS65217
+
+/* Bootcount using the RTC block */
+#define CONFIG_SYS_BOOTCOUNT_LE
+
+#ifdef CONFIG_NAND
+#define CONFIG_ENV_OFFSET              0x300000
+#define CONFIG_ENV_OFFSET_REDUND       0x340000
+#define CONFIG_ENV_SIZE                        0x040000
+
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+#define CONFIG_SYS_NAND_PAGE_COUNT      (CONFIG_SYS_NAND_BLOCK_SIZE / \
+                                       CONFIG_SYS_NAND_PAGE_SIZE)
+#define CONFIG_SYS_NAND_PAGE_SIZE       4096
+#define CONFIG_SYS_NAND_OOBSIZE         256
+#define CONFIG_SYS_NAND_BLOCK_SIZE      (256 * 1024)
+
+#define CONFIG_SYS_NAND_ECCPOS  {   2,   3,   4,   5,   6,   7,   8,   9, \
+                        10,  11,  12,  13,  14,  15,  16,  17,  18,  19, \
+                        20,  21,  22,  23,  24,  25,  26,  27,  28,  29, \
+                        30,  31,  32,  33,  34,  35,  36,  37,  38,  39, \
+                        40,  41,  42,  43,  44,  45,  46,  47,  48,  49, \
+                        50,  51,  52,  53,  54,  55,  56,  57,  58,  59, \
+                        60,  61,  62,  63,  64,  65,  66,  67,  68,  69, \
+                        70,  71,  72,  73,  74,  75,  76,  77,  78,  79, \
+                        80,  81,  82,  83,  84,  85,  86,  87,  88,  89, \
+                        90,  91,  92,  93,  94,  95,  96,  97,  98,  99, \
+                       100, 101, 102, 103, 104, 105, 106, 107, 108, 109, \
+                       110, 111, 112, 113, 114, 115, 116, 117, 118, 119, \
+                       120, 121, 122, 123, 124, 125, 126, 127, 128, 129, \
+                       130, 131, 132, 133, 134, 135, 136, 137, 138, 139, \
+                       140, 141, 142, 143, 144, 145, 146, 147, 148, 149, \
+                       150, 151, 152, 153, 154, 155, 156, 157, 158, 159, \
+                       160, 161, 162, 163, 164, 165, 166, 167, 168, 169, \
+                       170, 171, 172, 173, 174, 175, 176, 177, 178, 179, \
+                       180, 181, 182, 183, 184, 185, 186, 187, 188, 189, \
+                       190, 191, 192, 193, 194, 195, 196, 197, 198, 199, \
+                       200, 201, 202, 203, 204, 205, 206, 207, 208, 209, \
+                       }
+#define CONFIG_SYS_NAND_ECCSIZE         512
+#define CONFIG_SYS_NAND_ECCBYTES        26
+#define CONFIG_SYS_NAND_ONFI_DETECTION
+#define CONFIG_NAND_OMAP_ECCSCHEME      OMAP_ECC_BCH16_CODE_HW
+#define MTDIDS_DEFAULT                  "nand0=nand.0"
+
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS   NAND_LARGE_BADBLOCK_POS
+
+#endif /* CONFIG_NAND */
+
+#endif /* ! __CONFIG_AM335X_GUARDIAN_H */
index c51cf284502b922961538ffd04554d1a60818c46..9f8d3cc9e5e8cd9f0b49fd2e7389d55c0f84c8d2 100644 (file)
@@ -21,8 +21,6 @@
  * Commands configuration
  */
 
-/* SPI NOR flash default params, used by sf commands */
-
 /*
  * SDIO/MMC Card Configuration
  */
index 5dd5c28e08af045c300cb073ae2895eca0a02f01..749a67d4b0852c2036933259b451fe3148f9fe8c 100644 (file)
 #define CONFIG_SYS_MCKR                        0x1301
 #define CONFIG_SYS_MCKR_CSS            0x1302
 
+#define CONFIG_SPL_PAD_TO              CONFIG_SYS_NAND_U_BOOT_OFFS
+#define CONFIG_SYS_SPL_LEN             CONFIG_SPL_PAD_TO
+
 #endif
index 583f9948072830b81e49d1ae6cb08362c4a8664e..94848f5128b05c6a58c48f45e4fef8ed564bc7e1 100644 (file)
@@ -48,7 +48,8 @@
 #define PHYS_SDRAM_1           DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */
 #define PHYS_SDRAM_1_SIZE      (64 << 20) /* SDRAM size 64MB */
 #define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /* max size from SPRS586*/
-
+#define CONFIG_SPL_BSS_START_ADDR DAVINCI_DDR_EMIF_DATA_BASE
+#define CONFIG_SPL_BSS_MAX_SIZE 0x1080000
 /* memtest start addr */
 #define CONFIG_SYS_MEMTEST_START       (PHYS_SDRAM_1 + 0x2000000)
 
index 55968c2749efeb86be72042d65392fc5a811df4a..63194d58a29bcf5d0968c031e3984d42d5c03436 100644 (file)
@@ -32,8 +32,6 @@
 #define CONFIG_EHCI_IS_TDI
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 3
 
-/* SPI NOR flash default params, used by sf commands */
-
 /* Environment in SPI NOR flash */
 #define CONFIG_ENV_OFFSET              (1 << 20) /* 1MiB in */
 #define CONFIG_ENV_SIZE                        (64 << 10) /* 64KiB */
index f1bdc2d3e74ffb9a3cd783e4e39e7082f3ed6210..2fdc845029214dc3a2da0d6e606bc26efe07210f 100644 (file)
@@ -16,8 +16,6 @@
  * Commands configuration
  */
 
-/* SPI NOR flash default params, used by sf commands */
-
 /* USB/EHCI configuration */
 #define CONFIG_EHCI_IS_TDI
 
index d378052a8f7caf0925ead9aded12df677b2ff853..ec2405bbb456115d4b6f5c68433ab0f9ce700371 100644 (file)
 #define CONFIG_SYS_I2C_SLAVE           0x0
 #define CONFIG_SYS_I2C_SPEED           100000
 
-/*
- * SPI Flash configuration for the environemnt access
- */
-
-/* SPI NOR flash default params, used by sf commands */
-
 /*
  * SDIO/MMC Card Configuration
  */
index b78dbcb6b946610b172d2e76ee94429c9748af78..1f9d24b19b980a87118371d4269d6b58fd22920f 100644 (file)
@@ -29,8 +29,6 @@
 #define CONFIG_EHCI_IS_TDI
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 3
 
-/* SPI NOR flash default params, used by sf commands */
-
 /* Environment in SPI NOR flash */
 #define CONFIG_ENV_OFFSET              (1 << 20) /* 1MiB in */
 #define CONFIG_ENV_SIZE                        (64 << 10) /* 64KiB */
diff --git a/include/configs/db-xc3-24g4xg.h b/include/configs/db-xc3-24g4xg.h
new file mode 100644 (file)
index 0000000..0f75ad7
--- /dev/null
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2014 Stefan Roese <sr@denx.de>
+ */
+
+#ifndef _CONFIG_DB_XC3_24G4G_H
+#define _CONFIG_DB_XC3_24G4G_H
+
+/*
+ * High Level Configuration Options (easy to change)
+ */
+
+#define CONFIG_SYS_KWD_CONFIG  $(CONFIG_BOARDDIR)/kwbimage.cfg
+#define CONFIG_SYS_TCLK                200000000       /* 200MHz */
+
+/* USB/EHCI configuration */
+#define CONFIG_EHCI_IS_TDI
+
+/* Environment in SPI NOR flash */
+#define CONFIG_ENV_OFFSET              (1 << 20) /* 1MiB in */
+#define CONFIG_ENV_SIZE                        (64 << 10) /* 64KiB */
+#define CONFIG_ENV_SECT_SIZE           (256 << 10) /* 256KiB sectors */
+
+/* NAND */
+#define CONFIG_SYS_NAND_USE_FLASH_BBT
+#define CONFIG_SYS_NAND_ONFI_DETECTION
+
+/* Keep device tree and initrd in lower memory so the kernel can access them */
+#define CONFIG_EXTRA_ENV_SETTINGS      \
+       "fdt_high=0x10000000\0"         \
+       "initrd_high=0x10000000\0"
+
+/*
+ * mv-common.h should be defined after CMD configs since it used them
+ * to enable certain macros
+ */
+#include "mv-common.h"
+#undef CONFIG_SYS_MAXARGS
+#define CONFIG_SYS_MAXARGS 96
+
+#endif /* _CONFIG_DB_XC3_24G4G_H */
index 10eac20aa0c8fca754550a74c23f3853b2171451..7441f4a69dea100ace1f2f2cfaf3ae764cb7c33e 100644 (file)
                                         50, 51, 52, 53, 54, 55, 56, 57, }
 #define CONFIG_SYS_NAND_ECCSIZE                512
 #define CONFIG_SYS_NAND_ECCBYTES       14
-#define CONFIG_SYS_NAND_U_BOOT_OFFS    0x000c0000
+#define CONFIG_SYS_NAND_U_BOOT_OFFS    0x00140000
 /* NAND: SPL related configs */
 /* NAND: SPL falcon mode configs */
 #ifdef CONFIG_SPL_OS_BOOT
index 275a2b4788052f5808ad587430b2b6636e013cbe..192c055c5cc45c1801ada6973650e4f21c6358d5 100644 (file)
@@ -28,8 +28,6 @@
 #define CONFIG_SYS_I2C_SLAVE           0x0
 #define CONFIG_SYS_I2C_SPEED           100000
 
-/* SPI NOR flash default params, used by sf commands */
-
 /* Environment in SPI NOR flash */
 #define CONFIG_ENV_OFFSET              0x7E0000   /* RedBoot config partition in DTS */
 #define CONFIG_ENV_SIZE                        (64 << 10) /* 64KiB */
diff --git a/include/configs/gardena-smart-gateway-at91sam.h b/include/configs/gardena-smart-gateway-at91sam.h
new file mode 100644 (file)
index 0000000..e9a06e6
--- /dev/null
@@ -0,0 +1,88 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2012 Atmel Corporation
+ * Copyright (C) 2019 Stefan Roese <sr@denx.de>
+ *
+ * Configuation settings for the GARDENA smart Gateway (AT91SAM9G25)
+ */
+
+#ifndef __CONFIG_H__
+#define __CONFIG_H__
+
+/* ARM asynchronous clock */
+#define CONFIG_SYS_AT91_SLOW_CLOCK     32768
+#define CONFIG_SYS_AT91_MAIN_CLOCK     12000000        /* 12 MHz crystal */
+
+#ifndef CONFIG_SPL_BUILD
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#endif
+#define CONFIG_SKIP_LOWLEVEL_INIT_ONLY
+
+/* general purpose I/O */
+#define CONFIG_ATMEL_LEGACY            /* required until (g)pio is fixed */
+
+/* SDRAM */
+#define CONFIG_SYS_SDRAM_BASE          0x20000000
+#define CONFIG_SYS_SDRAM_SIZE          0x08000000      /* 128 megs */
+
+#define CONFIG_SYS_INIT_SP_ADDR \
+       (CONFIG_SYS_SDRAM_BASE + 16 * 1024 - GENERATED_GBL_DATA_SIZE)
+
+#define CONFIG_SYS_MALLOC_LEN          (16 * 1024 * 1024)
+
+/* NAND flash */
+#define CONFIG_SYS_MAX_NAND_DEVICE     1
+#define CONFIG_SYS_NAND_BASE           0x40000000
+#define CONFIG_SYS_NAND_DBW_8          1
+/* our ALE is AD21 */
+#define CONFIG_SYS_NAND_MASK_ALE       BIT(21)
+/* our CLE is AD22 */
+#define CONFIG_SYS_NAND_MASK_CLE       BIT(22)
+#define CONFIG_SYS_NAND_ENABLE_PIN     AT91_PIN_PD4
+#define CONFIG_SYS_NAND_READY_PIN      AT91_PIN_PD5
+
+#define CONFIG_SYS_LOAD_ADDR           0x22000000      /* load address */
+
+/* environment organization */
+#define CONFIG_ENV_UBI_PART            "ubi"
+#define CONFIG_ENV_UBI_VOLUME          "env"
+#define CONFIG_ENV_UBI_VOLUME_REDUND   "env_r"
+#define CONFIG_ENV_SIZE                        (64 << 10)
+
+/* SPL */
+#define CONFIG_SPL_TEXT_BASE           0x300000
+#define CONFIG_SPL_MAX_SIZE            0x7000
+#define CONFIG_SPL_STACK               0x308000
+
+#define CONFIG_SPL_BSS_START_ADDR      0x20000000
+#define CONFIG_SPL_BSS_MAX_SIZE                0x80000
+#define CONFIG_SYS_SPL_MALLOC_START    0x20080000
+#define CONFIG_SYS_SPL_MALLOC_SIZE     0x80000
+
+#define CONFIG_SYS_MONITOR_LEN         (512 << 10)
+
+#define CONFIG_SYS_MASTER_CLOCK                132096000
+#define CONFIG_SYS_AT91_PLLA           0x20c73f03
+#define CONFIG_SYS_MCKR                        0x1301
+#define CONFIG_SYS_MCKR_CSS            0x1302
+
+#define CONFIG_SPL_NAND_DRIVERS
+#define CONFIG_SPL_NAND_BASE
+#define CONFIG_SPL_NAND_RAW_ONLY
+#define CONFIG_SYS_NAND_U_BOOT_OFFS    0x40000
+#define CONFIG_SYS_NAND_U_BOOT_SIZE    0xa0000
+#define        CONFIG_SYS_UBOOT_START          CONFIG_SYS_TEXT_BASE
+#define        CONFIG_SYS_NAND_U_BOOT_START    CONFIG_SYS_TEXT_BASE
+#define CONFIG_SYS_NAND_U_BOOT_DST     CONFIG_SYS_TEXT_BASE
+
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+#define CONFIG_SYS_NAND_PAGE_SIZE      0x800
+#define CONFIG_SYS_NAND_PAGE_COUNT     64
+#define CONFIG_SYS_NAND_OOBSIZE                64
+#define CONFIG_SYS_NAND_BLOCK_SIZE     0x20000
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS  0x0
+
+#define CONFIG_SPL_PAD_TO              CONFIG_SYS_NAND_U_BOOT_OFFS
+#define CONFIG_SYS_SPL_LEN             CONFIG_SPL_PAD_TO
+
+#endif
index df4d8bcb3bbf869c830a8b0138e6d1b446c144a9..b2badab15eab25f82ca14057125d23e4a6bd8960 100644 (file)
@@ -23,8 +23,6 @@
  * Commands configuration
  */
 
-/* SPI NOR flash default params, used by sf commands */
-
 /*
  * SDIO/MMC Card Configuration
  */
index 2c0e4cbe92fd2244ce759fd2fac0b8f09c613ce0..547127490c9258e3301f5d5986fbb7a1912ae7ad 100644 (file)
 
 #include <configs/ti_armv7_keystone2.h>
 
-/* SPL SPI Loader Configuration */
-#define CONFIG_SPL_TEXT_BASE           0x0c100000
-
-
 #define SPI_MTD_PARTS KEYSTONE_SPI0_MTD_PARTS
 
 /* NAND Configuration */
index b1aec98a37225345cc20059c41265bd76b2eaba7..3ec5a5acf5f9780c744e44c68c0ba2a2aa8b662e 100644 (file)
@@ -72,9 +72,6 @@
        "bootm ${fit_loadaddr}#${name_fdt}"
 #endif
 
-/* SPL SPI Loader Configuration */
-#define CONFIG_SPL_TEXT_BASE           0x0c0a0000
-
 /* NAND Configuration */
 #define CONFIG_SYS_NAND_PAGE_2K
 
index 0b909a1bf6fabbbe82c8c67eefbfcc4dc6160734..d4f2e96bab087bf6355cf1138ac963c88de1097b 100644 (file)
@@ -40,9 +40,6 @@
 
 #include <configs/ti_armv7_keystone2.h>
 
-/* SPL SPI Loader Configuration */
-#define CONFIG_SPL_TEXT_BASE           0x0c200000
-
 #define SPI_MTD_PARTS KEYSTONE_SPI0_MTD_PARTS
 
 /* NAND Configuration */
index 59e6b096733a47c37a713a9a45de4c53e6a18f39..cfdb36e2d7ff72100bc996ace2239db88306583e 100644 (file)
@@ -40,9 +40,6 @@
 
 #include <configs/ti_armv7_keystone2.h>
 
-/* SPL SPI Loader Configuration */
-#define CONFIG_SPL_TEXT_BASE           0x0c100000
-
 #define SPI_MTD_PARTS KEYSTONE_SPI0_MTD_PARTS
 
 /* NAND Configuration */
index 72e62658d0ccc7a201e134111706a148b3160b23..55c4e633254755d54f21998ac4e6eedbd9e2207e 100644 (file)
@@ -76,9 +76,9 @@
        "kernel_addr=0x00800000\0"                                      \
        "ramdisk_addr=0x01000000\0"                                     \
        "fdt_addr=0x00ff0000\0"                                         \
-       "bootcmd_legacy=ide reset "                                     \
-               "&& load ide ${hdpart} ${kernel_addr} /uImage.buffalo " \
-               "&& load ide ${hdpart} ${ramdisk_addr} /initrd.buffalo "\
+       "bootcmd_legacy=sata init "                                     \
+               "&& load sata ${hdpart} ${kernel_addr} /uImage.buffalo "\
+               "&& load sata ${hdpart} ${ramdisk_addr} /initrd.buffalo "\
                "&& bootm ${kernel_addr} ${ramdisk_addr}\0"             \
        "bootcmd_net=bootp ${kernel_addr} vmlinuz "                     \
                "&& tftpboot ${ramdisk_addr} initrd.img "               \
                "&& tftpboot ${fdt_addr} " CONFIG_FDTFILE " "           \
                "&& bootz ${kernel_addr} "                              \
                        "${ramdisk_addr}:${ramdisk_len} ${fdt_addr}\0"  \
-       "bootcmd_hdd=ide reset "                                        \
-               "&& load ide ${hdpart} ${kernel_addr} /vmlinuz "        \
-               "&& load ide ${hdpart} ${ramdisk_addr} /initrd.img "    \
+       "bootcmd_hdd=sata init "                                        \
+               "&& load sata ${hdpart} ${kernel_addr} /vmlinuz "       \
+               "&& load sata ${hdpart} ${ramdisk_addr} /initrd.img "   \
                "&& setenv ramdisk_len ${filesize} "                    \
-               "&& load ide ${hdpart} ${fdt_addr} /dtb "               \
+               "&& load sata ${hdpart} ${fdt_addr} /dtb "              \
                "&& bootz ${kernel_addr} "                              \
                        "${ramdisk_addr}:${ramdisk_len} ${fdt_addr}\0"  \
        "bootcmd_usb=usb start "                                        \
 #undef CONFIG_RESET_PHY_R
 #endif /* CONFIG_CMD_NET */
 
-#ifdef CONFIG_IDE
-#undef CONFIG_SYS_IDE_MAXBUS
-#define CONFIG_SYS_IDE_MAXBUS          1
-#undef CONFIG_SYS_IDE_MAXDEVICE
-#define CONFIG_SYS_IDE_MAXDEVICE       1
-#define CONFIG_SYS_ATA_IDE0_OFFSET     MV_SATA_PORT0_OFFSET
+#ifdef CONFIG_SATA
+#define CONFIG_SYS_SATA_MAX_DEVICE 1
 #define CONFIG_SYS_64BIT_LBA
+#define CONFIG_LBA48
 #endif
 
 #endif /* _CONFIG_LSXL_H */
index f4972b64dcb158cf6ff8463cb56197957c8a5801..b28f3b94085ab695413d98759c062de11696a74c 100644 (file)
 /* End of 16M scrubbed by training in bootrom */
 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_TEXT_BASE + 0xFF0000)
 
-/*
- * SPI Flash configuration
- */
-
 #define CONFIG_ENV_OFFSET              0x180000 /* as Marvell U-Boot version */
 #define CONFIG_ENV_SIZE                        (64 << 10) /* 64KiB */
 #define CONFIG_ENV_SECT_SIZE           (64 << 10) /* 64KiB sectors */
index 1786e099ad4f7f7bff87b56ddd789f8ed85b3e5a..6680c3e5037507ace510cd9499a2762671d53987 100644 (file)
@@ -43,6 +43,9 @@
 #define PHYS_SDRAM_1_SIZE      (128 << 20) /* SDRAM size 128MB */
 #define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /* max size from SPRS586*/
 
+#define CONFIG_SPL_BSS_START_ADDR DAVINCI_DDR_EMIF_DATA_BASE
+#define CONFIG_SPL_BSS_MAX_SIZE 0x1080000
+
 /* memtest start addr */
 #define CONFIG_SYS_MEMTEST_START       (PHYS_SDRAM_1 + 0x2000000)
 
index 46b803089493af238410b54f1a21625f85f5cedc..e34873cea7d53182d502196c3dacfa87211f31f6 100644 (file)
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-/*
- * SoC must be defined first, before hardware.h is included.
- * In this case SoC is defined in boards.cfg.
- */
-#include <asm/hardware.h>
-
-#define CONFIG_SYS_AT91_CPU_NAME       "AT91SAM9G45"
-
-#define CONFIG_MACH_TYPE       MACH_TYPE_PM9G45
-
 /* ARM asynchronous clock */
-#define CONFIG_SYS_AT91_MAIN_CLOCK     12000000 /* from 12 MHz crystal */
-#define CONFIG_SYS_AT91_SLOW_CLOCK     32768           /* slow clock xtal */
-
-#define CONFIG_ARCH_CPU_INIT
-
-#define CONFIG_CMDLINE_TAG     1       /* enable passing of ATAGs */
-#define CONFIG_SETUP_MEMORY_TAGS 1
-#define CONFIG_INITRD_TAG      1
+#define CONFIG_SYS_AT91_SLOW_CLOCK      32768
+#define CONFIG_SYS_AT91_MAIN_CLOCK      12000000 /* from 12 MHz crystal */
 
+#define CONFIG_CMDLINE_TAG             /* enable passing of ATAGs      */
+#define CONFIG_SETUP_MEMORY_TAGS
+#define CONFIG_INITRD_TAG
 #define CONFIG_SKIP_LOWLEVEL_INIT
 
-/*
- * Hardware drivers
- */
-#define CONFIG_AT91_GPIO       1
-#define CONFIG_ATMEL_USART     1
-#define CONFIG_USART_BASE              ATMEL_BASE_DBGU
-#define        CONFIG_USART_ID                 ATMEL_ID_SYS
-
-#define CONFIG_SYS_USE_NANDFLASH       1
-
-/* LED */
-#define CONFIG_AT91_LED
-#define CONFIG_RED_LED         GPIO_PIN_PD(31) /* this is the user1 led */
-#define CONFIG_GREEN_LED       GPIO_PIN_PD(0)  /* this is the user2 led */
-
+/* general purpose I/O */
+#define CONFIG_ATMEL_LEGACY            /* required until (g)pio is fixed */
 
 /*
  * BOOTP options
  */
-#define CONFIG_BOOTP_BOOTFILESIZE      1
-
-#define CONFIG_JFFS2_CMDLINE           1
-#define CONFIG_JFFS2_NAND              1
-#define CONFIG_JFFS2_DEV               "nand0" /* NAND dev jffs2 lives on */
-#define CONFIG_JFFS2_PART_OFFSET       0       /* start of jffs2 partition */
-#define CONFIG_JFFS2_PART_SIZE         (256 * 1024 * 1024) /* partition */
+#define CONFIG_BOOTP_BOOTFILESIZE
 
 /* SDRAM */
-#define PHYS_SDRAM                     0x70000000
-#define PHYS_SDRAM_SIZE                        0x08000000      /* 128 megs */
+#define CONFIG_SYS_SDRAM_BASE           0x70000000
+#define CONFIG_SYS_SDRAM_SIZE          0x08000000
+
+#define CONFIG_SYS_INIT_SP_ADDR \
+       (CONFIG_SYS_SDRAM_BASE + 16 * 1024 - GENERATED_GBL_DATA_SIZE)
 
 /* NAND flash */
 #ifdef CONFIG_CMD_NAND
-#define CONFIG_SYS_MAX_NAND_DEVICE     1
-#define CONFIG_SYS_NAND_BASE           0x40000000
-#define CONFIG_SYS_NAND_DBW_8          1
+#define CONFIG_SYS_MAX_NAND_DEVICE             1
+#define CONFIG_SYS_NAND_BASE                   ATMEL_BASE_CS3
+#define CONFIG_SYS_NAND_DBW_8
 /* our ALE is AD21 */
-#define CONFIG_SYS_NAND_MASK_ALE       (1 << 21)
+#define CONFIG_SYS_NAND_MASK_ALE               BIT(21)
 /* our CLE is AD22 */
-#define CONFIG_SYS_NAND_MASK_CLE       (1 << 22)
-#define CONFIG_SYS_NAND_ENABLE_PIN     GPIO_PIN_PC(14)
-#define CONFIG_SYS_NAND_READY_PIN      GPIO_PIN_PD(3)
-
+#define CONFIG_SYS_NAND_MASK_CLE               BIT(22)
+#define CONFIG_SYS_NAND_ENABLE_PIN             AT91_PIN_PC14
+#define CONFIG_SYS_NAND_READY_PIN              AT91_PIN_PD3
+#define CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT
 #endif
 
 /* Ethernet */
-#define CONFIG_MACB                    1
-#define CONFIG_RMII                    1
-#define CONFIG_NET_RETRY_COUNT         20
-#define CONFIG_RESET_PHY_R             1
-
-/* USB */
-#define CONFIG_USB_ATMEL
-#define CONFIG_USB_ATMEL_CLK_SEL_UPLL
-#define CONFIG_USB_OHCI_NEW            1
-#define CONFIG_SYS_USB_OHCI_CPU_INIT   1
-#define CONFIG_SYS_USB_OHCI_REGS_BASE  0x00700000 /* _UHP_OHCI_BASE */
-#define CONFIG_SYS_USB_OHCI_SLOT_NAME  "at91sam9g45"
-#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS     2
-
-/* board specific(not enough SRAM) */
-#define CONFIG_AT91SAM9G45_LCD_BASE    PHYS_SDRAM + 0xE00000
-
-#define CONFIG_SYS_LOAD_ADDR           PHYS_SDRAM + 0x2000000 /* load addr */
-
-#define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM
-#define CONFIG_SYS_MEMTEST_END         CONFIG_AT91SAM9G45_LCD_BASE
-
-/* bootstrap + u-boot + env + linux in nandflash */
-#define CONFIG_ENV_OFFSET              0x60000
-#define CONFIG_ENV_OFFSET_REDUND       0x80000
-#define CONFIG_ENV_SIZE                        0x20000         /* 1 sector = 128 kB */
-#define CONFIG_BOOTCOMMAND     "nand read 0x72000000 0x200000 0x200000; bootm"
+#define CONFIG_RESET_PHY_R
+#define CONFIG_AT91_WANTS_COMMON_PHY
+
+#define CONFIG_SYS_LOAD_ADDR           0x22000000      /* load address */
+
+#define CONFIG_SYS_MEMTEST_START       CONFIG_SYS_SDRAM_BASE
+#define CONFIG_SYS_MEMTEST_END         0x23e00000
+
+#ifdef CONFIG_NAND_BOOT
+/* bootstrap + u-boot + env in nandflash */
+#define CONFIG_ENV_OFFSET              0x140000
+#define CONFIG_ENV_OFFSET_REDUND       0x100000
+#define CONFIG_ENV_SIZE                        0x20000
+
+#define CONFIG_BOOTCOMMAND                                             \
+       "nand read 0x70000000 0x200000 0x300000;"                       \
+       "bootm 0x70000000"
+#elif CONFIG_SD_BOOT
+/* bootstrap + u-boot + env + linux in mmc */
+#define CONFIG_ENV_SIZE                0x4000
+
+#define CONFIG_BOOTCOMMAND     "fatload mmc 0:1 0x71000000 dtb; " \
+                               "fatload mmc 0:1 0x72000000 zImage; " \
+                               "bootz 0x72000000 - 0x71000000"
+#endif
 
 /*
  * Size of malloc() pool
  */
-#define CONFIG_SYS_MALLOC_LEN          ROUND(3 * CONFIG_ENV_SIZE + 128*1024,\
-                                       0x1000)
+#define CONFIG_SYS_MALLOC_LEN          ROUND(3 * CONFIG_ENV_SIZE + \
+                                             128 * 1024, 0x1000)
+
+/* Defines for SPL */
+#define CONFIG_SPL_TEXT_BASE           0x300000
+#define CONFIG_SPL_MAX_SIZE            0x010000
+#define CONFIG_SPL_STACK               0x310000
+
+#define CONFIG_SYS_MONITOR_LEN         0x80000
+
+#ifdef CONFIG_SD_BOOT
+
+#define CONFIG_SPL_BSS_START_ADDR      0x70000000
+#define CONFIG_SPL_BSS_MAX_SIZE                0x00080000
+#define CONFIG_SYS_SPL_MALLOC_START    0x70080000
+#define CONFIG_SYS_SPL_MALLOC_SIZE     0x00080000
+
+#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME                "u-boot.img"
+
+#elif CONFIG_NAND_BOOT
+#define CONFIG_SPL_NAND_DRIVERS
+#define CONFIG_SPL_NAND_BASE
+#define CONFIG_SPL_NAND_ECC
+#define CONFIG_SPL_NAND_SOFTECC
+#define CONFIG_SYS_NAND_U_BOOT_OFFS    0x40000
+#define CONFIG_SYS_NAND_U_BOOT_SIZE    0x80000
+#define CONFIG_SYS_NAND_5_ADDR_CYCLE
+
+#define CONFIG_SYS_NAND_PAGE_SIZE      0x800
+#define CONFIG_SYS_NAND_BLOCK_SIZE     0x20000
+#define CONFIG_SYS_NAND_PAGE_COUNT     64
+#define CONFIG_SYS_NAND_BAD_BLOCK_POS  NAND_LARGE_BADBLOCK_POS
+#define CONFIG_SYS_NAND_ECCSIZE                256
+#define CONFIG_SYS_NAND_ECCBYTES       3
+#define CONFIG_SYS_NAND_OOBSIZE                64
+#define CONFIG_SYS_NAND_ECCPOS         { 40, 41, 42, 43, 44, 45, 46, 47, \
+                                         48, 49, 50, 51, 52, 53, 54, 55, \
+                                         56, 57, 58, 59, 60, 61, 62, 63, }
+#endif
 
-#define CONFIG_SYS_SDRAM_BASE  PHYS_SDRAM
-#define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_SDRAM_BASE + 0x1000 - \
-                               GENERATED_GBL_DATA_SIZE)
+#define CONFIG_SPL_ATMEL_SIZE
+#define CONFIG_SYS_MASTER_CLOCK                132096000
+#define CONFIG_SYS_AT91_PLLA           0x20c73f03
+#define CONFIG_SYS_MCKR                        0x1301
+#define CONFIG_SYS_MCKR_CSS            0x1302
 
 #endif
index 28af575bf20339e5c7ba70a6370919db1f3ce86e..f95b29480d7dd14a85aa035d0ed7c9ad42c05144 100644 (file)
 #define CONFIG_SYS_ICACHE_OFF
 #define CONFIG_SYS_DCACHE_OFF
 #endif
+
+#define CONFIG_SPL_PAD_TO              CONFIG_SYS_NAND_U_BOOT_OFFS
+#define CONFIG_SYS_SPL_LEN             CONFIG_SPL_PAD_TO
+
 #endif /* __CONFIG_H */
index 1d245779934746accffc1a2adfe2f2e229530cdc..3582eb2edffdcb34b64bd2bb8c312b36dce068b5 100644 (file)
 #define CONFIG_SYS_MCKR_CSS            (0x02 | CONFIG_SYS_MCKR)
 #define CONFIG_SYS_AT91_PLLB           0x10193F05
 
+#define CONFIG_SPL_PAD_TO              CONFIG_SYS_NAND_U_BOOT_OFFS
+#define CONFIG_SYS_SPL_LEN             CONFIG_SPL_PAD_TO
+
 #endif
index 59b2546f0b4caab351c6a59e40edc6687dd687cd..cd92835112dd56b44bef5f78e39862f75e2a9de5 100644 (file)
@@ -39,8 +39,6 @@
 #define CONFIG_EHCI_IS_TDI
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 3
 
-/* SPI NOR flash default params, used by sf commands */
-
 /* Environment in SPI NOR flash */
 #define CONFIG_ENV_OFFSET              (1 << 20) /* 1MiB in */
 #define CONFIG_ENV_SIZE                        (64 << 10) /* 64KiB */
index fb8c082c1dcdaf706d07d5af791ec628ac75c748..eeca085f9fc2cb9f57e788ce695df95322ff3fec 100644 (file)
@@ -22,7 +22,7 @@
 /* Memory Configuration */
 #define CONFIG_SYS_LPAE_SDRAM_BASE     0x800000000
 #define CONFIG_MAX_RAM_BANK_SIZE       (2 << 30)       /* 2GB */
-#define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SPL_TEXT_BASE - \
+#define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_ISW_ENTRY_ADDR - \
                                        GENERATED_GBL_DATA_SIZE)
 
 #ifdef CONFIG_SYS_MALLOC_F_LEN
 #endif
 
 /* SPL SPI Loader Configuration */
+#define CONFIG_SPL_TEXT_BASE           CONFIG_ISW_ENTRY_ADDR
 #define CONFIG_SPL_PAD_TO              65536
 #define CONFIG_SPL_MAX_SIZE            (CONFIG_SPL_PAD_TO - 8)
-#define CONFIG_SPL_BSS_START_ADDR      (CONFIG_SPL_TEXT_BASE + \
+#define CONFIG_SPL_BSS_START_ADDR      (CONFIG_ISW_ENTRY_ADDR + \
                                        CONFIG_SPL_MAX_SIZE)
 #define CONFIG_SPL_BSS_MAX_SIZE                (32 * 1024)
 #define CONFIG_SYS_SPL_MALLOC_START    (CONFIG_SPL_BSS_START_ADDR + \
 #define CONFIG_KSNET_SERDES_SGMII2_BASE                KS2_SGMII_SERDES2_BASE
 #define CONFIG_KSNET_SERDES_LANES_PER_SGMII    KS2_LANES_PER_SGMII_SERDES
 
-/* SerDes */
-#define CONFIG_TI_KEYSTONE_SERDES
-
 #define CONFIG_AEMIF_CNTRL_BASE                KS2_AEMIF_CNTRL_BASE
 
 /* I2C Configuration */
index ba57c40182cca7aa3739d1d84e9753dc9c3c565e..7c08e47d3d19ada432466d47908f08ff9b566451 100644 (file)
@@ -56,6 +56,7 @@
 
 #include <environment/ti/boot.h>
 #include <environment/ti/mmc.h>
+#include <environment/ti/nand.h>
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
        DEFAULT_LINUX_BOOT_ENV \
@@ -65,6 +66,7 @@
        DEFAULT_FDT_TI_ARGS \
        DFUARGS \
        NETARGS \
+       NANDARGS \
 
 /*
  * SPL related defines.  The Public RAM memory map the ROM defines the
 
 #define CONFIG_SYS_SPL_ARGS_ADDR       (CONFIG_SYS_SDRAM_BASE + \
                                         (128 << 20))
-
 #ifdef CONFIG_SPL_BUILD
 #undef CONFIG_TIMER
 #endif
index 5d5394e3e53b9fed10733a267ab05d1084b4a066..0de40eddcb5b1ec6545a06fff373c99874addd24 100644 (file)
 #define CONFIG_I2C_MV
 #define CONFIG_SYS_I2C_SLAVE           0x0
 
-/*
- * SPI Flash configuration
- */
-
 /* Environment in SPI NOR flash */
 #define CONFIG_ENV_OFFSET              0x180000 /* as Marvell U-Boot version */
 #define CONFIG_ENV_SIZE                        (64 << 10) /* 64KiB */
index 038f6398eb6c690dd165a358f03882ec79ac8907..c7805cf36bf2c142cb974853dcd3cd1bd5b51ca1 100644 (file)
@@ -34,9 +34,6 @@
 # define CONFIG_WATCHDOG
 #endif
 
-/* SPI NOR flash default params, used by sf commands */
-#define CONFIG_SPI_FLASH_SPANSION
-
 /*
  * SDIO/MMC Card Configuration
  */
index 9f8ce8850f51d1958596a76edf5f2c1c06fb3def..96ff254f981254900123b9117471646da6931997 100644 (file)
 #ifndef _CPSW_H_
 #define _CPSW_H_
 
+/* reg offset */
+#define CPSW_HOST_PORT_OFFSET  0x108
+#define CPSW_SLAVE0_OFFSET     0x208
+#define CPSW_SLAVE1_OFFSET     0x308
+#define CPSW_SLAVE_SIZE                0x100
+#define CPSW_CPDMA_OFFSET      0x800
+#define CPSW_HW_STATS          0x900
+#define CPSW_STATERAM_OFFSET   0xa00
+#define CPSW_CPTS_OFFSET       0xc00
+#define CPSW_ALE_OFFSET                0xd00
+#define CPSW_SLIVER0_OFFSET    0xd80
+#define CPSW_SLIVER1_OFFSET    0xdc0
+#define CPSW_BD_OFFSET         0x2000
+#define CPSW_MDIO_DIV          0xff
+
+#define AM335X_GMII_SEL_OFFSET 0x630
+
 struct cpsw_slave_data {
        u32             slave_reg_ofs;
        u32             sliver_reg_ofs;
@@ -50,10 +67,16 @@ struct cpsw_platform_data {
        u32     active_slave;
        bool    rmii_clock_external;
        u8      version;
+       const char *phy_sel_compat;
+       u32     syscon_addr;
+       const char *macid_sel_compat;
 };
 
 int cpsw_register(struct cpsw_platform_data *data);
-int ti_cm_get_macid(struct udevice *dev, int slave, u8 *mac_addr);
+int ti_cm_get_macid_addr(struct udevice *dev, int slave,
+                        struct cpsw_platform_data *data);
+void ti_cm_get_macid(struct udevice *dev, struct cpsw_platform_data *data,
+                    u8 *mac_addr);
 int cpsw_get_slave_phy_addr(struct udevice *dev, int slave);
 
 #endif /* _CPSW_H_  */
index 1625b8bf34822b6e8f41f1dbdead56c8ce13bff6..c5955b56b36d80876e7cf6cd037a3d018909f1ef 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2015 Renesas Electronics Corp.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 
 #ifndef __DT_BINDINGS_CLOCK_R8A7790_CPG_MSSR_H__
index e8823410c01c5a09d0676ddf547c1821b42cf619..aadd06c566c043e7e1909a3dc23fa70514022de1 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2015 Renesas Electronics Corp.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 
 #ifndef __DT_BINDINGS_CLOCK_R8A7791_CPG_MSSR_H__
index 72ce85cb2f94b0abb206145d9332dc14a47f738c..829c44db0271c27a95b788a740bd728a733bb41b 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2015 Renesas Electronics Corp.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 
 #ifndef __DT_BINDINGS_CLOCK_R8A7792_CPG_MSSR_H__
index 7318d45d4e7e9888c41aa1fb66def087b4cb6ff4..49c66d8ed1782fc06d06000f6af96c8a2b464262 100644 (file)
@@ -1,16 +1,8 @@
-/*
+/* SPDX-License-Identifier: GPL-2.0
+ *
  * r8a7793 clock definition
  *
  * Copyright (C) 2014  Renesas Electronics Corporation
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 
 #ifndef __DT_BINDINGS_CLOCK_R8A7793_H__
index 8809b0f62d615457f07a463a3c4699d0276a0250..d1ff646c31f2355bf0e67d28c563a827a9df94a6 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2015 Renesas Electronics Corp.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 
 #ifndef __DT_BINDINGS_CLOCK_R8A7793_CPG_MSSR_H__
index 93e99c3ffc8dafebef94d0644cb15532c86ab1b4..649f005782d05213ae3760124e67e4913c5b419c 100644 (file)
@@ -1,11 +1,7 @@
-/*
+/* SPDX-License-Identifier: GPL-2.0+
+ *
  * Copyright (C) 2014 Renesas Electronics Corporation
  * Copyright 2013 Ideas On Board SPRL
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifndef __DT_BINDINGS_CLOCK_R8A7794_H__
index 9d720311ae3a229a324febbeeaf698f0ec977c5c..6314e23b51af5be9a019a89ac2791c03bf69c57a 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2015 Renesas Electronics Corp.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 
 #ifndef __DT_BINDINGS_CLOCK_R8A7794_CPG_MSSR_H__
index f047eaf261f34ac783b2187997894daffe552572..92b3e2a95179d25cb67367b5208d7989fdd28795 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2015 Renesas Electronics Corp.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 #ifndef __DT_BINDINGS_CLOCK_R8A7795_CPG_MSSR_H__
 #define __DT_BINDINGS_CLOCK_R8A7795_CPG_MSSR_H__
@@ -54,7 +50,7 @@
 #define R8A7795_CLK_CANFD              39
 #define R8A7795_CLK_HDMI               40
 #define R8A7795_CLK_CSI0               41
-#define R8A7795_CLK_CSIREF             42
+/* CLK_CSIREF was removed */
 #define R8A7795_CLK_CP                 43
 #define R8A7795_CLK_CPEX               44
 #define R8A7795_CLK_R                  45
index 1e5942695f0dd057e0e3976824e0205b357eb6b9..c0957cf458403bfba85699904085dafd072d07d2 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2016 Renesas Electronics Corp.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2016 Renesas Electronics Corp.
  */
 #ifndef __DT_BINDINGS_CLOCK_R8A7796_CPG_MSSR_H__
 #define __DT_BINDINGS_CLOCK_R8A7796_CPG_MSSR_H__
@@ -60,7 +56,7 @@
 #define R8A7796_CLK_CANFD              45
 #define R8A7796_CLK_HDMI               46
 #define R8A7796_CLK_CSI0               47
-#define R8A7796_CLK_CSIREF             48
+/* CLK_CSIREF was removed */
 #define R8A7796_CLK_CP                 49
 #define R8A7796_CLK_CPEX               50
 #define R8A7796_CLK_R                  51
index 4e8ae3dee5901b01374e6fd609e7e988d4107676..fd701c4e87cf0e22ba08fce5c9a2027307466644 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2017 Glider bvba
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2017 Glider bvba
  */
 #ifndef __DT_BINDINGS_CLOCK_R8A77995_CPG_MSSR_H__
 #define __DT_BINDINGS_CLOCK_R8A77995_CPG_MSSR_H__
@@ -39,8 +35,8 @@
 #define R8A77995_CLK_CRD2              24
 #define R8A77995_CLK_SD0H              25
 #define R8A77995_CLK_SD0               26
-#define R8A77995_CLK_SSP2              27
-#define R8A77995_CLK_SSP1              28
+/* CLK_SSP2 was removed */
+/* CLK_SSP1 was removed */
 #define R8A77995_CLK_RPC               29
 #define R8A77995_CLK_RPCD2             30
 #define R8A77995_CLK_ZA2               31
@@ -53,5 +49,6 @@
 #define R8A77995_CLK_LV0               38
 #define R8A77995_CLK_LV1               39
 #define R8A77995_CLK_CP                        40
+#define R8A77995_CLK_CPEX              41
 
 #endif /* __DT_BINDINGS_CLOCK_R8A77995_CPG_MSSR_H__ */
diff --git a/include/dt-bindings/dma/k3-udma.h b/include/dt-bindings/dma/k3-udma.h
new file mode 100644 (file)
index 0000000..670e123
--- /dev/null
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ *  Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com
+ */
+
+#ifndef __DT_TI_UDMA_H
+#define __DT_TI_UDMA_H
+
+#define UDMA_TR_MODE           0
+#define UDMA_PKT_MODE          1
+
+#define UDMA_DIR_TX            0
+#define UDMA_DIR_RX            1
+
+#define PSIL_STATIC_TR_NONE    0
+#define PSIL_STATIC_TR_XY      1
+#define PSIL_STATIC_TR_MCAN    2
+
+#define UDMA_PDMA_TR_XY(id)                            \
+       ti,psil-config##id {                            \
+               linux,udma-mode = <UDMA_TR_MODE>;       \
+               statictr-type = <PSIL_STATIC_TR_XY>;    \
+       }
+
+#define UDMA_PDMA_PKT_XY(id)                           \
+       ti,psil-config##id {                            \
+               linux,udma-mode = <UDMA_PKT_MODE>;      \
+               statictr-type = <PSIL_STATIC_TR_XY>;    \
+       }
+
+#endif /* __DT_TI_UDMA_H */
index 2732d6c0fb39ebd28ef4ec81d415fc0d0677c8e7..616f5ce400797062c90468248ca92ce6717e9c1d 100644 (file)
@@ -17,6 +17,7 @@
 #define AT91_PINCTRL_DIS_SCHMIT                (1 << 4)
 #define AT91_PINCTRL_OUTPUT            (1 << 7)
 #define AT91_PINCTRL_OUTPUT_VAL(x)     ((x & 0x1) << 8)
+#define AT91_PINCTRL_SLEWRATE          (1 << 9)
 #define AT91_PINCTRL_DEBOUNCE          (1 << 16)
 #define AT91_PINCTRL_DEBOUNCE_VAL(x)   (x << 17)
 
@@ -27,6 +28,9 @@
 #define AT91_PINCTRL_DRIVE_STRENGTH_MED                        (0x2 << 5)
 #define AT91_PINCTRL_DRIVE_STRENGTH_HI                 (0x3 << 5)
 
+#define AT91_PINCTRL_SLEWRATE_DIS      (0x0 << 9)
+#define AT91_PINCTRL_SLEWRATE_ENA      (0x1 << 9)
+
 #define AT91_PIOA      0
 #define AT91_PIOB      1
 #define AT91_PIOC      2
index 8647bfa6629bb576083dc394757dc4a821e0d890..5b0a10063548755167dafac24517c5dfe5f2161b 100644 (file)
@@ -333,6 +333,10 @@ struct efi_system_table {
        EFI_GUID(0x5b1b31a1, 0x9562, 0x11d2, \
                 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
 
+#define LOADED_IMAGE_DEVICE_PATH_GUID \
+       EFI_GUID(0xbc62157e, 0x3e33, 0x4fec, \
+                0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf)
+
 #define EFI_LOADED_IMAGE_PROTOCOL_REVISION 0x1000
 
 struct efi_loaded_image {
index 512880ab8fbf3df9dca2f3b030a1461cc020ee31..00b81c6010ff7ee3b4f82469f9997800cc821241 100644 (file)
@@ -135,6 +135,7 @@ extern const efi_guid_t efi_guid_event_group_reset_system;
 /* GUID of the device tree table */
 extern const efi_guid_t efi_guid_fdt;
 extern const efi_guid_t efi_guid_loaded_image;
+extern const efi_guid_t efi_guid_loaded_image_device_path;
 extern const efi_guid_t efi_guid_device_path_to_text_protocol;
 extern const efi_guid_t efi_simple_file_system_protocol_guid;
 extern const efi_guid_t efi_file_info_guid;
@@ -203,15 +204,11 @@ struct efi_object {
  * struct efi_loaded_image_obj - handle of a loaded image
  *
  * @header:            EFI object header
- * @reloc_base:                base address for the relocated image
- * @reloc_size:                size of the relocated image
  * @exit_jmp:          long jump buffer for returning form started image
  * @entry:             entry address of the relocated image
  */
 struct efi_loaded_image_obj {
        struct efi_object header;
-       void *reloc_base;
-       aligned_u64 reloc_size;
        efi_status_t exit_status;
        struct jmp_buf_data exit_jmp;
        EFIAPI efi_status_t (*entry)(efi_handle_t image_handle,
@@ -320,10 +317,19 @@ efi_status_t efi_create_handle(efi_handle_t *handle);
 void efi_delete_handle(efi_handle_t obj);
 /* Call this to validate a handle and find the EFI object for it */
 struct efi_object *efi_search_obj(const efi_handle_t handle);
+/* Load image */
+efi_status_t EFIAPI efi_load_image(bool boot_policy,
+                                  efi_handle_t parent_image,
+                                  struct efi_device_path *file_path,
+                                  void *source_buffer,
+                                  efi_uintn_t source_size,
+                                  efi_handle_t *image_handle);
 /* Start image */
 efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
                                    efi_uintn_t *exit_data_size,
                                    u16 **exit_data);
+/* Unload image */
+efi_status_t EFIAPI efi_unload_image(efi_handle_t image_handle);
 /* Find a protocol on a handle */
 efi_status_t efi_search_protocol(const efi_handle_t handle,
                                 const efi_guid_t *protocol_guid,
diff --git a/include/environment/ti/nand.h b/include/environment/ti/nand.h
new file mode 100644 (file)
index 0000000..f838cb3
--- /dev/null
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com
+ *
+ * Environment variable definitions for NAND on TI boards.
+ */
+
+#ifdef CONFIG_NAND
+#define NANDARGS \
+       "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
+       "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
+       "nandargs=setenv bootargs console=${console} " \
+               "${optargs} " \
+               "root=${nandroot} " \
+               "rootfstype=${nandrootfstype}\0" \
+       "nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048\0" \
+       "nandrootfstype=ubifs rootwait=1\0" \
+       "nandboot=echo Booting from nand ...; " \
+               "run nandargs; " \
+               "nand read ${fdtaddr} NAND.u-boot-spl-os; " \
+               "nand read ${loadaddr} NAND.kernel; " \
+               "bootz ${loadaddr} - ${fdtaddr}\0"
+#else
+#define NANDARGS ""
+#endif
+
index 24210113411a73f3b727277f59d491b952b55057..34585d407d06d9aa861ace1144af627163b77554 100644 (file)
@@ -117,6 +117,12 @@ struct ext_filesystem {
        struct blk_desc *dev_desc;
 };
 
+struct ext_block_cache {
+       char *buf;
+       lbaint_t block;
+       int size;
+};
+
 extern struct ext2_data *ext4fs_root;
 extern struct ext2fs_node *ext4fs_file;
 
@@ -128,10 +134,11 @@ extern int gindex;
 int ext4fs_init(void);
 void ext4fs_deinit(void);
 int ext4fs_filename_unlink(char *filename);
-int ext4fs_write(const char *fname, unsigned char *buffer,
-                unsigned long sizebytes);
+int ext4fs_write(const char *fname, const char *buffer,
+                                unsigned long sizebytes, int type);
 int ext4_write_file(const char *filename, void *buf, loff_t offset, loff_t len,
                    loff_t *actwrite);
+int ext4fs_create_link(const char *target, const char *fname);
 #endif
 
 struct ext_filesystem *get_fs(void);
@@ -146,11 +153,15 @@ int ext4fs_size(const char *filename, loff_t *size);
 void ext4fs_free_node(struct ext2fs_node *node, struct ext2fs_node *currroot);
 int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf);
 void ext4fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
-long int read_allocated_block(struct ext2_inode *inode, int fileblock);
+long int read_allocated_block(struct ext2_inode *inode, int fileblock,
+                             struct ext_block_cache *cache);
 int ext4fs_probe(struct blk_desc *fs_dev_desc,
                 disk_partition_t *fs_partition);
 int ext4_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
                   loff_t *actread);
 int ext4_read_superblock(char *buffer);
 int ext4fs_uuid(char *uuid_str);
+void ext_cache_init(struct ext_block_cache *cache);
+void ext_cache_fini(struct ext_block_cache *cache);
+int ext_cache_read(struct ext_block_cache *cache, lbaint_t block, int size);
 #endif
index b7e35cd87c55170d089cd960a6817a11764e0f76..ad00f79f203a469fe1b92ade5fa2e07fe513d0bb 100644 (file)
@@ -917,6 +917,26 @@ struct display_timing {
 int fdtdec_decode_display_timing(const void *blob, int node, int index,
                                 struct display_timing *config);
 
+/**
+ * fdtdec_setup_mem_size_base_fdt() - decode and setup gd->ram_size and
+ * gd->ram_start
+ *
+ * Decode the /memory 'reg' property to determine the size and start of the
+ * first memory bank, populate the global data with the size and start of the
+ * first bank of memory.
+ *
+ * This function should be called from a boards dram_init(). This helper
+ * function allows for boards to query the device tree for DRAM size and start
+ * address instead of hard coding the value in the case where the memory size
+ * and start address cannot be detected automatically.
+ *
+ * @param blob         FDT blob
+ *
+ * @return 0 if OK, -EINVAL if the /memory node or reg property is missing or
+ * invalid
+ */
+int fdtdec_setup_mem_size_base_fdt(const void *blob);
+
 /**
  * fdtdec_setup_mem_size_base() - decode and setup gd->ram_size and
  * gd->ram_start
@@ -935,6 +955,25 @@ int fdtdec_decode_display_timing(const void *blob, int node, int index,
  */
 int fdtdec_setup_mem_size_base(void);
 
+/**
+ * fdtdec_setup_memory_banksize_fdt() - decode and populate gd->bd->bi_dram
+ *
+ * Decode the /memory 'reg' property to determine the address and size of the
+ * memory banks. Use this data to populate the global data board info with the
+ * phys address and size of memory banks.
+ *
+ * This function should be called from a boards dram_init_banksize(). This
+ * helper function allows for boards to query the device tree for memory bank
+ * information instead of hard coding the information in cases where it cannot
+ * be detected automatically.
+ *
+ * @param blob         FDT blob
+ *
+ * @return 0 if OK, -EINVAL if the /memory node or reg property is missing or
+ * invalid
+ */
+int fdtdec_setup_memory_banksize_fdt(const void *blob);
+
 /**
  * fdtdec_setup_memory_banksize() - decode and populate gd->bd->bi_dram
  *
index aa3604db8dc4c5ae77a23b059a7edb027e48e43a..6854597700ff4d7298fec81f643ec9c249209b99 100644 (file)
@@ -191,6 +191,8 @@ int do_rm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
                int fstype);
 int do_mkdir(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
                int fstype);
+int do_ln(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
+         int fstype);
 
 /*
  * Determine the UUID of the specified filesystem and print it. Optionally it is
index ccffc195527547c7d46ae8809b373212eb75f181..a5c760c711edcca9e278e478cd0c4babbef80b80 100644 (file)
@@ -68,9 +68,11 @@ struct dm_i2c_chip {
  * I2C bus udevice.
  *
  * @speed_hz: Bus speed in hertz (typically 100000)
+ * @max_transaction_bytes: Maximal size of single I2C transfer
  */
 struct dm_i2c_bus {
        int speed_hz;
+       int max_transaction_bytes;
 };
 
 /*
diff --git a/include/linux/soc/ti/cppi5.h b/include/linux/soc/ti/cppi5.h
new file mode 100644 (file)
index 0000000..34038b3
--- /dev/null
@@ -0,0 +1,995 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * CPPI5 descriptors interface
+ *
+ * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com
+ */
+
+#ifndef __TI_CPPI5_H__
+#define __TI_CPPI5_H__
+
+#include <hexdump.h>
+#include <linux/bitops.h>
+
+/**
+ * Descriptor header, present in all types of descriptors
+ */
+struct cppi5_desc_hdr_t {
+       u32 pkt_info0;  /* Packet info word 0 (n/a in Buffer desc) */
+       u32 pkt_info1;  /* Packet info word 1 (n/a in Buffer desc) */
+       u32 pkt_info2;  /* Packet info word 2 Buffer reclamation info */
+       u32 src_dst_tag; /* Packet info word 3 (n/a in Buffer desc) */
+} __packed;
+
+/**
+ * Host-mode packet and buffer descriptor definition
+ */
+struct cppi5_host_desc_t {
+       struct cppi5_desc_hdr_t hdr;
+       u64 next_desc;  /* w4/5: Linking word */
+       u64 buf_ptr;    /* w6/7: Buffer pointer */
+       u32 buf_info1;  /* w8: Buffer valid data length */
+       u32 org_buf_len; /* w9: Original buffer length */
+       u64 org_buf_ptr; /* w10/11: Original buffer pointer */
+       u32 epib[0];    /* Extended Packet Info Data (optional, 4 words) */
+       /*
+        * Protocol Specific Data (optional, 0-128 bytes in multiples of 4),
+        * and/or Other Software Data (0-N bytes, optional)
+        */
+} __packed;
+
+#define CPPI5_DESC_MIN_ALIGN                   (16U)
+
+#define CPPI5_INFO0_HDESC_EPIB_SIZE            (16U)
+#define CPPI5_INFO0_HDESC_PSDATA_MAX_SIZE      (128U)
+
+#define CPPI5_INFO0_HDESC_TYPE_SHIFT           (30U)
+#define CPPI5_INFO0_HDESC_TYPE_MASK            GENMASK(31, 30)
+#define   CPPI5_INFO0_DESC_TYPE_VAL_HOST       (1U)
+#define   CPPI5_INFO0_DESC_TYPE_VAL_MONO       (2U)
+#define   CPPI5_INFO0_DESC_TYPE_VAL_TR         (3U)
+#define CPPI5_INFO0_HDESC_EPIB_PRESENT         BIT(29)
+/*
+ * Protocol Specific Words location:
+ * 0 - located in the descriptor,
+ * 1 = located in the SOP Buffer immediately prior to the data.
+ */
+#define CPPI5_INFO0_HDESC_PSINFO_LOCATION      BIT(28)
+#define CPPI5_INFO0_HDESC_PSINFO_SIZE_SHIFT    (22U)
+#define CPPI5_INFO0_HDESC_PSINFO_SIZE_MASK     GENMASK(27, 22)
+#define CPPI5_INFO0_HDESC_PKTLEN_SHIFT         (0)
+#define CPPI5_INFO0_HDESC_PKTLEN_MASK          GENMASK(21, 0)
+
+#define CPPI5_INFO1_DESC_PKTERROR_SHIFT                (28U)
+#define CPPI5_INFO1_DESC_PKTERROR_MASK         GENMASK(31, 28)
+#define CPPI5_INFO1_HDESC_PSFLGS_SHIFT         (24U)
+#define CPPI5_INFO1_HDESC_PSFLGS_MASK          GENMASK(27, 24)
+#define CPPI5_INFO1_DESC_PKTID_SHIFT           (14U)
+#define CPPI5_INFO1_DESC_PKTID_MASK            GENMASK(23, 14)
+#define CPPI5_INFO1_DESC_FLOWID_SHIFT          (0)
+#define CPPI5_INFO1_DESC_FLOWID_MASK           GENMASK(13, 0)
+
+#define CPPI5_INFO2_HDESC_PKTTYPE_SHIFT                (27U)
+#define CPPI5_INFO2_HDESC_PKTTYPE_MASK         GENMASK(31, 27)
+/* Return Policy: 0 - Entire packet 1 - Each buffer */
+#define CPPI5_INFO2_HDESC_RETPOLICY            BIT(18)
+/*
+ * Early Return:
+ * 0 = desc pointers should be returned after all reads have been completed
+ * 1 = desc pointers should be returned immediately upon fetching
+ * the descriptor and beginning to transfer data.
+ */
+#define CPPI5_INFO2_HDESC_EARLYRET             BIT(17)
+/*
+ * Return Push Policy:
+ * 0 = Descriptor must be returned to tail of queue
+ * 1 = Descriptor must be returned to head of queue
+ */
+#define CPPI5_INFO2_DESC_RETPUSHPOLICY         BIT(16)
+#define CPPI5_INFO2_DESC_RETQ_SHIFT            (0)
+#define CPPI5_INFO2_DESC_RETQ_MASK             GENMASK(15, 0)
+
+#define CPPI5_INFO3_DESC_SRCTAG_SHIFT          (16U)
+#define CPPI5_INFO3_DESC_SRCTAG_MASK           GENMASK(31, 16)
+#define CPPI5_INFO3_DESC_DSTTAG_SHIFT          (0)
+#define CPPI5_INFO3_DESC_DSTTAG_MASK           GENMASK(15, 0)
+
+#define CPPI5_BUFINFO1_HDESC_DATA_LEN_SHIFT    (0)
+#define CPPI5_BUFINFO1_HDESC_DATA_LEN_MASK     GENMASK(27, 0)
+
+#define CPPI5_OBUFINFO0_HDESC_BUF_LEN_SHIFT    (0)
+#define CPPI5_OBUFINFO0_HDESC_BUF_LEN_MASK     GENMASK(27, 0)
+
+/*
+ * Host Packet Descriptor Extended Packet Info Block
+ */
+struct cppi5_desc_epib_t {
+       u32 timestamp;  /* w0: application specific timestamp */
+       u32 sw_info0;   /* w1: Software Info 0 */
+       u32 sw_info1;   /* w2: Software Info 1 */
+       u32 sw_info2;   /* w3: Software Info 2 */
+};
+
+/**
+ * Monolithic-mode packet descriptor
+ */
+struct cppi5_monolithic_desc_t {
+       struct cppi5_desc_hdr_t hdr;
+       u32 epib[0];    /* Extended Packet Info Data (optional, 4 words) */
+       /*
+        * Protocol Specific Data (optional, 0-128 bytes in multiples of 4),
+        *  and/or Other Software Data (0-N bytes, optional)
+        */
+};
+
+#define CPPI5_INFO2_MDESC_DATA_OFFSET_SHIFT    (18U)
+#define CPPI5_INFO2_MDESC_DATA_OFFSET_MASK     GENMASK(26, 18)
+
+/*
+ * Reload Enable:
+ * 0 = Finish the packet and place the descriptor back on the return queue
+ * 1 = Vector to the Reload Index and resume processing
+ */
+#define CPPI5_INFO0_TRDESC_RLDCNT_SHIFT                (20U)
+#define CPPI5_INFO0_TRDESC_RLDCNT_MASK         GENMASK(28, 20)
+#define CPPI5_INFO0_TRDESC_RLDCNT_MAX          (0x1ff)
+#define CPPI5_INFO0_TRDESC_RLDCNT_INFINITE     CPPI5_INFO0_TRDESC_RLDCNT_MAX
+#define CPPI5_INFO0_TRDESC_RLDIDX_SHIFT                (14U)
+#define CPPI5_INFO0_TRDESC_RLDIDX_MASK         GENMASK(19, 14)
+#define CPPI5_INFO0_TRDESC_RLDIDX_MAX          (0x3f)
+#define CPPI5_INFO0_TRDESC_LASTIDX_SHIFT       (0)
+#define CPPI5_INFO0_TRDESC_LASTIDX_MASK                GENMASK(13, 0)
+
+#define CPPI5_INFO1_TRDESC_RECSIZE_SHIFT       (24U)
+#define CPPI5_INFO1_TRDESC_RECSIZE_MASK                GENMASK(26, 24)
+#define   CPPI5_INFO1_TRDESC_RECSIZE_VAL_16B   (0)
+#define   CPPI5_INFO1_TRDESC_RECSIZE_VAL_32B   (1U)
+#define   CPPI5_INFO1_TRDESC_RECSIZE_VAL_64B   (2U)
+#define   CPPI5_INFO1_TRDESC_RECSIZE_VAL_128B  (3U)
+
+static inline void cppi5_desc_dump(void *desc, u32 size)
+{
+       print_hex_dump(KERN_ERR "dump udmap_desc: ", DUMP_PREFIX_NONE,
+                      32, 4, desc, size, false);
+}
+
+/**
+ * cppi5_desc_get_type - get descriptor type
+ * @desc_hdr: packet descriptor/TR header
+ *
+ * Returns descriptor type:
+ * CPPI5_INFO0_DESC_TYPE_VAL_HOST
+ * CPPI5_INFO0_DESC_TYPE_VAL_MONO
+ * CPPI5_INFO0_DESC_TYPE_VAL_TR
+ */
+static inline u32 cppi5_desc_get_type(struct cppi5_desc_hdr_t *desc_hdr)
+{
+       WARN_ON(!desc_hdr);
+
+       return (desc_hdr->pkt_info0 & CPPI5_INFO0_HDESC_TYPE_MASK) >>
+               CPPI5_INFO0_HDESC_TYPE_SHIFT;
+}
+
+/**
+ * cppi5_desc_get_errflags - get Error Flags from Desc
+ * @desc_hdr: packet/TR descriptor header
+ *
+ * Returns Error Flags from Packet/TR Descriptor
+ */
+static inline u32 cppi5_desc_get_errflags(struct cppi5_desc_hdr_t *desc_hdr)
+{
+       WARN_ON(!desc_hdr);
+
+       return (desc_hdr->pkt_info1 & CPPI5_INFO1_DESC_PKTERROR_MASK) >>
+               CPPI5_INFO1_DESC_PKTERROR_SHIFT;
+}
+
+/**
+ * cppi5_desc_get_pktids - get Packet and Flow ids from Desc
+ * @desc_hdr: packet/TR descriptor header
+ * @pkt_id: Packet ID
+ * @flow_id: Flow ID
+ *
+ * Returns Packet and Flow ids from packet/TR descriptor
+ */
+static inline void cppi5_desc_get_pktids(struct cppi5_desc_hdr_t *desc_hdr,
+                                        u32 *pkt_id, u32 *flow_id)
+{
+       WARN_ON(!desc_hdr);
+
+       *pkt_id = (desc_hdr->pkt_info1 & CPPI5_INFO1_DESC_PKTID_MASK) >>
+                  CPPI5_INFO1_DESC_PKTID_SHIFT;
+       *flow_id = (desc_hdr->pkt_info1 & CPPI5_INFO1_DESC_FLOWID_MASK) >>
+                   CPPI5_INFO1_DESC_FLOWID_SHIFT;
+}
+
+/**
+ * cppi5_desc_set_pktids - set Packet and Flow ids in Desc
+ * @desc_hdr: packet/TR descriptor header
+ * @pkt_id: Packet ID
+ * @flow_id: Flow ID
+ */
+static inline void cppi5_desc_set_pktids(struct cppi5_desc_hdr_t *desc_hdr,
+                                        u32 pkt_id, u32 flow_id)
+{
+       WARN_ON(!desc_hdr);
+
+       desc_hdr->pkt_info1 |= (pkt_id << CPPI5_INFO1_DESC_PKTID_SHIFT) &
+                               CPPI5_INFO1_DESC_PKTID_MASK;
+       desc_hdr->pkt_info1 |= (flow_id << CPPI5_INFO1_DESC_FLOWID_SHIFT) &
+                               CPPI5_INFO1_DESC_FLOWID_MASK;
+}
+
+/**
+ * cppi5_desc_set_retpolicy - set Packet Return Policy in Desc
+ * @desc_hdr: packet/TR descriptor header
+ * @flags: fags, supported values
+ *  CPPI5_INFO2_HDESC_RETPOLICY
+ *  CPPI5_INFO2_HDESC_EARLYRET
+ *  CPPI5_INFO2_DESC_RETPUSHPOLICY
+ * @return_ring_id: Packet Return Queue/Ring id, value 0xFFFF reserved
+ */
+static inline void cppi5_desc_set_retpolicy(struct cppi5_desc_hdr_t *desc_hdr,
+                                           u32 flags, u32 return_ring_id)
+{
+       WARN_ON(!desc_hdr);
+
+       desc_hdr->pkt_info2 |= flags;
+       desc_hdr->pkt_info2 |= return_ring_id & CPPI5_INFO2_DESC_RETQ_MASK;
+}
+
+/**
+ * cppi5_desc_get_tags_ids - get Packet Src/Dst Tags from Desc
+ * @desc_hdr: packet/TR descriptor header
+ * @src_tag_id: Source Tag
+ * @dst_tag_id: Dest Tag
+ *
+ * Returns Packet Src/Dst Tags from packet/TR descriptor
+ */
+static inline void cppi5_desc_get_tags_ids(struct cppi5_desc_hdr_t *desc_hdr,
+                                          u32 *src_tag_id, u32 *dst_tag_id)
+{
+       WARN_ON(!desc_hdr);
+
+       if (src_tag_id)
+               *src_tag_id = (desc_hdr->src_dst_tag &
+                             CPPI5_INFO3_DESC_SRCTAG_MASK) >>
+                             CPPI5_INFO3_DESC_SRCTAG_SHIFT;
+       if (dst_tag_id)
+               *dst_tag_id = desc_hdr->src_dst_tag &
+                             CPPI5_INFO3_DESC_DSTTAG_MASK;
+}
+
+/**
+ * cppi5_desc_set_tags_ids - set Packet Src/Dst Tags in HDesc
+ * @desc_hdr: packet/TR descriptor header
+ * @src_tag_id: Source Tag
+ * @dst_tag_id: Dest Tag
+ *
+ * Returns Packet Src/Dst Tags from packet/TR descriptor
+ */
+static inline void cppi5_desc_set_tags_ids(struct cppi5_desc_hdr_t *desc_hdr,
+                                          u32 src_tag_id, u32 dst_tag_id)
+{
+       WARN_ON(!desc_hdr);
+
+       desc_hdr->src_dst_tag = (src_tag_id << CPPI5_INFO3_DESC_SRCTAG_SHIFT) &
+                               CPPI5_INFO3_DESC_SRCTAG_MASK;
+       desc_hdr->src_dst_tag |= dst_tag_id & CPPI5_INFO3_DESC_DSTTAG_MASK;
+}
+
+/**
+ * cppi5_hdesc_calc_size - Calculate Host Packet Descriptor size
+ * @epib: is EPIB present
+ * @psdata_size: PSDATA size
+ * @sw_data_size: SWDATA size
+ *
+ * Returns required Host Packet Descriptor size
+ * 0 - if PSDATA > CPPI5_INFO0_HDESC_PSDATA_MAX_SIZE
+ */
+static inline u32 cppi5_hdesc_calc_size(bool epib, u32 psdata_size,
+                                       u32 sw_data_size)
+{
+       u32 desc_size;
+
+       if (psdata_size > CPPI5_INFO0_HDESC_PSDATA_MAX_SIZE)
+               return 0;
+       //TODO_GS: align
+       desc_size = sizeof(struct cppi5_host_desc_t) + psdata_size +
+                   sw_data_size;
+
+       if (epib)
+               desc_size += CPPI5_INFO0_HDESC_EPIB_SIZE;
+
+       return ALIGN(desc_size, CPPI5_DESC_MIN_ALIGN);
+}
+
+/**
+ * cppi5_hdesc_init - Init Host Packet Descriptor size
+ * @desc: Host packet descriptor
+ * @flags: supported values
+ *     CPPI5_INFO0_HDESC_EPIB_PRESENT
+ *     CPPI5_INFO0_HDESC_PSINFO_LOCATION
+ * @psdata_size: PSDATA size
+ *
+ * Returns required Host Packet Descriptor size
+ * 0 - if PSDATA > CPPI5_INFO0_HDESC_PSDATA_MAX_SIZE
+ */
+static inline void cppi5_hdesc_init(struct cppi5_host_desc_t *desc, u32 flags,
+                                   u32 psdata_size)
+{
+       WARN_ON(!desc);
+       WARN_ON(psdata_size > CPPI5_INFO0_HDESC_PSDATA_MAX_SIZE);
+       WARN_ON(flags & ~(CPPI5_INFO0_HDESC_EPIB_PRESENT |
+                         CPPI5_INFO0_HDESC_PSINFO_LOCATION));
+
+       desc->hdr.pkt_info0 = (CPPI5_INFO0_DESC_TYPE_VAL_HOST <<
+                              CPPI5_INFO0_HDESC_TYPE_SHIFT) | (flags);
+       desc->hdr.pkt_info0 |= ((psdata_size >> 2) <<
+                               CPPI5_INFO0_HDESC_PSINFO_SIZE_SHIFT) &
+                               CPPI5_INFO0_HDESC_PSINFO_SIZE_MASK;
+       desc->next_desc = 0;
+}
+
+/**
+ * cppi5_hdesc_update_flags - Replace descriptor flags
+ * @desc: Host packet descriptor
+ * @flags: supported values
+ *     CPPI5_INFO0_HDESC_EPIB_PRESENT
+ *     CPPI5_INFO0_HDESC_PSINFO_LOCATION
+ */
+static inline void cppi5_hdesc_update_flags(struct cppi5_host_desc_t *desc,
+                                           u32 flags)
+{
+       WARN_ON(!desc);
+       WARN_ON(flags & ~(CPPI5_INFO0_HDESC_EPIB_PRESENT |
+                         CPPI5_INFO0_HDESC_PSINFO_LOCATION));
+
+       desc->hdr.pkt_info0 &= ~(CPPI5_INFO0_HDESC_EPIB_PRESENT |
+                                CPPI5_INFO0_HDESC_PSINFO_LOCATION);
+       desc->hdr.pkt_info0 |= flags;
+}
+
+/**
+ * cppi5_hdesc_update_psdata_size - Replace PSdata size
+ * @desc: Host packet descriptor
+ * @psdata_size: PSDATA size
+ */
+static inline void cppi5_hdesc_update_psdata_size(
+                               struct cppi5_host_desc_t *desc, u32 psdata_size)
+{
+       WARN_ON(!desc);
+       WARN_ON(psdata_size > CPPI5_INFO0_HDESC_PSDATA_MAX_SIZE);
+
+       desc->hdr.pkt_info0 &= ~CPPI5_INFO0_HDESC_PSINFO_SIZE_MASK;
+       desc->hdr.pkt_info0 |= ((psdata_size >> 2) <<
+                               CPPI5_INFO0_HDESC_PSINFO_SIZE_SHIFT) &
+                               CPPI5_INFO0_HDESC_PSINFO_SIZE_MASK;
+}
+
+/**
+ * cppi5_hdesc_get_psdata_size - get PSdata size in bytes
+ * @desc: Host packet descriptor
+ */
+static inline u32 cppi5_hdesc_get_psdata_size(struct cppi5_host_desc_t *desc)
+{
+       u32 psdata_size = 0;
+
+       WARN_ON(!desc);
+
+       if (!(desc->hdr.pkt_info0 & CPPI5_INFO0_HDESC_PSINFO_LOCATION))
+               psdata_size = (desc->hdr.pkt_info0 &
+                              CPPI5_INFO0_HDESC_PSINFO_SIZE_MASK) >>
+                              CPPI5_INFO0_HDESC_PSINFO_SIZE_SHIFT;
+
+       return (psdata_size << 2);
+}
+
+/**
+ * cppi5_hdesc_get_pktlen - get Packet Length from HDesc
+ * @desc: Host packet descriptor
+ *
+ * Returns Packet Length from Host Packet Descriptor
+ */
+static inline u32 cppi5_hdesc_get_pktlen(struct cppi5_host_desc_t *desc)
+{
+       WARN_ON(!desc);
+
+       return (desc->hdr.pkt_info0 & CPPI5_INFO0_HDESC_PKTLEN_MASK);
+}
+
+/**
+ * cppi5_hdesc_set_pktlen - set Packet Length in HDesc
+ * @desc: Host packet descriptor
+ */
+static inline void cppi5_hdesc_set_pktlen(struct cppi5_host_desc_t *desc,
+                                         u32 pkt_len)
+{
+       WARN_ON(!desc);
+
+       desc->hdr.pkt_info0 |= (pkt_len & CPPI5_INFO0_HDESC_PKTLEN_MASK);
+}
+
+/**
+ * cppi5_hdesc_get_psflags - get Protocol Specific Flags from HDesc
+ * @desc: Host packet descriptor
+ *
+ * Returns Protocol Specific Flags from Host Packet Descriptor
+ */
+static inline u32 cppi5_hdesc_get_psflags(struct cppi5_host_desc_t *desc)
+{
+       WARN_ON(!desc);
+
+       return (desc->hdr.pkt_info1 & CPPI5_INFO1_HDESC_PSFLGS_MASK) >>
+               CPPI5_INFO1_HDESC_PSFLGS_SHIFT;
+}
+
+/**
+ * cppi5_hdesc_set_psflags - set Protocol Specific Flags in HDesc
+ * @desc: Host packet descriptor
+ */
+static inline void cppi5_hdesc_set_psflags(struct cppi5_host_desc_t *desc,
+                                          u32 ps_flags)
+{
+       WARN_ON(!desc);
+
+       desc->hdr.pkt_info1 |= (ps_flags <<
+                               CPPI5_INFO1_HDESC_PSFLGS_SHIFT) &
+                               CPPI5_INFO1_HDESC_PSFLGS_MASK;
+}
+
+/**
+ * cppi5_hdesc_get_errflags - get Packet Type from HDesc
+ * @desc: Host packet descriptor
+ */
+static inline u32 cppi5_hdesc_get_pkttype(struct cppi5_host_desc_t *desc)
+{
+       WARN_ON(!desc);
+
+       return (desc->hdr.pkt_info2 & CPPI5_INFO2_HDESC_PKTTYPE_MASK) >>
+               CPPI5_INFO2_HDESC_PKTTYPE_SHIFT;
+}
+
+/**
+ * cppi5_hdesc_get_errflags - set Packet Type in HDesc
+ * @desc: Host packet descriptor
+ * @pkt_type: Packet Type
+ */
+static inline void cppi5_hdesc_set_pkttype(struct cppi5_host_desc_t *desc,
+                                          u32 pkt_type)
+{
+       WARN_ON(!desc);
+       desc->hdr.pkt_info2 |=
+                       (pkt_type << CPPI5_INFO2_HDESC_PKTTYPE_SHIFT) &
+                        CPPI5_INFO2_HDESC_PKTTYPE_MASK;
+}
+
+/**
+ * cppi5_hdesc_attach_buf - attach buffer to HDesc
+ * @desc: Host packet descriptor
+ * @buf: Buffer physical address
+ * @buf_data_len: Buffer length
+ * @obuf: Original Buffer physical address
+ * @obuf_len: Original Buffer length
+ *
+ * Attaches buffer to Host Packet Descriptor
+ */
+static inline void cppi5_hdesc_attach_buf(struct cppi5_host_desc_t *desc,
+                                         dma_addr_t buf, u32 buf_data_len,
+                                         dma_addr_t obuf, u32 obuf_len)
+{
+       WARN_ON(!desc);
+       WARN_ON(!buf && !obuf);
+
+       desc->buf_ptr = buf;
+       desc->buf_info1 = buf_data_len & CPPI5_BUFINFO1_HDESC_DATA_LEN_MASK;
+       desc->org_buf_ptr = obuf;
+       desc->org_buf_len = obuf_len & CPPI5_OBUFINFO0_HDESC_BUF_LEN_MASK;
+}
+
+static inline void cppi5_hdesc_get_obuf(struct cppi5_host_desc_t *desc,
+                                       dma_addr_t *obuf, u32 *obuf_len)
+{
+       WARN_ON(!desc);
+       WARN_ON(!obuf);
+       WARN_ON(!obuf_len);
+
+       *obuf = desc->org_buf_ptr;
+       *obuf_len = desc->org_buf_len & CPPI5_OBUFINFO0_HDESC_BUF_LEN_MASK;
+}
+
+static inline void cppi5_hdesc_reset_to_original(struct cppi5_host_desc_t *desc)
+{
+       WARN_ON(!desc);
+
+       desc->buf_ptr = desc->org_buf_ptr;
+       desc->buf_info1 = desc->org_buf_len;
+}
+
+/**
+ * cppi5_hdesc_link_hbdesc - link Host Buffer Descriptor to HDesc
+ * @desc: Host Packet Descriptor
+ * @buf_desc: Host Buffer Descriptor physical address
+ *
+ * add and link Host Buffer Descriptor to HDesc
+ */
+static inline void cppi5_hdesc_link_hbdesc(struct cppi5_host_desc_t *desc,
+                                          dma_addr_t hbuf_desc)
+{
+       WARN_ON(!desc);
+       WARN_ON(!hbuf_desc);
+
+       desc->next_desc = hbuf_desc;
+}
+
+static inline dma_addr_t cppi5_hdesc_get_next_hbdesc(
+                               struct cppi5_host_desc_t *desc)
+{
+       WARN_ON(!desc);
+
+       return (dma_addr_t)desc->next_desc;
+}
+
+static inline void cppi5_hdesc_reset_hbdesc(struct cppi5_host_desc_t *desc)
+{
+       WARN_ON(!desc);
+
+       desc->hdr = (struct cppi5_desc_hdr_t) { 0 };
+       desc->next_desc = 0;
+}
+
+/**
+ * cppi5_hdesc_epib_present -  check if EPIB present
+ * @desc_hdr: packet descriptor/TR header
+ *
+ * Returns true if EPIB present in the packet
+ */
+static inline bool cppi5_hdesc_epib_present(struct cppi5_desc_hdr_t *desc_hdr)
+{
+       WARN_ON(!desc_hdr);
+       return !!(desc_hdr->pkt_info0 & CPPI5_INFO0_HDESC_EPIB_PRESENT);
+}
+
+/**
+ * cppi5_hdesc_get_psdata -  Get pointer on PSDATA
+ * @desc: Host packet descriptor
+ *
+ * Returns pointer on PSDATA in HDesc.
+ * NULL - if ps_data placed at the start of data buffer.
+ */
+static inline void *cppi5_hdesc_get_psdata(struct cppi5_host_desc_t *desc)
+{
+       u32 psdata_size;
+       void *psdata;
+
+       WARN_ON(!desc);
+
+       if (desc->hdr.pkt_info0 & CPPI5_INFO0_HDESC_PSINFO_LOCATION)
+               return NULL;
+
+       psdata_size = (desc->hdr.pkt_info0 &
+                      CPPI5_INFO0_HDESC_PSINFO_SIZE_MASK) >>
+                      CPPI5_INFO0_HDESC_PSINFO_SIZE_SHIFT;
+
+       if (!psdata_size)
+               return NULL;
+
+       psdata = &desc->epib;
+
+       if (cppi5_hdesc_epib_present(&desc->hdr))
+               psdata += CPPI5_INFO0_HDESC_EPIB_SIZE;
+
+       return psdata;
+}
+
+static inline u32 *cppi5_hdesc_get_psdata32(struct cppi5_host_desc_t *desc)
+{
+       return (u32 *)cppi5_hdesc_get_psdata(desc);
+}
+
+/**
+ * cppi5_hdesc_get_swdata -  Get pointer on swdata
+ * @desc: Host packet descriptor
+ *
+ * Returns pointer on SWDATA in HDesc.
+ * NOTE. It's caller responsibility to be sure hdesc actually has swdata.
+ */
+static inline void *cppi5_hdesc_get_swdata(struct cppi5_host_desc_t *desc)
+{
+       u32 psdata_size = 0;
+       void *swdata;
+
+       WARN_ON(!desc);
+
+       if (!(desc->hdr.pkt_info0 & CPPI5_INFO0_HDESC_PSINFO_LOCATION))
+               psdata_size = (desc->hdr.pkt_info0 &
+                              CPPI5_INFO0_HDESC_PSINFO_SIZE_MASK) >>
+                              CPPI5_INFO0_HDESC_PSINFO_SIZE_SHIFT;
+
+       swdata = &desc->epib;
+
+       if (cppi5_hdesc_epib_present(&desc->hdr))
+               swdata += CPPI5_INFO0_HDESC_EPIB_SIZE;
+
+       swdata += (psdata_size << 2);
+
+       return swdata;
+}
+
+/* ================================== TR ================================== */
+
+#define CPPI5_TR_TYPE_SHIFT                    (0U)
+#define CPPI5_TR_TYPE_MASK                     GENMASK(3, 0)
+#define CPPI5_TR_STATIC                                BIT(4)
+#define CPPI5_TR_WAIT                          BIT(5)
+#define CPPI5_TR_EVENT_SIZE_SHIFT              (6U)
+#define CPPI5_TR_EVENT_SIZE_MASK               GENMASK(7, 6)
+#define CPPI5_TR_TRIGGER0_SHIFT                        (8U)
+#define CPPI5_TR_TRIGGER0_MASK                 GENMASK(9, 8)
+#define CPPI5_TR_TRIGGER0_TYPE_SHIFT           (10U)
+#define CPPI5_TR_TRIGGER0_TYPE_MASK            GENMASK(11, 10)
+#define CPPI5_TR_TRIGGER1_SHIFT                        (12U)
+#define CPPI5_TR_TRIGGER1_MASK                 GENMASK(13, 12)
+#define CPPI5_TR_TRIGGER1_TYPE_SHIFT           (14U)
+#define CPPI5_TR_TRIGGER1_TYPE_MASK            GENMASK(15, 14)
+#define CPPI5_TR_CMD_ID_SHIFT                  (16U)
+#define CPPI5_TR_CMD_ID_MASK                   GENMASK(23, 16)
+#define CPPI5_TR_CSF_FLAGS_SHIFT               (24U)
+#define CPPI5_TR_CSF_FLAGS_MASK                        GENMASK(31, 24)
+#define   CPPI5_TR_CSF_SA_INDIRECT             BIT(0)
+#define   CPPI5_TR_CSF_DA_INDIRECT             BIT(1)
+#define   CPPI5_TR_CSF_SUPR_EVT                        BIT(2)
+#define   CPPI5_TR_CSF_EOL_ADV_SHIFT           (4U)
+#define   CPPI5_TR_CSF_EOL_ADV_MASK            GENMASK(6, 4)
+#define   CPPI5_TR_CSF_EOP                     BIT(7)
+
+/* Udmap TR flags Type field specifies the type of TR. */
+enum cppi5_tr_types {
+       /* type0: One dimensional data move */
+       CPPI5_TR_TYPE0 = 0,
+       /* type1: Two dimensional data move */
+       CPPI5_TR_TYPE1,
+       /* type2: Three dimensional data move */
+       CPPI5_TR_TYPE2,
+       /* type3: Four dimensional data move */
+       CPPI5_TR_TYPE3,
+       /* type4: Four dimensional data move with data formatting */
+       CPPI5_TR_TYPE4,
+       /* type5: Four dimensional Cache Warm */
+       CPPI5_TR_TYPE5,
+       /* type6-7: Reserved */
+       /* type8: Four Dimensional Block Move */
+       CPPI5_TR_TYPE8 = 8,
+       /* type9: Four Dimensional Block Move with Repacking */
+       CPPI5_TR_TYPE9,
+       /* type10: Two Dimensional Block Move */
+       CPPI5_TR_TYPE10,
+       /* type11: Two Dimensional Block Move with Repacking */
+       CPPI5_TR_TYPE11,
+       /* type12-14: Reserved */
+       /* type15 Four Dimensional Block Move with Repacking and Indirection */
+       CPPI5_TR_TYPE15 = 15,
+       CPPI5_TR_TYPE_MAX
+};
+
+/*
+ * Udmap TR Flags EVENT_SIZE field specifies when an event is generated
+ * for each TR.
+ */
+enum cppi5_tr_event_size {
+       /* When TR is complete and all status for the TR has been received */
+       CPPI5_TR_EVENT_SIZE_COMPLETION,
+       /*
+        * Type 0: when the last data transaction is sent for the TR;
+        * Type 1-11: when ICNT1 is decremented
+        */
+       CPPI5_TR_EVENT_SIZE_ICNT1_DEC,
+       /*
+        * Type 0-1,10-11: when the last data transaction is sent for the TR;
+        * All other types: when ICNT2 is decremented
+        */
+       CPPI5_TR_EVENT_SIZE_ICNT2_DEC,
+       /*
+        * Type 0-2,10-11: when the last data transaction is sent for the TR;
+        * All other types: when ICNT3 is decremented
+        */
+       CPPI5_TR_EVENT_SIZE_ICNT3_DEC,
+       CPPI5_TR_EVENT_SIZE_MAX
+};
+
+/*
+ * Udmap TR Flags TRIGGERx field specifies the type of trigger used to
+ * enable the TR to transfer data as specified by TRIGGERx_TYPE field.
+ */
+enum cppi5_tr_trigger {
+       CPPI5_TR_TRIGGER_NONE,          /* No Trigger */
+       CPPI5_TR_TRIGGER_GLOBAL0,               /* Global Trigger 0 */
+       CPPI5_TR_TRIGGER_GLOBAL1,               /* Global Trigger 1 */
+       CPPI5_TR_TRIGGER_LOCAL_EVENT,   /* Local Event */
+       CPPI5_TR_TRIGGER_MAX
+};
+
+/*
+ * Udmap TR Flags TRIGGERx_TYPE field specifies the type of data transfer
+ * that will be enabled by receiving a trigger as specified by TRIGGERx.
+ */
+enum cppi5_tr_trigger_type {
+       /* The second inner most loop (ICNT1) will be decremented by 1 */
+       CPPI5_TR_TRIGGER_TYPE_ICNT1_DEC,
+       /* The third inner most loop (ICNT2) will be decremented by 1 */
+       CPPI5_TR_TRIGGER_TYPE_ICNT2_DEC,
+       /* The outer most loop (ICNT3) will be decremented by 1 */
+       CPPI5_TR_TRIGGER_TYPE_ICNT3_DEC,
+       /* The entire TR will be allowed to complete */
+       CPPI5_TR_TRIGGER_TYPE_ALL,
+       CPPI5_TR_TRIGGER_TYPE_MAX
+};
+
+typedef u32 cppi5_tr_flags_t;
+
+/* Type 0 (One dimensional data move) TR (16 byte) */
+struct cppi5_tr_type0_t {
+       cppi5_tr_flags_t flags;
+       u16 icnt0;
+       u16 unused;
+       u64 addr;
+} __aligned(16) __packed;
+
+/* Type 1 (Two dimensional data move) TR (32 byte) */
+struct cppi5_tr_type1_t {
+       cppi5_tr_flags_t flags;
+       u16 icnt0;
+       u16 icnt1;
+       u64 addr;
+       s32 dim1;
+} __aligned(32) __packed;
+
+/* Type 2 (Three dimensional data move) TR (32 byte) */
+struct cppi5_tr_type2_t {
+       cppi5_tr_flags_t flags;
+       u16 icnt0;
+       u16 icnt1;
+       u64 addr;
+       s32 dim1;
+       u16 icnt2;
+       u16 unused;
+       s32 dim2;
+} __aligned(32) __packed;
+
+/* Type 3 (Four dimensional data move) TR (32 byte) */
+struct cppi5_tr_type3_t {
+       cppi5_tr_flags_t flags;
+       u16 icnt0;
+       u16 icnt1;
+       u64 addr;
+       s32 dim1;
+       u16 icnt2;
+       u16 icnt3;
+       s32 dim2;
+       s32 dim3;
+} __aligned(32) __packed;
+
+/*
+ * Type 15 (Four Dimensional Block Copy with Repacking and
+ * Indirection Support) TR (64 byte).
+ */
+struct cppi5_tr_type15_t {
+       cppi5_tr_flags_t flags;
+       u16 icnt0;
+       u16 icnt1;
+       u64 addr;
+       s32 dim1;
+       u16 icnt2;
+       u16 icnt3;
+       s32 dim2;
+       s32 dim3;
+       u32 _reserved;
+       s32 ddim1;
+       u64 daddr;
+       s32 ddim2;
+       s32 ddim3;
+       u16 dicnt0;
+       u16 dicnt1;
+       u16 dicnt2;
+       u16 dicnt3;
+} __aligned(64) __packed;
+
+struct cppi5_tr_resp_t {
+       u8 status;
+       u8 reserved;
+       u8 cmd_id;
+       u8 flags;
+} __packed;
+
+#define CPPI5_TR_RESPONSE_STATUS_TYPE_SHIFT    (0U)
+#define CPPI5_TR_RESPONSE_STATUS_TYPE_MASK     GENMASK(3, 0)
+#define CPPI5_TR_RESPONSE_STATUS_INFO_SHIFT    (4U)
+#define CPPI5_TR_RESPONSE_STATUS_INFO_MASK     GENMASK(7, 4)
+#define CPPI5_TR_RESPONSE_CMDID_SHIFT          (16U)
+#define CPPI5_TR_RESPONSE_CMDID_MASK           GENMASK(23, 16)
+#define CPPI5_TR_RESPONSE_CFG_SPECIFIC_SHIFT   (24U)
+#define CPPI5_TR_RESPONSE_CFG_SPECIFIC_MASK    GENMASK(31, 24)
+
+/*
+ * Udmap TR Response Status Type field is used to determine
+ * what type of status is being returned.
+ */
+enum cppi5_tr_resp_status_type {
+       CPPI5_TR_RESPONSE_STATUS_COMPLETE,              /* None */
+       CPPI5_TR_RESPONSE_STATUS_TRANSFER_ERR,          /* Transfer Error */
+       CPPI5_TR_RESPONSE_STATUS_ABORTED_ERR,           /* Aborted Error */
+       CPPI5_TR_RESPONSE_STATUS_SUBMISSION_ERR,        /* Submission Error */
+       CPPI5_TR_RESPONSE_STATUS_UNSUPPORTED_ERR,       /* Unsup. Feature */
+       CPPI5_TR_RESPONSE_STATUS_MAX
+};
+
+/*
+ * Udmap TR Response Status field values which corresponds
+ * CPPI5_TR_RESPONSE_STATUS_SUBMISSION_ERR
+ */
+enum cppi5_tr_resp_status_submission {
+       /* ICNT0 was 0 */
+       CPPI5_TR_RESPONSE_STATUS_SUBMISSION_ICNT0,
+       /* Channel FIFO was full when TR received */
+       CPPI5_TR_RESPONSE_STATUS_SUBMISSION_FIFO_FULL,
+       /* Channel is not owned by the submitter */
+       CPPI5_TR_RESPONSE_STATUS_SUBMISSION_OWN,
+       CPPI5_TR_RESPONSE_STATUS_SUBMISSION_MAX
+};
+
+/*
+ * Udmap TR Response Status field values which corresponds
+ * CPPI5_TR_RESPONSE_STATUS_UNSUPPORTED_ERR
+ */
+enum cppi5_tr_resp_status_unsupported {
+       /* TR Type not supported */
+       CPPI5_TR_RESPONSE_STATUS_UNSUPPORTED_TR_TYPE,
+       /* STATIC not supported */
+       CPPI5_TR_RESPONSE_STATUS_UNSUPPORTED_STATIC,
+       /* EOL not supported */
+       CPPI5_TR_RESPONSE_STATUS_UNSUPPORTED_EOL,
+       /* CONFIGURATION SPECIFIC not supported */
+       CPPI5_TR_RESPONSE_STATUS_UNSUPPORTED_CFG_SPECIFIC,
+       /* AMODE not supported */
+       CPPI5_TR_RESPONSE_STATUS_UNSUPPORTED_AMODE,
+       /* ELTYPE not supported */
+       CPPI5_TR_RESPONSE_STATUS_UNSUPPORTED_ELTYPE,
+       /* DFMT not supported */
+       CPPI5_TR_RESPONSE_STATUS_UNSUPPORTED_DFMT,
+       /* SECTR not supported */
+       CPPI5_TR_RESPONSE_STATUS_UNSUPPORTED_SECTR,
+       /* AMODE SPECIFIC field not supported */
+       CPPI5_TR_RESPONSE_STATUS_UNSUPPORTED_AMODE_SPECIFIC,
+       CPPI5_TR_RESPONSE_STATUS_UNSUPPORTED_MAX
+};
+
+/**
+ * cppi5_trdesc_calc_size - Calculate TR Descriptor size
+ * @tr_count: number of TR records
+ * @tr_size: Nominal size of TR record (max) [16, 32, 64, 128]
+ *
+ * Returns required TR Descriptor size
+ */
+static inline size_t cppi5_trdesc_calc_size(u32 tr_count, u32 tr_size)
+{
+       /*
+        * The Size of a TR descriptor is:
+        * 1 x tr_size : the first 16 bytes is used by the packet info block +
+        * tr_count x tr_size : Transfer Request Records +
+        * tr_count x sizeof(struct cppi5_tr_resp_t) : Transfer Response Records
+        */
+       return tr_size * (tr_count + 1) +
+               sizeof(struct cppi5_tr_resp_t) * tr_count;
+}
+
+/**
+ * cppi5_trdesc_init - Init TR Descriptor
+ * @desc: TR Descriptor
+ * @tr_count: number of TR records
+ * @tr_size: Nominal size of TR record (max) [16, 32, 64, 128]
+ * @reload_idx: Absolute index to jump to on the 2nd and following passes
+ *             through the TR packet.
+ * @reload_count: Number of times to jump from last entry to reload_idx. 0x1ff
+ *               indicates infinite looping.
+ *
+ * Init TR Descriptor
+ */
+static inline void cppi5_trdesc_init(struct cppi5_desc_hdr_t *desc_hdr,
+                                    u32 tr_count, u32 tr_size, u32 reload_idx,
+                                    u32 reload_count)
+{
+       WARN_ON(!desc_hdr);
+       WARN_ON(tr_count & ~CPPI5_INFO0_TRDESC_LASTIDX_MASK);
+       WARN_ON(reload_idx > CPPI5_INFO0_TRDESC_RLDIDX_MAX);
+       WARN_ON(reload_count > CPPI5_INFO0_TRDESC_RLDCNT_MAX);
+
+       desc_hdr->pkt_info0 = CPPI5_INFO0_DESC_TYPE_VAL_TR <<
+                             CPPI5_INFO0_HDESC_TYPE_SHIFT;
+       desc_hdr->pkt_info0 |= (reload_count << CPPI5_INFO0_TRDESC_RLDCNT_SHIFT) &
+                              CPPI5_INFO0_TRDESC_RLDCNT_MASK;
+       desc_hdr->pkt_info0 |= (reload_idx << CPPI5_INFO0_TRDESC_RLDIDX_SHIFT) &
+                              CPPI5_INFO0_TRDESC_RLDIDX_MASK;
+       desc_hdr->pkt_info0 |= (tr_count - 1) & CPPI5_INFO0_TRDESC_LASTIDX_MASK;
+
+       desc_hdr->pkt_info1 |= ((ffs(tr_size >> 4) - 1) <<
+                               CPPI5_INFO1_TRDESC_RECSIZE_SHIFT) &
+                               CPPI5_INFO1_TRDESC_RECSIZE_MASK;
+}
+
+/**
+ * cppi5_tr_init - Init TR record
+ * @flags: Pointer to the TR's flags
+ * @type: TR type
+ * @static_tr: TR is static
+ * @wait: Wait for TR completion before allow the next TR to start
+ * @event_size: output event generation cfg
+ * @cmd_id: TR identifier (application specifics)
+ *
+ * Init TR record
+ */
+static inline void cppi5_tr_init(cppi5_tr_flags_t *flags,
+                                enum cppi5_tr_types type, bool static_tr,
+                                bool wait, enum cppi5_tr_event_size event_size,
+                                u32 cmd_id)
+{
+       WARN_ON(!flags);
+
+       *flags = type;
+       *flags |= (event_size << CPPI5_TR_EVENT_SIZE_SHIFT) &
+                 CPPI5_TR_EVENT_SIZE_MASK;
+
+       *flags |= (cmd_id << CPPI5_TR_CMD_ID_SHIFT) &
+                 CPPI5_TR_CMD_ID_MASK;
+
+       if (static_tr && (type == CPPI5_TR_TYPE8 || type == CPPI5_TR_TYPE9))
+               *flags |= CPPI5_TR_STATIC;
+
+       if (wait)
+               *flags |= CPPI5_TR_WAIT;
+}
+
+/**
+ * cppi5_tr_set_trigger - Configure trigger0/1 and trigger0/1_type
+ * @flags: Pointer to the TR's flags
+ * @trigger0: trigger0 selection
+ * @trigger0_type: type of data transfer that will be enabled by trigger0
+ * @trigger1: trigger1 selection
+ * @trigger1_type: type of data transfer that will be enabled by trigger1
+ *
+ * Configure the triggers for the TR
+ */
+static inline void cppi5_tr_set_trigger(cppi5_tr_flags_t *flags,
+                               enum cppi5_tr_trigger trigger0,
+                               enum cppi5_tr_trigger_type trigger0_type,
+                               enum cppi5_tr_trigger trigger1,
+                               enum cppi5_tr_trigger_type trigger1_type)
+{
+       WARN_ON(!flags);
+
+       *flags |= (trigger0 << CPPI5_TR_TRIGGER0_SHIFT) &
+                 CPPI5_TR_TRIGGER0_MASK;
+       *flags |= (trigger0_type << CPPI5_TR_TRIGGER0_TYPE_SHIFT) &
+                 CPPI5_TR_TRIGGER0_TYPE_MASK;
+
+       *flags |= (trigger1 << CPPI5_TR_TRIGGER1_SHIFT) &
+                 CPPI5_TR_TRIGGER1_MASK;
+       *flags |= (trigger1_type << CPPI5_TR_TRIGGER1_TYPE_SHIFT) &
+                 CPPI5_TR_TRIGGER1_TYPE_MASK;
+}
+
+/**
+ * cppi5_tr_cflag_set - Update the Configuration specific flags
+ * @flags: Pointer to the TR's flags
+ * @csf: Configuration specific flags
+ *
+ * Set a bit in Configuration Specific Flags section of the TR flags.
+ */
+static inline void cppi5_tr_csf_set(cppi5_tr_flags_t *flags, u32 csf)
+{
+       WARN_ON(!flags);
+
+       *flags |= (csf << CPPI5_TR_CSF_FLAGS_SHIFT) &
+                 CPPI5_TR_CSF_FLAGS_MASK;
+}
+
+#endif /* __TI_CPPI5_H__ */
diff --git a/include/linux/soc/ti/k3-navss-ringacc.h b/include/linux/soc/ti/k3-navss-ringacc.h
new file mode 100644 (file)
index 0000000..487dfe9
--- /dev/null
@@ -0,0 +1,236 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * TI K3 AM65x NAVSS Ring accelerator Manager (RA) subsystem driver
+ *
+ * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com
+ */
+
+#ifndef __SOC_TI_K3_NAVSS_RINGACC_API_H_
+#define __SOC_TI_K3_NAVSS_RINGACC_API_H_
+
+#include <dm/ofnode.h>
+
+/**
+ * enum k3_nav_ring_mode - &struct k3_nav_ring_cfg mode
+ *
+ * RA ring operational modes
+ *
+ * @K3_NAV_RINGACC_RING_MODE_RING: Exposed Ring mode for SW direct access
+ * @K3_NAV_RINGACC_RING_MODE_MESSAGE: Messaging mode. Messaging mode requires
+ *     that all accesses to the queue must go through this IP so that all
+ *     accesses to the memory are controlled and ordered. This IP then
+ *     controls the entire state of the queue, and SW has no directly control,
+ *     such as through doorbells and cannot access the storage memory directly.
+ *     This is particularly useful when more than one SW or HW entity can be
+ *     the producer and/or consumer at the same time
+ * @K3_NAV_RINGACC_RING_MODE_CREDENTIALS: Credentials mode is message mode plus
+ *     stores credentials with each message, requiring the element size to be
+ *     doubled to fit the credentials. Any exposed memory should be protected
+ *     by a firewall from unwanted access
+ * @K3_NAV_RINGACC_RING_MODE_QM:  Queue manager mode. This takes the credentials
+ *     mode and adds packet length per element, along with additional read only
+ *     fields for element count and accumulated queue length. The QM mode only
+ *     operates with an 8 byte element size (any other element size is
+ *     illegal), and like in credentials mode each operation uses 2 element
+ *     slots to store the credentials and length fields
+ */
+enum k3_nav_ring_mode {
+       K3_NAV_RINGACC_RING_MODE_RING = 0,
+       K3_NAV_RINGACC_RING_MODE_MESSAGE,
+       K3_NAV_RINGACC_RING_MODE_CREDENTIALS,
+       K3_NAV_RINGACC_RING_MODE_QM,
+       k3_NAV_RINGACC_RING_MODE_INVALID
+};
+
+/**
+ * enum k3_nav_ring_size - &struct k3_nav_ring_cfg elm_size
+ *
+ * RA ring element's sizes in bytes.
+ */
+enum k3_nav_ring_size {
+       K3_NAV_RINGACC_RING_ELSIZE_4 = 0,
+       K3_NAV_RINGACC_RING_ELSIZE_8,
+       K3_NAV_RINGACC_RING_ELSIZE_16,
+       K3_NAV_RINGACC_RING_ELSIZE_32,
+       K3_NAV_RINGACC_RING_ELSIZE_64,
+       K3_NAV_RINGACC_RING_ELSIZE_128,
+       K3_NAV_RINGACC_RING_ELSIZE_256,
+       K3_NAV_RINGACC_RING_ELSIZE_INVALID
+};
+
+struct k3_nav_ringacc;
+struct k3_nav_ring;
+
+/**
+ * enum k3_nav_ring_cfg - RA ring configuration structure
+ *
+ * @size: Ring size, number of elements
+ * @elm_size: Ring element size
+ * @mode: Ring operational mode
+ * @flags: Ring configuration flags. Possible values:
+ *      @K3_NAV_RINGACC_RING_SHARED: when set allows to request the same ring
+ *      few times. It's usable when the same ring is used as Free Host PD ring
+ *      for different flows, for example.
+ *      Note: Locking should be done by consumer if required
+ */
+struct k3_nav_ring_cfg {
+       u32 size;
+       enum k3_nav_ring_size elm_size;
+       enum k3_nav_ring_mode mode;
+#define K3_NAV_RINGACC_RING_SHARED BIT(1)
+       u32 flags;
+};
+
+#define K3_NAV_RINGACC_RING_ID_ANY (-1)
+#define K3_NAV_RINGACC_RING_USE_PROXY BIT(1)
+
+/**
+ * k3_nav_ringacc_request_ring - request ring from ringacc
+ * @ringacc: pointer on ringacc
+ * @id: ring id or K3_NAV_RINGACC_RING_ID_ANY for any general purpose ring
+ * @flags:
+ *     @K3_NAV_RINGACC_RING_USE_PROXY: if set - proxy will be allocated and
+ *             used to access ring memory. Sopported only for rings in
+ *             Message/Credentials/Queue mode.
+ *
+ * Returns pointer on the Ring - struct k3_nav_ring
+ * or NULL in case of failure.
+ */
+struct k3_nav_ring *k3_nav_ringacc_request_ring(struct k3_nav_ringacc *ringacc,
+                                               int id, u32 flags);
+
+/**
+ * k3_nav_ringacc_get_dev - get pointer on RA device
+ * @ringacc: pointer on RA
+ *
+ * Returns device pointer
+ */
+struct udevice *k3_nav_ringacc_get_dev(struct k3_nav_ringacc *ringacc);
+
+/**
+ * k3_nav_ringacc_ring_reset - ring reset
+ * @ring: pointer on Ring
+ *
+ * Resets ring internal state ((hw)occ, (hw)idx).
+ * TODO_GS: ? Ring can be reused without reconfiguration
+ */
+void k3_nav_ringacc_ring_reset(struct k3_nav_ring *ring);
+/**
+ * k3_nav_ringacc_ring_reset - ring reset for DMA rings
+ * @ring: pointer on Ring
+ *
+ * Resets ring internal state ((hw)occ, (hw)idx). Should be used for rings
+ * which are read by K3 UDMA, like TX or Free Host PD rings.
+ */
+void k3_nav_ringacc_ring_reset_dma(struct k3_nav_ring *ring, u32 occ);
+
+/**
+ * k3_nav_ringacc_ring_free - ring free
+ * @ring: pointer on Ring
+ *
+ * Resets ring and free all alocated resources.
+ */
+int k3_nav_ringacc_ring_free(struct k3_nav_ring *ring);
+
+/**
+ * k3_nav_ringacc_get_ring_id - Get the Ring ID
+ * @ring: pointer on ring
+ *
+ * Returns the Ring ID
+ */
+u32 k3_nav_ringacc_get_ring_id(struct k3_nav_ring *ring);
+
+/**
+ * k3_nav_ringacc_ring_cfg - ring configure
+ * @ring: pointer on ring
+ * @cfg: Ring configuration parameters (see &struct k3_nav_ring_cfg)
+ *
+ * Configures ring, including ring memory allocation.
+ * Returns 0 on success, errno otherwise.
+ */
+int k3_nav_ringacc_ring_cfg(struct k3_nav_ring *ring,
+                           struct k3_nav_ring_cfg *cfg);
+
+/**
+ * k3_nav_ringacc_ring_get_size - get ring size
+ * @ring: pointer on ring
+ *
+ * Returns ring size in number of elements.
+ */
+u32 k3_nav_ringacc_ring_get_size(struct k3_nav_ring *ring);
+
+/**
+ * k3_nav_ringacc_ring_get_free - get free elements
+ * @ring: pointer on ring
+ *
+ * Returns number of free elements in the ring.
+ */
+u32 k3_nav_ringacc_ring_get_free(struct k3_nav_ring *ring);
+
+/**
+ * k3_nav_ringacc_ring_get_occ - get ring occupancy
+ * @ring: pointer on ring
+ *
+ * Returns total number of valid entries on the ring
+ */
+u32 k3_nav_ringacc_ring_get_occ(struct k3_nav_ring *ring);
+
+/**
+ * k3_nav_ringacc_ring_is_full - checks if ring is full
+ * @ring: pointer on ring
+ *
+ * Returns true if the ring is full
+ */
+u32 k3_nav_ringacc_ring_is_full(struct k3_nav_ring *ring);
+
+/**
+ * k3_nav_ringacc_ring_push - push element to the ring tail
+ * @ring: pointer on ring
+ * @elem: pointer on ring element buffer
+ *
+ * Push one ring element to the ring tail. Size of the ring element is
+ * determined by ring configuration &struct k3_nav_ring_cfg elm_size.
+ *
+ * Returns 0 on success, errno otherwise.
+ */
+int k3_nav_ringacc_ring_push(struct k3_nav_ring *ring, void *elem);
+
+/**
+ * k3_nav_ringacc_ring_pop - pop element from the ring head
+ * @ring: pointer on ring
+ * @elem: pointer on ring element buffer
+ *
+ * Push one ring element from the ring head. Size of the ring element is
+ * determined by ring configuration &struct k3_nav_ring_cfg elm_size..
+ *
+ * Returns 0 on success, errno otherwise.
+ */
+int k3_nav_ringacc_ring_pop(struct k3_nav_ring *ring, void *elem);
+
+/**
+ * k3_nav_ringacc_ring_push_head - push element to the ring head
+ * @ring: pointer on ring
+ * @elem: pointer on ring element buffer
+ *
+ * Push one ring element to the ring head. Size of the ring element is
+ * determined by ring configuration &struct k3_nav_ring_cfg elm_size.
+ *
+ * Returns 0 on success, errno otherwise.
+ * Not Supported by ring modes: K3_NAV_RINGACC_RING_MODE_RING
+ */
+int k3_nav_ringacc_ring_push_head(struct k3_nav_ring *ring, void *elem);
+
+/**
+ * k3_nav_ringacc_ring_pop_tail - pop element from the ring tail
+ * @ring: pointer on ring
+ * @elem: pointer on ring element buffer
+ *
+ * Push one ring element from the ring tail. Size of the ring element is
+ * determined by ring configuration &struct k3_nav_ring_cfg elm_size.
+ *
+ * Returns 0 on success, errno otherwise.
+ * Not Supported by ring modes: K3_NAV_RINGACC_RING_MODE_RING
+ */
+int k3_nav_ringacc_ring_pop_tail(struct k3_nav_ring *ring, void *elem);
+
+#endif /* __SOC_TI_K3_NAVSS_RINGACC_API_H_ */
diff --git a/include/linux/soc/ti/ti-udma.h b/include/linux/soc/ti/ti-udma.h
new file mode 100644 (file)
index 0000000..e9d4226
--- /dev/null
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ *  Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com
+ *  Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
+ */
+
+#ifndef __TI_UDMA_H
+#define __TI_UDMA_H
+
+/**
+ * struct ti_udma_drv_packet_data - TI UDMA transfer specific data
+ *
+ * @pkt_type: Packet Type - specific for each DMA client HW
+ * @dest_tag: Destination tag The source pointer.
+ *
+ * TI UDMA transfer specific data passed as part of DMA transfer to
+ * the DMA client HW in UDMA descriptors.
+ */
+struct ti_udma_drv_packet_data {
+       u32     pkt_type;
+       u32     dest_tag;
+};
+
+#endif /* __TI_UDMA_H */
index 90d5053636522d7d8340817ae22556e3e77d085d..222cf665460ff294b5344764f700fcc82818ad5f 100644 (file)
@@ -212,14 +212,43 @@ struct ti_sci_clk_ops {
                        u64 *current_freq);
 };
 
+/**
+ * struct ti_sci_rm_core_ops - Resource management core operations
+ * @get_range:         Get a range of resources belonging to ti sci host.
+ * @get_rage_from_shost:       Get a range of resources belonging to
+ *                             specified host id.
+ *                     - s_host: Host processing entity to which the
+ *                               resources are allocated
+ *
+ * NOTE: for these functions, all the parameters are consolidated and defined
+ * as below:
+ * - handle:   Pointer to TISCI handle as retrieved by *ti_sci_get_handle
+ * - dev_id:   TISCI device ID.
+ * - subtype:  Resource assignment subtype that is being requested
+ *             from the given device.
+ * - range_start:      Start index of the resource range
+ * - range_end:                Number of resources in the range
+ */
+struct ti_sci_rm_core_ops {
+       int (*get_range)(const struct ti_sci_handle *handle, u32 dev_id,
+                        u8 subtype, u16 *range_start, u16 *range_num);
+       int (*get_range_from_shost)(const struct ti_sci_handle *handle,
+                                   u32 dev_id, u8 subtype, u8 s_host,
+                                   u16 *range_start, u16 *range_num);
+};
+
 /**
  * struct ti_sci_core_ops - SoC Core Operations
  * @reboot_device: Reboot the SoC
  *             Returns 0 for successful request(ideally should never return),
  *             else returns corresponding error value.
+ * @query_msmc: Query the size of available msmc
+ *             Return 0 for successful query else appropriate error value.
  */
 struct ti_sci_core_ops {
        int (*reboot_device)(const struct ti_sci_handle *handle);
+       int (*query_msmc)(const struct ti_sci_handle *handle,
+                         u64 *msmc_start, u64 *msmc_end);
 };
 
 /**
@@ -257,6 +286,230 @@ struct ti_sci_proc_ops {
                                    u32 *sts_flags);
 };
 
+#define TI_SCI_RING_MODE_RING                  (0)
+#define TI_SCI_RING_MODE_MESSAGE               (1)
+#define TI_SCI_RING_MODE_CREDENTIALS           (2)
+#define TI_SCI_RING_MODE_QM                    (3)
+
+#define TI_SCI_MSG_UNUSED_SECONDARY_HOST TI_SCI_RM_NULL_U8
+
+/* RA config.addr_lo parameter is valid for RM ring configure TI_SCI message */
+#define TI_SCI_MSG_VALUE_RM_RING_ADDR_LO_VALID BIT(0)
+/* RA config.addr_hi parameter is valid for RM ring configure TI_SCI message */
+#define TI_SCI_MSG_VALUE_RM_RING_ADDR_HI_VALID BIT(1)
+ /* RA config.count parameter is valid for RM ring configure TI_SCI message */
+#define TI_SCI_MSG_VALUE_RM_RING_COUNT_VALID   BIT(2)
+/* RA config.mode parameter is valid for RM ring configure TI_SCI message */
+#define TI_SCI_MSG_VALUE_RM_RING_MODE_VALID    BIT(3)
+/* RA config.size parameter is valid for RM ring configure TI_SCI message */
+#define TI_SCI_MSG_VALUE_RM_RING_SIZE_VALID    BIT(4)
+/* RA config.order_id parameter is valid for RM ring configure TISCI message */
+#define TI_SCI_MSG_VALUE_RM_RING_ORDER_ID_VALID        BIT(5)
+
+#define TI_SCI_MSG_VALUE_RM_ALL_NO_ORDER \
+       (TI_SCI_MSG_VALUE_RM_RING_ADDR_LO_VALID | \
+       TI_SCI_MSG_VALUE_RM_RING_ADDR_HI_VALID | \
+       TI_SCI_MSG_VALUE_RM_RING_COUNT_VALID | \
+       TI_SCI_MSG_VALUE_RM_RING_MODE_VALID | \
+       TI_SCI_MSG_VALUE_RM_RING_SIZE_VALID)
+
+/**
+ * struct ti_sci_rm_ringacc_ops - Ring Accelerator Management operations
+ * @config: configure the SoC Navigator Subsystem Ring Accelerator ring
+ * @get_config: get the SoC Navigator Subsystem Ring Accelerator ring
+ *             configuration
+ */
+struct ti_sci_rm_ringacc_ops {
+       int (*config)(const struct ti_sci_handle *handle,
+                     u32 valid_params, u16 nav_id, u16 index,
+                     u32 addr_lo, u32 addr_hi, u32 count, u8 mode,
+                     u8 size, u8 order_id
+       );
+       int (*get_config)(const struct ti_sci_handle *handle,
+                         u32 nav_id, u32 index, u8 *mode,
+                         u32 *addr_lo, u32 *addr_hi, u32 *count,
+                         u8 *size, u8 *order_id);
+};
+
+/**
+ * struct ti_sci_rm_psil_ops - PSI-L thread operations
+ * @pair: pair PSI-L source thread to a destination thread.
+ *     If the src_thread is mapped to UDMA tchan, the corresponding channel's
+ *     TCHAN_THRD_ID register is updated.
+ *     If the dst_thread is mapped to UDMA rchan, the corresponding channel's
+ *     RCHAN_THRD_ID register is updated.
+ * @unpair: unpair PSI-L source thread from a destination thread.
+ *     If the src_thread is mapped to UDMA tchan, the corresponding channel's
+ *     TCHAN_THRD_ID register is cleared.
+ *     If the dst_thread is mapped to UDMA rchan, the corresponding channel's
+ *     RCHAN_THRD_ID register is cleared.
+ */
+struct ti_sci_rm_psil_ops {
+       int (*pair)(const struct ti_sci_handle *handle, u32 nav_id,
+                   u32 src_thread, u32 dst_thread);
+       int (*unpair)(const struct ti_sci_handle *handle, u32 nav_id,
+                     u32 src_thread, u32 dst_thread);
+};
+
+/* UDMAP channel types */
+#define TI_SCI_RM_UDMAP_CHAN_TYPE_PKT_PBRR             2
+#define TI_SCI_RM_UDMAP_CHAN_TYPE_PKT_PBRR_SB          3       /* RX only */
+#define TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_PBRR            10
+#define TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_PBVR            11
+#define TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_BCOPY_PBRR      12
+#define TI_SCI_RM_UDMAP_CHAN_TYPE_3RDP_BCOPY_PBVR      13
+
+/* UDMAP channel atypes */
+#define TI_SCI_RM_UDMAP_ATYPE_PHYS                     0
+#define TI_SCI_RM_UDMAP_ATYPE_INTERMEDIATE             1
+#define TI_SCI_RM_UDMAP_ATYPE_VIRTUAL                  2
+
+/* UDMAP channel scheduling priorities */
+#define TI_SCI_RM_UDMAP_SCHED_PRIOR_HIGH               0
+#define TI_SCI_RM_UDMAP_SCHED_PRIOR_MEDHIGH            1
+#define TI_SCI_RM_UDMAP_SCHED_PRIOR_MEDLOW             2
+#define TI_SCI_RM_UDMAP_SCHED_PRIOR_LOW                        3
+
+#define TI_SCI_RM_UDMAP_RX_FLOW_DESC_HOST              0
+#define TI_SCI_RM_UDMAP_RX_FLOW_DESC_MONO              2
+
+/* UDMAP TX/RX channel valid_params common declarations */
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_PAUSE_ON_ERR_VALID                BIT(0)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_ATYPE_VALID                BIT(1)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_CHAN_TYPE_VALID            BIT(2)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_FETCH_SIZE_VALID           BIT(3)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_CQ_QNUM_VALID              BIT(4)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_PRIORITY_VALID             BIT(5)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_QOS_VALID                  BIT(6)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_ORDER_ID_VALID             BIT(7)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_SCHED_PRIORITY_VALID       BIT(8)
+
+/**
+ * Configures a Navigator Subsystem UDMAP transmit channel
+ *
+ * Configures a Navigator Subsystem UDMAP transmit channel registers.
+ * See @ti_sci_msg_rm_udmap_tx_ch_cfg_req
+ */
+struct ti_sci_msg_rm_udmap_tx_ch_cfg {
+       u32 valid_params;
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_FILT_EINFO_VALID        BIT(9)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_FILT_PSWORDS_VALID      BIT(10)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_SUPR_TDPKT_VALID        BIT(11)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_CREDIT_COUNT_VALID      BIT(12)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_TX_FDEPTH_VALID            BIT(13)
+       u16 nav_id;
+       u16 index;
+       u8 tx_pause_on_err;
+       u8 tx_filt_einfo;
+       u8 tx_filt_pswords;
+       u8 tx_atype;
+       u8 tx_chan_type;
+       u8 tx_supr_tdpkt;
+       u16 tx_fetch_size;
+       u8 tx_credit_count;
+       u16 txcq_qnum;
+       u8 tx_priority;
+       u8 tx_qos;
+       u8 tx_orderid;
+       u16 fdepth;
+       u8 tx_sched_priority;
+};
+
+/**
+ * Configures a Navigator Subsystem UDMAP receive channel
+ *
+ * Configures a Navigator Subsystem UDMAP receive channel registers.
+ * See @ti_sci_msg_rm_udmap_rx_ch_cfg_req
+ */
+struct ti_sci_msg_rm_udmap_rx_ch_cfg {
+       u32 valid_params;
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_FLOWID_START_VALID      BIT(9)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_FLOWID_CNT_VALID        BIT(10)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_IGNORE_SHORT_VALID      BIT(11)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_CH_RX_IGNORE_LONG_VALID       BIT(12)
+       u16 nav_id;
+       u16 index;
+       u16 rx_fetch_size;
+       u16 rxcq_qnum;
+       u8 rx_priority;
+       u8 rx_qos;
+       u8 rx_orderid;
+       u8 rx_sched_priority;
+       u16 flowid_start;
+       u16 flowid_cnt;
+       u8 rx_pause_on_err;
+       u8 rx_atype;
+       u8 rx_chan_type;
+       u8 rx_ignore_short;
+       u8 rx_ignore_long;
+};
+
+/**
+ * Configures a Navigator Subsystem UDMAP receive flow
+ *
+ * Configures a Navigator Subsystem UDMAP receive flow's registers.
+ * See @tis_ci_msg_rm_udmap_flow_cfg_req
+ */
+struct ti_sci_msg_rm_udmap_flow_cfg {
+       u32 valid_params;
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_EINFO_PRESENT_VALID     BIT(0)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_PSINFO_PRESENT_VALID     BIT(1)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_ERROR_HANDLING_VALID     BIT(2)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DESC_TYPE_VALID          BIT(3)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SOP_OFFSET_VALID         BIT(4)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_QNUM_VALID          BIT(5)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_HI_VALID         BIT(6)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_LO_VALID         BIT(7)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_HI_VALID        BIT(8)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_LO_VALID        BIT(9)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_HI_SEL_VALID     BIT(10)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_SRC_TAG_LO_SEL_VALID     BIT(11)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_HI_SEL_VALID    BIT(12)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_DEST_TAG_LO_SEL_VALID    BIT(13)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ0_SZ0_QNUM_VALID      BIT(14)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ1_QNUM_VALID          BIT(15)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ2_QNUM_VALID          BIT(16)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_FDQ3_QNUM_VALID          BIT(17)
+#define TI_SCI_MSG_VALUE_RM_UDMAP_FLOW_PS_LOCATION_VALID        BIT(18)
+       u16 nav_id;
+       u16 flow_index;
+       u8 rx_einfo_present;
+       u8 rx_psinfo_present;
+       u8 rx_error_handling;
+       u8 rx_desc_type;
+       u16 rx_sop_offset;
+       u16 rx_dest_qnum;
+       u8 rx_src_tag_hi;
+       u8 rx_src_tag_lo;
+       u8 rx_dest_tag_hi;
+       u8 rx_dest_tag_lo;
+       u8 rx_src_tag_hi_sel;
+       u8 rx_src_tag_lo_sel;
+       u8 rx_dest_tag_hi_sel;
+       u8 rx_dest_tag_lo_sel;
+       u16 rx_fdq0_sz0_qnum;
+       u16 rx_fdq1_qnum;
+       u16 rx_fdq2_qnum;
+       u16 rx_fdq3_qnum;
+       u8 rx_ps_location;
+};
+
+/**
+ * struct ti_sci_rm_udmap_ops - UDMA Management operations
+ * @tx_ch_cfg: configure SoC Navigator Subsystem UDMA transmit channel.
+ * @rx_ch_cfg: configure SoC Navigator Subsystem UDMA receive channel.
+ * @rx_flow_cfg: configure SoC Navigator Subsystem UDMA receive flow.
+ */
+struct ti_sci_rm_udmap_ops {
+       int (*tx_ch_cfg)(const struct ti_sci_handle *handle,
+                        const struct ti_sci_msg_rm_udmap_tx_ch_cfg *params);
+       int (*rx_ch_cfg)(const struct ti_sci_handle *handle,
+                        const struct ti_sci_msg_rm_udmap_rx_ch_cfg *params);
+       int (*rx_flow_cfg)(
+               const struct ti_sci_handle *handle,
+               const struct ti_sci_msg_rm_udmap_flow_cfg *params);
+};
+
 /**
  * struct ti_sci_ops - Function support for TI SCI
  * @board_ops: Miscellaneous operations
@@ -264,6 +517,7 @@ struct ti_sci_proc_ops {
  * @clk_ops:   Clock specific operations
  * @core_ops:  Core specific operations
  * @proc_ops:  Processor specific operations
+ * @ring_ops: Ring Accelerator Management operations
  */
 struct ti_sci_ops {
        struct ti_sci_board_ops board_ops;
@@ -271,6 +525,10 @@ struct ti_sci_ops {
        struct ti_sci_clk_ops clk_ops;
        struct ti_sci_core_ops core_ops;
        struct ti_sci_proc_ops proc_ops;
+       struct ti_sci_rm_core_ops rm_core_ops;
+       struct ti_sci_rm_ringacc_ops rm_ring_ops;
+       struct ti_sci_rm_psil_ops rm_psil_ops;
+       struct ti_sci_rm_udmap_ops rm_udmap_ops;
 };
 
 /**
@@ -283,12 +541,42 @@ struct ti_sci_handle {
        struct ti_sci_version_info version;
 };
 
+#define TI_SCI_RESOURCE_NULL   0xffff
+
+/**
+ * struct ti_sci_resource_desc - Description of TI SCI resource instance range.
+ * @start:     Start index of the resource.
+ * @num:       Number of resources.
+ * @res_map:   Bitmap to manage the allocation of these resources.
+ */
+struct ti_sci_resource_desc {
+       u16 start;
+       u16 num;
+       unsigned long *res_map;
+};
+
+/**
+ * struct ti_sci_resource - Structure representing a resource assigned
+ *                         to a device.
+ * @sets:      Number of sets available from this resource type
+ * @desc:      Array of resource descriptors.
+ */
+struct ti_sci_resource {
+       u16 sets;
+       struct ti_sci_resource_desc *desc;
+};
+
 #if IS_ENABLED(CONFIG_TI_SCI_PROTOCOL)
 
 const struct ti_sci_handle *ti_sci_get_handle_from_sysfw(struct udevice *dev);
 const struct ti_sci_handle *ti_sci_get_handle(struct udevice *dev);
 const struct ti_sci_handle *ti_sci_get_by_phandle(struct udevice *dev,
                                                  const char *property);
+u16 ti_sci_get_free_resource(struct ti_sci_resource *res);
+void ti_sci_release_resource(struct ti_sci_resource *res, u16 id);
+struct ti_sci_resource *
+devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle,
+                           struct udevice *dev, u32 dev_id, char *of_prop);
 
 #else  /* CONFIG_TI_SCI_PROTOCOL */
 
@@ -309,6 +597,22 @@ const struct ti_sci_handle *ti_sci_get_by_phandle(struct udevice *dev,
 {
        return ERR_PTR(-EINVAL);
 }
+
+static inline u16 ti_sci_get_free_resource(struct ti_sci_resource *res)
+{
+       return TI_SCI_RESOURCE_NULL;
+}
+
+static inline void ti_sci_release_resource(struct ti_sci_resource *res, u16 id)
+{
+}
+
+static inline struct ti_sci_resource *
+devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle,
+                           struct udevice *dev, u32 dev_id, char *of_prop)
+{
+       return ERR_PTR(-EINVAL);
+}
 #endif /* CONFIG_TI_SCI_PROTOCOL */
 
 #endif /* __TISCI_PROTOCOL_H */
index dd52ed3f476c156c0528a7cbc3ed1ea153ad1493..44b32385c402e5697fec20ad9a820d0435773c39 100644 (file)
@@ -92,12 +92,14 @@ enum eth_state_t {
  * @enetaddr: The Ethernet MAC address that is loaded from EEPROM or env
  * @phy_interface: PHY interface to use - see PHY_INTERFACE_MODE_...
  * @max_speed: Maximum speed of Ethernet connection supported by MAC
+ * @priv_pdata: device specific platdata
  */
 struct eth_pdata {
        phys_addr_t iobase;
        unsigned char enetaddr[ARP_HLEN];
        int phy_interface;
        int max_speed;
+       void *priv_pdata;
 };
 
 enum eth_recv_flags {
index 14073cfdd2fc7e06760b04e2642c763e95e879d1..3a357de903f1449dbfd51be3ede273673bbf78bd 100644 (file)
@@ -51,9 +51,15 @@ int init_func_watchdog_reset(void);
                #if defined(__ASSEMBLY__)
                        #define WATCHDOG_RESET bl watchdog_reset
                #else
-                       extern void watchdog_reset(void);
+                       /* Don't require the watchdog to be enabled in SPL */
+                       #if defined(CONFIG_SPL_BUILD) &&                \
+                               !defined(CONFIG_SPL_WATCHDOG_SUPPORT)
+                               #define WATCHDOG_RESET() {}
+                       #else
+                               extern void watchdog_reset(void);
 
-                       #define WATCHDOG_RESET watchdog_reset
+                               #define WATCHDOG_RESET watchdog_reset
+                       #endif
                #endif
        #else
                /*
index 366d164cd76064cebd29f507d7b037d2ac2a0379..8fe5d85a050643c512963402ac566d2ad9801848 100644 (file)
@@ -301,6 +301,19 @@ config LZO
        help
          This enables support for LZO compression algorithm.r
 
+config GZIP
+       bool "Enable gzip decompression support for SPL build"
+       select ZLIB
+       default y
+       help
+         This enables support for GZIP compression algorithm.
+
+config ZLIB
+       bool
+       default y
+       help
+         This enables ZLIB compression lib.
+
 config SPL_LZ4
        bool "Enable LZ4 decompression support in SPL"
        help
index 417016102b48e2fb14767da761f4da943d137b88..4fccadc5483d00212feb4ded6913faa5f8af79c0 100644 (file)
@@ -141,6 +141,7 @@ static void *try_load_entry(uint16_t n, struct efi_device_path **device_path,
        efi_deserialize_load_option(&lo, load_option);
 
        if (lo.attributes & LOAD_OPTION_ACTIVE) {
+               u32 attributes;
                efi_status_t ret;
 
                debug("%s: trying to load \"%ls\" from %pD\n",
@@ -151,6 +152,16 @@ static void *try_load_entry(uint16_t n, struct efi_device_path **device_path,
                if (ret != EFI_SUCCESS)
                        goto error;
 
+               attributes = EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                            EFI_VARIABLE_RUNTIME_ACCESS;
+               size = sizeof(n);
+               ret = EFI_CALL(efi_set_variable(
+                               L"BootCurrent",
+                               (efi_guid_t *)&efi_global_variable_guid,
+                               attributes, size, &n));
+               if (ret != EFI_SUCCESS)
+                       goto error;
+
                printf("Booting: %ls\n", lo.label);
                efi_dp_split_file_path(lo.file_path, device_path, file_path);
        }
@@ -162,21 +173,53 @@ error:
 }
 
 /*
- * Attempt to load, in the order specified by BootOrder EFI variable, the
- * available load-options, finding and returning the first one that can
- * be loaded successfully.
+ * Attempt to load from BootNext or in the order specified by BootOrder
+ * EFI variable, the available load-options, finding and returning
+ * the first one that can be loaded successfully.
  */
 void *efi_bootmgr_load(struct efi_device_path **device_path,
                       struct efi_device_path **file_path)
 {
-       uint16_t *bootorder;
+       u16 bootnext, *bootorder;
        efi_uintn_t size;
        void *image = NULL;
        int i, num;
+       efi_status_t ret;
 
        bs = systab.boottime;
        rs = systab.runtime;
 
+       /* BootNext */
+       bootnext = 0;
+       size = sizeof(bootnext);
+       ret = EFI_CALL(efi_get_variable(L"BootNext",
+                                       (efi_guid_t *)&efi_global_variable_guid,
+                                       NULL, &size, &bootnext));
+       if (ret == EFI_SUCCESS || ret == EFI_BUFFER_TOO_SMALL) {
+               /* BootNext does exist here */
+               if (ret == EFI_BUFFER_TOO_SMALL || size != sizeof(u16))
+                       printf("BootNext must be 16-bit integer\n");
+
+               /* delete BootNext */
+               ret = EFI_CALL(efi_set_variable(
+                                       L"BootNext",
+                                       (efi_guid_t *)&efi_global_variable_guid,
+                                       0, 0, &bootnext));
+
+               /* load BootNext */
+               if (ret == EFI_SUCCESS) {
+                       if (size == sizeof(u16)) {
+                               image = try_load_entry(bootnext, device_path,
+                                                      file_path);
+                               if (image)
+                                       return image;
+                       }
+               } else {
+                       printf("Deleting BootNext failed\n");
+               }
+       }
+
+       /* BootOrder */
        bootorder = get_var(L"BootOrder", &efi_global_variable_guid, &size);
        if (!bootorder) {
                printf("BootOrder not defined\n");
index 4fc550d9f376fa657c0805d6c9977bebd583f512..b215bd7723da5a92865de778b34b9c3dafaec7fe 100644 (file)
@@ -26,6 +26,9 @@ LIST_HEAD(efi_obj_list);
 /* List of all events */
 LIST_HEAD(efi_events);
 
+/* Handle of the currently executing image */
+static efi_handle_t current_image;
+
 /*
  * If we're running on nasty systems (32bit ARM booting into non-EFI Linux)
  * we need to do trickery with caches. Since we don't want to break the EFI
@@ -1519,6 +1522,7 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path,
        efi_status_t ret;
        struct efi_loaded_image *info = NULL;
        struct efi_loaded_image_obj *obj = NULL;
+       struct efi_device_path *dp;
 
        /* In case of EFI_OUT_OF_RESOURCES avoid illegal free by caller. */
        *handle_ptr = NULL;
@@ -1542,15 +1546,19 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path,
 
        if (device_path) {
                info->device_handle = efi_dp_find_obj(device_path, NULL);
-               /*
-                * When asking for the device path interface, return
-                * bootefi_device_path
-                */
-               ret = efi_add_protocol(&obj->header,
-                                      &efi_guid_device_path, device_path);
-               if (ret != EFI_SUCCESS)
+
+               dp = efi_dp_append(device_path, file_path);
+               if (!dp) {
+                       ret = EFI_OUT_OF_RESOURCES;
                        goto failure;
+               }
+       } else {
+               dp = NULL;
        }
+       ret = efi_add_protocol(&obj->header,
+                              &efi_guid_loaded_image_device_path, dp);
+       if (ret != EFI_SUCCESS)
+               goto failure;
 
        /*
         * When asking for the loaded_image interface, just
@@ -1679,18 +1687,19 @@ error:
  *
  * Return: status code
  */
-static efi_status_t EFIAPI efi_load_image(bool boot_policy,
-                                         efi_handle_t parent_image,
-                                         struct efi_device_path *file_path,
-                                         void *source_buffer,
-                                         efi_uintn_t source_size,
-                                         efi_handle_t *image_handle)
+efi_status_t EFIAPI efi_load_image(bool boot_policy,
+                                  efi_handle_t parent_image,
+                                  struct efi_device_path *file_path,
+                                  void *source_buffer,
+                                  efi_uintn_t source_size,
+                                  efi_handle_t *image_handle)
 {
        struct efi_device_path *dp, *fp;
        struct efi_loaded_image *info = NULL;
        struct efi_loaded_image_obj **image_obj =
                (struct efi_loaded_image_obj **)image_handle;
        efi_status_t ret;
+       void *dest_buffer;
 
        EFI_ENTRY("%d, %p, %pD, %p, %zd, %p", boot_policy, parent_image,
                  file_path, source_buffer, source_size, image_handle);
@@ -1706,7 +1715,7 @@ static efi_status_t EFIAPI efi_load_image(bool boot_policy,
        }
 
        if (!source_buffer) {
-               ret = efi_load_image_from_path(file_path, &source_buffer,
+               ret = efi_load_image_from_path(file_path, &dest_buffer,
                                               &source_size);
                if (ret != EFI_SUCCESS)
                        goto error;
@@ -1719,154 +1728,30 @@ static efi_status_t EFIAPI efi_load_image(bool boot_policy,
                /* In this case, file_path is the "device" path, i.e.
                 * something like a HARDWARE_DEVICE:MEMORY_MAPPED
                 */
-               u64 addr;
-               void *dest_buffer;
-
-               ret = efi_allocate_pages(EFI_ALLOCATE_ANY_PAGES,
-                                        EFI_RUNTIME_SERVICES_CODE,
-                                        efi_size_in_pages(source_size), &addr);
-               if (ret != EFI_SUCCESS)
-                       goto error;
-               dest_buffer = (void *)(uintptr_t)addr;
-               memcpy(dest_buffer, source_buffer, source_size);
-               source_buffer = dest_buffer;
-
+               dest_buffer = source_buffer;
                dp = file_path;
                fp = NULL;
        }
        ret = efi_setup_loaded_image(dp, fp, image_obj, &info);
-       if (ret != EFI_SUCCESS)
-               goto error_invalid_image;
-       ret = efi_load_pe(*image_obj, source_buffer, info);
-       if (ret != EFI_SUCCESS)
-               goto error_invalid_image;
-       /* Update the type of the allocated memory */
-       efi_add_memory_map((uintptr_t)source_buffer,
-                          efi_size_in_pages(source_size),
-                          info->image_code_type, false);
-       info->system_table = &systab;
-       info->parent_handle = parent_image;
-       return EFI_EXIT(EFI_SUCCESS);
-error_invalid_image:
-       /* The image is invalid. Release all associated resources. */
-       efi_free_pages((uintptr_t)source_buffer,
-                      efi_size_in_pages(source_size));
-       efi_delete_handle(*image_handle);
-       *image_handle = NULL;
-       free(info);
+       if (ret == EFI_SUCCESS)
+               ret = efi_load_pe(*image_obj, dest_buffer, info);
+       if (!source_buffer)
+               /* Release buffer to which file was loaded */
+               efi_free_pages((uintptr_t)dest_buffer,
+                              efi_size_in_pages(source_size));
+       if (ret == EFI_SUCCESS) {
+               info->system_table = &systab;
+               info->parent_handle = parent_image;
+       } else {
+               /* The image is invalid. Release all associated resources. */
+               efi_delete_handle(*image_handle);
+               *image_handle = NULL;
+               free(info);
+       }
 error:
        return EFI_EXIT(ret);
 }
 
-/**
- * efi_start_image() - call the entry point of an image
- * @image_handle:   handle of the image
- * @exit_data_size: size of the buffer
- * @exit_data:      buffer to receive the exit data of the called image
- *
- * This function implements the StartImage service.
- *
- * See the Unified Extensible Firmware Interface (UEFI) specification for
- * details.
- *
- * Return: status code
- */
-efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
-                                   efi_uintn_t *exit_data_size,
-                                   u16 **exit_data)
-{
-       struct efi_loaded_image_obj *image_obj =
-               (struct efi_loaded_image_obj *)image_handle;
-       efi_status_t ret;
-
-       EFI_ENTRY("%p, %p, %p", image_handle, exit_data_size, exit_data);
-
-       efi_is_direct_boot = false;
-
-       /* call the image! */
-       if (setjmp(&image_obj->exit_jmp)) {
-               /*
-                * We called the entry point of the child image with EFI_CALL
-                * in the lines below. The child image called the Exit() boot
-                * service efi_exit() which executed the long jump that brought
-                * us to the current line. This implies that the second half
-                * of the EFI_CALL macro has not been executed.
-                */
-#ifdef CONFIG_ARM
-               /*
-                * efi_exit() called efi_restore_gd(). We have to undo this
-                * otherwise __efi_entry_check() will put the wrong value into
-                * app_gd.
-                */
-               gd = app_gd;
-#endif
-               /*
-                * To get ready to call EFI_EXIT below we have to execute the
-                * missed out steps of EFI_CALL.
-                */
-               assert(__efi_entry_check());
-               debug("%sEFI: %lu returned by started image\n",
-                     __efi_nesting_dec(),
-                     (unsigned long)((uintptr_t)image_obj->exit_status &
-                                     ~EFI_ERROR_MASK));
-               return EFI_EXIT(image_obj->exit_status);
-       }
-
-       ret = EFI_CALL(image_obj->entry(image_handle, &systab));
-
-       /*
-        * Usually UEFI applications call Exit() instead of returning.
-        * But because the world doesn't consist of ponies and unicorns,
-        * we're happy to emulate that behavior on behalf of a payload
-        * that forgot.
-        */
-       return EFI_CALL(systab.boottime->exit(image_handle, ret, 0, NULL));
-}
-
-/**
- * efi_exit() - leave an EFI application or driver
- * @image_handle:   handle of the application or driver that is exiting
- * @exit_status:    status code
- * @exit_data_size: size of the buffer in bytes
- * @exit_data:      buffer with data describing an error
- *
- * This function implements the Exit service.
- *
- * See the Unified Extensible Firmware Interface (UEFI) specification for
- * details.
- *
- * Return: status code
- */
-static efi_status_t EFIAPI efi_exit(efi_handle_t image_handle,
-                                   efi_status_t exit_status,
-                                   efi_uintn_t exit_data_size,
-                                   u16 *exit_data)
-{
-       /*
-        * TODO: We should call the unload procedure of the loaded
-        *       image protocol.
-        */
-       struct efi_loaded_image_obj *image_obj =
-               (struct efi_loaded_image_obj *)image_handle;
-
-       EFI_ENTRY("%p, %ld, %zu, %p", image_handle, exit_status,
-                 exit_data_size, exit_data);
-
-       /* Make sure entry/exit counts for EFI world cross-overs match */
-       EFI_EXIT(exit_status);
-
-       /*
-        * But longjmp out with the U-Boot gd, not the application's, as
-        * the other end is a setjmp call inside EFI context.
-        */
-       efi_restore_gd();
-
-       image_obj->exit_status = exit_status;
-       longjmp(&image_obj->exit_jmp, 1);
-
-       panic("EFI application exited");
-}
-
 /**
  * efi_unload_image() - unload an EFI image
  * @image_handle: handle of the image to be unloaded
@@ -1878,7 +1763,7 @@ static efi_status_t EFIAPI efi_exit(efi_handle_t image_handle,
  *
  * Return: status code
  */
-static efi_status_t EFIAPI efi_unload_image(efi_handle_t image_handle)
+efi_status_t EFIAPI efi_unload_image(efi_handle_t image_handle)
 {
        struct efi_object *efiobj;
 
@@ -2734,6 +2619,139 @@ out:
        return EFI_EXIT(r);
 }
 
+/**
+ * efi_start_image() - call the entry point of an image
+ * @image_handle:   handle of the image
+ * @exit_data_size: size of the buffer
+ * @exit_data:      buffer to receive the exit data of the called image
+ *
+ * This function implements the StartImage service.
+ *
+ * See the Unified Extensible Firmware Interface (UEFI) specification for
+ * details.
+ *
+ * Return: status code
+ */
+efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
+                                   efi_uintn_t *exit_data_size,
+                                   u16 **exit_data)
+{
+       struct efi_loaded_image_obj *image_obj =
+               (struct efi_loaded_image_obj *)image_handle;
+       efi_status_t ret;
+       void *info;
+       efi_handle_t parent_image = current_image;
+
+       EFI_ENTRY("%p, %p, %p", image_handle, exit_data_size, exit_data);
+
+       /* Check parameters */
+       ret = EFI_CALL(efi_open_protocol(image_handle, &efi_guid_loaded_image,
+                                        &info, NULL, NULL,
+                                        EFI_OPEN_PROTOCOL_GET_PROTOCOL));
+       if (ret != EFI_SUCCESS)
+               return EFI_EXIT(EFI_INVALID_PARAMETER);
+
+       efi_is_direct_boot = false;
+
+       /* call the image! */
+       if (setjmp(&image_obj->exit_jmp)) {
+               /*
+                * We called the entry point of the child image with EFI_CALL
+                * in the lines below. The child image called the Exit() boot
+                * service efi_exit() which executed the long jump that brought
+                * us to the current line. This implies that the second half
+                * of the EFI_CALL macro has not been executed.
+                */
+#ifdef CONFIG_ARM
+               /*
+                * efi_exit() called efi_restore_gd(). We have to undo this
+                * otherwise __efi_entry_check() will put the wrong value into
+                * app_gd.
+                */
+               gd = app_gd;
+#endif
+               /*
+                * To get ready to call EFI_EXIT below we have to execute the
+                * missed out steps of EFI_CALL.
+                */
+               assert(__efi_entry_check());
+               debug("%sEFI: %lu returned by started image\n",
+                     __efi_nesting_dec(),
+                     (unsigned long)((uintptr_t)image_obj->exit_status &
+                                     ~EFI_ERROR_MASK));
+               current_image = parent_image;
+               return EFI_EXIT(image_obj->exit_status);
+       }
+
+       current_image = image_handle;
+       ret = EFI_CALL(image_obj->entry(image_handle, &systab));
+
+       /*
+        * Usually UEFI applications call Exit() instead of returning.
+        * But because the world doesn't consist of ponies and unicorns,
+        * we're happy to emulate that behavior on behalf of a payload
+        * that forgot.
+        */
+       return EFI_CALL(systab.boottime->exit(image_handle, ret, 0, NULL));
+}
+
+/**
+ * efi_exit() - leave an EFI application or driver
+ * @image_handle:   handle of the application or driver that is exiting
+ * @exit_status:    status code
+ * @exit_data_size: size of the buffer in bytes
+ * @exit_data:      buffer with data describing an error
+ *
+ * This function implements the Exit service.
+ *
+ * See the Unified Extensible Firmware Interface (UEFI) specification for
+ * details.
+ *
+ * Return: status code
+ */
+static efi_status_t EFIAPI efi_exit(efi_handle_t image_handle,
+                                   efi_status_t exit_status,
+                                   efi_uintn_t exit_data_size,
+                                   u16 *exit_data)
+{
+       /*
+        * TODO: We should call the unload procedure of the loaded
+        *       image protocol.
+        */
+       efi_status_t ret;
+       void *info;
+       struct efi_loaded_image_obj *image_obj =
+               (struct efi_loaded_image_obj *)image_handle;
+
+       EFI_ENTRY("%p, %ld, %zu, %p", image_handle, exit_status,
+                 exit_data_size, exit_data);
+
+       /* Check parameters */
+       if (image_handle != current_image)
+               goto out;
+       ret = EFI_CALL(efi_open_protocol(image_handle, &efi_guid_loaded_image,
+                                        &info, NULL, NULL,
+                                        EFI_OPEN_PROTOCOL_GET_PROTOCOL));
+       if (ret != EFI_SUCCESS)
+               goto out;
+
+       /* Make sure entry/exit counts for EFI world cross-overs match */
+       EFI_EXIT(exit_status);
+
+       /*
+        * But longjmp out with the U-Boot gd, not the application's, as
+        * the other end is a setjmp call inside EFI context.
+        */
+       efi_restore_gd();
+
+       image_obj->exit_status = exit_status;
+       longjmp(&image_obj->exit_jmp, 1);
+
+       panic("EFI application exited");
+out:
+       return EFI_EXIT(EFI_INVALID_PARAMETER);
+}
+
 /**
  * efi_handle_protocol() - get interface of a protocol on a handle
  * @handle:             handle on which the protocol shall be opened
index 8e0965bfc8941465580900826f8e8bc8aeac137c..051fc1d339f7b929f3a34111c0a9ddd47c34c08e 100644 (file)
@@ -797,9 +797,26 @@ static efi_status_t EFIAPI efi_cin_read_key_stroke_ex(
                ret = EFI_NOT_READY;
                goto out;
        }
+       /*
+        * CTRL+A - CTRL+Z have to be signaled as a - z.
+        * SHIFT+CTRL+A - SHIFT+CTRL+Z have to be signaled as A - Z.
+        */
+       switch (next_key.key.unicode_char) {
+       case 0x01 ... 0x07:
+       case 0x0b ... 0x0c:
+       case 0x0e ... 0x1a:
+               if (!(next_key.key_state.key_toggle_state &
+                     EFI_CAPS_LOCK_ACTIVE) ^
+                   !(next_key.key_state.key_shift_state &
+                     (EFI_LEFT_SHIFT_PRESSED | EFI_RIGHT_SHIFT_PRESSED)))
+                       next_key.key.unicode_char += 0x40;
+               else
+                       next_key.key.unicode_char += 0x60;
+       }
        *key_data = next_key;
        key_available = false;
        efi_con_in.wait_for_key->is_signaled = false;
+
 out:
        return EFI_EXIT(ret);
 }
index 0483403be0d0fdf053b442467a5c7d5e5eeda303..182d735e6bc28cadf6a83823cdb5d344020480e0 100644 (file)
@@ -134,6 +134,25 @@ static int sanitize_path(char *path)
        return 0;
 }
 
+/**
+ * efi_create_file() - create file or directory
+ *
+ * @fh:                        file handle
+ * @attributes:                attributes for newly created file
+ * Returns:            0 for success
+ */
+static int efi_create_file(struct file_handle *fh, u64 attributes)
+{
+       loff_t actwrite;
+       void *buffer = &actwrite;
+
+       if (attributes & EFI_FILE_DIRECTORY)
+               return fs_mkdir(fh->path);
+       else
+               return fs_write(fh->path, map_to_sysmem(buffer), 0, 0,
+                               &actwrite);
+}
+
 /**
  * file_open() - open a file handle
  *
@@ -176,6 +195,7 @@ static struct efi_file_handle *file_open(struct file_system *fs,
 
        if (parent) {
                char *p = fh->path;
+               int exists;
 
                if (plen > 0) {
                        strcpy(p, parent->path);
@@ -192,18 +212,17 @@ static struct efi_file_handle *file_open(struct file_system *fs,
                if (set_blk_dev(fh))
                        goto error;
 
-               if ((mode & EFI_FILE_MODE_CREATE) &&
-                   (attributes & EFI_FILE_DIRECTORY)) {
-                       if (fs_mkdir(fh->path))
-                               goto error;
-               } else if (!((mode & EFI_FILE_MODE_CREATE) ||
-                            fs_exists(fh->path)))
-                       goto error;
-
+               exists = fs_exists(fh->path);
                /* fs_exists() calls fs_close(), so open file system again */
                if (set_blk_dev(fh))
                        goto error;
 
+               if (!exists) {
+                       if (!(mode & EFI_FILE_MODE_CREATE) ||
+                           efi_create_file(fh, attributes))
+                               goto error;
+               }
+
                /* figure out if file is a directory: */
                fh->isdir = is_dir(fh);
        } else {
@@ -257,10 +276,12 @@ static efi_status_t EFIAPI efi_file_open(struct efi_file_handle *file,
 
        /* Open file */
        *new_handle = file_open(fh->fs, fh, file_name, open_mode, attributes);
-       if (*new_handle)
+       if (*new_handle) {
+               EFI_PRINT("file handle %p\n", *new_handle);
                ret = EFI_SUCCESS;
-       else
+       } else {
                ret = EFI_NOT_FOUND;
+       }
 out:
        return EFI_EXIT(ret);
 }
@@ -616,9 +637,72 @@ static efi_status_t EFIAPI efi_file_setinfo(struct efi_file_handle *file,
                                            efi_uintn_t buffer_size,
                                            void *buffer)
 {
-       EFI_ENTRY("%p, %p, %zu, %p", file, info_type, buffer_size, buffer);
+       struct file_handle *fh = to_fh(file);
+       efi_status_t ret = EFI_UNSUPPORTED;
+
+       EFI_ENTRY("%p, %pUl, %zu, %p", file, info_type, buffer_size, buffer);
+
+       if (!guidcmp(info_type, &efi_file_info_guid)) {
+               struct efi_file_info *info = (struct efi_file_info *)buffer;
+               char *filename = basename(fh);
+               char *new_file_name, *pos;
+               loff_t file_size;
 
-       return EFI_EXIT(EFI_UNSUPPORTED);
+               if (buffer_size < sizeof(struct efi_file_info)) {
+                       ret = EFI_BAD_BUFFER_SIZE;
+                       goto out;
+               }
+               /* We cannot change the directory attribute */
+               if (!fh->isdir != !(info->attribute & EFI_FILE_DIRECTORY)) {
+                       ret = EFI_ACCESS_DENIED;
+                       goto out;
+               }
+               /* Check for renaming */
+               new_file_name = malloc(utf16_utf8_strlen(info->file_name));
+               if (!new_file_name) {
+                       ret = EFI_OUT_OF_RESOURCES;
+                       goto out;
+               }
+               pos = new_file_name;
+               utf16_utf8_strcpy(&pos, info->file_name);
+               if (strcmp(new_file_name, filename)) {
+                       /* TODO: we do not support renaming */
+                       EFI_PRINT("Renaming not supported\n");
+                       free(new_file_name);
+                       ret = EFI_ACCESS_DENIED;
+                       goto out;
+               }
+               free(new_file_name);
+               /* Check for truncation */
+               if (set_blk_dev(fh)) {
+                       ret = EFI_DEVICE_ERROR;
+                       goto out;
+               }
+               if (fs_size(fh->path, &file_size)) {
+                       ret = EFI_DEVICE_ERROR;
+                       goto out;
+               }
+               if (file_size != info->file_size) {
+                       /* TODO: we do not support truncation */
+                       EFI_PRINT("Truncation not supported\n");
+                       ret = EFI_ACCESS_DENIED;
+                       goto out;
+               }
+               /*
+                * We do not care for the other attributes
+                * TODO: Support read only
+                */
+               ret = EFI_SUCCESS;
+       } else if (!guidcmp(info_type, &efi_file_system_info_guid)) {
+               if (buffer_size < sizeof(struct efi_file_system_info)) {
+                       ret = EFI_BAD_BUFFER_SIZE;
+                       goto out;
+               }
+       } else {
+               ret = EFI_UNSUPPORTED;
+       }
+out:
+       return EFI_EXIT(ret);
 }
 
 static efi_status_t EFIAPI efi_file_flush(struct efi_file_handle *file)
index fe66e7b9ffe1146a8bb27e28403649071c4bbd04..93feefd366cd0a267cb01bff247d51bf5e461ff3 100644 (file)
@@ -14,6 +14,8 @@
 const efi_guid_t efi_global_variable_guid = EFI_GLOBAL_VARIABLE_GUID;
 const efi_guid_t efi_guid_device_path = DEVICE_PATH_GUID;
 const efi_guid_t efi_guid_loaded_image = LOADED_IMAGE_GUID;
+const efi_guid_t efi_guid_loaded_image_device_path
+               = LOADED_IMAGE_DEVICE_PATH_GUID;
 const efi_guid_t efi_simple_file_system_protocol_guid =
                EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID;
 const efi_guid_t efi_file_info_guid = EFI_FILE_INFO_GUID;
@@ -59,10 +61,10 @@ static efi_status_t efi_print_image_info(struct efi_loaded_image_obj *obj,
 {
        printf("UEFI image");
        printf(" [0x%p:0x%p]",
-              obj->reloc_base, obj->reloc_base + obj->reloc_size - 1);
-       if (pc && pc >= obj->reloc_base &&
-           pc < obj->reloc_base + obj->reloc_size)
-               printf(" pc=0x%zx", pc - obj->reloc_base);
+              image->image_base, image->image_base + image->image_size - 1);
+       if (pc && pc >= image->image_base &&
+           pc < image->image_base + image->image_size)
+               printf(" pc=0x%zx", pc - image->image_base);
        if (image->file_path)
                printf(" '%pD'", image->file_path);
        printf("\n");
@@ -227,7 +229,6 @@ efi_status_t efi_load_pe(struct efi_loaded_image_obj *handle, void *efi,
        unsigned long rel_size;
        int rel_idx = IMAGE_DIRECTORY_ENTRY_BASERELOC;
        uint64_t image_base;
-       uint64_t image_size;
        unsigned long virt_size = 0;
        int supported = 0;
 
@@ -271,7 +272,6 @@ efi_status_t efi_load_pe(struct efi_loaded_image_obj *handle, void *efi,
                IMAGE_NT_HEADERS64 *nt64 = (void *)nt;
                IMAGE_OPTIONAL_HEADER64 *opt = &nt64->OptionalHeader;
                image_base = opt->ImageBase;
-               image_size = opt->SizeOfImage;
                efi_set_code_and_data_type(loaded_image_info, opt->Subsystem);
                efi_reloc = efi_alloc(virt_size,
                                      loaded_image_info->image_code_type);
@@ -287,7 +287,6 @@ efi_status_t efi_load_pe(struct efi_loaded_image_obj *handle, void *efi,
        } else if (nt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
                IMAGE_OPTIONAL_HEADER32 *opt = &nt->OptionalHeader;
                image_base = opt->ImageBase;
-               image_size = opt->SizeOfImage;
                efi_set_code_and_data_type(loaded_image_info, opt->Subsystem);
                efi_reloc = efi_alloc(virt_size,
                                      loaded_image_info->image_code_type);
@@ -306,6 +305,11 @@ efi_status_t efi_load_pe(struct efi_loaded_image_obj *handle, void *efi,
                return EFI_LOAD_ERROR;
        }
 
+       /* Copy PE headers */
+       memcpy(efi_reloc, efi, sizeof(*dos) + sizeof(*nt)
+              + nt->FileHeader.SizeOfOptionalHeader
+              + num_sections * sizeof(IMAGE_SECTION_HEADER));
+
        /* Load sections into RAM */
        for (i = num_sections - 1; i >= 0; i--) {
                IMAGE_SECTION_HEADER *sec = &sections[i];
@@ -330,10 +334,8 @@ efi_status_t efi_load_pe(struct efi_loaded_image_obj *handle, void *efi,
        invalidate_icache_all();
 
        /* Populate the loaded image interface bits */
-       loaded_image_info->image_base = efi;
-       loaded_image_info->image_size = image_size;
-       handle->reloc_base = efi_reloc;
-       handle->reloc_size = virt_size;
+       loaded_image_info->image_base = efi_reloc;
+       loaded_image_info->image_size = virt_size;
 
        return EFI_SUCCESS;
 }
index 55622d2fb40178652c57b8c57d5945259bf6a922..dbe29b89603e4898abef1a72b842964f3e56c3f2 100644 (file)
@@ -15,6 +15,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/* Magic number identifying memory allocated from pool */
+#define EFI_ALLOC_POOL_MAGIC 0x1fe67ddf6491caa2
+
 efi_uintn_t efi_memory_map_key;
 
 struct efi_mem_list {
@@ -33,7 +36,12 @@ LIST_HEAD(efi_mem);
 void *efi_bounce_buffer;
 #endif
 
-/*
+/**
+ * efi_pool_allocation - memory block allocated from pool
+ *
+ * @num_pages: number of pages allocated
+ * @checksum:  checksum
+ *
  * U-Boot services each EFI AllocatePool request as a separate
  * (multiple) page allocation.  We have to track the number of pages
  * to be able to free the correct amount later.
@@ -43,9 +51,26 @@ void *efi_bounce_buffer;
  */
 struct efi_pool_allocation {
        u64 num_pages;
+       u64 checksum;
        char data[] __aligned(ARCH_DMA_MINALIGN);
 };
 
+/**
+ * checksum() - calculate checksum for memory allocated from pool
+ *
+ * @alloc:     allocation header
+ * Return:     checksum, always non-zero
+ */
+static u64 checksum(struct efi_pool_allocation *alloc)
+{
+       u64 addr = (uintptr_t)alloc;
+       u64 ret = (addr >> 32) ^ (addr << 32) ^ alloc->num_pages ^
+                 EFI_ALLOC_POOL_MAGIC;
+       if (!ret)
+               ++ret;
+       return ret;
+}
+
 /*
  * Sorts the memory list from highest address to lowest address
  *
@@ -204,8 +229,8 @@ uint64_t efi_add_memory_map(uint64_t start, uint64_t pages, int memory_type,
        bool carve_again;
        uint64_t carved_pages = 0;
 
-       debug("%s: 0x%llx 0x%llx %d %s\n", __func__,
-             start, pages, memory_type, overlap_only_ram ? "yes" : "no");
+       EFI_PRINT("%s: 0x%llx 0x%llx %d %s\n", __func__,
+                 start, pages, memory_type, overlap_only_ram ? "yes" : "no");
 
        if (memory_type >= EFI_MAX_MEMORY_TYPE)
                return EFI_INVALID_PARAMETER;
@@ -409,17 +434,24 @@ void *efi_alloc(uint64_t len, int memory_type)
        return NULL;
 }
 
-/*
- * Free memory pages.
+/**
+ * efi_free_pages() - free memory pages
  *
- * @memory     start of the memory area to be freed
- * @pages      number of pages to be freed
- * @return     status code
+ * @memory:    start of the memory area to be freed
+ * @pages:     number of pages to be freed
+ * Return:     status code
  */
 efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages)
 {
        uint64_t r = 0;
 
+       /* Sanity check */
+       if (!memory || (memory & EFI_PAGE_MASK)) {
+               printf("%s: illegal free 0x%llx, 0x%zx\n", __func__,
+                      memory, pages);
+               return EFI_INVALID_PARAMETER;
+       }
+
        r = efi_add_memory_map(memory, pages, EFI_CONVENTIONAL_MEMORY, false);
        /* Merging of adjacent free regions is missing */
 
@@ -429,13 +461,13 @@ efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages)
        return EFI_NOT_FOUND;
 }
 
-/*
- * Allocate memory from pool.
+/**
+ * efi_allocate_pool - allocate memory from pool
  *
- * @pool_type  type of the pool from which memory is to be allocated
- * @size       number of bytes to be allocated
- * @buffer     allocated memory
- * @return     status code
+ * @pool_type: type of the pool from which memory is to be allocated
+ * @size:      number of bytes to be allocated
+ * @buffer:    allocated memory
+ * Return:     status code
  */
 efi_status_t efi_allocate_pool(int pool_type, efi_uintn_t size, void **buffer)
 {
@@ -458,17 +490,18 @@ efi_status_t efi_allocate_pool(int pool_type, efi_uintn_t size, void **buffer)
        if (r == EFI_SUCCESS) {
                alloc = (struct efi_pool_allocation *)(uintptr_t)addr;
                alloc->num_pages = num_pages;
+               alloc->checksum = checksum(alloc);
                *buffer = alloc->data;
        }
 
        return r;
 }
 
-/*
- * Free memory from pool.
+/**
+ * efi_free_pool() - free memory from pool
  *
- * @buffer     start of memory to be freed
- * @return     status code
+ * @buffer:    start of memory to be freed
+ * Return:     status code
  */
 efi_status_t efi_free_pool(void *buffer)
 {
@@ -479,8 +512,15 @@ efi_status_t efi_free_pool(void *buffer)
                return EFI_INVALID_PARAMETER;
 
        alloc = container_of(buffer, struct efi_pool_allocation, data);
-       /* Sanity check, was the supplied address returned by allocate_pool */
-       assert(((uintptr_t)alloc & EFI_PAGE_MASK) == 0);
+
+       /* Check that this memory was allocated by efi_allocate_pool() */
+       if (((uintptr_t)alloc & EFI_PAGE_MASK) ||
+           alloc->checksum != checksum(alloc)) {
+               printf("%s: illegal free 0x%p\n", __func__, buffer);
+               return EFI_INVALID_PARAMETER;
+       }
+       /* Avoid double free */
+       alloc->checksum = 0;
 
        r = efi_free_pages((uintptr_t)alloc, alloc->num_pages);
 
index 8266d06c2efc8ff1607b725e0497b618968d568b..a908843d87ab50d0fd989c160890fc7354905321 100644 (file)
@@ -10,6 +10,9 @@
 
 #define OBJ_LIST_NOT_INITIALIZED 1
 
+/* Language code for American English according to RFC 4646 */
+#define EN_US L"en-US"
+
 static efi_status_t efi_obj_list_initialized = OBJ_LIST_NOT_INITIALIZED;
 
 /* Initialize and populate EFI object list */
@@ -24,6 +27,30 @@ efi_status_t efi_init_obj_list(void)
         */
        efi_save_gd();
 
+       /*
+        * Variable PlatformLang defines the language that the machine has been
+        * configured for.
+        */
+       ret = EFI_CALL(efi_set_variable(L"PlatformLang",
+                                       &efi_global_variable_guid,
+                                       EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                       EFI_VARIABLE_RUNTIME_ACCESS,
+                                       sizeof(EN_US), EN_US));
+       if (ret != EFI_SUCCESS)
+               goto out;
+
+       /*
+        * Variable PlatformLangCodes defines the language codes that the
+        * machine can support.
+        */
+       ret = EFI_CALL(efi_set_variable(L"PlatformLangCodes",
+                                       &efi_global_variable_guid,
+                                       EFI_VARIABLE_BOOTSERVICE_ACCESS |
+                                       EFI_VARIABLE_RUNTIME_ACCESS,
+                                       sizeof(EN_US), EN_US));
+       if (ret != EFI_SUCCESS)
+               goto out;
+
        /* Initialize once only */
        if (efi_obj_list_initialized != OBJ_LIST_NOT_INITIALIZED)
                return efi_obj_list_initialized;
index 699f4184d932c1b3870951dd7d06e43ceb659d32..37728c3c165ddabf2af7ca7f254ffdf93bcfd54d 100644 (file)
@@ -180,7 +180,7 @@ efi_status_t EFIAPI efi_get_variable(u16 *variable_name,
        if (ret)
                return EFI_EXIT(ret);
 
-       debug("%s: get '%s'\n", __func__, native_name);
+       EFI_PRINT("get '%s'\n", native_name);
 
        val = env_get(native_name);
        free(native_name);
@@ -211,7 +211,7 @@ efi_status_t EFIAPI efi_get_variable(u16 *variable_name,
                if (hex2bin(data, s, len))
                        return EFI_EXIT(EFI_DEVICE_ERROR);
 
-               debug("%s: got value: \"%s\"\n", __func__, s);
+               EFI_PRINT("got value: \"%s\"\n", s);
        } else if ((s = prefix(val, "(utf8)"))) {
                unsigned len = strlen(s) + 1;
 
@@ -226,9 +226,9 @@ efi_status_t EFIAPI efi_get_variable(u16 *variable_name,
                memcpy(data, s, len);
                ((char *)data)[len] = '\0';
 
-               debug("%s: got value: \"%s\"\n", __func__, (char *)data);
+               EFI_PRINT("got value: \"%s\"\n", (char *)data);
        } else {
-               debug("%s: invalid value: '%s'\n", __func__, val);
+               EFI_PRINT("invalid value: '%s'\n", val);
                return EFI_EXIT(EFI_DEVICE_ERROR);
        }
 
@@ -485,7 +485,7 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name,
        s = bin2hex(s, data, data_size);
        *s = '\0';
 
-       debug("%s: setting: %s=%s\n", __func__, native_name, val);
+       EFI_PRINT("setting: %s=%s\n", native_name, val);
 
        if (env_set(native_name, val))
                ret = EFI_DEVICE_ERROR;
index 2ffdd65b759c73ba332fdec1a50b634c69e7f78e..d63b9e3addfd340d35c67284cc1ec7eb2f5c189c 100644 (file)
 #include <common.h>
 #include <efi_api.h>
 
-/*
+static efi_guid_t loaded_image_protocol_guid = LOADED_IMAGE_GUID;
+
+/**
+ * check_loaded_image_protocol() - check image_base/image_size
+ *
+ * Try to open the loaded image protocol. Check that this function is located
+ * between image_base and image_base + image_size.
+ *
+ * @image_handle:      handle of the loaded image
+ * @systable:          system table
+ * @return:            status code
+ */
+static efi_status_t EFIAPI check_loaded_image_protocol
+               (efi_handle_t image_handle, struct efi_system_table *systable)
+{
+       struct efi_simple_text_output_protocol *cout = systable->con_out;
+       struct efi_boot_services *boottime = systable->boottime;
+       struct efi_loaded_image *loaded_image_protocol;
+       efi_status_t ret;
+
+       /*
+        * Open the loaded image protocol.
+        */
+       ret = boottime->open_protocol
+                               (image_handle, &loaded_image_protocol_guid,
+                                (void **)&loaded_image_protocol, NULL,
+                                 NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
+       if (ret != EFI_SUCCESS) {
+               cout->output_string(cout,
+                                   L"Could not open loaded image protocol");
+               return ret;
+       }
+       if ((void *)check_loaded_image_protocol <
+           loaded_image_protocol->image_base ||
+           (void *)check_loaded_image_protocol >=
+           loaded_image_protocol->image_base +
+           loaded_image_protocol->image_size) {
+               cout->output_string(cout,
+                                   L"Incorrect image_base or image_size\n");
+               return EFI_NOT_FOUND;
+       }
+       return EFI_SUCCESS;
+}
+
+/**
  * Entry point of the EFI application.
  *
- * @handle     handle of the loaded image
- * @systable   system table
- * @return     status code
+ * @handle:    handle of the loaded image
+ * @systable:  system table
+ * @return:    status code
  */
 efi_status_t EFIAPI efi_main(efi_handle_t handle,
                             struct efi_system_table *systable)
 {
        struct efi_simple_text_output_protocol *con_out = systable->con_out;
+       efi_status_t ret = EFI_UNSUPPORTED;
 
        con_out->output_string(con_out, L"EFI application calling Exit\n");
 
+       if (check_loaded_image_protocol(handle, systable) != EFI_SUCCESS)
+               ret = EFI_NOT_FOUND;
+
        /* The return value is checked by the calling test */
-       systable->boottime->exit(handle, EFI_UNSUPPORTED, 0, NULL);
+       systable->boottime->exit(handle, ret, 0, NULL);
 
        /*
         * This statement should not be reached.
index 09a7e133a539488bf1f01f96e4821ec362fb7a6a..a51dc5e98670ccf02883ef5ee03633c05db9cdf0 100644 (file)
@@ -1088,18 +1088,18 @@ int fdtdec_decode_display_timing(const void *blob, int parent, int index,
        return ret;
 }
 
-int fdtdec_setup_mem_size_base(void)
+int fdtdec_setup_mem_size_base_fdt(const void *blob)
 {
        int ret, mem;
        struct fdt_resource res;
 
-       mem = fdt_path_offset(gd->fdt_blob, "/memory");
+       mem = fdt_path_offset(blob, "/memory");
        if (mem < 0) {
                debug("%s: Missing /memory node\n", __func__);
                return -EINVAL;
        }
 
-       ret = fdt_get_resource(gd->fdt_blob, mem, "reg", 0, &res);
+       ret = fdt_get_resource(blob, mem, "reg", 0, &res);
        if (ret != 0) {
                debug("%s: Unable to decode first memory bank\n", __func__);
                return -EINVAL;
@@ -1113,38 +1113,43 @@ int fdtdec_setup_mem_size_base(void)
        return 0;
 }
 
+int fdtdec_setup_mem_size_base(void)
+{
+       return fdtdec_setup_mem_size_base_fdt(gd->fdt_blob);
+}
+
 #if defined(CONFIG_NR_DRAM_BANKS)
 
 static int get_next_memory_node(const void *blob, int mem)
 {
        do {
-               mem = fdt_node_offset_by_prop_value(gd->fdt_blob, mem,
+               mem = fdt_node_offset_by_prop_value(blob, mem,
                                                    "device_type", "memory", 7);
        } while (!fdtdec_get_is_enabled(blob, mem));
 
        return mem;
 }
 
-int fdtdec_setup_memory_banksize(void)
+int fdtdec_setup_memory_banksize_fdt(const void *blob)
 {
        int bank, ret, mem, reg = 0;
        struct fdt_resource res;
 
-       mem = get_next_memory_node(gd->fdt_blob, -1);
+       mem = get_next_memory_node(blob, -1);
        if (mem < 0) {
                debug("%s: Missing /memory node\n", __func__);
                return -EINVAL;
        }
 
        for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) {
-               ret = fdt_get_resource(gd->fdt_blob, mem, "reg", reg++, &res);
+               ret = fdt_get_resource(blob, mem, "reg", reg++, &res);
                if (ret == -FDT_ERR_NOTFOUND) {
                        reg = 0;
-                       mem = get_next_memory_node(gd->fdt_blob, mem);
+                       mem = get_next_memory_node(blob, mem);
                        if (mem == -FDT_ERR_NOTFOUND)
                                break;
 
-                       ret = fdt_get_resource(gd->fdt_blob, mem, "reg", reg++, &res);
+                       ret = fdt_get_resource(blob, mem, "reg", reg++, &res);
                        if (ret == -FDT_ERR_NOTFOUND)
                                break;
                }
@@ -1164,6 +1169,12 @@ int fdtdec_setup_memory_banksize(void)
 
        return 0;
 }
+
+int fdtdec_setup_memory_banksize(void)
+{
+       return fdtdec_setup_memory_banksize_fdt(gd->fdt_blob);
+
+}
 #endif
 
 #if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
@@ -1171,17 +1182,22 @@ int fdtdec_setup_memory_banksize(void)
        CONFIG_IS_ENABLED(MULTI_DTB_FIT_LZO)
 static int uncompress_blob(const void *src, ulong sz_src, void **dstp)
 {
-       size_t sz_out = CONFIG_SPL_MULTI_DTB_FIT_UNCOMPRESS_SZ;
+       size_t sz_out = CONFIG_VAL(MULTI_DTB_FIT_UNCOMPRESS_SZ);
+       bool gzip = 0, lzo = 0;
        ulong sz_in = sz_src;
        void *dst;
        int rc;
 
        if (CONFIG_IS_ENABLED(GZIP))
-               if (gzip_parse_header(src, sz_in) < 0)
-                       return -1;
+               if (gzip_parse_header(src, sz_in) >= 0)
+                       gzip = 1;
        if (CONFIG_IS_ENABLED(LZO))
-               if (!lzop_is_valid_header(src))
-                       return -EBADMSG;
+               if (!gzip && lzop_is_valid_header(src))
+                       lzo = 1;
+
+       if (!gzip && !lzo)
+               return -EBADMSG;
+
 
        if (CONFIG_IS_ENABLED(MULTI_DTB_FIT_DYN_ALLOC)) {
                dst = malloc(sz_out);
@@ -1197,10 +1213,12 @@ static int uncompress_blob(const void *src, ulong sz_src, void **dstp)
 #  endif
        }
 
-       if (CONFIG_IS_ENABLED(GZIP))
+       if (CONFIG_IS_ENABLED(GZIP) && gzip)
                rc = gunzip(dst, sz_out, (u8 *)src, &sz_in);
-       else if (CONFIG_IS_ENABLED(LZO))
+       else if (CONFIG_IS_ENABLED(LZO) && lzo)
                rc = lzop_decompress(src, sz_in, dst, &sz_out);
+       else
+               hang();
 
        if (rc < 0) {
                /* not a valid compressed blob */
index 54b160d72bbd95106e4d32fe7ed253a521527225..56dbbe127baa3866795a14b120c46e2123d9aa38 100644 (file)
@@ -179,10 +179,10 @@ MKIMAGEFLAGS_boot.bin = -T atmelimage
 ifeq ($(CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER),y)
 MKIMAGEFLAGS_boot.bin += -n $(shell $(obj)/../tools/atmel_pmecc_params)
 
-boot.bin: $(obj)/../tools/atmel_pmecc_params
+$(obj)/boot.bin: $(obj)/../tools/atmel_pmecc_params
 endif
 
-boot.bin: $(obj)/u-boot-spl.bin FORCE
+$(obj)/boot.bin: $(obj)/u-boot-spl.bin FORCE
        $(call if_changed,mkimage)
 else
 ifdef CONFIG_ARCH_ZYNQ
@@ -225,7 +225,7 @@ endif
 endif
 
 ifeq ($(CONFIG_SYS_SOC),"at91")
-ALL-y  += boot.bin
+ALL-y  += $(obj)/boot.bin
 endif
 
 ALL-$(CONFIG_SPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-16bit-spl.bin
index 8c7c1592a562435a758b19ed84d1e6274994c260..fa98efc24c0be17ea60047e74b9ebf85a8dd0421 100644 (file)
@@ -4399,7 +4399,6 @@ CONFIG_THOR_RESET_OFF
 CONFIG_THUNDERX
 CONFIG_TIMESTAMP
 CONFIG_TIZEN
-CONFIG_TI_KEYSTONE_SERDES
 CONFIG_TI_KSNAV
 CONFIG_TI_SPI_MMAP
 CONFIG_TMU_TIMER
index 36b35ee536b1607dfe97a3c432ee763e6d2d8cea..bc226a8e6376a07c4c35850ea1ee78e6511cd1db 100644 (file)
@@ -141,7 +141,7 @@ def test_efi_selftest_text_input_ex(u_boot_console):
        u_boot_console.run_command(cmd=chr(4), wait_for_echo=False,
                                   send_nl=False, wait_for_prompt=False)
        m = u_boot_console.p.expect(
-               ['Unicode char 4 \(unknown\), scan code 0 \(CTRL\+Null\)'])
+               ['Unicode char 100 \\(\'d\'\\), scan code 0 \\(CTRL\\+Null\\)'])
        if m != 0:
                raise Exception('EOT failed in \'text input\' test')
        u_boot_console.drain_console()
index 43eeb4be0baf0a7b127996782d5a570b7874c3fd..9324657d216085fe847cecaf789961ee3c08d3a4 100644 (file)
@@ -13,6 +13,7 @@ supported_fs_basic = ['fat16', 'fat32', 'ext4']
 supported_fs_ext = ['fat16', 'fat32']
 supported_fs_mkdir = ['fat16', 'fat32']
 supported_fs_unlink = ['fat16', 'fat32']
+supported_fs_symlink = ['ext4']
 
 #
 # Filesystem test specific setup
@@ -48,6 +49,7 @@ def pytest_configure(config):
     global supported_fs_ext
     global supported_fs_mkdir
     global supported_fs_unlink
+    global supported_fs_symlink
 
     def intersect(listA, listB):
         return  [x for x in listA if x in listB]
@@ -59,6 +61,7 @@ def pytest_configure(config):
         supported_fs_ext =  intersect(supported_fs, supported_fs_ext)
         supported_fs_mkdir =  intersect(supported_fs, supported_fs_mkdir)
         supported_fs_unlink =  intersect(supported_fs, supported_fs_unlink)
+        supported_fs_symlink =  intersect(supported_fs, supported_fs_symlink)
 
 def pytest_generate_tests(metafunc):
     """Parametrize fixtures, fs_obj_xxx
@@ -84,6 +87,9 @@ def pytest_generate_tests(metafunc):
     if 'fs_obj_unlink' in metafunc.fixturenames:
         metafunc.parametrize('fs_obj_unlink', supported_fs_unlink,
             indirect=True, scope='module')
+    if 'fs_obj_symlink' in metafunc.fixturenames:
+        metafunc.parametrize('fs_obj_symlink', supported_fs_symlink,
+            indirect=True, scope='module')
 
 #
 # Helper functions
@@ -143,6 +149,8 @@ def mk_fs(config, fs_type, size, id):
         mkfs_opt = '-F 16'
     elif fs_type == 'fat32':
         mkfs_opt = '-F 32'
+    elif fs_type == 'ext4':
+        mkfs_opt = '-O ^metadata_csum'
     else:
         mkfs_opt = ''
 
@@ -523,3 +531,72 @@ def fs_obj_unlink(request, u_boot_config):
         call('rmdir %s' % mount_dir, shell=True)
         if fs_img:
             call('rm -f %s' % fs_img, shell=True)
+
+#
+# Fixture for symlink fs test
+#
+# NOTE: yield_fixture was deprecated since pytest-3.0
+@pytest.yield_fixture()
+def fs_obj_symlink(request, u_boot_config):
+    """Set up a file system to be used in symlink fs test.
+
+    Args:
+        request: Pytest request object.
+        u_boot_config: U-boot configuration.
+
+    Return:
+        A fixture for basic fs test, i.e. a triplet of file system type,
+        volume file name and  a list of MD5 hashes.
+    """
+    fs_type = request.param
+    fs_img = ''
+
+    fs_ubtype = fstype_to_ubname(fs_type)
+    check_ubconfig(u_boot_config, fs_ubtype)
+
+    mount_dir = u_boot_config.persistent_data_dir + '/mnt'
+
+    small_file = mount_dir + '/' + SMALL_FILE
+    medium_file = mount_dir + '/' + MEDIUM_FILE
+
+    try:
+
+        # 3GiB volume
+        fs_img = mk_fs(u_boot_config, fs_type, 0x40000000, '1GB')
+
+        # Mount the image so we can populate it.
+        check_call('mkdir -p %s' % mount_dir, shell=True)
+        mount_fs(fs_type, fs_img, mount_dir)
+
+        # Create a subdirectory.
+        check_call('mkdir %s/SUBDIR' % mount_dir, shell=True)
+
+        # Create a small file in this image.
+        check_call('dd if=/dev/urandom of=%s bs=1M count=1'
+                   % small_file, shell=True)
+
+        # Create a medium file in this image.
+        check_call('dd if=/dev/urandom of=%s bs=10M count=1'
+                   % medium_file, shell=True)
+
+        # Generate the md5sums of reads that we will test against small file
+        out = check_output(
+            'dd if=%s bs=1M skip=0 count=1 2> /dev/null | md5sum'
+            % small_file, shell=True)
+        md5val = [out.split()[0]]
+        out = check_output(
+            'dd if=%s bs=10M skip=0 count=1 2> /dev/null | md5sum'
+            % medium_file, shell=True)
+        md5val.extend([out.split()[0]])
+
+        umount_fs(mount_dir)
+    except CalledProcessError:
+        pytest.skip('Setup failed for filesystem: ' + fs_type)
+        return
+    else:
+        yield [fs_ubtype, fs_img, md5val]
+    finally:
+        umount_fs(mount_dir)
+        call('rmdir %s' % mount_dir, shell=True)
+        if fs_img:
+            call('rm -f %s' % fs_img, shell=True)
index 5f107562d95205e1957b10d98da8cea1ed0c9f29..35b2bb65183d6742059c9e2f4ebea9d79fe782b7 100644 (file)
@@ -6,6 +6,9 @@ MIN_FILE='testfile'
 # $SMALL_FILE is the name of the 1MB file in the file system image
 SMALL_FILE='1MB.file'
 
+# $MEDIUM_FILE is the name of the 10MB file in the file system image
+MEDIUM_FILE='10MB.file'
+
 # $BIG_FILE is the name of the 2.5GB file in the file system image
 BIG_FILE='2.5GB.file'
 
diff --git a/test/py/tests/test_fs/fstest_helpers.py b/test/py/tests/test_fs/fstest_helpers.py
new file mode 100644 (file)
index 0000000..faec298
--- /dev/null
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier:      GPL-2.0+
+# Copyright (c) 2019, Texas Instrument
+# Author: JJ Hiblot <jjhiblot@ti.com>
+#
+
+from subprocess import check_call, CalledProcessError
+
+def assert_fs_integrity(fs_type, fs_img):
+    try:
+        if fs_type == 'ext4':
+            check_call('fsck.ext4 -n -f %s' % fs_img, shell=True)
+    except CalledProcessError:
+        raise
index 140ca29ac73d31077256a8784e2709fd19092c57..71f3e86fb18db96f34287d7fc4d71d9c09788c68 100644 (file)
@@ -11,6 +11,7 @@ This test verifies basic read/write operation on file system.
 import pytest
 import re
 from fstest_defs import *
+from fstest_helpers import assert_fs_integrity
 
 @pytest.mark.boardspec('sandbox')
 @pytest.mark.slow
@@ -237,6 +238,7 @@ class TestFsBasic(object):
                 'md5sum %x $filesize' % ADDR,
                 'setenv filesize'])
             assert(md5val[0] in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_fs12(self, u_boot_console, fs_obj_basic):
         """
@@ -252,6 +254,7 @@ class TestFsBasic(object):
                 'host bind 0 %s' % fs_img,
                 '%swrite host 0:0 %x /. 0x10' % (fs_type, ADDR)])
             assert('Unable to write' in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_fs13(self, u_boot_console, fs_obj_basic):
         """
@@ -286,3 +289,4 @@ class TestFsBasic(object):
                 'md5sum %x $filesize' % ADDR,
                 'setenv filesize'])
             assert(md5val[0] in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
index 06cad5516d583a6a5da8d77da7d37f9b97360dfc..2c47738b8df241eda4c0c079de0588b778026c74 100644 (file)
@@ -11,6 +11,7 @@ This test verifies extended write operation on file system.
 import pytest
 import re
 from fstest_defs import *
+from fstest_helpers import assert_fs_integrity
 
 @pytest.mark.boardspec('sandbox')
 @pytest.mark.slow
@@ -36,6 +37,7 @@ class TestFsExt(object):
                 'md5sum %x $filesize' % ADDR,
                 'setenv filesize'])
             assert(md5val[0] in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_fs_ext2(self, u_boot_console, fs_obj_ext):
         """
@@ -58,6 +60,7 @@ class TestFsExt(object):
                 'md5sum %x $filesize' % ADDR,
                 'setenv filesize'])
             assert(md5val[0] in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_fs_ext3(self, u_boot_console, fs_obj_ext):
         """
@@ -72,6 +75,7 @@ class TestFsExt(object):
                 '%swrite host 0:0 %x /dir1/none/%s.w3 $filesize'
                     % (fs_type, ADDR, MIN_FILE)])
             assert('Unable to write "/dir1/none/' in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_fs_ext4(self, u_boot_console, fs_obj_ext):
         """
@@ -104,6 +108,7 @@ class TestFsExt(object):
                 'md5sum %x $filesize' % ADDR,
                 'setenv filesize'])
             assert(md5val[1] in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_fs_ext5(self, u_boot_console, fs_obj_ext):
         """
@@ -136,6 +141,7 @@ class TestFsExt(object):
                 'md5sum %x $filesize' % ADDR,
                 'setenv filesize'])
             assert(md5val[2] in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_fs_ext6(self, u_boot_console, fs_obj_ext):
         """
@@ -160,6 +166,7 @@ class TestFsExt(object):
                 'printenv filesize',
                 'setenv filesize'])
             assert('filesize=0' in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_fs_ext7(self, u_boot_console, fs_obj_ext):
         """
@@ -192,6 +199,7 @@ class TestFsExt(object):
                 'md5sum %x $filesize' % ADDR,
                 'setenv filesize'])
             assert(md5val[3] in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_fs_ext8(self, u_boot_console, fs_obj_ext):
         """
@@ -209,6 +217,7 @@ class TestFsExt(object):
                 '%swrite host 0:0 %x /dir1/%s.w8 0x1400 %x'
                     % (fs_type, ADDR, MIN_FILE, 0x100000 + 0x1400))
             assert('Unable to write "/dir1' in output)
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_fs_ext9(self, u_boot_console, fs_obj_ext):
         """
@@ -223,3 +232,4 @@ class TestFsExt(object):
                 '%swrite host 0:0 %x /dir1/%s.w9 0x1400 0x1400'
                     % (fs_type, ADDR, MIN_FILE)])
             assert('Unable to write "/dir1' in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
index b3fe11cf3b52f8c7230041586a12b0033145b8c7..fa9561ec359fdb386abc26a69e268b2b150d8bc8 100644 (file)
@@ -9,6 +9,7 @@ This test verifies mkdir operation on file system.
 """
 
 import pytest
+from fstest_helpers import assert_fs_integrity
 
 @pytest.mark.boardspec('sandbox')
 @pytest.mark.slow
@@ -29,6 +30,8 @@ class TestMkdir(object):
                 '%sls host 0:0 dir1' % fs_type)
             assert('./'   in output)
             assert('../'  in output)
+            assert_fs_integrity(fs_type, fs_img)
+
 
     def test_mkdir2(self, u_boot_console, fs_obj_mkdir):
         """
@@ -46,6 +49,7 @@ class TestMkdir(object):
                 '%sls host 0:0 dir1/dir2' % fs_type)
             assert('./'   in output)
             assert('../'  in output)
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_mkdir3(self, u_boot_console, fs_obj_mkdir):
         """
@@ -58,6 +62,7 @@ class TestMkdir(object):
                 'host bind 0 %s' % fs_img,
                 '%smkdir host 0:0 none/dir3' % fs_type])
             assert('Unable to create a directory' in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_mkdir4(self, u_boot_console, fs_obj_mkdir):
         """
@@ -69,6 +74,7 @@ class TestMkdir(object):
                 'host bind 0 %s' % fs_img,
                 '%smkdir host 0:0 .' % fs_type])
             assert('Unable to create a directory' in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_mkdir5(self, u_boot_console, fs_obj_mkdir):
         """
@@ -80,6 +86,7 @@ class TestMkdir(object):
                 'host bind 0 %s' % fs_img,
                 '%smkdir host 0:0 ..' % fs_type])
             assert('Unable to create a directory' in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_mkdir6(self, u_boot_console, fs_obj_mkdir):
         """
@@ -111,3 +118,4 @@ class TestMkdir(object):
                 '%sls host 0:0 dir6/0123456789abcdef13/..' % fs_type)
             assert('0123456789abcdef00/'  in output)
             assert('0123456789abcdef13/'  in output)
+            assert_fs_integrity(fs_type, fs_img)
diff --git a/test/py/tests/test_fs/test_symlink.py b/test/py/tests/test_fs/test_symlink.py
new file mode 100644 (file)
index 0000000..9ced101
--- /dev/null
@@ -0,0 +1,130 @@
+# SPDX-License-Identifier:      GPL-2.0+
+# Copyright (c) 2019, Texas Instrument
+# Author: Jean-Jacques Hiblot <jjhiblot@ti.com>
+#
+# U-Boot File System:symlink Test
+
+"""
+This test verifies unlink operation (deleting a file or a directory)
+on file system.
+"""
+
+import pytest
+import re
+from fstest_defs import *
+from fstest_helpers import assert_fs_integrity
+
+
+@pytest.mark.boardspec('sandbox')
+@pytest.mark.slow
+class TestSymlink(object):
+    def test_symlink1(self, u_boot_console, fs_obj_symlink):
+        """
+        Test Case 1 - create a link. and follow it when reading
+        """
+        fs_type, fs_img, md5val = fs_obj_symlink
+        with u_boot_console.log.section('Test Case 1 - create link and read'):
+            output = u_boot_console.run_command_list([
+                'host bind 0 %s' % fs_img,
+                'setenv filesize',
+                'ln host 0:0 %s /%s.link ' % (SMALL_FILE, SMALL_FILE),
+            ])
+            assert('' in ''.join(output))
+
+            output = u_boot_console.run_command_list([
+                '%sload host 0:0 %x /%s.link' % (fs_type, ADDR, SMALL_FILE),
+                'printenv filesize'])
+            assert('filesize=100000' in ''.join(output))
+
+            # Test Case 4b - Read full 1MB of small file
+            output = u_boot_console.run_command_list([
+                'md5sum %x $filesize' % ADDR,
+                'setenv filesize'])
+            assert(md5val[0] in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
+
+    def test_symlink2(self, u_boot_console, fs_obj_symlink):
+        """
+        Test Case 2 - create chained links
+        """
+        fs_type, fs_img, md5val = fs_obj_symlink
+        with u_boot_console.log.section('Test Case 2 - create chained links'):
+            output = u_boot_console.run_command_list([
+                'host bind 0 %s' % fs_img,
+                'setenv filesize',
+                'ln host 0:0 %s /%s.link1 ' % (SMALL_FILE, SMALL_FILE),
+                'ln host 0:0 /%s.link1 /SUBDIR/%s.link2' % (
+                    SMALL_FILE, SMALL_FILE),
+                'ln host 0:0 SUBDIR/%s.link2 /%s.link3' % (
+                    SMALL_FILE, SMALL_FILE),
+            ])
+            assert('' in ''.join(output))
+
+            output = u_boot_console.run_command_list([
+                '%sload host 0:0 %x /%s.link3' % (fs_type, ADDR, SMALL_FILE),
+                'printenv filesize'])
+            assert('filesize=100000' in ''.join(output))
+
+            # Test Case 4b - Read full 1MB of small file
+            output = u_boot_console.run_command_list([
+                'md5sum %x $filesize' % ADDR,
+                'setenv filesize'])
+            assert(md5val[0] in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
+
+    def test_symlink3(self, u_boot_console, fs_obj_symlink):
+        """
+        Test Case 3 - replace file/link with link
+        """
+        fs_type, fs_img, md5val = fs_obj_symlink
+        with u_boot_console.log.section('Test Case 1 - create link and read'):
+            output = u_boot_console.run_command_list([
+                'host bind 0 %s' % fs_img,
+                'setenv filesize',
+                'ln host 0:0 %s /%s ' % (MEDIUM_FILE, SMALL_FILE),
+                'ln host 0:0 %s /%s.link ' % (MEDIUM_FILE, MEDIUM_FILE),
+            ])
+            assert('' in ''.join(output))
+
+            output = u_boot_console.run_command_list([
+                '%sload host 0:0 %x /%s' % (fs_type, ADDR, SMALL_FILE),
+                'printenv filesize'])
+            assert('filesize=a00000' in ''.join(output))
+
+            output = u_boot_console.run_command_list([
+                'md5sum %x $filesize' % ADDR,
+                'setenv filesize'])
+            assert(md5val[1] in ''.join(output))
+
+            output = u_boot_console.run_command_list([
+                'ln host 0:0 %s.link /%s ' % (MEDIUM_FILE, SMALL_FILE),
+                '%sload host 0:0 %x /%s' % (fs_type, ADDR, SMALL_FILE),
+                'printenv filesize'])
+            assert('filesize=a00000' in ''.join(output))
+
+            output = u_boot_console.run_command_list([
+                'md5sum %x $filesize' % ADDR,
+                'setenv filesize'])
+            assert(md5val[1] in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
+
+    def test_symlink4(self, u_boot_console, fs_obj_symlink):
+        """
+        Test Case 4 - create a broken link
+        """
+        fs_type, fs_img, md5val = fs_obj_symlink
+        with u_boot_console.log.section('Test Case 1 - create link and read'):
+
+            output = u_boot_console.run_command_list([
+                'setenv filesize',
+                'ln host 0:0 nowhere /link ',
+            ])
+            assert('' in ''.join(output))
+
+            output = u_boot_console.run_command(
+                '%sload host 0:0 %x /link' %
+                (fs_type, ADDR))
+            with u_boot_console.disable_check('error_notification'):
+                output = u_boot_console.run_command('printenv filesize')
+            assert('"filesize" not defined' in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
index 2b817468eda07dc1e21aeedfb3da9ac6b59b2130..97aafc63bb58b01f479293c6d377ba74bb127225 100644 (file)
@@ -10,6 +10,7 @@ on file system.
 """
 
 import pytest
+from fstest_helpers import assert_fs_integrity
 
 @pytest.mark.boardspec('sandbox')
 @pytest.mark.slow
@@ -30,6 +31,7 @@ class TestUnlink(object):
                 '%sls host 0:0 dir1/' % fs_type)
             assert(not 'file1' in output)
             assert('file2' in output)
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_unlink2(self, u_boot_console, fs_obj_unlink):
         """
@@ -48,6 +50,7 @@ class TestUnlink(object):
             output = u_boot_console.run_command(
                 '%sls host 0:0 dir2' % fs_type)
             assert('0 file(s), 2 dir(s)' in output)
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_unlink3(self, u_boot_console, fs_obj_unlink):
         """
@@ -59,6 +62,7 @@ class TestUnlink(object):
                 'host bind 0 %s' % fs_img,
                 '%srm host 0:0 dir1/nofile' % fs_type])
             assert('nofile: doesn\'t exist' in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_unlink4(self, u_boot_console, fs_obj_unlink):
         """
@@ -71,9 +75,10 @@ class TestUnlink(object):
                 '%srm host 0:0 dir4' % fs_type])
             assert('' == ''.join(output))
 
-        output = u_boot_console.run_command(
-            '%sls host 0:0 /' % fs_type)
-        assert(not 'dir4' in output)
+            output = u_boot_console.run_command(
+                '%sls host 0:0 /' % fs_type)
+            assert(not 'dir4' in output)
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_unlink5(self, u_boot_console, fs_obj_unlink):
         """
@@ -86,6 +91,7 @@ class TestUnlink(object):
                 'host bind 0 %s' % fs_img,
                 '%srm host 0:0 dir5' % fs_type])
             assert('directory is not empty' in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_unlink6(self, u_boot_console, fs_obj_unlink):
         """
@@ -97,6 +103,7 @@ class TestUnlink(object):
                 'host bind 0 %s' % fs_img,
                 '%srm host 0:0 dir5/.' % fs_type])
             assert('directory is not empty' in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
 
     def test_unlink7(self, u_boot_console, fs_obj_unlink):
         """
@@ -108,3 +115,4 @@ class TestUnlink(object):
                 'host bind 0 %s' % fs_img,
                 '%srm host 0:0 dir5/..' % fs_type])
             assert('directory is not empty' in ''.join(output))
+            assert_fs_integrity(fs_type, fs_img)
index a13bc0a5f6089ec9ad168e3a9d9347ae800732bd..2dc715bb51018ae17727e6aa2072b08fe77a0544 100644 (file)
@@ -6,6 +6,7 @@
 # read if the test configuration contains a CRC of the expected data.
 
 import pytest
+import time
 import u_boot_utils
 
 """
@@ -57,6 +58,116 @@ env__mmc_rd_configs = (
 )
 """
 
+def mmc_dev(u_boot_console, is_emmc, devid, partid):
+    """Run the "mmc dev" command.
+
+    Args:
+        u_boot_console: A U-Boot console connection.
+        is_emmc: Whether the device is eMMC
+        devid: Device ID
+        partid: Partition ID
+
+    Returns:
+        Nothing.
+    """
+
+    # Select MMC device
+    cmd = 'mmc dev %d' % devid
+    if is_emmc:
+        cmd += ' %d' % partid
+    response = u_boot_console.run_command(cmd)
+    assert 'no card present' not in response
+    if is_emmc:
+        partid_response = '(part %d)' % partid
+    else:
+        partid_response = ''
+    good_response = 'mmc%d%s is current device' % (devid, partid_response)
+    assert good_response in response
+
+@pytest.mark.buildconfigspec('cmd_mmc')
+def test_mmc_dev(u_boot_console, env__mmc_rd_config):
+    """Test the "mmc dev" command.
+
+    Args:
+        u_boot_console: A U-Boot console connection.
+        env__mmc_rd_config: The single MMC configuration on which
+            to run the test. See the file-level comment above for details
+            of the format.
+
+    Returns:
+        Nothing.
+    """
+
+    is_emmc = env__mmc_rd_config['is_emmc']
+    devid = env__mmc_rd_config['devid']
+    partid = env__mmc_rd_config.get('partid', 0)
+
+    # Select MMC device
+    mmc_dev(u_boot_console, is_emmc, devid, partid)
+
+@pytest.mark.buildconfigspec('cmd_mmc')
+def test_mmc_rescan(u_boot_console, env__mmc_rd_config):
+    """Test the "mmc rescan" command.
+
+    Args:
+        u_boot_console: A U-Boot console connection.
+        env__mmc_rd_config: The single MMC configuration on which
+            to run the test. See the file-level comment above for details
+            of the format.
+
+    Returns:
+        Nothing.
+    """
+
+    is_emmc = env__mmc_rd_config['is_emmc']
+    devid = env__mmc_rd_config['devid']
+    partid = env__mmc_rd_config.get('partid', 0)
+
+    # Select MMC device
+    mmc_dev(u_boot_console, is_emmc, devid, partid)
+
+    # Rescan MMC device
+    cmd = 'mmc rescan'
+    response = u_boot_console.run_command(cmd)
+    assert 'no card present' not in response
+
+@pytest.mark.buildconfigspec('cmd_mmc')
+def test_mmc_info(u_boot_console, env__mmc_rd_config):
+    """Test the "mmc info" command.
+
+    Args:
+        u_boot_console: A U-Boot console connection.
+        env__mmc_rd_config: The single MMC configuration on which
+            to run the test. See the file-level comment above for details
+            of the format.
+
+    Returns:
+        Nothing.
+    """
+
+    is_emmc = env__mmc_rd_config['is_emmc']
+    devid = env__mmc_rd_config['devid']
+    partid = env__mmc_rd_config.get('partid', 0)
+    info_device = env__mmc_rd_config['info_device']
+    info_speed = env__mmc_rd_config['info_speed']
+    info_mode = env__mmc_rd_config['info_mode']
+    info_buswidth = env__mmc_rd_config['info_buswidth']
+
+    # Select MMC device
+    mmc_dev(u_boot_console, is_emmc, devid, partid)
+
+    # Read MMC device information
+    cmd = 'mmc info'
+    response = u_boot_console.run_command(cmd)
+    good_response = "Device: %s" % info_device
+    assert good_response in response
+    good_response = "Bus Speed: %s" % info_speed
+    assert good_response in response
+    good_response = "Mode : %s" % info_mode
+    assert good_response in response
+    good_response = "Bus Width: %s" % info_buswidth
+    assert good_response in response
+
 @pytest.mark.buildconfigspec('cmd_mmc')
 def test_mmc_rd(u_boot_console, env__mmc_rd_config):
     """Test the "mmc read" command.
@@ -77,6 +188,7 @@ def test_mmc_rd(u_boot_console, env__mmc_rd_config):
     sector = env__mmc_rd_config.get('sector', 0)
     count_sectors = env__mmc_rd_config.get('count', 1)
     expected_crc32 = env__mmc_rd_config.get('crc32', None)
+    read_duration_max = env__mmc_rd_config.get('read_duration_max', 0)
 
     count_bytes = count_sectors * 512
     bcfg = u_boot_console.config.buildconfig
@@ -86,17 +198,7 @@ def test_mmc_rd(u_boot_console, env__mmc_rd_config):
     addr = '0x%08x' % ram_base
 
     # Select MMC device
-    cmd = 'mmc dev %d' % devid
-    if is_emmc:
-        cmd += ' %d' % partid
-    response = u_boot_console.run_command(cmd)
-    assert 'no card present' not in response
-    if is_emmc:
-        partid_response = '(part %d)' % partid
-    else:
-        partid_response = ''
-    good_response = 'mmc%d%s is current device' % (devid, partid_response)
-    assert good_response in response
+    mmc_dev(u_boot_console, is_emmc, devid, partid)
 
     # Clear target RAM
     if expected_crc32:
@@ -113,7 +215,9 @@ def test_mmc_rd(u_boot_console, env__mmc_rd_config):
 
     # Read data
     cmd = 'mmc read %s %x %x' % (addr, sector, count_sectors)
+    tstart = time.time()
     response = u_boot_console.run_command(cmd)
+    tend = time.time()
     good_response = 'MMC read: dev # %d, block # %d, count %d ... %d blocks read: OK' % (
         devid, sector, count_sectors, count_sectors)
     assert good_response in response
@@ -126,3 +230,10 @@ def test_mmc_rd(u_boot_console, env__mmc_rd_config):
             assert expected_crc32 in response
         else:
             u_boot_console.log.warning('CONFIG_CMD_CRC32 != y: Skipping check')
+
+    # Check if the command did not take too long
+    if read_duration_max:
+        elapsed = tend - tstart
+        u_boot_console.log.info('Reading %d bytes took %f seconds' %
+                                (count_bytes, elapsed))
+        assert elapsed <= (read_duration_max - 0.01)
index a88a3830c0c8d41c93765474622205f8b43c22d8..dffaf9043a040815efedac502338308e3228eb9d 100644 (file)
@@ -1273,6 +1273,13 @@ static void *image_create_v1(size_t *imagesz, struct image_tool_params *params,
        e = image_find_option(IMAGE_CFG_DEBUG);
        if (e)
                main_hdr->flags = e->debug ? 0x1 : 0;
+       e = image_find_option(IMAGE_CFG_BINARY);
+       if (e) {
+               char *s = strrchr(e->binary.file, '/');
+
+               if (strcmp(s, "/binary.0") == 0)
+                       main_hdr->destaddr = cpu_to_le32(params->addr);
+       }
 
 #if defined(CONFIG_KWB_SECURE)
        if (image_get_csk_index() >= 0) {