Skip to content

Commit 40d3fc0

Browse files
authored
Merge pull request #236 from siemens/su/split-pgs
Split the firmware building for PG1 and PG2
2 parents f9615cf + 4db11bc commit 40d3fc0

File tree

13 files changed

+72
-15
lines changed

13 files changed

+72
-15
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ jobs:
3636
build/tmp/deploy/images/iot2050/iot2050-image-example-iot2050-debian-iot2050.wic.img.bmap
3737
3838
bootloaders:
39-
name: Bootloaders
39+
name: Bootloaders for both PG1 and PG2
4040
runs-on: ubuntu-latest
4141
steps:
4242
- name: Checkout
4343
uses: actions/checkout@v2
44-
- name: Build image
44+
- name: Build bootloader image for PG1
45+
run: ./kas-container build kas-iot2050-boot.yml:kas/opt/pg1.yml
46+
- name: Build bootloader image for PG2
4547
run: ./kas-container build kas-iot2050-boot.yml
4648
- name: Archive bootloaders
4749
uses: actions/upload-artifact@v2

.gitlab-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ all:
2424
- kas build kas-iot2050-example.yml
2525
- kas build kas-iot2050-example.yml:kas/opt/preempt-rt.yml
2626
- sudo rm -rf build/tmp
27+
- kas build kas-iot2050-boot.yml:kas/opt/pg1.yml
28+
- sudo rm -rf build/tmp
2729
- kas build kas-iot2050-boot.yml

conf/machine/iot2050.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
DISTRO_ARCH ?= "arm64"
1212

13-
PREFERRED_PROVIDER_u-boot-${MACHINE} = "u-boot-iot2050"
13+
PREFERRED_PROVIDER_u-boot-${MACHINE} ?= "u-boot-iot2050-pg2"
1414

1515
KERNEL_NAME ?= "iot2050"
1616

kas/opt/pg1.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# Copyright (c) Siemens AG, 2022
3+
#
4+
# Authors:
5+
# Su Baocheng <[email protected]>
6+
#
7+
# This file is subject to the terms and conditions of the MIT License. See
8+
# COPYING.MIT file in the top-level directory.
9+
#
10+
11+
header:
12+
version: 10
13+
14+
local_conf_header:
15+
u-boot: |
16+
PREFERRED_PROVIDER_u-boot-${MACHINE} = "u-boot-iot2050-pg1"

recipes-bsp/u-boot/README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,33 @@ The boot loader is built like this:
88
./kas-container build kas-iot2050-boot.yml
99
```
1010

11-
After the build the boot image is under
11+
Default built is for PG2 board. To build for PG1:
12+
13+
```shell
14+
./kas-container build kas-iot2050-boot.yml:kas/opt/pg1.yml
15+
```
16+
17+
After the build the boot images are under
1218

1319
```text
14-
build/tmp/deploy/images/iot2050/iot2050-image-boot.bin
20+
build/tmp/deploy/images/iot2050/iot2050-pg1-image-boot.bin
21+
build/tmp/deploy/images/iot2050/iot2050-pg2-image-boot.bin
1522
```
1623

1724
## Flashing the image
1825

1926
> :warning:
2027
> Flashing an incorrect image may brick the device!
2128
22-
Write `iot2050-image-boot.bin` to an SD card and insert that into
29+
Write `iot2050-pgN-image-boot.bin` to an SD card and insert that into
2330
the target device. Then boot into the U-Boot shell and execute there:
2431

2532
```shell
2633
sf probe
27-
load mmc 0:1 $loadaddr /path/to/iot2050-image-boot.bin
34+
load mmc 0:1 $loadaddr /path/to/iot2050-pgN-image-boot.bin
2835
sf update $loadaddr 0x0 $filesize
2936
```
3037

31-
> :note:
32-
> When updating the boot loader of the BASIC variant, make sure to remove
33-
> 0014-iot2050-Provide-dtb-for-devices-using-boot-load-V01..patch from the kernel
34-
> patch queue in recipes-kernel/linux/linux-iot2050_*.bb.
35-
3638
## Recovering a bricked device
3739

3840
If the device does not come up anymore after flashing the boot loader, you can
@@ -41,5 +43,5 @@ Dediprog SF100 or SF600. Attach the programmer to X17, then run the following
4143
on the host machine:
4244

4345
```shell
44-
dpcmd --vcc 2 -v -u iot2050-image-boot.bin
46+
dpcmd --vcc 2 -v -u iot2050-pgN-image-boot.bin
4547
```
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
188 KB
Binary file not shown.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#
2+
# Copyright (c) Siemens AG, 2022
3+
#
4+
# Authors:
5+
# Su Baocheng <[email protected]>
6+
#
7+
# This file is subject to the terms and conditions of the MIT License. See
8+
# COPYING.MIT file in the top-level directory.
9+
#
10+
11+
require u-boot-iot2050_2021.04.inc
12+
13+
SPI_FLASH_DEPLOY_IMG = "iot2050-pg1-image-boot.bin"
14+
15+
do_prepare_build_append() {
16+
ln -sf ../prebuild/tiboot3_sr1.bin ${S}/tiboot3.bin
17+
}

0 commit comments

Comments
 (0)