Bootlin contributes a new interface to the Linux NAND subsystem

MTD stack

Over the last months, Bootlin engineers Boris Brezillon and Miquèl Raynal have been working on rewriting the NAND controller driver used on a large number of Marvell SoCs. This NAND controller driver had grown very complicated, and Miquèl’s adventure in this rework led him to contribute a new interface to the NAND framework, in order to simplify implementing NAND controller drivers for complex NAND controllers. In this blog post, Miquèl summarizes the original issue, and how it is solved by the ->exec_op() interface he has contributed.

Introduction

The NAND framework is the layer between the generic MTD layer and the NAND controller drivers. Its purpose is to handle MTD requests and transform them into understandable NAND operations the controller will have to send to the NAND chip.

For general information about NANDs, the reader is invited to read the ONFI specification (Open NAND Flash Interface) which defines the most common NAND operations.

Interacting with a NAND chip

Raw NANDs (so-called “parallel NANDs”) are slave devices waiting for instructions from the controller. An operation is a sequence of instructions usually referred as “command” (CMD), “addresses” (ADDR), and “data” cycles (DATA_IN/DATA_OUT) and sometimes wait periods (WAITRDY). Some everyday operations any NAND enthusiast should know by heart are, for instance:

NAND operation example

How it was handled in the Linux kernel

Today, a majority of NAND controlller drivers implement the ->cmd_ctrl() hook. It aimed to be a very small function, designed to just send command and address cycles independently, usually embedding some very controller-specific logic. This hook was supposed to be called by a function of higher level from the NAND core, ->cmdfunc(). In addition to calling ->cmd_ctrl() to send command and address cycles, the core would also call ->read|write_byte|word|buf() hooks to actually move data from the NAND controller and the memory (the DATA parts in the diagram above).

This approach worked very well with simple NAND controllers, which are just able to send command and address cycles one at a time to the NAND chip, without any extra intelligence. However, NAND controllers have become more and more complex and now can handle higher-level operations, usually to provide higher performance. For example, a NAND controller may provide an operation that would do all of the command and address cycles of a read-page operation in one-go. Some controllers even support only those higher-level operations, and are not able to simply do the basic operation of sending one command cycle or one data cycle. To handle such controllers, their drivers were overloading the ->cmdfunc() hook directly, circumventing the generic NAND core implementation of ->cmdfunc(). This is a first drawback: it is no longer possible to easily add logic to the NAND core to support new NAND operations, because some drivers overload the ->cmdfunc() logic. Worse, ->cmdfunc() doesn’t provide some information such as the length of the data transfer, which some controllers actually need in order to run the desired operation. NAND controller drivers started to have complicated state machines just to work around the NAND framework limitations.

NAND stack before exec_op

Some driver-specific implementations of this hook started diverging from the original one, giving maintainers a lot of pain to maintain the whole subsystem, specifically when they needed to introduce additional vendor-specific operations support. These implementations were not only diverse but also incomplete, sometimes buggy and most importantly, developers had to guess the data that would probably be moved by the core after that, which is clearly a symptom that the framework was not fitting the user needs anymore.

The ->exec_op() era

The NAND subsystem maintainers decided to switch to a new approach, based on a new hook called ->exec_op(), implemented by NAND controller drivers and called by the generic NAND core. The logic behind that name is to provide to every controller a generic interface that can easily be extended and exposes the overall NAND operation to be performed. This way, the driver can optimize depending on the controller capabilities without the need of a complex state machine as ->cmdfunc() was.

All major NAND generic raw operations like reset, reading the NAND ID, selecting a set of timings, reading/writing data and so on found their place into small internal functions named nand_[operation]_op().

From the NAND controller driver point of view, an array of instructions is received for each operation. The controller then needs to parse these instructions, decides if it can handle the overall operation, splits the operation if needed, and executes what is requested.

Using the ->exec_op() interface is as simple as declaring a list with the controller capabilities, each entry of this array having a callback function knowing the overall operation that will actually handle all the logic. The NAND core was enhanced with a proper parser that one may use in his driver to handle the callback selection logic.

NAND stack with exec_op

For a more complete overview, one can check the slides and the video of Miquèl’s presentation at FOSDEM about NAND flash memories and the introduction of ->exec_op() in the Linux kernel.

Current status

The ->exec_op() interface in the NAND core has been accepted and merged upstream, and will be part of Linux 4.16. The first driver converted to this new interface was obviously the NAND controller driver used on Marvell platforms, pxa3xx_nand. It has been rewritten as marvell_nand, and will also be part of Linux 4.16. Even though the new driver is longer (by lines of code) than the previous one, it supports additional features (such as raw read and write operations), allows the NAND core to pass custom commands to the NAND chip, and has a logic that is a lot less complicated.

Miquèl has also worked on converting the fsmc_nand driver to ->exec_op(), but this work hasn’t been merged yet. In the community, Stefan Agner has taken on the task to convert the vf610_nfc driver to this new approach.

Bootlin is proud to have contributed such enhancements to the Linux kernel, and hopes to see other developers contribute to this subsystem in the near future, by migrating their favorite NAND controller driver to ->exec_op()!

Bootlin at the Embedded Linux Conference 2018

Like every year for more than 10 years, Bootlin engineers will participate to the next Embedded Linux Conference, which takes place in Portland on March 12-14. Of course, it will be our first ELC with our new company name! In total, eight engineers from Bootlin will participate to the event. Maxime Chevallier, who joined Bootlin last Monday, will be attending the conference, his first one with a Bootlin hat (but Maxime has already been a speaker at the last Embedded Linux Conference Europe).

Embedded Linux Conference 2018

We will also be giving a number of talks, tutorials or moderating Bird of a Feather sessions:

We’re really happy to again meet the embedded Linux open-source community at this event! It is worth mentioning that following this event, Bootlin CTO Thomas Petazzoni will be in the Silicon Valley on March 15-16, available for business meetings: do not hesitate to contact us if you’re interested.

Crowdfunding campaign for upstream Linux kernel driver for Allwinner VPU

Back in 2012, Bootlin engineer Maxime Ripard pioneered the support for Allwinner processors in the official Linux kernel. Today, thanks to the contributions of numerous developers around the world and our involvement, there is very good support for a large number of Allwinner processors in the Linux kernel, to the point where actual Allwinner-based products are shipping with the mainline kernel.

Despite this major effort, there is one area that has remained unsupported in the mainline kernel: the video decoding and encoding engine, which allows to accelerate in hardware the decoding and encoding of popular codecs such as MPEG2, MPEG4 or H264. Last summer, we successfully implemented a prototype, supporting MPEG2 decoding and partially MPEG4 decoding.

Today, we are launching a crowdfunding campaign to fund the remainder of the development: finishing MPEG4 decoding support, implementing H264 decoding, optimizing the rendering of video frames in cooperation with the display driver, and upstreaming the driver. We also have additional goals of supporting H265, encoding support, and additional Allwinner SoCs.

In the vendor-provided kernel, this video decoding/encoding unit is supported by a kernel driver that uses a non-standard user-space API, in conjunction with a binary-only userspace blob. Fortunately, a number of people have done an enormous reverse engineering effort, which we have leveraged for our existing prototype, and which we intend to use to continue the development of this upstream driver. Both Maxime Ripard and our intern Paul Kocialkowski will be working on this crowdfunded project.

This is our first crowdfunding campaign to fund upstream Linux kernel development, and we are interested in seeing how much interest there is in such a financing model. Help us making this a success by spreading the word!

Free Electrons becomes Bootlin

Bootlin logo

Free Electrons is changing to a new name, in the context of a trademark dispute.

Reasons for changing

On July 25, 2017, the company FREE SAS, a French telecom operator, known as the owner of the free.fr website, filed a complaint before the District Court of Paris against Free Electrons and its founder Michael Opdenacker for infringing upon 3 trademarks which include the word “free” and on FREE SAS’s rights on its domain name and its company name.

In this complaint, FREE SAS asked, among others, the French judges to order Free Electrons and its founder Michael Opdenacker to pay the total sum of 107,000 euros on various grounds, to order Free Electrons to change name, to delete the domain name “free-electrons.com” within 15 days and to cease all use of the sign “FREE ELECTRONS” but also of the term “free” alone or with any other terms in any field in which FREE SAS is active or for any goods and services covered by its prior trademarks.

