Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] board: add support for ARC HS Development Kit (HSDK)
@ 2017-12-07 17:06 Evgeniy Didin
  2017-12-13  7:34 ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Evgeniy Didin @ 2017-12-07 17:06 UTC (permalink / raw)
  To: buildroot

Synopsys DesignWare HSDK (which stands for ARC HS
Development Kit) is the latest and greatest development
platform that sports quad-core ARC HS38 in real silicon.

Most noticeable features of the board are:
 * Quad-core ARC HS38 CPU running at 1GHz
 * 4Gb of DDR
 * Built-in Vivante GPU (well supported via open source
   Etnaviv drivers)
 * Built-in Wi-Fi/Bluetooth module (RedPine RS-9113)

And as usual we have:
 * [micro] SD-card slot
 * 2 USB 2.0 ports
 * 1Gbit Ethernet port
 * Built-in Digilent JTAG probe
 * Serial port accessible via micro-USB port

Writing sdcard.img on SDcard creates two partitions:
 * FAT32 with uImage and uboot.env
 * EXT4 with root filesystem

We modify kernel config because in default hsdk kernel config
CONFIG_INITRAMFS_SOURCE parameter is set and when we build
rootfs separately (BR2_TARGET_ROOTFS_INITRAMFS is not set)
error appears. Also we set up CONFIG_ARC_UBOOT_SUPPORT which
enables usage of uboot variables in the boot process.

Signed-off-by: Evgeniy Didin <didin@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: arc-buildroot at synopsys.com
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

---
 board/synopsys/hsdk/genimage-hsdk.cfg | 26 +++++++++++++++++++++++++
 board/synopsys/hsdk/linux.fragment    |  2 ++
 board/synopsys/hsdk/post-image.sh     | 18 ++++++++++++++++++
 board/synopsys/hsdk/uboot.env.txt     |  9 +++++++++
 configs/snps_hsdk_defconfig           | 36 +++++++++++++++++++++++++++++++++++
 5 files changed, 91 insertions(+)
 create mode 100644 board/synopsys/hsdk/genimage-hsdk.cfg
 create mode 100644 board/synopsys/hsdk/linux.fragment
 create mode 100755 board/synopsys/hsdk/post-image.sh
 create mode 100644 board/synopsys/hsdk/uboot.env.txt
 create mode 100644 configs/snps_hsdk_defconfig

diff --git a/board/synopsys/hsdk/genimage-hsdk.cfg b/board/synopsys/hsdk/genimage-hsdk.cfg
new file mode 100644
index 0000000000..8928f704a2
--- /dev/null
+++ b/board/synopsys/hsdk/genimage-hsdk.cfg
@@ -0,0 +1,26 @@
+image boot.vfat {
+  vfat {
+    files = {
+      "uboot.env",
+      "uImage"
+    }
+  }
+  size = 100M
+}
+
+image sdcard.img {
+  hdimage {
+  }
+
+  partition boot {
+    partition-type = 0xC
+    bootable = "true"
+    image = "boot.vfat"
+  }
+
+  partition rootfs {
+    partition-type = 0x83
+    image = "rootfs.ext4"
+    size = 1G
+  }
+}
diff --git a/board/synopsys/hsdk/linux.fragment b/board/synopsys/hsdk/linux.fragment
new file mode 100644
index 0000000000..53b9305e09
--- /dev/null
+++ b/board/synopsys/hsdk/linux.fragment
@@ -0,0 +1,2 @@
+CONFIG_INITRAMFS_SOURCE=
+CONFIG_ARC_UBOOT_SUPPORT=y
diff --git a/board/synopsys/hsdk/post-image.sh b/board/synopsys/hsdk/post-image.sh
new file mode 100755
index 0000000000..5871a410a5
--- /dev/null
+++ b/board/synopsys/hsdk/post-image.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+BOARD_DIR="$(dirname $0)"
+BOARD_NAME="$(basename ${BOARD_DIR})"
+GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+rm -rf "${GENIMAGE_TMP}"
+
+mkenvimage -s 0x4000 -o output/images/uboot.env ${BOARD_DIR}/uboot.env.txt
+
+genimage                           \
+        --rootpath "${TARGET_DIR}"     \
+        --tmppath "${GENIMAGE_TMP}"    \
+        --inputpath "${BINARIES_DIR}"  \
+        --outputpath "${BINARIES_DIR}" \
+        --config "${GENIMAGE_CFG}"
+tar czf output/images/sdcard.img.tar.gz --directory="./output/images"  sdcard.img
+exit $?
diff --git a/board/synopsys/hsdk/uboot.env.txt b/board/synopsys/hsdk/uboot.env.txt
new file mode 100644
index 0000000000..6bcfb56a77
--- /dev/null
+++ b/board/synopsys/hsdk/uboot.env.txt
@@ -0,0 +1,9 @@
+baudrate=115200
+bootargs=console=ttyS3,115200n8 root=/dev/mmcblk0p2 rootwait
+bootcmd=fatload mmc 0:1; bootm
+bootdelay=2
+bootfile=uImage
+loadaddr=0x82000000
+stderr=serial0 at f0005000
+stdin=serial0 at f0005000
+stdout=serial0 at f0005000
diff --git a/configs/snps_hsdk_defconfig b/configs/snps_hsdk_defconfig
new file mode 100644
index 0000000000..8c67b0ec0d
--- /dev/null
+++ b/configs/snps_hsdk_defconfig
@@ -0,0 +1,36 @@
+#Architecture
+BR2_arcle=y
+BR2_archs38=y
+
+#Linux headers
+BR2_KERNEL_HEADERS_4_14=y
+
+#System
+BR2_TARGET_GENERIC_HOSTNAME="hsdk"
+BR2_TARGET_GENERIC_ISSUE="Welcome to the HSDK Platform"
+BR2_SYSTEM_DHCP="eth0"
+
+#Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.14.4"
+BR2_LINUX_KERNEL_DEFCONFIG="hsdk"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/synopsys/hsdk/linux.fragment"
+
+#Filesystem / image
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/synopsys/hsdk/post-image.sh"
+
+#Bootloader
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2017.11"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="hsdk"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_FORMAT_ELF=y
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-12-18 13:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-07 17:06 [Buildroot] [PATCH] board: add support for ARC HS Development Kit (HSDK) Evgeniy Didin
2017-12-13  7:34 ` Thomas Petazzoni
2017-12-13 18:04   ` Alexey Brodkin
2017-12-14  6:08     ` Thomas Petazzoni
2017-12-15  9:15       ` Alexey Brodkin
2017-12-18 11:06         ` Thomas Petazzoni
2017-12-18 13:05           ` Alexey Brodkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox