Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions base_external/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source "$BR2_EXTERNAL_assignment_base_PATH/package/aesd-assignments/Config.in"
7 changes: 5 additions & 2 deletions base_external/configs/aesd_rpi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@ BR2_ARM_FPU_NEON_VFPV4=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_SYSTEM_DHCP="eth0"
BR2_ROOTFS_OVERLAY="../base_external/rootfs_overlay/"
BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi3/post-build.sh"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3/post-image.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="--add-pi3-miniuart-bt-overlay"
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3/post-image.sh ../base_external/post-image.sh"
BR2_ROOTFS_POST_SCRIPT_ARGS="--add-pi3-miniuart-bt-overlay --add-SPI"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,5eeff139ea9135db6e01a58ef613338f1d0899d8)/linux-5eeff139ea9135db6e01a58ef613338f1d0899d8.tar.gz"
BR2_LINUX_KERNEL_DEFCONFIG="bcm2709"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2710-rpi-3-b bcm2710-rpi-3-b-plus bcm2710-rpi-cm3"
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_PACKAGE_SPIDEV_TEST=y
BR2_PACKAGE_RPI_FIRMWARE=y
BR2_PACKAGE_SPI_TOOLS=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
Expand Down
2 changes: 1 addition & 1 deletion base_external/external.desc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
name: assignment_base
description: Base customization for assignment
description: Base customization for assignment
2 changes: 1 addition & 1 deletion base_external/external.mk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include $(sort $(wildcard $(BR2_EXTERNAL_assignment_base_PATH)/package/*/*.mk))
include $(sort $(wildcard $(BR2_EXTERNAL_assignment_base_PATH)/package/*/*.mk))
51 changes: 51 additions & 0 deletions base_external/post-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

set -e

#BOARD_DIR="$(dirname $0)"
BOARD_DIR="../buildroot/board/raspberrypi3"
BOARD_NAME="$(basename ${BOARD_DIR})"
GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg"
GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"

for arg in "$@"
do
case "${arg}" in

# SPI/I2C
--add-SPI)
if ! grep -qE '^dtparam=spi=on' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
# enable SPi
dtparam=spi=on
__EOF__
fi
;;

--gpu_mem_256=*|--gpu_mem_512=*|--gpu_mem_1024=*)
# Set GPU memory
gpu_mem="${arg:2}"
sed -e "/^${gpu_mem%=*}=/s,=.*,=${gpu_mem##*=}," -i "${BINARIES_DIR}/rpi-firmware/config.txt"
;;
esac

done

# Pass an empty rootpath. genimage makes a full copy of the given rootpath to
# ${GENIMAGE_TMP}/root so passing TARGET_DIR would be a waste of time and disk
# space. We don't rely on genimage to build the rootfs image, just to insert a
# pre-built one in the disk image.

trap 'rm -rf "${ROOTPATH_TMP}"' EXIT
ROOTPATH_TMP="$(mktemp -d)"

rm -rf "${GENIMAGE_TMP}"

genimage \
--rootpath "${ROOTPATH_TMP}" \
--tmppath "${GENIMAGE_TMP}" \
--inputpath "${BINARIES_DIR}" \
--outputpath "${BINARIES_DIR}" \
--config "${GENIMAGE_CFG}"

exit $?
19 changes: 19 additions & 0 deletions base_external/rootfs_overlay/etc/init.d/S99lddmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#! /bin/sh


case "$1" in
start)
echo "Starting init script for I2C module"
modprobe spidev
modprobe spi-bcm2835
;;
stop)
echo "Removing user modules"
rmmod spi-bcm2835
rmmo spidev
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
7 changes: 7 additions & 0 deletions clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
#Script to clean buildroot configuration.
#Author: Siddhant Jajoo.


make -C buildroot distclean

Binary file added screenshots/spi_defconfig.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/spi_make_menuconfig.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.