Michael Opdenacker and Free Electrons’ management consider that these claims are unfounded as both companies were coexisting peacefully since 2005.

The services we offer are different, we target a different audience (professionals instead of individuals), and most of our communication efforts are in English, to reach an international audience. Therefore Michael Opdenacker and Free Electrons’ management believe that there is no risk of confusion between Free Electrons and FREE SAS.

However, FREE SAS has filed in excess of 100 oppositions and District Court actions against trademarks or names containing “free”. In view of the resources needed to fight this case, Free Electrons has decided to change name without waiting for the decision of the District Court.

This will allow us to stay focused on our projects rather than exhausting ourselves fighting a long legal battle.

The new name

Amongst all the new names we considered, “Bootlin” came out as our favorite option. It can’t express all our values but it corresponds to what we’ve been working on since the beginning and hope to continue to do for many years: booting Linux on new hardware.

Of course, “booting” here shouldn’t be limited to getting a first shell prompt on new hardware. It means doing whatever is needed to run Linux by taking the best advantage of software and hardware capabilities.

Same team, same passion

Nothing else changes in the company. We are the same engineers, the same Linux kernel contributors and maintainers (now 6 of us have their names in the Linux MAINTAINERS file), with the same technical skills and appetite for new technical challenges.

More than ever, we remain united by the passion we all share in the company since the beginning: working with hardware and low-level software, working together with the free software community, and sharing the experience with others so that they can at least get the best of what the community offers and hopefully one day become active contributors too. “Get the best of the community” is effectively one of our slogans.

Practical details

The only thing we’re changing is the name (“Bootlin” instead of “Free Electrons”), the domain name (bootlin.com instead of free-electrons.com) and the logo. The two penguins, our mascots which have been the key identification of Free Electrons for many years will stay the same. Except for the domain name change, all URLs should stay the same, and all e-mail addresses too.

For the moment, we’ve just migrated the mail and main web servers. The other services will be updated progressively.

For practical reasons, the name of the company running Bootlin will remain “Free Electrons” for a few more months. Until then, there won’t be any impact on the way we interact with our customers. We will let our ongoing customers know when the legal name changes.

What about links to free-electrons.com resources, made by community websites but also in mailing lists archives and in public forums? Of course, we redirected the old URLs to the new ones, and will continue to do so as long as we can. However, depending on the outcome of the legal procedure, we may not be able to keep the free-electrons.com domain forever. Therefore, we would be grateful if you could update all your links to our site whenever feasible, to avoid the risk of broken links in the future.

Bootlin at FOSDEM and Buildroot Developers meeting

The FOSDEM conference will take place next week-end in Brussels, Belgium. As the biggest open-source conference event in Europe, featuring a number of talks related to embedded systems and generally low-level development, Bootlin never misses this event!

Fosdem 2018 logo

This year, Bootlin engineer Miquèl Raynal will be giving a talk Drive your NAND within Linux – Forget the word “nightmare”, sharing details on the enhancements he has contributed to the Linux kernel MTD subsystem, and which are scheduled to be merged in the 4.16 Linux kernel release.

In addition to Miquèl’s talk, a number of other Bootlin engineers will be attending the event: Mylène Josserand, Quentin Schulz, Antoine Ténart, Boris Brezillon and Thomas Petazzoni.

Buildroot logoFinally, Bootlin is also sponsoring the participation of Thomas Petazzoni to the Buildroot Developers Meeting, which is a 2-day event dedicated to the development of the Buildroot embedded Linux build system. With 14 attendees, this event will have the largest number of participants it ever had. We take this opportunity to thank Google and Mind, who are sponsoring the event by providing the meeting room, lunch and social event for the attendees.

Tourist suggestions in Avignon, France

We very regularly organize public training sessions about embedded Linux and kernel and drivers training sessions in Avignon in France. Of course, we can also organize such sessions anywhere in the world.

AvignonThese tips only reflect our own interests and tastes. There are certainly others other worthy things to do and see in the area. We would recommend to buy a tourist guide book about Provence, which will have a much more exhaustive and objective coverage. See also the Avignon tourism website for updates and information about local events.

Sightseeing in Avignon

Popes Palace, AvignonThe historic city centre of Avignon, the Popes’ Palace, all the episcopal buildings and the Saint Benezet Bridge are listed as world heritage sites by UNESCO.  The Avignon city walls constitute the 2nd longest continuous wall in the world, after the Great Wall of China. The annual Festival d’Avignon (around July) is one of the biggest art festivals in the world.

The Popes Palace one of the 10 most visited monuments in France. It is the biggest Gothic edifice in all of Europe and awe-inspiring monument to the importance of Avignon in the Christian world of the Middle Ages.

You can go up to Rocher des Doms, the cradle of the city, for a refreshing break among the peacocks and swans by the pond. From this spot, you have panoramic views over the entire city, its tiled roofs and bell towers and over to Villeneuve-les-Avignon and all the surrounding areas (stairs behind the main building of the palace).

Saint Benezet Bridge, AvignonThe Saint Bénézet Bridge was built around 1180 – miraculously, according to legend, by a simple shepherd – to link the city to Villeneuve-les-Avignon. Over the years, wars and successive flooding by the Rhone partially destroyed the bridge. Today, the 12th century Saint Nicholas Chapel remains, as well as four arches of which the span constitutes, according to a prestigious civil engineer, an amazing feat for the period.

Museums

Hieronymus Bosch, Calvet Museum, Avignon

The Petit Palais Museum: exceptional collection of paintings from Italy and Provence (end 13th – beg. 14th century) and collection of Romanesque and Gothic sculptures from Avignon.

The Calvet Museum: in a splendid 18th century town house. Fine arts, painting and sculpture collection (15th – 20th century).

The Angladon Museum: ancient town house in the center of Avignon’s old town: masterpieces of the 19th and 20th century and 18th century living rooms, signed furniture, works of art, paintings and drawings.

Collection Lambert en Avignon: amazing showcase of modern art, spanning from paintings and land art to photography and video.

Shopping

Shopping Street, Avignon

At the bottom of the Place de l’Horloge, the main avenue, Rue de la Republique, divides the city into two. On one side, the Rue Saint Agricol leads to the chic and bourgeois neighborhood with the Rue Joseph Vernet, the 5th Avenue of Avignon where designer clothing and luxury goods shops abound, and the Place Crillon, with the prestigious Hotel d’Europe in a former private town mansion built in the 16th century for the Marquis de Graveson.

The Les Halles market of Avignon is a treasure trove for all kinds of products from the Provence area. Every day from 6:30 am to 1:30 pm vendors sell local vegetables, herbs, meats, olives and oil, and anything lavender-related. The market is housed in a big, modern building in the city center which facade is overgrown with plants and moss, making it stand out from the traditional architecture around it.

The Rue de la Republique, the central axis of the city, and the pedestrian areas are rather dedicated to big shopping brands: Fnac (books, music and technology), Zara, H&M, Eram, André, Naf-Naf, Promod, Kookai, etc.

You can also find many little designer shops in the very typical Rue des teinturiers.

Restaurants

To eat at the restaurants in town, it is recommended to book a table in advance. The best idea for up-to-date advice is probably to use sites that collect tourist reviews (here’s the TripAdvisor page for restaurants in Avignon).

Here are a few that we like and at least gave us a good impression the last time we went:

  • Le 26, 26 rue des Trois Faucons, 84000 Avignon
  • D’ici et d’ailleurs 4 Rue Galante, 84000 Avignon, 04 90 14 63 65

Here are more good restaurants worth visiting outside of Avignon:

  • Domaine de la Camarette 439 Chemin des Brunettes, 84210 Pernes les Fontaines, 04 90 616 078 (booking is compulsory)
  • Mas de Grès 1651 RD 901 – Four à Chaux-Isle sur Sorgue, 84800 Lagnes 04 90 20 32 85

More sightseeing in Provence

Culture and heritage

L'Isle sur la Sorgue
L’Isle sur la Sorgue:
“Comtadine Venice” with its
numerous canals and 300 antique sellers

Orange
Orange:
The Roman Theater and Triumphal Arch

Gordes
Gordes:
See the village, lavender fields and the Sénanque Abbey

Venasque
Venasque:
The medieval Baptistery and the old town

Vaison la Romaine
Vaison la Romaine:
Roman ruins and the old town

Carpentras
Carpentras:
The oldest synagogue in France

Pernes les Fontaines
Pernes les Fontaines:
The 40 fountains

Aix en Provence
Aix en Provence:
The mountain “Sainte Victoire” – subject of a number of Cézanne’s paintings.

Aix en Provence
Aix en Provence:
The Cours Mirabeau and the old town

Uzès
Uzès:
The famous Roman “Pont du Gard” aqueduct and the old town.

Arles
Arles:
The Roman amphitheatre and the old town.

Les Baux-de-Provence
Les Baux-de-Provence:
Cathédrale d’Images: sound and lights show in ancient and spectacular stone-pits.

Nîmes
Nîmes:
The Roman amphitheatre and the arenas.

Museums

Pernes les Fontaines Costumes comtadines
The museum of the Comtadin costume: in an ancient shop of the 19th century, exhibition of ancient Comtadin costumes and traditions linked to the materials.
The Maison Fléchier: reconstruction of the last santonnier’s workshop of Pernes les Fontaines, traditions of the Comtat Venaissin and of Provençal Christmas.

Fontaine de Vaucluse
Speleology museum: in a recreated life-size scenery, presentation of the researches and explorations of the Fontaine de Vaucluse and other speleological sites.
Library Pétrarque museum

RoussillonOchres in Roussillon

Conservatoire des ocres et pigments appliqués: ancient ochre factory created in 1871.

Carpentras
Duplessis museum: collection of fine arts of the town and art works by artists of the Comtat Venaissin
Pharmacy Museum: preserved in order from the 18th century with its jars of Italian, Montpellier and Moustier earthenware.

Cavaillon
Provençal nativity scene museum: one of the nicest santon collections of the Luberon and the Alpilles.

Gordes
500px photo (217546431)

Pol Mara museum: 200 works to discover in the castle with the biggest Renaissance chimney of Europe.

Nature

The régional Parc of the Luberon: it provides a habitat to a exceptional variety of flora and fauna, as for an architectural and natural heritage of high value.

The Mont Ventoux: The giant of the Provence (1912 m).

Fontaine de Vaucluse: natural resurgence of the Sorgue that gushes forth at the foot of a 230 m cliff.

The Provençal Colorado: Remains of an ancient ochre quarry on more than 30 hectares. Colorado provençal 2

The Alpilles: exceptional massif with famous towns and villages such as les Baux de Provence, Saint Rémy en Provence

The Thouzon cave in le Thor: discovered the 23rd of January 1902, it is the only natural cave laid out for tourism in the Vaucluse. It lies in the centre of the Pays des Sorgues.

The Dentelles de Montmirail: A small chain of mountain with a dramatically jagged shape of their peaks. A perfect place for hiking.

The gorges of the Nesque: imposing wild canyon, perfect for cycling and walking.

The Orgnacpothole in Bollène: Cave and regional prehistoric museum

The villages

Our region is famous for its picturesque villages, with their Mediterranean flair. One can, while walking, make discoveries and plunge in the history of the region.
Oppède le Vieux 2013 table d orientation 02

The villages with character in:
The Ventoux: Venasque, Le Beaucet, Séguret, Le Crestet, Brantes, Méthamis, Mazan
The Luberon: Gordes, Roussillon, Murs, Joucas, Bonnieux, Lacoste, Ménerbes, Lauris,
Oppède le Vieux, Lourmarin, Cabrières d’Avignon, Saignon, Curcurron
The Alpilles: Les Baux de Provence, Saint Rémy de Provence, Eygalières

Visit their markets – between rosemary and thyme, melon or figs the beautiful stallholders with their singsong accents sale peaches, apricots or a nice bunch of lavender.

You’ll find the planning for markets around Avignon here.

Do not miss: the farmer markets in Coustellet (Sundays from 9 a.m. until 1 p.m.) and in Velleron (in the summer, every day as from 6 p.m., except Sundays and bank holidays).
Market in Aix-en-Provence, France (6053041300)

The Wine road

Luberon red wine and food pairing

Between the Luberon, the Ventoux and the Côtes du Rhône, the Vaucluse can be proud of being one of the nicest wine region of France. The clayey chalky soil, the different grape varieties, and the wine grower’s know-how produce world famous wines. Here under, a list of the best wine growers of the Côtes du Rhône, Côtes du Luberon and Côtes du Ventoux.
To taste with moderation.

The Côtes du Rhône

Sablet:
Domaine de Piaugier

Rasteau:
Domaine de la Soumade

Vacqueyras:
Domaine des Amouriers

Gigondas:
Domaine de la Présidente

Uchaux:
SCEA Château d’Hugues

Châteauneuf du Pape:
Domaine de Beaurenard
La Cave du Verger des Papes
Château la Nerthe

Tavel:
Domaine de la Mordorée

Saint Gervais:
Domaine St Anne

Saint Victor la Coste:
Domaine Pélaquié

Beaumes de Venise:
Domaine de la Pigeade
Domaine de Durban
Vignes beaumes de venise

The Côtes du Luberon

Oppède:
Domaine de la Citadelle

Apt:
Domaine de Mayol

La Tour d’Aigues:
Château de la Dorgonne

La Motte d’Aigues:
Bastide du Claux

The Côtes du Ventoux

Mormoiron:
Château Pesquié

Mazan:
Domaine de Fondrèche
Terre de Solence

Flassan:
La Ferme Saint Pierre

The country products

Truffel
The famous truffle markets, with their special atmosphere, take place in winter (Fridays in Carpentras and Saturdays in Richerenches). Once in the season (the last week of December) takes place the big Truffle Market of Ménerbes, where is also to see the Maison de la Truffe et du Vin du Luberon (the House of truffle and wine of the Luberon), bringing lots of information on those subjects.

Olive oil
A list of oil mills in the Luberon area.Old Olive Oil Mill in Mouriès
The mill Moulin de la Balméenne in Beaume de Venise

Goats cheese
Family Morard in Buoux

Tapenade (olive paste)
”Les Délices du Luberon” in Isle sur la Sorgue

Berlingots (boiled sweet)
Confectionner’s shop ”Confiserie du Mont Ventoux” in Carpentras
Calissons (sweets made of ground almond)
Confectionner’s shop ”Confiserie du Roy René” in Aix en Provence

Croquettes (almond croquettes)
Traditional biscuit factory ”Aujoras” in Morières-les-Avignon

Nougat
The nougat factory ”Silvain Frères” in Saint Didier Nougat de Montélimar - 20090704

Activities for the young and the not-so-young

All year round

The Jarditrain in Saint Didier
miniature world dedicated to the train passion

Karting in Monteux

The Crocodile Farm in Pierrelatte

La Barben Zoo
The biggest animal parc of south-eastern France

Haribo Sweets museum in Uzès
Come and discover the great story of the sweets and try them.

Hot-air balloon
One of the most original and beautiful ways of discovering the Luberon, gliding with the birds over the beautiful landscapes. One can do that just next to ours, in Joucas.

During the summer

Kayak Vert in Fontaine de Vaucluse (March – November)
From Fontaine du Vaucluse down to l’Isle sur la Sorgue, discover the joys of canoeing during the 2 hours of the descent of the Sorgue. https://www.canoefrance.comKayak à l'Isle-sur-la-Sorgue

Passerelle des Cimes (bridges in the trees) in Lagnes (March – November)
Young and not-so-young will go for an adventure on differents secure itinaries: https://www.parcours-aerien.com

Mini golf de la Peupleraie in Isle sur la Sorgue (Mai – September)
Outdoor activity Espace for the whole family

Circus castle Alexis Gruss in Piolenc (Mai – September)
Visit of the Circus Gruss museum, make up, ride in a barouche, circus workshop, trapeze, horses. https://www.alexis-gruss.com/piolenc/accueil.htm©Jacques Gavard - Alexis Gruss

Colorado Aventure in Rustrel (March – November)
3 hour adventure for the whole family, courses for children and juniors.
https://www.colorado-aventures.com

Bambouseraie en Cevennes (March – November)
A unique journey in the heart of giant bambou forest and hundred-year-old trees, approximately 100 km away from Avignon.

Back from ELCE: participation to the Device Tree workshop

