]> www.infradead.org Git - users/jedix/linux-maple.git/commit
arm64: dts: freescale: imx8mp-verdin: Add Ivy carrier board
authorJoão Paulo Gonçalves <joao.goncalves@toradex.com>
Tue, 24 Sep 2024 11:40:53 +0000 (13:40 +0200)
committerShawn Guo <shawnguo@kernel.org>
Thu, 17 Oct 2024 09:21:10 +0000 (17:21 +0800)
commitb98948b042954a602ccd5bd5c55030ac08821e20
tree8e37d50599917b171bd1b95f8f18ba1b2f93d9b5
parent56ba6fd50e8436b2168c8add256f370d4c215f65
arm64: dts: freescale: imx8mp-verdin: Add Ivy carrier board

Add Toradex Verdin Ivy carrier board support. One notable feature of Ivy
is the analog inputs. These inputs are multiplexed, allowing the same
input to measure either voltage or current. For current measurements,
a GPIO switch enables or disables the shunt resistor. This process is
automatically managed by the Linux kernel using the IIO and MUX
subsystems. Voltage measurement is always enabled, but the voltage
measured by the ADC is scaled by a cascade voltage divider. In the
device tree, the equivalent gain of the voltage divider is used, which
can be calculated as follows:

               ------------
               +          |
                         .-.
                  R1=30K | |
                         | |
                         '-'
                          |-------------------
    Analog Input (AIN)    |                  |
                         .-.                .-.
                  R2=10K | |         R3=30K | |
                         | |                | |
                         '-'                '-'
                          |                  |
                          |                  |--------
                          |                 .-.      +
                          |          R4=10K | |
                          |                 | |      ADC Input (Channels 0 and 1)
                          |                 '-'
               -          |                  |       -
               -----------|                  |--------
                         ===                ===
                         GND                GND

Vin  = Analog Input (AIN)
Vout = ADC Input
Rth  = Thevenin Equiv. Resistance
Vth  = Thevenin Equiv. Voltage
RL   = Load Resistor

R1 = 30K, R2 = 10K, R3 = 30K, R4 = 10K
RL = R4 = 10K

Rth  = (R1 // R2) + R3 = 37500 Ohms
Vth  = (Vin * R2) / (R1 + R2) = Vin/4;
Vout = (Vth * RL)/ (Rth + RL) = Vth/4.75 = Vin/19
Gain = Vout/Vin = 1/19

https://www.toradex.com/products/carrier-board/ivy-carrier-board

Signed-off-by: João Paulo Gonçalves <joao.goncalves@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm64/boot/dts/freescale/Makefile
arch/arm64/boot/dts/freescale/imx8mp-verdin-ivy.dtsi [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mp-verdin-nonwifi-ivy.dts [new file with mode: 0644]
arch/arm64/boot/dts/freescale/imx8mp-verdin-wifi-ivy.dts [new file with mode: 0644]