Skip to content
Snippets Groups Projects
  1. Jun 24, 2021
    • Lukasz Majewski's avatar
      net: imx: Adjust fec_main.c to provide support for L2 switch · 00793ea4
      Lukasz Majewski authored
      This patch provides the code for re-using generic FEC i.MX code for
      More Than IP L2 switch.
      
      The trick here is to reconfigure FEC driver to use DMA0 as the one
      connected to switch's port 0. Port 1 and 2 are then connected to
      ENET-MAC.
      
      The internal connection diagram can be found here [0].
      
      This code has been developed on i.MX287 device, but this switch (from
      More ThanIP) can be also found on e.g. NXP's Vybrid VF610 SoC.
      
      To reuse as much code as possible it was also necessary to introduce
      fec_hwp() wrapper, which either returns pointer to MAC or L2 switch
      interrupt and buffer descriptors.
      Following registers shall be used with it:
      FEC_{IEVENT|IMASK}, FEC_MTIP_R_DES_ACTIVE_0, FEC_MTIP_X_DES_ACTIVE_0,
      FEC_MTIP_R_DES_START_0, FEC_MTIP_X_DES_START_0
      This driver introduces special wrappers to map on fly DMA0 to either
      ENET-MAC0 or L2 switch port 0.
      
      The most intrusive changes when L2 switch is used:
      
      - Disable RACC (Receive Data Accelerator)
      When this feature is enabled the data is shifted by 16 bits and
      hence received packets are malformed when we try to pass data from
      one switch port to another.
      
      - L2 switch shall pass the whole pkt_len packet. Current FEC code
      subtract 4 to remove FCS
      
      The control of FEC clock and promisc is handled by bridge driver, so
      there is no need for adjustments.
      
      This driver forward ports the legacy driver [1][2] into contemporary
      Linux.
      
      Last but not least - some functions had to be exported to allow proper
      configuration of ethernet interfaces when bridging was enabled/disabled.
      
      Links:
      [0] - Chapter 29.3.1 in
      "i.MX28 Applications Processor Reference Manual, Rev. 2, 08/2013"
      [1]
      From 2.6 i.MX kernel:
      Repo: git://git.freescale.com/imx/linux-2.6-imx.git
      Branch: imx_2.6.35_maintain
      SHA1: b3912bb8a4caf3ec50909135e88af959982c43ca
      
      [2] - https://github.com/lmajewski/linux-imx28-l2switch/commits/master
      
      
      
      Signed-off-by: default avatarLukasz Majewski <lukma@denx.de>
      00793ea4
    • Lukasz Majewski's avatar
      net: Provide switchdev driver for NXP's More Than IP L2 switch · b2ee1858
      Lukasz Majewski authored
      
      This change provides driver for More Than IP L2 switch IP block to hook
      into switchdev subsystem to provide bridging offloading for i.MX28
      SoC (imx287 to be precise).
      
      This code is responsible for configuring this device as L2 bridge when
      one decides to bridge eth[01] interfaces (so no vlan, filtering table
      aging supported).
      
      This driver shall be regarded as a complementary one for NXP's FEC
      (fec_main.c). It reuses some code from it.
      
      Signed-off-by: default avatarLukasz Majewski <lukma@denx.de>
      b2ee1858
    • Lukasz Majewski's avatar
      ARM: dts: imx28: Add description for L2 switch on XEA board · 8d2f06c4
      Lukasz Majewski authored
      
      The 'eth_switch' node is now extendfed to enable support for L2
      switch.
      
      Moreover, the mac[01] nodes are defined as well and linked to the
      former with 'phy-handle' property.
      
      Signed-off-by: default avatarLukasz Majewski <lukma@denx.de>
      8d2f06c4
  2. Jun 11, 2021
  3. Apr 25, 2021
  4. Apr 24, 2021
  5. Apr 23, 2021
  6. Apr 22, 2021
  7. Apr 21, 2021
Loading