42 Commits
Author SHA1 Message Date
feelfree69 889c94404c Merge pull request #656 from andrebrait/fix/upload-any-part-type
Accept firmware uploads independent of file MIME type
2026-10-23 08:15:07 +02:00
feelfree69 0f98734ae2 Merge branch 'main' into fix/upload-any-part-type 2026-10-23 08:09:07 +02:00
feelfree69 2d0abbbca0 Merge pull request #691 from hlyi/clean-min-max-port
clean up min_port and max_port from struct after PR#684
2026-10-23 08:08:14 +02:00
feelfree69 fdcdfa9b45 Merge pull request #659 from andrebrait/fix/health-lldp-phase
health: give the LLDP phase a valid slot in the phase arrays
2026-10-23 08:07:31 +02:00
HL Yi c043c671d7 clean up min_port and max_port from struct after PR#684 2026-10-22 18:34:44 -05:00
René van Dorst 11a24783e4 Merge pull request #682 from hlyi/remove-custom-init
replacing machine_init.c with individual init c files
2026-10-22 19:41:08 +00:00
feelfree69 e864c32980 Merge branch 'main' into remove-custom-init 2026-10-22 21:31:41 +02:00
René van Dorst bb329daab0 Merge pull request #684 from hlyi/use-macro
use macro for min_port and max_port for code optimization
2026-10-22 19:09:24 +00:00
feelfree69 89c8903454 Merge pull request #690 from mintsoft/gh-comment-path-fix
Fixing path on the du command to respect new structure
2026-10-22 20:58:58 +02:00
Rob Emery 63a3bc50d6 Removing the comment step as this is erroring with
Error: Resource not accessible by integration
and I think the repository owner will need to check
the settings on the repo
2026-10-22 19:53:35 +01:00
Rob Emery a94be7d524 Fixing path on the du command to respect new structure 2026-10-22 19:53:00 +01:00
feelfree69 50be5308d9 Merge pull request #689 from mintsoft/build-fix-2
Fix for 688
2026-10-22 20:25:17 +02:00
Rob Emery 9731a33fa9 Adding missing? permission to fix the build 2026-10-22 19:16:50 +01:00
feelfree69 c3dddd9c90 Merge pull request #688 from mintsoft/build-fix
Fix build after #529
2026-10-22 19:28:25 +02:00
Rob Emery 6e5617c82f Fixing path to tools builds now they have injected BUILDDIR from the
main Makefile
2026-10-22 18:22:14 +01:00
feelfree69 6638748e3c Merge pull request #529 from mintsoft/ci-build-sizing
CI: Output the sizes of the banks
2026-10-22 18:59:17 +02:00
Rob Emery 98965b73f6 Fixes to BUILDDIR 2026-10-22 13:34:29 +01:00
Rob Emery ef0d9d872e adding the HTML/JS compressed sizes to the comment 2026-10-22 12:34:48 +01:00
Andre Brait 7d7585fa6d fix(health): give the LLDP phase a valid slot in the phase arrays
In HEALTH=1 builds health_phase(HEALTH_LLDP) used id 7 while ph_max[] and
ph_slow[] had HEALTH_PHASES = 6 entries. The LLDP checkpoint therefore
wrote one byte past ph_max (into the high byte of ph_slow[0]) and, when
the phase took two ticks or more, incremented two bytes past ph_slow
(dhcp_state.state and transaction_id on KP_9000_6XHML_X2).

Rename it HEALTH_PH_LLDP = 6, derive HEALTH_PHASES from it so the arrays
always cover the last phase, print an lldp line in "health" and document
it.

Fixes #658
2026-10-22 11:32:05 +02:00
Andre Brait 13801241ca fix: accept firmware uploads independent of part MIME type
Chrome on macOS labels .bin files application/macbinary. Searching for application/octet-stream mistakes the image bytes for more part headers and aborts when the preamble buffer fills.

Find the multipart header terminator instead, after the HTTP separator retained by handle_post. Keep authentication, CRC checks and staging limits unchanged. Cover MacBinary, an omitted part Content-Type, and a split header terminator with exact staged-byte checks.
2026-10-22 11:26:31 +02:00
Rob Emery 94ca35f65e First version of a local "make bank_size" 2026-10-22 09:40:17 +01:00
Rob Emery 69714c8a75 Adding the ability to override the BUILDDIR so I can store branch-builds elsewhere 2026-10-22 09:40:17 +01:00
Rob Emery 2bc6939f86 Sort -u and use v3 to silence nodejs v20 warnings 2026-10-22 09:40:16 +01:00
Rob Emery aea537f8e7 Storing the output of the build in tmp files so we can extract
the bits we need
But we need both main and branch checked out and the action can
do it for us
Pulling the bank occupancy from the map produced by sdcc rather
than the output of the build as it appears the output number is
only the maximum size of the banks
BANK0 isn't output, but what I'm guessing are the consituents for it are
2026-10-22 09:40:16 +01:00
HL Yi 7346977f91 use macro for min_port and max_port for code optimization 2026-10-21 19:40:19 -05:00
HL Yi 7673ef8322 desolve machine_init.c similar to what we did for machine.c 2026-10-21 15:20:56 -05:00
logicog c9e8403c6e Merge pull request #640 from hlyi/add-chipset
Add MACHINE_CHIPSET in header files.
2026-10-21 19:04:40 +02:00
bloq 7a44d8181f Merge pull request #582 from avicarmeli/fix/http-upload-reset-owner
Fix firmware upload reset ownership across HTTP connections
2026-10-20 14:58:51 -05:00
René van Dorst d698e180e4 Merge pull request #669 from vankxr/nit/ignore-test-build
nit: add test build directories to gitignore
2026-10-20 18:36:44 +00:00
René van Dorst 566e26ace2 Merge pull request #670 from vankxr/fix/higher-rate-sfp
sfp: force higher rate SFP modules to 10G
2026-10-20 18:36:17 +00:00
avicarmeli 674dc23a27 Merge upstream/main into PR #582; preserve HTTP upload reset ownership 2026-10-20 21:25:37 +03:00
João Silva 620edafd62 sfp: force higher rate SFP modules to 10G
sds: validate mode before touching anything

Signed-off-by: João Silva <jgc3silva@gmail.com>
2026-10-20 19:05:25 +01:00
João Silva 413d10bbcc nit: add test build directories to gitignore
Signed-off-by: João Silva <jgc3silva@gmail.com>
2026-10-20 18:56:31 +01:00
bloq 0faceab1d0 Merge pull request #648 from hlyi/httpc-hygiene
hygiene clean up for httpd.c
2026-10-20 11:00:54 -05:00
bloq 7e12f0a62c Merge pull request #627 from vankxr/fix/httpd-hdr-frag
httpd: fix incorrect handling of fragmented headers
2026-10-20 11:00:50 -05:00
avicarmeli 491a919105 httpd: clear upload reset intent when the TCP slot is reused
With UIP_CONF_MAX_CONNECTIONS set to one, a verified upload can leave
reset intent set when its response is never acknowledged. A subsequent
TCP connection reuses that slot, and ACKing its plain GET response can
otherwise trigger reset_chip(). This is sequential slot reuse, not
concurrent HTTP connections.

Store reset intent in the connection appstate and initialize both tstate
and fw_reset_pending on every uip_connected() event, regardless of stale
appstate contents. Reset only after the verified upload response is fully
acknowledged.

Exercise the real HTTP callback for all stale tstate bytes, sequential
slot reuse and a later GET, partial/final ACKs, abort, timeout and CRC
failure. Keep the regression tests in the existing tab-indented style.
2026-10-20 18:47:33 +03:00
João Silva 2588965eee httpd: handle header buffering for GET requests and add extra test cases
httpd: handle config upload boundary and add regression tests
httpd: handle split method names and add regression tests

Signed-off-by: João Silva <jgc3silva@gmail.com>
2026-10-20 14:58:08 +01:00
HL Yi 0a3d7d360a add MACHINE_CHIPSET to HASIVO_S1100P_8GT_1SX_S 2026-10-20 07:52:36 -05:00
HL Yi 9561f239b4 fixed verbiage in machine.h 2026-10-20 07:49:34 -05:00
HL Yi b06ff76a21 add MACHINE_CHIPSET in header files, and add common settings in machine_defs.h 2026-10-20 07:49:34 -05:00
João Silva d104b3129d httpd: handle headers split across segments correctly
Signed-off-by: João Silva <jgc3silva@gmail.com>
2026-10-19 19:21:32 +01:00
HL Yi f0c672418c hygiene clean up for httpd.c 2026-10-18 08:44:37 -05:00
137 changed files with 1160 additions and 407 deletions

No files matched your search

