4

My searches on the web didn't provide suitable answers to these questions:

1) Where is the baseband firmware stored?

My understanding is that this particular firmware is a RTOS built for the Baseband Processor (BP/CP). BP is part of a SoC, so it uses its own RAM and its own storage for the firmware.

Is the firmware really stored in another eMMC than the Android firmware ?

2) How does Android interact with the baseband firmware?

Again, my understanding (which may be incorrect) is that the BP communicates directly with the AP via a serial connection UART trough Radio Interface Layer (RIL). This RIL interact with Android telephony services.

When does the baseband firmware take action ?

3) When the modem/baseband/radio partition is used ?

It seems to me that it only contains the firmware.

One thing I've found is that this partition isn't mounted during Android runtime. Is it only mounted for modem firmware update ?

1
  • rmt_storage also provides BP access to IMEI which is stored on signed partitions like EFS, MODEMST1, MODEMST2, FSG, FSC along with modem firmware files. MODEM is usually first partition with FAT filesystem. All or some of these partitions may get firmware updates from OEM/SoC vendor. Like rmt_storage, rild is a closed source binary from vendor which facilitates communication between Android (telephony stack) and BP through kernel. Fingerprint, rmnet LTE/3G interface, RPM, TEE, GPS, Modem Diagnostic Mode etc. also communicate with AP using SMD or possibly UART, and their userspace blobs Dec 14, 2019 at 19:16

1 Answer 1

6

Is the firmware really stored in another eMMC than the Android firmware?

No. Baseband firmware, kernel and userspace Android are all stored on the same eMMC (there might be some exception but I don't know of). Some SoCs have boot area partitions which are somewhat isolated at hardware level (usually used for bootloaders) but technically those are also on the same eMMC. So are Replay Protected Memory Block (RPMB) partitions.

How does Android interact with the baseband firmware?

Your understanding is correct that Communication / Baseband Processors (CP/BP or modem) are completely isolated from Application Processor (AP, which runs Android OS) and they run their own RTOS. Communication between AP and BP can be through multiple possible channels but mostly those are proprietary just like BPs themselves (not sure why: if giants like Qualcomm are keeping backdoors, or hiding their security vulnerabilities, or don't want to put users' privacy at stake). On Qualcomm devices, for instance, its in-kernel implementation is called Shared Memory Device/Driver (SMD).

BP also includes a Digital Signal Processor (DSP) which is used for multimedia processing. Both Modem and DSP have their mountable partitions on eMMC (at least on Qualcomm devices) which they access through kernel using RPC mechanism. This old document states:

"No new hardware is required. An eMMC card will have 2 partitions reserved for modem storage.
...
All the modem requests will be handled by a user space program and the remote storage RPC client will provide an interface to the user application to receive the requests from modem and also to send the status of requests to modem."

In-kernel implementation includes just an RPC client, while a closed source userspace daemon (Remote Storage) handles the actual communication with the modem. Though privacy advocates have issues with this approach. Since the kernel interfaces of SMD or other communication drivers are not documented, only the closed source binary blobs (HALs, provided by SoC vendors) in userspace can communicate with them (e.g. rmt_storage uses Userspace I/O API), while Android framework communicates with the HALs. Reference implementations of HALs are part of AOSP.

Is it only mounted for modem firmware update?

No. MODEM is usually first partition on eMMC with FAT filesystem, while DSP has EXT4. Both have entries in fstab and are mounted on every boot. rmt_storage also provides BP access to IMEI which is stored on signed partitions like EFS, MODEMST1, MODEMST2, FSG, FSC along with modem firmware files. All of these partitions have no filesystems but are binary blobs written to raw partitions. So they aren't mounted. All or some of these partitions may get OTA firmware updates from OEM/SoC vendors.

Like rmt_storage, Radio Interface Layer Daemon (rild) is another HAL from vendor which facilitates communication between Android's telephony stack and modem's LTE/3G/2G interface through kernel using control and data transfer protocols like RMNET, QMI etc. Other isolated components including RPM, GPS, Modem Diagnostic Mode and TEE (not sure about SE) also communicate with AP using similar communication channels in kernel (which also include UART) and their respective HALs in userspace. RPM (Resource and Power Management) and TEE (Qualcomm's TtustZone) have also their partitions on eMMC, both contain ELF executable binaries.


RESOURCES:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .