r3215 - trunk/src/target/u-boot/patches

laforge at sita.openmoko.org laforge at sita.openmoko.org
Thu Oct 18 08:06:21 CEST 2007


Author: laforge
Date: 2007-10-18 08:06:17 +0200 (Thu, 18 Oct 2007)
New Revision: 3215

Modified:
   trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch
   trunk/src/target/u-boot/patches/uboot-gta02.patch
Log:
Add GTA02 LED switching code to u-boot


Modified: trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch	2007-10-18 06:04:30 UTC (rev 3214)
+++ trunk/src/target/u-boot/patches/uboot-20061030-neo1973.patch	2007-10-18 06:06:17 UTC (rev 3215)
@@ -8,7 +8,7 @@
 ===================================================================
 --- u-boot.orig/Makefile
 +++ u-boot/Makefile
-@@ -2174,6 +2174,14 @@
+@@ -2175,6 +2175,14 @@
  sbc2410x_config: unconfig
  	@$(MKCONFIG) $(@:_config=) arm arm920t sbc2410x NULL s3c24x0
  
@@ -504,7 +504,7 @@
 ===================================================================
 --- /dev/null
 +++ u-boot/board/neo1973/common/cmd_neo1973.c
-@@ -0,0 +1,115 @@
+@@ -0,0 +1,124 @@
 +/*
 + * (C) Copyright 2006 by OpenMoko, Inc.
 + * Author: Harald Welte <laforge at openmoko.org>
@@ -572,6 +572,14 @@
 +			neo1973_backlight(1);
 +		else
 +			neo1973_backlight(0);
++	} else if (!strcmp(argv[1], "led")) {
++		long led = simple_strtol(argv[2], NULL, 10);
++		if (argc < 4)
++			goto out_help;
++		if (!strcmp(argv[3], "on"))
++			neo1973_led(led, 1);
++		else
++			neo1973_led(led, 0);
 +	} else if (!strcmp(argv[1], "vibrator")) {
 +		if (argc < 3)
 +			goto out_help;
@@ -615,6 +623,7 @@
 +	"neo1973 charger fast - enable fast (500mA) charging\n"
 +	"neo1973 charger off - disable charging\n"
 +	"neo1973 backlight (on|off) - switch backlight on or off\n"
++	"neo1973 led num (on|off) - switch LED number 'num' on or off\n"
 +	"neo1973 vibrator (on|off) - switch vibrator on or off\n"
 +	"neo1973 gsm (on|off) - switch GSM Modem on or off\n"
 +	"neo1973 gps (on|off) - switch GPS system on or off\n"
@@ -1351,7 +1360,7 @@
 ===================================================================
 --- /dev/null
 +++ u-boot/board/neo1973/gta01/gta01.c
-@@ -0,0 +1,485 @@
+@@ -0,0 +1,491 @@
 +/*
 + * (C) 2006 by OpenMoko, Inc.
 + * Author: Harald Welte <laforge at openmoko.org>
@@ -1837,6 +1846,12 @@
 +	return 0;
 +}
 +
++void neo1973_led(int led, int on)
++{
++	printf("No LED's in this Neo1973 hardware revision\n");
++}
++
++
 Index: u-boot/board/neo1973/gta01/pcf50606.c
 ===================================================================
 --- /dev/null
@@ -2331,7 +2346,7 @@
 ===================================================================
 --- /dev/null
 +++ u-boot/board/neo1973/common/neo1973.h
-@@ -0,0 +1,34 @@
+@@ -0,0 +1,35 @@
 +#ifndef _NEO1973_H
 +#define _NEO1973_H
 +
@@ -2359,6 +2374,7 @@
 +void neo1973_vibrator(int on);
 +void neo1973_gsm(int on);
 +void neo1973_gps(int on);
++void neo1973_led(int led, int on);
 +
 +int neo1973_911_key_pressed(void);
 +

Modified: trunk/src/target/u-boot/patches/uboot-gta02.patch
===================================================================
--- trunk/src/target/u-boot/patches/uboot-gta02.patch	2007-10-18 06:04:30 UTC (rev 3214)
+++ trunk/src/target/u-boot/patches/uboot-gta02.patch	2007-10-18 06:06:17 UTC (rev 3215)
@@ -91,7 +91,7 @@
 ===================================================================
 --- /dev/null
 +++ u-boot/board/neo1973/gta02/gta02.c
-@@ -0,0 +1,432 @@
+@@ -0,0 +1,455 @@
 +/*
 + * (C) 2006-2007 by OpenMoko, Inc.
 + * Author: Harald Welte <laforge at openmoko.org>
@@ -167,6 +167,12 @@
 +	  "bne 1b":"=r" (loops):"0" (loops));
 +}
 +
++enum gta02_led {
++	GTA02_LED_PWR_ORANGE	= 0,
++	GTA02_LED_PWR_BLUE	= 1,
++	GTA02_LED_AUX_RED	= 2,
++};
++
 +/*
 + * Miscellaneous platform dependent initialisations
 + */
@@ -302,6 +308,14 @@
 +	/* Initialize the Power Management Unit with a safe register set */
 +	pcf50633_init();
 +
++	/* switch on one of the power led's */
++	neo1973_led(GTA02_LED_PWR_ORANGE, 1);
++
++	/* issue a short pulse with the vibrator */
++	neo1973_vibrator(1);
++	udelay(50000);
++	neo1973_vibrator(0);
++
 +#if defined(CONFIG_ARCH_GTA02_v1)
 +	/* Glamo3362 reset and power cycle */
 +	gpio->GPJDAT &= ~0x000000001;	/* GTA02v1_GPIO_3D_RESET */
@@ -370,11 +384,6 @@
 +	jbt6k74_display_onoff(1);
 +#endif
 +
-+	/* issue a short pulse with the vibrator */
-+	neo1973_vibrator(1);
-+	udelay(50000);
-+	neo1973_vibrator(0);
-+
 +	/* switch on the backlight */
 +	neo1973_backlight(1);
 +
@@ -524,6 +533,21 @@
 +	puts("not implemented yet\n");
 +	return -1;
 +}
++
++void neo1973_led(int led, int on)
++{
++	S3C24X0_GPIO * const gpio = S3C24X0_GetBase_GPIO();
++
++	printf("switching led %u %u\n", led, on);
++	if (led > 2)
++		return;
++
++	if (on)
++		gpio->GPBDAT |= (1 << led);
++	else
++		gpio->GPBDAT &= ~(1 << led);
++}
++
 Index: u-boot/board/neo1973/gta02/u-boot.lds
 ===================================================================
 --- /dev/null





More information about the commitlog mailing list