xavier开发套件中使用了PD controller CYPD4226-40LQXIT CYPRESS的 PD controller USB控制芯片:
电路图如下:
设备树文件中,配置了PD Controller的信息
lkernel-4.9/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2888-0001-p2822-0000-common.dtsi
1.kernel/kernel-4.9/hardware/nvidia/platform/t19x/galen/kernel-dts/common/tegra194-p2822-disp.dtsi
中定义了typec的一些接口信息,用于显示:
关于显示的绑定文件:
1.kernel/kernel-5.10/kernel/nvidia/Documentation/devicetree/bindings/video/nvidia,tegra-display-hub.txt
设备树文件:
1.kernel/kernel-4.9/hardware/nvidia/soc/t19x/kernel-dts/tegra194-soc/tegra194-soc-base.dtsi
中设备显示配置:
head0: nvdisplay@15200000
compatible = "nvidia,tegra194-dc";
head0: nvdisplay@15200000 {
status = "disabled";
compatible = "nvidia,tegra194-dc";
reg = <0x0 0x15200000 0x0 0x10000>;
interrupts = <0 153 4>;
iommus = <&smmu TEGRA_SID_NVDISPLAY>;
iso-smmu;
non-coherent;
nvidia,dc-ctrlnum = <0>;
nvidia,cmu-enable = <0x1>;
clock-names = "nvdisplay_disp",
"nvdisplayhub", "nvdisplay_p0",
"nvdisplay_p1", "nvdisplay_p2",
"nvdisplay_p3", "pllp_display",
"pll_d", "plld2",
"plld3", "plld4",
"emc";
clocks = <&bpmp_clks TEGRA194_CLK_NVDISPLAY_DISP>,
<&bpmp_clks TEGRA194_CLK_NVDISPLAYHUB>,
<&bpmp_clks TEGRA194_CLK_NVDISPLAY_P0>,
<&bpmp_clks TEGRA194_CLK_NVDISPLAY_P1>,
<&bpmp_clks TEGRA194_CLK_NVDISPLAY_P2>,
<&bpmp_clks TEGRA194_CLK_NVDISPLAY_P3>,
<&bpmp_clks TEGRA194_CLK_PLLP_OUT0>,
<&bpmp_clks TEGRA194_CLK_PLLD>,
<&bpmp_clks TEGRA194_CLK_PLLD2>,
<&bpmp_clks TEGRA194_CLK_PLLD3>,
<&bpmp_clks TEGRA194_CLK_PLLD4>,
<&bpmp_clks TEGRA194_CLK_EMC>;
reset-names = "misc", "wgrp0", "wgrp1", "wgrp2",
"wgrp3", "wgrp4", "wgrp5", "head0";
resets = <&bpmp_resets TEGRA194_RESET_NVDISPLAY0_MISC>,
<&bpmp_resets TEGRA194_RESET_NVDISPLAY0_WGRP0>,
<&bpmp_resets TEGRA194_RESET_NVDISPLAY0_WGRP1>,
<&bpmp_resets TEGRA194_RESET_NVDISPLAY0_WGRP2>,
<&bpmp_resets TEGRA194_RESET_NVDISPLAY0_WGRP3>,
<&bpmp_resets TEGRA194_RESET_NVDISPLAY0_WGRP4>,
<&bpmp_resets TEGRA194_RESET_NVDISPLAY0_WGRP5>,
<&bpmp_resets TEGRA194_RESET_NVDISPLAY0_HEAD0>;
fb_reserved = <&fb0_reserved>;
iommu-direct-regions = <&fb0_reserved &fb1_reserved
&fb2_reserved &fb3_reserved>;
pinctrl-names = "hdmi-dp0-dpd-disable", "hdmi-dp0-dpd-enable",
"hdmi-dp1-dpd-disable", "hdmi-dp1-dpd-enable",
"hdmi-dp2-dpd-disable", "hdmi-dp2-dpd-enable",
"hdmi-dp3-dpd-disable", "hdmi-dp3-dpd-enable";
pinctrl-0 = <&hdmi_dp0_dpd_disable>;
pinctrl-1 = <&hdmi_dp0_dpd_enable>;
pinctrl-2 = <&hdmi_dp1_dpd_disable>;
pinctrl-3 = <&hdmi_dp1_dpd_enable>;
pinctrl-4 = <&hdmi_dp2_dpd_disable>;
pinctrl-5 = <&hdmi_dp2_dpd_enable>;
pinctrl-6 = <&hdmi_dp3_dpd_disable>;
pinctrl-7 = <&hdmi_dp3_dpd_enable>;
};
&head0 {
status = "okay";
nvidia,fb-bpp = <32>;
nvidia,fbmem-size = <265420800>; /* 8K (7680*4320) 32bpp double buffered */
nvidia,fb-flags = <TEGRA_FB_FLIP_ON_PROBE>;
win-mask = <0x3>;
nvidia,fb-win = <0>;
nvidia,dc-connector = <&sor2>;
nvidia,dc-flags = <TEGRA_DC_FLAG_ENABLED>;
avdd_hdmi-supply = <&p2888_spmic_sd0>; /* 1v0 */
avdd_hdmi_pll-supply = <&p2888_spmic_sd1>; /* 1v8 */
vdd_hdmi_5v0-supply = <&p2822_vdd_hdmi_5v0>; /* 5v0 */
};
&head1 {
status = "okay";
nvidia,fb-bpp = <32>;
nvidia,fbmem-size = <265420800>; /* 8K (7680*4320) 32bpp double buffered */
nvidia,fb-flags = <TEGRA_FB_FLIP_ON_PROBE>;
win-mask = <0xC>;
nvidia,fb-win = <2>;
nvidia,dc-connector = <&sor0>;
nvidia,dc-flags = <TEGRA_DC_FLAG_ENABLED>;
vdd-dp-pwr-supply = <&p2888_spmic_sd0>;
avdd-dp-pll-supply = <&p2888_spmic_sd1>;
vdd-edp-sec-mode-supply = <&battery_reg>;
vdd-dp-pad-supply = <&battery_reg>;
vdd_hdmi_5v0-supply = <&p2822_vdd_hdmi_5v0>;
};
1.kernel/kernel-4.9/kernel/nvidia/drivers/video/tegra/dc/of_dc.c
tegra_dc_probe
解析设备树中的数据,然后驱动进行配置
of_dc_parse_platform_data
tegra_dc_register_typec_edev
dc 接口具体分析就不贴了,代码挺多!
USB VBUS 的设备树配置如下:
external-connection {
vbus_id_extcon: extcon@1 {
compatible = "extcon-gpio-states";
reg = <0x1>;
extcon-gpio,name = "VBUS";
extcon-gpio,cable-states = <
0x0 0x1
0x1 0x0>;
gpios = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Z, 1) 0>;
extcon-gpio,out-cable-names = <EXTCON_USB EXTCON_USB_HOST EXTCON_NONE>;
wakeup-source;
#extcon-cells = <1>;
};
};
extcon:External Connector framework 从名字看主要表征外部连接器的,通过gpio状态去识别外部连接器的类型,并通知关心外部连接器状态的驱动。 主要驱动代码路径: kernel/msm-4.19/include/linux/extcon.h kernel/msm-4.19/drivers/extcon
Jetson AGX Xavier支持4路加强型的USB接口,但不全是能用的,因为PCIE, SATA, UFS, and XUSB公用了UPHY.
USB TYPEC 接出的引脚图:
?D+/D- 连接到了UTMI,SSTX/SSRX 连接到了UPHY.
直接去掉TYPE C的PD controller及功能
Jetson/FAQ/BSP/Remove TypeC - eLinux.org
|