Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Help with device tree overlays on RPI



try 'dtoverlay=thorpej-RPI-NixieClock.dtbo' in your config file instead of 'dtoverlay=thorpej-RPI-NixieClock'

Le 2018-11-12 16:05, Jason Thorpe a écrit :
I'm trying to use a device tree overlay for a hardware project I'm
working on, that will be used with a Raspberry Pi B+ (at least
initially).  I'm using a tweaked rpi-mkknlimg.sh from skrll@ that adds
the DDTK dynamic device tree tag, and Linux's knlinfo is happy with
it:

thorpej-mbp13:thorpej$ perl ../knlinfo netbsd.img
Kernel trailer found at 5966892/0x5b0c2c:
  DDTK: y
  DTOK: y
  283x: y
thorpej-mbp13:thorpej$

/boot/config.txt:

# UART settings, see
https://www.raspberrypi.org/documentation/configuration/uart.md
enable_uart=1
force_turbo=0

dtdebug=1
dtoverlay=thorpej-RPI-NixieClock


...and /boot/overlays/thorpej-RPI-NixieClock.dtbo is there.

Basically, the symptom is that the overlay doesn't show up in the
converged FDT at all.  I've tried other overlays from 3rd parties, and
they don't seem to load, either.  Of course, it's not possible
currently to get the VC logs because we don't have the "vcdbg" tool.

Any ideas how I can go about debugging this problem without the VC
logs?  Here is my .dts file for the overlay:

// #include <dt-bindings/pinctrl/bcm2835.h>
// #include <dt-bindings/gpio/gpio.h>
// #include <dt-bindings/input/linux-event-codes.h>

/*
 * Device tree overlay for my Nixie clock.
 */
/dts-v1/;
/plugin/;
/ {
        compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";

        /*
         * i2c devices:
         *
         *      - DS3231 real-time clock
         *      - TSL2561 ambient light sensor
         *      - PCA9685 PWM LED controller
         */
        fragment@0 {
                target = <&i2c1>;

                __overlay__ {
                        #address-cells = <1>;
                        #size-cells = <0>;

                        light-sensor@39 {
                                compatible = "amstaos,tsl2561";
                                reg = <0x39>;
                        };

                        pwm@41 {
                                compatible = "nxp,pca9685";
                                reg = <0x41>;
                        };

                        rtc@68 {
                                compatible = "dallas,ds3231";
                                reg = <0x68>;
                        };
                };
        };

        /*
         * Clock controls:
         *
         *      Rotary encoder:
         *              - "Up"                  0
         *              - "Down"                2
         *              - "Enter"               3
         *      - Snooze button                 4
         *      - Alarm-set button              5
         *      - Alarm-off-for-today button    6
         *      - Alarm on/off switch           27
         *      - Setup mode switch             25
         */
        nixie_clock_control_pins: nixie-clock-control-pins {
                brcm,pins = <0 2 3 4 5 6 25 27>;
                brcm,function = <0 /*BCM2835_FSEL_GPIO_IN*/>;
                brcm,pull = <2 /*BCM2835_PUD_UP*/>;
        };

        nixie-clock-controls {
                compatible = "gpio-keys";

                pinctrl-names = "default";
                pinctrl-0 = <&nixie_clock_control_pins>;

                up-button {
                        label = "up";
                        linux,code = <103 /*KEY_UP*/>;
                        gpios = <&gpio 0 1 /*GPIO_ACTIVE_LOW*/>;
                };

                down-button {
                        label = "down";
                        linux,code = <108 /*KEY_DOWN*/>;
                        gpios = <&gpio 2 1 /*GPIO_ACTIVE_LOW*/>;
                };

                enter-button {
                        label = "enter";
                        linux,code = <28 /*KEY_ENTER*/>;
                        gpios = <&gpio 3 1 /*GPIO_ACTIVE_LOW*/>;
                };

                snooze-button {
                        label = "snooze";
                        linux,code = <31 /*KEY_S*/>;
                        gpios = <&gpio 4 1 /*GPIO_ACTIVE_LOW*/>;
                };

                alarm-set-button {
                        label = "alarm-set";
                        linux,code = <0x167 /*KEY_TIME*/>;
                        gpios = <&gpio 5 1 /*GPIO_ACTIVE_LOW*/>;
                };

                awake-button {
                        label = "awake";
                        linux,code = <113 /*KEY_MUTE*/>;
                        gpios = <&gpio 6 1 /*GPIO_ACTIVE_LOW*/>;
                };

                alarm-enable-switch {
                        label = "alarm-on-off";
                        linux,code = <30 /*KEY_A*/>;
                        gpios = <&gpio 27 1 /*GPIO_ACTIVE_LOW*/>;
                };

                setup-mode-switch {
                        label = "setup-mode";
                        linux,code = <141 /*KEY_SETUP*/>;
                        gpios = <&gpio 25 1 /*GPIO_ACTIVE_LOW*/>;
                };
        };
};

-- thorpej


Home | Main Index | Thread Index | Old Index