diff options
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/dts/imx8mm-ab2-u-boot.dtsi | 11 | ||||
-rw-r--r-- | arch/arm/dts/imx8mm-ab2.dts | 43 | ||||
-rw-r--r-- | arch/arm/dts/imx8mn-ab2-u-boot.dtsi | 11 | ||||
-rw-r--r-- | arch/arm/dts/imx8mn-ab2.dts | 43 | ||||
-rw-r--r-- | arch/arm/mach-imx/imx8/cpu.c | 15 |
5 files changed, 119 insertions, 4 deletions
diff --git a/arch/arm/dts/imx8mm-ab2-u-boot.dtsi b/arch/arm/dts/imx8mm-ab2-u-boot.dtsi index b19020f70d..37a4e826c8 100644 --- a/arch/arm/dts/imx8mm-ab2-u-boot.dtsi +++ b/arch/arm/dts/imx8mm-ab2-u-boot.dtsi @@ -4,12 +4,23 @@ */ / { + aliases { + usbgadget0 = &usbg1; + }; + firmware { optee { compatible = "linaro,optee-tz"; method = "smc"; }; }; + + usbg1: usbg1 { + compatible = "fsl,imx27-usb-gadget"; + dr_mode = "peripheral"; + chipidea,usb = <&usbotg1>; + status = "okay"; + }; }; &{/soc@0} { diff --git a/arch/arm/dts/imx8mm-ab2.dts b/arch/arm/dts/imx8mm-ab2.dts index 4f346c20c0..442a7188ee 100644 --- a/arch/arm/dts/imx8mm-ab2.dts +++ b/arch/arm/dts/imx8mm-ab2.dts @@ -5,6 +5,7 @@ /dts-v1/; +#include <dt-bindings/usb/pd.h> #include "imx8mm.dtsi" / { @@ -455,6 +456,31 @@ scl-gpios = <&gpio5 16 GPIO_ACTIVE_HIGH>; sda-gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>; status = "okay"; + + ptn5150: tcpc@1d { + compatible = "nxp,ptn5150"; + reg = <0x1d>; + status = "okay"; + + port { + typec1_dr_sw: endpoint { + remote-endpoint = <&usb1_drd_sw>; + }; + }; + + typec1_con: connector { + compatible = "usb-c-connector"; + label = "USB-C"; + power-role = "dual"; + data-role = "dual"; + try-power-role = "sink"; + source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>; + sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM) + PDO_VAR(5000, 20000, 3000)>; + op-sink-microwatt = <15000000>; + self-powered; + }; + }; }; &i2c3 { @@ -498,6 +524,23 @@ status = "okay"; }; +&usbotg1 { + picophy,pre-emp-curr-control = <3>; + picophy,dc-vol-level-adjust = <7>; + dr_mode = "host"; + hnp-disable; + srp-disable; + adp-disable; + usb-role-switch; + status = "okay"; + + port { + usb1_drd_sw: endpoint { + remote-endpoint = <&typec1_dr_sw>; + }; + }; +}; + &wdog1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_wdog>; diff --git a/arch/arm/dts/imx8mn-ab2-u-boot.dtsi b/arch/arm/dts/imx8mn-ab2-u-boot.dtsi index d4c5e43477..8b5115b2fb 100644 --- a/arch/arm/dts/imx8mn-ab2-u-boot.dtsi +++ b/arch/arm/dts/imx8mn-ab2-u-boot.dtsi @@ -4,12 +4,23 @@ */ / { + aliases { + usbgadget0 = &usbg1; + }; + firmware { optee { compatible = "linaro,optee-tz"; method = "smc"; }; }; + + usbg1: usbg1 { + compatible = "fsl,imx27-usb-gadget"; + dr_mode = "peripheral"; + chipidea,usb = <&usbotg1>; + status = "okay"; + }; }; &{/soc@0} { diff --git a/arch/arm/dts/imx8mn-ab2.dts b/arch/arm/dts/imx8mn-ab2.dts index 9685eeb3d5..119f90b02d 100644 --- a/arch/arm/dts/imx8mn-ab2.dts +++ b/arch/arm/dts/imx8mn-ab2.dts @@ -5,6 +5,7 @@ /dts-v1/; +#include <dt-bindings/usb/pd.h> #include "imx8mn.dtsi" / { @@ -418,6 +419,31 @@ scl-gpios = <&gpio5 16 GPIO_ACTIVE_HIGH>; sda-gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>; status = "okay"; + + ptn5150: tcpc@1d { + compatible = "nxp,ptn5150"; + reg = <0x1d>; + status = "okay"; + + port { + typec1_dr_sw: endpoint { + remote-endpoint = <&usb1_drd_sw>; + }; + }; + + typec1_con: connector { + compatible = "usb-c-connector"; + label = "USB-C"; + power-role = "dual"; + data-role = "dual"; + try-power-role = "sink"; + source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>; + sink-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM) + PDO_VAR(5000, 20000, 3000)>; + op-sink-microwatt = <15000000>; + self-powered; + }; + }; }; &i2c3 { @@ -498,6 +524,23 @@ status = "okay"; }; +&usbotg1 { + picophy,pre-emp-curr-control = <3>; + picophy,dc-vol-level-adjust = <7>; + dr_mode = "host"; + hnp-disable; + srp-disable; + adp-disable; + usb-role-switch; + status = "okay"; + + port { + usb1_drd_sw: endpoint { + remote-endpoint = <&typec1_dr_sw>; + }; + }; +}; + &wdog1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_wdog>; diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c index c8fa86c929..8685196912 100644 --- a/arch/arm/mach-imx/imx8/cpu.c +++ b/arch/arm/mach-imx/imx8/cpu.c @@ -949,18 +949,25 @@ u32 get_cpu_rev(void) u32 id = 0, rev = 0; int ret; + /* returns ID - chip id [4:0], chip revision [9:5]*/ ret = sc_misc_get_control(-1, SC_R_SYSTEM, SC_C_ID, &id); if (ret) return 0; + /* Extract silicon version */ rev = (id >> 5) & 0xf; + /* Extract chip ID and add dummy */ id = (id & 0x1f) + MXC_SOC_IMX8; /* Dummy ID for chip */ - /* 8DXL uses A1/A2, so generate dummy rev to differentiate with B/C */ - if (id == MXC_CPU_IMX8DXL && rev != 0) - rev = 0x10 + rev; + /* 8DXL A1: use dummy rev to differentiate from B */ + if (id == MXC_CPU_IMX8DXL && rev == CHIP_REV_B) + rev = CHIP_REV_A1; + /* 8DXL B0: detect as B instead of C */ + else if (id == MXC_CPU_IMX8DXL && rev == CHIP_REV_C) + rev = CHIP_REV_B; - return (id << 12) | rev; + /* return Chip ID in [31:12] and silicon ver in [11:0]*/ + return (id << 12) | (rev & 0xfff); } static bool check_device_power_off(struct udevice *dev, |