1. 18 9月, 2014 4 次提交
    • M
      can: flexcan: put TX mailbox into TX_INACTIVE mode after tx-complete · de594488
      Marc Kleine-Budde 提交于
      After sending a RTR frame the TX mailbox becomes a RX_EMPTY mailbox. To avoid
      side effects when the RX-FIFO is full, this patch puts the TX mailbox into
      TX_INACTIVE mode in the transmission complete interrupt handler. This, of
      course, leaves a race window between the actual completion of the transmission
      and the handling of tx-complete interrupt. However this is the best we can do
      without busy polling the tx complete interrupt.
      
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      de594488
    • D
      can: flexcan: implement workaround for errata ERR005829 · 25e92445
      David Jander 提交于
      This patch implements the workaround mentioned in ERR005829:
      
          ERR005829: FlexCAN: FlexCAN does not transmit a message that is enabled to
          be transmitted in a specific moment during the arbitration process.
      
      Workaround: The workaround consists of two extra steps after setting up a
      message for transmission:
      
      Step 8: Reserve the first valid mailbox as an inactive mailbox (CODE=0b1000).
      If RX FIFO is disabled, this mailbox must be message buffer 0. Otherwise, the
      first valid mailbox can be found using the "RX FIFO filters" table in the
      FlexCAN chapter of the chip reference manual.
      
      Step 9: Write twice INACTIVE code (0b1000) into the first valid mailbox.
      Signed-off-by: NDavid Jander <david@protonic.nl>
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      25e92445
    • D
      can: flexcan: correctly initialize mailboxes · fc05b884
      David Jander 提交于
      Apparently mailboxes may contain random data at startup, causing some of them
      being prepared for message reception. This causes overruns being missed or even
      confusing the IRQ check for trasmitted messages, increasing the transmit
      counter instead of the error counter.
      
      This patch initializes all mailboxes after the FIFO as RX_INACTIVE.
      Signed-off-by: NDavid Jander <david@protonic.nl>
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      fc05b884
    • M
      can: flexcan: mark TX mailbox as TX_INACTIVE · c32fe4ad
      Marc Kleine-Budde 提交于
      This patch fixes the initialization of the TX mailbox. It is now correctly
      initialized as TX_INACTIVE not RX_EMPTY.
      
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      c32fe4ad
  2. 11 9月, 2014 1 次提交
  3. 21 8月, 2014 2 次提交
  4. 17 3月, 2014 1 次提交
  5. 07 3月, 2014 2 次提交
  6. 03 3月, 2014 7 次提交
  7. 30 1月, 2014 1 次提交
  8. 26 11月, 2013 1 次提交
  9. 10 10月, 2013 2 次提交
    • M
      can: flexcan: fix mx28 detection by rearanging OF match table · e3587842
      Marc Kleine-Budde 提交于
      The current implemetation of of_match_device() relies that the of_device_id
      table in the driver is sorted from most specific to least specific compatible.
      
      Without this patch the mx28 is detected as the less specific p1010. This leads
      to a p1010 specific workaround is activated on the mx28, which is not needed.
      
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      e3587842
    • M
      can: flexcan: flexcan_chip_start: fix regression, mark one MB for TX and abort pending TX · d5a7b406
      Marc Kleine-Budde 提交于
      In patch
      
          0d1862ea can: flexcan: fix flexcan_chip_start() on imx6
      
      the loop in flexcan_chip_start() that iterates over all mailboxes after the
      soft reset of the CAN core was removed. This loop put all mailboxes (even the
      ones marked as reserved 1...7) into EMPTY/INACTIVE mode. On mailboxes 8...63,
      this aborts any pending TX messages.
      
      After a cold boot there is random garbage in the mailboxes, which leads to
      spontaneous transmit of CAN frames during first activation. Further if the
      interface was disabled with a pending message (usually due to an error
      condition on the CAN bus), this message is retransmitted after enabling the
      interface again.
      
      This patch fixes the regression by:
      1) Limiting the maximum number of used mailboxes to 8, 0...7 are used by the RX
      FIFO, 8 is used by TX.
      2) Marking the TX mailbox as EMPTY/INACTIVE, so that any pending TX of that
      mailbox is aborted.
      
      Cc: linux-stable <stable@vger.kernel.org>
      Cc: Lothar Waßmann <LW@KARO-electronics.de>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      d5a7b406
  10. 30 9月, 2013 1 次提交
  11. 21 9月, 2013 1 次提交
  12. 22 8月, 2013 1 次提交
  13. 01 8月, 2013 2 次提交
  14. 27 6月, 2013 1 次提交
  15. 03 6月, 2013 2 次提交
  16. 16 5月, 2013 1 次提交
  17. 26 1月, 2013 1 次提交
  18. 04 12月, 2012 1 次提交
  19. 27 11月, 2012 1 次提交
  20. 24 10月, 2012 1 次提交
  21. 02 10月, 2012 1 次提交
    • W
      flexcan: disable bus error interrupts for the i.MX28 · 4f72e5f0
      Wolfgang Grandegger 提交于
      Due to a bug in most Flexcan cores, the bus error interrupt needs
      to be enabled. Otherwise we don't get any error warning or passive
      interrupts. This is _not_ necessary for the i.MX28 and this patch
      disables bus error interrupts if "berr-reporting" is not requested.
      This avoids bus error flooding, which might harm, especially on
      low-end systems.
      
      To handle such quirks of the Flexcan cores, a hardware feature flag
      has been introduced, also replacing the "hw_ver" variable. So far
      nobody could tell what Flexcan core version is available on what
      Freescale SOC, apart from the i.MX6Q and P1010, and which bugs or
      features are present on the various "hw_rev".
      
      CC: Hui Wang <jason77.wang@gmail.com>
      CC: Shawn Guo <shawn.guo@linaro.org>
      Signed-off-by: NWolfgang Grandegger <wg@grandegger.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4f72e5f0
  22. 20 7月, 2012 2 次提交
    • S
      can: flexcan: add 2nd clock to support imx53 and newer · 3d42a379
      Steffen Trumtrar 提交于
      This patch adds support for a second clock to the flexcan driver. On
      modern freescale ARM cores like the imx53 and imx6q two clocks ("ipg"
      and "per") must be enabled in order to access the CAN core.
      
      In the original driver, the clock was requested without specifying the
      connection id, further all mainline ARM archs with flexcan support
      (imx28, imx25, imx35) register their flexcan clock without a
      connection id, too.
      
      This patch first renames the existing clk variable to clk_ipg and
      converts it to devm for easier error handling. The connection id "ipg"
      is added to the devm_clk_get() call. Then a second clock "per" is
      requested. As all archs don't specify a connection id, both clk_get
      return the same clock. This ensures compatibility to existing flexcan
      support and adds support for imx53 at the same time.
      
      After this patch hits mainline, the archs may give their existing
      flexcan clock the "ipg" connection id and implement a dummy "per"
      clock.
      
      This patch has been tested on imx28 (unmodified clk tree) and on imx53
      with a seperate "ipg" and "per" clock.
      
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: Shawn Guo <shawn.guo@linaro.org>
      Signed-off-by: NSteffen Trumtrar <s.trumtrar@pengutronix.de>
      Acked-by: NHui Wang <jason77.wang@gmail.com>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      3d42a379
    • M
      can: mark bittiming_const pointer in struct can_priv as const · 194b9a4c
      Marc Kleine-Budde 提交于
      This patch marks the bittiming_const pointer as in the struct can_pric as
      "const". This allows us to mark the struct can_bittiming_const in the CAN
      drivers as "const", too.
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      194b9a4c
  23. 17 7月, 2012 1 次提交
  24. 03 7月, 2012 1 次提交
    • H
      can: flexcan: add hardware controller version support · 30c1e672
      Hui Wang 提交于
      At least in the i.MX series, the flexcan contrller divides into ver_3
      and ver_10, current driver is for ver_3 controller.
      
      i.MX6 has ver_10 controller, it has more reigsters than ver_3 has.
      The rxfgmask (Rx FIFO Global Mask) register is one of the new added.
      Its reset value is 0xffffffff, this means ID Filter Table must be
      checked when receive a packet, but the driver is designed to accept
      everything during the chip start, we need to clear this register to
      follow this design.
      
      Use the data entry of the struct of_device_id to point chip specific
      info, we can set hardware version for each platform.
      
      Cc: linux-can@vger.kernel.org
      Cc: Marc Kleine-Budde <mkl@pengutronix.de>
      Cc: Wolfgang Grandegger <wg@grandegger.com>
      Cc: Shawn Guo <shawn.guo@linaro.org>
      Signed-off-by: NHui Wang <jason77.wang@gmail.com>
      [mkl: add id_table support]
      Tested-by: NHui Wang <jason77.wang@gmail.com>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      30c1e672
  25. 02 7月, 2012 1 次提交