Commit Graph

226 Commits

Author SHA1 Message Date
Arnaud Ferraris
c9d89e1736 d/changelog: release version 0.4.3-1 mobian/0.4.3-1 2022-02-19 15:37:12 +01:00
Arnaud Ferraris
a66852d96d d/watch: fix watch file
Our `watch` file was looking at the wrong URL, fix that.
2022-02-19 15:36:49 +01:00
Arnaud Ferraris
8c9941eef6 debian: small cleanups
`salsa-ci.yml` is no longer needed as we now have our own CI pipelines.
Also delete unneeded newlines from `watch` file.
2022-02-19 15:22:40 +01:00
Arnaud Ferraris
d9778e6ecd d/control: build-depend on scdoc
This is required for building the manpages. Also bump Standards-Version,
no other changes needed.
2022-02-19 15:19:13 +01:00
Arnaud Ferraris
7b46f084d9 New upstream version 0.4.3
eg25-manager v0.4.3

IMPORTANT: this release renames the executable to `eg25-manager` (added
dash). Make sure existing scripts are updated to reflect this change.

Changes:
* improve udev monitoring:
  - filter based on vendor/product ID
  - disable udev monitoring for the PinePhone Pro
* add manpages for `eg25-manager` and its configuration files
  - this adds an optional build dependency on `scdoc`
* Fix build when not using ModemManager
* Fix GPIO module initialization for BraveHeart Edition PinePhones
* Various build system improvements (now requires meson >= 0.58.0)
2022-02-19 15:18:21 +01:00
Arnaud Ferraris
ee70cf7d2f meson.build: release version 0.4.3 0.4.3 2022-02-19 15:17:40 +01:00
Arnaud Ferraris
0e2311fb36 Rename executable to eg25-manager
This brings more consistency with how other components are named
(repo, package, service file, manpages...).
2022-02-19 15:17:27 +01:00
Arnaud Ferraris
5e4c797695 meson: bump minimum version
`doc/meson.build` used currently-deprecated functions. Replace those
with the proper alternatives, which were introduced in a newer meson
version than our requirement. As a consequence, bump minimal version.
2022-02-19 15:05:31 +01:00
Arnaud Ferraris
be1ae18592 Move manpages to doc/ subfolder 2022-02-19 15:02:43 +01:00
Arnaud Ferraris
19eb488e29 gpio: fix init for BH edition PinePhone
BH PinePhone don't have the modem's `STATUS` pin connected to the SoC,
and as such require using `libusb` for checking the modem power state.
We didn't handle this case previously due to lack of on-device testing,
causing BH phones to fail with newer versions.

This patch ignores the `status` GPIO for devices relying on `libusb`,
which are only pre-CE PinePhones.
2022-02-19 13:50:41 +00:00
ArenM
a3c51fc513 Add manpages for eg25-manager and it's config file 2022-02-18 18:54:47 -05:00
Arnaud Ferraris
75400fb9c0 data: add USB vendor/product IDs to all configs
PP 1.2 and PPP configs were lacking this parameter. Although it's not a
problem as `eg25-manager` will then use a default value, adding them
won't harm and make them more consistent with other config files.
2022-02-07 12:43:49 +01:00
Arnaud Ferraris
97b1878ebc manager: disable reset timers once reset sequence starts
`modem_reset()` can be called from multiple places, both tied to a
specific timer. In order to prevent calling this function multiple times
in a row, disable all related timers as soon as we enter this function.
2022-02-07 12:43:49 +01:00
Arnaud Ferraris
9e6bccdf37 udev: use USB vendor/product ID to determine behavior
When going into firmware upgrade mode, the modem comes back with
different IDs than in normal use. We should make sure we cancel the
reset sequence when that happens, and not start a new one.
2022-02-07 12:43:49 +01:00
Arnaud Ferraris
df79247821 manager: populate USB vendor/product ID's with default values
We'll need those in the `udev` module, but never made it a mandatory
config option. This commit makes sure those values are properly filled
in.
2022-01-04 15:24:01 +01:00
Dylan Van Assche
61c89a003a udev: cancel reset if modem is already back
Cancel reset if modem is back before reset sequence is started.
When upgrading the modem through fwupd, it will enter fastboot.
Therefore, it disappears from the USB bus for a few ms.
However, the eg25-manager considers this as an issue and
resets the modem a bit later during the upgrade process.
To avoid this, cancel the reset sequence if the modem is already
back before the reset sequence is started. This will take less than 3
seconds.
2022-01-04 14:41:54 +01:00
Arnaud Ferraris
9cf51b9529 pinephone-pro: switch to 16K audio
As the modem is connected to a dedicated audio codec, we can select any
sample rate. Let's go for 16K as it should improve call audio quality.

