pmp v1 implementation - #576
Conversation
16f6bab to
3dc39ca
Compare
This driver adds support for PMP version 1 SoC. Signed-off-by: dd-dreams <80887265+dd-dreams@users.noreply.github.com>
Signed-off-by: dd-dreams <80887265+dd-dreams@users.noreply.github.com>
Signed-off-by: dd-dreams <80887265+dd-dreams@users.noreply.github.com>
| iommus = <&pmp_dart 0>; | ||
|
|
||
| apple,init-ranges = <0x0 0x00024000 0x0 0x4000>, | ||
| <0x0 0x00064000 0x0 0x4000>, |
There was a problem hiding this comment.
Would it make sense to have just one cell here?
There was a problem hiding this comment.
Every single address and size fits in 32 bit, so <0x00024000 0x4000>, and so on
| required: | ||
| - compatible | ||
|
|
||
| additionalProperties: true |
There was a problem hiding this comment.
Will not fly upstream, they want everything documented.
| select PM_GENERIC_DOMAINS | ||
|
|
||
| help | ||
| Enable support for the Apple PMPv1 report control driver. |
There was a problem hiding this comment.
Something went wrong with formatting here.
| This provides power-domain support for PMPv1 report entries | ||
| described in the device tree on Apple SoCs. | ||
|
|
||
| Say 'y' if you have an Apple machine with PMPv1. |
There was a problem hiding this comment.
"An Apple machine with base M1 or earlier"
| #[pin] | ||
| dev: ARef<device::Device>, | ||
| #[pin] | ||
| node: of::Node, |
There was a problem hiding this comment.
Just get all the data you need from dt in init, and store it in the parsed form.
| fabric and other uncore components. | ||
|
|
||
| Say 'y' here if you have an Apple M1 chip. | ||
| Say 'n' here if you don't have an Apple M1 chip. |
There was a problem hiding this comment.
There will be complaints from checkpatch
There was a problem hiding this comment.
Feel free to ignore this specific one
|
|
||
| let mut err = 0; | ||
|
|
||
| let mut map_addresses = |
There was a problem hiding this comment.
Please do not abuse nested functions like this.
| map_addresses(0, 14, dva)?; | ||
|
|
||
| // 2nd region | ||
| dva = 0xc1000000; |
There was a problem hiding this comment.
Should those be in dts?
|
|
||
| #[cfg(CONFIG_APPLE_PMP_V1_REPORT = "y")] | ||
| pub mod pmdomain; | ||
| pub mod pmp_v1_bridge; |
There was a problem hiding this comment.
Should this also be gated?
| impl pmp_v1_bridge::DevPwrBridge for PmpData { | ||
| fn send_devpwr(&self, dev: u64, enable: bool) -> Result<()> { | ||
| let msg = (OPC_DEVPWR << OPC_SHIFT) + (dev << 16) + enable as u64; | ||
| self.recv_message(msg) |
There was a problem hiding this comment.
this is confusing, we want to send a message, but passing it to a recv function
No description provided.