arm64: tegra: add BPMP support
Subsystems (3)
cover arm64: tegra: add BPMP support
Hi,
This series introduce the first announced Boot and Power Management Processor (BPMP) for the new generation Tegra SoCs, which is designed for boot process handling and offloading the power management tasks from the CPU.
We also add some very initial and basic support for Tegra186 SoC, which supports debug console and initrd for initial bring up currently. More drivers and functions can be supported based on this later.
Thanks,
Joseph
Joseph Lo (10):
Documentation: dt-bindings: mailbox: tegra: Add binding for HSP
mailbox
mailbox: tegra-hsp: Add HSP(Hardware Synchronization Primitives)
driver
Documentation: dt-bindings: firmware: tegra: add bindings of the BPMP
firmware: tegra: add IVC library
firmware: tegra: add BPMP support
soc/tegra: Add Tegra186 support
arm64: defconfig: Enable Tegra186 SoC
arm64: dts: tegra: Add Tegra186 support
arm64: dts: tegra: Add NVIDIA Tegra186 P3310 main board support
arm64: dts: tegra: Add NVIDIA P2771 board support
.../bindings/firmware/nvidia,tegra186-bpmp.txt | 61 + .../bindings/mailbox/nvidia,tegra186-hsp.txt | 42 + arch/arm64/boot/dts/nvidia/Makefile | 1 + arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts | 8 + arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi | 30 + arch/arm64/boot/dts/nvidia/tegra186.dtsi | 77 + arch/arm64/configs/defconfig | 1 + drivers/firmware/Kconfig | 1 + drivers/firmware/Makefile | 1 + drivers/firmware/tegra/Kconfig | 25 + drivers/firmware/tegra/Makefile | 2 + drivers/firmware/tegra/bpmp.c | 713 +++++++++ drivers/firmware/tegra/ivc.c | 659 ++++++++ drivers/mailbox/Kconfig | 9 + drivers/mailbox/Makefile | 2 + drivers/mailbox/tegra-hsp.c | 306 ++++ drivers/soc/tegra/Kconfig | 14 + include/dt-bindings/mailbox/tegra-hsp.h | 20 + include/soc/tegra/bpmp.h | 29 + include/soc/tegra/bpmp_abi.h | 1601 ++++++++++++++++++++ include/soc/tegra/ivc.h | 102 ++ 21 files changed, 3704 insertions(+) create mode 100644 Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt create mode 100644 Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt create mode 100644 arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts create mode 100644 arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi create mode 100644 arch/arm64/boot/dts/nvidia/tegra186.dtsi create mode 100644 drivers/firmware/tegra/Kconfig create mode 100644 drivers/firmware/tegra/Makefile create mode 100644 drivers/firmware/tegra/bpmp.c create mode 100644 drivers/firmware/tegra/ivc.c create mode 100644 drivers/mailbox/tegra-hsp.c create mode 100644 include/dt-bindings/mailbox/tegra-hsp.h create mode 100644 include/soc/tegra/bpmp.h create mode 100644 include/soc/tegra/bpmp_abi.h create mode 100644 include/soc/tegra/ivc.h
Signature · 1 line
2.9.0
PATCH 1/10 Documentation: dt-bindings: mailbox: tegra: Add binding for HSP mailbox
Add DT binding for the Hardware Synchronization Primitives (HSP). The HSP is designed for the processors to share resources and communicate together. It provides a set of hardware synchronization primitives for interprocessor communication. So the interprocessor communication (IPC) protocols can use hardware synchronization primitive, when operating between two processors not in an SMP relationship.
--- .../bindings/mailbox/nvidia,tegra186-hsp.txt | 42 ++++++++++++++++++++++ include/dt-bindings/mailbox/tegra-hsp.h | 20 +++++++++++ 2 files changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt create mode 100644 include/dt-bindings/mailbox/tegra-hsp.h
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt new file +42 -0
@@ -0,0 +1,42 @@ +NVIDIA Tegra Hardware Synchronization Primitives (HSP) + +The HSP modules are used for the processors to share resources and communicate +together. It provides a set of hardware synchronization primitives for +interprocessor communication. So the interprocessor communication (IPC) +protocols can use hardware synchronization primitives, when operating between +two processors not in an SMP relationship. + +The features that HSP supported are shared mailboxes, shared semaphores, +arbitrated semaphores and doorbells. + +Required properties: +- name : Should be hsp +- compatible : Should be "nvidia,tegra<chip>-hsp" +- reg : Offset and length of the register set for the device +- interrupts : Should contain the HSP interrupts +- interrupt-names: Should contain the names of the HSP interrupts that the + client are using. + "doorbell" +- nvidia,hsp-function : Specifies one of the HSP functions that the HSP unit + will be supported. The function ID can be found in the + header file <dt-bindings/mailbox/tegra-hsp.h>. +- #mbox-cells : Should be 1. Specifies the HSP master that will be enabled of + the HSP client. The master ID constants can be found in the + header file <dt-bindings/mailbox/tegra-hsp.h>. + +Example: + +hsp_top: hsp@3c00000 { + compatible = "nvidia,tegra186-hsp"; + reg = <0x0 0x03c00000 0x0 0xa0000>; + interrupts = <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "doorbell"; + nvidia,hsp-function = <HSP_DOORBELL>; + #mbox-cells = <1>; +}; + +bpmp@d0000000 { + ... + mboxes = <&hsp_top HSP_DB_MASTER_BPMP>; + ... +};
include/dt-bindings/mailbox/tegra-hsp.h new file +20 -0
@@ -0,0 +1,20 @@ +/* +* This header provides constants for binding nvidia,tegra<chip>-hsp. +* +* The number with HSP_DB_MASTER prefix indicates the bit that is +* associated with a master ID in the doorbell registers. +*/ + + +#ifndef _DT_BINDINGS_MAILBOX_TEGRA186_HSP_H +#define _DT_BINDINGS_MAILBOX_TEGRA186_HSP_H + +#define HSP_SHARED_MAILBOX 0 +#define HSP_SHARED_SEMAPHORE 1 +#define HSP_ARBITRATED_SEMAPHORE 2 +#define HSP_DOORBELL 3 + +#define HSP_DB_MASTER_CCPLEX 17 +#define HSP_DB_MASTER_BPMP 19 + +#endif /* _DT_BINDINGS_MAILBOX_TEGRA186_HSP_H */
Signature · 1 line
2.9.0
PATCH 2/10 mailbox: tegra-hsp: Add HSP(Hardware Synchronization Primitives) driver
In reply to Joseph LoThe Tegra HSP mailbox driver implements the signaling doorbell-based interprocessor communication (IPC) for remote processors currently. The HSP HW modules support some different features for that, which are shared mailboxes, shared semaphores, arbitrated semaphores, and doorbells. And there are multiple HSP HW instances on the chip. So the driver is extendable to support more features for different IPC requirement.
The driver of remote processor can use it as a mailbox client and deal with the IPC protocol to synchronize the data communications.
--- drivers/mailbox/Kconfig | 9 ++ drivers/mailbox/Makefile | 2 + drivers/mailbox/tegra-hsp.c | 306 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 317 insertions(+) create mode 100644 drivers/mailbox/tegra-hsp.c
drivers/mailbox/Kconfig +9 -0
@@ -114,6 +114,15 @@ config MAILBOX_TEST Test client to help with testing new Controller driver implementations. +config TEGRA_HSP_MBOX + bool "Tegra HSP(Hardware Synchronization Primitives) Driver" + depends on ARCH_TEGRA_186_SOC + help + The Tegra HSP driver is used for the interprocessor communication + between different remote processors and host processors on Tegra186 + and later SoCs. Say Y here if you want to have this support. + If unsure say N. + config XGENE_SLIMPRO_MBOX tristate "APM SoC X-Gene SLIMpro Mailbox Controller" depends on ARCH_XGENE
drivers/mailbox/Makefile +2 -0
@@ -25,3 +25,5 @@ obj-$(CONFIG_TI_MESSAGE_MANAGER) += ti-msgmgr.o obj-$(CONFIG_XGENE_SLIMPRO_MBOX) += mailbox-xgene-slimpro.o obj-$(CONFIG_HI6220_MBOX) += hi6220-mailbox.o + +obj-${CONFIG_TEGRA_HSP_MBOX} += tegra-hsp.o
drivers/mailbox/tegra-hsp.c new file +306 -0
306 lines not on this page · raw message
Signature · 1 line
2.9.0
PATCH 3/10 Documentation: dt-bindings: firmware: tegra: add bindings of the BPMP
In reply to Joseph LoThe BPMP is a specific processor in Tegra chip, which is designed for booting process handling and offloading the power management tasks from the CPU. The binding document defines the resources that would be used by the BPMP firmware driver, which can create the interprocessor communication (IPC) between the CPU and BPMP.
--- .../bindings/firmware/nvidia,tegra186-bpmp.txt | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt new file +61 -0
@@ -0,0 +1,61 @@ +NVIDIA Tegra Boot and Power Management Processor (BPMP) + +The BPMP is a specific processor in Tegra chip, which is designed for +booting process handling and offloading the power management tasks from +the CPU. The binding document defines the resources that would be used by +the BPMP firmware driver, which can create the interprocessor +communication (IPC) between the CPU and BPMP. + +Required properties: +- name : Should be bpmp +- compatible : Should be "nvidia,tegra<chip>-bpmp" +- mboxes : The phandle of mailbox controller and the channel ID + See "Documentation/devicetree/bindings/mailbox/ + nvidia,tegra186-hsp.txt" and "Documentation/devicetree/ + bindings/mailbox/mailbox.txt" for more details about the generic + mailbox controller and mailbox client driver bindings. +- shmem : List of the phandle of the TX and RX shared memory area that + the IPC between CPU and BPMP is based on. +- #clock-cells : Should be 1. +- #reset-cells : Should be 1. + +The shared memory bindings for BPMP +----------------------------------- + +The shared memory area for the IPC TX and RX between CPU and BPMP are +predefined and work on top of sysram, which is a sram inside the chip. + +See "Documentation/devicetree/bindings/sram/sram.txt" for the bindings. + +Example: + +hsp_top: hsp@03c00000 { + ... + #mbox-cells = <1>; +}; + +bpmp@d0000000 { + compatible = "nvidia,tegra186-bpmp"; + mboxes = <&hsp_mbox HSP_DB_MASTER_BPMP>; + shmem = <&cpu_bpmp_tx &cpu_bpmp_rx>; + #clock-cells = <1>; + #reset-cells = <1>; +}; + +sysram@30000000 { + compatible = "nvidia,tegra186-sysram", "mmio-ram"; + reg = <0x0 0x30000000 0x0 0x50000>; + #address-cells = <2>; + #size-cells = <2>; + ranges = <0 0x0 0x0 0x30000000 0x0 0x50000>; + + cpu_bpmp_tx: bpmp_shmem@4e000 { + compatible = "nvidia,tegra186-bpmp-shmem"; + reg = <0x0 0x4e000 0x0 0x1000>; + }; + + cpu_bpmp_rx: bpmp_shmem@4f000 { + compatible = "nvidia,tegra186-bpmp-shmem"; + reg = <0x0 0x4f000 0x0 0x1000>; + }; +};
Signature · 1 line
2.9.0
PATCH 4/10 firmware: tegra: add IVC library
In reply to Joseph LoThe Inter-VM communication (IVC) is a communication protocol, which is designed for interprocessor communication (IPC) or the communication between the hypervisor and the virtual machine with a guest OS on it. So it can be translated as inter-virtual memory or inter-virtual machine communication. The message channels are maintained on the DRAM or SRAM and the data coherency should be considered. Or the data could be corrupted or out of date when the remote client checking it.
Inside the IVC, it maintains memory-based descriptors for the TX/RX channels and the coherency issue of the counter and payloads. So the clients can use it to send/receive messages to/from remote ones.
We introduce it as a library for the firmware drivers, which can use it for IPC.
Based-on-the-work-by:
Peter Newman <[email protected]>
--- drivers/firmware/Kconfig | 1 + drivers/firmware/Makefile | 1 + drivers/firmware/tegra/Kconfig | 13 + drivers/firmware/tegra/Makefile | 1 + drivers/firmware/tegra/ivc.c | 659 ++++++++++++++++++++++++++++++++++++++++ include/soc/tegra/ivc.h | 102 +++++++ 6 files changed, 777 insertions(+) create mode 100644 drivers/firmware/tegra/Kconfig create mode 100644 drivers/firmware/tegra/Makefile create mode 100644 drivers/firmware/tegra/ivc.c create mode 100644 include/soc/tegra/ivc.h
drivers/firmware/Kconfig +1 -0
@@ -199,5 +199,6 @@ config HAVE_ARM_SMCCC source "drivers/firmware/broadcom/Kconfig" source "drivers/firmware/google/Kconfig" source "drivers/firmware/efi/Kconfig" +source "drivers/firmware/tegra/Kconfig" endmenu
drivers/firmware/Makefile +1 -0
@@ -24,3 +24,4 @@ obj-y += broadcom/ obj-$(CONFIG_GOOGLE_FIRMWARE) += google/ obj-$(CONFIG_EFI) += efi/ obj-$(CONFIG_UEFI_CPER) += efi/ +obj-y += tegra/
drivers/firmware/tegra/Kconfig new file +13 -0
@@ -0,0 +1,13 @@ +menu "Tegra firmware driver" + +config TEGRA_IVC + bool "Tegra IVC protocol" + depends on ARCH_TEGRA + help + IVC (Inter-VM Communication) protocol is part of the IPC + (Inter Processor Communication) framework on Tegra. It maintains the + data and the different commuication channels in SysRAM or RAM and + keeps the content is synchronization between host CPU and remote + processors. + +endmenu
drivers/firmware/tegra/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-$(CONFIG_TEGRA_IVC) += ivc.o
drivers/firmware/tegra/ivc.c new file +659 -0
659 lines not on this page · raw message
include/soc/tegra/ivc.h new file +102 -0
102 lines not on this page · raw message
Signature · 1 line
2.9.0
PATCH 5/10 firmware: tegra: add BPMP support
In reply to Joseph LoThe Tegra BPMP (Boot and Power Management Processor) is designed for the booting process handling, offloading the power management tasks and some system control services from the CPU. It can be clock, DVFS, thermal/EDP, power gating operation and system suspend/resume handling. So the CPU and the drivers of these modules can base on the service that the BPMP firmware driver provided to signal the event for the specific PM action to BPMP and receive the status update from BPMP.
Comparing to the ARM SCPI, the service provided by BPMP is message-based communication but not method-based. The BPMP firmware driver provides the send/receive service for the users, when the user concerns the response time. If the user needs to get the event or update from the firmware, it can request the MRQ service as well. The user needs to take care of the message format, which we call BPMP ABI.
The BPMP ABI defines the message format for different modules or usages. For example, the clock operation needs an MRQ service code called MRQ_CLK with specific message format which includes different sub commands for various clock operations. This is the message format that BPMP can recognize.
So the user needs two things to initiate IPC between BPMP. Get the service from the bpmp_ops structure and maintain the message format as the BPMP ABI defined.
Based-on-the-work-by:
Sivaram Nair <[email protected]>
--- drivers/firmware/tegra/Kconfig | 12 + drivers/firmware/tegra/Makefile | 1 + drivers/firmware/tegra/bpmp.c | 713 +++++++++++++++++ include/soc/tegra/bpmp.h | 29 + include/soc/tegra/bpmp_abi.h | 1601 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 2356 insertions(+) create mode 100644 drivers/firmware/tegra/bpmp.c create mode 100644 include/soc/tegra/bpmp.h create mode 100644 include/soc/tegra/bpmp_abi.h
drivers/firmware/tegra/Kconfig +12 -0
@@ -10,4 +10,16 @@ config TEGRA_IVC keeps the content is synchronization between host CPU and remote processors. +config TEGRA_BPMP + bool "Tegra BPMP driver" + depends on ARCH_TEGRA && TEGRA_HSP_MBOX && TEGRA_IVC + help + BPMP (Boot and Power Management Processor) is designed to off-loading + the PM functions which include clock/DVFS/thermal/power from the CPU. + It needs HSP as the HW synchronization and notification module and + IVC module as the message communication protocol. + + This driver manages the IPC interface between host CPU and the + firmware running on BPMP. + endmenu
drivers/firmware/tegra/Makefile +1 -0
@@ -1 +1,2 @@ +obj-$(CONFIG_TEGRA_BPMP) += bpmp.o obj-$(CONFIG_TEGRA_IVC) += ivc.o
drivers/firmware/tegra/bpmp.c new file +713 -0
713 lines not on this page · raw message
include/soc/tegra/bpmp.h new file +29 -0
@@ -0,0 +1,29 @@ +/* +* Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms and conditions of the GNU General Public License, +* version 2, as published by the Free Software Foundation. +* +* This program is distributed in the hope 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 __TEGRA_BPMP_H + +typedef void (*bpmp_mrq_handler )(int mrq_code,void *data,int ch); + +struct tegra_bpmp_ops { +int (*send_receive)(int mrq_code,void *ob_data,int ob_sz, +void *ib_data,int ib_sz); +int (*send_receive_atomic)(int mrq_code,void *ob_data,int ob_sz, +void *ib_data,int ib_sz); +int (*request_mrq)(int mrq_code,bpmp_mrq_handler handler,void *data); +void (*mrq_return)(int ch,int ret_code,int val); +}; + +struct tegra_bpmp_ops *tegra_bpmp_get_ops (void ); + +#endif /* __TEGRA_BPMP_H */
include/soc/tegra/bpmp_abi.h new file +1601 -0
1,601 lines not on this page · raw message
Signature · 1 line
2.9.0
PATCH 6/10 soc/tegra: Add Tegra186 support
In reply to Joseph LoThe Tegra186 has a combination of Denver and Cortex-A57 CPU cores and GPUs with Pascal architecture on it. It features with ADSP with Cortex-A9 CPU for audio processing, hardware video encoder/decoder with multi-format support, ISP for image capture processing and BPMP for the power managements.
--- drivers/soc/tegra/Kconfig | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/soc/tegra/Kconfig +14 -0
@@ -61,6 +61,20 @@ config ARCH_TEGRA_132_SOC but contains an NVIDIA Denver CPU complex in place of Tegra124's "4+1" Cortex-A15 CPU complex. +config ARCH_TEGRA_186_SOC + bool "NVIDIA Tegra186 SoC" + select MAILBOX + select TEGRA_BPMP + select TEGRA_HSP_MBOX + select TEGRA_IVC + help + Enable support for the NVIDIA Tegar186 SoC. The Tegra186 has a + combination of Denver and Cortex-A57 CPU cores and GPUs with Pascal + architecture on it. It features with ADSP with Cortex-A9 CPU for + audio processing, hardware video encoder/decoder with multi-format + support, ISP for image capture processing and BPMP for the power + managements. + config ARCH_TEGRA_210_SOC bool "NVIDIA Tegra210 SoC" select PINCTRL_TEGRA210
Signature · 1 line
2.9.0
PATCH 7/10 arm64: defconfig: Enable Tegra186 SoC
In reply to Joseph LoEnable Tegra186 SoC.
--- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
@@ -312,6 +312,7 @@ CONFIG_QCOM_SMEM=y CONFIG_QCOM_SMD=y CONFIG_QCOM_SMD_RPM=y CONFIG_ARCH_TEGRA_132_SOC=y +CONFIG_ARCH_TEGRA_186_SOC=y CONFIG_ARCH_TEGRA_210_SOC=y CONFIG_EXTCON_USB_GPIO=y CONFIG_PWM=y
Signature · 1 line
2.9.0
PATCH 8/10 arm64: dts: tegra: Add Tegra186 support
In reply to Joseph LoThis adds the initial support of Tegra186 SoC, which can help to bring up the debug console and initrd for further developing.
--- arch/arm64/boot/dts/nvidia/tegra186.dtsi | 77 ++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 arch/arm64/boot/dts/nvidia/tegra186.dtsi
arch/arm64/boot/dts/nvidia/tegra186.dtsi new file +77 -0
@@ -0,0 +1,77 @@ +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/mailbox/tegra-hsp.h> + +/ { + compatible = "nvidia,tegra186"; + interrupt-parent = <&gic>; + #address-cells = <2>; + #size-cells = <2>; + + uarta: serial at 03100000 { + compatible = "nvidia,tegra186-uart", "nvidia,tegra20-uart"; + reg = <0x0 0x03100000 0x0 0x40>; + reg-shift = <2>; + interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>; + status = "disabled"; + }; + + gic: interrupt-controller at 03881000 { + compatible = "arm,gic-400"; + #interrupt-cells = <3>; + interrupt-controller; + reg = <0x0 0x03881000 0x0 0x1000>, + <0x0 0x03882000 0x0 0x2000>; + interrupts = <GIC_PPI 9 + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; + interrupt-parent = <&gic>; + }; + + hsp_top: hsp at 03c00000 { + compatible = "nvidia,tegra186-hsp"; + reg = <0x0 0x03c00000 0x0 0xa0000>; + interrupts = <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "doorbell"; + nvidia,hsp-function = <HSP_DOORBELL>; + #mbox-cells = <1>; + }; + + bpmp at d0000000 { + compatible = "nvidia,tegra186-bpmp"; + mboxes = <&hsp_top HSP_DB_MASTER_BPMP>; + shmem = <&cpu_bpmp_tx &cpu_bpmp_rx>; + #clock-cells = <1>; + #reset-cells = <1>; + status = "disabled"; + }; + + sysram at 30000000 { + compatible = "nvidia,tegra186-sysram", "mmio-ram"; + reg = <0x0 0x30000000 0x0 0x4ffff>; + #address-cells = <2>; + #size-cells = <2>; + ranges = <0 0x0 0x0 0x30000000 0x0 0x4ffff>; + + cpu_bpmp_tx: bpmp_shmem at 4e000 { + compatible = "nvidia,tegra186-bpmp-shmem"; + reg = <0x0 0x4e000 0x0 0x1000>; + }; + + cpu_bpmp_rx: bpmp_shmem at 4f000 { + compatible = "nvidia,tegra186-bpmp-shmem"; + reg = <0x0 0x4f000 0x0 0x1000>; + }; + }; + + timer { + compatible = "arm,armv8-timer"; + interrupts = <GIC_PPI 13 + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 14 + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 11 + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 10 + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>; + interrupt-parent = <&gic>; + }; +};
Signature · 1 line
2.9.0
PATCH 9/10 arm64: dts: tegra: Add NVIDIA Tegra186 P3310 main board support
In reply to Joseph LoAdd NVIDIA Tegra186 P3310 main board support, which is a chip module with DRAM, nonvolatile storage, WiFi, ethernet and PMIC chips on it. It also needs an IO board and hooks on it to represent as an application platform.
--- arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi
arch/arm64/boot/dts/nvidia/tegra186-p3310.dtsi new file +30 -0
@@ -0,0 +1,30 @@ +#include "tegra186.dtsi" + +/ { + model = "NVIDIA Tegra186 P3310 main Board"; + compatible = "nvidia,p3301", "nvidia,tegra186"; + + aliases { + serial0 = &uarta; + }; + + chosen { + bootargs = "earlycon console=ttyS0,115200n8"; + stdout-path = "serial0:115200n8"; + }; + + memory { + device_type = "memory"; + reg = <0x0 0x80000000 0x2 0x00000000>; + }; + + serial at 03100000 { + // HACK: before clk driver ready + clock-frequency = <408000000>; + status = "okay"; + }; + + bpmp at d0000000 { + status = "okay"; + }; +};
Signature · 1 line
2.9.0
PATCH 10/10 arm64: dts: tegra: Add NVIDIA P2771 board support
In reply to Joseph LoAdd NVIDIA Tegra186 P2771 board support, which is a reference development board with P2597 I/O board and P3310 chip module on it.
--- arch/arm64/boot/dts/nvidia/Makefile | 1 + arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts
arch/arm64/boot/dts/nvidia/Makefile +1 -0
@@ -1,4 +1,5 @@ dtb-$(CONFIG_ARCH_TEGRA_132_SOC) += tegra132-norrin.dtb +dtb-$(CONFIG_ARCH_TEGRA_186_SOC) += tegra186-p2771-0000.dtb dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-0000.dtb dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2371-2180.dtb dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-p2571.dtb
arch/arm64/boot/dts/nvidia/tegra186-p2771-0000.dts new file +8 -0
@@ -0,0 +1,8 @@ +/dts-v1/; + +#include "tegra186-p3310.dtsi" + +/ { + model = "NVIDIA Tegra186 P2771-0000 Board"; + compatible = "nvidia,p2771-0000", "nvidia,tegra186"; +};
Signature · 1 line
2.9.0
Re: [PATCH 01/10] Documentation: dt-bindings: mailbox: tegra: Add binding for HSP mailbox
In reply to Joseph LoQuoted 6 lines · Joseph Lo
Add DT binding for the Hardware Synchronization Primitives (HSP). The HSP is designed for the processors to share resources and communicate together. It provides a set of hardware synchronization primitives for interprocessor communication. So the interprocessor communication (IPC) protocols can use hardware synchronization primitive, when operating between two processors not in an SMP relationship.
This binding is quite different to the binding you sent to internal IP review. I wonder why it changed? Specific comments below:
Quoted 6 lines
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt +4
-0+NVIDIA Tegra Hardware Synchronization Primitives (HSP) + +The HSP modules are used for the processors to share resources and communicate +together. It provides a set of hardware synchronization primitives for
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt line 14
Quoted 10 lines
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt +10
-0+interprocessor communication. So the interprocessor communication (IPC) +protocols can use hardware synchronization primitives, when operating between +two processors not in an SMP relationship. + +The features that HSP supported are shared mailboxes, shared semaphores, +arbitrated semaphores and doorbells. + +Required properties: +- name : Should be hsp +- compatible : Should be "nvidia,tegra<chip>-hsp"
I think this should explicitly list the value values of the compatible property, rather than being a generic/wildcard description:
- compatible
Array of strings.
One of:
- "nvidia,tegra186-hsp"
If/when this binding supports other SoCs in the future, we'll add more entries into that list.
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt line 19
Quoted 5 lines
+- reg : Offset and length of the register set for the device +- interrupts : Should contain the HSP interrupts +- interrupt-names: Should contain the names of the HSP interrupts that theDocumentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt +2
-0+ client are using. + "doorbell"
The binding should describe the HW, and not be affected by anything "that the client(s) are using". If there are multiple interrupts, we should list them all here, from the start.
When revising this, I would consider the following wording canonical:
- interrupt-names
Array of strings.
Contains a list of names for the interrupts described by the interrupts property. May contain the following entries, in any order:
- "doorbell"
- "..." (no doubt many more items will be listed here, e.g. for semaphores, etc.).
Users of this binding MUST look up entries in the interrupts property by name, using this interrupts-names property to do so.
- interrupts
Array of interrupt specifiers.
Must contain one entry per entry in the interrupt-names property, in a matching order.
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt
Quoted 3 lines
+- nvidia,hsp-function : Specifies one of the HSP functions that the HSP unit
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt +2
-0+ will be supported. The function ID can be found in the + header file <dt-bindings/mailbox/tegra-hsp.h>.
This property wasn't in the internal patch.
This doesn't make sense. The HW feature-set is fixed. This sounds like some kind of software configuration option, or a way to allow different drivers to handle different aspects of the HW? In general, the binding shouldn't be influenced by software structure. Please delete this property.
Now, if you're attempting to set up a binding where each function (semaphores, shared mailboxes, doorbells, etc.) has a different DT node, then (a) splitting up HW modules into sub-blocks has usually turned out to be a mistake in the past, and (b) the differences should likely be represented by using a different compatible property for each sub-component, rather than via a custom property.
The following properties were included in the internal patch:
nvidia,num-SM = <0x8>;
nvidia,num-AS = <0x2>;
nvidia,num-SS = <0x2>;
nvidia,num-DB = <0x7>;
nvidia,num-SI = <0x8>;... yet aren't here. True the compatible value implies those values; was that why the properties were removed?
Quoted 3 lines
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt +3
-0+Example: + +hsp_top: hsp at 3c00000 {
...
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt line 42
Quoted 5 lines
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt +5
-0+bpmp at d0000000 { + ... + mboxes = <&hsp_top HSP_DB_MASTER_BPMP>; + ... +};
I'd suggest not including the bpmp node in the example, since it's not part of the HSP node. If you do, recall that bpmp has no reg property and hence the node name shouldn't include a unit address.
include/dt-bindings/mailbox/tegra-hsp.h
Quoted 1 line
include/dt-bindings/mailbox/tegra-hsp.h +0
-0
This file should probably be named tegra186-hsp, since I doubt the master ID values will be stable between chips.
Quoted 2 lines
+/*
+ * This header provides constants for binding nvidia,tegra<chip>-hsp.
That should say "186" not "<chip>"
include/dt-bindings/mailbox/tegra-hsp.h line 10
Quoted 2 lines
include/dt-bindings/mailbox/tegra-hsp.h +2
-0+#ifndef _DT_BINDINGS_MAILBOX_TEGRA186_HSP_H +#define _DT_BINDINGS_MAILBOX_TEGRA186_HSP_H
The two changes mentioned above would be consistent with that include guard's name including the text "186".
include/dt-bindings/mailbox/tegra-hsp.h line 15
Quoted 4 lines
include/dt-bindings/mailbox/tegra-hsp.h +4
-0+#define HSP_SHARED_MAILBOX 0 +#define HSP_SHARED_SEMAPHORE 1 +#define HSP_ARBITRATED_SEMAPHORE 2 +#define HSP_DOORBELL 3
I think those should be removed, along with the nvidia,hsp-function property.
Re: [PATCH 03/10] Documentation: dt-bindings: firmware: tegra: add bindings of the BPMP
In reply to Joseph LoDocumentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt line 7
Quoted 13 lines · Joseph Lo
The BPMP is a specific processor in Tegra chip, which is designed for booting process handling and offloading the power management tasks from the CPU. The binding document defines the resources that would be used by the BPMP firmware driver, which can create the interprocessor communication (IPC) between the CPU and BPMP.
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt +5
-0+The BPMP is a specific processor in Tegra chip, which is designed for +booting process handling and offloading the power management tasks from +the CPU. The binding document defines the resources that would be used by +the BPMP firmware driver, which can create the interprocessor +communication (IPC) between the CPU and BPMP.
s/power management/power management, clock management, and reset control/?
Quoted 3 lines
+Required properties:
+- name : Should be bpmp +- compatible : Should be "nvidia,tegra<chip>-bpmp"
Again, I'd suggest wording this as:
- compatible
Array of strings.
One of:
- "nvidia,tegra186-bpmp"
Quoted 1 line
+- mboxes : The phandle of mailbox controller and the channel ID
s/channel ID/mailbox specifier/.
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt line 16
Quoted 4 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt +4
-0+ See "Documentation/devicetree/bindings/mailbox/ + nvidia,tegra186-hsp.txt" and "Documentation/devicetree/ + bindings/mailbox/mailbox.txt" for more details about the generic + mailbox controller and mailbox client driver bindings.
I'd rather not split the filenames across lines, since that makes grep fail to match. Perhaps add the following text to the introductory section at the start of the file to avoid having to mention some of the filenames in an indented block of text:
==========
This node is a mailbox consumer. See the following file for details of the mailbox subsystem, and the specifiers implemented by the relevant provider(s):
- Documentation/devicetree/bindings/mailbox/mailbox.txt
- Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt
This node is a clock and reset provider. See the following files for general documentation of those features, and the specifiers implemented by this node:
- Documentation/devicetree/bindings/clock/clock-bindings.txt
- include/dt-bindings/clock/tegra186-clock.h
- Documentation/devicetree/bindings/reset/reset.txt
- include/dt-bindings/reset/tegra186-reset.h
==========
Related, I would expect those two header files (tegra186-clock.h and tegra186-reset.h) to be part of this patch, since they form part of the definition of this binding.
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt line 26
Quoted 5 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt +5
-0+The shared memory bindings for BPMP +----------------------------------- + +The shared memory area for the IPC TX and RX between CPU and BPMP are +predefined and work on top of sysram, which is a sram inside the chip.
s/a sram/an SRAM/.
Quoted 1 line
+Example:
...
Quoted 1 line
+bpmp at
d0000000{
There should be no unit address ("@d0000000") in the node name, since there's no reg property.
Re: [PATCH 01/10] Documentation: dt-bindings: mailbox: tegra: Add binding for HSP mailbox
In reply to Stephen WarrenQuoted 11 lines · Stephen Warren
Quoted 6 lines · Joseph Lo
Add DT binding for the Hardware Synchronization Primitives (HSP). The HSP is designed for the processors to share resources and communicate together. It provides a set of hardware synchronization primitives for interprocessor communication. So the interprocessor communication (IPC) protocols can use hardware synchronization primitive, when operating between two processors not in an SMP relationship.
This binding is quite different to the binding you sent to internal IP review. I wonder why it changed? Specific comments below:
Due to some enhancements for supporting multiple functions of HSP sub-modules in the same driver, I re-wrote some parts of the bindings and driver.
Quoted 39 lines
Quoted 12 lines
diff --git
a/Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txtb/Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txtDocumentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt new file +3
-0+NVIDIA Tegra Hardware Synchronization Primitives (HSP) + +The HSP modules are used for the processors to share resources andcommunicate
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt new file +3
-0+together. It provides a set of hardware synchronization primitives for +interprocessor communication. So the interprocessor communication (IPC) +protocols can use hardware synchronization primitives, when operatingbetween
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt line 14
Quoted 8 lines
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt new file +8
-0+two processors not in an SMP relationship. + +The features that HSP supported are shared mailboxes, shared semaphores, +arbitrated semaphores and doorbells. + +Required properties: +- name : Should be hsp +- compatible : Should be "nvidia,tegra<chip>-hsp"I think this should explicitly list the value values of the compatible property, rather than being a generic/wildcard description:
- compatible
Array of strings.
One of:
- "nvidia,tegra186-hsp"If/when this binding supports other SoCs in the future, we'll add more entries into that list.
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt line 19
Quoted 6 lines
+- reg : Offset and length of the register set for the device +- interrupts : Should contain the HSP interrupts +- interrupt-names: Should contain the names of the HSP interruptsthat the
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt new file +2
-0+ client are using. + "doorbell"
Quoted 5 lines
The binding should describe the HW, and not be affected by anything "that the client(s) are using". If there are multiple interrupts, we should list them all here, from the start.
When revising this, I would consider the following wording canonical:
Okay.
Quoted 9 lines
- interrupt-names
Array of strings.
Contains a list of names for the interrupts described by the interrupts property. May contain the following entries, in any order:
- "doorbell"
- "..." (no doubt many more items will be listed here, e.g. for semaphores, etc.).
I think I will just list "doorbell" for now. And adding more later once we add other HSP sub-module support.
Quoted 19 lines
Users of this binding MUST look up entries in the interrupts property by name, using this interrupts-names property to do so.
- interrupts
Array of interrupt specifiers.
Must contain one entry per entry in the interrupt-names property, in a matching order.Review
Quoted 4 lines
+- nvidia,hsp-function : Specifies one of the HSP functions that the HSP unit
(quoted diff) +2
-0+ will be supported. The function ID can be found in the + header file <dt-bindings/mailbox/tegra-hsp.h>.This property wasn't in the internal patch.
This doesn't make sense. The HW feature-set is fixed. This sounds like some kind of software configuration option, or a way to allow different drivers to handle different aspects of the HW? In general, the binding shouldn't be influenced by software structure. Please delete this property.
Quoted 6 lines
Now, if you're attempting to set up a binding where each function (semaphores, shared mailboxes, doorbells, etc.) has a different DT node, then (a) splitting up HW modules into sub-blocks has usually turned out to be a mistake in the past, and (b) the differences should likely be represented by using a different compatible property for each sub-component, rather than via a custom property.
Currently the usage of HSP HW in the downstream kernel is something like the model below.
remote_processor_A-\
remote_processor_B--->hsp at 1000 (doorbell func) <-> host CPU remote_processor_C-/
remote_processor_D -> hsp at 2000 (shared mailbox) <-> CPU
remote_processor_E -> hsp at 3000 (shared mailbox) <-> CPU
I am thinking if we can just add the appropriate compatible strings for it to replace "nvidia,tegra186-hsp". e.g. "nvidia,tegra186-hsp-doorbell" and "nvidia,tegra186-hsp-sharedmailbox". So the driver can probe and initialize correctly depend on the compatible property. How do you think about it? Is this the same as the (b) you mentioned above?
Quoted 4 lines
The following properties were included in the internal patch:
Quoted 8 lines
nvidia,num-SM = <0x8>; nvidia,num-AS = <0x2>; nvidia,num-SS = <0x2>; nvidia,num-DB = <0x7>; nvidia,num-SI = <0x8>;... yet aren't here. True the compatible value implies those values; was that why the properties were removed?
Because these values are available in the HSP_INT_DIMENSIONING register, so remove them.
Quoted 5 lines
Quoted 4 lines
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt new file +3
-0+Example: + +hsp_top: hsp at 3c00000 {...
Quoted 9 lines
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt line 42
Quoted 5 lines
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt new file +5
-0+bpmp at d0000000 { + ... + mboxes = <&hsp_top HSP_DB_MASTER_BPMP>; + ... +};I'd suggest not including the bpmp node in the example, since it's not part of the HSP node. If you do, recall that bpmp has no reg property and hence the node name shouldn't include a unit address.
Okay.
Quoted 6 lines
include/dt-bindings/mailbox/tegra-hsp.h
Quoted 3 lines
include/dt-bindings/mailbox/tegra-hsp.h +0
-0This file should probably be named tegra186-hsp, since I doubt the master ID values will be stable between chips.
Yes, true. Will fix.
Quoted 12 lines
Quoted 3 lines
+/*
+ * This header provides constants for binding nvidia,tegra<chip>-hsp.That should say "186" not "<chip>"
include/dt-bindings/mailbox/tegra-hsp.h line 10
Quoted 2 lines
include/dt-bindings/mailbox/tegra-hsp.h +2
-0+#ifndef _DT_BINDINGS_MAILBOX_TEGRA186_HSP_H +#define _DT_BINDINGS_MAILBOX_TEGRA186_HSP_HThe two changes mentioned above would be consistent with that include guard's name including the text "186".
Quoted 8 lines
include/dt-bindings/mailbox/tegra-hsp.h line 15
Quoted 4 lines
include/dt-bindings/mailbox/tegra-hsp.h +4
-0+#define HSP_SHARED_MAILBOX 0 +#define HSP_SHARED_SEMAPHORE 1 +#define HSP_ARBITRATED_SEMAPHORE 2 +#define HSP_DOORBELL 3I think those should be removed, along with the nvidia,hsp-function property.
Okay.
Thanks,
-Joseph
Re: [PATCH 03/10] Documentation: dt-bindings: firmware: tegra: add bindings of the BPMP
In reply to Stephen WarrenQuoted 11 lines · Stephen Warren
Quoted 9 lines · Joseph Lo
The BPMP is a specific processor in Tegra chip, which is designed for booting process handling and offloading the power management tasks from the CPU. The binding document defines the resources that would be used by the BPMP firmware driver, which can create the interprocessor communication (IPC) between the CPU and BPMP.
diff --git
a/Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txtb/Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt
Quoted 8 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt line 7
Quoted 6 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt new file +3
-0+The BPMP is a specific processor in Tegra chip, which is designed for +booting process handling and offloading the power management tasks from +the CPU. The binding document defines the resources that would beused by
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt new file +2
-0+the BPMP firmware driver, which can create the interprocessor +communication (IPC) between the CPU and BPMP.s/power management/power management, clock management, and reset control/?
Yes.
Quoted 11 lines
Quoted 4 lines
+Required properties:
+- name : Should be bpmp +- compatible : Should be "nvidia,tegra<chip>-bpmp"Again, I'd suggest wording this as:
- compatible
Array of strings.
One of:
- "nvidia,tegra186-bpmp"
Okay.
Quoted 10 lines
Quoted 2 lines
+- mboxes : The phandle of mailbox controller and the channel ID
s/channel ID/mailbox specifier/.
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt line 16
Quoted 4 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt new file +4
-0+ See "Documentation/devicetree/bindings/mailbox/ + nvidia,tegra186-hsp.txt" and "Documentation/devicetree/ + bindings/mailbox/mailbox.txt" for more details about the generic + mailbox controller and mailbox client driver bindings.
Quoted 4 lines
I'd rather not split the filenames across lines, since that makes grep fail to match. Perhaps add the following text to the introductory section at the start of the file to avoid having to mention some of the filenames in an indented block of text:
Thanks.
Quoted 19 lines
==========
This node is a mailbox consumer. See the following file for details of the mailbox subsystem, and the specifiers implemented by the relevant provider(s):-
Documentation/devicetree/bindings/mailbox/mailbox.txt
-Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txtThis node is a clock and reset provider. See the following files for general documentation of those features, and the specifiers implemented by this node:
-
Documentation/devicetree/bindings/clock/clock-bindings.txt
-include/dt-bindings/clock/tegra186-clock.h
-Documentation/devicetree/bindings/reset/reset.txt
-include/dt-bindings/reset/tegra186-reset.h
==========
Quoted 3 lines
Related, I would expect those two header files (
tegra186-clock.handtegra186-reset.h) to be part of this patch, since they form part of the definition of this binding.
Okay. Will add them.
Quoted 9 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt line 26
Quoted 6 lines
Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.txt new file +5
-0+The shared memory bindings for BPMP +----------------------------------- + +The shared memory area for the IPC TX and RX between CPU and BPMP are +predefined and work on top of sysram, which is a sram inside the chip.s/a sram/an SRAM/.
Quoted 6 lines
Quoted 1 line
+Example:
...
Quoted 1 line
+bpmp at
d0000000{There should be no unit address ("@d0000000") in the node name, since there's no reg property.
Thanks,
-Joseph
Re: [PATCH 01/10] Documentation: dt-bindings: mailbox: tegra: Add binding for HSP mailbox
In reply to Joseph LoQuoted 42 lines · Joseph Lo
Quoted 10 lines · Stephen Warren
Quoted 6 lines · Joseph Lo
Add DT binding for the Hardware Synchronization Primitives (HSP). The HSP is designed for the processors to share resources and communicate together. It provides a set of hardware synchronization primitives for interprocessor communication. So the interprocessor communication (IPC) protocols can use hardware synchronization primitive, when operating between two processors not in an SMP relationship.
This binding is quite different to the binding you sent to internal IP review. I wonder why it changed? Specific comments below:
Due to some enhancements for supporting multiple functions of HSP sub-modules in the same driver, I re-wrote some parts of the bindings and driver.
Quoted 17 lines
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt line 19
Quoted 10 lines
diff --git
a/Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txtb/Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt+- reg : Offset and length of the register set for the device +- interrupts : Should contain the HSP interrupts +- interrupt-names: Should contain the names of the HSP interruptsthat the
Documentation/devicetree/bindings/mailbox/nvidia,tegra186-hsp.txt new file +2
-0+ client are using. + "doorbell"The binding should describe the HW, and not be affected by anything "that the client(s) are using". If there are multiple interrupts, we should list them all here, from the start.
When revising this, I would consider the following wording canonical:
Quoted 8 lines
- interrupt-names
Array of strings.
Contains a list of names for the interrupts described by the interrupts property. May contain the following entries, in any order:
- "doorbell"
- "..." (no doubt many more items will be listed here, e.g. for semaphores, etc.).
Quoted 2 lines
I think I will just list "doorbell" for now. And adding more later once we add other HSP sub-module support.
That should be OK; adding more entries in interrupt-names is backwards compatible. Still, since the HW is fixed, it would be nice to just get the complete list documented up front if possible.
Quoted 28 lines
Quoted 12 lines
Review
Quoted 3 lines
+- nvidia,hsp-function : Specifies one of the HSP functions that the HSP unit
(quoted diff) +2
-0+ will be supported. The function ID can be found in the + header file <dt-bindings/mailbox/tegra-hsp.h>.This property wasn't in the internal patch.
This doesn't make sense. The HW feature-set is fixed. This sounds like some kind of software configuration option, or a way to allow different drivers to handle different aspects of the HW? In general, the binding shouldn't be influenced by software structure. Please delete this property.
Quoted 6 lines
Now, if you're attempting to set up a binding where each function (semaphores, shared mailboxes, doorbells, etc.) has a different DT node, then (a) splitting up HW modules into sub-blocks has usually turned out to be a mistake in the past, and (b) the differences should likely be represented by using a different compatible property for each sub-component, rather than via a custom property.
Currently the usage of HSP HW in the downstream kernel is something like the model below.
remote_processor_A-\
remote_processor_B--->hsp at 1000 (doorbell func) <-> host CPU remote_processor_C-/
remote_processor_D-> hsp at 2000 (shared mailbox) <-> CPU
Quoted 7 lines
remote_processor_E-> hsp at 3000 (shared mailbox) <-> CPUI am thinking if we can just add the appropriate compatible strings for it to replace "nvidia,tegra186-hsp". e.g. "nvidia,tegra186-hsp-doorbell" and "nvidia,tegra186-hsp-sharedmailbox". So the driver can probe and initialize correctly depend on the compatible property. How do you think about it? Is this the same as the (b) you mentioned above?
Yes, that would be (b) above.
However, please do note (a): I expect that splitting things up will turn out to be a mistake, as it has for other HW modules in the past. I would far rather see a single hsp node in DT, since there is a single HSP block in HW. Sure that block has multiple sub-functions. However, there is common logic that affects all of those sub-functions and binds everything into a single HW module. If you represent the HW module using multiple different DT nodes, it will be hard to correctly represent that common logic. Conversely, I see no real advantage to splitting up the DT node. I strongly believe we should have a single "hsp" node in DT.
Internally, the SW driver for that node can be structured however you want; it could register with multiple subsystems (mailbox, ...) with just one struct device, or the HSP driver could be an MFD device with sub-drivers for each separate piece of functionality the HW implements. All this can easily be done even while using a single DT node. And furthermore, we can add this SW structure later if/when we actually need it; in other words, there's no need to change your current patches right now, except to remove the nvidia,hsp-function DT property.
Re: [PATCH 01/10] Documentation: dt-bindings: mailbox: tegra: Add binding for HSP mailbox
Quoted 3 lines · Stephen Warren
Quoted 2 lines · Joseph Lo
Quoted 1 line · Stephen Warren
On 06/27/2016 03:02 AM, Joseph Lo wrote:
snip.
Quoted 20 lines
Quoted 10 lines
Currently the usage of HSP HW in the downstream kernel is something like the model below.
remote_processor_A-\
remote_processor_B--->hsp at 1000 (doorbell func) <-> host CPU remote_processor_C-/
remote_processor_D-> hsp at 2000 (shared mailbox) <-> CPUQuoted 7 lines
remote_processor_E-> hsp at 3000 (shared mailbox) <-> CPUI am thinking if we can just add the appropriate compatible strings for it to replace "nvidia,tegra186-hsp". e.g. "nvidia,tegra186-hsp-doorbell" and "nvidia,tegra186-hsp-sharedmailbox". So the driver can probe and initialize correctly depend on the compatible property. How do you think about it? Is this the same as the (b) you mentioned above?
Yes, that would be (b) above.
Quoted 9 lines
However, please do note (a): I expect that splitting things up will turn out to be a mistake, as it has for other HW modules in the past. I would far rather see a single hsp node in DT, since there is a single HSP block in HW. Sure that block has multiple sub-functions. However, there is common logic that affects all of those sub-functions and binds everything into a single HW module. If you represent the HW module using multiple different DT nodes, it will be hard to correctly represent that common logic. Conversely, I see no real advantage to splitting up the DT node. I strongly believe we should have a single "hsp" node in DT.
We have 6 HSP block in HW. FYI.
Quoted 9 lines
Internally, the SW driver for that node can be structured however you want; it could register with multiple subsystems (mailbox, ...) with just one struct device, or the HSP driver could be an MFD device with sub-drivers for each separate piece of functionality the HW implements. All this can easily be done even while using a single DT node. And furthermore, we can add this SW structure later if/when we actually need it; in other words, there's no need to change your current patches right now, except to remove the nvidia,hsp-function DT property.
Thanks,
-Joseph
Re: [PATCH 01/10] Documentation: dt-bindings: mailbox: tegra: Add binding for HSP mailbox
Quoted 35 lines · Joseph Lo
Quoted 3 lines · Stephen Warren
Quoted 2 lines · Joseph Lo
Quoted 1 line · Stephen Warren
On 06/27/2016 03:02 AM, Joseph Lo wrote:
snip.
Quoted 20 lines
Quoted 10 lines
Currently the usage of HSP HW in the downstream kernel is something like the model below.
remote_processor_A-\
remote_processor_B--->hsp at 1000 (doorbell func) <-> host CPU remote_processor_C-/
remote_processor_D-> hsp at 2000 (shared mailbox) <-> CPUQuoted 7 lines
remote_processor_E-> hsp at 3000 (shared mailbox) <-> CPUI am thinking if we can just add the appropriate compatible strings for it to replace "nvidia,tegra186-hsp". e.g. "nvidia,tegra186-hsp-doorbell" and "nvidia,tegra186-hsp-sharedmailbox". So the driver can probe and initialize correctly depend on the compatible property. How do you think about it? Is this the same as the (b) you mentioned above?
Yes, that would be (b) above.
Quoted 9 lines
However, please do note (a): I expect that splitting things up will turn out to be a mistake, as it has for other HW modules in the past. I would far rather see a single hsp node in DT, since there is a single HSP block in HW. Sure that block has multiple sub-functions. However, there is common logic that affects all of those sub-functions and binds everything into a single HW module. If you represent the HW module using multiple different DT nodes, it will be hard to correctly represent that common logic. Conversely, I see no real advantage to splitting up the DT node. I strongly believe we should have a single "hsp" node in DT.
Quoted 1 line
We have 6 HSP block in HW. FYI.
Yes, we have 6 /instances/ of the overall HSP block. Those should each have their own node, since they're entirely separate modules, all instances of the same configurable IP block.
Above, I was talking about the sub-blocks within each HSP instance, which should all be represented into a single node per instance, for a total of 6 DT nodes overall.
Re: [PATCH 01/10] Documentation: dt-bindings: mailbox: tegra: Add binding for HSP mailbox
Quoted 41 lines · Stephen Warren
Quoted 38 lines · Joseph Lo
Quoted 3 lines · Stephen Warren
Quoted 2 lines · Joseph Lo
Quoted 1 line · Stephen Warren
On 06/27/2016 03:02 AM, Joseph Lo wrote:
snip.
Quoted 23 lines
Quoted 13 lines
Currently the usage of HSP HW in the downstream kernel is something like
the model below.remote_processor_A-\
remote_processor_B--->hsp at 1000 (doorbell func) <-> host CPU remote_processor_C-/
remote_processor_D-> hsp at 2000 (shared mailbox) <-> CPU
remote_processor_E-> hsp at 3000 (shared mailbox) <-> CPUQuoted 7 lines
I am thinking if we can just add the appropriate compatible strings for it to replace "nvidia,tegra186-hsp". e.g. "nvidia,tegra186-hsp-doorbell"
and "nvidia,tegra186-hsp-sharedmailbox". So the driver can probe and initialize correctly depend on the compatible property. How do you think
about it? Is this the same as the (b) you mentioned above?Yes, that would be (b) above.
Quoted 9 lines
However, please do note (a): I expect that splitting things up will turn out to be a mistake, as it has for other HW modules in the past. I would far rather see a single hsp node in DT, since there is a single HSP block in HW. Sure that block has multiple sub-functions. However, there is common logic that affects all of those sub-functions and binds everything into a single HW module. If you represent the HW module using multiple different DT nodes, it will be hard to correctly represent that common logic. Conversely, I see no real advantage to splitting up the DT node. I strongly believe we should have a single "hsp" node in DT.
Quoted 1 line
We have 6 HSP block in HW. FYI.
Quoted 7 lines
Yes, we have 6 /instances/ of the overall HSP block. Those should each have their own node, since they're entirely separate modules, all instances of the same configurable IP block.
Above, I was talking about the sub-blocks within each HSP instance, which should all be represented into a single node per instance, for a total of 6 DT nodes overall.
Yes.
So, one thing still concerns me is that the binding and driver still can't work with multiple HSP sub-modules per HSP block. It only supports one HSP module per HSP block right how. Although, I said it matches the model that we are using in the downstream kernel. But I still concern if we need to enable and work with multiple HSP modules per HSP block at sometime in future, then the binding and driver need lots of change to achieve that. And the binding is not back-ward compatible obviously.
So I want to revise it again.
#mbox-cells: should be 2.
The mobxes property in the client node should contain the phandle of the HSP block, HSP sub-module ID and the specifier of the module.
Ex.
hsp_top0: hsp at 1000 {
...
#mbox-cells = <2>;
};clientA {
....
mboxes = <&hsp_top0 HSP_DOORBELL DB_MASTER_XXX>;
};clientB {
...
mboxes = <&hsp_top0 HSP_SHARED_MAILBOX SM_MASTER_XXX>;
};Stephen, How do you think of this change?
Thanks,
-Joseph
Re: [PATCH 01/10] Documentation: dt-bindings: mailbox: tegra: Add binding for HSP mailbox
Quoted 52 lines · Joseph Lo
Quoted 51 lines · Stephen Warren
Quoted 44 lines · Joseph Lo
Quoted 3 lines · Stephen Warren
Quoted 2 lines · Joseph Lo
Quoted 1 line · Stephen Warren
On 06/27/2016 03:02 AM, Joseph Lo wrote:
snip.
Quoted 24 lines
Quoted 13 lines
Currently the usage of HSP HW in the downstream kernel is something like
the model below.remote_processor_A-\
remote_processor_B--->hsp at 1000 (doorbell func) <-> host CPU remote_processor_C-/
remote_processor_D-> hsp at 2000 (shared mailbox) <-> CPU
remote_processor_E-> hsp at 3000 (shared mailbox) <-> CPUQuoted 8 lines
I am thinking if we can just add the appropriate compatible strings for
it to replace "nvidia,tegra186-hsp". e.g. "nvidia,tegra186-hsp-doorbell"
and "nvidia,tegra186-hsp-sharedmailbox". So the driver can probe and initialize correctly depend on the compatible property. How do you think
about it? Is this the same as the (b) you mentioned above?Yes, that would be (b) above.
Quoted 14 lines
However, please do note (a): I expect that splitting things up will turn
out to be a mistake, as it has for other HW modules in the past. I would
far rather see a single hsp node in DT, since there is a single HSP block in HW. Sure that block has multiple sub-functions. However, there is common logic that affects all of those sub-functions and binds everything into a single HW module. If you represent the HW module using
multiple different DT nodes, it will be hard to correctly represent that
common logic. Conversely, I see no real advantage to splitting up the DT
node. I strongly believe we should have a single "hsp" node in DT.Quoted 1 line
We have 6 HSP block in HW. FYI.
Yes, we have 6 /instances/ of the overall HSP block. Those should each have their own node, since they're entirely separate modules, all instances of the same configurable IP block.
Quoted 8 lines
Quoted 3 lines
Above, I was talking about the sub-blocks within each HSP instance, which should all be represented into a single node per instance, for a total of 6 DT nodes overall.
Yes.
So, one thing still concerns me is that the binding and driver still can't work with multiple HSP sub-modules per HSP block. It only supports one HSP module per HSP block right how.
The driver can be enhanced without affecting the DT binding, providing the binding is reasonably designed, as I believe it is.
I believe the existing binding can work fine for multiple HSP sub-modules, or at least be extended in a backwards-compatible way. Aside from the mailbox cells issue you mention below, is there any other reason you believe the binding can't be extended in a backwards-compatible way? Interrupts are already accessed solely by name, so we can add more later without issue. The node can become a provider for any other resource type besides mailboxes in a backwards-compatible way without issue.
Quoted 24 lines
Although, I said it matches the
model that we are using in the downstream kernel. But I still concern if we need to enable and work with multiple HSP modules per HSP block at sometime in future, then the binding and driver need lots of change to achieve that. And the binding is not back-ward compatible obviously.So I want to revise it again.
#mbox-cells: should be 2.
The mobxes property in the client node should contain the phandle of the HSP block, HSP sub-module ID and the specifier of the module.
Ex.
hsp_top0: hsp at 1000 { ... #mbox-cells = <2>; };clientA { .... mboxes = <&hsp_top0 HSP_DOORBELL DB_MASTER_XXX>; };
Quoted 6 lines
clientB { ... mboxes = <&hsp_top0 HSP_SHARED_MAILBOX SM_MASTER_XXX>; };Stephen, How do you think of this change?
Well, we could do that. Or, since we won't have 2^32 instances of doorbells, we could also have #mbox-cells=<1> as we do now, and encode mailbox IDs as "(type << 16) | id" where TEGRA186_HSP_MAILBOX_TYPE_DB is
0. That would be backwards-compatible with no change to the binding. I think either way is fine. I have a slight preference for keeping #mbox-cells=<1> to avoid revising the U-Boot driver code I wrote, but I can deal with changing it if I have to.
Re: [PATCH 01/10] Documentation: dt-bindings: mailbox: tegra: Add binding for HSP mailbox
Quoted 66 lines · Stephen Warren
Quoted 53 lines · Joseph Lo
Quoted 52 lines · Stephen Warren
Quoted 45 lines · Joseph Lo
Quoted 3 lines · Stephen Warren
Quoted 2 lines · Joseph Lo
Quoted 1 line · Stephen Warren
On 06/27/2016 03:02 AM, Joseph Lo wrote:
snip.
Quoted 24 lines
Quoted 13 lines
Currently the usage of HSP HW in the downstream kernel is something like
the model below.remote_processor_A-\
remote_processor_B--->hsp at 1000 (doorbell func) <-> host CPU remote_processor_C-/
remote_processor_D-> hsp at 2000 (shared mailbox) <-> CPU
remote_processor_E-> hsp at 3000 (shared mailbox) <-> CPUQuoted 8 lines
I am thinking if we can just add the appropriate compatible strings for
it to replace "nvidia,tegra186-hsp". e.g. "nvidia,tegra186-hsp-doorbell"
and "nvidia,tegra186-hsp-sharedmailbox". So the driver can probe and initialize correctly depend on the compatible property. How do you think
about it? Is this the same as the (b) you mentioned above?Yes, that would be (b) above.
Quoted 15 lines
However, please do note (a): I expect that splitting things up will turn
out to be a mistake, as it has for other HW modules in the past. I would
far rather see a single hsp node in DT, since there is a single HSP block in HW. Sure that block has multiple sub-functions. However, there
is common logic that affects all of those sub-functions and binds everything into a single HW module. If you represent the HW module using
multiple different DT nodes, it will be hard to correctly represent that
common logic. Conversely, I see no real advantage to splitting up the DT
node. I strongly believe we should have a single "hsp" node in DT.Quoted 1 line
We have 6 HSP block in HW. FYI.
Yes, we have 6 /instances/ of the overall HSP block. Those should each have their own node, since they're entirely separate modules, all instances of the same configurable IP block.
Quoted 8 lines
Quoted 3 lines
Above, I was talking about the sub-blocks within each HSP instance, which should all be represented into a single node per instance, for a total of 6 DT nodes overall.
Yes.
So, one thing still concerns me is that the binding and driver still can't work with multiple HSP sub-modules per HSP block. It only supports one HSP module per HSP block right how.
The driver can be enhanced without affecting the DT binding, providing the binding is reasonably designed, as I believe it is.
Quoted 8 lines
I believe the existing binding can work fine for multiple HSP sub-modules, or at least be extended in a backwards-compatible way. Aside from the mailbox cells issue you mention below, is there any other reason you believe the binding can't be extended in a backwards-compatible way? Interrupts are already accessed solely by name, so we can add more later without issue. The node can become a provider for any other resource type besides mailboxes in a backwards-compatible way without issue.
Because the mbox client has no idea to know which hsb sub-module to bind with. However, the way you suggested below should solve my concern and back-ward compatible indeed.
Quoted 32 lines
Quoted 25 lines
Although, I said it matches the
model that we are using in the downstream kernel. But I still concern if we need to enable and work with multiple HSP modules per HSP block at sometime in future, then the binding and driver need lots of change to achieve that. And the binding is not back-ward compatible obviously.So I want to revise it again.
#mbox-cells: should be 2.
The mobxes property in the client node should contain the phandle of the HSP block, HSP sub-module ID and the specifier of the module.
Ex.
hsp_top0: hsp at 1000 { ... #mbox-cells = <2>; };clientA { .... mboxes = <&hsp_top0 HSP_DOORBELL DB_MASTER_XXX>; };Quoted 6 lines
clientB { ... mboxes = <&hsp_top0 HSP_SHARED_MAILBOX SM_MASTER_XXX>; };Stephen, How do you think of this change?
Quoted 7 lines
Well, we could do that. Or, since we won't have 2^32 instances of doorbells, we could also have #mbox-cells=<1> as we do now, and encode mailbox IDs as "(type << 16) | id" where
TEGRA186_HSP_MAILBOX_TYPE_DBis
0. That would be backwards-compatible with no change to the binding. I think either way is fine. I have a slight preference for keeping #mbox-cells=<1> to avoid revising the U-Boot driver code I wrote, but I can deal with changing it if I have to.
Ah, yes. I think the U-Boot doesn't need to deal with the multiple HSP sub-module supporting issue, and the binding I purposed was more complicate for that. The idea with "#mbox-cells=<1>" and "mboxes=<(type<<16)|id>" is fine with me. I will revise the hsp driver for this.
Thanks,
-Joseph