From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukasz Majewski Date: Wed, 20 Aug 2014 09:37:26 +0200 Subject: [U-Boot] [UBOOT RFC PATCH 09/13] common: cmd_dfu: add an API that takes controller index for handling interrupts In-Reply-To: <53F376C5.5010607@ti.com> References: <1408372115-4570-1-git-send-email-kishon@ti.com> <1408372115-4570-10-git-send-email-kishon@ti.com> <20140819105353.6ae63d94@amdc2363> <53F376C5.5010607@ti.com> Message-ID: <20140820093726.4ce91f1d@amdc2363> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Kishon, > Hi, > > On Tuesday 19 August 2014 02:23 PM, Lukasz Majewski wrote: > > Hi Kishon, > > > >> Since there can be multiple USB controllers in the system, > >> usb_gadget_handle_interrupts should take controller index as > >> arguments. > > > > The controller index is passed in the ums/dfu/thor command. Then PHY > > subsystem is properly configured. > > Since we only handle one USB controller transmission at a time > > (u-boot doesn't use interrupts - we only pool) the > > usb_gadget_handle_interrupts() was enough for our purpose. > > yeah, if we have only one USB controller in the system, controller > index is not needed. To sum up: 1. You should be able to specify the USB controller when calling dfu or ums commands (as it is now). 2. If this is not enough for some reason (and good justification is welcome here), then usb_gadget_handle_interrupts() should be extended to accept the controller index argument. > > -Kishon > > > > To start transmission from other usb controller you need to end > > current transmission and then invoke modified command with > > different controller number. > > > > It would be enough to extend > > usb_gadget_handle_interrupts() to accept controller index argument > > (only six boards use it - it shall be easy to modify them all). > > > >> However such an API can only be added in board file so > >> added board_usb_gadget_handle_interrupts(). > >> usb_gadget_handle_interrupts() should be deprecated. > >> > >> Signed-off-by: Kishon Vijay Abraham I > >> --- > >> common/cmd_dfu.c | 1 + > >> include/usb.h | 7 +++++++ > >> 2 files changed, 8 insertions(+) > >> > >> diff --git a/common/cmd_dfu.c b/common/cmd_dfu.c > >> index 1e7d50c..f27ba52 100644 > >> --- a/common/cmd_dfu.c > >> +++ b/common/cmd_dfu.c > >> @@ -52,6 +52,7 @@ static int do_dfu(cmd_tbl_t *cmdtp, int flag, int > >> argc, char * const argv[]) goto exit; > >> > >> usb_gadget_handle_interrupts(); > >> + > >> board_usb_gadget_handle_interrupts(controller_index); > > > > NAK, for the reason stated above. > > > >> } > >> exit: > >> g_dnl_unregister(); > >> diff --git a/include/usb.h b/include/usb.h > >> index d9fedee..26c6462 100644 > >> --- a/include/usb.h > >> +++ b/include/usb.h > >> @@ -197,6 +197,13 @@ int board_usb_init(int index, enum > >> usb_init_type init); */ > >> int board_usb_cleanup(int index, enum usb_init_type init); > >> > >> +/* > >> + * Can be use to handle interrupts from a specific controller. > >> + * > >> + * @index index of the USB controller > >> + */ > >> +int board_usb_gadget_handle_interrupts(int index); > >> + > >> #ifdef CONFIG_USB_STORAGE > >> > >> #define USB_MAX_STOR_DEV 5 > > > > > > -- Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group