From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wes1-so2.wedos.net (wes1-so2.wedos.net [46.28.106.16]) by dpdk.org (Postfix) with ESMTP id 678715A24 for ; Sat, 26 Mar 2016 02:12:34 +0100 (CET) Received: from pcviktorin.fit.vutbr.cz (pcviktorin.fit.vutbr.cz [147.229.13.147]) by wes1-so2.wedos.net (Postfix) with ESMTPSA id 3qX2GB0XmJzT3; Sat, 26 Mar 2016 02:12:34 +0100 (CET) From: Jan Viktorin To: dev@dpdk.org Cc: Thomas Monjalon , Stephen Hemminger , Keith Wiles , david.marchand@6wind.com, jianbo.liu@linaro.org, jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com, Jan Viktorin Date: Sat, 26 Mar 2016 02:12:32 +0100 Message-Id: <1458954760-2333-1-git-send-email-viktorin@rehivetech.com> X-Mailer: git-send-email 2.7.0 Subject: [dpdk-dev] [RFC 0/6] Flattened Device Tree access from DPDK X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2016 01:12:34 -0000 Hello, while extending the DPDK by a kind of platform devices (for the 16.07), an access to the FDT might be necessary (or at least very helpful). This patch series for 16.07 introduces an approach to solve this topic. The API is designed from scratch and there is only the Linux backend for it. The Linux backend can read and traverse the /proc/device-tree structure. The API, however, stays as independent as possible. It is possible to: * open the FDT in a platform independent way (rte_fdt_open/close) * define a path in the FDT in an abstract way (rte_fdt_path) * read strings, 32 and 64 bit values, a binary content (rte_fdt_path_readX) * walk the FDT structure from a selected point (rte_fdt_path_walk) I've included unit tests of the API and of the Linux implemention. Some basic API tests are introduced in the patch 3. Then a simplified device-tree file structure is added together with more tests testing the Linux backend (4,5). I've left those 3 patches separated for now but I think they can be aggregated into a single patch later. Here, I've encounter an issue. The testing FDT files (app/test/linux-fdt) need to be copied (or linked) to the working directory of the _test_ executable. I have no idea, how to integrate such logic into the build system. The API provides a very limited set of access functions. I think, it's as minimalistic as possible while enabling all necessary operations a PMD driver would need. However, some higher level functions would be helpful, too. The patch series is still missing some bits (eg. better error logging). Any comments and suggestions are welcome... Regards Jan Jan Viktorin (6): eal/fdt: introduce Flattened Device Tree API eal/fdt: implement FDT API for Linux eal/fdt: test FDT API eal/fdt: add testing FDT of xgene-1 got from Linux runtime eal/fdt: test Linux implementation on xgene-1 FDT eal/fdt: export for dpdk 16.07 app/test/Makefile | 1 + app/test/linux-fdt/xgene1/#address-cells | Bin 0 -> 4 bytes app/test/linux-fdt/xgene1/#size-cells | Bin 0 -> 4 bytes app/test/linux-fdt/xgene1/compatible | Bin 0 -> 28 bytes app/test/linux-fdt/xgene1/model | Bin 0 -> 25 bytes .../xgene1/soc/ethernet@17020000/local-mac-address | Bin 0 -> 6 bytes .../linux-fdt/xgene1/soc/ethernet@17020000/reg | Bin 0 -> 48 bytes app/test/test_fdt.c | 484 +++++++++++++++++++++ lib/librte_eal/common/Makefile | 2 +- lib/librte_eal/common/eal_common_fdt.c | 317 ++++++++++++++ lib/librte_eal/common/include/rte_fdt.h | 185 ++++++++ lib/librte_eal/linuxapp/eal/Makefile | 3 + lib/librte_eal/linuxapp/eal/eal_fdt.c | 336 ++++++++++++++ lib/librte_eal/linuxapp/eal/rte_eal_version.map | 20 + 14 files changed, 1347 insertions(+), 1 deletion(-) create mode 100644 app/test/linux-fdt/xgene1/#address-cells create mode 100644 app/test/linux-fdt/xgene1/#size-cells create mode 100644 app/test/linux-fdt/xgene1/compatible create mode 100644 app/test/linux-fdt/xgene1/model create mode 100644 app/test/linux-fdt/xgene1/soc/ethernet@17020000/local-mac-address create mode 100644 app/test/linux-fdt/xgene1/soc/ethernet@17020000/reg create mode 100644 app/test/test_fdt.c create mode 100644 lib/librte_eal/common/eal_common_fdt.c create mode 100644 lib/librte_eal/common/include/rte_fdt.h create mode 100644 lib/librte_eal/linuxapp/eal/eal_fdt.c -- 2.7.0