-
Notifications
You must be signed in to change notification settings - Fork 14
dts: comma: pin i2c bus numbers for openpilot via aliases #116
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
greatgitsby
wants to merge
1
commit into
commaai:master
Choose a base branch
from
greatgitsby:dts-i2c-bus-aliases
base: master
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
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
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 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,26 @@ | |||||||||||
| / { | ||||||||||||
| aliases { | ||||||||||||
| serial0 = &uart9; | ||||||||||||
|
|
||||||||||||
| /* | ||||||||||||
| * openpilot opens fixed i2c bus numbers: IMU on bus 1 | ||||||||||||
| * (sensord.py I2C_BUS_IMU=1), ina231 power monitor on bus 0, | ||||||||||||
| * touch on bus 2. Linux derives the adapter number from these | ||||||||||||
| * aliases (of_alias_get_id). Upstream sdm845.dtsi ships identity | ||||||||||||
| * aliases (i2cN=&i2cN), so without this override the IMU node | ||||||||||||
| * (i2c@890000 = i2c4) would be bus 4. Remap the three buses we | ||||||||||||
| * use to the legacy numbers and park the displaced identity | ||||||||||||
| * aliases on unused nodes so no two aliases target one node. | ||||||||||||
| * | ||||||||||||
| * Matches agnos legacy DTS: se10=/dev/i2c-0 (power), | ||||||||||||
| * se4=IMU bus 1, se5=/dev/i2c-2 (touch). | ||||||||||||
| */ | ||||||||||||
| i2c0 = &i2c10; /* i2c@a88000 legacy /dev/i2c-0 (no devices on mici) */ | ||||||||||||
| i2c1 = &i2c4; /* i2c@890000 IMU */ | ||||||||||||
| i2c2 = &i2c5; /* i2c@894000 touch */ | ||||||||||||
| i2c4 = &i2c0; | ||||||||||||
| i2c5 = &i2c1; | ||||||||||||
| i2c10 = &i2c2; | ||||||||||||
| }; | ||||||||||||
|
|
||||||||||||
| chosen { | ||||||||||||
|
|
@@ -379,6 +399,19 @@ | |||||||||||
| clock-frequency = <100000>; | ||||||||||||
| }; | ||||||||||||
|
|
||||||||||||
| /* | ||||||||||||
| * Legacy /dev/i2c-0 (SE10, a88000) -> aliased to bus 0 above. On the comma | ||||||||||||
| * four this bus carries no devices openpilot uses: there is NO ina231 (legacy | ||||||||||||
| * comma_mici.dts /delete-node's it as "not populated on mici" — confirmed on | ||||||||||||
| * device: probe of 0x40 returns -ENXIO, bus scan empty). openpilot reads power | ||||||||||||
| * from the PMIC bms power_supply, not this bus. Kept enabled only to preserve | ||||||||||||
| * bus-0 numbering parity with legacy. | ||||||||||||
| */ | ||||||||||||
| &i2c10 { | ||||||||||||
| status = "okay"; | ||||||||||||
| clock-frequency = <100000>; | ||||||||||||
|
Comment on lines
+411
to
+412
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to have the patch ready for the mainline coding style 😉
Suggested change
|
||||||||||||
| }; | ||||||||||||
|
|
||||||||||||
| &mdss { | ||||||||||||
| status = "okay"; | ||||||||||||
| }; | ||||||||||||
|
|
||||||||||||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we just give these nice alias names instead? we'll be shipping a new kernel anyway in the next release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, this is good hack, but proper alias won't hurt :)