public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <l.majewski@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] usb:g_dnl:ums: Conditional compilation for mass storage function (f_mass_storage)
Date: Tue, 24 Sep 2013 10:11:08 +0200	[thread overview]
Message-ID: <20130924101108.00d15f73@amdc308.digital.local> (raw)
In-Reply-To: <1379426303-16111-1-git-send-email-l.majewski@samsung.com>

Hi Marek,

> The mass storage composite function is now compiled in only when
> CONFIG_USB_GADGET_MASS_STORAGE is defined.
> Such change provides binary size reduction for boards which use USB
> download gadget (like am335x_evm) with DFU, but don't use UMS.
> 
> For example at am335x_evm board reduction is more than 2KiB for
> text and around 120B for data.
> 

Any comments on those patches (from patch 1 to 3)?

> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> Cc: Marek Vasut <marex@denx.de>
> ---
>  drivers/usb/gadget/Makefile |    1 +
>  drivers/usb/gadget/g_dnl.c  |    2 +-
>  include/usb_mass_storage.h  |    9 +++++++++
>  3 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
> index 4d51f59..1590c4a 100644
> --- a/drivers/usb/gadget/Makefile
> +++ b/drivers/usb/gadget/Makefile
> @@ -23,6 +23,7 @@ COBJS-$(CONFIG_USB_GADGET_S3C_UDC_OTG) +=
> s3c_udc_otg.o COBJS-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o
>  COBJS-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
>  COBJS-$(CONFIG_DFU_FUNCTION) += f_dfu.o
> +COBJS-$(CONFIG_USB_GADGET_MASS_STORAGE) += f_mass_storage.o
>  endif
>  ifdef CONFIG_USB_ETHER
>  COBJS-y += ether.o
> diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
> index a3e05a8..19011bf 100644
> --- a/drivers/usb/gadget/g_dnl.c
> +++ b/drivers/usb/gadget/g_dnl.c
> @@ -15,11 +15,11 @@
>  #include <part.h>
>  
>  #include <g_dnl.h>
> +#include <usb_mass_storage.h>
>  #include "f_dfu.h"
>  
>  #include "gadget_chips.h"
>  #include "composite.c"
> -#include "f_mass_storage.c"
>  
>  /*
>   * One needs to define the following:
> diff --git a/include/usb_mass_storage.h b/include/usb_mass_storage.h
> index 35cdcc3..e08deb4 100644
> --- a/include/usb_mass_storage.h
> +++ b/include/usb_mass_storage.h
> @@ -11,6 +11,7 @@
>  #define SECTOR_SIZE		0x200
>  
>  #include <mmc.h>
> +#include <linux/usb/composite.h>
>  
>  struct ums_device {
>  	struct mmc *mmc;
> @@ -39,4 +40,12 @@ extern struct ums_board_info
> *board_ums_init(unsigned int, extern int
> usb_gadget_handle_interrupts(void); extern int fsg_main_thread(void
> *); 
> +#ifdef CONFIG_USB_GADGET_MASS_STORAGE
> +int fsg_add(struct usb_configuration *c);
> +#else
> +int fsg_add(struct usb_configuration *c)
> +{
> +	return 0;
> +}
> +#endif
>  #endif /* __USB_MASS_STORAGE_H__ */



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

  parent reply	other threads:[~2013-09-24  8:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-17 13:58 [U-Boot] [PATCH 1/3] usb:g_dnl:ums: Conditional compilation for mass storage function (f_mass_storage) Lukasz Majewski
2013-09-17 13:58 ` [U-Boot] [PATCH 2/3] usb:gadget:Remove redundant #includes for USB composite gadget and its functions Lukasz Majewski
2013-09-17 13:58 ` [U-Boot] [PATCH 3/3] usb:g_dnl:dfu: Download gadget and DFU function code clean up Lukasz Majewski
2013-09-24  8:11 ` Lukasz Majewski [this message]
2013-09-24  8:47   ` [U-Boot] [PATCH 1/3] usb:g_dnl:ums: Conditional compilation for mass storage function (f_mass_storage) Marek Vasut
2013-09-27 11:34     ` Lukasz Majewski
2013-09-27 14:29       ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130924101108.00d15f73@amdc308.digital.local \
    --to=l.majewski@samsung.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox