logicog
eb0e4df5ea
Fix reset after image upload
2025-10-26 14:20:30 +01:00
logicog
ac4f0d410f
Add CRC16 initial code
2025-10-20 07:29:39 +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
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
110c403443
Adding firmware update at beginning of boot if a new image is found in second half of flash
2025-09-30 20:45:44 +02:00
logicog
6aa28b7385
Cleanup and increase of flash_buf size for flash write buffer
2025-09-30 20:45:44 +02:00
logicog
9ad5fcb43e
Add STP handling
...
Adds a timeer for calling the STP state machine which currently sends out
CNF (HELLO) packages.
Identifies incoming STP packets and calls the stp_in() routine to handle these.
2025-09-08 22:22:57 +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
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
c5995a4184
Add: phy_modify() to modify phy_registers.
...
Makes it easier to modify set/clear bit in a phy register.
Simulair like Linux PHY-core: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/phy/phy-core.c#n551
2025-09-02 22:23:02 +02:00
René van Dorst
cc132a8734
phy_write(): also use SFR_DATA_U16 and SFR_SMI_REG_U16
...
Was added by pr#7.
2025-09-01 09:59:41 +02:00
René van Dorst
689d208ff1
phy: fix whitespace and comments alinement
2025-09-01 09:59:06 +02:00
René van Dorst
b8928a8bcd
Replace manual SFR_DATA_0 and SFR_DATA_8 pair read and write with SFR_DATA_U16.
...
Also added SFR_SMI_REG_U16.
Doing pval = reg_h; pval <<= 8; pval |= reg_l; dont always optimized by the compiler a some places, not all.
A snipped of the diff between two .asm files.
5414,5424c5414,5416
< ; rtlplayground.c:1382: uint16_t pval = SFR_DATA_8;
< ; rtlplayground.c:1383: pval <<= 8;
< mov r7,_SFR_DATA_8
< mov r6,#0x00
< ; rtlplayground.c:1384: pval |= SFR_DATA_0;
< mov r4,_SFR_DATA_0
< mov r5,#0x00
< mov a,r6
< orl ar4,a
< mov a,r7
< orl ar5,a
---
> ; rtlplayground.c:1382: uint16_t pval = SFR_DATA_U16;
> mov r6,((_SFR_DATA_U16 >> 0) & 0xFF)
> mov r7,((_SFR_DATA_U16 >> 8) & 0xFF)
2025-09-01 09:20:36 +02:00
René van Dorst
9dafeab490
Added SFR_NIC_DATA_U16LE and SFR_NIC_RING_U16LE.
...
Let's use sfr16 for NIC data and ring.
SFR define can so reordered to it does the BE to LE swap for us.
2025-09-01 09:20:36 +02:00
René van Dorst
af0135bcce
Add sfr16 SFR_REG_ADDR_U16.
...
So instead do it manual split a uint16_t in to two uint8_t.
The compiler can do it, so reduces user error.
Note: compiler writes the lower/LSB part first.
When that is importent this can´t be used.
Assembly is still the same except note above.
2025-09-01 09:20:36 +02:00
René van Dorst
7ff028303d
Add phy_write() with bit_mask lookup inside the function.
...
Move the lookup saves a lot of instructions for every phy_write() call.
Assembly diff for one change.
< ; rtl837x_phy.c:240: phy_write_mask(bit_mask[port], 0x07, 0x00, 0x3200); // Enable AN
< mov dpl,r5
< mov dph,r6
---
> ; rtl837x_phy.c:240: phy_write(port, 0x07, 0x00, 0x3200); // Enable AN
> mov _phy_write_PARM_2,#0x07
1345,1359c1019,1024
< movc a,@a+dptr
< mov r5,a
< inc dptr
< clr a
< movc a,@a+dptr
< mov r6,a
< mov _phy_write_mask_PARM_2,#0x07
< clr a
< mov _phy_write_mask_PARM_3,a
< mov (_phy_write_mask_PARM_3 + 1),a
< mov _phy_write_mask_PARM_4,a
< mov (_phy_write_mask_PARM_4 + 1),#0x32
< mov dpl, r5
< mov dph, r6
< lcall _phy_write_mask
---
> mov _phy_write_PARM_3,a
> mov (_phy_write_PARM_3 + 1),a
> mov _phy_write_PARM_4,a
> mov (_phy_write_PARM_4 + 1),#0x32
> mov dpl, r7
> lcall _phy_write
Replace all phy_write_mask(bit_mask[<var>], ...) to phy phy_write(<var>, ...).
2025-09-01 00:12:12 +02:00
René van Dorst
d6ea9be4c0
rename phy_write() to phy_write_mask().
...
It seems that bit_mask[phy] lookup is expensive and it used in many places.
But most of the time we only addressing a single phy.
2025-09-01 00:07:27 +02:00
logicog
829fbf707a
Use uip for mac-address, enable STP packages
2025-08-30 18:43:31 +02:00
logicog
83dcd22863
Add STP packet identification
2025-08-30 08:29:25 +02:00
logicog
81b7e4fa87
Identify pin configuration registers
2025-08-22 09:04:34 +02:00
logicog
52f8366d03
Improve command parser to work with other than serial buffer
2025-08-21 16:11:22 +02:00
logicog
940ee648df
Use definition of NSFP in header file
2025-08-20 10:19:07 +02:00
logicog
ad53165351
Introduce identified RX/TX control register names
2025-08-19 09:34:14 +02:00
logicog
0fb4fafdb2
strtox now returns copied length
2025-08-05 09:34:44 +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
a5d156a645
Fix dropping of RTL VLAN tag for 802.1Q Tag, add L2 configuration
2025-07-25 22:51:18 +02:00
logicog
0b30019769
Use names for I2C-controller registers
2025-07-23 08:34:26 +02:00
logicog
96a108e891
Use common SDS configuration code also for RTL8224
2025-07-23 08:01:33 +02:00
logicog
bcc58d2965
Make RTL8224 work
2025-07-22 19:05:27 +02:00
logicog
8fee855da2
Separate code for rtl8272 from rtl8373 for readability and stability against accidental changes
2025-07-22 09:42:56 +02:00
logicog
ccd8bf1633
Cleanup
2025-07-17 23:29:20 +02:00
logicog
b0a41a5af6
Add support for RTL8372-devices with 2 SFP+ ports
2025-07-17 13:25:07 +02:00
logicog
d66931acdf
Adding initial http daemon implementation
2025-07-13 12:03:40 +02:00
logicog
b192a87cab
Cleaning up printouts for debugging of uIP
2025-07-11 16:36:16 +02:00
logicog
8b761cfcc8
Add UIP stack. Still lots of debug output on packets...
2025-07-11 14:54:57 +02:00
logicog
e0924314b4
Add memcpy function for __xdata
2025-07-06 09:53:28 +02:00
logicog
65c2336313
Use external command parser module. Add support for mirroring
2025-07-05 09:24:16 +02:00
logicog
2d8c0efabd
Add 802.1Q VLAN and PVID support. Support VLAN tag at CPU-port
2025-07-04 09:17:10 +02:00
logicog
997d85ba02
Add basic VLAN configuration
2025-07-02 11:57:15 +02:00
logicog
6f90e1db53
Add support for changing Ethernet speeds
2025-06-29 20:06:53 +02:00
logicog
b59f51b3ca
Cleanup of initialitation, make debug code conditional
2025-06-29 11:10:29 +02:00
logicog
5faf31cdb8
Moving PHY code to BANK1
2025-06-25 15:30:50 +02:00
logicog
73a0a7d137
Add banking support
2025-06-25 13:20:06 +02:00
logicog
b8352f9430
Implement ARP broadcast and make ping work
2025-06-23 17:57:54 +02:00
logicog
2776df9ca8
Make RX of packets work
2025-06-21 16:18:19 +02:00
logicog
dd039494c2
Add more RTL8224 config
2025-06-21 05:58:55 +02:00
logicog
869db02865
Emable RTL8224 PHY. Better implementation of sleep/delay timer
2025-06-17 18:21:15 +02:00
logicog
e4d477938d
Detect RTL8373 and name registers for GPIO. Enable RTL8224
2025-06-16 06:55:47 +02:00
logicog
85cb2a52a5
Cleanup
2025-06-15 18:26:27 +02:00