Fix ql gpio api.

Change-Id: I99e53fff580d6ec392e5e83d561455581abb18dd
diff --git a/mbtk/include/ql/ql_gpio.h b/mbtk/include/ql/ql_gpio.h
index 74402e9..0159438 100755
--- a/mbtk/include/ql/ql_gpio.h
+++ b/mbtk/include/ql/ql_gpio.h
@@ -61,6 +61,9 @@
     /*PIN-40*/   PINNAME_SPI_CLK = 40,
     /*PIN-41*/   PINNAME_I2C_SCL = 41,
     /*PIN-42*/   PINNAME_I2C_SDA = 42,
+    /*PIN-45*/   PINNAME_GPIO20 = 45,
+    /*PIN-49*/   PINNAME_STATUS = 49,
+    /*PIN-51*/   PINNAME_NETLIGHT = 51,
     /*PIN-62*/   PINNAME_GPIO6 = 62,
     /*PIN-63*/   PINNAME_DCD = 63,
     /*PIN-66*/   PINNAME_DTR = 66,
@@ -85,6 +88,7 @@
     /*PIN-120*/  PINNAME_RMII_INT = 120,
     /*PIN-121*/  PINNAME_RMII_MDIO = 121,
     /*PIN-122*/  PINNAME_RMII_MDC = 122,
+    /*PIN-123*/  PINNAME_PRI_TDI = 123,
     /*PIN-127*/  PINNAME_WLAN_PER_EN = 127,
     /*PIN-135*/  PINNAME_WLAN_WAKE = 135,
     /*PIN-136*/  PINNAME_WLAN_EN = 136,
diff --git a/mbtk/ql_lib/src/ql_gpio.c b/mbtk/ql_lib/src/ql_gpio.c
index 2d3cae6..9be2026 100755
--- a/mbtk/ql_lib/src/ql_gpio.c
+++ b/mbtk/ql_lib/src/ql_gpio.c
@@ -16,6 +16,7 @@
     int gpio;
 } pin_gpio_mmap_s;
 
+#ifdef MBTK_PROJECT_L508
 static pin_gpio_mmap_s pin_gpio_mmap[] = {
     {PINNAME_GPIO1, -1},            /*PIN-1*/
     {PINNAME_GPIO2, -1},             /*PIN-2*/
@@ -31,9 +32,9 @@
     {PINNAME_PCM_OUT, 27},          /*PIN-25*/
     {PINNAME_PCM_SYNC, -1},         /*PIN-26*/
     {PINNAME_PCM_CLK, -1},          /*PIN-27*/
-    {PINNAME_SDC2_DATA3, -1},       /*PIN-28*/
+    {PINNAME_SDC2_DATA3, 21},       /*PIN-28*/
     {PINNAME_SDC2_DATA2, -1},       /*PIN-29*/
-    {PINNAME_SDC2_DATA1, -1},       /*PIN-30*/
+    {PINNAME_SDC2_DATA1, 4},       /*PIN-30*/
     {PINNAME_SDC2_DATA0, -1},       /*PIN-31*/
     {PINNAME_SDC2_CLK, -1},         /*PIN-32*/
     {PINNAME_SDC2_CMD, -1},         /*PIN-33*/
@@ -43,6 +44,9 @@
     {PINNAME_SPI_CLK, -1},          /*PIN-40*/
     {PINNAME_I2C_SCL, -1},          /*PIN-41*/
     {PINNAME_I2C_SDA, -1},          /*PIN-42*/
+    {PINNAME_GPIO20, 20},           /*PIN-45*/
+    {PINNAME_STATUS, 13},           /*PIN-49*/
+    {PINNAME_NETLIGHT, 14},         /*PIN-51*/
     {PINNAME_GPIO6, -1},            /*PIN-62*/
     {PINNAME_DCD, -1},              /*PIN-63*/
     {PINNAME_DTR, -1},              /*PIN-66*/
@@ -61,17 +65,81 @@
     {PINNAME_RMII_TX_CTRL, -1},     /*PIN-81*/
     {PINNAME_RMII_RXD3, -1},        /*PIN-82*/
     {PINNAME_RMII_TXCL, -1},        /*PIN-83*/
-    {PINNAME_RMII_TXD3, -1},        /*PIN-84*/
+    {PINNAME_RMII_TXD3, 5},        /*PIN-84*/
     {PINNAME_WLAN_SLP_CLK, -1},    /*PIN-118*/
     {PINNAME_RMII_RST, 20},        /*PIN-119*/
     {PINNAME_RMII_INT, -1},        /*PIN-120*/
     {PINNAME_RMII_MDIO, 17},       /*PIN-121*/
     {PINNAME_RMII_MDC, 16},        /*PIN-122*/
+    {PINNAME_PRI_TDI, 117},        /*PIN-123*/
     {PINNAME_WLAN_PER_EN, 24},     /*PIN-127*/
     {PINNAME_WLAN_WAKE, 21},       /*PIN-135*/
     {PINNAME_WLAN_EN, 22},         /*PIN-136*/
     {PINNAME_GPIO8, -1},            /*PIN-139*/
 };
