modify time sequence of fpga firmware loading
authorluowei <lw@rock-chips.com>
Wed, 13 Oct 2010 03:02:03 +0000 (11:02 +0800)
committerluowei <lw@rock-chips.com>
Wed, 13 Oct 2010 03:02:03 +0000 (11:02 +0800)
arch/arm/mach-rk2818/iomux.c
drivers/fpga/spi_fpga_fw.c
drivers/fpga/spi_i2c.c

index afc695be0497218df6575dd8980e2c70f964f1ea..c45bee2ab08b838d17a10717db3263c6368656d1 100755 (executable)
@@ -69,7 +69,7 @@ MUX_CFG(GPIOB3_U0RTSN_SEL_NAME,                       B,   13,    1,    0,    DEFAULT)                /* 0 : gpio_b3 1
 MUX_CFG(GPIOB2_U0CTSN_SEL_NAME,                        B,   12,    1,    0,    DEFAULT)                /* 0 : gpio_b2 1 : uart0_cts_n */
 MUX_CFG(GPIOF2_APWM0_SEL_NAME,                 B,   11,    1,    0,    INITIAL)                /* 0 : gpio_f2 1 : pwm0 */
 MUX_CFG(GPIOC_LCDC16BIT_SEL_NAME,              B,   10,    1,    1,    INITIAL)                /* 0 : gpio_d0 ~ gpio_d7 1 : lcdc_data8 ~ lcdc_data15 */
-MUX_CFG(GPIOC_LCDC24BIT_SEL_NAME,              B,    9,    1,    1,    INITIAL)                /* 0 : gpio_c2 ~ gpio_c7 1 : lcdc_data18 ~ lcdc_data23 */
+MUX_CFG(GPIOC_LCDC24BIT_SEL_NAME,              B,    9,    1,    0,    INITIAL)                /* 0 : gpio_c2 ~ gpio_c7 1 : lcdc_data18 ~ lcdc_data23 */
 MUX_CFG(GPIOC_LCDC18BIT_SEL_NAME,              B,    8,    1,    1,    INITIAL)                /* 0 : gpio_c0/c1 1 : lcdc_data16 ~ lcdc_data17 */
 MUX_CFG(CXGPIO_LCDDEN_SEL_NAME,                        B,    7,    1,    1,    INITIAL)                /* 0 : gpio2_26 1 : lcdc_denable */
 MUX_CFG(CXGPIO_LCDVSYNC_SEL_NAME,              B,    6,    1,    1,    INITIAL)                /* 0 : gpio2_25 1 : lcdc_vsync */
index 154b9347edb161df9f104494014edec0053394b1..c40de96b633cfc48f08635611c003909fce0653f 100755 (executable)
@@ -165,13 +165,13 @@ static void __init spi_fpga_dlfw(unsigned char * fpga_fw, unsigned int fpga_fw_l
     \r
     //step 2\r
     FPGA_CRESET_HIGH();\r
-    udelay(500); //delay >= 300us for clear internal memory \r
+    mdelay(2); //delay >= 300us for clear internal memory \r
 \r
     //step 3\r
     //spi_fpga_wait(8); //need ???\r
     \r
     //step 4\r
-    //FPGA_CS_HIGH();\r
+    FPGA_CS_HIGH();\r
     spi_fpga_wait(8);\r
 \r
     //step 5\r
@@ -180,7 +180,7 @@ static void __init spi_fpga_dlfw(unsigned char * fpga_fw, unsigned int fpga_fw_l
 \r
 \r
     //step 6\r
-    //FPGA_CS_HIGH();\r
+    FPGA_CS_HIGH();\r
     spi_fpga_wait(13000);\r
 \r
     //step 7\r
@@ -189,7 +189,7 @@ static void __init spi_fpga_dlfw(unsigned char * fpga_fw, unsigned int fpga_fw_l
 \r
 \r
     //step 8\r
-    //FPGA_CS_HIGH();\r
+    FPGA_CS_HIGH();\r
     spi_fpga_wait(8);\r
 \r
     //step 9\r
@@ -198,7 +198,7 @@ static void __init spi_fpga_dlfw(unsigned char * fpga_fw, unsigned int fpga_fw_l
 \r
 \r
     //step 10\r
-    //FPGA_CS_HIGH();\r
+    FPGA_CS_HIGH();\r
     spi_fpga_wait(8);\r
 \r
     //step 11\r
@@ -207,11 +207,11 @@ static void __init spi_fpga_dlfw(unsigned char * fpga_fw, unsigned int fpga_fw_l
 \r
 \r
     //step 12\r
-    //FPGA_CS_HIGH();\r
+    FPGA_CS_HIGH();\r
     spi_fpga_wait(8);\r
 \r
     //step 13\r
-    //FPGA_CS_HIGH();\r
+    FPGA_CS_HIGH();\r
     spi_fpga_send_bytes(fpga_fw, fpga_fw_len);\r
 \r
     //step 14\r
index 7c1653f7755cc97f62a0a84278a1b4b994905481..75c80f55abf3f7458708631e2d72de666c9268d9 100755 (executable)
@@ -66,6 +66,9 @@ int spi_i2c_handle_irq(struct spi_fpga_port *port,unsigned char channel)
        }\r
        else if(INT_I2C_READ_NACK ==(ret & 0x07))\r
        {\r
+               #if SPI_FPGA_I2C_EVENT\r
+               wake_up(&port->i2c.wait_r);\r
+               #endif\r
                printk("Error::read no ack!!check the I2C slave device ret=%d \n",ret);\r
        }\r
        else if(INT_I2C_WRITE_ACK == (ret & 0x07))\r
@@ -77,6 +80,9 @@ int spi_i2c_handle_irq(struct spi_fpga_port *port,unsigned char channel)
        }\r
        else if(INT_I2C_WRITE_NACK == (ret & 0x07))\r
        {\r
+               #if SPI_FPGA_I2C_EVENT\r
+               wake_up(&port->i2c.wait_w);\r
+               #endif\r
                printk("Error::write no ack!!check the I2C slave device ret=%d \n",ret);\r
        }\r
        else\r
@@ -247,7 +253,7 @@ int spi_i2c_writebuf(struct spi_fpga_port *port ,struct i2c_msg *pmsg,int ch)
                if(ret == 0)\r
                {\r
                        printk("%s:60ms time out!\n",__FUNCTION__);\r
-                       return -1;\r
+                       continue;\r
                }\r
                spin_lock(&port->i2c.i2c_lock);\r
                port->i2c.interrupt &= INT_I2C_WRITE_MASK;\r