mirror of
https://github.com/shenmintao/aic8800d80.git
synced 2026-09-26 17:44:16 +00:00
test: restore MCU1 cache fix for V3 firmware
This commit is contained in:
@@ -234,6 +234,7 @@ int system_config_8800d80(struct aic_usb_dev *usb_dev){
|
|||||||
int syscfg_num;
|
int syscfg_num;
|
||||||
int ret, cnt;
|
int ret, cnt;
|
||||||
const u32 mem_addr = 0x40500000;
|
const u32 mem_addr = 0x40500000;
|
||||||
|
const u32 cache_mem_addr = 0x40100020;
|
||||||
struct dbg_mem_read_cfm rd_mem_addr_cfm;
|
struct dbg_mem_read_cfm rd_mem_addr_cfm;
|
||||||
ret = rwnx_send_dbg_mem_read_req(usb_dev, mem_addr, &rd_mem_addr_cfm);
|
ret = rwnx_send_dbg_mem_read_req(usb_dev, mem_addr, &rd_mem_addr_cfm);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
@@ -245,7 +246,20 @@ int system_config_8800d80(struct aic_usb_dev *usb_dev){
|
|||||||
}
|
}
|
||||||
chip_id = (u8)(rd_mem_addr_cfm.memdata >> 16);
|
chip_id = (u8)(rd_mem_addr_cfm.memdata >> 16);
|
||||||
printk("chip_id=%x, chip_mcu_id = %d\n", chip_id, chip_mcu_id);
|
printk("chip_id=%x, chip_mcu_id = %d\n", chip_id, chip_mcu_id);
|
||||||
printk("issue58: using Radxa SDK V3 D80 loader profile\n");
|
printk("issue58: using Radxa SDK V3 D80 loader profile with MCU1 cache fix\n");
|
||||||
|
if (chip_mcu_id == 1) {
|
||||||
|
ret = rwnx_send_dbg_mem_read_req(usb_dev, cache_mem_addr, &rd_mem_addr_cfm);
|
||||||
|
if (ret) {
|
||||||
|
printk("%x rd fail: %d\n", cache_mem_addr, ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
rd_mem_addr_cfm.memdata |= 0x01;
|
||||||
|
ret = rwnx_send_dbg_mem_write_req(usb_dev, cache_mem_addr, rd_mem_addr_cfm.memdata);
|
||||||
|
if (ret) {
|
||||||
|
printk("%x write fail: %d\n", cache_mem_addr, ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
#if 1
|
#if 1
|
||||||
syscfg_num = sizeof(syscfg_tbl_8800d80) / sizeof(u32) / 2;
|
syscfg_num = sizeof(syscfg_tbl_8800d80) / sizeof(u32) / 2;
|
||||||
for (cnt = 0; cnt < syscfg_num; cnt++) {
|
for (cnt = 0; cnt < syscfg_num; cnt++) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Issue #58: legacy firmware test for D80 MCU revision 1
|
# Issue #58: V3 firmware and MCU1 Bluetooth cache test
|
||||||
|
|
||||||
This branch is an experimental build for
|
This branch is an experimental build for
|
||||||
[issue #58](https://github.com/shenmintao/aic8800d80/issues/58). It is intended
|
[issue #58](https://github.com/shenmintao/aic8800d80/issues/58). It is intended
|
||||||
@@ -10,10 +10,11 @@ chip_id=7, chip_mcu_id=1
|
|||||||
|
|
||||||
Do not merge this branch as a general firmware downgrade. It replaces the
|
Do not merge this branch as a general firmware downgrade. It replaces the
|
||||||
complete `fw/aic8800D80` firmware set and matches the D80 loader's FMAC patch
|
complete `fw/aic8800D80` firmware set and matches the D80 loader's FMAC patch
|
||||||
table, patch-buffer layout, and MCU cache setup to that firmware generation.
|
table and patch-buffer layout to that firmware generation. It additionally
|
||||||
The USB transport and modern-kernel compatibility code remain current.
|
sets bit 0 of register `0x40100020` only when `chip_mcu_id=1`, as tested in
|
||||||
Firmware and loader paths for D80N, D80X2, DC, and other variants are not
|
[PR #35](https://github.com/shenmintao/aic8800d80/pull/35). The USB transport
|
||||||
changed.
|
and modern-kernel compatibility code remain current. Firmware and loader paths
|
||||||
|
for D80N, D80X2, DC, and other variants are not changed.
|
||||||
|
|
||||||
## Hypothesis
|
## Hypothesis
|
||||||
|
|
||||||
@@ -32,11 +33,17 @@ fixed at upstream commit
|
|||||||
The normal FMAC file has SHA-256
|
The normal FMAC file has SHA-256
|
||||||
`1ec680c2b63dcaa0e5d33c5fb6d1857d030f8145c05c385e243760388a61a0da`.
|
`1ec680c2b63dcaa0e5d33c5fb6d1857d030f8145c05c385e243760388a61a0da`.
|
||||||
|
|
||||||
The first hardware test proved that this image uploads completely without the
|
Hardware testing of commit `7b2541e` proved that the matched V3 firmware and
|
||||||
`0x170400` timeout, but the device then failed to re-enumerate while the newer
|
loader upload completely without the `0x170400` timeout, re-enumerate as
|
||||||
loader was still applying SDK V5-era FMAC patches and MCU cache setup. This
|
`a69c:8d81`, and provide working 2.4 GHz and 5 GHz Wi-Fi. Its Bluetooth
|
||||||
follow-up matches those loader operations to V3 so that their effect can be
|
interfaces bind to the kernel's standard `btusb` driver, but HCI initialization
|
||||||
tested separately, while retaining unrelated fixes in the current driver.
|
fails with `Opcode 0x0c03 failed: -110`.
|
||||||
|
|
||||||
|
This follow-up changes one loader behavior only: for MCU revision 1 it reads
|
||||||
|
register `0x40100020`, sets bit 0, and writes the value back before firmware
|
||||||
|
upload. PR #35 independently found that this is required for correct Bluetooth
|
||||||
|
firmware block writes on MCU1 and verified it with the system `btusb` driver.
|
||||||
|
This branch does not contain or install `aic_btusb`.
|
||||||
|
|
||||||
## Install the test branch
|
## Install the test branch
|
||||||
|
|
||||||
@@ -44,7 +51,7 @@ From an existing clone:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
git fetch origin
|
git fetch origin
|
||||||
git switch test/issue-58-mcu1-legacy-fw
|
git switch test/issue-58-mcu1-v3-fw-cache
|
||||||
git pull --ff-only
|
git pull --ff-only
|
||||||
sudo ./install.sh
|
sudo ./install.sh
|
||||||
```
|
```
|
||||||
@@ -61,8 +68,8 @@ re-enumerates after `a69c:8d80`:
|
|||||||
```bash
|
```bash
|
||||||
sudo dmesg -C
|
sudo dmesg -C
|
||||||
# Disconnect and reconnect the device, then wait for initialization.
|
# Disconnect and reconnect the device, then wait for initialization.
|
||||||
sudo dmesg | tee issue58-legacy-fw-dmesg.txt
|
sudo dmesg | tee issue58-v3-cache-dmesg.txt
|
||||||
sudo dmesg | grep -iE 'aic|issue58|chip_id|chip_mcu_id|fmacfw|bin upload|cmd timed-out|error -110'
|
sudo dmesg | grep -iE 'aic|issue58|chip_id|chip_mcu_id|fmacfw|bin upload|cmd timed-out|Bluetooth|btusb|0x0c03|error -110'
|
||||||
lsusb
|
lsusb
|
||||||
lsusb -t
|
lsusb -t
|
||||||
```
|
```
|
||||||
@@ -70,7 +77,7 @@ lsusb -t
|
|||||||
The log must contain:
|
The log must contain:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
issue58: using Radxa SDK V3 D80 loader profile
|
issue58: using Radxa SDK V3 D80 loader profile with MCU1 cache fix
|
||||||
```
|
```
|
||||||
|
|
||||||
Please report all of the following, even if an earlier item fails:
|
Please report all of the following, even if an earlier item fails:
|
||||||
@@ -83,8 +90,10 @@ Please report all of the following, even if an earlier item fails:
|
|||||||
5. Whether the interface receives an address by DHCP.
|
5. Whether the interface receives an address by DHCP.
|
||||||
6. Whether the gateway and an Internet address can be pinged, and whether real
|
6. Whether the gateway and an Internet address can be pinged, and whether real
|
||||||
traffic works.
|
traffic works.
|
||||||
7. Whether Bluetooth still enumerates and works through the kernel's standard
|
7. Whether both Bluetooth interfaces are bound to the kernel's standard
|
||||||
`btusb` driver. This test does not install or use `aic_btusb`.
|
`btusb` driver and the earlier HCI Reset timeout is gone.
|
||||||
|
8. Whether Bluetooth can scan, pair, and establish a real connection. This
|
||||||
|
test does not install or use `aic_btusb`.
|
||||||
|
|
||||||
Useful commands:
|
Useful commands:
|
||||||
|
|
||||||
@@ -96,6 +105,8 @@ ip address
|
|||||||
ip route
|
ip route
|
||||||
lsusb -t
|
lsusb -t
|
||||||
bluetoothctl list
|
bluetoothctl list
|
||||||
|
bluetoothctl show
|
||||||
|
bluetoothctl scan on
|
||||||
```
|
```
|
||||||
|
|
||||||
Identify the new AIC interface with `iw dev`, then replace `wlan0` below with
|
Identify the new AIC interface with `iw dev`, then replace `wlan0` below with
|
||||||
|
|||||||
Reference in New Issue
Block a user