Skip to main content

v2n-pmic-inspect

Inspector for the V2N SoM's on-module power chips — ACT88760, DA9292 and TPS628640 — run as a Linux/Yocto user-space app on the Cortex-A55 cluster over BRD_I2C. It is read-only unless you pass --write together with one action flag.

Source: examples/v2n/v2n-pmic-inspect/. New in alp-sdk v0.17.0.

The write actions change live power rails

--set-mv, --enable / --disable, --fix-gpio4-polarity and --deepx-rail-sequence reprogram PMICs that power the SoC, its memory and (on V2N-M1) the DEEPX NPU. A wrong setpoint can take a board off-rail. The drivers enforce the SoM's metadata-generated voltage windows and refuse out-of-window or critical-rail requests, but nothing here has been run on silicon yet — treat every write as a bench operation on a unit you can afford to power-cycle, and stay read-only otherwise.

What it reads​

AddressChipWhat is shown
0x25 / 0x26ACT88760 (act8760)Buck1..7 and LDO1..6: net, enable, mV, POK, OV/ILIM; GPIO1..11: net, MODE byte, polarity, MUX, push-pull, level, IRQ mask
0x1EDA9292 (da9292)identity (DEV_ID / REV_ID / CFG_REV); CH1 / CH2: enable, active mV, VSTEP / VSEL, PG, UV / OV / OC; latched EVENT_00/01 (peeked, not cleared)
0x44 / 0x48 / 0x4FTPS628640The DEEPX-side bucks on V2N-M1: VOUT, CONTROL. Skipped when absent — they answer only once the DEEPX rail has been enabled
0x4DTPS628640The LPDDR4X 0.6 V buck, an assembly option; skipped when absent

Rail net names, guard windows, critical flags, the expected DA9292 identity and the expected ACT88760 MODE4 byte all come from the generated <alp/chips/v2n_power_tree.h>, which the SDK generates from the SoM's power-tree metadata. The app hard-codes no window: it hands the generated tables to the drivers, and the drivers enforce them.

Usage​

v2n-pmic-inspect # text dump, family v2n-m1 (a superset for reading)
v2n-pmic-inspect --family v2n --json # machine-readable
v2n-pmic-inspect --include-clear-on-read
Exit codeMeaning
0Silicon matches the metadata.
1Silicon and metadata disagree: a DA9292 identity byte differs, ACT88760 MODE4 is not 0x08, a power chip is missing, or a present rail's live voltage reads outside its window.
2Usage error, or /dev/i2c-8 could not be opened.
3A write action was refused or failed.

Clear-on-read registers are never read unless you pass --include-clear-on-read: ACT88760 ADD1 0x00 (VSYS latches), 0x04 (GPIO1..8 toggles) and 0x2B (GPIO9..11 toggles — so without the flag the GPIO9..11 level and IRQ-mask columns show ?), and TPS628640 0x05 (STATUS). act8760_init() reads 0x00 as its presence probe, so the VSYS latches are consumed even without the flag. The DA9292 EVENT registers are write-1-to-clear, so they are always only peeked.

Kernel-owned addresses are checked first with an I2C_SLAVE-based probe; an address a kernel driver holds (EBUSY) is reported as kernel-owned and never touched — the same check v2n-brd-i2c-bringup does.

Write actions​

Every write needs --write, exactly one action flag, and an explicit --family v2n|v2n-m1 (which selects the guard tables). The app also refuses to write when silicon disagrees with the metadata — except for the GPIO4 fix below.

ActionWhat it does
--set-mv <rail> <mV>Programs a setpoint. The driver rounds down to the chip's grid in the rail's live range and refuses (ALP_ERR_OUT_OF_RANGE) unless the encoded value is inside the rail's window.
--enable <rail> / --disable <rail>Changes the enable bit. Disabling a critical rail — every ACT88760 rail, DA9292 CH1, TPS628640 0x4D — always returns ALP_ERR_NOSUPPORT. The app refuses --disable of any DA9292 / TPS628640 rail: DEEPX rails only go down in order, through the --deepx-rail-sequence shutdown.
--fix-gpio4-polarityActs only when ACT88760 MODE4 reads exactly 0x88 (an inverted OTP that holds the GD32 supervisor in reset); writes 0x08 and reads it back. Prints a no-op message if MODE4 already reads 0x08, and refuses any other value. The fix is volatile — repeat it after every power cycle.
--deepx-rail-sequenceV2N-M1 only. Runs the DA9292 CH2 DEEPX-rail sequence through the Linux GPIO character device. M1_RESET is not touched.

<rail> is an id (buck1..buck7, ldo1..ldo6, da9292.ch1, da9292.ch2, a TPS628640 net) or the rail's net name as the app prints it in the read-only dump. Buck5 / Buck6 have no confirmed net name — use their buck5 / buck6 ids.

--deepx-rail-sequence safety rules​

On a normally booted board U-Boot has already run this sequence; this action is for bench bring-up only.

  • It refuses when DA9292 CH2 is already enabled — that state means the boot owner already ran the sequence, and claiming the enable line would drop the DEEPX core enable under a live DEEPX.
  • It refuses when either DEEPX control line is held by another consumer, or is already an output, and unless the kernel names the lines as expected.
  • The process stays running while the rail is up. If the sequence succeeds it keeps holding the lines, because the RZ pin controller returns a released line to input. SIGINT / SIGTERM / SIGHUP power the rail down in order. Killing the process uncleanly (SIGKILL) releases the core-enable line, which then floats under a live CH2.
  • CM33-boot mode is blocked. In A55-boot mode U-Boot owns the DEEPX sequence and Linux is the sole BRD_I2C master. The Cortex-M33 must not master BRD_I2C, so no CM33 image may run the sequence. The boot-mode strap level is not recorded yet, so the app prints it but cannot gate on it.

board.yaml​

som:
sku: E1M-V2N101

preset: e1m-x-evk

cores:
a55_cluster:
app: ./src
peripherals:
- i2c
- gpio

chips:
- act8760
- da9292
- tps628640

diagnostics:
log_level: info

No meta-alp-sdk recipe packages this app yet, so tan build blocks the A55 slice with a yocto-recipe-missing warning. Build it with the Yocto SDK.

Build (Yocto SDK)​

# The SDK that includes meta-alp-sdk ships libalp_sdk.so + libalp_chips.a
# with the act8760, da9292 and tps628640 drivers on by default:
. /opt/poky/<ver>/environment-setup-aarch64-poky-linux

cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=$OECORE_NATIVE_SYSROOT/usr/share/cmake/OEToolchainConfig.cmake
cmake --build build

Copy build/v2n-pmic-inspect to the target and run it as a user that can open /dev/i2c-8 (and /dev/gpiochip* for the DEEPX action).

See also​

Questions about this page? Email contact@alplab.ai