Skip to content

Commit 12ec2e0

Browse files
committed
configs,rpi4: complete port, Infix booting
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent 27a2576 commit 12ec2e0

File tree

11 files changed

+398
-9
lines changed

11 files changed

+398
-9
lines changed

board/aarch64/rpi/bcm2711_defconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,6 @@ CONFIG_B43=m
622622
CONFIG_B43LEGACY=m
623623
CONFIG_BRCMFMAC=m
624624
CONFIG_BRCMFMAC_USB=y
625-
CONFIG_BRCMDBG=y
626625
CONFIG_IWLWIFI=m
627626
CONFIG_IWLDVM=m
628627
CONFIG_IWLMVM=m
@@ -1510,7 +1509,8 @@ CONFIG_HFSPLUS_FS=m
15101509
CONFIG_JFFS2_FS=m
15111510
CONFIG_JFFS2_SUMMARY=y
15121511
CONFIG_UBIFS_FS=m
1513-
CONFIG_SQUASHFS=m
1512+
CONFIG_SQUASHFS=y
1513+
CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU=y
15141514
CONFIG_SQUASHFS_XATTR=y
15151515
CONFIG_SQUASHFS_LZO=y
15161516
CONFIG_SQUASHFS_XZ=y

board/aarch64/rpi/cmdline.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
root=/dev/mmcblk1p2 rootwait 8250.nr_uarts=1 console=tty1 console=ttyS0,115200 quiet
1+
root=/dev/mmcblk0p2 rootwait console=tty1 console=ttyAMA0,115200

board/aarch64/rpi/config.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
start_file=start4.elf
88
fixup_file=fixup4.dat
99

10+
kernel=u-boot.bin
11+
1012
device_tree=bcm2711-rpi-4-b.dtb
11-
kernel=Image
13+
dtoverlay=rpi-env
14+
dtoverlay=infix-key
1215

1316
# To use an external initramfs file
1417
#initramfs rootfs.cpio.gz
@@ -28,5 +31,11 @@ enable_uart=1
2831
force_turbo=1
2932
#dtoverlay=miniuart-bt
3033

34+
# Run as fast as firmware / board allows
35+
arm_boost=1
36+
3137
# enable 64bits support
3238
arm_64bit=1
39+
40+
# Enable early debugging info
41+
uart_2ndstage=1

board/aarch64/rpi/genimage.cfg.in

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
image boot.vfat {
2+
vfat {
3+
files = {
4+
#BOOT_FILES#
5+
}
6+
}
7+
8+
size = 32M
9+
}
10+
11+
image cfg.ext4 {
12+
empty = true
13+
temporary = true
14+
size = 16M
15+
16+
ext4 {
17+
label = "cfg"
18+
}
19+
}
20+
21+
image var.ext4 {
22+
empty = true
23+
temporary = true
24+
size = 512M
25+
26+
ext4 {
27+
label = "var"
28+
use-mke2fs = true
29+
}
30+
}
31+
32+
image sdcard.img {
33+
hdimage {
34+
partition-table-type = "gpt"
35+
}
36+
37+
partition boot {
38+
partition-type-uuid = EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
39+
bootable = "true"
40+
image = "boot.vfat"
41+
}
42+
43+
partition aux {
44+
partition-uuid = D4EF35A0-0652-45A1-B3DE-D63339C82035
45+
image = "aux.ext4"
46+
}
47+
48+
partition primary {
49+
partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4
50+
bootable = true
51+
size = 200M
52+
image = "rootfs.squashfs"
53+
}
54+
55+
partition secondary {
56+
partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4
57+
bootable = true
58+
size = 200M
59+
image = "rootfs.squashfs"
60+
}
61+
62+
partition cfg {
63+
partition-uuid = 7aa497f0-73b5-47e5-b2ab-8752d8a48105
64+
image = "cfg.ext4"
65+
}
66+
67+
partition var {
68+
partition-uuid = 8046A06A-E45A-4A14-A6AD-6684704A393F
69+
image = "var.ext4"
70+
}
71+
}

board/aarch64/rpi/post-build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
# Armbian firmware installs to /lib/firmware but driver wants the
4+
# file(s) in /lib/firmware/brcm/
5+
if [ -f "${TARGET_DIR}/lib/firmware/BCM4345C0.hcd" ]; then
6+
mv "${TARGET_DIR}/lib/firmware/BCM4345C0.hcd" "${TARGET_DIR}/lib/firmware/brcm/"
7+
fi

board/aarch64/rpi/post-image.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/sh
2+
set -e
3+
4+
BOARD_DIR=$(dirname "$0")
5+
GENIMAGE_CFG="${BUILD_DIR}/genimage.cfg"
6+
GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
7+
8+
# Device trees are installed for distro boot (syslinux.conf), but on RPi
9+
# we need them for the SPL, which feeds the TPL (U-Boot) for use instead
10+
# of the (built-in) control DT other platforms use.
11+
find "${TARGET_DIR}/boot" -type f -name '*.dtb' -exec cp '{}' "${BINARIES_DIR}/" \;
12+
13+
# We've asked U-Boot previously to build overlays for us: Infix signing
14+
# key and our ixboot scripts. Make sure here they are installed in the
15+
# proper directory so genimage can create the DOS partition the SPL
16+
# reads config.txt from.
17+
find "${BINARIES_DIR}" -type f -name '*.dtbo' -exec mv '{}' "${BINARIES_DIR}/rpi-firmware/overlays/" \;
18+
19+
# Create FILES array for the genimage.cfg generation
20+
FILES=""
21+
for f in "${BINARIES_DIR}"/*.dtb "${BINARIES_DIR}"/rpi-firmware/*; do
22+
case "$f" in
23+
*~|*.bak) continue ;;
24+
esac
25+
FILES="${FILES}\t\t\t\"${f#"${BINARIES_DIR}/"}\",\n"
26+
done
27+
28+
KERNEL=$(sed -n 's/^kernel=//p' "${BINARIES_DIR}/rpi-firmware/config.txt")
29+
FILES="${FILES}\t\t\t\"${KERNEL}\""
30+
31+
sed "s|#BOOT_FILES#|${FILES}|" "${BOARD_DIR}/genimage.cfg.in" > "${GENIMAGE_CFG}"
32+
33+
ROOTPATH_TMP=$(mktemp -d)
34+
trap 'rm -rf \"$ROOTPATH_TMP\"' EXIT
35+
36+
rm -rf "${GENIMAGE_TMP}"
37+
38+
genimage \
39+
--rootpath "${ROOTPATH_TMP}" \
40+
--tmppath "${GENIMAGE_TMP}" \
41+
--inputpath "${BINARIES_DIR}" \
42+
--outputpath "${BINARIES_DIR}" \
43+
--config "${GENIMAGE_CFG}"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
default rpi4b
2+
menu title Boot Menu
3+
prompt 1
4+
timeout 30
5+
6+
label rpi4b
7+
menu label Infix on Raspberry Pi 4B
8+
kernel /boot/Image
9+
devicetree /boot/broadcom/bcm2711-rpi-4-b.dtb
10+
append ${bootargs_root} 8250.nr_uarts=1 console=ttyS0,115200 ${bootargs_log} -- ${bootargs_user}
11+
12+
label rpi400
13+
menu label Infix on Raspberry Pi 400
14+
kernel /boot/Image
15+
devicetree /boot/broadcom/bcm2711-rpi-400.dtb
16+
append ${bootargs_root} 8250.nr_uarts=1 console=ttyS0,115200 ${bootargs_log} -- ${bootargs_user}
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
{
2+
"ieee802-dot1ab-lldp:lldp": {
3+
"infix-lldp:enabled": true
4+
},
5+
"ietf-interfaces:interfaces": {
6+
"interface": [
7+
{
8+
"name": "lo",
9+
"type": "infix-if-type:loopback",
10+
"ietf-ip:ipv4": {
11+
"address": [
12+
{
13+
"ip": "127.0.0.1",
14+
"prefix-length": 8
15+
}
16+
]
17+
},
18+
"ietf-ip:ipv6": {
19+
"address": [
20+
{
21+
"ip": "::1",
22+
"prefix-length": 128
23+
}
24+
]
25+
}
26+
},
27+
{
28+
"name": "eth0",
29+
"type": "infix-if-type:ethernet"
30+
}
31+
]
32+
},
33+
"ietf-keystore:keystore": {
34+
"asymmetric-keys": {
35+
"asymmetric-key": [
36+
{
37+
"name": "genkey",
38+
"public-key-format": "ietf-crypto-types:ssh-public-key-format",
39+
"public-key": "",
40+
"private-key-format": "ietf-crypto-types:rsa-private-key-format",
41+
"cleartext-private-key": "",
42+
"certificates": {}
43+
}
44+
]
45+
}
46+
},
47+
"ietf-netconf-acm:nacm": {
48+
"enable-nacm": true,
49+
"groups": {
50+
"group": [
51+
{
52+
"name": "admin",
53+
"user-name": [
54+
"admin"
55+
]
56+
}
57+
]
58+
},
59+
"rule-list": [
60+
{
61+
"name": "admin-acl",
62+
"group": [
63+
"admin"
64+
],
65+
"rule": [
66+
{
67+
"name": "permit-all",
68+
"module-name": "*",
69+
"access-operations": "*",
70+
"action": "permit",
71+
"comment": "Allow 'admin' group complete access to all operations and data."
72+
}
73+
]
74+
},
75+
{
76+
"name": "default-deny-all",
77+
"group": [
78+
"*"
79+
],
80+
"rule": [
81+
{
82+
"name": "deny-password-read",
83+
"module-name": "ietf-system",
84+
"path": "/ietf-system:system/authentication/user/password",
85+
"access-operations": "*",
86+
"action": "deny"
87+
}
88+
]
89+
}
90+
]
91+
},
92+
"ietf-netconf-server:netconf-server": {
93+
"listen": {
94+
"endpoints": {
95+
"endpoint": [
96+
{
97+
"name": "default-ssh",
98+
"ssh": {
99+
"tcp-server-parameters": {
100+
"local-address": "::"
101+
},
102+
"ssh-server-parameters": {
103+
"server-identity": {
104+
"host-key": [
105+
{
106+
"name": "default-key",
107+
"public-key": {
108+
"central-keystore-reference": "genkey"
109+
}
110+
}
111+
]
112+
}
113+
}
114+
}
115+
}
116+
]
117+
}
118+
}
119+
},
120+
"ietf-system:system": {
121+
"hostname": "rpi4",
122+
"ntp": {
123+
"enabled": true,
124+
"server": [
125+
{
126+
"name": "ntp.org",
127+
"udp": {
128+
"address": "pool.ntp.org"
129+
},
130+
"iburst": true
131+
}
132+
]
133+
},
134+
"authentication": {
135+
"user": [
136+
{
137+
"name": "admin",
138+
"password": "$factory$",
139+
"infix-system:shell": "bash"
140+
}
141+
]
142+
},
143+
"infix-system:motd-banner": "Li0tLS0tLS0uCnwgIC4gLiAgfCBJbmZpeCAtLSBhIE5ldHdvcmsgT3BlcmF0aW5nIFN5c3RlbQp8LS4gdiAuLXwgaHR0cHM6Ly9rZXJuZWxraXQuZ2l0aHViLmlvCictJy0tLSctJwo="
144+
},
145+
"infix-dhcp-client:dhcp-client": {
146+
"client-if": [
147+
{
148+
"if-name": "eth0",
149+
"option": [
150+
{
151+
"id": "netmask"
152+
},
153+
{
154+
"id": "broadcast"
155+
},
156+
{
157+
"id": "router"
158+
},
159+
{
160+
"id": "domain"
161+
},
162+
{
163+
"id": "hostname"
164+
},
165+
{
166+
"id": "dns-server"
167+
},
168+
{
169+
"id": "ntp-server"
170+
}
171+
]
172+
}
173+
]
174+
},
175+
"infix-meta:meta": {
176+
"infix-meta:version": "1.2"
177+
},
178+
"infix-services:mdns": {
179+
"enabled": true
180+
},
181+
"infix-services:web": {
182+
"enabled": true,
183+
"console": {
184+
"enabled": true
185+
},
186+
"netbrowse": {
187+
"enabled": true
188+
},
189+
"restconf": {
190+
"enabled": true
191+
}
192+
}
193+
}

board/aarch64/rpi/uboot/extras.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# CONFIG_MMC_PCI is not set
2+
CONFIG_OF_OVERLAY_LIST="rpi-env infix-key"
3+
# CONFIG_ENV_IS_IN_FAT is not set

0 commit comments

Comments
 (0)