-
Notifications
You must be signed in to change notification settings - Fork 5.2k
ARCH_BCM270X: Drop ATAGS support #1178
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
Conversation
Great I'll give this a test. Been looking forward to this day. (Even more so when 2709 gets the same treatment). |
You could cherry-pick #1163 and then drop bcm2708-i2s. |
Awesome! Still boots and seems to work. |
Me too. ARCH_BCM2835 is now just around the corner.
Will do. |
Version 2 Removed bcm2708-i2s driver. bcm2835-i2s patches were already applied to rpi-4.3.y. Removed the 4M init_dma_coherent_pool_size so we're back to the default 256k. Added reboot_part parameter.
Any other value (1,5) leads to a regular reboot. Does the bootloader boot partiton 0 if the asked for partition isn't bootable? Added aux enable node so we can enable uart1 from board_bcm2835. |
If a partition doesn't exist it falls back to partition zero. |
I discovered that the kernel was hung with no message on the console 30 min after last round of testing. |
I rebuilt the kernel from scratch and haven't been able to reproduce the problem. |
I'm not sure what I should do with reboot_part. |
If necessary NOOBS can use a new mechanism when choosing next partition to boot from. The kernel version and NOOBS version tend to be tied together (updating NOOBS kernel is not generally supported). There will be other users of reboot_part. We use it in production tests to signal results from a previous boot. No doubt others are using it for multiboot purposes. But if it needs to change, then it needs to change. It's not too hard to test for both possible paths. Ping @lurch @ghollingworth that a future kernel update may require NOOBS changes. |
Thanks for the heads up. NOOBS v1.4.x is still using a 3.18 kernel ( https://github.com/raspberrypi/noobs/blob/master/buildroot/.config#L309 ) without DT enabled. If/when it becomes necessary to change the reboot_part logic though, it'll be easy to modify: https://github.com/raspberrypi/noobs/blob/master/recovery/util.cpp#L143 |
@pelwell Yup, we've been communicating via email :-) It's just a shame that I'm so busy at the moment that I haven't been able to give him more help. |
An odyssean saga? - definitely! But I'm just a small fish standing on the "shoulders of giants", grateful for any tidbits thrown my way. |
@notro v4.3 is out, so this needs a rebase. |
The Pi was dead again today, no error messages. It had just been sitting idle. |
I've noticed that without this PR the USB hardware correctly accesses memory through the 0x4 alias bus address. After this PR it accesses memory incorrectly through the 0x0 alias. The GPU debugger catches bad accesses:
Not sure if that is the cause of your instability, but it is something suspicious. |
The 'Convert to multiplatform' patch changes the address logic, so I guess it's the culprit. |
The difference between 0x0 and 0x4 alias is quite minor (whether it goes through GPU's L1 cache). Most peripherals like USB can't see the L1 cache, so may get the same data in either case (although we are in undefined behaviour territory). Each access does generate an exception on the GPU, so at the very least kernel accesses will cripple the gpu performance. If the same error applies to Pi2 (0x0 alias instead of 0xC alias), then it is likely to be far more obviously broken as peripherals can see the GPU's L2 cache (but don't want to). I'll try to do the test. Note: with v4.3 there are a few build errors with platform include files. I'm hacking it by adding extra header includes, but I suspect there is a better solution. |
I can confirm that the GPU exceptions start with the multiplatform commit. |
Can you give me an example statement from the usb driver which triggers this exception? |
I've spotted something that could be the source of the problem. drivers/usb/host/dwc_common_port/dwc_os.h #define DWC_DMA_ALLOC(_size_,_dma_) __DWC_DMA_ALLOC(NULL, _size_, _dma_) drivers/usb/host/dwc_common_port/dwc_common_linux.c void *__DWC_DMA_ALLOC(void *dma_ctx, uint32_t size, dwc_dma_t *dma_addr)
{
#ifdef xxCOSIM /* Only works for 32-bit cosim */
void *buf = dma_alloc_coherent(dma_ctx, (size_t)size, dma_addr, GFP_KERNEL);
#else
void *buf = dma_alloc_coherent(dma_ctx, (size_t)size, dma_addr, GFP_KERNEL | GFP_DMA32);
#endif
if (!buf) {
return NULL;
}
memset(buf, 0, (size_t)size);
return buf;
} |
Version 3 Removed bcm2835_wdt sysfs symlinks. NOOBS have to use the new path when it switches to kernel version >4.1: /sys/module/bcm2835_wdt/parameters/reboot_part Pass in the device when allocating dma memory in dwc_otg to get the correct bus address. @popcornmix Please test with the debugger to verify that the exceptions are indeed gone. |
Did some tests, this is already looking really good, great job! Only a few minor things: Currently I have to patch mkknlimg so the kernel doesn't get flagged as 2835, otherwise it won't boot. Manually specifying the device_tree file in config.txt also works, but that's a PITA as I swap between B and B+ quite often during testing. Some idea how to improve 2835 detection in mkknlimg? I also get a warning in dmesg every time an I2S audio device is closed. Looks like dma_free_coherent now doesn't like to be called with IRQs disabled:
Ah, and could you please add commit 0bbc1e2 (limit cyclic lite transfers to 32k)? Haven't found the time yet to dig further into that.. |
Thanks for giving this a spin.
It seems that the documentation has been realised in code with this 4.3 commit: torvalds/linux@6894258 How to solve this? I don't know.
Will do. |
> Ah, and could you please add commit 0bbc1e2
Will do.
Thanks!
BTW: you can drop the dreq/slave_id commit, the DMA channels are now
properly set up in the DT and this is no longer needed.
|
If the image support bcm283x and bcm270x then I think the firmware should load a bcm270x DTB by default. There are a few ways to achieve this:
Any thoughts? |
This is currently possible with the --dtok parameter. It turns of auto detection.
I like this one. The tag decides the default dtb. |
Latest version of this PR is not provoking GPU asserts. |
I have fiq support with 2836: irqchip: irq-bcm2835: Add 2836 FIQ support |
I tried Phil's upstream interrupt controller patches and your fiq patch: but dwc_otg fails with fiq enabled. It does work with fiq disabled. |
Yes I have 2836 running now with fiq enabled (a bit unreliable network transfer though).
I use Eric's timer patch and it enables syscon (I have removed the conditional here): diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
index edbe6fe..3d76e13 100644
--- a/arch/arm/mach-bcm/Kconfig
+++ b/arch/arm/mach-bcm/Kconfig
@@ -115,6 +115,7 @@ config ARCH_BCM2835
select ARM_TIMER_SP804
select CLKSRC_OF
select FIQ
+ select MFD_SYSCON
select PINCTRL
select PINCTRL_BCM2835
help Looking at your patch I can see why I have problems with mmc dma on 2836. |
And I can see that @pelwell discovered the reason for the spurious interrupts, that's good! |
I see that bcm2709_defconfig has CONFIG_CACHE_L2X0 disabled. Why is that? ARCH_BCM2709 does select MIGHT_HAVE_CACHE_L2X0 in arch/arm/Kconfig |
Pretty sure we don't want CONFIG_CACHE_L2X0. That is an outer L2 cache (external to the arm cores). We have an inner L2 cache (integrated with the cores). |
Is it ok to enable CONFIG_NEON on Pi1? diff -u arch/arm/configs/bcmrpi_defconfig arch/arm/configs/bcm2709_defconfig +# CONFIG_CACHE_L2X0 is not set
+CONFIG_SMP=y
+CONFIG_HAVE_ARM_ARCH_TIMER=y
+CONFIG_VMSPLIT_2G=y
+CONFIG_NEON=y
+CONFIG_KERNEL_MODE_NEON=y
-CONFIG_LATENCYTOP=y
-CONFIG_CRYPTO_CRYPTD=m
-CONFIG_CRYPTO_SHA512=m
-CONFIG_CRYPTO_SHA1_ARM=m
-CONFIG_CRYPTO_AES_ARM=m
+CONFIG_CRYPTO_SHA1_ARM_NEON=m
+CONFIG_CRYPTO_AES_ARM_BS=m |
There is no Neon support on pi1 so it's probably not good to enable it (unless it gets disabled in some way). |
@notro have you had fiq + upstream interrupt controller working with bcm2709_defconfig platform? |
Yes, this is what I used: https://github.com/notro/linux/commits/irq2836-43 |
Yes, SPARSE_IRQ is what I used in the drop atags patchset: 9b4b8da |
I want to drop downstream interrupt controller in 4.4 (which has drop atags). |
I guess you have this error in the kernel log: Failed to get local register map. FIQ is disabled for cpus > 1 I see that @anholt doesn't use a syscon node in his 2836 v2 patch like he did in his dev branch that I looked at. |
Yes, I get that error in kernel log. |
It should work if you add that node, but I'm not sure if this is the approved way of doing it. |
I'll give it a try. For now I'll settle for working. Approved can come later. |
If all the cpu's come up, I guess you're ok, but there's some smp code in irq-bcm2836 and I don't know how that plays with the current 2709 smp code: static void
bcm2836_arm_irqchip_smp_init(void)
{
#ifdef CONFIG_SMP
/* Unmask IPIs to the boot CPU. */
bcm2836_arm_irqchip_cpu_notify(&bcm2836_arm_irqchip_cpu_notifier,
CPU_STARTING,
(void *)smp_processor_id());
register_cpu_notifier(&bcm2836_arm_irqchip_cpu_notifier);
set_smp_cross_call(bcm2836_arm_irqchip_send_ipi);
#endif
} Maybe it just does the same operation twice, I haven't studied it. |
I mean: maybe irq2836 and 2709 combined will so some smp operations twice. |
Adding 0d3f1f5 doesn't affect the "Failed to get local register map. FIQ is disabled for cpus > 1" error. |
CONFIG_MFD_SYSCON does seem to make the fiq work. Just need to test for stability. |
Display WA raspberrypi#1178 is meant to fix Aux channel voltage swing too low with some type C dongles. Although it is for type C, HW engineers reported that it can be applied to all external ports even if they are not going to type C. For CNL we apply the workaround every time Aux B, C and D are powering up since they will lose the configuration when powered down. v2: Use common tag for WA Cc: Rodrigo Vivi <[email protected]> Cc: Arthur J Runyan <[email protected]> Cc: Ville Syrjälä <[email protected]> Signed-off-by: Lucas De Marchi <[email protected]> Reviewed-by: Rodrigo Vivi <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Current code always select _CNL_AUX_ANAOVRD1_B register regardless the pw in use. CNL_DISP_PW_AUX_B = 9 CNL_DISP_PW_AUX_C = 10 CNL_DISP_PW_AUX_D = 11 And for pick we want B = 0 C = 1 D = 2 Fixes: ddd39e4 ("drm/i915/cnl: apply Display WA raspberrypi#1178 to fix type C dongles") Cc: Lucas De Marchi <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]> Acked-by: Lucas De Marchi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Outputs C and D on EHL are combo PHY outputs and thus should not be using the same TC AUX power well handlers as ICL. And even though icl_combo_phy_aux_power_well_ops works okay for EHL/JSL combo PHYs none of its special handling is actually necessary for this platform: * EHL/JSL don't actually need to program PORT_CL_DW12 * Display WA raspberrypi#1178 does not apply to EHL/JSL Thus we can simply drop back to using our standard "hsw-style" power well ops for EHL AUX power wells. Bspec: 4301 Fixes: f722b8c ("drm/i915/ehl: All EHL ports are combo phys") Cc: Jose Souza <[email protected]> Cc: Bob Paauwe <[email protected]> Cc: Vivek Kasireddy <[email protected]> Cc: Lucas De Marchi <[email protected]> Signed-off-by: Matt Roper <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Lucas De Marchi <[email protected]> (cherry picked from commit e8ab8d6) Signed-off-by: Joonas Lahtinen <[email protected]>
The TGL workaround database no longer shows Wa raspberrypi#1178 (or anything similar under different workaround names/numbers) so we should be able to drop it. In fact Swati just discovered that applying this workaround is the root cause of some power well enable failures we've been seeing in CI (gitlab issue 498). Once we stop applying this WA, TGL no longer utilizes any of the special handling provided by icl_combo_phy_aux_power_well_ops so we can just drop back to using the standard hsw-style power well ops instead. v3: Drop now-unused _TGL_AUX_ANAOVRD1_C definition too. (Lucas) Closes: https://gitlab.freedesktop.org/drm/intel/issues/498 Fixes: deea06b ("drm/i915/tgl: apply Display WA raspberrypi#1178 to fix type C dongles") Cc: Lucas De Marchi <[email protected]> Cc: Swati Sharma <[email protected]> Cc: Imre Deak <[email protected]> Signed-off-by: Matt Roper <[email protected]> Reviewed-by: Lucas De Marchi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit ab34025) Signed-off-by: Joonas Lahtinen <[email protected]>
This PR makes Device Tree mandatory for booting the ARCH_BCM2708 kernel.
We have used Device Tree since we switched to 3.18 in January and it's time to remove ATAGS support.
This will cut down on the amount of patches that we have to keep around and apply on each new kernel release. It is also a necessary step on the way to get one kernel image that can boot both Pi1 and Pi2 (instead of having kernel.img and kernel7.img).
A /boot/config.txt that disables Device Tree will not boot anymore:
There will be no visible sign that the kernel didn't receive a Device Tree since it won't know which drivers to load and hence can't display an error (a custom kernel with EARLY_PRINTK enabled would print an error on the serial console).