Skip to content

Commit 5df7bd4

Browse files
authored
Merge pull request #356 from iabdalkader/portenta_video
variants/portenta_h7: Add support for Analogix ANX7625 MIPI-DSI.
2 parents a592fef + 4e05f7b commit 5df7bd4

4 files changed

Lines changed: 120 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) Arduino SRL
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
title: Analogix ANX7625 MIPI-DSI to DisplayPort bridge
5+
6+
description: |
7+
Analogix ANX7625 MIPI-DSI to DisplayPort converter bridge.
8+
9+
compatible: "analogix,anx7625"
10+
11+
include: [mipi-dsi-device.yaml]
12+
13+
properties:
14+
i2c-bus:
15+
type: phandle
16+
required: true
17+
description: I2C controller used for the video bridge
18+
19+
video-on-gpios:
20+
type: phandle-array
21+
description: GPIO for powering on the video bridge
22+
23+
video-rst-gpios:
24+
type: phandle-array
25+
description: GPIO for resetting the video bridge
26+
27+
otg-on-gpios:
28+
type: phandle-array
29+
description: GPIO for OTG control

loader/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE} COMPONENTS yaml boards)
1010
set(DTC_OVERLAY_FILE ${CMAKE_CURRENT_LIST_DIR}/../variants/${NORMALIZED_BOARD_TARGET}/${NORMALIZED_BOARD_TARGET}.overlay)
1111
set(EXTRA_CONF_FILE ${CMAKE_CURRENT_LIST_DIR}/../variants/${NORMALIZED_BOARD_TARGET}/${NORMALIZED_BOARD_TARGET}.conf)
1212

13+
# Add dts/bindings to DTS_ROOT for custom bindings
14+
list(APPEND DTS_ROOT ${CMAKE_CURRENT_LIST_DIR}/..)
15+
1316
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
1417

1518
project(app LANGUAGES C CXX)

variants/arduino_portenta_h7_stm32h747xx_m7/arduino_portenta_h7_stm32h747xx_m7.conf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,15 @@ CONFIG_VIDEO_BUFFER_POOL_SZ_MAX=614400
136136
CONFIG_VIDEO_BUFFER_POOL_ALIGN=32
137137
CONFIG_VIDEO_BUFFER_USE_SHARED_MULTI_HEAP=y
138138
CONFIG_VIDEO_BUFFER_SMH_ATTRIBUTE=2
139+
140+
# Display subsystem for USB-C Video (ANX7625)
141+
CONFIG_DISPLAY=y
142+
CONFIG_DISPLAY_INIT_PRIORITY=80
143+
CONFIG_STM32_LTDC=y
144+
CONFIG_STM32_LTDC_FB_USE_SHARED_MULTI_HEAP=y
145+
CONFIG_STM32_LTDC_FB_SMH_ATTRIBUTE=2
146+
CONFIG_MIPI_DSI=y
147+
CONFIG_MIPI_DSI_STM32=y
139148
CONFIG_FLASH=y
140149

141150
CONFIG_BT=y

variants/arduino_portenta_h7_stm32h747xx_m7/arduino_portenta_h7_stm32h747xx_m7.overlay

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@
290290
/ {
291291
chosen {
292292
zephyr,camera = &dcmi;
293+
zephyr,display = &ltdc;
294+
zephyr,mipi-dsi = &mipi_dsi;
293295
zephyr,console = &usart6;
294296
zephyr,shell-uart = &usart6;
295297
zephyr,cdc-acm-uart0 = &usart6;
@@ -448,3 +450,80 @@ qspi_flash: &mx25l12833f {};
448450
};
449451

450452
/delete-node/ &sram2;
453+
454+
&sdram1 {
455+
/* Frame buffer memory cache will cause screen flickering. */
456+
zephyr,memory-attr = <( DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE) )>;
457+
};
458+
459+
/*
460+
*PLL3 calculation for 1024x768@60Hz (57.8 MHz pixel clock)
461+
* Portenta H7 uses 25 MHz HSE crystal
462+
* VCO input = HSE / div-m = 25 MHz / 25 = 1 MHz
463+
* VCO output = VCO input × mul-n = 1 MHz × 289 = 289 MHz
464+
* Pixel clock = VCO output / div-r = 289 MHz / 5 = 57.8 MHz
465+
*/
466+
&pll3 {
467+
status = "okay";
468+
clocks = <&clk_hse>;
469+
div-m = <25>; /* HSE_VALUE/1MHz: 25MHz/25 = 1 MHz VCO input */
470+
mul-n = <289>; /* pixelclock/200kHz: 57800/200 = 289 */
471+
div-p = <2>;
472+
div-q = <7>;
473+
div-r = <5>; /* 1000/200kHz = 5 -> 289MHz/5 = 57.8 MHz */
474+
};
475+
476+
&ltdc {
477+
status = "okay";
478+
ext-sdram = <&sdram1>;
479+
width = <1024>;
480+
height = <768>;
481+
def-back-color-red = <0>;
482+
def-back-color-green = <0>;
483+
def-back-color-blue = <0>;
484+
pixel-format = <PANEL_PIXEL_FORMAT_RGB_565>;
485+
486+
display-timings {
487+
compatible = "zephyr,panel-timing";
488+
hsync-active = <0>;
489+
vsync-active = <0>;
490+
de-active = <0>;
491+
pixelclk-active = <0>;
492+
hsync-len = <68>;
493+
hfront-porch = <24>;
494+
hback-porch = <80>;
495+
vsync-len = <6>;
496+
vfront-porch = <3>;
497+
vback-porch = <29>;
498+
};
499+
};
500+
501+
&mipi_dsi {
502+
status = "okay";
503+
504+
pll-ndiv = <40>;
505+
pll-idf = <2>;
506+
pll-odf = <0>;
507+
508+
de-active-high;
509+
bta-ack-disable; /* ANX7625 bridge doesn't respond to BTA requests */
510+
largest-packet-size = <16>;
511+
512+
phy-timings = <35 35 35 35 0 10>;
513+
514+
/*
515+
* This binding allows adding child node with with data-lanes property
516+
* as required by STM32 MIPI-DSI driver.
517+
*/
518+
anx7625: anx7625@0 {
519+
status = "okay";
520+
compatible = "analogix,anx7625";
521+
reg = <0>; /* Virtual channel 0 */
522+
pixel-format = <0>; /* Not used */
523+
data-lanes = <2>; /* 2 data lanes */
524+
i2c-bus = <&i2c1>;
525+
video-on-gpios = <&gpiok 2 GPIO_ACTIVE_HIGH>;
526+
video-rst-gpios = <&gpioj 3 GPIO_ACTIVE_HIGH>;
527+
otg-on-gpios = <&gpioj 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
528+
};
529+
};

0 commit comments

Comments
 (0)