Skip to contentSkip to conversation

board: add support for Intel Galileo Gen 2

PATCH Superseded Kinsella 1 participant 1 message Oct 2, 2015

v5 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Kinsella

#0 lore raw

PATCH v5 1/2 board: add support for Intel Galileo Gen 2

Delta's from v4:-
* Add rootwait to kernel command line

Board support package includes:-
* Toplevel build root configuration
* Github based 3.8.7 Kernel
* Upstream 3.8.7
* Linux 3.8.7 Kernel Driver Patches
* Linux 3.8.7 configuration
* Grub configuration
* Init Script to load modules
* genimage config to create sdcard image.
* Patch to binutils to omit LOCK prefix

---
 board/intel/galileo/efi-part.cfg                   |   9 +
 board/intel/galileo/genimage.cfg                   |  15 +
 board/intel/galileo/grub.cfg                       |  11 +
 board/intel/galileo/linux-3.8.config               | 310 +++++++++++++++++++++
 board/intel/galileo/post-build.sh                  |   2 +
 board/intel/galileo/post-image.sh                  |  26 ++
 .../galileo/rootfs_overlay/etc/init.d/S09modload   |  35 +++
 .../etc/modules-load.galileo/galileo.conf          |   6 +
 .../etc/modules-load.galileo/galileo_gen2.conf     |   7 +
 configs/galileo_defconfig                          |  25 ++
 10 files changed, 446 insertions(+)
 create mode 100644 board/intel/galileo/efi-part.cfg
 create mode 100644 board/intel/galileo/genimage.cfg
 create mode 100644 board/intel/galileo/grub.cfg
 create mode 100644 board/intel/galileo/linux-3.8.config
 create mode 100755 board/intel/galileo/post-build.sh
 create mode 100755 board/intel/galileo/post-image.sh
 create mode 100755 board/intel/galileo/rootfs_overlay/etc/init.d/S09modload
 create mode 100644 board/intel/galileo/rootfs_overlay/etc/modules-load.galileo/galileo.conf
 create mode 100644 board/intel/galileo/rootfs_overlay/etc/modules-load.galileo/galileo_gen2.conf
 create mode 100644 configs/galileo_defconfig
board/intel/galileo/efi-part.cfg new file +9 -0
new file mode 100644
index 0000000..e873db0
@@ -0,0 +1,9 @@
+image efi-part.vfat {
+  vfat {
+      files = {
+        "startup.nsh",
+        "EFI",
+      }
+    }
+  size=512K
+}
board/intel/galileo/genimage.cfg new file +15 -0
new file mode 100644
index 0000000..8ef12c9
@@ -0,0 +1,15 @@
+image sdcard.img {
+  hdimage {
+  }
+
+  partition boot {
+    partition-type = 0xC
+    image = "efi-part.vfat"
+  }
+
+  partition rootfs {
+    partition-type = 0x83
+    image = "rootfs.ext2"
+    size = 512M
+  }
+}
board/intel/galileo/grub.cfg new file +11 -0
new file mode 100644
index 0000000..6777277
@@ -0,0 +1,11 @@
+set default="0"
+set timeout="0"
+
+menuentry "Buildroot" {
+    # Grub2 supports ext2, load the kernel from the Linux rootfs partition
+    # Set root tells grub to search the 2nd partition for the bzImage
+    set root=(hd0,msdos2)
+
+    # Set Linux to boot from the 2nd partition, SD/MMC support is baked into the kernel
+    linux /boot/bzImage root=/dev/mmcblk0p2 rootwait console=ttyS1,115200n8 reboot=efi,warm apic=debug rw
+}
board/intel/galileo/linux-3.8.config new file +310 -0

310 lines not on this page · raw message

board/intel/galileo/post-build.sh new file +2 -0
new file mode 100755
index 0000000..490fb4d
@@ -0,0 +1,2 @@
+#!/bin/sh
+cp board/intel/galileo/grub.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg
board/intel/galileo/post-image.sh new file +26 -0
new file mode 100755
index 0000000..6f5ea66
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+EFI_IMAGE_CFG="board/intel/galileo/efi-part.cfg"
+GENIMAGE_CFG="board/intel/galileo/genimage.cfg"
+EFI_PART_DIR="${BINARIES_DIR}/efi-part"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+
+mkimage () {
+    rm -rf "${GENIMAGE_TMP}"
+
+    genimage \
+      --rootpath "${TARGET_DIR}" \
+      --tmppath "${GENIMAGE_TMP}" \
+      --inputpath "$1" \
+      --outputpath "${BINARIES_DIR}" \
+      --config "$2"
+}
+
+# Create the EFI Partition
+mkimage "${EFI_PART_DIR}" "${EFI_IMAGE_CFG}"
+
+# Create the SD Card Image
+mkimage "${BINARIES_DIR}" "${GENIMAGE_CFG}"
+
+RET=${?}
+exit ${RET}
board/intel/galileo/rootfs_overlay/etc/init.d/S09modload new file +35 -0
new file mode 100755
index 0000000..cb3e573
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+
+load_drivers()
+{
+    while IFS= read -r line; do
+      modprobe $line
+    done < "/etc/modules-load.galileo/$1.conf"
+}
+
+do_board()
+{
+    board=$(cat /sys/devices/virtual/dmi/id/board_name)
+    case "$board" in
+        *"GalileoGen2" )
+            load_drivers "galileo_gen2" ;;
+        *"Galileo" )
+            load_drivers "galileo" ;;
+    esac
+}
+
+case "$1" in
+  start)
+    do_board
+    ;;
+  stop)
+    ;;
+  restart|reload)
+    ;;
+  *)
+    echo "Usage: $0 {start|stop|restart}"
+    exit 1
+esac
+
+exit $?
board/intel/galileo/rootfs_overlay/etc/modules-load.galileo/galileo.conf new file +6 -0
new file mode 100644
index 0000000..762aa2d
@@ -0,0 +1,6 @@
+intel_qrk_gip
+cy8c9540a
+i2c_dev
+industrialio
+ad7298
+stmmac
board/intel/galileo/rootfs_overlay/etc/modules-load.galileo/galileo_gen2.conf new file +7 -0
new file mode 100644
index 0000000..e8081e0
@@ -0,0 +1,7 @@
+intel_qrk_gip
+gpio-pca953x
+pca9685
+i2c_dev
+industrialio
+adc1x8s102
+stmmac
configs/galileo_defconfig new file +25 -0
new file mode 100644
index 0000000..50ebc4a
@@ -0,0 +1,25 @@
+BR2_GLOBAL_PATCH_DIR="board/intel/galileo/patches"
+BR2_KERNEL_HEADERS_VERSION=y
+BR2_DEFAULT_KERNEL_VERSION="3.8"
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_3_8=y
+BR2_BINUTILS_VERSION_2_25_X=y
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttyS1"
+BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y
+BR2_ROOTFS_OVERLAY="board/intel/galileo/rootfs_overlay"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/intel/galileo/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/intel/galileo/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/mdr78/Linux-3.8.7-galileo.git"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="d1a51d55dc67022be6c2d15163ce6dd28540042f"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/intel/galileo/linux-3.8.config"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_2r1=y
+BR2_TARGET_ROOTFS_EXT2_LABEL="rootfs.ext2"
+BR2_TARGET_GRUB2=y
+BR2_TARGET_GRUB2_I386_EFI=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
Signature · 1 line
2.1.0