1. 20 Oct, 2013 3 commits
    • Troy Kisky's avatar
      usb: gadget: mv_udc: fix typo in error message · d0928794
      Troy Kisky authored
      
      
      Change 'nfo=' to 'info='
      Signed-off-by: default avatarTroy Kisky <troy.kisky@boundarydevices.com>
      d0928794
    • Troy Kisky's avatar
      usb: gadget: ether: return error from rx_submit if no request · 71fc5f91
      Troy Kisky authored
      
      
      This prevents a crash if tftpboot is given a bad filename.
      
      rx_req will be released by eth_reset_config
      which is called by eth_disconnect,
      which is called using the .disconnect member of usb_gadget_driver by mv_pullup in mv_udc
      which is called using the .pullup member of usb_gadget_ops by usb_gadget_disconnect
      which is called by usb_eth_halt
      which is called using the .halt member of eth_device by eth_halt
      which is called by TftpHandler when TFTP_ERR_FILE_NOT_FOUND or TFTP_ERR_ACCESS_DENIED occurs
      
      I trigger this with the following commands
      setenv ipaddr 10.0.0.2 && setenv netmask 255.255.255.0 && setenv serverip 10.0.0.1
      setenv usbnet_devaddr 00:11:22:33:44:55 && setenv usbnet_hostaddr 00:aa:bb:cc:dd:ee
      setenv ethprime usb_ether && setenv ethact usb_ether && setenv ncip 10.0.0.1
      tftpboot 10800000 10.0.0.1:missing_file
      Signed-off-by: default avatarTroy Kisky <troy.kisky@boundarydevices.com>
      71fc5f91
    • Troy Kisky's avatar
      usb: gadget: ether set wMaxPacketSize · 43880ce5
      Troy Kisky authored
      
      
      set wMaxPacketSize for full speed descriptors
      fs_source_desc, fs_sink_desc to 64.
      
      Full-speed bulk endpoint can have a maximum packet size of
      8, 16, 32, or 64 bytes, so choice 64.
      
      The hs_source_desc, hs_sink_desc, already have their wMaxPacketSize
      set to 512. That is the only legal value for high speed bulk endpoints.
      
      Strictly speaking, this patch is not needed because
      usb_ep_autoconfig will call ep_matches which will
      override wMaxPacketSize for BULK endpoints only with
      the size associated with the endpoint setup by the udc driver.
      But if you want to rely on this, you may as well combine the
      full speed descriptor with the high speed descriptor to
      minimize confusion.
      Signed-off-by: default avatarTroy Kisky <troy.kisky@boundarydevices.com>
      43880ce5
  2. 14 Oct, 2013 2 commits
  3. 24 Sep, 2013 7 commits
  4. 26 Aug, 2013 2 commits
  5. 19 Aug, 2013 1 commit
  6. 29 Jul, 2013 16 commits
    • Lukasz Majewski's avatar
      dfu: Implementation of target reset after communication with dfu-util's -R switch · 6bed7ce5
      Lukasz Majewski authored
      
      
      This patch extends dfu code to support transmission with -R switch
      specified at dfu-util.
      
      When -R is specified, the extra USB_REQ_DFU_DETACH request is sent after
      successful data transmission. Then dfu resources are released and reset
      command is issued.
      Signed-off-by: default avatarLukasz Majewski <l.majewski@samsung.com>
      Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
      6bed7ce5
    • Marek Vasut's avatar
      usb: mv_udc: Add bounce buffer · 6dd30af0
      Marek Vasut authored
      
      
      The requests sent to the controller are not properly cache aligned
      most of the time, thus implement a simple bounce buffer to avoid
      problem with cache.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Lei Wen <leiwen@marvell.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      6dd30af0
    • Marek Vasut's avatar
      usb: mv_udc: Add proper cache management · f19a343e
      Marek Vasut authored
      
      
      Implement functions to flush/invalidate dcache over QH and qTDs
      and make use of them where appropriate. Also use them to replace
      the old incorrect cache management attempt. This is the first step
      towards making this driver work with data cache enabled.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Lei Wen <leiwen@marvell.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      f19a343e
    • Marek Vasut's avatar
      usb: mv_udc: Implement better qTD item accessor · ede709c0
      Marek Vasut authored
      
      
      The code for retrieving qTD item for particular endpoint is hard
      to understand, moreover it's duplicated all over the driver. Move
      the code into single nice and documented function.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Lei Wen <leiwen@marvell.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      ede709c0
    • Marek Vasut's avatar
      usb: mv_udc: Improve allocation of qTD items · 8a095a68
      Marek Vasut authored
      
      
      Allocate the qTD items all at once instead of allocating them
      separately. Moreover, make sure each qTD is properly aligned
      to 32-bytes boundary and that cache can be safely flushed over
      each qTD touple.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Lei Wen <leiwen@marvell.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      8a095a68
    • Marek Vasut's avatar
      usb: mv_udc: Implement better QH accessor · b5cd45bf
      Marek Vasut authored
      
      
      The code for retrieving QH for particular endpoint is hard to understand,
      moreover it's duplicated all over the driver. Move the code into single
      nice and documented function.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Lei Wen <leiwen@marvell.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      b5cd45bf
    • Marek Vasut's avatar
      usb: mv_udc: Add cacheline length check · 5804b885
      Marek Vasut authored
      
      
      Check the length of system cacheline at compile-time and fail
      if the system uses too long cachelines.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Lei Wen <leiwen@marvell.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      5804b885
    • Marek Vasut's avatar
      usb: mv_udc: Properly align the endpoint QH and qTD list · ab65da14
      Marek Vasut authored
      
      
      The endpoint QH list has to be aligned to 10-bit boundary. We also have
      to make sure the list is aligned on a cacheline boundary. Make sure it
      is. Furthermore, check if the memory allocation for the QH list didn't
      fail. Moveover, improve the comment about the QH list structure.
      
      Finally, the qTD item list has to be aligned only to 5-bit boundary, not
      10-bit as it is now, fix this as well.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Lei Wen <leiwen@marvell.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      ab65da14
    • Marek Vasut's avatar
      usb: mv_udc: Move QH and qTD into mv_drv · ab52df19
      Marek Vasut authored
      
      
      Both the endpoint queue head and the endpoint item list is a controller
      specific thing. Move them both into controller private data.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Lei Wen <leiwen@marvell.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      ab52df19
    • Marek Vasut's avatar
      usb: mv_udc: Init mv_drv.gadget.ops statically · fe48f058
      Marek Vasut authored
      
      
      There is no need to init this field at runtime, so init it statically.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Lei Wen <leiwen@marvell.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      fe48f058
    • Marek Vasut's avatar
      usb: mv_udc: Remove QH_MAXNUM macro · f6463177
      Marek Vasut authored
      
      
      The QH_MAXNUM is used in absolutelly incorrect manner and is not
      even needed. Remove it and correctly replace it's occurance with
      2 * NUM_ENDPOINTS .
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Lei Wen <leiwen@marvell.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      f6463177
    • Marek Vasut's avatar
      usb: mv_udc: Clean up the initial variable check · d7663038
      Marek Vasut authored
      
      
      Clean up the code that checks the validity of a USB gadget driver
      in usb_gadget_register_driver(). Moreover, limit the speed of the
      driver to either FULL or HIGH, this is more precise and once we
      have xHCI support, also more correct.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Lei Wen <leiwen@marvell.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      d7663038
    • Marek Vasut's avatar
      usb: mv_udc: Make use of struct ehci_ctrl · be7ed253
      Marek Vasut authored
      
      
      The usb_lowlevel_init() call already fills and passes back struct
      ehci_ctrl , which readily contains correctly determined address of
      the port register block address computed from values from controller
      configuration registers. Leverage this and make use of this value
      as this makes the code mode universal, but also gets us rid of the
      CONFIG_USB_REG_BASE configuration option.
      
      Moreover, this patch cleans up the usb_gadget_register_driver() call
      a little by correcting the error handling. Note the usb_lowlevel_init()
      and mvudc_probe() are now called in reversed order, but this has no
      impact on the code.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Lei Wen <leiwen@marvell.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      be7ed253
    • Marek Vasut's avatar
      usb: mv_udc: Clean up the EP initialization · 2ea4b448
      Marek Vasut authored
      
      
      Move the constant values that are programmed into mv_ep.ep into
      separate static const structure so they can be memcpy()'d when
      the initialization happens.
      
      Moveover, we only every init NUM_ENDPOINTS, not 2 * NUM_ENDPOINTS,
      so fix this bug as well.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Lei Wen <leiwen@marvell.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      2ea4b448
    • Marek Vasut's avatar
      usb: mv_udc: Move endpoint array into driver data · 532d846f
      Marek Vasut authored
      
      
      The endpoints are operated on a per-controller basis, move the
      endpoint array into controller's private data. Also shuffle the
      struct mv_ep structure definition just above the definition of
      the struct mv_drv so they're well grouped together.
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Lei Wen <leiwen@marvell.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      532d846f
    • Marek Vasut's avatar
      usb: mv_udc: Unbreak the mv_udc driver · a7eafcfe
      Marek Vasut authored
      
      
      The mv_udc driver is broken for a while and doesn't even compile.
      This patch fixes the issues and gets the driver into working state
      again. This driver was tested on Freescale i.MX233/i.MX28 .
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Cc: Lei Wen <leiwen@marvell.com>
      Cc: Otavio Salvador <otavio@ossystems.com.br>
      Cc: Stefano Babic <sbabic@denx.de>
      a7eafcfe
  7. 24 Jul, 2013 2 commits
  8. 10 Jul, 2013 2 commits
  9. 30 Jun, 2013 5 commits