Skip to content

Feature cm3 64 dev - #2147

Closed
Minipada wants to merge 1 commit into
raspberrypi:rpi-4.9.yfrom
synapticon:feature_cm3_64_dev
Closed

Minipada wants to merge 1 commit into
raspberrypi:rpi-4.9.yfrom
synapticon:feature_cm3_64_dev

Conversation

@Minipada

@Minipada Minipada commented Aug 4, 2017 •

Copy link
Copy Markdown

I am working on a CM3 64 bits OS. I manage to boot, the kernel log seems really promising. My only issue is it seems device tree overlays are ignored, for a reason I ignore. Because they are ignored, I cannot use pi3-disable-bt enabling to log in. Hence the message console [ttyS0] enabled is not displayed.

I think dtoverlays are ignored since adding overlay to use uart1 doesn't change any behavior.

The setup:

  • cmdline.txt: dwc_otg.lpm_enable=0 console=tty1 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait cma=128M@64M
  • config.txt:
    • enable_uart=1
    • dtoverlay=pi3-disable-bt
    • dtoverlay=vc4-kms-v3d
    • gpu_mem=16
    • device_tree=bcm2837-rpi-cm3.dtb (WIP)
    • core_freq=250

PS: I know it's a bit messy in the commits, I will merge when PR is done
Resolves #2133

@pelwell

pelwell commented Aug 4, 2017

Copy link
Copy Markdown
Contributor

I would be very surprised if the overlay is being ignored completely. I can't try anything until next week, but if you upload the output from dtc -I fs /proc/device-tree I may be able to figure out why it isn't working. For maximum helpfulness upload the output with and without the overlay applied, and the output from sudo vcdbg log msg 2>&1.

@pelwell

pelwell commented Aug 4, 2017

Copy link
Copy Markdown
Contributor

Don't worry about there being multiple commits - we can squash at merge time - but please ensure that all files end with carriage returns.

@Minipada

Minipada commented Aug 4, 2017

Copy link
Copy Markdown
Author

I thought I did, but I forgot to precise, I get this colored screen. There may be a setting for HDMI missing

@pelwell

pelwell commented Aug 4, 2017 •

Copy link
Copy Markdown
Contributor

You would normally run commands using ssh, but that is tricky if you don't know the IP address, and impossible if the kernel isn't running sufficiently.

One approach would be to add the required commands to /etc/rc.local, writing they output to files - assuming that it boots, of course.

@Minipada

Minipada commented Aug 7, 2017

Copy link
Copy Markdown
Author

Here is the log from dtc, I used the rc.local. It really seems only my overlay is loaded, nothing else

/dts-v1/;

