1 Star 0 Fork 0

大川搬砖/device-tree-parse

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT
PetaLinux User Module Template
===================================

This directory contains a PetaLinux kernel module created from a template.

If you are developing your module from scratch, simply start editing the
file hkm-devtree.c.

You can easily import any existing module code by copying it into this 
directory, and editing the automatically generated Makefile as described below.

The "all:" target in the Makefile template will compile compile the module.

Before building the module, you will need to enable the module from
PetaLinux menuconfig by running:
    "petalinux-config -c rootfs"
You will see your module in the "modules --->" submenu.

To compile and install your module to the target file system copy on the host,
simply run the command.
    "petalinux-build -c kernel" to build kernel first, and then run
    "petalinux-build -c hkm-devtree" to build the module

You will also need to rebuild PetaLinux bootable images so that the images
is updated with the updated target filesystem copy, run this command:
    "petalinux-build -c rootfs"

You can also run one PetaLinux command to compile the module, install it
to the target filesystem host copy and update the bootable images as follows:
    "petalinux-build"

If OF(OpenFirmware) is configured, you need to add the device node to the
DTS(Device Tree Source) file so that the device can be probed when the module is
loaded. Here is an example of the device node in the device tree:

	hkm-devtree_instance: hkm-devtree@XXXXXXXX {
		compatible = "vendor,hkm-devtree";
		reg = <PHYSICAL_START_ADDRESS ADDRESS_RANGE>;
		interrupt-parent = <&INTR_CONTROLLER_INSTANCE>;
		interrupts = < INTR_NUM INTR_SENSITIVITY >;
	};
Notes:
 * "hkm-devtree@XXXXXXXX" is the label of the device node, it is usually the "DEVICE_TYPE@PHYSICAL_START_ADDRESS". E.g. "hkm-devtree@89000000".
 * "compatible" needs to match one of the the compatibles in the module's compatible list.
 * "reg" needs to be pair(s) of the physical start address of the device and the address range.
 * If the device has interrupt, the "interrupt-parent" needs to be the interrupt controller which the interrupt connects to. and the "interrupts" need to be pair(s) of the interrupt ID and the interrupt sensitivity.

For more information about the the DTS file, please refer to this document in the Linux kernel: linux-2.6.x/Documentation/powerpc/booting-without-of.txt


To add extra source code files (for example, to split a large module into 
multiple source files), add the relevant .o files to the list in the local 
Makefile where indicated.
MIT License Copyright (c) 2023 大川搬砖 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

驱动中解析设备节点。 展开 收起
C
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/sdc-coding/device-tree-parse.git
[email protected]:sdc-coding/device-tree-parse.git
sdc-coding
device-tree-parse
device-tree-parse
master

搜索帮助