mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
Move the boot and SerDes setup out of the common area into BANK3
The common segment is the scarce one: sixteen kilobytes shared by every bank, and before this it had about 2.5 kB left. Most of what moves here runs once at startup and does not have to sit in it. The two SerDes helpers are the exception: the link-change handler and the SFP polling both reach sds_config() while the switch is running, so they are not startup-only. None of it is reached from an interrupt. boot.c takes setup_i2c, init_smi, nic_setup, rtl8373_revision, rtl8224_enable, early_boot_handle_button, set_hostname_default and the two SerDes helpers. BANK3 is enabled with the linker flag; nothing else in the build needed changing. Everything moved is declared __banked, since every caller is outside BANK3: main() and friends run from the common area and rtl837x_init.c calls sds_config() and sds_config_mac() from BANK2. The calls the moved code makes outward were already banked, so that side needed no work. Common segment 13393 -> 10137 bytes, leaving 5787 free rather than 2531. BANK3 holds 3732. All 34 machines in machine.h build and link. Walking the generated assembly for plain lcalls that cross a bank boundary finds none among 2808 calls; those build cleanly and only fail at run time, so it seemed worth checking by machine rather than by eye.
This commit is contained in:
1 parent
f49ca0d6fe
commit
7fa26e0ae3
6 files changed
+498
-442
No files matched your search
@@ -59,6 +59,7 @@ SRCS = \
|
||||
dhcp.c \
|
||||
html_data.c \
|
||||
rtlplayground.c \
|
||||
boot.c \
|
||||
syslog.c \
|
||||
udp_apps.c
|
||||
|
||||
@@ -132,7 +133,7 @@ $(BUILDDIR)/%.rel: %.asm | create_build_dir
|
||||
# mv -f $(addprefix $(basename $^), .lst .rel .sym) .
|
||||
|
||||
$(BUILDDIR)/rtlplayground.ihx: $(OBJS) $(BUILDDIR)/crtbank.rel $(BUILDDIR)/crc16.rel
|
||||
$(CC) $(CC_FLAGS) -Wl-bHOME=0x00000 -Wl-bBANK1=0x14000 -Wl-bBANK2=0x24000 -Wl-r -o $@ $^
|
||||
$(CC) $(CC_FLAGS) -Wl-bHOME=0x00000 -Wl-bBANK1=0x14000 -Wl-bBANK2=0x24000 -Wl-bBANK3=0x34000 -Wl-r -o $@ $^
|
||||
|
||||
$(BUILDDIR)/rtlplayground.img: $(BUILDDIR)/rtlplayground.ihx
|
||||
objcopy --input-target=ihex -O binary $< $@
|
||||
|
||||
Reference in new issue
Block a user