Table of Contents

Mainline Linux 2.6 kernel for Microblaze, Linux on Microblaze

I would like to thanks PetaLogix for lending Xilinx s3e1600E board and Xilinx for providing ML505 and s3adsp1800 boards.

If you want something to know please send email to microblaze mailing list with CC to me. (archive, archive-gmane)

Latest code is available at GIT server. http://git.monstr.eu/git/gitweb.cgi

Linux maintaining fragment

Known BUGs

TODO

What is different?

Patch submission

Before sending your patches please do:

  1. Check for-linus, fixes-for-linus and next branch for latest rc changes
  2. Check it with checkpatch.pl script which is in linux kernel and run sparse (make C=1) for checking too. I will reject all patches which break coding style.
  3. Sending only in-line patches (git-send-email is recommended) do not attach them - it is better for reviewing.
  4. Send the smallest patches as possible and fix only one issue separately.
  5. Look at Documentation/SubmittingPatches for proper line.

Toolchain

How to boot Microblaze FDT kernel?

Vocabulary

BSP

For working with FDT kernel you need to have DTS file which describes your Microblaze SoC.

BSP updates

This chapter is only for user which wants to update BSP.

Prepared pack contains three BSP
  1. Top BSP which helps you with generation all BSP with one setting. For more information look at this site.
  2. U-BOOT bsp which generate files for U-BOOT bootloader. For more information look at this site.
  3. Device tree BSP which generates DTS setting file
Cloning BSP from GIT server

Device tree compiler

For creating DTB which is passing to Linux kernel you need DTC

Hardware design

Hardware requirements

Please check your system.xmp (or *.xmp which you use) that ModuleSearchPath is set correctly

Please choose TOP BSP and set values there.

For example fragment from *.mss file for ml505

For example fragment from *.mss file for s3e1600

Bootloader options

Before you start to build hardware you should choose our booting strategy. I would like to give you some options what you can choose.

  1. Create your own bootloader
  2. Use common bootloader
    1. Use small bootloader - FS-BOOT
    2. Use advanced bootloader - U-BOOT
DescriptionOwnFS-BootU-BOOT
Memory consumptionDepends on your features8k BRAM>128k
FunctionsDepends on what you want to developCopy SREC to memory, Boot kernel from Flash - readingFull Flash, System ACE, Network-emaclite,emac,ll_temac, gpio, booting all kernel and a lot of others
Time of developingDepends on your features but it is huge in compare to standard solution-Only adding features which are not there
Source code maintaining Customer must care aboutPetaLogixme
Stability uknown ~99.9% stable ~99% stable - Depends on setting

You can use our own bootloader in all variants but be sure you have time and developer who will do it. Keep in your mind that if you want to use it after some years again someone take care about. Please counted how much money this option cost. You will not have any support of it.

  1. System has no non-volatile memory (without FLASH, SPI flash, SystemACE)
    • Use FS-BOOT which waits for SREC through serial line
      • copy advanced bootloader to ram and start it - recommended way
        • + add more functionality
        • - you want to boot any kernel - you must have any different way how to get kernel to memory
        • loading around 30s (baudrate 115200)
      • copy directly linux kernel to memory and boot it
        • + simply
        • - time wasting
  2. System has FLASH memory - NOR
    • Use FS-BOOT and place it to BRAM
      • Only start kernel stored in FLASH (Kernel is stored to FLASH via JTAG)
      • Start U-BOOT and use U-BOOT for advanced booting - recommended way
    • Use any simple bootloader which only jump to flash memory and boots whatever
  3. System has FLASH memory - NAND, Spansion FLASH
    • Use U-BOOT which can work with NAND flashes
  4. System has System.ACE
    • Create own bootloader which will read file from CF and loads it to memory and boots - it is possible load U-BOOT too
    • Use .ACE file with FS-BOOT and boots kernel or U-BOOT stored in flash
    • Use .ACE file with U-BOOT - recommended way
  5. System has SPI flash
    • Currently I don't know about any standard solution. Recommended way is stored U-BOOT there and create simple bootloader which copy it to main memory and jump to start.

Hw build

U-BOOT bootloader

mkimage executable files

Linux Microblaze FDT kernel

Creating DTB file

FDT Kernel booting

Memory layout

Kernel can be place to almost every position. There are some limitation like. The last instruction of kernel cannot exceed limit which is placed approximately 16 kB from the end of memory. You have to calculate with the size of file system too.

U-BOOT

For noMMU kernel -> here is separated Rootfs and kernel

For MMU kernel -> initramfs is included in image.ub file

If you see message below you have problem with overriding DTB with kernel image. You should change fdt address.

Booting from others bootloaders

Command line priorities

From the lowest to the highest priority

NFS rootfs

Setup nfsroot bootargs

Setup current configs in menuconfig

Command line options summaru

Rootfs on SystemACEroot=/dev/xsa2
NFS rootfsroot=/dev/nfs rw nfsroot=192.168.0.102:/tftpboot/rootnfs
Console on uart16550 or old uartliteconsole=ttyS0,115200
Console on uarliteconsole=ttyUL0,115200
Turn off consolesilent=off
Single user modesingle
tmpfs as root devfs=mount rw rootfstype=tmpfs root=/dev/ram
setup ipaddr by dhcpip=dhcp
setup static ipaddrip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>
ip=192.168.10.2:192.168.10.1:192.168.10.1:255.255.255.0:test:eth0:on

Serial console

Uartlite

Uart16550

Extract compiled in .config

I recommend you in developing to enable CONFIG_IKCONFIG, CONFIG_IKCONFIG_PROC for compiled in .config

Showing linux kernel buffer

Via U-BOOT

Via XMD

There is second way how to read Linux kernel log buffer via XMD. This features is not available for free users. Here is the log to show you how this options works. There are new built-in features in xmd called log. The script find-out log buffer from latest Linux kernel code and you can just type log command to show whole log buffer.

FIXME

HeartBeat function

Saving value in Microblaze ASM

Store byte

        ori     r10, r0, 0x12345678
        addik   r11, r0, r0_ram + 0x300
        addik   r12, r0, r0_ram + 0x304
        sb      r10,r0,r11
        sbr     r10,r0,r12

XMD% mrd 0xd02b602c 10
D02B602C:   00000078
D02B6030:   78000000
D02B6034:   00000000

Half word

        ori     r10, r0, 0x12345678
        addik   r11, r0, r0_ram + 0x300
        addik   r12, r0, r0_ram + 0x304
        sh      r10,r0,r11
        shr     r10,r0,r12

XMD% mrd 0xd02b602c 10
D02B602C:   00005678
D02B6030:   78560000
D02B6034:   00000000

Word

        ori     r10, r0, 0x12345678
        addik   r11, r0, r0_ram + 0x300
        addik   r12, r0, r0_ram + 0x304
        sw      r10,r0,r11
        swr     r10,r0,r12

XMD% mrd 0xd02b602c 10
D02B602C:   12345678
D02B6030:   78563412
D02B6034:   00000000

Error logs

Initramfs bug

stat.h

ROMFS on 2.6.29-rc2/rc3

Broken setgroups syscall

noMMU No init found

Sparse Installation