欧美性猛交xxxx免费看_牛牛在线视频国产免费_天堂草原电视剧在线观看免费_国产粉嫩高清在线观看_国产欧美日本亚洲精品一5区

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評(píng)論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會(huì)員中心
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識(shí)你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

Petalinux2020.01 內(nèi)核DMA驅(qū)動(dòng)調(diào)試說明

C29F_xilinx_inc ? 來源:用戶發(fā)布 ? 作者:用戶發(fā)布 ? 2022-02-16 16:21 ? 次閱讀

1、在用戶設(shè)備樹中 pl-custom中

/delete-node/ &axi_dma_0;
/ {
axi_dma_0: dma@a0000000 {
#dma-cells = ;
clock-names = "s_axi_lite_aclk", "m_axi_mm2s_aclk", "m_axi_s2mm_aclk";
clocks = , , ;
compatible = "xlnx,axi-dma-7.1", "xlnx,axi-dma-1.00.a";
interrupt-names = "mm2s_introut", "s2mm_introut";
interrupt-parent = ;
interrupts = ;
reg = ;
xlnx,addrwidth = ;
xlnx,sg-length-width = ;
dma-channel@a0000000 {
compatible = "xlnx,axi-dma-mm2s-channel";
dma-channels = ;
interrupts = ;
xlnx,datawidth = ;
xlnx,device-id = ;
xlnx,include-dre ;
};
dma-channel@a0000030 {
compatible = "xlnx,axi-dma-s2mm-channel";
dma-channels = ;
interrupts = ;
xlnx,datawidth = ;
xlnx,device-id = ;
xlnx,include-dre ;
};
};
};

2 、在用戶system-user中

/include/ "system-conf.dtsi"
/include/ "pl-custom.dtsi"
/ {
axidma_chrdev: axidma_chrdev@0 {
compatible = "xlnx,axidma-chrdev";
dmas = ;
dma-names = "tx_channel", "rx_channel";
};
};

&axi_dma_0 {
dma-coherent;
status = "okay";
};

3、device-tree.bbappend

SRC_URI += "file://system-user.dtsi"
SRC_URI += "file://pl-custom.dtsi"

4 、teminal

petalinux-create -t modules -n xilinx-axidma --enable

5 、github上下載dma驅(qū)動(dòng),xilinx_axidma-master.zip 并解壓,由于內(nèi)核的改變,對下列部分文件做出改變。
(1) makefile

DRIVER_NAME = xilinx-axidma
$(DRIVER_NAME)-objs = axi_dma.o axidma_chrdev.o axidma_dma.o axidma_of.o
obj-m := $(DRIVER_NAME).o

(2)xilinx-axidma.bb

SRC_URI = "file://Makefile \
file://axi_dma.c \
file://axidma_chrdev.c \
file://axidma_dma.c \
file://axidma_of.c \
file://axidma.h \
file://axidma_ioctl.h \
file://COPYING \

(3)axi_dma.c

#include
// new

(4)axidma_chrdev.c
linux 內(nèi)核4.x到5.x,參數(shù)減少,查看內(nèi)核函數(shù),無影響
https://elixir.bootlin.com/linux/v4.9.251/source/include/linux/of_device.h
https://elixir.bootlin.com/linux/v4.9.251/source/include/linux/uaccess.h

在 static bool axidma_access_ok(const void __user *arg, size_t size, bool readonly)函數(shù)中

