Layerscape知识库

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Layerscape Knowledge Base

讨论

排序依据:
The BareMetal framework targets to support the scenarios that need low latency, real-time response, and high-performance. There is no OS running on the cores and customer-specific application runs on that directly. This document describes how to develop customer-specific application based on BareMetal framework. The directory “app” stored in u-boot repository includes the use cases for testing GPIO, I2C, IRQ init, QSPI, Ethernet, USB, PCIe, CAN, ENETC and SAI features. 1. GPIO use case 2. I2C use case 3. IRQ use case 4. QSPI Use case 5. Ethernet use case 6. USB Use case 7. PCIe use case 8. CAN Use Case 9. ENETC Use Case 10. SAI Use Case 11. Build and Run the Baremetal Application
查看全文
1. FMan VSP Hardware Overview 2. The usage of Virtual Storage Profiles 3. FMan VSP Driver 4. Traffic bifurcation using VSP on LS1046ARDB
查看全文
1. Fuse Provisioning Utility Introduction 2. Input File for Fuse Provisioning Tool 3. Build Fuse Provisioning Firmware Image with flex-builder and Deploy the Firmware Image 4. Build and Deploy Fuse Provisioning Image Manually 5. Validate Fuse Provisioning
查看全文
This document introduces basic concept of Power Management, LS1028 RCW configuration to enable GPIO, Linux Kernel source and device tree modification to support GPIO wakeup, Kernel configuration to enable sleep feature and GPIO wakeup driver, export GPIO pin and enable interrupt, Order system to sleep and trigger GPIO interrupt to wake up the system.
查看全文
DPDK provides a simple, complete framework for fast packet processing in data plane applications. Using the APIs provided as part of the framework, applications can leverage the capabilities of underlying network infrastructure. This document describes DPDK basic introduction, DPDK core components, DPDK Linux networking, DPDK Crypto Subsystem, DPDK memory manager and DPDK implementation on Layerscape platforms. 1. DPDK Basic Introduction 2. DPDK core components 3. DPDK Linux Networking 4. DPDK Crypto Subsystem     4.1 DPDK Crypto Subsystem APIs     4.2 DPDK Security Offload – rte_security 5. DPDK memory manager     5.1 Multi-layered memory architecture     5.2 Buffer Manager     5.3 Packet Buffer mbuf 6. DPDK implementation on Layerscape platforms
查看全文
boot loader requirements to boot Kernel ARM64 Virtual Memory Layout ARM64 IRQ Vectors Setup FDT Mapping ARM64 Kernel booting process        5.1 Prior to start_kernel              5.1.1__create_page_tables              5.1.2 __cpu_setup              5.1.3 __primary_switch       5.2 Start_kernel             5.2.1 Start_kernel -> setup_arch                     5.2.1.1 Start_kernel -> setup_arch -> setup_machine_fdt                     5.2.1.2 Start_kernel -> setup_arch -> paging_init / bootmem_init                     5.2.1.3 Start_kernel -> setup_arch -> psci_init             5.2.2 Start_kernel -> Rest_init                      5.2.2.1 Start_kernel -> Rest_init -> kernel_init
查看全文
NXP created eIQ machine learning software for QorIQ Layerscape applications processors, a set of ML tools which allows developing and deploying ML applications on the QorIQ Layerscape family of devices. OpenCV is an open-source computer vision library. It offers a unitary solution for both the neural network inference (DNN module) and the standard machine learning algorithms (ML module). It includes many computer vision functions, making it easier to build complex machine learning applications in a short amount of time and without being dependent on other libraries. This document describe applications YOLO object detection, Image segmentation, Image colorization, Image classification, Human pose estimation and Text detection developed based on OpenCV DNN framework.
查看全文
1. Debugging Packet Loss Issue 1.1 Frame Manager(FMan) Introduction 1.2 Frame Manager Buffer Manager Interface (BMI) Rx Port Statistics Counters 1.3 Linux Sysfs Support for Fman Rx Port Statistics 2. Queue Manager(Qman) Enqueue Rejections 2.1 Reasons for an Enqueue Rejection 2.2 Frame Queue Descriptor 2.3 Qman Debugfs 2.4 Buffer Manager (BMan) Debugfs
查看全文
The below steps describe how to modify the content of the existing rootfs. Steps are explained using LX2160ARDB board, however, the steps are applicable to all Layerscape devices and boards. Extract and modify contents of cpio.gz archive Generate .itb image Set up Ethernet connection between TFTP server and Layerscape board Boot the Linux kernel using new .itb image Step1: Extract and modify contents of cpio.gz archive Create a temporary directory for extracting the contents of the cpio.gz archive image. For example: mkdir temp_folder.  Extract the contents of the cpio.gz archive in the temporary folder. For example: gunzip -c rootfs_lsdk2012_yocto_tiny_arm64.cpio.gz | sh -c 'cd temp_folder/&& cpio -i' The temporary folder lists the filesystem as follows:  bin boot dev etc home init lib media mnt proc run sbin sys tmp usr var Make changes to the filesystem in the temporary folder. For example: copy a 'HelloWorld' file in the filesystem using the following command: cp <path>/HelloWorld . Repack the filesystem into a new cpio.gz archive. For example: use the following command: sh -c 'cd temp_folder/ && find . | cpio -H newc -o' | gzip -9 > new_rootfs_lsdk2012_yocto_tiny_arm64.cpio.gz   Step2: Generate .itb image Change the path for new rootfs (new_rootfs_lsdk2012_yocto_tiny_arm64.cpio.gz) in linux_arm64_LS.its using gedit editor. For example: Change directory to flexbuild_lsdk<version>/configs/linux. gedit linux_arm64_LS.its Update path as follows:  data = /incbin/("../../packages/rfs/initrd/new_rootfs_lsdk2012_yocto_tiny_arm64.cpio.gz"); Generate .itb image using the following command: For example: flex-builder -i mkitb -r yocto:tiny This generates lsdk2012_yocto_tiny_LS_arm64.itb image. Copy the .itb image to the TFTP server. Step 3 - Set up Ethernet connection between TFTP server and Layerscape board Set up Ethernet connection between the board (for example, LX2160ARDB) and host machine on which you have configured the TFTP server. Boot the board to U-Boot prompt. U-Boot prints a list of enabled Ethernet interfaces. For example, LX2160ARDB U-Boot prints following Ethernet interfaces. DPMAC2@xlaui4, DPMAC3@xgmii, DPMAC4@xgmii, DPMAC5@25g-aui, DPMAC6@25g-aui, DPMAC17@rgmii-id, DPMAC18@rgmii-id  Set server IP address to the IP address of the host machine on which you have configured the TFTP server. => setenv serverip <ipaddress1> Set ethact and ethprime as the ethernet interface connected to the TFTP server. See LX2160ARDB Ethernet Port Mapping for the mapping of Ethernet port names appearing on the chassis front panel with the port names in U-Boot and Linux. => setenv ethprime <name of interface connected to TFTP server> For example: => setenv ethprime DPMAC3@xgmii => setenv ethact <name of interface connected to TFTP server> For example: => setenv ethact DPMAC3@xgmii Set IP address of the board. You can set a static IP address or, if the board can connect to a dhcp server, you can use the dhcp command.  Static IP address assignment: => setenv ipaddr <ipaddress2> => setenv netmask <subnet mask> Dynamic IP address assignment: => dhcp Save the settings. => saveenv Check the connection between the board and the TFTP server. => ping $serverip Using DPMAC3@xgmii device host 192.168.2.1 is alive Step4: Boot the Linux kernel using new .itb image Load the .itb image from TFTP server to DDR memory of the board. => tftp 0xa0000000 <itb_file_name> For example: => tftp 0xa0000000 lsdk2012_yocto_tiny_LS_arm64.itb Boot the kernel with .itb image as follows: => bootm 0xa0000000#<board_name> For example: => bootm 0xa0000000#lx2160ardb Let the board boots to Tiny Linux. List the filesystem. NXP LSDK tiny 2012 (based on Yocto) TinyLinux login: root root@TinyLinux:~# ls root@TinyLinux:~# cd / root@TinyLinux:/# ls HelloWorld boot etc init media new_rootfs_lsdk2012_yocto_tiny_arm64.cpio.gz root sbin tmp var bin dev home lib mnt proc run sys usr root@TinyLinux:/# You will observe the HelloWorld file available in the filesystem.
查看全文
The VPP platform is an extensible framework that provides out-of-the-box production quality switch/router functionality. This document introduces Vector Packet Processing(VPP), creating VPP IPsec configuration scripts, building VPP v20.05 in LSDK 20.12, executing VPP IPsec on LS1046ARDB and LS2088ARDB platforms
查看全文
This topic explains steps to compile and execute Hello World program (in C) on a Layerscape board. Similarly, you can execute other custom applications on your board. Create a Hello World program in C.  Copy this file (.c) on a Ubuntu machine (using WinSCP). Run the following command to convert the .c file into a binary file. $ aarch64-linux-gnu-gcc <.c file> -o <binary file> For example: $ aarch64-linux-gnu-gcc Hello_World.c -o Hello_World Note: You can use this command in the same directory in which .c file is present or provide path of this file. Connect to the board console on which you want to execute the custom application via terminal and boot the board with LITB. Note: It is suggested to boot the board with Tiny Linux for executing custom application.  => tftp 0xa0000000 lsdk2004_yocto_tiny_LS_arm64.itb Using e1000#0 device TFTP from server 192.168.3.1; our IP address is 192.168.3.142 Filename 'lsdk2004_yocto_tiny_LS_arm64.itb'. Load address: 0xa0000000 Loading: ################################################################# ################################################################# ##################################################### 4.3 MiB/s done Bytes transferred = 37030212 (2350944 hex) => bootm 0xa0000000#lx2160ardb ## Loading kernel from FIT Image at a0000000 ... Using 'lx2160ardb' configuration Trying 'kernel' kernel subimage Description: ARM64 Kernel Created: 2021-02-03 6:01:29 UTC Type: Kernel Image Compression: gzip compressed Data Start: 0xa00000d0 Data Size: 14086432 Bytes = 13.4 MiB When Tiny Linux boots, enable Ethernet to download the HelloWorld program on the board. To see the available networks. root@TinyLinux:~# ifconfig -a eth0 Link encap:Ethernet HWaddr 68:05:ca:2b:2c:ca BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:114 Memory:90460c0000-90460e0000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) sit0 Link encap:UNSPEC HWaddr 00-00-00-00-31-00-6C-6F-00-00-00-00-00-00-00-00 NOARP MTU:1480 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Enable the Ethernet connection. # ifconfig <eth interface> <IP address> netmask <netmask> up For example: root@TinyLinux:~# ifconfig eth0 192.168.3.121 netmask 255.255.255.0 up Set the gateway IP and ping the server to test the connection. # route add default gw <gateway IP> # ping <server IP> For example: root@TinyLinux:~# route add default gw 192.168.3.1 root@TinyLinux:~# ping 192.168.3.1 PING 192.168.3.1 (192.168.3.1): 56 data bytes 64 bytes from 192.168.3.1: seq=0 ttl=64 time=0.479 ms 64 bytes from 192.168.3.1: seq=1 ttl=64 time=0.204 ms Download the HelloWorld binary file on your board. For example: root@TinyLinux:~# scp user@192.168.3.1:/tftpboot/LX2160ARDB/HelloWorld . Execute the HelloWorld application. root@TinyLinux:~# ./HelloWorld Hello, World!    
查看全文
This topic shows steps to customize LITB by using a different kernel image instead of the existing kernel image. Browse to the FlexBuild installation directory. Modify the kernel image in linux_arm64_LS.its. $ vi configs/linux/linux_arm64_LS.its Save the changes done in the file. Generate LITB using flex-builder. $ source setup.env $ flex-builder -i mkitb -r <distro_type>:<distro_scale> -a <arch> For example: $ source setup.env $ flex-builder -i mkitb -r ubuntu:main -a arm64 INSTRUCTION: mkitb DISTRO TYPE: ubuntu DISTRO SCALE: main .... .... /home/flexbuild_lsdk2004/build/images/lsdk2004_ubuntu_main_LS_arm64.itb [Done]   Note: To create .itb file directly from .its file, run this command: mkimage -f <xyz.its> <xyz.itb> Connect to the board console via terminal and run following commands at U-boot to boot the board with customized LITB. => ping $serverip Using e1000#0 device host 192.168.3.1 is alive => Using e1000#0 device host 192.168.3.1 is alive => tftp 0xa0000000 lsdk2004_ubuntu_main_LS_arm64.itb Using e1000#0 device TFTP from server 192.168.3.1; our IP address is 192.168.3.49 Filename 'lsdk2004_ubuntu_main_LS_arm64.itb'. Load address: 0xa0000000 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# #################################### 9.8 MiB/s done Bytes transferred = 683506200 (28bd7a18 hex) => bootm 0xa0000000#lx2160ardb ## Loading kernel from FIT Image at a0000000 ... Using 'lx2160ardb' configuration Trying 'kernel' kernel subimage Description: ARM64 Kernel Created: 2021-02-03 6:01:29 UTC Type: Kernel Image Compression: gzip compressed Data Start: 0xa00000d0 Data Size: 14086432 Bytes = 13.4 MiB   Check timestamp in boot log to ensure that the board is booted with the updated kernel image in the customized LITB.   Starting kernel ... [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083] [ 0.000000] Linux version 5.4.3 (test@Ubuntu-18) (gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)) #1 SMP PREEMPT Wed Feb 3 00:04:09 IST 2021 [ 0.000000] Machine model: NXP Layerscape LX2160ARDB [ 0.000000] earlycon: pl11 at MMIO32 0x00000000021c0000 (options '') [ 0.000000] printk: bootconsole [pl11] enabled [ 0.000000] efi: Getting EFI parameters from FDT:  
查看全文
Prerequisites: The board should be running Linux and connected to terminal console. Note: For log level debug support, the restool version should be LSDK-2003-RC1 or above and MC version should be 10.20.0 or above. To check restool version: $ root@localhost:~# restool -v restool LSDK-20.04 To check MC version: root@localhost:~# restool -m MC firmware version: 10.24.0 For debugging, use the ls-debug script available in the LSDK rootfs. There is no need to create the debug object. ls-debug -h ls-debug options -h, --help ls-debug help information -ts, --timestamp=X Enable/Disable timestamp printing, X is ON or OFF -c, --console=X Enable/Disable printing in UART console, X is ON or OFF -l, --log=X Enable/Disable printing in DDR log, X is ON or OF -u, --uart=X Set UART ID of the console, X = [0 - 4], 0 = OFF -ll, --level=X Set logging level, X = [0 - 5] 0: Global 1: Debug 2: Info 3: Warning 4: Error 5: Critical -m, mem, --memory Dump information about memory modules available dpxy.z Dump information about MC respective object   For example, to enable logging in console with log level INFO: $ ls-debug --log=on --console=on --level=2 dpdbg.0 created DDR log printing ON UART console printing ON Log level set to 2 $ root@localhost:~# ls-debug --memory Memory dumped information available in MC log/console $ root@localhost:~# cat `find /dev/ -name "*mc_console"` [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_get_obj for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dpdbg_open on DPDBG [I, RESMAN] Handling command: dpdbg_dump on DPDBG [I, DPNI] Memory info: [I, DPNI] MC DDR #1 cacheable memory [I, DPNI] Total: 134217728 bytes [I, DPNI] Used: 14802708 bytes [I, DPNI] Free: 119415020 bytes [I, DPNI] MC DDR #1 non-cacheable memory [I, DPNI] Total: 50331648 bytes [I, DPNI] Used: 27680 bytes [I, DPNI] Free: 50303968 bytes [I, DPNI] DMEM1 memory [I, DPNI] Total: 81920 bytes [I, DPNI] Used: 27168 bytes [I, DPNI] Free: 54752 bytes [I, DPNI] DMEM2 memory [I, DPNI] Total: 81920 bytes [I, DPNI] Used: 27168 bytes [I, DPNI] Free: 54752 bytes [I, DPNI] DDR #1 memory [I, DPNI] Total: 1610612736 bytes [I, DPNI] Used: 143163392 bytes [I, DPNI] Free: 1467449344 bytes [I, DPNI] PEB memory [I, DPNI] Total: 2097152 bytes [I, DPNI] Used: 524288 bytes [I, DPNI] Free: 1572864 bytes [I, DPNI] DP-DDR memory [I, DPNI] Total: 4294967296 bytes [I, DPNI] Used: 0 bytes [I, DPNI] Free: 4294967296 bytes [I, RESMAN] Handling command: dpdbg_close on DPDBG [I, RESMAN] Handling command: dprc_close for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_set_irq_mask for DPRC 1 on portal id 0 [I, RESMAN] Handling command: dprc_set_irq_enable for DPRC 1 on portal id 0 root@localhost:~#
查看全文
  Note: MCFBA{L/H} that is used to dump the MC log buffer is valid only after the following command is executed: fsl_mc start mc  ${mc_addr} ${dpc_addr} Run the above command first, then MCFBA contents will be valid. To display the MC log buffer in U-Boot for debug purpose, when MC console is not available: Determine the MC firmware base. At the U-Boot prompt, perform md at 0x8340020 (this is MCFBA{L/H}) => md 0x8340020 10 08340020: e0000006 00000027 00060000 00000000 ....'........... 08340030: 00000000 00000000 00000000 00000000 ................ 08340040: 00000000 00000000 00000000 00000000 ................ 08340050: 00000000 00000000 00000000 00000000 ................ The value at 08340024 is the MCFBAH address. In this case, it is 00000027. The value at 08340020 is the MCFBAL address. In this case, it is e0000000. So you can build the MCFBA base address as:  0x27e0000000. Run the following command to start the MC if it is not booted already. run mcinitcmd Dump the log buffer structure at offset 0x01000000 into the MC firmware base 0x27e1000000 (as per the example). md 27e1000000 27e1000000: 4d430100 00000000 01400000 00300000 ..CM......@...0. 27e1000010: 000000b1 00000000 00000000 00000000 ................ 27e1000020: 00000000 00000000 00000000 00000000 ................ 27e1000030: 00000000 00000000 00000000 00000000 ................ 4d430100 = magic number, 400000 = log buffer offset, 00300000 = log buffer length Dump the content of the log buffer. md 27e1400000   The output size can be increased by specifying the number of objects.  md 27e1400000 <num> For example: md 27e1400000 20 In case that the log buffer has more information, you can extend the output of md by replacing 20 with a greater value.          
