diff --git a/Documentation/admin-guide/media/apple-jpeg.rst b/Documentation/admin-guide/media/apple-jpeg.rst index bdcdb8d34ab55..8a475cf7879d6 100644 --- a/Documentation/admin-guide/media/apple-jpeg.rst +++ b/Documentation/admin-guide/media/apple-jpeg.rst @@ -24,12 +24,15 @@ apple,t8112-jpeg wide64 0x0e0008 apple,t8122-jpeg wide64 0x0f0008 apple,t8132-jpeg wide64 0x100008 apple,t8140-jpeg wide64 0x110000 +apple,t8142-jpeg wide64 0x110010 =================== ========= ======================== On the wide64 engines the HWREV readback equals the hardware description's ``hw-type`` with the stepping nibble masked (read back on T8112 and T6041), so the T8122 and T8132 rows use their ``hw-type``. T8132 has the T6041 -identity and shares its data. The T8103 engines report the legacy selector +identity and shares its data. T8142 (read back on a J815) has the T6050 +identity and shares its data: macOS 27.2.1 programs its engines with T6050's +reset image and job sequence, write for write. The T8103 engines report the legacy selector 0x0a0103 there, which is not a HWREV, so T8103 has no row yet. Identification powers the domain, writes MODE=0x147 and reads the selected diff --git a/Documentation/devicetree/bindings/media/apple,jpeg.yaml b/Documentation/devicetree/bindings/media/apple,jpeg.yaml index 7571f1969c42c..00aa5c9429ad4 100644 --- a/Documentation/devicetree/bindings/media/apple,jpeg.yaml +++ b/Documentation/devicetree/bindings/media/apple,jpeg.yaml @@ -39,6 +39,7 @@ select: - apple,t8132-jpeg - apple,t6050-jpeg - apple,t8140-jpeg + - apple,t8142-jpeg required: - compatible @@ -57,6 +58,7 @@ allOf: enum: - apple,t8132-jpeg - apple,t6050-jpeg + - apple,t8142-jpeg required: - compatible then: @@ -66,6 +68,7 @@ allOf: - enum: - apple,t8132-jpeg - apple,t6050-jpeg + - apple,t8142-jpeg - const: apple,jpeg reg: diff --git a/arch/arm64/boot/dts/apple/t8142-j815.dts b/arch/arm64/boot/dts/apple/t8142-j815.dts index a11d808ff22a0..3f4171f4c955f 100644 --- a/arch/arm64/boot/dts/apple/t8142-j815.dts +++ b/arch/arm64/boot/dts/apple/t8142-j815.dts @@ -204,3 +204,20 @@ &ane { status = "okay"; }; + +/* Both JPEG engines and their DART. */ +&ps_jpg { + status = "okay"; +}; + +&jpeg_dart { + status = "okay"; +}; + +&jpeg0 { + status = "okay"; +}; + +&jpeg1 { + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/apple/t8142-peripherals.dtsi b/arch/arm64/boot/dts/apple/t8142-peripherals.dtsi index caf5902393d51..949f6da167a89 100644 --- a/arch/arm64/boot/dts/apple/t8142-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t8142-peripherals.dtsi @@ -226,11 +226,37 @@ status = "disabled"; }; + /* ADT dart-jpeg: one DART for both engines, jpeg0 on SID 0, jpeg1 on SID 1. */ jpeg_dart: iommu@301020000 { compatible = "apple,t8142-dart", "apple,t8110-dart"; reg = <0x3 0x1020000 0x0 0xc000>; interrupts = ; #iommu-cells = <1>; + /* ADT vm-base 0x100_0000_0000, vm-size 0x300_0000_0000 */ + apple,dma-range = <0x100 0x0 0x300 0x0>; + power-domains = <&ps_jpg>; + status = "disabled"; + }; + + /* + * ADT jpeg0/jpeg1 ("jpeg,t8101", hw-type 0x110010). Their power-gates + * JPG0-V/JPG1-V are virtual PMGR entries under JPG. + */ + jpeg0: jpeg@301000000 { + compatible = "apple,t8142-jpeg", "apple,jpeg"; + reg = <0x3 0x1000000 0x0 0x4000>; + interrupts = ; + iommus = <&jpeg_dart 0>; + power-domains = <&ps_jpg>; + status = "disabled"; + }; + + jpeg1: jpeg@301060000 { + compatible = "apple,t8142-jpeg", "apple,jpeg"; + reg = <0x3 0x1060000 0x0 0x4000>; + interrupts = ; + iommus = <&jpeg_dart 1>; + power-domains = <&ps_jpg>; status = "disabled"; }; @@ -529,6 +555,16 @@ }; &pmgr { + /* ADT pmgr device JPG (id 64), parent AFISOCNI1 (no power state). */ + ps_jpg: power-controller@2a0 { + compatible = "apple,t8142-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x2a0 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "jpg"; + status = "disabled"; + }; + /* ADT pmgr device ANE_SYS (id 73), parent AFISOCNI3 (no power state). */ ps_ane_sys: power-controller@2e8 { compatible = "apple,t8142-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; diff --git a/drivers/media/platform/apple/jpeg/apple-jpeg-drv.c b/drivers/media/platform/apple/jpeg/apple-jpeg-drv.c index 837d3d044d326..2a1b2b636241e 100644 --- a/drivers/media/platform/apple/jpeg/apple-jpeg-drv.c +++ b/drivers/media/platform/apple/jpeg/apple-jpeg-drv.c @@ -889,6 +889,8 @@ static const struct of_device_id aj_of_match[] = { { .compatible = "apple,t6041-jpeg", .data = &apple_jpeg_t6041 }, { .compatible = "apple,t8132-jpeg", .data = &apple_jpeg_t6041 }, { .compatible = "apple,t6050-jpeg", .data = &apple_jpeg_t6050 }, + /* T6050's revision, reset image and job programming (traced on a J815). */ + { .compatible = "apple,t8142-jpeg", .data = &apple_jpeg_t6050 }, { .compatible = "apple,t8140-jpeg", .data = &apple_jpeg_t8140 }, { } };