mirror of
https://github.com/dikeckaan/mu300-linux.git
synced 2026-12-05 08:02:40 +00:00
fix: preserve V50 SIM routing during live driver deployment
This commit is contained in:
1 parent
85d72fa95c
commit
b4c051c8bd
2 files changed
+36
-2
No files matched your search
@@ -112,7 +112,19 @@ EPS 仍报告 LTE、NR 已确认注册时,显示 5G。空回复、错误或无
|
||||
有重叠,不将两者相加冒充独立测试数),另有 14 项看板语言检查通过。
|
||||
- 页面测试覆盖四种物理卡列表、物理卡 ID 到查看槽位映射,原 U30 控件测试
|
||||
继续运行;三语言检查通过。
|
||||
- 当前 V50 仅做了身份、DT 与 GPIO 的只读检查。**尚未部署新内核,也未实测
|
||||
四种板型的真实选卡或 U30 Air 的灯色变化**。不能把离线通过写成硬件验证。
|
||||
- V50 `board_id=3` 已热部署网页、选卡控制器与 GPIO 驱动。使用当前运行
|
||||
7.2.8 的同一缓存 vmlinux 构建可加载模块,先比对 GNU build ID
|
||||
`225b295327acfde0ad03a044860e952b73571ad2`,包含匹配的 split BTF。
|
||||
没有更换内核、重启或重载 Wi-Fi / SIPA 驱动。
|
||||
- 热部署使用 `preserve_state=1`:先读取原选择电平,再以相同电平取得输出
|
||||
方向,避免绑定时切动已上电的卡。未开启该参数的生产冷启动仍按原厂
|
||||
bootargs/default 初始化。GPIO105 保持检测输入,106 / 108 为输出。
|
||||
- 实机 RPC 返回 supported/ready=true、board_id=3、cards=[0,1],当前
|
||||
active_card=0;两个有效卡位通过检查,原厂外置 physical ID 3 被拒绝。
|
||||
两个选择电平均保持 0,CFUN 回读 1,未见 BTF / 符号版本错误。
|
||||
已通过 kmodloader 实际加载并配置重启自动加载,原文件备份于
|
||||
`/root/update-backups/v50-card-topology-20261019`。
|
||||
- **尚未实测四种板型的真实来回切卡,也未实测 U30 Air 的灯色变化**。
|
||||
当前热部署保留用户原上网卡,不能把状态及参数检查写成切卡成功。
|
||||
- 已验证的表来自上述 B15 固件;若未来出现其他 board_id 或不同 GPIO 布局,
|
||||
应提取该版本原厂 APK / telephony / driver 后扩展映射,不自动套用相似板型。
|
||||
@@ -16,6 +16,12 @@ struct v50_sim {
|
||||
struct mutex lock;
|
||||
};
|
||||
|
||||
/* A live deployment must not switch a powered SIM as a side effect of probe.
|
||||
* Cold production boots keep the stock bootarg/default initialization. */
|
||||
static bool preserve_state;
|
||||
module_param(preserve_state, bool, 0444);
|
||||
MODULE_PARM_DESC(preserve_state, "Keep current selector levels when binding on a running system");
|
||||
|
||||
static ssize_t v50_read(struct device *dev, struct gpio_desc *gpio, char *buf)
|
||||
{
|
||||
int value = gpiod_get_value_cansleep(gpio);
|
||||
@@ -124,6 +130,7 @@ static int v50_sim_probe(struct platform_device *pdev)
|
||||
struct device *dev = &pdev->dev;
|
||||
struct device_node *v50;
|
||||
struct v50_sim *sim;
|
||||
int chip, psim, ret;
|
||||
|
||||
/* Some generic vendor trees carry unused SIM nodes on other products. */
|
||||
v50 = of_find_compatible_node(NULL, NULL, "awinic,aw9523b");
|
||||
@@ -139,13 +146,28 @@ static int v50_sim_probe(struct platform_device *pdev)
|
||||
if (IS_ERR(sim->detect))
|
||||
return dev_err_probe(dev, PTR_ERR(sim->detect), "card detect GPIO\n");
|
||||
sim->chip = devm_gpiod_get(dev, "esim2-esim3-switch",
|
||||
preserve_state ? GPIOD_ASIS :
|
||||
v50_initial("androidboot.simswitch=", true));
|
||||
if (IS_ERR(sim->chip))
|
||||
return dev_err_probe(dev, PTR_ERR(sim->chip), "eSIM selector GPIO\n");
|
||||
sim->psim = devm_gpiod_get(dev, "soft-psim-switch",
|
||||
preserve_state ? GPIOD_ASIS :
|
||||
v50_initial("androidboot.psimswitch=", false));
|
||||
if (IS_ERR(sim->psim))
|
||||
return dev_err_probe(dev, PTR_ERR(sim->psim), "physical SIM selector GPIO\n");
|
||||
if (preserve_state) {
|
||||
/* LK may have left an unused selector as an input with a pull-down.
|
||||
* Retain its actual level, but take output ownership for later writes. */
|
||||
chip = gpiod_get_value_cansleep(sim->chip);
|
||||
psim = gpiod_get_value_cansleep(sim->psim);
|
||||
if (chip < 0 || psim < 0)
|
||||
return dev_err_probe(dev, chip < 0 ? chip : psim, "read selectors\n");
|
||||
ret = gpiod_direction_output(sim->chip, chip);
|
||||
if (!ret)
|
||||
ret = gpiod_direction_output(sim->psim, psim);
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "preserve selector outputs\n");
|
||||
}
|
||||
platform_set_drvdata(pdev, sim);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user