From f621563479d0a32f9983088c0f78faa7c7205e7b Mon Sep 17 00:00:00 2001 From: logicog Date: Thu, 8 Jan 2026 06:44:38 +0100 Subject: [PATCH 1/2] Enable DIO by default --- cmd_parser.c | 1 - httpd/httpd.c | 1 - rtl837x_flash.c | 2 -- rtlplayground.c | 2 +- 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/cmd_parser.c b/cmd_parser.c index 2b4a640..4a531fc 100644 --- a/cmd_parser.c +++ b/cmd_parser.c @@ -23,7 +23,6 @@ #pragma constseg BANK1 extern __code struct machine machine; -extern __xdata uint16_t mpos; extern __xdata uint8_t stpEnabled; extern __code uint8_t log_to_phys_port[9]; diff --git a/httpd/httpd.c b/httpd/httpd.c index fff640e..f890e76 100644 --- a/httpd/httpd.c +++ b/httpd/httpd.c @@ -37,7 +37,6 @@ __xdata uint8_t outbuf[TCP_OUTBUF_SIZE]; __xdata uint8_t entry; __xdata uint16_t slen; __xdata uint16_t o_idx; -__xdata uint16_t mpos; __xdata uint16_t len_left; __xdata uint16_t cont_len; __xdata uint32_t cont_addr; diff --git a/rtl837x_flash.c b/rtl837x_flash.c index 7da5be2..09b86a3 100644 --- a/rtl837x_flash.c +++ b/rtl837x_flash.c @@ -8,8 +8,6 @@ #include "rtl837x_sfr.h" __xdata uint8_t dio_enabled; -__xdata uint8_t markbuf[16]; -extern __xdata uint16_t mpos; __xdata struct flash_region_t flash_region; diff --git a/rtlplayground.c b/rtlplayground.c index aaa2f43..6199647 100644 --- a/rtlplayground.c +++ b/rtlplayground.c @@ -1738,7 +1738,7 @@ void bootloader(void) print_string("\nStarting up...\n"); print_string(" Flash controller\n"); - flash_init(0); + flash_init(1); // Reset NIC reg_bit_set(RTL837X_REG_RESET, RESET_NIC_BIT); From 52522968c7f4e4afb1a2f16b4e857ebb05227567 Mon Sep 17 00:00:00 2001 From: logicog Date: Thu, 8 Jan 2026 22:42:50 +0100 Subject: [PATCH 2/2] Restore SPI read registers after Jedec/Security Register reads --- rtl837x_flash.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rtl837x_flash.c b/rtl837x_flash.c index 09b86a3..3945bf9 100644 --- a/rtl837x_flash.c +++ b/rtl837x_flash.c @@ -157,6 +157,8 @@ void flash_read_jedecid(void) SFR_FLASH_MODEB = 0x0; SFR_FLASH_CMD_R = CMD_FREAD; SFR_FLASH_DUMMYCYCLES = 8; + + flash_configure_mmio(); } @@ -316,6 +318,8 @@ void flash_read_security(void) flash_region.len -= 4; } while(flash_region.len); + + flash_configure_mmio(); }