Skip to content
New issue

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

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

Already on GitHub? # to your account

draft: sunxi: pinephone: differentiate hw revisions 1.2 and 1.2b #1

Conversation

AndreySV
Copy link

@AndreySV AndreySV commented Jan 3, 2024

In newer 1.2 PinePhone board revisions LIS3MDL magnetometer was replaced by AF8133J. They use the same PB1 pin in different modes.

LIS3MDL uses it as an gpio input to handle interrupt. AF8133J uses it as an gpio output as a reset signal.

It wasn't possible at runtime to enable both device tree nodes and detect supported sensor at probe time. As a result new board revision was introduced with AF8133J definition (1.2b).

AF8133J has reset pin (PB1) connected to the SoC. By default AF8133J is in a reset state and don't respond to probe request on I2C bus. Extra code would be needed to handle reset signal. Therefore this code uses LIS3MDL magnetometer (1.2) revision instead of AF8133J (1.2b) to detect board revision.

@AndreySV
Copy link
Author

AndreySV commented Jan 3, 2024

Closes Tow-Boot/Tow-Boot#293

@AndreySV
Copy link
Author

AndreySV commented Jan 3, 2024

@samueldr I could not find device specific branch for PinePhone, so I put the change to _all. I'll redo, when it's needed.

@AndreySV AndreySV changed the title sunxi: pinephone: differentiate hw revisions 1.2 and 1.2b draft: sunxi: pinephone: differentiate hw revisions 1.2 and 1.2b Jan 4, 2024
@AndreySV AndreySV force-pushed the feat/pinephone-1.2b-revision branch from dc6b896 to 86097c8 Compare January 4, 2024 21:05
The A64 uses the AXP803 as its PMIC.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
PinePhone uses AXP803 PMIC. IC (LIS3MDL magnetometer) that will be
probed to detect hardware revision is connected to DLDO1.

Normally on A64 PMIC (and DLDO1) is initialized by TF-A, but device
tree selection happens before that and in this case requires some
basic PMIC initialization.
TF-A will initialize other required regulators as before.

Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
In newer 1.2 PinePhone board revisions LIS3MDL magnetometer was replaced by
AF8133J. They use the same PB1 pin in different modes.

LIS3MDL uses it as an gpio input to handle interrupt.
AF8133J uses it as an gpio output as a reset signal.

It wasn't possible at runtime to enable both device tree
nodes and detect supported sensor at probe time. As a result new board
revision was introduced with AF8133J definition (1.2b).

AF8133J has reset pin (PB1) connected to the SoC. By default AF8133J
is in a reset state and don't respond to probe request on I2C
bus. Extra code would be needed to handle reset signal. Therefore this
code uses LIS3MDL magnetometer (1.2) revision instead of
AF8133J (1.2b) to detect board revision.

Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
@AndreySV AndreySV force-pushed the feat/pinephone-1.2b-revision branch from 86097c8 to 6af923a Compare January 4, 2024 21:42
@AndreySV
Copy link
Author

Close in favour of #2

@AndreySV AndreySV closed this Jan 13, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant