All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/5] board/odroidc2: remove unused files
@ 2020-04-18 15:10 Dagg Stompler
  2020-04-18 15:10 ` [Buildroot] [PATCH 2/5] meson-tools: new Package Dagg Stompler
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Dagg Stompler @ 2020-04-18 15:10 UTC (permalink / raw)
  To: buildroot

remove all the odroidc2 board related files.

Signed-off-by: Dagg Stompler <daggs@gmx.com>
---
 board/hardkernel/odroidc2/boot.ini      | 176 ------------------------
 board/hardkernel/odroidc2/genimage.cfg  |  27 ----
 board/hardkernel/odroidc2/post-image.sh |  19 ---
 board/hardkernel/odroidc2/readme.txt    |  53 -------
 4 files changed, 275 deletions(-)
 delete mode 100644 board/hardkernel/odroidc2/boot.ini
 delete mode 100644 board/hardkernel/odroidc2/genimage.cfg
 delete mode 100755 board/hardkernel/odroidc2/post-image.sh
 delete mode 100644 board/hardkernel/odroidc2/readme.txt

diff --git a/board/hardkernel/odroidc2/boot.ini b/board/hardkernel/odroidc2/boot.ini
deleted file mode 100644
index 2fdffa3049..0000000000
--- a/board/hardkernel/odroidc2/boot.ini
+++ /dev/null
@@ -1,176 +0,0 @@
-ODROIDC2-UBOOT-CONFIG
-
-########################################################################
-# Changes made to this are overwritten every time there's a new upgrade
-# To make your changes permanent change it on
-# boot.ini.default
-# After changing it on boot.ini.default run the bootini command to
-# rewrite this file with your personal permanent settings.
-# Documentation: http://odroid.com/dokuwiki/doku.php?id=en:c2_persistent_bootini
-########################################################################
-
-# Possible screen resolutions
-# Uncomment only a single Line! The line with setenv written.
-# At least one mode must be selected.
-
-# Custom modeline!
-# To use custom modeline you need to disable all the below resolutions
-# and setup your own!
-# For more information check our wiki:
-# http://odroid.com/dokuwiki/doku.php?id=en:c2_hdmi_autosetting
-# Example below:
-# setenv m "custombuilt"
-# setenv modeline "1920,1200,154000,74040,60,1920,1968,2000,2080,1200,1202,1208,1235,1,0,1"
-
-# 480 Lines (720x480)
-# setenv m "480i60hz" # Interlaced 60Hz
-# setenv m "480i_rpt" # Interlaced for Rear Projection Televisions 60Hz
-# setenv m "480p60hz" # 480 Progressive 60Hz
-# setenv m "480p_rpt" # 480 Progressive for Rear Projection Televisions 60Hz
-
-# 576 Lines (720x576)
-# setenv m "576i50hz" # Interlaced 50Hz
-# setenv m "576i_rpt" # Interlaced for Rear Projection Televisions 50Hz
-# setenv m "576p50hz" # Progressive 50Hz
-# setenv m "576p_rpt" # Progressive for Rear Projection Televisions 50Hz
-
-# 720 Lines (1280x720)
-# setenv m "720p50hz" # 50Hz
-# setenv m "720p60hz" # 60Hz
-
-# 1080 Lines (1920x1080)
-# setenv m "1080i60hz" # Interlaced 60Hz
-setenv m "1080p60hz" # Progressive 60Hz
-# setenv m "1080i50hz" # Interlaced 50Hz
-# setenv m "1080p50hz" # Progressive 50Hz
-# setenv m "1080p24hz" # Progressive 24Hz
-
-# 4K (3840x2160)
-# setenv m "2160p30hz"    # Progressive 30Hz
-# setenv m "2160p25hz"    # Progressive 25Hz
-# setenv m "2160p24hz"    # Progressive 24Hz
-# setenv m "smpte24hz"    # Progressive 24Hz SMPTE
-# setenv m "2160p50hz"    # Progressive 50Hz
-# setenv m "2160p60hz"    # Progressive 60Hz
-# setenv m "2160p50hz420" # Progressive 50Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it)
-# setenv m "2160p60hz420" # Progressive 60Hz with YCbCr 4:2:0 (Requires TV/Monitor that supports it)
-
-### VESA modes ###
-# setenv m "640x480p60hz"
-# setenv m "800x480p60hz"
-# setenv m "480x800p60hz"
-# setenv m "800x600p60hz"
-# setenv m "1024x600p60hz"
-# setenv m "1024x768p60hz"
-# setenv m "1280x800p60hz"
-# setenv m "1280x1024p60hz"
-# setenv m "1360x768p60hz"
-# setenv m "1440x900p60hz"
-# setenv m "1600x900p60hz"
-# setenv m "1680x1050p60hz"
-# setenv m "1600x1200p60hz"
-# setenv m "1920x1200p60hz"
-# setenv m "2560x1080p60hz"
-# setenv m "2560x1440p60hz"
-# setenv m "2560x1600p60hz"
-# setenv m "3440x1440p60hz"
-
-# HDMI BPP Mode
-setenv m_bpp "32"
-# setenv m_bpp "24"
-# setenv m_bpp "16"
-
-# HDMI DVI/VGA modes
-# By default its set to HDMI, if needed change below.
-# Uncomment only a single Line.
-# setenv vout "dvi"
-# setenv vout "vga"
-
-# HDMI HotPlug Detection control
-# Allows you to force HDMI thinking that the cable is connected.
-# true = HDMI will believe that cable is always connected
-# false = will let board/monitor negotiate the connection status
-setenv hpd "true"
-# setenv hpd "false"
-
-# Monitor output
-# Controls if HDMI PHY should output anything to the monitor
-setenv monitor_onoff "false" # true or false
-
-# Server Mode (aka. No Graphics)
-# Setting nographics to 1 will disable all video subsystem
-# This mode is ideal of server type usage. (Saves ~300Mb of RAM)
-setenv nographics "0"
-
-# Meson Timer
-# 1 - Meson Timer
-# 0 - Arch Timer
-# Using meson_timer improves the video playback however it breaks KVM (virtualization).
-# Using arch timer allows KVM/Virtualization to work however you'll experience poor video
-setenv mesontimer "1"
-
-# UHS (Ultra High Speed) MicroSD mode enable/disable
-setenv disableuhs "false"
-
-# MicroSD Card Detection enable/disable
-# Force the MMC controlled to believe that a card is connected.
-setenv mmc_removable "true"
-
-# USB Multi WebCam tweak
-# Only enable this if you use it.
-setenv usbmulticam "false"
-
-# Default Console Device Setting
-setenv condev "console=ttyS0,115200n8 console=tty0"   # on both
-
-# CPU Frequency / Cores control
-###########################################
-### WARNING!!! WARNING!!! WARNING!!!
-# Before changing anything here please read the wiki entry:
-# http://odroid.com/dokuwiki/doku.php?id=en:c2_set_cpu_freq
-#
-# MAX CPU's
-# setenv maxcpus "1"
-# setenv maxcpus "2"
-# setenv maxcpus "3"
-setenv maxcpus "4"
-
-# MAX Frequency
-# setenv max_freq "2016"  # 2.016GHz
-# setenv max_freq "1944"  # 1.944GHz
-# setenv max_freq "1944"  # 1.944GHz
-# setenv max_freq "1920"  # 1.920GHz
-# setenv max_freq "1896"  # 1.896GHz
-# setenv max_freq "1752"  # 1.752GHz
-# setenv max_freq "1680"  # 1.680GHz
-# setenv max_freq "1656"  # 1.656GHz
-setenv max_freq "1536"  # 1.536GHz
-
-
-
-###########################################
-
-# Boot Arguments
-if test "${m}" = "custombuilt"; then setenv cmode "modeline=${modeline}"; fi
-
-setenv bootargs "root=/dev/mmcblk0p2 rootwait ro ${condev} no_console_suspend hdmimode=${m} ${cmode} m_bpp=${m_bpp} vout=${vout} fsck.repair=yes net.ifnames=0 elevator=noop disablehpd=${hpd} max_freq=${max_freq} maxcpus=${maxcpus} monitor_onoff=${monitor_onoff} disableuhs=${disableuhs} mmc_removable=${mmc_removable} usbmulticam=${usbmulticam}"
-
-# Booting
-
-setenv loadaddr "0x11000000"
-setenv dtb_loadaddr "0x1000000"
-setenv initrd_loadaddr "0x13000000"
-
-fatload mmc 0:1 ${loadaddr} Image
-fatload mmc 0:1 ${dtb_loadaddr} meson64_odroidc2.dtb
-fdt addr ${dtb_loadaddr}
-
-if test "${mesontimer}" = "0"; then fdt rm /meson_timer; fdt rm /cpus/cpu at 0/timer; fdt rm /cpus/cpu at 1/timer; fdt rm /cpus/cpu at 2/timer; fdt rm /cpus/cpu at 3/timer; fi
-if test "${mesontimer}" = "1"; then fdt rm /timer; fi
-
-if test "${nographics}" = "1"; then fdt rm /reserved-memory; fdt rm /aocec; fi
-if test "${nographics}" = "1"; then fdt rm /meson-fb; fdt rm /amhdmitx; fdt rm /picdec; fdt rm /ppmgr; fi
-if test "${nographics}" = "1"; then fdt rm /meson-vout; fdt rm /mesonstream; fdt rm /meson-fb; fi
-if test "${nographics}" = "1"; then fdt rm /deinterlace; fdt rm /codec_mm; fi
-
-booti ${loadaddr} - ${dtb_loadaddr}
diff --git a/board/hardkernel/odroidc2/genimage.cfg b/board/hardkernel/odroidc2/genimage.cfg
deleted file mode 100644
index 15f97d4457..0000000000
--- a/board/hardkernel/odroidc2/genimage.cfg
+++ /dev/null
@@ -1,27 +0,0 @@
-image boot.vfat {
-	vfat {
-		files = {
-			"boot.ini",
-			"Image",
-			"meson64_odroidc2.dtb"
-		}
-	}
-	size = 32M
-}
-
-image sdcard.img {
-	hdimage {
-	}
-
-	partition vfat {
-		partition-type = 0xC
-		image = "boot.vfat"
-		offset = 1048576
-	}
-
-	partition rootfs {
-		partition-type = 0x83
-		image = "rootfs.ext4"
-		size = 512M
-	}
-}
diff --git a/board/hardkernel/odroidc2/post-image.sh b/board/hardkernel/odroidc2/post-image.sh
deleted file mode 100755
index aaf12c1e79..0000000000
--- a/board/hardkernel/odroidc2/post-image.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-BOARD_DIR="$(dirname $0)"
-GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
-GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
-
-cp ${BOARD_DIR}/boot.ini ${BINARIES_DIR}/
-
-rm -rf "${GENIMAGE_TMP}"
-
-genimage                           \
-	--rootpath "${TARGET_DIR}"     \
-	--tmppath "${GENIMAGE_TMP}"    \
-	--inputpath "${BINARIES_DIR}"  \
-	--outputpath "${BINARIES_DIR}" \
-	--config "${GENIMAGE_CFG}"
-
-dd if=${BINARIES_DIR}/u-boot.bin of=${BINARIES_DIR}/sdcard.img bs=1 count=442 conv=sync,notrunc
-dd if=${BINARIES_DIR}/u-boot.bin of=${BINARIES_DIR}/sdcard.img bs=512 skip=1 seek=1 conv=fsync,notrunc
diff --git a/board/hardkernel/odroidc2/readme.txt b/board/hardkernel/odroidc2/readme.txt
deleted file mode 100644
index b44aa67f5a..0000000000
--- a/board/hardkernel/odroidc2/readme.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-ODROID-C2
-
-Intro
-=====
-To be able to use ODROID-C2 board with the images generated by
-Buildroot, you have to prepare the SDCard or eMMC.
-
-How to build it
-===============
-
-  $ make odroidc2_defconfig
-
-Then you can edit the build options using
-
-  $ make menuconfig
-
-Compile all and build rootfs image:
-
-  $ make
-
-Note: you will need to have access to the network, since Buildroot will
-download the packages' sources.
-
-Result of the build
--------------------
-
-After building, you should obtain this tree:
-
-    output/images/
-    +-- Image
-    +-- boot.ini                   [1]
-    +-- boot.vfat
-    +-- meson64_odroidc2.dtb
-    +-- rootfs.ext2
-    +-- rootfs.ext4
-    +-- rootfs.tar
-    +-- sdcard.img
-    `-- u-boot.bin
-
-[1] This is the ODROID-C2 configuration file used in u-boot.
-
-How to write the SD card or eMMC
-================================
-
-Once the build process is finished you will have an image called "sdcard.img"
-in the output/images/ directory.
-
-Copy the bootable "sdcard.img" onto an SD card or eMMC with "dd":
-
-  $ sudo dd if=output/images/sdcard.img of=/dev/sdX
-
-Insert the SDcard into your ODROID-C2, and power it up. Your new system
-should come up now.
--
2.26.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 2/5] meson-tools: new Package
  2020-04-18 15:10 [Buildroot] [PATCH 1/5] board/odroidc2: remove unused files Dagg Stompler
@ 2020-04-18 15:10 ` Dagg Stompler
  2020-04-18 15:10 ` [Buildroot] [PATCH 3/5] OdroidC2ATF: " Dagg Stompler
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dagg Stompler @ 2020-04-18 15:10 UTC (permalink / raw)
  To: buildroot

add meson-tools for handling of amlogic boards boot firmware signatures

Signed-off-by: Dagg Stompler <daggs@gmx.com>
---
 DEVELOPERS                           |  3 +++
 package/Config.in.host               |  1 +
 package/meson-tools/Config.in.host   |  9 +++++++++
 package/meson-tools/meson-tools.hash |  2 ++
 package/meson-tools/meson-tools.mk   | 24 ++++++++++++++++++++++++
 5 files changed, 39 insertions(+)
 create mode 100644 package/meson-tools/Config.in.host
 create mode 100644 package/meson-tools/meson-tools.hash
 create mode 100644 package/meson-tools/meson-tools.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index f94d3e4faf..94d9c68208 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -639,6 +639,9 @@ N:	Cyril Bur <cyrilbur@gmail.com>
 F:	arch/Config.in.powerpc
 F:	package/kvm-unit-tests

+N:	Dagg Stompler <daggs@gmx.com>
+F:	package/meson-tools/
+
 N:	Daniel J. Leach <dleach@belcan.com>
 F:	package/dacapo/

diff --git a/package/Config.in.host b/package/Config.in.host
index eb8f63f689..a5ad2a3f11 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -42,6 +42,7 @@ menu "Host utilities"
 	source "package/lpc3250loader/Config.in.host"
 	source "package/lttng-babeltrace/Config.in.host"
 	source "package/mender-artifact/Config.in.host"
+	source "package/meson-tools/Config.in.host"
 	source "package/mfgtools/Config.in.host"
 	source "package/mkpasswd/Config.in.host"
 	source "package/mtd/Config.in.host"
diff --git a/package/meson-tools/Config.in.host b/package/meson-tools/Config.in.host
new file mode 100644
index 0000000000..d90be61aeb
--- /dev/null
+++ b/package/meson-tools/Config.in.host
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_HOST_MESON_TOOLS
+	bool "host meson-tools"
+	help
+	  meson-tools is a collection of tools for use with
+	  the Amlogic Meson family of ARM based SoCs.
+	  it allows management of signatures which are required
+	  for booting amlogic based boards with u-boot.
+
+	  https://github.com/afaerber/meson-tools
diff --git a/package/meson-tools/meson-tools.hash b/package/meson-tools/meson-tools.hash
new file mode 100644
index 0000000000..f10f5d8590
--- /dev/null
+++ b/package/meson-tools/meson-tools.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256	10d707b2f741df03ff5000f2a82c6f577036ce1cd34d9278b22b92cb616b6fce	meson-tools-0a02e2d34413f4bf9b15946352bc8c8ee13a5843.tar.gz
diff --git a/package/meson-tools/meson-tools.mk b/package/meson-tools/meson-tools.mk
new file mode 100644
index 0000000000..7fe115c6dd
--- /dev/null
+++ b/package/meson-tools/meson-tools.mk
@@ -0,0 +1,24 @@
+################################################################################
+#
+# meson-tools
+#
+################################################################################
+
+HOST_MESON_TOOLS_VERSION = 0a02e2d34413f4bf9b15946352bc8c8ee13a5843
+HOST_MESON_TOOLS_SITE = $(call github,afaerber,meson-tools,$(HOST_MESON_TOOLS_VERSION))
+HOST_MESON_TOOLS_LICENSE = GPL-2.0+
+HOST_MESON_TOOLS_LICENSE_FILES = COPYING README.md
+HOST_MESON_TOOLS_DEPENDENCIES = host-openssl
+
+HOST_MESON_TOOLS_PROGS = amlbootsig unamlbootsig amlinfo
+
+define HOST_MESON_TOOLS_BUILD_CMDS
+	$(MAKE) -C $(@D) CC="$(HOSTCC)" CFLAGS="$(HOST_CFLAGS)" LDFLAGS="$(HOST_LDFLAGS) -lssl -lcrypto"
+endef
+
+define HOST_MESON_TOOLS_INSTALL_CMDS
+	$(foreach f,$(HOST_MESON_TOOLS_PROGS),
+		$(INSTALL) -D -m 0755 $(@D)/$(f) $(HOST_DIR)/bin/$(f))
+endef
+
+$(eval $(host-generic-package))
--
2.26.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 3/5] OdroidC2ATF: new Package
  2020-04-18 15:10 [Buildroot] [PATCH 1/5] board/odroidc2: remove unused files Dagg Stompler
  2020-04-18 15:10 ` [Buildroot] [PATCH 2/5] meson-tools: new Package Dagg Stompler
@ 2020-04-18 15:10 ` Dagg Stompler
  2020-04-18 15:10 ` [Buildroot] [PATCH 4/5] board/odroidc2: add board Dagg Stompler
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dagg Stompler @ 2020-04-18 15:10 UTC (permalink / raw)
  To: buildroot

introduce a package that holds the ATF for AmLogic's Odroid C2 boards

Signed-off-by: Dagg Stompler <daggs@gmx.com>
---
 DEVELOPERS                           |  1 +
 package/Config.in.host               |  1 +
 package/OdroidC2ATF/Config.in.host   |  8 ++++++++
 package/OdroidC2ATF/OdroidC2ATF.hash |  2 ++
 package/OdroidC2ATF/OdroidC2ATF.mk   | 26 ++++++++++++++++++++++++++
 5 files changed, 38 insertions(+)
 create mode 100644 package/OdroidC2ATF/Config.in.host
 create mode 100644 package/OdroidC2ATF/OdroidC2ATF.hash
 create mode 100644 package/OdroidC2ATF/OdroidC2ATF.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 94d9c68208..8e12ede746 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -641,6 +641,7 @@ F:	package/kvm-unit-tests

 N:	Dagg Stompler <daggs@gmx.com>
 F:	package/meson-tools/
+F:	package/OdroidC2ATF/

 N:	Daniel J. Leach <dleach@belcan.com>
 F:	package/dacapo/
diff --git a/package/Config.in.host b/package/Config.in.host
index a5ad2a3f11..f753182136 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -48,6 +48,7 @@ menu "Host utilities"
 	source "package/mtd/Config.in.host"
 	source "package/mtools/Config.in.host"
 	source "package/mxsldr/Config.in.host"
+	source "package/OdroidC2ATF/Config.in.host"
 	source "package/omap-u-boot-utils/Config.in.host"
 	source "package/openocd/Config.in.host"
 	source "package/opkg-utils/Config.in.host"
diff --git a/package/OdroidC2ATF/Config.in.host b/package/OdroidC2ATF/Config.in.host
new file mode 100644
index 0000000000..a8199d4f57
--- /dev/null
+++ b/package/OdroidC2ATF/Config.in.host
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_HOST_ODROIDC2ATF
+	bool "host OdroidC2ATF"
+	help
+	  OdroidC2ATF is a package that holst the minimal file needed for the ATF (ARM Trusted Firmware) from hardkernel's
+	  uboot repository and uses it to allow safe boot of mainline u-boot kernels.
+	  the files were taken without chaning from https://github.com/hardkernel/u-boot/tree/odroidc2-v2015.01
+
+	  https://github.com/daggs1/OdroidC2ATF
diff --git a/package/OdroidC2ATF/OdroidC2ATF.hash b/package/OdroidC2ATF/OdroidC2ATF.hash
new file mode 100644
index 0000000000..b9ec3bddb7
--- /dev/null
+++ b/package/OdroidC2ATF/OdroidC2ATF.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256	991fb15908410c6c8a6ef2e0da368ca8e2b813d123382f0e8958814ad0aead97  OdroidC2ATF-13a8560b2884cb5fa13537e1aa193e3cb7b2d996.tar.gz
diff --git a/package/OdroidC2ATF/OdroidC2ATF.mk b/package/OdroidC2ATF/OdroidC2ATF.mk
new file mode 100644
index 0000000000..166ce839b2
--- /dev/null
+++ b/package/OdroidC2ATF/OdroidC2ATF.mk
@@ -0,0 +1,26 @@
+################################################################################
+#
+# Odroidc2ATF
+#
+################################################################################
+
+HOST_ODROIDC2ATF_VERSION = 13a8560b2884cb5fa13537e1aa193e3cb7b2d996
+HOST_ODROIDC2ATF_SITE = $(call github,daggs1,OdroidC2ATF,$(HOST_ODROIDC2ATF_VERSION))
+HOST_ODROIDC2ATF_LICENSE = GPL-2.0
+HOST_ODROIDC2ATF_LICENSE_FILES = COPYING COPYING.txt README
+HOST_ODROIDC2ATF_FIRMWARE_FOLDER = $(HOST_DIR)/usr/share/odroidc2_atf
+HOST_ODROIDC2ATF_FIRMWARE_FILES = bins/bl1.bin.hardkernel bins/bl30.bin bins/bl301.bin bins/bl31.bin bins/bl2.package
+
+define HOST_ODROIDC2ATF_BUILD_CMDS
+	$(MAKE) -C $(@D)/fip_create CC="$(HOSTCC)" CFLAGS="$(HOST_CFLAGS)" LDFLAGS="$(HOST_LDFLAGS)"
+endef
+
+define HOST_ODROIDC2ATF_INSTALL_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/fip_create/fip_create $(HOST_DIR)/bin
+	mkdir -p $(HOST_ODROIDC2ATF_FIRMWARE_FOLDER)
+	$(foreach f,$(HOST_ODROIDC2ATF_FIRMWARE_FILES),
+		$(INSTALL) -D -m 0644 $(@D)/$(f) $(HOST_ODROIDC2ATF_FIRMWARE_FOLDER)/
+	)
+endef
+
+$(eval $(host-generic-package))
--
2.26.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 4/5] board/odroidc2: add board
  2020-04-18 15:10 [Buildroot] [PATCH 1/5] board/odroidc2: remove unused files Dagg Stompler
  2020-04-18 15:10 ` [Buildroot] [PATCH 2/5] meson-tools: new Package Dagg Stompler
  2020-04-18 15:10 ` [Buildroot] [PATCH 3/5] OdroidC2ATF: " Dagg Stompler
@ 2020-04-18 15:10 ` Dagg Stompler
  2020-04-18 15:10 ` [Buildroot] [PATCH 5/5] configs/odroidc2: add build config Dagg Stompler
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Dagg Stompler @ 2020-04-18 15:10 UTC (permalink / raw)
  To: buildroot

re add the odroidc2 board to buildroot.
 - uses latest uboot.
 - uses kernel 5.6

Signed-off-by: Dagg Stompler <daggs@gmx.com>
---
 board/hardkernel/odroidc2/boot.cmd            | 11 ++++
 board/hardkernel/odroidc2/genimage.cfg        | 33 +++++++++++
 board/hardkernel/odroidc2/post-build.sh       |  8 +++
 board/hardkernel/odroidc2/post-image.sh       | 29 ++++++++++
 board/hardkernel/odroidc2/readme.txt          | 57 +++++++++++++++++++
 .../rootfs_overlay/etc/init.d/S09modload      | 23 ++++++++
 6 files changed, 161 insertions(+)
 create mode 100644 board/hardkernel/odroidc2/boot.cmd
 create mode 100644 board/hardkernel/odroidc2/genimage.cfg
 create mode 100755 board/hardkernel/odroidc2/post-build.sh
 create mode 100755 board/hardkernel/odroidc2/post-image.sh
 create mode 100644 board/hardkernel/odroidc2/readme.txt
 create mode 100755 board/hardkernel/odroidc2/rootfs_overlay/etc/init.d/S09modload

diff --git a/board/hardkernel/odroidc2/boot.cmd b/board/hardkernel/odroidc2/boot.cmd
new file mode 100644
index 0000000000..d800a6d44b
--- /dev/null
+++ b/board/hardkernel/odroidc2/boot.cmd
@@ -0,0 +1,11 @@
+setenv kernel_filename "Image"
+setenv fdt_filename "meson-gxbb-odroidc2.dtb"
+setenv bootargs "console=ttyAML0,115200n8 earlyprintk root=/dev/mmcblk1p2 rootwait rw"
+
+echo > Loading Kernel...
+fatload mmc 0:1 ${kernel_addr_r} ${kernel_filename}
+echo > Loading FDT...
+fatload mmc 0:1 ${fdt_addr_r} ${fdt_filename}
+
+echo > Booting System...
+booti ${kernel_addr_r} - ${fdt_addr_r}
diff --git a/board/hardkernel/odroidc2/genimage.cfg b/board/hardkernel/odroidc2/genimage.cfg
new file mode 100644
index 0000000000..a36b924b08
--- /dev/null
+++ b/board/hardkernel/odroidc2/genimage.cfg
@@ -0,0 +1,33 @@
+image boot.vfat {
+	vfat {
+		files = {
+			"Image",
+			"meson-gxbb-odroidc2.dtb",
+			"boot.scr"
+		}
+	}
+	size = 64M
+}
+
+image sdcard.img {
+	hdimage {
+	}
+
+	partition u-boot {
+		in-partition-table = "no"
+		image = "uboot-odc2.img"
+		offset = 49664
+	}
+
+	partition boot {
+		partition-type = 0xC
+		bootable = "true"
+		image = "boot.vfat"
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+		size = 512M
+	}
+}
diff --git a/board/hardkernel/odroidc2/post-build.sh b/board/hardkernel/odroidc2/post-build.sh
new file mode 100755
index 0000000000..745fb2a724
--- /dev/null
+++ b/board/hardkernel/odroidc2/post-build.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+# post-build.sh for Odroid C2 taken from CubieBoard's post-build.sh
+# 2013, Carlo Caione <carlo.caione@gmail.com>
+
+BOARD_DIR="$(dirname $0)"
+MKIMAGE=$HOST_DIR/bin/mkimage
+
+${MKIMAGE} -A arm64 -O linux -T script -C none -n "Boot script" -d "${BOARD_DIR}/boot.cmd" ${BINARIES_DIR}/boot.scr
diff --git a/board/hardkernel/odroidc2/post-image.sh b/board/hardkernel/odroidc2/post-image.sh
new file mode 100755
index 0000000000..3783a65a1c
--- /dev/null
+++ b/board/hardkernel/odroidc2/post-image.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+BOARD_DIR="$(dirname $0)"
+GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
+SIGNED_UBOOT_IMG="${BINARIES_DIR}/uboot-odc2.img"
+ODRODIDC2_ATF_FOLDER="${HOST_DIR}/usr/share/odroidc2_atf"
+IM_FILE="${ODRODIDC2_ATF_FOLDER}/bl1.bin.hardkernel"
+
+${HOST_DIR}/bin/fip_create --bl30 ${ODRODIDC2_ATF_FOLDER}/bl30.bin --bl301 ${ODRODIDC2_ATF_FOLDER}/bl301.bin --bl31 ${ODRODIDC2_ATF_FOLDER}/bl31.bin --bl33 ${BINARIES_DIR}/u-boot.bin ${BINARIES_DIR}/fip.bin
+${HOST_DIR}/bin/fip_create --dump ${BINARIES_DIR}/fip.bin
+cat ${ODRODIDC2_ATF_FOLDER}/bl2.package ${BINARIES_DIR}/fip.bin > ${BINARIES_DIR}/boot_new.bin
+${HOST_DIR}/bin/amlbootsig ${BINARIES_DIR}/boot_new.bin ${BINARIES_DIR}/u-boot.img
+
+dd if=${BINARIES_DIR}/u-boot.img of=${SIGNED_UBOOT_IMG} bs=512 skip=96
+
+rm -rf "${GENIMAGE_TMP}"
+
+genimage                           \
+	--rootpath "${TARGET_DIR}"     \
+	--tmppath "${GENIMAGE_TMP}"    \
+	--inputpath "${BINARIES_DIR}"  \
+	--outputpath "${BINARIES_DIR}" \
+	--config "${GENIMAGE_CFG}"
+
+dd if=${IM_FILE} of=${BINARIES_DIR}/sdcard.img bs=1 count=442 conv=sync,notrunc
+dd if=${IM_FILE} of=${BINARIES_DIR}/sdcard.img bs=512 skip=1 seek=1 conv=fsync,notrunc
+
+rm -rf ${BINARIES_DIR}/fip.bin ${BINARIES_DIR}/boot_new.bin ${BINARIES_DIR}/u-boot.img
diff --git a/board/hardkernel/odroidc2/readme.txt b/board/hardkernel/odroidc2/readme.txt
new file mode 100644
index 0000000000..ef5a91d453
--- /dev/null
+++ b/board/hardkernel/odroidc2/readme.txt
@@ -0,0 +1,57 @@
+ODROID-C2
+
+Intro
+=====
+To be able to use ODROID-C2 board with the images generated by
+Buildroot, you have to prepare the SDCard or eMMC.
+
+How to build it
+===============
+
+  $ make odroidc2_defconfig
+
+Then you can edit the build options using
+
+  $ make menuconfig
+
+Compile all and build rootfs image:
+
+  $ make
+
+Note: you will need to have access to the network, since Buildroot will
+download the packages' sources.
+
+Result of the build
+-------------------
+
+After building, you should obtain this tree:
+
+    output/images/
+    +-- Image
+    +-- uImage			   [2]
+    +-- boot.scr                   [1]
+    +-- boot.vfat
+    +-- meson-gxbb-odroidc2.dtb
+    +-- rootfs.ext2
+    +-- rootfs.ext4
+    +-- rootfs.tar
+    +-- sdcard.img
+    +-- uboot-odc2.img		   [3]
+    `-- u-boot.bin
+
+[1] This is the ODROID-C2 configuration file used in u-boot.
+[2] This is the ODROID-C2 kernel image file which will be booted.
+[3] This is the ODROID-C2 signed u-boot image which will be used.
+
+How to write the SD card or eMMC
+================================
+
+Once the build process is finished you will have an image called "sdcard.img"
+in the output/images/ directory.
+
+Copy the bootable "sdcard.img" onto an SD card or eMMC with "dd":
+
+  $ sudo dd if=output/images/sdcard.img of=/dev/sdX
+
+Insert the SDcard into your ODROID-C2, and power it up. Your new system
+should come up now.
diff --git a/board/hardkernel/odroidc2/rootfs_overlay/etc/init.d/S09modload b/board/hardkernel/odroidc2/rootfs_overlay/etc/init.d/S09modload
new file mode 100755
index 0000000000..9345a411b3
--- /dev/null
+++ b/board/hardkernel/odroidc2/rootfs_overlay/etc/init.d/S09modload
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+
+load_drivers()
+{
+	echo "Loading needed modules..."
+	for file in $(echo "dwmac_generic dwmac-meson8b meson_dw_hdmi meson_gxbb_wdt"); do
+		modprobe ${file}
+	done
+}
+
+case "$1" in
+	start)
+		load_drivers
+		;;
+	stop)
+		;;
+	restart|reload)
+		;;
+	*)
+		echo "Usage: $0 {start|stop|restart}"
+		exit 1
+esac
--
2.26.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 5/5] configs/odroidc2: add build config
  2020-04-18 15:10 [Buildroot] [PATCH 1/5] board/odroidc2: remove unused files Dagg Stompler
                   ` (2 preceding siblings ...)
  2020-04-18 15:10 ` [Buildroot] [PATCH 4/5] board/odroidc2: add board Dagg Stompler
@ 2020-04-18 15:10 ` Dagg Stompler
  2020-04-29 21:23 ` [Buildroot] [PATCH 1/5] board/odroidc2: remove unused files Thomas Petazzoni
  2020-05-10 18:26 ` Peter Korsgaard
  5 siblings, 0 replies; 7+ messages in thread
From: Dagg Stompler @ 2020-04-18 15:10 UTC (permalink / raw)
  To: buildroot

add config to buildroot which allows building an image which
can run on Hardkernel's Odroid C2 board.

Signed-off-by: Dagg Stompler <daggs@gmx.com>
---
 DEVELOPERS                 |  1 +
 configs/odroidc2_defconfig | 40 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+)
 create mode 100644 configs/odroidc2_defconfig

diff --git a/DEVELOPERS b/DEVELOPERS
index 8e12ede746..21e7bb1719 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -640,6 +640,7 @@ F:	arch/Config.in.powerpc
 F:	package/kvm-unit-tests

 N:	Dagg Stompler <daggs@gmx.com>
+F:	board/odroidc2/
 F:	package/meson-tools/
 F:	package/OdroidC2ATF/

diff --git a/configs/odroidc2_defconfig b/configs/odroidc2_defconfig
new file mode 100644
index 0000000000..3680fad91a
--- /dev/null
+++ b/configs/odroidc2_defconfig
@@ -0,0 +1,40 @@
+# Architecture
+BR2_aarch64=y
+
+# Toolchain
+BR2_GCC_VERSION_9_X=y
+
+# System
+BR2_TARGET_GENERIC_HOSTNAME="odroidc2"
+BR2_TARGET_GENERIC_GETTY_PORT="ttyAML0"
+BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_ROOTFS_OVERLAY="board/hardkernel/odroidc2/rootfs_overlay"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/hardkernel/odroidc2/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/hardkernel/odroidc2/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="yes"
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.6"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="amlogic/meson-gxbb-odroidc2"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+
+# U-Boot
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_LEGACY=y
+BR2_TARGET_UBOOT_BOARDNAME="odroid-c2"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_BOOT_SCRIPT=y
+BR2_TARGET_UBOOT_BOOT_SCRIPT_SOURCE="board/hardkernel/odroidc2/boot.cmd"
+
+# Required tools to create the SD image
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MESON_TOOLS=y
+BR2_PACKAGE_HOST_MTOOLS=y
+BR2_PACKAGE_HOST_ODROIDC2ATF=y
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
--
2.26.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 1/5] board/odroidc2: remove unused files
  2020-04-18 15:10 [Buildroot] [PATCH 1/5] board/odroidc2: remove unused files Dagg Stompler
                   ` (3 preceding siblings ...)
  2020-04-18 15:10 ` [Buildroot] [PATCH 5/5] configs/odroidc2: add build config Dagg Stompler
@ 2020-04-29 21:23 ` Thomas Petazzoni
  2020-05-10 18:26 ` Peter Korsgaard
  5 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2020-04-29 21:23 UTC (permalink / raw)
  To: buildroot

On Sat, 18 Apr 2020 18:10:16 +0300
Dagg Stompler <daggs@gmx.com> wrote:

> remove all the odroidc2 board related files.
> 
> Signed-off-by: Dagg Stompler <daggs@gmx.com>
> ---
>  board/hardkernel/odroidc2/boot.ini      | 176 ------------------------
>  board/hardkernel/odroidc2/genimage.cfg  |  27 ----
>  board/hardkernel/odroidc2/post-image.sh |  19 ---
>  board/hardkernel/odroidc2/readme.txt    |  53 -------
>  4 files changed, 275 deletions(-)
>  delete mode 100644 board/hardkernel/odroidc2/boot.ini
>  delete mode 100644 board/hardkernel/odroidc2/genimage.cfg
>  delete mode 100755 board/hardkernel/odroidc2/post-image.sh
>  delete mode 100644 board/hardkernel/odroidc2/readme.txt

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 1/5] board/odroidc2: remove unused files
  2020-04-18 15:10 [Buildroot] [PATCH 1/5] board/odroidc2: remove unused files Dagg Stompler
                   ` (4 preceding siblings ...)
  2020-04-29 21:23 ` [Buildroot] [PATCH 1/5] board/odroidc2: remove unused files Thomas Petazzoni
@ 2020-05-10 18:26 ` Peter Korsgaard
  5 siblings, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2020-05-10 18:26 UTC (permalink / raw)
  To: buildroot

>>>>> "Dagg" == Dagg Stompler <daggs@gmx.com> writes:

 > remove all the odroidc2 board related files.
 > Signed-off-by: Dagg Stompler <daggs@gmx.com>

Committed to 2020.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-05-10 18:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-18 15:10 [Buildroot] [PATCH 1/5] board/odroidc2: remove unused files Dagg Stompler
2020-04-18 15:10 ` [Buildroot] [PATCH 2/5] meson-tools: new Package Dagg Stompler
2020-04-18 15:10 ` [Buildroot] [PATCH 3/5] OdroidC2ATF: " Dagg Stompler
2020-04-18 15:10 ` [Buildroot] [PATCH 4/5] board/odroidc2: add board Dagg Stompler
2020-04-18 15:10 ` [Buildroot] [PATCH 5/5] configs/odroidc2: add build config Dagg Stompler
2020-04-29 21:23 ` [Buildroot] [PATCH 1/5] board/odroidc2: remove unused files Thomas Petazzoni
2020-05-10 18:26 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.