Skip to content
Snippets Groups Projects
Commit 93496d0c authored by Dietmar Muscholik's avatar Dietmar Muscholik Committed by Oleksii Kutuzov
Browse files

[NONFUNC] Add documentation for stm32 driver

parent 6be0955b
No related branches found
No related tags found
1 merge request!13Merge E81 development branch into trunk
Device tree bindings for the seco stm32 embedded controller
***********************************************************
The stm32 embedded controller acts as a GPIO- and PWM-controller
and also handles system-reboot and -halt, by sending an appropriate
command to the controller.
Properties
----------
- compatible = "seco,stm32"
- reg = <0x40>: The address on the i2c-bus.
- pinctrl-names = "default"
- pinctrl-0 = <phandle>: Phandle of the pincontrol, only required for the
interrupt-pin.
- interrupt-parent = <phandle>: Where interrupts have to be send to.
- interrupts = <phandle>: Number and flags of the interrupt-pin.
GPIO
- gpio-controller: This is a gpio-controller, all standard-properties of
a gpio-controller will automaticaly be available.
- #gpio-cells = <2>: Number of parameters for a GPIO-definition,
pin-number and flags.
- ngpios =/bits/ 16 <16-bit-int>: Number of GPIOs to handle.
Interrupt
- interrupt-controller: This is an interrupt-controller, all
standard-properties of an interrupt-controller will automaticaly be
available.
- #interrupt-cells = <2>: Number of parameters for an
interrupt-definition, pin-number and flags.
- cpu-irq = <int>: Interrupt that can be triggered by a GPIO.
PWM
- #pwm-cells = <2>: Number of parameters for a PWM-definition. These are
period and duty-cyle. This is only for the kernel. The periods of the
PWMs are hardcodes in the stm32-firmware and can not be changed.
- pwm-pins = <array of int>: Pins that are used as PWM-pins.
Reboot-notifier
- reboot-delay-ms = <int>: Number of ms the embedded controller should
wait before actualy reboot of power-off.
Examples
--------
&lpi2c5 {
stm32: stm32@40 {
reg = <0x40>;
compatible = "seco,stm32";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_stm32>;
interrupt-parent = <&gpio2>;
interrupts = <EC_IRQ_PIN IRQ_TYPE_EDGE_FALLING>;
gpio-controller;
#gpio-cells = <2>;
ngpios =/bits/ 16 <STM32_NGPIOS>;
interrupt-controller;
#interrupt-cells = <2>;
cpu-irq = <CPU_IRQ>;
#pwm-cells = <2>;
pwm-pins = <LCD0_BKLT_PWM_PIN LCD1_BKLT_PWM_PIN I2S0_MCLK_PIN>;
reboot-delay-ms = <500>;
status = "okay";
};
};
Using pin 10 as enable-gpio
---------------------------
some_node {
...
enable-gpio = <&stm32 10 GPIO_ACTIVE_HIGH>;
...
};
Using pin 11 as interrupt-source
--------------------------------
some_node {
...
interrupt-parent = <&stm32>;
interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
...
};
Using pin 12 as PWM
-------------------
&stm32 {
pwm-pins = <12>; // pin 12 will act as pwm #0
};
some_node {
...
pwms = <&stm32 0 4000000 0>;
...
};
Using pin 13 as hog-gpio
------------------------
Sometimes you will need to switch a GPIO that is not handled by any driver,
e.g. to enable an USB-hub or switch on a clock for a WiFi-interface.
&stm32 {
some-gpio {
gpio-hog;
gpios = <13 (GPIO_PUSH_PULL | GPIO_ACTIVE_HIGH)>;
output-high:
line-name = "some-gpio";
};
};
Sysfs
-----
Some information is available in /sys/bus/i2c/devices/<bus>-<address>.
These are:
- chip_id
- fw_ver
- seco_code
- boot_mode
Writing to boot_mode will change the boot_mode for the next reboot.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment