Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
8f980ea9
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8f980ea9
编写于
7月 23, 2021
作者:
O
openharmony_ci
提交者:
Gitee
7月 23, 2021
浏览文件
操作
浏览文件
下载
差异文件
!431 Gitee Review - FixDocsBug
Merge pull request !431 from duxbbo/FixDocsBug
上级
94a20f91
4e8a86b5
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
381 addition
and
377 deletion
+381
-377
zh-cn/device-dev/porting/Readme-CN.md
zh-cn/device-dev/porting/Readme-CN.md
+2
-2
zh-cn/device-dev/porting/figure/HDF_WIFI.png
zh-cn/device-dev/porting/figure/HDF_WIFI.png
+0
-0
zh-cn/device-dev/porting/standard-system-porting-guide.md
zh-cn/device-dev/porting/standard-system-porting-guide.md
+378
-374
zh-cn/readme.md
zh-cn/readme.md
+1
-1
未找到文件。
zh-cn/device-dev/porting/Readme-CN.md
浏览文件 @
8f980ea9
# 开发板移植
# 开发板移植
目前OpenHarmony已经成立了SIG组
[
sig-devboard
](
https://gitee.com/openharmony/community/blob/master/sig/sig-devboard/sig_devboard_cn.md
)
。该SIG组以支持更多第三方开发板为目标,提供开发板移植的支撑。
目前OpenHarmony已经成立了SIG组
[
sig-devboard
](
https://gitee.com/openharmony/community/blob/master/sig/sig-devboard/sig_devboard_cn.md
)
。该SIG组以支持更多第三方开发板为目标,提供开发板移植的支撑。
...
@@ -24,5 +23,6 @@ repo init -u https://gitee.com/openharmony-sig/manifest.git -b master -m devboar
...
@@ -24,5 +23,6 @@ repo init -u https://gitee.com/openharmony-sig/manifest.git -b master -m devboar
-
[
轻量级系统
](
transplant-minichip.md
)
-
[
轻量级系统
](
transplant-minichip.md
)
-
[
小型系统
](
transplant-smallchip.md
)
-
[
小型系统
](
transplant-smallchip.md
)
-
[
标准系统
](
standard_system_porting_guide.md
)
-
[
标准系统
](
standard-system-porting-guide.md
)
zh-cn/device-dev/porting/figure/HDF_WIFI.png
查看替换文件 @
94a20f91
浏览文件 @
8f980ea9
58.7 KB
|
W:
|
H:
21.5 KB
|
W:
|
H:
2-up
Swipe
Onion skin
zh-cn/device-dev/porting/standard
_system_porting_
guide.md
→
zh-cn/device-dev/porting/standard
-system-porting-
guide.md
浏览文件 @
8f980ea9
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
`./build.sh --product-name MyProduct `
`./build.sh --product-name MyProduct `
构建完成后,可以在如下目录看到构建出来的OpenHarmony镜像文件
构建完成后,可以在如下目录看到构建出来的OpenHarmony镜像文件
:
`//out/ohos-arm-release/packages/phone/images`
`//out/ohos-arm-release/packages/phone/images`
...
@@ -98,7 +98,7 @@
...
@@ -98,7 +98,7 @@
}
,
}
,
```
```
接着需要修改定义产品的配置文件
`//productdefine/common/products/MyProduct.json`
。将刚刚定义的子系统加入到产品中
接着需要修改定义产品的配置文件
`//productdefine/common/products/MyProduct.json`
。将刚刚定义的子系统加入到产品中
。
### 2. 编译内核
### 2. 编译内核
...
@@ -107,7 +107,7 @@
...
@@ -107,7 +107,7 @@
目前OpenHarmony源码中提供了Linux 4.19的内核,归档在
`//kernel/linux-4.19`
。请尽可能使用这个内核。
目前OpenHarmony源码中提供了Linux 4.19的内核,归档在
`//kernel/linux-4.19`
。请尽可能使用这个内核。
每个SOC必然需要对内核做一些修改或扩展,建议采用补丁的方式。
每个SOC必然需要对内核做一些修改或扩展,建议采用补丁的方式。
建议的目录结构
建议的目录结构
如下:
```
```
├── build
├── build
│ ├── kernel
│ ├── kernel
...
@@ -181,7 +181,7 @@ root {
...
@@ -181,7 +181,7 @@ root {
}
}
```
```
更详细的驱动开发指导,请参考
[
LCD
](
https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/driver/LCD.md
)
更详细的驱动开发指导,请参考
[
LCD
](
https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/driver/LCD.md
)
。
### 2. 触摸屏
### 2. 触摸屏
本节描述如何移植触摸屏驱动。触摸屏的驱动被放置在
`//drivers/framework/model/input/driver/touchscreen`
目录中。移植触摸屏驱动主要工作是向系统注册ChipDevice模型实例。
本节描述如何移植触摸屏驱动。触摸屏的驱动被放置在
`//drivers/framework/model/input/driver/touchscreen`
目录中。移植触摸屏驱动主要工作是向系统注册ChipDevice模型实例。
...
@@ -189,7 +189,7 @@ root {
...
@@ -189,7 +189,7 @@ root {
-
创建触摸屏器件驱动
-
创建触摸屏器件驱动
在目录中创建名为
`touch_ic_name.c`
的文件。代码模板如下:
在目录中创建名为
`touch_ic_name.c`
的文件。代码模板如下:
注意:请替换ic_name为你所适配芯片的名称
注意:请替换ic_name为你所适配芯片的名称
。
```
C
```
C
#include "hdf_touch.h"
#include "hdf_touch.h"
...
@@ -213,7 +213,7 @@ struct HdfDriverEntry g_touchXXXXChipEntry = {
...
@@ -213,7 +213,7 @@ struct HdfDriverEntry g_touchXXXXChipEntry = {
HDF_INIT(g_touchXXXXChipEntry);
HDF_INIT(g_touchXXXXChipEntry);
```
```
其中ChipDevice中要提供若干方法
其中ChipDevice中要提供若干方法
:
| 方法| 实现说明|
| 方法| 实现说明|
|------|------|
|------|------|
|int32_t (
*Init)(ChipDevice *
device)| 器件初始化|
|int32_t (
*Init)(ChipDevice *
device)| 器件初始化|
...
@@ -239,16 +239,16 @@ HDF_INIT(g_touchXXXXChipEntry);
...
@@ -239,16 +239,16 @@ HDF_INIT(g_touchXXXXChipEntry);
}
}
```
```
更详细的驱动开发指导,请参考
[
TOUCHSCREEN
](
https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/driver/TOUCHSCREEN.md
)
更详细的驱动开发指导,请参考
[
TOUCHSCREEN
](
https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/driver/TOUCHSCREEN.md
)
。
### 3. WLAN
### 3. WLAN

Wi-Fi驱动分为两部分,一部分负责管理WLAN设备,另一个部分负责处理WLAN流量。
`HDF WLAN`
分别为这两部分做了抽象。目前支持SDIO接口的WLAN芯片。
Wi-Fi驱动分为两部分,一部分负责管理WLAN设备,另一个部分负责处理WLAN流量。
`HDF WLAN`
分别为这两部分做了抽象。目前支持SDIO接口的WLAN芯片
<img
src=
"./figure/HDF_WIFI.png"
alt=
"Wi-Fi结构图"
width=
"800"
/>
主要需要实现的接口有:
支持一款芯片的主要工作是实现一个ChipDriver驱动。实现HDF_WLAN_CORE和NetDevice提供的接口。主要需要实现的接口有:
| 接口| 定义头文件| 说明|
| 接口| 定义头文件| 说明|
|------|------|------|
|------|------|------|
...
@@ -259,7 +259,9 @@ Wi-Fi驱动分为两部分,一部分负责管理WLAN设备,另一个部分
...
@@ -259,7 +259,9 @@ Wi-Fi驱动分为两部分,一部分负责管理WLAN设备,另一个部分
建议适配按如下步骤操作:
建议适配按如下步骤操作:
1.
创建HDF驱动
1.
创建HDF驱动
建议将代码放置在
`//device/MySoCVendor/peripheral/wifi/chip_name/`
建议将代码放置在
`//device/MySoCVendor/peripheral/wifi/chip_name/`
。
文件模板如下:
```
C
```
C
static int32_t HdfWlanHisiChipDriverInit(struct HdfDeviceObject *device) {
static int32_t HdfWlanHisiChipDriverInit(struct HdfDeviceObject *device) {
...
@@ -282,7 +284,7 @@ struct HdfDriverEntry g_hdfXXXChipEntry = {
...
@@ -282,7 +284,7 @@ struct HdfDriverEntry g_hdfXXXChipEntry = {
HDF_INIT(g_hdfXXXChipEntry);
HDF_INIT(g_hdfXXXChipEntry);
```
```
在CreateChipDriverFactory中
,需要创建一个HdfChipDriverFactory
在CreateChipDriverFactory中
需要创建一个HdfChipDriverFactory,接口如下:
| 接口| 说明|
| 接口| 说明|
|------|------|
|------|------|
|const char
*
driverName| 当前driverName |
|const char
*
driverName| 当前driverName |
...
@@ -306,9 +308,10 @@ HdfChipDriver需要实现的接口有
...
@@ -306,9 +308,10 @@ HdfChipDriver需要实现的接口有
2.
编写配置文件,描述驱动支持的设备
2.
编写配置文件,描述驱动支持的设备
在产品配置目录下创建芯片的配置文件
`//vendor/MyProductVendor/MyProduct/config/wifi/wlan_chip_chip_name.hcs`
注意: 路径中的vendor_name、product_name、chip_name请替换成实际名称
在产品配置目录下创建芯片的配置文件
`//vendor/MyProductVendor/MyProduct/config/wifi/wlan_chip_chip_name.hcs`
。
注意: 路径中的vendor_name、product_name、chip_name请替换成实际名称。
模板如下:
```
hcs
```
hcs
root {
root {
wlan_config {
wlan_config {
...
@@ -330,6 +333,7 @@ root {
...
@@ -330,6 +333,7 @@ root {
产品的所有设备信息被定义在文件
`//vendor/MyProductVendor/MyProduct/config/device_info/device_info.hcs`
中。修改该文件,在名为network的host中,名为device_wlan_chips的device中增加配置。
产品的所有设备信息被定义在文件
`//vendor/MyProductVendor/MyProduct/config/device_info/device_info.hcs`
中。修改该文件,在名为network的host中,名为device_wlan_chips的device中增加配置。
注意:moduleName 要与触摸屏驱动中的moduleName相同。
注意:moduleName 要与触摸屏驱动中的moduleName相同。
模板如下:
```
hcs
```
hcs
deviceN :: deviceNode {
deviceN :: deviceNode {
...
@@ -354,21 +358,21 @@ config DRIVERS_WLAN_XXX
...
@@ -354,21 +358,21 @@ config DRIVERS_WLAN_XXX
Answer Y to enable XXX Host driver. Support chip xxx
Answer Y to enable XXX Host driver. Support chip xxx
```
```
接着修改文件
`//drivers/adapter/khdf/linux/model/network/wifi/Kconfig`
,在文件末尾加入如下代码将配置菜单加入内核中
接着修改文件
`//drivers/adapter/khdf/linux/model/network/wifi/Kconfig`
,在文件末尾加入如下代码将配置菜单加入内核中
。如:
```
```
source "../../../../../device/MySoCVendor/peripheral/Kconfig"
source "../../../../../device/MySoCVendor/peripheral/Kconfig"
```
```
-
创建构建脚本
-
创建构建脚本
在
`//drivers/adapter/khdf/linux/model/network/wifi/Makefile`
文件末尾增加配置,模板如下
在
`//drivers/adapter/khdf/linux/model/network/wifi/Makefile`
文件末尾增加配置,模板如下
:
```
```
HDF_DEVICE_ROOT := $(HDF_DIR_PREFIX)/../device
HDF_DEVICE_ROOT := $(HDF_DIR_PREFIX)/../device
obj-$(CONFIG_DRIVERS_WLAN_XXX) += $(HDF_DEVICE_ROOT)/MySoCVendor/peripheral/build/standard/
obj-$(CONFIG_DRIVERS_WLAN_XXX) += $(HDF_DEVICE_ROOT)/MySoCVendor/peripheral/build/standard/
```
```
当在内核中开启
`DRIVERS_WLAN_XXX`
开关时,会调用
`//device/MySoCVendor/peripheral/build/standard/`
中的makefile
当在内核中开启
`DRIVERS_WLAN_XXX`
开关时,会调用
`//device/MySoCVendor/peripheral/build/standard/`
中的makefile
。
更多详细的开发手册,请参考
[
WLAN开发
](
https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/driver/WLAN.md
)
更多详细的开发手册,请参考
[
WLAN开发
](
https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/driver/WLAN.md
)
。
\ No newline at end of file
zh-cn/readme.md
浏览文件 @
8f980ea9
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
- porting:移植适配
- porting:移植适配
- [三方库移植指导](device-dev/porting/transplant-thirdparty.md)
- [三方库移植指导](device-dev/porting/transplant-thirdparty.md)
- [标准系统芯片移植指导](device-dev/porting/standard
_system_porting_
guide.md)
- [标准系统芯片移植指导](device-dev/porting/standard
-system-porting-
guide.md)
- bundles:组件开发
- bundles:组件开发
- [组件开发规范](device-dev/bundles/bundles-standard-rules.md)
- [组件开发规范](device-dev/bundles/bundles-standard-rules.md)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录