+25 -5
View File
@@ -5,6 +5,11 @@ on:
branches: ['**'] branches: ['**']
pull_request: pull_request:
permissions:
contents: read
pull-requests: write
issues: write
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -13,18 +18,33 @@ jobs:
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
with:
path: branch
- uses: actions/checkout@v6
with:
path: main
ref: main
- name: Install dependencies - name: Install dependencies
run: | run: |
apt update apt update
apt install make gcc sdcc xxd python-is-python3 libjson-c-dev zlib1g-dev -y apt install make gcc sdcc xxd python-is-python3 libjson-c-dev zlib1g-dev -y
- name: Run the host-side unit tests - name: Run the host-side unit tests
run: make -C test run: cd branch && make -C test
- name: Check that every machine definition can be compiled - name: Check that every machine definition can be compiled
run: make machine_check run: cd branch && make machine_check
- name: Make project (4x2/RTL8372) - name: Make project (4x2/RTL8372)
run: make CI=1 MACHINE="KP_9000_6XHML_X2" run: cd branch && make CI=1 MACHINE="KP_9000_6XHML_X2" && cp output/KP_9000_6XHML_X2/rtlplayground.map /tmp/branch.map
- name: Make project (8x1/RTL8373) - name: Make project (8x1/RTL8373)
run: make CI=1 MACHINE="KP_9000_9XHML_X_V3_1" run: cd branch && make CI=1 MACHINE="KP_9000_9XHML_X_V3_1"
- name: Make project with the health instrumentation - name: Make project with the health instrumentation
run: make clean && make CI=1 MACHINE="KP_9000_6XHML_X2" HEALTH=1 run: cd branch && make clean && make CI=1 MACHINE="KP_9000_6XHML_X2" HEALTH=1
- name: Make main
run: cd main && make CI=1 MACHINE="KP_9000_6XHML_X2" && cp output/KP_9000_6XHML_X2/rtlplayground.map /tmp/main.map
- name: Calculate bank growth
run: |
sed -rn 's/^([XCD]SEG|(BANK[0-9])).*=\s+([0-9]+)\. bytes.*$/MAIN_\1=\3/p' /tmp/main.map | sort -u >> "$GITHUB_ENV"
sed -rn 's/^([XCD]SEG|(BANK[0-9])).*=\s+([0-9]+)\. bytes.*$/BRANCH_\1=\3/p' /tmp/branch.map | sort -u >> "$GITHUB_ENV"
du -sb main/output/KP_9000_6XHML_X2/html_min | awk '{print "MAIN_WEB="$1}' >> "$GITHUB_ENV"
du -sb branch/output/KP_9000_6XHML_X2/html_min | awk '{print "BRANCH_WEB="$1}' >>"$GITHUB_ENV"
+3
View File
@@ -1,13 +1,16 @@
.gitignore .gitignore
.idea/ .idea/
output/ output/
output-main/
html_data.c html_data.c
html_data.h html_data.h
version.h version.h
tools/httpd_sim tools/httpd_sim
tools/injector tools/injector
tools/fileadder tools/fileadder
build/
# host-test stand-ins for the two generated headers # host-test stand-ins for the two generated headers
!test/stub/html_data.h !test/stub/html_data.h
!test/stub/version.h !test/stub/version.h
.vscode
+7
View File
@@ -25,6 +25,13 @@
## Fixed ## Fixed
- Web UI
- Accept firmware uploads regardless of the file part's MIME type, including
`application/macbinary` sent by Chrome on macOS for `.bin` files.
- Health
- `HEALTH=1` builds no longer write past the phase timing arrays at the LLDP checkpoint, which
corrupted the `link` slow counter and the DHCP client state. #658
- Config - Config
- A startup configuration line longer than the command buffer no longer stops the replay: - A startup configuration line longer than the command buffer no longer stops the replay:
the offending line is skipped and the following lines are still applied. the offending line is skipped and the following lines are still applied.
+35 -20
View File
@@ -15,11 +15,10 @@ SUBDIRS := tools
SUBDIRSCLEAN=$(addsuffix clean,$(SUBDIRS)) SUBDIRSCLEAN=$(addsuffix clean,$(SUBDIRS))
# $MACHINE selects machine/$(MACHINE).c as the board definition and is passed # $MACHINE selects machine/$(MACHINE).c as the board definition and is passed
# on as -DMACHINE_$(MACHINE), which the rest of the firmware tests with # on as -DMACHINE_NAME, which machine.h uses to include machine/$(MACHINE).h.
# #if defined(MACHINE_...), and as -DMACHINE_NAME, which machine.h uses to # Board selection itself needs no MACHINE_* symbol for #if chains, so the
# include machine/$(MACHINE).h. Both take the same value, so they cannot drift. # definition is all the compiler has to know.
ifneq ($(MACHINE),) ifneq ($(MACHINE),)
CC_FLAGS += -DMACHINE_$(MACHINE)
CC_FLAGS += -DMACHINE_NAME=$(MACHINE) CC_FLAGS += -DMACHINE_NAME=$(MACHINE)
endif endif
# Health instrumentation and the "health" console command: HEALTH=1 gmake ... # Health instrumentation and the "health" console command: HEALTH=1 gmake ...
@@ -34,7 +33,16 @@ endif
# The board definition being built: one file per MACHINE_* symbol in machine.h. # The board definition being built: one file per MACHINE_* symbol in machine.h.
MACHINE_SRC = machine/$(MACHINE).c MACHINE_SRC = machine/$(MACHINE).c
BUILDDIR = output/$(MACHINE) MACHINE_INIT_DEFAULT := machine/default_machine_init.c
MACHINE_INIT_SRC := $(wildcard machine/$(MACHINE)_init.c)
ifeq ($(MACHINE_INIT_SRC),)
MACHINE_INIT_SRC := $(MACHINE_INIT_DEFAULT)
endif
ifndef BUILDDIR
BUILDDIR = output/$(MACHINE)
endif
VERSION_HEADER := version.h VERSION_HEADER := version.h
GIT_VERSION := $(shell git rev-parse --short HEAD) GIT_VERSION := $(shell git rev-parse --short HEAD)
@@ -61,6 +69,9 @@ endif
# is built, including the tools/ subdirectory. # is built, including the tools/ subdirectory.
all: create_build_dir $(VERSION_HEADER) $(MACHINE_SRC) $(SUBDIRS) $(BUILDDIR)/rtlplayground-$(FILENAME_EXTENSION).bin all: create_build_dir $(VERSION_HEADER) $(MACHINE_SRC) $(SUBDIRS) $(BUILDDIR)/rtlplayground-$(FILENAME_EXTENSION).bin
bank_size:
tools/bank_occupancy.sh "$(MACHINE)"
create_build_dir: create_build_dir:
mkdir -p "$(BUILDDIR)" mkdir -p "$(BUILDDIR)"
mkdir -p "$(BUILDDIR)/uip" mkdir -p "$(BUILDDIR)/uip"
@@ -81,7 +92,7 @@ $(MACHINE_SRC):
# invalid $MACHINE value # invalid $MACHINE value
SRCS = \ SRCS = \
$(MACHINE_SRC) \ $(MACHINE_SRC) \
machine_init.c \ $(MACHINE_INIT_SRC) \
cmd_editor.c \ cmd_editor.c \
cmd_parser.c \ cmd_parser.c \
dhcp.c \ dhcp.c \
@@ -133,7 +144,7 @@ HTML := $(shell find html -name '*.js' -or -name '*.html' -or -name '*.svg' -or
# Minified copy of the web UI sources, used as the fileadder input. # Minified copy of the web UI sources, used as the fileadder input.
# The raw html/ sources stay untouched for development; the minified # The raw html/ sources stay untouched for development; the minified
# copy is a build artifact under output/. # copy is a build artifact under output/.
HTML_MIN := output/html_min HTML_MIN := $(BUILDDIR)/html_min
.PHONY: html_min .PHONY: html_min
html_min: $(HTML) html_min: $(HTML)
rm -rf $(HTML_MIN) rm -rf $(HTML_MIN)
@@ -141,7 +152,7 @@ html_min: $(HTML)
@for f in $(HTML); do python3 tools/minify.py $$f $(HTML_MIN)/$$(basename $$f) || exit 1; done @for f in $(HTML); do python3 tools/minify.py $$f $(HTML_MIN)/$$(basename $$f) || exit 1; done
html_data.c html_data.h &: $(HTML) | tools html_min html_data.c html_data.h &: $(HTML) | tools html_min
tools/output/fileadder -a $(HTML_LOCATION) -s $(IMAGESIZE) -b BANK1 -z -d $(HTML_MIN) -p html_data tools/$(BUILDDIR)/fileadder -a $(HTML_LOCATION) -s $(IMAGESIZE) -b BANK1 -z -d $(HTML_MIN) -p html_data
$(VERSION_HEADER): FORCE $(VERSION_HEADER): FORCE
@printf '%s\n' "#ifndef VERSION_H" "#define VERSION_H" \ @printf '%s\n' "#ifndef VERSION_H" "#define VERSION_H" \
@@ -155,7 +166,7 @@ $(VERSION_HEADER): FORCE
httpd: html_data.h httpd: html_data.h
$(SUBDIRS): $(SUBDIRS):
$(MAKE) -C $@ $(MAKE) -C $@ BUILDDIR=$(BUILDDIR)
clean: $(SUBDIRSCLEAN) clean: $(SUBDIRSCLEAN)
-rm -f html_data.c html_data.h $(VERSION_HEADER) -rm -f html_data.c html_data.h $(VERSION_HEADER)
@@ -193,31 +204,35 @@ $(BUILDDIR)/rtlplayground.img: $(BUILDDIR)/rtlplayground.ihx
$(BUILDDIR)/rtlplayground-$(FILENAME_EXTENSION).bin: $(BUILDDIR)/rtlplayground.img | tools $(BUILDDIR)/rtlplayground-$(FILENAME_EXTENSION).bin: $(BUILDDIR)/rtlplayground.img | tools
if [ -e $@ ]; then rm $@; fi if [ -e $@ ]; then rm $@; fi
tools/output/imagebuilder -i $^ $@ tools/$(BUILDDIR)/imagebuilder -i $^ $@
tools/output/fileadder -a $(DEFAULT_CONFIG_LOCATION) -s $(IMAGESIZE) -d config.txt $@ tools/$(BUILDDIR)/fileadder -a $(DEFAULT_CONFIG_LOCATION) -s $(IMAGESIZE) -d config.txt $@
tools/output/fileadder -a $(CONFIG_LOCATION) -s $(IMAGESIZE) -d config.txt $@ tools/$(BUILDDIR)/fileadder -a $(CONFIG_LOCATION) -s $(IMAGESIZE) -d config.txt $@
tools/output/fileadder -a $(HTML_LOCATION) -s $(IMAGESIZE) -z -d $(HTML_MIN) -b BANK1 $@ tools/$(BUILDDIR)/fileadder -a $(HTML_LOCATION) -s $(IMAGESIZE) -z -d $(HTML_MIN) -b BANK1 $@
tools/output/crc_calculator -u $@ tools/$(BUILDDIR)/crc_calculator -u $@
ln -sf $(MACHINE)/rtlplayground-$(FILENAME_EXTENSION).bin output/rtlplayground.bin ln -sf $(MACHINE)/rtlplayground-$(FILENAME_EXTENSION).bin $(BUILDDIR)/../rtlplayground.bin
.PHONY: clean distclean all $(SUBDIRS) $(SUBDIRSCLEAN) create_build_dir .PHONY: clean distclean all $(SUBDIRS) $(SUBDIRSCLEAN) create_build_dir
# Every machine/ definition is compiled, so a machine added to machine/ is # Every machine/ definition is compiled, so a machine added to machine/ is
# covered without registering it anywhere. The machine-specific defines are # covered without registering it anywhere. The _init.c files are excluded here:
# they are the boot hooks, compiled separately below (the board's own if it
# exists, otherwise default_machine_init.c). The machine-specific defines are
# filtered out of $(CC_FLAGS) and supplied per iteration instead, so this also # filtered out of $(CC_FLAGS) and supplied per iteration instead, so this also
# works as "make machine_check MACHINE=...". # works as "make machine_check MACHINE=...".
MACHINE_DEFS := $(sort $(patsubst machine/%.c,%,$(wildcard machine/*.c))) MACHINE_DEFS := $(sort $(patsubst machine/%.c,%,$(filter-out machine/%_init.c,$(wildcard machine/*.c))))
MACHINE_LESS_CC_FLAGS = $(filter-out -DMACHINE_%,$(CC_FLAGS)) MACHINE_LESS_CC_FLAGS = $(filter-out -DMACHINE_%,$(CC_FLAGS))
.PHONY: .PHONY: machine_check
machine_check: machine_check:
@mkdir -p $(BUILDDIR)/tmp @mkdir -p $(BUILDDIR)/tmp
@set -eo pipefail; \ @set -eo pipefail; \
for MACHINE in $(MACHINE_DEFS); \ for MACHINE in $(MACHINE_DEFS); \
do \ do \
echo "Checking $${MACHINE}"; \ echo "Checking $${MACHINE}"; \
$(CC) $(MACHINE_LESS_CC_FLAGS) -DMACHINE_$${MACHINE} -DMACHINE_NAME=$${MACHINE} -MMD -o $(BUILDDIR)/tmp/machine_check -c machine/$${MACHINE}.c; \ $(CC) $(MACHINE_LESS_CC_FLAGS) -DMACHINE_NAME=$${MACHINE} -MMD -o $(BUILDDIR)/tmp/machine_check -c machine/$${MACHINE}.c; \
$(CC) $(MACHINE_LESS_CC_FLAGS) -DMACHINE_$${MACHINE} -DMACHINE_NAME=$${MACHINE} -MMD -o $(BUILDDIR)/tmp/machine_check -c machine_init.c; \ INIT=machine/$${MACHINE}_init.c; \
if [ ! -e $$INIT ] && [ ! -L $$INIT ]; then INIT=$(MACHINE_INIT_DEFAULT); fi; \
$(CC) $(MACHINE_LESS_CC_FLAGS) -DMACHINE_NAME=$${MACHINE} -MMD -o $(BUILDDIR)/tmp/machine_check -c $$INIT; \
done done
@rm -rf $(BUILDDIR)/tmp @rm -rf $(BUILDDIR)/tmp
+15 -12
View File
@@ -125,18 +125,6 @@ void early_boot_handle_button(void) __banked
void sds_config(uint8_t sds, uint8_t mode) __banked void sds_config(uint8_t sds, uint8_t mode) __banked
{ {
print_string("sds_config sds: "); print_byte(sds); print_string(", mode: "); print_byte(mode); write_char('\n'); print_string("sds_config sds: "); print_byte(sds); print_string(", mode: "); print_byte(mode); write_char('\n');
sds_config_mac(sds, mode);
if (mode == SDS_10GR || mode == SDS_QXGMII)
sds_write_v(sds, 0x21, 0x10, 0x4480); // Q002110:6480
else
sds_write_v(sds, 0x21, 0x10, 0x6480); // Q002110:6480
sds_write_v(sds, 0x21, 0x13, 0x0400); // Q002113:0400
sds_write_v(sds, 0x21, 0x18, 0x6d02); // Q002118:6d02
sds_write_v(sds, 0x21, 0x1b, 0x424e); // Q00211b:424e
sds_write_v(sds, 0x21, 0x1d, 0x0002); // Q00211d:0002
sds_write_v(sds, 0x36, 0x1c, 0x1390); // Q00361c:1390
sds_write_v(sds, 0x36, 0x14, 0x003f); // Q003614:003f
uint8_t page = 0; uint8_t page = 0;
uint16_t v = 0; uint16_t v = 0;
@@ -165,6 +153,21 @@ void sds_config(uint8_t sds, uint8_t mode) __banked
print_string("Error in SDS Mode\n"); print_string("Error in SDS Mode\n");
return; return;
} }
sds_config_mac(sds, mode);
if (mode == SDS_10GR || mode == SDS_QXGMII)
sds_write_v(sds, 0x21, 0x10, 0x4480); // Q002110:6480
else
sds_write_v(sds, 0x21, 0x10, 0x6480); // Q002110:6480
sds_write_v(sds, 0x21, 0x13, 0x0400); // Q002113:0400
sds_write_v(sds, 0x21, 0x18, 0x6d02); // Q002118:6d02
sds_write_v(sds, 0x21, 0x1b, 0x424e); // Q00211b:424e
sds_write_v(sds, 0x21, 0x1d, 0x0002); // Q00211d:0002
sds_write_v(sds, 0x36, 0x1c, 0x1390); // Q00361c:1390
sds_write_v(sds, 0x36, 0x14, 0x003f); // Q003614:003f
sds_write_v(sds, 0x36, 0x10, v); // Q003610:0200 sds_write_v(sds, 0x36, 0x10, v); // Q003610:0200
if (page == 0x2e) { // 10G Fiber / SDS_QXGMII if (page == 0x2e) { // 10G Fiber / SDS_QXGMII
+5 -4
View File
@@ -266,7 +266,7 @@ uint8_t cmd_parse_port(uint8_t idx) {
return 0; return 0;
port = machine.phys_to_log_port[port]; port = machine.phys_to_log_port[port];
if (port < machine.min_port || port > machine.max_port) if (!MACHINE_PORT_VALID(port))
return 0; return 0;
atoi_results_u8 = port; atoi_results_u8 = port;
@@ -743,7 +743,7 @@ void parse_isolate(void)
} }
if (cmd_compare(2, "off")) { if (cmd_compare(2, "off")) {
for (uint8_t i = machine.min_port; i <= machine.max_port; i++) for (uint8_t i = MACHINE_MIN_PORT; i <= MACHINE_MAX_PORT; i++)
members |= ((uint16_t)1) << i; members |= ((uint16_t)1) << i;
members |= PMASK_CPU; // CPU-port members |= PMASK_CPU; // CPU-port
port_isolate(port_configured, members); port_isolate(port_configured, members);
@@ -797,7 +797,7 @@ void parse_ingress(void)
if (!cmd_is_space_or_nul(idx)) if (!cmd_is_space_or_nul(idx))
goto err; goto err;
// Setting mode for all ports at once // Setting mode for all ports at once
for (log_port = machine.min_port; log_port <= machine.max_port; log_port++) { for (log_port = MACHINE_MIN_PORT; log_port <= MACHINE_MAX_PORT; log_port++) {
if (!port_ingress_filter(log_port, mode)) { if (!port_ingress_filter(log_port, mode)) {
cmd_error("cannot set the ingress filter for port "); print_phys_port(log_port); write_char('\n'); cmd_error("cannot set the ingress filter for port "); print_phys_port(log_port); write_char('\n');
return; return;
@@ -1019,7 +1019,7 @@ void parse_mtu(void)
uint8_t p; uint8_t p;
if (cmd_compare(1, "show")) { if (cmd_compare(1, "show")) {
for (p = machine.min_port; p <= machine.max_port; p++) { for (p = MACHINE_MIN_PORT; p <= MACHINE_MAX_PORT; p++) {
reg_read_m(RTL8373_REG_MAC_L2_PORT_MAX_LEN + ((uint16_t) p << 8)); reg_read_m(RTL8373_REG_MAC_L2_PORT_MAX_LEN + ((uint16_t) p << 8));
uint16_t mtu = SFR_DATA_U16 & 0x3fff; uint16_t mtu = SFR_DATA_U16 & 0x3fff;
print_string("Port "); print_phys_port(p); print_string("Port "); print_phys_port(p);
@@ -2329,6 +2329,7 @@ void health_show(void) __banked
ph_line("tx ", HEALTH_PH_TX); ph_line("tx ", HEALTH_PH_TX);
ph_line("stp ", HEALTH_PH_STP); ph_line("stp ", HEALTH_PH_STP);
ph_line("cmd ", HEALTH_PH_CMD); ph_line("cmd ", HEALTH_PH_CMD);
ph_line("lldp", HEALTH_PH_LLDP);
/* Stack: current depth plus how much of the painted area is untouched */ /* Stack: current depth plus how much of the painted area is untouched */
print_string("sp "); print_string("sp ");
+2 -2
View File
@@ -19,8 +19,8 @@ extern __xdata uint8_t err_status;
#define HEALTH_PH_TX 3 #define HEALTH_PH_TX 3
#define HEALTH_PH_STP 4 #define HEALTH_PH_STP 4
#define HEALTH_PH_CMD 5 #define HEALTH_PH_CMD 5
#define HEALTH_PHASES 6 #define HEALTH_PH_LLDP 6
#define HEALTH_LLDP 7 #define HEALTH_PHASES (HEALTH_PH_LLDP + 1) /* last id + 1: sizes the arrays in cmd_parser.c */
extern __xdata uint16_t health_rx_frames; extern __xdata uint16_t health_rx_frames;
#define health_rx_frame() health_rx_frames++ #define health_rx_frame() health_rx_frames++
+39 -15
View File
@@ -1,6 +1,6 @@
# Adding a new device # Adding a new device
A device is supported by adding one board definition `.h` and board configuration `.c` file A device is supported by adding one board header `.h` and board definition `.c` file
under `machine/`. under `machine/`.
the build selects the definition by name, and CI compiles every file it finds. the build selects the definition by name, and CI compiles every file it finds.
@@ -14,27 +14,35 @@ make MACHINE=<NAME>
| File | Purpose | | File | Purpose |
|------|---------| |------|---------|
| `machine/<NAME>.c` | the `struct machine machine` board definition | | `machine/<NAME>.c` | the `struct machine machine` board definition |
| `machine/<NAME>.h` | `MACHINE_MODEL`, the model string shown in the UI and the CLI | | `machine/<NAME>.h` | `MACHINE_MODEL` (the model string shown in the UI and the CLI) and `MACHINE_CHIPSET` (`RTL8372` or `RTL8373`) |
| `machine/<NAME>_init.c` | optional `machine_custom_init()` boot hook, for registers the machine definition cannot express |
| `doc/devices/<name>.md` + `doc/supported_devices.md` | (only if the board is verified and you want to support it publicly) user-facing documentation | | `doc/devices/<name>.md` + `doc/supported_devices.md` | (only if the board is verified and you want to support it publicly) user-facing documentation |
`<NAME>` is the machine symbol without its `MACHINE_` prefix, so `MACHINE` is `<NAME>` is the machine symbol without its `MACHINE_` prefix, so `MACHINE` is
passed exactly as spelled on the command line: `make MACHINE=MY_BOARD_1_0` passed exactly as spelled on the command line: `make MACHINE=MY_BOARD_1_0`
needs `machine/MY_BOARD_1_0.c` and `machine/MY_BOARD_1_0.h`. needs `machine/MY_BOARD_1_0.c` and `machine/MY_BOARD_1_0.h`.
## Step 1: the model header ## Step 1: the board header
`machine/<NAME>.h` only carries the product string. Use the existing files as `machine/<NAME>.h` carries the product string and the SoC family. Use the
the template: existing files as the template:
```c ```c
#ifndef _MACHINE_MY_BOARD_1_0_H_ #ifndef _MACHINE_MY_BOARD_1_0_H_
#define _MACHINE_MY_BOARD_1_0_H_ #define _MACHINE_MY_BOARD_1_0_H_
#define MACHINE_MODEL "Brand Model V1.0" #define MACHINE_MODEL "Brand Model V1.0"
#define MACHINE_CHIPSET RTL8373
#endif #endif
``` ```
`MACHINE_CHIPSET` is `RTL8373` or `RTL8372`; a build without it will fail. It selects the default
logical port range: `MACHINE_MIN_PORT` is `0` for RTL8373 and `3` for RTL8372, while
`MACHINE_MAX_PORT` is `8`, the highest logical port index. A board with a different range defines
`MACHINE_MIN_PORT` and/or `MACHINE_MAX_PORT` in its header to override the
defaults.
The device product string is what the CLI or the Web-Interface will print to identify the device; `machine.h` includes it by name. The device product string is what the CLI or the Web-Interface will print to identify the device; `machine.h` includes it by name.
> [!NOTE] > [!NOTE]
@@ -55,10 +63,7 @@ ports and the same number of SFP+ cages.
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 1,
.min_port = 0,
.max_port = 8,
.n_sfp = 1, .n_sfp = 1,
.log_to_phys_port = {1, 2, 3, 4, 5, 6, 7, 8, 9}, .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}, .phys_to_log_port = {0, 1, 2, 3, 4, 5, 6, 7, 8},
@@ -89,13 +94,16 @@ __code const struct machine machine = {
}; };
``` ```
`MACHINE_COMMON_SETTING` (from `machine_defs.h`) initializes `machine_name` and
`isRTL8373` from the header's `MACHINE_MODEL` and `MACHINE_CHIPSET`. The logical
port range comes from `MACHINE_MIN_PORT` and `MACHINE_MAX_PORT` in `machine.h`.
Keep it as the first initializer and list the board-specific fields after it.
### Fields ### Fields
| Field | Meaning | | Field | Meaning |
|-------|---------| |-------|---------|
| `machine_name` | always `MACHINE_MODEL` | | `MACHINE_COMMON_SETTING` | expands to `machine_name` (`MACHINE_MODEL`) and `isRTL8373` (`1` for `RTL8373`, `0` for `RTL8372`); both are derived from the header's `MACHINE_CHIPSET` (see Step 1) |
| `isRTL8373` | `1` for an RTL8373 SoC, `0` for RTL8372 |
| `min_port` / `max_port` | range of logical port numbers the device has; `min_port` is `0` for RTL8373 boards and `3` for RTL8372 boards (logical ports 1–2 are the SoC's internal ports on the 8372), `max_port` is usually 8. |
| `n_sfp` | number of SFP+ cages | | `n_sfp` | number of SFP+ cages |
| `n_10g` | SerDes 10G capability used by the RTL837xN init: `0` none, `1` one, `2` two 10G-capable SerDes | | `n_10g` | SerDes 10G capability used by the RTL837xN init: `0` none, `1` one, `2` two 10G-capable SerDes |
| `log_to_phys_port[9]` | logical port (0-based index) → physical front-panel port number | | `log_to_phys_port[9]` | logical port (0-based index) → physical front-panel port number |
@@ -130,14 +138,30 @@ apart:
ln -s KP_9000_6XHML_X2.c machine/MY_BOARD_1_0.c ln -s KP_9000_6XHML_X2.c machine/MY_BOARD_1_0.c
``` ```
The new board still needs `machine/MY_BOARD_1_0.h` (pick the version number on the PCB) with its own The new board still needs `machine/MY_BOARD_1_0.h` (pick the version number on
`MACHINE_MODEL`, because `MACHINE_MODEL` is what distinguishes the products. the PCB) with its own `MACHINE_MODEL` and `MACHINE_CHIPSET`: `MACHINE_MODEL` is
what distinguishes the products, and `MACHINE_CHIPSET` must match the SoC of
the board definition being reused.
Existing examples: `machine/PCB_K0402WS_V3.c`, `machine/KP_9000_9XHML_X_V3_2.c` Existing examples: `machine/PCB_K0402WS_V3.c`, `machine/KP_9000_9XHML_X_V3_2.c`
and the six `KP_9000_*` revision variants. and the six `KP_9000_*` revision variants.
Two files that differ only in whitespace or comments are duplicates and should Two files that differ only in whitespace or comments are duplicates and should
be collapsed this way. be collapsed this way.
### Optional custom init hook
If the board needs custom initialization, add
`machine/<NAME>_init.c` defining `machine_custom_init()`. The Makefile picks the
file up by name and compiles it.
Boards that need the same hook share one file: keep the code in a single
`machine/<NAME>_init.c` whose `machine/<NAME>.c` is a real file (not a symlink),
and make the other boards' `_init.c` symlinks to it, for example:
```
ln -s KP_9000_6XH_X2_init.c machine/MY_BOARD_1_0_init.c
```
## Step 3: build and verify ## Step 3: build and verify
``` ```
@@ -151,7 +175,7 @@ file, before anything is compiled.
Then run the checks CI runs: Then run the checks CI runs:
``` ```
make machine_check # compiles machine/<NAME>.c and machine_init.c for every machine make machine_check # compiles machine/<NAME>.c and its optional _init.c for every machine
make -C test # host-side unit tests make -C test # host-side unit tests
``` ```
+2 -1
View File
@@ -14,6 +14,7 @@ rx max 00 slow 0x0000
tx max 00 slow 0x0000 tx max 00 slow 0x0000
stp max 04 slow 0x0001 stp max 04 slow 0x0001
cmd max 02 slow 0x0001 cmd max 02 slow 0x0001
lldp max 00 slow 0x0000
sp 80 untouched 62 sp 80 untouched 62
tcp st 00 tmr 00 rtx 00 rto 00 len 0x0000 mss 0x05b4 tcp st 00 tmr 00 rtx 00 rto 00 len 0x0000 mss 0x05b4
lport 0x0000 rport 0x0000 rip 0x0000 0x0000 lport 0x0000 rport 0x0000 rip 0x0000 0x0000
@@ -46,7 +47,7 @@ a flooded CPU port from a stalled loop, which look identical from outside.
## Phases ## Phases
Each line is one section of the main loop: the link poll, SFP handling, Each line is one section of the main loop: the link poll, SFP handling,
frame reception, TCP transmission, the STP timers and the command dispatch. frame reception, TCP transmission, the STP timers, the LLDP timer and the command dispatch.
`max` is the worst time that section has taken, in ticks of 5 ms; `slow` `max` is the worst time that section has taken, in ticks of 5 ms; `slow`
counts the passes that took two ticks or more. A misbehaving subsystem counts the passes that took two ticks or more. A misbehaving subsystem
names itself here, which is the difference between knowing that the loop is names itself here, which is the difference between knowing that the loop is
+77 -30
View File
@@ -55,8 +55,8 @@ __xdata uint8_t boundary[72];
#define CONFIG_UPLOAD_BUF (CONFIG_LEN + 384) #define CONFIG_UPLOAD_BUF (CONFIG_LEN + 384)
__xdata uint8_t config_upload; __xdata uint8_t config_upload;
__xdata uint8_t config_buf[CONFIG_UPLOAD_BUF]; __xdata uint8_t config_buf[CONFIG_UPLOAD_BUF];
// bytes buffered in config_buf so far (config body, or a firmware part // bytes buffered in config_buf so far (HTTP header, POST body, or a firmware
// header); accumulates across TCP segments // part header); accumulates across TCP segments
__xdata uint16_t pre_acc; __xdata uint16_t pre_acc;
__xdata uint8_t * __xdata content_type = 0; __xdata uint8_t * __xdata content_type = 0;
__xdata uint8_t * __xdata session = 0; __xdata uint8_t * __xdata session = 0;
@@ -75,9 +75,6 @@ __xdata uint8_t postbody_endpoint;
__xdata uint16_t postbody_start; __xdata uint16_t postbody_start;
__xdata char passwd[21]; __xdata char passwd[21];
// Set when a verified firmware upload awaits its response ACK, after
// which the chip resets to apply the staged image
__xdata uint8_t fw_reset_pending;
__xdata char session_id[SESSION_ID_LENGTH + 1]; __xdata char session_id[SESSION_ID_LENGTH + 1];
__xdata uint8_t authenticated; __xdata uint8_t authenticated;
__xdata uint32_t now; __xdata uint32_t now;
@@ -90,6 +87,7 @@ __xdata uint32_t last_session_use;
#define TSTATE_POST 4 #define TSTATE_POST 4
#define TSTATE_MULTIPART 5 #define TSTATE_MULTIPART 5
#define TSTATE_POSTBODY 6 #define TSTATE_POSTBODY 6
#define TSTATE_HEADER 7
extern __xdata uint16_t crc_value; extern __xdata uint16_t crc_value;
__xdata uint16_t crc_final; __xdata uint16_t crc_final;
@@ -109,8 +107,8 @@ void httpd_init(void) __banked
uip_listen(HTONS(80)); uip_listen(HTONS(80));
// Not through uip_conn: it only points at a connection while uIP is // Not through uip_conn: it only points at a connection while uIP is
// handling one, and nothing has set it yet at init time. // handling one, and nothing has set it yet at init time.
uip_conns[0].appstate.tstate = TSTATE_CLOSED; for (uint8_t i = 0; i < UIP_CONNS; i++)
fw_reset_pending = 0; // xdata is not zeroed by the startup code uip_conns[i].appstate.tstate = TSTATE_CLOSED;
} }
@@ -450,15 +448,9 @@ static uint8_t config_take(void)
// unlike scan_header(), keeps no auth state, so it may run on every buffered segment // unlike scan_header(), keeps no auth state, so it may run on every buffered segment
static uint16_t preamble_payload_start(uint16_t n) static uint16_t preamble_payload_start(uint16_t n)
{ {
uint16_t pos; // Skip the HTTP header separator retained by handle_post().
uint16_t pos = 4;
for (pos = 0; pos + 24 <= n; pos++) {
if (strstart(&config_buf[pos], "application/octet-stream"))
break;
}
if (pos + 24 > n)
return 0;
pos += 24;
while (pos + 3 < n && !strstart(&config_buf[pos], "\r\n\r\n")) while (pos + 3 < n && !strstart(&config_buf[pos], "\r\n\r\n"))
pos++; pos++;
if (pos + 3 >= n) if (pos + 3 >= n)
@@ -511,7 +503,7 @@ uint8_t stream_upload(void)
"Content-Type: text/plain\r\n\r\n" "Content-Type: text/plain\r\n\r\n"
"OK: checksum verified, rebooting\n"); "OK: checksum verified, rebooting\n");
// Reset once the response is fully ACKed // Reset once the response is fully ACKed
fw_reset_pending = 1; s->fw_reset_pending = 1;
} else { } else {
print_string("Checksum incorrect! Aborting.\n"); print_string("Checksum incorrect! Aborting.\n");
slen = strtox(outbuf, "HTTP/1.1 400 Bad Request\r\nContent-Length: 33\r\n" slen = strtox(outbuf, "HTTP/1.1 400 Bad Request\r\nContent-Length: 33\r\n"
@@ -746,7 +738,42 @@ static void post_body_continue(void)
} }
void handle_post(void)
/*
* Buffer an HTTP request header across TCP receive events. Stop copying at
* CRLFCRLF so any body bytes in the final segment stay in uip_appdata.
*
* Return the body offset in the current receive buffer, 0 while incomplete,
* or 0xffff after sending an error response.
*/
static uint16_t request_header_take(void)
{
uint16_t i;
for (i = 0; i < uip_len; i++) {
if (pre_acc + 1 >= CONFIG_UPLOAD_BUF) {
uip_conn->appstate.tstate = TSTATE_NONE;
send_bad_request();
return 0xffff;
}
config_buf[pre_acc++] = ((__xdata uint8_t *)uip_appdata)[i];
config_buf[pre_acc] = NUL;
if (pre_acc >= 4
&& config_buf[pre_acc - 4] == '\r'
&& config_buf[pre_acc - 3] == '\n'
&& config_buf[pre_acc - 2] == '\r'
&& config_buf[pre_acc - 1] == '\n') {
uip_conn->appstate.tstate = TSTATE_NONE;
return i + 1;
}
}
postbody_start = ticks;
uip_conn->appstate.tstate = TSTATE_HEADER;
return 0;
}
void handle_post(uint16_t body_off)
{ {
__xdata struct httpd_state * __xdata s = &(uip_conn->appstate); __xdata struct httpd_state * __xdata s = &(uip_conn->appstate);
__xdata uint8_t *p = uip_appdata; __xdata uint8_t *p = uip_appdata;
@@ -759,6 +786,9 @@ void handle_post(void)
// Was the multipart header sent in multiple packets? // Was the multipart header sent in multiple packets?
if (s->tstate != TSTATE_MULTIPART) { if (s->tstate != TSTATE_MULTIPART) {
p = config_buf;
request_path = p + 6;
dbg_string("Is POST\n"); dbg_string("Is POST\n");
p += 5; // Skip post p += 5; // Skip post
// Find end of request path // Find end of request path
@@ -772,9 +802,12 @@ void handle_post(void)
dbg_string("Boundary: >"); dbg_string_x(boundary); dbg_string("<\n"); dbg_string("Boundary: >"); dbg_string_x(boundary); dbg_string("<\n");
if (!*p || !content_type) { if (!*p || !content_type) {
dbg_string("Bad Request!\n"); dbg_string("Bad Request!\n");
send_not_found(); send_bad_request();
return; return;
} }
pre_acc = 0;
p = (__xdata uint8_t *)uip_appdata + body_off;
if (is_word(request_path, "upload")) { if (is_word(request_path, "upload")) {
if (!authenticated) { if (!authenticated) {
send_unauthorized(); send_unauthorized();
@@ -800,7 +833,10 @@ void handle_post(void)
dbg_string("Configuration upload\n"); dbg_string("Configuration upload\n");
verify_crc = 0; verify_crc = 0;
config_upload = 1; config_upload = 1;
pre_acc = 0; // config_take() matches CRLF-prefixed delimiters, including the first.
config_buf[0] = '\r';
config_buf[1] = '\n';
pre_acc = 2;
} }
// Check for other POST requests, which are not multipart, below // Check for other POST requests, which are not multipart, below
} else { } else {
@@ -824,7 +860,6 @@ void handle_post(void)
handle_firmware_fragment(p); handle_firmware_fragment(p);
return; return;
} else if (is_word(request_path, "cmd")) { } else if (is_word(request_path, "cmd")) {
p += 4;
if (!authenticated) { if (!authenticated) {
send_unauthorized(); send_unauthorized();
return; return;
@@ -843,7 +878,6 @@ void handle_post(void)
return; return;
} }
p += 4;
postbody_endpoint = POSTBODY_LOGIN; postbody_endpoint = POSTBODY_LOGIN;
if (!post_body_take(p)) if (!post_body_take(p))
return; return;
@@ -874,9 +908,10 @@ void httpd_appcall(void)
print_byte(s->tstate); print_byte(s->tstate);
write_char(' '); write_char(' ');
#endif #endif
if(uip_connected() && s->tstate == TSTATE_CLOSED) { if(uip_connected()) {
dbg_string("Connected...\n"); dbg_string("Connected...\n");
s->tstate = TSTATE_NONE; s->tstate = TSTATE_NONE;
s->fw_reset_pending = 0; // explicitly initialize reused XDATA appstate
} else if (uip_closed()) { } else if (uip_closed()) {
dbg_string("Connection closed\n"); dbg_string("Connection closed\n");
s->tstate = TSTATE_CLOSED; s->tstate = TSTATE_CLOSED;
@@ -890,9 +925,9 @@ void httpd_appcall(void)
dbg_string("Closing because everything has been transmitted\n"); dbg_string("Closing because everything has been transmitted\n");
uip_close(); uip_close();
s->tstate = TSTATE_CLOSED; s->tstate = TSTATE_CLOSED;
} else if (s->tstate == TSTATE_POSTBODY } else if ((s->tstate == TSTATE_POSTBODY || s->tstate == TSTATE_HEADER)
&& (uint16_t)ticks - postbody_start > POSTBODY_TIMEOUT) { && (uint16_t)ticks - postbody_start > POSTBODY_TIMEOUT) {
dbg_string("Body never arrived\n"); dbg_string("HTTP request never completed\n");
uip_abort(); uip_abort();
s->tstate = TSTATE_CLOSED; s->tstate = TSTATE_CLOSED;
} }
@@ -928,7 +963,7 @@ void httpd_appcall(void)
cont_len -= slen; cont_len -= slen;
cont_addr += slen; cont_addr += slen;
s->tstate = TSTATE_TX; s->tstate = TSTATE_TX;
} else if (fw_reset_pending) { } else if (s->fw_reset_pending) {
// The upload verdict has been fully ACKed by the client; // The upload verdict has been fully ACKed by the client;
// now it is safe to reset and apply the staged image // now it is safe to reset and apply the staged image
print_string("Resetting to apply update\n"); print_string("Resetting to apply update\n");
@@ -955,6 +990,7 @@ void httpd_appcall(void)
cont_len = 0; cont_len = 0;
dbg_char('<'); dbg_short(uip_len); dbg_char('\n'); dbg_char('<'); dbg_short(uip_len); dbg_char('\n');
__xdata uint8_t *p = uip_appdata; __xdata uint8_t *p = uip_appdata;
uint16_t body_off = 0;
// Mark end of request header with \0 // Mark end of request header with \0
p[uip_len] = 0; p[uip_len] = 0;
#ifdef DEBUG #ifdef DEBUG
@@ -963,9 +999,21 @@ void httpd_appcall(void)
dbg_char('\n'); dbg_char('\n');
#endif #endif
p = uip_appdata; p = uip_appdata;
if (is_word(p, "POST") || s->tstate == TSTATE_MULTIPART if (s->tstate != TSTATE_MULTIPART && s->tstate != TSTATE_POSTBODY) {
|| s->tstate == TSTATE_POSTBODY) { if (s->tstate != TSTATE_HEADER)
handle_post(); pre_acc = 0;
body_off = request_header_take();
if (!body_off) {
uip_len = 0;
return;
}
if (body_off == 0xffff)
goto do_send;
}
if (s->tstate == TSTATE_MULTIPART || s->tstate == TSTATE_POSTBODY
|| is_word(config_buf, "POST")) {
handle_post(body_off);
// If this is an ongoing post stream, then wait for the next packet // If this is an ongoing post stream, then wait for the next packet
if (s->tstate == TSTATE_POST || s->tstate == TSTATE_MULTIPART if (s->tstate == TSTATE_POST || s->tstate == TSTATE_MULTIPART
|| s->tstate == TSTATE_POSTBODY) { || s->tstate == TSTATE_POSTBODY) {
@@ -975,12 +1023,11 @@ void httpd_appcall(void)
goto do_send; goto do_send;
} }
// We only expect a GET request here. p = config_buf;
if (!is_word(p, "GET")) { if (!is_word(p, "GET")) {
send_bad_request(); send_bad_request();
goto do_send; goto do_send;
} }
dbg_string("GET request "); dbg_string("GET request ");
p += 4; p += 4;
scan_header(p); scan_header(p);
+1
View File
@@ -12,6 +12,7 @@
for each TCP connection. */ for each TCP connection. */
typedef struct httpd_state { typedef struct httpd_state {
uint8_t tstate; uint8_t tstate;
uint8_t fw_reset_pending;
} uip_tcp_appstate_t; } uip_tcp_appstate_t;
/* Finally we define the application function to be called by uIP. */ /* Finally we define the application function to be called by uIP. */
+18 -18
View File
@@ -341,7 +341,7 @@ void send_vlan(uint16_t vlan)
} }
slen += strtox(outbuf + slen, "\",\"pvid\":\"0x"); slen += strtox(outbuf + slen, "\",\"pvid\":\"0x");
uint16_t pvid_mask = 0; uint16_t pvid_mask = 0;
for (uint8_t i = machine.min_port; i <= machine.max_port; i++) { for (uint8_t i = MACHINE_MIN_PORT; i <= MACHINE_MAX_PORT; i++) {
if (port_pvid_get(i) == vlan) if (port_pvid_get(i) == vlan)
pvid_mask |= (1 << i); pvid_mask |= (1 << i);
} }
@@ -357,7 +357,7 @@ void send_vlan(uint16_t vlan)
bool send_counters(uint8_t phys_port) bool send_counters(uint8_t phys_port)
{ {
uint8_t phys_port_idx = phys_port - 1; uint8_t phys_port_idx = phys_port - 1;
if (phys_port_idx > (machine.max_port - machine.min_port)) if (phys_port_idx > (MACHINE_MAX_PORT - MACHINE_MIN_PORT))
goto err; goto err;
uint8_t log_port = machine.phys_to_log_port[phys_port_idx]; uint8_t log_port = machine.phys_to_log_port[phys_port_idx];
@@ -676,7 +676,7 @@ void send_stp(void)
slen += strtox(outbuf + slen, "\",\"ports\":["); slen += strtox(outbuf + slen, "\",\"ports\":[");
reg_read_m(RTL837X_MSTP_STATES); reg_read_m(RTL837X_MSTP_STATES);
for (i = 0; i < STP_ENTITIES; i++) { for (i = 0; i < STP_ENTITIES; i++) {
if (i < STP_LAG_BASE && (i < machine.min_port || i > machine.max_port)) if (i < STP_LAG_BASE && !MACHINE_PORT_VALID(i))
continue; continue;
if (i < STP_LAG_BASE && stp_ent_of[i] != i) if (i < STP_LAG_BASE && stp_ent_of[i] != i)
continue; continue;
@@ -761,7 +761,7 @@ void send_lacp(void)
} }
slen -= 1; // remove comma slen -= 1; // remove comma
slen += strtox(outbuf + slen, "],\"ports\":["); slen += strtox(outbuf + slen, "],\"ports\":[");
for (uint8_t i = machine.min_port; i <= machine.max_port; i++) { for (uint8_t i = MACHINE_MIN_PORT; i <= MACHINE_MAX_PORT; i++) {
slen += strtox(outbuf + slen, "{\"p\":"); slen += strtox(outbuf + slen, "{\"p\":");
itoa_html(machine.log_to_phys_port[i]); itoa_html(machine.log_to_phys_port[i]);
slen += strtox(outbuf + slen, ",\"lag\":"); slen += strtox(outbuf + slen, ",\"lag\":");
@@ -793,7 +793,7 @@ void send_lldp(void)
bool_to_html(lldp_enabled); bool_to_html(lldp_enabled);
slen += strtox(outbuf + slen, ",\"portStatus\":["); slen += strtox(outbuf + slen, ",\"portStatus\":[");
for (uint8_t i = machine.min_port; i <= machine.max_port; i++) { for (uint8_t i = MACHINE_MIN_PORT; i <= MACHINE_MAX_PORT; i++) {
slen += strtox(outbuf + slen, "{\"portNum\":"); slen += strtox(outbuf + slen, "{\"portNum\":");
itoa_html(machine.log_to_phys_port[i]); itoa_html(machine.log_to_phys_port[i]);
@@ -808,7 +808,7 @@ void send_lldp(void)
bool_to_html(1 & (lldp_logical_port_status >> i)); bool_to_html(1 & (lldp_logical_port_status >> i));
slen += strtox(outbuf + slen, "}"); slen += strtox(outbuf + slen, "}");
if (i < machine.max_port) if (i < MACHINE_MAX_PORT)
char_to_html(','); char_to_html(',');
else else
char_to_html(']'); char_to_html(']');
@@ -825,7 +825,7 @@ void send_eee(void)
uint8_t eee_ablty = sfr_data[3]; uint8_t eee_ablty = sfr_data[3];
char_to_html('['); char_to_html('[');
for (uint8_t i = machine.min_port; i <= machine.max_port; i++) { for (uint8_t i = MACHINE_MIN_PORT; i <= MACHINE_MAX_PORT; i++) {
slen += strtox(outbuf + slen, "{\"portNum\":"); slen += strtox(outbuf + slen, "{\"portNum\":");
itoa_html(machine.log_to_phys_port[i]); itoa_html(machine.log_to_phys_port[i]);
@@ -857,7 +857,7 @@ void send_eee(void)
bool_to_html(eee_ablty & (1 << i)); bool_to_html(eee_ablty & (1 << i));
} }
char_to_html('}'); char_to_html('}');
if (i < machine.max_port) if (i < MACHINE_MAX_PORT)
char_to_html(','); char_to_html(',');
else else
char_to_html(']'); char_to_html(']');
@@ -870,7 +870,7 @@ void send_bandwidth(void)
dbg_string("send_bandwidth called\n"); dbg_string("send_bandwidth called\n");
slen = strtox(outbuf, HTTP_RESPONCE_JSON); slen = strtox(outbuf, HTTP_RESPONCE_JSON);
char_to_html('['); char_to_html('[');
for (uint8_t i = machine.min_port; i <= machine.max_port; i++) { for (uint8_t i = MACHINE_MIN_PORT; i <= MACHINE_MAX_PORT; i++) {
slen += strtox(outbuf + slen, "{\"portNum\":"); slen += strtox(outbuf + slen, "{\"portNum\":");
itoa_html(machine.log_to_phys_port[i]); itoa_html(machine.log_to_phys_port[i]);
slen += strtox(outbuf + slen, ",\"iLimited\":"); slen += strtox(outbuf + slen, ",\"iLimited\":");
@@ -900,7 +900,7 @@ void send_bandwidth(void)
byte_to_html(sfr_data[3]); byte_to_html(sfr_data[3]);
char_to_html('"'); char_to_html('"');
char_to_html('}'); char_to_html('}');
if (i < machine.max_port) if (i < MACHINE_MAX_PORT)
char_to_html(','); char_to_html(',');
else else
char_to_html(']'); char_to_html(']');
@@ -914,7 +914,7 @@ void send_storm(void)
slen = strtox(outbuf, HTTP_RESPONCE_JSON); slen = strtox(outbuf, HTTP_RESPONCE_JSON);
char_to_html('['); char_to_html('[');
for (i = machine.min_port; i <= machine.max_port; i++) { for (i = MACHINE_MIN_PORT; i <= MACHINE_MAX_PORT; i++) {
slen += strtox(outbuf + slen, "{\"portNum\":"); slen += strtox(outbuf + slen, "{\"portNum\":");
itoa_html(machine.log_to_phys_port[i]); itoa_html(machine.log_to_phys_port[i]);
slen += strtox(outbuf + slen, ",\"en\":\""); slen += strtox(outbuf + slen, ",\"en\":\"");
@@ -934,7 +934,7 @@ void send_storm(void)
} }
char_to_html('"'); char_to_html('"');
char_to_html('}'); char_to_html('}');
if (i < machine.max_port) if (i < MACHINE_MAX_PORT)
char_to_html(','); char_to_html(',');
else else
char_to_html(']'); char_to_html(']');
@@ -949,7 +949,7 @@ void send_isolation(void)
dbg_string("send_isolation called\n"); dbg_string("send_isolation called\n");
slen = strtox(outbuf, HTTP_RESPONCE_JSON); slen = strtox(outbuf, HTTP_RESPONCE_JSON);
char_to_html('['); char_to_html('[');
for (uint8_t i = machine.min_port; i <= machine.max_port; i++) { for (uint8_t i = MACHINE_MIN_PORT; i <= MACHINE_MAX_PORT; i++) {
slen += strtox(outbuf + slen, "{\"portNum\":"); slen += strtox(outbuf + slen, "{\"portNum\":");
itoa_html(machine.log_to_phys_port[i]); itoa_html(machine.log_to_phys_port[i]);
slen += strtox(outbuf + slen, ",\"allow\":\""); slen += strtox(outbuf + slen, ",\"allow\":\"");
@@ -958,7 +958,7 @@ void send_isolation(void)
byte_to_html(allow & 0xff); byte_to_html(allow & 0xff);
char_to_html('"'); char_to_html('"');
char_to_html('}'); char_to_html('}');
if (i < machine.max_port) if (i < MACHINE_MAX_PORT)
char_to_html(','); char_to_html(',');
} }
char_to_html(']'); char_to_html(']');
@@ -970,7 +970,7 @@ void send_mtu(void)
dbg_string("send_mtu called\n"); dbg_string("send_mtu called\n");
slen = strtox(outbuf, HTTP_RESPONCE_JSON); slen = strtox(outbuf, HTTP_RESPONCE_JSON);
char_to_html('['); char_to_html('[');
for (uint8_t i = machine.min_port; i <= machine.max_port; i++) { for (uint8_t i = MACHINE_MIN_PORT; i <= MACHINE_MAX_PORT; i++) {
slen += strtox(outbuf + slen, "{\"portNum\":"); slen += strtox(outbuf + slen, "{\"portNum\":");
itoa_html(machine.log_to_phys_port[i]); itoa_html(machine.log_to_phys_port[i]);
slen += strtox(outbuf + slen, ",\"mtu\":\"0x"); slen += strtox(outbuf + slen, ",\"mtu\":\"0x");
@@ -980,7 +980,7 @@ void send_mtu(void)
byte_to_html(mtu & 0xff); byte_to_html(mtu & 0xff);
char_to_html('"'); char_to_html('"');
char_to_html('}'); char_to_html('}');
if (i < machine.max_port) if (i < MACHINE_MAX_PORT)
char_to_html(','); char_to_html(',');
else else
char_to_html(']'); char_to_html(']');
@@ -994,7 +994,7 @@ void send_status(void)
dbg_string("sending status\n"); dbg_string("sending status\n");
char_to_html('['); char_to_html('[');
for (uint8_t i = machine.min_port; i <= machine.max_port; i++) { for (uint8_t i = MACHINE_MIN_PORT; i <= MACHINE_MAX_PORT; i++) {
slen += strtox(outbuf + slen, "{\"portNum\":"); slen += strtox(outbuf + slen, "{\"portNum\":");
itoa_html(machine.log_to_phys_port[i]); itoa_html(machine.log_to_phys_port[i]);
slen += strtox(outbuf + slen, ",\"logPort\":"); slen += strtox(outbuf + slen, ",\"logPort\":");
@@ -1115,7 +1115,7 @@ void send_status(void)
slen += strtox(outbuf + slen, "\",\"macs\":\"0x"); slen += strtox(outbuf + slen, "\",\"macs\":\"0x");
reg_to_html(RTL837X_L2_LRN_PORT_CONSTRT_CNT + (i << 2)); reg_to_html(RTL837X_L2_LRN_PORT_CONSTRT_CNT + (i << 2));
slen += strtox(outbuf + slen, "\"}"); slen += strtox(outbuf + slen, "\"}");
if (i < machine.max_port) if (i < MACHINE_MAX_PORT)
char_to_html(','); char_to_html(',');
else else
char_to_html(']'); char_to_html(']');
+43 -4
View File
@@ -15,8 +15,51 @@
#define MACHINE_INC(dir,file) MACHINE_STR(dir/file) #define MACHINE_INC(dir,file) MACHINE_STR(dir/file)
#define RTL8370 0x70
#define RTL8372 0x72
#define RTL8373 0x73
#include MACHINE_INC(MACHINE_DEF_DIR,MACHINE_NAME.h) #include MACHINE_INC(MACHINE_DEF_DIR,MACHINE_NAME.h)
#ifndef MACHINE_CHIPSET
#error "MACHINE_CHIPSET shall be defined in <machine>.h file"
#endif
#ifndef MACHINE_MIN_PORT
#if MACHINE_CHIPSET == RTL8372
#define MACHINE_MIN_PORT 3
#else
#define MACHINE_MIN_PORT 0
#endif
#endif
#ifndef MACHINE_MAX_PORT
#if MACHINE_CHIPSET == RTL8370
#define MACHINE_MAX_PORT 7
#else
#define MACHINE_MAX_PORT 8
#endif
#endif
#define MACHINE_PORT_VALID(p) \
((uint8_t)((p) - MACHINE_MIN_PORT) <= (MACHINE_MAX_PORT - MACHINE_MIN_PORT))
// auto derive SOC_FAMILY
#define RTL836X 6
#define RTL837X 7
#ifdef SOC_FAMILY
#error "SOC_FAMILY can not be manually defined, shall be auto derived"
#endif
#if (MACHINE_CHIPSET == RTL8372) || (MACHINE_CHIPSET == RTL8373)
#define SOC_FAMILY RTL837X
#elif (MACHINE_CHIPSET == RTL8370 )
#define SOC_FAMILY RTL836X
#else
#error "Unsupported MACHINE_CHIPSET is specified!"
#endif
#define LED_27 1 #define LED_27 1
// SYSTEM LED // SYSTEM LED
#define LED_28_SYS 2 #define LED_28_SYS 2
@@ -41,10 +84,6 @@ struct sfp_port
struct machine { struct machine {
char machine_name[30]; char machine_name[30];
uint8_t isRTL8373; uint8_t isRTL8373;
// Lowest logical port number
uint8_t min_port;
// Highest logical port number
uint8_t max_port;
uint8_t n_sfp; uint8_t n_sfp;
uint8_t n_10g; uint8_t n_10g;
uint8_t log_to_phys_port[9]; uint8_t log_to_phys_port[9];
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_2G08110GSN_H_ #define _MACHINE_2G08110GSN_H_
#define MACHINE_MODEL "MokerLink 2G08110GSN" #define MACHINE_MODEL "MokerLink 2G08110GSN"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+3 -6
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 2, .n_sfp = 2,
/* Same 2M-PCB43-V1.1 board family as the KP-9000-6XH-X2 (see /* Same 2M-PCB43-V1.1 board family as the KP-9000-6XH-X2 (see
* machine/KP_9000_6XHML_X2.c), but the two SFP+ cages (physical ports 5 and * machine/KP_9000_6XHML_X2.c), but the two SFP+ cages (physical ports 5 and
@@ -44,8 +41,8 @@ __code const struct machine machine = {
* at 2.5G only) and LED-ID2 carries the SFP single LED. The "solid" * at 2.5G only) and LED-ID2 carries the SFP single LED. The "solid"
* conditions (LINK/speed) barely drive the LEDs here and ACT is what * conditions (LINK/speed) barely drive the LEDs here and ACT is what
* actually lights them, which is why the white LED used to glow faintly at * actually lights them, which is why the white LED used to glow faintly at
* non-2.5G speeds; the fix for that is LED_GLB_IO_EN bit 6, set in * non-2.5G speeds; the fix for that is LED_GLB_IO_EN bit 6, set in the
* machine_init.c. */ * shared machine_custom_init() hook (machine/2G5F4_10G2_V1_01_init.c). */
.led_sets = { { LEDS_2G5 | LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK | LEDS_ACT | LEDS_10G, .led_sets = { { LEDS_2G5 | LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK | LEDS_ACT | LEDS_10G,
LEDS_2G5 | LEDS_LINK | LEDS_10G, LEDS_2G5 | LEDS_LINK | LEDS_10G,
LEDS_1G | LEDS_LINK, LEDS_1G | LEDS_LINK,
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_2G5F4_10G2_V1_01_H_ #define _MACHINE_2G5F4_10G2_V1_01_H_
#define MACHINE_MODEL "2G5F4_10G2_V1.01 / SGT0204S" #define MACHINE_MODEL "2G5F4_10G2_V1.01 / SGT0204S"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1
View File
@@ -0,0 +1 @@
KP_9000_6XH_X2_init.c
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_DEFAULT_8C_1SFP_H_ #define _MACHINE_DEFAULT_8C_1SFP_H_
#define MACHINE_MODEL "8+1 SFP Port Switch" #define MACHINE_MODEL "8+1 SFP Port Switch"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 1,
.min_port = 0,
.max_port = 8,
.n_sfp = 1, .n_sfp = 1,
.log_to_phys_port = {1, 2, 3, 4, 5, 6, 7, 8, 9}, .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}, .phys_to_log_port = {0, 1, 2, 3, 4, 5, 6, 7, 8},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_F7008_2_5_H_ #define _MACHINE_F7008_2_5_H_
#define MACHINE_MODEL "F7008-2.5 8+1 SFP Port Switch" #define MACHINE_MODEL "F7008-2.5 8+1 SFP Port Switch"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 2, .n_sfp = 2,
.log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5}, .log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5},
.phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0}, .phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_FG_4GT_2SX_V2_0_H_ #define _MACHINE_FG_4GT_2SX_V2_0_H_
#define MACHINE_MODEL "FG-4GT-2SX_V2.0" #define MACHINE_MODEL "FG-4GT-2SX_V2.0"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+6
View File
@@ -0,0 +1,6 @@
#include "machine_init_defs.h"
void machine_custom_init(void) __banked
{
REG_SET(RTL837X_REG_LED_GLB_IO_EN, 0x7624155b);
}
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 1,
.min_port = 0,
.max_port = 8,
.n_sfp = 1, .n_sfp = 1,
.log_to_phys_port = {1, 2, 3, 4, 5, 6, 7, 8, 9}, .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}, .phys_to_log_port = {0, 1, 2, 3, 4, 5, 6, 7, 8},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_FG_8GT_1SX_H_ #define _MACHINE_FG_8GT_1SX_H_
#define MACHINE_MODEL "FG-8GT-1SX" #define MACHINE_MODEL "FG-8GT-1SX"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_FNS1200P_H_ #define _MACHINE_FNS1200P_H_
#define MACHINE_MODEL "FNS-1200P" #define MACHINE_MODEL "FNS-1200P"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1
View File
@@ -0,0 +1 @@
KP_9000_6XH_X2_init.c
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_GT_ST018M_H_ #define _MACHINE_GT_ST018M_H_
#define MACHINE_MODEL "GoodTop GT-ST018M" #define MACHINE_MODEL "GoodTop GT-ST018M"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_GT_ST024M_H_ #define _MACHINE_GT_ST024M_H_
#define MACHINE_MODEL "GoodTop GT-ST024M" #define MACHINE_MODEL "GoodTop GT-ST024M"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1 -4
View File
@@ -1,11 +1,8 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 1,
.mac_flash_offset = 0x1FC000, .mac_flash_offset = 0x1FC000,
.min_port = 0,
.max_port = 8,
.n_sfp = 1, .n_sfp = 1,
.log_to_phys_port = {1, 2, 3, 4, 5, 6, 7, 8, 9}, .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}, .phys_to_log_port = {0, 1, 2, 3, 4, 5, 6, 7, 8},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_HASIVO_S1100P_8GT_1SX_S_H_ #define _MACHINE_HASIVO_S1100P_8GT_1SX_S_H_
#define MACHINE_MODEL "Hasivo S1100P-8GT-1SX-S" #define MACHINE_MODEL "Hasivo S1100P-8GT-1SX-S"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_HASIVO_S1100WP_8GT_1SX_SE_H_ #define _MACHINE_HASIVO_S1100WP_8GT_1SX_SE_H_
#define MACHINE_MODEL "Hasivo S1100WP-8GT-1SX-SE" #define MACHINE_MODEL "Hasivo S1100WP-8GT-1SX-SE"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 0, .n_sfp = 0,
.n_10g = 2, .n_10g = 2,
.log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6}, .log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_HASIVO_S600W_4GT_2XGT_SE_H_ #define _MACHINE_HASIVO_S600W_4GT_2XGT_SE_H_
#define MACHINE_MODEL "Hasivo S600W-4GT-2XGT-SE" #define MACHINE_MODEL "Hasivo S600W-4GT-2XGT-SE"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_HC_SWTG124AS_H_ #define _MACHINE_HC_SWTG124AS_H_
#define MACHINE_MODEL "Horaco HC-SWTG124AS" #define MACHINE_MODEL "Horaco HC-SWTG124AS"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 2, .n_sfp = 2,
.log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6}, .log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6},
.phys_to_log_port = {4, 5, 6, 7, 3, 8, 0, 0, 0}, .phys_to_log_port = {4, 5, 6, 7, 3, 8, 0, 0, 0},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_HG0402XG_V1_1_H_ #define _MACHINE_HG0402XG_V1_1_H_
#define MACHINE_MODEL "HG0402XG V1.1" #define MACHINE_MODEL "HG0402XG V1.1"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 2, .n_sfp = 2,
.log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5}, .log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5},
.phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0}, .phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_HI_K0402WS_H_ #define _MACHINE_HI_K0402WS_H_
#define MACHINE_MODEL "PCB-K0402WS-V3.0" #define MACHINE_MODEL "PCB-K0402WS-V3.0"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1
View File
@@ -0,0 +1 @@
KP_9000_6XH_X2_init.c
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 1,
.min_port = 0,
.max_port = 8,
.n_sfp = 1, .n_sfp = 1,
.log_to_phys_port = {1, 2, 3, 4, 5, 6, 7, 8, 9}, .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}, .phys_to_log_port = {0, 1, 2, 3, 4, 5, 6, 7, 8},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_HI_K0801WS_H_ #define _MACHINE_HI_K0801WS_H_
#define MACHINE_MODEL "Hi-Source HI-k0801WS" #define MACHINE_MODEL "Hi-Source HI-k0801WS"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 1, .n_sfp = 1,
.log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6}, .log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6},
.phys_to_log_port = {4, 5, 6, 7, 3, 8, 0, 0, 0}, .phys_to_log_port = {4, 5, 6, 7, 3, 8, 0, 0, 0},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_K0501W_V2_0_H_ #define _MACHINE_K0501W_V2_0_H_
#define MACHINE_MODEL "K0501W V2.0" #define MACHINE_MODEL "K0501W V2.0"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 2, .n_sfp = 2,
.log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6}, .log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6},
.phys_to_log_port = {4, 5, 6, 7, 3, 8, 0, 0, 0}, .phys_to_log_port = {4, 5, 6, 7, 3, 8, 0, 0, 0},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_KP_9000_6XHML_X2_H_ #define _MACHINE_KP_9000_6XHML_X2_H_
#define MACHINE_MODEL "keepLink KP-9000-6XHML-X2" #define MACHINE_MODEL "keepLink KP-9000-6XHML-X2"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_KP_9000_6XHML_X2_V1_1_H_ #define _MACHINE_KP_9000_6XHML_X2_V1_1_H_
#define MACHINE_MODEL "keepLink KP-9000-6XHML V1.1" #define MACHINE_MODEL "keepLink KP-9000-6XHML V1.1"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_KP_9000_6XHML_X2_V1_2_H_ #define _MACHINE_KP_9000_6XHML_X2_V1_2_H_
#define MACHINE_MODEL "keepLink KP-9000-6XHML V1.2" #define MACHINE_MODEL "keepLink KP-9000-6XHML V1.2"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_KP_9000_6XHML_X2_V2_1_H_ #define _MACHINE_KP_9000_6XHML_X2_V2_1_H_
#define MACHINE_MODEL "keepLink KP-9000-6XHML V2.1" #define MACHINE_MODEL "keepLink KP-9000-6XHML V2.1"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1
View File
@@ -0,0 +1 @@
KP_9000_6XH_X2_init.c
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 1, .n_sfp = 1,
.log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6}, .log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6},
.phys_to_log_port = {4, 5, 6, 7, 3, 8, 0, 0, 0}, .phys_to_log_port = {4, 5, 6, 7, 3, 8, 0, 0, 0},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_KP_9000_6XH_X_H_ #define _MACHINE_KP_9000_6XH_X_H_
#define MACHINE_MODEL "keepLink KP-9000-6XH-X" #define MACHINE_MODEL "keepLink KP-9000-6XH-X"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 2, .n_sfp = 2,
.log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5}, .log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5},
.phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0}, .phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_KP_9000_6XH_X2_H_ #define _MACHINE_KP_9000_6XH_X2_H_
#define MACHINE_MODEL "keepLink KP-9000-6XH-X2" #define MACHINE_MODEL "keepLink KP-9000-6XH-X2"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_KP_9000_6XH_X2_V1_1_H_ #define _MACHINE_KP_9000_6XH_X2_V1_1_H_
#define MACHINE_MODEL "keepLink KP-9000-6XH V1.1" #define MACHINE_MODEL "keepLink KP-9000-6XH V1.1"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_KP_9000_6XH_X2_V1_2_H_ #define _MACHINE_KP_9000_6XH_X2_V1_2_H_
#define MACHINE_MODEL "keepLink KP-9000-6XH V1.2" #define MACHINE_MODEL "keepLink KP-9000-6XH V1.2"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_KP_9000_6XH_X2_V2_1_H_ #define _MACHINE_KP_9000_6XH_X2_V2_1_H_
#define MACHINE_MODEL "keepLink KP-9000-6XH-X2 V2.1" #define MACHINE_MODEL "keepLink KP-9000-6XH-X2 V2.1"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1
View File
@@ -0,0 +1 @@
KP_9000_6XH_X2_init.c
+6
View File
@@ -0,0 +1,6 @@
#include "machine_init_defs.h"
void machine_custom_init(void) __banked
{
reg_bit_set(RTL837X_REG_LED_GLB_IO_EN, 6);
}
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 1,
.min_port = 0,
.max_port = 8,
.n_sfp = 1, .n_sfp = 1,
.log_to_phys_port = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }, .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 }, .phys_to_log_port = { 0, 1, 2, 3, 4, 5, 6, 7, 8 },
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_KP_9000_9XHML_X_V2_2_H_ #define _MACHINE_KP_9000_9XHML_X_V2_2_H_
#define MACHINE_MODEL "keepLink KP-9000-9XHML-X V2.2" #define MACHINE_MODEL "keepLink KP-9000-9XHML-X V2.2"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+1 -4
View File
@@ -2,10 +2,7 @@
// 2M-PCB23-V3.2 is wired like V3.1 (SFP detection, LEDs, factory MAC location) // 2M-PCB23-V3.2 is wired like V3.1 (SFP detection, LEDs, factory MAC location)
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 1,
.min_port = 0,
.max_port = 8,
.n_sfp = 1, .n_sfp = 1,
.log_to_phys_port = {1, 2, 3, 4, 5, 6, 7, 8, 9}, .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}, .phys_to_log_port = {0, 1, 2, 3, 4, 5, 6, 7, 8},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_KP_9000_9XHML_X_V3_1_H_ #define _MACHINE_KP_9000_9XHML_X_V3_1_H_
#define MACHINE_MODEL "keepLink KP-9000-9XHML-X V3.1" #define MACHINE_MODEL "keepLink KP-9000-9XHML-X V3.1"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_KP_9000_9XHML_X_V3_2_H_ #define _MACHINE_KP_9000_9XHML_X_V3_2_H_
#define MACHINE_MODEL "keepLink KP-9000-9XHML-X V3.2" #define MACHINE_MODEL "keepLink KP-9000-9XHML-X V3.2"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 1,
.min_port = 0,
.max_port = 8,
.n_sfp = 1, .n_sfp = 1,
.log_to_phys_port = {1, 2, 3, 4, 5, 6, 7, 8, 9}, .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}, .phys_to_log_port = {0, 1, 2, 3, 4, 5, 6, 7, 8},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_KP_9000_9XH_X_EU_H_ #define _MACHINE_KP_9000_9XH_X_EU_H_
#define MACHINE_MODEL "keepLink KP-9000-9XH-X-EU" #define MACHINE_MODEL "keepLink KP-9000-9XH-X-EU"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 1,
.min_port = 0,
.max_port = 8,
.n_sfp = 1, .n_sfp = 1,
.log_to_phys_port = {2, 1, 4, 3, 5, 6, 7, 8, 9}, .log_to_phys_port = {2, 1, 4, 3, 5, 6, 7, 8, 9},
.phys_to_log_port = {1, 0, 3, 2, 4, 5, 6, 7, 8}, .phys_to_log_port = {1, 0, 3, 2, 4, 5, 6, 7, 8},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_LIANGUO_HYWS_SGT0108S_H_ #define _MACHINE_LIANGUO_HYWS_SGT0108S_H_
#define MACHINE_MODEL "Lianguo HYWS-SGT0108S" #define MACHINE_MODEL "Lianguo HYWS-SGT0108S"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+1 -4
View File
@@ -1,11 +1,8 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.mac_flash_offset = 0x1FC000, .mac_flash_offset = 0x1FC000,
.min_port = 3,
.max_port = 8,
.n_sfp = 1, .n_sfp = 1,
.log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6}, .log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6},
.phys_to_log_port = {4, 5, 6, 7, 3, 8, 0, 0, 0}, .phys_to_log_port = {4, 5, 6, 7, 3, 8, 0, 0, 0},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_LIANGUO_ZX_SWTGW215AS_H_ #define _MACHINE_LIANGUO_ZX_SWTGW215AS_H_
#define MACHINE_MODEL "Lianguo ZX-SWTGW215AS" #define MACHINE_MODEL "Lianguo ZX-SWTGW215AS"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 2, .n_sfp = 2,
.log_to_phys_port = {0, 0, 0, 5, 4, 3, 2, 1, 6}, .log_to_phys_port = {0, 0, 0, 5, 4, 3, 2, 1, 6},
.phys_to_log_port = {7, 6, 5, 4, 3, 8, 0, 0, 0}, .phys_to_log_port = {7, 6, 5, 4, 3, 8, 0, 0, 0},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_ONT_S207CW_62TS_SE_H_ #define _MACHINE_ONT_S207CW_62TS_SE_H_
#define MACHINE_MODEL "ONT-S207CW-62TS-SE / Binardat 2G06-04210GSM / Binardat 2G06-04210GS" #define MACHINE_MODEL "ONT-S207CW-62TS-SE / Binardat 2G06-04210GSM / Binardat 2G06-04210GS"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 1,
.min_port = 0,
.max_port = 8,
.n_sfp = 1, .n_sfp = 1,
.log_to_phys_port = {1, 2, 3, 4, 5, 6, 7, 8, 9}, .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}, .phys_to_log_port = {0, 1, 2, 3, 4, 5, 6, 7, 8},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_PB_2132_H_ #define _MACHINE_PB_2132_H_
#define MACHINE_MODEL "PB-2132" #define MACHINE_MODEL "PB-2132"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 2, .n_sfp = 2,
.log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5}, .log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5},
.phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0}, .phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_PCB_K0402WS_V1_H_ #define _MACHINE_PCB_K0402WS_V1_H_
#define MACHINE_MODEL "PCB-K0402WS-V1.0" #define MACHINE_MODEL "PCB-K0402WS-V1.0"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 2, .n_sfp = 2,
.log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5}, .log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5},
.phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0}, .phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_PCB_K0402WS_V2_H_ #define _MACHINE_PCB_K0402WS_V2_H_
#define MACHINE_MODEL "PCB-K0402WS-V2.0" #define MACHINE_MODEL "PCB-K0402WS-V2.0"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1
View File
@@ -0,0 +1 @@
KP_9000_6XH_X2_init.c
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_PCB_K0402WS_V3_H_ #define _MACHINE_PCB_K0402WS_V3_H_
#define MACHINE_MODEL "PCB-K0402WS-V3.0" #define MACHINE_MODEL "PCB-K0402WS-V3.0"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1
View File
@@ -0,0 +1 @@
KP_9000_6XH_X2_init.c
+1 -4
View File
@@ -2,11 +2,8 @@
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 1,
.mac_flash_offset = 0x1FC000, .mac_flash_offset = 0x1FC000,
.min_port = 0,
.max_port = 8,
.n_sfp = 1, .n_sfp = 1,
.log_to_phys_port = {1, 2, 3, 4, 5, 6, 7, 8, 9}, .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}, .phys_to_log_port = {0, 1, 2, 3, 4, 5, 6, 7, 8},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_PCB_SWTG018AS_V2_1_0_H_ #define _MACHINE_PCB_SWTG018AS_V2_1_0_H_
#define MACHINE_MODEL "SWTGW218AS (SWTG018AS-V2.1.0)" #define MACHINE_MODEL "SWTGW218AS (SWTG018AS-V2.1.0)"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+18
View File
@@ -0,0 +1,18 @@
#include "machine_init_defs.h"
static __code const struct { uint16_t reg; uint32_t val; } custom_init_regs[] = {
{ RTL837X_REG_LED3_0_SET1, 0x00100000UL },
{ RTL837X_REG_LED1_0_SET1, 0x01400155UL },
{ RTL837X_REG_LED1_0_SET0, 0x01740141UL },
{ RTL837X_REG_LED_GLB_IO_EN, 0x7f24977fUL },
{ RTL837X_PIN_MUX_0, 0x20db6880UL },
};
void machine_custom_init(void) __banked
{
uint8_t i;
// REG_SET is a multi-statement macro without a do-while wrapper: braces required
for (i = 0; i < sizeof(custom_init_regs) / sizeof(custom_init_regs[0]); i++) {
REG_SET(custom_init_regs[i].reg, custom_init_regs[i].val);
}
}
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 2, .n_sfp = 2,
.log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6}, .log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6},
.phys_to_log_port = {4, 5, 6, 7, 3, 8, 0, 0, 0}, .phys_to_log_port = {4, 5, 6, 7, 3, 8, 0, 0, 0},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_PCB_SWTG024AS_A_2_0_1_H_ #define _MACHINE_PCB_SWTG024AS_A_2_0_1_H_
#define MACHINE_MODEL "PCB-SWTG024AS-A-2.0.1" #define MACHINE_MODEL "PCB-SWTG024AS-A-2.0.1"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+9
View File
@@ -0,0 +1,9 @@
#include "machine_init_defs.h"
void machine_custom_init(void) __banked
{
reg_bit_set(RTL837X_REG_LED_GLB_IO_EN, 6);
reg_bit_set(RTL837X_REG_LED_MODE, 17);
reg_bit_clear(RTL837X_REG_LED_MODE, 9);
reg_bit_clear(RTL837X_REG_LED_MODE, 7);
}
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 1,
.min_port = 0,
.max_port = 8,
.n_sfp = 1, .n_sfp = 1,
.log_to_phys_port = {1, 2, 3, 4, 5, 6, 7, 8, 9}, .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}, .phys_to_log_port = {0, 1, 2, 3, 4, 5, 6, 7, 8},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_POE_2G080110GS_H_ #define _MACHINE_POE_2G080110GS_H_
#define MACHINE_MODEL "MokerLink POE-2G080110GS" #define MACHINE_MODEL "MokerLink POE-2G080110GS"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 2, .n_sfp = 2,
.log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5}, .log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5},
.phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0}, .phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_SIRIVISION_S25G2206FP_V1_1_H_ #define _MACHINE_SIRIVISION_S25G2206FP_V1_1_H_
#define MACHINE_MODEL "SIRIVISION S25G2206FP V1.1" #define MACHINE_MODEL "SIRIVISION S25G2206FP V1.1"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1
View File
@@ -2,6 +2,7 @@
#define _MACHINE_SKS3200_8E1X_H_ #define _MACHINE_SKS3200_8E1X_H_
#define MACHINE_MODEL "XikeStor SKS3200-8E1X" #define MACHINE_MODEL "XikeStor SKS3200-8E1X"
#define MACHINE_CHIPSET RTL8373
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 2, .n_sfp = 2,
.log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5}, .log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5},
.phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0}, .phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_STEAMEMO_IG204_V1_H_ #define _MACHINE_STEAMEMO_IG204_V1_H_
#define MACHINE_MODEL "Steamemo IG204 V1" #define MACHINE_MODEL "Steamemo IG204 V1"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 2, .n_sfp = 2,
.log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5}, .log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5},
.phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0}, .phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_SWGT024_V2_0_MANAGED_H_ #define _MACHINE_SWGT024_V2_0_MANAGED_H_
#define MACHINE_MODEL "SWGT024 V2.0 Managed" #define MACHINE_MODEL "SWGT024 V2.0 Managed"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 0,
.min_port = 3,
.max_port = 8,
.n_sfp = 2, .n_sfp = 2,
.log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5}, .log_to_phys_port = {0, 0, 0, 6, 1, 2, 3, 4, 5},
.phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0}, .phys_to_log_port = {4, 5, 6, 7, 8, 3, 0, 0, 0},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_SWGT024_V2_0_UNMANAGED_H_ #define _MACHINE_SWGT024_V2_0_UNMANAGED_H_
#define MACHINE_MODEL "SWGT024 V2.0 Unmanaged" #define MACHINE_MODEL "SWGT024 V2.0 Unmanaged"
#define MACHINE_CHIPSET RTL8372
#endif #endif
+1 -4
View File
@@ -1,10 +1,7 @@
#include "machine_defs.h" #include "machine_defs.h"
__code const struct machine machine = { __code const struct machine machine = {
.machine_name = MACHINE_MODEL, MACHINE_COMMON_SETTING,
.isRTL8373 = 1,
.min_port = 0,
.max_port = 8,
.n_sfp = 1, .n_sfp = 1,
.log_to_phys_port = {1, 2, 3, 4, 5, 6, 7, 8, 9}, .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}, .phys_to_log_port = {0, 1, 2, 3, 4, 5, 6, 7, 8},
+1
View File
@@ -2,5 +2,6 @@
#define _MACHINE_SWTG018AS_A_V_2_0_H_ #define _MACHINE_SWTG018AS_A_V_2_0_H_
#define MACHINE_MODEL "SWTG018AS-A V2.0" #define MACHINE_MODEL "SWTG018AS-A V2.0"
#define MACHINE_CHIPSET RTL8373
#endif #endif
Loaded 100 of 137 files, more files were not shown because too many files have changed in this diff. Show more