1. 12 Jul, 2018 13 commits
  2. 18 Jun, 2018 8 commits
  3. 14 Jun, 2018 1 commit
  4. 12 Jun, 2018 18 commits
    • Benjamin Herrenschmidt's avatar
      fsi/sbefifo: Add driver for the SBE FIFO · 9f4a8a2d
      Benjamin Herrenschmidt authored
      This driver provides an in-kernel and a user API for accessing
      the command FIFO of the SBE (Self Boot Engine) of the POWER9
      processor, via the FSI bus.
      
      It provides an in-kernel interface to submit command and receive
      responses, along with a helper to locate and analyse the response
      status block. It's a simple synchronous submit() type API.
      
      The user interface uses the write/read interface that an earlier
      version of this driver already provided, however it has some
      specific limitations in order to keep the driver simple and
      avoid using up a lot of kernel memory:
      
       - The user should perform a single write() with the command and
         a single read() to get the response (with a buffer big enough
         to hold the entire response).
      
       - On a write() the command is simply "stored" into a kernel buffer,
         it is submitted as one operation on the subsequent read(). This
         allows to have the code write directly from the FIFO into the user
         buffer and avoid hogging the SBE between the write() and read()
         syscall as it's critical that the SBE be freed asap to respond
         to the host. An extra write() will simply replace the previously
         written command.
      
       - A write of a single 4 bytes containing the value 0x52534554
         in big endian will trigger a reset request. No read is necessary,
         the write() call will return when the reset has been acknowledged
         or times out.
      
       - The command is limited to 4K bytes.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Tested-by: default avatarJoel Stanley <joel@jms.id.au>
      ---
      9f4a8a2d
    • Eddie James's avatar
      fsi: scom: Remove PIB reset during probe · 52b7116e
      Eddie James authored
      The PIB reset causes problems for the running P9 chip. The reset
      shouldn't be performed by this driver.
      Signed-off-by: default avatarEddie James <eajames@linux.vnet.ibm.com>
      Reviewed-by: default avatarChristopher Bostic <cbostic@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Tested-by: default avatarJoel Stanley <joel@jms.id.au>
      52b7116e
    • Jeremy Kerr's avatar
      fsi/master-gpio: Replace bit_bit lock with IRQ disable/enable · 26d79b27
      Jeremy Kerr authored
      We currently use a spinlock (bit_lock) around operations that clock bits
      out of the FSI bus, and a mutex to protect against simultaneous access
      to the master.
      
      This means that bit_lock isn't needed for mutual exlusion, only to
      prevent timing issues when clocking bits out.
      
      To reflect this, this change converts bit_lock to just the
      local_irq_save/restore operation.
      Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Tested-by: default avatarJoel Stanley <joel@jms.id.au>
      26d79b27
    • Benjamin Herrenschmidt's avatar
      fsi/fsi-master-gpio: More error handling cleanup · c49e3440
      Benjamin Herrenschmidt authored
      Remove calls to the empty and useless fsi_master_gpio_error()
      function, and report CRC errors as "FSI_ERR_NO_SLAVE" when
      reading an all 1's response.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Tested-by: default avatarJoel Stanley <joel@jms.id.au>
      c49e3440
    • Benjamin Herrenschmidt's avatar
      fsi/fsi-master-gpio: Implement CRC error recovery · 4e56828a
      Benjamin Herrenschmidt authored
      The FSI protocol defines two modes of recovery from CRC errors,
      this implements both:
      
       - If the device returns an ECRC (it detected a CRC error in the
         command), then we simply issue the command again.
      
       - If the master detects a CRC error in the response, we send
         an E_POLL command which requests a resend of the response
         without actually re-executing the command (which could otherwise
         have unwanted side effects such as dequeuing a FIFO twice).
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reviewed-by: default avatarChristopher Bostic <cbostic@linux.vnet.ibm.com>
      Tested-by: default avatarJoel Stanley <joel@jms.id.au>
      ---
      
      Note: This was actually tested by removing some of my fixes, thus
      causing us to hit occasional CRC errors during high LPC activity.
      4e56828a
    • Jeremy Kerr's avatar
      fsi/gpio: Use relative-addressing commands · 0e82e5c1
      Jeremy Kerr authored
      FSI CFAMs support shorter commands that use a relative (or same) address
      as the last. This change introduces a last_addr to the master state, and
      uses it for subsequent reads/writes, and performs relative addressing
      when a subsequent read/write is in range.
      Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reviewed-by: default avatarChristopher Bostic <cbostic@linux.vnet.ibm.com>
      Tested-by: default avatarJoel Stanley <joel@jms.id.au>
      0e82e5c1
    • Jeremy Kerr's avatar
      fsi/gpio: Include command build in locked section · 8193fb44
      Jeremy Kerr authored
      For implementing relative addressing mode, we'll need to build a command
      that is coherent with CFAM state. To do that, include the
      build_command_* functions in the locked section of read/write/term.
      Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Tested-by: default avatarJoel Stanley <joel@jms.id.au>
      8193fb44
    • Benjamin Herrenschmidt's avatar
      fsi/fsi-master-gpio: Delay sampling of FSI data input · f3ca4834
      Benjamin Herrenschmidt authored
      Most SoC GPIO implementations, including the Aspeed one, have
      synchronizers on the GPIO inputs. This means that the value
      read from a GPIO is a couple of clocks old, from whatever clock
      source feeds those synchronizers.
      
      In practice, this means that in no-delay mode, we are using a
      value that can potentially be a bit too old and too close to
      the clock edge establishing the data on the other side of the link.
      
      The voltage converters we use on some systems make this worse
      and sensitive to things like voltage fluctuations etc... This is,
      we believe, the cause of occasional CRC errors encountered during
      heavy activity on the LPC bus.
      
      This is fixed by introducing a dummy GPIO read before the actual
      data read. It slows down SBEFIFO by about 15% (less than any delay
      primitive) and the end result is so far solid.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reviewed-by: default avatarChristopher Bostic <cbostic@linux.vnet.ibm.com>
      Tested-by: default avatarJoel Stanley <joel@jms.id.au>
      f3ca4834
    • Benjamin Herrenschmidt's avatar
      fsi/fsi-master-gpio: Reduce dpoll clocks · b632642e
      Benjamin Herrenschmidt authored
      FSI_GPIO_DPOLL_CLOCKS is the number of clocks before sending
      a DPOLL command after receiving a BUSY status. It should be
      at least tSendDelay (16 clocks).
      
      According to comments in the code, it needs to also be at least
      21 clocks due to HW issues.
      
      It's currently 100 clocks which impacts performances negatively
      in some cases. Reduces it in half to 50 clocks which seems to
      still be solid.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reviewed-by: default avatarChristopher Bostic <cbostic@linux.vnet.ibm.com>
      Tested-by: default avatarJoel Stanley <joel@jms.id.au>
      b632642e
    • Benjamin Herrenschmidt's avatar
      fsi/fsi-master-gpio: Reduce turnaround clocks · 97a4e5c9
      Benjamin Herrenschmidt authored
      FSI_GPIO_PRIME_SLAVE_CLOCKS is the number of clocks if the
      "idle" phase between the end of a response and the beginning
      of the next one. It corresponds to tSendDelay in the FSI
      specification.
      
      The default value in the slave is 16 clocks. 100 is way overkill
      and significantly reduces the driver performance.
      
      This changes it to 20 (which gives the HW a bit of margin still
      just in case).
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reviewed-by: default avatarChristopher Bostic <cbostic@linux.vnet.ibm.com>
      Tested-by: default avatarJoel Stanley <joel@jms.id.au>
      97a4e5c9
    • Benjamin Herrenschmidt's avatar
      fsi/fsi-master-gpio: Add "no-gpio-delays" option · bc1099d2
      Benjamin Herrenschmidt authored
      This adds support for an optional device-tree property that
      makes the driver skip all the delays around clocking the
      GPIOs and set it in the device-tree of common POWER9 based
      OpenPower platforms.
      
      This useful on chips like the AST2500 where the GPIO block is
      running at a fairly low clock frequency (25Mhz typically). In
      this case, the delays are unnecessary and due to the low
      precision of the timers, actually quite harmful in terms of
      performance.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reviewed-by: default avatarChristopher Bostic <cbostic@linux.vnet.ibm.com>
      Tested-by: default avatarJoel Stanley <joel@jms.id.au>
      bc1099d2
    • Benjamin Herrenschmidt's avatar
      fsi/fsi-master-gpio: Sample input data on different clock phase · 5d0d16f1
      Benjamin Herrenschmidt authored
      We currently sample the input data right after we toggle the
      clock low, then high. The slave establishes the data on the
      rising edge, so this is not ideal. We should sample it on
      the low phase instead.
      
      This currently works because we have an extra delay, but subsequent
      patches will remove it.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Reviewed-by: default avatarChristopher Bostic <cbostic@linux.vnet.ibm.com>
      Tested-by: default avatarJoel Stanley <joel@jms.id.au>
      5d0d16f1
    • Jeremy Kerr's avatar
      fsi: gpio: Use a mutex to protect transfers · e5538139
      Jeremy Kerr authored
      Reduce time spent with interrupts disabled by limiting the critical
      sections to bitbanging FSI symbols. We only need to ensure exclusive use
      of the bus for an entire transfer, not that the transfer be performed in
      atomic context.
      Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Tested-by: default avatarJoel Stanley <joel@jms.id.au>
      e5538139
    • Andrew Jeffery's avatar
    • Andrew Jeffery's avatar
      fsi: gpio: Trace busy count · 918da951
      Andrew Jeffery authored
      An observation from trace output of the existing FSI tracepoints was
      that the remote device was sometimes reporting as busy. Add a new
      tracepoint reporting the busy count in order to get a better grip on how
      often this is the case.
      Signed-off-by: default avatarAndrew Jeffery <andrew@aj.id.au>
      Acked-by: default avatarEddie James <eajames@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Tested-by: default avatarJoel Stanley <joel@jms.id.au>
      918da951
    • Linus Torvalds's avatar
      Merge tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 8efcf34a
      Linus Torvalds authored
      Pull ARM SoC late updates from Olof Johansson:
       "This is a branch with a few merge requests that either came in late,
        or took a while longer for us to review and merge than usual and thus
        cut it a bit close to the merge window. We stage them in a separate
        branch and if things look good, we still send them up -- and that's
        the case here.
      
        This is mostly DT additions for Renesas platforms, adding IP block
        descriptions for existing and new SoCs.
      
        There are also some driver updates for Qualcomm platforms for SMEM/QMI
        and GENI, which is their generalized serial protocol interface"
      
      * tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (186 commits)
        soc: qcom: smem: introduce qcom_smem_virt_to_phys()
        soc: qcom: qmi: fix a buffer sizing bug
        MAINTAINERS: Update pattern for qcom_scm
        soc: Unconditionally include qcom Makefile
        soc: qcom: smem: check sooner in qcom_smem_set_global_partition()
        soc: qcom: smem: fix qcom_smem_set_global_partition()
        soc: qcom: smem: fix off-by-one error in qcom_smem_alloc_private()
        soc: qcom: smem: byte swap values properly
        soc: qcom: smem: return proper type for cached entry functions
        soc: qcom: smem: fix first cache entry calculation
        soc: qcom: cmd-db: Make endian-agnostic
        drivers: qcom: add command DB driver
        arm64: dts: renesas: salvator-common: Add ADV7482 support
        ARM: dts: r8a7740: Add CEU1
        ARM: dts: r8a7740: Add CEU0
        arm64: dts: renesas: salvator-common: enable VIN
        arm64: dts: renesas: r8a77970: add VIN and CSI-2 nodes
        arm64: dts: renesas: r8a77965: add VIN and CSI-2 nodes
        arm64: dts: renesas: r8a7796: add VIN and CSI-2 nodes
        arm64: dts: renesas: r8a7795-es1: add CSI-2 node
        ...
      8efcf34a
    • Linus Torvalds's avatar
      Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 32bcbf8b
      Linus Torvalds authored
      Pull ARM SoC driver updates from Olof Johansson:
       "This contains platform-related driver updates for ARM and ARM64.
      
        Highlights:
      
         - ARM SCMI (System Control & Management Interface) driver cleanups
      
         - Hisilicon support for LPC bus w/ ACPI
      
         - Reset driver updates for several platforms: Uniphier,
      
         - Rockchip power domain bindings and hardware descriptions for
           several SoCs.
      
         - Tegra memory controller reset improvements"
      
      * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (59 commits)
        ARM: tegra: fix compile-testing PCI host driver
        soc: rockchip: power-domain: add power domain support for px30
        dt-bindings: power: add binding for px30 power domains
        dt-bindings: power: add PX30 SoCs header for power-domain
        soc: rockchip: power-domain: add power domain support for rk3228
        dt-bindings: power: add binding for rk3228 power domains
        dt-bindings: power: add RK3228 SoCs header for power-domain
        soc: rockchip: power-domain: add power domain support for rk3128
        dt-bindings: power: add binding for rk3128 power domains
        dt-bindings: power: add RK3128 SoCs header for power-domain
        soc: rockchip: power-domain: add power domain support for rk3036
        dt-bindings: power: add binding for rk3036 power domains
        dt-bindings: power: add RK3036 SoCs header for power-domain
        dt-bindings: memory: tegra: Remove Tegra114 SATA and AFI reset definitions
        memory: tegra: Remove Tegra114 SATA and AFI reset definitions
        memory: tegra: Register SMMU after MC driver became ready
        soc: mediatek: remove unneeded semicolon
        soc: mediatek: add a fixed wait for SRAM stable
        soc: mediatek: introduce a CAPS flag for scp_domain_data
        soc: mediatek: reuse regmap_read_poll_timeout helpers
        ...
      32bcbf8b
    • Linus Torvalds's avatar
      Merge tag 'armsoc-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 721afaa2
      Linus Torvalds authored
      Pull ARM SoC device tree updates from Olof Johansson:
       "As always, a large number of DT updates. Too many to enumerate them
        all, but at a glance:
      
        New SoCs introduced in this release:
      
         - Amlogic:
            + Meson 8M2 SoC, a.k.a. S812. A quad Cortex-A9 SoC used in some
              set top boxes and other products.
      
         - Mediatek:
            + MT7623A, which is a flavor of the MT7623 family with other
              on-chip ethernet options.
      
         - Qualcomm:
            + SDM845, a.k.a Snapdragon 845, an 4+4-core Kryo 385/845
              (Cortex-A75/A55 derivative) SoC that's one of the current
              high-end mobile SoCs.
      
              It's great to see mainline support for it. So far, you can't do
              much with it, since a lot of peripherals are not yet in the DTs
              but driver support for USB, GPU and other pieces are starting to
              trickle in. This might end up being a well-supported SoC
              upstream if the momentum keeps up.
      
         - Renesas:
            + R8A77990, a.k.a R-Car E3, a new automotive
              entertainment-targeted SoC. Currently only one Cortex-A53 CPU is
              enabled, we are eagerly awaiting more. So far, basic drivers
              such as serial, gpios, PMU and ethernet are enabled.
            + R8A77470, a.k.a. RZ/G1C, a new dual Cortex-A7 SoC with PowerVR
              GPU. Same here, basic set of drivers such as serial, gpios and
              ethernet enabled, and SMP support is also forthcoming.
      
         - STMicroelectronics:
            + STM32F469, very similar tih STM32F429 but with display support
      
        Enhancements to SoCs/platforms (DTS contents, some driver portions
        might not be in yet):
         - Allwinner sun8i (h3/a33/a83t) SMP, DVFS tweaks, misc
         - Amlogic Meson: I2C, UFS, TDM, GPIO external interrupts, MMC resets
         - Hisilicon hi3660: Thermal cooling, CPU frequency scaling, mailbox interfaces
         - Marvell Berlin2CD: SMP support, thermal sensors
         - Mediatek MT7623: Highspeed DMA, audio support
         - Qualcomm IPQ8074 PCIe support, MSM8996 UFS support
         - Renesas: Watchdog and PMU support across many platforms
         - Rockchip RK3399: USB3 OTG support
         - Samsung Exynos: Audio-over-HDMI on Odroid X/X2/U3
         - STMicro STM32: Lots of peripherals added to STM32MP175C
         - Uniphier: Ethernet support
      
        New boards:
         - Allwinner A20: Olimex A20-SOM-EVB-eMMC variant
         - Allwinner H2+: Libre Computer ALL-H3-CC (h2+ version)
         - Allwinner A33: Nintendo NES/SuperNES Classic Edition
         - Aspeed: S2600WF, Inventec Lanyang BMC, Portwell Neptune
         - Berlin2CD: Valve Steam Link
         - Broadcom BCM5301X: Luxul XAP-1610 and XWR-3150 V1
         - Broadcom: Raspberry Pi 3 B+
         - Mediatek MT7623N and MT7623A: reference boards
         - Meson 8M2: Tronsmart MXIII Plus
         - NXP i.MX: Engicam i.CoreM6, DHCOM iMX6 SOM, BTicino i.MX6DL Mamoj
         - Qualcomm MSM8974: Sony Xperia Z1 Compact support
         - Qualcomm SDM845: MTP development board
         - Renesas: Ebisu R8A77990 board
         - Renesas RZ/G1C: iwg23s: iWave G235-SDB
         - TI am335x: Pocketbeagle support"
      
      * tag 'armsoc-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (448 commits)
        ARM: dts: aspeed: Fix hwrng register address
        arm64: dts: sprd: whale2: Add the rtc enable clock for watchdog
        arm64: dts: sprd: Add GPIO and GPIO keys device nodes
        arm64: dts: sprd: fix typo in 'remote-endpoint'
        arm64: dts: apq8096-db820c: Removed bt-en-1-8v regulator
        arm64: dts: fix regulator property name for wlan pcie endpoint
        arm64: dts: qcom: msm8996: Use UFS_GDSC for UFS
        ARM: dts: pxa3xx: fix MMC clocks
        ARM: pxa: dts: add pin definitions for extended GPIOs
        ARM: pxa: dts: add gpio-ranges to gpio controller
        ARM: dts: ipq8074: Enable few peripherals for hk01 board
        ARM: dts: ipq8074: Add pcie nodes
        ARM: dts: ipq8074: Add peripheral nodes
        ARM: dts: ipq4019: Add qcom-ipq4019-ap.dk07.1-c2 board file
        ARM: dts: ipq4019: Add qcom-ipq4019-ap.dk07.1-c1 board file
        ARM: dts: ipq4019: Add ipq4019-ap.dk07.1 common data
        ARM: dts: ipq4019: Add qcom-ipq4019-ap.dk04.1-c3 board file
        ARM: dts: ipq4019: Add ipq4019-ap.dk04.1-c1 board file
        ARM: dts: ipq4019: Add ipq4019-ap.dk04.dtsi
        ARM: dts: ipq4019: Change the max opp frequency
        ...
      721afaa2