logicog
b41452026f
Make sure port is not called for an SFP module
2025-12-14 12:17:53 +01:00
logicog
2ed9974c04
Add more options to Link configuration and status display
2025-12-14 11:41:50 +01:00
logicog
edfb86bff4
Use SFP pin definitions and I2C ports for SFP modules
2025-12-13 09:25:58 +01:00
logicog
d75ad636f9
Use machine structure
2025-12-12 09:06:52 +01:00
logicog
32b5539670
Do not show non-ascii Transceiver field in SFP module description
2025-12-07 10:59:39 +01:00
logicog
68405f70d2
Add lag show command
2025-12-06 23:38:41 +01:00
logicog
8284554f69
Add LAG configuration commands
2025-12-05 07:38:16 +01:00
logicog
dc6734236c
Add rnd and passwd commands
2025-12-01 18:26:46 +01:00
logicog
4d915a0d80
Add support for command history
...
This adds a command history, both for the CLI as well as for
commands sent by the web-interface. They are written to a ring buffer
in order to work safely with a relatively small amount of RAM
The buffer is used to read the current in-RAM configuration
from the switch by the web-interface. It could also be used
to implement cmd history via cursor up/down in the CLI.
2025-11-29 12:44:23 +01:00
René van Dorst
f59be9cf2b
Added software version + git short hash string to firmware.
...
The Makefile has the version number and generates a version.h which
has VERSION_SW define that looks like "v<VERSION>-g<GIT_SHORT_HASH>".
Software version shows at boot in the serial console.
And shown with command: `version`.
It can also be requested via `information.json`.
```
{
"ip_address": "192.168.10.247",
"ip_gateway": "192.168.10.1",
"ip_netmask": "255.255.255.0",
"mac_address": "1c:2a:a3:23:00:02",
"sw_ver": "v0.1.0-gd48235f",
"hw_ver": "SWGT024-V2.0"
}
```
2025-11-26 23:08:23 +01:00
logicog
2008d490a9
Add support for mirror status and mirror deletion via CLI
2025-10-29 15:39:47 +01:00
logicog
ba902a68d4
Defer cmd execution for console and via http POST
2025-10-21 18:05:33 +02:00
logicog
0d64efacb3
Add EEE status query
2025-10-20 18:35:35 +02:00
logicog
7546d0c685
Fix bug in usage of CONST segment in banked code. Use #pragma constseg
2025-10-14 18:41:52 +02:00
logicog
717247bc0e
Add MAC-EEE functionality
2025-10-11 13:09:47 +02:00
René van Dorst
a59f92a648
Also use struct flash_region in flash_read_security(), flash_sector_erase().
2025-10-05 16:53:46 +02:00
René van Dorst
884bc18a61
Remove flash_read_bulk(), refactor website and execute_config().
...
flash_read_bulk() is kind of a printf function. But did not work as well.
flash_read_bulk() was used in the http generation so this needed to be changed as well.
For the website we decided that we are going to use CSR(Client Side Rendering).
So every HTML and JS files are now static.
Variables are fetched via json calls and output is render on the client side.
Also usefull for the future when we want a REST like API.
execute_config() was also using flash_read_bulk().
This have been replaced with flash_read_bulk() and parsing the flash_buf buffer.
2025-10-05 15:47:14 +02:00
René van Dorst
7a87b79871
Convert flash_addr to struct flash_region.
...
flash_region storage flash address and length, which a operation is needed.
2025-10-05 15:36:08 +02:00
logicog
05492e601a
Reducing IMEM footprint in flash routines
2025-09-30 20:45:44 +02:00
logicog
d4e2b9872d
Cleanup of flash code
...
Fix several bugs found in the write-flash code during installer coding.
Move all flash functions into CODE0. This is required to share these
functions with the installer image (currently they are duplicated so
they are not within the CODE1 segment).
De-magics all Flash command codes based on the Winbond W25Q32JV
datasheet.
2025-09-26 21:00:47 +02:00
logicog
95d7901d00
Add STP control commands
...
Adds
stp on
stp off
control commands.
2025-09-08 22:25:38 +02:00
René van Dorst
455d2e28d6
fix: isletter(), make everything lowercase.
2025-09-08 18:54:48 +02:00
René van Dorst
7a2e568fcc
Make a helper isnumber(), replace all same patterns.
2025-09-07 17:22:13 +02:00
René van Dorst
bde8454449
isletter(): optimized version
...
Less instructions and jumps.
Saves 39 bytes.
```patch
1634,1651c1621,1628
< mov r7,a
< mov r6,a
< ; cmd_parser.c:63: return (l >= 'a' && l <= 'z') || (l >= 'A' && l <= 'Z');
< cjne r7,#0x61,00326$
< 00326$:
< mov _parse_vlan_sloc0_1_0,c
< jc 00153$
< mov a,r7
< add a,#0xff - 0x7a
< mov _parse_vlan_sloc0_1_0,c
< jnc 00149$
< 00153$:
< cjne r6,#0x41,00329$
< 00329$:
< mov _parse_vlan_sloc0_1_0,c
< jc 00132$
< mov a,r6
< add a,#0xff - 0x5a
---
> ; cmd_parser.c:66: l |= 0x20;
> ; cmd_parser.c:67: l -= 'A';
> orl a,#0x20
> ; cmd_parser.c:68: return (l <= ('Z'-'A'));
> add a,#0xbf
> add a,#0xff - 0x19
> cpl c
> ; cmd_parser.c:245: if (cmd_words_b[2] > 0 && isletter(cmd_buffer[cmd_words_b[2]])) {
1653,1654c1630
< jc 00132$
< 00149$:
---
> jnc 00132$
```
2025-09-07 17:04:46 +02:00
René van Dorst
54ab915557
cmd: reg{get,set}: more small refactor
...
Refactor some value checking.
Simplified hexvalue to addr.
Updated some comments.
Remove extra debug prints and EOL after the command.
2025-09-07 16:52:51 +02:00
René van Dorst
4cad857ad5
fix: cmd: regset: need add offset when we have less then 8 hex numbers
2025-09-07 16:33:01 +02:00
René van Dorst
074c89cf27
cmd: convert reg to regget and regset.
...
We want to stick close to the origonal commands.
See: https://github.com/up-n-atom/SWTG118AS?tab=readme-ov-file#commands
2025-09-07 14:50:50 +02:00
René van Dorst
7e729c626c
cmd: add reg read and write.
...
like:
* `reg w 04`
* `reg w 04 00023678`
2025-09-07 01:03:15 +02:00
René van Dorst
e0864f811f
cmd: move gpio status to a function print_gpio_status()
2025-09-06 17:05:16 +02:00
René van Dorst
74b8280d80
gpio: SOC only has 64 gpio not 96.
...
Remove BANK_A
Rename BANK_B to GPIO_00_31
Rename BACK_C to GPIO_32_63
Added also _INPUT, _DIRECTIOn registers
2025-09-06 17:04:25 +02:00
René van Dorst
8e9cababfb
gpio: show also bit changes vs last gpio cmd
2025-09-05 00:10:18 +02:00
René van Dorst
f481d1fbe4
add cmd gpio
2025-09-04 23:49:17 +02:00
logicog
5635ad835e
Add support for ip, gw and netmask commands
2025-09-03 20:32:57 +02:00
logicog
a0239b72f4
Add support for VLAN names
2025-08-28 16:58:51 +02:00
logicog
52f8366d03
Improve command parser to work with other than serial buffer
2025-08-21 16:11:22 +02:00
logicog
d60a3786bb
Fix typo
2025-07-29 11:18:41 +02:00
logicog
8b1b4aff68
Fix parsing of mirror command, fix parsing of serial buffer beyond wrap arond, add bulk reading of flash and start of config file parser
2025-07-28 23:04:08 +02:00
logicog
891ee08243
Add support for non-linear mapping of physical ports to logical ports. Add support for trunking
2025-07-25 22:49:51 +02:00
logicog
fa4a80c291
Cleanup of printouts
2025-07-21 11:11:52 +02:00
logicog
b0a41a5af6
Add support for RTL8372-devices with 2 SFP+ ports
2025-07-17 13:25:07 +02:00
logicog
8b761cfcc8
Add UIP stack. Still lots of debug output on packets...
2025-07-11 14:54:57 +02:00
logicog
062c5576de
Fixing banked call
2025-07-05 23:46:09 +02:00
logicog
846494dc46
Move parsing to external module
2025-07-05 09:23:20 +02:00