Robostix u-boot

From GumstixDocsWiki

Jump to: navigation, search

Currently, when the gumstix/robostix combo boots up, the robostix boots up with RESET asserted. I've also heard reports of people having troubles with the voltage conversion not working well. This appears to be caused by the fact that the gumstix connector has VCC5 on it rather than V_BATT, and VCC5 is disabled by default.

The Robostix modifications page shows a way of modifying the gumstix connector.

Rather than just present the final result, I thought it would be good to give some background. The pins that we're interested in manipulating are:

GPIO Active Description
70 High VCC5/AVCC enable
72 Low '245 enable
73 Low Reset


The first thing to do is to identify the various registers required to manipulate the GPIO lines. I've extracted the pertinent lines from include/asm-arm/arch-pxa/pxaregs.h

#define GPLR2 __REG(0x40E00008) /* GPIO Pin-Level Register GPIO<80:64> */
#define GPDR2 __REG(0x40E00014) /* GPIO Pin Direction Register GPIO<80:64> */
#define GPSR2 __REG(0x40E00020) /* GPIO Pin Output Set Register GPIO<80:64> */
#define GPCR2 __REG(0x40E0002C) /* GPIO Pin Output Clear Register GPIO <80:64> */
#define GAFR2_L __REG(0x40E00064) /* GPIO Alternate Function Select Register GPIO<79:64> */

Enter uboot by pressing return as the gumstix boots. You should get a GUM> prompt. Enter md 40E00000 and you should get something that looks like this:

GUM> md 0x40E00000
40e00000: 327ddf3f ffffbfff 01cec000 cd82a9f8 ?.}2............
40e00010: 0002aa80 0001ffff 00000000 00000000 ................
40e00020: 00000000 00000000 00000000 00000000 ................
40e00030: 00000000 00000000 00000000 00000000 ................
40e00040: 00000000 00000000 00000000 00000000 ................
40e00050: 00000000 80011000 a5254010 69908010 .........@%....i
40e00060: aaa5aaaa aaaaaaaa 00000000 00000000 ................
40e00070: 00000000 00000000 00000000 00000000 ................
40e00080: 327ddf3f ffffbfff 01cec000 cd82a9f8 ?.}2............
40e00090: 0002aa80 0001ffff 00000000 00000000 ................
40e000a0: 00000000 00000000 00000000 00000000 ................
40e000b0: 00000000 00000000 00000000 00000000 ................
40e000c0: 00000000 00000000 00000000 00000000 ................
40e000d0: 00000000 80011000 a5254010 69908010 .........@%....i
40e000e0: aaa5aaaa aaaaaaaa 00000000 00000000 ................
40e000f0: 00000000 00000000 00000000 00000000 ................

The values that we're interested in are (see Chapter 4 of the PXA 255 Processor Developer's Manual)

40E00014: 0001ffff GPDR2 - pins 70, 72 & 73 are all configured as output
40E00064: aaaaaaaa GAFR2_L - pins 70, 72 & 73 all configured as AF2

The data direction appears to be correct for all of the pins (output) so we'll leave that alone. We want to set the VCC5 enable to 1 and 245-enable to 0, and we may or may not want to take the robostix out of reset.

This uboot command:

mw 40E0002C 100;mw 40E00020 240;mw 40E00064 aaa0caaa

will clear the 245-enable, set the Vcc5-enable and reset, and configure those 3 pins as GPIO pins. This uboot command:

mw 40E0002C 300;mw 40E00020 40;mw 40E00064 aaa0caaa

will clear 245-enable and reset, set VCC5-enable, and configure those 3 pins as GPIO pins.

To simplify things a bit we can do this:

setenv robostix_pwr_run "mw 40E0002C 100;mw 40E00020 240;mw 40E00064 aaa0caaa"
setenv robostix_pwr_reset "mw 40E0002C 300;mw 40E00020 40;mw 40E00064 aaa0caaa"

We want to modify uboot's bootcmd variable, but we also want to preserve the original contents, so issue:

setenv linux "$bootcmd"

On the newer versions of u-boot (i.e 1.1.4 and newer), the above doesn't seem to work with the particular contents of the bootcmd variable. Instead, you'll need to copy and paste the contents of the linux variable (use printenv to see the old value).

Note that using $bootcmd will only work if bootcmd hasn't been modified yet. The fully expanded version would be:

setenv linux "fsload a2000000 boot/uImage;bootm a2000000"

Now you can modify bootcmd as:

setenv bootcmd "run robostix_pwr_run; run linux"

to cause the robostix to start running and then boot linux. Using:

setenv bootcmd "run robostix_pwr_reset; run linux"

will power the robostix, but leave it in reset.

Finally, issue the saveenv command to save things, and then issue boot to test it.

Personal tools