What´s the best Practice to Build own Kernel

here you can see patches i have applied: the 7 part patchset from Bibby Hsieh, your 4 patches and the iommu-patch

i used the v1 from this patchset from may 14 instead of the old from may 8, but on a quick look i see no difference in part 7/7

ohhh, you don’t need to add this. This is a harmless error.

i’ve traced initialisation from mtk_hdmi_phy.c:

static int mtk_hdmi_phy_probe(struct platform_device *pdev)
....
        return of_clk_add_provider(dev->of_node, of_clk_src_simple_get,
                                   hdmi_phy->pll);

to drivers/clk/clk.c:

static int clk_fetch_parent_index(struct clk_core *core,
				  struct clk_core *parent)
        ....
	for (i = 0; i < core->num_parents; i++)
		if (clk_core_get_parent_by_index(core, i) == parent)
			return i;

	return -EINVAL;

and the only way to fix it, i’ve found, was to add hdmitx_dig_cts to hdmi_parents.

Another good news! After a’ve added CONFIG_DRM_MALI_DISPLAY=y option the kernel became able to start Xorg server. But we steel have no framebuffer console. I didn’t found any gegeral fb device like VGA or VESA on x86 platform, so i don’t know what to add.

1 Like

New photo by Alexander Ryabchenko

Looks Good :grinning:. But I guess you could ignore that harmless error.

Sorry, didn’t get it. :slight_smile: I’m completely new to hardware drivers, so it’s possible that i can miss some obvious errors :slight_smile:

nice what have you changed in addition to my repo?

Blockquote[quote=“DeadMeat, post:155, topic:3937”] Sorry, didn’t get it. :slight_smile: I’m completely new to hardware drivers, so it’s possible that i can miss some obvious errors :slight_smile: [/quote]

That is, I’m afraid the clock topology will be broken (not sure), and we will fix this .Can you try to adjust the resolution?

1 Like

Hello, Frank, i’ve applided diff --git a/drivers/clk/mediatek/clk-mt2701.c b/drivers/clk/mediatek/clk-mt2701.c index 4dda898…c560ac6 100644 — a/drivers/clk/mediatek/clk-mt2701.c +++ b/drivers/clk/mediatek/clk-mt2701.c @@ -315,9 +315,11 @@ static const char * const tve_parents[] = {

 static const char * const hdmi_parents[] = {
        "clk26m",
+       "hdmitx_dig_cts",
        "hdmipll_ck",
        "hdmipll_d2",
        "hdmipll_d3"
+
 };
 
 static const char * const apll_parents[] = {

Also i’ve enabled CONFIG_REGULATOR_FIXED_VOLTAGE=y, CONFIG_DRM_MALI_DISPLAY=y, and some other not hdmi related stuff. I can make diff between my and standart .config . I didn’t changed mt7623n_evb_fwu_defconfig

I’ve tried few random resolution setting. Everything seems ok.

CONFIG_REGULATOR_FIXED_VOLTAGE=y is only for usb, or is it needed for hdmi (found no reference in dts-changes)?

can you try without the “hdmitx_dig_cts”-patch, because ryder says it is not neccessary

so actually only CONFIG_DRM_MALI_DISPLAY=y is missing in defconfig, right?

Shure,it’s only for usb, but my mouse and keyboad dont work without it.:grinning:

I’ve tried, and i got this error:

[1.111339] clk: failed to reparent hdmi_sel to hdmitx_dig_cts: -22

At least: CONFIG_DRM_MALI_DISPLAY=y and CONFIG_DRM_ARM=y

Please see my cofig diff.

config.diff (3.4 КБ)

There are many of unnesessary changes, so I can rebuld kernel with default config with all nesessary changes and send the patch, if You need.

right, but hdmi works without this, right?

added these 3 options (regulator+2xdrm) to defconfig…

ok i see there are some more options related:

  • +CONFIG_DRM_KMS_CMA_HELPER=y
  • +CONFIG_COMMON_CLK_MT2701_MMSYS=y
  • +CONFIG_COMMON_CLK_MT2701_IMGSYS=y
  • +CONFIG_COMMON_CLK_MT2701_VDECSYS=y
  • +CONFIG_FB_SIMPLE=y
  • +CONFIG_VIDEOMODE_HELPERS=y

last one is seleted by default:

  │ Symbol: VIDEOMODE_HELPERS [=y]                                                                                         │  
  │ Type  : bool                                                                                                           │  
  │   Defined at drivers/video/Kconfig:33                                                                                  │  
  │   Depends on: HAS_IOMEM [=y]                                                                                           │  
  │   Selected by:                                                                                                         │  
  │   - DRM_MALI_DISPLAY [=y] && HAS_IOMEM [=y] && DRM [=y] && OF [=y] && (ARM [=y] || ARM64) && COMMON_CLK [=y]

Probably… DRM_MALI_DISPLAY wasn’t configured, so Xorg was not able to start. I’ll try to rebuild kernel without this patch, but with Mali display enabled. But probably only tomorrow.

That was my try to enable frame buffer, so it’s not nessesary.

how about the others (drm_kms and videomode_helpers)? i guess the clocks are neccessary…

Please remove these two lines in hdmi node to get rid of that error.

assigned-clocks = <&topckgen CLK_TOP_HDMI_SEL>;

assigned-clock-parents = <&hdmi_phy>;

have done it (also adding the clock-options), @DeadMeat can you please test it?

As soon as I get to my R2. Most likely tomorrow.

P. S. Probably we should to discuss hdmi in a dedicated thread, I suppose this one is for general kernel building. :slight_smile:

Maybe we can use this: Hdmi in uboot and linux

at least we should get the virtual fb console working…then the xserver