点击蓝字 ╳ 关注我们
陆道
诚迈科技高级技术专家
简介
如何添加新的开发板进行编译
{
"product_name": "hongzos_rk3568",
"device_company": "rockchip",
"device_build_path": "device/board/archermind/rk3568",
"target_cpu": "arm",
"type": "standard",
"version": "3.0",
"board":"rk3568",
U-Boot移植
gitclonehttps://github.com/rockchip-linux/u-boot.git
RKBIN_TOOLS=rkbin/tools
#include "boot_rkimg.h"
#define BLK_CNT(_num_bytes, _block_size)
((_num_bytes + _block_size - 1) / _block_size)
static char* load_ramdisk_from_partition(void *buffer)
{
struct blk_desc *desc = rockchip_get_bootdev();
disk_partition_t part_ramdisk_boot;
static char initrd_str[28];
long blk_cnt = 0, blks_read = 0;
long blk_start = 0;
if (part_get_info_by_name(desc, "ramdisk", &part_ramdisk_boot) < 0) {
printf("No ramdisk partition
");
return NULL;
}
blk_cnt = part_ramdisk_boot.size;
blk_start = part_ramdisk_boot.start;
printf("Load from partition ' ramdisk ' to address 0x%p, count: %ld total block(s) by ludao
", buffer, blk_cnt);
blks_read = blk_dread(desc, blk_start, blk_cnt, buffer);
if (blks_read != blk_cnt) {
return NULL;
}
printf("Read from partition ' ramdisk ' done, from 0x%lx total block(s) 0x%lx
", blk_start, blk_cnt);
sprintf(initrd_str, "0x%p:0x%lx", buffer, blk_cnt*(part_ramdisk_boot.blksz));
printf("Openharmony ramdisk_addr_r = %s
", initrd_str);
return initrd_str;
}
static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
if (label->initrd) {
if (get_relfile_envaddr(cmdtp, label->initrd, "ramdisk_addr_r") < 0) {
printf("Skipping %s for failure retrieving initrd
",
label->name);
return 1;
}
bootm_argv[2] = initrd_str;
strncpy(bootm_argv[2], env_get("ramdisk_addr_r"), 18);
strcat(bootm_argv[2], ":");
strncat(bootm_argv[2], env_get("filesize"), 9);
}else{
void *buffer = (void *)env_get_ulong("ramdisk_addr_r", 16, 0);
bootm_argv[2] = load_ramdisk_from_partition(buffer);
if(bootm_argv[2]){
printk("initrd = %s
", bootm_argv[2]);
}
}
./make.shCROSS_COMPILE=aarch64-linux-gnu-rk3568
Linux-5.10移植
先进入kernel/linux/linux-5.10目录
patch -p1 < kernel/linux/patches/linux-5.10/rk3568_patch/kernel.patch
修改device/board/hihope/rk3568/kernel/build_kernel.sh
注释掉
//patch-p1< ${KERNEL_PATCH}
把设备树放到kernel/linux/linux-5.10/arch/arm64/boot/dts/rockchip/目录
修改kernel/linux/linux-5.10/ make-ohos.sh
model_list=(
"TB-RK3568X0 arm64 0xfe660000 rk3568-toybrick-x0-linux Image rockchip_linux_defconfig"
"TB-RK3568X10 arm64 0xfe660000 rk3568-toybrick-x10-linux Image rockchip_linux_defconfig"
)
CONFIG_DRM_PANEL_SIMPLE = y
kernel/linux/linux-5.10/drivers/gpu/drm/panel/panel-simple.c
注释掉
//intpanel_simple_loader_protect(structdrm_panel*panel)
cmdline="appendearlycon=uart8250,mmio32,${uart}root=PARTUUID=614e0000-0000-4b53-8000-1d28000054a9rwrootwaitrootfstype=ext4
分区表
FIRMWARE_VER:11.0
MACHINE_MODEL:rk3568_r
MACHINE_ID:007
MANUFACTURER: rockchip
MAGIC: 0x5041524B
ATAG: 0x00200800
MACHINE: rk3568_r
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
TYPE: GPT
CMDLINE:mtdparts=rk29xxnand:0x00002000@0x00002000(uboot),0x00002000@0x00004000(misc),0x00003000@0x00006000(resource),0x00030000@0x00009000(boot_linux:bootable),0x00002000@0x00039000(ramdisk),0x00400000@0x0003B000(system),0x00200000@0x0043B000(vendor),0x00019000@0x0063B000(sys-prod),0x00019000@0x00654000(chip-prod),0x00010000@0x0066D000(updater),-@0x0067D000(userdata:grow)
uuid:system=614e0000-0000-4b53-8000-1d28000054a9
uuid:boot_linux=a2d37d82-51e0-420d-83f5-470db993dd35
# fstab file.
#
/dev/block/platform/fe310000.sdhci/by-name/system /usr ext4 ro,barrier=1 wait,required
/dev/block/platform/fe310000.sdhci/by-name/vendor /vendor ext4 ro,barrier=1 wait,required
/dev/block/platform/fe310000.sdhci/by-name/sys-prod /sys_prod ext4 ro,barrier=1 wait
/dev/block/platform/fe310000.sdhci/by-name/chip-prod /chip_prod ext4 ro,barrier=1 wait
/dev/block/platform/fe310000.sdhci/by-name/userdata /data f2fs discard,noatime,nosuid,nodev,fscrypt=2aes-256-xts wait,check,fileencryption=software,quota
/dev/block/platform/fe310000.sdhci/by-name/misc/miscnonenonewait,required
根文件系统
image_list += [
"ramdisk",
"updater_ramdisk",
]
显示模块适配
&dsi1 {
status = "okay";
//rockchip,lane-rate = <200>;
dsi1_panel: panel@0 {
status = "okay";
compatible = "simple-panel-dsi";
reg = <0>;
backlight = <&backlight>;
reset-delay-ms = <60>;
enable-delay-ms = <60>;
prepare-delay-ms = <60>;
unprepare-delay-ms = <60>;
disable-delay-ms = <60>;
dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_EOT_PACKET)>;
dsi,format = ;
dsi,lanes = <4>;
panel-init-sequence = [
05 78 01 11
05 14 01 29
];
panel-exit-sequence = [
05 00 01 28
05 00 01 10
];
disp_timings1: display-timings {
native-mode = <&dsi1_timing0>;
dsi1_timing0: timing0 {
clock-frequency = <150000000>;
hactive = <1200>;
vactive = <1920>;
hback-porch = <120>;
hfront-porch = <10>;
vback-porch = <10>;
&hdmi {
status = "okay";
rockchip,phy-table =
<92812500 0x8009 0x0000 0x0270>,
<165000000 0x800b 0x0000 0x026d>,
<185625000 0x800b 0x0000 0x01ed>,
<297000000 0x800b 0x0000 0x01ad>,
<594000000 0x8029 0x0000 0x0088>,
<000000000 0x0000 0x0000 0x0000>;
};
CONFIG_DRM_PANEL_SIMPLE=y
CONFIG_DRM_ANALOGIX_DP=y
CONFIG_DRM_DW_HDMI=y
CONFIG_DRM_DW_HDMI_I2S_AUDIO=y
CONFIG_DRM_DW_HDMI_CEC=y
CONFIG_DRM_DW_MIPI_DSI=y
std::shared_ptr DrmDevice::Create()
{
DISPLAY_DEBUGLOG();
if (mDrmFd == nullptr) {
const std::string name("rockchip");
int drmFd = open("/dev/dri/card0", O_RDWR | O_CLOEXEC); // drmOpen(name.c_str(), nullptr);
}
int32_t DrmDisplay::Init()
{
...
...
ret = preComp->Init(); // gfx初始化,这里需要跳过
DISPLAY_CHK_RETURN((ret != DISPLAY_SUCCESS), DISPLAY_FAILURE, DISPLAY_LOGE("can not init HdiGfxComposition")); // 或者不判断返回值
}
int32_t HdiGfxComposition::vector &layers, HdiLayer &clientLayer)
{
#if 0 // CPU合成
layer->SetDeviceSelect(COMPOSITION_CLIENT);
#else
if ((layer->GetCompositionType() != COMPOSITION_VIDEO) &&
(layer->GetCompositionType() != COMPOSITION_CURSOR)) {
layer->SetDeviceSelect(COMPOSITION_DEVICE);
} else {
layer->SetDeviceSelect(layer->GetCompositionType());
}
#endif
}
constchar*g_drmFileNode="/dev/dri/card0";
gt9xx: gt911@14 {
compatible = "goodix,gt9xx";
reg = <0x14>;
pinctrl-names = "default";
pinctrl-0 = <&tp_gpio>;
goodix_irq_gpio = <&gpio3 RK_PB4 IRQ_TYPE_LEVEL_LOW>;
goodix_rst_gpio = <&gpio3 RK_PB3 GPIO_ACTIVE_HIGH>;
/*touchscreen-inverted-x;*/
status = "okay";
};
//input_set_abs_params(ts->input_dev,ABS_MT_WIDTH_MAJOR,0,255,0,0);
USB调试适配
"setparamsys.usb.controllerfcc00000.dwc3"
总结
参考链接
https://gitee.com/harchermindy/vendor_archermind
https://gitee.com/harchermindy/device_board_archermind
https://gitee.com/harchermindy/uboot-rk-openharmony
https://gitee.com/harchermindy/linux-5.10
原文标题:开发板如何适配OpenHarmony 3.2
文章出处:【微信公众号:OpenAtom OpenHarmony】欢迎添加关注!文章转载请注明出处。
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。
举报投诉
-
鸿蒙
+关注
关注
55文章
1629浏览量
42119 -
OpenHarmony
+关注
关注
23文章
3290浏览量
15159
原文标题:开发板如何适配OpenHarmony 3.2
文章出处:【微信号:gh_e4f28cfa3159,微信公众号:OpenAtom OpenHarmony】欢迎添加关注!文章转载请注明出处。
发布评论请先 登录
相关推荐
OpenHarmony鸿蒙南向开发案例:【智能猫眼(基于3516开发板)】
基于Hi3516开发板,使用开源OpenHarmony开发的RTSP协议流媒体应用。达到将Hi3516开发板中摄像头获取的数据通过RTSP协议传输到手机并显示 。
OpenHarmony开发板汇总
Tiger(A311D)标准系统:DAYU200开发套件(RK3568)标准系统:软通扬帆富设备开发板(RK3399)
系统类型
OpenHarmony支持如下几种系统类型:
轻量系统(mini
发表于 10-19 11:27
标准系统:上海海思Phoenix 开发板(Hi3751V351)
开发板名称(芯片型号)
上海海思Phoenix 开发板(Hi3751V351)
芯片架构
CPU频率
介绍(字数请控制在200字以内)
● TYPEC--Type-c● 植入鸿蒙系统--预置
发表于 10-19 10:59
润开鸿DAYU200及DAYU210联袂通过OpenHarmony 3.2 Release版本兼容性测评
及DAYU210两款开发平台率先完成OpenHarmony 3.2 Release版本适配的详细情况。
润开鸿DAYU200及DAYU210开发
发表于 09-22 11:11
【触觉智能 Purple Pi OH 开发板体验】一、OpenHarmony(鸿蒙系统)开发环境配置以及示例代码
不同HarmonyOS 支持 previewer 预览、模拟器运行、真机运行三种方式;OpenHarmony 支持 previewer 预览、真机(目前主要使用 3516 系列开发板)运行。首先,目前
发表于 08-31 11:03
6步玩转OpenHarmony标准芯片适配
了OpenHarmony系统。完成这一步后,就有了可供各开发者并行开发的基础版本。其他硬件模块的适配,第二、三、四阶段的硬件适配,如图形、W
发表于 08-22 09:10
两百元的OpenHarmony标准系统开发板(软硬件全部开源)
元。它使用的芯片是rk3566,适配的OpenHarmony版本为3.2Release,是目前最便宜的OpenHarmony标准系统开源开发板
深开鸿KHDVK-450A开发板通过OpenHarmony 3.2 Release版本兼容性测评
点击蓝字 ╳ 关注我们 开源项目 OpenHarmony 是每个人的 OpenHarmony 近日,由深圳开鸿数字产业发展有限公司(以下简称“深开鸿”)推出的 KHDVK-450A开发板通过
触觉智能RK3568_OpenHarmony开发板适配
触觉智能RK3568_OpenHarmony开发板适配 2023-5-24 master openharmony 4.0.7.3 openharmo
一加6T适配OpenHarmony 3.2
OpenHarmony-3.2-Release 已发布,并且已经有好一段时间,本次释放一加 6/6T 相关刷机包,主要升级为 OpenHarmony-3.2-Release 正式版并初步支持部分外设功能(如音频播放和蓝牙),及更新内核。
基于RK3588的润开鸿DAYU210旗舰级标准系统开发平台合入OpenHarmony主干
开发者大会2023正式发布OpenHarmony 3.2 Release版本
作为OpenHarmony生态委员会芯片开发板生态组负责单位以
发表于 05-17 14:17
OpenHarmony开发者大会 | 技术分论坛:OpenHarmony 3.2 Release技术底座深度解析
点击蓝字 ╳ 关注我们 开源项目 OpenHarmony 是每个人的 OpenHarmony 4月19日,以“开源正当时,共赢新未来”为主题的开放原子开源基金会OpenHarmony开发
基于RK3588的润开鸿DAYU210旗舰级标准系统开发平台合入OpenHarmony主线
--RK3588的OpenHarmony适配工作,推出基于该芯片的润开鸿HH-SCDAYU210开发平台。 OpenHarmony开发者大会
亿晟科技被评为OpenHarmony生态开发板贡献单位
近日,深圳市亿晟科技有限公司被评为“OpenHarmony生态开发板贡献单位”,并被OpenHarmony项目群工作委员会授予“OpenHarmony生态
评论