Commit Graph

1079 Commits

Author SHA1 Message Date
4132c450a5 firmware: runtime changes for exception
Ported from:
M-Labs/artiq-zynq#162

This includes new API for exception handling, some refactoring to avoid
code duplication for exception structures, and modified protocols to
send nested exceptions and avoid string allocation.
2022-01-26 07:16:54 +08:00
4e3e0d129c firmware: fix compilation warning 2022-01-11 09:31:26 +08:00
12ee326fb4 firmware: fixed personality function 2022-01-11 09:30:19 +08:00
Steve Fan
4a6bea479a
Host report for async error upon kernel termination (#1791)
Closes #1644
2021-12-04 13:33:24 +08:00
f281112779 satman: add 100mhz si5324 settings
siphaser: add calculated vco for 100mhz comment
2021-12-03 17:19:11 +08:00
9423428bb0 drtio: fix crc32 offset address 2021-11-24 12:00:56 +08:00
db3e5e83e6 bump misoc 2021-11-08 16:59:08 +08:00
531670d6c5 dyld: check ABI 2021-11-08 16:59:08 +08:00
03b803e764 firmware: adjust csr separation 2021-11-08 16:59:08 +08:00
b3e315e24a rust: find json file using CARGO_TRIPLE 2021-11-08 16:59:08 +08:00
0898e101e2 board_misoc: reuse riscv dir for comm & kernel 2021-11-08 16:59:08 +08:00
69cddc6b86
rtio_clocking: add warnings for unsupported rtio_clock settings (#1773) 2021-10-28 16:34:22 +08:00
9b1d7e297d
runtime: clock input specification improvements
closes #1735
2021-10-28 16:21:51 +08:00
d5fa3d131a cargo.lock: update libc version for libfringe 2021-10-16 17:42:24 +08:00
6d3164a912 riscv: print mtval on panic 2021-10-16 17:42:24 +08:00
46326716fd runtime: bump libfringe, impl ecall abi
See libfringe PR: M-Labs/libfringe#1
2021-10-16 17:42:24 +08:00
0a59c889de satman/kern: init locked PMP on startup 2021-10-16 17:42:24 +08:00
27a7a96626 runtime: setup pmp + transfer to user 2021-10-16 17:42:24 +08:00
a0bf11b465 riscv: impl pmp 2021-10-16 17:42:24 +08:00
790a20edf6 linker: generate stack guard + symbol 2021-10-16 17:42:24 +08:00
35d21c98d3 Revert "runtime: expose rint from libm"
Consistency with NAR3/Zynq where rint is not available.

This reverts commit f5100702f6.
2021-10-11 08:12:04 +08:00
f5100702f6 runtime: expose rint from libm 2021-10-10 20:40:17 +08:00
59065c4663 alloc_list: support alloc w/ large align
Signed-off-by: Oi Chee Cheung <dc@m-labs.hk>
2021-10-07 12:38:03 +08:00
2d79d824f9 firmware: remove minor or1k leftovers 2021-09-12 20:03:37 +08:00
a573dcf3f9 board_misoc/build: use rv32 as target arg
The original rv64 argument was only to match the misoc counterpart.
2021-09-10 14:11:23 +08:00
448974fe11 runtime/main: cleanup 2021-09-10 13:59:53 +08:00
b091d8cb66 kernel: flush cache before mod_init
This could be necessary as redirecting instructions from D$ directly to I$ as it seems.
Related: https://github.com/SpinalHDL/VexRiscv/issues/137
2021-09-10 13:25:12 +08:00
b8ed5a0d91 alloc: fix alignment for riscv32 arch 2021-09-10 13:25:12 +08:00
2213e7ffac ksupp/rtio/exception: fix timestamp 2021-09-10 13:25:12 +08:00
09ffd9de1e dma: fix timestamp fetch 2021-09-10 13:25:12 +08:00
c6ba0f3cf4 ksupport: fix dma cslice (ffi) 2021-09-10 13:25:12 +08:00
c812a837ab runtime: enlarge stack size 2021-09-10 13:25:12 +08:00
a596db404d satman: fix cargo xbuild sysroot 2021-09-10 13:25:12 +08:00
4fab267593 cargo: std dependency hack 2021-09-10 13:25:12 +08:00
dcbd9f905c cargo: use cargo xbuild 2021-09-10 13:25:12 +08:00
9f6b3f6014 firmware: clarify target triple
The lack of compressed instruction support can be inferred from the target triple, literally.
2021-09-10 13:25:12 +08:00
6db7280b09 flake: board package WIP 2021-09-10 13:25:12 +08:00
d8ac429059 dyld: streamline lib.rs
Only riscv32 is supported anyway, no need to have excessive architecture check.
2021-09-10 13:25:12 +08:00
798774192d slave_fpga/bootloader: read in little endian 2021-09-10 13:25:12 +08:00
eecd825d23 firmware: suppress warning 2021-09-10 13:25:12 +08:00
1da0554a49 pcr: purge 2021-09-10 13:25:12 +08:00
70507e1b72 Cargo.lock: update 2021-09-10 13:25:12 +08:00
c113cd6bf5 libfringe: bump 2021-09-10 13:25:12 +08:00
61b0170a12 firmware: purge or1k 2021-09-10 13:25:12 +08:00
af263ffe1f ksupport: fix rpc, cache signature (FFI)
The reason of the borrow stuff is explained in M-Labs/artiq-zynq#76 (artiq-zyna repo).
As for `cache_get()`, compiler will perform stack allocation to pre-allocate the returned structure, and pass to cache_get alongside the `key`.
However, ksupport fails to recognize the passed memory, so it will always assume the passed memory as the key.
2021-09-10 13:25:12 +08:00
8fa47b8119 rpc: enforce alignment 2021-09-10 13:25:12 +08:00
de0f2d4a28 firmware: adopt endianness protocol in artiq-zynq
Related:
artiq-zynq: M-Labs/artiq-zynq#126
artiq: #1588
2021-09-10 13:25:12 +08:00
9afe63c08a ksupport: fix proto_artiq dependency 2021-09-10 13:25:12 +08:00
29a2f106d1 ksupport: replace asm with llvm_asm 2021-09-10 13:25:12 +08:00
279593f984 ksupport.ld: merge sbss with bss 2021-09-10 13:25:12 +08:00
1ba8c8dfee runtime: remove irq again 2021-09-10 13:25:12 +08:00
3d629006df makefiles: revert byte-swaps 2021-09-10 13:25:12 +08:00
7542105f0f board_misoc: remove pcr
VexRiscv seems to not support additional hardware performance counter, at least I have not seen any documentation on how to use it.
2021-09-10 13:25:12 +08:00
01ca114c66 runtime: remove irq dependency 2021-09-10 13:25:12 +08:00
36171f2c61 runtime: remove inaccurate sp on panic 2021-09-10 13:25:12 +08:00
01e357e5d3 ksupport.ld: reduce load section alignment 2021-09-10 13:25:12 +08:00
1293e0750e ld, makefiles: use ld.lld 2021-09-10 13:25:12 +08:00
5656e52581 remove profiler 2021-09-10 13:25:12 +08:00
1b8b4baf6a ksupport: fix panic, libc, unwind 2021-09-10 13:25:12 +08:00
905330b0f1 ksupport: handle riscv exceptions 2021-09-10 13:25:12 +08:00
50a62b3d42 liballoc: change align to 16 bytes 2021-09-10 13:25:12 +08:00
7f0bc9f7f0 runtime/makefile: specify emulation, flip endianness 2021-09-10 13:25:12 +08:00
c42adfe6fd runtime.ld: merge .sbss & .bss 2021-09-10 13:25:12 +08:00
f56152e72f rust: fix dependencies 2021-09-10 13:25:12 +08:00
c800b6c8d3 runtime: update rust alloc, managed 2021-09-10 13:25:09 +08:00
e99061b013 runtime: add riscv 2021-09-10 13:23:22 +08:00
ecedec577c runtime: impl riscv exception handling 2021-09-10 13:23:15 +08:00
252594a606 runtime: impl riscv panic handler 2021-09-10 13:20:31 +08:00
31bf17563c personality: update from rust/panic_unwind 2021-09-10 13:20:31 +08:00
bfddd8a30f libdyld: add riscv support 2021-09-10 13:20:31 +08:00
ad3037d0f6 libc: add minimal C types 2021-09-10 13:20:31 +08:00
daaf6c3401 libunwind: add rust interface 2021-09-10 13:20:31 +08:00
6d9cebfd42 satman: handle .sbss generation 2021-09-10 13:20:31 +08:00
96438c9da7 satman: make fbi big-endian 2021-09-10 13:20:31 +08:00
6535b2f089 satman: fix feature 2021-09-10 13:20:31 +08:00
45adaa1d98 satman: add riscv exception handling 2021-09-10 13:20:31 +08:00
869a282410 satman: use riscv 2021-09-10 13:20:31 +08:00
ebb9f298b5 proto_artiq: update alloc type path 2021-09-10 13:20:31 +08:00
97a0132f15 libio: update alloc type path 2021-09-10 13:20:31 +08:00
37ea863004 libio: pin failure version 2021-09-10 13:20:31 +08:00
3ff74e0693 bootloader: handle .sbss generation in .ld
Signed-off-by: occheung <dc@m-labs.hk>
2021-09-10 13:20:31 +08:00
448fe0e8cf bootloader: fix panic
Signed-off-by: occheung <dc@m-labs.hk>
2021-09-10 13:20:31 +08:00
8294d7fea5 bootloader: swap endianness
Signed-off-by: occheung <dc@m-labs.hk>
2021-09-10 13:20:31 +08:00
13032272fd bootloader: add rv32 exception handler
Signed-off-by: occheung <dc@m-labs.hk>
2021-09-10 13:20:31 +08:00
46102ee737 board_misoc: build vectors.S with rv64 target in misoc
Signed-off-by: occheung <dc@m-labs.hk>
2021-09-10 13:20:31 +08:00
b87ea79d51 rv32: rm irq & vexriscv-rust
Signed-off-by: occheung <dc@m-labs.hk>
2021-09-10 13:20:31 +08:00
9aee42f0f2 rv32/boot: remove hotswap
Signed-off-by: occheung <dc@m-labs.hk>
2021-09-10 13:20:31 +08:00
82b4052cd6 libboard_misoc: vexriscv integration
Signed-off-by: occheung <dc@m-labs.hk>
2021-09-10 13:20:31 +08:00
420891ba54 syntax 2021-08-12 13:01:35 +08:00
9f94bc61ae missing part of 477b1516d 2021-08-12 12:55:37 +08:00
477b1516d3 remove profiler 2021-08-12 12:51:55 +08:00
5111132ef0
ICAP: prevent sayma from using it (#1740) 2021-08-06 15:08:30 +08:00
6b88ea563d
talk to ICAP primitive to restart gateware (#1733) 2021-08-05 17:00:31 +08:00
ea0c7b6173 Merge remote-tracking branch 'harrydrtio/k7-drtio' 2021-06-15 10:04:45 +08:00
92fd705990 increase memory allocated to comms CPU
See discussion in #1612.
2021-02-21 19:06:12 +08:00
14d464b4cf update copyright year 2021-02-17 15:52:08 +08:00
8148fdb8a7
use device endian for core device protocols (#1591) 2021-01-22 16:33:21 +08:00
3832b261b1 firmware: optimize integer array/list rpc 2021-01-21 09:05:17 +01:00
f6d39fd6ba kc705: revive DRTIO master with updated syntax
* KC705 master variant now uses Si5324 as synthesiser.
* Multi-channel has not been implemented yet.
2021-01-20 15:05:31 +08:00
43be383c86 kasli v2.0: drive TX_DISABLE low on all SFPs (fixes #1570)
This was the same problem as #1508 but on SFP1..3
2020-12-23 00:10:12 +08:00
73271600a1 jdcg: STPL tests now perform after DAC initialization 2020-12-14 18:03:31 +08:00
David Nadlinger
d95e619567 compiler: Implement binary NumPy math functions (arctan2, …)
The bulk of the diff is just factoring out the implementation
for binary arithmetic implementations, to be reused for binary
function calls.
2020-11-11 01:35:28 +01:00
David Nadlinger
bc6fbecbda compiler, firmware: Do not expose abort() to kernels
This was only exposed for the assert implementation, and
does not exist on Zynq.
2020-11-10 20:40:18 +01:00
ea95d91428 wrpll: separate collector reset 2020-11-09 17:57:13 +08:00
90017da484 firmware: remove obsolete watchdog code (#1458) 2020-10-15 18:38:00 +08:00
57ee57e7ea runtime: fix metlino si5324 init (2) 2020-10-14 18:41:56 +08:00
ac35548d0f runtime: fix metlino si5324 init 2020-10-14 12:57:25 +08:00
35c61ce24d si5324: unify N31 settings when used as synthesizer
Closes #1528
2020-10-12 14:45:52 +08:00
hartytp
e6ff2ddc32 wrpll: add more diagnostics in firmware and adapt to recent gateware changes 2020-10-08 15:32:27 +08:00
9214e0f3e2 firmware: fix Si5324 CKIN selection on Kasli 2.0
https://github.com/sinara-hw/Kasli/issues/82#issuecomment-702129805
2020-10-02 20:35:32 +08:00
aac2194759 Ported rpc changes to or1k 2020-08-26 14:17:06 +08:00
Paweł Kulik
eb350c3459 Drive SFP0 TX_DISABLE low during startup (as was in Kasli v1.1). Fixes Ethernet on SFP modules with pullup on this line.
Signed-off-by: Paweł Kulik <pawel.kulik@creotech.pl>
2020-08-24 21:39:53 +08:00
d8cd5023f6 runtime: expose more libm functions 2020-08-12 13:36:06 +08:00
David Nadlinger
8783ba2072 compiler/firmware: RPCs for ndarrays 2020-08-09 17:08:43 +01:00
504f72a02c rtio: remove legacy i_overflow_reset CSR 2020-08-06 17:52:32 +08:00
eb28d7be3a firmware/rpc: fixed typo 2020-07-16 15:15:47 +08:00
f78d673079 firmware/rpc: added #[repr(C)] for structs.
Previously the structs are in repr(Rust) which has no layout guarantee.
2020-07-16 15:11:17 +08:00
e31ee1f0b3 firmware/i2c: rewrite I2C implementation
* Never drive SDL or SDA high. They are specified to be open
  collector/drain and pulled up by resistive pullups. Driving
  high fails miserably in a multi-master topology (e.g. with
  a USB I2C interface). It would only ever be implemented to
  speed up the bus actively but that's tricky and completely
  unnecessary here.
* Make the handover states between the I2C protocol phases (start, stop,
  restart, write, read) well defined. Add comments stressing those
  pre/postconditions.
* Add checks for SDA arbitration failures and stuck SCL.
* Remove wrong, misleading or redundant comments.
2020-07-15 16:43:07 +08:00
8719bab726 Revert "i2c: duplicate TCA9548 control byte"
This reverts commit f265976df6.
2020-07-08 19:02:02 +08:00
f265976df6 i2c: duplicate TCA9548 control byte 2020-07-03 16:45:05 +08:00
David Nadlinger
3f0cf6e683 runtime: Stop kernel CPU before restarting comms CPU on panic
Before, the system would enter a boot loop when a panic occurred
while the kernel CPU was active (and panic_reset == 1), as
kernel::start() for the startup kernel would panic.
2020-07-01 17:29:05 +08:00
d5c1eaa16e runtime: remove stack alignment requirement
I suppose this was for TMPU, but was never finished.
2020-05-29 15:37:23 +08:00
02900d79d0 firmware: fix typos 2020-05-29 15:21:07 +08:00
4e9a529e5a kasli: integrate WRPLL 2020-05-07 21:34:02 +08:00
35f1814235 kasli: implement virtual LEDs 2020-05-07 19:07:43 +08:00
b83afedf43 kasli: light up ERROR LED on panic 2020-05-07 19:06:10 +08:00
4982fde898 firmware: I2C I/O expander support 2020-05-05 21:38:17 +08:00
ef4e5bc69b firmware: Kasli I2C EEPROM cleanup 2020-05-05 21:29:29 +08:00
9bc43b2dbf kasli: support EEPROM on v2 2020-04-23 23:00:36 +08:00
fb0ade77a9 firmware: fix non-DRTIO build 2020-04-10 17:23:17 +08:00
3c823a483a sayma: improve DAC sync messaging (again) 2020-04-06 22:36:43 +08:00
4d601c2102 sayma: improve DAC sync messaging 2020-04-06 22:36:03 +08:00
61d4614b61 sayma: fix/cleanup DRTIO-DAC sync interaction 2020-04-06 22:34:05 +08:00
facc0357d8 drtio: make sure receive buffer is drained after ping reply 2020-04-06 22:33:15 +08:00
ffd3172e02 sayma: move SYSREF DDMTD to RTM (#795) 2020-04-06 00:01:28 +08:00
380de177e7 rtio: fix wide output after RTIO refactoring
fixes 3d0c3cc1cf
2020-03-05 17:55:27 +00:00
52ec849008 sayma: fix sysref_delay_dac 2020-02-05 19:04:01 +08:00
bf9f4e380a si5324: program I2C mux on Metlino 2020-02-03 18:07:59 +08:00
bfcbffcd8d update smoltcp
This disables the 'log' features which does not compile, and may break net_trace. To be investigated later.
2020-01-21 13:58:23 +08:00
62a52cb086 sayma: do not pollute the log with DAC status on success 2020-01-20 20:14:24 +08:00
6b428ef3be sayma: initialize DAC before testing jesd::ready 2020-01-20 20:14:24 +08:00
ec03767dcf sayma: improve DAC status report 2020-01-20 18:22:06 +08:00
5c299de3b4 sayma: print DAC status on JESD not ready error 2020-01-20 18:21:29 +08:00
45efee724e sayma: add JESD204 PHY done diagnostics 2020-01-20 12:47:31 +08:00
3242e9ec6c wrpll: loop test 2020-01-13 22:31:57 +08:00
d5895b8999 wrpll: adpll -> set_adpll 2020-01-13 20:46:36 +08:00
e7ef23d30c wrpll: use CONFIG_CLOCK_FREQUENCY and rtio_frequency in trim_dcxos 2020-01-13 20:44:15 +08:00
ea3bce6fe3 wrpll: wait for settling time after setting ADPLL 2020-01-13 20:43:34 +08:00
9d7196bdb7 update copyright year 2020-01-13 19:33:44 +08:00
e87d864063 wrpll: print ADPLL offsets 2020-01-13 19:32:30 +08:00
8edbc33d0e wrpll: calculate initial ADPLL offsets 2020-01-13 19:29:10 +08:00
9dd011f4ad firmware: remove bitrotten Sayma code 2020-01-13 18:47:54 +08:00
583a18dd5f firmware: expose fmod to kernels. Closes #1417 2020-01-10 14:33:02 +08:00
3f32d78c0e wrpll: simple ADPLL test 2019-12-31 12:12:29 +08:00
bb04b082a7 wrpll: clarify comment 2019-12-31 12:12:29 +08:00
642a305c6a wrpll: remove unnecessary delay
Counting now happens in the sys domain with no CDC between counter and CPU.
2019-12-30 20:01:06 +08:00
f57f235dca wrpll: new frequency meter
As per Mattermost discussion with Tom.
2019-12-30 19:47:57 +08:00
dfad27125e runtime: relax/fix TCP keepalive settings (#1125) 2019-12-23 19:58:10 +08:00
c5137eeb62 firmware: remove legacy hmc542 code 2019-12-20 15:25:55 +08:00
David Nadlinger
d3508b014f firmware: Add whitespace between panic handler location and message 2019-12-17 19:59:59 +00:00
6f52540569 wrpll: fix previous commit 2019-12-09 20:13:55 +08:00
13486f3acf wrpll: swap helper/main si549 frequencies 2019-12-09 19:49:34 +08:00
4919fb8765 wrpll: print DDMTD helper tags 2019-12-09 17:39:22 +08:00
0d4eccc1a5 wrpll: improve debug output 2019-12-09 17:23:09 +08:00
f633c62e8d wrpll: speed up si549 i2c access 2019-12-09 17:22:58 +08:00
14e09582b6 wrpll: work around si549 not working when lsdiv=2 2019-12-09 16:20:08 +08:00
439576f59d wrpll: fix Si549 initialization delays 2019-12-09 16:13:57 +08:00
0499f83580 wrpll: helper clock sanity check 2019-12-08 23:46:33 +08:00
Paweł Kulik
14e250c78f Enabled internal pullup for CML SYSREF outputs, otherwise there is no signal on them.
Signed-off-by: Paweł Kulik <pawel.kulik@creotech.pl>
2019-12-07 09:30:24 +08:00
eb271f383b wrpll: add DDMTD cores 2019-11-28 22:03:50 +08:00
39d5ca11f4 si549: increase I2C frequency 2019-11-28 22:03:26 +08:00
87894102e5 si549: use recommended i2c read sequence 2019-11-28 17:49:02 +08:00
354d82cfe3 wrpll: drive helper clock domain 2019-11-28 17:40:00 +08:00
68cab5be8c si549: cleanups 2019-11-28 16:36:59 +08:00
bcd2383c9d wrpll: si549 initialization 2019-11-27 22:58:08 +08:00
4832bfb08c wrpll: i2c functions, select_recovered_clock placeholder 2019-11-27 21:21:00 +08:00
449d2c4f08 libboard_misoc: fix !has_i2c 2019-11-27 21:04:28 +08:00
e0687b77f5 si5324: 10 MHz ext_ref_frequency
* close #1254
* tested on innsbruck2 kasli variant
* sponsored by Uni Innsbruck/AQT

Signed-off-by: Robert Jördens <rj@quartiq.de>
2019-11-22 18:29:12 +01:00
6644903843 bootloader: fix imports 2019-11-06 14:45:55 +08:00
b25a17fa37 netboot: support slave FPGA loading 2019-11-05 16:28:49 +08:00
9dc82bd766 bootloader: add no_flash_boot config option to force network boot 2019-11-05 15:31:08 +08:00
29b4d87943 firmware: add cargosha256.nix 2019-11-01 10:28:41 +08:00
5362f92b39 bootloader: disable minimum stack space check in linker script
* The value varies greatly whether netboot is enabled or not.
* There is no simple solution to detect has_ethmac in the linker script and set the value accordingly.
* The space check is an imperfect solution that will be superseded by stack pointer limits.
* Left commented out so we can re-enable it manually during development if stack corruption is suspected.
2019-11-01 10:25:14 +08:00
deadfead2a bootloader: fix !has_ethmac 2019-11-01 10:19:08 +08:00
a78e493b72 firmware: load slave FPGA in bootloader 2019-10-31 12:42:40 +08:00
389a8f587a slave_fpga: modularize 2019-10-31 11:50:53 +08:00
bc050fdeec bootloader: treat zero-length firmware in flash as no firmware 2019-10-30 21:46:06 +08:00
462cf5967e bootloader: add netboot support 2019-10-30 21:23:42 +08:00
f2f7170d20 hmc7043: use recommend I/O standards
https://github.com/sinara-hw/Sayma_RTM/issues/116#issuecomment-544187952
2019-10-21 22:56:10 +08:00
47a83c71f1 firmware: more readable network addresses message 2019-10-21 14:00:14 +08:00
818d6b2f5a bootloader: fix compilation problems 2019-10-21 13:28:17 +08:00
8f76a3218e firmware: move i2c to libboard_misoc, enable IPv6 in bootloader, share network settings 2019-10-21 12:58:52 +08:00
1c5e749036 satman: remove compilation warning without JESD DACs 2019-10-21 12:53:54 +08:00
d26d80410e runtime: refactor network settings 2019-10-19 17:56:35 +08:00
6d5dcb4211 runtime: enable IPv6. Closes #349 2019-10-19 17:20:33 +08:00
05e8f24c24 sayma2: JESD204 synchronization 2019-10-18 23:28:47 +08:00
4df2c5d1fb sayma: prepare for SYSREF align
We will try DDMTD on the AMC first, as this is simpler and perhaps will work on v2 after the power supply fixes.
2019-10-08 12:30:47 +08:00
5ee81dc643 satman: define constants for JdacBasicRequest reqnos 2019-10-08 10:27:04 +08:00
4b3baf4825 firmware: run PRBS and STPL JESD204 tests 2019-10-08 00:10:36 +08:00
ebd5d890f1 satman: check for JESD ready 2019-10-06 23:10:57 +08:00