aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2012-07-05 11:00:32 +0200
committerPaul Kocialkowski <contact@paulk.fr>2012-07-05 11:00:32 +0200
commit9243252c706d7d8b2e42625b6af73231bace40d6 (patch)
treec805ab9064c6a7c668bcd5ebc13969546dd9f619 /samsung-ipc
parentccbc15dc1a83935e4fc8d127151fe58fd8045769 (diff)
downloadexternal_libsamsung-ipc-9243252c706d7d8b2e42625b6af73231bace40d6.zip
external_libsamsung-ipc-9243252c706d7d8b2e42625b6af73231bace40d6.tar.gz
external_libsamsung-ipc-9243252c706d7d8b2e42625b6af73231bace40d6.tar.bz2
XMM6260 I9100: Renamed and moved structures
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'samsung-ipc')
-rw-r--r--samsung-ipc/device/xmm6260/fwloader_i9100.c38
-rw-r--r--samsung-ipc/device/xmm6260/fwloader_i9100.h27
2 files changed, 35 insertions, 30 deletions
diff --git a/samsung-ipc/device/xmm6260/fwloader_i9100.c b/samsung-ipc/device/xmm6260/fwloader_i9100.c
index dc0673b..f8b4312 100644
--- a/samsung-ipc/device/xmm6260/fwloader_i9100.c
+++ b/samsung-ipc/device/xmm6260/fwloader_i9100.c
@@ -26,10 +26,8 @@
/*
* Locations of the firmware components in the Samsung firmware
*/
-static struct xmm6260_offset {
- size_t offset;
- size_t length;
-} i9100_radio_parts[] = {
+
+struct i9100_radio_part i9100_radio_parts[] = {
[PSI] = {
.offset = 0,
.length = 0xf000,
@@ -52,11 +50,7 @@ static struct xmm6260_offset {
}
};
-struct {
- unsigned code;
- size_t data_size;
- bool need_ack;
-} i9100_boot_cmd_desc[] = {
+struct i9100_boot_cmd_desc i9100_boot_cmd_desc[] = {
[SetPortConf] = {
.code = 0x86,
.data_size = 0x800,
@@ -86,25 +80,9 @@ struct {
.code = 0x804,
.data_size = 0x4000,
.need_ack = 0,
- },
+ }
};
-typedef struct {
- uint8_t magic;
- uint16_t length;
- uint8_t padding;
-} __attribute__((packed)) psi_header_t;
-
-typedef struct {
- uint8_t data[76];
-} __attribute__((packed)) boot_info_t;
-
-typedef struct {
- uint16_t check;
- uint16_t cmd;
- uint32_t data_size;
-} __attribute__((packed)) bootloader_cmd_t;
-
static int send_image(fwloader_context *ctx, enum xmm6260_image type) {
int ret = -1;
@@ -151,7 +129,7 @@ fail:
static int send_PSI(fwloader_context *ctx) {
size_t length = i9100_radio_parts[PSI].length;
- psi_header_t hdr = {
+ struct i9100_psi_header hdr = {
.magic = XMM_PSI_MAGIC,
.length = length,
.padding = 0xff,
@@ -252,7 +230,7 @@ static int bootloader_cmd(fwloader_context *ctx, enum xmm6260_boot_cmd cmd,
magic += ptr[i];
}
- bootloader_cmd_t header = {
+ struct i9100_boot_cmd header = {
.check = magic,
.cmd = cmd_code,
.data_size = data_size,
@@ -292,7 +270,7 @@ static int bootloader_cmd(fwloader_context *ctx, enum xmm6260_boot_cmd cmd,
goto done_or_fail;
}
- bootloader_cmd_t ack = {
+ struct i9100_boot_cmd ack = {
.check = 0,
};
if ((ret = receive(ctx->boot_fd, &ack, sizeof(ack))) < 0) {
@@ -337,7 +315,7 @@ done_or_fail:
static int ack_BootInfo(fwloader_context *ctx) {
int ret;
- boot_info_t info;
+ struct i9100_boot_info info;
if ((ret = receive(ctx->boot_fd, &info, sizeof(info))) != sizeof(info)) {
_e("failed to receive Boot Info ret=%d", ret);
diff --git a/samsung-ipc/device/xmm6260/fwloader_i9100.h b/samsung-ipc/device/xmm6260/fwloader_i9100.h
index 7cc18b2..d027416 100644
--- a/samsung-ipc/device/xmm6260/fwloader_i9100.h
+++ b/samsung-ipc/device/xmm6260/fwloader_i9100.h
@@ -48,6 +48,33 @@
#define FW_LOAD_ADDR 0x60300000
#define NVDATA_LOAD_ADDR 0x60e80000
+struct i9100_radio_part {
+ size_t offset;
+ size_t length;
+};
+
+struct i9100_boot_cmd_desc {
+ unsigned code;
+ size_t data_size;
+ bool need_ack;
+};
+
+struct i9100_psi_header {
+ uint8_t magic;
+ uint16_t length;
+ uint8_t padding;
+} __attribute__((packed));
+
+struct i9100_boot_info {
+ uint8_t data[76];
+} __attribute__((packed));
+
+struct i9100_boot_cmd {
+ uint16_t check;
+ uint16_t cmd;
+ uint32_t data_size;
+} __attribute__((packed));
+
#endif
// vim:ts=4:sw=4:expandtab