Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 110 additions & 11 deletions docs/dragon/q6a/low-dev/spi_fw.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ SPI启动固件(BootROM + 引导程序)的核心任务是分阶段初始化

进入 [资源汇总下载](../download) 页面,下载 `edl-ng` 压缩包并解压,然后根据自己的系统平台选择对应的版本进行 SPI 固件的下载。

## 烧录 SPI 启动固件

<Tabs queryString = "EDLplatform">
<TabItem value="Windows" label="Windows" default>

## 烧录 Firmware

- [进入 EDL mode](edl_mode)

- 输入以下命令进行烧录
- 输入以下命令进行 SPI 启动固件的烧录

<NewCodeBlock tip="Windows$" type="host">

Expand All @@ -33,12 +33,6 @@ SPI启动固件(BootROM + 引导程序)的核心任务是分阶段初始化

</NewCodeBlock>

## FAQ

- 若提示 Unable to loda DLL 'libusb-1.0'

安装 [vc_redist](https://aka.ms/vs/17/release/vc_redist.x64.exe)

</TabItem>
<TabItem value="Linux" label="Linux">

Expand Down Expand Up @@ -92,17 +86,122 @@ edl-ng --version

终端若是打印出版本信息,说明 `edl-ng` 工具设置软链接成功。

- [进入 EDL mode](edl_mode)

- 烧录 SPI 启动固件

进入 [资源汇总下载](../../download) 页面,下载 `spi firmware` 文件,然后解压进入到 `prog_firehose_ddr.elf` 文件所在目录并打开终端,使用 `edl-ng` 命令擦除 SPI 启动固件。
进入 [资源汇总下载](../../download) 页面,下载 `spi firmware` 文件,然后解压进入到 `prog_firehose_ddr.elf` 文件所在目录并打开终端,使用 `edl-ng` 命令烧录 SPI 启动固件。

<NewCodeBlock tip="Linux$" type="host">

```
sudo edl-ng rawprogram rawprogram0.xml patch0.xml --loader=prog_firehose_ddr.elf --memory=spinor
sudo edl-ng --memory=spinor rawprogram rawprogram0.xml patch0.xml --loader=prog_firehose_ddr.elf
```

</NewCodeBlock>

</TabItem>
</Tabs>

## 擦除 SPI 启动固件

擦除 SPI 启动固件将导致设备无法启动,需要重新烧录 SPI 启动固件才可正常启动,若非必要,请勿擦除 SPI 启动固件。

<Tabs queryString = "EDLplatform">
<TabItem value="Windows" label="Windows" default>

- [进入 EDL mode](edl_mode)

- 擦除 SPI 启动固件

打开终端,输入以下命令进行擦除:

<NewCodeBlock tip="Windows$" type="host">

```
.\edl-ng.exe --memory spinor erase-part ddr -l C:\path\to\prog_firehose_ddr.elf
.\edl-ng.exe --memory spinor erase-part uefi -l C:\path\to\prog_firehose_ddr.elf
.\edl-ng.exe --memory spinor erase-part devcfg -l C:\path\to\prog_firehose_ddr.elf
.\edl-ng.exe --memory spinor erase-part xbl -l C:\path\to\prog_firehose_ddr.elf
```

</NewCodeBlock>

</TabItem>
<TabItem value="Linux" label="Linux">

- [进入 EDL mode](edl_mode)

将 Linux 版本的 `edl-ng` 工具添加到系统环境变量中,这样可以在任意位置打开终端就直接使用 `edl-ng` 命令。

- 查看路径

你可以在 `edl-ng` 工具所在的文件夹下打开终端,使用 `realpath` 命令查看当前文件夹下 `edl-ng` 的完整路径,然后给 `edl-ng` 创建软链接。

<NewCodeBlock tip="Linux$" type="host">

```
realpath edl-ng
```

</NewCodeBlock>

终端输出示例:

```
/home/user/edl-ng-dist/linux-x64/edl-ng
```

- 创建软链接

<NewCodeBlock tip="Linux$" type="host">

```
sudo ln -s [edl-ng path] /usr/local/bin/edl-ng
# 示例
sudo ln -s /home/user/edl-ng-dist/linux-x64/edl-ng /usr/local/bin/edl-ng
```

</NewCodeBlock>

参数说明:

- `[edl-ng path]` : 需要修改成自己的 `edl-ng` 工具完整路径

- 验证

可以在任意位置打开终端,使用 `edl-ng --version` 命令查看版本信息。

<NewCodeBlock tip="Linux$" type="host">

```
edl-ng --version
```

</NewCodeBlock>

终端若是打印出版本信息,说明 `edl-ng` 工具设置软链接成功。

- 擦除 SPI 启动固件

进入 `prog_firehose_ddr.elf` 文件所在目录打开终端,输入以下命令进行擦除

<NewCodeBlock tip="Linux$" type="host">

```
sudo edl-ng --memory spinor erase-part ddr -l prog_firehose_ddr.elf
sudo edl-ng --memory spinor erase-part uefi -l prog_firehose_ddr.elf
sudo edl-ng --memory spinor erase-part devcfg -l prog_firehose_ddr.elf
sudo edl-ng --memory spinor erase-part xbl -l prog_firehose_ddr.elf
```

</NewCodeBlock>

</TabItem>
</Tabs>

## FAQ

- 若提示 Unable to loda DLL 'libusb-1.0'

安装 [vc_redist](https://aka.ms/vs/17/release/vc_redist.x64.exe)
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
sidebar_position: 6
---

# Burn SPI boot firmware
# Flashing SPI Boot Firmware

:::tip Firmware Notes
The Dragon Q6A comes with SPI boot firmware pre-installed. Under normal circumstances, there is no need to re-flash the boot firmware. However, if the system fails to boot properly, you can try re-flashing the SPI boot firmware.
:::tip Firmware Information
The Radxa Dragon Q6A comes with SPI boot firmware pre-installed by default. Under normal circumstances, there is no need to flash the boot firmware. However, if the system fails to boot properly, you may try re-flashing the SPI boot firmware.

The primary function of the SPI boot firmware (BootROM + bootloader) is to initialize hardware in stages (CPU → memorystorage) and ultimately load the operating system kernel from the storage device.
:: :
The core function of the SPI boot firmware (BootROM + Bootloader) is to initialize hardware in stages (CPU → MemoryStorage) and ultimately load the operating system kernel from the storage device.
:::

When the device cannot boot normally, you can enter [EDL mode](./edl_mode) and then use the EDL tool to flash the SPI boot firmware.
When the device cannot boot normally, you can put the device into [EDL Mode](./edl_mode) and then use the EDL tool to flash the SPI boot firmware.

Go to the [Resource Download](../download) page, download the `edl-ng` compressed package and unzip it, then select the corresponding version based on your system platform to download the SPI firmware.
Go to the [Resource Download](../download) page, download the `edl-ng` package and extract it. Then select the appropriate version for your system platform to download the SPI firmware.

## Flashing SPI Boot Firmware

<Tabs queryString = "EDLplatform">
<TabItem value="Windows" label="Windows" default>

## Firmware burning

- [Enter EDL mode](edl_mode)

- Enter the following command to burn
- Enter the following command to flash the SPI boot firmware

<NewCodeBlock tip="Windows$" type="host">

Expand All @@ -33,20 +33,14 @@ Go to the [Resource Download](../download) page, download the `edl-ng` compresse

</NewCodeBlock>

## FAQ

- If prompted Unable to loda DLL 'libusb-1.0'

Install [vc_redist](https://aka.ms/vs/17/release/vc_redist.x64.exe)

</TabItem>
<TabItem value="Linux" label="Linux">

Add the Linux version of the `edl-ng` tool to the system environment variables so that you can use the `edl-ng` command directly from any terminal.
Add the Linux version of the `edl-ng` tool to your system's environment variables so you can use the `edl-ng` command from any terminal location.

- View the path
- Check the path

You can open a terminal in the folder where the `edl-ng` tool is located, use the `realpath` command to view the full path of `edl-ng` in the current folder, and then create a soft link for `edl-ng`.
You can open a terminal in the folder where the `edl-ng` tool is located, use the `realpath` command to view the full path of `edl-ng` in the current folder, and then create a symbolic link for `edl-ng`.

<NewCodeBlock tip="Linux$" type="host">

Expand All @@ -62,7 +56,7 @@ Terminal output example:
/home/user/edl-ng-dist/linux-x64/edl-ng
```

- Create soft links
- Create a symbolic link

<NewCodeBlock tip="Linux$" type="host">

Expand All @@ -76,11 +70,11 @@ sudo ln -s /home/user/edl-ng-dist/linux-x64/edl-ng /usr/local/bin/edl-ng

Parameter description:

- `[edl-ng path]` : Needs to be changed to the full path of your own `edl-ng` tool
- `[edl-ng path]` : Replace with your own full path to the `edl-ng` tool

- Verification

You can open a terminal at any location and use the `edl-ng --version` command to view the version information.
You can open a terminal from any location and use the `edl-ng --version` command to check the version information.

<NewCodeBlock tip="Linux$" type="host">

Expand All @@ -90,11 +84,13 @@ edl-ng --version

</NewCodeBlock>

If the terminal prints the version information, it means that the `edl-ng` tool has successfully set the soft link.
If the terminal prints the version information, the `edl-ng` tool symbolic link has been set up successfully.

- Burn SPI boot firmware
- [Enter EDL mode](edl_mode)

Go to the [Resource Summary Download](../../download) page, download the `spi firmware` file, then unzip it into the directory where the `prog_firehose_ddr.elf` file is located and open the terminal. Use the `edl-ng` command to erase the SPI boot firmware.
- Flash SPI Boot Firmware

Go to the [Resource Download](../../download) page, download the `spi firmware` file, then extract it and navigate to the directory containing the `prog_firehose_ddr.elf` file. Open a terminal in this directory and use the `edl-ng` command to flash the SPI boot firmware.

<NewCodeBlock tip="Linux$" type="host">

Expand All @@ -106,3 +102,106 @@ sudo edl-ng --memory=spinor rawprogram rawprogram0.xml patch0.xml --loader=prog_

</TabItem>
</Tabs>

## Erase SPI Boot Firmware

Erasing the SPI boot firmware will prevent the device from booting. You will need to re-flash the SPI boot firmware to restore normal operation. Do not erase the SPI boot firmware unless absolutely necessary.

<Tabs queryString = "EDLplatform">
<TabItem value="Windows" label="Windows" default>

- [Enter EDL mode](edl_mode)

- Erase SPI Boot Firmware

Open a terminal and enter the following commands to erase:

<NewCodeBlock tip="Windows$" type="host">

```
.\edl-ng.exe --memory spinor erase-part ddr -l C:\path\to\prog_firehose_ddr.elf
.\edl-ng.exe --memory spinor erase-part uefi -l C:\path\to\prog_firehose_ddr.elf
.\edl-ng.exe --memory spinor erase-part devcfg -l C:\path\to\prog_firehose_ddr.elf
.\edl-ng.exe --memory spinor erase-part xbl -l C:\path\to\prog_firehose_ddr.elf
```

</NewCodeBlock>

</TabItem>
<TabItem value="Linux" label="Linux">

- [Enter EDL mode](edl_mode)

Add the Linux version of the `edl-ng` tool to your system's environment variables so you can use the `edl-ng` command from any terminal location.

- Check the path

You can open a terminal in the folder where the `edl-ng` tool is located, use the `realpath` command to view the full path of `edl-ng` in the current folder, and then create a symbolic link for `edl-ng`.

<NewCodeBlock tip="Linux$" type="host">

```
realpath edl-ng
```

</NewCodeBlock>

Terminal output example:

```
/home/user/edl-ng-dist/linux-x64/edl-ng
```

- Create a symbolic link

<NewCodeBlock tip="Linux$" type="host">

```
sudo ln -s [edl-ng path] /usr/local/bin/edl-ng
# Example
sudo ln -s /home/user/edl-ng-dist/linux-x64/edl-ng /usr/local/bin/edl-ng
```

</NewCodeBlock>

Parameter description:

- `[edl-ng path]` : Replace with your own full path to the `edl-ng` tool

- Verification

You can open a terminal from any location and use the `edl-ng --version` command to check the version information.

<NewCodeBlock tip="Linux$" type="host">

```
edl-ng --version
```

</NewCodeBlock>

If the terminal prints the version information, the `edl-ng` tool symbolic link has been set up successfully.

- Erase SPI Boot Firmware

Enter the `prog_firehose_ddr.elf` file directory and open a terminal, input the following command to erase

<NewCodeBlock tip="Linux$" type="host">

```
sudo edl-ng --memory spinor erase-part ddr -l prog_firehose_ddr.elf
sudo edl-ng --memory spinor erase-part uefi -l prog_firehose_ddr.elf
sudo edl-ng --memory spinor erase-part devcfg -l prog_firehose_ddr.elf
sudo edl-ng --memory spinor erase-part xbl -l prog_firehose_ddr.elf
```

</NewCodeBlock>

</TabItem>
</Tabs>

## FAQ

- If it prompts "Unable to loda DLL 'libusb-1.0'"

Install [vc_redist](https://aka.ms/vs/17/release/vc_redist.x64.exe)
Loading