AM335x Pinctrl Addresses

I’m trying to configure a board very similar to a Beaglebone Black to work with a 24-bit LCD panel, but to do this I need to configure all 24 LCD data pins to operate as LCD drivers. I was planning on accomplishing this using device tree overlays within my Linux environment, but I’m not really sure how to implement this specifically.

I’m using the “BB-BONE-LCD4-01-00A0.dts” overlay as a reference, which configures lcd_data0 through lcd_data15 to drive an LCD. I also need to configure lcd_data16 through lcd_data24, but I’m not sure how to find the mappings used by pinctrl (eg. 0xa0 = lcd_data0). The pinctrl documentation refers to the addresses as register offsets, but the AM335x Technical Reference Manual doesn’t contain the term “pinctrl” anywhere so I’m not sure where these registers could be. I’ve also tried grep-ing my way through the kernel to figure out how this is implemented, and there are some logical mappings in the drivers/pinctrl directory (eg. PINCTRL_PIN() calls) but I can’t find anything like this for the AM335x. I can’t find any examples of 24-bit LCD device tree overlays, so I don’t really think I have any choice other than finding the pin numbers myself

Does a mapping exist for the AM335x? Any help would be appreciated.

The authoritative source for register values can be found using the
AM335x data sheet (Chapter 2, Terminal Description) and the AM335x
Technical Reference Manual (Chapter 9, Control Module). The LCD signals
are all listed in table 2-10 of the data sheet, with links to the
package-specific pin, which gets you the pin name you can then look up
in section 9.3 of the TRM "Control Module Registers".

There is a handy "crib sheet" available as well:

https://github.com/selsinork/beaglebone-black-pinmux/blob/master/pinmux.ods

...which lists all the pinmux modes for each P8/P9 pin, and provides
control register offset values for the pinmux control register. You may
have to adjust by 0x800, as some code wants the register offset from the
base of the control module register space (ie: 0x800-0x9ff) while other
code expects an offset from the first GPIO pinmux register (ie:
0x000-0x1ff). Make sure you use the proper value.

All of the LCD pins are listed in Derek Molloy’s nice BeagleboneBlackP8HeaderTable.pdf. The high-order ones you are looking for are on P8_11 to P8_17 + P8_19, but the order is mixed up.

Do a web search for BeagleboneBlackP8HeaderTable and BeagleboneBlackP9HeaderTable and you will find Derek’s tables on github.