diff --git a/doc/devices/PCB-K0402WS-V2.0.md b/doc/devices/PCB-K0402WS-V2.0.md new file mode 100644 index 00000000..36dea4d8 --- /dev/null +++ b/doc/devices/PCB-K0402WS-V2.0.md @@ -0,0 +1,97 @@ +Hisource Hi-K0402WS V2 + +RTL8372-based 4×2.5G + 2×SFP+ unmanaged switch. + +Using SPI clamp in-board is the only method for initial installation. + +### Label specifications + +- **Manufacturer**: HISOURCE +- **Model**: Hi-K0402WS V2 +- **Ports**: + - 4 × RJ45: 10/100/1000/2500 Mbps + - 2 × SFP+: 1G / 2.5G / 10G + +### What works + +- All four 2.5GBASE-T RJ45 ports at 10/100/1000/2500 Mbps +- Both SFP+ ports supporting 1G, 2.5G and 10G modules +- LEDs: amber (2.5G) and green (1G/100M/10M) per copper port; combined link/act on SFP ports + +### PCB overview + +**Board markings** +- PCB-K0402WS-V2.0 +- DIP-K0402WS-V2.0 + +**Key components** +- U1: SPI NOR flash, 2 MiB +- S1: unpopulated slide switch footprint (three through-holes used as serial console) + +Front panel + + + +Bottom label + + + +Top side (PCB) + + + +### Port layout + +| Front panel position | Logical port | Physical port | Type | +|----------------------|--------------|---------------|---------| +| SFP left | 8 | 5 | SFP+ | +| RJ45 1 | 4 | 1 | Copper | +| RJ45 2 | 5 | 2 | Copper | +| RJ45 3 | 6 | 3 | Copper | +| RJ45 4 | 7 | 4 | Copper | +| SFP right | 3 | 6 | SFP+ | + +### Serial console + +The PCB has three unpopulated through-holes intended for a slide switch, directly connected to UART0. +Numbered from the left (SFP port side), the pinout is: + +| Position (left→right) | Signal | GPIO | +|-----------------------|--------|--------------------------| +| 1 (leftmost) | RX | GPIO32\_UART0\_RX (32) | +| 2 (middle) | GND | GND | +| 3 (rightmost) | TX | GPIO31\_UART0\_TX (31) | + +- **Settings**: 115200 baud / 8N1 / 3.3V TTL +- Connect a USB-TTL adapter: adapter TX → pin 1, GND → pin 2, adapter RX → pin 3 + +### LED configuration + +Copper ports use LED SET0, SFP ports use LED SET1. + +| SET | LED0 | LED2 | +|------|--------------------------------------------------|---------------------------------------------------| +| SET0 | Amber — lights on 2.5G link | Green — lights on 1G / 100M / 10M link | +| SET1 | All speeds — lights on any link with activity | — | + +LED pad to physical port mapping: + +| GPIO pads | Port | +|-----------|-------------------------| +| GPIO8–11 | Physical port 5 (left SFP) | +| GPIO12–14 | Physical port 1 (RJ45 1) | +| GPIO15–17 | Physical port 2 (RJ45 2) | +| GPIO18–20 | Physical port 3 (RJ45 3) | +| GPIO21–23 | Physical port 4 (RJ45 4) | +| GPIO24–27 | Physical port 6 (right SFP) | + +### SFP GPIO assignments + +| SFP | pin\_detect (ModAbs) | pin\_los | SerDes | I2C SDA | I2C SCL | +|------------------|-----------------------------|------------------------|--------|----------------------|--------------------------| +| Left (logical 8) | GPIO30\_ACL\_BIT3\_EN | GPIO37 | SDS1 | GPIO39\_I2C\_SDA4 | GPIO40\_I2C\_SCL3\_MDC1 | +| Right (logical 3)| GPIO50\_I2C\_SCL2\_UART1\_TX | GPIO51\_I2C\_SDA2\_UART1\_RX | SDS0 | GPIO41\_I2C\_SDA3\_MDIO1 | GPIO40\_I2C\_SCL3\_MDC1 | + +GPIO assignments were verified by observing GPIO state changes during SFP module insertion/removal +and cross-checked against an original firmware register dump. +`pin_tx_disable` is GPIO\_NA on both ports (original firmware keeps all GPIOs as inputs). diff --git a/doc/devices/photos/PCB-K0402WS-V2.0/PCB-top.jpg b/doc/devices/photos/PCB-K0402WS-V2.0/PCB-top.jpg new file mode 100644 index 00000000..2378dd7a Binary files /dev/null and b/doc/devices/photos/PCB-K0402WS-V2.0/PCB-top.jpg differ diff --git a/doc/devices/photos/PCB-K0402WS-V2.0/chassis-bottom.jpg b/doc/devices/photos/PCB-K0402WS-V2.0/chassis-bottom.jpg new file mode 100644 index 00000000..c30a3b70 Binary files /dev/null and b/doc/devices/photos/PCB-K0402WS-V2.0/chassis-bottom.jpg differ diff --git a/doc/devices/photos/PCB-K0402WS-V2.0/chassis-front.jpg b/doc/devices/photos/PCB-K0402WS-V2.0/chassis-front.jpg new file mode 100644 index 00000000..47bf168a Binary files /dev/null and b/doc/devices/photos/PCB-K0402WS-V2.0/chassis-front.jpg differ diff --git a/doc/supported_devices.md b/doc/supported_devices.md index 284e6255..b1441692 100644 --- a/doc/supported_devices.md +++ b/doc/supported_devices.md @@ -7,6 +7,7 @@ The following devices have been tested and are fully working: | Davuaz | Da-K6501W | No | [PCB-K0501W-V2.0](devices/K0501W_V2_0.md) | | 5 + 1 | | FOXNEO | FNS-1200P | No | [PCB-K0402W-U13-V2.0](devices/FNS-1200P.md) | 2M | 4 + 2 | | Hisource | Hi-K0402WS | No | [PCB-K0402WS-V3.0](devices/PCB-K0402WS-V3.0.md) | | 4 + 2 | +| Hisource | Hi-K0402WS | No | [PCB-K0402WS-V2.0](devices/PCB-K0402WS-V2.0.md) | 2M | 4 + 2 | | Hisource | Hi-K0801WS | No | [PCB-KO801W-V2.0](devices/HI-K0801WS.md) | | 8 + 1 | | hongyavision | LG-SG5T1 | No | [PCB-SWTG024AS-V2.0_16895](devices/SWTG024AS-V2.0.md) | 0.5M | 5 + 1 | | Horaco | HC-SWTGW215AS | Yes | [SWTG024AS-A-V2.0.1_19650 5C 1SFP](devices/SWTG024AS-A-V2.0.1_5C_1SFP.md) | ? | 5 + 1 | diff --git a/machine.c b/machine.c index e7863057..17db6db1 100644 --- a/machine.c +++ b/machine.c @@ -801,9 +801,13 @@ __code const struct machine machine = { }, }; -#elif defined MACHINE_FNS1200P +#elif defined(MACHINE_PCB_K0402WS_V2) || defined(MACHINE_FNS1200P) __code const struct machine machine = { +#if defined(MACHINE_PCB_K0402WS_V2) + .machine_name = "PCB-K0402WS-V2.0", +#else .machine_name = "FNS-1200P", +#endif .isRTL8373 = 0, .min_port = 3, .max_port = 8, diff --git a/machine.h b/machine.h index 1750af10..91c4b1ff 100644 --- a/machine.h +++ b/machine.h @@ -30,6 +30,7 @@ // #define MACHINE_SWTGW218AS // #define MACHINE_PCB_SWTG018AS_V2_1_0 // #define MACHINE_PCB_K0402WS_V3 +// #define MACHINE_PCB_K0402WS_V2 // #define MACHINE_K0501W_V2_0 // #define MACHINE_LIANGUO_ZX_SWTGW215AS // #define MACHINE_ZX310S_4T2XH diff --git a/machine_init.c b/machine_init.c index e11e7f26..2f674a33 100644 --- a/machine_init.c +++ b/machine_init.c @@ -48,7 +48,7 @@ void machine_custom_init(void) __banked reg_bit_set(RTL837X_REG_LED_GLB_IO_EN, 6); } -#elif defined MACHINE_FNS1200P +#elif defined(MACHINE_PCB_K0402WS_V2) || defined(MACHINE_FNS1200P) void machine_custom_init(void) __banked { reg_bit_set(RTL837X_REG_LED_GLB_IO_EN, 6);