/ {
  compatible = "brcm,bcm2837", "brcm,bcm2836";
  serial-number = "000000006de701e3";
  model = "Raspberry Pi Compute Module 3 Rev 1.0";
  memreserve = <0x37000000 0x8000000>;
  interrupt-parent = <0x1>;
  #address-cells = <0x1>;
  #size-cells = <0x1>;

  clocks {
    compatible = "simple-bus";
    #address-cells = <0x1>;
    #size-cells = <0x0>;

    clock@3 {
      compatible = "fixed-clock";
      #clock-cells = <0x0>;
      phandle = <0x3>;
      reg = <0x3>;
      clock-output-names = "osc";
      clock-frequency = <0x124f800>;
      linux,phandle = <0x3>;
    };

    clock@4 {
      compatible = "fixed-clock";
      #clock-cells = <0x0>;
      phandle = <0x13>;
      reg = <0x4>;
      clock-output-names = "otg";
      clock-frequency = <0x1c9c3800>;
      linux,phandle = <0x13>;
    };
  };

  __overrides__ {
    i2c1 = "", "", "", "\"status";
    i2c_vc = "", "", "", "!status";
    sd_overclock = "", "", "", "'brcm,overclock-50:0";
    i2c0_baudrate = "", "", "", "!clock-frequency:0";
    sd_pio_limit = "", "", "", "'brcm,pio-limit:0";
    act_led_trigger = "", "", "", "#linux,default-trigger";
    audio = "", "", "", "$status";
    sd_debug = "", "", "", "'brcm,debug";
    cache_line_size = [00 00 00 18 63 61 63 68 65 2d 6c 69 6e 65 2d 73 69 7a 65 3a 30 00];
    i2c1_baudrate = "", "", "", "\"clock-frequency:0";
    spi = "", "", "", " status";
    i2c_arm = "", "", "", "\"status";
    uart0 = [00 00 00 1d 73 74 61 74 75 73 00];
    i2c2_iknowwhatimdoing = [00 00 00 11 73 74 61 74 75 73 00];
    i2s = [00 00 00 1f 73 74 61 74 75 73 00];
    i2c0 = "", "", "", "!status";
    arm_freq = <0x19 0x636c6f63 0x6b2d6672 0x65717565 0x6e63793a 0x30000000 0x1a636c 0x6f636b2d 0x66726571 0x75656e63 0x793a3000 0x1b 0x636c6f63 0x6b2d6672 0x65717565 0x6e63793a 0x30000000 0x1c636c 0x6f636b2d 0x66726571 0x75656e63 0x793a3000>;
    watchdog = "", "", "", "%status";
    i2c_baudrate = "", "", "", "\"clock-frequency:0";
    i2c_vc_baudrate = "", "", "", "!clock-frequency:0";
    act_led_activelow = "", "", "", "#gpios:8";
    i2c2_baudrate = [00 00 00 11 63 6c 6f 63 6b 2d 66 72 65 71 75 65 6e 63 79 3a 30 00];
    sd_force_pio = "", "", "", "'brcm,force-pio?";
    uart1 = [00 00 00 1e 73 74 61 74 75 73 00];
    i2c_arm_baudrate = "", "", "", "\"clock-frequency:0";
    random = "", "", "", "&status";
    act_led_gpio = "", "", "", "#gpios:4";
    i2c = "", "", "", "\"status";
  };

  system {
    linux,serial = <0x0 0x6de701e3>;
    linux,revision = <0xa220a0>;
  };

  soc {
    compatible = "simple-bus";
    ranges = <0x7e000000 0x3f000000 0x1000000 0x40000000 0x40000000 0x40000>;
    #address-cells = <0x1>;
    #size-cells = <0x1>;
    dma-ranges = <0xc0000000 0x0 0x3f000000>;

    serial@7e201000 {
      compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell";
      clocks = <0x7 0x13 0x7 0x14>;
      clock-names = "uartclk", "apb_pclk";
      status = "okay";
      interrupts = <0x2 0x19>;
      phandle = <0x1d>;
      arm,primecell-periphid = <0x241011>;
      reg = <0x7e201000 0x1000>;
      linux,phandle = <0x1d>;
    };

    pixelvalve@7e207000 {
      compatible = "brcm,bcm2835-pixelvalve1";
      status = "disabled";
      interrupts = <0x2 0xe>;
      reg = <0x7e207000 0x100>;
    };

    cprman@7e101000 {
      compatible = "brcm,bcm2835-cprman";
      clocks = <0x3 0x4 0x0 0x4 0x1 0x4 0x2 0x5 0x0 0x5 0x1 0x5 0x2>;
      firmware = <0x6>;
      #clock-cells = <0x1>;
      phandle = <0x7>;
      reg = <0x7e101000 0x2000>;
      linux,phandle = <0x7>;
    };

    hvs@7e400000 {
      compatible = "brcm,bcm2835-hvs";
      status = "disabled";
      interrupts = <0x2 0x1>;
      reg = <0x7e400000 0x6000>;
    };

    gpio@7e200000 {
      compatible = "brcm,bcm2835-gpio";
      gpio-controller;
      #interrupt-cells = <0x2>;
      interrupts = <0x2 0x11 0x2 0x12>;
      phandle = <0xa>;
      reg = <0x7e200000 0xb4>;
      #gpio-cells = <0x2>;
      linux,phandle = <0xa>;
      interrupt-controller;

      i2c1 {
        brcm,pins = <0x2 0x3>;
        phandle = <0x10>;
        brcm,function = <0x4>;
        linux,phandle = <0x10>;
      };

      spi0_pins {
        brcm,pins = <0x9 0xa 0xb>;
        phandle = <0xb>;
        brcm,function = <0x4>;
        linux,phandle = <0xb>;
      };

      sdhost_pins {
        brcm,pins = <0x30 0x31 0x32 0x33 0x34 0x35>;
        phandle = <0x14>;
        brcm,pull = <0x0 0x2 0x2 0x2 0x2 0x2>;
        brcm,function = <0x4>;
        linux,phandle = <0x14>;
      };

      i2s {
        brcm,pins = <0x12 0x13 0x14 0x15>;
        phandle = <0x9>;
        brcm,function = <0x4>;
        linux,phandle = <0x9>;
      };

      audio_pins {
        brcm,pins;
        phandle = <0x16>;
        brcm,function;
        linux,phandle = <0x16>;
      };

      i2c0 {
        brcm,pins = <0x0 0x1>;
        phandle = <0xd>;
        brcm,function = <0x4>;
        linux,phandle = <0xd>;
      };

      spi0_cs_pins {
        brcm,pins = <0x8 0x7>;
        phandle = <0xc>;
        brcm,function = <0x1>;
        linux,phandle = <0xc>;
      };
    };

    pixelvalve@7e807000 {
      compatible = "brcm,bcm2835-pixelvalve2";
      status = "disabled";
      interrupts = <0x2 0xa>;
      reg = <0x7e807000 0x100>;
    };

    v3d@7ec00000 {
      power-domains = <0xf 0xa>;
      compatible = "brcm,vc4-v3d";
      status = "disabled";
      interrupts = <0x1 0xa>;
      reg = <0x7ec00000 0x1000>;
    };

    gpu {
      compatible = "brcm,bcm2835-vc4";
      status = "disabled";
    };

    mmc@7e300000 {
      compatible = "brcm,bcm2835-mmc";
      clocks = <0x7 0x1c>;
      status = "disabled";
      interrupts = <0x2 0x1e>;
      brcm,overclock-50 = <0x0>;
      dma-names = "rx-tx";
      reg = <0x7e300000 0x100>;
      dmas = <0x8 0xb>;
    };

    arm-pmu {
      compatible = "arm,armv8-pmuv3", "arm,cortex-a7-pmu";
      interrupt-parent = <0x2>;
      interrupts = <0x9>;
    };

    thermal {
      compatible = "brcm,bcm2835-thermal";
      firmware = <0x6>;
    };

    spi@7e204000 {
      compatible = "brcm,bcm2835-spi";
      clocks = <0x7 0x14>;
      status = "disabled";
      #address-cells = <0x1>;
      interrupts = <0x2 0x16>;
      cs-gpios = <0xa 0x8 0x1 0xa 0x7 0x1>;
      #size-cells = <0x0>;
      dma-names = "tx", "rx";
      phandle = <0x20>;
      reg = <0x7e204000 0x1000>;
      pinctrl-0 = <0xb 0xc>;
      dmas = <0x8 0x6 0x8 0x7>;
      linux,phandle = <0x20>;
      pinctrl-names = "default";

      spidev@1 {
        compatible = "spidev";
        #address-cells = <0x1>;
        #size-cells = <0x0>;
        reg = <0x1>;
        spi-max-frequency = <0x7a120>;
      };

      spidev@0 {
        compatible = "spidev";
        #address-cells = <0x1>;
        #size-cells = <0x0>;
        reg = <0x0>;
        spi-max-frequency = <0x7a120>;
      };
    };

    i2cdsi {
      compatible = "i2c-gpio";
      status = "disabled";
      #address-cells = <0x1>;
      #size-cells = <0x0>;

      bridge@45 {
        compatible = "raspberrypi,touchscreen-bridge-i2c";
        reg = <0x45>;
      };

      bridge@38 {
        compatible = "raspberrypi,touchscreen-ts-i2c";
        reg = <0x38>;
      };
    };

    vchiq {
      compatible = "brcm,bcm2835-vchiq";
      cache-line-size = <0x40>;
      firmware = <0x6>;
      interrupts = <0x0 0x2>;
      phandle = <0x18>;
      reg = <0x7e00b840 0xf>;
      linux,phandle = <0x18>;
    };

    i2c@7e804000 {
      compatible = "brcm,bcm2835-i2c";
      clocks = <0x7 0x14>;
      status = "disabled";
      #address-cells = <0x1>;
      interrupts = <0x2 0x15>;
      #size-cells = <0x0>;
      phandle = <0x22>;
      reg = <0x7e804000 0x1000>;
      clock-frequency = <0x186a0>;
      pinctrl-0 = <0x10>;
      linux,phandle = <0x22>;
      pinctrl-names = "default";
    };

    audio {
      brcm,pwm-channels = <0x8>;
      compatible = "brcm,bcm2835-audio";
      status = "disabled";
      phandle = <0x24>;
      pinctrl-0 = <0x16>;
      linux,phandle = <0x24>;
      pinctrl-names = "default";
    };

    i2s@7e203000 {
      compatible = "brcm,bcm2835-i2s";
      clocks = <0x7 0x1f>;
      #sound-dai-cells = <0x0>;
      status = "disabled";
      dma-names = "tx", "rx";
      phandle = <0x1f>;
      reg = <0x7e203000 0x24>;
      pinctrl-0 = <0x9>;
      dmas = <0x8 0x2 0x8 0x3>;
      linux,phandle = <0x1f>;
      pinctrl-names = "default";
    };

    mailbox@7e00b880 {
      compatible = "brcm,bcm2835-mbox";
      #mbox-cells = <0x0>;
      interrupts = <0x0 0x1>;
      phandle = <0x15>;
      reg = <0x7e00b880 0x40>;
      linux,phandle = <0x15>;
    };

    gpiomem {
      compatible = "brcm,bcm2835-gpiomem";
      reg = <0x7e200000 0x1000>;
    };

    vec@7e806000 {
      compatible = "brcm,bcm2835-vec";
      clocks = <0x7 0x18>;
      status = "disabled";
      interrupts = <0x2 0x1b>;
      reg = <0x7e806000 0x1000>;
    };

    power {
      compatible = "raspberrypi,bcm2835-power";
      firmware = <0x6>;
      phandle = <0xf>;
      linux,phandle = <0xf>;
      #power-domain-cells = <0x1>;
    };

    pixelvalve@7e206000 {
      compatible = "brcm,bcm2835-pixelvalve0";
      status = "disabled";
      interrupts = <0x2 0xd>;
      reg = <0x7e206000 0x100>;
    };

    firmware {
      compatible = "raspberrypi,bcm2835-firmware";
      mboxes = <0x15>;
      phandle = <0x6>;
      linux,phandle = <0x6>;
    };

    dsi@7e209000 {
      compatible = "brcm,bcm2835-dsi0";
      clocks = <0x7 0x20 0x7 0x2f 0x7 0x31>;
      clock-names = "phy", "escape", "pixel";
      status = "disabled";
      #address-cells = <0x1>;
      interrupts = <0x2 0x4>;
      #size-cells = <0x0>;
      #clock-cells = <0x1>;
      phandle = <0x4>;
      reg = <0x7e209000 0x78>;
      clock-output-names = "dsi0_byte", "dsi0_ddr2", "dsi0_ddr";
      linux,phandle = <0x4>;
    };

    fb {
      compatible = "brcm,bcm2708-fb";
      firmware = <0x6>;
      status = "okay";
    };

    sdhost@7e202000 {
      compatible = "brcm,bcm2835-sdhost";
      clocks = <0x7 0x14>;
      brcm,pio-limit = <0x1>;
      status = "okay";
      interrupts = <0x2 0x18>;
      brcm,overclock-50 = <0x0>;
      bus-width = <0x4>;
      dma-names = "rx-tx";
      phandle = <0x27>;
      reg = <0x7e202000 0x100>;
      pinctrl-0 = <0x14>;
      dmas = <0x8 0xd>;
      linux,phandle = <0x27>;
      non-removable;
      pinctrl-names = "default";
    };

    virtgpio {
      compatible = "brcm,bcm2835-virtgpio";
      gpio-controller;
      firmware = <0x6>;
      status = "okay";
      phandle = <0x17>;
      #gpio-cells = <0x2>;
      linux,phandle = <0x17>;
    };

    dpi@7e208000 {
      compatible = "brcm,bcm2835-dpi";
      clocks = <0x7 0x14 0x7 0x2c>;
      clock-names = "core", "pixel";
      status = "disabled";
      #address-cells = <0x1>;
      #size-cells = <0x0>;
      reg = <0x7e208000 0x8c>;
    };

    expgpio {
      compatible = "brcm,bcm2835-expgpio";
      gpio-controller;
      firmware = <0x6>;
      status = "okay";
      phandle = <0x12>;
      #gpio-cells = <0x2>;
      linux,phandle = <0x12>;
    };

    hdmi@7e902000 {
      power-domains = <0xf 0x5>;
      compatible = "brcm,bcm2835-hdmi";
      clocks = <0x7 0x10 0x7 0x19>;
      clock-names = "pixel", "hdmi";
      ddc = <0x11>;
      status = "disabled";
      interrupts = <0x2 0x8 0x2 0x9>;
      dma-names = "audio-rx";
      hpd-gpios = <0x12 0x0 0x1>;
      reg = <0x7e902000 0x600 0x7e808000 0x100>;
      dmas = <0x8 0x11>;
    };

    timer {
      compatible = "arm,armv8-timer", "arm,armv7-timer";
      always-on;
      interrupt-parent = <0x2>;
      interrupts = <0x0 0x1 0x3 0x2>;
    };

    pwm@7e20c000 {
      compatible = "brcm,bcm2835-pwm";
      clocks = <0x7 0x1e>;
      status = "disabled";
      assigned-clock-rates = <0x989680>;
      assigned-clocks = <0x7 0x1e>;
      reg = <0x7e20c000 0x28>;
      #pwm-cells = <0x2>;
    };

    watchdog@7e100000 {
      compatible = "brcm,bcm2835-pm-wdt";
      phandle = <0x25>;
      reg = <0x7e100000 0x28>;
      linux,phandle = <0x25>;
    };

    interrupt-controller@7e00b200 {
      compatible = "brcm,bcm2836-armctrl-ic";
      #interrupt-cells = <0x2>;
      interrupt-parent = <0x2>;
      interrupts = <0x8>;
      phandle = <0x1>;
      reg = <0x7e00b200 0x200>;
      linux,phandle = <0x1>;
      interrupt-controller;
    };

    local_intc {
      compatible = "brcm,bcm2836-l1-intc";
      #interrupt-cells = <0x1>;
      interrupt-parent = <0x2>;
      phandle = <0x2>;
      reg = <0x40000000 0x100>;
      linux,phandle = <0x2>;
      interrupt-controller;
    };

    dsi@7e700000 {
      power-domains = <0xf 0x12>;
      compatible = "brcm,bcm2835-dsi1";
      clocks = <0x7 0x23 0x7 0x30 0x7 0x32>;
      clock-names = "phy", "escape", "pixel";
      status = "disabled";
      #address-cells = <0x1>;
      interrupts = <0x2 0xc>;
      #size-cells = <0x0>;
      #clock-cells = <0x1>;
      phandle = <0x5>;
      reg = <0x7e700000 0x8c>;
      clock-output-names = "dsi1_byte", "dsi1_ddr2", "dsi1_ddr";
      linux,phandle = <0x5>;
    };

    sound {
      status = "disabled";
    };

    i2c@7e205000 {
      compatible = "brcm,bcm2835-i2c";
      clocks = <0x7 0x14>;
      status = "disabled";
      #address-cells = <0x1>;
      interrupts = <0x2 0x15>;
      #size-cells = <0x0>;
      phandle = <0x21>;
      reg = <0x7e205000 0x1000>;
      clock-frequency = <0x186a0>;
      pinctrl-0 = <0xd>;
      linux,phandle = <0x21>;
      pinctrl-names = "default";
    };

    serial@7e215040 {
      compatible = "brcm,bcm2835-aux-uart";
      clocks = <0xe 0x0>;
      status = "disabled";
      interrupt-parent = <0xe>;
      interrupts = <0x0>;
      phandle = <0x1e>;
      reg = <0x7e215040 0x40>;
      linux,phandle = <0x1e>;
    };

    dma@7e007000 {
      #dma-cells = <0x1>;
      compatible = "brcm,bcm2835-dma";
      brcm,dma-channel-mask = <0x7f34>;
      interrupts = <0x1 0x10 0x1 0x11 0x1 0x12 0x1 0x13 0x1 0x14 0x1 0x15 0x1 0x16 0x1 0x17 0x1 0x18 0x1 0x19 0x1 0x1a 0x1 0x1b 0x1 0x1b 0x1 0x1b 0x1 0x1b 0x1 0x1c>;
      phandle = <0x8>;
      reg = <0x7e007000 0xf00>;
      linux,phandle = <0x8>;
      interrupt-names = "dma0", "dma1", "dma2", "dma3", "dma4", "dma5", "dma6", "dma7", "dma8", "dma9", "dma10", "dma11", "dma12", "dma13", "dma14", "dma-shared-all";
    };

    i2c@7e805000 {
      compatible = "brcm,bcm2835-i2c";
      clocks = <0x7 0x14>;
      status = "disabled";
      #address-cells = <0x1>;
      interrupts = <0x2 0x15>;
      #size-cells = <0x0>;
      phandle = <0x11>;
      reg = <0x7e805000 0x1000>;
      clock-frequency = <0x186a0>;
      linux,phandle = <0x11>;
    };

    spi@7e215080 {
      compatible = "brcm,bcm2835-aux-spi";
      clocks = <0xe 0x1>;
      status = "disabled";
      interrupt-parent = <0xe>;
      #address-cells = <0x1>;
      interrupts = <0x1>;
      #size-cells = <0x0>;
      reg = <0x7e215080 0x40>;
    };

    aux@0x7e215000 {
      compatible = "brcm,bcm2835-aux";
      clocks = <0x7 0x14>;
      #interrupt-cells = <0x1>;
      interrupts = <0x1 0x1d>;
      #clock-cells = <0x1>;
      phandle = <0xe>;
      reg = <0x7e215000 0x8>;
      linux,phandle = <0xe>;
      interrupt-controller;
    };

    firmwarekms@7e600000 {
      compatible = "raspberrypi,rpi-firmware-kms";
      status = "disabled";
      interrupts = <0x2 0x10>;
      brcm,firmware = <0x6>;
      reg = <0x7e600000 0x100>;
    };

    rng@7e104000 {
      compatible = "brcm,bcm2835-rng";
      phandle = <0x26>;
      reg = <0x7e104000 0x10>;
      linux,phandle = <0x26>;
    };

    syscon@40000000 {
      compatible = "brcm,bcm2836-arm-local", "syscon";
      reg = <0x40000000 0x100>;
    };

    usb@7e980000 {
      power-domains = <0xf 0x6>;
      compatible = "brcm,bcm2708-usb";
      clocks = <0x13>;
      clock-names = "otg";
      #address-cells = <0x1>;
      interrupts = <0x2 0x0 0x1 0x9>;
      #size-cells = <0x0>;
      reg = <0x7e980000 0x10000 0x7e006000 0x1000>;
    };

    smi@7e600000 {
      compatible = "brcm,bcm2835-smi";
      clocks = <0x7 0x2a>;
      status = "disabled";
      interrupts = <0x2 0x10>;
      assigned-clock-rates = <0x7735940>;
      dma-names = "rx-tx";
      assigned-clocks = <0x7 0x2a>;
      reg = <0x7e600000 0x100>;
      dmas = <0x8 0x4>;
    };

    spi@7e2150c0 {
      compatible = "brcm,bcm2835-aux-spi";
      clocks = <0xe 0x2>;
      status = "disabled";
      interrupt-parent = <0xe>;
      #address-cells = <0x1>;
      interrupts = <0x2>;
      #size-cells = <0x0>;
      reg = <0x7e2150c0 0x40>;
    };
  };

  leds {
    compatible = "gpio-leds";

    act {
      gpios = <0x17 0x0 0x0>;
      label = "led0";
      phandle = <0x23>;
      linux,phandle = <0x23>;
      linux,default-trigger = "mmc0";
    };
  };

  aliases {
    intc = "/soc/interrupt-controller@7e00b200";
    spi2 = "/soc/spi@7e2150c0";
    i2c1 = "/soc/i2c@7e804000";
    i2c_vc = "/soc/i2c@7e205000";
    spi0 = "/soc/spi@7e204000";
    thermal = "/soc/thermal";
    vchiq = "/soc/vchiq";
    sdhost = "/soc/sdhost@7e202000";
    aux = "/soc/aux@0x7e215000";
    gpio = "/soc/gpio@7e200000";
    audio = "/soc/audio";
    dma = "/soc/dma@7e007000";
    soc = "/soc";
    leds = "/leds";
    mmc = "/soc/mmc@7e300000";
    serial1 = "/soc/serial@7e215040";
    i2c_arm = "/soc/i2c@7e804000";
    uart0 = "/soc/serial@7e201000";
    fb = "/soc/fb";
    i2c2 = "/soc/i2c@7e805000";
    i2s = "/soc/i2s@7e203000";
    spi1 = "/soc/spi@7e215080";
    usb = "/soc/usb@7e980000";
    i2c0 = "/soc/i2c@7e205000";
    watchdog = "/soc/watchdog@7e100000";
    sound = "/soc/sound";
    mailbox = "/soc/mailbox@7e00b880";
    uart1 = "/soc/serial@7e215040";
    random = "/soc/rng@7e104000";
    i2c = "/soc/i2c@7e804000";
    serial0 = "/soc/serial@7e201000";
  };

  chosen {
    bootargs = "bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2708_fb.fbswap=1 smsc95xx.macaddr=B8:27:EB:E7:01:E3 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=tty1 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait cma=128M@64M";
    kaslr-seed = <0x0 0x0>;
  };

  memory {
    device_type = "memory";
    reg = <0x0 0x37000000>;
  };

  fixedregulator_3v3 {
    compatible = "regulator-fixed";
    regulator-min-microvolt = <0x325aa0>;
    regulator-max-microvolt = <0x325aa0>;
    regulator-always-on;
    regulator-name = "3v3";
  };

  cpus {
    #address-cells = <0x1>;
    #size-cells = <0x0>;

    cpu@3 {
      compatible = "arm,cortex-a53", "arm,armv8";
      cpu-release-addr = <0x0 0xf0>;
      device_type = "cpu";
      enable-method = "spin-table";
      phandle = <0x1c>;
      reg = <0x3>;
      clock-frequency = <0x35a4e900>;
      linux,phandle = <0x1c>;
    };

    cpu@1 {
      compatible = "arm,cortex-a53", "arm,armv8";
      cpu-release-addr = <0x0 0xe0>;
      device_type = "cpu";
      enable-method = "spin-table";
      phandle = <0x1a>;
      reg = <0x1>;
      clock-frequency = <0x35a4e900>;
      linux,phandle = <0x1a>;
    };

    cpu@2 {
      compatible = "arm,cortex-a53", "arm,armv8";
      cpu-release-addr = <0x0 0xe8>;
      device_type = "cpu";
      enable-method = "spin-table";
      phandle = <0x1b>;
      reg = <0x2>;
      clock-frequency = <0x35a4e900>;
      linux,phandle = <0x1b>;
    };

    cpu@0 {
      compatible = "arm,cortex-a53", "arm,armv8";
      device_type = "cpu";
      phandle = <0x19>;
      reg = <0x0>;
      clock-frequency = <0x35a4e900>;
      linux,phandle = <0x19>;
    };
  };

  fixedregulator_5v0 {
    compatible = "regulator-fixed";
    regulator-min-microvolt = <0x4c4b40>;
    regulator-max-microvolt = <0x4c4b40>;
    regulator-always-on;
    regulator-name = "5v0";
  };
};

