Working with AutoConfig

User Guide
Copyright Information
Acknowledgements
Terminology
Introduction
PetaLinux Overview…
Working with PetaLinux – The Basics
Overview
Loading the settings file
Selecting a Platform
PetaLinux Configuration
Building your Hardware
Working with AutoConfig
Building PetaLinux
Booting your System
Customising PetaLinux…
Advanced Topics…
Debugging…
PetaLinux Bootloader Solutions…
Supported Reference Designs…
PetaLinux Tools Reference
Getting Help
PetaLinux AutoConfig™ framework allows the hardware configurations to be propagated to the bootloader and Linux kernel configurations. A few simple parameters in your EDK project’s MSS (MicroProcessor Software Specification) file are all that is required to automatically configure the kernel and bootloader for your specific hardware platform.

Briefly, the steps are:

Create a new linux platform, with the petalinux-new-platform command. This is optional – you can stick with the default “microblaze-auto” platform if you wish.
Create your EDK hardware project in the ${PETALINUX}/hardware/user-platforms subdirectory
Edit your MSS file to specifiy the PetaLinux autoconfiguration BSP tools (see below)
Use EDK to build the hardware project
Use the petalinux-copy-autoconfig helpder script to propagate the system settings from your hardware project, across to your new Linux platform
Rebuild PetaLinux, to get your fully configured bootloader, Linux kernel and root filesystem image, ready for download.
Overview of the MSS file section for PetaLinux BSP
The MSS file in an EDK project is where software and library settings for that proejct are configured. The PetaLogix’ autoconfig tools integrate with the EDK to allow you to specify PetaLinux platform settings just like any other EDK software project.

The following is an example of the OS section you need to add to an MSS file for PetaLinux integration:

BEGIN OS
PARAMETER OS_NAME = petalinux
PARAMETER OS_VER = 1.00.b
PARAMETER PROC_INSTANCE = microblaze_0
PARAMETER stdout = RS232_Uart
PARAMETER stdin = RS232_Uart
PARAMETER main_memory = plb_ddr_0
PARAMETER main_memory_bank = 0
PARAMETER main_memory_size = 0x04000000
PARAMETER flash_memory = opb_emc_0
PARAMETER flash_memory_bank = 1
PARAMETER lmb_memory = lmb_bram_if_cntlr_1
END

Parameter Explanantion Notes
os_name name of the BSP to use for this CPU Must be set to “petalinux”
os_ver Version number of the BSP. Currently 1.00.b
proc_instance CPU instance attached to PetaLinux Specify the instance name of the MicroBlaze CPU from your MHS file (e.g. microblaze_0)
stdout UART or UARTLITE peripheral for standard output Applies to bootloaders FS-Boot and u-boot only)
stdin UART or UARTLITE peripheral for standard input Applies to bootloaders FS-Boot and u-boot only)
main_memory Instance name of memory interface controller that is the main system memory
main_memory_bank Memory bank number, for multi-banked memory interface controllers Required for most EDK memory interface controllers
main_memory_size Override the memory size Optional – can be used to force Linux to use less than the full memory range
flash_memory Instance name of memory interface controller connected to non-volatile flash memory Optional.
flash_memory_bank Memory bank number, for multi-banked memory interface controllers Required for most EDK memory interface controllers
lmb_memory Instance name of on-chip BRAM memory interface controller. Optional
Copying the AutoConfig file
When EDK builds your hardware project, the PetaLinux BSP file auto-config.in for 2.4 kernel and Kconfig.in for 2.6 kernel will be also be created. To copy it across to your currently selected PetaLinux platform, use the petalinux-copy-autoconfig command as follows:

In the hardware project directory, execute the following command.

[[email protected]/my-platform]$ petalinux-copy-autoconfig
This command will automatically detect your software project installation on your system and install the hardware AutoConfig™ files into your software development build tree.

You can now return to the software/petalinux-dist directory to build (or rebuild) your PetaLinux kernel and bootlaoder, ready for download.