Skip to contentSkip to conversation

3/4: Innokom update

PATCH New Robert Schwebel 2 participants 2 messages Mar 19, 2003 – Mar 25, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 3/4: Innokom update

- fixes i2c fixup code :)
- fixes forgotten baudrate

Robert

Signature · 55 lines
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Braunschweiger Str. 79,  31134 Hildesheim, Germany
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
    Phone: +49-5121-28619-0 |  Fax: +49-5121-28619-4
-------------- next part --------------
diff -urNb -x CVS -x ptx-patches u-boot/board/innokom/innokom.c u-boot-ptx/board/innokom/innokom.c
--- u-boot/board/innokom/innokom.c	Tue Mar 18 19:50:36 2003
+++ u-boot-ptx/board/innokom/innokom.c	Wed Mar 19 09:42:09 2003
@@ -39,20 +39,28 @@
  * The Innokom board has GPIO70 connected to SCLK which can be toggled
  * until all chips think that their current cycles are finished.
  */
-void i2c_init_board(void)
+int i2c_init_board(void)
 {
-	int i;
+	int i, icr;
 
-	/* set gpio pin to output */
-        GPDR(70) |= GPIO_bit(70);
-	for (i = 0; i < 11; i++) {
+	/* disable I2C controller first, otherwhise it thinks we want to    */
+	/* talk to the slave port...                                        */
+	icr = ICR; ICR &= ~(ICR_SCLE | ICR_IUE);
+	
+	/* set gpio pin low _before_ we change direction to output          */
 		GPCR(70) = GPIO_bit(70);
+	
+	/* now toggle between output=low and high-impedance                 */
+	for (i = 0; i < 20; i++) {
+		GPDR(70) |= GPIO_bit(70);  /* output */
 		udelay(10);
-		GPSR(70)  = GPIO_bit(70);
+		GPDR(70) &= ~GPIO_bit(70); /* input  */
 		udelay(10);
 	}
-        /* set gpio pin to input */
-        GPDR(70) &= ~GPIO_bit(70);
+
+	ICR = icr;
+
+	return 0;
 }
 
 
@@ -98,6 +106,9 @@
 	/* adress of boot parameters */
 	gd->bd->bi_boot_params = 0xa0000100;
 
+	/* baud rate */
+	gd->bd->bi_baudrate = CONFIG_BAUDRATE;
+
 	return 0;
 }
#1 lore raw

PATCH 1/1 3/4: Innokom update

Quoted 3 lines · In message <[email protected]> you wrote:

- fixes i2c fixup code :)
- fixes forgotten baudrate

Added.

Will show up on CVS later.

Wolfgang Denk

Signature · 5 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
On the subject of C program indentation: "In My Egotistical  Opinion,
most  people's  C  programs  should be indented six feet downward and
covered with dirt."                               - Blair P. Houghton