@Minipada

Minipada commented Sep 8, 2017

Copy link
Copy Markdown
Author

I just got back to work on it. Sorry if this seems newbie explanation but I don't have any experience on this topic and any help is much appreciated.
I digged into it, it seems rpi-3-b has all peripherals with which I have issues imported from bcm2835-rpi.dtsi. From the log and the previous explanation, I deducted my device tree is not loaded by the CM3.
I started from scratch but I don't understand why. The chip on the rpi 3 and cm3 is the same. IO definition changes of course but the device tree itself should be loaded, even using the bcm2837-rpi-3-b on the CM3, which is not happening.

I guess I'm missing something important but the first step would be to actually be able to load the bcm2837-rpi-3-b on the CM3, whatever the result, no?

@pelwell

pelwell commented Sep 8, 2017

Copy link
Copy Markdown
Contributor

The firmware chooses which .dtb to load for the current platform based on the revision number. By default it will use bcm27*.dtb, i.e. downstream DTBs. You are wanting it to load bcm28*.dtb - an upstream DTB. There are two ways to request this:

  1. Use the mkknlimg utility in the kernel scripts directory to add a trailer. It ought to figure out that the kernel is an upstream build but, if not, use the --283x option to force it. The firmware will look for and read the trailer, then load the appropriate upstream DTB. An upstream DTB for a CM3 would be called bcm2837-rpi-cm3.dtb, but the source for that option doesn't currently exist in the kernel tree.
  2. Use the device_tree= directive to hard-code which DTB to load. In your case you would use:
device_tree=bcm2837-rpi-cm3.dtb

This mechanism allows you to load any DTB you choose.

@Minipada

Minipada commented Sep 8, 2017

Copy link
Copy Markdown
Author

Thanks for the explanation. Now I can force the loading, but would you have any idea why bcm2837-rpi-3-b is loaded on the rpi3 while it's not on the cm3?

@pelwell

pelwell commented Sep 8, 2017

Copy link
Copy Markdown
Contributor

Because the revision code tells the firmware that a CM3 is a CM3, not a Pi 3 B.

@Minipada

Minipada commented Sep 12, 2017 •

Copy link
Copy Markdown
Author

Thank you! I'm making progress and am now stumbling across the issue that the kernel command line is set to:

bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2708_fb.fbswap=1 
vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  dwc_otg.lpm_enable=0 
console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 
elevator=deadline fsck.repair=yes rootwait cma=128

My cmdline.txt:
dwc_otg.lpm_enable=0 console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait cma=128

It seems the enable_uart=1 in the config.txt is not loaded:

device_tree=bcm2710-rpi-cm3.dtb
device_tree=bcm2837-rpi-cm3.dtb
dtoverlay=vc4-kms-v3d

gpu_mem=128
arm_freq=1150
core_freq=250
sdram_freq=450
enable_uart=1
dtoverlay=pi3-disable-bt
arm_control=0x200

