forked from nxp-imx/linux-imx
-
Notifications
You must be signed in to change notification settings - Fork 8
MT-149180: add basic ipc/extcon mechanism to send usb events from the stm through the kernel #41
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
Draft
Overdr0ne
wants to merge
32
commits into
MultiTracksDotCom:develop
Choose a base branch
from
Overdr0ne:MT-149180
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
718ba91
extcon: Add STM32 SPI IPC driver
Overdr0ne 6fc6a6f
arm64: configs: Enable STM32 SPI IPC extcon driver
Overdr0ne 579eca8
arm64: dts: freescale: Add STM32 SPI IPC and extcon nodes
Overdr0ne ba8eea0
extcon: Kconfig: select CRC8 and improve stm32-ipc help description
Overdr0ne 2cedf5c
extcon: stm32-ipc: remove unused GPIO header
Overdr0ne 7ee736b
extcon: stm32-ipc: fallback to safe disconnected state error
Overdr0ne d24f351
extcon: stm32-ipc: Use dev_dbg in threaded IRQ to avoid log flooding
Overdr0ne 97c4e67
extcon: stm32-ipc: create per-device debugfs to avoid collisions
Overdr0ne 2398ab9
extcon: stm32-ipc: implement CRC-8/length validation on SPI packets
Overdr0ne 813a866
extcon: stm32-ipc: replace magic numbers with enum and defines
Overdr0ne fa00235
extcon: stm32-ipc: add Kconfig dependency on OF
Overdr0ne a76fffd
extcon: stm32-ipc: fix declarations after statements
Overdr0ne 4033d42
extcon: stm32-ipc: validate port-id DT property
Overdr0ne a18f363
extcon: stm32-ipc: use dev_warn_ratelimited
Overdr0ne af22146
extcon: stm32-ipc: initialize CRC-8 table once
Overdr0ne 7db84be
extcon: stm32-ipc: fix debugfs lifetime management
Overdr0ne 57f6c94
extcon: stm32-ipc: cache states to reduce churn
Overdr0ne 9d2588b
extcon: stm32-ipc: rate-limit SPI transfer error logs
Overdr0ne 39b5db7
extcon: stm32-ipc: warn on unmatched connector ports
Overdr0ne f61e32c
extcon: stm32-ipc: clean up debugfs to avoid UAF
Overdr0ne 9ec6b44
extcon: stm32-ipc: register platform driver first
Overdr0ne 371883f
extcon: stm32-ipc: pass device struct directly
Overdr0ne 8e20baa
extcon: stm32-ipc: fix debugfs double-free on unbind
Overdr0ne 2bfa6ab
dt-bindings: extcon: add multitracks,stm32-spi-ipc
Overdr0ne 49b1080
arm64: dts: freescale: mt-connect: wire both extcon phandles
Overdr0ne 35dd274
extcon: stm32-ipc: track connector match via a flag
Overdr0ne e3f6b79
extcon: stm32-ipc: take IRQ trigger type from DT
Overdr0ne 04586ee
arm64: dts: freescale: mt-connect: fix STM IPC interrupt to GPIO4_IO29
Overdr0ne 0715ac6
extcon: stm32-ipc: require the attention interrupt
Overdr0ne bc6331c
extcon: stm32-ipc: clean up comments and line lengths
Overdr0ne 0c7d705
arm64: dts: freescale: mt-connect: drop redundant ECSPI2 SS0 pinmux
Overdr0ne 18f9826
extcon: stm32-ipc: narrow irq handler lock scope
Overdr0ne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
95 changes: 95 additions & 0 deletions
95
Documentation/devicetree/bindings/extcon/multitracks,stm32-spi-ipc.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) | ||
| %YAML 1.2 | ||
| --- | ||
| $id: http://devicetree.org/schemas/extcon/multitracks,stm32-spi-ipc.yaml# | ||
| $schema: http://devicetree.org/meta-schemas/core.yaml# | ||
|
|
||
| title: MultiTracks STM32 SPI IPC USB extcon provider | ||
|
|
||
| maintainers: | ||
| - Samuel Morris <scmorris.dev@gmail.com> | ||
|
|
||
| description: | | ||
| An SPI client that talks to an external STM32 co-processor. The STM32 reports | ||
| USB cable/role events (disconnected, peripheral or host) for each physical USB | ||
| port over SPI, signalled by a dedicated attention (interrupt) line. | ||
|
|
||
| Each USB port is described by a child connector node that acts as an extcon | ||
| provider (EXTCON_USB / EXTCON_USB_HOST) for the USB OTG controller wired to | ||
| that port, allowing it to switch between host and peripheral roles. | ||
|
|
||
| properties: | ||
| compatible: | ||
| const: multitracks,stm32-spi-ipc | ||
|
|
||
| reg: | ||
| maxItems: 1 | ||
|
|
||
| interrupts: | ||
| maxItems: 1 | ||
| description: | ||
| Attention line, driven by the STM32 co-processor to signal that a new | ||
| event packet is pending on the SPI bus. | ||
|
|
||
| patternProperties: | ||
| '^connector-usb[0-9]+$': | ||
| type: object | ||
| description: | ||
| A virtual USB connector exposed as an extcon provider. Reference it from | ||
| the "extcon" property of the corresponding USB OTG controller node. | ||
|
|
||
| properties: | ||
| compatible: | ||
| const: multitracks,stm32-usb-connector | ||
|
|
||
| port-id: | ||
| $ref: /schemas/types.yaml#/definitions/uint32 | ||
| maximum: 255 | ||
| description: | ||
| Identifier of the USB port on the STM32 co-processor that this | ||
| connector represents. It is matched against the "port" field of the | ||
| incoming SPI event packet. | ||
|
|
||
| required: | ||
| - compatible | ||
| - port-id | ||
|
|
||
| additionalProperties: false | ||
|
|
||
| required: | ||
| - compatible | ||
| - reg | ||
| - interrupts | ||
|
|
||
| allOf: | ||
| - $ref: /schemas/spi/spi-peripheral-props.yaml# | ||
|
|
||
| unevaluatedProperties: false | ||
|
|
||
| examples: | ||
| - | | ||
| #include <dt-bindings/interrupt-controller/irq.h> | ||
|
|
||
| spi { | ||
| #address-cells = <1>; | ||
| #size-cells = <0>; | ||
|
|
||
| ipc@0 { | ||
| compatible = "multitracks,stm32-spi-ipc"; | ||
| reg = <0>; | ||
| spi-max-frequency = <10000000>; | ||
| interrupt-parent = <&gpio2>; | ||
| interrupts = <11 IRQ_TYPE_EDGE_FALLING>; | ||
|
|
||
| connector-usb1 { | ||
| compatible = "multitracks,stm32-usb-connector"; | ||
| port-id = <0>; | ||
| }; | ||
|
|
||
| connector-usb2 { | ||
| compatible = "multitracks,stm32-usb-connector"; | ||
| port-id = <1>; | ||
| }; | ||
| }; | ||
| }; | ||
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.