Project

General

Profile

XMMUpstreaming » History » Revision 10

Revision 9 (Denis 'GNUtoo' Carikli, 02/10/2022 04:52 PM) → Revision 10/25 (Denis 'GNUtoo' Carikli, 02/10/2022 04:52 PM)

h1. XMMUpstreaming 

 {{toc}} 

 h2. Analysis of Replicant 9 Linux 5.2 modem branch 

 These were cleaned up and ported from forkbomb's code: 
 <pre> 
 b4c2df98ed6f misc: xmm6262: Add Samsung IPC USB modem firmware download module 
 77b55273bd6e net: usb: add Samsung IPC-over-HSIC driver 
 f9ae2d1697fa net: add Samsung IPC interface driver 
 7806adad4507 HACK: usb: host: ehci-exynos: add ehci_power sysfs node 
 82c317b0da5e HACK: add modem power on/off driver 
 28e5b460f920 HACK: usb: ehci_exynos: enable OHCI_SUSP_LEGACY 
 e7c122b770c1 ARM: dts: EXYNOS: add 3G modem nodes to midas boards 
 c3201527f7ea ARM: dts: split Exynos 4412 N710x boards up 
 5b55f03cda8c ARM: dts: EXYNOS: add Samsung IPC modem support 
 eca381876d5e ARM: dts: EXYNOS: enable HSIC0 on midas boards 
 7ec9129e3221 replicant_*_defconfig: extend cmdline to get IMSI and other information 
 54c196380507 replicant_*_defconfig: Add modem support 
 [...] 
 0ecfebd2b524 Linux 5.2 
 </pre> 

 If we look at the drivers only (not the dts or config changes, or hacks in pre-existing code, we are left with): 
 <pre> 
 b4c2df98ed6f misc: xmm6262: Add Samsung IPC USB modem firmware download module 
 77b55273bd6e net: usb: add Samsung IPC-over-HSIC driver 
 f9ae2d1697fa net: add Samsung IPC interface driver 
 82c317b0da5e HACK: add modem power on/off driver 
 </pre> 

 We'd also need to find a way to fix these: 
 <pre> 
 7806adad4507 HACK: usb: host: ehci-exynos: add ehci_power sysfs node 
 28e5b460f920 HACK: usb: ehci_exynos: enable OHCI_SUSP_LEGACY 
 </pre> 


 So we'd probably need to have something like that instead: 
 1. A driver for the SIPC (Samsung IPC) protocol (f9ae2d1697fa net: add Samsung IPC interface driver) 
 2. A driver for the SIPC (Samsung IPC) transport on top of HSIC and the protocol (77b55273bd6e net: usb: add Samsung IPC-over-HSIC driver). 
 3. A modem driver with: 
 ** The GPIO handling like drivers/hsi/clients/nokia-modem.c (some GPIOs probably cannot be handled in userspace like gpio_pda_active (see [[XMMBoot#GPIOs-usage]] for more details) (82c317b0da5e HACK: add modem power on/off driver) 
 ** The firmware loading code (b4c2df98ed6f misc: xmm6262: Add Samsung IPC USB modem firmware download module) 
 ** Probably some of the hacks here. For instance GPIO input IRQ -> hsic bus reset 

 So we have: Userspace <-> SIPC protocol <-> SIPC transport <-> HSIC 

 However I'm not sure about certain things: 
 * The SIPC protocol is huge and has different userspace interfaces. Maybe it could be split? 
 * The SIPC transport driver uses an USB id table (the modem ID once booted). => Should we keep the IDs in it or move them in the modem driver instead? 

 Also look at the motorolla cpcap driver for the droid4. The architecture is different though: While it uses USB, it's tied to Qualcomm modem drivers (CDC) which probably doesn't have a specific protocol beside the multiplexing of the UART lines and network interfaces, though CDC could be seen as a specific protocol 

 h2. Analysis of the architecture of the drivers made by Simon Shields 

 Simon Shields wrote some drivers that work on top of upstream Linux and that were made to work in at least two conditions: 
 * With the Replicant 11 kernel under Parabola and with Simon Shields patches for libsamsung-ipc being reworked/rebased 
 * With a Galaxy S as part of some other project (PostmarketOS ?) (TODO: Add mailing list link and reference) 

 h3. Firmware loading and GPIO driver 

 TODO 

 h3. Main drivers 

 

 h4. Write to /dev/umts_ipc 

 <pre> 





 +----------------+          +---------------+                                                                                                                       +--------------+ 
 | libsamsung-ipc | -----> | /dev/umts_ipc | -----> drivers/net/sipc/miscdev.c: .write -> sipc_misc_write( [...] ) {    [...] // enqueue data to tx_queue_raw } -> | tx_queue_raw | 
 +----------------+          +---------------+                                                                                                                       +--------------+ 
 </pre>