Beginning of support for odroid c2

This commit is contained in:
Bob Mottram 2016-06-28 17:18:15 +01:00
parent 7cbb3242bf
commit 33e6f2c2be
No known key found for this signature in database
GPG Key ID: BA68F26108DC9F87
5 changed files with 173 additions and 93 deletions

View File

@ -51,7 +51,7 @@ To build a 64bit Qemu image:
freedombone-image -t qemu-x86_64 -s 8G freedombone-image -t qemu-x86_64 -s 8G
Other supported boards are cubieboard2, cubietruck, olinuxino-lime, olinuxino-lime2 and olinuxino-micro. Other supported boards are cubieboard2, cubietruck, olinuxino-lime, olinuxino-lime2, olinuxino-micro and odroid-c2.
If the image build fails with an error such as "/Error reading from server. Remote end closed connection/" then you can specify a debian package mirror repository manually with: If the image build fails with an error such as "/Error reading from server. Remote end closed connection/" then you can specify a debian package mirror repository manually with:

Binary file not shown.

View File

@ -133,6 +133,55 @@ beaglebone_repack_kernel() {
-d $initRd uInitrd ) -d $initRd uInitrd )
} }
odroidc2_setup_boot() {
dtb="$1"
# Setup uEnv.txt
if grep -q btrfs /etc/fstab ; then
fstype=btrfs
else
fstype=ext4
fi
kernelVersion=$(ls /usr/lib/*/${dtb}.dtb | head -1 | cut -d/ -f4)
version=$(echo $kernelVersion | sed 's/linux-image-\(.*\)/\1/')
initRd=initrd.img-$version
vmlinuz=vmlinuz-$version
# based on http://odroid.com/dokuwiki/doku.php?id=en:c2_building_u-boot
cat >> /boot/uEnv.txt <<EOF
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=$fstype rootwait fixrtc
mmcrootflags=subvol=@
console=ttyO0,115200n8
kernel_file=$vmlinuz
initrd_file=$initRd
loadaddr=0x11000000
initrd_addr=0x13000000
fdtaddr=0x1000000
initrd_high=0xffffffff
fdt_high=0xffffffff
loadkernel=load mmc \${mmcdev}:\${mmcpart} \${loadaddr} \${kernel_file}
loadinitrd=load mmc \${mmcdev}:\${mmcpart} \${initrd_addr} \${initrd_file}; setenv initrd_size \${filesize}
loadfdt=load mmc \${mmcdev}:\${mmcpart} \${fdtaddr} /dtbs/\${fdtfile}
m="1080p60hz"
m_bpp="32"
loadfiles=run loadkernel; run loadinitrd; run loadfdt
mmcargs=setenv bootargs rootwait rw console=tty0 console=\${console} root=\${mmcroot} rootfstype=\${mmcrootfstype} rootflags=\${mmcrootflags} no_console_suspend hdmimode=${m} m_bpp=${m_bpp} fsck.fix=yes
uenvcmd=run loadfiles; run mmcargs; booti \${loadaddr} \${initrd_addr}:\${initrd_size} \${fdtaddr}
EOF
mkdir -p /boot/dtbs
cp /usr/lib/linux-image-*-armmp/* /boot/dtbs
}
a20_setup_boot() { a20_setup_boot() {
dtb="$1" dtb="$1"
@ -197,6 +246,10 @@ case "$MACHINE" in
beaglebone_repack_kernel beaglebone_repack_kernel
enable_serial_console ttyO0 enable_serial_console ttyO0
;; ;;
odroid-c2)
odroidc2_setup_boot meson64_odroidc2
enable_serial_console ttyO0
;;
cubietruck) cubietruck)
a20_setup_boot sun7i-a20-cubietruck.dtb a20_setup_boot sun7i-a20-cubietruck.dtb
enable_serial_console ttyS0 enable_serial_console ttyS0

View File

@ -83,6 +83,9 @@ logrotate module-init-tools netbase rsyslog udev debian-archive-keyring"
# Packages needed on the beaglebone # Packages needed on the beaglebone
beaglebone_pkgs="linux-image-armmp u-boot-tools u-boot" beaglebone_pkgs="linux-image-armmp u-boot-tools u-boot"
# Packages needed on the Odroid C2 devices:
odroidc2_pkgs="linux-image-armmp-lpae u-boot-tools u-boot"
# Packages needed on the Allwinner A20 devices: # Packages needed on the Allwinner A20 devices:
a20_pkgs="linux-image-armmp-lpae u-boot-tools u-boot u-boot-sunxi" a20_pkgs="linux-image-armmp-lpae u-boot-tools u-boot u-boot-sunxi"
@ -103,6 +106,19 @@ case "$MACHINE" in
--no-extlinux \ --no-extlinux \
--foreign /usr/bin/qemu-arm-static \ --foreign /usr/bin/qemu-arm-static \
--roottype btrfs \ --roottype btrfs \
"
;;
odroid-c2)
extra_pkgs="$odroidc2_pkgs"
extra_opts="\
--variant minbase \
--bootoffset=2mib \
--bootsize 128M \
--boottype ext2 \
--no-kernel \
--no-extlinux \
--foreign /usr/bin/qemu-arm-static \
--roottype btrfs \
" "
;; ;;
cubietruck | a20-olinuxino-lime | a20-olinuxino-lime2 | a20-olinuxino-micro | cubieboard2) cubietruck | a20-olinuxino-lime | a20-olinuxino-lime2 | a20-olinuxino-micro | cubieboard2)

View File

@ -89,6 +89,17 @@ beaglebone: prep
$(SIGN) $(SIGN)
@echo "Build complete." @echo "Build complete."
# build Odroid C2 SD card image
odroid-c2: prep
$(eval ARCHITECTURE = aarch64)
$(eval MACHINE = odroid-c2)
$(MAKE_IMAGE)
@rm -f $(ARCHIVE)
$(XZ) $(IMAGE)
@echo ""
$(SIGN)
@echo "Build complete."
# build Cubieboard2 SD card image # build Cubieboard2 SD card image
cubieboard2: prep cubieboard2: prep
$(eval ARCHITECTURE = armhf) $(eval ARCHITECTURE = armhf)