Skip to contentSkip to conversation

sunxi-tools: new host package

PATCH New Carlo Caione 1 participant 4 messages Mar 8, 2013 Arm/Allwinner sunXi SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 sunxi-tools: new host package

Tools to help hacking Allwinner A10 (aka sun4i) based devices

---
 package/Config.in.host             |  1 +
 package/sunxi-tools/Config.in.host |  7 +++++++
 package/sunxi-tools/sunxi-tools.mk | 20 ++++++++++++++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 package/sunxi-tools/Config.in.host
 create mode 100644 package/sunxi-tools/sunxi-tools.mk
package/Config.in.host +1 -0
index 79050f2..b2b9fbd 100644
@@ -5,6 +5,7 @@ source "package/lpc3250loader/Config.in.host"
 source "package/omap-u-boot-utils/Config.in.host"
 source "package/openocd/Config.in.host"
 source "package/sam-ba/Config.in.host"
+source "package/sunxi-tools/Config.in.host"
 source "package/uboot-tools/Config.in.host"
 
 endmenu
package/sunxi-tools/Config.in.host new file +7 -0
new file mode 100644
index 0000000..71e0418
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_HOST_SUNXI_TOOLS
+	bool "host sunxi-tools"
+	help
+          Tools to help hacking Allwinner A10 (aka sun4i) based devices and
+	  possibly it's successors
+
+	  https://github.com/linux-sunxi/sunxi-tools
package/sunxi-tools/sunxi-tools.mk new file +20 -0
new file mode 100644
index 0000000..60acff5
@@ -0,0 +1,20 @@
+#############################################################
+#
+# sunxi-tools
+#
+#############################################################
+
+SUNXI_TOOLS_VERSION = master
+SUNXI_TOOLS_SITE = git://github.com/linux-sunxi/sunxi-tools.git
+
+define HOST_SUNXI_TOOLS_BUILD_CMDS
+	$(MAKE) -C $(@D)
+endef
+
+define HOST_SUNXI_TOOLS_INSTALL_CMDS
+	for f in fexc bin2fex fex2bin bootinfo fel pio nand-part ; do \
+		install -m 755 -D $(@D)/$$f $(HOST_DIR)/usr/bin/$$f ; \
+	done
+endef
+
+$(eval $(host-generic-package))
Signature · 1 line
1.8.1.5
#2 lore raw

PATCH 2/3 cubieboard: config file

Configuration file for cubieboard (http://cubieboard.org/)

---
 configs/cubieboard_defconfig | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 configs/cubieboard_defconfig
configs/cubieboard_defconfig new file +33 -0
new file mode 100644
index 0000000..42d8eb3
@@ -0,0 +1,33 @@
+# Architecture
+BR2_arm=y
+BR2_cortex_a8=y
+
+# System configuration
+BR2_TARGET_GENERIC_HOSTNAME="sun4i"
+BR2_TARGET_GENERIC_ISSUE="Welcome to use sun4i"
+BR2_TARGET_GENERIC_GETTY=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttyS0"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/cubieboard/post-build.sh"
+
+# Additional tools
+BR2_PACKAGE_HOST_SUNXI_TOOLS=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_GIT_REPO_URL="https://github.com/linux-sunxi/linux-sunxi.git"
+BR2_LINUX_KERNEL_CUSTOM_GIT_VERSION="sunxi-3.4"
+BR2_LINUX_KERNEL_VERSION="sunxi-3.4"
+BR2_LINUX_KERNEL_DEFCONFIG="sun4i"
+
+# Bootloaders
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BOARDNAME="cubieboard"
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_VERSION="sunxi"
+BR2_TARGET_UBOOT_CUSTOM_GIT_REPO_URL="https://github.com/linux-sunxi/u-boot-sunxi.git"
+BR2_TARGET_UBOOT_CUSTOM_GIT_VERSION="sunxi"
+BR2_TARGET_UBOOT_FORMAT_BIN=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_TARGET_UBOOT_SPL_NAME="spl/sunxi-spl.bin"
Signature · 1 line
1.8.1.5
#3 lore raw

PATCH 3/3 cubieboard: scripts

In reply to Carlo Caione

post-build script for cubieboard and an additional script to correctly create the sd-card

---
 board/cubieboard/boot.cmd       |   4 ++
 board/cubieboard/mkCubieCard.sh | 110 ++++++++++++++++++++++++++++++++++++++++
 board/cubieboard/post-build.sh  |  40 +++++++++++++++
 3 files changed, 154 insertions(+)
 create mode 100644 board/cubieboard/boot.cmd
 create mode 100755 board/cubieboard/mkCubieCard.sh
 create mode 100755 board/cubieboard/post-build.sh
board/cubieboard/boot.cmd new file +4 -0
new file mode 100644
index 0000000..849ed00
@@ -0,0 +1,4 @@
+setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait panic=10 ${extra}
+fatload mmc 0 0x43000000 script.bin
+fatload mmc 0 0x48000000 uImage
+bootm 0x48000000
board/cubieboard/mkCubieCard.sh new file +110 -0

110 lines not on this page · raw message

board/cubieboard/post-build.sh new file +40 -0
new file mode 100755
index 0000000..c59e430
@@ -0,0 +1,40 @@
+#!/bin/sh
+# post-build.sh for CubieBoard
+# 2013, Carlo Caione <[email protected]>
+
+TARGET_DIR=$1
+IMAGES_DIR=$1/../images
+BOARD_DIR="$(dirname $0)"
+HOST_DIR=$1/../host/usr/bin
+TMP_DIR=`mktemp -d`
+
+FEX2BIN=$HOST_DIR/fex2bin
+FEX_BOARD_FILE=$TMP_DIR/sys_config/a10/cubieboard.fex
+BIN_BOARD_FILE=$IMAGES_DIR/script.bin
+
+MKIMAGE=$HOST_DIR/mkimage
+BOOT_CMD=$BOARD_DIR/boot.cmd
+BOOT_CMD_H=$IMAGES_DIR/boot.scr
+
+SD_IMAGE=$IMAGES_DIR/sd.img
+
+GIT_SUNXI_BOARD=git://github.com/linux-sunxi/sunxi-boards.git
+
+# Temp dir
+mkdir $TMP_DIR
+
+# Building script.bin
+if [ -e $FEX2BIN ];
+then
+	git clone $GIT_SUNXI_BOARD $TMP_DIR
+	$FEX2BIN $FEX_BOARD_FILE $BIN_BOARD_FILE
+fi
+
+# U-Boot script
+if [ -e $MKIMAGE -a -e $BOOT_CMD ];
+then
+	$MKIMAGE -C none -A arm -T script -d $BOOT_CMD $BOOT_CMD_H
+fi
+
+# Clean-up
+rm -fr $TMP_DIR
Signature · 1 line
1.8.1.5
#1 lore raw

PATCH 1/3 sunxi-tools: new host package

In reply to Carlo Caione
Quoted 2 lines · Carlo Caione

Tools to help hacking Allwinner A10 (aka sun4i) based devices

[cut]

Ups, sorry for double posting this set of patches.

--
Carlo