RK3588设备树节点解读(rk3588s.dtsi)

顶层结构

/ {
    compatible = "rockchip,rk3588";

    interrupt-parent = <&gic>;
    #address-cells = <2>;
    #size-cells = <2>;

    aliases {
        ...
    };

    clocks {
        ...
    };

    cpus {
        ...
    };

    ...
};
  • / 节点:根节点,描述整个设备树的属性。
  • compatible:指定设备的兼容性字符串,这里表示兼容 “rockchip,rk3588”。
  • interrupt-parent:指定中断控制器的父节点,这里是 &gic。
  • #address-cells 和 #size-cells:定义地址和大小单元的数量,这里都为 2。

Aliases

aliases {
    csi2dcphy0 = &csi2_dcphy0;
    ...
};
  • aliases:定义一些易于使用的别名,简化对设备节点的引用。

时钟配置

clocks {
    compatible = "simple-bus";
    #address-cells = <2>;
    #size-cells = <2>;
    ranges;

    spll: spll {
        compatible = "fixed-clock";
        #clock-cells = <0>;
        clock-frequency = <702000000>;
        clock-output-names = "spll";
    };

    xin32k: xin32k {
        compatible = "fixed-clock";
        #clock-cells = <0>;
        clock-frequency = <32768>;
        clock-output-names = "xin32k";
    };

    ...
};
  • clocks:定义时钟相关的信息。
  • compatible:指定设备的兼容性,这里是 “simple-bus”。
  • spll 和 xin32k:定义固定频率的时钟。

CPU 节点

cpus {
    #address-cells = <1>;
    #size-cells = <0>;

    cpu-map {
        cluster0 {
            core0 {
                cpu = <&cpu_l0>;
            };
            ...
        };
        ...
    };

    cpu_l0: cpu@0 {
        device_type = "cpu";
        compatible = "arm,cortex-a55";
        reg = <0x0>;
        enable-method = "psci";
        capacity-dmips-mhz = <530>;
        clocks = <&scmi_clk SCMI_CLK_CPUL>;
        operating-points-v2 = <&cluster0_opp_table>;
        cpu-idle-states = <&CPU_SLEEP>;
        i-cache-size = <32768>;
        i-cache-line-size = <64>;
        i-cache-sets = <128>;
        d-cache-size = <32768>;
        d-cache-line-size = <64>;
        d-cache-sets = <128>;
        next-level-cache = <&l2_cache_l0>;
        #cooling-cells = <2>;
        dynamic-power-coefficient = <100>;
    };

    ...
};

  • cpus:定义 CPU 的相关信息。
  • cpu-map:定义 CPU 的层次结构。
  • cpu_l0:具体 CPU 的描述。
    • device_type:设备类型为 “cpu”。
    • compatible:兼容的 CPU 类型为 “arm,cortex-a55”。
    • reg:CPU 在设备树中的地址。
    • enable-method:启用 CPU 的方法,这里是 “psci”。
    • capacity-dmips-mhz:CPU 每 MHz 的 DMIPS 值。
    • clocks:CPU 使用的时钟。
    • operating-points-v2:CPU 的工作点(频率和电压)。
    • cpu-idle-states:CPU 的空闲状态。
    • i-cache-size/d-cache-size:指令和数据缓存的大小。
    • i-cache-line-size/d-cache-line-size:缓存行大小。
    • i-cache-sets/d-cache-sets:缓存集合数目。
    • next-level-cache:下一级缓存。
    • #cooling-cells:用于热管理的降温单元数。
    • dynamic-power-coefficient:动态功耗系数。

电源管理

pmu: power-management@fd8d8000 {
    compatible = "rockchip,rk3588-pmu", "syscon", "simple-mfd";
    reg = <0x0 0xfd8d8000 0x0 0x400>;

    power: power-controller {
        compatible = "rockchip,rk3588-power-controller";
        #power-domain-cells = <1>;
        #address-cells = <1>;
        #size-cells = <0>;
        status = "okay";

        ...
    };
};
  • pmu:电源管理单元。
    • compatible:表示兼容 “rockchip,rk3588-pmu”,“syscon”,“simple-mfd”。
    • reg:设备寄存器地址和大小。
  • power-controller:电源控制器的属性。
    • #power-domain-cells:电源域单元数。
    • #address-cells/#size-cells:地址和大小单元数。
    • status:设备状态,这里是 “okay”。

中断控制器

gic: interrupt-controller@fe600000 {
    compatible = "arm,gic-v3";
    #interrupt-cells = <3>;
    #address-cells = <2>;
    #size-cells = <2>;
    ranges;
    interrupt-controller;

    reg = <0x0 0xfe600000 0 0x10000>, /* GICD */
          <0x0 0xfe680000 0 0x100000>; /* GICR */
    interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>;
    its0: msi-controller@fe640000 {
        compatible = "arm,gic-v3-its";
        msi-controller;
        #msi-cells = <1>;
        reg = <0x0 0xfe640000 0x0 0x20000>;
    };
    its1: msi-controller@fe660000 {
        compatible = "arm,gic-v3-its";
        msi-controller;
        #msi-cells = <1>;
        reg = <0x0 0xfe660000 0x0 0x20000>;
    };
};
  • gic:中断控制器。
    • compatible:表示兼容 “arm,gic-v3”。
    • #interrupt-cells:中断单元数。
    • #address-cells/#size-cells:地址和大小单元数。
    • ranges:地址范围。
    • interrupt-controller:标记这是一个中断控制器。
    • reg:寄存器地址和大小。
    • interrupts:中断信息,类型为 GIC PPI,编号为 9,触发类型为高电平。
  • its0 和 its1:中断翻译服务器(ITS)控制器。
    • compatible:表示兼容 “arm,gic-v3-its”。
    • msi-controller:标记这是一个 MSI 控制器。
    • #msi-cells:MSI 单元数。
    • reg:寄存器地址和大小。

其他设备

文件中还定义了其他许多设备,如 USB 控制器、显示子系统、音频子系统、各种总线接口(I2C、SPI、UART 等)、GPU、NPU、VPU、SATA 控制器等。每个设备节点通常包含以下信息:

  • compatible:设备的兼容性字符串。
  • reg:设备寄存器地址和大小。
  • interrupts:设备中断信息。
  • clocks 和 clock-names:时钟信息。
  • resets 和 reset-names:复位信息。
  • status:设备状态(如 “okay” 或 “disabled”)。
RK3588是一款高性能的应用处理器,广泛用于多媒体、人工智能等应用场景。HDMI Rx (HDMI接收) 设备树配置对于连接外部显示设备至关重要。下面将简要介绍如何在Linux内核中为RK3588配置HDMI RX功能的设备树。 ### 1. 基本结构 通常,在`dtsi`文件(如rk3588.dtsi)里会预先定义好一些基础节点信息,并留有钩子给特定板级设计做进一步定制化修改。你需要找到类似以下内容的部分: ```c &hdmi_in { compatible = "rockchip,rk3588-hdmirx"; pinctrl-names = "default"; pinctrl-0 = <&hdmi_rx_pin>; status = "okay"; /* 其他属性 */ }; ``` 这里的关键点包括: - `compatible`: 指定兼容驱动名称。 - `pinctrl-*`: 定义了GPIO复用设置。 - `status`: 控制是否激活此节点,默认应设为"okay"表示启用该模块。 ### 2. 配置具体参数 根据实际硬件需求调整分辨率及时钟频率等相关参数: ```c /* 示例 - 设置默认解析度 */ initial_EDID_override = <...>; /* 或者更详细的配置 */ display-timings { native-mode = <&timing_4Kp60>; timing_4Kp60: timing@0 { clock-frequency = <74250000>; // 单位Hz hactive = <3840>; vactive = <2160>; hfront-porch = ...; hback-porch = ...; vsync-len = ...; ... }; } ``` > **注意**:上述代码片段仅为示意目的而编写,具体的数值需要依据实际情况确定,比如从EDID数据获取显示器支持的最佳模式。 ### 3. 引入PIN控制 确保正确的IO端口分配以及必要的电气特性设定,这部分一般位于`.dtsi`中的独立部分并引用进来: ```c hdmi_rx_pin: hdmi-rx-pin { rockchip,pins = < RK_PD0 (PIN_OUTPUT | RK_FUNC_HDMI) ... >; }; ``` 这指定了哪些引脚应该被配置成HDMI_RX专用的功能角色。 --- 以上就是关于RK3588平台上通过Device Tree对HDMI RX的支持进行基本描述的过程概述。如果你正在尝试构建或调试这样的系统,请务必参考最新的官方文档和技术手册获得最准确的信息和支持资料。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值