Commit Graph

349 Commits

Author SHA1 Message Date
Sebastien Bourdeauducq 560889372f firmware: grabber support 2018-05-29 10:26:36 +08:00
Sebastien Bourdeauducq b10d3ee4b4 make RTIO clock switch optional and simplify
Kasli no longer has an internal RTIO clock.
Switching clocks dynamically is no longer supported.
2018-05-18 17:41:34 +08:00
whitequark 5744d97d59 firmware: adjust backtrace addresses correctly. 2018-05-17 08:13:55 +00:00
whitequark 31c6c79204 firmware: implement an edge profiler.
It doesn't work extremely well, and the results can be somewhat
confusing, and it needs a libunwind patch, but it's the best I could
do and it seems still useful.
2018-05-16 21:53:53 +00:00
whitequark ca93b94aea firmware: move config requests to management protocol.
They were only in session protocol because of historical reasons.
2018-05-16 14:32:49 +00:00
Florent Kermarrec 7fe49a78d2 firmware/runtime/session: fix compilation when no rtio core 2018-05-15 23:47:47 +02:00
whitequark 9f5b76253c firmware: remove some unnecessary unwraps. 2018-05-15 15:05:19 +00:00
whitequark b54926134c firmware: update the signature of #[lang="panic_fmt"]. 2018-05-15 15:05:19 +00:00
whitequark 9347f6e00c firmware: use a dedicated error type in the scheduler.
After this commit, error handling does not normally allocate
(session::Error::{Load,Unexpected} still allocate, but those two
are very rare).

Good riddance to libstd_artiq.
2018-05-15 14:19:44 +00:00
whitequark 479cb9a857 firmware: use dedicated error types for every protocol and thread.
Good riddance to io::Error::Unrecognized.
2018-05-15 13:27:23 +00:00
whitequark 514eab3d39 Update Rust to 1.26.0. 2018-05-15 12:47:51 +00:00
whitequark 26faaad2b7 firmware: remove io::Result<T, E> in favor of Result<T, impl Fail>.
This doesn't yet use impl Fail since std_artiq::io::Error doesn't
impl it.
2018-05-15 08:29:03 +00:00
whitequark 140ca729aa firmware: rename io::Error::{UnexpectedEof→UnexpectedEnd}.
We don't even have files.
2018-05-15 08:27:45 +00:00
whitequark ce0593315b firmware: move {ProtoRead,ProtoWrite} to the root of libio. 2018-05-15 08:16:09 +00:00
whitequark 5ead27f2e1 firmware: eliminate uses of std_artiq::io::{Read,Write} from runtime. 2018-05-14 19:11:57 +00:00
whitequark cf33ba748d firmware: eliminate non-io uses of std_artiq from runtime.
Just replace these with references to alloc.
2018-05-14 19:11:57 +00:00
whitequark ae50196186 firmware: rename libproto to libproto_artiq.
libproto_artiq only has ARTIQ-specific protocols.
2018-05-14 18:09:44 +00:00
whitequark 02b8426f60 firmware: rename libboard to libboard_misoc.
By analogy with libbuild_misoc. Hopefully one day it actually gets
moved to misoc...
2018-05-14 18:09:44 +00:00
whitequark 1ff42683d9 firmware: merge libamp into libboard_artiq.
All gateware interfaces live in libboard_artiq, but libamp predates
libboard_artiq.
2018-05-14 17:33:25 +00:00
whitequark 764386c9e3 firmware: split libdrtioaux into libproto and libboard_artiq modules.
All other protocol code lives in libproto, and all other gateware
interfaces live in libboard_artiq.
2018-05-14 17:26:59 +00:00
whitequark 6a10d54432 firmware: migrate rpc_proto to new libio.
This closes an old and horrible issue in that some code in ksupport
may implicitly try to allocate and we'll never know until it crashes
at runtime inside liballoc_stub.

This also removes liballoc_stub.
This also removes ReadExt and WriteExt from libproto.
Hooray!
2018-05-14 17:26:59 +00:00
whitequark 09617c9f5e firmware: migrate session_proto to new libio. 2018-05-14 15:17:32 +00:00
whitequark 976bb5e935 firmware: migrate analyzer_proto to new libio. 2018-05-14 12:51:59 +00:00
whitequark d543c9aa63 firmware: backtrace_artiq → unwind_backtrace.
This crate isn't ARTIQ-specific.
2018-05-14 07:33:00 +00:00
whitequark 68ef09ed73 firmware: stop profiler before rebooting too. 2018-05-05 01:52:44 +00:00
whitequark b1d349cc1b firmware: implement a sampling profiler.
Does not yet support constructing call graphs.
2018-05-05 00:44:40 +00:00
whitequark 623614f835 Update LLVM to 6.0.0 and Rust to 1.25.0. 2018-05-01 08:57:37 +00:00
whitequark 3b054855ec firmware: add allocator debug feature, invoked by artiq_coredebug frontend. 2018-04-21 19:39:46 +00:00
whitequark 873324d52b firmware: don't truncate queued RPCs (fixes #985). 2018-04-21 19:39:46 +00:00
whitequark 0d5fd1e83d runtime: fix race condition in log extraction code paths (#979).
The core device used to panic if certain combinations of borrows
of the log buffer happened. Now they all use .try_borrow_mut().
2018-04-20 15:26:00 +00:00
Sebastien Bourdeauducq 416232cb64 runtime: do not reset RTIO PHY on core.reset(). Closes #971 2018-03-28 10:51:07 +08:00
Sebastien Bourdeauducq f2cc2a5ff2 firmware: reset local RTIO PHYs on startup (#958) 2018-03-22 16:29:31 +08:00
whitequark 9ea7d7a804 firmware: allow building without system UART. 2018-03-14 18:34:31 +00:00
Robert Jördens 7afb23e8be runtime: demote dropped and malformed packets msgs to debug 2018-03-07 14:28:21 +01:00
Sebastien Bourdeauducq c2d2cc2d72 runtime: fix setup_si5324_as_synthesizer 2018-03-07 10:57:30 +08:00
Sebastien Bourdeauducq c34d00cbc9 drtio: implement Si5324 phaser gateware and partial firmware support 2018-03-07 10:57:30 +08:00
Sebastien Bourdeauducq a274af77d5 runtime: fix compilation without DRTIO 2018-03-05 00:43:42 +08:00
Sebastien Bourdeauducq 432e61bbb4 drtio: add kernel API to check for link status. Closes #941 2018-03-05 00:23:55 +08:00
Sebastien Bourdeauducq 928d5dc9b3 drtio: raise RTIOLinkError if operation fails due to link lost (#942) 2018-03-04 01:02:53 +08:00
Robert Jördens de63e657b8 kasli/si5324: lock to 100 MHz with highest available bandwidth 2018-03-01 14:49:53 +01:00
Robert Jördens a7720d05cd firmware, sayma: port converter_spi to spi2
* ksupport/nrt_bus
* port ad9154, hmc830, hmc7043
* port local_spi and drtio_spi
* port kernel_proto libdrtioaux, satman
* change sayma_rtm gateware over
* add spi2 NRTSPIMaster
* remove spi NRTSPIMaster
* change sayma device_db
* change HMC830 to open mode and explicitly sequence open mode
2018-03-01 11:19:18 +01:00
Robert Jördens 0c49201be7 firmware: add slave fpga serial load support
based on whitequark's work in f95fb27

m-labs/artiq#813
2018-02-28 19:27:52 +01:00
Robert Jördens cedecc3030 Revert "firmware: Sayma RTM FPGA bitstream loading prototype (#813)."
This reverts commit f95fb273f1.

Will be replaced with a bitbang/GPIO based version.
2018-02-28 18:43:56 +01:00
whitequark f95fb273f1 firmware: Sayma RTM FPGA bitstream loading prototype (#813). 2018-02-28 16:46:23 +00:00
Sebastien Bourdeauducq 738654c783 drtio: support remote RTIO resets 2018-02-20 18:48:54 +08:00
Sebastien Bourdeauducq ad2c9590d0 drtio: rewrite/fix reset and link bringup/teardown 2018-02-20 17:26:43 +08:00
Sebastien Bourdeauducq 83abdd283a drtio: signal stable clock input to transceiver 2018-02-18 22:29:30 +08:00
Sebastien Bourdeauducq 039dee4c8e si5324: rename SI5324_FREE_RUNNING to SI5324_AS_SYNTHESIZER
The previous name was causing confusion with the FREE_RUN bit
that connects the crystal to CLKIN2.
2018-02-17 13:54:50 +08:00
Sebastien Bourdeauducq cfb21ca126 si5324: fix usage of external CLKIN2 reference 2018-02-17 13:52:01 +08:00
Robert Jördens e41f49cc75 kasli: opticlock 125 MHz, mark external reference case broken 2018-02-16 17:23:15 +00:00
Sebastien Bourdeauducq 4d42df2a7c kasli: set up Si5324 in standalone operation 2018-02-15 20:32:58 +08:00
whitequark fe50018037 firmware: make network tracing runtime switchable. 2018-02-14 23:03:20 +00:00
whitequark 807eb1155b Update smoltcp.
Fixes #902.
2018-01-30 03:29:08 +00:00
whitequark d58393a1e5 runtime: build with -Cpanic=unwind.
This is required for backtraces to function. I'm not sure how it
turned out that master had -Cpanic=abort.
2018-01-26 23:01:24 +00:00
whitequark 80cbef0031 firmware: always reset PHY when initializing Ethernet.
Fixes #897.
2018-01-19 04:56:11 +00:00
whitequark 1f82ceaa85 firmware: add HMC542 (Allaki) support. 2018-01-19 04:47:26 +00:00
Sebastien Bourdeauducq dc593ec0f0 Merge branch 'rtio-sed' into sed-merge 2018-01-10 12:04:54 +08:00
whitequark 267c699835 firmware: support DDRPHY without write leveling (fixes #886).
Currently, this is kasli.
2018-01-09 02:41:02 +00:00
whitequark 07ccb9eebd firmware: support configuration without ethphy (#886).
Currently, this is kasli.
2018-01-08 22:16:17 +00:00
whitequark 3a3f44af53 firmware: update smoltcp. 2018-01-08 21:41:53 +00:00
Sebastien Bourdeauducq e1a75ac1c1 runtime: set log level early
We want to debug startup.
2018-01-04 22:19:48 +08:00
whitequark fc9766d2fa firmware: reset ethphy before initializing smoltcp (fixes #884). 2018-01-04 11:42:35 +00:00
whitequark b7f38b123b frimware: update to log 0.4. 2018-01-01 11:45:55 +00:00
whitequark b8f3d28bc0 firmware: update compiler_builtins dependency and move it to libboard.
This is so that we only specify it once.
2017-12-31 09:16:11 +00:00
whitequark 33e0393e4a firmware: move mod ethmac to libboard. 2017-12-28 14:40:15 +00:00
whitequark acd13837ff firmware: implement the new bootloader. 2017-12-28 13:18:51 +00:00
whitequark b9754e7108 firmware: deduplicate libbuild_misoc and libbuild_artiq. 2017-12-28 13:18:51 +00:00
whitequark fcc438524c firmware: use main.rs as the root source for non-library crates. NFC. 2017-12-28 08:20:23 +00:00
whitequark 8f33061a6d firmware: fix sayma_amc_standalone build with sawg. 2017-12-28 08:20:23 +00:00
Sebastien Bourdeauducq 4ea801b2ea firmware: si5324 moved to board_artiq 2017-12-28 15:45:45 +08:00
whitequark 3b18ece3b7 satman: update for changes in firmware elsewhere. 2017-12-28 07:36:33 +00:00
whitequark ca419aa3c2 firmware: split out libboard_artiq from libboard. 2017-12-28 07:07:00 +00:00
whitequark b443fbd8f7 runtime: remove #[repr(simd)] hack. 2017-12-28 04:46:27 +00:00
whitequark 7687a34285 firmware: remove dependency on compiler-rt. 2017-12-28 04:08:29 +00:00
whitequark 4dfe71676e firmware: remove dependency on libbase. 2017-12-28 04:03:27 +00:00
whitequark 68f128944a firmware: clean up makefiles. 2017-12-27 23:10:47 +00:00
whitequark d7cb4963e1 firmware: prepare config block for access from BIOS/bootloader.
* remove liballoc dependency from mod config,
  * move mod config to libboard,
  * move config sector immediately after BIOS sector.
2017-12-27 21:28:40 +00:00
whitequark 5a2cbe7088 runtime: remove borrow_mut!() in favor of backtraces. 2017-12-27 19:15:25 +00:00
whitequark edfacbd063 conda: ship runtime.elf in board-specific packages.
This is so that backtraces may be symbolized.
2017-12-26 21:50:31 +00:00
whitequark 8b4a006855 runtime: update smoltcp. 2017-12-26 14:33:56 +00:00
whitequark 71eca5ad61 runtime: fix some final flash storage issues. 2017-12-26 14:09:17 +00:00
whitequark 188764693e runtime: we're growing, put storage at 1M instead of 512K. 2017-12-26 03:34:16 +00:00
whitequark e2513a2401 runtime: ensure flash storage never overlaps with runtime sections. 2017-12-26 03:31:37 +00:00
whitequark 6e341da3a1 runtime: simplify. NFC. 2017-12-26 02:31:28 +00:00
whitequark 061fb3dcd5 runtime: remove accidentally committed parts of a Makefile. 2017-12-25 20:30:13 +00:00
whitequark 230f2e5e18 runtime: print (address-only) backtraces on core device panics. 2017-12-25 18:32:41 +00:00
whitequark 3eec15c01d firmware: fix compatibility with newer rustc. NFC. 2017-12-25 17:16:05 +00:00
Sebastien Bourdeauducq a6ffe9f38d drtio: add Sayma top-level designs 2017-12-21 23:08:56 +08:00
Sebastien Bourdeauducq a23251276d Revert "sayma: set up Si5324 for RGMII clock rerouting"
This reverts commit 2b01aa22b6.
2017-12-21 14:42:15 +08:00
whitequark 701308474f runtime: update smoltcp. 2017-12-19 15:51:03 +00:00
whitequark aaba36be7a runtime: log moninj messages at TRACE level, like all others. 2017-12-16 22:39:13 +00:00
whitequark 8cece4f260 runtime: hotswap slightly more carefully.
This generally lets some last characters out of UART, last ACKs
out of queues, etc. Nothing guaranteed though.
2017-12-16 22:39:13 +00:00
whitequark 4a9d8c9459 runtime: fix a warning. 2017-12-16 22:39:13 +00:00
Sebastien Bourdeauducq 2b01aa22b6 sayma: set up Si5324 for RGMII clock rerouting 2017-12-17 00:25:33 +08:00
Sebastien Bourdeauducq 77977932f2 firmware: remove AD9516 support
This was only used in KC705 phaser.
2017-12-14 19:16:39 +08:00
Sebastien Bourdeauducq 5809e08686 runtime: no startup_clock config is not an error 2017-12-14 12:39:26 +08:00
whitequark 9e8bb1d51c runtime: update smoltcp. 2017-12-08 07:36:56 +00:00
whitequark 8e8f037971 runtime: print ethmac preamble error count.
Also, print total error count, not the difference (but still compute
the difference to determine *when* to print).
2017-11-26 22:35:26 +00:00
whitequark 26fdd42f8f runtime: update smoltcp. 2017-11-22 08:09:06 +00:00
Florent Kermarrec 76ddb063cf gateware/targets/sayma: get hmc830/7043 spi working (still need to test clock generation) 2017-11-06 12:08:28 +01:00
whitequark fcd660d682 runtime: remove accidentally deleted code. 2017-11-03 16:10:59 +00:00
whitequark dfb2fe0b80 runtime: allow #[cfg(not(has_ethmac))] builds. 2017-11-03 16:09:22 +00:00
whitequark 4835431ac3 runtime: allow #[cfg(not(has_kernel_cpu))] builds. 2017-11-03 16:04:17 +00:00
whitequark ad8fcb8b86 runtime: has_rtio -> has_rtio_core.
has_rtio is the cfg for the kernel CPU, has_rtio_core is the one
for the comms CPU.

Also remove a few useless #[cfg]s.
2017-11-03 15:59:59 +00:00
whitequark 2404a0d8c8 runtime: allow #[cfg(not(has_rtio))] builds. 2017-11-03 15:49:30 +00:00
whitequark b03e36e4e9 conda: update misoc. 2017-10-30 09:33:02 +00:00
whitequark 7f32ae31de runtime: fix a typo. 2017-10-30 08:48:35 +00:00
whitequark a66450b0af runtime: temporarily revert ethmac statistics collection. 2017-10-30 08:27:51 +00:00
whitequark ae2d7abbed runtime: update smoltcp. 2017-10-30 08:26:54 +00:00
whitequark cdf63c5ea0 runtime: interrogate ethmac error counters and display changes. 2017-10-30 07:46:23 +00:00
whitequark 978c0d98aa runtime: update smoltcp. 2017-10-30 07:22:47 +00:00
whitequark 8e91856426 runtime: parse the "ip" configuration as IP, not CIDR.
Or it defaults to the default IP on settings that were previously
perfectly valid.
2017-10-30 04:25:58 +00:00
whitequark 6bdeddd201 runtime: remove UDP-related code. 2017-10-25 02:55:01 +00:00
whitequark cdba330845 Update smoltcp.
Fixes #840.
2017-10-25 02:31:27 +00:00
whitequark e7dac530c1 runtime: avoid hardcoding ethmac slot layout, use info from CSR. 2017-10-03 19:16:11 +00:00
whitequark fd07c3f4d7 runtime: get rid of config_dummy.rs. NFC.
Use the same strategy as elsewhere.
2017-10-02 03:20:50 +00:00
whitequark 73c76ebb9a firmware: eliminate most transmutes and document the rest. NFC. 2017-10-02 03:09:46 +00:00
Sebastien Bourdeauducq b4c52c34f7 Merge branch 'sinara' 2017-09-30 01:11:16 +08:00
Sebastien Bourdeauducq 6c049ad40c rtio: report channel numbers in asynchronous errors 2017-09-29 16:32:57 +08:00
Sebastien Bourdeauducq 5437f0e3e3 rtio: make sequence errors consistently asychronous 2017-09-29 14:40:06 +08:00
whitequark c00b3fe8cd firmware: update smoltcp. 2017-09-24 22:57:27 +00:00
whitequark 7799413a41 firmware: update Rust from 1.18.0 to 1.20.0. 2017-09-24 22:51:44 +00:00
Sebastien Bourdeauducq 20d79c930c drtio: use SED and input collector 2017-09-24 12:23:47 +08:00
whitequark c1829f3eda runtime: update smoltcp. 2017-09-22 19:05:18 +00:00
Sebastien Bourdeauducq 2b2b345eb9 firmware: wait for serwb to be ready before proceeding further 2017-09-06 11:07:07 +08:00
whitequark 74b7010d67 runtime: allow safely pulling logs even on TRACE log level.
Before this commit, this resulted in a packet flood, because
sending a TRACE log message to the host caused more TRACE log
messages to be emitted.
2017-08-31 14:13:51 +00:00
Sebastien Bourdeauducq 44edba0c65 firmware: add placeholder code for HMC830/7043 initialization 2017-08-31 13:35:47 +08:00
whitequark 20f43d5792 firmware: fix ethmac MTU value.
1500 is the maximum payload size, not maximum frame size.
2017-08-31 00:57:35 +00:00
whitequark 737c1044a4 firmware: update smoltcp. 2017-08-31 00:45:56 +00:00
whitequark f26e698f31 Revert "firmware: reduce ethmac maximum burst size by one."
This reverts commit 2231b16e0a.

Only made a difference with TRACE log level to UART, i.e. only
because UART was the bottleneck.
2017-08-30 15:22:20 +00:00
whitequark 39ecbc0d68 firmware: update smoltcp. 2017-08-30 14:35:45 +00:00
whitequark 2231b16e0a firmware: reduce ethmac maximum burst size by one.
Empirically, this much reduces packet loss. I'm not really sure why,
but it seems safe to do the change.
2017-08-30 14:35:25 +00:00
whitequark e6e176fa14 Revert "firmware: update smoltcp."
This reverts commit 7c340f6b48.
2017-08-25 12:03:01 +00:00
whitequark 7c340f6b48 firmware: update smoltcp. 2017-08-25 07:20:38 +00:00
whitequark f5e1d9568d firmware: update smoltcp. 2017-08-24 05:50:59 +00:00
Sebastien Bourdeauducq ac83bfbd8e runtime: add support for targets without SPI flash 2017-08-20 11:28:57 -04:00
whitequark dd87508a7f Implement forwarding of logs from core device to master.
Fixes #691.
2017-07-18 05:31:59 +00:00
Sebastien Bourdeauducq 9045b4cc19 drtio: initial firmware support for multi-link 2017-07-18 00:40:21 +08:00
whitequark 1e2603572a runtime: fix a bug causing sockets to get stuck in CLOSE-WAIT. 2017-07-05 16:27:36 +00:00
whitequark ee1d5dbccb runtime: allow a much larger log buffer and avoid hacks. 2017-07-04 18:18:31 +00:00
whitequark 6a49c114c8 runtime: update smoltcp. 2017-06-28 00:27:22 +00:00
whitequark 370f22541c runtime: update smoltcp. 2017-06-27 21:06:45 +00:00
whitequark f17a6616b2 runtime: ensure management interface buffer can hold log buffer.
Otherwise we get weird edge cases where the network stack could try
to append to log buffer while management interface is holding
the log buffer and trying to push it out, and it's just no good.

The serialized log buffer at its maximum length is slightly longer
than 32 KiB, so we just allocate the largest possible TCP buffer
to the management interface to keep it simple.
2017-06-24 17:09:28 +00:00
whitequark 12357d884e runtime: update smoltcp. 2017-06-24 16:55:59 +00:00
Sebastien Bourdeauducq 66dee9d1ad drtio: send/process I2C and SPI aux packets (#740) 2017-06-21 16:50:51 +08:00
Sebastien Bourdeauducq f58f16ccd4 drtioaux: add default timeout 2017-06-21 16:23:11 +08:00
Sebastien Bourdeauducq c86029bca2 i2c: expose restart as syscall, add structure for I2C-over-DRTIO 2017-06-19 23:44:51 +08:00
Sebastien Bourdeauducq 5d63489080 i2c,spi: add busno error detection 2017-06-19 14:27:30 +08:00
Sebastien Bourdeauducq 8399f8893d add kernel access to non-realtime SPI buses (#740) 2017-06-18 12:45:07 +08:00
whitequark a820ae98cf ksupport: avoid allocations on I/O error paths.
Fixes #715.
2017-04-21 17:20:50 +00:00