Skip to content

ARM: bcm2708: overlay to set cma to 128M@128M #1431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

msperl
Copy link
Contributor

@msperl msperl commented Apr 24, 2016

Added overlay to set cma-boot parameter to 128M@128M.

This may be most helpful for system with 512MB when running vc4-kms

Signed-off-by: Martin Sperl [email protected]

Added overlay to set cma-boot parameter to 128M@128M.

This may be most helpful for system with 512MB when running vc4-kms

Signed-off-by: Martin Sperl <[email protected]>
@popcornmix
Copy link
Collaborator

@pelwell I guess we should support arbitrary cma settings as dt parameters (which may require firmware changes).

@pelwell
Copy link
Contributor

pelwell commented Apr 24, 2016

String manipulation would require firmware changes, but there is a new mechanism in the most recent firmware releases (kernel 4.1.21 - dea25fa - and later). An overlay can include both active and inactive fragments - an inactive fragment has a __dormant__ node where an active one would have __overlay__. There is a new syntax to control the activation of fragments that I've called "overlay" overrides, because they don't just modify a single property.

Recall that a DT parameter declaration is a sequence of <phandle>, "<property-name><options>" pairs. Overlay overrides are indicated with a phandle of zero, and a string containing a list of directives. So far the directives all control the activation of fragments:

+n  Activate fragment n
-n  Dectivate fragment n
=n  Activate fragment n if the parameter value is true (on, yes, etc.),
    otherwise deactivate it
!n  Activate fragment n if the parameter value is false (off, no, etc.),
    otherwise deactivate it

For example:

fragment@0 {
    target-path = "/chosen";
    __overlay__ {
        bootargs = "cma=256M@256M";
    };
};

fragment@1 {
    target-path = "/chosen";
    __dormant__ {
        bootargs = "cma=128M@128M";
    };
};

__overrides__ {
    cma_256_256 = <0>, "+0-1";
    cma_128_128 = <0>, "+1-0";
};

Here the parameter values are ignored, but the i2c-rtc overlay could be rewritten this way with each RTC declaration in its own fragment and using:

// fragment 1 = ds1307
// fragment 2 = ds1339
// fragment 3 = ds3231
// fragment 4 = pcf2127

ds1307 = <0>,"=1!2!3";
ds1339 = <0>,"=2!1!3";
ds1339 = <0>,"=3!1!2";
pcf2127 = <0>,"=4";
...

and

dtoverlay=i2c-rtc,ds1307=on,ds1339=off,pcf2127=off

The usage here is slightly contrived because you don't need to allow the explicit offs, but the negation has allowed us to marek the three DS RTCs as being mutually exclusive (they all use address 0x68).

Although this structure would make the i2c-rtc overlay file larger, because inactive fragments aren't merged the resulting DTB is smaller and cleaner.

Old firmware will automatically ignore __dormant__ fragments, and the zero phandle will be treated as the end of the parameter declaration, so provided you don't put property overrides after overlay overrides in the same parameter declaration and you choose the default activation states to be sensible then adding this new syntax should be harmless to users who haven't upgraded.

@msperl
Copy link
Contributor Author

msperl commented Apr 24, 2016

I will leave it up to you - in principle it is a problem during migration, as I assume that when we have completely switched to kms then these settings will go into the board-specific dts...

I will leave it as is and up to you to decide how you want to manage this in the meantime.

@pelwell
Copy link
Contributor

pelwell commented Apr 24, 2016

On the subject of changes in DT parameter handling, I've also recently removed the restriction that integer parameters may not create or extend and existing property.

@pelwell
Copy link
Contributor

pelwell commented Apr 24, 2016

I'll create a new PR with vc4-kms-v3d parameters for a few CMA positions and sizes, to give people a chance to comment.

pelwell pushed a commit to pelwell/linux that referenced this pull request Apr 24, 2016
Example: dtoverlay=vc4-kms-v3d,cma-128

See: raspberrypi#1431

Signed-off-by: Phil Elwell <[email protected]>
@pelwell
Copy link
Contributor

pelwell commented Apr 24, 2016

New pull request at #1434.

@pelwell
Copy link
Contributor

pelwell commented Apr 25, 2016

Superseded by #1434, which is now merged.

@pelwell pelwell closed this Apr 25, 2016
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Apr 30, 2016
See: raspberrypi/linux#1257

kernel: backport commits to fix Ad Hoc mode
See: raspberrypi/linux#1384

kernel: BCM270X_DT: Sound DT adjustments for Dynamic DT

kernel: dts: add overlay for pitft22
See: https://github.com/adafruit/Adafruit-Pi-Kernel-o-Matic

kernel: drm/vc4: Add DT parameters to control CMA usage
See: raspberrypi/linux#1431

kernel: ARM: bcm2835: add i2s-gpio28-31 for cm
See: raspberrypi/linux#1430
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Apr 30, 2016
See: raspberrypi/linux#1257

kernel: backport commits to fix Ad Hoc mode
See: raspberrypi/linux#1384

kernel: BCM270X_DT: Sound DT adjustments for Dynamic DT

kernel: dts: add overlay for pitft22
See: https://github.com/adafruit/Adafruit-Pi-Kernel-o-Matic

kernel: drm/vc4: Add DT parameters to control CMA usage
See: raspberrypi/linux#1431

kernel: ARM: bcm2835: add i2s-gpio28-31 for cm
See: raspberrypi/linux#1430
XECDesign pushed a commit to RPi-Distro/firmware that referenced this pull request May 4, 2016
See: raspberrypi/linux#1257

kernel: backport commits to fix Ad Hoc mode
See: raspberrypi/linux#1384

kernel: BCM270X_DT: Sound DT adjustments for Dynamic DT

kernel: dts: add overlay for pitft22
See: https://github.com/adafruit/Adafruit-Pi-Kernel-o-Matic

kernel: drm/vc4: Add DT parameters to control CMA usage
See: raspberrypi/linux#1431

kernel: ARM: bcm2835: add i2s-gpio28-31 for cm
See: raspberrypi/linux#1430
popcornmix pushed a commit that referenced this pull request May 31, 2016
Example: dtoverlay=vc4-kms-v3d,cma-128

See: #1431

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Jun 21, 2016
Example: dtoverlay=vc4-kms-v3d,cma-128

See: #1431

Signed-off-by: Phil Elwell <[email protected]>
popcornmix pushed a commit that referenced this pull request Jun 26, 2016
Example: dtoverlay=vc4-kms-v3d,cma-128

See: #1431

Signed-off-by: Phil Elwell <[email protected]>
ColinIanKing pushed a commit to ColinIanKing/ubuntu-xenial that referenced this pull request Oct 28, 2016
Example: dtoverlay=vc4-kms-v3d,cma-128

See: raspberrypi/linux#1431

Signed-off-by: Phil Elwell <[email protected]>
angyalp pushed a commit to angyalp/kernel_rpi that referenced this pull request Dec 19, 2016
Example: dtoverlay=vc4-kms-v3d,cma-128

See: raspberrypi#1431

Signed-off-by: Phil Elwell <[email protected]>
tabp0le pushed a commit to tabp0le/ubuntu_xenial_kernel that referenced this pull request Dec 22, 2016
Example: dtoverlay=vc4-kms-v3d,cma-128

See: raspberrypi/linux#1431

Signed-off-by: Phil Elwell <[email protected]>
perfecto-devops pushed a commit to perfecto-devops/ubuntu-xenial that referenced this pull request Feb 2, 2017
Example: dtoverlay=vc4-kms-v3d,cma-128

See: raspberrypi/linux#1431

Signed-off-by: Phil Elwell <[email protected]>
Noltari pushed a commit to Noltari/linux that referenced this pull request Feb 6, 2017
Example: dtoverlay=vc4-kms-v3d,cma-128

See: raspberrypi/linux#1431

Signed-off-by: Phil Elwell <[email protected]>
neuschaefer pushed a commit to neuschaefer/raspi-binary-firmware that referenced this pull request Feb 27, 2017
See: raspberrypi/linux#1257

kernel: backport commits to fix Ad Hoc mode
See: raspberrypi/linux#1384

kernel: BCM270X_DT: Sound DT adjustments for Dynamic DT

kernel: dts: add overlay for pitft22
See: https://github.com/adafruit/Adafruit-Pi-Kernel-o-Matic

kernel: drm/vc4: Add DT parameters to control CMA usage
See: raspberrypi/linux#1431

kernel: ARM: bcm2835: add i2s-gpio28-31 for cm
See: raspberrypi/linux#1430
JackieLiu1 pushed a commit to JackieLiu1/kernel that referenced this pull request Mar 23, 2017
Example: dtoverlay=vc4-kms-v3d,cma-128

See: raspberrypi/linux#1431

Signed-off-by: Phil Elwell <[email protected]>
woshihuangzhijie pushed a commit to woshihuangzhijie/linuxcode that referenced this pull request Sep 20, 2017
Example: dtoverlay=vc4-kms-v3d,cma-128

See: raspberrypi/linux#1431

Signed-off-by: Phil Elwell <[email protected]>
amichelotti pushed a commit to amichelotti/ubuntu-vme-xenial that referenced this pull request Oct 19, 2017
Example: dtoverlay=vc4-kms-v3d,cma-128

See: raspberrypi/linux#1431

Signed-off-by: Phil Elwell <[email protected]>
lianhaidong pushed a commit to lianhaidong/ubuntu-xenial that referenced this pull request Nov 6, 2017
Example: dtoverlay=vc4-kms-v3d,cma-128

See: raspberrypi/linux#1431

Signed-off-by: Phil Elwell <[email protected]>
liuqun pushed a commit to liuqun/linux-raspi2 that referenced this pull request Dec 14, 2017
Example: dtoverlay=vc4-kms-v3d,cma-128

See: raspberrypi/linux#1431

Signed-off-by: Phil Elwell <[email protected]>
liuqun pushed a commit to liuqun/linux-raspi2 that referenced this pull request Dec 20, 2017
Example: dtoverlay=vc4-kms-v3d,cma-128

See: raspberrypi/linux#1431

Signed-off-by: Phil Elwell <[email protected]>
liuqun pushed a commit to liuqun/linux-raspi2 that referenced this pull request Dec 20, 2017
Example: dtoverlay=vc4-kms-v3d,cma-128

See: raspberrypi/linux#1431

Signed-off-by: Phil Elwell <[email protected]>
polceanum pushed a commit to polceanum/ubuntu-xenial that referenced this pull request Feb 6, 2018
Example: dtoverlay=vc4-kms-v3d,cma-128

See: raspberrypi/linux#1431

Signed-off-by: Phil Elwell <[email protected]>
APokorny pushed a commit to ubports/ubuntu_kernel_xenial that referenced this pull request Oct 11, 2018
Example: dtoverlay=vc4-kms-v3d,cma-128

See: raspberrypi/linux#1431

Signed-off-by: Phil Elwell <[email protected]>
hisenyiu2015 pushed a commit to hisenyiu2015/msm-4.14 that referenced this pull request May 20, 2021
Example: dtoverlay=vc4-kms-v3d,cma-128

See: raspberrypi/linux#1431

Signed-off-by: Phil Elwell <[email protected]>
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.

3 participants