From owner-freebsd-arm@freebsd.org Sat Apr 14 03:44:59 2018 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3EE9F9E53D for ; Sat, 14 Apr 2018 03:44:58 +0000 (UTC) (envelope-from curtis@orleans.occnc.com) Received: from mta1-em1.orleans.occnc.com (mta1-em1.orleans.occnc.com [IPv6:2001:470:88e6:1::141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mta1.orleans.occnc.com", Issuer "OCCNC secondary CA (ca1a2a)" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A264D7E2CD; Sat, 14 Apr 2018 03:44:58 +0000 (UTC) (envelope-from curtis@orleans.occnc.com) Received: from harbor1.v6only.occnc.com (harbor1-em2.v6only.occnc.com [IPv6:2001:470:88e6:2::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: curtis@occnc.com) by mta1-em1.orleans.occnc.com (Postfix) with ESMTPSA id EAB6A1279A; Fri, 13 Apr 2018 23:44:57 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=orleans.occnc.com; s=curtis-orleans-20180228-204217; t=1523677498; bh=fvFYpPyQkwLRcnl9HjNU0rqYJAXBnDdTSziOltXENP8=; h=To:cc:Reply-To:From:Subject:In-reply-to:Date; b=ih7j1SdQvq9Grl7GRdIQyJMuSt9g91Wa6XFab4w2RaSQ+cChUO0+zSjvQ5p/jAHA8 HfrWUPQA8t5BTkKfBw/tF3SbYalSjEAxF+TcwrtucFEzIfd1rxAydOpr/8zooNNWmr BUD8FUz+xy/8DpH4vHbuJLtrgKAFFj1khvhPADLgLJ5d0gDekPZPvvVnid8wPbQxHw U1HKdSfcd0G/GpwGKVUn334arZmw1m8wsbtHUYRzVROa6apDmtk6q484+6DSK7uhKB gUx6dRxUEjhJqCmV59XWoEGBzMB6AuNcgkaIKXBoGwAYBRaiyp6vQw/COYw7v1IiPm M+VXLsAFVs4FQ== To: freebsd-arm@freebsd.org cc: Brad Davis , Curtis Villamizar Reply-To: Curtis Villamizar From: Curtis Villamizar Subject: Re: Success building Orange Pi PC Plus (aka OPiPC+) using crochet In-reply-to: <1523653462.2951986.1337383960.6D5B3105@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <53392.1523672555.1@harbor1-em2.v6only.occnc.com> Content-Transfer-Encoding: quoted-printable Date: Fri, 13 Apr 2018 22:22:35 -0400 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 03:44:59 -0000 In message Curtis Villamizar writes: > = > > On Fri, Apr 13, 2018, at 11:43 AM, Curtis Villamizar wrote: > > > FYI- > > > = > > > I have a build using crochet for Orange Pi PC Plus that works fine. > > > = > > > Instructions are at http://occnc.com/info/arm64/NOTES.html > > > = > > > There are some contributions to crochet but I'm not sure what the > > > right way is to submit patches and additions to crochet is. > > = > > Awesome! Just submit a pull request on github. > > = > > Regards, > > Brad Davis > = > = > Brad, > = > You must have mistaken me for someone with a clue. > = > Could you be more explicit. > = > Curtis Can't get github.com to work so here are git diffs. Please push/pull/whatever on my behalf. Also please keep me on the Cc since I'm not subscribed. Curtis diff --git a/board/OrangePi-PC-Plus/opipc+-workaround.dts b/board/OrangePi= -PC-Plus/opipc+-workaround.dts new file mode 100644 index 0000000..f5c6e94 --- /dev/null +++ b/board/OrangePi-PC-Plus/opipc+-workaround.dts @@ -0,0 +1,6 @@ +#include "sun8i-h3-orangepi-pc-plus.dts" + +&codec { + status =3D "disabled"; +}; + = diff --git a/board/OrangePi-PC-Plus/overlay/etc/fstab b/board/OrangePi-PC-= Plus/overlay/etc/fstab new file mode 100644 index 0000000..09ccd82 --- /dev/null +++ b/board/OrangePi-PC-Plus/overlay/etc/fstab @@ -0,0 +1,6 @@ +/dev/mmcsd0s1 /boot/msdos msdosfs rw,noatime 0 0 +/dev/mmcsd0s2a / ufs rw,noatime 1 1 +md /tmp mfs rw,noatime,-s30m 0 0 +md /var/log mfs rw,noatime,-s15m 0 0 +md /var/tmp mfs rw,noatime,-s12m 0 0 + diff --git a/board/OrangePi-PC-Plus/overlay/etc/rc.conf b/board/OrangePi-P= C-Plus/overlay/etc/rc.conf new file mode 100644 index 0000000..602326d --- /dev/null +++ b/board/OrangePi-PC-Plus/overlay/etc/rc.conf @@ -0,0 +1,15 @@ +hostname=3D"orangepi-pc-plus" +ifconfig_awg0=3D"DHCP" +sshd_enable=3D"YES" + +# Nice if you have a network, else annoying. +#ntpd_enable=3D"YES" +ntpd_sync_on_start=3D"YES" + +# Uncomment to disable common services (more memory) +#cron_enable=3D"NO" +#syslogd_enable=3D"NO" + +sendmail_submit_enable=3D"NO" +sendmail_outbound_enable=3D"NO" +sendmail_msp_queue_enable=3D"NO" diff --git a/board/OrangePi-PC-Plus/setup.sh b/board/OrangePi-PC-Plus/setu= p.sh new file mode 100644 index 0000000..0e26528 --- /dev/null +++ b/board/OrangePi-PC-Plus/setup.sh @@ -0,0 +1,110 @@ +KERNCONF=3DGENERIC +UBLDR_LOADADDR=3D0x42000000 +SUNXI_UBOOT=3D"u-boot-orangepi-pc-plus" +SUNXI_UBOOT_BIN=3D"u-boot.img" +# image size fits a 2+ GB root image in first UFS partition +IMAGE_SIZE=3D$((3 * 1000 * 1000 * 1000)) +TARGET_ARCH=3Darmv6 + +FREEBSD_SRC=3D/usr/src +# BOARD_BOOT_MOUNTPOINT +# BOARD_FREEBSD_MOUNTPOINT +# BOARD_CURRENT_MOUNTPOINT + +UBOOT_PATH=3D"/usr/local/share/u-boot/${SUNXI_UBOOT}" + +allwinner_partition_image ( ) { + echo "Installing U-Boot files" + dd if=3D${UBOOT_PATH}/u-boot-sunxi-with-spl.bin conv=3Dnotrunc,sync \ + of=3D/dev/${DISK_MD} bs=3D1024 seek=3D8 + dd if=3D${UBOOT_PATH}/u-boot.img conv=3Dnotrunc,sync \ + of=3D/dev/${DISK_MD} bs=3D1024 seek=3D40 + disk_partition_mbr + disk_fat_create 32m 16 1m + # note: /usr/{local,ports} elsewhere - 2.5g for base + disk_ufs_create `expr 5 \* 512`m + # rest of disk - either use growfs on prior or add partitions if need= ed + #disk_ufs_create ... +} +strategy_add $PHASE_PARTITION_LWW allwinner_partition_image + +allwinner_check_uboot ( ) { + uboot_port_test ${SUNXI_UBOOT} ${SUNXI_UBOOT_BIN} +} +strategy_add $PHASE_CHECK allwinner_check_uboot + +strategy_add $PHASE_BUILD_OTHER freebsd_ubldr_build \ + UBLDR_LOADADDR=3D${UBLDR_LOADADDR} +strategy_add $PHASE_BOOT_INSTALL freebsd_ubldr_copy_ubldr . + +make_workaround_fdt ( ) { + mkdir -p ${WORKDIR}/opipc+ + # note: the echo expands the directory variables + cmd=3D`echo MACHINE=3Darm /usr/src/sys/tools/fdt/make_dtb.sh \ + ${FREEBSD_SRC}/sys ${BOARDDIR}/opipc+-workaround.dts \ + ${WORKDIR}/opipc+` + echo =3D=3D=3D Running: $cmd =3D=3D=3D + sh -c "$cmd" + if [ $? !=3D 0 ] ; then + echo make_workaround_fdt: command failed + echo " " $cmd + exit 1 + fi +} + +copy_workaround_fdt ( ) { + destdir=3D$1 + if [ x =3D "x$destdir" ] ; then + echo make_workaround_fdt: needs a destination directory argument + exit 1 + else + if [ "x$destdir" =3D xboot ] ; then + destdir=3D${BOARD_BOOT_MOUNTPOINT} # not set at define time + elif [ "x$destdir" =3D xbsd ] ; then + destdir=3D${BOARD_FREEBSD_MOUNTPOINT}/boot/dtb + fi + if [ ! -d $destdir ] ; then + echo make_workaround_fdt: $destdir is not a directory + exit 1 + fi + fi + echo =3D=3D=3D Copy dtb file to ${destdir}/sun8i-h3-orangepi-pc-plus.= dtb =3D=3D=3D + cp ${WORKDIR}/opipc+/opipc+-workaround.dtb \ + ${destdir}/sun8i-h3-orangepi-pc-plus.dtb +} + +#strategy_add $PHASE_BOOT_INSTALL freebsd_install_fdt \ +# ../gnu/dts/arm/sun8i-h3-orangepi-pc-plus.dts \ +# ${BOARD_BOOT_MOUNTPOINT}/sun8i-h3-orangepi-pc-plus.dtb +#strategy_add $PHASE_FREEBSD_BOARD_INSTALL freebsd_install_fdt \ +# ../gnu/dts/arm/sun8i-h3-orangepi-pc-plus.dts \ +# ${BOARD_FREEBSD_MOUNTPOINT}/boot/dtb/orangepi-pc-plus.dtb + +# compiles dts twice but no big deal +strategy_add $PHASE_BOOT_INSTALL make_workaround_fdt +strategy_add $PHASE_BOOT_INSTALL copy_workaround_fdt boot +strategy_add $PHASE_FREEBSD_BOARD_INSTALL copy_workaround_fdt bsd + +make_boot_install_boot_scr_file ( ) { + echo "echo \"Loading U-boot loader: ubldr.bin\"" \ + > ${BOARD_BOOT_MOUNTPOINT}/boot.cmd +# not sure if we need to pre-load the dtb file +# echo "" \ +# >> ${BOARD_BOOT_MOUNTPOINT}/boot.cmd + echo "load \${devtype} \${devnum}:${distro_bootpart}"\ + "${UBLDR_LOADADDR}" ubldr.bin \ + >> ${BOARD_BOOT_MOUNTPOINT}/boot.cmd + echo "go ${UBLDR_LOADADDR}" \ + >> ${BOARD_BOOT_MOUNTPOINT}/boot.cmd + mkimage -A arm -T script -C none -n "Boot Commands" \ + -d ${BOARD_BOOT_MOUNTPOINT}/boot.cmd \ + ${BOARD_BOOT_MOUNTPOINT}/boot.scr +} +strategy_add $PHASE_FREEBSD_BOARD_INSTALL make_boot_install_boot_scr_file + +# BeagleBone puts the kernel on the FreeBSD UFS partition. +strategy_add $PHASE_FREEBSD_BOARD_INSTALL board_default_installkernel . +# overlay/etc/fstab mounts the FAT partition at /boot/msdos +strategy_add $PHASE_FREEBSD_BOARD_INSTALL mkdir -p boot/msdos +# ubldr help and config files go on the UFS partition (after boot dir exi= sts) +strategy_add $PHASE_FREEBSD_BOARD_INSTALL freebsd_ubldr_copy boot