Forums » Software Development »
PIN mux details and modifications
Added by Raja Vankam over 12 years ago
Hi,
I have to use more GPIOs in our design. I am thinking of using the pins assigned for CAN0 and CAN1 in Mityarm as GPIO.
Do i have to change the pin mux configuration if so do i have to use any utility for that?
u-boot needs to be re compiled for the same? if so could you please send me the details of platform and procedure to recompile the same?
Thanks.
Replies (14)
RE: PIN mux details and modifications - Added by Michael Williamson over 12 years ago
Are you using linux as your target OS? If you, you will need to update the pinmux settings in your baseboard-XXXX.c file in the kernel for the pins in question. You probably don't need to change u-Boot for these pins if you use external pull up/down resistors (most pins on the SOM are tristated with weak pull ups during initialization and u-Boot does not set them).
The TI wiki for the AM3359 as well as our kernel and u-Boot wiki have some basic compilation instructions.
-Mike
RE: PIN mux details and modifications - Added by Raja Vankam over 12 years ago
Hi Mike,
Thanks for the information.
what are all the modifications we have to do if our board doesnot have any external pull up/down resisters?
Changing Mux details in baseboard_XX.c file seems not working for LCD_data pin to GPIO.
Could you please let us know with an example, say LCD_Data pins to be changed to GPIOs as output always.
Regards,
Raja.
RE: PIN mux details and modifications - Added by Raja Vankam over 12 years ago
Hi Mike,
To change the mux details i have defined the basic pin details to GPIO and added GPIO pin details to mux335x.c file.
I tried pins of CAN1, LCD_DATA and tried to probe on connector J401 for LCD but could not get the value what i have written.
My host operating system is Ubuntu 10.10 and using mityarm OVP with Ubuntu 10.04 on it.
Please let us know how to get through this.
Thanks.
RE: PIN mux details and modifications - Added by Michael Williamson over 12 years ago
Hi,
So there are 3 steps to configuring a GPIO.
1) modify the baseboard file and ensure your issuing a pin mux configuration.
2) make sure the pin mux option is defined int he mux335x file (TI didn't complete the definitions, so make sure your pins are defined).
3) in the unix shell you need to run the commands:
echo "N" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpioN/direction
echo "1" > /sys/class/gpio/gpioN/value
If you send me or post your patches to the kernel I can review them. If you tell me exactly what pin on the devkit you'd like to toggle I can try to whip up some patches for you and post them here.
You might also consider posting this to the TI E2E website, as the same approach would apply to the EVM (this is really a "programming the SOC" question as opposed to "programming the SOM" question, and TI should support such an inquiry).
-Mike
RE: PIN mux details and modifications - Added by Raja Vankam over 12 years ago
Hi,
Thanks for your quick response.
I have tried the same by configuring LCD_data0 pin to GPIO. as lcd_data11.gpio0_8 as AM33xx_PIN_OUTPUT and added to MUXENTRY of the same pin in mux33xx.c file. Not able to find the file mux335x.c file. Are you referring to same file what i have modified above.
Rebuilt the uImage and copied to SD card and booted.
Run the commands in the shell as shown by you.
It would be of great help if can give me patch for configuring LCD_DATA11 pin to GPIO.
Thanks
RE: PIN mux details and modifications - Added by Raja Vankam over 12 years ago
Hi,
Do you have any updates for me regarding my approach on pinmux?
Thanks.
RE: PIN mux details and modifications - Added by Michael Williamson over 12 years ago
Not yet (kind of bandwidth constrained, sorry).
You might try posting to the E2E site on TI's support site:
This shouldn't be specific to the CL SOM, this is more of a basic AM335x question.
I will try to get to it, but I need to round up hardware and get some time to write up some code for you....
Can you post your baseboard file? It may be something simple that I can quickly review instead of cook up from the ground up....
Sorry for the delay.
-Mike
RE: PIN mux details and modifications - Added by Raja Vankam over 12 years ago
Attached the baseboard file for your refence.
Wanted to configure LCD_DATA pin to be configured as GPIO.
Thanks.
RE: PIN mux details and modifications - Added by Michael Williamson over 12 years ago
Hi Raja,
Can you also post your boot up text (dmesg)? I just want to check for any boot / pinmux error messages if you haven't already done so.
-Mike
RE: PIN mux details and modifications - Added by Raja Vankam over 12 years ago
Log file.
teraterm.log (17.6 KB) teraterm.log |
RE: PIN mux details and modifications - Added by Michael Williamson over 12 years ago
Hi. OK.
From your log file, there is an error:
[ 0.079700] _omap_mux_get_by_name: Could not find signal lcd_data11.gpio0_8
This means that the pinmux setting for this pin you are trying to use as a GPIO is not properly defined in the mux33xx.c file. Until you can clear this error message, you won't be able to toggle the pin. I suspect that's your problem.
Did you patch the mux33xx.c file to define the pinmux position for gpio0_8?
I really wish TI would finish these tables when they originally define them. The only define the tables for the pinmux settings for their specific EVM's.
-Mike
RE: PIN mux details and modifications - Added by Raja Vankam over 12 years ago
Hi,
But i have changed the can_pin_mux and LCD_Data0 pins aswell. but even those are also not working. I have attached the mux335x file for your reference.
Please let me know anything can be done. I will post to TI based on your input.
RE: PIN mux details and modifications - Added by Michael Williamson over 12 years ago
Hi.
In your log file, you show modification of gpio 100.
The gpio offset on the linux command line needs to be
GPIO = bank*32+offset
that corresponds to gpio3_4. I don't see that anywhere in your mux files.
Also, you need to echo "out" > /sys/class/gpioN/direction to make the pin an output, or else it will remain as an input (the default for GPIOs, I think).
Which gpio offsets are you using for your test for the can_pin_mux and lcd data pins?
-Mike
RE: PIN mux details and modifications - Added by Raja Vankam over 12 years ago
I have tested these pins too
can_pin_mux[] = { {"uart1_rxd.gpio0_14", AM33XX_PIN_OUTPUT}, {"uart1_txd.gpio0_15", AM33XX_PIN_OUTPUT}, {"mii1_txd3.gpio0_16", AM33XX_PIN_OUTPUT}, {"mii1_txd2.gpio0_17", AM33XX_PIN_OUTPUT},
same i have configured in mux335x.c
LCD: LCD_data0.gpio2_6. GPIO number is: 70.
for can pin mux, as it is bank 0, direct numbers: 14 - 17 are used.
example i showed to just demonstrate one example on how i tested before sending log to you.