t8010: add H9P PCIe NVMe storage support#4
Conversation
Drop the temporary T8010 DART driver. The Hoolock base now has S5L8960X/T8010 support in apple-dart, so the iPad7 PCIe DART can use the upstream compatible fallback plus apple,dma-range. Move the Apple H9P FlatDMA helpers out of the main nvme-pci body into a private include file. The remaining pci.c changes are limited to the H9P hooks that still need private nvme-pci access. Signed-off-by: Pauli1Go <101004482+Pauli1Go@users.noreply.github.com>
Build the Apple H9P FlatDMA glue as a normal nvme-pci object instead of including a .c file from pci.c. Add a small internal dma_ops hook table so the remaining H9P integration points are explicit and generic. Remove the direct PMGR regmap power forcing from the H9P PCIe host. The live iPad7 boot now relies on the attached genpd power domains and still enumerates the Apple NVMe endpoint. Name the remaining PCIe/PHY bring-up constants used by the H9P port setup sequence, keeping the tested register sequence unchanged. Signed-off-by: Pauli1Go <101004482+Pauli1Go@users.noreply.github.com>
t8010 NVMe support
|
|
|
changed the base branch to a snapshot of 7.1 to facilitate review |
There was a problem hiding this comment.
The sign offs are invalid. You must sign off using a "known identity" and a real email.
https://docs.kernel.org/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin
Please split up the commits properly, in this order
- Add PCIE device tree bindings
- Add PCIE driver
- Add NVME Glue
- Update DTS
- Update MAINTAINERS file (ARM/APPLE MACHINE SUPPORT section)
Reset nvme controller seems to be broken, it should however be fixable and made to work.
You should also look into if the changes could be added to pcie-apple.c instead. That being said, I do not know enough about the pcie controller to say for certain it is a better way.
I mentioned some things should be done by m1n1, so you need to prepare a m1n1 PR as well.
Check the git history of the file/directory for good commit title styles.
In order for me to try to merge this at all, you also need to commit to maintaining the driver and work to upstream the kernel changes.
| }; | ||
| }; | ||
|
|
||
| soc { |
There was a problem hiding this comment.
everything here in soc {} belongs to t8010.dtsi, not here.
| pcie0_nvmmu_window: nvmmu-window@8bee00000 { | ||
| reg = <0x8 0xbee00000 0x0 0x01200000>; | ||
| no-map; | ||
| }; |
There was a problem hiding this comment.
this part goes into t8010-common.dtsi.
This part should be made to be filled by bootloader (m1n1) based on /arm-io/nvme-mmu0 in ADT,
make sure you have a /* To be filled by loader */ comment.
This memory region is for the NVMe controller's private use, so the name should be based on that, perhaps nvme-hmb@0? (0 because filled by loader)
Use an alias like nvme_hmb in the aliases node to make it easier for the loader to get the node.
| Four port state interrupts followed by 32 MSI interrupts and the | ||
| optional NVMMU fault interrupt for the active storage port. | ||
| minItems: 37 | ||
| maxItems: 37 |
There was a problem hiding this comment.
maxItems without minItems implies identical minItems, so minItems here should be removed
also for clocks, clock-names, power-domains
| title: Apple H9P/T8010 PCIe Host Controller | ||
|
|
||
| maintainers: | ||
| - Hector Martin <marcan@marcan.st> |
There was a problem hiding this comment.
No. Please do not lie about maintainer.
|
|
||
| memory-region: | ||
| description: | ||
| Reserved physical window programmed into the H9P NVMMU/SART path. |
There was a problem hiding this comment.
This should be prefixed with apple,. I believe apple,nvme-hmb is a more appropriate name combined with above reviews.
When a node is referencing another node, please word like this in the description, Phandle of <another node description>
| { 0x013c, 4, 0x00000002, 0x00000002 }, | ||
| { 0x0140, 4, 0x0073ffff, 0x00704c4b }, | ||
| }; | ||
|
|
There was a problem hiding this comment.
Tunables don't belong here. They should be applied in m1n1. (check the tunables properties in the ADT node)
| dma_addr_t tcb_dma; | ||
| dma_addr_t tcb_table_dma; | ||
| dma_addr_t tcb_sgl_dma; | ||
| } nvmmu[H9P_NUM_PORTS]; |
| pcie0: pcie@610000000 { | ||
| compatible = "apple,t8010-pcie"; | ||
| device_type = "pci"; | ||
| status = "okay"; |
There was a problem hiding this comment.
Don't use status unless it is disabled in a .dtsi file but is overriden to okay in another file.
| items: | ||
| - const: config | ||
| - const: phy0 | ||
| - const: phy1 |
There was a problem hiding this comment.
There is only one phy, so this needs a better name. I believe this range corresponds to phy_base in m1n1's reg info, so maybe name this phy.
| - const: config | ||
| - const: phy0 | ||
| - const: phy1 | ||
| - const: phy2 |
There was a problem hiding this comment.
There is only one phy, so this needs a better name. I believe this range corresponds to phyip_base in m1n1's reg info, so maybe name this phy-ip.
| interrupts: | ||
| description: | ||
| Four port state interrupts followed by 32 MSI interrupts and the | ||
| optional NVMMU fault interrupt for the active storage port. |
There was a problem hiding this comment.
Please use msi-ranges like in pcie-apple.c to specify a range of interrupts instead of writing out 32 consecutive interrupts.
|
Currently only works when booting through PongoOS. The iBoot/remote_boot path does not leave the S3E/NVMe BAR/core initialized the same way, so CAP/scratch/core registers stay dead and NVMe probe fails. This also needs to be fixed. (iPhone 7 D101) |
Add internal storage support for Apple A10/T8010 devices using the H9P PCIe
storage path. Tested on iPad7,12.
This adds:
apple,t8010-pciebindingnvme-pciglue inpci-apple-h9p.cThe endpoint enumerates as PCIe NVMe, so this keeps using
nvme-pciinstead ofpretending it is an ANS/
nvme-applecontroller. The small private DMA hook isneeded because H9P uses non-standard per-request FlatDMA/NVMMU mapping.
Tested on iPad7,12:
/dev/nvme0n1p2