1# Copyright (c) 2023 Bjarki Arge Andreasen
2# SPDX-License-Identifier: Apache-2.0
3
4config MODEM_CELLULAR
5	bool "Generic cellular modem support"
6	select MODEM_MODULES
7	select MODEM_PPP
8	select MODEM_CMUX
9	select MODEM_CHAT
10	select MODEM_PIPE
11	select MODEM_PIPELINK
12	select MODEM_BACKEND_UART
13	select RING_BUFFER
14	select NET_L2_PPP_OPTION_MRU
15	select NET_L2_PPP_PAP
16	select NET_L2_PPP_MGMT
17	depends on (DT_HAS_QUECTEL_BG95_ENABLED || DT_HAS_QUECTEL_BG96_ENABLED || \
18				DT_HAS_SIMCOM_A76XX_ENABLED || DT_HAS_SIMCOM_SIM7080_ENABLED || \
19				DT_HAS_U_BLOX_SARA_R4_ENABLED || DT_HAS_U_BLOX_SARA_R5_ENABLED || \
20				DT_HAS_SWIR_HL7800_ENABLED || DT_HAS_TELIT_ME910G1_ENABLED || \
21				DT_HAS_TELIT_ME310G1_ENABLED || DT_HAS_QUECTEL_EG25_G_ENABLED || \
22				DT_HAS_NORDIC_NRF91_SLM_ENABLED || DT_HAS_SQN_GM02S_ENABLED || \
23				DT_HAS_U_BLOX_LARA_R6_ENABLED || DT_HAS_QUECTEL_EG800Q_ENABLED)
24	select MODEM_CMUX_DEFAULT_MTU_127 if \
25		(DT_HAS_QUECTEL_BG95_ENABLED || DT_HAS_QUECTEL_BG96_ENABLED || \
26		 DT_HAS_QUECTEL_EG25_G_ENABLED || DT_HAS_SIMCOM_SIM7080_ENABLED || \
27		 DT_HAS_U_BLOX_SARA_R4_ENABLED || DT_HAS_U_BLOX_SARA_R5_ENABLED || \
28		 DT_HAS_SWIR_HL7800_ENABLED || DT_HAS_TELIT_ME910G1_ENABLED || \
29		 DT_HAS_TELIT_ME310G1_ENABLED || DT_HAS_SQN_GM02S_ENABLED || \
30		 DT_HAS_QUECTEL_EG800Q_ENABLED || DT_HAS_SIMCOM_A76XX_ENABLED)
31	help
32	  This driver uses the generic 3gpp AT commands, along
33	  with the standard protocols CMUX and PPP, to configure
34	  cellular modems to establish a point-to-point
35	  network connection. It is a template for tailored
36	  drivers for the ublox, quectel and other modems, which
37	  include power management and more complex device specific
38	  features.
39
40if MODEM_CELLULAR
41
42config MODEM_CELLULAR_APN
43	string "Static APN"
44	default "internet"
45	help
46	  If left empty the driver will wait for the application to call
47	  cellular_set_apn() before it proceeds to the dial phase.
48
49config MODEM_CELLULAR_PERIODIC_SCRIPT_MS
50	int "Periodic script interval in milliseconds"
51	default 2000
52
53config MODEM_CELLULAR_UART_BUFFER_SIZES
54	int "The UART receive and transmit buffer sizes in bytes."
55	default 512
56
57config MODEM_CELLULAR_CHAT_BUFFER_SIZE
58	int "The size of the buffer used for the chat scripts in bytes."
59	default 128
60
61config MODEM_CELLULAR_USER_PIPE_BUFFER_SIZES
62	int "The size of the buffers used for each user pipe in bytes."
63	default 128
64
65config MODEM_CELLULAR_NEW_BAUDRATE
66	int "New baudrate to configure modem to, if supported"
67	range 9600 4000000
68	default 3000000 if DT_HAS_U_BLOX_LARA_R6_ENABLED
69	default 115200
70
71config MODEM_CELLULAR_NEW_BAUDRATE_DELAY
72	int "Time modem takes to change baudrate, in milliseconds"
73	range 0 1000
74	default 100 if DT_HAS_U_BLOX_LARA_R6_ENABLED
75	default 300
76
77if DT_HAS_U_BLOX_LARA_R6_ENABLED
78
79choice MODEM_CELLULAR_RAT
80	prompt "Which Radio Access Technology to use"
81	default MODEM_CELLULAR_RAT_4G
82
83config MODEM_CELLULAR_RAT_4G
84	bool "Use only 4G"
85
86config MODEM_CELLULAR_RAT_4G_3G
87	bool "Use 4G & 3G"
88
89config MODEM_CELLULAR_RAT_4G_3G_2G
90	bool "Use 4G, 3G & 2G"
91
92endchoice
93
94config MODEM_CELLULAR_CLEAR_FORBIDDEN
95	bool "Clear forbidden networks from SIM-card on boot"
96
97endif #DT_HAS_U_BLOX_LARA_R6_ENABLED
98
99endif #MODEM_CELLULAR
100