diff --git a/boards/nxp/frdm_mcxn947/board.c b/boards/nxp/frdm_mcxn947/board.c index e2186dab1c0a524..57049f84a8c2ec5 100644 --- a/boards/nxp/frdm_mcxn947/board.c +++ b/boards/nxp/frdm_mcxn947/board.c @@ -213,6 +213,19 @@ static int frdm_mcxn947_init(void) CLOCK_AttachClk(kFRO_HF_to_USDHC); #endif +#if DT_NODE_HAS_STATUS(DT_NODELABEL(smartdma), okay) + CLOCK_EnableClock(kCLOCK_Smartdma); + RESET_PeripheralReset(kSMART_DMA_RST_SHIFT_RSTn); +#if DT_NODE_HAS_STATUS(DT_NODELABEL(video_sdma), okay) + /* Drive CLKOUT from PLL0, divided by 27 to yield ~5.5MHz clock + * The camera will use this clock signal to generate + * PCLK, HSYNC, and VSYNC + */ + SYSCON->CLKOUTSEL = 0x1; + SYSCON->CLKOUTDIV = 26; +#endif +#endif + #if CONFIG_FLASH_MCUX_FLEXSPI_NOR /* We downclock the FlexSPI to 50MHz, it will be set to the * optimum speed supported by the Flash device during FLEXSPI diff --git a/boards/nxp/frdm_mcxn947/frdm_mcxn947-pinctrl.dtsi b/boards/nxp/frdm_mcxn947/frdm_mcxn947-pinctrl.dtsi index 5a124c7a717fe42..46fa862f94bb919 100644 --- a/boards/nxp/frdm_mcxn947/frdm_mcxn947-pinctrl.dtsi +++ b/boards/nxp/frdm_mcxn947/frdm_mcxn947-pinctrl.dtsi @@ -141,6 +141,31 @@ }; }; + pinmux_smartdma_camera: pinmux_smartdma_camera { + group0 { + /* + * SmartDMA pinmux is not defined by SOC header, so + * we encode it manually + */ + pinmux = , + , + , + , + , + , + , + , + , + , + , + , + ; + drive-strength = "low"; + slew-rate = "fast"; + input-enable; + }; + }; + pinmux_usdhc0: pinmux_usdhc0 { group0 { pinmux = , diff --git a/boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi b/boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi index 0c85858491b87b6..b59b68dffdbfcb2 100644 --- a/boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi +++ b/boards/nxp/frdm_mcxn947/frdm_mcxn947.dtsi @@ -81,6 +81,28 @@ pinctrl-0 = <&pinmux_flexcomm7_lpi2c>; pinctrl-names = "default"; clock-frequency = ; + ov7670: ov7670@21 { + compatible = "ovti,ov7670"; + reset-gpios = <&gpio1 19 GPIO_ACTIVE_HIGH>; + pwdn-gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>; + reg = <0x21>; + }; +}; + +/* SmartDMA is used for video driver on this board */ +&smartdma { + status = "okay"; + program-mem = <0x4000000>; + video_sdma: video-sdma { + status = "okay"; + compatible = "nxp,video-smartdma"; + pinctrl-0 = <&pinmux_smartdma_camera>; + pinctrl-names = "default"; + sensor = <&ov7670>; + vsync-pin = <4>; + hsync-pin = <11>; + pclk-pin = <5>; + }; }; /*