Commit Graph

1079 Commits

Author SHA1 Message Date
36b3678853 satman: fix ddma reporting wrong destination 2023-09-22 10:25:37 +08:00
af77885dfc rtio_mgt: fix drtio reset on standalone 2023-09-22 09:46:40 +08:00
eb57b3b393 drtio: async messages become synchronous
They are now a reply for DestinationStatusRequest.
This prevents gateware errors and lost packets if the receiver is busy.
2023-09-21 16:30:00 +08:00
372008cb66 Firmware: AD9117 Add check presence of clk comment 2023-09-18 13:04:51 +08:00
85abb1da2c Firmware: Set DACs RETIMER-CLK to Phase 1 Shuttler
- Intend to maintain the same pipeline latency across all DACs on Shuttler
- Force the RETIMER-CLK to be PHASE 1 on all DACs
- See Issue #2200 for details
2023-09-18 12:52:21 +08:00
ccb140a929 Firmware: Add AD9117 DAC Startup Seq for shuttler 2023-09-11 15:07:47 +08:00
b49fb841ce Firmware: EFC enables error led when going panic 2023-09-06 15:54:35 +08:00
7f63bb322d disable DRTIO-over-EEM OSERDES until clock is stable
This asserts OOB reset on EFC.
2023-09-05 16:59:01 +08:00
b56f7e429a
drtio: rename drtio_transceiver to gt_drtio 2023-08-28 04:50:46 +00:00
2139456f80 firmware: skip clock switch for efc 2023-08-25 15:06:42 +08:00
a2a780a3f2 firmware: fix compilation warning 2023-08-25 15:06:02 +08:00
dc97d3aee6 drtio-eem: CONFIG_EEM_TRANSCEIVERS -> CONFIG_EEM_DRTIO_COUNT 2023-08-25 11:49:39 +08:00
cd22e42cb4
efc: add DRTIO virtual LEDs
- EFC Gateware: Add virtual_leds to rtio
- EFC Firmware: io_expander is kept being serviced to update
  virtual_leds after init
2023-08-23 06:21:14 +00:00
e8818c812c satman: fix non-eem satellites failing to build 2023-08-22 16:32:59 +08:00
occheung
64d3f867a0
add DRTIO-over-EEM PHY
for EFC and perhaps Phaser
2023-08-09 23:59:40 +00:00
David Nadlinger
efbae51f9d runtime: Validate ksupport ELF against hard-coded address ranges
This would have caught the reduction in header padding with LLD 14.
In theory, we could just get rid of the hard-coded kernel CPU address
ranges altogether and use ksupport.elf as the one source of truth; the
code already exists in dyld. The actual base address of the file would
still need to be forwarded to the kernel-side libunwind glue, though,
as there doesn't seem to be a clean way to get the equivalent of
KSUPPORT_HEADER_SIZE through the linker script. I have left this as-is
with the hard-coded KERNELCPU_… constants for now.
2023-08-07 10:10:38 +00:00
David Nadlinger
8acfa82586 ksupport: Remove unused sections from linker script [nfc]
We no longer build ksupport.ld in a position-independent fashion, and
the reference to the ld.bfd _GLOBAL_OFFSET_TABLE issue was just a
distraction
2023-08-07 10:10:38 +00:00
David Nadlinger
4d636ea593 Upgrade to LLD 14
Previous linker versions had inserted some zero padding bytes
between the ELF headers and the first section, but LLD 14 does
not anymore.

Hard-coding the offset of the first section in ksupport.elf
manually isn't ideal; we should probably parse the ELF program
headers instead when first setting up the kernel CPU.
2023-08-07 10:10:38 +00:00
758b97426a Bootloader: SDRAM patch for EFC
- Modification of the CFG flag ensure EFC to initialize DDRPHY correctly
Note that Kasli and EFC share the same model of SDRAM
2023-08-02 02:18:45 +00:00
c206e92f29 Bootloader: Remove kusddrphy support for SDRAM
- Delete all the kusddrphy cfg flags and related code
2023-08-02 02:18:20 +00:00
cb547c8a46
efc: turn on power of FMC peripheral
- Add efc's io expander method
- Enable VADJ, P3V3_FMC in satman main during startup
2023-08-01 00:29:45 +00:00
b3dc199e6a Fix panic when receiving empty strings in rpc calls
Receiving an empty string in an RPC call currently panics.

When `length` is zero, a call to the `alloc` function (as implemented in `artiq/firmware/runtime/session.rs`) returns a null pointer. Constructing a `CMutSlice` from a null pointer panics.
A `CMutSlice` consists of a pointer and the length. Rust's documentation of the `core::ptr` module states: "The canonical way to obtain a pointer that is valid for zero-sized accesses is `NonNull::dangling`."
This commits adds a check for the length of a string received in an RPC call. Only for lengths greater than zero a memory allocation is performed. For zero-length strings, a dangling pointer is used.

Test plan:
Invoke the following experiment, which returns an empty string over RPC:
```
class ReturnEmptyString(artiq.experiment.EnvExperiment):
    def build(self):
        self.core: Core = self.get_device("core")

    @kernel
    def run(self):
        x = self.do_rpc()
        print(x)

    @rpc
    def do_rpc(self) -> TStr:
        return ""
```

Signed-off-by: Sven Over (Oxford Ionics) <sven.over@oxionics.com>
2023-07-18 04:00:32 +00:00
b97f6a9e44 bootloader: fix compilation warning without Ethernet 2023-06-02 10:48:55 +08:00
d103cbea31 libboard_misoc: fix clang STB_WEAK warning 2023-05-31 18:59:51 +08:00
a4895b591a analyzer: fix satellite behavior 2023-05-29 13:13:24 +08:00
b9c7905b20 nixpkgs 23.05 2023-05-27 17:17:36 +08:00
c1d6fd4bbe satman analyzer: remove forgotten comment 2023-05-19 11:39:14 +08:00
ab52748cac analyzer sat: disarm on drop 2023-05-19 11:39:14 +08:00
ddfe51e7ac analyzer: use transactions for data transmission 2023-05-19 11:39:14 +08:00
6c96033d41 analyzer: implement querying up satellites for data 2023-05-19 11:39:14 +08:00
0b03126038 satman: support analyzer packets 2023-05-19 11:39:14 +08:00
fdca1ab7fc drtioaux: add analyzer related messages 2023-05-19 11:39:14 +08:00
3ca47537b8 Fix mismatched signatures for the wide interface
Lists are passed by-reference from python code, and so should be
&CSlice<_> not CSlice<_>.

Signed-off-by: Jonathan Coates <jonathan.coates@oxionics.com>
2023-05-19 10:18:06 +08:00
2f35869eb1
satman: fix PMP and L2 flush 2023-04-20 15:45:15 +08:00
918d30b900 dma: pass "uses_ddma" for non-remote recordings 2023-04-18 12:35:37 +08:00
8984f5104a Move RTIO errors formatting to the session_proto
This would be closer to the artiq-zynq implementation

Signed-off-by: Egor Savkin <es@m-labs.hk>
2023-04-17 09:23:30 +08:00
d0b8818688 Add 125 MHz from 80 MHz reference option to rtio clocking
Signed-off-by: Egor Savkin <es@m-labs.hk>
2023-04-13 14:57:24 +08:00
97161a3df2 firmware: improve RTIO map error reporting 2023-04-04 11:27:31 +08:00
696bda5c03 handle playback status in aux_transact 2023-03-28 14:18:29 +08:00
9150230ea7 dma: gate ddma features behind cfg(has_drtio) 2023-03-28 14:18:29 +08:00
e9a153b985
runtime: implement distributed DMA 2023-03-22 11:16:25 +08:00
bbf80875fb
firmware: assume empty config records as removed (#2064)
This will return `KeyNotFound` for empty values, which are produced by `remove` operation

Signed-off-by: Egor Savkin <es@m-labs.hk>
2023-03-13 18:18:26 +08:00
1ca09b9484
Add support for default route (IPv4 and IPv6) (#2059)
Based on code by Michael Birtwell <michael.birtwell@oxionics.com>
2023-03-13 17:29:10 +08:00
84e7515721
satman: distributed DMA support 2023-03-11 18:36:36 +08:00
a9360823b1 libproto: remove obsolete Jdac packets 2023-03-02 20:29:09 +08:00
394138f00f
firmware: block session on startup kernel to be finished (#2046) 2023-01-19 16:46:53 +08:00
514ac953ce remove obsolete SI5324_AS_SYNTHESIZER config option 2023-01-12 13:01:08 +08:00
0a37a1a4c1 Merge branch 'syncrtio' 2023-01-12 12:58:19 +08:00
628b671433 update copyright year 2023-01-12 10:41:10 +08:00
070fed755b
firmware: unify RTIO error message format 2023-01-09 16:13:05 +08:00
cf2a4972f7 remove WRPLL 2023-01-06 17:53:11 +08:00
5da9794895 remove Sayma and Metlino support 2023-01-06 17:41:12 +08:00
3838dfc1d1
DRTIO: RTIO/SYS clock merge, KC705 2023-01-06 07:13:38 +08:00
David Nadlinger
b9f13d48aa firmware: Fix object references in tuples
Sine 8740ec3dd, the alignment() information from
"run-time type information" (i.e. the Tag type) is also
used when sending tuples to the host.
2022-12-19 00:57:46 +00:00
17efc28dbe
DRTIO: RTIO/SYS clock merge 2022-12-17 15:39:54 +08:00
David Nadlinger
1e0102379b firmware: Rename si5324 crystal_{ref -> as_ckin2} [nfc]
This would have made the issue in the pre-740543d4e code
much more obvious (the config option by itself does not
have any effect on the choice of active reference input).
2022-12-17 02:17:12 +00:00
David Nadlinger
ceabeb8d84 firmware: Fix Si5324 initialisation for satellites
Commit 740543d4e2 had unintentionally broken DRTIO
satellites, as si5324::setup is also used there. This
imports setup_si5324_as_synthesizer() from artiq-zynq,
where the input selection was already explicitly done.

GitHub: Fixes #2028.
2022-12-17 02:17:06 +00:00
SingularitySurfer
8e476dd502 implement pca9539 and runtime io-expander chip selection
better comments and address translation

fix spurious };

unwrap init in runtime and return err instead of panic

propagate error

del unnecessary use

Signed-off-by: SingularitySurfer <Norman_Krackow@gmx.de>
2022-12-14 22:46:38 +08:00
454ae39c5d
firmware: fix crash on exception with host message (#2017) 2022-12-07 10:41:43 +08:00
David Nadlinger
3c7a394eff runtime/rtio_clocking: Deduplicate/document input selection [nfc] 2022-12-04 04:21:44 +00:00
David Nadlinger
740543d4e2 firmware: Fix Kasli v2 runtime rtio_clock selection
SI5324_EXT_REF now only controls the (deprecated) fallbacks
for when the rtio_clock option is not set.
2022-12-04 02:23:38 +00:00
1852491102
add channel names to RTIO errors 2022-12-02 16:27:03 +08:00
David Nadlinger
261dc6b933 firmware/runtime: Fix Ext0_Synth0_*to125 log messages 2022-12-02 01:37:56 +00:00
b8b6ce14cc Update smoltcp to 0.8.2
This fixes an issue where TCP issues are not retransmitted when only
some packets in a burst are acknowledged. This causes smoltcp to never
make progress and hang.

Signed-off-by: Jonathan Coates <jonathan.coates@oxionics.com>
2022-11-28 22:10:23 +08:00
David Nadlinger
950b9ac4d6 firmware: More explicit panic message if stack guard is tripped
This should give even only mildly technical users a
chance to figure out what's going on, which empirically
is not the case for a plain Exception(LoadFault) without
further context.
2022-11-24 16:54:49 +00:00
David Nadlinger
3d25092cbd firmware/rpc_proto: Remove unnecessary cast [nfc] 2022-11-14 22:50:38 +00:00
David Nadlinger
dbbe8e8ed4 firmware/rpc_proto: Fix typo breaking receiving of arrays
This was introduced in 8740ec3dd5.
2022-11-14 22:49:45 +00:00
David Nadlinger
8740ec3dd5 firmware/rpc_proto: Fix size/alignment calculation for structs with tail padding
Also factors out duplicate code for (de)serializing
elements of lists and ndarrays, and replaces the rounding
calculations by the well-known, much faster power-of-two-only
bit-twiddling version.

GitHub: Fixes #1934.
2022-11-14 11:37:45 +08:00
David Nadlinger
6caa779c74 firmware/ksupport: Include .gcc_except_table (LSDA)
For whatever reason, no language-specific unwind data
was generated for ksupport code so far, but rustc does
emit it for an upcoming refactoring.
2022-11-14 11:37:45 +08:00
David Nadlinger
4819016a3c firmware/ksupport: Document rpc_recv alignment requirements [nfc] 2022-11-14 11:37:45 +08:00
af0b94bb34 rtio_clock: remove 150MHz support 2022-11-01 08:12:54 +08:00
5cd57e8688 rtio_clocking: switch clocks and reboot 2022-11-01 08:12:54 +08:00
kk1050
46fb8916bb
update SEEN_ASYNC_ERRORS in destination_survey 2022-06-18 15:46:49 +08:00
f79f7db3a2 dyld: handle rebind on symbols relocated by CALL_PLT 2022-06-01 12:44:33 +08:00
872f8f039f dyld: support additional RV32 reloc types
The support of LO12 type requires the runtime linker to find the corresponding HI20 symbol. resolve_rela needs the entire relocation section for that.
2022-06-01 12:44:33 +08:00
50495097e5 dyld: rename pltrel to jmprel
nac3ld will not generate PLT & its relocation section. There might not be a pltrel in that case.
On the other hand, rebinding will not be limited to the symbols in the PLT when linked with nac3ld.
Thus the renaming.
2022-06-01 12:44:33 +08:00
4bdb4c8e11 config: error instead of empty value if key not found 2022-05-19 16:48:59 +08:00
50dbda4f43 Use new ip_addr_storage module instead of net_settings
Necessary to avoid needing the alloc only trait impls in net_settings
when compiling the bootloader.
2022-04-24 10:10:43 +08:00
95378cf9c9 Centralise all uses of the IPv4 index in net_settings.rs 2022-04-24 10:10:43 +08:00
671453938b Require explicitly closing TcpStreams
Instead of automatically closing and draining the TcpStream in the Drop
implementation instead expect the user to call TcpStream::close.
Add close called to all users of TcpStream.
Document the requirement to call close on TcpListener::accept, this seems
to be the only way to get a new TcpStream at the moment.
2022-04-24 10:10:43 +08:00
1fe59d27dc Use an Ipv4AddrConfig enum instead of the USE_DHCP constant 2022-04-24 10:10:43 +08:00
73082d116f Ensure that pending data is sent when closing sockets
This is only necessary if close hasn't been called on the socket
but that's not always done. e.g. by the core analyzer server.
2022-04-24 10:10:43 +08:00
596b9a265c Prefer DHCP to the built-in static IPs
Signed-off-by: Michael Birtwell <michael.birtwell@oxionics.com>
2022-04-24 10:10:42 +08:00
6ffb1f83ee DHCP support for core device firmware
DHCP is enabled by setting the `ip` config entry to "use_dhcp". Reusing this
config field rather than creating a new one means that there is no ambiguity
over which config field takes precedence.

Adds a thread to configure the interface based on DHCP events
Adds a `Dhcpv4Socket` as a wrapper around smoltcp's version
Formalises the storage of the IP addresses so that we can update one in
another module.

There's also a workaround for the first DHCP discover packet frequently
going missing.

Signed-off-by: Michael Birtwell <michael.birtwell@oxionics.com>
2022-04-24 10:10:14 +08:00
c60de48a30 Upgrade smoltcp 0.6.0 -> 0.8.0
Main changes:
Deal with interfaces now being generic over mediums, update interface name
and initialisation.
Interfaces now own their sockets. So we store a reference to the Interface
instead of the SocketSet in Scheduler and IO.
Sockets are no longer reference counted. We never called the function to
increase the socket's reference count, so now we just remove it where it
was previously released. This will result in the socket being dropped at
a different time, but I think that should be fine.

Tested firmware upload to the bootloader and spamming artiq_coremgmt log
calls to download the log from the firmware.

Signed-off-by: Michael Birtwell <michael.birtwell@oxionics.com>
2022-04-24 10:09:27 +08:00
c82c358f3a runtime: provide/fix more libc mem functions 2022-03-28 13:33:57 +08:00
723f41c78b runtime: fix EXCEPTION_ID_LOOKUP 2022-03-26 20:10:24 +08:00
866a83796a firmware: add UnwrapNoneError exception 2022-03-26 15:28:13 +08:00
65d2dd0173 fix compilation warning 2022-03-20 16:15:01 +08:00
922d2b1619 drop support for big-endian moninj 2022-03-19 22:58:31 +08:00
aff569b2c3 firmware: support 64-bit moninj probes 2022-03-17 19:56:07 +08:00
a159ef642d drtio: demote default routing table message to info 2022-03-16 21:22:35 +08:00
ebfeb1869f firmware: use &CSlice for lists 2022-03-10 16:30:22 +08:00
8415151866 update copyright year 2022-03-10 11:56:16 +08:00
232f28c0e8 kern_hw: fix return type 2022-03-04 15:16:14 +08:00
51fa1b5e5e drtio: fix i2c switch 2022-03-04 15:16:14 +08:00
a85b4d5f5e
I2C API for PCA9547 support (#1860) 2022-03-01 15:07:53 +08:00
0da7b83176 runtime: add nac3 exception symbols 2022-02-23 11:04:53 +08:00
David Nadlinger
e45cb217be firmware: Explicitly use wrapping integer math in PRNGs
Patch by Hannah McLaughlin; apparently, the overflow actually
doesn't get checked/reported without `opt-level = 2` and
`lto = "thin"`.
2022-02-03 23:57:17 +00:00
Steve Fan
34008b7a21
Backport of "fixes alignment and size problem" from artiq-zynq (#1841) 2022-01-28 20:49:55 +08:00