software: use a single crt0 (deprecate crt0-ctr/crt0-xip) and avoid unnecessary defines.
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 23 Jun 2020 10:23:26 +0000 (12:23 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 23 Jun 2020 10:41:48 +0000 (12:41 +0200)
Since https://github.com/enjoy-digital/litex/issues/566, crt0-ctr and crt0-xip are now similiar
so we can get back to a single crt0 and remove the defines that were generated to distinguish
the different cases.

Since LiteX/MiSoC have diverged and are no longer compatible, we also no longer need to generate
the LiteX flag.

litex/soc/integration/builder.py
litex/soc/software/bios/Makefile
litex/soc/software/libbase/Makefile

index ef7e45e6a4211d8cb03fdf83d19f87a4b8050d72..e625c58893f65f44373355184f9678086aefc86c 100644 (file)
@@ -91,20 +91,6 @@ class Builder:
 
             for k, v in export.get_cpu_mak(self.soc.cpu, self.compile_software):
                 define(k, v)
-            # Distinguish between LiteX and MiSoC.
-            define("LITEX", "1")
-            # Distinguish between applications running from main RAM and
-            # flash for user-provided software packages.
-            exec_profiles = {
-                "COPY_TO_MAIN_RAM" : "0",
-                "EXECUTE_IN_PLACE" : "0"
-            }
-            if "main_ram" in self.soc.mem_regions.keys():
-                exec_profiles["COPY_TO_MAIN_RAM"] = "1"
-            else:
-                exec_profiles["EXECUTE_IN_PLACE"] = "1"
-            for k, v in exec_profiles.items():
-                define(k, v)
             define(
                 "COMPILER_RT_DIRECTORY",
                 get_data_mod("software", "compiler_rt").data_location)
index 35bff23741660e2305d9b2453390724cc47906bb..778757da72905f7337c2a0ee79bed6d650e6934b 100755 (executable)
@@ -58,7 +58,7 @@ endif
 bios.elf: $(BIOS_DIRECTORY)/linker.ld $(OBJECTS)
 
 
-%.elf: ../libbase/crt0-ctr.o \
+%.elf: ../libbase/crt0.o \
        ../libcompiler_rt/libcompiler_rt.a \
        ../libbase/libbase-nofloat.a \
        ../liblitedram/liblitedram.a \
@@ -66,7 +66,7 @@ bios.elf: $(BIOS_DIRECTORY)/linker.ld $(OBJECTS)
        ../liblitespi/liblitespi.a \
        ../liblitesdcard/liblitesdcard.a
        $(LD) $(LDFLAGS) -T $(BIOS_DIRECTORY)/linker.ld -N -o $@ \
-               ../libbase/crt0-ctr.o \
+               ../libbase/crt0.o \
                $(OBJECTS) \
                -L../libcompiler_rt \
                -L../libbase \
index 5974e00073bcf30d89803f928cd360a4688b1e66..1094ac5730b9599976f87a7623808f782e31df05 100755 (executable)
@@ -1,11 +1,25 @@
 include ../include/generated/variables.mak
 include $(SOC_DIRECTORY)/software/common.mak
 
-OBJECTS = exception.o libc.o errno.o crc16.o crc32.o console.o \
-       system.o id.o uart.o time.o qsort.o strtod.o spiflash.o strcasecmp.o i2c.o \
-       div64.o progress.o
-
-all: crt0-ctr.o crt0-xip.o libbase.a libbase-nofloat.a
+OBJECTS = exception.o \
+       libc.o            \
+       errno.o           \
+       crc16.o           \
+       crc32.o           \
+       console.o         \
+       system.o          \
+       id.o              \
+       uart.o            \
+       time.o            \
+       qsort.o           \
+       strtod.o          \
+       spiflash.o        \
+       strcasecmp.o      \
+       i2c.o             \
+       div64.o           \
+       progress.o
+
+all: crt0.o libbase.a libbase-nofloat.a
 
 libbase.a: $(OBJECTS) vsnprintf.o
        $(AR) crs libbase.a $(OBJECTS) vsnprintf.o
@@ -25,14 +39,11 @@ vsnprintf-nofloat.o: $(LIBBASE_DIRECTORY)/vsnprintf.c
 %.o: $(LIBBASE_DIRECTORY)/%.S
        $(assemble)
 
-crt0-ctr.o: $(CPU_DIRECTORY)/crt0.S
+crt0.o: $(CPU_DIRECTORY)/crt0.S
        $(assemble)
 
-crt0-xip.o: $(CPU_DIRECTORY)/crt0.S
-       $(CC) -c -DEXECUTE_IN_PLACE $(CFLAGS) -o $@ $<
-
 .PHONY: all clean
 
 clean:
-       $(RM) $(OBJECTS) crt0-$(CPU).o crt0-$(CPU)-flash.o vsnprintf.o vsnprintf-nofloat.o
+       $(RM) $(OBJECTS) crt0.o vsnprintf.o vsnprintf-nofloat.o
        $(RM) libbase.a libbase-nofloat.a .*~ *~