Edit online

数据结构设计

CMU 模块关键结构体定义如下:
  • aic_clk_fixed_parent_cfg
    struct aic_clk_fixed_parent_cfg {
        struct aic_clk_comm_cfg comm;   // 时钟操作的函数集合
        u32 offset_reg;                 // 寄存器偏移地址
        s8 bus_gate_bit;                // 总线使能位偏移
        s8 mod_gate_bit;                // 模块使能位偏移
        u8 div_bit;                     // 分频系数位偏移
        u8 div_mask;                    // 分频系数 Mask
        u8 id;                          // 时钟 id
        u8 type;                        // 时钟类型
        u8 parent_id;                   // 父时钟 id
        u8 flag;
    };
  • aic_clk_multi_parent_cfg
    struct aic_clk_multi_parent_cfg {
        struct aic_clk_comm_cfg comm;   // 时钟操作的函数集合
        u32 offset_reg;                 // 寄存器偏移地址
        s32 gate_bit;                   // 时钟使能位偏移
        u8 mux_bit;                     // 父时钟源选择位的 bit 偏移
        u8 mux_mask;                    // 父时钟源选择位 Mask
        u8 div0_bit;                    // 分频系数位偏移
        u8 div0_mask;                   // 分频系数 Mask
        u8 id;                          // 时钟 id
        u8 num_parents;                 // 父时钟个数
        const u8 *parent_ids;           // 父时钟数组
    };
  • aic_clk_pll_cfg
    struct aic_clk_pll_cfg {
        struct aic_clk_comm_cfg comm;   // 时钟操作的函数集合
        u32 offset_gen;                 // 整数分频寄存器的偏移
        u32 offset_fra;                 // 小数分频寄存器的偏移
        u32 offset_sdm;                 // 展频寄存器的偏移
        u8 id;                          // 时钟 id
        u8 type;                        // 时钟类型
        u8 parent_id;                   // 父时钟 id
        u8 flag;
    };
  • aic_clk_disp_cfg
    struct aic_clk_disp_cfg {
        struct aic_clk_comm_cfg comm;   // 时钟操作的函数集合
        u32 offset_reg;                 // 寄存器偏移地址
        u8 divn_bit;                    // 分频系数 N 位偏移
        u8 divn_mask;                   // 分频系数 N 位 Mask
        u8 divm_bit;                    // 分频系数 M 位偏移
        u8 divm_mask;                   // 分频系数 M 位 Mask
        u8 divl_bit;                    // 分频系数 L 位偏移
        u8 divl_mask;                   // 分频系数 L 位 Mask
        u8 pix_divsel_bit;              // pix 分频系数位偏移
        u8 pix_divsel_mask;             // pix 分频系数位 Mask
        u8 id;                          // 时钟 id
        u8 parent_id;                   // 父时钟 id
    };