blob: fedfe128b22d5a457b28b9d3c258483177f5aee4 [file] [log] [blame]
Jocelyn Dang08bb3a92018-10-17 16:26:50 -07001// Copyright 2018 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
Todd Eisenberger35f03c802018-12-27 14:16:00 -08004library fuchsia.hardware.usb.fwloader;
Jocelyn Dang08bb3a92018-10-17 16:26:50 -07005
Jocelyn Dangb3dab2c2018-12-05 10:57:24 -08006using fuchsia.mem;
Jocelyn Dang08bb3a92018-10-17 16:26:50 -07007using zx;
8
Alex Zaslavskye3b39f22021-07-17 18:09:45 +00009type PrebuiltType = strict enum : uint8 {
Jocelyn Dang9eea02b12018-12-07 10:06:03 -080010 /// Test firmware that can be loaded onto the USB test device for running USB tests.
11 TESTER = 1;
12 /// Flash programmer used for loading a new bootloader onto the USB test device I2C EEPROM.
13 FLASH = 2;
14 /// Bootloader for the USB test device.
15 BOOT = 3;
16};
17
Alex Zaslavskye3b39f22021-07-17 18:09:45 +000018@for_deprecated_c_bindings
Pascal Perezfaa49b22019-02-19 11:01:18 -050019protocol Device {
Jocelyn Dang08bb3a92018-10-17 16:26:50 -070020 /// Loads the prebuilt firmware onto the USB test device, and renumerates as the new device.
Alex Zaslavskye3b39f22021-07-17 18:09:45 +000021 LoadPrebuiltFirmware(struct {
22 prebuilt_type PrebuiltType;
23 }) -> (struct {
24 s zx.status;
25 });
Jocelyn Dang08bb3a92018-10-17 16:26:50 -070026
27 /// Loads the firmware onto the USB test device, and renumerates as the new device.
Alex Zaslavskye3b39f22021-07-17 18:09:45 +000028 LoadFirmware(resource struct {
29 firmware fuchsia.mem.Buffer;
30 }) -> (struct {
31 s zx.status;
32 });
Jocelyn Dang08bb3a92018-10-17 16:26:50 -070033};