public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/5] arm: socfpga: Add example UDC config
Date: Fri, 7 Nov 2014 16:31:32 +0100	[thread overview]
Message-ID: <201411071631.32139.marex@denx.de> (raw)
In-Reply-To: <20141107154000.2f059b83@amdc2363>

On Friday, November 07, 2014 at 03:40:00 PM, Lukasz Majewski wrote:
> Hi Marek,
> 
> > Add example of an USB UDC configuration with DFU and UMS.
> > 
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Chin Liang See <clsee@altera.com>
> > Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
> > Cc: Vince Bridgers <vbridger@altera.com>
> > Cc: Pavel Machek <pavel@denx.de>
> > Cc: Stefan Roese <sr@denx.de>
> > Cc: Lukasz Majewski <l.majewski@samsung.com>
> > ---
> > 
> >  board/altera/socfpga/socfpga_cyclone5.c | 21 +++++++++++++++++++++
> >  include/configs/socfpga_common.h        | 30
> > 
> > +++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 1
> > deletion(-)
> > 
> > diff --git a/board/altera/socfpga/socfpga_cyclone5.c
> > b/board/altera/socfpga/socfpga_cyclone5.c index 0f81d89..ce625e5
> > 100644 --- a/board/altera/socfpga/socfpga_cyclone5.c
> > +++ b/board/altera/socfpga/socfpga_cyclone5.c
> > @@ -8,6 +8,10 @@
> > 
> >  #include <asm/arch/reset_manager.h>
> >  #include <asm/io.h>
> > 
> > +#include <usb.h>
> > +#include <usb/s3c_udc.h>
> > +#include <usb_mass_storage.h>
> > +
> > 
> >  #include <netdev.h>
> >  
> >  DECLARE_GLOBAL_DATA_PTR;
> > 
> > @@ -39,3 +43,20 @@ int board_init(void)
> > 
> >  	return 0;
> >  
> >  }
> > 
> > +
> > +#ifdef CONFIG_USB_GADGET
> > +struct s3c_plat_otg_data socfpga_otg_data = {
> > +	.regs_otg	= CONFIG_USB_DWC2_REG_ADDR,
> > +	.usb_gusbcfg	= 0x1417,
> > +};
> > +
> > +int board_usb_init(int index, enum usb_init_type init)
> > +{
> > +	return s3c_udc_probe(&socfpga_otg_data);
> > +}
> > +
> > +int g_dnl_board_usb_cable_connected(void)
> > +{
> > +	return 1;
> > +}
> > +#endif
> > diff --git a/include/configs/socfpga_common.h
> > b/include/configs/socfpga_common.h index 1df886b..9823be6 100644
> > --- a/include/configs/socfpga_common.h
> > +++ b/include/configs/socfpga_common.h
> > @@ -37,7 +37,7 @@
> > 
> >   */
> >  
> >  #define CONFIG_NR_DRAM_BANKS		1
> >  #define PHYS_SDRAM_1			0x0
> > 
> > -#define CONFIG_SYS_MALLOC_LEN		(10 * 1024 * 1024)
> > +#define CONFIG_SYS_MALLOC_LEN		(64 * 1024 * 1024)
> > 
> >  #define CONFIG_SYS_MEMTEST_START	PHYS_SDRAM_1
> >  #define CONFIG_SYS_MEMTEST_END		PHYS_SDRAM_1_SIZE
> > 
> > @@ -191,6 +191,34 @@
> > 
> >  #endif
> >  
> >  /*
> > 
> > + * USB Gadget (DFU, UMS)
> > + */
> > +#if defined(CONFIG_CMD_DFU) || defined(CONFIG_CMD_USB_MASS_STORAGE)
> > +#define CONFIG_USB_GADGET
> > +#define CONFIG_USB_GADGET_S3C_UDC_OTG
> > +#define CONFIG_USB_GADGET_DUALSPEED
> > +#define CONFIG_USB_GADGET_VBUS_DRAW	2
> > +
> > +/* USB Composite download gadget - g_dnl */
> > +#define CONFIG_USBDOWNLOAD_GADGET
> > +#define CONFIG_USB_GADGET_MASS_STORAGE
> > +
> > +#define CONFIG_DFU_FUNCTION
> > +#define CONFIG_DFU_MMC
> > +#define CONFIG_SYS_DFU_DATA_BUF_SIZE	(32 * 1024 * 1024)
> > +#define DFU_DEFAULT_POLL_TIMEOUT	300
> > +
> > +/* USB IDs */
> > +#define CONFIG_G_DNL_VENDOR_NUM		0x0525	/*
> > NetChip */ +#define CONFIG_G_DNL_PRODUCT_NUM	0xA4A5	/*
> > Linux-USB File-backed Storage Gadget */ +#define
> > CONFIG_G_DNL_UMS_VENDOR_NUM	CONFIG_G_DNL_VENDOR_NUM +#define
> > CONFIG_G_DNL_UMS_PRODUCT_NUM	CONFIG_G_DNL_PRODUCT_NUM +#ifndef
> > CONFIG_G_DNL_MANUFACTURER +#define
> > CONFIG_G_DNL_MANUFACTURER	"Altera" +#endif
> > +#endif
> > +
> > +/*
> > 
> >   * U-Boot environment
> >   */
> >  
> >  #define CONFIG_SYS_CONSOLE_IS_IN_ENV
> 
> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
> Tested-by: Lukasz Majewski <l.majewski@samsung.com>

Queued for master, thanks!

  parent reply	other threads:[~2014-11-07 15:31 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04  5:07 [U-Boot] [PATCH 1/5] usb: s3c-otg: Remove useless include Marek Vasut
2014-11-04  5:07 ` [U-Boot] [PATCH 2/5] usb: s3c-otg: Encapsulate PHY control Marek Vasut
2014-11-04 19:30   ` Pavel Machek
2014-11-06  9:43   ` Lukasz Majewski
2014-11-04  5:07 ` [U-Boot] [PATCH 3/5] usb: s3c-otg: Split out " Marek Vasut
2014-11-04 19:34   ` Pavel Machek
2014-11-06 20:26     ` Marek Vasut
2014-11-07  8:59       ` Lukasz Majewski
2014-11-07  9:12         ` Marek Vasut
2014-11-07 10:08           ` Lukasz Majewski
2014-11-07 10:28             ` Marek Vasut
2014-11-07 14:23               ` Lukasz Majewski
2014-11-07 15:30                 ` Marek Vasut
2014-11-06  9:59   ` Lukasz Majewski
2014-11-06 20:23     ` Marek Vasut
2014-11-06 21:29       ` Lukasz Majewski
2014-11-07  8:05         ` Marek Vasut
2014-11-07 10:40           ` Lukasz Majewski
2014-11-04  5:07 ` [U-Boot] [PATCH 4/5] usb: s3c-otg: Allow custom gusbcfg Marek Vasut
2014-11-04 19:36   ` Pavel Machek
2014-11-06 20:27     ` Marek Vasut
2014-11-07  9:11       ` Lukasz Majewski
2014-11-07  9:25         ` Marek Vasut
2014-11-07 10:22           ` Lukasz Majewski
2014-11-07 14:33           ` Lukasz Majewski
2014-11-07 15:31             ` Marek Vasut
2014-11-04  5:07 ` [U-Boot] [PATCH 5/5] arm: socfpga: Add example UDC config Marek Vasut
2014-11-04 19:51   ` Pavel Machek
2014-11-04 20:09     ` Marek Vasut
2014-11-04 21:01       ` Pavel Machek
2014-11-07 14:40   ` Lukasz Majewski
2014-11-07 14:53     ` Marek Vasut
2014-11-07 15:28       ` Lukasz Majewski
2014-11-07 15:37         ` Marek Vasut
2014-11-07 15:31     ` Marek Vasut [this message]
2014-11-04 19:28 ` [U-Boot] [PATCH 1/5] usb: s3c-otg: Remove useless include Pavel Machek
2014-11-06  9:32 ` Lukasz Majewski

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=201411071631.32139.marex@denx.de \
    --to=marex@denx.de \
    --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