-
Notifications
You must be signed in to change notification settings - Fork 5k
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
overlays: Add overlay to run an upstream kernel #2393
Conversation
The difference between upstream and downstream device trees is marginal by now. This overlay combines all overlays required to make the downstream device tree upstream compatible. See: raspberrypi/firmware#943 The idea behind this overlay is that the RPi firmware can then based on the upstream flag apply this overlay automatically, providing kernels that need to follow upstream bindings (like U-Boot) with a device tree to work against. Signed-off-by: Alexander Graf <[email protected]>
Thinking about this, there will be no way to apply any parameters, so are you happy with the defaults? ovmerge will strip the parameter declarations once any have been applied (put the parameters after each overlay name, separated by commas and no whitespace) - you can force the same behaviour by just appending a comma, or you can explicitly re-apply the defaults. |
I don't fully grasp that comment :). So the combined overlay does have an overrides section still around which seems to at least remotely reflect the parameters you can specify in the individual overlay files, no? With the automated detection and applying of an "upstream" overlay, there obviously is no way to apply parameters. But that shouldn't be terribly bad as long as the defaults are sane. |
That's the question. The most critical parameter is the size of the CMA pool - 256MB is the default value, but it probably won't work on a device with less than 1GB RAM. Fortunately the CMA size can be overridden from cmdline.txt, so I'm tempted to make cma-96 the safe default. The other most critical parameter is dr_mode - the upstream DTBs are tuned for the devices, with rpi-zero using "otg" (the default) and everything else using "host". You would lose this distinction by applying the same overlay to all downstream DTBs. A better way might be to bake the "natural" dr_mode into the downstream DTBs, knowing that it will be ignored by the dwc-otg driver, and adjusting the overlay to only set dr_mode in the event that the parameter is used. |
As for CMA size, we need to find different ways to tune that anyways. Applying random kernel command line options from firmware doesn't scale (think of the BSDs again) and really doesn't apply to any boot flow I'm interested in, as that always involved grub which overwrites whatever firmware puts in the command line anyway :). As for dr_mode, I agree that it would be a good idea to put the natural mode into the base DTB and only adjust it if desired. You're definitely much better at device tree wizardry than me, do you think you could just quickly assemble something? |
I've hit a snag - the downstream set of DTBs doesn't include one for Pi Zero - we just use the B+ DTB - although there is one for the Zero W. This means there is nowhere to record the fact that the Zero wants OTG mode. |
So how does the downstream kernel on the Zero itself know that it should use OTG instead of Host Mode? |
It doesn't - the downstream driver doesn't support OTG. You have to use the dwc2 overlay to load the upstream driver - dr_mode="otg" is the default. |
So that means the Zero simply doesn't work with USB out of the box, even with downstream? Then we can default to dr_mode = "host" in the upstream overlay, no? |
Ok, consider me puzzled. I've booted a RPi3 with the dwc2 overlay applied, so dr_mode="otg". I've also verified that it really is: $ cat /sys/kernel/debug/3f980000.usb/dr_mode But the USB controller is definitely in host mode - I can use ethernet and an attached USB keyboard. |
The Zero does work with USB out of the box, but as a host. If you think upstream Zero users without an upstream DTB (extremely niche) would be happy with that then I can live with it. OTG mode means "either host or peripheral, depending on the type of cable and some hardware magic". The Pi 3 is lacking the hardware magic, so it comes up in host mode. |
I just tried on the CM3 as well (I don't have a Zero handy) and that works as expected as well with USB host working as USB host. I still fail to see why the Zero would not work - the special hardware is usually in the micro->USB-A adapter which you need for the Zero to even plug anything in, right? So OTG detection should work just fine there too. |
The upstream DTB has gone out of its way to give the Pi Zero (but not the Zero W, for some reason) a DTB that specifies "otg" mode, whereas the others are locked to "host". However, since all the other Pis either have hardware OTG control methods or tie the pin to ground, setting "otg" mode on all Pis should be safe. Which brings us back to the ovmerge command line:
The resulting overlay will have no parameters to document. |
Just a note about the upstream dtb for the Zero W. The dr_mode should also be "otg", but a regression (#2390) forced me to start with "host". Now this issue has been fixed and in 4.17 the dr_mode of Zero W will also be "otg". |
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
I've merged an updated version of this overlay. The firmware still needs to be modified to load it automatically. |
kernel: Fix GCC 6.4.0 and 7.3.0 warnings See: raspberrypi/linux#2413 kernel: audioinjector-octo: Add continuous clock feature See: raspberrypi/linux#2409 kernel: overlays: Add 'upstream' overlay See: raspberrypi/linux#2393 kernel: overlays: Add overlay for PiBell soundcard See: https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=99784&p=1279490#p1278971 kernel: Removing (broken) RaspiDac3 support kernel: i2c: bcm2835: Set up the rising/falling edge delays See: raspberrypi/linux#2407 kernel: overlays: Add updated mmc1 alias to sdio overlays kernel: config: Enable CONFIG_GPIO_MOCKUP module See: raspberrypi/linux#2410 kernel: overlays: Rework sdio overlays to allow polling See: raspberrypi/linux#2401 kernel: firmware/raspberrypi: Add a get_throttled sysfs file See: raspberrypi/linux#2397 firmware: dtoverlay: Also allow fragment-<n> in overlays firmware: i2c_gpio: Optimise and run clients faster
kernel: Fix GCC 6.4.0 and 7.3.0 warnings See: raspberrypi/linux#2413 kernel: audioinjector-octo: Add continuous clock feature See: raspberrypi/linux#2409 kernel: overlays: Add 'upstream' overlay See: raspberrypi/linux#2393 kernel: overlays: Add overlay for PiBell soundcard See: https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=99784&p=1279490#p1278971 kernel: Removing (broken) RaspiDac3 support kernel: i2c: bcm2835: Set up the rising/falling edge delays See: raspberrypi/linux#2407 kernel: overlays: Add updated mmc1 alias to sdio overlays kernel: config: Enable CONFIG_GPIO_MOCKUP module See: raspberrypi/linux#2410 kernel: overlays: Rework sdio overlays to allow polling See: raspberrypi/linux#2401 kernel: firmware/raspberrypi: Add a get_throttled sysfs file See: raspberrypi/linux#2397 firmware: dtoverlay: Also allow fragment-<n> in overlays firmware: i2c_gpio: Optimise and run clients faster
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: #2393 Signed-off-by: Phil Elwell <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: raspberrypi/linux#2393 Signed-off-by: Phil Elwell <[email protected]> (cherry picked from commit 1b481f8a427561dc7fd2afaa317d7be13f55382e https://github.com/raspberrypi/linux raspi/rpi-4.15.y) Signed-off-by: Paolo Pisati <[email protected]> Signed-off-by: Seth Forshee <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: raspberrypi/linux#2393 Signed-off-by: Phil Elwell <[email protected]> (cherry picked from commit 1b481f8a427561dc7fd2afaa317d7be13f55382e https://github.com/raspberrypi/linux raspi/rpi-4.15.y) Signed-off-by: Paolo Pisati <[email protected]> Signed-off-by: Seth Forshee <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: raspberrypi/linux#2393 Signed-off-by: Phil Elwell <[email protected]> (cherry picked from commit 1b481f8a427561dc7fd2afaa317d7be13f55382e https://github.com/raspberrypi/linux raspi/rpi-4.15.y) Signed-off-by: Paolo Pisati <[email protected]> Signed-off-by: Seth Forshee <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: raspberrypi/linux#2393 Signed-off-by: Phil Elwell <[email protected]> (cherry picked from commit 1b481f8a427561dc7fd2afaa317d7be13f55382e https://github.com/raspberrypi/linux raspi/rpi-4.15.y) Signed-off-by: Paolo Pisati <[email protected]> Signed-off-by: Seth Forshee <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: raspberrypi/linux#2393 Signed-off-by: Phil Elwell <[email protected]> (cherry picked from commit 1b481f8a427561dc7fd2afaa317d7be13f55382e https://github.com/raspberrypi/linux raspi/rpi-4.15.y) Signed-off-by: Paolo Pisati <[email protected]> Signed-off-by: Seth Forshee <[email protected]>
The 'upstream' overlay makes the necessary changes for a downstream .dtb to be used with an upstream kernel. It is currently made up from three other overlays - vc4-kms-v3d, dwc2 and upstream-aux-interrupt. The VPU firmware will soon be made to automatically load this overlay when an upstream kernel is detected (using the trailer supplied by the mkknlimg script). See: raspberrypi/linux#2393 Signed-off-by: Phil Elwell <[email protected]> (cherry picked from commit 1b481f8a427561dc7fd2afaa317d7be13f55382e https://github.com/raspberrypi/linux raspi/rpi-4.15.y) Signed-off-by: Paolo Pisati <[email protected]> Signed-off-by: Seth Forshee <[email protected]>
The difference between upstream and downstream device trees is
marginal by now. This overlay combines all overlays required to
make the downstream device tree upstream compatible.
See: raspberrypi/firmware#943
The idea behind this overlay is that the RPi firmware can then
based on the upstream flag apply this overlay automatically,
providing kernels that need to follow upstream bindings (like
U-Boot) with a device tree to work against.
Signed-off-by: Alexander Graf [email protected]