diff options
author | H. Nikolaus Schaller <hns@goldelico.com> | 2010-10-20 07:58:52 +0200 |
---|---|---|
committer | H. Nikolaus Schaller <hns@goldelico.com> | 2010-10-20 07:58:52 +0200 |
commit | 206aa7cc620cb6e051a1a7b50b921b8425035c56 (patch) | |
tree | 18c524c5d24676bb0c5307ce4f2681a38375d3a4 /board/ti | |
parent | 3c1901948d16c2b1d47ce32b69645816d3f85b33 (diff) | |
download | bootable_bootloader_goldelico_gta04-206aa7cc620cb6e051a1a7b50b921b8425035c56.zip bootable_bootloader_goldelico_gta04-206aa7cc620cb6e051a1a7b50b921b8425035c56.tar.gz bootable_bootloader_goldelico_gta04-206aa7cc620cb6e051a1a7b50b921b8425035c56.tar.bz2 |
added some more BB-XM distinctions; started systest command
Diffstat (limited to 'board/ti')
-rw-r--r-- | board/ti/beagle/beagle.c | 2 | ||||
-rw-r--r-- | board/ti/beagle/commands.c | 12 | ||||
-rw-r--r-- | board/ti/beagle/gps.c | 6 | ||||
-rw-r--r-- | board/ti/beagle/status.c | 106 | ||||
-rw-r--r-- | board/ti/beagle/tsc2007.c | 2 |
5 files changed, 89 insertions, 39 deletions
diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index e5688ac..6b2aff7 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -254,7 +254,7 @@ int misc_init_r(void) printf("Beagle xM Rev A\n"); setenv("beaglerev", "xMA"); MUX_BEAGLE_XM(); - /* Set VAUX1 to 1.8V for GTA04E display board */ + /* Set VAUX1 to 3.3V for GTA04E display board */ twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX1_DEDICATED, /*TWL4030_PM_RECEIVER_VAUX1_VSEL_33*/ 0x07, TWL4030_PM_RECEIVER_VAUX1_DEV_GRP, diff --git a/board/ti/beagle/commands.c b/board/ti/beagle/commands.c index 07b9673..b5ee4ad 100644 --- a/board/ti/beagle/commands.c +++ b/board/ti/beagle/commands.c @@ -204,7 +204,7 @@ static int pendown(int *x, int *y) if(x) *x=xx; if(y) *y=yy; udelay(10000); // reduce I2C traffic and debounce... - return z > 50; // was pressed + return z > 200; // was pressed #else // must be in PENIRQ mode... return (led_get_buttons() & 0x08) == 0; @@ -367,7 +367,7 @@ static int do_led_blink(int argc, char *argv[]) while (!tstc() && !pendown(NULL, NULL)) { led_set_led(value++); // mirror to LEDs - udelay(500000); // 0.5 seconds + udelay(100000); // 0.1 seconds } if(tstc()) getc(); @@ -476,3 +476,11 @@ U_BOOT_CMD(gps, 3, 0, do_gps, "GPS sub-system", "echo - echo GPS out to console\n" ); +static int do_systest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +{ + // do mixture of gps_echo, tsc_loop, status mirror status blink + return (0); +} + +U_BOOT_CMD(systest, 2, 0, do_systest, "System Test", ""); + diff --git a/board/ti/beagle/gps.c b/board/ti/beagle/gps.c index efaf49e..d511d50 100644 --- a/board/ti/beagle/gps.c +++ b/board/ti/beagle/gps.c @@ -36,12 +36,6 @@ int gps_init(void) { -// MUX_VAL(CP(MMC2_DAT6), (IEN | PTU | EN | M4)) /*GPIO_138 - EXT-ANT */\ -// MUX_VAL(CP(UART2_CTS), (IEN | PTD | DIS | M4)) /*GPIO_144*/\ -// MUX_VAL(CP(UART2_RTS), (IEN | PTD | DIS | M4)) /*GPIO_145*/\ -// MUX_VAL(CP(UART2_TX), (IEN | PTD | DIS | M0)) /*GPIO_146*/\ -// MUX_VAL(CP(UART2_RX), (IEN | PTD | DIS | M0)) /*GPIO_147*/\ - omap_request_gpio(GPIO_GPS_ON); omap_set_gpio_direction(GPIO_GPS_ON, 0); // output omap_request_gpio(GPIO_GPSEXT); diff --git a/board/ti/beagle/status.c b/board/ti/beagle/status.c index 99bbe72..e0d5e80 100644 --- a/board/ti/beagle/status.c +++ b/board/ti/beagle/status.c @@ -30,57 +30,105 @@ #include <asm/mach-types.h> #include "status.h" -// Note: on GTA04 the LEDs will be connected to GPIOs of TPS65950 -#define GPIO_LED_AUX_RED 70 // AUX -#define GPIO_LED_AUX_GREEN 71 // AUX -#define GPIO_LED_POWER_RED 78 // Power -#define GPIO_LED_POWER_GREEN 79 // Power +static int isGTA04 = 0; -// Note: on GTA04 the GPIOs will be different and the state of the POWER button is only available through the TPS65950 +// we can't include "beagle.h" +/* BeagleBoard revisions */ +#define REVISION_AXBX 0x7 +#define REVISION_CX 0x6 +#define REVISION_C4 0x5 +#define REVISION_XM 0x0 -#define GPIO_AUX 136 +static int isXM = 0; + +// Note: on GTA04 the LEDs will be connected to TCA8418 and controlled through I2C +// Note: BB-XM has scrambled DSS assignment + +#define GPIO_LED_AUX_RED (isXM?88:70) // AUX +#define GPIO_LED_AUX_GREEN (isXM?89:71) // AUX +#define GPIO_LED_POWER_RED 78 // Power +#define GPIO_LED_POWER_GREEN 79 // Power +#define GPIO_LED_VIBRA (isXM?2:88) // Vibracall motor +#define GPIO_LED_UNUSED (isXM?3:89) // unused + +// Note: on GTA04 the GPIOs will be assigned differently and the state of the POWER button is only available through the TPS65950 + +#define GPIO_AUX (isGTA04?136:136) #define GPIO_POWER 137 -#define GPIO_GPSEXT 138 // external GPS antenna plugged in -#define GPIO_PENIRQ 157 // TSC must be set up to provide PENIRQ +#define GPIO_GPSEXT (isGTA04?138:138) // external GPS antenna is plugged in +#define GPIO_PENIRQ (isGTA04?157:157) // TSC must be set up to provide PENIRQ void led_set_led(int value) { - omap_set_gpio_dataout(GPIO_LED_AUX_RED, (value&(1 << 0))); - omap_set_gpio_dataout(GPIO_LED_AUX_GREEN, (value&(1 << 1))); - omap_set_gpio_dataout(GPIO_LED_POWER_RED, (value&(1 << 2))); - omap_set_gpio_dataout(GPIO_LED_POWER_GREEN, (value&(1 << 3))); + if(!isGTA04) { + omap_set_gpio_dataout(GPIO_LED_AUX_RED, (value&(1 << 0))); + omap_set_gpio_dataout(GPIO_LED_AUX_GREEN, (value&(1 << 1))); + omap_set_gpio_dataout(GPIO_LED_POWER_RED, (value&(1 << 3))); + omap_set_gpio_dataout(GPIO_LED_POWER_GREEN, (value&(1 << 4))); + omap_set_gpio_dataout(GPIO_LED_VIBRA, (value&(1 << 6))); + omap_set_gpio_dataout(GPIO_LED_UNUSED, (value&(1 << 7))); + } + else { + // initialize i2c controller + } } int led_get_buttons(void) -{ +{ // convert button state into led state + if(isGTA04) { + // read GPIOs and TPS65950 + } return ((!omap_get_gpio_datain(GPIO_AUX)) << 0) | ((omap_get_gpio_datain(GPIO_GPSEXT)) << 1) | - ((!omap_get_gpio_datain(GPIO_POWER)) << 2) | - ((omap_get_gpio_datain(GPIO_PENIRQ)) << 3); + ((!omap_get_gpio_datain(GPIO_POWER)) << 3) | + ((omap_get_gpio_datain(GPIO_PENIRQ)) << 4); } int led_init(void) { - MUX_VAL(CP(DSS_DATA0), (IEN | PTD | EN | M4)); /*GPIO */ - MUX_VAL(CP(DSS_DATA1), (IEN | PTD | EN | M4)); /*GPIO */ - MUX_VAL(CP(DSS_DATA8), (IEN | PTD | EN | M4)); /*GPIO */ - MUX_VAL(CP(DSS_DATA9), (IEN | PTD | EN | M4)); /*GPIO */ + isXM = (beagle_get_revision() == REVISION_XM); + + if(!isGTA04) { + if(isXM) { // XM has scrambled dss assignment with respect to default ball name + MUX_VAL(CP(DSS_DATA18), (IEN | PTD | EN | M4)); /*GPIO */ + MUX_VAL(CP(DSS_DATA19), (IEN | PTD | EN | M4)); /*GPIO */ + MUX_VAL(CP(DSS_DATA8), (IEN | PTD | EN | M4)); /*GPIO */ + MUX_VAL(CP(DSS_DATA9), (IEN | PTD | EN | M4)); /*GPIO */ + MUX_VAL(CP(SYS_BOOT0), (IEN | PTD | EN | M4)); /*GPIO */ + MUX_VAL(CP(SYS_BOOT1), (IEN | PTD | EN | M4)); /*GPIO */ + } + else { + MUX_VAL(CP(DSS_DATA0), (IEN | PTD | EN | M4)); /*GPIO */ + MUX_VAL(CP(DSS_DATA1), (IEN | PTD | EN | M4)); /*GPIO */ + MUX_VAL(CP(DSS_DATA8), (IEN | PTD | EN | M4)); /*GPIO */ + MUX_VAL(CP(DSS_DATA9), (IEN | PTD | EN | M4)); /*GPIO */ + MUX_VAL(CP(DSS_DATA16), (IEN | PTD | EN | M4)); /*GPIO */ + MUX_VAL(CP(DSS_DATA17), (IEN | PTD | EN | M4)); /*GPIO */ + } + + omap_request_gpio(GPIO_LED_AUX_GREEN); + omap_request_gpio(GPIO_LED_AUX_RED); + omap_request_gpio(GPIO_LED_POWER_GREEN); + omap_request_gpio(GPIO_LED_POWER_RED); + omap_request_gpio(GPIO_LED_VIBRA); + omap_request_gpio(GPIO_LED_UNUSED); + } - omap_request_gpio(GPIO_LED_AUX_GREEN); - omap_request_gpio(GPIO_LED_AUX_RED); - omap_request_gpio(GPIO_LED_POWER_GREEN); - omap_request_gpio(GPIO_LED_POWER_RED); omap_request_gpio(GPIO_AUX); omap_request_gpio(GPIO_POWER); omap_request_gpio(GPIO_GPSEXT); omap_request_gpio(GPIO_PENIRQ); - omap_set_gpio_direction(GPIO_LED_AUX_GREEN, 0); // output - omap_set_gpio_direction(GPIO_LED_AUX_RED, 0); // output - omap_set_gpio_direction(GPIO_LED_POWER_GREEN, 0); // output - omap_set_gpio_direction(GPIO_LED_POWER_RED, 0); // output - + if(!isGTA04) { + omap_set_gpio_direction(GPIO_LED_AUX_GREEN, 0); // output + omap_set_gpio_direction(GPIO_LED_AUX_RED, 0); // output + omap_set_gpio_direction(GPIO_LED_POWER_GREEN, 0); // output + omap_set_gpio_direction(GPIO_LED_POWER_RED, 0); // output + omap_set_gpio_direction(GPIO_LED_VIBRA, 0); // output + omap_set_gpio_direction(GPIO_LED_UNUSED, 0); // output + } + omap_set_gpio_direction(GPIO_AUX, 1); // input omap_set_gpio_direction(GPIO_POWER, 1); // input omap_set_gpio_direction(GPIO_AUX, 1); // input diff --git a/board/ti/beagle/tsc2007.c b/board/ti/beagle/tsc2007.c index 82bddbb..72e64bf 100644 --- a/board/ti/beagle/tsc2007.c +++ b/board/ti/beagle/tsc2007.c @@ -130,7 +130,7 @@ int read_adc(int adcnum) void print_adc(void) { - printf("0: %04d 1:%04d 2:%04d 3:%04d 4: %04d 5:%04d 6:%04d 7:%04d", + printf("0:%04u 1:%04u 2:%04u 3:%04u 4:%04u 5:%04u 6:%04u 7:%04u", read_adc(0), read_adc(1), read_adc(2), |