Skip to content

Conversation

@unicornx
Copy link
Contributor

添加 sysctl 部分的驱动,包括

  • boot
  • clock
  • power
  • reset

这些驱动都是 bsp 运行必须的,所以默认参与编译,不可 dsable。

拉取/合并请求描述:(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自查

@github-actions github-actions bot added the BSP label May 15, 2025
@github-actions
Copy link

github-actions bot commented May 15, 2025

📌 Code Review Assignment

🏷️ Tag: bsp_k230

Path: bsp/k230
Reviewers: unicornx

Changed Files (Click to expand)
  • bsp/k230/drivers/interdrv/sysctl/SConscript
  • bsp/k230/drivers/interdrv/sysctl/sysctl_boot/SConscript
  • bsp/k230/drivers/interdrv/sysctl/sysctl_boot/sysctl_boot.c
  • bsp/k230/drivers/interdrv/sysctl/sysctl_boot/sysctl_boot.h
  • bsp/k230/drivers/interdrv/sysctl/sysctl_clock/SConscript
  • bsp/k230/drivers/interdrv/sysctl/sysctl_clock/sysctl_clk.c
  • bsp/k230/drivers/interdrv/sysctl/sysctl_clock/sysctl_clk.h
  • bsp/k230/drivers/interdrv/sysctl/sysctl_power/SConscript
  • bsp/k230/drivers/interdrv/sysctl/sysctl_power/sysctl_pwr.c
  • bsp/k230/drivers/interdrv/sysctl/sysctl_power/sysctl_pwr.h
  • bsp/k230/drivers/interdrv/sysctl/sysctl_reset/SConscript
  • bsp/k230/drivers/interdrv/sysctl/sysctl_reset/sysctl_rst.c
  • bsp/k230/drivers/interdrv/sysctl/sysctl_reset/sysctl_rst.h

📊 Current Review Status (Last Updated: 2025-05-15 08:50 UTC)

  • unicornx Pending Review

📝 Review Instructions

  1. 维护者可以通过单击此处来刷新审查状态: 🔄 刷新状态
    Maintainers can refresh the review status by clicking here: 🔄 Refresh Status

  2. 确认审核通过后评论 LGTM/lgtm
    Comment LGTM/lgtm after confirming approval

  3. PR合并前需至少一位维护者确认
    PR must be confirmed by at least one maintainer before merging

ℹ️ 刷新CI状态操作需要具备仓库写入权限。
ℹ️ Refresh CI status operation requires repository Write permission.

@unicornx unicornx added the BSP: K230 BSP related with K230 label May 15, 2025
@supperthomas supperthomas requested a review from Copilot May 15, 2025 08:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds drivers for sysctl functionality on the K230 board including reset, power, boot, and clock controls.

  • Introduces enums, structures, and API prototypes for sysctl reset, power, and boot operations.
  • Implements sysctl boot functions in C, along with SConscript build scripts for each driver module.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
bsp/k230/drivers/interdrv/sysctl/sysctl_reset/sysctl_rst.h New header defining reset enums, structure, and reset APIs.
bsp/k230/drivers/interdrv/sysctl/sysctl_reset/SConscript SConscript for compiling the reset driver.
bsp/k230/drivers/interdrv/sysctl/sysctl_power/sysctl_pwr.h New header for power management APIs and power domain definitions.
bsp/k230/drivers/interdrv/sysctl/sysctl_power/SConscript SConscript for compiling the power driver.
bsp/k230/drivers/interdrv/sysctl/sysctl_clock/SConscript SConscript for compiling the clock driver.
bsp/k230/drivers/interdrv/sysctl/sysctl_boot/sysctl_boot.h New header defining boot-related structures, enums, and API prototypes.
bsp/k230/drivers/interdrv/sysctl/sysctl_boot/sysctl_boot.c Implementation of boot functions, including boot mode selection and reset.
bsp/k230/drivers/interdrv/sysctl/sysctl_boot/SConscript SConscript for compiling the boot driver.
bsp/k230/drivers/interdrv/sysctl/SConscript Main SConscript aggregating all sysctl component builds.
Comments suppressed due to low confidence (1)

bsp/k230/drivers/interdrv/sysctl/sysctl_reset/SConscript:13

  • [nitpick] Using the variable name 'list' shadows Python's built-in type. Consider renaming it (e.g., 'file_list') to avoid potential confusion.
list = os.listdir(cwd)


void sysctl_boot_set_spi2axi(void)
{
sysctl_boot->soc_boot_ctl |= 1 < 2;
Copy link

Copilot AI May 15, 2025

Choose a reason for hiding this comment

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

In the sysctl_boot_set_spi2axi() function, the '<' operator is used instead of the intended bitwise shift operator '<<'. This likely does not set the correct bit, so it should be changed to '1 << 2'.

Suggested change
sysctl_boot->soc_boot_ctl |= 1 < 2;
sysctl_boot->soc_boot_ctl |= 1 << 2;

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

SystemCtrl includes:
- boot
- clock
- power
- reset

These drivers are built-in by default.

Signed-off-by: Wang Chen <unicorn_wang@outlook.com>
@unicornx unicornx force-pushed the dev-add-sysctrl-drv branch from 18c2a23 to a090daf Compare May 15, 2025 08:50
@unicornx unicornx requested a review from Rbb666 May 15, 2025 09:01
@Rbb666 Rbb666 merged commit 33a719d into RT-Thread:master May 15, 2025
35 checks passed
@unicornx unicornx deleted the dev-add-sysctrl-drv branch May 19, 2025 01:28
@Rbb666 Rbb666 mentioned this pull request Sep 18, 2025
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BSP: K230 BSP related with K230 BSP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants