Repository navigation
arm: dts: hi3516a: enable uart1-3 so boards can mux them for PTZ - #111
Conversation
Only uart0 was enabled, so a board whose PTZ controller hangs off another UART had no tty to talk to, whatever it did with the pads. That is OpenIPC/firmware#2385: a HI3516D_N81820 speed dome whose pan/tilt MCU is driven over Pelco-D from the main board, where the stock firmware muxes UART1 (IOCONFIG 0x200F007C/0x200F0084 = 1) and keeps the UART1_RTSN ball as GPIO9_2 for what looks like an RS-485 direction pin. Enable uart1, uart2 and uart3 and give them serial1..3 aliases, so ttyAMA1..3 name the same controller whatever the probe order. The pads are left alone: every one of them resets to GPIO (datasheet table 2-48, muxctrl_reg30..35), so a board that does not mux them sees no change on the wire and only gains three tty nodes. Muxing is per board and stays with the board.
PR Summary by QodoEnable HI3516A UART1–3 with stable serial aliases
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. The PTZ pads stay in GPIO mode
|
| &uart1 { | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &uart2 { | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &uart3 { | ||
| status = "okay"; | ||
| }; |
There was a problem hiding this comment.
1. The ptz pads stay in gpio mode 📎 Requirement gap ≡ Correctness
The enabled UART nodes contain only status = "okay" and add no board-specific pinmux configuration for the PTZ connection. Because the relevant pads remain GPIO unless the board configures them separately, this implementation does not verify or configure the physical UART path required by the motor controller.
Agent Prompt
## Issue description
The change enables three UART controllers but does not configure the board-specific pads for the PTZ motor-controller connection, leaving the physical interface in its reset GPIO mode.
## Fix Focus Areas
- arch/arm/boot/dts/hi3516a-demb.dts[90-100]
## Recommended Fix
Verify which UART and physical pads connect to the PTZ MCU on the target board, then add the corresponding board-specific pinctrl and any required RS-485 direction GPIO configuration. Enable only the verified UART path and document the board-specific mapping.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| serial1 = &uart1; | ||
| serial2 = &uart2; | ||
| serial3 = &uart3; |
There was a problem hiding this comment.
2. Ptz movement remains unvalidated 📎 Requirement gap ☼ Reliability
The change creates stable serial aliases and enables the UART controllers but adds no serial communication test or PTZ protocol configuration. Without testing the configured device against the motor controller using the applicable settings, users have no demonstrated path to pan, tilt, or zoom control.
Agent Prompt
## Issue description
The UART aliases and enablement do not establish that the PTZ motor controller is reachable or that Pelco-D communication works.
## Fix Focus Areas
- arch/arm/boot/dts/hi3516a.dtsi[26-28]
- arch/arm/boot/dts/hi3516a-demb.dts[90-100]
## Recommended Fix
After verifying the board-specific UART and pinmux, boot the target hardware and test the resulting device node with the expected Pelco-D 9600 baud, 8N1 settings. Confirm pan, tilt, and zoom commands reach the secondary controller, and record the validation in the board documentation or test coverage.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
…elco-D pan/tilt) (#210) The Anxinshi ASRIH698T-020-20X is the XiongMai HI3516D_N81820 main board in a 20x pan/tilt dome. Its base MCU speaks Pelco-D, address 1, 9600 8N1, over RS-485 on UART1, which the reporter of OpenIPC/firmware#2385 drove by hand on nightly-20261020-ef421c8 once OpenIPC/linux#111 gave the board ttyAMA1. muxes.sh repeats what the stock firmware does at every boot: UART1 RXD/TXD on their pads, and the UART1_RTSN ball kept as GPIO9_2, the transceiver's direction pin, driven high. It resets low, which is receive, and nothing sent would reach the bus. customizer.sh points majestic's Pelco-D actuator at ttyAMA1 at 9600 and narrows the WebUI pad to pan and tilt. Cloned from hi3516dv100_lite_xm-n81820, the varifocal on the same board, with two differences. FLASH_SIZE is 8: the dome boots the 8M layout (5120k rootfs per its mtdparts in #2219) and its chip size is not known, so a 16M image could not be written to it. And majestic drives one actuator, which here is the pan/tilt head, so the MS41908M lens is not driven by majestic on this image.
For OpenIPC/firmware#2385. The HI3516D_N81820 speed dome drives its pan/tilt MCU over Pelco-D from the main board. Only
uart0is enabled inhi3516a-demb.dts, so there is no/dev/ttyAMA1to send on, whatever the board does with its pads.Change
hi3516a-demb.dts:&uart1,&uart2and&uart3set tostatus = "okay". This is the reporter's patch.hi3516a.dtsi:serial1..3aliases, so ttyAMA1..3 always map to the same controller, whatever the probe order.No pinmux. Per the Hi3516A/D datasheet (Issue 10), table 2-48, muxctrl_reg30..35 (
0x200F0078..0x8C) all reset to GPIO. A board that doesn't mux them sees no change on the wire and only gains three tty nodes. On the dome, stock firmware sets0x7C/0x84to 1 (UART1 RXD/TXD) and keeps0x78(the UART1_RTSN ball) as GPIO9_2, driven as an output, which looks like an RS-485 direction pin. That is board-specific, so it belongs in the device profile, not here.Checked against the datasheet: UART1/2/3 bases
0x2009_0000/0x200A_0000/0x2023_0000, and clock gates PERI_CRG0xe4bits 16/17/18. Both match the dtsi andclk-hi3516a.c.Verified
hi3516dv100_liteagainst this branch. The decompiledhi3516a-demb.dtbshows uart@20090000/200a0000/20230000okayand serial1..3 aliases.Not run on a camera. The lab dv100 board is offline. The reporter will boot it from the nightly and report on the issue.