Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NS Interrupt notification over async notif #112

Draft
wants to merge 19 commits into
base: optee
Choose a base branch
from

Commits on Jan 11, 2023

  1. arm64: dt: Remove timer from mt8173 **not for mainline**

    From the commit below, the mt8173-evb failed to boot to console due to
    changes in the mt8173 device tree files.
    
      commit c0d6fe2
      Merge: b44a3d2 3e4dda7
      Author: Linus Torvalds <[email protected]>
      Date:   Tue Nov 10 15:06:26 2015 -0800
    
          Merge tag 'armsoc-dt' of
          git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
    
    Until properly solved, let's just remove the section in the device tree
    blob that causes this.
    
    Signed-off-by: Joakim Bech <[email protected]>
    Reviewed-by: Pascal Brand <[email protected]>
    jbech-linaro authored and jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    783e42f View commit details
    Browse the repository at this point in the history
  2. arm64: dt: OP-TEE for foundation-v8 **not for mainline**

    Configures foundation-v8 with OP-TEE.
    
    Signed-off-by: Jens Wiklander <[email protected]>
    [jf: rebase onto v5.9-rc7]
    Signed-off-by: Jerome Forissier <[email protected]>
    jenswi-linaro authored and jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    1ed0f96 View commit details
    Browse the repository at this point in the history
  3. arm64: dt: OP-TEE for Juno **not for mainline**

    Configures Juno with OP-TEE.
    
    Reviewed-by: Pascal Brand <[email protected]>
    Signed-off-by: Jens Wiklander <[email protected]>
    [jf: rebase onto v5.9-rc7]
    Signed-off-by: Jerome Forissier <[email protected]>
    jenswi-linaro authored and jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    7467a90 View commit details
    Browse the repository at this point in the history
  4. arm64: dt: Add no-map to the reserved-memory node for OP-TEE for foun…

    …dation-v8 **not for mainline**
    
    All the platforms that reserve memory for OP-TEE statically via the
    DT (i.e., not those that reserve it via UEFI or that patch the DT
    dynamically thanks to OP-TEE's CFG_DT option) have to mark it 'no-map'
    so that only the TEE driver may map it.
    
    Signed-off-by: Jens Wiklander <[email protected]>
    jenswi-linaro authored and jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    fa58344 View commit details
    Browse the repository at this point in the history
  5. arm64: dt: Add no-map to the reserved-memory node for OP-TEE for juno…

    … **not for mainline**
    
    All the platforms that reserve memory for OP-TEE statically via the
    DT (i.e., not those that reserve it via UEFI or that patch the DT
    dynamically thanks to OP-TEE's CFG_DT option) have to mark it 'no-map'
    so that only the TEE driver may map it.
    
    Signed-off-by: Jens Wiklander <[email protected]>
    jenswi-linaro authored and jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    996eb0f View commit details
    Browse the repository at this point in the history
  6. arm64: dt: Add OP-TEE firmware to mt8173 **not for mainline**

    Signed-off-by: Joakim Bech <[email protected]>
    Reviewed-by: Pascal Brand <[email protected]>
    Reviewed-by: Jerome Forissier <[email protected]>
    jbech-linaro authored and jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    2f0b8ae View commit details
    Browse the repository at this point in the history
  7. arm64: dts: hi3798cv200-poplar: memreserve for bootloader

    Reserve memory for bootloader purposes.
    
    Acked-by: Jerome Forissier <[email protected]>
    Signed-off-by: Igor Opaniuk <[email protected]>
    igoropaniuk authored and jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    e47d374 View commit details
    Browse the repository at this point in the history
  8. arm64: dts: hi3798cv200-poplar: add optee node

    Add optee node, so OP-TEE driver is probed properly.
    
    Acked-by: Jerome Forissier <[email protected]>
    Signed-off-by: Igor Opaniuk <[email protected]>
    igoropaniuk authored and jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    72a9576 View commit details
    Browse the repository at this point in the history
  9. ARM: dts: stm32: Define OP-TEE resources on stm32mp15 and enable on DK2

    Define OP-TEE firmware node for stm32mp15 based platforms. The node
    if disable by default.
    
    Enable the OP-TEE node and define OP-TEE reserved memory for
    stm32mp157c-dk2.
    
    Signed-off-by: Etienne Carriere <[email protected]>
    [jf: rebase onto v5.9]
    Signed-off-by: Jerome Forissier <[email protected]>
    etienne-lms authored and jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    afbb325 View commit details
    Browse the repository at this point in the history
  10. Enable Microsoft fTPM driver on Arm Foundation v8 models.

    Signed-off-by: Javier Almansa Sobrino <[email protected]>
    Acked-by: Joakim Bech <[email protected]>
    Link: linaro-swg#85
    [jf: not currently intended for upstream; add link to PR]
    Signed-off-by: Jerome Forissier <[email protected]>
    javieralso-arm authored and jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    9e8b7ff View commit details
    Browse the repository at this point in the history
  11. stm32mp157c-ev1.dts: Fix optee status to 'okay'

    The optee device status is disabled by default, change its status to 'okay'
    in the dts of the EV1 board
    
    Signed-off-by: Timothée Cercueil <[email protected]>
    [jf: rebase onto v5.17]
    Signed-off-by: Jerome Forissier <[email protected]>
    Timothée Cercueil authored and jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    3b88d5f View commit details
    Browse the repository at this point in the history
  12. arm: dts: define OP-TEE resources for STM32MP1 ED1 and EV1

    This change fixes EV1 configuration which lacked OP-TEE
    reserved memory. This change also makes ED1 board ready
    the host OP-TEE by enabling OP-TEE node and defining the
    OP-TEE reserved memory for that board. This change defines
    these resources in ED1 DTS file which is included in EV1 DTS
    file.
    
    Signed-off-by: Etienne Carriere <[email protected]>
    Acked-by: Jerome Forissier <[email protected]>
    [jf: rebase onto v5.17]
    Signed-off-by: Jerome Forissier <[email protected]>
    etienne-lms authored and jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    916de92 View commit details
    Browse the repository at this point in the history
  13. arm64: dt: OP-TEE for FVP Base RevC

    Configures FVP Base RevC with OP-TEE.
    
    With commit 1bf41f5d9b0d ("fvp: add Trusted Services support") in
    https://github.com/OP-TEE/build there is support for building running
    with the FVP Base RevC model. However, some updates to the DTB passed
    to the kernel is missing for the OP-TEE driver to be probed. So fix that
    by adding an OP-TEE node in the DTS.
    
    Signed-off-by: Jens Wiklander <[email protected]>
    jenswi-linaro authored and jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    07b522e View commit details
    Browse the repository at this point in the history
  14. arm: dts: define OP-TEE resources for STM32MP15 DHCOM based boards

    Enable OP-TEE node defined in stm32mp151.dtsi and define OP-TEE
    reserverd memory for all boards based on STM32MP15 DHCOM.
    
    Signed-off-by: Johann Neuhauser <[email protected]>
    Acked-by: Etienne Carriere <[email protected]>
    jneuhauser authored and jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    57db133 View commit details
    Browse the repository at this point in the history
  15. arm: dts: define OP-TEE resources for STM32MP15 DHCOR based boards

    Enable OP-TEE node defined in stm32mp151.dtsi and define OP-TEE
    reserverd memory for all boards based on STM32MP15 DHCOR.
    
    Signed-off-by: Johann Neuhauser <[email protected]>
    Acked-by: Etienne Carriere <[email protected]>
    jneuhauser authored and jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    4d17ae6 View commit details
    Browse the repository at this point in the history
  16. arm64: dt: rockpi4: disable node usbdrd_dwc3_0 **not for mainline**

    If a USB-A to USB-A cable is used to flash the RockPi4 eMMC as described
    in [1], it is likely that the board will be booted with the cable still
    plugged into the board and into the computer on the other side. Such a
    configuration results in periodic error messages from the kernel:
    
     [    4.832697] usb usb6-port1: Cannot enable. Maybe the USB cable is bad?
     [    4.833416] usb usb6-port1: config error
    
    That is annoying, especially since the messages are also sent to the
    console by default, which could mess up with CI scripts. Therefore,
    disable this port (it is the upper USB3 blue port; the lower one will
    still work fine).
    
    Link: [1] https://wiki.radxa.com/Rockpi4/dev/usb-install
    Signed-off-by: Jerome Forissier <[email protected]>
    Acked-by: Jens Wiklander <[email protected]>
    Acked-by: Joakim Bech <[email protected]>
    jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    e1c3d91 View commit details
    Browse the repository at this point in the history
  17. arm64: dt: rockpi4: add OP-TEE nodes **not for mainline**

    Add optee node as well as reserved memory to the Rockpi4 DT.
    
    Signed-off-by: Jerome Forissier <[email protected]>
    jforissier committed Jan 11, 2023
    Configuration menu
    Copy the full SHA
    aed8040 View commit details
    Browse the repository at this point in the history

Commits on May 6, 2023

  1. dt-bindings: arm: optee: add interrupt controller properties

    Adds an optional interrupt controller property to optee firmware node
    in the DT bindings. Optee driver may embeds an irqchip exposing
    OP-TEE interrupt events notified by the TEE world. Optee registers up
    to 1 interrupt controller and identifies each line with a line
    number from 0 to UINT16_MAX.
    
    The identifiers and meaning of the interrupt line number are specific
    to the platform and shall be found in the OP-TEE platform documentation.
    
    In the example shown in optee DT binding documentation, the platform SCMI
    device controlled by Linux scmi driver uses optee interrupt irq 5 as
    signal to trigger processing of an asynchronous incoming SCMI message
    in the scope of a CPU DVFS control. A platform can have several SCMI
    channels driven this way. Optee irqs also permit small embedded devices
    to share e.g. a gpio expander, a group of wakeup sources, etc... between
    OP-TEE world (for sensitive services) and Linux world (for non-sensitive
    services). The physical controller is driven from the TEE which exposes
    some controls to Linux kernel.
    
    This change was posted to the LKML (patch v4 [1]).
    
    Link: [1] https://lore.kernel.org/lkml/[email protected]/
    Co-developed-by: Pascal Paillet <[email protected]>
    Signed-off-by: Pascal Paillet <[email protected]>
    Signed-off-by: Etienne Carriere <[email protected]>
    etienne-lms committed May 6, 2023
    Configuration menu
    Copy the full SHA
    97439f2 View commit details
    Browse the repository at this point in the history
  2. optee: multiplex tee interrupt events on optee async notif irq

    Implements an irqchip in optee driver for the interrupt events notified
    from OP-TEE world to the Linux OS. Optee registers up to 1 interrupt
    controller and identifies each line with a line number from 0 to
    UINT16_MAX. The identifiers and meaning of the interrupt line number
    are specific to the platform and shall be found in the OP-TEE platform
    documentation
    
    There already exist an optee asynchronous notification mechanism using
    an irq for OP-TEE to signal its optee driver in Linux of a pending
    interrupt event. The implementation binds each event to the awaking of
    a thread waiting to call the TEE. The interrupt notification service
    added by this change allows TEE to send interrupt signals to Linux kernel
    on secure event occurrences which end consumer is a Linux sub-system.
    
    When optee driver initializes, TEE tells whether it supports interrupt
    notification services or not.
    
    OP-TEE SMC ABI defines 4 new SMC function IDs for non-secure world to
    manage interrupt events:
    - OPTEE_SMC_GET_NOTIF_ITR allows non-secure world to retrieve pending
      interrupts by grapes up to 5 lines. For efficiency, the function also
      reports whether there are pending async values targeting suspended
      threaded sequences execution and whether TEE has background threaded
      work to do.
    - OPTEE_SMC_NOTIF_ITR_SET_MASK allows Linux irq consumer to mask/unmask
      the irq line using a fastcall SMC (uninterruptible) service.
    - OPTEE_SMC_NOTIF_ITR_SET_STATE allows Linux irq consumer to enable and
      disable the irq line using a yielded TEE call.
    - OPTEE_SMC_NOTIF_ITR_SET_WAKEUP allows Linux irq consumer to enable
      and disable the wakeup from low power capability of the interrupt.
    
    This change was posted to the LKML (patch v4 [1]). A patch v5 [2] exists
    and is equivalent to this change but targets kernel v6.3-rc4 and later
    to resolve rebase conflicts.
    
    Link: [1] https://lore.kernel.org/lkml/[email protected]/
    Link: [2] https://lore.kernel.org/lkml/[email protected]/
    Co-developed-by: Pascal Paillet <[email protected]>
    Signed-off-by: Pascal Paillet <[email protected]>
    Co-developed-by: Fabrice Gasnier <[email protected]>
    Signed-off-by: Fabrice Gasnier <[email protected]>
    Signed-off-by: Etienne Carriere <[email protected]>
    etienne-lms committed May 6, 2023
    Configuration menu
    Copy the full SHA
    9a724e5 View commit details
    Browse the repository at this point in the history