-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
BCM270x: Make uart1 work with Device Tree #1008
Conversation
Add uart1 to Device Tree. Enable it in AUXENB when it's used. Remove old platform device. Signed-off-by: Noralf Trønnes <[email protected]>
Looks okay to me. @pelwell ? |
BCM270x: Make uart1 work with Device Tree
Would it be possible to now have the 8250 kernel drive enabled in bcmrpi_defconfig? I believe that would be very useful as currently even with this change to allow uart1 to work with DT a user still needs to custom compile the kernel and modules to make use of it. Im not sure if this can be done via a module option (I think these are correct)
or if it should be just built in using the options given by @notro |
kernel: Add rpi-ft5406 overlay Add rpi-ft5406 driver as module kernel: config: Enable 8250 serial port See: raspberrypi/linux#1008 kernel: config: Enable POWER_RESET_GPIO See: raspberrypi/linux#1031 firmware: arm_display: Fix fb_base alias returned from mailbox property interface See: raspberrypi/linux#1026 firmware: mem_unlock - prevent decrementing lock count below 0 firmware: camera: Support multi-channel raw image capture firmware: camera: write_raw copies input frame if HDR is enabled firmware: camera: Write correct camera mode from write_raw_md_stage firmware: AGC tuner: Correction to setting default digital gain to x1.0
kernel: Add rpi-ft5406 overlay Add rpi-ft5406 driver as module kernel: config: Enable 8250 serial port See: raspberrypi/linux#1008 kernel: config: Enable POWER_RESET_GPIO See: raspberrypi/linux#1031 firmware: arm_display: Fix fb_base alias returned from mailbox property interface See: raspberrypi/linux#1026 firmware: mem_unlock - prevent decrementing lock count below 0 firmware: camera: Support multi-channel raw image capture firmware: camera: write_raw copies input frame if HDR is enabled firmware: camera: Write correct camera mode from write_raw_md_stage firmware: AGC tuner: Correction to setting default digital gain to x1.0
Can you try rpi-update. The options should be in. |
The update works a treat and i have successfully used the port with minicom. |
I was just about to ask if you could help out ondrej1024 on the forum, but I see you have done that already. Thank you. If you would like to submit a pull request with your overlay and updates to the Makefile and README then I'll happily merge it. I'll need to look into the automatic creation of /dev/ttyS0 even without the overlay - it is not the desired behaviour. |
I now understand why ttyS0 is being created without an overlay, and I've got it working(ish). The value of CONFIG_SERIAL_8250_RUNTIME_UARTS (currently 1) is the number of uarts initially configured at boot time, and causes /dev/ttyS0 to be created (but with what properties?) regardless of the DT content. Fortunately this config value can be overridden by a module parameter, so it may be necessary to use that as well as DT to enable the interface, unless we decide that having a (presumably) non-functioning ttyS0 is preferable to having to manipulate cmdline.txt. The other remaining issue is that the baudrate seems to be out by a factor of two - I'm looking at clock rates now. |
So i just attached the logic analyser on my setup here (Compute in OpenPi) and the baud rate is correct for 9600 and 115200
I've not tried on the Pi2 and don't know if that has a different system clock speed? |
Yes, the baud rate discrepancy was caused by using the core clock directly, which didn't take account of the non-standard clock divisor. Future firmware releases will correctly patch the uart1 clock value, but be aware that if you are overclocking the core you will need to set force_turbo=1 to get a sensible baud rate. |
kernel: bcm2708-spi: Don't use static pin configuration with DT kernel: bcm2708-i2s: Don't use static pin configuration with DT kernel: gpio-poweroff: Allow it to work on Raspberry Pi See: raspberrypi/linux#1031 kernel: BCM270X_DT: Create a core clock, use it for SPI and sdhost kernel: BCM270X_DT: Add overlay to enable uart1 See: raspberrypi/linux#1008 kernel: config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING See: Hexxeh/rpi-firmware#85 firmware: arm_loader: Support initialising vchiq through mailbox property interface See: raspberrypi/linux#1026 firmware: drivers/usb: Reduce busy-wait to sensible timeout See: raspberrypi/linux#1026 firmware: video_encode: Initialise headers for video_bitrate See: #163 firmware: arm_loader: Use the new core_freq DT parameter if present firmware: arm_loader: Set the uart1_clkrate DT property from core_freq firmware: arm_cursor: Better handling of a second app requesting a cursor firmware: arm: Tidy up setting of arm_control and arm_bash
kernel: bcm2708-spi: Don't use static pin configuration with DT kernel: bcm2708-i2s: Don't use static pin configuration with DT kernel: gpio-poweroff: Allow it to work on Raspberry Pi See: raspberrypi/linux#1031 kernel: BCM270X_DT: Create a core clock, use it for SPI and sdhost kernel: BCM270X_DT: Add overlay to enable uart1 See: raspberrypi/linux#1008 kernel: config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING See: #85 firmware: arm_loader: Support initialising vchiq through mailbox property interface See: raspberrypi/linux#1026 firmware: drivers/usb: Reduce busy-wait to sensible timeout See: raspberrypi/linux#1026 firmware: video_encode: Initialise headers for video_bitrate See: raspberrypi/firmware#163 firmware: arm_loader: Use the new core_freq DT parameter if present firmware: arm_loader: Set the uart1_clkrate DT property from core_freq firmware: arm_cursor: Better handling of a second app requesting a cursor firmware: arm: Tidy up setting of arm_control and arm_bash
rpi-update firmware should contain @pelwell's fix |
New overlay works for me, getting good baudrates out of it and the pin override works So that just leave the creation of /dev/ttyS0 question |
The /dev/ttyS0 creation is triggered by the config parameter SERIAL_8250_RUNTIME_UARTS, which we are setting to 1. Making this a 0 stops the device being created without and with the DT overlay. There are two parameters - SERIAL_8250_NR_UARTS and SERIAL_8250_RUNTIME_UARTS. The former is simply the size of an array, and the latter says how many entries in the array will be used. It seems odd to have a "RUNTIME" value like that compiled in, but it makes (slightly) more sense when you know that it can be overridden using the "nr_uarts" module parameter. Creating the platform device from DT only has the effect of initialising one of the pre-defined UART ports, so in order to get the behaviour we want, i.e. either one configured UART or no UARTs, it is necessary to:
That sounds tedious, but I have a trick up my sleeve. When you write to the "/chosen/bootargs" DT property from an overlay the new value is appended to the kernel command line (plus, this happens before the extra settings supplied by the firmware). This makes it possible to set the module parameter from the overlay. I've pushed an update to the rpi-4.0.y branch. |
@pelwell I'm just amazed by what your overlay mechanism can accomplish. It solves one problem after another with ease. |
@pelwell that looks like a very nice little work around |
Oddly, applying the same patch (specifically setting SERIAL_8250_RUNTIME_UARTS=0) to the rpi-4.1.y branch causes it to crash before the serial console comes up. I'll have to return to this later. |
The 4.1 8250 driver has a bug that causes it to crash if nr_uarts is zero. With this bug patched, the overlay works as expected. Both are now on rpi-4.1.y. |
What does this mean? The reason I ask is because Eric has a proposal for the aux enable problem using gated clocks. |
This means that that UART1 isn't an exact clone of a 8250 UART. In particular, the clock divisor is calculated differently. A standard 8250 derives the baud rate as The mini UART clock is tied (through a gate) to the core clock. It will therefore normally be 250MHz, but that will change if the VPU is overclocked. The current Pi firmware uses the uart1_clkrate DT parameter, passing in double the value of core_freq. Unless Eric's cprman driver (or the 8250 driver) can be modified in some way, it sounds like UART1 will run twice as quickly as it should. |
Maybe we can solve that problem by inserting a "fixed-factor-clock" to double the frequency?
http://lxr.free-electrons.com/source/drivers/clk/clk-fixed-factor.c |
That's neat (although I'd have called it "fixed-scaled-clock"). |
This patch seems to do the right thing, and removes the need for the uart1_clkrate parameter: diff --git a/arch/arm/boot/dts/bcm2708_common.dtsi b/arch/arm/boot/dts/bcm2708_c
index f096f45..4d1cc67 100644
--- a/arch/arm/boot/dts/bcm2708_common.dtsi
+++ b/arch/arm/boot/dts/bcm2708_common.dtsi
@@ -165,7 +165,7 @@
compatible = "brcm,bcm2835-aux-uart", "ns16550";
reg = <0x7e215040 0x40>;
interrupts = <1 29>;
- clock-frequency = <500000000>;
+ clocks = <&clk_uart1>;
reg-shift = <2>;
no-loopback-test;
status = "disabled";
@@ -294,6 +294,14 @@
clock-output-names = "pwm";
clock-frequency = <100000000>;
};
+
+ clk_uart1: clock@6 {
+ compatible = "fixed-factor-clock";
+ clocks = <&clk_core>;
+ #clock-cells = <0>;
+ clock-div = <1>;
+ clock-mult = <2>;
+ };
};
__overrides__ { |
I didn't think this far, that we could benefit from it already. This is maybe the best way to work around this discrepency in the almost-like 8250 uart. |
kernel: Revert "BCM270X_DT: mz61581: Revert to spi-bcm2708" See: raspberrypi/linux#1132 kernel: bcm2835-mmc: Don't overwrite MMC capabilities from DT kernel: BCM270X_DT: Use fixed-factor-clock for uart1 See: raspberrypi/linux#1008 kernel: vchiq: fix NULL pointer dereference when closing driver See: raspberrypi/linux#1123 firmware: Fix touchscreen I2C to only read from i2c in smaller bursts to avoid a fifo overrun problem with the i2c peripheral See: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=120642 firmware: arm_display: Fix issue with nonsensical negative overscan settings See: #471 firmware: arm_loader: Enable the i2c_arm and i2c_vc aliases for CM See: raspberrypi/linux#1129 firmware: di_adv: Allow the v3d priority boost to be modified See: http://forum.kodi.tv/showthread.php?tid=231092&pid=2103200#pid2103200
kernel: Revert "BCM270X_DT: mz61581: Revert to spi-bcm2708" See: raspberrypi/linux#1132 kernel: bcm2835-mmc: Don't overwrite MMC capabilities from DT kernel: BCM270X_DT: Use fixed-factor-clock for uart1 See: raspberrypi/linux#1008 kernel: vchiq: fix NULL pointer dereference when closing driver See: raspberrypi/linux#1123 firmware: Fix touchscreen I2C to only read from i2c in smaller bursts to avoid a fifo overrun problem with the i2c peripheral See: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=120642 firmware: arm_display: Fix issue with nonsensical negative overscan settings See: raspberrypi/firmware#471 firmware: arm_loader: Enable the i2c_arm and i2c_vc aliases for CM See: raspberrypi/linux#1129 firmware: di_adv: Allow the v3d priority boost to be modified See: http://forum.kodi.tv/showthread.php?tid=231092&pid=2103200#pid2103200
Note that the drivers/tty/serial/8250/8250_bcm2835aux.c driver (which essentially just doubles clock and is accepted into https://git.kernel.org/cgit/linux/kernel/git/gregkh/tty.git/commit/?h=tty-next&id=bdc5f300958062a766518b81d5378f837149d5c1 but not merged into upstream yet) is a candidate to use in the future. Note that it relies on drivers/clk/bcm/clk-bcm2835-aux.c and drivers/clk/bcm/clk-bcm2835.c, some of which we may already use with the openGL framework... But while trying to see if setting the console works on ttyS0 I found that there is a clock issue when using the aux uart and then enabling the ttyAMA0 device the system freezes. So I wonder if this behavior has been seen during development/testing of this downstream solution? |
Apart from the fact that miniUART/UART1/ttyS0 uses the core clock which changes in turbo mode without force_turbo=1, I've not seen any downstream problems with UARTs and clocks. If you can reproduce the freeze with the downstream kernel then please create a new issue. |
thanks - so you have not seen it... |
It’s know that the system will freeze any time the port is opened and there is not a device connected to pins for it to talk to, ‘RepRap’ Matt
|
as for VPU: i wonder if there is any means to get the clock framework to issue a notification when the But that is also similar to the SPI clock which also relies on VPU clock, but there the impact is smaller, as spi recalculates the divider on each spi_message, so it only impacts the current in-flight transaction... Thanks for the info - I will build latest 4.5 and then report to the corresponding lists/Eric. |
During page migrations UBIFS might get confused and the following assert triggers: [ 213.480000] UBIFS assert failed in ubifs_set_page_dirty at 1451 (pid 436) [ 213.490000] CPU: 0 PID: 436 Comm: drm-stress-test Not tainted 4.4.4-00176-geaa802524636-dirty #1008 [ 213.490000] Hardware name: Allwinner sun4i/sun5i Families [ 213.490000] [<c0015e70>] (unwind_backtrace) from [<c0012cdc>] (show_stack+0x10/0x14) [ 213.490000] [<c0012cdc>] (show_stack) from [<c02ad834>] (dump_stack+0x8c/0xa0) [ 213.490000] [<c02ad834>] (dump_stack) from [<c0236ee8>] (ubifs_set_page_dirty+0x44/0x50) [ 213.490000] [<c0236ee8>] (ubifs_set_page_dirty) from [<c00fa0bc>] (try_to_unmap_one+0x10c/0x3a8) [ 213.490000] [<c00fa0bc>] (try_to_unmap_one) from [<c00fadb4>] (rmap_walk+0xb4/0x290) [ 213.490000] [<c00fadb4>] (rmap_walk) from [<c00fb1bc>] (try_to_unmap+0x64/0x80) [ 213.490000] [<c00fb1bc>] (try_to_unmap) from [<c010dc28>] (migrate_pages+0x328/0x7a0) [ 213.490000] [<c010dc28>] (migrate_pages) from [<c00d0cb0>] (alloc_contig_range+0x168/0x2f4) [ 213.490000] [<c00d0cb0>] (alloc_contig_range) from [<c010ec00>] (cma_alloc+0x170/0x2c0) [ 213.490000] [<c010ec00>] (cma_alloc) from [<c001a958>] (__alloc_from_contiguous+0x38/0xd8) [ 213.490000] [<c001a958>] (__alloc_from_contiguous) from [<c001ad44>] (__dma_alloc+0x23c/0x274) [ 213.490000] [<c001ad44>] (__dma_alloc) from [<c001ae08>] (arm_dma_alloc+0x54/0x5c) [ 213.490000] [<c001ae08>] (arm_dma_alloc) from [<c035cecc>] (drm_gem_cma_create+0xb8/0xf0) [ 213.490000] [<c035cecc>] (drm_gem_cma_create) from [<c035cf20>] (drm_gem_cma_create_with_handle+0x1c/0xe8) [ 213.490000] [<c035cf20>] (drm_gem_cma_create_with_handle) from [<c035d088>] (drm_gem_cma_dumb_create+0x3c/0x48) [ 213.490000] [<c035d088>] (drm_gem_cma_dumb_create) from [<c0341ed8>] (drm_ioctl+0x12c/0x444) [ 213.490000] [<c0341ed8>] (drm_ioctl) from [<c0121adc>] (do_vfs_ioctl+0x3f4/0x614) [ 213.490000] [<c0121adc>] (do_vfs_ioctl) from [<c0121d30>] (SyS_ioctl+0x34/0x5c) [ 213.490000] [<c0121d30>] (SyS_ioctl) from [<c000f2c0>] (ret_fast_syscall+0x0/0x34) UBIFS is using PagePrivate() which can have different meanings across filesystems. Therefore the generic page migration code cannot handle this case correctly. We have to implement our own migration function which basically does a plain copy but also duplicates the page private flag. UBIFS is not a block device filesystem and cannot use buffer_migrate_page(). Cc: [email protected] Signed-off-by: Kirill A. Shutemov <[email protected]> [rw: Massaged changelog, build fixes, etc...] Signed-off-by: Richard Weinberger <[email protected]> Acked-by: Christoph Hellwig <[email protected]>
commit 4ac1c17 upstream. During page migrations UBIFS might get confused and the following assert triggers: [ 213.480000] UBIFS assert failed in ubifs_set_page_dirty at 1451 (pid 436) [ 213.490000] CPU: 0 PID: 436 Comm: drm-stress-test Not tainted 4.4.4-00176-geaa802524636-dirty #1008 [ 213.490000] Hardware name: Allwinner sun4i/sun5i Families [ 213.490000] [<c0015e70>] (unwind_backtrace) from [<c0012cdc>] (show_stack+0x10/0x14) [ 213.490000] [<c0012cdc>] (show_stack) from [<c02ad834>] (dump_stack+0x8c/0xa0) [ 213.490000] [<c02ad834>] (dump_stack) from [<c0236ee8>] (ubifs_set_page_dirty+0x44/0x50) [ 213.490000] [<c0236ee8>] (ubifs_set_page_dirty) from [<c00fa0bc>] (try_to_unmap_one+0x10c/0x3a8) [ 213.490000] [<c00fa0bc>] (try_to_unmap_one) from [<c00fadb4>] (rmap_walk+0xb4/0x290) [ 213.490000] [<c00fadb4>] (rmap_walk) from [<c00fb1bc>] (try_to_unmap+0x64/0x80) [ 213.490000] [<c00fb1bc>] (try_to_unmap) from [<c010dc28>] (migrate_pages+0x328/0x7a0) [ 213.490000] [<c010dc28>] (migrate_pages) from [<c00d0cb0>] (alloc_contig_range+0x168/0x2f4) [ 213.490000] [<c00d0cb0>] (alloc_contig_range) from [<c010ec00>] (cma_alloc+0x170/0x2c0) [ 213.490000] [<c010ec00>] (cma_alloc) from [<c001a958>] (__alloc_from_contiguous+0x38/0xd8) [ 213.490000] [<c001a958>] (__alloc_from_contiguous) from [<c001ad44>] (__dma_alloc+0x23c/0x274) [ 213.490000] [<c001ad44>] (__dma_alloc) from [<c001ae08>] (arm_dma_alloc+0x54/0x5c) [ 213.490000] [<c001ae08>] (arm_dma_alloc) from [<c035cecc>] (drm_gem_cma_create+0xb8/0xf0) [ 213.490000] [<c035cecc>] (drm_gem_cma_create) from [<c035cf20>] (drm_gem_cma_create_with_handle+0x1c/0xe8) [ 213.490000] [<c035cf20>] (drm_gem_cma_create_with_handle) from [<c035d088>] (drm_gem_cma_dumb_create+0x3c/0x48) [ 213.490000] [<c035d088>] (drm_gem_cma_dumb_create) from [<c0341ed8>] (drm_ioctl+0x12c/0x444) [ 213.490000] [<c0341ed8>] (drm_ioctl) from [<c0121adc>] (do_vfs_ioctl+0x3f4/0x614) [ 213.490000] [<c0121adc>] (do_vfs_ioctl) from [<c0121d30>] (SyS_ioctl+0x34/0x5c) [ 213.490000] [<c0121d30>] (SyS_ioctl) from [<c000f2c0>] (ret_fast_syscall+0x0/0x34) UBIFS is using PagePrivate() which can have different meanings across filesystems. Therefore the generic page migration code cannot handle this case correctly. We have to implement our own migration function which basically does a plain copy but also duplicates the page private flag. UBIFS is not a block device filesystem and cannot use buffer_migrate_page(). Signed-off-by: Kirill A. Shutemov <[email protected]> [rw: Massaged changelog, build fixes, etc...] Signed-off-by: Richard Weinberger <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
commit 4ac1c17 upstream. During page migrations UBIFS might get confused and the following assert triggers: [ 213.480000] UBIFS assert failed in ubifs_set_page_dirty at 1451 (pid 436) [ 213.490000] CPU: 0 PID: 436 Comm: drm-stress-test Not tainted 4.4.4-00176-geaa802524636-dirty #1008 [ 213.490000] Hardware name: Allwinner sun4i/sun5i Families [ 213.490000] [<c0015e70>] (unwind_backtrace) from [<c0012cdc>] (show_stack+0x10/0x14) [ 213.490000] [<c0012cdc>] (show_stack) from [<c02ad834>] (dump_stack+0x8c/0xa0) [ 213.490000] [<c02ad834>] (dump_stack) from [<c0236ee8>] (ubifs_set_page_dirty+0x44/0x50) [ 213.490000] [<c0236ee8>] (ubifs_set_page_dirty) from [<c00fa0bc>] (try_to_unmap_one+0x10c/0x3a8) [ 213.490000] [<c00fa0bc>] (try_to_unmap_one) from [<c00fadb4>] (rmap_walk+0xb4/0x290) [ 213.490000] [<c00fadb4>] (rmap_walk) from [<c00fb1bc>] (try_to_unmap+0x64/0x80) [ 213.490000] [<c00fb1bc>] (try_to_unmap) from [<c010dc28>] (migrate_pages+0x328/0x7a0) [ 213.490000] [<c010dc28>] (migrate_pages) from [<c00d0cb0>] (alloc_contig_range+0x168/0x2f4) [ 213.490000] [<c00d0cb0>] (alloc_contig_range) from [<c010ec00>] (cma_alloc+0x170/0x2c0) [ 213.490000] [<c010ec00>] (cma_alloc) from [<c001a958>] (__alloc_from_contiguous+0x38/0xd8) [ 213.490000] [<c001a958>] (__alloc_from_contiguous) from [<c001ad44>] (__dma_alloc+0x23c/0x274) [ 213.490000] [<c001ad44>] (__dma_alloc) from [<c001ae08>] (arm_dma_alloc+0x54/0x5c) [ 213.490000] [<c001ae08>] (arm_dma_alloc) from [<c035cecc>] (drm_gem_cma_create+0xb8/0xf0) [ 213.490000] [<c035cecc>] (drm_gem_cma_create) from [<c035cf20>] (drm_gem_cma_create_with_handle+0x1c/0xe8) [ 213.490000] [<c035cf20>] (drm_gem_cma_create_with_handle) from [<c035d088>] (drm_gem_cma_dumb_create+0x3c/0x48) [ 213.490000] [<c035d088>] (drm_gem_cma_dumb_create) from [<c0341ed8>] (drm_ioctl+0x12c/0x444) [ 213.490000] [<c0341ed8>] (drm_ioctl) from [<c0121adc>] (do_vfs_ioctl+0x3f4/0x614) [ 213.490000] [<c0121adc>] (do_vfs_ioctl) from [<c0121d30>] (SyS_ioctl+0x34/0x5c) [ 213.490000] [<c0121d30>] (SyS_ioctl) from [<c000f2c0>] (ret_fast_syscall+0x0/0x34) UBIFS is using PagePrivate() which can have different meanings across filesystems. Therefore the generic page migration code cannot handle this case correctly. We have to implement our own migration function which basically does a plain copy but also duplicates the page private flag. UBIFS is not a block device filesystem and cannot use buffer_migrate_page(). Signed-off-by: Kirill A. Shutemov <[email protected]> [rw: Massaged changelog, build fixes, etc...] Signed-off-by: Richard Weinberger <[email protected]> Acked-by: Christoph Hellwig <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
kernel: Add rpi-ft5406 overlay Add rpi-ft5406 driver as module kernel: config: Enable 8250 serial port See: raspberrypi/linux#1008 kernel: config: Enable POWER_RESET_GPIO See: raspberrypi/linux#1031 firmware: arm_display: Fix fb_base alias returned from mailbox property interface See: raspberrypi/linux#1026 firmware: mem_unlock - prevent decrementing lock count below 0 firmware: camera: Support multi-channel raw image capture firmware: camera: write_raw copies input frame if HDR is enabled firmware: camera: Write correct camera mode from write_raw_md_stage firmware: AGC tuner: Correction to setting default digital gain to x1.0
kernel: bcm2708-spi: Don't use static pin configuration with DT kernel: bcm2708-i2s: Don't use static pin configuration with DT kernel: gpio-poweroff: Allow it to work on Raspberry Pi See: raspberrypi/linux#1031 kernel: BCM270X_DT: Create a core clock, use it for SPI and sdhost kernel: BCM270X_DT: Add overlay to enable uart1 See: raspberrypi/linux#1008 kernel: config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING See: Hexxeh/rpi-firmware#85 firmware: arm_loader: Support initialising vchiq through mailbox property interface See: raspberrypi/linux#1026 firmware: drivers/usb: Reduce busy-wait to sensible timeout See: raspberrypi/linux#1026 firmware: video_encode: Initialise headers for video_bitrate See: raspberrypi#163 firmware: arm_loader: Use the new core_freq DT parameter if present firmware: arm_loader: Set the uart1_clkrate DT property from core_freq firmware: arm_cursor: Better handling of a second app requesting a cursor firmware: arm: Tidy up setting of arm_control and arm_bash
kernel: Revert "BCM270X_DT: mz61581: Revert to spi-bcm2708" See: raspberrypi/linux#1132 kernel: bcm2835-mmc: Don't overwrite MMC capabilities from DT kernel: BCM270X_DT: Use fixed-factor-clock for uart1 See: raspberrypi/linux#1008 kernel: vchiq: fix NULL pointer dereference when closing driver See: raspberrypi/linux#1123 firmware: Fix touchscreen I2C to only read from i2c in smaller bursts to avoid a fifo overrun problem with the i2c peripheral See: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=120642 firmware: arm_display: Fix issue with nonsensical negative overscan settings See: raspberrypi#471 firmware: arm_loader: Enable the i2c_arm and i2c_vc aliases for CM See: raspberrypi/linux#1129 firmware: di_adv: Allow the v3d priority boost to be modified See: http://forum.kodi.tv/showthread.php?tid=231092&pid=2103200#pid2103200
Since setup_tlb_handler() is executed in atomic context, we should use GFP_ATOMIC instead of GFP_KERNEL to alloc pages. Otherwise we will get a "sleeping in atomic context" error: [ 0.013118] BUG: sleeping function called from invalid context at mm/page_alloc.c:5158 [ 0.013126] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 0, name: swapper/1 [ 0.013131] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.19-rc3+ #1008 1a223086d14d07967cc427f15d52139422271360 [ 0.013136] Hardware name: Loongson Loongson-3A5000-7A1000-1w-V0.1-CRB/Loongson-LS3A5000-7A1000-1w-EVB-V1.21, BIOS Loongson-UDK2018-V2.0.04082-beta7 04/27 [ 0.013140] Stack : 90000000015fc990 9000000100493c18 9000000000df3370 9000000100490000 [ 0.013151] 9000000100493b50 0000000000000000 9000000100493b58 9000000001417ef0 [ 0.013160] 900000000199e54e 0000000000000040 9000000100493c18 90000000015f7a98 [ 0.013168] ffffffffffffffff 6de72f8b42179d1e 9000000100403b80 90000000015f7890 [ 0.013176] 0000000000000001 00000000fffff175 9000000000eb9860 9000000001530b4b [ 0.013184] 9000000000e99e60 0000000000000013 0000000006ecc000 0000000000000001 [ 0.013193] 90000000015f7a98 9000000001417ef0 0000000000000004 0000000000000000 [ 0.013201] 0000000000000cc0 0000000000000000 0000000000000001 90000000015fc990 [ 0.013209] 9000000000217e74 9000000001603b6b 9000000000208640 0000000000000000 [ 0.013217] 00000000000000b0 0000000000000004 0000000000000000 0000000000070000 [ 0.013225] ... [ 0.013229] Call Trace: [ 0.013230] [<9000000000208640>] show_stack+0x4c/0x14c [ 0.013240] [<9000000000df3370>] dump_stack_lvl+0x70/0xac [ 0.013246] [<9000000000270c8c>] ___might_sleep+0x104/0x124 [ 0.013253] [<9000000000477e84>] __alloc_pages+0x240/0x464 [ 0.013260] [<9000000000214214>] setup_tlb_handler+0x104/0x1e8 [ 0.013265] [<9000000000214324>] tlb_init+0x2c/0x3c [ 0.013270] [<9000000000208b74>] per_cpu_trap_init+0xec/0x108 [ 0.013275] [<9000000000202850>] cpu_probe+0x400/0x8a4 [ 0.013279] [<900000000020d160>] start_secondary+0x5c/0x3d4 Signed-off-by: Huacai Chen <[email protected]>
Add uart1 to Device Tree. Enable it in AUXENB when it's used.
Remove old platform device.
This is how I have tested this on Pi1 and Pi2:
config
DT overlay
Add to /boot/cmdline.txt
dmesg
To get a login prompt on ttyS0, /etc/inittab would need some attention.