Skip to content

vim4: upgrade kernel and gpu #13397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this approach seems rather odd, can you explain why you have to do it this way?
does the kernel module not load these at boot? can we change the kernel configs for the drivers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent was to load the video ucode as early as possible to make the hardware decoders happy which get loaded later in the S06modprobe. Converting the inserted modules in the script to buitin forces other modules to be builtin as well. It seems some of the modules cannot be builtin because they need to be loaded in certain order.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

if test "$1" != "start"
then
exit 0
fi

printf "Preload VIMs video firmware: "

# Load video firmware
/sbin/modprobe -q tee
/sbin/modprobe -q amlogic-tee
/sbin/modprobe -q optee
/usr/bin/tee-supplicant &
sleep 1
/usr/bin/tee_preload_fw /lib/firmware/video/video_ucode.bin

echo "OK"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
options dhd firmware_path=../../../lib/firmware/brcm/ nvram_path=../../../lib/firmware/brcm/
78 changes: 45 additions & 33 deletions board/batocera/amlogic/a3gen2/fsoverlay/etc/modules.conf
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is forcing to preload a lot of modules, why is this necessary?
can you not change the kernel module to load in the kernel config if they're essential for booting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous modules.conf was based on the board vendor's module.conf. This was to keep it consistent with that strategy.
However it in my TODO list to start fine tuning this list and also the builtin ones.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you could, it seems excessive especially considering some should autoload when needed accordingly. it can be a separate PR.

Original file line number Diff line number Diff line change
@@ -1,7 +1,44 @@
dhd
amlogic-aoclk-g12a
videobuf-core
amlogic-input
aml_media
amlogic-phy-debug
amlogic-inphy
aml_drm
amlogic-crypto-dma
amlogic-wireless
amlogic-pcie-v3_host
sha1-ce
zsmalloc
ntfs3
system_heap
mdio-mux
pcs_xpcs
stmmac
stmmac-platform
dwmac-meson
amlogic-mdio-g12a
dwmac-meson8b
dwmac-dwc-qos-eth
i2c-dev
v4l2-async
v4l2-fwnode
videobuf-vmalloc
amlogic-audio-utils
dwc_otg
bl40_module
amlogic-host
amlogic-seckey
amlogic-snd-codec-dummy
amlogic-snd-soc
amlogic-snd-codec-t9015
amlogic-snd-codec-tl1
cfg80211
mac80211
media_clock
firmware
video_framerate_adapter
pts_server
decoder_common
stream_input
amvdec_mh264
Expand All @@ -23,40 +60,15 @@ amvdec_ports
amvdec_mavs
amvdec_av1
amvdec_av1_v4l
amvdec_avs3_v4l
amvdec_avs2_v4l
amvdec_mavs_v4l
amvdec_avs2_fb_v4l
media_sync
encoder_common
jpegenc
amvenc_multi
snd_usb_audio
snd_usbmidi_lib
snd_soc_aml_codec_tl1_acodec
snd_soc_aml_t9015
snd_soc_dummy_codec
snd_hwdep
audiodsp
audio_data
reg_access
meson_ir
meson_gxl
meson_cpufreq
meson_clk_debug
leds_state
gpio_keypad
exfat
dwmac_dwc_qos_eth
dolby_fw
aml_drm
adc_keypad
optee
optee_armtz
overlay
nft_chain_nat
nft_counter
nft_compat
nf_tables
xt_conntrack
xt_MASQUERADE
xt_addrtype
veth
dhd
snd-seq
binfmt_misc
wireguard
nfsd
5 changes: 2 additions & 3 deletions board/batocera/amlogic/a3gen2/khadas-vim4/boot/extlinux.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
LABEL Batocera.linux
LINUX /boot/linux
FDT /boot/kvim4.dtb
FDTDIR /boot
INITRD /boot/initrd.gz
APPEND initrd=/boot/initrd.gz label=BATOCERA partition_type=generic rootwait quiet loglevel=0 console=tty3 console=ttyAML0,115200n8 console=ttyS0,921600n8 vt.global_cursor_default=0 fan=auto vout=1080p60hz,enable hdmimode=1080p60hz outputmode=1080p60hz ${bootargs} ${boot_user_args}

APPEND initrd=/boot/initrd.gz label=BATOCERA partition_type=generic rootwait quiet loglevel=0 vt.global_cursor_default=0 fan=auto ${bootargs} ${boot_user_args} console=tty3 console=ttyAML0,115200n8 console=ttyS0,921600n8
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ mkdir -p "${BATOCERA_BINARIES_DIR}/build-uboot-vim4" || exit 1
cp "${BOARD_DIR}/build-uboot.sh" "${BATOCERA_BINARIES_DIR}/build-uboot-vim4/" || exit 1
cd "${BATOCERA_BINARIES_DIR}/build-uboot-vim4/" && ./build-uboot.sh "${HOST_DIR}" "${BOARD_DIR}" "${BINARIES_DIR}" || exit 1

