public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Device tree vs hardware configurations
@ 2014-09-23 17:58 Nikita Yushchenko
  2014-09-25  6:42 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Nikita Yushchenko @ 2014-09-23 17:58 UTC (permalink / raw)
  To: devicetree; +Cc: linux-kernel, Gennady Kuznetsov, Aleksey Makarov

Hi

I'm currently forward-porting a BSP for imx6-based custom board from 
pre-devicetree kernel to modern kernel.

In old BSP there was a board setup file, that registered all board's 
devices. For new BSP, I need to replace that with device tree based 
solution.

However, old BSP used conditional code to register devices differently 
based on GPIO inputs and on kernel command line. This approach was used to

- handle board's jumper that switches SPI CS lines: current jumper 
setting is available over gpio, depending on that old BSP registered 
chips differently,

- handle different i2c connections on different board revisions: board 
has 5 i2c busses with quite a few devices connected, these busses are 
routed to different hardware busses on different board revisions, board 
revision could be read over gpios.

- handle different possible display connections (lvds vs lcd, 6bit vs 
8bit hw interface) based on kernel command line options

- handle different possible camera connections by registered camera 
differently based on kernel command line option

... and more,


Device tree describes hardware unconditionally. I already have to 
provide 2 dts files for imx6q and imx6dl based setups (both just include 
a common dtsi) ...  But providing separate dts file for every possible 
hardware configuration will result into 2^n device trees, which is 
inconvenient visible regression against old BSP that "just worked" on 
all hardware configurations.


Is there a sane way to handle hardware configurations like above in 
device tree based kernel?


Nikita Yushchenko

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-25  6:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-23 17:58 Device tree vs hardware configurations Nikita Yushchenko
2014-09-25  6:42 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox