Imu bmi088 device tree error

Dear nvidia,hello,I refer to the official documentation as follows:

bmi088@69 {
  compatible = "bmi,bmi088";
  accel_i2c_addr = <0x19>;
  status = "okay";
  reg = <0x69>;
  accel_irq_gpio = <&tegra_aon_gpio TEGRA_AON_GPIO(PT, 5) GPIO_ACTIVE_HIGH>;
  gyro_irq_gpio = <&tegra_aon_gpio TEGRA_AON_GPIO(PT, 6) GPIO_ACTIVE_HIGH>;
  accel_matrix = [01 00 00 00 01 00 00 00 01];
  gyro_matrix = [01 00 00 00 01 00 00 00 01];
  accel_reg_0x53 = <0x0A>;
  gyro_reg_0x16 = <0x01>;
  gyro_reg_0x18 = <0x01>;

But compile tells me: syntax error FATAL ERROR: Unable to parse input tree.
The problem appears on these two lines:

  accel_irq_gpio = <&tegra_aon_gpio TEGRA_AON_GPIO(PT, 5) GPIO_ACTIVE_HIGH>;
  gyro_irq_gpio = <&tegra_aon_gpio TEGRA_AON_GPIO(PT, 6) GPIO_ACTIVE_HIGH>;

Am I missing a header file to configure these two parameters? Corresponds to the interrupt pins of the accelerometer and gyroscope, respectively. I see that the interrupt configuration of the BMI160 is as follows, can I provide some suggestions to modify it? Thank you.

interrupt-parent = <&tegra_aon_gpio>;
interrupts = <TEGRA194_AON_GPIO(AA, 2) GPIO_ACTIVE_LOW>;

I found the problem, it turned out to be the number of the interrupt pin, I used the following two lines to test that it can compile successfully.

accel_irq_gpio = <&tegra_aon_gpio TEGRA194_AON_GPIO(AA, 5) GPIO_ACTIVE_HIGH>;
gyro_irq_gpio = <&tegra_aon_gpio TEGRA194_AON_GPIO(AA, 6) GPIO_ACTIVE_HIGH>;

But I’m using gpio15 and gpio16 as interrupt pins, so I get an error when I use (PT, 5) and (PT, 6) as pin inputs, what should be the number of these two pins in the description of the device tree?

I use the device tree interrupt pins below to represent GPIO15 and GPIO16, is this correct? If it is correct, the topic is solved.

			accel_irq_gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(T, 5) GPIO_ACTIVE_HIGH>;
  			gyro_irq_gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(T, 6) GPIO_ACTIVE_HIGH>;

hello DreamLan,

this is incorrect, alphabet T should be omitted for using this GPIO marco.
for example, accel_irq_gpio = <&tegra_aon_gpio TEGRA194_MAIN_GPIO(T, 5) GPIO_ACTIVE_HIGH>;
you may see-also /sys/kernel/debug/gpio for the GPIO numbers. for example, # cat /sys/kernel/debug/gpio | grep T.05

accel_irq_gpio = <&tegra_aon_gpio TEGRA_AON_GPIO(T, 5) GPIO_ACTIVE_HIGH>;
gyro_irq_gpio = <&tegra_main_gpio TEGRA_AON_GPIO(T, 6) GPIO_ACTIVE_HIGH>;

I just tried and this compilation is unsuccessful.

hello DreamLan,

my bad… the marco should be TEGRA194_XXX_GPIO as you’re working with Xavier series.
see-also the header file for refernece, $public_sources/kernel_src/kernel/nvidia/include/dt-bindings/gpio/tegra194-gpio.h

note, I’ve revise my previous comments to avoid confusion.

With your modified parameters, you can compile successfully, thank you for your help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.