[Replicant] [libsamsung-ipc] [PATCH 05/11] modems: xmm626: abstract xmm626_kernel_smdk4412_firmware_send

Denis 'GNUtoo' Carikli GNUtoo at cyberdimension.org
Sun Oct 11 22:22:16 UTC 2020


The idea is to build an abstraction for loading the various subpartitions
of the modem OS partition in the modem.

To do that we start small and just wrap the various loading function
as-is.

At the end, the function are expected to be generic and the modem
would implement them while the devices will provide a struct with the
relevant subpartition informations.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo at cyberdimension.org>
---
 samsung-ipc/ipc.h                       | 2 ++
 samsung-ipc/modems/modem.c              | 8 ++++++++
 samsung-ipc/modems/modem.h              | 3 +++
 samsung-ipc/modems/xmm626/xmm626_hsic.c | 2 ++
 samsung-ipc/modems/xmm626/xmm626_mipi.c | 2 ++
 5 files changed, 17 insertions(+)

diff --git a/samsung-ipc/ipc.h b/samsung-ipc/ipc.h
index 2135a23..7e51f07 100644
--- a/samsung-ipc/ipc.h
+++ b/samsung-ipc/ipc.h
@@ -81,6 +81,8 @@ struct ipc_client_gprs_specs {
 struct ipc_client_modem_driver_ops {
 	int (*data_send)(struct ipc_client *client, int device_fd,
 			 const void *data,  size_t size, int address);
+	int (*firmware_send)(struct ipc_client *client, int device_fd,
+			     const void *firmware_data, size_t firmware_size);
 };
 
 struct ipc_client_nv_data_specs {
diff --git a/samsung-ipc/modems/modem.c b/samsung-ipc/modems/modem.c
index 9bfd4ae..e3e426d 100644
--- a/samsung-ipc/modems/modem.c
+++ b/samsung-ipc/modems/modem.c
@@ -25,3 +25,11 @@ int modem_data_send(struct ipc_client *client, int device_fd, const void *data,
 	return client->modem_driver_ops->data_send(client, device_fd, data,
 						   size,  address);
 }
+
+int modem_firmware_send(struct ipc_client *client, int device_fd,
+			const void *firmware_data, size_t firmware_size)
+{
+	return client->modem_driver_ops->firmware_send(client, device_fd,
+						       firmware_data,
+						       firmware_size);
+}
diff --git a/samsung-ipc/modems/modem.h b/samsung-ipc/modems/modem.h
index c821760..5c362c6 100644
--- a/samsung-ipc/modems/modem.h
+++ b/samsung-ipc/modems/modem.h
@@ -25,4 +25,7 @@
 int modem_data_send(struct ipc_client *client, int device_fd, const void *data,
 		    size_t size, int address);
 
+int modem_firmware_send(struct ipc_client *client, int device_fd,
+			const void *firmware_data, size_t firmware_size);
+
 #endif /* __SAMSUNG_IPC_MODEM_H__ */
diff --git a/samsung-ipc/modems/xmm626/xmm626_hsic.c b/samsung-ipc/modems/xmm626/xmm626_hsic.c
index 06c1bf8..4e1263d 100644
--- a/samsung-ipc/modems/xmm626/xmm626_hsic.c
+++ b/samsung-ipc/modems/xmm626/xmm626_hsic.c
@@ -33,6 +33,7 @@
 #include "modems/modem.h"
 #include "modems/xmm626/xmm626.h"
 #include "modems/xmm626/xmm626_hsic.h"
+#include "modems/xmm626/xmm626_kernel_smdk4412.h"
 #include "modems/xmm626/xmm626_mipi.h"
 
 int xmm626_hsic_ack_read(__attribute__((unused)) struct ipc_client *client,
@@ -565,4 +566,5 @@ int xmm626_hsic_hw_reset_send(struct ipc_client *client, int device_fd)
 
 struct ipc_client_modem_driver_ops xmm626_hsic_modem_driver_ops = {
 	.data_send = xmm626_hsic_modem_data_send,
+	.firmware_send = xmm626_kernel_smdk4412_firmware_send,
 };
diff --git a/samsung-ipc/modems/xmm626/xmm626_mipi.c b/samsung-ipc/modems/xmm626/xmm626_mipi.c
index b39e712..54adb91 100644
--- a/samsung-ipc/modems/xmm626/xmm626_mipi.c
+++ b/samsung-ipc/modems/xmm626/xmm626_mipi.c
@@ -32,6 +32,7 @@
 #include "ipc.h"
 #include "modems/modem.h"
 #include "modems/xmm626/xmm626.h"
+#include "modems/xmm626/xmm626_kernel_smdk4412.h"
 #include "modems/xmm626/xmm626_mipi.h"
 
 int xmm626_mipi_crc_calculate(const void *data, size_t size)
@@ -626,4 +627,5 @@ int xmm626_mipi_hw_reset_send(struct ipc_client *client, int device_fd)
 
 struct ipc_client_modem_driver_ops xmm626_mipi_modem_driver_ops = {
 	.data_send = xmm626_mipi_modem_data_send,
+	.firmware_send = xmm626_kernel_smdk4412_firmware_send,
 };
-- 
2.28.0



More information about the Replicant mailing list