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