]> granicus.if.org Git - esp-idf/commitdiff
phyinit: Use PHY config to enable, don't need phy_get_romfunc_addr to init
authorAngus Gratton <angus@espressif.com>
Thu, 19 Jan 2017 00:18:44 +0000 (11:18 +1100)
committerAngus Gratton <angus@espressif.com>
Thu, 19 Jan 2017 00:18:44 +0000 (11:18 +1100)
components/esp32/component.mk
components/esp32/cpu_freq.c
components/esp32/phy.h
components/esp32/phy_init.c

index e1cd2c6524a7ac4b5b183dd5f53d68f51449f993..a8109a0f5ee8e1ceee17c8c8c840aea6dd4cf3ca 100644 (file)
@@ -3,16 +3,14 @@
 #
 
 COMPONENT_SRCDIRS := . hwcrypto
-LIBS := core rtc phy
-ifdef CONFIG_BT_ENABLED
-LIBS += coexist
+LIBS := core rtc
+ifdef CONFIG_PHY_ENABLED # BT || WIFI
+LIBS += phy coexist
 endif
 ifdef CONFIG_WIFI_ENABLED
 LIBS += net80211 pp wpa smartconfig coexist wps wpa2
 endif
 
-LIBS := $(sort $(LIBS))  # de-duplicate, we can handle different orders here
-
 LINKER_SCRIPTS += esp32.common.ld esp32.rom.ld esp32.peripherals.ld
 
 ifeq ("$(CONFIG_NEWLIB_NANO_FORMAT)","y")
index 7618f147af8fe700cec9ba8ada01303af66e4b36..f5ccd13df72c27cb59270d9b2a6c5b836e0d5210 100644 (file)
@@ -17,7 +17,6 @@
 #include "rom/ets_sys.h"
 #include "rom/uart.h"
 #include "sdkconfig.h"
-#include "phy.h"
 #include "rtc.h"
 #include "soc/soc.h"
 #include "soc/rtc_cntl_reg.h"
@@ -32,7 +31,6 @@
 void esp_set_cpu_freq(void)
 {
     uint32_t freq_mhz = CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ;
-    phy_get_romfunc_addr();
 
     // freq will be changed to 40MHz in rtc_init_lite,
     // wait uart tx finish, otherwise some uart output will be lost
index 81990f2e3695d5dc166f24bd9e24d182b4ad50a7..c0affb36ef9d7e1569820888cbf9098eff4249aa 100644 (file)
@@ -25,8 +25,7 @@ extern "C" {
  */
 
 /**
- * @brief Initialize function pointer table in PHY library.
- * @note This function should be called before register_chipv7_phy.
+ * @brief Return ROM function pointer table from PHY library.
  */
 void phy_get_romfunc_addr(void);
 
index 07a455d501f5c943ff604ee046480c8a58894c61..5b130eaf7aa4cf7c8e06efe6099d5a2826a6c385 100644 (file)
@@ -27,7 +27,7 @@
 #include "nvs.h"
 #include "sdkconfig.h"
 
-#ifdef CONFIG_WIFI_ENABLED
+#ifdef CONFIG_PHY_ENABLED
 #include "phy.h"
 #include "phy_init_data.h"
 
@@ -39,8 +39,7 @@ esp_err_t esp_phy_init(const esp_phy_init_data_t* init_data,
 {
     assert(init_data);
     assert(calibration_data);
-    // Initialize PHY pointer table
-    phy_get_romfunc_addr();
+
     REG_SET_BIT(DPORT_CORE_RST_EN_REG, DPORT_MAC_RST);
     REG_CLR_BIT(DPORT_CORE_RST_EN_REG, DPORT_MAC_RST);
     // Enable WiFi peripheral clock
@@ -221,4 +220,4 @@ static esp_err_t store_cal_data_to_nvs_handle(nvs_handle handle,
     return err;
 }
 
-#endif // CONFIG_WIFI_ENABLED
+#endif // CONFIG_PHY_ENABLED