// if (!readonly && !access_ok(VERIFY_WRITE, arg, size)) {
if (!readonly && !access_ok(arg, size)) {

// } else if (!access_ok(VERIFY_READ, arg, size)) {
} else if (!access_ok(arg, size)) {

//of_dma_configure(struct device->dev, NULL);
of_dma_configure(struct device->dev, NULL,true);

(5)axidma_dma.c

#include
// new

static void axidma_dma_callback(void *data)
struct kernel_siginfo sig_info;

6、petalinux-build petalinux-build --sdk petalinux-package --sysroot

7、配置qt的環(huán)境。

8 qt 將example中的axidma_benchmark.c復(fù)制到qt,并添加其他所需文件。

(1)**.pro
SOURCES += \
gpio.cpp \
libaxidma.c \
main.cpp \
util.c

HEADERS += \
axidma_ioctl.h \
conversion.h \
gpio.h \
libaxidma.h \
util.h

(2)main.cpp() 由于是將C文件改為c++文件,所以此文件中這個(gè)函數(shù)需要做改變((void *)和(char *)相同)

static int single_transfer_test(axidma_dev_t dev, int tx_channel, void *tx_buf,
int tx_size, struct axidma_video_frame *tx_frame, int rx_channel,
void *rx_buf, int rx_size, struct axidma_video_frame *rx_frame)
{
int rc;

// Initialize the buffer region we're going to transmit
init_data((char *)tx_buf, (char *)rx_buf, tx_size, rx_size);

// Perform the DMA transaction
rc = axidma_twoway_transfer(dev, tx_channel, (char *)tx_buf, tx_size, tx_frame,
rx_channel, (char *)rx_buf, rx_size, rx_frame, true);
if (rc return rc;
}

// Verify that the data in the buffer changed
return verify_data((char *)tx_buf, (char *)rx_buf, tx_size, rx_size);
}

(3)在所有的 **.h中,為了使用QT的類功能,盡量用C++編程,對C文件的頭文件做如下改變。

#ifdef __cplusplus
extern "C"{
#endif

......

#endif /* UTIL_H_ */

#ifdef __cplusplus
}
#endif

9、加載驅(qū)動(dòng)

root@u3_save:/lib/modules/5.4.0-xilinx-v2020.1/extra# insmod xilinx-axidma.ko
[ 1637.846215] axidma: axidma_dma.c: axidma_dma_init: 725: DMA: Found 1 transmit channels and 1 receive channels.
[ 1637.856240] axidma: axidma_dma.c: axidma_dma_init: 727: VDMA: Found 0 transmit channels and 0 receive channels.

10、測試 因?yàn)閐ma的輸入輸出并沒有還起來,所以只能看到發(fā)出去,看不到接收的

root@u3_save:/mnt# ./u3_dma_save
AXI DMA Benchmark Parameters:
Transmit Buffer Size: 7.91 MiB
R[ 1661.465441] axidma axidma: DMA mask not set
eceive Buffer Size: 7.91 MiB
Number of DMA Transfers: 1000 transfers

Using transmit channel 0 and receive channel 1.
[ 1671.710879] axidma: axidma_dma.c: axidma_start_transfer: 309: DMA receive transaction timed out.
[ 1672.719678] xilinx-vdma a0000000.dma: Cannot stop channel 00000000145aa465: 0
Failed to perform the AXI DMA read-write transfer: Timer expired

11、當(dāng)使用環(huán)回時(shí)

root@u3_dma_test:/# ./mnt/u3_dma_save
AXI DMA Benchmark Parameters:
Transmit Buffer Size: 7.91 MiB
Receive Buffer Size: 7.91 MiB
Number of DMA Transfers: 1000 transfers

Using transmit channel 0 and receive channel 1.
Single transfer test successfully completed!
Beginning performance analysis of the DMA engine.

DMA Timing Statistics:
Elapsed Time: 41.49 s
Transmit Throughput: 190.66 MiB/s
Receive Throughput: 190.66 MiB/s
Total Throughput: 381.32 MiB/s
root@u3_dma_test:/#

13、qt and opencv 的配置
(1)安裝sdk.sh
(2)在qt的pro中添加

INCLUDEPATH += /home/lcl/Soft/Sdk/sysroots/aarch64-xilinx-linux/usr/include

LIBS += \
-lopencv_imgcodecs \
-lopencv_highgui \
-lopencv_imgproc \
-lopencv_core \

即可。

14、接口改為128

