Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hardkernel-odroid-h4-plus docs #903

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f4aa311
docs: Add hardkernel-odroid-h4-plus placeholder files
philipandag Sep 19, 2024
483e421
mkdocs.yml: Add hardkernel odroid h4 pages
philipandag Sep 19, 2024
36190a4
hardkernel_odroid_h4_plus/releases.md: Add
philipandag Sep 19, 2024
6603f8e
unified/hardkernel/overview.md: Add
philipandag Sep 19, 2024
4697210
unified/hardkernel/building-manual.md: Add
philipandag Sep 19, 2024
3b627e4
unified/hardkernel/initial-deployment.md: Add
philipandag Sep 19, 2024
40e79d7
unified/hardkernel/firmware-update.md: Add
philipandag Sep 19, 2024
1d34c93
unified/hardkernel/recovery.md: Add
philipandag Sep 19, 2024
e162fab
docs hardkernel: pre-commit
philipandag Sep 20, 2024
befecc5
hardkernel_odroid_h4_plus/hardware-matrix.md: Add
philipandag Sep 20, 2024
48b99dd
unified/hardkernel/test-matrix.md: Add only Dasharo Compatibility
philipandag Sep 20, 2024
ba5ee6c
unified/hardkernel/test-matrix.md: Add reference from script
philipandag Sep 20, 2024
07655bc
docs: Move all odroid H4+ files from unified to variants
philipandag Sep 30, 2024
718c7e3
hardkernel_odroid_h4/firmware_update.md: update flash command
philipandag Sep 30, 2024
5c5403d
hardkernel_odroid_h4/recovery.md: Describe using flash jumper
philipandag Sep 30, 2024
aa5f0b9
hardkernel_odroid_h4/initial_deployment.md: Mention DTS
philipandag Sep 30, 2024
e15fa98
hardkernel_odroid_h4/releases.md: Add newsletter subscribe url
philipandag Sep 30, 2024
7d161f3
hardkernel_odroid_h4/recovery.md: Reword dual bios recovery
philipandag Sep 30, 2024
b0c60d7
Update docs/variants/hardkernel_odroid_h4/building-manual.md
philipandag Sep 30, 2024
9e3c3c5
hardkernel_odroid_h4/building-manual.md: Remove tab
philipandag Sep 30, 2024
2913c24
hardkernel_odroid_h4/firmware_update.md: Mention DTS
philipandag Sep 30, 2024
766cebd
hardkernel_odroid_h4/recovery.md: Remove tab
philipandag Sep 30, 2024
55e78f8
hardkernel_odroid_h4/releases.md: Add note "Coming soon."
philipandag Sep 30, 2024
cc6928c
hardkernel_odroid_h4/hardware-matrix.md: Fix PSU
philipandag Oct 3, 2024
1c09992
hardkernel_odroid_h4/releases.md: Dasharo Pro Package
philipandag Oct 3, 2024
c4f3a9d
hardkernel_odroid_h4/hardware-matrix.md: Add RAM model from dmidecode
philipandag Oct 3, 2024
4207d88
hardkernel_odroid_h4/hardware-matrix.md: Add eMMC from parted -l
philipandag Oct 3, 2024
31af080
hardkernel_odroid_h4/overview.md: Add missing links
philipandag Oct 3, 2024
9410d4a
hardkernel_odroid_h4/recovery.md: Fix redirect to other section
philipandag Oct 3, 2024
98804eb
hardkernel_odroid_h4/recovery.md: URL to ODROID wiki recovery
philipandag Oct 3, 2024
93fdfdb
hardkernel_odroid_h4/recovery.md: Suggest hard reset after flashing
philipandag Oct 8, 2024
60ab1f9
hardkernel_odroid_h4/test-matrix.md: Add compatibility links
philipandag Oct 8, 2024
32fcc94
hardkernel_odroid_h4/test-matrix.md: Add performance tests
philipandag Oct 8, 2024
0e0a62e
hardkernel_odroid_h4/test-matrix.md: Add stability
philipandag Oct 8, 2024
2130831
hardkernel_odroid_h4/test-matrix.md: Add performance
philipandag Oct 8, 2024
782894f
hard\/test-matrix.md: Align table columns
philipandag Oct 8, 2024
fb0f41b
hardkernel_odroid_h4/firmware-update.md: Update section name
philipandag Nov 28, 2024
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
Binary file added docs/images/odroid_flash_switch.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions docs/variants/hardkernel_odroid_h4/building-manual.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Dasharo firmware building guide

## Intro

This guide shows how to build Dasharo firmware for Hardkernel devices.

## Requirements

- Docker
+ follow [Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/)
+ follow [Post-installation steps for Linux](https://docs.docker.com/engine/install/linux-postinstall/)
- Git
+ `sudo apt-get install git`

## Building

To build Dasharo firmware image, first clone the coreboot repository:

```bash
git clone https://github.com/Dasharo/coreboot.git
```

then follow the steps below:

1. To build a specific version checkout to the version's tag.
Skip this step otherwise.

```bash
cd coreboot
git checkout hardkernel_odroid_h4_<version>
```

For example

```bash
git checkout hardkernel_odroid_h4_v0.9.0
```

2. Checkout submodules:

```bash
git submodule update --init --checkout
```

3. Build the firmware:

```bash
./build.sh odroid_h4
```

The resulting coreboot image will be placed in the coreboot directory as
`hardkernel_odroid_h4_<version>.rom`.
41 changes: 41 additions & 0 deletions docs/variants/hardkernel_odroid_h4/firmware-update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Firmware update

The following documentation describes the process of Dasharo open-source
firmware update. If your device is currently flashed with the proprietary
firmware please refer to the [Initial deployment](initial-deployment.md)
documentation.

The update process may be different, depending on the currently installed
Dasharo firmware version.

For simplicity of the process we recommend using
[Dasharo Tools Suite](../../dasharo-tools-suite/overview.md).

Before starting the update procedure be sure to disable Dasharo BIOS Boot
medium lock and Secure Boot:

1. Power on the device.
2. While the device is booting, hold the `DELETE` key to enter the UEFI Setup
Menu.
3. Enter the `Dasharo System Features` menu using the arrow keys and Enter.
4. Enter the [Dasharo Security Options](https://docs.dasharo.com/dasharo-menu-docs/dasharo-system-features/#dasharo-security-options)
submenu.
5. Verify the state of the `Lock the BIOS boot medium` option - if the option
is chosen, press `Space` and then `F10` to save the changes.
6. Go back to the main menu using the `ESC` key.
7. Enter the `Device Manager` menu.
8. Enter the [Secure Boot Configuration](https://docs.dasharo.com/dasharo-menu-docs/device-manager/#secure-boot-configuration)
submenu.
9. Verify that the `Current Secure Boot State` field says Disabled - if not,
unselect the `Attempt Secure Boot` option below then press `F10` to save
the changes.
10. Reboot the device to properly apply the changes.

The settings of all the above options can be restored after a firmware
update.

## Updating Dasharo
miczyg1 marked this conversation as resolved.
Show resolved Hide resolved
philipandag marked this conversation as resolved.
Show resolved Hide resolved

```bash
flashrom -p internal -w hardkernel_odroid_h4_v<version>.rom --fmap -i WP_RO -i RW_SECTION_A
```
27 changes: 27 additions & 0 deletions docs/variants/hardkernel_odroid_h4/hardware-matrix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Hardware configuration matrix

## Introduction

This document describes the hardware configuration used for validation of
Dasharo on the Hardkernel ODROID H4.

## Hardkernel ODROID H4+

| Component | Description |
|--------------------------------|---------------------------------------------|
| **CPU** | Intel(R) Processor N97 |
| **RAM** | Samsung M425R1GB4BB0-CWMOD |
| **SSD** | Samsung SSD PRO 900 1TB |
| **eMMC** | MMC PJ3032
| **Flash memory** | Winbond W25Q128JV |
| **USB Keyboard** | DELL KB216 |
| **USB Mouse** | None |
| **USB pendrives** | 1. SanDisk Ultra Flair USB 3.0 16 GB |
| **Display** | HDMI 1920x1080p |
| **Ethernet controller** | Intel i210 (on-board) |
| **Storage devices** | SATA disk (TBD) |
| **Network** | Local network wired connection |
| **Remote Testing Environment** | RTE v1.1.0 |
| **Power Control** | Sonoff |
| **Power supply** | ULLPOWER ICP65-150-4000 15V 5A |
| **KVM** | PiKVM based on Raspberry Pi Zero 2w |
38 changes: 38 additions & 0 deletions docs/variants/hardkernel_odroid_h4/initial-deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Initial deployment

Initial flashing of Dasharo firmware can be done from Linux using flashrom with
the internal programmer or using the Dasharo Tools Suite included in the Dasharo
Pro Package subscription (formerly Dasharo Entry Subscription). An instruction
on how to use the DTS can be found in the [DTS documentation](../../dasharo-tools-suite/documentation.md#dasharo-zero-touch-initial-deployment)

This document describes the process of building, installing and running
flashrom on Ubuntu 24.04.

## Build flashrom

Please follow generic guide for [Dasharo flashrom fork](../../osf-trivia-list/deployment.md#how-to-install-dasharo-flashrom-fork).

## Reading flash contents

Always prepare a backup of the current firmware image. To read from the flash
and save it to a file (`dump.rom`), execute the following command:

```bash
flashrom -p internal -r dump.rom
```

If you forgot to do this, you can get the original, proprietary
firmware from the [ODROID wiki website](https://wiki.odroid.com/odroid-h4/hardware/h4_bios_update#bios_release)
to restore it in case it is bricked. Using the firmware other than
your own backup should be the last resort.

## Flashing Dasharo

To flash Dasharo on the platform, execute the following command - replace `[path]`
with the path to the Dasharo image you want to flash, e.g. `hardkernel_odroid_h4_v0.9.0.rom`.

```bash
sudo flashrom -p internal -w [path] --ifd -i bios
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure particle flashing is what we should do for initial deployment? I have doubts because using partial flashing from AMI to Dasharo gave me no support for the network. Then partial flashing from Dasharo to Dasharo leads to serious bricking. The reset of CMOS + G3 helped, but I was pretty concerned when switching SPI to AMI, which didn't boot (it looks like a lack of CMOS reset). Let's make sure this section is robust.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have doubts because using partial flashing from AMI to Dasharo gave me no support for the network.

Any more details on it? iPXE has to be explicitly enabled in the setup.

Then partial flashing from Dasharo to Dasharo leads to serious bricking.

Happened to me as well, but also after AMI->Dasharo transition. This PR should fix the bricking: Dasharo/coreboot#569

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any more details on it? iPXE has to be explicitly enabled in the setup.

After booting to DTS v2.0.0, I had no network interface. I cannot reproduce that now, but I should analyze it more deeply when testing over the next 1-2 days.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It happened again while doing Dasharo->AMI transition:

bash-5.2# flashrom -p internal -w logs/rom.bin
flashrom v1.2-1037-g5b4a5b40 on Linux 6.6.21-yocto-standard (x86_64)
flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
coreboot table found at 0x76933000.
Found chipset "Intel Alder Lake-N".
Enabling flash write... Warning: Setting BIOS Control at 0xdc from 0x8b to 0x89 failed.
New value is 0x8b.
SPI Configuration is locked down.
FREG0: Flash Descriptor region (0x00000000-0x00000fff) is read-write.
FREG1: BIOS region (0x00600000-0x00ffffff) is read-write.
FREG2: Management Engine region (0x00001000-0x00413fff) is read-write.
PR0: Warning: 0x00b00000-0x00ffffff is read-only.
At least some flash regions are write protected. For write operations,
you should use a flash layout and include only writable regions. See
manpage for more details.
OK.
Found Programmer flash chip "Opaque flash chip" (16384 kB, Programmer-specific) on internal.
Reading old flash chip contents... done.
Erasing and writing flash chip... Transaction error between offset 0x00b00000 and 0x00afffff (= 0x00b00000 + -1)!
Reading current flash chip contents... done. Looking for another erase function.
Looking for another erase function.
Looking for another erase function.
Looking for another erase function.
Looking for another erase function.
Looking for another erase function.
Looking for another erase function.
No usable erase functions left.
FAILED!
Uh oh. Erase/write failed. Checking if anything has changed.
Reading current flash chip contents... done.
Apparently at least some data has changed.
Your flash chip is in an unknown state.
Get help on IRC (see https://www.flashrom.org/Contact) or mail
[email protected] with the subject "FAILED: <your board name>"!-------------------------------------------------------------------------------
DO NOT REBOOT OR POWEROFF!

This is my fault since I didn't remove all necessary locks before flashing, but the critical question is how to deal with such a situation correctly. PR0 range is weird, why it does not cover whole bios region?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess one way to deal with the problem is to write Dasharo again, go to the setup menu, disable protection, and then do the recovery.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During training, @mkopec also faced a similar issue with the lack of an Ethernet interface, it seem to be some problem with power cycles because after G3, things started to work correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might say to perform a G3 an/or cmos reset if necessary. I am not sure what other changes I can suggest.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is my fault since I didn't remove all necessary locks before flashing, but the critical question is how to deal with such a situation correctly.

Platform should still be bootable

PR0 range is weird, why it does not cover whole bios region?

It covers the WP_RO region, Vboot's recovery. So theoretically it should boot from recovery (provided Dasharo works with AMI's ME blobs)

```

After successful operation reboot the platform.
9 changes: 9 additions & 0 deletions docs/variants/hardkernel_odroid_h4/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Overview

- [Releases](./releases.md)
- [Building Manual](./building-manual.md)
- [Initial Deployment](./initial-deployment.md)
- [Firmware Update](./firmware-update.md)
- [Recovery](./recovery.md)
- [Hardware Configuration Matrix](./hardware-matrix.md)
- [Test Matrix](./test-matrix.md)
107 changes: 107 additions & 0 deletions docs/variants/hardkernel_odroid_h4/recovery.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Recovery

## Intro

The following documentation describes the process of recovering hardware from
the brick state using an [RTE](../../transparent-validation/rte/introduction.md)
and Dasharo open-source firmware.

## Dual BIOS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section could be improved based on my experience from recovery after bad initial deployment: https://github.com/Dasharo/docs/pull/903/files#r1788722185

Copy link
Contributor Author

@philipandag philipandag Oct 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9fa8e3c

Although I'm not sure if this issue would arise when recovering. You had issues with the initial deployment of Dasharo flashing only the bios region. Here we are flashing the whole FW, so there shouldn't be any issues with ME or network interfaces being in some invalid state afterwards?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also had issues with flashing the whole firmware, especially on top of working proprietary BIOS.


The **ODROID H4+ and ODROID-H4 Ultra** devices both have the Dual BIOS
feature. If the device does not boot properly, the backup flash chip can be
selected using the flash selector jumper.

![](../../images/odroid_flash_switch.jpg)
*First bios chip selected using the flash selector*

1. Move the flash selector jumper to select the backup flash chip. If the
device does not boot from any of the flash chips, an external flashing
needs to be performed. In that case continue with the
[External flashing](#external-flashing) section.
2. If the device boots, boot to an OS.
3. Move the flash selector jumper back to it's original position selecting the
previous flash chip, from which the device does not boot.
4. With the device working, an OS booted and the flash chip selector moved
back, the firmware can be flashed using the command:

```bash
flashrom -p internal -w [path_to_binary]
```
pietrushnic marked this conversation as resolved.
Show resolved Hide resolved

5. After the flashing finishes reboot the device. If the platform does not boot
a CMOS reset and boot from G3 state may be needed:

1. Unplug the CMOS battery and the power supply
2. Wait for 10 seconds
3. Plug the CMOS battery and power supply back in
4. Press the power button

## External flashing

=== "RTE"
### Prerequisites

* [Prepared RTE](../../transparent-validation/rte/v1.1.0/quick-start-guide.md)
* 6x female-female wire cables

### Connections

To prepare the stand for flashing follow the steps described in
the [Generic test stand setup](../../unified-test-documentation/generic-testing-stand-setup.md#detailed-description-of-the-process)

### Firmware flashing

To flash firmware follow the steps described below:

1. Login to RTE via `ssh` or `minicom`.
2. Turn on the platform by connecting the power supply.
3. Wait at least 5 seconds.
4. Turn off the platform by using the power button.
5. Wait at least 3 seconds.
6. Set the proper state of the SPI by using the following commands on RTE:

```bash
# set SPI Vcc to 3.3V
echo 1 > /sys/class/gpio/gpio405/value
# SPI Vcc on
echo 1 > /sys/class/gpio/gpio406/value
# SPI lines ON
echo 1 > /sys/class/gpio/gpio404/value
```

7. Wait at least 2 seconds.
8. Disconnect the power supply from the platform.
9. Wait at least 2 seconds.
10. Check if the flash chip is connected properly

```bash
flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=16000
```

11. Flash the platform by using the following command:

```bash
flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=16000 -w [path_to_binary]
```

> Flashing with flashrom takes about 1 minute.

12. Change back the state of the SPI by using the following commands:

```bash
echo 0 > /sys/class/gpio/gpio404/value
echo 0 > /sys/class/gpio/gpio405/value
echo 0 > /sys/class/gpio/gpio406/value
```

13. Turn on the platform by connecting the power supply.

The first boot of the platform after proceeding with the above procedure can
take much longer than normal.

=== "CH341A"
For instructions on how to perform a recovery
using the CH341A external programmer refer to
the [Odroid Wiki](https://wiki.odroid.com/odroid-h3/hardware/restore_h3_bios_usbprogrammer#with_usb_programmer_module_ch341a)
.
19 changes: 19 additions & 0 deletions docs/variants/hardkernel_odroid_h4/releases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Dasharo compatible with Hardkernel ODROID H4+

Following Release Notes describe status of Open Source Firmware development for
Hardkernel ODROID H4

For details about our release process please read
[Dasharo Standard Release Process](../../dev-proc/standard-release-process.md).

<center>

[Subscribe to Hardkernel ODROID H4 Dasharo Release Newsletter]
[newsletter]{ .md-button .md-button--primary .center }

</center>

Coming soon in the [Dasharo Pro Package for Network Appliance](https://shop.3mdeb.com/shop/dasharo-pro-package/1-year-dasharo-entry-subscription-for-network-appliance/).

<!-- TODO -->
philipandag marked this conversation as resolved.
Show resolved Hide resolved
[newsletter]: https://newsletter.3mdeb.com/subscription/pULA4K0Eo
Loading
Loading