Skip to content
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

bsp: cvitek: continue supporting duo 256M ARM core #9835

Merged
merged 4 commits into from
Dec 30, 2024

Conversation

unicornx
Copy link
Contributor

@unicornx unicornx commented Dec 25, 2024

注意:为了 review 和日后 track 方便,这个 PR 包含了四个 commit,merge 时请不要压缩,保持四个 commit 即可。

Fixed #9694。这个 PR 代替了 #9749#9771,所以本 PR 合并后,这两个 PR 无需合并,可以 cancel 掉。

  • patch 1: components: drivers: add RT_USING_SMP judgement inside smp_call.h
  • patch 2: bsp: cvitek: use ioremap for arm64 core
  • patch 3: bsp: cvitek: update combine.sh for arm64
  • patch 4: bsp: cvitek: update README for cv18xx_aarch64

patch 1: cv18xx_aarch64 这个 bsp 是单核,直接在 libcpu/aarch64/common/setup.c 文件中 #include <smp_call.h> 编译会报错说找不到 rt_hw_spinlock_t 定义。一种直接的解决方法是修改 libcpu/aarch64/common/setup.c 文件,将 #include <smp_call.h> 用 RT_USING_SMP 判断括起来。但讨论后不是最优解法,可以将对 RT_USING_SMP 的判断移到 smp_call.h 里面去。具体讨论见:#9771 (comment)

patch 2 ~ 3 都是针对 cv18xx_aarch64 的修改。相关背景参考 #9749

以上 patches 的具体改动说明见各自 commit message。

拉取/合并请求描述:(PR description)

[

为什么提交这份PR (why to submit this PR)

你的解决方案是什么 (what is your solution)

请提供验证的bsp和config (provide the config and bsp)

  • BSP:
  • .config:
  • action:

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/workflows/bsp_buildings.yml 详细请参考链接BSP自查

@unicornx unicornx added BSP: Cvitek BSP related with cvitek Arch: ARM/AArch64 BSP related with arm RT-Smart RT-Thread Smart related PR or issues BSP labels Dec 25, 2024
@unicornx
Copy link
Contributor Author

@liYony 请帮忙 review,谢谢

@liYony
Copy link
Contributor

liYony commented Dec 25, 2024

我看你这边删除了combine.sh相关的内容,我仔细阅读了下代码,这个combine.sh主要是用于更新fip.bin用的,如果把这个脚本删除将会导致在使用arm的大核的同时,小核固件无法得到更新。
image
我建议还是保留吧。(arm和rv版本的fip.bin是不能混用的)

@unicornx
Copy link
Contributor Author

@liYony 我根据您的意见更新了,请再 review 一下吧,谢谢。

Copy link
Contributor

@liYony liYony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

貌似把这些prebuild的bin文件给删掉了

smp_call.h defines SMP-related structures and declares
SMP-related functions. These codes are only valid when
RT_USING_SMP is defined in the bsp, which means we have
to use RT_USING_SMP for judgment in every place where
this file is included, such as following:

```c
```

Now move the judgment of RT_USING_SMP directly into
smp_call.h, so that it's simpler to include the header
file as:

```c
```

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
For ARM, RT-smart and RT-standard both enable mmc (see
rt_hw_board_init() in bsp/cvitek/cv18xx_aarch64/board/board.c,
rt_hw_mmu_setup is called both for smart or standard).

So ioremap is must to do for ARM.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
Move the combine.sh to under cv18xx_aarch64, so we can
run this script the same as scons and no need to change
cwd.

Rename the folder boot to prebuild just becuase all the
files under boot are prebuild binaries.
Move the prebuilt fip.bin to under prebuild/milkv-duo256m
because it's only for 256.

Update combine.sh accordingly and output fip.bin to the output
folder where we create fip.bin/boot.sd as other bsp.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
Re-write README.md for aarch64.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
@unicornx
Copy link
Contributor Author

貌似把这些prebuild的bin文件给删掉了

抱歉,好像我 git 操作有点问题,现在修复了,重新 push 了一版,请检查,谢谢。

@unicornx unicornx requested a review from liYony December 26, 2024 07:16
@Rbb666 Rbb666 merged commit 8cf5389 into RT-Thread:master Dec 30, 2024
46 checks passed
@unicornx unicornx deleted the dev-duo-aarch64 branch December 31, 2024 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: ARM/AArch64 BSP related with arm BSP: Cvitek BSP related with cvitek BSP component: drivers Component RT-Smart RT-Thread Smart related PR or issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] bsp/cvitek/cv18xx_aarch64 需要维护
3 participants