On Mon, 14 Sep 2020 11:45:28 +0200 Tony Garnock-Jones <[email protected]> wrote:
> This patch series adds support for herolte (Samsung Galaxy S7) devices > to libsamsung-ipc. > > CURRENT STATUS: > > - the modem boots successfully > > - it WILL NOT interact with userland unless something opens > /dev/umts_rfs0 at the same time as /dev/umts_ipc0 is open (see uses > of "rild_ready()" in the kernel source code) > > - one way to get by for now is to repeatedly `cat /dev/umts_rfs0 > >/dev/null` in another terminal Just to make sure we're on the same page, here's what I know about /dev/umts_rfs0 and the modem nv_data. As far as I know, the modem doesn't have access to any storage device. So not only we are expected to load its firmware (which you implemented in this patch set), but are also expected to provide it a way to read and write its data as the nonfree Samsung RIL(s) also do that and the modem firmware also expects that. This is done through the RFS channel. - /dev/umts_rfs0: RFS channel (To let the modem's read/write it's data) - /dev/umts_ipc0: IPC channel (The main protocol) Theses are then used by libsamsung-ipc to communicate to the modem. You can recreate a similar architecture with a Single board computer that runs GNU/Linux: You remove any storage and load the bootloader through the UART (from your laptop), along with a kernel and a filesystem in RAM. That single board computer then boots from that kernel and RAM filesystem, and then use a network filesystem like NFS to store its data, and it would communicate back and forth with a network protocol like TCP/IP with your laptop. With libsamsung-ipc, the modem only has access to very few files: nv_data.bin that contains its data, and potentially nv_data.bin.md5 as well which contains a checksum of the nv_data.bin file. I don't know much about the differences between the NV partition and the nv_data.bin, as most of their content is still unknown as far as I can tell, but as the nv_data.bin contains the IMEI, it will be needed for your phone to get on the network. As we don't know how to recreate the EFS nor the nv_data.bin yet, it's also highly encouraged to do backups of them. So far we can force the modem to create an nv_data.bin file on some devices but then we end up with a bogus IMEI which prevent us from registering on the network. There is work done toward creating the nv_data.bin from scratch, but we're far from being there yet, especially because there seem to be several EFS versions, with the later being harder to work with. > 1. What should be done about the phone's need for /dev/umts_rfs0 to > be open at the same time as /dev/umts_ipc0 is open? For the record, you pointed me to the source of that code responsible of that check in the kernel #replicant: < tonyg> rild_ready at 17.0 is here: https://github.com/ivanmeler/android_kernel_samsung_herolte/blob/lineage-17.0/drivers/misc/modem_v1/link_device_shmem.c#L260 I think that the problem you are having comes from the fact that the ipc-modem tool is not complete enough: Along with the ipc-test tool, they were mainly only used during very early developments, but they are still good enough to test very basic functionality like modem bootstrap. In contrast, in libsamsung-ril we open both the /dev/ipc_fmt0 and /dev/ipc_rfs0 channels[1], whereas ipc-modem only opens the /dev/ipc_fmt0 with that code: > client_fmt = ipc_client_create(IPC_CLIENT_TYPE_FMT); So the solution would probably be to try to do something like that in the tools you use for testing: > client_rfs = ipc_client_create(IPC_CLIENT_TYPE_RFS); and see if you need extra code to make it happy. In the long run, if you want to use libsamsung-ipc with your device, you probably need to combine libsamsung-ipc with a higher level daemon. Here's the status of the various ones that are available: - libsamsung-ril: It's meant to work with Android and has not been tested on GNU/Linux yet. It works on Android 6 but not on Android 9 or 10 yet as I need to convert it to the new SIM API for that, but I already started working on it as we need that done for Replicant 10. - Ofono: Jonathan Bakker (xcracer99 on github) has patches to be able to use libsamsung-ipc with Ofono. - In the past freesmartphone.org could also use libsamsung-ril, but freesmartphone.org is unmaintained nowadays. It is also possible to write your own daemon. > 2. What's going on with that IPC_SMS_DEVICE_READY loop? I don't know. It could be a bug in libsamsung-ipc. Given the name of the message (It looks a bit like SIM READY), and the fact that we have a patch fixing a bug preventing access to the SIM card in review, it could be worth retrying after I push the patch. References: ----------- [1]https://git.replicant.us/replicant/hardware_replicant_libsamsung-ril/tree/ipc.c#n781 Denis.
pgpczWwVfM4Fx.pgp
Description: OpenPGP digital signature
_______________________________________________ Replicant mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/replicant
