[Mediatek] mt8195-demo: please help to include these MediaTek drivers in initrd.img in CD/DVD release image

Bug #2038512 reported by Macpaul Lin
18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

[Impact]
Peripheral probe failure for MediaTek boards 'mt8195-demo' and 'genio-1200-evk'.

[Ubuntu Version]
Jammy

[initramfs-tools]
0.140ubuntu13.4

[Kernel version]
5.15 -> 6.2
(Generate initrd.img-6.2.0 on 5.15 kernel.)

[Fix]
I've used 'dracut' to examing the driver dependencies for boards 'mt8195-demo' and 'genio-1200-evk'.
It is able to buot into console and use USB port3.
Hope these drivers could help to run installer with USB disk in next daily build.

Note: It won't work with 'update-initramfs -u -k 6.2.0-34-generic' if just simply add driver lists in '/etc/modules', '/etc/modprobe.d/mediatek.conf' or '/etc/modules-load.d/mediatek.conf'. I fixed this issue with 'dracut' and it seems this tool will include more common framework drivers into initrd.img.

[MediaTek relate drivers]
file: mediatek-drivers-for-mt8195-demo-bringup.txt
(Not listed in probing sequence)

i2c-mt65xx
spi-mt65xx
reset-ti-syscon
mt6397
rtc-mt6397
mtk-pmic-wrap
mt6315-regulator
spmi-mtk-pmif
mtk_scp_ipi
mediatek-drm
mtk-vcodec-dec
mtk-vcodec-enc
mtk_jpeg
mtk-vcodec-common
mtk-jpeg-enc-hw
mtk-vpu
mtk-jpeg-dec-hw
mtk-cmdq-helper
mtk-cmdq-helper
mtk-cmdq-mailbox
mtk-mdp3
phy-mtk-mipi-dsi-drv
btmtk
leds-mt6360
tcpci_mt6360
mt6360_charger
mt6360-regulator
mt6360-core
mt6359-regulator
mt6360-adc
snd-soc-mt8195-afe
snd-soc-mtk-common
snd-soc-dmic
dwmac-mediatek
stmmac-platform
stmmac
mtk-rng
mtk_scp
mtk_rpmsg
pwm-mediatek
pwm-mtk-disp
nvmem_mtk-efuse
mtk-sd
cqhci
phy-mtk-tphy
mtu3
xhci-mtk-hcd
phy-mtk-pcie
pcie-mediatek-gen3

[lsmod log]
file: lsmod-i1200-demo-kernel-6.2-dracut-initrd.txt

[Other info]
effected kernel (6.2-latest)
ubuntu kernel for lunar, and Mantic.

Tags: patch
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 2038512

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
ethan.hsieh (ethan.hsieh) wrote :
Revision history for this message
ethan.hsieh (ethan.hsieh) wrote :
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

ubuntu kernel team does not handle which drivers do or do not get included in the initrd.

Since this is stuff that affects generic, these should be added by default for modules=most mode by initramfs-tools.

please contact ubuntu foundations team about this.

affects: linux (Ubuntu) → initramfs-tools (Ubuntu)
Changed in initramfs-tools (Ubuntu):
status: Incomplete → New
Revision history for this message
Macpaul Lin (macpaul-lin-mtk) wrote :

The setting of /etc/initramfs-tools/initramfs.conf was already set to 'MODULES=most'.

But it seems just not working for adding some of these drivers.
I was trying to configure these drivers on...

[Ubuntu Version]
Jammy

[initramfs-tools]
0.140ubuntu13.4

[Kernel version]
5.15 -> 6.2
(Generate initrd.img-6.2.0 on 5.15 kernel.)

description: updated
Revision history for this message
Macpaul Lin (macpaul-lin-mtk) wrote (last edit ):

Update:

It seems adding both files for the dependencies is required.
1. /etc/modprobe.d/mediatek.conf (module dependencies)
2. /etc/initramfs-tools/conf.d/driver-policy: 'MODULES=dep'

If only one file is added won't work.

update:
file: mediatek.conf (not optimized yet).

Revision history for this message
ethan.hsieh (ethan.hsieh) wrote :
Revision history for this message
Macpaul Lin (macpaul-lin-mtk) wrote :

