public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] rockchip: missing request op in common pinctrl driver resulting kernel boot failure
@ 2019-06-14  9:09 Levin Du
  2019-06-14 14:52 ` Mark Kettenis
  0 siblings, 1 reply; 3+ messages in thread
From: Levin Du @ 2019-06-14  9:09 UTC (permalink / raw)
  To: u-boot

Hi all,

I try U-Boot v2019.04 on the Firefly-RK3399 board and the kernel failed during
loading. After doing some `git bisect`, I find the commit
e7ae4cf27a6d5837cb5e868712cdaa61d3ceb5e0 (which is adding common rockchip
pinctrl driver) is where the problem starts to emerge.

After some trial and error, it seems that the new pinctrl driver has got rid
of the request op. But in board/rockchip/evb_rk3399/evb-rk3399.c:


       /* Enable pwm0 for panel backlight */                                                                                                      
       ret = pinctrl_request_noflags(pinctrl, PERIPH_ID_PWM0);                                                                                    
       if (ret) {                                                                                                                                 
               debug("%s PWM0 pinctrl init fail! (ret=%d)\n", __func__, ret);                                                                     
               goto out;                                                                                                                          
       }                                                                                                                                          
                                                                                                                                                  

The pinctrl_request_noflags call will fail and end, skiping the regulator
operations in normal flow.

Adding a dummy request function (return 0) to rockchip_pinctrl_ops solves the
kernel hang: 

+static int rockchip_pinctrl_request(struct udevice *dev, int func, int flags)
+{
+       struct rockchip_pinctrl_priv *priv = dev_get_priv(dev);
+
+       debug("%s: func=%x, flags=%x\n", __func__, func, flags);
+       return 0;
+}
+
 const struct pinctrl_ops rockchip_pinctrl_ops = {
+        .request                      = rockchip_pinctrl_request,
        .set_state                      = rockchip_pinctrl_set_state,
        .get_gpio_mux                   = rockchip_pinctrl_get_gpio_mux,
 };

But I wonder why no other RK3399 boards experience the same problem. If I'd
like to write a patch to address this, a dummy request function is not proper
IMO. I'm seeking your advice. Thanks in advance.

Best Regards,
-- 
Levin Du

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-17  7:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-14  9:09 [U-Boot] rockchip: missing request op in common pinctrl driver resulting kernel boot failure Levin Du
2019-06-14 14:52 ` Mark Kettenis
2019-06-17  7:44   ` djw at t-chip.com.cn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox