Commit Graph

7191 Commits

Author SHA1 Message Date
enjoy-digital 315fbe18cb
Merge pull request #1016 from antmicro/jboc/lpddr5
soc/software/liblitedram: fix max error count computation
2021-09-01 11:16:07 +02:00
enjoy-digital 931a2b34ce
Merge pull request #1019 from G33KatWork/fix_setup
Add docs static files to package_data in setup.py
2021-09-01 11:14:47 +02:00
Florent Kermarrec feeb2bfe31 tools/litex_contributors: Add special cases for companies to replace individuals with company name/email.
Avoid doing it manually.
2021-09-01 11:09:26 +02:00
Joel Stanley 722772a3d8 microwatt: Fix relocation error when linking
When building with GCC 11:

../libbase/crt0.o: in function `_start':
litex/soc/cores/cpu/microwatt/crt0.S:54:(.text+0x38): relocation truncated to fit: R_PPC64_GOT16_DS against symbol `_fdata' defined in .data section in bios.elf
litex/soc/cores/cpu/microwatt/crt0.S:55:(.text+0x3c): relocation truncated to fit: R_PPC64_GOT16_DS against symbol `_edata' defined in .data section in bios.elf
litex/soc/cores/cpu/microwatt/crt0.S:56:(.text+0x40): relocation truncated to fit: R_PPC64_GOT16_DS against symbol `_fdata_rom' defined in *ABS* section in bios.elf
litex/soc/cores/cpu/microwatt/crt0.S:68:(.text+0x68): relocation truncated to fit: R_PPC64_GOT16_DS against symbol `_fbss' defined in .bss section in bios.elf
litex/soc/cores/cpu/microwatt/crt0.S:69:(.text+0x6c): relocation truncated to fit: R_PPC64_GOT16_DS against symbol `_ebss' defined in .bss section in bios.elf
litex/soc/cores/cpu/microwatt/crt0.S:80:(.text+0x90): relocation truncated to fit: R_PPC64_GOT16_DS against symbol `_fstack' defined in .bss section in bios.elf
boot.o: in function `copy_file_from_sdcard_to_ram':
litex/soc/software/bios/boot.c:622:(.text+0x18): relocation truncated to fit: R_PPC64_TOC16_DS against `.toc'
litex/soc/software/bios/boot.c:627:(.text+0x5c): relocation truncated to fit: R_PPC64_TOC16_DS against `.toc'+8
litex/soc/software/bios/boot.c:633:(.text+0x8c): relocation truncated to fit: R_PPC64_TOC16_DS against `.toc'+10
litex/soc/software/bios/boot.c:639:(.text+0xdc): relocation truncated to fit: R_PPC64_TOC16_DS against `.toc'+18
litex/soc/software/bios/boot.c:650:(.text+0x128): additional relocation overflows omitted from the output

This is because we pass -mcmodel=small. As the PowerPC ELF ABI
describes, the small code model restricts the relocations to 16-bit
offsets[1]. If we omit the option we get the default, which is the
medium model allowing 32-bit offsets.

http://openpowerfoundation.org/wp-content/uploads/resources/leabi/content/dbdoclet.50655240_19143.html

Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-09-01 18:02:19 +09:30
Pawel Sagan 8aa7c1b9dd litex: adding oddr/iddr/ddrtristate simulation models
Signed-off-by: Pawel Sagan <psagan@antmicro.com>
2021-09-01 10:25:21 +02:00
Joel Stanley d91c8dcfa2 bios: Fix build-id link error
New version of binutils contain stricter checks for sections that are
not included in the linker script, resulting in this error:

 ld: error: no memory region specified for loadable section `.note.gnu.build-id'

Disable this feature as there is no use for it on bare metal systems.

Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-09-01 15:41:24 +09:30
Joel Stanley c74e3642b3 bios: Fix PHDR link error
binutils 2.34 contains stricter checks for sections that are not
included in the linker script, resulting in this error:

 ld: bios.elf: error: PHDR segment not covered by LOAD segment

From the 2.34 NEWS:

  The ld check for "PHDR segment not covered by LOAD segment" is more
  effective, catching cases that were wrongly allowed by previous versions of
  ld.  If you see this error it is likely you are linking with a bad linker
  script or the binary you are building is not intended to be loaded by a
  dynamic loader.  In the latter case --no-dynamic-linker is appropriate.

As the BIOS runs bare metal, we do not need to emit a PHDR segment.

Signed-off-by: Joel Stanley <joel@jms.id.au>
2021-09-01 15:33:44 +09:30
Andreas Galauner b0470c7da1 Add docs static files to package_data in setup.py
This patch adds the static files needed for the documentation to the
`package_data` field in `setup.py`.

I ran into failures when generating documentation after installing litex
using pipenv which didn't copy these files which in turn caused the
documentation generation to fail.

This change causes all files in the `static` subfolder of the
litex.soc.doc module to be installed as well.
2021-09-01 05:23:51 +02:00
asadaleem-rs 8428e89f09 customize main ram size from command line argument 2021-08-30 17:36:40 +05:00
Jędrzej Boczar f943092bb5 soc/software/liblitedram: fix max error count computation
READ_CHECK_TEST_PATTERN_MAX_ERRORS was being computed incorrectly
which could result in integer underflows when computing core via
(max_errors - errors). This could happen e.g. when using
DFIRateConverter, which modifies DFII_PIX_DATA_BYTES. Now we use
DFII_PIX_DATA_BYTES in the equation so this should not happen.
2021-08-30 12:54:49 +02:00
enjoy-digital 1d27e25cbb
Merge pull request #1015 from antmicro/ddr-tristate
build: add DDRTristate
2021-08-27 19:12:45 +02:00
Piotr Binkowski 84896f73ac build: add DDRTristate 2021-08-27 13:51:58 +02:00
enjoy-digital 53750715d7
Merge pull request #1013 from antmicro/reset-tx-uart-pad
Set TX UART pin high on reset
2021-08-26 18:54:18 +02:00
Michal Sieron 47291e07f7 Set TX UART pin high on reset
Without this we get corrupted data on the output after
SoC reset. It was present there, but got removed in
908e72e65b refactor.
Fixes #991
2021-08-26 18:07:03 +02:00
Tim Ansell 0c11c19ffd
Merge pull request #1012 from gsomlo/gls-json-ethmac-depth
json2dts_linux: update ethmac [tx|rx]-fifo-depth
2021-08-25 15:23:27 -07:00
Gabriel Somlo 98a0b688bf json2dts_linux: update ethmac DT node generation
The Linux LiteETH driver parses registers by name. Provide the expected
names for each register: "mac", "mdio", and "buffer", respectively.

For setting up tx and rx slots, the Linux driver expects three pieces
of information: number of tx and rx slots, and slot size. Update
json2dts_linux to provide the appropriate names and values.
2021-08-25 17:51:23 -04:00
Florent Kermarrec f017b06926 integration/export/get_csr_json: Only set type to "ro" for read_only CSRStatus. 2021-08-24 19:26:36 +02:00
Florent Kermarrec 05a614c7a2 integration/export: Cosmetic cleanups. 2021-08-24 19:13:16 +02:00
Florent Kermarrec 44b223a918 soc/integration/builder: Force a fresh software build when variables.mak is changing.
When playing with CPUs and variants, users previously had to do a rm -rf build to ensure
a proper software build. Various developers already lost time on it so it's important
to handle it directly in the Builder which is now the case.
2021-08-24 15:38:42 +02:00
Florent Kermarrec dceed5f7e7 tools: Rename JSON based generators and expose new ones:
-litex_json2dts_linux  (previously litex_json2dts).
-litex_json2dts_zephyr (previously litex_zephyr_dts_generator).
-litex_json2renode     (previously litex_renode_generator).

litex_json2dts_zephyr and litex_json2renode are now also directly exposed.
2021-08-24 08:52:56 +02:00
enjoy-digital d0b2eec962
Merge pull request #993 from antmicro/add_renode_scripts
Add Renode platform/script and Zephyr DT overlay generators
2021-08-24 08:45:22 +02:00
enjoy-digital 17a7ac19b6
Merge pull request #986 from antmicro/jboc/lpddr5
soc/software/liblitedram: fix pattern checking for low DFI databits
2021-08-23 19:11:18 +02:00
Florent Kermarrec babbcd28bc software: Review/Cleanup #998.
- Fix compilation in sdram.c.
- Fix warnings.
- Move Sequential/Random mode printf to memtest.
- Reduce SPI Flash test size (Testing full SPI Flash makes the boot too long, especially in random mode).
2021-08-23 17:59:11 +02:00
Florent Kermarrec 7fa49e2d0d Merge branch 'antmicro-memspeed-ra' 2021-08-23 17:03:20 +02:00
Florent Kermarrec b50d5aa328 Merge branch 'memspeed-ra' of git://github.com/antmicro/litex into antmicro-memspeed-ra 2021-08-23 17:02:58 +02:00
enjoy-digital 16f6f08d00
Merge pull request #1004 from antmicro/liblitespi-freq-init
liblitespi: perform frequency initialization after entering quad/qpi mode
2021-08-23 16:36:42 +02:00
enjoy-digital 767bf81c6f
Merge pull request #1007 from antmicro/fix-demo-alignments
Fix alignments in demo/linker.ld
2021-08-23 16:12:23 +02:00
Michal Sieron 2883187c48 Make sure crt0 files come first
BIOS jumps on boot to the beginning of main_ram.
Unless `_start` function of loaded binary is there
it won't work correctly.
2021-08-19 15:05:11 +02:00
Michal Sieron 92fd154b28 Fix alignments in demo/linker.ld
Without this change, when `.data` section size wasn't multiple
of word size, `data_loop` in crt0 was jumping over `_edata` and
continued looping. As it works on words and right now 64 bit CPUs
are biggest ones supported - alignment is now 8 bytes.

Also removed `- 4` from stack address, as it needs to be aligned
to 16 bytes on RISC-V.
2021-08-18 18:25:22 +02:00
Filip Kokosinski ebc4ddc1e5 soc: software: liblitespi: enter quad mode before freq init
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2021-08-16 07:47:08 +02:00
Florent Kermarrec 78c1751c47 litex_setup: Use fixed version of opentitan for ibex CPU. (ibex has evolved since initial support). 2021-08-13 16:27:50 +02:00
enjoy-digital 20e910b836
Merge pull request #995 from david-sawatzke/ecpprog
Add ecpprog-based programmer for ecp5
2021-08-13 12:19:26 +02:00
David Sawatzke 9b8253c016 build/lattice/programmer: Add ecpprog-based programmer 2021-08-13 11:14:07 +02:00
enjoy-digital 17b8a74735
Merge pull request #994 from antmicro/fix-clang-support-detection
Fix clang support detection
2021-08-13 10:21:13 +02:00
Florent Kermarrec e3a88c324e cpu/rocket/blackparrot: Update crt_init (#988). 2021-08-13 10:16:43 +02:00
enjoy-digital 601e96e5d1
Merge pull request #988 from antmicro/fix-longlong
Fix stack alignment
2021-08-13 09:59:19 +02:00
enjoy-digital 32b913b362
Merge pull request #992 from cklarhorst/master
cores/vexriscv_smp: Fix vexriscv_smp doesn't build without a memory bus
2021-08-13 09:46:51 +02:00
Filip Kokosinski 27f73533b9 soc: software: add random_access option to memspeed
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2021-08-12 09:05:09 +02:00
Christian Klarhorst ebe22ca2b6 cores/vexriscv_smp: Fix vexriscv_smp doesn't build without a memory bus
The current code only works with a memory bus because otherwise
"generate_cluster_name" doesn't get called.
Cluster_name is only needed in the finalize phase.
Therefore, the name will now be generated just before its usage.

Verifiable with: 
litex_sim --cpu-type vexriscv_smp (should be broken before this commit)
2021-08-11 14:17:58 +02:00
Michal Sieron d1e70498a6 Fix clang support detection 2021-08-11 11:39:31 +02:00
Mateusz Holenko fcbebde302 Add Zephyr DTS overlay generator 2021-08-11 11:27:28 +02:00
Mateusz Holenko d9c67dd763 Add Renode scripts generator 2021-08-11 11:27:28 +02:00
enjoy-digital ab9f214a5e
Merge pull request #987 from danc86/nextpnr-nexus-no-io-ff
build/lattice: work around lack of SDR I/O primitives in nextpnr
2021-08-11 09:50:47 +02:00
Michal Sieron 8c2e13bff7 Fix stack alignment
RISC-V requires stack to be aligned to 16 bytes.
1d5384e669/riscv-elf.md?plain=1#L183

Right now, in bios/linker.ld, `_fstack` is being set to 8 bytes
before the end of sram region.
```
PROVIDE(_fstack = ORIGIN(sram) + LENGTH(sram) - 8);
```

Removing ` - 8` makes it aligned to 16.

Also there are changes in crt0.S for vexriscv,
vexriscv_smp and cv32e40p.

Code that was setting up stack, was adding 4 to its address
for some reason.

Removing it makes it aligned to 8 bytes, and with change in
bios/linker.ld to 16 bytes.

It also fixes `printf` with long long integers on 32bit
CPUs ([relevant issue](https://github.com/riscv/riscv-gcc/issues/63)).
2021-08-10 13:00:46 +02:00
Dan Callaghan cd8666d0b3 build/lattice: work around lack of SDR I/O primitives in nextpnr
Fixes #907.
2021-08-09 19:26:40 +10:00
Florent Kermarrec 79ac09316a interconnect/axi/AXIBurst2Beat: Fix BURST_WRAP case. 2021-08-06 16:41:58 +02:00
Jędrzej Boczar 6f8a0052ef soc/software/liblitedram: fix pattern checking for low DFI databits 2021-08-04 15:14:07 +02:00
Florent Kermarrec ce5864983d soc/add_cpu: Add memory mapping overrides to build log and make an exception for the CPUNone case.
A regular CPU can provides specific mapping constraints and we are overriding provided mapping
with these constraints.

The case of CPUNone is different and we can do the opposite: Give priority to User's mapping.

For the regular CPU case, the override was done silently, it is now logged during the build.
2021-07-30 15:00:10 +02:00
Florent Kermarrec c80d5723c9 soc/add_spi_flash: Reduce default_divisor. 2021-07-30 12:32:57 +02:00
Florent Kermarrec 6100620634 bios/main: Display Flash in SoC capabilities. 2021-07-29 19:26:01 +02:00