查看全文
To boot a Layerscape board with an empty DPL file: Create an empty DPL file, content.dts. For example: /dts-v1/; / { dpl-version = <0x0000000a>; containers { dprc@1 { compatible = "fsl,dprc"; parent = "none"; options = "DPRC_CFG_OPT_SPAWN_ALLOWED", "DPRC_CFG_OPT_ALLOC_ALLOWED", "DPRC_CFG_OPT_IRQ_CFG_ALLOWED"; objects { obj_set@dpmcp { type = "dpmcp"; ids = <0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd>; }; }; }; }; objects { dpmcp@1 { compatible = "fsl,dpmcp"; }; dpmcp@2 { compatible = "fsl,dpmcp"; }; dpmcp@3 { compatible = "fsl,dpmcp"; }; dpmcp@4 { compatible = "fsl,dpmcp"; }; dpmcp@5 { compatible = "fsl,dpmcp"; }; dpmcp@6 { compatible = "fsl,dpmcp"; }; dpmcp@7 { compatible = "fsl,dpmcp"; }; dpmcp@8 { compatible = "fsl,dpmcp"; }; dpmcp@9 { compatible = "fsl,dpmcp"; }; dpmcp@10 { compatible = "fsl,dpmcp"; }; dpmcp@11 { compatible = "fsl,dpmcp"; }; dpmcp@12 { compatible = "fsl,dpmcp"; }; dpmcp@13 { compatible = "fsl,dpmcp"; }; dpmcp@14 { compatible = "fsl,dpmcp"; }; dpmcp@15 { compatible = "fsl,dpmcp"; }; dpmcp@16 { compatible = "fsl,dpmcp"; }; dpmcp@17 { compatible = "fsl,dpmcp"; }; dpmcp@18 { compatible = "fsl,dpmcp"; }; dpmcp@19 { compatible = "fsl,dpmcp"; }; }; }; ​ Note: There is no network object capable of receiving Ethernet frames in the DPL file. You can create more dpmcps if the number of objects that will be created dynamically is high. Generate the DPL file using content.dts. dtc -I dts -O dtb -o dpl.dtb content.dts​ Flash the DPL file, dpl.dtb to the alternate bank.  tftp 0x80000000 dpl.dtb; i2c mw 66 50 20;sf probe; sf erase 0x00D00000 +$filesize && sf write 0x80000000 0x00D00000 $filesize​ Boot the board. After the board boots, create a dpmac. (Make sure you create a DPMAC that is valid based on the selected SERDES protocol configured by the RCW). restool dpmac create --mac-id=3​ Probe the dpmac driver. restool dprc assign dprc.1 --object=dpmac.3 --plugged=1​ Create a network interface. ls-addni dpmac.3​ Save contents as content_new.dts. restool dprc generate-dpl dprc.1 > content_new.dts​    
查看全文
The below steps describe how to measure CPU temperature and how to stress individual cores of CPU. Steps are explained with an example of LX2160A SoC. However, these steps are applicable to all Layerscape devices. Download Flexbuild and add packages in Yocto tiny Generate Yocto tiny userland Enable thermal monitoring unit and build kernel Generate .itb image Load .itb image from TFTP server to Layerscape board Validate stress package and measure CPU temperature before and after stress Step 1: Download Flexbuild and add packages in Yocto tiny On a Linux machine, download Layerscape Software Development Kit - <version>. Go to Download tabs at http://www.nxp.com/lsdk. Enter login details, accept the agreement to download the Flexbuild source tarball in the name format flexbuild_<version>.tgz. Run the following commands to extract Flexbuild files from tar archived file. $ tar xvzf flexbuild_<version>.tgz $ cd flexbuild_<verison> $ source setup.env $ flex-builder -h Add “stress” package to "IMAGE_INSTALL_append" parameter of local_arm64_tiny.conf file available in flexbuild_<version>/configs/yocto/ folder. Save and exit the file. Step 2 – Generate Yocto tiny userland Change directory to flexbuild_<version>. Clean obsolete cache data. This step is needed in case source/config has changed. $ source setup.env $ flex-builder -i clean-rfs -r yocto Run the following commands to generate Yocto-based tiny userland: $ flex-builder -i mkrfs -r yocto:tiny $flex-builder -i mklinux -r yocto:tiny $ flex-builder -i mkfw -m <machine_name> -b sd This generates the following images: rootfs_lsdk<version>_yocto_tiny_arm64.cpio.gz (~22M), lsdk<version>_yocto_tiny_LS_arm64.itb, and firmware_<machine_name>_uboot_sdboot.img. For example: rootfs_lsdk2004_yocto_tiny_arm64.cpio.gz (~22M), lsdk2004_yocto_tiny_LS_arm64.itb, and firmware_lx2160ardb_rev2_uboot_sdboot.img Step 3 Enable system monitoring unit and build kernel Change directory to flexbuild_<version>/packages/linux/linux. Enable environmental setting for cross-compiling. The following setting is applicable when you configure and build kernel on a different architecture from the target. For example, compiling an Armv8 kernel on an X86 computer. Run the following commands on Ubuntu Linux: $ export CROSS_COMPILE=aarch64-linux-gnu- $ export ARCH=arm64 Run make menuconfig command to configure settings to enable thermal monitoring unit. $ make menuconfig The command opens the kernel configuration [tree-view structure] prompt. Use the Arrow keys to navigate the menu and Enter to select the submenu. Navigate to Device Drivers --> <*> Generic Thermal sysfs driver --> [ ] Generic CPU cooling support option. Press Y key to include the option. [*] symbol indicates the option is included (shown in below figure). Similarly, include the following options to enable thermal management framework. After you include all options as mentioned in the above table, save the configuration with a file name. For example,  save the configuration file as thermal.config. Exit to come out of the Kernel Configuration prompt. Copy the configuration file to arch/arm64/configs folder. $ cp <config filename> arch/arm64/configs/ For example, $ cp thermal.config arch/arm64/configs/ Configure the kernel. Load the changed configuration for Layerscape Armv8 platform in 64-bit mode for LSDK. $ export CROSS_COMPILE=aarch64-linux-gnu- $ export ARCH=arm64 $ make distclean $ make defconfig <config filename> Build kernel image and device tree image. $ make -j8 Step 4 - Generate .itb file Generate .itb file, which includes stress package and thermal monitoring unit installed, for kernel booting. Copy the Image and Image.gz files from the /flexbuild_<version>/packages/linux/linux/arch/arm64/boot folder and to the /flexbuild_<version>/build/linux/kernel/arm64/LS folder. Change directory to flexbuild_<version>. Generate .itb image using flex-builder. $ source setup.env $ flex-builder -i mkitb -r yocto:tiny This generates lsdk2<version>_yocto_tiny_LS_arm64.itb file. For example, lsdk2004_yocto_tiny_LS_arm64.itb file. Copy the .itb image to the TFTP server. Step 5 - Load .itb image from TFTP server to Layerscape board Set up Ethernet connection between the board (for example, LX2160ARDB) and host machine on which you have configured the TFTP server. Boot the board to U-Boot prompt. U-Boot prints a list of enabled Ethernet interfaces. For example, LX2160ARDB U-Boot prints following Ethernet interfaces. DPMAC2@xlaui4, DPMAC3@xgmii, DPMAC4@xgmii, DPMAC5@25g-aui, DPMAC6@25g-aui, DPMAC17@rgmii-id, DPMAC18@rgmii-id  Set server IP address to the IP address of the host machine on which you have configured the TFTP server. => setenv serverip <ipaddress1> Set ethact and ethprime as the ethernet interface connected to the TFTP server. See LX2160ARDB Ethernet Port Mapping for the mapping of Ethernet port names appearing on the chassis front panel with the port names in U-Boot and Linux. => setenv ethprime <name of interface connected to TFTP server> For example: => setenv ethprime DPMAC3@xgmii => setenv ethact <name of interface connected to TFTP server> For example: => setenv ethact DPMAC3@xgmii Set IP address of the board. You can set a static IP address or, if the board can connect to a dhcp server, you can use the dhcp command.  Static IP address assignment: => setenv ipaddr <ipaddress2> => setenv netmask <subnet mask> Dynamic IP address assignment: => dhcp Save the settings. => saveenv Check the connection between the board and the TFTP server. => ping $serverip Using DPMAC3@xgmii device host 192.168.2.1 is alive Load the .itb image from TFTP server to DDR memory of the board. => tftp 0xa0000000 <itb_file_name> For example: => tftp 0xa0000000 lsdk2004_yocto_tiny_LS_arm64.itb Boot the kernel with .itb image as follows: => bootm 0xa0000000#<board_name> For example: => bootm 0xa0000000#lx2160ardb Let the board boots to Tiny Linux. Step 6 – Validate stress package and measure CPU temperature before and after stress Check stress-ng package using which stress-ng command: # which stress-ng /usr/bin/stress-ng Check scaling_current_frequency of the cores. # cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq  For example: Check frequency of 16 cores of LX2160ARDB as follows: Check the temperature of the CPU before applying stress. # cat /sys/class/thermal/thermal_zone*/temp Apply stress by executing following command: # stress-ng -c 8 -i 1 -m 1 --vm-bytes 128M -t 60s & The command applies stress for 60 seconds. For more information on stress-ng command, run stress-ng -h command for help. Check the temperature of the CPU after applying stress. # cat /sys/class/thermal/thermal_zone*/temp For example:
查看全文
The below steps describe how to measure the CPU power using sensors and also describe how to stress individual cores of CPU. Steps are explained with an example of LX2160A SoC. However, these steps are applicable to all Layerscape devices. Download Flexbuild and add packages in Ubuntu:Lite Generate Ubuntu-based Lite userland (Ubuntu:Lite) Enable system monitoring unit and build kernel Generate .itb image Load .itb image from TFTP server to Layerscape board Validate stress package and measure CPU power using sensors Step 1: Download Flexbuild and add packages in Ubuntu:lite On a Linux machine, download Layerscape Software Development Kit - <version>. Go to Download tabs at http://www.nxp.com/lsdk. Enter login details, accept the agreement to download the Flexbuild source tarball in the name format flexbuild_<version>.tgz. Run the following commands to extract Flexbuild files from tar archived file. $ tar xvzf flexbuild_<version>.tgz $ cd flexbuild_<verison> $ source setup.env $ flex-builder -h Add packages for stress and power sensors in the additional_lite_packages_list file available in the flexbuild_<version>/configs/ubuntu/ folder. Add ‘stress’ and ‘lm-sensors’ packages for Ubuntu Lite as shown below: Save and exit the file. Step 2 – Generate Ubuntu:Lite image Change directory to flexbuild_<version>. Clean obsolete cache data. This step is needed in case the source/configuration has changed. $ source setup.env $ flex-builder -i clean-rfs -r ubuntu:lite Generate Ubuntu-based Lite userland using the following command: $ flex-builder -i mkrfs -r ubuntu:lite This generates rootfs_lsdk<version>_ubuntu_lite_arm64 file. For example: rootfs_lsdk2004_ubuntu_lite_arm64 file. Pack userland in tgz format (Optional step). $ flex-builder -i packrfs -r ubuntu:lite For example: rootfs_lsdk2004_ubuntu_lite_arm64.tgz (~180 M)   Step 3 Enable system monitoring unit and build kernel Change directory to flexbuild_<version>/packages/linux/linux. Enable environmental setting for cross-compiling. The following setting is applicable when you configure and build kernel on a different architecture from the target. For example, compiling an Armv8 kernel on an X86 computer. Run the following commands on Ubuntu Linux: $ export CROSS_COMPILE=aarch64-linux-gnu- $ export ARCH=arm64 Run make menuconfig command to configure settings to enable system monitoring unit for sensing power. $ make menuconfig The command opens the kernel configuration [tree-view structure] prompt. Use the Arrow keys to navigate the menu and Enter to select the submenu. Navigate to Device Drivers --> <*> Hardware Monitoring Support --> [M] Texas Instruments INA219 and compatibles option. Device Drivers-->Hardware Monitoring Support Press Y key to include the option. [*] symbol indicates the option is included (shown in below figure). This enables INA220. Texas Instruments INA219 and Compatibles option included Similarly, include the following options to enable I2C block device driver support and I2C bus multiplexing PC9547. Kernel Configure Tree View Option After you include all options as mentioned in the above table, save the configuration with a file name. For example,  save the configuration file as power.config. Exit to come out of the Kernel Configuration prompt. Copy the configuration file to arch/arm64/configs folder. $ cp <config filename> arch/arm64/configs/ For example, $ cp power.config arch/arm64/configs/ Configure the kernel. Load the changed configuration for Layerscape Armv8 platform in 64-bit mode for LSDK. $ export CROSS_COMPILE=aarch64-linux-gnu- $ export ARCH=arm64 $ make distclean $ make defconfig <config filename> Build kernel image and device tree image. $ make -j8 Step 4 - Generate .itb file Generate .itb file, which includes stress package and thermal monitoring unit installed, for kernel booting. Copy the Image and Image.gz files from the /flexbuild_<version>/packages/linux/linux/arch/arm64/boot folder and to the /flexbuild_<version>/build/linux/kernel/arm64/LS folder. Change directory to flexbuild_<version>. Generate .itb image using flex-builder. $ source setup.env $ flex-builder -i mkitb -r ubuntu:lite This generates lsdk<version>_ubuntu_lite_LS_arm64.itb file. For example, lsdk2004_ubuntu_lite_LS_arm64.itb Copy the .itb image to the TFTP server. Step 5 - Load .itb image from TFTP server to Layerscape board Set up Ethernet connection between the board (for example, LX2160ARDB) and host machine on which you have configured the TFTP server. Boot the board to U-Boot prompt. U-Boot prints a list of enabled Ethernet interfaces. For example, LX2160ARDB U-Boot prints following Ethernet interfaces. DPMAC2@xlaui4, DPMAC3@xgmii, DPMAC4@xgmii, DPMAC5@25g-aui, DPMAC6@25g-aui, DPMAC17@rgmii-id, DPMAC18@rgmii-id  Set server IP address to the IP address of the host machine on which you have configured the TFTP server. => setenv serverip <ipaddress1> Set ethact and ethprime as the ethernet interface connected to the TFTP server. See LX2160ARDB Ethernet Port Mapping  for the mapping of Ethernet port names appearing on the chassis front panel with the port names in U-Boot and Linux. => setenv ethprime <name of interface connected to TFTP server> For example: => setenv ethprime DPMAC3@xgmii => setenv ethact <name of interface connected to TFTP server> For example: => setenv ethact DPMAC3@xgmii Set IP address of the board. You can set a static IP address or, if the board can connect to a dhcp server, you can use the dhcp command.  Static IP address assignment: => setenv ipaddr <ipaddress2> => setenv netmask <subnet mask> Dynamic IP address assignment: => dhcp Save the settings. => saveenv Check the connection between the board and the TFTP server. => ping $serverip Using DPMAC3@xgmii device host 192.168.2.1 is alive Load the .itb image from TFTP server to DDR memory of the board. => tftp 0xa0000000 <itb_file_name> For example: => tftp 0xa0000000 sdk2004_ubuntu_lite_LS_arm64.itb Boot the kernel with .itb image as follows: => bootm 0xa0000000#<board_name> For example: => bootm 0xa0000000#lx2160ardb Board boots to Linux prompt. Step 6 – Validate stress package and measure CPU power using sensors Validate if stress and sensors packages have been installed properly. $ which stress ./usr/bin/stress  $ which sensors ./usr/bin/sensors Measure CPU power before applying stress to the cores. $ sensors CPU power before stress Apply stress to CPU cores using the following command. # stress -c <number of cores> -i <number of IO> -m <number of vm> --vm-bytes 128M -t <time in seconds> & For example: The command applies stress for 60 seconds. For more information on stress command, run stress-h command for help. Measure CPU power after applying stress in given time interval. $ sensors
查看全文
[中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-344564 
查看全文
[中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-344236 
查看全文
[中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-343865 
查看全文