After publishing our slides and videos from the Embedded Linux Conference Europe (ELCE), reporting on talks selected by Bootlin engineers, and mentioning the award given to Michael Opdenacker, here comes the last blog post giving feedback from our participation to the 2017 edition of this conference.

On Thursday after ELCE, Bootlin engineers Maxime Ripard and Thomas Petazzoni participated to the Device Tree workshop, a day-long meeting to discuss the status and future of Device Tree support, especially in the context of the Linux kernel.

Device Tree Workshoup group photo 2017

Beyond participating to the event, Maxime and Thomas also presented briefly on two topics:

  • Maxime Ripard brought up the topic of handling foreign DT bindings (see slides). Currently, the Device Tree bindings documentation is stored in the Linux kernel source tree, in Documentation/devicetree/bindings/. However, in theory, bindings are not operating-system specific, and indeed the same bindings are used in other projects: U-Boot, Barebox, FreeBSD, Zephyr, and probably more. Maxime raised the question of what these projects should do when they create new bindings or extend existing ones? Should they contribute a patch to Linux? Should we have a separate repository for DT bindings? A bit of discussion followed, but without getting to a real conclusion.
  • Thomas Petazzoni presented on the topic of avoiding duplication in Device Tree representations (see slides). Recent Marvell Armada processors have a hardware layout where a block containing multiple IPs is duplicated several times in the SoC. In the currently available Armada 8040 there are two copies of the CP110 hardware block, and the Linux kernel carries a separate description for each. While very similar, those descriptions have subtle differences that make it non-trivial to de-duplicate. However, future SoCs will not have just 2 copies of the same hardware block, 4 copies or potentially more. In such a situation, duplicating the Device Tree description is no longer reasonable. Thomas presented a solution based on the C pre-processor, and commented on other options, such as a script to generate DTs, or improvements in the DT compiler itself. A discussion around those options followed, and while tooling improvements were considered as being the long-term solution, in the short term the solution based on the C pre-processor was acceptable upstream.

For Bootlin, participating to such events is very important, as it allows to expose to kernel developers the issue we are facing in some of our projects, and to get direct feedback from the developers on how to move forward on those topics. We definitely intend to continue participating in similar events in the future, for topics of interest to Bootlin.

MIPI I3C specification published, and new iteration of Linux I3C subsystem

MIPI I3C specification publishedBack in August 2017, Bootlin contributed to the Linux kernel a patch series adding support for the new MIPI I3C bus, a bus that aims at replacing busses like I2C and SPI, by offering better performance, lower power consumption, and new features like discovery, in-band interrupts and hot join.

At the time of our submission, the I3C specification was closed, but a few days ago, the MIPI Alliance announced that the I3C specification was now publicly available. This is of course very good news as it will allow a much easier and wider adoption of I3C, and it was a somewhat unexpected move since the MIPI Alliance had traditionally kept its specifications only for its members. Hopefully the I3C experience will encourage the MIPI Alliance to follow the same direction for existing or future protocols.

With this announcement from the MIPI Alliance, it was time for us to submit an updated version of our I3C support for the Linux kernel, which Bootlin engineer Boris Brezillon did on Thursday: [PATCH v2 0/7] Add the I3C subsystem. Compared to the previous version submitted in August, this new version has interesting improvements:

  • A generic infrastructure to support IBIs (in-band interrupts) was added
  • Helpers to support hot-join were added to the core I3C subsystem
  • The Cadence I3C controller driver was improved to support IBIs and hot-join
  • And of course, many of the comments received on the first iteration have been addressed

With the specification now public, we hope to receive useful comments and feedback from the Linux kernel community to improve, and hopefully in the near future, merge the support for the MIPI I3C bus.

Bootlin contributes Linux support for Microsemi MIPS SoC

VSC7513 Block Diagram
Microsemi VSC7513 Block Diagram
Earlier this month, Bootlin engineer Alexandre Belloni posted a patch series (in its second version) adding initial support for Microsemi Ocelot SoCs, the VSC7513 and VSC7514. These SoCs are used for switches, so the biggest part of the chip is a switch fabric, built around a MIPS core and a few basic peripherals. While Bootlin generally works on ARM platforms and has contributed support for numerous ARM processors in the Linux kernel, for this project we are contributing the support for a MIPS processor.

