From 180a53a3ae5d6fa99d0e5057c667b587077a0cb1 Mon Sep 17 00:00:00 2001 From: Christian Stewart Date: Tue, 3 May 2022 17:25:42 -0700 Subject: [PATCH] odroid/hc4: new configuration package Signed-off-by: Christian Stewart --- README.md | 3 + configs/odroid/README.md | 20 ++++- configs/odroid/c4/metadata/description | 2 +- .../odroid/c4/resources/boot-scripts/boot.txt | 2 +- configs/odroid/common/buildroot/kernel | 4 +- configs/odroid/hc4/README.md | 60 +++++++++++++ configs/odroid/hc4/buildroot/arch | 3 + configs/odroid/hc4/buildroot/dts | 1 + configs/odroid/hc4/buildroot/serial | 3 + configs/odroid/hc4/buildroot/uboot | 8 ++ configs/odroid/hc4/busybox/flash | 2 + configs/odroid/hc4/cflags/01-arch | 1 + configs/odroid/hc4/hooks/pre.sh | 90 +++++++++++++++++++ configs/odroid/hc4/kernel/base | 85 ++++++++++++++++++ configs/odroid/hc4/kernel/cmdline | 1 + configs/odroid/hc4/kernel/display | 36 ++++++++ configs/odroid/hc4/kernel/slim | 7 ++ configs/odroid/hc4/kernel/wifi | 3 + configs/odroid/hc4/metadata/dependencies | 1 + configs/odroid/hc4/metadata/description | 1 + .../hc4/resources/boot-scripts/boot.txt | 39 ++++++++ .../odroid/hc4/resources/sd_fuse/sd_fusing.sh | 43 +++++++++ configs/odroid/hc4/uboot/base | 3 + ...on64-prevent-stdout-stderr-on-videoc.patch | 30 +++++++ 24 files changed, 441 insertions(+), 7 deletions(-) create mode 100644 configs/odroid/hc4/README.md create mode 100644 configs/odroid/hc4/buildroot/arch create mode 100644 configs/odroid/hc4/buildroot/dts create mode 100644 configs/odroid/hc4/buildroot/serial create mode 100644 configs/odroid/hc4/buildroot/uboot create mode 100644 configs/odroid/hc4/busybox/flash create mode 100644 configs/odroid/hc4/cflags/01-arch create mode 100755 configs/odroid/hc4/hooks/pre.sh create mode 100644 configs/odroid/hc4/kernel/base create mode 100644 configs/odroid/hc4/kernel/cmdline create mode 100644 configs/odroid/hc4/kernel/display create mode 100644 configs/odroid/hc4/kernel/slim create mode 100644 configs/odroid/hc4/kernel/wifi create mode 100644 configs/odroid/hc4/metadata/dependencies create mode 100644 configs/odroid/hc4/metadata/description create mode 100644 configs/odroid/hc4/resources/boot-scripts/boot.txt create mode 100755 configs/odroid/hc4/resources/sd_fuse/sd_fusing.sh create mode 100644 configs/odroid/hc4/uboot/base create mode 100644 configs/odroid/hc4/uboot_patches/0001-HACK-configs-meson64-prevent-stdout-stderr-on-videoc.patch diff --git a/README.md b/README.md index 7da856642..93785ddab 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,7 @@ Here are the boards/systems currently supported: | [Odroid C4] | [odroid/c4] | ✔ U-Boot 2022.04 | ✔ tb-5.18.1 | | | [Odroid HC1] | [odroid/xu] | ✔ U-Boot 2017.07 | ✔ tb-5.18.1 | ⚠ Obsolete | | [Odroid HC2] | [odroid/xu] | ✔ U-Boot 2017.07 | ✔ tb-5.18.1 | ✔ Tested | +| [Odroid HC4] | [odroid/hc4] | ✔ U-Boot 2022.07 | ✔ tb-5.18.1 | | | [Odroid N2]+ | [odroid/n2] | ✔ U-Boot 2022.04 | ✔ tb-5.18.1 | ✔ Tested | | [Odroid M1] | [odroid/m1] | ✔ U-Boot 2017.09 | ✔ tb-5.18.1 | | | [Odroid U] | [odroid/u] | ✔ U-Boot 2022.04 | ✔ tb-5.18.1 | ⚠ Obsolete | @@ -203,6 +204,7 @@ Here are the boards/systems currently supported: [Odroid C4]: https://wiki.odroid.com/odroid-c4/odroid-c4 [Odroid HC1]: https://www.hardkernel.com/shop/odroid-hc1-home-cloud-one/ [Odroid HC2]: https://www.hardkernel.com/shop/odroid-hc2-home-cloud-two/ +[Odroid HC4]: https://www.hardkernel.com/shop/odroid-hc4/ [Odroid M1]: https://wiki.odroid.com/odroid-m1/odroid-m1 [Odroid N2]: https://wiki.odroid.com/odroid-n2/odroid-n2 [Odroid U]: https://wiki.odroid.com/old_product/odroid-x_u_q/odroid_u3/odroid-u3 @@ -248,6 +250,7 @@ Here are the boards/systems currently supported: [odroid/c2]: ./configs/odroid [odroid/c4]: ./configs/odroid [odroid/m1]: ./configs/odroid +[odroid/hc4]: ./configs/odroid [odroid/n2]: ./configs/odroid [odroid/u]: ./configs/odroid [odroid/xu]: ./configs/odroid diff --git a/configs/odroid/README.md b/configs/odroid/README.md index 0245e3be1..f3d4201be 100644 --- a/configs/odroid/README.md +++ b/configs/odroid/README.md @@ -16,7 +16,7 @@ Reference: Set the comma-separated `SKIFF_CONFIG` variable: ```sh -$ export SKIFF_CONFIG=odroid/xu +$ export SKIFF_CONFIG=odroid/n2,skiff/core $ make configure # configure the system $ make compile # build the system ``` @@ -46,6 +46,7 @@ tested by the developers unless otherwise noted. | [c2] | odroid/c2 | | | [c4] | odroid/c4 | Reboot issue | | [hc2] | odroid/xu | | +| [hc4] | odroid/hc4 | Reboot issue | | [m1] | odroid/m1 | | | [n2] | odroid/n2 | Includes n2+ | | [u] + u2 | odroid/u | Discontinued | @@ -60,6 +61,7 @@ tested by the developers unless otherwise noted. [m1]: https://www.hardkernel.com/shop/odroid-m1-with-8gbyte-ram/ [c2]: https://www.hardkernel.com/shop/odroid-c2/ [c4]: https://www.hardkernel.com/shop/odroid-c4/ +[hc4]: https://www.hardkernel.com/shop/odroid-hc4/ ## SD Card Compatibility @@ -78,14 +80,26 @@ Some SD cards may not work as well with the Odroid hardware. ## Bootup Process -**If using the n2, set the boot switch to MMC.** - All Odroid boards use u-boot. U-boot is flashed to the beginning of the SD card, before the first partition. It loads and executes a boot.ini configuration. Note: there may be some binary bootloader blobs used that are provided by the vendor & signed, and cannot be compiled by Skiff, depending on the board. +## Odroid N2 + +**If using the n2, set the boot switch to MMC.** + +## Odroid HC4 + +**If using the hc4, petitboot must be bypassed.** + +See the details in the [odroid/hc4](./hc4) docs. + +On default, the HC4 boots from SPI, which contains petitboot. If the black +button on the bottom of the device (the "boot select" switch) is pressed, the +board will use u-boot from the MicroSD card. + ## Acknowledgments Thank you to [tobetter] for patching / testing the latest Linux kernels for the diff --git a/configs/odroid/c4/metadata/description b/configs/odroid/c4/metadata/description index 38e135604..0ac19f625 100644 --- a/configs/odroid/c4/metadata/description +++ b/configs/odroid/c4/metadata/description @@ -1 +1 @@ -Base configuration for the ODROID C4 board (aarch64). +Base configuration for the ODROID C4 board. diff --git a/configs/odroid/c4/resources/boot-scripts/boot.txt b/configs/odroid/c4/resources/boot-scripts/boot.txt index 3288cff62..8eceefdfd 100644 --- a/configs/odroid/c4/resources/boot-scripts/boot.txt +++ b/configs/odroid/c4/resources/boot-scripts/boot.txt @@ -116,7 +116,7 @@ if test "${hdmi_forcergb}" = "1"; then setenv hdmitx "${hdmitx},forcergb"; fi if test "${disable_vu7}" = "false"; then setenv hid_quirks "usbhid.quirks=0x0eef:0x0005:0x0004"; fi # Boot Args -setenv bootargs "coherent_pool=2M ${bootmem} ${condev} ${amlogic} no_console_suspend fsck.repair=yes net.ifnames=0 elevator=noop hdmimode=${hdmimode} cvbsmode=576cvbs max_freq_a55=${max_freq_a55} maxcpus=${maxcpus} voutmode=${voutmode} ${cmode} disablehpd=${disablehpd} cvbscable=${cvbscable} overscan=${overscan} ${hid_quirks} monitor_onoff=${monitor_onoff} ${hdmitx} ${bootsplash} sdrmode=${sdrmode} enable_wol=${enable_wol}" +setenv bootargs "coherent_pool=2M ${bootmem} ${condev} ${amlogic} no_console_suspend fsck.repair=yes net.ifnames=0 elevator=noop hdmimode=${hdmimode} cvbsmode=576cvbs max_freq_a55=${max_freq_a55} maxcpus=${maxcpus} voutmode=${voutmode} ${cmode} disablehpd=${disablehpd} cvbscable=${cvbscable} overscan=${overscan} ${hid_quirks} monitor_onoff=${monitor_onoff} ${hdmitx} sdrmode=${sdrmode} enable_wol=${enable_wol}" fatload mmc ${devnum}:1 ${kernel_addr_r} Image fatload mmc ${devnum}:1 ${initramfs_addr_r} rootfs.cpio.uboot diff --git a/configs/odroid/common/buildroot/kernel b/configs/odroid/common/buildroot/kernel index 92b4b5f2e..9d4827c22 100644 --- a/configs/odroid/common/buildroot/kernel +++ b/configs/odroid/common/buildroot/kernel @@ -6,8 +6,8 @@ BR2_LINUX_KERNEL_CUSTOM_TARBALL=y # BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,skiffos,linux,22e1b9192fcd3407eea8ceca4e14dc3291ff6af1)/linux-skiff-odroid-5.18.0-rc5-r1.tar.gz" # BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_17=y -# skiff-odroid-5.18.y-4 -BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,skiffos,linux,d302139224b22e1363532d001b9b82b460cc51b1)/linux-skiff-odroid-5.18.1-r1.tar.gz" +# skiff-odroid-5.18.y-5 +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,skiffos,linux,ce44f4f5c25366a6a89ab482bf433d1e6ebcb6c0)/linux-skiff-odroid-5.18.1-r2.tar.gz" BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_17=y BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y diff --git a/configs/odroid/hc4/README.md b/configs/odroid/hc4/README.md new file mode 100644 index 000000000..248fa7c87 --- /dev/null +++ b/configs/odroid/hc4/README.md @@ -0,0 +1,60 @@ +# Odroid HC4 + +This configuration targets the Odroid HC4. + +**Petitboot must be bypassed to boot this board.** + +See the [common config](../) for more information. + +## Getting Started + +Set the comma-separated `SKIFF_CONFIG` variable: + +```sh +$ export SKIFF_CONFIG=odroid/hc4,skiff/core +$ make configure # configure the system +$ make compile # build the system +``` + +Once the build is complete, we will flash to a MicroSD card to boot. You will +need to `sudo bash` for this on most systems. + +```sh +$ sudo bash # switch to root +$ export ODROID_SD=/dev/sdz # make sure this is right! (usually sdb) +$ make cmd/odroid/common/format # tell skiff to format the device +$ make cmd/odroid/common/install # tell skiff to install the os +``` + +You only need to run the `format` step once. It will create the partition table. +The `install` step will overwrite the current Skiff installation on the card, +taking care to not touch any persistent data (from the persist partition). It's +safe to upgrade Skiff independently from your persistent data. + +You will then need to disable Petitboot: + +## Disabling Petitboot + +On default, the HC4 boots from SPI, which contains petitboot. If the black +button on the bottom of the device (the "boot select" switch) is pressed, the +board will use u-boot from the MicroSD card. + +To permanently disable petitboot: + + 1. Attach a display & keyboard to the device. + 2. Power on the board. + 3. Go to "Exit to shell" and enter these commands: + +```sh +flash_eraseall /dev/mtd0 +flash_eraseall /dev/mtd1 +flash_eraseall /dev/mtd2 +flash_eraseall /dev/mtd3 +``` + +Alternatively, boot to SkiffOS using the black button on the bottom of the +device while booting, then use the following command to erase the SPI: + +```sh +flash_erase /dev/mtd0 0 0 +``` diff --git a/configs/odroid/hc4/buildroot/arch b/configs/odroid/hc4/buildroot/arch new file mode 100644 index 000000000..1c90f121f --- /dev/null +++ b/configs/odroid/hc4/buildroot/arch @@ -0,0 +1,3 @@ +BR2_aarch64=y +BR2_cortex_a55=y +BR2_ARM_FPU_FP_ARMV8=y diff --git a/configs/odroid/hc4/buildroot/dts b/configs/odroid/hc4/buildroot/dts new file mode 100644 index 000000000..17f035d6e --- /dev/null +++ b/configs/odroid/hc4/buildroot/dts @@ -0,0 +1 @@ +BR2_LINUX_KERNEL_INTREE_DTS_NAME="amlogic/meson-sm1-odroid-hc4" diff --git a/configs/odroid/hc4/buildroot/serial b/configs/odroid/hc4/buildroot/serial new file mode 100644 index 000000000..d7b19339f --- /dev/null +++ b/configs/odroid/hc4/buildroot/serial @@ -0,0 +1,3 @@ +BR2_TARGET_GENERIC_GETTY=y +BR2_TARGET_GENERIC_GETTY_BAUDRATE_115200=y +BR2_TARGET_GENERIC_GETTY_PORT="ttyAML0" diff --git a/configs/odroid/hc4/buildroot/uboot b/configs/odroid/hc4/buildroot/uboot new file mode 100644 index 000000000..c615c7edf --- /dev/null +++ b/configs/odroid/hc4/buildroot/uboot @@ -0,0 +1,8 @@ +BR2_TARGET_UBOOT_CUSTOM_VERSION=y +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2022.07-rc4" + +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="odroid-hc4" + +# Closed source blobs for amlogic fip +BR2_PACKAGE_AMLOGIC_BOOT_FIP=y +BR2_PACKAGE_AMLOGIC_BOOT_FIP_BOARD="odroid-hc4" diff --git a/configs/odroid/hc4/busybox/flash b/configs/odroid/hc4/busybox/flash new file mode 100644 index 000000000..aeb8c8c02 --- /dev/null +++ b/configs/odroid/hc4/busybox/flash @@ -0,0 +1,2 @@ +# enable flash_eraseall tool +CONFIG_FLASH_ERASEALL=y diff --git a/configs/odroid/hc4/cflags/01-arch b/configs/odroid/hc4/cflags/01-arch new file mode 100644 index 000000000..0d4f066e9 --- /dev/null +++ b/configs/odroid/hc4/cflags/01-arch @@ -0,0 +1 @@ +-march=armv8.2-a+crypto+fp16+rcpc+dotprod -mtune=cortex-a55 diff --git a/configs/odroid/hc4/hooks/pre.sh b/configs/odroid/hc4/hooks/pre.sh new file mode 100755 index 000000000..5a86d66ae --- /dev/null +++ b/configs/odroid/hc4/hooks/pre.sh @@ -0,0 +1,90 @@ +#!/bin/bash + +IMAGES_DIR=${SKIFF_BUILDROOT_DIR}/output/images + +echo "Copying sd_fuse script..." +rsync -rav $SKIFF_CURRENT_CONF_DIR/resources/sd_fuse/ $IMAGES_DIR/hk_sd_fuse/ + +# this helper function includes postprocess for u200 and its variants. +# $1 PATH for uboot blob repo +# $2 family g12a or g12b +# source: https://raw.githubusercontent.com/armbian/build/master/config/sources/families/include/meson64_common.inc +uboot_g12_postprocess() +{ + $1/blx_fix.sh $1/bl30.bin \ + zero_tmp \ + bl30_zero.bin \ + $1/bl301.bin \ + bl301_zero.bin \ + bl30_new.bin bl30 + + $1/blx_fix.sh $1/bl2.bin \ + zero_tmp \ + bl2_zero.bin \ + $1/acs.bin \ + bl21_zero.bin \ + bl2_new.bin bl2 + + $1/aml_encrypt_$2 --bl30sig \ + --input bl30_new.bin \ + --output bl30_new.bin.g12.enc \ + --level v3 + $1/aml_encrypt_$2 --bl3sig \ + --input bl30_new.bin.g12.enc \ + --output bl30_new.bin.enc \ + --level v3 --type bl30 + $1/aml_encrypt_$2 --bl3sig \ + --input $1/bl31.img \ + --output bl31.img.enc \ + --level v3 --type bl31 + $1/aml_encrypt_$2 --bl3sig \ + --input bl33.bin \ + --compress lz4 \ + --output bl33.bin.enc \ + --level v3 --type bl33 + $1/aml_encrypt_$2 --bl2sig \ + --input bl2_new.bin \ + --output bl2.n.bin.sig + if [ -e $1/lpddr3_1d.fw ] + then + $1/aml_encrypt_$2 --bootmk --output u-boot-signed.bin \ + --bl2 bl2.n.bin.sig \ + --bl30 bl30_new.bin.enc \ + --bl31 bl31.img.enc \ + --bl33 bl33.bin.enc \ + --ddrfw1 $1/ddr4_1d.fw \ + --ddrfw2 $1/ddr4_2d.fw \ + --ddrfw3 $1/ddr3_1d.fw \ + --ddrfw4 $1/piei.fw \ + --ddrfw5 $1/lpddr4_1d.fw \ + --ddrfw6 $1/lpddr4_2d.fw \ + --ddrfw7 $1/diag_lpddr4.fw \ + --ddrfw8 $1/aml_ddr.fw \ + --ddrfw9 $1/lpddr3_1d.fw \ + --level v3 + else + $1/aml_encrypt_$2 --bootmk --output u-boot-signed.bin \ + --bl2 bl2.n.bin.sig \ + --bl30 bl30_new.bin.enc \ + --bl31 bl31.img.enc \ + --bl33 bl33.bin.enc \ + --ddrfw1 $1/ddr4_1d.fw \ + --ddrfw2 $1/ddr4_2d.fw \ + --ddrfw3 $1/ddr3_1d.fw \ + --ddrfw4 $1/piei.fw \ + --ddrfw5 $1/lpddr4_1d.fw \ + --ddrfw6 $1/lpddr4_2d.fw \ + --ddrfw7 $1/diag_lpddr4.fw \ + --ddrfw8 $1/aml_ddr.fw \ + --level v3 + fi +} + +echo "Building u-boot fip..." +cd ${IMAGES_DIR} +mkdir -p ./boot-fip +cd ./boot-fip +cp ../u-boot.bin bl33.bin +uboot_g12_postprocess ${IMAGES_DIR}/amlogic-boot-fip/ g12a +cp u-boot-signed.bin.sd.bin ${IMAGES_DIR}/ +echo "Built u-boot fip for odroid hc4." diff --git a/configs/odroid/hc4/kernel/base b/configs/odroid/hc4/kernel/base new file mode 100644 index 000000000..5e296c174 --- /dev/null +++ b/configs/odroid/hc4/kernel/base @@ -0,0 +1,85 @@ +# CONFIG_CLK_QORIQ is not set +# CONFIG_COMMON_CLK_CDCE706 is not set +# CONFIG_COMMON_CLK_CDCE925 is not set +# CONFIG_COMMON_CLK_CS2000_CP is not set +# CONFIG_COMMON_CLK_NXP is not set +# CONFIG_COMMON_CLK_PIC32 is not set +# CONFIG_COMMON_CLK_PWM is not set +# CONFIG_COMMON_CLK_PXA is not set +# CONFIG_COMMON_CLK_SCPI is not set +# CONFIG_COMMON_CLK_SI514 is not set +# CONFIG_COMMON_CLK_SI5351 is not set +# CONFIG_COMMON_CLK_SI570 is not set +# CONFIG_COMMON_CLK_VERSATILE is not set +# CONFIG_FTL is not set +# CONFIG_IIO_BUFFER_CB is not set +# CONFIG_INFTL is not set +# CONFIG_LEDS_TRIGGER_MTD is not set +# CONFIG_MTD_ABSENT is not set +# CONFIG_MTD_AFS_PARTS is not set +# CONFIG_MTD_AR7_PARTS is not set +# CONFIG_MTD_CFI is not set +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +# CONFIG_MTD_DOCG3 is not set +# CONFIG_MTD_JEDECPROBE is not set +# CONFIG_MTD_LPDDR is not set +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MT81xx_NOR is not set +# CONFIG_MTD_NAND_BRCMNAND is not set +# CONFIG_MTD_NAND_CAFE is not set +# CONFIG_MTD_NAND_DENALI_DT is not set +# CONFIG_MTD_NAND_DENALI_PCI is not set +# CONFIG_MTD_NAND_DISKONCHIP is not set +# CONFIG_MTD_NAND_DOCG4 is not set +# CONFIG_MTD_NAND_ECC_BCH is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +# CONFIG_MTD_NAND_GPIO is not set +# CONFIG_MTD_NAND_HISI504 is not set +# CONFIG_MTD_NAND_MTK is not set +# CONFIG_MTD_NAND_NANDSIM is not set +# CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set +# CONFIG_MTD_NAND_PLATFORM is not set +# CONFIG_MTD_NAND_RICOH is not set +# CONFIG_MTD_ONENAND is not set +# CONFIG_MTD_PARTITIONED_MASTER is not set +# CONFIG_MTD_RAM is not set +# CONFIG_MTD_REDBOOT_PARTS is not set +# CONFIG_MTD_ROM is not set +# CONFIG_MTD_SM_COMMON is not set +# CONFIG_MTD_SPINAND_MT29F is not set +# CONFIG_MTD_SWAP is not set +# CONFIG_MTD_TESTS is not set +# CONFIG_MTD_UBI_BLOCK is not set +# CONFIG_MTD_UBI_FASTMAP is not set +# CONFIG_MTD_UBI_GLUEBI is not set +# CONFIG_NFTL is not set +# CONFIG_RFD_FTL is not set +# CONFIG_SM_FTL is not set +# CONFIG_SSFDC is not set + +CONFIG_COMMON_CLK_XGENE=y +CONFIG_IIO=y +CONFIG_IIO_BUFFER=y +CONFIG_IIO_KFIFO_BUF=y +CONFIG_MTD=y +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_MAP_BANK_WIDTH_1=y +CONFIG_MTD_MAP_BANK_WIDTH_2=y +CONFIG_MTD_MAP_BANK_WIDTH_4=y +CONFIG_MTD_NAND=y +CONFIG_MTD_NAND_ECC=y +CONFIG_MTD_NAND_IDS=y +CONFIG_MTD_OF_PARTS=y +CONFIG_MTD_OOPS=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=20 +CONFIG_MTD_UBI_WL_THRESHOLD=4096 diff --git a/configs/odroid/hc4/kernel/cmdline b/configs/odroid/hc4/kernel/cmdline new file mode 100644 index 000000000..f3083e1e5 --- /dev/null +++ b/configs/odroid/hc4/kernel/cmdline @@ -0,0 +1 @@ +CONFIG_CMDLINE="" diff --git a/configs/odroid/hc4/kernel/display b/configs/odroid/hc4/kernel/display new file mode 100644 index 000000000..b72d89a44 --- /dev/null +++ b/configs/odroid/hc4/kernel/display @@ -0,0 +1,36 @@ +CONFIG_FB_TFT=m +CONFIG_FB_TFT_AGM1264K_FL=m +CONFIG_FB_TFT_BD663474=m +CONFIG_FB_TFT_HX8340BN=m +CONFIG_FB_TFT_HX8347D=m +CONFIG_FB_TFT_HX8353D=m +CONFIG_FB_TFT_HX8357D=m +CONFIG_FB_TFT_ILI9163=m +CONFIG_FB_TFT_ILI9320=m +CONFIG_FB_TFT_ILI9325=m +CONFIG_FB_TFT_ILI9340=m +CONFIG_FB_TFT_ILI9341=m +CONFIG_FB_TFT_ILI9481=m +CONFIG_FB_TFT_ILI9486=m +CONFIG_FB_TFT_PCD8544=m +CONFIG_FB_TFT_RA8875=m +CONFIG_FB_TFT_S6D02A1=m +CONFIG_FB_TFT_S6D1121=m +CONFIG_FB_TFT_SSD1289=m +CONFIG_FB_TFT_SSD1305=m +CONFIG_FB_TFT_SSD1306=m +CONFIG_FB_TFT_SSD1325=m +CONFIG_FB_TFT_SSD1331=m +CONFIG_FB_TFT_SSD1351=m +CONFIG_FB_TFT_ST7735R=m +CONFIG_FB_TFT_ST7789V=m +CONFIG_FB_TFT_TINYLCD=m +CONFIG_FB_TFT_TLS8204=m +CONFIG_FB_TFT_UC1611=m +CONFIG_FB_TFT_UC1701=m +CONFIG_FB_TFT_UPD161704=m +CONFIG_FB_TFT_WATTEROTT=m +CONFIG_FB_FLEX=m +CONFIG_FB_TFT_FBTFT_DEVICE=m +CONFIG_FB_TFT_HKTFT35=m +CONFIG_FB_TFT_HKTFT32=m diff --git a/configs/odroid/hc4/kernel/slim b/configs/odroid/hc4/kernel/slim new file mode 100644 index 000000000..f82ba5697 --- /dev/null +++ b/configs/odroid/hc4/kernel/slim @@ -0,0 +1,7 @@ +# This fragment slims down the Odroid kernel, decreasing boot time. +# Modules are lazy-loaded asynchronously by Skiff. + +CONFIG_RC_CORE=m +# CONFIG_MEDIA_SUPPORT=m +# CONFIG_SOUND=m +CONFIG_IIO=m \ No newline at end of file diff --git a/configs/odroid/hc4/kernel/wifi b/configs/odroid/hc4/kernel/wifi new file mode 100644 index 000000000..5d7432200 --- /dev/null +++ b/configs/odroid/hc4/kernel/wifi @@ -0,0 +1,3 @@ +# use out-of-tree module +CONFIG_RTL8821AU=n +CONFIG_RTL8812AU=n diff --git a/configs/odroid/hc4/metadata/dependencies b/configs/odroid/hc4/metadata/dependencies new file mode 100644 index 000000000..061505d35 --- /dev/null +++ b/configs/odroid/hc4/metadata/dependencies @@ -0,0 +1 @@ +odroid/common diff --git a/configs/odroid/hc4/metadata/description b/configs/odroid/hc4/metadata/description new file mode 100644 index 000000000..3e4a8d49d --- /dev/null +++ b/configs/odroid/hc4/metadata/description @@ -0,0 +1 @@ +Base configuration for the ODROID HC4 board. diff --git a/configs/odroid/hc4/resources/boot-scripts/boot.txt b/configs/odroid/hc4/resources/boot-scripts/boot.txt new file mode 100644 index 000000000..c0fc1cd63 --- /dev/null +++ b/configs/odroid/hc4/resources/boot-scripts/boot.txt @@ -0,0 +1,39 @@ +# U-Boot Parameters +setenv initrd_high "0xffffffff" +setenv fdt_high "0xffffffff" + +# setenv silent 1 +setenv condev "console=tty1 console=ttyAML0,115200n8" +setenv verify 0 +setenv bootlogo "false" + +setenv dtb_addr_r "0x1000000" +setenv kernel_addr_r "0x40008000" +setenv initramfs_addr_r "0x46000000" + +# boot to memory for skiff +setenv bootmem "root=/dev/ram0 ro" + +# max cpu frequency for little core, A55 in MHz unit +# setenv max_freq_a55 "2016" # 2.016 Ghz +setenv max_freq_a55 "1908" # 1.908 GHz, default value +# setenv max_freq_a55 "1800" # 1.8 Ghz +# setenv max_freq_a55 "1704" # 1.704 GHz + +# max cpu-cores +setenv maxcpus "4" + +# Wake-On-Lan support (0=disable, 1=enable) +setenv enable_wol "0" + +# Boot Args +setenv bootargs "coherent_pool=2M ${bootmem} ${condev} ${amlogic} no_console_suspend fsck.repair=yes net.ifnames=0 elevator=noop max_freq_a55=${max_freq_a55} maxcpus=${maxcpus} enable_wol=${enable_wol}" + +fatload mmc ${devnum}:1 ${kernel_addr_r} Image +fatload mmc ${devnum}:1 ${initramfs_addr_r} rootfs.cpio.uboot +fatload mmc ${devnum}:1 ${dtb_addr_r} meson-sm1-odroid-hc4.dtb + +fdt addr ${dtb_addr_r} + +# boot +booti ${kernel_addr_r} ${initramfs_addr_r} ${dtb_addr_r} diff --git a/configs/odroid/hc4/resources/sd_fuse/sd_fusing.sh b/configs/odroid/hc4/resources/sd_fuse/sd_fusing.sh new file mode 100755 index 000000000..9325a3b66 --- /dev/null +++ b/configs/odroid/hc4/resources/sd_fuse/sd_fusing.sh @@ -0,0 +1,43 @@ +# +# Copyright (C) 2011 Samsung Electronics Co., Ltd. +# http://www.samsung.com/ +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +#################################### +set -x +set -eo pipefail + +if [ -z $1 ]; then + echo "usage: ./sd_fusing.sh " + exit 1 +fi + +ubootimg=$2 +if [ ! -b $1 ]; then + echo "$1 not found, unable to fuse bootloader." + exit 1 +fi + +#################################### +# fusing images + +uboot_position=1 +device=$1 + +# Get the U-Boot blob +if [ ! -f $ubootimg ]; then + echo "U-Boot blob not found." + exit 1 +fi + +# +echo "u-boot fusing" +dd iflag=dsync oflag=dsync if=$ubootimg of=$device seek=$uboot_position bs=512 skip=1 seek=1 ${SD_FUSE_DD_ARGS} +dd iflag=dsync oflag=dsync if=$ubootimg of=$device seek=$uboot_position bs=1 count=444 ${SD_FUSE_DD_ARGS} + +#################################### +# +echo "U-boot image is fused successfully." diff --git a/configs/odroid/hc4/uboot/base b/configs/odroid/hc4/uboot/base new file mode 100644 index 000000000..549975681 --- /dev/null +++ b/configs/odroid/hc4/uboot/base @@ -0,0 +1,3 @@ +CONFIG_BOOTDELAY=0 +CONFIG_USB_KEYBOARD=y +CONFIG_SYS_WHITE_ON_BLACK=y diff --git a/configs/odroid/hc4/uboot_patches/0001-HACK-configs-meson64-prevent-stdout-stderr-on-videoc.patch b/configs/odroid/hc4/uboot_patches/0001-HACK-configs-meson64-prevent-stdout-stderr-on-videoc.patch new file mode 100644 index 000000000..7f0f35513 --- /dev/null +++ b/configs/odroid/hc4/uboot_patches/0001-HACK-configs-meson64-prevent-stdout-stderr-on-videoc.patch @@ -0,0 +1,30 @@ +From 999db8ed0a1e935435b17367138bf95180803677 Mon Sep 17 00:00:00 2001 +From: Christian Hewitt +Date: Fri, 13 Nov 2020 02:09:36 +0000 +Subject: [PATCH] HACK: configs: meson64: prevent stdout/stderr on videoconsole + +Several devices have CONFIG_DM_VIDEO enabled which causes stdout/stderr +to appear on videoconsole, so remove videoconsole from STDOUT so that +early u-boot boot remains silent unless using the uart/serial console. + +Signed-off-by: Christian Hewitt +--- + include/configs/meson64.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/configs/meson64.h b/include/configs/meson64.h +index cb202d5555..ba095efe62 100644 +--- a/include/configs/meson64.h ++++ b/include/configs/meson64.h +@@ -18,7 +18,7 @@ + + /* For splashscreen */ + #ifdef CONFIG_DM_VIDEO +-#define STDOUT_CFG "vidconsole,serial" ++#define STDOUT_CFG "serial" + #else + #define STDOUT_CFG "serial" + #endif +-- +2.35.1 +