Marvell publishes the datasheet of the Armada 370 processor

thumb-armada-xpOver the last two years, Bootlin has contributed support for the Marvell Armada 370 and Marvell Armada XP processors to the mainline Linux kernel. These ARM processors are used mainly in Network Attached Storage devices but also in other devices such as printers. Until now the datasheet for these processors was only available for Marvell customers and partners under NDA, but last week, Marvell finally released the datasheet of the Armada 370 publicly, with no restriction, no registration, no NDA. The Armada 370 processor can already be found in several consumer grade products:

From now on, on the Marvell page (broken link removed) related to the Armada 3xx family, the Armada 370 Functional Specification (broken link removed) as well as the Armada 370 Hardware Specifications (broken link removed) can be found. While the Armada XP datasheet is not available at this time, it is worth mentioning that the vast majority of the peripherals are exactly the same between Armada 370 and Armada XP, so even Armada XP users will find useful information in this datasheet.

Bootlin is happy to see that Marvell is making more and more progress towards mainlining their kernel support and opening their datasheets publicly. We strongly believe that the openness of these datasheets will allow hobbyists and developers to improve the support for Armada 370 in the open-source ecosystem, be it in the Linux kernel, in bootloaders like U-Boot or Barebox or even in other projects.

2014 Q2 newsletter

Bootlin is happy to share some news about the latest training and contribution activities of the company.

Linux 3.14 released, Bootlin contributions inside!

Linus Torvalds has just released the 3.14 version of the Linux kernel. As usual, it incorporates a large number of changes, for which a good summary is available on the KernelNewbies site.

This time around, Bootlin is the 19th company contributing to this kernel release, by number of patches, right between Cisco and Renesas. Six of our engineers have contributed to this release: Maxime Ripard, Alexandre Belloni, Ezequiel Garcia, Grégory Clement, Michael Opdenacker and Thomas Petazzoni. In total, they have contributed 121 patches to this kernel release.

  • By far, the largest number of patches are related to the addition of NAND support for the Armada 370 and Armada XP processors. This required a significant effort, done by Ezequiel Garcia, to re-use the existing pxa3xx_nand driver and extend it to cover the specificities of the Armada 370/XP NAND controller. And these specificities were quite complicated, involving a large number of changes to the driver, which all had to also be validated on existing PXA3xx hardware to not introduce any regression.
  • Support for high speed timers on various Allwinner SOCs has been added by Maxime Ripard.
  • Support for the Allwinner reset controller has been implemented by Maxime Ripard.
  • SMP support for the Allwinner A31 SOC was added by Maxime Ripard.
  • A number of small fixes and improvements were made to the AT91 pinctrl driver and the pinctrl subsystem by Alexandre Belloni.
  • Michael Opdenacker continued his quest to finally get rid of the IRQF_DISABLED flag.
  • A number of fixes and improvements were made by Grégory Clement and Thomas Petazzoni on various Armada 370/XP drivers: fix for the I2C controller on certain early Armada XP revisions, fixes to make the Armada 370/XP network driver usable as a module, etc.

In detail, our contributions were:

Bootlin contributions to Linux 3.13

Version 3.13 of the Linux kernel was released by Linus Torvalds on January, 19th 2014. The kernelnewbies.org site has an excellent page that covers the most important improvements and feature additions that this new kernel release brings.

As usual Bootlin contributed to this kernel: with 121 patches merged in 3.13 on a total of 12127 patches contributed, Bootlin is ranked 17th in the list of companies contributing to the Linux kernel. We also appeared on Jonathan Corbet kernel contribution statistics at LWN.net, as a company having contributed 1% of the kernel changes, right between Renesas Electronics and Huawei Technologies.

Amongst the contributions we made for 3.13:

  • Standby support added to the Marvell Kirkwood processors, done by Ezequiel Garcia.
  • Various fixes and improvements to the PXA3xx NAND driver, as well as to the Marvell Armada 370/XP clocks, in preparation to the introduction of NAND support for Armada 370/XP, which will arrive in 3.14. Work done by Ezequiel Garcia.
  • Added support for the Performance Monitoring Unit in the AM33xx Device Tree files, which allows to use perf and oprofile on platforms such as the BeagleBone. Work done by Alexandre Belloni.
  • Support added for the I2C controllers on certain Allwinner SOCs, as well as several other cleanups and minor improvements for these SoCs. Work done by Maxime Ripard.
  • Continued the work to get rid of IRQF_DISABLED, as well as other janitorial tasks such as removing unused Kconfig symbols. Work done by Michael Opdenacker.
  • Added support for MSI (Message Signaled Interrupts) for the Armada 370 and XP SoCs. Work done by Thomas Petazzoni.
  • Added support for the Marvell Matrix board (an Armada XP based platform) and the OpenBlocks A7 (a Kirkwood based platform manufactured by PlatHome). Work done by Thomas Petazzoni.

In detail, the patches contributed by Bootlin are:

Bootlin New Year – 2014

A French version also exists.

The Bootlin team wishes you a Happy New Year for 2014, with plenty of optimism and energy!

We are taking this opportunity to give some news about Bootlin.

In 2013, Bootlin significantly increased its contribution to open-source projects, especially at the Linux kernel level.

639 patches integrated in the Linux kernel, mainly to improve support for Marvell ARM processors and Allwinner ARM processors. For all kernel releases published in 2013, Bootlin has been in the top 30 contributing companies. We now have a significant experience in integrating support for ARM processors in the Linux kernel, and we expect to work more in this area in 2014.

595 patches integrated in the Buildroot embedded Linux build system, in a large number of areas, making Bootlin the second most important contributor after Buildroot’s maintainer. This effort allows Bootlin to keep an up-to-date expertise in cross-compilation and build systems.

26 patches integrated in the Barebox bootloader:

22 patches to the Yocto Freescale layer, mainly adding support for the Crystalfontz boards. In the process, a new image type was developed and significant improvements were made to the Barebox recipe.

Several of these contributions, and many other activities, were driven by development and consulting activities in 2013, with mainly:

  • Linux kernel code development, adding and maintaining support for customer ARM processors or boards in the mainline Linux kernel. Especially on Marvell and Freescale processors.
  • Linux kernel, driver development and build system integration for an Atmel SAMA5 based medical device.
  • Development of Linux kernel drivers for radio-frequency transceivers, on an Atmel SAMA5 based home automation platform.
  • Boot time optimization audits.
  • Buildroot consulting and audit.

We have also significantly improved and updated our training courses:

  • Our embedded Linux and kernel driver development course was updated to use the BeagleBone Black platform, to cover the usage of the Device Tree on ARM platform, and to use a fun I2C device to illustrate the development of a device driver in our labs.
  • Our Android system development course was updated to use Android 4.x, and use the BeagleBone Black as the development platform for the practical labs.
  • Our embedded Linux system development course was updated to use more recent versions of the Linux kernel, in order to cover the usage of the Device Tree on ARM platforms.

Our training materials remain freely available under a Creative Commons license, including their source code, available from a public Git repository.

Bootlin continues to believe that participating to conferences is critical to keep its engineers up to date with the latest Linux developments and create connections with the developers of the Linux community which are essential to make our projects progress faster. For this purpose, we participated to a large number of conferences in 2013:

  • FOSDEM 2013, in Brussels, Belgium. Our CTO and engineer Thomas Petazzoni gave a talk about ARM kernel development
  • Buildroot Developers Meeting, Brussels, Belgium. Our engineer Thomas Petazzoni organized and participated to this 2-days meeting, sponsored by Google, to work on Buildroot developments.
  • Embedded Linux Conference 2013 and Android Builders Summit 2013, in San Francisco, United States. Our engineer Gregory Clement gave a talk about the Linux kernel clock framework. Our engineer Thomas Petazzoni gave a talk about ARM kernel development. See also our videos.
  • Linaro Connect Europe 2013, Dublin Ireland. Our engineer Thomas Petazzoni participated to numerous discussions related to support for ARM processors in the Linux kernel.
  • Linux Plumbers 2013, New Orleans, United States. Our engineer Maxime Ripard attended the conference, and participated to discussions around Android and Linux kernel development.
  • Kernel Recipes, Paris, France. Both Bootlin CEO Michael Opdenacker and CTO Thomas Petazzoni participated to this Linux kernel conference, and Thomas gave two talks: one about ARM kernel development and one about Buildroot.
  • ARM kernel mini-summit 2013, Edinburgh, UK. Our engineers Gregory Clement, Thomas Petazzoni and Maxime Ripard participated to the invitation-only ARM kernel mini-summit. This summit is the key place to discuss and define the next directions for support for ARM processors in the Linux kernel.
  • Embedded Linux Conference Europe, Edinburgh, UK. Gregory Clement gave a talk about about the Linux kernel clock framework and Thomas Petazzoni gave a talk about the Device Tree.
  • Buildroot Developers Meeting, Edinburgh, UK. Our engineer Thomas Petazzoni organized and participated to this 2-days meeting, sponsored by Imagination Technologies, to work on Buildroot development.

A very important development of Bootlin in 2013 is the addition of a new engineer to our team: Alexandre Belloni joined us in March 2013. Alexandre has a very significant embedded Linux and kernel experience, see his profile.

Now, let’s talk about our plans for 2014:

  • Hire several additional engineers. One of them has already been hired and will join us in April, bringing a significant Linux kernel development experience, including mainline contribution.
  • Our involvement in support for ARM processors in the Linux kernel will grow significantly.
  • Two new training courses will be released: one “Boot time reduction” training course, and an “OpenEmbedded and Yocto” training course.
  • For the first time, we will organize public training sessions (open to individual registration) outside of France.
    • Our next Android system development session in English will happen on April 14-17 in Southampton, UK
    • We are also working on embedded Linux and Kernel and driver development sessions in the USA, to be announced in the next weeks.
    • We also plan to organize embedded Linux and Kernel and driver development sessions in Germany, with German speaking trainers.
    • By the way, our Android system development courses in French will continue to run in Toulouse, but there will also be a session on April 1-4 in Lyon.

    See also the full list of public sessions.

As in 2013, we will participate to several key conferences. We have already planned our participation to: Linux Conf Australia (January 2014), FOSDEM (February 2014), Embedded Linux Conference (April 2014) and the Embedded Linux Conference Europe (October 2014).

You can follow Bootlin news by reading our blog and by following our quick news on Twitter. We now have a Google+ page too.

Again, Happy New Year!

The Bootlin team.

New training materials: boot time reduction workshop

We are happy to release new training materials that we have developed in 2013 with funding from Atmel Corporation.

The materials correspond to a 1-day embedded Linux boot time reduction workshop. In addition to boot time reduction theory, consolidating some of our experience from our embedded Linux boot time reduction projects, the workshop allows participants to practice with the most common techniques. This is done on SAMA5D3x Evaluation Kits from Atmel.

The system to optimize is a video demo from Atmel. We reduce the time to start a GStreamer based video player. During the practical labs, you will practice with techniques to:

  • Measure the various steps of the boot process
  • Analyze time spent starting system services, using bootchartd
  • Simplify your init scripts
  • Trace application startup with strace
  • Find kernel functions taking the most time during the boot process
  • Reduce kernel size and boot time
  • Replace U-Boot by the Barebox bootloader, and save a lot of time
    thanks to the activation of the data cache.

Creative commonsAs usual, our training materials are available under the terms of the Creative Commons Attribution-ShareAlike 3.0 license. This essentially means that you are free to download, distribute and even modify them, provided you mention us as the original authors and that you share these documents under the same conditions.

Special thanks to Atmel for allowing us to share these new materials under this license!

Here are the documents at last:

The first public session of this workshop will be announced in the next weeks.
Don’t hesitate to contact us if you are interested in organizing a session on your site.

Linux init failures now easier to debug

If you are an embedded Linux developer too, you have probably been frustrated by the lack of information from the Linux kernel when it failed to start the init process when you’re building a new root filesystem. The only thing you get is No init found, and this could hide many different causes:

  • No init program candidate found at all
  • Some init program candidates exist but they can’t be executed, for multiple possible causes (missing execute permissions, failed to load shared libraries, executable compiled for an unknown architecture…)

The good news is that this source of frustration will be gone in Linux 3.13. Thanks to a Bootlin commit merged on Nov. 13, 2013, whenever an attempt to execute an init program candidate fails, there is a message in the console detailing the executable path and the error code. For example:

Starting init: /sbin/init exists but couldn't execute it (error -13)

When you get such a message, all you have to do is lookup the error code in include/uapi/asm-generic/errno-base.h or maybe in uapi/asm-generic/errno.h. In the above example, the -13 code meant permission denied, typically because of missing execution rights.

This had been annoying me for a long time, and I am glad that the Linux kernel community accepted my improvement!

By the way, many more improvements to the Linux kernel from Bootlin are currently getting merged in 3.13. See all our contributions to the Linux kernel.

Linux 3.12 released, Bootlin 14th contributor by number of commits

Emperor penguins pictureThe 3.12 kernel has just been released by Linus Torvalds, who summarized what he considers to be the major improvements offered by this release: improvements to the dynamic tick code, support infrastructure for DRM render nodes, TSO sizing and the FQ scheduler in the network layer, support for user namespaces in the XFS filesystem, multithreaded RAID5 in the MD subsystem, offline data deduplication in the Btrfs filesystem.

As usual, Bootlin contributed to the Linux kernel during this cycle, and according to the statistics at KPS, Bootlin is the 14th contributor in terms of number of commits, as a company. Bootlin contributed 185 patches to this kernel release, on a total of 10920 patches. Note that this classification includes the “Unknown” company which ranks first, gathering the contributions from all the contributors that are not known to be affiliated to any company.

The highlights of our contributions are:

  • Addition of support for the HX8369 LCD controller to the driver we had contributed earlier for the HX8357 LCD controller, in drivers/video/backlight/hx8357.c. These LCD controllers are used by the Crystalfontz i.MX28 boards, and this new development was done primarily by Alexandre Belloni.
  • Addition of a driver for the Nuvoton NAU7802 ADC chip on I2C, in drivers/iio/adc/nau7802.c. Some initial work was done by Maxime Ripard, but lots of debugging and additional work was done by Alexandre Belloni, who also pushed the driver to the mainline.
  • Added Device Tree information for the PMU unit on Atmel SAMA5D3 platforms, which allows to use perf on these platforms. Done by Alexandre Belloni.
  • Addition of a Device Tree binding to the mvebu-mbus driver, which controls the configuration of the MBus on Marvell EBU platforms (Armada 370/XP, Kirkwood, Dove, etc.). This binding took a lot of discussion time, and many iterations before reaching a state that was considered acceptable for mainline, but it has finally been merged in 3.12. The core of this work was done by Ezequiel Garcia, with several contributions from Thomas Petazzoni to convert existing platforms to the new APIs.
  • Many cleanups and improvements to the nand_pxa3xx driver, which for the moment is used for the NAND controller on PXA3xx, but that we are currently extending to also cover the NAND controller of Armada 370/XP platforms. In 3.12, only some cleanups have been integrated, and we are currently submitting the more important patches for mainline integration. This work was done by Ezequiel Garcia.
  • Cleanups, and conversion to CLOCKSOURCE_OF_DECLARE of the Armada 370/XP clocksource driver. Done by Ezequiel Garcia.
  • Extension of the Marvell I2C driver to use a new feature of the I2C controller found on Armada 370/XP, which allows to program an entire transaction at once, instead of having interrupts at each step of the transaction. This work was done by Gregory Clement.
  • The quest of removing unneeded ->init_irq() callbacks in machine descriptors continued, with Maxime Ripard removing 4 additional occurrences of this in mach-shmobile.
  • Cleanups and improvements to the sun4i clocksource driver, used on Allwinner SOCs. Done by Maxime Ripard.
  • Introduction of the initial support for the Allwinner A31 SOC and its WITS Columbus evaluation kit, as well as initial support for the Allwinner A20 SOC and the Olimex A20-Olinuxino-Micro and Cubieboard2 board, both based on the Allwinner A20 SOC. This includes clock support, pinctrl support, Ethernet support where applicable, and more. Work done by Maxime Ripard.
  • Michael Opdenacker continued his fight against IRQF_DISABLED and removed more occurrences of them. Michael also fixed a few issues in some Kconfig files.
  • Fixed big-endian issues in the Marvell mvneta Ethernet driver and the Marvell XOR driver, in preparation for the addition of big-endian support to the mach-mvebu platform. Done by Thomas Petazzoni.
  • Conversion of a few more Kirkwood platforms to the Device Tree, and removal of legacy support for other Kirkwood platforms that were already converted to the Device Tree. Done by Thomas Petazzoni.
  • Addition of the support for the Armada XP based AXP-WiFi AP board, from Marvell. Done by Thomas Petazzoni.
  • Improvements of the MSI infrastructure in the kernel: consolidation of code between architectures, addition of a registry of msi_chip. This preparatory work was needed to introduce MSI support for Armada 370/XP, which should hopefully make its way into 3.13. Work done by Thomas Petazzoni.

