Amlogic: add support for ODROID-N2L

This commit is contained in:
adamg 2023-11-01 15:04:22 +00:00
parent 2be5a7c403
commit d6c3602824
8 changed files with 148 additions and 3 deletions

View file

@ -0,0 +1 @@
Hardkernel ODROID-N2

View file

@ -56,4 +56,10 @@ case "${SUBDEVICE}" in
mkimage_extlinux
mkimage_uboot
;;
Odroid_N2L)
DTB=("meson-g12b-odroid-n2l")
mkimage_dtb
mkimage_extlinux
mkimage_uboot
;;
esac

View file

@ -60,9 +60,12 @@ if [ -n "$DT_ID" ]; then
*odroid_go_ultra*|*rgb10-max-3*)
SUBDEVICE="Odroid_GOU"
;;
*odroid-n2*)
*odroid-n2|*odroid-n2-plus)
SUBDEVICE="Odroid_N2"
;;
*odroid-n2l)
SUBDEVICE="Odroid_N2L"
;;
esac
fi

View file

@ -150,5 +150,5 @@
# htop tool (yes / no)
HTOP_TOOL="yes"
# JELOS Subdevices
SUBDEVICES="Odroid_GOU Odroid_N2"
# JELOS Subdevices (supported devices: Odroid_GOU Odroid_N2 Odroid_N2L)
SUBDEVICES="Odroid_GOU Odroid_N2 Odroid_N2L"

View file

@ -0,0 +1,80 @@
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2l.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2l.dts
@@ -0,0 +1,77 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
+ */
+
+/dts-v1/;
+
+#include "meson-g12b-a311d.dtsi"
+#include "meson-g12b-odroid-n2.dtsi"
+
+/ {
+ compatible = "hardkernel,odroid-n2l", "amlogic,s922x", "amlogic,g12b";
+ model = "Hardkernel ODROID-N2L";
+
+ sound {
+ compatible = "amlogic,axg-sound-card";
+ model = "ODROID-N2L";
+ audio-aux-devs = <&tdmout_b>, <&tdmin_a>, <&tdmin_b>,
+ <&tdmin_c>, <&tdmin_lb>;
+ audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
+ "TDMOUT_B IN 1", "FRDDR_B OUT 1",
+ "TDMOUT_B IN 2", "FRDDR_C OUT 1",
+ "TDM_B Playback", "TDMOUT_B OUT",
+ "TDMIN_A IN 4", "TDM_B Loopback",
+ "TDMIN_B IN 4", "TDM_B Loopback",
+ "TDMIN_C IN 4", "TDM_B Loopback",
+ "TDMIN_LB IN 1", "TDM_B Loopback",
+ "TODDR_A IN 0", "TDMIN_A OUT",
+ "TODDR_B IN 0", "TDMIN_A OUT",
+ "TODDR_C IN 0", "TDMIN_A OUT",
+ "TODDR_A IN 1", "TDMIN_B OUT",
+ "TODDR_B IN 1", "TDMIN_B OUT",
+ "TODDR_C IN 1", "TDMIN_B OUT",
+ "TODDR_A IN 2", "TDMIN_C OUT",
+ "TODDR_B IN 2", "TDMIN_C OUT",
+ "TODDR_C IN 2", "TDMIN_C OUT",
+ "TODDR_A IN 6", "TDMIN_LB OUT",
+ "TODDR_B IN 6", "TDMIN_LB OUT",
+ "TODDR_C IN 6", "TDMIN_LB OUT";
+
+ dai-link-6 {
+ /delete-node/ codec-1;
+ };
+
+ dai-link-7 {
+ /delete-node/ codec-1;
+ };
+
+ /delete-node/ dai-link-9;
+ };
+};
+
+&eth_phy {
+ status = "disabled";
+};
+
+&vddcpu_a {
+ regulator-min-microvolt = <680000>;
+ regulator-max-microvolt = <1040000>;
+
+ pwms = <&pwm_ab 0 1500 0>;
+};
+
+&vddcpu_b {
+ regulator-min-microvolt = <680000>;
+ regulator-max-microvolt = <1040000>;
+
+ pwms = <&pwm_AO_cd 1 1500 0>;
+};
+
+&usb2_phy0 {
+ phy-supply = <&usb_pwr_en>;
+};
+
+&usb2_phy1 {
+ phy-supply = <&usb_pwr_en>;
+};

View file

@ -0,0 +1,34 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
PKG_NAME="u-boot-Odroid_N2L"
PKG_VERSION="v2023.10"
PKG_LICENSE="GPL"
PKG_SITE="https://www.denx.de/wiki/U-Boot"
PKG_URL="https://github.com/u-boot/u-boot/archive/${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain amlogic-boot-fip"
PKG_DEPENDS_UNPACK="amlogic-boot-fip"
PKG_LONGDESC="Das U-Boot is a cross-platform bootloader for embedded systems."
PKG_TOOLCHAIN="manual"
configure_package() {
PKG_UBOOT_CONFIG="odroid-n2l_defconfig"
PKG_UBOOT_FIP="odroid-n2l"
FIP_DIR="$(get_build_dir amlogic-boot-fip)"
}
make_target() {
[ "${BUILD_WITH_DEBUG}" = "yes" ] && PKG_DEBUG=1 || PKG_DEBUG=0
setup_pkg_config_host
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm make mrproper
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm make HOSTCC="${HOST_CC}" HOSTCFLAGS="-I${TOOLCHAIN}/include" HOSTLDFLAGS="${HOST_LDFLAGS}" ${PKG_UBOOT_CONFIG}
DEBUG=${PKG_DEBUG} CROSS_COMPILE="${TARGET_KERNEL_PREFIX}" LDFLAGS="" ARCH=arm _python_sysroot="${TOOLCHAIN}" _python_prefix=/ _python_exec_prefix=/ make HOSTCC="${HOST_CC}" HOSTCFLAGS="-I${TOOLCHAIN}/include" HOSTLDFLAGS="${HOST_LDFLAGS}" HOSTSTRIP="true" CONFIG_MKIMAGE_DTC_PATH="scripts/dtc/dtc"
cp -av ${PKG_BUILD}/u-boot.bin ${FIP_DIR}/${PKG_UBOOT_FIP}
cd ${FIP_DIR}
./build-fip.sh ${PKG_UBOOT_FIP} ${FIP_DIR}/${PKG_UBOOT_FIP}/u-boot.bin ${PKG_BUILD}
}
makeinstall_target() {
: # nothing
}

View file

@ -0,0 +1,11 @@
--- a/include/configs/meson64.h
+++ b/include/configs/meson64.h
@@ -99,7 +99,7 @@
"pxefile_addr_r=0x01080000\0" \
"fdtoverlay_addr_r=0x01000000\0" \
"ramdisk_addr_r=0x13000000\0" \
- "fdtfile=amlogic/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
+ "fdtfile=/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
BOOTENV
#endif

View file

@ -0,0 +1,10 @@
--- a/configs/odroid-n2l_defconfig
+++ b/configs/odroid-n2l_defconfig
@@ -18,6 +18,7 @@
CONFIG_DEBUG_UART=y
CONFIG_REMAKE_ELF=y
CONFIG_OF_BOARD_SETUP=y
+CONFIG_BOOTDELAY=0
# CONFIG_DISPLAY_CPUINFO is not set
CONFIG_MISC_INIT_R=y
CONFIG_SYS_MAXARGS=32