i.mx28 gpio voltage setting?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.mx28 gpio voltage setting?

4,395 Views
davee
Contributor III

Hi all,

I'm working on  some gpio pins that need 1.8 volts, but 2 pins won't change to 1.8 all the others have? I've set the pin as follows:

{
.name   = "WLAN_EN",
.id     = PINID_SAIF0_SDATA0,
.fun    = PIN_GPIO,
.strength= PAD_8MA,
.voltage= PAD_1_8V,
.drive= 1,
.data  = 1,
.output= 1,
},
{
.name = "WAN_IRQ",
.id = PINID_SSP3_MOSI,  // GPIO2_25
.fun = PIN_GPIO,
.strength = PAD_4MA,
.voltage = PAD_1_8V,
.pullup= 1,
.drive= 1,
.pull= 1,
},

When I measure the pins with dvm they show 3.3v?

The other pins I've set up are alternate functions and measure 1.8v as expected, is there some alternate way to set up gpio or is not possible to use 1.8v on gpio?

Labels (2)
0 Kudos
Reply
17 Replies

3,519 Views
lategoodbye
Senior Contributor I

Hi Dave,

which Kernel version do you use?

Are you sure that these pins aren't already used by a sound interface or like something else?

0 Kudos
Reply

3,519 Views
davee
Contributor III

Hi Stefan,

The kernel version is 2.6.35.3.

According to init functions called by mx28evk_pins_init() the pins are not used by anything else.

But I'll check again.

0 Kudos
Reply

3,519 Views
lategoodbye
Senior Contributor I

Okay, maybe you could try the following commands to get more information:

mount -t debugfs debugfs /sys/kernel

cat /sys/kernel/gpio

Are the defined GPIO names (WLAN_EN, WAN_IRQ) displayed correctly?

3,519 Views
davee
Contributor III

result:

gpio-119 (WLAN_EN             ) out hi

gpio-89  (WAN_IRQ             ) in  lo

I would of expected WAN_IRQ to be high as the pull up is supposed to be enabled.

I added debug and the gpio_request return >0 for those pins.

0 Kudos
Reply

3,519 Views
lategoodbye
Senior Contributor I

Are you absolute sure that you measure the right pins?

If you change the GPIO output value from Linux, then the measure result changes?

0 Kudos
Reply

3,519 Views
davee
Contributor III

I've measured the WAN_EN which should be 1.8v and it reads 3.3v, I cant export the pin as the kernel already has it (I think) so no easy way to change the pin state, but when the pins were used for other functionality at 3.3v they worked without without issue.

WAN_IRQ reads as good as zero.

The pins seem to be setup correctly according to the debug output when the gpio is registered

gpio pin WLAN_EN id 0x3000017 function 3

drive is 1 pull is 0 pullup is 0 output is 1 data is 1

voltage setting exit is 0x0

gpio pin WAN_IRQ id 0x2000019 function 3

drive is 1 pull is 1 pullup is 1 output is 0 data is 0

voltage setting exit is 0x0

the Voltage setting matches PAD_1_8V

0 Kudos
Reply

3,518 Views
lategoodbye
Senior Contributor I

You're right. To handle the GPIOs over sysfs, it is necessary to comment out the entries above.

Am i right, that's a custom board?

What kind of bootloader do you use?

0 Kudos
Reply

3,519 Views
VladanJovanovic
NXP Employee
NXP Employee

Hi Dave,

Did you check that corresponding HW_PINCTRL_DRIVExx register for those pins is configured properly (for 1.8V)? there's a small utility in /unit_tests/ called memtool that you can use to dump register values under Linux to help with checking this.

One option could be that there's some other module in the Linux kernel that utilizes those pins for some other purpose, and thus you're not able to use them for GPIOs.

Vladan

3,519 Views
davee
Contributor III

Hi Vladan,

As per my email, memtool shows the register is not being set for 1.8v operation, also the drive strength is not being set.

I'm using standard linux gpio calls which drill down to mk28_set_voltage, so quite how the other pins have managed to get setup at 1.8v and why no one else is come across this I'm not sure.

0 Kudos
Reply

3,519 Views
davee
Contributor III

The request to set strength and voltage return -22 which EINVAL and according to the function mxs_set_strength and voltage that means the label doesn't match!

This seems to be true for all pins where I have set the pad voltage or strength, I'm now looking at why this might be.

0 Kudos
Reply

3,519 Views
francescoluccon
Contributor I

Hi Dave,

I've discovered the same problem as your one occurred to you. I need to reset the voltage and strength settings for some gpios of imx28 and I discovered that (as Vladan said before) the relative HW_PINCTRL_DRIVExx registers values are wrong (comparing them with settings defined in pin_desc structure of the board).

I've checked out the entire my linux kernel source files, and it sounds there's not any other gpios re-configurations.

Have you discovered anything else? Have you got further info about that bug?

0 Kudos
Reply

3,519 Views
davee
Contributor III

Hi,

I've not had time to look any further now I have my system doing what I need, but that was the only bug that I came across in the gpio, to resolve it for now I just commented out the label check which made no sense to me anyway.

Regards,

Dave

0 Kudos
Reply

3,519 Views
GraceH
Senior Contributor II

It is a software bug, please use attached patch.  For the pin name is not passed to function mxs_gpio_request(struct gpio_chip *chip, unsigned int pin), so the pin name of GPIO pin is set as "gpio". But when set the other properties of the pin, the pin name will be compared, then the functions return error for the wrong pin name.

Grace

0 Kudos
Reply

3,519 Views
davee
Contributor III

That patch results in:

"warning: comparison with string literal results in unspecified behavior"

0 Kudos
Reply

3,520 Views
YixingKong
Senior Contributor IV

Dave

This discussion is closed since no activity. If you still need help, please feel free to reply with an update to this discussion, or create another discussion.

Thanks,

Yixing

0 Kudos
Reply

3,520 Views
tamilarasane
Contributor III

Hi All,

I need to interface WIFI module with imx28.

But my wifi module's  i/o logic is in 1P8V. is it possible to change the imx28 i/o levels of the following pins to 1P8V?

.

SSP0_DETECT

SSP0_DATA0

SSP0_DATA1

SSP0_DATA2

SSP0_DATA3

SSP0_SCK

SSP0_CMD

SSP2_SCK

can you pls explain me the steps ASAP?

Thanks,

Tamilarasan

0 Kudos
Reply

3,520 Views
YixingKong
Senior Contributor IV

Dave

Had your issue got resolved? If yes, we are going to close the discussion in 3 days. If you still need help please feel free to contact Freescale.

Thanks,
Yixing

0 Kudos
Reply