GeorgeIoak
Posts: 43
Joined: Thu Aug 30, 2012 1:50 am

Polarity in dt-blob.bin

Thu Nov 30, 2017 12:44 am

I'm working on creating a dt-blob and reading through https://www.raspberrypi.org/documentati ... uration.md and other references.

I understand active high and active low when you're interfacing with functions on microcontrollers but I'm wondering how it's used it's used on the Pi. Is this just another method to define a pin state that goes together with startup_state or is this different and I'm missing some explanation on how this is used?

Thanks,
George

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1847
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Polarity in dt-blob.bin

Thu Nov 30, 2017 11:02 am

First of all, I need to make it clear that dt-blob.bin is not Device Tree, even though it uses the DT compiler and has "dt" in it's name.

The polarity in dt-blob only applies to input and output pins - GPIOs - where it allows for a software translation between "on/off" and "high/low". GPIOs controlled by the firmware can have their sense inverted by marking them as active low. Because most users only care about the spare GPIOs brought out on the header pins as controlled by the ARM(s), the dt-blob view of polarity is of limited use, but if you are designing a custom Compute Module carrier board then it can be used when assigning common firmware GPIO functions (activity LEDs, low power detection etc.) to pins of your choosing.

GeorgeIoak
Posts: 43
Joined: Thu Aug 30, 2012 1:50 am

Re: Polarity in dt-blob.bin

Thu Nov 30, 2017 5:18 pm

Hi and thanks for your response. Sorry if this post should have been in another category but I thought it was best suited here.

I have created a custom board that is basically a Hat for the Pi3. This is for the first prototypes and later I plan on migrating this to the compute module.

It sounds like I can ignore these settings for now but for future research is there a reference ARM document that I can refer to. Can you provide an example of where this might be used. My understanding of active low/high comes when a pin has a dedicated function, say enable, or sleep. If it's active high then a high signal turns that function on but an active low means you need to apply a low signal.

I'm sorry but coming at this from a software/firmware approach seems odd to have that capability unless perhaps this means that you could change the behavior the mode of a pin. As an example say you wanted to use a SPI port but instead of CE being active low, this would allow you to redefine it to be active high. Stills seems a bit odd to me since if you're designing hardware you usually design around what the hardware function is.

Thanks again,
George

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1847
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Polarity in dt-blob.bin

Thu Nov 30, 2017 5:25 pm

As I said, these polarity settings only apply to GPIOs when accessed from the firmware (the dt-blob.bin is strictly for the firmware). For the other functions, including SPI, whether or not they support control of the polarity is function-dependent, and you will need to use function-specific ways of specifying the required polarity.

The BCM2835 peripherals, including SPI and GPIO, are described in the BCM2835 ARM Peripherals guide.

GeorgeIoak
Posts: 43
Joined: Thu Aug 30, 2012 1:50 am

Re: Polarity in dt-blob.bin

Thu Nov 30, 2017 10:57 pm

Thanks, that link helps. It doesn't appear that the guide for the BCM2837 has been released, has it? I ask because the reference blob (https://github.com/raspberrypi/firmware ... .dts#L1157) shows GPIOs 128-135 and if I'm going to design for the compute module I believe I would need to know those functions (or at least it would be good to know).

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1847
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Polarity in dt-blob.bin

Fri Dec 01, 2017 12:28 am

128-135 are on an I2C-controlled GPIO expander which has no alternate functions - just input and output. They are provided by an external IC, not part of BCM2837, so the BCM2835 guide is still relevant and sufficient.

Return to “Device Tree”

Who is online

Users browsing this forum: No registered users and 7 guests