mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Merge pull request #119 from feelfree69/swtgw218as
Add MACHINE_SWTGW218AS Managed Switch. Deselect all MACHINE type so the use always have to select a machine type.
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
### ZX-SWTGW218AS
|
||||||
|
|
||||||
|
## Brands
|
||||||
|
|Brand|Type|Managed|PCB|Flash|Chip RTL|
|
||||||
|
|---|---|---|---|---|---|
|
||||||
|
| Mokerlink | ZX-SWTGW218AS | Yes| SWTG118AS-V2.0-16029 | 2MB (FM25Q16A)| 8273N + 8224N |
|
||||||
|
| Sodola | | | | | |
|
||||||
|
| Horaco | | | | | |
|
||||||
|
|
||||||
|
|
||||||
|
## Photos
|
||||||
|
|
||||||
|
<img src="photos/SWTGW218AS-managed/front.png" width="800" />
|
||||||
|
|
||||||
|
<img src="photos/SWTGW218AS-managed/label.jpg" width="800" />
|
||||||
|
|
||||||
|
## PCB
|
||||||
|
|
||||||
|
See up'n'atom's Repo:
|
||||||
|
|
||||||
|
https://github.com/up-n-atom/SWTG118AS/blob/main/photos/SWTG118AS-v2.0/SWTG118AS-v2.0-pcb-top.JPG
|
||||||
|
|
||||||
|
https://github.com/up-n-atom/SWTG118AS/blob/main/photos/SWTG118AS-v2.0/SWTG118AS-v2.0-pcb-bottom.JPG
|
||||||
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 558 KiB |
@@ -213,6 +213,40 @@ __code const struct machine machine = {
|
|||||||
|
|
||||||
void machine_custom_init(void) { }
|
void machine_custom_init(void) { }
|
||||||
|
|
||||||
|
#elif defined MACHINE_SWTGW218AS
|
||||||
|
|
||||||
|
__code const struct machine machine = {
|
||||||
|
.machine_name = "SWTGW218AS 8+1 Managed Switch",
|
||||||
|
.isRTL8373 = 1,
|
||||||
|
.min_port = 0,
|
||||||
|
.max_port = 8,
|
||||||
|
.n_sfp = 1,
|
||||||
|
.log_to_phys_port = {1, 2, 3, 4, 5, 6, 7, 8, 9},
|
||||||
|
.phys_to_log_port = {0, 1, 2, 3, 4, 5, 6, 7, 8},
|
||||||
|
.is_sfp = {0, 0, 0, 0, 0, 0, 0, 0, 1},
|
||||||
|
.sfp_port[0].pin_detect = GPIO30_ACL_BIT3_EN,
|
||||||
|
.sfp_port[0].pin_los = GPIO37,
|
||||||
|
.sfp_port[0].pin_tx_disable = GPIO_NA,
|
||||||
|
.sfp_port[0].sds = 1,
|
||||||
|
.sfp_port[0].i2c = { .sda = GPIO39_I2C_SDA4, .scl = GPIO40_I2C_SCL3_MDC1 },
|
||||||
|
.reset_pin = GPIO54_ACL_BIT2_EN,
|
||||||
|
.high_leds = { .mux = LED_27 | LED_28 | LED_29, .enable = LED_28 | LED_29 },
|
||||||
|
.port_led_set = { 0, 0, 0, 0, 0, 0, 0, 0, 1},
|
||||||
|
.led_sets = { { LEDS_2G5 | LEDS_LINK | LEDS_ACT, // Green LED (right)
|
||||||
|
0, // unused
|
||||||
|
LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK | LEDS_ACT, // Amber LED (left)
|
||||||
|
0
|
||||||
|
}, // unused
|
||||||
|
{ LEDS_10G | LEDS_5G | LEDS_2G5 | LEDS_1G | LEDS_100M | LEDS_LINK | LEDS_ACT, // SFP LED
|
||||||
|
0, // unused
|
||||||
|
0, // unused
|
||||||
|
0
|
||||||
|
}, // unused },
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
void machine_custom_init(void) { }
|
||||||
|
|
||||||
#elif defined DEFAULT_8C_1SFP
|
#elif defined DEFAULT_8C_1SFP
|
||||||
__code const struct machine machine = {
|
__code const struct machine machine = {
|
||||||
.machine_name = "8+1 SFP Port Switch",
|
.machine_name = "8+1 SFP Port Switch",
|
||||||
@@ -314,4 +348,6 @@ __code const struct machine machine = {
|
|||||||
void machine_custom_init(void) {
|
void machine_custom_init(void) {
|
||||||
reg_bit_set(RTL837X_REG_LED_GLB_IO_EN, 6);
|
reg_bit_set(RTL837X_REG_LED_GLB_IO_EN, 6);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
#error "Please select a machine type in machine.h"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,18 +6,17 @@
|
|||||||
/*
|
/*
|
||||||
* Select your machine type below
|
* Select your machine type below
|
||||||
*/
|
*/
|
||||||
#define MACHINE_KP_9000_6XHML_X2
|
// #define MACHINE_KP_9000_6XHML_X2
|
||||||
// #define MACHINE_KP_9000_6XH_X
|
// #define MACHINE_KP_9000_6XH_X
|
||||||
// #define MACHINE_KP_9000_9XH_X_EU
|
// #define MACHINE_KP_9000_9XH_X_EU
|
||||||
// #define MACHINE_SWGT024_V2_0
|
// #define MACHINE_SWGT024_V2_0
|
||||||
// #define MACHINE_HORACO_ZX_SG4T2
|
// #define MACHINE_HORACO_ZX_SG4T2
|
||||||
// #define MACHINE_TRENDNET_TEG_S562
|
// #define MACHINE_TRENDNET_TEG_S562
|
||||||
// #define MACHINE_HG0402XG_V1_1
|
// #define MACHINE_HG0402XG_V1_1
|
||||||
|
// #define MACHINE_SWTGW218AS
|
||||||
// #define MACHINE_HI_K0402WS
|
// #define MACHINE_HI_K0402WS
|
||||||
// #define DEFAULT_8C_1SFP
|
// #define DEFAULT_8C_1SFP
|
||||||
|
|
||||||
// #define DEFAULT_5C_1SFP
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
// GPIO pins for SDA/SCL
|
// GPIO pins for SDA/SCL
|
||||||
uint8_t sda;
|
uint8_t sda;
|
||||||
|
|||||||
+2
-1
@@ -1902,6 +1902,8 @@ void bootloader(void)
|
|||||||
|
|
||||||
leds_dump();
|
leds_dump();
|
||||||
|
|
||||||
|
set_sys_led_state(SYS_LED_SLOW);
|
||||||
|
|
||||||
if (machine_detected.isRTL8373)
|
if (machine_detected.isRTL8373)
|
||||||
rtl8373_init();
|
rtl8373_init();
|
||||||
else
|
else
|
||||||
@@ -1982,7 +1984,6 @@ void bootloader(void)
|
|||||||
dest += 0x1000;
|
dest += 0x1000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set_sys_led_state(SYS_LED_SLOW);
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
// This register seems to work on the RTL8373 only if also the SDS
|
// This register seems to work on the RTL8373 only if also the SDS
|
||||||
|
|||||||
Reference in New Issue
Block a user