aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2019-09-12 17:23:14 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2019-09-12 17:48:11 +0200
commit5a1f981743c0df1d1686632e8897d455b9da18a9 (patch)
treeda04027e9f9199ab781f68c6cc6368f724522ca5 /samsung-ipc
parent61560a66a1d3424fef4a11c4136c47d1212bc5e6 (diff)
downloadhardware_replicant_libsamsung-ipc-history/modem_1519_0020_lsusb.tar.gz
hardware_replicant_libsamsung-ipc-history/modem_1519_0020_lsusb.tar.bz2
hardware_replicant_libsamsung-ipc-history/modem_1519_0020_lsusb.zip
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'samsung-ipc')
-rw-r--r--samsung-ipc/devices/generic/generic.c18
-rw-r--r--samsung-ipc/modems/xmm626/xmm626_sec_modem.c11
2 files changed, 22 insertions, 7 deletions
diff --git a/samsung-ipc/devices/generic/generic.c b/samsung-ipc/devices/generic/generic.c
index 97cf831..e5ce033 100644
--- a/samsung-ipc/devices/generic/generic.c
+++ b/samsung-ipc/devices/generic/generic.c
@@ -88,6 +88,8 @@ int generic_boot(struct ipc_client *client)
}
ipc_client_log(client, "Turned the modem on");
+ system("lsusb");
+
rc = 0;
do {
modem_boot_fd = open(XMM626_SEC_MODEM_BOOT0_DEVICE, O_RDWR | O_NOCTTY | O_NONBLOCK);
@@ -102,6 +104,7 @@ int generic_boot(struct ipc_client *client)
goto error;
}
ipc_client_log(client, "Opened modem boot device");
+ system("lsusb");
p = (unsigned char *) modem_image_data + GENERIC_PSI_OFFSET;
@@ -127,6 +130,7 @@ int generic_boot(struct ipc_client *client)
goto error;
}
ipc_client_log(client, "Sent XMM626 HSIC port config");
+ system("lsusb");
p = (unsigned char *) modem_image_data + GENERIC_SEC_START_OFFSET;
@@ -145,6 +149,7 @@ int generic_boot(struct ipc_client *client)
goto error;
}
ipc_client_log(client, "Sent XMM626 HSIC firmware");
+ system("lsusb");
rc = xmm626_hsic_nv_data_send(client, modem_boot_fd);
if (rc < 0) {
@@ -159,6 +164,7 @@ int generic_boot(struct ipc_client *client)
goto error;
}
ipc_client_log(client, "Sent XMM626 HSIC SEC end");
+ system("lsusb");
rc = xmm626_hsic_hw_reset_send(client, modem_boot_fd);
if (rc < 0) {
@@ -166,6 +172,7 @@ int generic_boot(struct ipc_client *client)
goto error;
}
ipc_client_log(client, "Sent XMM626 HSIC HW reset");
+ system("lsusb");
usleep(300000);
@@ -173,6 +180,8 @@ int generic_boot(struct ipc_client *client)
if (rc < 0) {
ipc_client_log(client, "Waiting for host wake failed");
}
+ ipc_client_log(client, "Waited for host wake");
+ system("lsusb");
rc = xmm626_sec_modem_hci_power(0);
@@ -180,21 +189,26 @@ int generic_boot(struct ipc_client *client)
ipc_client_log(client, "Turning the modem off failed");
goto error;
}
-
+ ipc_client_log(client, "Turned off the modem");
+ system("lsusb");
+
rc = xmm626_sec_modem_link_get_hostwake_wait(modem_link_fd);
if (rc < 0) {
ipc_client_log(client, "Waiting for host wake failed");
}
ipc_client_log(client, "Waited for host wake");
+ system("lsusb");
rc = xmm626_sec_modem_hci_power(1);
-
if (rc < 0) {
ipc_client_log(client, "Turning the modem on failed");
goto error;
}
+ ipc_client_log(client, "Turned the modem on");
+ system("lsusb");
usleep(300000);
+ ipc_client_log(client, "%s complete", __FUNCTION__);
rc = 0;
goto complete;
diff --git a/samsung-ipc/modems/xmm626/xmm626_sec_modem.c b/samsung-ipc/modems/xmm626/xmm626_sec_modem.c
index 737db3f..4c764ae 100644
--- a/samsung-ipc/modems/xmm626/xmm626_sec_modem.c
+++ b/samsung-ipc/modems/xmm626/xmm626_sec_modem.c
@@ -166,14 +166,15 @@ int xmm626_sec_modem_link_get_hostwake_wait(
i = 0;
for (i = 0; i < 10; i++) {
/* !gpio_get_value (hostwake) */
- status = sysfs_value_read(XMM626_SEC_HOSTWAKE_PATH);
- if (status == 0) /* invert: return true when hostwake is low */
- return 0;
+// status = sysfs_value_read(XMM626_SEC_HOSTWAKE_PATH);
+ printf("%s: i=%d read(%s) => status: %d\n", __FUNCTION__, i, XMM626_SEC_HOSTWAKE_PATH, status);
+// if (status == 0) /* invert: return true when hostwake is low */
+ // return 0;
- usleep(50000);
+ usleep(500000);
}
- return -1;
+ return 0;
}
int xmm626_sec_modem_fmt_send(struct ipc_client *client,