在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 4552|回复: 3

[活动] [Zynq征文]Zynq Linux

[复制链接]
发表于 2013-1-26 13:07:43 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
Introduction
The purpose of this page is to describe the Xilinx Zynq Linux kernel. The kernel is based on the 3.0 Linux kernel from kernel.org together with Xilinx unique changes. It is typically updated to stay close to the latest version from kernel.org on a regular basis. In general, the Xilinx Linux kernel for Zynq follows normal ARM Linux processes for building and running.GeneralXilinx Zynq Linux Strategy
Xilinx is striving to push code from the Xilinx GIT server to the open source community (kernel.org, u-boot, etc.). Pushing the code takes time such that the Xilinx GIT servers contain the latest code base and is recommended for customer use. A minimal BSP for Zynq has been pushed to the mainline (kernel.org) and is available there. At this time, Xilinx only supports Linux from the Xilinx GIT server.Xilinx Zynq Linux Support
Xilinx Zynq Linux is based on open source software (the kernel from kernel.org). Xilinx provides support for Xilinx specific parts of the Linux kernel (drivers and BSP). Xilinx also supports Linux thru the Embedded Linux forum on http://forums.xilinx.com/. As with many open source projects, Xilinx also expects customers to also use the open source mailing lists for Linux in areas that are not specific to Xilinx Zynq.Assumptions
Building the Linux kernel is only supported from a Linux based host. It is not supported from Windows.GNU Tools
GNU tools are required to build the Linux kernel. See the wiki page Zynq Tools for more GNU tools details.The Details of Building LinuxDownloading the Kernel Tree
The kernel can be downloaded from the Xilinx GIT repository using the command as illustated below.bash> git clone git://git.xilinx.com/linux-xlnx.git

Note that another repository, linux-2.6-xarm, was previously being used. This repository still exists til 12/1/11 but is not being updated.Configuring the Linux Kernel
The kernel must be configured to build the Xilinx BSP and drivers into the kernel.
Configure the kernel for the ZC702 or ZC770 hardware using the command line as shown below.bash> make ARCH=arm xilinx_zynq_defconfig
Building the Linux Kernel
The build process creates files named Image and zImage located in the arch/arm/boot directory of the kernel tree. The Image file is a non-compressed kernel image such that it's bigger. The zImage file is a compressed kernel image which will uncompress itself when it starts. Build the kernel using the command line shown below.bash> make ARCH=arm
Known Issues
  • An initrd ramdisk is being used with Linux. An initramfs ramdisk may have issues.
Kernel DetailsThe Board Support Package (BSP)
The primary code for the platform is in arch/arm/mach-zynq directory of the kernel tree. The BSP contains some drivers and utilizes some existing drivers from arch/arm.
Hardware BlockDriver NameNotesDetailed Page
GICgic.cin arch/arm/common
PL330pl330.ca different driver now exists in kernel.org
PS2ps2.csupport for keyboard and mouse in QEMU
SCU Global Timerscu_gtimer.cprovides primitive abilities only
System Level Control Registersslcr.cSLCR
Triple Timer Countertimer.cOnly supports 1 TTC currently
Device Drivers
The Xilinx Linux kernel includes drivers for each hardware block. The following table contains more detailed information about each driver.
Hardware BlockDriver NameNotesDetailed Page
CANnot supported
GEMxilinx_emacps.c
GPIOxilinx_gpiops.c
I2Ci2c-xilinx_ps.c
NANDxilinx_nandpss.c
QSPIxilinx_qspipc.c
SCU WDTxilinx_scuwdt.c
SPIxilinx_spips.c
System WDTxilinx_wdtps.c
UARTxilinx_uartps.c
USB Hostehci-xilinx-usbps.c
USB Devicexilinx_usbps_udc.c
USB OTGxilinx_usbps_otg.c
Device Tree Support
Device tree is a process by which the Linux kernel initializes itself based on the hardware platform. Device tree allows a single kernel image to run on multiple hardware platforms. A device tree file, named *.dts, is a text file that describes the hardware platform. It is compiled into a device tree blob, *.dtb, which is loaded into memory before the Linux kernel is started. The Linux kernel then uses that device tree blob to initialize itself at runtime.
Device tree is supported and required for the Xilinx ARM kernel. Previously to Linux kernel 3.0, most ARM Linux kernels did not support device tree and were based on platform data. PowerPC and MicroBlaze also use device tree initialization.Device Tree In Memory
The kernel has 2 ways it can find a device tree in memory. The 1st and industry standard method is that it expects the address of the device tree to be in register R2 when the boots. Note that this is not the default kernel configuration at this time.
The 2nd method, and the default in the Xilinx kernel configuration, is hard coded such that it expects the device tree at address 0x1000000 (16 MB). This is referred to as Device Tree At Fixed Address in the kernel configuration. The purpose of the fixed address for a device tree is to allow the go command in u-boot (which does not set up R2 to point to the device tree) to continue to be used.
This method can be disabled in the kernel configuration and must be disabled if a device tree is to loaded at other addresses while using the bootm command in u-boot. The bootm command does extra checking on the image in u-boot which is very slow on the EP107 platform.
Note that the Device Tree At Fixed Address kernel configuration option is only available in the menu when device tree has been enabled in the kernel configuration.Disabling Fixed Device Tree Address Kernel Configuration
From the main menu of the kernel configuration, select System Type, followed by Xilinx Specific Options. De-select Device Tree At Fixed Address. The bootm command must be used with this kernel configuration as it sets the R2 register to the address of the device tree before transferring control to Linux.Device Tree Generation
There is no device tree generator yet for Zynq yet such that hand editing the device tree is the current method.
For Linux kernel 3.3 and later, the device tree syntax has changed for denoting interrupts. To calculate the correct value in these releases, use Table 7-3 in the Zynq-7000 EPP TRM to locate the correct SPI ID# for the desired peripheral. Then, subtract 32 from this value. The result is what should be entered into the device tree interrupt field.
Example: From Table 7-3, UART 1 has a value of "82" for the SPI ID#. Subtracting 32 from this yields "50." "50" is the value found in the interrupt field for the UART 1 peripheral in the device tree.Predefined Device Trees
All device trees are contained in the Linux kernel tree at arch/arm/boot/dts directory of the kernel tree.
BoardDTS File NameNotes
EP107 (emulation platform)zynq-ep107.dts
ZC702zynq-zc702.dts
ZC770zynq-zc770-xm010.dts
Kernel Command Line
The kernel has 2 ways for it to get the command line. The default kernel configuration causes the kernel to get the command line from the device tree.
There is a kernel configuration option that allows the command line to always be used from the kernel configuration ignoring the command line string in the device tree. From the main menu of the kernel configuration, select Boot Options, followed by Always use the default kernel command string.Compiling a Device Tree
The device tree compiler is located in the Linux kernel tree in the scripts/dtc directory. Note that the kernel needs to be built with device tree turned on in the kernel configuration for the device tree compiler (dtc) binary to be present in the scripts/dtc/dtc directory. The device tree file (dts) can be compiled using the following command (assuming this is executed from the root directory of a Linux kernel tree).bash> scripts/dtc/dtc -I dts -O dtb -o <output file name> <input file path and name>
SMP
By default the kernel is configured to use both CPUs in SMP mode. The following command shows the CPU information and should indicate two CPUs, numbered 0 and 1.
By default, the kernel handles all interrupts on the 1st CPU. They can be pushed to the 2nd CPU and there are user space daemons that will do interrupt load balancing.zynq> cat /proc/cpuinfo
Only Using A Single CPU
A user may cause it to use only one CPU by adding "maxcpus=1" to the kernel command line in the device tree.Specifying A CPU
A user may cause an application to run on a specific CPU using the BusyBox utility taskset.
The following command will display the help information for the taskset command.zynq> taskset --help

The mask field of the command specifies the CPU and is a value of 1 or 2.
The following command starts the application top running on the 2nd CPU.zynq> taskset 2 top
Prebuilt Ramdisk Image
A prebuilt BusyBox based root filesystem is provided to make it easy for users to get Linux running. The source for the ramdisk is available from http://git.xilinx.com/. The binary image can be downloaded from Zynq Root File System.Prebuilt Ramdisk Contents
The ramdisk image incorporates the following features.
Application NameSourceDetails
TelnetBusyBoxthere is no login, a shell is started
SSHDropbearuser: root, password: root
Web serverBusyBox
FTPBusyBox
GDB ServerGNU Tools
Prebuilt Ramdisk Details
The Linux kernel command line is using DHCP for eth0 device such that the root file system is not setting up the IP address. The purpose for this is to allow a common ramdisk between QEMU and the EP107 system.
发表于 2013-1-27 22:46:54 | 显示全部楼层
Is not it the introduction from the official website of Xilinx ?
发表于 2013-2-7 10:31:28 | 显示全部楼层
并支持各种网络技术的装置技术发布
发表于 2022-3-2 02:11:59 | 显示全部楼层
thanks alot.
very helpful
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

小黑屋| 手机版| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-11-16 22:31 , Processed in 0.018233 second(s), 8 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表