LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 07-11-2016, 03:35 AM   #1
Knarzos
LQ Newbie
 
Registered: Jul 2016
Posts: 2

Rep: Reputation: Disabled
Advice in system/driver architecture


Hi, may I ask for your advice.

I have an Embedded-System with a PowerPC P2020 running a Kernel 4.1.x which is build on an ELDK5.4.
In ELDK we create a uimage and dtb file which is flashed with uboot.

This System is connected to a bunch of peripheral cards containing i2c chips and other stuff.
We have a custom driver to communicate with these peripheral cards and monitor different states in the i2c chips. Lately the hardware designers found a critical "bug" in the hardware which lead to a changed set of i2c chips on the peripherals.
The driver modification is not the problem, but the system needs to support the old and the new peripheral boards, because the hardware is costly and we can't just trash the old peripherals.
(There is now way to get the peripheral revision number and distinguish between the old and new version.)

I’m not very experienced with Linux and don't know if this is the correct approach to solve the problem:
- Branch the driver to create one version for the old hardware and one version for the new hardware
- Create a dtb file for both hardware configurations. (This bugs me most. I would be easy to load one or the other module at start-up, but to flash the dtb file for every hardware change feels strange)

Is there a better way to solve this problem?


Summary:
Embedded system with Kernel 4.1.xx (uimage, dtb, module support on)
Needs to support different hardware configurations.

Regards,
Knarzos
 
Old 07-12-2016, 06:26 PM   #2
blue_z
Member
 
Registered: Jul 2015
Location: USA
Distribution: Ubuntu, Lubuntu, Mint, custom embedded
Posts: 104

Rep: Reputation: Disabled
To implement the approach you mention, you could either manually install the correct dtb for each board (but that is fallible) or enhance U-Boot with some mechanism to detect the HW version, and then load the proper dtb. Of course your kernel image would have both driver versions available.

> to flash the dtb file for every hardware change feels strange

There are methods for storing multiple dtb files and kernel images.
Instead of raw flash partitions, these files should be stored in the /boot directory of the root filesystem.


If the HW differences aren't too extreme (or you want to conceal these differences), then you could have one composite driver for both HW versions, and at runtime (e.g. starting at probe) handle the differences. In theory this could isolate the HW differences to just one driver.
For marketed chips/devices, this is the typical approach. The kernel source tree has driver files for specific chips/devices or families of chips/devices, and not files per each version/variation.

In general you would want to avoid having a human decide/install the correct soft/firmware. The pros and cons for any approach would also depend on the scope of those HW differences and the amount of effort for development and maintainability you expect to provide.

Regards
 
Old 07-12-2016, 06:40 PM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
It is also possible for a single driver to handle a family of interfaces.

It all depends on how complex the change is as to whether a separate driver should be done. If it is impossible to identify the differences based on PNP identification (model/version), then the driver itself must determine the differences using internal data. If the differences are relatively minor, then the driver should make the determination on its own - a simpler result.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Mail System Architecture anwar-it0 Linux - Server 4 09-09-2013 01:55 PM
how can i port a driver with a specific architecture into another architecture? the hope Linux - Hardware 4 03-23-2011 05:39 PM
what is 'architecture' in 'binary for an architecture'?multiple architecture support? wagaboy Linux - Newbie 2 07-10-2010 11:18 AM
system architecture - 32 vs 64 bit cylarz Linux - Desktop 2 03-28-2007 08:22 AM
system architecture? e1000 Linux - Hardware 7 05-04-2004 05:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 06:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration