Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 34 additions & 8 deletions Documentation/devicetree/bindings/phy/apple,s5l8942x-usb-phy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$id: http://devicetree.org/schemas/phy/apple,s5l8942x-usb-phy.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple S5L8942X USB and HSIC PHY
title: Apple S5L8942X and S5L8950X USB and HSIC PHY

maintainers:
- Shayne Legault <8741557+shaynelegault@users.noreply.github.com>
Expand All @@ -14,31 +14,49 @@ description: |
and reset. The first PHY argument selects the output: 0 for USB OTG,
1 for the HSIC host. The HSIC supplies power the attached peripheral.

On the S5L8950X (A6) the PHY can also hold the PMGR power-state gates
of the OTG block (UPERF, USB-OTG and USBREG), which it switches on at
probe and never off again. Its PMGR offsets and tuning differ from the
A5's, so it has no S5L8940X fallback.

select:
properties:
compatible:
contains:
const: apple,s5l8942x-otgphy
enum:
- apple,s5l8942x-otgphy
- apple,s5l8950x-otgphy
required:
- compatible

properties:
compatible:
items:
- const: apple,s5l8942x-otgphy
- const: apple,s5l8940x-otgphy
oneOf:
- items:
- const: apple,s5l8942x-otgphy
- const: apple,s5l8940x-otgphy
- const: apple,s5l8950x-otgphy

reg:
items:
- description: PHY control registers
- description: USB complex control registers

clocks:
maxItems: 1
description: PHY reference clock, at 12, 24 or 48 MHz
minItems: 1
items:
- description: PHY reference clock, at 12, 24 or 48 MHz
- description: UPERF power-state gate
- description: USB-OTG power-state gate
- description: USBREG power-state gate

clock-names:
const: ref
minItems: 1
items:
- const: ref
- const: uperf
- const: otg
- const: usbreg

'#phy-cells':
const: 1
Expand Down Expand Up @@ -67,3 +85,11 @@ examples:
clock-names = "ref";
#phy-cells = <1>;
};
- |
phy@36000000 {
compatible = "apple,s5l8950x-otgphy";
reg = <0x36000000 0x1000>, <0x3f108000 0x1000>;
clocks = <&refclk24mhz>, <&uperf_ps>, <&usb_otg_ps>, <&usbreg_ps>;
clock-names = "ref", "uperf", "otg", "usbreg";
#phy-cells = <1>;
};
6 changes: 6 additions & 0 deletions Documentation/devicetree/bindings/usb/dwc2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ allOf:
enum:
- apple,s5l8940x-dwc2
- apple,s5l8942x-dwc2
- apple,s5l8950x-dwc2
then:
required:
- phys
Expand All @@ -32,6 +33,11 @@ allOf:
properties:
compatible:
oneOf:
- items:
- const: apple,s5l8950x-dwc2
- const: apple,s5l8942x-dwc2
- const: apple,s5l8940x-dwc2
- const: snps,dwc2
- items:
- const: apple,s5l8942x-dwc2
- const: apple,s5l8940x-dwc2
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/boot/dts/apple/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
dtb-$(CONFIG_ARCH_APPLE_S5L) += s5l8942x-p105.dtb
dtb-$(CONFIG_ARCH_APPLE_S5L) += s5l8945x-j1.dtb
dtb-$(CONFIG_ARCH_APPLE_S5L) += s5l8940x-k93.dtb
dtb-$(CONFIG_ARCH_APPLE_S5L) += s5l8950x-n41.dtb
dtb-$(CONFIG_ARCH_APPLE_S5L) += s5l8950x-n42.dtb
30 changes: 30 additions & 0 deletions arch/arm/boot/dts/apple/s5l8950x-5.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: GPL-2.0 OR MIT
/*
* Apple iPhone 5 (N41 / iPhone5,1 and N42 / iPhone5,2, S5L8950X / Apple A6):
* what the two models share. Apple sells them as one phone that differs in
* its cellular bands, which Linux does not drive, and the N42's ADT names
* its touch controller "multi-touch,n41". Everything below was read from
* the N42: the iPhone5,2 iOS 8.4.1 (12H321) ADT as iBoot passes it, and the
* iPhone5,2 10.3.4 (14G61) ADT and kernelcache. N41 is untested.
*/

#include "s5l8950x.dtsi"

/ {
aliases {
serial0 = &uart6;
};
};

/*
* UART6 is the debug port. Production iBEC leaves it gated off unless
* debug-uarts is set, so there is no earlycon on it: the serial driver
* switches the gate on before its first register access.
*/
&uart6_ps {
status = "okay";
};

&uart6 {
status = "okay";
};
24 changes: 24 additions & 0 deletions arch/arm/boot/dts/apple/s5l8950x-n41.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: GPL-2.0 OR MIT
/*
* Apple iPhone 5 (GSM) -- iPhone5,1 / N41AP / S5L8950X (Apple A6).
*
* The same phone as the N42 for everything Linux drives (s5l8950x-5.dtsi).
* Untested: every value was read from an N42.
*/

/dts-v1/;

#include "s5l8950x-5.dtsi"

/ {
compatible = "apple,n41ap", "apple,s5l8950x", "apple,arm";
model = "Apple iPhone 5 (GSM) (iPhone5,1)";

chosen {
bootargs = "console=tty0 console=ttyGS0,115200 lpj=6500000 root=/dev/ram0 rw rootwait panic=10 loglevel=8 ignore_loglevel g_cdc.host_addr=02:10:5a:51:00:01 g_cdc.dev_addr=02:10:5a:51:00:02";

/* Overwritten by m1n1 kboot_prepare_dt() when an initrd is loaded. */
linux,initrd-start = <0x88000000>;
linux,initrd-end = <0x88000000>;
};
};
29 changes: 29 additions & 0 deletions arch/arm/boot/dts/apple/s5l8950x-n42.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// SPDX-License-Identifier: GPL-2.0 OR MIT
/*
* Apple iPhone 5 (Global) -- iPhone5,2 / N42AP / S5L8950X (Apple A6).
*
* Booted from a jailbroken iOS through kDFU: iBSS, then a patched iBEC
* starts m1n1 (armv7) with bootx, and m1n1 starts Linux.
*/

/dts-v1/;

#include "s5l8950x-5.dtsi"

/ {
compatible = "apple,n42ap", "apple,s5l8950x", "apple,arm";
model = "Apple iPhone 5 (Global) (iPhone5,2)";

chosen {
/*
* console=tty0 draws the boot log on the 640x1136 portrait
* simple-framebuffer; ttyGS0 stays last so /dev/console is the
* USB CDC ACM serial gadget.
*/
bootargs = "console=tty0 console=ttyGS0,115200 lpj=6500000 root=/dev/ram0 rw rootwait panic=10 loglevel=8 ignore_loglevel g_cdc.host_addr=02:10:5a:52:00:01 g_cdc.dev_addr=02:10:5a:52:00:02";

/* Overwritten by m1n1 kboot_prepare_dt() when an initrd is loaded. */
linux,initrd-start = <0x88000000>;
linux,initrd-end = <0x88000000>;
};
};
Loading
Loading