From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Sun, 25 Oct 2015 12:46:30 +0100 Subject: [U-Boot] [PATCH 2/2] musb: sunxi: Implement dfu_usb_get_reset() In-Reply-To: <201510251200.09867.marex@denx.de> References: <1445748287-12421-1-git-send-email-siarhei.siamashka@gmail.com> <1445748287-12421-3-git-send-email-siarhei.siamashka@gmail.com> <201510251200.09867.marex@denx.de> Message-ID: <20151025124630.68a2f2e6@lilith> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Marek, On Sun, 25 Oct 2015 12:00:09 +0100, Marek Vasut wrote: > On Sunday, October 25, 2015 at 05:44:47 AM, Siarhei Siamashka wrote: > > This is necessary to distinguish between the "dfu-util --detach" and > > the "dfu-util --reset" requests. > > > > The default weak implementation of dfu_usb_get_reset() unconditionally > > reboots the device, but we want to be able to continue the boot.scr > > execution after writing the kernel, fdt and ramdisk to RAM via DFU. > > > > Signed-off-by: Siarhei Siamashka > > --- > > drivers/usb/musb-new/sunxi.c | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c > > index a146c08..5eb8d19 100644 > > --- a/drivers/usb/musb-new/sunxi.c > > +++ b/drivers/usb/musb-new/sunxi.c > > @@ -166,6 +166,17 @@ static void USBC_ConfigFIFO_Base(void) > > } > > > > /************************************************************************* > > ***** + * Needed for the DFU polling magic > > + > > ************************************************************************** > > ****/ + > > +static u8 last_int_usb; > > + > > +bool dfu_usb_get_reset(void) > > +{ > > + return !!(last_int_usb & MUSB_INTR_RESET); > > The !! is not needed. Except if you want to be sure that you return 0 or 1 rather than 0 or (1 << something). > [...] > > Best regards, > Marek Vasut Amicalement, -- Albert.