匿名
未登录
登录
百问网嵌入式Linux wiki
搜索
查看“Reset overview”的源代码
来自百问网嵌入式Linux wiki
名字空间
页面
讨论
更多
更多
页面选项
Read
查看源代码
历史
←
Reset overview
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
The Linux<sup>®</sup> kernel reset framework offers a generic API for reset lines management at platform level.<br /> <br> == Framework purpose == The purpose of this article is to introduce the Linux kernel Reset Framework. It provides general information and, based on concrete IP use cases, explains how to use it. <br/> The Linux Reset framework offers a generic API for abstracting and controlling the different reset lines of the platform.<br/> Reset lines can be internal system reset signals or external lines such as a GPIO to reset an external device. ==System overview== {{ ImageMap|Image:Reset overview.png {{!}} frame {{!}} center{{!}} Reset Overview rect 322 527 422 555 [[RCC internal peripheral | RCC]] }} ===Component description=== *'''reset core:''' kernel reset framework designed for abstracting device reset handling via GPIOs or internal reset controller modules.<br/> *'''reset-stm32mp1:''' STM32MP1 RCC specific reset driver *'''RCC:''' Reset and clock controller that generates the different internal reset lines on STM32MP1. <br/> ===API description=== Documentation on the reset interface can be found in kernel documentation folder: https://www.kernel.org/doc/Documentation/devicetree/bindings/reset/reset.txt *Kernel reset API To get the line reset from DT: :*'''devm_reset_control_get_exclusive:''' looks up and obtains an exclusive reference to a reset controller (cannot be shared with another driver). :*'''devm_reset_control_get_shared:''' looks up and obtains a shared reference to reset a controller (can be shared with another driver). :*'''devm_reset_control_get:''' same as devm_reset_control_get_exclusive. :*'''devm_reset_control_get_optional:''' same as devm_reset_control_get except that the reference name is optional. :*'''devm_reset_control_get_optional_exclusive:''' same as devm_reset_control_get_exclusive except that the reference name is optional. :*'''devm_reset_control_get_optional_shared:''' same as devm_reset_control_get_shared except that the reference name is optional. To configure the reset line and retrieve its status from DT: :*'''reset_control_assert:''' asserts the reset line :*'''reset_control_deassert:''' deasserts the reset line :*'''reset_control_status:''' returns if the line is asserted or not ==Configuration== ===Kernel configuration=== By default, the activation of the Reset framework configuration (CONFIG_RESET_CONTROLER) is selected in the kernel configuration, through the Linux Menuconfig tool: [[Menuconfig or how to configure kernel]] (CONFIG_ARCH_STM32=y, CONFIG_ARCH_MULTI_V7=y): ===Device tree configuration=== A detailed device tree configuration is described in [[Reset device tree configuration]]. == How to use the Reset framework== To control a peripheral reset line, a driver must first get a reference on the reset handler thanks to its device tree node.<br/> The driver can then assert and deassert the reset line by calling the reset framework API.<br/> Below an example: foo: foo@adcdefgh { compatible = "foo-driver"; ... '''resets = <&rcc FOO_R>;''' ... }; Before using the reset specified in the device tree node, the foo driver has to request it at probe execution. static int foo_probe(struct platform_device *pdev) { '''struct reset_control *rst;''' ... rst = '''devm_reset_control_get_exclusive(&pdev->dev, NULL)'''; if (IS_ERR(rst)) { ret = PTR_ERR(rest); dev_err(&pdev->dev, "reset get failed: %d\n", ret); goto err_master_put; } ... The reset can then be asserted or deasserted using the reset framework API: ... '''reset_control_assert(rst);''' udelay(2); '''reset_control_deassert(rst);''' ... ==Source code location== Reset core file <ref>{{CodeSource | Linux kernel | drivers/reset/core.c}}</ref> <br> STM32MP1 reset file <ref>{{CodeSource | Linux kernel | drivers/reset/reset-stm32mp1.c}}</ref> <br> STM32MP1 reset interface file <ref>{{CodeSource | Linux kernel | include/dt-bindings/reset/stm32mp1-resets.h}}</ref> ==References== <references /> <noinclude> {{ArticleBasedOnModel | Framework overview article model}} {{PublicationRequestId | 10343 | 2019-01-21 | AnneJ}} [[Category:Reset]] </noinclude>
该页面使用的模板:
模板:ArticleBasedOnModel
(
查看源代码
)
模板:CodeSource
(
查看源代码
)
模板:ImageMap
(
查看源代码
)
模板:PublicationRequestId
(
查看源代码
)
返回至
Reset overview
。
导航
导航
WIKI首页
官方店铺
资料下载
交流社区
所有页面
所有产品
MPU-Linux开发板
MCU-单片机开发板
Linux开发系列视频
单片机开发系列视频
所有模块配件
Wiki工具
Wiki工具
特殊页面
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志