This and the cma value in the cmdline.txt. Here is the kernel log:

[    0.000000] cma: Reserved 4 MiB at 0x0000000037c00000

Also, I know that having arm_control=0x200 should print on the kernel log:
hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available. It really means the config.txt has some parts not being able to be loaded.
From my understanding, the bootloader cares about this, not the kernel. I hope I gave enough details.

Thanks

@Minipada

Minipada commented Oct 6, 2017

Copy link
Copy Markdown
Author

@pelwell I have edited my commits.
Status now is I have the serial IF I use mypiandrew's workaround with unswap in #1913. I still need to work on I2C/SPI and refactor the work. I just want to reach a working state before doing so.

PS: Thanks for your previous explanations, it took some time to understand everything but it helped a lot

@pbrkr

pbrkr commented Oct 25, 2017

Copy link
Copy Markdown
Contributor

+1 on this, it would be excellent to get this merged as it would allow us to support the CM3 in 64-bit mode in OpenEmbedded.

@Minipada

Copy link
Copy Markdown
Author

For info, I made it pass some test:

  • memtester
  • tynimembench
  • sysbench
  • stress

and results were as good as on the raspberrypi3 in 64 bits. It's going to be soon integrated in a robot, it'll endure some more tests

endif

dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rpi-3-b.dtb
dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rpi-cm3.dtb

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'll want this Makefile to generate both bcm2837-rpi-3-b.dtb and bcm2837-rpi-cm3.dtb, rather than disabling bcm2837-rpi-3-b.dtb?
For comparison, see https://github.com/raspberrypi/linux/blob/rpi-4.9.y/arch/arm64/boot/dts/broadcom/Makefile and https://github.com/raspberrypi/linux/blob/rpi-4.9.y/arch/arm/boot/dts/Makefile

At this stay everything seems loaded except the CMA variable in the config.txt and the UART.
Using this commit, ttyS0 works using mypiandrew's workaround with unswap in #1913 .
@Minipada

Minipada commented Jul 27, 2018 •

Copy link
Copy Markdown
Author

At this stay everything seems loaded except the CMA variable in the config.txt and the UART.
Using this commit, ttyS0 works using mypiandrew's workaround with unswap in #1913 .

I got to a working state by tinkering, I'm no kernel expert and a deeper review would be greatly appreciated.

@Minipada Minipada closed this Jan 22, 2019
popcornmix pushed a commit that referenced this pull request Dec 31, 2020
[ Upstream commit 0405f94 ]

Removing the meson-dw-hdmi module results in the following splat:

i[   43.340509] WARNING: CPU: 0 PID: 572 at drivers/regulator/core.c:2125 _regulator_put.part.0+0x16c/0x174
[...]
[   43.454870] CPU: 0 PID: 572 Comm: modprobe Tainted: G        W   E     5.10.0-rc4-00049-gd274813a4de3-dirty #2147
[   43.465042] Hardware name:  , BIOS 2021.01-rc2-00012-gde865f7ee1 11/16/2020
[   43.471945] pstate: 80400009 (Nzcv daif +PAN -UAO -TCO BTYPE=--)
[   43.477896] pc : _regulator_put.part.0+0x16c/0x174
[   43.482638] lr : regulator_put+0x44/0x60
[...]
[   43.568715] Call trace:
[   43.571132]  _regulator_put.part.0+0x16c/0x174
[   43.575529]  regulator_put+0x44/0x60
[   43.579067]  devm_regulator_release+0x20/0x2c
[   43.583380]  release_nodes+0x1c8/0x2b4
[   43.587087]  devres_release_all+0x44/0x6c
[   43.591056]  __device_release_driver+0x1a0/0x23c
[   43.595626]  driver_detach+0xcc/0x160
[   43.599249]  bus_remove_driver+0x68/0xe0
[   43.603130]  driver_unregister+0x3c/0x6c
[   43.607011]  platform_driver_unregister+0x20/0x2c
[   43.611678]  meson_dw_hdmi_platform_driver_exit+0x18/0x4a8 [meson_dw_hdmi]
[   43.618485]  __arm64_sys_delete_module+0x1bc/0x294

as the HDMI regulator is still enabled on release.

In order to address this, register a callback that will deal with
the disabling when the driver is unbound, solving the problem.

Fixes: 161a803 ("drm/meson: dw_hdmi: Add support for an optional external 5V regulator")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201116200744.495826-4-maz@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants