How to enbale spi,i2c,uart,i2s on Radxa nio12l (MT8395) need step by step guidance

I just got my Radxa NIO-12L set up ubuntu22.04 and I’d really like to make full use of the 40-pin header.

Right now I can’t find clear information about:

  • How the 40-pin header pins are mapped to GPIO numbers
  • Which device tree entries control those pins
  • How to enable SPI and I2C/UART and i2s on those header pins

I have checked the available documentation and tools, but I don’t see anything that explains how to turn on SPI or how the GPIO lines are numbered for this board.

Could you please provide:

  1. A pinout / mapping for the 40-pin header (header pin → SoC pin → GPIO number),
  2. Instructions or a device tree example for enabling SPI on the header
    (for example using SPIM1_CSB / SPIM1_CLK / SPIM1_MO / SPIM1_MI on GPIO136–139),
  3. A minimal C/C++ example showing how to:
    • Toggle a GPIO on the header using the recommended API,
    • Use SPI from userspace (e.g. via /dev/spidevX.Y) on this board.