Hi Tomi,

Robert Nelson pointed me here. I'm bringing up the Raspberry Pi Touch
Display 2 (5-inch) on a BeagleY-AI (AM67A/J722S) using your DSI work as
backported in Robert's v7.0.x-arm64-k3 tree (7.0.11-arm64-k3-r20). The
panel is a native ILI9881C MIPI-DSI panel (720x1280, 2 lanes); a Goodix
GT911 touch and the RPi "v2" control MCU both sit on the DSI-connector
i2c bus (i2c-3), and the MCU supplies the panel reset and the touch
regulator over i2c.

Relevant config: CONFIG_DRM_TIDSS=y, CONFIG_DRM_CDNS_DSI=y,
CONFIG_DRM_PANEL_ILITEK_ILI9881C=y,
CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_V2=y.

HDMI works. You mention testing the DSI output with the RPi 7" display
(via the TC358762 DSI->DPI bridge) using extra overlays -- would you be
able to share that 7" DSI test overlay? It would be an invaluable
reference for the DSS/DSI videoport wiring. I suspect the crux of my
problem is that the TD2 5" is a native DSI panel whose reset/power come
from an i2c MCU, so the panel has a deferred dependency that the
bridge-based 7" panel does not.

Setup
-----

The DSI-connector i2c and the MIPI mux are not enabled in the
BeagleY-AI base dtb of this image, so my overlay supplies:
  - the MIPI mux routing (gpio-hog on main_gpio0: MIPI_SWITCH_OE=high,
    MIPI_SWITCH_SEL=low, with the two pads muxed to GPIO);
  - pinctrl-0 = <&main_i2c0_pins_default>, status = "okay" and
    clock-frequency on the i2c node;
  - display_mcu@45 (raspberrypi,touchscreen-panel-regulator-v2),
    gt911@5d, the ili9881c panel@0 on dsi0 (reset-gpio via the MCU,
    power-supply), the DSS (dss1) / DSI port endpoints, and touch_reg.

With that, every device binds:

  /sys/bus/mipi-dsi/devices/30500000.dsi.0 -> ili9881c-dsi   (panel)
  /sys/bus/i2c/devices/3-0045/driver       -> rpi_touchscreen_v2 (MCU)
  Goodix-TS 3-005d: ID 911, version: 1060                    (touch)
  /sys/kernel/debug/devices_deferred       -> (empty)

Problem: tidss assembles before the DSI bridge is added
-------------------------------------------------------

  [    2.000378] [drm] Missing drm_bridge_add() before attach
  [    2.059239] tidss 30220000.dss: [drm] Registered 1 planes with drm panic
  [    2.061629] [drm] Initialized tidss 1.0.0 for 30220000.dss on minor 0
  [    2.062051] tidss 30220000.dss: [drm] Cannot find any crtc or sizes
  [    2.062628] tidss 30220000.dss: [drm] Cannot find any crtc or sizes

tidss initializes at ~2.0s with only HDMI-A-1 (the sole DRM
connector). But the DSI panel chain finishes binding only ~10s later:
the panel depends on the MCU regulator reached over i2c-3, and the MCU
and GT911 bind at the deferred-probe timeout. So at 2.0s the
cdns-dsi/panel bridge is not added yet ("Missing drm_bridge_add()
before attach"); tidss reports "Cannot find any crtc" for the DSI
videoport, comes up HDMI-only, and does not defer or re-scan when the
panel binds later. Net result: no DSI connector/crtc and the panel is
never enabled.

Questions:
  1. Should tidss -EPROBE_DEFER until the DSI output's downstream
     bridge (cdns-dsi + panel) is added, rather than succeeding with
     HDMI only?
  2. Is "Missing drm_bridge_add() before attach" the cdns-dsi bridge
     or the panel bridge, and is it expected when the panel attaches
     after tidss has initialized?
  3. Is there a recommended way to ensure the DSI panel chain is ready
     before tidss probes, or for tidss to pick up the DSI output once
     the panel binds?

I'm happy to share the full overlay, dmesg and /sys state, and to test
patches.

Separately (I'll send a proper patch to the bridge maintainers): a
cdns-dsi data-lane off-by-one. In cdns_dsi_init_link(),

  for (i = 1; i < output->dev->lanes; i++)
      val |= DATA_LANE_EN(i);

enables only lanes 1..N-1 because DATA_LANE_EN(x) is BIT(x - 1), so a
2-lane panel ends up with MCTL_MAIN_PHY_CTL = 0x11 instead of 0x13
(lane 1 stuck in START). "<" should be "<=". On 6.1 the TD2 panel comes
up but the image is black for this reason.

Thanks,
Shubham

Reply via email to