Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple framebuffer in device-tree

I have been trying to setup simple framebuffer on a device, and I am having problems with the device tree. Currently I have it setup pretty much as it is in the documentation:

chosen {
    #address-cells = <1>;
    #size-cells = <1>;

    framebuffer0: framebuffer@1817000
    {
            compatible = "simple-framebuffer";
            reg = <0x1817000 (1920*1080*4)>;
            width = <1920>;
            height = <1080>;
            stride = <(1920*4)>;
            format = "a8b8g8r8";
    };

};

During boot, the error I get is:

simple-framebuffer chosen:framebuffer@1817000: No memory resource
simple-framebuffer: probe of chosen:framebuffer@1817000 failed with error -22

From the simplefb code I see that it fails on the following:

  mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  if (!mem) {
          dev_err(&pdev->dev, "No memory resource\n");
          return -EINVAL;
  }

Several internet sources tell that IORESOURCE_MEM is the reg property, and it is defined so I am baffled about what could be wrong.

like image 505
sivu Avatar asked Sep 10 '26 12:09

sivu


1 Answers

I had a similar issue I added ranges; and status= "okay" and it worked for me. Zynq as well.

chosen {
    #address-cells = <0x1>;
    #size-cells = <0x1>;
    ranges;
    framebuffer0: framebuffer@1817000
    {
            compatible = "simple-framebuffer";
            reg = <0x1817000 (1920*1080*4)>;
            width = <1920>;
            height = <1080>;
            stride = <(1920*4)>;
            format = "a8b8g8r8";
            status = "okay"
    };

};
like image 149
lordofdaring Avatar answered Sep 14 '26 15:09

lordofdaring