Installing Linux Kernel 2.6.23 on the PPC405 core of a Xilinx ML403 board
2013-11-18 18:29
507 查看
Installing Linux Kernel 2.6.23 on the PPC405 core of a Xilinx ML403 board
The aim of the following text is to explain the necessary steps, especially potential pitfalls and their avoidance, to setup a Linux Kernel 2.6.23 on a Xilinx ML403 prototyping board.[hide] |
Hardware Setup
Section to be written.
Software Setup
Installing a Cross Compiler Chain for PPC405
Write something about cross-tools here.
Making the Cross Compiler accessible
Configuring the Linux Kernel
After generating the cross compilation tool chain it is necessary to compile a fitting Linux Kernel. This section details how this is done.
Generating a Board Support Package (BSP) for Kernel 2.6
Use XPS for that, see its documentation. The main directory of the EDK project will be referred to as $EDK_PROJECT_DIR in the following text. The Xilinx Platform Studio (XPS), on my machine,generates the Bord Support Package (BSP) in the directory: $EDK_PROJECT_DIR/ppc405_0/libsrc/linux_2_6_v1_00_b/. This directory will be referred to as $BSP_DIR in the following text. Please note that depending on the version of the Xilinx tools this location
may slightly differ.
Obtaining the Kernel Sources
Before integrating the BSP into the Kernel Tree it is necessary to obtain the kernel sources of Kernel2.6.23. Extract the sources at a convenient location. The top-level directory of the kernel (linux-2.6.23) will be referred to as $KERNEL_DIR in the following.
Enabling Cross Compilation for the Linux Kernel
The Linux Kernel allows the user to define the target architecture (ARCH) and which compiler chain to use (CROSS_COMPILE). To do so please edit the file `$KERNEL_DIR/Makefile' with the followingvalues:
ARCH ?= ppc CROSS_COMPILE ?= powerpc-405-linux-gnu
Integrating the BSP into the Kernel Tree
The BSP generated by the Xilinx tools contains all necessary drivers for Kernel 2.6. Many of these drivers have been integrated into Kernel 2.6.23 already. Therefore, I do not use the driversgenerated by Xilinx but the ones provided by the Kernel. However, due to the fact that we are using a custom hardware setup here, without a BIOS, it is necessary to give the kernel detailed information about it. We do this by including a xparamerter header
file. The files of interest are stored in the directory: $BSP_DIR/arch/ppc/platforms/4xx/xparameters/. Copy the two header files to the directory: $BSP_DIR/arch/ppc/platforms/4xx/xparameters/. Due to some changes in the kernel it is necessary to modify the
file: xparameters.h, change the line:
#if defined(CONFIG_XILINX_ML40X)
to:
#if defined(CONFIG_XILINX_ML403)
Furthermore, change the line:
#include<linux/config.h>
to:
#include<linux/autoconf.h>
To obtain the configuration of the selected embedded system the kernel calls the function embed_config(). Unfortunately, by default the linux kernel uses a dummy function instead of the real
one. To change this comment out the following from the file $KERNEL_DIR/arch/ppc/boot/simple/misc-embedded.c :
void __attribute__((weak)) embed_config(bdt **bpd){ }
This completes the necessary modifications to the Linux Kernel source code, now it is time to configure the kernel.
Configuring the Kernel
The Linux kernel contains many different configuration options. Most of these are optional / additional at the moment. Nevertheless, the following options are necessary in this case. To configurethe kernel execute the following command in your kernel root:
make menuconfig
Set the following configuration options:
Enable loadable module support: DISABLE
Processor:
Type 40x
Math emulation: ENABLE
IBM 40x options:
Machine Type: "Xilinx-ML403"
Platform options:
Kernel command line: "console=ttyUL0 root=/dev/$FOO", The setting for the root device depends on the actual system. In my current system it is the second partition of the CF card connected to the SystemACE controller (/dev/xsa2).
Bus options:
PCI support: DISABLE
PCCARD (PCMCIA/CardBus) support:
PCCARD (PCMCIA/CardBus) support: DISABLE
Drivers
Block Devices:
Xilinx SystemACE support: ENABLE
Character devices:
Serial drivers:
Xilinx uartlite serial port support: ENABLE
Support for console on Xilinx uartlite serial port: ENABLE
Compiling the Kernel
To compile the kernel execute the following command in the kernel root directory:make bzImage
This compiles the kernel for the PPC, and generates the file:
$KERNEL_DIR/arch/ppc/boot/images/zImage.elf
Configuring the ML403 and Booting Kernel the using Xilinx's SystemACE
To test the compiled kernel it is necessary to create a SystemACE file. A SystemACE file, short ace-file, combines an elf-file with a bitstream to configure an FPGA. This file is then copiedonto the first partition (file system: FAT), of a medium that the SystemACE controller can access. In case of the ML403 board this is a Compact Flash card. To generate an ace-file, named: linux.ace, for the current project execute the following command in
the project root directory:
xmd -tcl genace.tcl -jprog -board ml403
-hw implementation/download.bit
-elf $KERNEL_DIR/arch/ppc/boot/images/zImage.elf-ace linux.ace
Copy it onto the CF card, and then place the CF card into the CF slot of the ML403. When you switch on the board it should configure the FPGA and then load the kernel. Don't forget to connect
the serial port of the ML403 to a terminal program to watch the kernel booting. If there are any problems, check that you did all the changes to the kernel correct, check the HW settings as well.
Part
two of this howto details how to get the Xilinx EMAC 10/100 MBit/s network core working.
相关文章推荐
- 装完Centos7提示Initial setup of CentOS Linux 7 (core)
- Beautiful Code {16. The Linux Kernel Driver Model: The Benefits of Working Together}
- 【系统】[CentOS]装完CentOS7重启提示Initial setup of CentOS Linux 7 (core)
- VirtualBox + kgdb analysis of Linux kernel (v3.4.0-rc3)
- VirtualBox安装VBoxLinuxAdditions错误:unable to find the sources of your current linux kernel
- 装完Centos7提示Initial setup of CentOS Linux 7 (core)
- redhat 6.4 安装VirtualBox自动增强功能功:unable to find the sources of your current Linux kernel
- The VirtualBox kernel modules do not match this version of VirtualBox 解决 (linux update,nvidia失败)
- Xilinx hijinx,第 1 部分:ML403 全新体验
- Linux kernel config -- the least config of 2.6.32
- 装完Centos7提示Initial setup of CentOS Linux 7 (core)
- unable to find the sources of your current Linux kernel.
- Centos7安装完毕后重启提示Initial setup of CentOS Linux 7 (core)的解决方法
- 装完Centos7提示Initial setup of CentOS Linux 7 (core)
- 装完Centos7提示Initial setup of CentOS Linux 7 (core)
- Centos7安装完毕后重启提示Initial setup of CentOS Linux 7 (core)的解决方法
- Analysis of Linux kernel crashes
- Centos7安装完提示Initial setup of CentOS Linux 7 (core)
- VirtualBox安装VBoxLinuxAdditions错误:unable to find the sources of your current linux kernel
- Centos7安装完毕后重启提示Initial setup of CentOS Linux 7 (core)的解决方法