點(diǎn)擊藍(lán)字 ╳ 關(guān)注我們
陸道
誠邁科技高級(jí)技術(shù)專家
簡介
如何添加新的開發(fā)板進(jìn)行編譯
{
"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移植
先進(jìn)入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}
把設(shè)備樹放到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
分區(qū)表
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
根文件系統(tǒng)
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調(diào)試適配
"setparamsys.usb.controllerfcc00000.dwc3"
總結(jié)
參考鏈接
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
原文標(biāo)題:開發(fā)板如何適配OpenHarmony 3.2
文章出處:【微信公眾號(hào):OpenAtom OpenHarmony】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。
-
鴻蒙
+關(guān)注
關(guān)注
57文章
2352瀏覽量
42863 -
OpenHarmony
+關(guān)注
關(guān)注
25文章
3722瀏覽量
16323
原文標(biāo)題:開發(fā)板如何適配OpenHarmony 3.2
文章出處:【微信號(hào):gh_e4f28cfa3159,微信公眾號(hào):OpenAtom OpenHarmony】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論