Note: the bitclock's frequency is left untouched due to a bug in the
EG25 kernel, so we can't take advantage of the recommended higher
frequency.
2021-12-24 15:14:43 +00:00
Arnaud Ferraris
50b4c00c16 data: add 'monitor_udev' parameter to existing configs
We disable dev monitoring only for the PinePhone Pro, it remains enabled
for all variants of the OG PinePhone.
2021-12-24 15:14:43 +00:00
Arnaud Ferraris
fedce7298b manager: start udev monitoring module conditionally
The problem addressed by monitoring the modem status through udev seems
tied to the specific USB controller used by the A64. On RK3399 devices,
this quirk is apparently unneeded, and actually harmful as it resets the
modem USB connection while ModemManager is already configuring it.

This commit adds an optional config parameter for disabling this module
(enabled by default).
2021-12-24 15:14:43 +00:00
Rafael Diniz
8665f8a4a6 Fix compile error when not using Modem Manager. 2021-12-23 21:12:24 +03:00
Kai Lüke
88c68b9933 suspend: actually check if the modem is found before resetting
The timeout was meant to give more time to find the modem, yet the
callback didn't actually check if it came back but blindly issued a
reset.
Add a check to the callback to see if the modem was found and only
reset if not.

Fixes https://gitlab.com/mobian1/devices/eg25-manager/-/issues/28
2021-12-15 22:47:40 +00:00
Arnaud Ferraris
9c05776843 d/changelog: release version 0.4.2-1 mobian/0.4.2-1 2021-12-08 18:27:34 +01:00
Arnaud Ferraris
08a7039ca0 Update upstream source from tag '0.4.2'
Update to upstream version '0.4.2'
with Debian dir ad2c13f51c
2021-12-08 18:23:57 +01:00
Arnaud Ferraris
929b3942c0 d/gbp.conf: update for current Mobian workflow 2021-12-08 18:23:44 +01:00
Arnaud Ferraris
a91bc71e23 meson.build: release version 0.4.2 0.4.2 2021-12-08 18:21:48 +01:00
Arnaud Ferraris
b21c4b0fa4 data: add PinePhone Pro config
The PinePhone Pro uses the same EG25 modem as the OG PinePhone, but with
a different SoC. It also uses an ALC5616 audio codec directly hooked up
to the modem (which is I2S master in this case).

The config is therefore almost identical to the PinePhone rev1.2 except
for the gpios, UART port used and `AT+QDAI` config (to account for the
different audio setup).
2021-11-27 13:12:17 +01:00
Arnaud Ferraris
abf60b793a gpio: make more generic
Instead of assuming we're running on the PinePhone (and therefore
hardcoding gpiochip labels and line numbers), make all of those
configurable. Legacy config files will still be parsed as long as they
lack the `chips` key.

Existing config files are also updated to match the new config format.
2021-11-24 01:34:14 +01:00
Arnaud Ferraris
f8b3e28434 config: add config_get_table helper function 2021-11-24 01:20:54 +01:00
Arnaud Ferraris
d9725981bb Merge branch 'at-overflow' into 'master'
at: break before overflow when receiving messages

See merge request mobian1/devices/eg25-manager!40
2021-11-10 10:50:58 +00:00
ArenM
a06360f4c8 at: break before overflow when receiving messages
Previously this code checked if the buffer was full after writing to it,
which meant that the buffer could overflow.

This checks for an overflow before copying into the buffer and only
copies the data that will fit.
2021-11-06 19:59:22 -04:00
Arnaud Ferraris
f8430eb16f d/changelog: release version 0.4.1-1 2021-10-08 11:03:27 +02:00
Arnaud Ferraris
1b69252cbe d/copyright: add missing entries 2021-10-08 11:02:21 +02:00
Arnaud Ferraris
c17f947249 debian: drop distro-specific systemd service
It is now provided by upstream
2021-10-08 11:02:05 +02:00
Arnaud Ferraris
e96aec8390 New upstream version 0.4.1 2021-10-08 10:56:18 +02:00
Arnaud Ferraris
1f8fa88d37 meson.build: release version 0.4.1 0.4.1 2021-10-07 11:11:30 +02:00
Arnaud Ferraris
deeb60fa6a gnss: warn if ftruncate() fails 2021-10-07 11:11:30 +02:00
Arnaud Ferraris
a3d27cb3f7 data: install systemd system service 2021-10-06 22:41:43 +02:00
Arnaud Ferraris
af4d5ca1c1 udev: don't reset immediately
Executing a reset each time the modem is unbound is a bit too extreme:
the modem sometimes recovers by itself and only needs a "soft" reset
sequence (unbind/bind).

This commit introduces a short timer (2s) so we the modem can settle in.
If reset fails after this time, the modem is probably completely broken,
or already rebooting, so we can safely issue a reset AT command.
2021-10-06 22:35:36 +02:00
Arnaud Ferraris
25dd46bb30 manager: make modem_reset more reliable
`modem_reset()` could previously either fail silently, or fall back to
using AT commands without indicating what happened. This commit adds
informative messages and makes sure we fall back to resetting using AT
commands whenever we encounter an error.
2021-10-06 22:25:39 +02:00
Arnaud Ferraris
86978e18a6 at: fix more typos 2021-10-06 02:17:21 +02:00
Arnaud Ferraris
bcdc839abb gnss: don't overload the modem during upload
By instructing sendfile() to send the whole content of the assistance
data at once results in a big data transfer (> 4kb) first followed by a
huge amount of small transfers (64 or 128b). This "overloads" the modem
which needs to process smaller chunks of data and have more time to do
so (experimentation shows that 1kb need 100ms for processing, or the
upload will subsequently fail).

This commit sets the transfer size to 256b and increase the timeout
between each transfer to 25ms.
2021-10-06 01:54:30 +02:00
Arnaud Ferraris
73868260a2 gnss: wait for the modem to confirm upload success
If we clear QFUPL right after we finished the file transfer, we will
execute the following commands right away, leading to interleaved
replies from the modem (i.e. the reply to QGPSXTRATIME being received
with the notification of upload completion).

Keeping the command in the queue allows us to use the callback a second
time once the upload is complete and resume assistance data processing
accordingly.
2021-10-06 01:54:30 +02:00
Arnaud Ferraris
66073cdd21 at: get rid of compiler warning 2021-10-06 01:54:30 +02:00
Arnaud Ferraris
cfd7ebf156 at: ensure we don't skip steps
After the modem send "RDY", other messages are received. With the
current implementation, this causes eg25-manager to mark the modem as
configured before it is even picked up by ModemManager. Adding an
additional status check helps preventing this issue.
2021-10-06 01:54:30 +02:00
Arnaud Ferraris
f03f086fcb src: fix typo 2021-10-05 23:45:33 +02:00
Arnaud Ferraris
f68af6405d manager: honor --version option
Fixes #22
2021-10-05 23:45:27 +02:00
Arnaud Ferraris
68349c9f58 Merge branch 'fix-config-crash' into 'master'
Don't crash on incomplete config files

Closes #23

See merge request mobian1/devices/eg25-manager!31
2021-10-05 20:34:28 +00:00
Arnaud Ferraris
3d9456c0e7 Merge branch 'wip/a-wai/clear-command-queue' into 'master'
at: clear command queue before configuring modem

Closes #24

See merge request mobian1/devices/eg25-manager!34
2021-10-05 20:34:12 +00:00
Arnaud Ferraris
87a7a6c9e9 Merge branch 'at_logging' into 'master'
Fix logging of at commands (was preventing sending them)

See merge request mobian1/devices/eg25-manager!36
2021-10-05 20:33:55 +00:00
ArenM
aec8135ad4 at: escape non text characters in modem response logs 2021-10-05 12:09:12 -04:00