Skip to contentSkip to conversation

board: amarula: Add A64-Relic support

PATCH Superseded Jagan Teki 2 participants 3 messages Jun 20, 2018 – Jun 26, 2018

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

PATCH v3 1/2 board: amarula: Add A64-Relic support

Add initial support for Amarula A64-Relic board
with below features:
- U-Boot 2018.07-rc1
- Linux 4.17.0-rc6
- Default packages from buildroot

---
Changes for v3:
- Use 4.17 kernel headers
- Add wiki link
- Add BR2_PACKAGE_HOST_ANDROID_TOOLS_FASTBOOT
- Update comments on readme.txt suggested by Thomas Changes for v2:
- Use mainline U-Boot
- Drop uboot.fragment since the UMS used for developement, so note it on readme.txt how to use.
- format the 'Write eMMC' steps suggested by Arnout.
- fix fastboot steps in readme.txt
- add offset in genimage.cfg for boot partition instead of size

 .gitlab-ci.yml                        |  1 +
 DEVELOPERS                            |  1 +
 board/amarula/a64-relic/extlinux.conf |  4 ++
 board/amarula/a64-relic/genimage.cfg  | 39 +++++++++++++++++
 board/amarula/a64-relic/post-build.sh |  4 ++
 board/amarula/a64-relic/readme.txt    | 81 +++++++++++++++++++++++++++++++++++
 configs/amarula_a64_relic_defconfig   | 47 ++++++++++++++++++++
 7 files changed, 177 insertions(+)
 create mode 100644 board/amarula/a64-relic/extlinux.conf
 create mode 100644 board/amarula/a64-relic/genimage.cfg
 create mode 100755 board/amarula/a64-relic/post-build.sh
 create mode 100644 board/amarula/a64-relic/readme.txt
 create mode 100644 configs/amarula_a64_relic_defconfig
.gitlab-ci.yml +1 -0
index e80491cdde..9663105462 100644
@@ -79,6 +79,7 @@ acmesystems_aria_g25_128mb_defconfig: *defconfig
 acmesystems_aria_g25_256mb_defconfig: *defconfig
 acmesystems_arietta_g25_128mb_defconfig: *defconfig
 acmesystems_arietta_g25_256mb_defconfig: *defconfig
+amarula_a64_relic_defconfig: *defconfig
 amarula_vyasa_rk3288_defconfig: *defconfig
 arcturus_ucls1012a_defconfig: *defconfig
 arcturus_ucp1020_defconfig: *defconfig
DEVELOPERS +1 -0
index d22ac527fa..0825da5f0c 100644
@@ -893,6 +893,7 @@ F:	board/amarula/
 F:	board/asus/
 F:	board/bananapi/
 F:	board/engicam/
+F:	configs/amarula_a64_relic_defconfig
 F:	configs/amarula_vyasa_rk3288_defconfig
 F:	configs/asus_tinker_rk3288_defconfig
 F:	board/friendlyarm/nanopi-a64/
board/amarula/a64-relic/extlinux.conf new file +4 -0
new file mode 100644
index 0000000000..9f469846bc
@@ -0,0 +1,4 @@
+label linux-4.17.0-rc3
+  kernel /Image
+  devicetree /sun50i-a64-amarula-relic.dtb
+  append console=ttyS0,115200 earlyprintk root=/dev/mmcblk1p4 rootwait
board/amarula/a64-relic/genimage.cfg new file +39 -0
new file mode 100644
index 0000000000..871412dee7
@@ -0,0 +1,39 @@
+image boot.vfat {
+	vfat {
+		files = {
+			"Image",
+			"sun50i-a64-amarula-relic.dtb",
+			"extlinux"
+		}
+	}
+	size = 64M
+}
+
+image sdcard.img {
+	hdimage {
+	}
+
+	partition spl {
+		in-partition-table = "no"
+		image = "sunxi-spl.bin"
+		offset = 8192
+	}
+
+	partition u-boot {
+		in-partition-table = "no"
+		image = "u-boot.itb"
+		offset = 40K
+	}
+
+	partition boot {
+		partition-type = 0xC
+		bootable = "true"
+		image = "boot.vfat"
+		offset = 1M
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+	}
+}
board/amarula/a64-relic/post-build.sh new file +4 -0
new file mode 100755
index 0000000000..ec20fca7d9
@@ -0,0 +1,4 @@
+#!/bin/sh
+BOARD_DIR="$(dirname $0)"
+
+install -m 0644 -D $BOARD_DIR/extlinux.conf $BINARIES_DIR/extlinux/extlinux.conf
board/amarula/a64-relic/readme.txt new file +81 -0

81 lines not on this page · raw message

configs/amarula_a64_relic_defconfig new file +47 -0

47 lines not on this page · raw message

Signature · 1 line
2.14.3
author
#1 lore raw

PATCH v3 2/2 board: amarula: a64-relic: Add WiFi support

Amarula A64-Relic board has AP6330 WiFi/BT combo, but does not have ethernet port. So it makes sense to enable wireless networking by default:
- add broadcom wireless firmware package to image
- add basic wireless tools to image
- add rootfs overlay with proper NVRAM file for on-board AP6330 chip
- add mdev to image to enable module autoloading
- update readme.txt to test wifi

---
Changes for v3:
- none
Changes for v2:
- drop init scripts for module loading
- add mdev for module autoloading

 board/amarula/a64-relic/readme.txt                 |  9 +++
 .../lib/firmware/brcm/brcmfmac4330-sdio.txt        | 83 ++++++++++++++++++++++
 configs/amarula_a64_relic_defconfig                | 13 ++++
 3 files changed, 105 insertions(+)
 create mode 100644 board/amarula/a64-relic/rootfs_overlay/lib/firmware/brcm/brcmfmac4330-sdio.txt
board/amarula/a64-relic/readme.txt +9 -0
index 0c4894b9f9..b6f89a1627 100644
@@ -76,6 +76,15 @@ capability of U-Boot. To achieve this:
     => mmc dev 1
     => ums 0 mmc 1
 
+WiFi
+====
+
+ # wpa_passphrase ACCESSPOINTNAME >> /etc/wpa_supplicant.conf
+   (type password and enter)
+ # wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B
+ # udhcpc -i wlan0
+ # ping google.com
+
 --
 Jagan Teki <[email protected]>
 20-Jun-2018
board/amarula/a64-relic/rootfs_overlay/lib/firmware/brcm/brcmfmac4330-sdio.txt new file +83 -0

83 lines not on this page · raw message

configs/amarula_a64_relic_defconfig +13 -0
index 846275eadb..82c30fbb0f 100644
@@ -42,6 +42,19 @@ BR2_PACKAGE_HOST_ANDROID_TOOLS_FASTBOOT=y
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
 BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/amarula/a64-relic/genimage.cfg"
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/amarula/a64-relic/post-build.sh"
+BR2_ROOTFS_OVERLAY="board/amarula/a64-relic/rootfs_overlay"
+
+# wireless firmware
+BR2_PACKAGE_LINUX_FIRMWARE=y
+BR2_PACKAGE_LINUX_FIRMWARE_BRCM_BCM43XX=y
+
+# wireless tools
+BR2_PACKAGE_IW=y
+BR2_PACKAGE_WPA_SUPPLICANT=y
+BR2_PACKAGE_WPA_SUPPLICANT_NL80211=y
+BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT=y
+BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
Signature · 1 line
2.14.3
#2 lore raw

PATCH v3 1/2 board: amarula: Add A64-Relic support

In reply to Jagan Teki

Hello Jagan,

Thanks for this new iteration and the improvements. However, there is still one thing I don't understand.

board/amarula/a64-relic/readme.txt line 33

Quoted 8 lines · Jagan Teki
board/amarula/a64-relic/readme.txt new file +8 -0
+build files at output/images/:
+  - sunxi-spl.bin
+  - u-boot.itb
+  - Image
+  - sun50i-a64-amarula-relic.dtb
+  - boot.vfat
+  - rootfs.ext4
+  - sdcard.img

Why do you generate sdcard.img ? It is not used anywhere in the instructions below, because you're just flashing the eMMC through fastboot, on a per-partition basis.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com