From 974052877dd96a6fa8b9042eb24dfe5027272578 Mon Sep 17 00:00:00 2001 From: SkullyDev <7769743+SkullyDev@users.noreply.github.com> Date: Tue, 15 Sep 2026 00:37:27 +0300 Subject: [PATCH 1/2] Added config for HASIVO_S600W_4GT_2XGT_SE (4x2.5G, 2x10G) SysLed behavior logic added so it can mimic any original style --- machine.c | 41 +++++++++++++++++++++++++++++++++++++++++ machine.h | 2 ++ machine_init.c | 7 +++++++ rtlplayground.c | 12 ++++++++++-- 4 files changed, 60 insertions(+), 2 deletions(-) diff --git a/machine.c b/machine.c index aeb8d5bc..e7eb7618 100644 --- a/machine.c +++ b/machine.c @@ -1226,6 +1226,47 @@ __code const struct machine machine = { 0x1d, 0x20, 0x21 }, }; +#elif defined MACHINE_HASIVO_S600W_4GT_2XGT_SE +__code const struct machine machine = { + .machine_name = "Hasivo S600W-4GT-2XGT-SE", + .isRTL8373 = 0, + .min_port = 3, + .max_port = 8, + .n_sfp = 0, + .n_10g = 2, + .sys_led_mode = SYS_LED_SLOW, + .log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6}, + .phys_to_log_port = {4, 5, 6, 7, 3, 8, 0, 0, 0}, + .is_sfp = {0, 0, 0, 0, 0, 0, 0, 0, 0}, + .reset_pin = GPIO54_ACL_BIT2_EN, + .high_leds = { .mux = LED_28_SYS | LED_29, .enable = LED_28_SYS | LED_29 }, + .port_led_set = { 0, 0, 0, 1, 0, 0, 0, 0, 1 }, + .led_sets = { + { + LEDS_2G5 | LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK | LEDS_ACT, + LEDS_2G5 | LEDS_LINK, + LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK, + 0, + }, + { + LEDS_10G | LEDS_5G | LEDS_2G5 | LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK | LEDS_ACT, + LEDS_10G | LEDS_LINK, + LEDS_5G | LEDS_2G5 | LEDS_LINK, + 0, + }, + }, + .led_mux_custom = 1, + .led_mux = { + 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, + 0x3f, 0x3f, 0x3f, 0x0f, 0x20, + 0x21, 0x22, 0x10, 0x11, 0x12, + 0x14, 0x15, 0x16, 0x18, 0x19, + 0x1a, 0x1c, 0x1d, 0x1e, 0x0c, + 0x0d, 0x0e, 0x23 + }, + +}; + #else #error "Please select a machine type in machine.h" #endif diff --git a/machine.h b/machine.h index fd882229..98e5abee 100644 --- a/machine.h +++ b/machine.h @@ -45,6 +45,7 @@ // #define MACHINE_FG_4GT_2SX_V2_0 // #define MACHINE_FG_8GT_1SX // #define MACHINE_POE_2G080110GS +// #define MACHINE_HASIVO_S600W_4GT_2XGT_SE typedef struct { // GPIO pins for SDA/SCL @@ -77,6 +78,7 @@ struct sfp_port typedef struct machine { char machine_name[30]; uint8_t isRTL8373; + uint8_t sys_led_mode; // Lowest logical port number uint8_t min_port; // Highest logical port number diff --git a/machine_init.c b/machine_init.c index 2f674a33..aa10a0f5 100644 --- a/machine_init.c +++ b/machine_init.c @@ -117,6 +117,13 @@ void machine_custom_init(void) __banked REG_SET(RTL837X_REG_LED_GLB_IO_EN, 0x7624155b); } +#elif defined MACHINE_HASIVO_S600W_4GT_2XGT_SE +void machine_custom_init(void) __banked +{ + // For this device, the reset button triggers this input + gpio_input_setup(GPIO54_ACL_BIT2_EN); +} + #else void machine_custom_init(void) __banked { } #endif diff --git a/rtlplayground.c b/rtlplayground.c index a2efbf5a..5f5ce64e 100644 --- a/rtlplayground.c +++ b/rtlplayground.c @@ -1141,7 +1141,11 @@ void handle_button(void) else { print_string("Short button press detected; no action.\n"); - set_sys_led_state(SYS_LED_ON); + if (machine.sys_led_mode) { + set_sys_led_state(machine.sys_led_mode); + } else { + set_sys_led_state(SYS_LED_ON); + } } } else @@ -1747,7 +1751,11 @@ void main(void) print_cmd_prompt(); idle_ready = 1; - set_sys_led_state(SYS_LED_ON); + if (machine.sys_led_mode) { + set_sys_led_state(machine.sys_led_mode); + } else { + set_sys_led_state(SYS_LED_ON); + } cmd_editor_init(); From c31b67572bce4284e41cca10d59417e01bfb5340 Mon Sep 17 00:00:00 2001 From: SkullyDev <7769743+SkullyDev@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:03:42 +0300 Subject: [PATCH 2/2] Remove led behavior & LED comments Should work without gpio_input_setup --- machine.c | 20 +++++++++++--------- machine.h | 1 - machine_init.c | 7 ------- rtlplayground.c | 12 ++---------- 4 files changed, 13 insertions(+), 27 deletions(-) diff --git a/machine.c b/machine.c index e7eb7618..6d53e1e7 100644 --- a/machine.c +++ b/machine.c @@ -1234,25 +1234,27 @@ __code const struct machine machine = { .max_port = 8, .n_sfp = 0, .n_10g = 2, - .sys_led_mode = SYS_LED_SLOW, .log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6}, .phys_to_log_port = {4, 5, 6, 7, 3, 8, 0, 0, 0}, .is_sfp = {0, 0, 0, 0, 0, 0, 0, 0, 0}, .reset_pin = GPIO54_ACL_BIT2_EN, .high_leds = { .mux = LED_28_SYS | LED_29, .enable = LED_28_SYS | LED_29 }, .port_led_set = { 0, 0, 0, 1, 0, 0, 0, 0, 1 }, + /* Ports 1-4: Green: 2.5GBit, Orange: 10/100/1000MBit + * Ports 5-6: Green: 10GBit, Orange: 5/2.5GBit, None: 10/100/1000MBit + */ .led_sets = { { - LEDS_2G5 | LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK | LEDS_ACT, - LEDS_2G5 | LEDS_LINK, - LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK, - 0, + LEDS_2G5 | LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK | LEDS_ACT, // Yellow + LEDS_2G5 | LEDS_LINK, // Green + LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK, // Orange + 0, // Unused }, { - LEDS_10G | LEDS_5G | LEDS_2G5 | LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK | LEDS_ACT, - LEDS_10G | LEDS_LINK, - LEDS_5G | LEDS_2G5 | LEDS_LINK, - 0, + LEDS_10G | LEDS_5G | LEDS_2G5 | LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK | LEDS_ACT, // Yellow + LEDS_10G | LEDS_LINK, // Green + LEDS_5G | LEDS_2G5 | LEDS_LINK, // Orange + 0, // Unused }, }, .led_mux_custom = 1, diff --git a/machine.h b/machine.h index 98e5abee..099d28f1 100644 --- a/machine.h +++ b/machine.h @@ -78,7 +78,6 @@ struct sfp_port typedef struct machine { char machine_name[30]; uint8_t isRTL8373; - uint8_t sys_led_mode; // Lowest logical port number uint8_t min_port; // Highest logical port number diff --git a/machine_init.c b/machine_init.c index aa10a0f5..2f674a33 100644 --- a/machine_init.c +++ b/machine_init.c @@ -117,13 +117,6 @@ void machine_custom_init(void) __banked REG_SET(RTL837X_REG_LED_GLB_IO_EN, 0x7624155b); } -#elif defined MACHINE_HASIVO_S600W_4GT_2XGT_SE -void machine_custom_init(void) __banked -{ - // For this device, the reset button triggers this input - gpio_input_setup(GPIO54_ACL_BIT2_EN); -} - #else void machine_custom_init(void) __banked { } #endif diff --git a/rtlplayground.c b/rtlplayground.c index 5f5ce64e..a2efbf5a 100644 --- a/rtlplayground.c +++ b/rtlplayground.c @@ -1141,11 +1141,7 @@ void handle_button(void) else { print_string("Short button press detected; no action.\n"); - if (machine.sys_led_mode) { - set_sys_led_state(machine.sys_led_mode); - } else { - set_sys_led_state(SYS_LED_ON); - } + set_sys_led_state(SYS_LED_ON); } } else @@ -1751,11 +1747,7 @@ void main(void) print_cmd_prompt(); idle_ready = 1; - if (machine.sys_led_mode) { - set_sys_led_state(machine.sys_led_mode); - } else { - set_sys_led_state(SYS_LED_ON); - } + set_sys_led_state(SYS_LED_ON); cmd_editor_init();