Forráskód Böngészése

scripts update && new standalone vertion adaption

lzh 1 éve
szülő
commit
35a43ac102

+ 2 - 9
bsp/phytium/aarch32/SConstruct

@@ -51,16 +51,9 @@ def is_phytium_sdk_installed():
 def install_phytium_sdk():
     if is_phytium_sdk_installed():
         return 0
-    print("Checking for the presence of phytium_standalone_sdk_install.py script...")
-    sconstruct_dir = os.getcwd()
-    install_script_path = os.path.join(sconstruct_dir, "phytium_standalone_sdk_install.py")
-    if os.path.exists(install_script_path):
-        subprocess.call(["rm","-rf", install_script_path])
 
-    try:
-        subprocess.call(["wget", "https://gitee.com/phytium_embedded/phytium-standalone-sdk/raw/Standalone-Sdk_RT-thread/phytium_standalone_sdk_install.py"])
-    except:
-        print("Please refer to the ./README and manual download phytium_standalone_sdk_install.py, place in current folder")
+    install_script_path = os.getcwd() + "/../libraries/phytium_standalone_sdk_install.py"
+
     if os.path.exists(install_script_path):
         try:
             subprocess.call(["python", install_script_path])

+ 2 - 11
bsp/phytium/aarch64/SConstruct

@@ -51,18 +51,9 @@ def is_phytium_sdk_installed():
 def install_phytium_sdk():
     if is_phytium_sdk_installed():
         return 0
-    print("Checking for the presence of phytium_standalone_sdk_install.py script...")
-    sconstruct_dir = os.getcwd()
-    install_script_path = os.path.join(sconstruct_dir, "phytium_standalone_sdk_install.py")
-    if os.path.exists(install_script_path):
-        subprocess.call(["rm","-rf", install_script_path])
 
-    if not os.path.exists(install_script_path):
-        try:
-            subprocess.call(["wget", "https://gitee.com/phytium_embedded/phytium-standalone-sdk/raw/Standalone-Sdk_RT-thread/phytium_standalone_sdk_install.py"])
-        except:
-            print("Please refer to the ./README and manual download phytium_standalone_sdk_install.py, place in current folder")
-    
+    install_script_path = os.getcwd() + "/../libraries/phytium_standalone_sdk_install.py"
+
     if os.path.exists(install_script_path):
         try:
             subprocess.call(["python", install_script_path])

+ 3 - 3
bsp/phytium/libraries/drivers/drv_xmac.c

@@ -919,7 +919,7 @@ enum lwip_port_link_status FXmacLwipPortLinkDetect(FXmacOs *instance_p)
             if ((phy_link_status == FXMAC_LINKUP) && FXmacPhyAutonegStatus(xmac_p, xmac_p->phy_address))
             {
                 err_t phy_ret;
-                phy_ret = FXmacPhyInit(xmac_p, xmac_p->config.speed, xmac_p->config.duplex, xmac_p->config.auto_neg);
+                phy_ret = FXmacPhyInit(xmac_p, xmac_p->config.speed, xmac_p->config.duplex, xmac_p->config.auto_neg,XMAC_PHY_RESET_DISABLE);
 
                 if (phy_ret != FT_SUCCESS)
                 {
@@ -953,7 +953,7 @@ enum lwip_port_link_status FXmacPhyReconnect(FXmacOs *instance_p)
         {
             /* auto negotiation again*/
             err_t phy_ret;
-            phy_ret = FXmacPhyInit(xmac_p, xmac_p->config.speed, xmac_p->config.duplex, xmac_p->config.auto_neg);
+            phy_ret = FXmacPhyInit(xmac_p, xmac_p->config.speed, xmac_p->config.duplex, xmac_p->config.auto_neg,XMAC_PHY_RESET_DISABLE);
             if (phy_ret != FT_SUCCESS)
             {
                 LOG_I("FXmacPhyInit is error.");
@@ -1154,7 +1154,7 @@ FError FXmacOsInit(FXmacOs *instance_p)
     }
 
     /* initialize phy */
-    status = FXmacPhyInit(xmac_p, xmac_p->config.speed, xmac_p->config.duplex, xmac_p->config.auto_neg);
+    status = FXmacPhyInit(xmac_p, xmac_p->config.speed, xmac_p->config.duplex, xmac_p->config.auto_neg,XMAC_PHY_RESET_ENABLE);
     if (status != FT_SUCCESS)
     {
         LOG_W("FXmacPhyInit is error.");

+ 3 - 0
bsp/phytium/libraries/drivers/drv_xmac.h

@@ -43,6 +43,9 @@ extern "C" {
 
 #define FXMAX_MAX_HARDWARE_ADDRESS_LENGTH 6
 
+#define XMAC_PHY_RESET_ENABLE 1
+#define XMAC_PHY_RESET_DISABLE 0
+
 /* configuration */
 #define FXMAC_OS_CONFIG_JUMBO  BIT(0)
 #define FXMAC_OS_CONFIG_MULTICAST_ADDRESS_FILITER  BIT(1) /* Allow multicast address filtering  */

+ 24 - 0
bsp/phytium/libraries/phytium_standalone_sdk_install.py

@@ -0,0 +1,24 @@
+import os
+import subprocess
+
+def clone_repository(branch, commit_hash):
+    repository_url = "https://gitee.com/phytium_embedded/phytium-standalone-sdk.git"
+    target_folder =  "../libraries/phytium_standalone_sdk"
+
+    # Clone the repository
+    subprocess.call(["git", "clone", "-b", branch, repository_url, target_folder])
+
+    # Change to the cloned repository folder
+    os.chdir(target_folder)
+
+    # Checkout the specific commit
+    subprocess.call(["git", "checkout", commit_hash])
+
+    print("Repository cloned successfully to {}".format(os.getcwd()))
+
+if __name__ == "__main__":
+
+    branch_to_clone = "master"
+    commit_to_clone = "7e5edbfb79928ee3505bfe2b831da9a5832c25aa"
+
+    clone_repository(branch_to_clone, commit_to_clone)

+ 2 - 3
bsp/phytium/libraries/port/fdriver_port/fdrivers_port.h

@@ -13,7 +13,7 @@
  *
  * FilePath: fdrivers_port.h
  * Created Date: 2023-10-16 17:02:35
- * Last Modified: 2023-10-27 09:22:20
+ * Last Modified: 2024-01-05 14:51:14
  * Description:  This file is for drive layer code decoupling
  *
  * Modify History:
@@ -25,7 +25,6 @@
 #ifndef FDRIVERS_PORT_H
 #define FDRIVERS_PORT_H
 
-#include "ftypes.h"
 #ifdef __aarch64__
     #include "faarch64.h"
 #else
@@ -36,7 +35,7 @@
 #include "rtconfig.h"
 #include "ftypes.h"
 #include "drv_log.h"
-
+#include "fkernel.h"
 #ifdef __aarch64__
     #include "faarch64.h"
 #else