mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
SAMA5D3x-EK: Add support for USB MSC device on AT25 serial flash
This commit is contained in:
@@ -486,14 +486,14 @@ config USBMSC_EP0MAXPACKET
|
||||
|
||||
config USBMSC_EPBULKOUT
|
||||
int "Bulk OUT endpoint number"
|
||||
default 0
|
||||
default 2
|
||||
---help---
|
||||
The logical 7-bit address of a hardware endpoints that support
|
||||
bulk OUT and IN operations
|
||||
|
||||
config USBMSC_EPBULKIN
|
||||
int "Bulk IN endpoint number"
|
||||
default 0
|
||||
default 3
|
||||
---help---
|
||||
The logical 7-bit address of a hardware endpoints that support
|
||||
bulk OUT and IN operations
|
||||
@@ -522,17 +522,17 @@ config USBMSC_BULKOUTREQLEN
|
||||
maxpacket and ideally as large as a block device sector.
|
||||
|
||||
config USBMSC_VENDORID
|
||||
hex "Mass stroage Vendor ID"
|
||||
hex "Mass storage Vendor ID"
|
||||
default 0x00
|
||||
|
||||
config USBMSC_VENDORSTR
|
||||
string "Mass stroage vendor string"
|
||||
string "Mass storage vendor string"
|
||||
default "Nuttx"
|
||||
---help---
|
||||
The vendor ID code/string
|
||||
|
||||
config USBMSC_PRODUCTID
|
||||
hex "Mass stroage Product ID"
|
||||
hex "Mass storage Product ID"
|
||||
default 0x00
|
||||
|
||||
config USBMSC_PRODUCTSTR
|
||||
@@ -544,7 +544,7 @@ config USBMSC_VERSIONNO
|
||||
default "0x399"
|
||||
|
||||
config USBMSC_REMOVABLE
|
||||
bool "Mass stroage remove able"
|
||||
bool "Mass storage remove able"
|
||||
default n
|
||||
---help---
|
||||
Select if the media is removable
|
||||
|
||||
@@ -922,7 +922,6 @@ int usbmsc_setconfig(FAR struct usbmsc_dev_s *priv, uint8_t config)
|
||||
#ifdef CONFIG_USBDEV_DUALSPEED
|
||||
FAR const struct usb_epdesc_s *epdesc;
|
||||
bool hispeed = (priv->usbdev->speed == USB_SPEED_HIGH);
|
||||
uint16_t bulkmxpacket;
|
||||
#endif
|
||||
int i;
|
||||
int ret = 0;
|
||||
@@ -966,12 +965,11 @@ int usbmsc_setconfig(FAR struct usbmsc_dev_s *priv, uint8_t config)
|
||||
/* Configure the IN bulk endpoint */
|
||||
|
||||
#ifdef CONFIG_USBDEV_DUALSPEED
|
||||
bulkmxpacket = USBMSC_BULKMAXPACKET(hispeed);
|
||||
epdesc = USBMSC_EPBULKINDESC(hispeed);
|
||||
ret = EP_CONFIGURE(priv->epbulkin, epdesc, false);
|
||||
epdesc = USBMSC_EPBULKINDESC(hispeed);
|
||||
ret = EP_CONFIGURE(priv->epbulkin, epdesc, false);
|
||||
#else
|
||||
ret = EP_CONFIGURE(priv->epbulkin,
|
||||
usbmsc_getepdesc(USBMSC_EPFSBULKIN), false);
|
||||
ret = EP_CONFIGURE(priv->epbulkin,
|
||||
usbmsc_getepdesc(USBMSC_EPFSBULKIN), false);
|
||||
#endif
|
||||
if (ret < 0)
|
||||
{
|
||||
|
||||
@@ -784,6 +784,8 @@ static inline int usbmsc_cmdstartstopunit(FAR struct usbmsc_dev_s *priv)
|
||||
if (ret == OK)
|
||||
{
|
||||
#ifndef CONFIG_USBMSC_REMOVABLE
|
||||
FAR struct usbmsc_lun_s *lun = priv->lun;
|
||||
|
||||
/* This command is not valid if the media is not removable */
|
||||
|
||||
usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_NOTREMOVABLE), 0);
|
||||
@@ -806,8 +808,8 @@ static inline int usbmsc_cmdpreventmediumremoval(FAR struct usbmsc_dev_s *priv)
|
||||
{
|
||||
#ifdef CONFIG_USBMSC_REMOVABLE
|
||||
FAR struct scsicmd_preventmediumremoval_s *pmr = (FAR struct scsicmd_preventmediumremoval_s *)priv->cdb;
|
||||
FAR struct usbmsc_lun_s *lun = priv->lun;
|
||||
#endif
|
||||
FAR struct usbmsc_lun_s *lun = priv->lun;
|
||||
int ret;
|
||||
|
||||
priv->u.alloclen = 0;
|
||||
|
||||
Reference in New Issue
Block a user