]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/ibl.git/blobdiff - src/ethboot/ethboot.c
Merge branch 'newI2cMap' into tmp-mike2
[keystone-rtos/ibl.git] / src / ethboot / ethboot.c
index 07b8c3c65f8ae801995a90d3a9e52aeb6d6e235b..a8fb492969b1268f75de32d948d6333a04043c7c 100644 (file)
 #include "ethboot.h"
 #include "net.h"
 #include "cpmacdrv.h"
+#include "sgmii.h"
 #include "device.h"
 #include "mdioapi.h"
 #include <string.h>
+#include "net_osal.h"
 
+/**
+ *  @brief Remove the possible re-definition of iblEthBoot. iblcfg.h defines this to be a void
+ *         statement if there is no ethernet boot support. It must be re-enabled for the compile
+ */
+#ifdef iblEthBoot
+ #undef iblEthBoot
+#endif
 
 /* Convert an IP address from unsigned char to IPN (uint32) */
 #define FORM_IPN(x)     (  (x[0] << 24) | \
@@ -48,7 +57,7 @@ void ibl_rec_params (void *params)
     UNFORM_IPN(iblStatus.ethParams.ipAddr, netdev->ip_address);
     UNFORM_IPN(iblStatus.ethParams.serverIp, netdev->server_ip);
 
-    memcpy (iblStatus.ethParams.hwAddress, netdev->mac_address, sizeof(iblStatus.ethParams.hwAddress));
+    netMemcpy (iblStatus.ethParams.hwAddress, netdev->mac_address, sizeof(iblStatus.ethParams.hwAddress));
     strncpy (iblStatus.ethParams.fileName, netdev->file_name, sizeof(iblStatus.ethParams.fileName));
 
 }
@@ -78,10 +87,15 @@ void iblEthBoot (Int32 eIdx)
                 ibl.mdioConfig.mdioClkDiv, ibl.mdioConfig.interDelay);
 
 
+    /* SGMII configuration. If sgmii is not present this statement is defined
+     * to void in target.h */
+    hwSgmiiConfig (ibl.ethConfig[eIdx].port, &ibl.sgmiiConfig[eIdx]);
+
+
     nDevice.port_num = ibl.ethConfig[eIdx].port;
 
     /* Simple transation to initialize the driver */
-    memcpy (nDevice.mac_address, ibl.ethConfig[eIdx].ethInfo.hwAddress, sizeof(nDevice.mac_address));
+    netMemcpy (nDevice.mac_address, ibl.ethConfig[eIdx].ethInfo.hwAddress, sizeof(nDevice.mac_address));
 
     nl = FORM_IPN(ibl.ethConfig[eIdx].ethInfo.ipAddr);
     if (ibl.ethConfig[eIdx].doBootp == TRUE)
@@ -97,7 +111,7 @@ void iblEthBoot (Int32 eIdx)
     nDevice.use_bootp_server_ip = ibl.ethConfig[eIdx].useBootpServerIp;
 
     /* Note - the file name structure in nDevice is only 64 bytes, but 128 in ethInfo */
-    memcpy (nDevice.file_name, ibl.ethConfig[eIdx].ethInfo.fileName, sizeof(nDevice.file_name));
+    netMemcpy (nDevice.file_name, ibl.ethConfig[eIdx].ethInfo.fileName, sizeof(nDevice.file_name));
     nDevice.use_bootp_file_name = ibl.ethConfig[eIdx].useBootpFileName;
 
 
@@ -172,6 +186,7 @@ void iblEthBoot (Int32 eIdx)
 
     }
 
+
     entry = iblBoot (&net_boot_module, format, &ibl.ethConfig[eIdx].blob);