Update:

I've tested latest release image [1].

The ethernet is working. However due to the network environment in MediaTek, I could get IP address but just cannot get the correct DNS server. Hence I could not set $URL for packages during installation.

The USB hosts aren't working.
However, according to the debugging result on Suse.
I think these drivers [2][3] are still need for enabling USB hosts.
I've extract initrd from ubuntu-23.10-live-server-arm64.iso and trying to build a customized CD-image via this method [4]. But I've failed at the very last several steps to make a new CD-image with customized initrd.

[1] https://cdimage.ubuntu.com/ubuntu/releases/23.10/release/ubuntu-23.10-live-server-arm64.iso
[2] mt6360_charger, mtk-pmic-wrap, nvmem_mtk-efuse
[3] https://bugzilla.suse.com/show_bug.cgi?id=1215995
[4] https://help.ubuntu.com/community/LiveCDCustomization

Please help to include more drivers [2] in the next daily build release. Thanks.

Revision history for this message
Macpaul Lin (macpaul-lin-mtk) wrote (last edit ):

I'm not sure if the repo https://github.com/snapcore/core-initrd/
is used for creating initrd for server or desktop's live-cd or installation CD image.
However, I've send a pull request.

If this is not the correct repo to send pull request, please help to correct me.
https://github.com/snapcore/core-initrd/pull/216

Revision history for this message
Benjamin Drung (bdrung) wrote :

The initramfs-tools code can be found on https://code.launchpad.net/~ubuntu-core-dev/ubuntu/+source/initramfs-tools/+git/initramfs-tools

Can you test the proposed changes from https://code.launchpad.net/~bdrung/ubuntu/+source/initramfs-tools/+git/initramfs-tools/+ref/mediatek (patch with the changes from the three commits is attached)? Apply the changes to /usr/share/initramfs-tools/hook-functions and test if the boards boot correctly then.

tags: added: patch
Revision history for this message
Macpaul Lin (macpaul-lin-mtk) wrote :

Thanks for pointing the required resource in hook-function in initramfs-tools.
These seems helped. However I'm still check more required drivers.

+ modules="$modules =drivers/nvmem"
     modules="$modules =drivers/phy"
+ modules="$modules =drivers/power"
     modules="$modules =drivers/regulator"
     modules="$modules =drivers/reset"
     modules="$modules =drivers/spi"
+ modules="$modules =drivers/soc"

I think this is also required for "spmi-mtk-pmif"

+modules="$modules =drivers/spmi"

according to this https://bugzilla.suse.com/show_bug.cgi?id=1216767 fix.

Revision history for this message
Benjamin Drung (bdrung) wrote :

linux-modules-extra-6.5.0-10-generic ships four System Power Management Interface (SPMI) modules on arm64:

drivers/spmi/hisi-spmi-controller.ko.zst
drivers/spmi/spmi-mtk-pmif.ko.zst
drivers/spmi/spmi-pmic-arb.ko.zst
drivers/spmi/spmi.ko.zst

See https://packages.ubuntu.com/mantic-updates/arm64/linux-modules-extra-6.5.0-10-generic/filelist

Including those should not consume too much space.

Revision history for this message
Benjamin Drung (bdrung) wrote :

Forwarded adding System Power Management Interface (SPMI) modules to dracut: https://github.com/dracutdevs/dracut/pull/2557

Benjamin Drung (bdrung)
Changed in initramfs-tools (Ubuntu):
status: New → Fix Committed
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package initramfs-tools - 0.142ubuntu16

---------------
initramfs-tools (0.142ubuntu16) noble; urgency=medium

  * Install nvmem, soc, power, and System Power Management Interface (SPMI)
    kernel modules on ARM/RISC-V for MediaTek boards (LP: #2038512)
  * Install intel_lpss_pci and spi_pxa2xx_platform kernel modules for keyboard
    on MacBook Pro 2017 (LP: #2042710)
  * Install surface_aggregator_registry for keyboard on Surface Laptop 4
    (LP: #2007050)
  * framebuffer: Add privacy screen modules to the initrd (LP: #1954320)

 -- Benjamin Drung <email address hidden> Tue, 14 Nov 2023 19:34:42 +0100

Changed in initramfs-tools (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.