unsigned long flags)
 {
        struct clk_hw *hw = ERR_PTR(-ENOMEM), *mux_hw;
-       struct clk_hw *div_hw, *gate_hw;
+       struct clk_hw *div_hw, *gate_hw = NULL;
        struct clk_divider *div = NULL;
        struct clk_gate *gate = NULL;
        struct clk_mux *mux = NULL;
        div->lock = &imx_ccm_lock;
        div->flags = CLK_DIVIDER_ROUND_CLOSEST;
 
-       gate = kzalloc(sizeof(*gate), GFP_KERNEL);
-       if (!gate)
-               goto fail;
+       /* skip registering the gate ops if M4 is enabled */
+       if (!mcore_booted) {
+               gate = kzalloc(sizeof(*gate), GFP_KERNEL);
+               if (!gate)
+                       goto fail;
 
-       gate_hw = &gate->hw;
-       gate->reg = reg;
-       gate->bit_idx = PCG_CGC_SHIFT;
-       gate->lock = &imx_ccm_lock;
+               gate_hw = &gate->hw;
+               gate->reg = reg;
+               gate->bit_idx = PCG_CGC_SHIFT;
+               gate->lock = &imx_ccm_lock;
+       }
 
        hw = clk_hw_register_composite(NULL, name, parent_names, num_parents,
                        mux_hw, mux_ops, div_hw,