diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2012-07-05 11:09:25 +0200 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2012-07-05 11:09:25 +0200 |
commit | d4f9b162481e41076dd6520141b89db25e530d2d (patch) | |
tree | ae14dc95a001da0e5026cb01db8fb81f9223d0b2 /samsung-ipc/device | |
parent | 9243252c706d7d8b2e42625b6af73231bace40d6 (diff) | |
download | external_libsamsung-ipc-d4f9b162481e41076dd6520141b89db25e530d2d.zip external_libsamsung-ipc-d4f9b162481e41076dd6520141b89db25e530d2d.tar.gz external_libsamsung-ipc-d4f9b162481e41076dd6520141b89db25e530d2d.tar.bz2 |
XMM6260 I9250: Renamed and moved structures
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'samsung-ipc/device')
-rw-r--r-- | samsung-ipc/device/xmm6260/fwloader_i9250.c | 51 | ||||
-rw-r--r-- | samsung-ipc/device/xmm6260/fwloader_i9250.h | 43 |
2 files changed, 49 insertions, 45 deletions
diff --git a/samsung-ipc/device/xmm6260/fwloader_i9250.c b/samsung-ipc/device/xmm6260/fwloader_i9250.c index af7d541..f0e6222 100644 --- a/samsung-ipc/device/xmm6260/fwloader_i9250.c +++ b/samsung-ipc/device/xmm6260/fwloader_i9250.c @@ -23,41 +23,11 @@ #include "ipc_private.h" #include "fwloader_i9250.h" -typedef struct { - uint32_t total_size; - uint16_t hdr_magic; - uint16_t cmd; - uint16_t data_size; -} __attribute__((packed)) bootloader_cmd_hdr_t; - -#define DECLARE_BOOT_CMD_HEADER(name, code, size) \ -bootloader_cmd_hdr_t name = {\ - .total_size = size + 10,\ - .hdr_magic = 2,\ - .cmd = code,\ - .data_size = size,\ -} - -typedef struct { - uint16_t checksum; - uint16_t tail_magic; - uint8_t unknown[2]; -} __attribute__((packed)) bootloader_cmd_tail_t; - -#define DECLARE_BOOT_TAIL_HEADER(name, checksum) \ -bootloader_cmd_tail_t name = {\ - .checksum = checksum,\ - .tail_magic = 3,\ - .unknown = "\xea\xea",\ -} - /* * Locations of the firmware components in the Samsung firmware */ -static struct xmm6260_offset { - size_t offset; - size_t length; -} i9250_radio_parts[] = { + +struct i9250_radio_part i9250_radio_parts[] = { [PSI] = { .offset = 0, .length = 0xf000, @@ -80,16 +50,7 @@ static struct xmm6260_offset { } }; -/* - * on I9250, all commands need ACK and we do not need to - * allocate a fixed size buffer - */ - -struct { - unsigned code; - bool long_tail; - bool no_ack; -} i9250_boot_cmd_desc[] = { +struct i9250_boot_cmd_desc i9250_boot_cmd_desc[] = { [SetPortConf] = { .code = 0x86, .long_tail = 1, @@ -408,9 +369,9 @@ static int bootloader_cmd(fwloader_context *ctx, _d("received ack"); hexdump(cmd_data, ack_length + 4); - bootloader_cmd_hdr_t *ack_hdr = (bootloader_cmd_hdr_t*)cmd_data; - bootloader_cmd_tail_t *ack_tail = (bootloader_cmd_tail_t*) - (cmd_data + ack_length + 4 - sizeof(bootloader_cmd_tail_t)); + struct i9250_boot_cmd_header *ack_hdr = (struct i9250_boot_cmd_header*)cmd_data; + struct i9250_boot_tail_header *ack_tail = (struct i9250_boot_tail_header*) + (cmd_data + ack_length + 4 - sizeof(struct i9250_boot_tail_header)); _d("ack code 0x%x checksum 0x%x", ack_hdr->cmd, ack_tail->checksum); if (ack_hdr->cmd != header.cmd) { diff --git a/samsung-ipc/device/xmm6260/fwloader_i9250.h b/samsung-ipc/device/xmm6260/fwloader_i9250.h index d398e31..41deb28 100644 --- a/samsung-ipc/device/xmm6260/fwloader_i9250.h +++ b/samsung-ipc/device/xmm6260/fwloader_i9250.h @@ -54,6 +54,49 @@ #define BL_RESET_MAGIC "\x01\x10\x11\x00" #define BL_RESET_MAGIC_LEN 4 +struct i9250_radio_part { + size_t offset; + size_t length; +}; + +/* + * on I9250, all commands need ACK and we do not need to + * allocate a fixed size buffer + */ +struct i9250_boot_cmd_desc { + unsigned code; + bool long_tail; + bool no_ack; +}; + +struct i9250_boot_cmd_header { + uint32_t total_size; + uint16_t hdr_magic; + uint16_t cmd; + uint16_t data_size; +} __attribute__((packed)); + +#define DECLARE_BOOT_CMD_HEADER(name, code, size) \ +struct i9250_boot_cmd_header name = {\ + .total_size = size + 10,\ + .hdr_magic = 2,\ + .cmd = code,\ + .data_size = size,\ +} + +struct i9250_boot_tail_header { + uint16_t checksum; + uint16_t tail_magic; + uint8_t unknown[2]; +} __attribute__((packed)); + +#define DECLARE_BOOT_TAIL_HEADER(name, checksum) \ +struct i9250_boot_tail_header name = {\ + .checksum = checksum,\ + .tail_magic = 3,\ + .unknown = "\xea\xea",\ +} + #endif // vim:ts=4:sw=4:expandtab |