diff options
author | Simon Busch <morphis@gravedo.de> | 2012-08-27 21:11:02 +0200 |
---|---|---|
committer | Simon Busch <morphis@gravedo.de> | 2012-08-27 21:33:48 +0200 |
commit | d500d716dfe4bd9c6dc435b7c11f7c31f2be0594 (patch) | |
tree | ee9b8a984573737a6a87c8bf8e3b458ddcf1bf85 /samsung-ipc | |
parent | d4f8a0b572ff1ff927f1234417ead038695e4079 (diff) | |
download | external_libsamsung-ipc-d500d716dfe4bd9c6dc435b7c11f7c31f2be0594.zip external_libsamsung-ipc-d500d716dfe4bd9c6dc435b7c11f7c31f2be0594.tar.gz external_libsamsung-ipc-d500d716dfe4bd9c6dc435b7c11f7c31f2be0594.tar.bz2 |
maguro: try to load radio image from more than on source path
Diffstat (limited to 'samsung-ipc')
-rw-r--r-- | samsung-ipc/device/maguro/maguro_loader.c | 22 | ||||
-rw-r--r-- | samsung-ipc/device/maguro/maguro_loader.h | 1 |
2 files changed, 17 insertions, 6 deletions
diff --git a/samsung-ipc/device/maguro/maguro_loader.c b/samsung-ipc/device/maguro/maguro_loader.c index 84de38d..73a0f86 100644 --- a/samsung-ipc/device/maguro/maguro_loader.c +++ b/samsung-ipc/device/maguro/maguro_loader.c @@ -100,6 +100,12 @@ struct maguro_boot_cmd_desc maguro_boot_cmd_desc[] = { }, }; +#define I9250_RADIO_IMAGE_PATHS_NUM 2 +const char *i9250_radio_image_paths[] = { + "/dev/block/platform/omap/omap_hsmmc.0/by-name/radio", + "/dev/mmcblk0p9" +}; + static int maguro_send_image(struct ipc_client *client, struct modemctl_io_data *io_data, enum xmm6260_image type) { @@ -652,18 +658,24 @@ fail: int maguro_modem_bootstrap(struct ipc_client *client) { - int ret = -1; + int ret = -1, n = 0, fd = -1; struct modemctl_io_data io_data; memset(&io_data, 0, sizeof(client, io_data)); - io_data.radio_fd = open(I9250_RADIO_IMAGE, O_RDONLY); + io_data.radio_fd = -1; + for (n = 0; n < I9250_RADIO_IMAGE_PATHS_NUM; n++) { + fd = open(i9250_radio_image_paths[n], O_RDONLY); + if (fd > 0) { + io_data.radio_fd = fd; + ipc_client_log(client, "opened radio image %s, fd=%d", i9250_radio_image_paths[n], io_data.radio_fd); + break; + } + } + if (io_data.radio_fd < 0) { ipc_client_log(client, "Error: failed to open radio firmware"); goto fail; } - else { - ipc_client_log(client, "opened radio image %s, fd=%d", I9250_RADIO_IMAGE, io_data.radio_fd); - } if (fstat(io_data.radio_fd, &io_data.radio_stat) < 0) { ipc_client_log(client, "Error: failed to stat radio image, error %s", strerror(errno)); diff --git a/samsung-ipc/device/maguro/maguro_loader.h b/samsung-ipc/device/maguro/maguro_loader.h index e8bb448..bc3f5bd 100644 --- a/samsung-ipc/device/maguro/maguro_loader.h +++ b/samsung-ipc/device/maguro/maguro_loader.h @@ -27,7 +27,6 @@ #ifndef __MAGURO_LOADER_H__ #define __MAGURO_LOADER_H__ -#define I9250_RADIO_IMAGE "/dev/block/platform/omap/omap_hsmmc.0/by-name/radio" #define I9250_SECOND_BOOT_DEV "/dev/umts_boot1" #define I9250_BOOT_LAST_MASK 0x0000ffff |