root@u3_dma_test:/# ./mnt/u3_dma_save
AXI DMA Benchmark Parameters:
Transmit Buffer Size: 16.00 MiB
Receive Buffer Size: 16.00 MiB
Number of DMA Transfers: 1000 transfers

Using transmit channel 0 and receive channel 1.
Elapsed Time: 0.25 s
Single transfer test successfully completed!
Beginning performance analysis of the DMA engine.

DMA Timing Statistics:
Elapsed Time: 12.39 s
Transmit Throughput: 1291.32 MiB/s
Receive Throughput: 1291.32 MiB/s
Total Throughput: 2582.65 MiB/s
root@u3_dma_test:/#

15、第一個(gè)Elapsed Time: 0.25 s是當(dāng)我把數(shù)據(jù)從緩沖區(qū)復(fù)制到其他位置消耗的時(shí)間,也就是16MB的數(shù)據(jù)需要250ms的時(shí)間,速率也就在60M左右,也驗(yàn)證以前的貼子,dma的實(shí)現(xiàn)方式(UIO或者內(nèi)核驅(qū)動(dòng))與數(shù)據(jù)從緩沖區(qū)copy到別的地方的速率是沒有關(guān)系的。

16、速度慢是緩沖區(qū)的問題 https://github.com/bperez77/xilinx_axidma/issues/69
(1)在設(shè)備樹中
/include/ "system-conf.dtsi"
/include/ "pl-custom.dtsi"
/ {

axidma_chrdev: axidma_chrdev@0 {
compatible = "xlnx,axidma-chrdev";
dmas = ;
dma-names = "tx_channel", "rx_channel";
dma-coherent;
};
&axi_dma_0 {
dma-coherent;
status = "okay";
};

在測試代碼中加速加入測速代碼
......
rc = single_transfer_test(axidma_dev, tx_channel, tx_buf, tx_size,
tx_frame, rx_channel, rx_buf, rx_size, rx_frame);
if (rc goto free_rx_buf;
}

struct timeval start_time0, end_time0;
double elapsed_time0;
// Begin timing
gettimeofday(&start_time0, NULL);
memcpy(image_mid0, rx_buf, 2048*4096*4);
gettimeofday(&end_time0, NULL);
elapsed_time0 = TVAL_TO_SEC(end_time0) - TVAL_TO_SEC(start_time0);
printf("\tElapsed Time0: %0.2f s\n", elapsed_time0);

struct timeval start_time1, end_time1;
double elapsed_time1;
// Begin timing
gettimeofday(&start_time1, NULL);
memcpy(image_mid1, image_mid0, 2048*4096*4);
gettimeofday(&end_time1, NULL);
elapsed_time1 = TVAL_TO_SEC(end_time1) - TVAL_TO_SEC(start_time1);
printf("\tElapsed Time1: %0.2f s\n", elapsed_time1);

(3)測試結(jié)果
root@u3_dma_test:/# ./mnt/u3_dma_save
AXI DMA Benchmark Parameters:
Transmit Buffer Size: 32.00 MiB
[ 84.709677] axidma axidma: DMA mask not set
Receive Buffer Size: 32.00 MiB
Number of DMA Transfers: 1000 transfers

Using transmit channel 0 and receive channel 1.
Elapsed Time0: 0.07 s
Elapsed Time1: 0.07 s
Single transfer test successfully completed!
Beginning performance analysis of the DMA engine.

DMA Timing Statistics:
Elapsed Time: 24.75 s
Transmit Throughput: 1292.82 MiB/s
Receive Throughput: 1292.82 MiB/s
Total Throughput: 2585.64 MiB/s
root@u3_dma_test:/#

最后測得速率 32MB/70ms=450MB。
17、雖然速度是提高了,但是讀寫的數(shù)據(jù)是不對的
https://forums.xilinx.com/t5/%E5%B5%8C%E5%85%A5%E5%BC%8F-%E7%A1%AC%E4%BB...
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842098/Zynq+Ultr...

審核編輯:符乾江

聲明:本文內(nèi)容及配圖由入駐作者撰寫或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點(diǎn)僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問題,請聯(lián)系本站處理。 舉報(bào)投訴
  • 驅(qū)動(dòng)
    +關(guān)注

    關(guān)注

    12

    文章

    1853

    瀏覽量

    85699
  • Linux
    +關(guān)注

    關(guān)注

    87

    文章

    11352

    瀏覽量

    210548
收藏 人收藏

    評(píng)論

    相關(guān)推薦

    ZYNQ基礎(chǔ)---AXI DMA使用

    前言 在ZYNQ中進(jìn)行PL-PS數(shù)據(jù)交互的時(shí)候,經(jīng)常會(huì)使用到DMA,其實(shí)在前面的ZYNQ學(xué)習(xí)當(dāng)中,也有學(xué)習(xí)過DMA的使用,那就是通過使用自定義的IP,完成HP接口向內(nèi)存寫入和讀取數(shù)據(jù)的方式。同樣
    的頭像 發(fā)表于 01-06 11:13 ?587次閱讀
    ZYNQ基礎(chǔ)---AXI <b class='flag-5'>DMA</b>使用

    rk3566-pwm內(nèi)核驅(qū)動(dòng)

    rk3566-pwm內(nèi)核驅(qū)動(dòng)
    發(fā)表于 01-05 09:18 ?0次下載

    如何在Petalinux下Patch u-boot源碼

    在軟件開發(fā)過程中我們經(jīng)常遇到用 Patch 來傳遞和更新代碼的場景。本文以一個(gè)端到端的例子來演示在 Petalinux 使用過程中,如何給 u-boot 的源碼生成 Patch 并在 Petalinux 中編譯。
    的頭像 發(fā)表于 12-04 16:26 ?1185次閱讀
    如何在<b class='flag-5'>Petalinux</b>下Patch u-boot源碼

    嵌入式工程師都在找的【Linux內(nèi)核調(diào)試技術(shù)】建議收藏!

    ,我們可以定位到導(dǎo)致系統(tǒng)不穩(wěn)定的具體代碼位置。然后,根據(jù)這些信息對內(nèi)核代碼進(jìn)行修復(fù)和優(yōu)化。 調(diào)試結(jié)果經(jīng)過上述調(diào)試過程,我們發(fā)現(xiàn)SPI控制器驅(qū)動(dòng)中存在一個(gè)競態(tài)條件,導(dǎo)致在數(shù)據(jù)傳輸過程
    發(fā)表于 11-28 15:37

    DMA是什么?詳細(xì)介紹

    DMA(Direct Memory Access)是一種允許某些硬件子系統(tǒng)直接訪問系統(tǒng)內(nèi)存的技術(shù),而無需中央處理單元(CPU)的介入。這種技術(shù)可以顯著提高數(shù)據(jù)傳輸速率,減輕CPU的負(fù)擔(dān),并提高整體
    的頭像 發(fā)表于 11-11 10:49 ?1.2w次閱讀

    elmo直線電機(jī)驅(qū)動(dòng)調(diào)試細(xì)則

    elmo驅(qū)動(dòng)直線電機(jī)調(diào)試步驟及參數(shù)整定
    發(fā)表于 11-04 17:43 ?11次下載

    如何調(diào)試伺服驅(qū)動(dòng)

    伺服驅(qū)動(dòng)器的重要性:在自動(dòng)化和精密控制領(lǐng)域,伺服驅(qū)動(dòng)器是實(shí)現(xiàn)精確運(yùn)動(dòng)控制的關(guān)鍵組件。 調(diào)試的目的:確保伺服驅(qū)動(dòng)器與電機(jī)匹配,提高系統(tǒng)性能,減少故障率。 1. 了解伺服
    的頭像 發(fā)表于 11-04 15:00 ?667次閱讀

    linux內(nèi)核中通用HID觸摸驅(qū)動(dòng)

    在linux內(nèi)核中,為HID觸摸面板實(shí)現(xiàn)了一個(gè)通用的驅(qū)動(dòng)程序,位于/drivers/hid/hid-multitouch.c文件中。hid觸摸驅(qū)動(dòng)是以struct hid_driver實(shí)現(xiàn),首先定義一個(gè)描述hid觸摸
    的頭像 發(fā)表于 10-29 10:55 ?1037次閱讀
    linux<b class='flag-5'>內(nèi)核</b>中通用HID觸摸<b class='flag-5'>驅(qū)動(dòng)</b>

    linux驅(qū)動(dòng)程序如何加載進(jìn)內(nèi)核

    在Linux系統(tǒng)中,驅(qū)動(dòng)程序是內(nèi)核與硬件設(shè)備之間的橋梁。它們允許內(nèi)核與硬件設(shè)備進(jìn)行通信,從而實(shí)現(xiàn)對硬件設(shè)備的控制和管理。 驅(qū)動(dòng)程序的編寫 驅(qū)動(dòng)
    的頭像 發(fā)表于 08-30 15:02 ?611次閱讀

    STC串口驅(qū)動(dòng)調(diào)試程序

    STC的串口驅(qū)動(dòng)調(diào)試程序。
    發(fā)表于 07-08 14:23 ?3次下載

    SPI+DMA方式驅(qū)動(dòng)ADC芯片

    有SPI+DMA方式驅(qū)動(dòng)ADC芯片的例程嗎
    發(fā)表于 04-26 17:53

    AOSP源碼定制-內(nèi)核驅(qū)動(dòng)編寫

    有時(shí)候?yàn)榱朔治鲆恍さ臋z測,需要在內(nèi)核層面對讀寫相關(guān)的操作進(jìn)行監(jiān)控,每次去修改對應(yīng)的內(nèi)核源碼編譯重刷過于耗時(shí)耗力,這里就來嘗試編寫一個(gè)內(nèi)核驅(qū)動(dòng),載入后監(jiān)控讀寫。
    的頭像 發(fā)表于 04-23 11:15 ?1428次閱讀
    AOSP源碼定制-<b class='flag-5'>內(nèi)核</b><b class='flag-5'>驅(qū)動(dòng)</b>編寫

    調(diào)試STM32的adc單通道DMA傳輸時(shí),DMA傳輸后就出現(xiàn)值變了的原因?

    這次在調(diào)試STM32的adc單通道DMA傳輸時(shí)出現(xiàn)了一個(gè)很大的問題。 直接去讀取ADC的DR是沒問題的,但是過來DMA傳輸后就出現(xiàn)值變了。 printf(\"
    發(fā)表于 04-22 06:03

    Linux DMA子系統(tǒng)驅(qū)動(dòng)開發(fā)

    Streaming DMA在訪問內(nèi)存地址時(shí)經(jīng)過cache,是non-coherence設(shè)備,通常采用streaming mapping的API進(jìn)行內(nèi)存申請,在單次DMA傳輸時(shí)進(jìn)行map,在傳輸完成后進(jìn)行unmap;
    發(fā)表于 04-07 14:38 ?969次閱讀
    Linux <b class='flag-5'>DMA</b>子系統(tǒng)<b class='flag-5'>驅(qū)動(dòng)</b>開發(fā)

    什么是DMADMA究竟有多快!

    直接內(nèi)存訪問(Direct Memory Access,DMA):在計(jì)算機(jī)體系結(jié)構(gòu)中,DMA 是一種數(shù)據(jù)傳輸方式,允許外部設(shè)備直接訪問計(jì)算機(jī)的內(nèi)存,而無需通過中央處理單元(CPU)的干預(yù)。這有
    的頭像 發(fā)表于 02-22 10:43 ?2283次閱讀
    什么是<b class='flag-5'>DMA</b>?<b class='flag-5'>DMA</b>究竟有多快!