mkdir -p "${BATOCERA_BINARIES_DIR}/boot/boot" || exit 1
mkdir -p "${BATOCERA_BINARIES_DIR}/boot/boot/amlogic" || exit 1
mkdir -p "${BATOCERA_BINARIES_DIR}/boot/extlinux" || exit 1

cp "${BINARIES_DIR}/Image" "${BATOCERA_BINARIES_DIR}/boot/boot/linux" || exit 1
cp "${BINARIES_DIR}/initrd.gz" "${BATOCERA_BINARIES_DIR}/boot/boot/initrd.gz" || exit 1
cp "${BINARIES_DIR}/rootfs.squashfs" "${BATOCERA_BINARIES_DIR}/boot/boot/batocera.update" || exit 1

cp "${BINARIES_DIR}/kvim4.dtb" "${BATOCERA_BINARIES_DIR}/boot/boot/" || exit 1
cp "${BINARIES_DIR}/kvim4.dtb" "${BATOCERA_BINARIES_DIR}/boot/boot/amlogic/" || exit 1
cp "${BINARIES_DIR}/kvim4n.dtb" "${BATOCERA_BINARIES_DIR}/boot/boot/amlogic/" || exit 1
cp "${BOARD_DIR}/boot/extlinux.conf" "${BATOCERA_BINARIES_DIR}/boot/extlinux/" || exit 1
# cp "${BINARIES_DIR}/boot.scr" "${BATOCERA_BINARIES_DIR}/boot/" || exit 1
# cp "${BOARD_DIR}/boot/logo.bmp" "${BATOCERA_BINARIES_DIR}/boot/boot/" || exit 1
Expand Down
54 changes: 54 additions & 0 deletions board/batocera/amlogic/a3gen2/linux-defconfig-fragment.config
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,59 @@ CONFIG_CIFS_SMB2=y
CONFIG_CIFS_SMB311=y
# CONFIG_CIFS_SMB_DIRECT is not set

CONFIG_EXFAT_FS=y
# To control the GPU performance
CONFIG_MALI_MIDGARD_DVFS=y

# Normally part of Initramfs kernel modules
# but also shows what is overridden over a clean default config file
CONFIG_AMLOGIC_ADC=y
CONFIG_AMLOGIC_AMLOGIC_THERMAL=y
CONFIG_AMLOGIC_COMMON_CLK=y
CONFIG_AMLOGIC_COMMON_CLK_T7=y
CONFIG_AMLOGIC_CPU_INFO=y
CONFIG_AMLOGIC_DEBUG=y
CONFIG_AMLOGIC_DEBUG_IOTRACE=y
CONFIG_AMLOGIC_DOS_RESET_MESON=y
CONFIG_AMLOGIC_EFUSE_UNIFYKEY=y
CONFIG_AMLOGIC_FAKE_SMMU=y
CONFIG_AMLOGIC_GKI_TOOL=y
CONFIG_AMLOGIC_GPIO=y
CONFIG_AMLOGIC_GX_REBOOT=y
CONFIG_AMLOGIC_HOST_DRIVER=y
CONFIG_AMLOGIC_HWSPINLOCK=y
CONFIG_AMLOGIC_HW_RANDOM_MESON=y
CONFIG_AMLOGIC_I2C_MESON=y
CONFIG_AMLOGIC_LED=y
CONFIG_AMLOGIC_MEMORY_DEBUG=y
CONFIG_AMLOGIC_MESON_CPUFREQ=y
CONFIG_AMLOGIC_MHU_MBOX=y
CONFIG_AMLOGIC_MMC_CQHCI=y
CONFIG_AMLOGIC_MMC_MESON_GX=y
CONFIG_AMLOGIC_PCIE_V2_HOST=y
CONFIG_AMLOGIC_PINCTRL_MESON_T7=y
CONFIG_AMLOGIC_PM=y
CONFIG_AMLOGIC_POWER=y
CONFIG_AMLOGIC_PWM=y
CONFIG_AMLOGIC_RESET_MESON=y
CONFIG_AMLOGIC_RTC=y
CONFIG_AMLOGIC_SECMON=y
CONFIG_AMLOGIC_SOC_INFO=y
CONFIG_AMLOGIC_SPI=y
CONFIG_AMLOGIC_USB_SUPPORT=y
CONFIG_AMLOGIC_USER_FAULT=y
CONFIG_HWMON=y
CONFIG_KHADAS_MCU=y
CONFIG_MMC_CQHCI=y
CONFIG_REGULATOR_GPIO=y
CONFIG_REGULATOR_PWM=y

# TODO: Disable more unused modules
# CONFIG_EFI is not set
# CONFIG_IGB is not set
# CONFIG_IXGB is not set
# CONFIG_IXGBE is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_AMLOGIC_DTV_DEMOD is not set
# CONFIG_AMLOGIC_ATV_DEMOD is not set
# CONFIG_MEDIA_USB_SUPPORT is not set
Loading