+#else
+static pin_gpio_mmap_s pin_gpio_mmap[] = {
+    {PINNAME_GPIO1, -1},            /*PIN-1*/
+    {PINNAME_GPIO2, -1},             /*PIN-2*/
+    {PINNAME_GPIO3, -1},             /*PIN-3*/
+    {PINNAME_GPIO4, -1},             /*PIN-4*/
+    {PINNAME_GPIO5, -1},             /*PIN-5*/
+    {PINNAME_NET_STATUS, -1},        /*PIN-6*/
+    {PINNAME_DBG_RXD, -1},          /*PIN-11*/
+    {PINNAME_DBG_TXD, -1},          /*PIN-12*/
+    {PINNAME_USIM_PRESENCE, 19},    /*PIN-13*/
+    {PINNAME_SD_INT_DET, -1},       /*PIN-23*/
+    {PINNAME_PCM_IN, 28},           /*PIN-24*/
+    {PINNAME_PCM_OUT, 27},          /*PIN-25*/
+    {PINNAME_PCM_SYNC, -1},         /*PIN-26*/
+    {PINNAME_PCM_CLK, -1},          /*PIN-27*/
+    {PINNAME_SDC2_DATA3, 21},       /*PIN-28*/
+    {PINNAME_SDC2_DATA2, -1},       /*PIN-29*/
+    {PINNAME_SDC2_DATA1, 4},       /*PIN-30*/
+    {PINNAME_SDC2_DATA0, -1},       /*PIN-31*/
+    {PINNAME_SDC2_CLK, -1},         /*PIN-32*/
+    {PINNAME_SDC2_CMD, -1},         /*PIN-33*/
+    {PINNAME_SPI_CS_N, -1},         /*PIN-37*/
+    {PINNAME_SPI_MOSI, -1},         /*PIN-38*/
+    {PINNAME_SPI_MISO, -1},         /*PIN-39*/
+    {PINNAME_SPI_CLK, -1},          /*PIN-40*/
+    {PINNAME_I2C_SCL, -1},          /*PIN-41*/
+    {PINNAME_I2C_SDA, -1},          /*PIN-42*/
+    {PINNAME_GPIO20, 20},           /*PIN-45*/
+    {PINNAME_STATUS, 13},           /*PIN-49*/
+    {PINNAME_NETLIGHT, 14},         /*PIN-51*/
+    {PINNAME_GPIO6, -1},            /*PIN-62*/
+    {PINNAME_DCD, -1},              /*PIN-63*/
+    {PINNAME_DTR, -1},              /*PIN-66*/
+    {PINNAME_MAIN_CTS, -1},         /*PIN-64*/
+    {PINNAME_MAIN_RTS, -1},         /*PIN-65*/
+    {PINNAME_MAIN_TXD, -1},         /*PIN-67*/
+    {PINNAME_MAIN_RXD, -1},         /*PIN-68*/
+    {PINNAME_RMII_RXD1, -1},        /*PIN-73*/
+    {PINNAME_RMII_RXCL, -1},        /*PIN-74*/
+    {PINNAME_RMII_CLK, 3},         /*PIN-75*/
+    {PINNAME_RMII_RXD0, 1},        /*PIN-76*/
+    {PINNAME_RMII_TXD0, -1},        /*PIN-77*/
+    {PINNAME_RMII_TXD1, -1},        /*PIN-78*/
+    {PINNAME_RMII_RXD2, -1},        /*PIN-79*/
+    {PINNAME_RMII_TXD2, -1},        /*PIN-80*/
+    {PINNAME_RMII_TX_CTRL, -1},     /*PIN-81*/
+    {PINNAME_RMII_RXD3, -1},        /*PIN-82*/
+    {PINNAME_RMII_TXCL, -1},        /*PIN-83*/
+    {PINNAME_RMII_TXD3, 5},        /*PIN-84*/
+    {PINNAME_WLAN_SLP_CLK, -1},    /*PIN-118*/
+    {PINNAME_RMII_RST, 20},        /*PIN-119*/
+    {PINNAME_RMII_INT, -1},        /*PIN-120*/
+    {PINNAME_RMII_MDIO, 17},       /*PIN-121*/
+    {PINNAME_RMII_MDC, 16},        /*PIN-122*/
+    {PINNAME_PRI_TDI, 117},        /*PIN-123*/
+    {PINNAME_WLAN_PER_EN, 24},     /*PIN-127*/
+    {PINNAME_WLAN_WAKE, 21},       /*PIN-135*/
+    {PINNAME_WLAN_EN, 22},         /*PIN-136*/
+    {PINNAME_GPIO8, -1},            /*PIN-139*/
+};
+
+#endif
 
 static int gpio_export(int gpio)
 {