[DM/FDT] Fix garble when booting#10166
Conversation
@1078249029 另外你虽然列出了关联的 issue,但是语法不对,导致 github 并没有将 pr 和 issue 关联起来,建议再仔细阅读一下 https://github.com/plctlab/plct-rt-thread/blob/notes/0.notes/20241212-github-tips.md 并修改。 具体的代码修改,还是要请设备树的专家 @GuEe-GUI 看一下。 |
|
看了一下,题主的解决思路主要还是没匹配到早期打印接口就直接不执行打印。 但其实并不需要这么做,因为如果没匹配到接口,rt_kputs 理论上不会打印任何东西: rt_kputs
-->rt_hw_console_output
----> rt_fdt_earlycon_output
--------> fdt_earlycon.console_putc所以还是建议查清楚之前打印乱码到底是谁打印出来的比较好,不一定是直接打印的,可能是之前缓存在 fdt early msg 中的数据(那又是谁写进去的缓存?),因为其他平台测试过都是没有这个问题的。 |
我这里又测了一遍,将 |
3ac7685 to
a2be033
Compare
|
我详细说一下bug是怎么产生的吧。首先cvitek开启了fdt并在设备树中描述了 |
|
那就采用清空 .bss 就可以了,原则上任何打印都不能错过。 其次如果只是使用普通的 .bss 段,不需要手动进行修饰 感谢题主排查出问题! |
Fix garble caused by empty implementation of earlycon series function in driver.If driver doesn't offer earlycon_id or rt_f dt_earlycon_id.setup function but open option, the checking of best_earlycon_id will failed. Signed-off-by: 1078249029 <1078249029@qq.com>
a2be033 to
24482f4
Compare
|
@unicornx review 完成就可以了。 |
|
因为这段大小可以调整很大,如果放在 bss会导致清理时间很长,但是经过后期实际验证,大部分平台使用默认值(128 字节)已经足够,即便翻倍也不会明显导致初始化时间较长,毕竟使用设备树的平台性能不会差到哪去。 其次就是后期确实有更早的打印需求(一般都是调试用,发布版本不会启用),那之前假设 earlycon 初始化之前不打印的情况就不符合这个需求了。 |
|
@Rbb666 请 review,谢谢 |

拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
Fix garble caused by empty implementation of earlycon series function in driver.If driver doesn't offer earlycon_id or rt_f dt_earlycon_id.setup function but open option, the checking of best_earlycon_id will failed.
Fixed #10154
你的解决方案是什么 (what is your solution)
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up