Skip to content

Commit 8d7cdf9

Browse files
committed
zephyr: update to newer revision
1 parent 4df7f0e commit 8d7cdf9

6 files changed

Lines changed: 70 additions & 58 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
11
&psram0 {
22
status = "disabled";
33
};
4+
5+
&gpio0 {
6+
phy_power_hold: phy_power_hold {
7+
gpio-hog;
8+
gpios = <12 GPIO_ACTIVE_HIGH>;
9+
output-high;
10+
};
11+
};
12+
13+
/delete-node/ &phy;
14+
15+
&mdio {
16+
ref-clk-output-gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>;
17+
18+
phy: ethernet-phy@0 {
19+
compatible = "ethernet-phy";
20+
status = "okay";
21+
reg = <0>;
22+
no-reset;
23+
default-speeds = "10BASE Half-Duplex", "10BASE Full-Duplex",
24+
"100BASE Half-Duplex", "100BASE Full-Duplex";
25+
};
26+
};
27+
28+
&eth {
29+
phy-handle = <&phy>;
30+
ref-clk-output-gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>;
31+
};

app/boards/opendeck/olimex_esp32_poe/firmware.overlay

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,6 @@
3838
};
3939
};
4040

41-
/delete-node/ &phy;
42-
43-
&mdio {
44-
ref-clk-output-gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>;
45-
46-
phy: ethernet-phy@0 {
47-
compatible = "ethernet-phy";
48-
reg = <0>;
49-
reset-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
50-
reset-assert-duration-us = <300000>;
51-
reset-deassertion-timeout-ms = <50>;
52-
};
53-
};
54-
55-
&eth {
56-
phy-handle = <&phy>;
57-
ref-clk-output-gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>;
58-
};
59-
6041
opendeck_i2c_bus: &i2c0 {};
6142

6243
&i2c0 {

west.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ manifest:
1212
projects:
1313
- name: zephyr
1414
remote: zephyrproject-rtos
15-
revision: 2f9f440c2fc8105e6beeb2f711e4acfdda46dcd5
15+
revision: b54e0ba58fde513965d077f99c9f22125fe19d68
1616
import:
1717
name-allowlist:
1818
- cmsis
Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
11
diff --git a/drivers/ethernet/eth_esp32.c b/drivers/ethernet/eth_esp32.c
2-
index 545f971ae52..25008051097 100644
2+
index 1b202e9b9..53d580c7e 100644
33
--- a/drivers/ethernet/eth_esp32.c
44
+++ b/drivers/ethernet/eth_esp32.c
5-
@@ -528,7 +528,9 @@ int eth_esp32_initialize(const struct device *dev)
6-
7-
if (strcmp(phy_connection_type, "rmii") == 0) {
8-
esp32_emac_iomux_init_rmii();
9-
-#if !DT_INST_NODE_HAS_PROP(0, ref_clk_output_gpios)
10-
+#if DT_INST_NODE_HAS_PROP(0, ref_clk_output_gpios)
11-
+ emac_hal_clock_enable_rmii_output(&dev_data->hal);
12-
+#else
13-
eth_esp32_iomux_rmii_clk_input();
5+
@@ -711,8 +711,12 @@ int eth_esp32_initialize(const struct device *dev)
6+
goto err;
7+
}
8+
#if !DT_INST_NODE_HAS_PROP(0, ref_clk_output_gpios)
9+
eth_esp32_iomux_rmii_clk_input(rmii_clk_gpio);
1410
emac_hal_clock_enable_rmii_input(&dev_data->hal);
11+
+#else
12+
+ /* Restore RMII REF_CLK output after MDIO init and before MAC reset. */
13+
+ emac_hal_clock_enable_rmii_output(&dev_data->hal);
14+
+ (void)emac_hal_ref_clock_div(&dev_data->hal, 0);
1515
#endif
16+
} else if (strcmp(phy_connection_type, "mii") == 0) {
17+
eth_esp32_iomux_init_mii();
18+
@@ -735,6 +739,12 @@ int eth_esp32_initialize(const struct device *dev)
19+
/* Set dma_burst_len as ETH_DMA_BURST_LEN_32 by default */
20+
emac_hal_dma_config_t dma_config = { .dma_burst_len = 0 };
21+
22+
+#if DT_INST_NODE_HAS_PROP(0, ref_clk_output_gpios)
23+
+ /* MAC reset can clear external clock control; keep PHY REF_CLK running. */
24+
+ emac_hal_clock_enable_rmii_output(&dev_data->hal);
25+
+ (void)emac_hal_ref_clock_div(&dev_data->hal, 0);
26+
+#endif
27+
+
28+
eth_esp32_reset_desc_chain(dev_data);
29+
emac_hal_init_mac_default(&dev_data->hal);
30+
emac_hal_init_dma_default(&dev_data->hal, &dma_config);
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
diff --git a/drivers/ethernet/eth_esp32.c b/drivers/ethernet/eth_esp32.c
2-
index 545f971ae52..21195f140a2 100644
2+
index 1b202e485..f4f0a8a60 100644
33
--- a/drivers/ethernet/eth_esp32.c
44
+++ b/drivers/ethernet/eth_esp32.c
5-
@@ -568,6 +568,7 @@ int eth_esp32_initialize(const struct device *dev)
5+
@@ -742,6 +742,7 @@ int eth_esp32_initialize(const struct device *dev)
66
eth_esp32_reset_desc_chain(dev_data);
77
emac_hal_init_mac_default(&dev_data->hal);
88
emac_hal_init_dma_default(&dev_data->hal, &dma_config);
99
+ emac_ll_pass_all_multicast_enable(dev_data->hal.mac_regs, true);
1010

11-
res = generate_mac_addr(dev_data->mac_addr);
12-
if (res != 0) {
11+
/*
12+
* Enable the TX-finish interrupt (for TX descriptor recycling) and

zephyr/patch/zephyr/esp32_runner_handle_code_partition_offset.patch

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
import os
77
+import re
8+
import shutil
9+
from pathlib import Path
810

9-
from runners.core import RunnerCaps, ZephyrBinaryRunner
10-
11-
@@ -82,6 +83,31 @@
12-
espidf=args.esp_idf_path, encrypt=args.esp_encrypt, no_stub=args.esp_no_stub,
13-
reset_type=args.reset_type)
11+
@@ -141,6 +142,31 @@ class Esp32BinaryRunner(ZephyrBinaryRunner):
12+
Path(prev_bin).parent.mkdir(parents=True, exist_ok=True)
13+
shutil.copy2(self.app_bin, prev_bin)
1414

1515
+ def get_chosen_code_partition_address(self):
1616
+ edt_path = os.path.join(self.cfg.build_dir, 'zephyr', 'edt.pickle.cmake')
@@ -37,27 +37,15 @@
3737
+ def get_app_address(self):
3838
+ return self.get_chosen_code_partition_address() or self.app_address
3939
+
40-
def do_run(self, command, **kwargs):
40+
@classmethod
41+
def do_create(cls, cfg, args):
42+
return Esp32BinaryRunner(cfg, args)
43+
@@ -184,7 +210,7 @@ class Esp32BinaryRunner(ZephyrBinaryRunner):
4144

42-
cmd_flash = ['esptool']
43-
@@ -101,7 +127,10 @@
44-
self.logger.warning(
45-
'--reset-type is ignored because reset is disabled (--no-reset)')
46-
if self.reset:
47-
- cmd_flash.extend(['--after', self.reset_type or 'hard-reset', 'write-flash', '-u'])
48-
+ cmd_flash.extend(['--after', self.reset_type or 'hard-reset'])
49-
+ else:
50-
+ cmd_flash.extend(['--after', 'no-reset'])
51-
+ cmd_flash.extend(['write-flash', '-u'])
52-
cmd_flash.extend(['--flash-mode', self.flash_mode])
53-
cmd_flash.extend(['--flash-freq', self.flash_freq])
54-
cmd_flash.extend(['--flash-size', self.flash_size])
55-
@@ -109,7 +138,7 @@
56-
if self.encrypt:
57-
cmd_flash.extend(['--encrypt'])
45+
self._append_flash_opts(cmd_flash)
5846

5947
- cmd_flash.extend([self.app_address, self.app_bin])
6048
+ cmd_flash.extend([self.get_app_address(), self.app_bin])
6149

62-
self.logger.info(f"Flashing esp32 chip on {self.device} ({self.baud}bps)")
63-
self.check_call(cmd_flash)
50+
device_str = self.device if self.device else 'auto-detect'
51+
self.logger.info(

0 commit comments

Comments
 (0)