Commit 5a53e02e authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman

greybus: firmware: Rename to bootrom protocol

Align with Greybus specifications and rename Firmware Protocol driver as
Bootrom Protocol driver.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 0c35631b
......@@ -9,7 +9,7 @@ greybus-y := core.o \
control.o \
svc.o \
svc_watchdog.o \
firmware.o \
bootrom.o \
operation.o \
legacy.o
......
/*
* Greybus bootrom code
*
* Copyright 2016 Google Inc.
* Copyright 2016 Linaro Ltd.
*
* Released under the GPLv2 only.
*/
#ifndef __BOOTROM_H
#define __BOOTROM_H
int gb_bootrom_init(void);
void gb_bootrom_exit(void);
#endif /* __BOOTROM_H */
......@@ -10,7 +10,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#define CREATE_TRACE_POINTS
#include "firmware.h"
#include "bootrom.h"
#include "greybus.h"
#include "greybus_trace.h"
#include "legacy.h"
......@@ -243,10 +243,10 @@ static int __init gb_init(void)
goto error_operation;
}
retval = gb_firmware_init();
retval = gb_bootrom_init();
if (retval) {
pr_err("gb_firmware_init failed\n");
goto error_firmware;
pr_err("gb_bootrom_init failed\n");
goto error_bootrom;
}
retval = gb_legacy_init();
......@@ -258,8 +258,8 @@ static int __init gb_init(void)
return 0; /* Success */
error_legacy:
gb_firmware_exit();
error_firmware:
gb_bootrom_exit();
error_bootrom:
gb_operation_exit();
error_operation:
gb_hd_exit();
......@@ -275,7 +275,7 @@ module_init(gb_init);
static void __exit gb_exit(void)
{
gb_legacy_exit();
gb_firmware_exit();
gb_bootrom_exit();
gb_operation_exit();
gb_hd_exit();
bus_unregister(&greybus_bus_type);
......
/*
* Greybus firmware code
*
* Copyright 2015 Google Inc.
* Copyright 2015 Linaro Ltd.
*
* Released under the GPLv2 only.
*/
#ifndef __FIRMWARE_H
#define __FIRMWARE_H
int gb_firmware_init(void);
void gb_firmware_exit(void);
#endif /* __FIRMWARE_H */
......@@ -43,7 +43,7 @@ enum greybus_protocol {
GREYBUS_PROTOCOL_AUDIO_MGMT = 0x12,
GREYBUS_PROTOCOL_AUDIO_DATA = 0x13,
GREYBUS_PROTOCOL_SVC = 0x14,
GREYBUS_PROTOCOL_FIRMWARE = 0x15,
GREYBUS_PROTOCOL_BOOTROM = 0x15,
GREYBUS_PROTOCOL_CAMERA_DATA = 0x16,
/* ... */
GREYBUS_PROTOCOL_RAW = 0xfe,
......@@ -72,7 +72,7 @@ enum greybus_class_type {
GREYBUS_CLASS_AUDIO = 0x12,
/* 0x13 is unused */
/* 0x14 is unused */
GREYBUS_CLASS_FIRMWARE = 0x15,
GREYBUS_CLASS_BOOTROM = 0x15,
/* ... */
GREYBUS_CLASS_RAW = 0xfe,
GREYBUS_CLASS_VENDOR = 0xff,
......
......@@ -212,70 +212,70 @@ struct gb_control_timesync_authoritative_request {
#define GB_APB_REQUEST_CPORT_FEAT_EN 0x0b
#define GB_APB_REQUEST_CPORT_FEAT_DIS 0x0c
/* Firmware Protocol */
/* Version of the Greybus firmware protocol we support */
#define GB_FIRMWARE_VERSION_MAJOR 0x00
#define GB_FIRMWARE_VERSION_MINOR 0x01
/* Greybus firmware request types */
#define GB_FIRMWARE_TYPE_VERSION 0x01
#define GB_FIRMWARE_TYPE_FIRMWARE_SIZE 0x02
#define GB_FIRMWARE_TYPE_GET_FIRMWARE 0x03
#define GB_FIRMWARE_TYPE_READY_TO_BOOT 0x04
#define GB_FIRMWARE_TYPE_AP_READY 0x05 /* Request with no-payload */
#define GB_FIRMWARE_TYPE_GET_VID_PID 0x06 /* Request with no-payload */
/* Greybus firmware boot stages */
#define GB_FIRMWARE_BOOT_STAGE_ONE 0x01 /* Reserved for the boot ROM */
#define GB_FIRMWARE_BOOT_STAGE_TWO 0x02 /* Firmware package to be loaded by the boot ROM */
#define GB_FIRMWARE_BOOT_STAGE_THREE 0x03 /* Module personality package loaded by Stage 2 firmware */
/* Greybus firmware ready to boot status */
#define GB_FIRMWARE_BOOT_STATUS_INVALID 0x00 /* Firmware blob could not be validated */
#define GB_FIRMWARE_BOOT_STATUS_INSECURE 0x01 /* Firmware blob is valid but insecure */
#define GB_FIRMWARE_BOOT_STATUS_SECURE 0x02 /* Firmware blob is valid and secure */
/* Max firmware data fetch size in bytes */
#define GB_FIRMWARE_FETCH_MAX 2000
struct gb_firmware_version_request {
/* Bootrom Protocol */
/* Version of the Greybus bootrom protocol we support */
#define GB_BOOTROM_VERSION_MAJOR 0x00
#define GB_BOOTROM_VERSION_MINOR 0x01
/* Greybus bootrom request types */
#define GB_BOOTROM_TYPE_VERSION 0x01
#define GB_BOOTROM_TYPE_FIRMWARE_SIZE 0x02
#define GB_BOOTROM_TYPE_GET_FIRMWARE 0x03
#define GB_BOOTROM_TYPE_READY_TO_BOOT 0x04
#define GB_BOOTROM_TYPE_AP_READY 0x05 /* Request with no-payload */
#define GB_BOOTROM_TYPE_GET_VID_PID 0x06 /* Request with no-payload */
/* Greybus bootrom boot stages */
#define GB_BOOTROM_BOOT_STAGE_ONE 0x01 /* Reserved for the boot ROM */
#define GB_BOOTROM_BOOT_STAGE_TWO 0x02 /* Bootrom package to be loaded by the boot ROM */
#define GB_BOOTROM_BOOT_STAGE_THREE 0x03 /* Module personality package loaded by Stage 2 firmware */
/* Greybus bootrom ready to boot status */
#define GB_BOOTROM_BOOT_STATUS_INVALID 0x00 /* Firmware blob could not be validated */
#define GB_BOOTROM_BOOT_STATUS_INSECURE 0x01 /* Firmware blob is valid but insecure */
#define GB_BOOTROM_BOOT_STATUS_SECURE 0x02 /* Firmware blob is valid and secure */
/* Max bootrom data fetch size in bytes */
#define GB_BOOTROM_FETCH_MAX 2000
struct gb_bootrom_version_request {
__u8 major;
__u8 minor;
} __packed;
struct gb_firmware_version_response {
struct gb_bootrom_version_response {
__u8 major;
__u8 minor;
} __packed;
/* Firmware protocol firmware size request/response */
struct gb_firmware_size_request {
/* Bootrom protocol firmware size request/response */
struct gb_bootrom_firmware_size_request {
__u8 stage;
} __packed;
struct gb_firmware_size_response {
struct gb_bootrom_firmware_size_response {
__le32 size;
} __packed;
/* Firmware protocol get firmware request/response */
struct gb_firmware_get_firmware_request {
/* Bootrom protocol get firmware request/response */
struct gb_bootrom_get_firmware_request {
__le32 offset;
__le32 size;
} __packed;
struct gb_firmware_get_firmware_response {
struct gb_bootrom_get_firmware_response {
__u8 data[0];
} __packed;
/* Firmware protocol Ready to boot request */
struct gb_firmware_ready_to_boot_request {
/* Bootrom protocol Ready to boot request */
struct gb_bootrom_ready_to_boot_request {
__u8 status;
} __packed;
/* Firmware protocol Ready to boot response has no payload */
/* Bootrom protocol Ready to boot response has no payload */
/* Firmware protocol get VID/PID request has no payload */
struct gb_firmware_get_vid_pid_response {
/* Bootrom protocol get VID/PID request has no payload */
struct gb_bootrom_get_vid_pid_response {
__le32 vendor_id;
__le32 product_id;
} __packed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment