Device Tree Overlay ? why do we need it?

I am a new user to beaglebone and I have a couple of basic questions.
I want to know what is meant by DT or Device tree overlay and why it is required for BB/ ARM335X. Is it not required for other main processors like Intel because they are " defined" in the Linux kernel? and TI ARM3358 processor is not " defined" . What support is available for other “popular” processors and is not available for TI ARM 3358 in Linux Kernal? Or was there support BEFORE and was it taken BACK?
I mean is this the reason that we make a device tree and pass it to the system ? I may have mentioned incorrect statements please feel free to correct me.

secondly, I know that with no Device tree stuff, it is possible to lighten up an LED connected to the BB and BBB using the terminal. So if the definitions are not there in the Linux kernel, how come this method works? I mean how can one export a GPIO and lighten the LED connected if that is not found in the kernel? If so, then is a DT necessary at all?

A confused.

DT simplify kernel development for arm processor as they tend to vary on features, its easier to make a general formula than custom driver for each processor.
I think this link will answer your quetions https://github.com/jadonk/validation-scripts/tree/master/test-capemgr

-Pedro

That's a good question---I think the reason is that ARM has much wider
choice of peripherals that tend to be simpler than typical peripherals
on the x86 architecture. On x86, they are usually connected using the
PCI infrastructure, which configures their register and interrupt
layout at boot and provides that info to the drivers. ARM peripheral
register addresses are defined by the SoC makers and are static, and
also tend to be simpler---a typical x86 peripheral might be an
ethernet or video card requiring dozens of registers to operate, while
a typical ARMs tends to have multiple but simple PWM, timer or serial
port devices that have few registers each.

thank you Pedro and Przemek .

I read through the materiel provided but I still have some doubts.

  1. Do you know a place where a very beginner coming from TI microcontrolers (e.g. MSP430 and ARM Cortex M) can learn this embedded linux from the begining? can you provide a guidance? a series of videos or an extemely good book or some really good source? because I dont seem to get the hang of these stuff by going through posts and blogs because none start from scratch. I haven’t taken any units on e linux in uni either.

  2. Okay, I now get a little bigger picture that DTs are used to define external hardware that can be or are already connected to the ARM Cortex A. So, Why is a DT used to define the HDMI eMMC? It is because the new Linux kernel has not included any hardware definitions for HDMI and eMMC ?

  3. Is it possible that GPIOs be programmed without doing anything with Device trees using the new Linux Kernel in the BBB?

thank you a lot for responses.

I am a new user to beaglebone and I have a couple of basic questions.
I want to know what is meant by DT or Device tree overlay and why it is
required for BB/ ARM335X. Is it not required for other main processors like
Intel because they are " defined" in the Linux kernel? and TI ARM3358
processor is not " defined" . What support is available for other
"popular" processors and is not available for TI ARM 3358 in Linux Kernal?
Or was there support BEFORE and was it taken BACK?
I mean is this the reason that we make a device tree and pass it to the
system ? I may have mentioned incorrect statements please feel free to
correct me.

For a start its not just the 3358/9 that use device tree. It started with
PowerPC chips, has spread to all ARM chips and is now spreading to MIPS
chips. The 3358/9 chips are defined in the kernel and are fully supported.

The x86 and AMD64 chips have as others have mentioned busses that are more
self identifying - such as PCI. However just look at the lmsensors code
to see that there are many chips which provide things like thermal and voltage
sensing which have to be found by implication rather than identification.
ACPI also comes into this equation, but does not exist on ARM.

Linus Torvalds got fed up with the previous way of handing ARM chips and
boards, and so the ARM community used the device tree to get rid of the mess.
However there was a lot of mess, and so converting everything to use the
device trees is taking a bit of time and getting in the way of new development
as there are only a limited number of developers.

You can find details about device tree at http://www.devicetree.org which
will give you the history and the links to OpenFirmware which is the real
origin of device trees.

secondly, I know that with no Device tree stuff, it is possible to lighten
up an LED connected to the BB and BBB using the terminal. So if the
definitions are not there in the Linux kernel, how come this method works?
I mean how can one export a GPIO and lighten the LED connected if that is
not found in the kernel? If so, then is a DT necessary at all?

Most people want to rather more than just light up a LED.

A confused.

David

I personally highly recommend the book “Bad to the Bone” You can read my review here: https://groups.google.com/forum/?fromgroups#!category-topic/beagleboard/osLlMAbfKac

Dear garyamort,

Since the book is written for the Linux Kernel version 3.2 and the current version is 3.8 do you think I will have any problem?
awaiting your reply.

I think this rant from Linus explains it all :wink:

http://article.gmane.org/gmane.linux.ports.arm.omap/55060

It includes both versions - the examples generally will have “here is how to do it in 3.2” followed by “here is how to do it in 3.8”

  1. Why is a DT used to define the HDMI

Because this is a system-on-chip. The HDMI, gpio, gpu, pruss, etc are all peripherals of the cpu that are located on the chip, but still separate from the cpu.

  1. If you just want to get gpio or leds working quickly, check out this post: https://groups.google.com/d/msg/beagleboard/75suL1Mhzao/FBZr4gPM2wkJ
    And, make sure you have the latest production image and check out the /lib/firmware path. I think there’s a device tree overlay for about everything on chip now.

thank you David Lambert ,
G
aryamortand

Brandon , appreciate your time spent!

I’m planing to buy the book recomended. I think it might stop me from wandering around with my problems:-)

and that means using previous Kernel in the beaglebone its possible that we connect an LED in series with a resister and lightn it up using jurst terminal! but where as when we install the new kernel (3.8), its going to involve the device tree overlaying since the “board file” is not there anymore and the new kernel needs an Overlay defining its GPIO and all peripherals thus as soon as the new kernel is installed using the terminal I will not be able to play around with GPIO or any pheripheral for that matter.

okay. phew! that was hard to learn! did a lot of reading today! but was worth it. Thank you everyone for helping!

this blog have a lot of helpful DT stuff
http://hipstercircuits.com/