In details, our contributions were:

Crystalfontz boards support in Yocto

The Yocto 1.5 release is approaching and the Freescale layer trees are now frozen.
Bootlin added support for the various Crystalfontz boards to that release as you can check on the OpenEmbedded metadata index.

Yocto Project

First some preparative work has been done in the meta-fsl-arm layer in order to add the required features to generate an image able to boot on the Crystalfontz boards:

  • Support for a newer version of the Barebox mainline, 2013.08.0. As the previously supported version of Barebox was too old, it didn’t include support for the Crystalfontz boards. Also, some work has been done to make the recipe itself more generic so that custom layers can reuse it more easily.
  • Inclusion of the patches allowing the imx-bootlets to boot Barebox. The imx-bootlets were only able to boot U-Boot or the Linux kernel until now.
  • Creation of a new image type, using the imx-bootlets, then Barebox to boot the Linux kernel. All the boards based on a Freescale mxs SoC (i.mx23 and i.mx28) will benefit of this new image type. This is actually the difficult part where you lay out the compiled binaries (bootloaders, kernel and root filesystem) in the final file that is an SD card image ready to be flashed.

Then, the recipes for the Crystalfontz boards have been added to the meta-fsl-arm-extra layer:

  • First the bootloaders, imx-bootlets and Barebox, including the specific patches and configurations for the Crystalfontz boards.
  • Then the kernel. The linux-cfa recipe uses the 3.10 based kernel available on github.
  • The machine configurations themselves, selecting Barebox as the bootloader and the correct kernel recipe. Also, these are choosing to install the kernel in the root filesystem instead of in its own partition.
  • Touchscreen calibration for the cfa-10057 and the cfa-10058 boards. This is required to get xinput-calibrator working properly as it can’t calibrate without starting values.

In a nut shell, you can now use the following commands to get a working image for your particular Crystalfontz board:

  • For your convenience, Freescale is providing a repo manifest to retrieve all the necessary git repositories. So first download and install repo:
    mkdir ~/bin
    curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
    chmod a+x ~/bin/repo
    PATH=${PATH}:~/bin
  • We will work in a directory named fsl-community-bsp:
    mkdir fsl-community-bsp
    cd fsl-community-bsp
  • Ask repo to get the master branch, when Yocto 1.5 is released, you could select the new branch. (Edit: starting from September, 28th, you can use the branch named dora)
    repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b master
  • Download the layers:
    repo sync
  • Configure the build for cfa-10036:
    MACHINE=cfa10036 source ./setup-environment build
  • Start the build with:
    bitbake core-image-minimal
  • Grab a cup of coffee!

