1. 04 Mar, 2021 14 commits
  2. 03 Mar, 2021 21 commits
    • Tom Rini's avatar
      Merge tag 'u-boot-imx-20210303' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx · 52ba373b
      Tom Rini authored
      i.MX for 2021.04
      ----------------
      
      - new boards:
      	- i.MX8MN Beacon EmbeddedWorks (2GB)
      	- Gateworks Venice imx8mm
      - convert to DM:
      	- imx53-qsb, mx53loco, mx51evk, mx23-evk
      - Fixes :
      	- Network : FEC ethernet quirks
      	- DH dh-imx6
      
      CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/6597
      52ba373b
    • Tim Harvey's avatar
      board: gateworks: imx8mm: Add Gateworks Venice board support · 03bf8436
      Tim Harvey authored
      Add initial support for Gateworks Venice product family based on the
      i.MX 8M Mini SoC
      Signed-off-by: default avatarTim Harvey <tharvey@gateworks.com>
      03bf8436
    • Tim Harvey's avatar
      arm: dts: imx8mm: add Gateworks i.MX8 Mini Dev kits · 5db93abe
      Tim Harvey authored
      Add Gateworks i.MX 8M Mini Development kits from Linux-5.12-rc1
      Signed-off-by: default avatarTim Harvey <tharvey@gateworks.com>
      5db93abe
    • Tom Rini's avatar
      Merge https://source.denx.de/u-boot/custodians/u-boot-usb · 23ab54e0
      Tom Rini authored
      - Kconfig dependency fix for USB_KEYBOARD
      - musb gadget fixes / enhancements
      23ab54e0
    • Heinrich Schuchardt's avatar
      usb: USB keyboard requires DM_KEYBOARD · 795d605c
      Heinrich Schuchardt authored
      If CONFIG_DM_USB=y, the USB keyboard only works if CONFIG_DM_KEYBOARD=y.
      Signed-off-by: Heinrich Schuchardt's avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
      795d605c
    • Pali Rohár's avatar
      Nokia RX-51: Enable usbtty serial console by default · 57ac2872
      Pali Rohár authored
      Now when usbtty serial console is fixed in U-Boot enable CONFIG_USB_TTY for
      Nokia RX-51 board by default.
      
      Fix also USB product id as U-Boot ignores CONFIG_USBD_PRODUCTID macro and
      include U-Boot string into USB product name to indicate usage of U-Boot.
      
      CONFIG_CONSOLE_MUX is already used and U-Boot console is available for
      all in/out devices. Therefore there is no need to have separate commands
      'run sercon', 'run usbcon' and 'run vgacon', so remove them.
      
      As space for U-Boot is limited to 256kB, enable CONFIG_OPTIMIZE_INLINING
      and disable some other unused options so CONFIG_USB_TTY can be enabled.
      
      Nokia RX-51 does not have easily accessible UART serial console so the only
      option for easy debugging is to use device's keyboard+screen or this usbtty
      serial console over USB.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      57ac2872
    • Pali Rohár's avatar
      Nokia RX-51: Move content of rx51.h to rx51.c · 69b78cbf
      Pali Rohár authored
      After removal of MUX configuration there is no need to have extra rx51.h.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      69b78cbf
    • Pali Rohár's avatar
      Nokia RX-51: Remove function set_muxconf_regs() · b99e03d9
      Pali Rohár authored
      This function is not used and was never called.
      
      This board contains '#define CONFIG_SKIP_LOWLEVEL_INIT' because X-Loader
      set everything up, including MUX configuration.
      
      Also this MUX configuration is incorrect and does not match hardware.
      
      So remove this dead, unused and broken code.
      
      This change will decrease size of U-Boot binary.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      b99e03d9
    • Pali Rohár's avatar
      arm: omap3: Compile s_init() function only when it is used · 50ef3851
      Pali Rohár authored
      Function s_init() is called only from lowlevel_init(). So compile it only
      when function lowlevel_init() is compiled.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      50ef3851
    • Pali Rohár's avatar
      arm: omap3: Compile lowlevel_init() function only when it is used · 628680a9
      Pali Rohár authored
      Function lowlevel_init() is called only from cpu_init_crit() and this
      function is wrapped into #if .. #endif section. So compile also
      lowlevel_init() function under same #if condition.
      
      Function cpy_clk_code() uses lowlevel_init symbol to get address where
      go_to_speed code ends. As this symbol is not available anymore when
      compiling with CONFIG_SKIP_LOWLEVEL_INIT, defines a new label
      go_to_speed_end at the place where go_to_speed code ends.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      628680a9
    • Pali Rohár's avatar
      usb: gadget: Use dbg_ep0() macro instead of serial_printf() · 7f98575b
      Pali Rohár authored
      All debug messages from ep0.c except a few are printed by dbg_ep0() macro.
      So for remaining few exceptions use also dbg_ep0() instead of serial_printf().
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      7f98575b
    • Pali Rohár's avatar
      usb: musb: Ensure that we set musb dynamic FIFO buffer for every endpoint · f2e81c1d
      Pali Rohár authored
      If we do not set FIFO buffer address and size for some endpoint which is in
      use then default programmed address 0x0 would be used which is in conflict
      with address of FIFO buffer for endpoint 0. Moreover address of FIFO buffer
      for endpoint 0 cannot be programmed, it is fixed to 0x0. Sharing address
      space between more endpoints cause data loss and unexpected errors.
      
      This patch is fixing transmission of characters over usbtty serial console
      and allows using of usbtty for debugging purposes on Nokia N900.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      f2e81c1d
    • Pali Rohár's avatar
      usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand · f1e8d207
      Pali Rohár authored
      Interrupt for EP0 is indicated in intrtx register via first bit. This bit
      is set for both RX and TX despite register has only TX in its name. First
      bit in intrrx register is reserved, not used and never set.
      
      So remove calling musb_peri_ep0() function at every iteration of udc_irq()
      and musb_peri_rx() and call it only from musb_peri_tx() when correct
      interrupt bit in initrtx it set.
      
      Address from SET ADDRESS command must be set to faddr register only after
      acknowledging SERV_RXPKTRDY followed by received EP0 interrupt. So prior
      calling musb_peri_ep0_set_address() check for EP0 interrupt instead of
      (incorrect) MUSB_INTR_SOF interrupt.
      
      This patch fixes issue that host (computer) cannot register U-Boot USB
      device and is failing with errors:
      
          usb 1-1: new full-speed USB device number 86 using xhci_hcd
          usb 1-1: Device not responding to setup address.
          usb 1-1: Device not responding to setup address.
          usb 1-1: device not accepting address 86, error -71
      
      U-Boot was writing address to faddr register too early and did not wait for
      correct interrupt after which should update address.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      f1e8d207
    • Pali Rohár's avatar
      usb: musb: Fix receiving of bigger buffers · ff77bb30
      Pali Rohár authored
      If musb_peri_rx_ep() was called to process received HW buffer but U-Boot
      cannot read it yet (e.g. because U-Boot SW buffer is full) then interrupt
      was marked as processed also when HW buffer stayed unprocessed.
      
      U-Boot tried to process this buffer again when it received interrupt again,
      but it can receive it only when sender (host) sends a new data. As sender
      (host) is not going to send a new data until U-Boot process current data
      this issue caused a deadlock in case sender (host) is emitting data faster
      than U-Boot can process it.
      
      Reading musb intrrx register automatically clears this register and marks
      interrupt as processed. So to prevent marking interrupt in U-Boot as
      processed, adds a new variable pending_intrrx which would contain
      unprocessed bits of intrrx register.
      
      For a second step, every time when musb_peri_rx_ep() is called and there
      are waiting data to be processed (signaled by MUSB_RXCSR_RXPKTRDY) either
      acknowledge sender (via musb_peri_rx_ack()) that whole HW buffer was
      processed or set corresponding bit in pending_intrrx that HW buffer was not
      fully processed yet and next iteration is required after U-Boot allocates
      space for reading HW buffer.
      
      This patch fixes receiving large usb buffers, e.g. file transfer via Kermit
      protocol implemented by 'loadb' U-Boot command over usbtty serial console.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      ff77bb30
    • Pali Rohár's avatar
      usb: musb: Fix transmission of bigger buffers · ea7125c4
      Pali Rohár authored
      If udc_endpoint_write() was called with bigger payload which does not fit
      into one USB packet it is needed to transmit payload in more USB packets.
      First packet is transmitted by udc_endpoint_write() call itself and other
      packets are put into waiting queue.
      
      Implement function musb_peri_tx() which checks if endpoints are ready for
      transmit and continue transmission of waiting queue.
      
      This patch fixes sending big output from printenv command over usbtty
      serial console.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz&gt;>
      ea7125c4
    • Pali Rohár's avatar
      usb: musb: Read value of PERI_RXCSR to 16bit variable · 7d7ae28c
      Pali Rohár authored
      PERI_RXCSR is 16bit register so store its value into 16bit local variable.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      7d7ae28c
    • Pali Rohár's avatar
      usb: musb: Fix configuring FIFO for endpoints · 10bc1325
      Pali Rohár authored
      This patch fixes configuring FIFOs for one-directional endpoints which have
      only one queue (either RX or TX, but noth both).
      
      Size of FIFO buffer is 2^(idx+3) bytes and starting address is 2^(addr+3).
      Moreover first 64 bytes are reserved for EP0.
      
      Without this patch if FIFO size specified by caller was zero then idx was
      incorrectly calculated (expr. ffs(0)-1) and size overflowed in fifosz
      register. This register uses has only 4 bits for FIFO size. Moreover
      specifying zero buffer size is not possible (with idx=0 is minimal buffer
      size 8 bytes).
      
      So even for one-directional endpoints we need to correctly specify both
      (RX and TX) FIFO buffer sizes and its addresses.
      
      This patch is fixing calculation of start address and buffer size to
      minimal value and ensures that it would not overlap with buffer reserved
      for EP0.
      
      This issue caused loose of packets on USB bus in both directions and
      basically usbtty was unusable.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      10bc1325
    • Pali Rohár's avatar
      usb: musb: Always clear the data toggle bit when configuring ep · a6f5e1b9
      Pali Rohár authored
      Without this patch clearing was done only when U-Boot was compiled with
      MUSB Host Controller. But clearing of data toggle bit is needed also for
      MUSB Device Controller otherwise Device Controller does not work correctly.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      a6f5e1b9
    • Pali Rohár's avatar
      usb: musb: Fix compilation of gadget code · 4cc53ef1
      Pali Rohár authored
      musb udc code depends on usb gadget code provided by CONFIG_USB_DEVICE as
      defined in drivers/usb/gadget/Makefile. But this Makefile is not included
      into U-Boot build when CONFIG_USB_GADGET is not set. As CONFIG_USB_DEVICE
      cannot be enabled together with CONFIG_USB_GADGET it means that dependency
      for musb udc code is not compiled during build. Fix it by including
      drivers/usb/gadget dependency also when CONFIG_USB_DEVICE is set.
      
      This patch fixes compile errors:
      
      arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_ep0_rx':
      u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `ep0_recv_setup'
      arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_ep0_idle':
      u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `ep0_recv_setup'
      arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_ep0_zero_data_request':
      u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
      arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_ep0_idle':
      u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `ep0_recv_setup'
      arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_ep0_rx':
      u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_rcv_complete'
      arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `musb_peri_rx_ep':
      u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_rcv_complete'
      arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `udc_endpoint_write':
      u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_tx_complete'
      arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `udc_irq':
      u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
      arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
      arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
      arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
      arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
      arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o:u-boot/drivers/usb/musb/musb_udc.c: more undefined references to `usbd_device_event_irq' follow
      arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `udc_setup_ep':
      u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_alloc_urb'
      arm-linux-gnueabi-ld.bfd: drivers/usb/musb/built-in.o: in function `udc_startup_events':
      u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
      arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
      arm-linux-gnueabi-ld.bfd: u-boot/drivers/usb/musb/musb_udc.c: undefined reference to `usbd_device_event_irq'
      make: *** [Makefile:1762: u-boot] Error 1
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      4cc53ef1
    • Pali Rohár's avatar
      serial: usbtty: Send urb data in correct order · 7f840c1b
      Pali Rohár authored
      Function next_urb() selects the last urb data buffer from linked list to
      which next data from usbtty's puts function should be appended.
      
      But to check if TX data still exists it is needed to look at the first urb
      data buffer from linked list. So check for endpoint->tx_urb (first from the
      linked list) instead of current_urb (the last from the linked list).
      
      Successful call to udc_endpoint_write() may invalidate active urb and
      allocate new urb in queue which invalidates pointer returned by next_urb()
      function.
      
      So call next_urb() prior putting data into urb buffer and call it every
      time after using udc_endpoint_write() function to prevent sending data from
      usbtty's puts function in incorrect order.
      
      This patch fixes issue that usbtty code does not transmit data when they
      are waiting in the tx queue.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      7f840c1b
    • Pali Rohár's avatar
      serial: usbtty: Fix puts function · d3fb8fee
      Pali Rohár authored
      This function has incorrect implementation of prepending CR prior LF.
      Without this patch it prepended CR prior whole string which is going to be
      written and let LF without leading CR. Fix this issue by inserting CR at
      correct place to make output on usbtty serial console more readable.
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
      Acked-by: default avatarPavel Machek <pavel@ucw.cz>
      d3fb8fee
  3. 02 Mar, 2021 5 commits