Alexandre’s initial patch series contains the basic support for the SoC:

All in all, this patch series only adds support to boot the platform up to a shell, with interrupts, pin-muxing, GPIOs and UARTs enabled. Additional features will be contributed later, especially support for the switch fabric in the form of a switchdev driver.

We are happy to be working on Microsemi platforms, and to bring the support for yet another hardware platform to the official Linux kernel.

Feedback from the Netdev 2.2 conference

The Netdev 2.2 conference took place in Seoul, South Korea. As we work on a diversity of networking topics at Bootlin as part of our Linux kernel contributions, Bootlin engineers Alexandre Belloni and Antoine Ténart went to Seoul to attend lots of interesting sessions and to meet with the Linux networking community. Below, they report on what they learned from this conference, by highlighting two talks they particularly liked.

Linux Networking Dietary Restrictions — slides — video

David S. Miller gave a keynote about reducing the size of core structures in the Linux kernel networking core. The idea behind his work is to use smaller structures which has many benefits in terms of performance as less cache misses will occur and less memory resources are needed. This is especially true in the networking core as small changes may have enormous impacts and improve performance a lot. Another argument from his maintainer hat perspective is the maintainability, where smaller structures usually means less complexity.

He presented five techniques he used to shrink the networking core data structures. The first one was to identify members of common base structures that are only used in sub-classes, as these members can easily be moved out and not impact all the data paths.

The second one makes use of what David calls “state compression”, aka. understanding the real width of the information stored in data structures and to pack flags together to save space. In his mind a boolean should take a single bit whereas in the kernel it requires way more space than that. While this is fine for many uses it makes sense to compress all these data in critical structures.

Then David S. Miller spoke about unused bits in pointers where in the kernel all pointers have 3 bits never used. He argued these bits are 3 boolean values that should be used to reduce core data structure sizes. This technique and the state compression one can be used by introducing helpers to safely access the data.

Another technique he used was to unionize members that aren’t used at the same time. This helps reducing even more the structure size by not having areas of memory never used during identified steps in the networking stack.

Finally he showed us the last technique he used, which was using lookup keys instead of pointers when the objects can be found cheaply based on their index. While this cannot be used for every object, it helped reducing some data structures.

While going through all these techniques he gave many examples to help understanding what can be saved and how it was effective. This was overall a great talk showing a critical aspect we do not always think of when writing drivers, which can lead to big performance improvements.

David S. Miller at Nedev 2.2

WireGuard: Next-generation Secure Kernel Network Tunnel — slides — video

Jason A. Donenfeld presented his new and shiny L3 network tunneling mechanism, in Linux. After two years of development this in-kernel formally proven cryptographic protocol is ready to be submitted upstream to get the first rounds of review.

The idea behind Wireguard is to provide, with a small code base, a simple interface to establish and maintain encrypted tunnels. Jason made a demo which was impressive by its simplicity when securely connecting two machines, while it can be a real pain when working with OpenVPN or IPsec. Under the hood this mechanism uses UDP packets on top of either IPv4 and IPv6 to transport encrypted packets using modern cryptographic principles. The authentication is similar to what SSH is using: static private/public key pairs. One particularly nice design choice is the fact that Wireguard is exposed as a stateless interface to the administrator whereas the protocol is stateful and timer based, which allow to put devices into sleep mode and not to care about it.

One of the difficulty to get Wireguard accepted upstream is its cryptographic needs, which do not match what can provide the kernel cryptographic framework. Jason knows this and plan to first send patches to rework the cryptographic framework so that his module nicely integrates with in-kernel APIs. First RFC patches for Wireguard should be sent at the end of 2017, or at the beginning of 2018.

We look forward to seeing Wireguard hit the mainline kernel, to allow everybody to establish secure tunnels in an easy way!

Jason A. Donenfeld at Netdev 2.2

Conclusion

Netdev 2.2 was again an excellent experience for us. It was an (almost) single track format, running alongside the workshops, allowing to not miss any session. The technical content let us dive deeply in the inner working of the network stack and stay up-to-date with the current developments.

Thanks for organizing this and for the impressive job, we had an amazing time!