dts: nxp_rt7xx: Add support for USB

Add USB support

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
This commit is contained in:
Mahesh Mahadevan 2025-02-05 20:10:53 -06:00 committed by Carles Cufí
commit 28ab3e3502
5 changed files with 70 additions and 0 deletions

View file

@ -406,6 +406,28 @@ void board_early_init_hook(void)
CLOCK_AttachClk(kLPOSC_to_OSTIMER);
CLOCK_SetClkDiv(kCLOCK_DivOstimerClk, 1U);
#endif
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(usb0)) && CONFIG_UDC_NXP_EHCI
/* Power on usb ram array as need, powered USB0RAM array*/
POWER_DisablePD(kPDRUNCFG_APD_USB0_SRAM);
POWER_DisablePD(kPDRUNCFG_PPD_USB0_SRAM);
/* Apply the config */
POWER_ApplyPD();
/* disable the read and write gate */
SYSCON4->USB0_MEM_CTRL |= (SYSCON4_USB0_MEM_CTRL_MEM_WIG_MASK |
SYSCON4_USB0_MEM_CTRL_MEM_RIG_MASK |
SYSCON4_USB0_MEM_CTRL_MEM_STDBY_MASK);
/* Enable the USBPHY0 CLOCK */
SYSCON4->USBPHY0_CLK_ACTIVE |= SYSCON4_USBPHY0_CLK_ACTIVE_IPG_CLK_ACTIVE_MASK;
CLOCK_AttachClk(k32KHZ_WAKE_to_USB);
CLOCK_AttachClk(kOSC_CLK_to_USB_24MHZ);
CLOCK_EnableClock(kCLOCK_Usb0);
CLOCK_EnableClock(kCLOCK_UsbphyRef);
RESET_PeripheralReset(kUSB0_RST_SHIFT_RSTn);
RESET_PeripheralReset(kUSBPHY0_RST_SHIFT_RSTn);
CLOCK_EnableUsbhs0PhyPllClock(kCLOCK_Usbphy480M, usbClockFreq);
CLOCK_EnableUsbhs0Clock(kCLOCK_Usb480M, usbClockFreq);
#endif
}
static void GlikeyWriteEnable(GLIKEY_Type *base, uint8_t idx)

View file

@ -88,6 +88,8 @@ the hardware features below.
+-----------+------------+-------------------------------------+
| OS_TIMER | on-chip | os timer |
+-----------+------------+-------------------------------------+
| USB | on-chip | USB device |
+-----------+------------+-------------------------------------+
The default configuration can be found in the defconfig file:

View file

@ -147,4 +147,16 @@
};
};
zephyr_udc0: &usb0 {
status = "okay";
phy-handle = <&usbphy>;
};
&usbphy {
status = "okay";
tx-d-cal = <7>;
tx-cal-45-dp-ohms = <6>;
tx-cal-45-dm-ohms = <6>;
};
p3t1755dp_ard_i2c_interface: &flexcomm8_lpi2c8 {};

View file

@ -20,4 +20,5 @@ supported:
- uart
- spi
- adc
- usb_device
vendor: nxp

View file

@ -57,6 +57,13 @@
pinctrl: pinctrl {
compatible = "nxp,rt-iocon-pinctrl";
};
/* USB PLL */
usbclk: usbpll-clock {
compatible = "fixed-clock";
clock-frequency = <24000000>;
#clock-cells = <0>;
};
};
@ -968,6 +975,32 @@
status = "disabled";
};
usb0: usbd@418000 {
compatible = "nxp,ehci";
reg = <0x418000 0x1000>;
interrupts = <40 0>;
interrupt-names = "usb_otg";
clocks = <&usbclk>;
num-bidir-endpoints = <8>;
status = "disabled";
};
usb1: usbd@419000 {
compatible = "nxp,ehci";
reg = <0x419000 0x1000>;
interrupts = <41 0>;
interrupt-names = "usb_otg";
clocks = <&usbclk>;
num-bidir-endpoints = <8>;
status = "disabled";
};
usbphy: usbphy@414000 {
compatible = "nxp,usbphy";
reg = <0x414000 0x1000>;
status = "disabled";
};
mrt0: mrt@2d000 {
compatible = "nxp,mrt";
reg = <0x2d000 0x100>;