You’ll end up with an image that you can flash using the following command:
sudo dd if=tmp/deploy/images/cfa10036/core-image-minimal-cfa10036.sdcard of=/dev/mmcblk0

Obviously, you need to replace cfa10036 by the board model you are using in the above commands. While not completely perfect, core-image-sato is also working.

In detail, the contributions from Bootlin are:

Buildroot 2013.08 released, new features and contributions from Bootlin

Buildroot logoThe 2013.08 release of Buildroot has been published a few days ago by Peter Korsgaard, the project maintainer. As usual, this release contains a number of improvements and new features that are summarized in Peter’s release e-mail, and also visible in the CHANGES file.

On a total of 744 commits merged for this release, Bootlin has contributed 141 patches, focusing on the following main improvements:

  • Conversion of the “internal toolchain back-end” of Buildroot to use the package infrastructure. The internal toolchain back-end is the piece of code in Buildroot that is responsible for building a cross-compilation toolchain (i.e building binutils, gcc, the C library, gdb and the necessary dependencies). Until now, this code was using some basic makefiles, many of which dating from many years back in the history of Buildroot. By converting this piece of code to use normal Buildroot packages, it is now easier to maintain and extend. It is worth noting that the internal toolchain back-end is only one of the two back-ends of Buildroot in terms of toolchains: it can also use pre-built external toolchains.
  • Thanks to the clean up highlighted above, we have added eglibc support to the internal toolchain back-end. Until now, using eglibc or glibc was only possible using pre-built external toolchains. Now, Buildroot is directly capable of building eglibc-based toolchains, in addition to the uClibc library which has been supported for many years by Buildroot. Note that we have already posted patches that also add glibc support, they should hopefully be included for the next release, 2013.11.
  • Vast improvements in the way Buildroot supports the various floating point possibilities on ARM: we’ve added support for the EABIhf ABI, improved how the various floating point units can be selected, etc. Selecting the right floating point solution for your embedded Linux system should now be a lot easier.
  • Support to build a system using the Thumb2 instruction set available on ARM, which provides a smaller code size compared to the classical ARM instruction set.
  • Updates to the available external toolchains: addition of the Arago ARMv5 and ARMv7 toolchains, and update the versions of the available Linaro toolchains for ARM and AArch64.
  • Addition of packages to support the video decoding hardware of some AT91 SoCs, the Hantro x170.

Moreover, in the absence of the official maintainer Peter Korsgaard, Thomas Petazzoni has played the role of interim maintainer during approximately one month, and has handled the first two release candidates of the 2013.08 cycle.

Last but not least, Thomas has also been the mentor of Spenser Gilliland, a student working on Buildroot as part of the Google Summer of Code. His work consists in improving support for ARM multimedia features in Buildroot, and a part of his work went into the 2013.08 release:

  • Addition of a libvpx package
  • Addition of a libopenmax virtual package to support various OpenMAX implementations
  • A complete bump of the Glib/Gtk stack
  • The addition of GStreamer 1.x support (Buildroot already had support for GStreamer 0.10.x, but not the more recent 1.x)
  • Addition of the gst-omx package which allows accelerated video decoding on the Raspberry Pi board thanks to an OpenMAX specific implementation
  • Addition of a ti-gfx package that allows to support OpenGL on TI OMAP platforms, it has been successfully tested with the BeagleBoard XM
  • Addition of the sunxi-mali package to support OpenGL on Allwinner SOCs, and the sunxi-cedarx package to support accelerated video decoding on Allwinner SOCs

The Google Summer of Code is still on-going until the end of September, and Spenser has already posted patches to improve support for Mesa3D, libdrm and the addition of the glmark2 OpenGL benchmark. Those improvements will hopefully be part of the next 2013.11 release.

In detail, the contributions from Bootlin for this release have been: