How to enable gmbus (I2C)

Victor910

New Member


Messages: 12

My system Freebsd 12.0
I had installed port drm--stable-kmod"
The question, how to enable "gmbus " support?

My dmesg:
Code:
[drm] Initialized
drmn0: <drmn> on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
[drm:__intel_uncore_early_sanitize] unclaimed mmio detected on uncore init, clearing
[drm] Memory usable by graphics device = 4096M
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] Driver supports precise vblank timestamp query.
[drm:drm_irq_install] irq=16
[drm] Connector eDP-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.eDP-1
[drm]   - kern.vt.fb.default_mode
[drm] failed to retrieve link info, disabling eDP
[drm] Connector HDMI-A-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.HDMI-A-1
[drm]   - kern.vt.fb.default_mode
[drm] Connector DP-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.DP-1
[drm]   - kern.vt.fb.default_mode
[drm:drm_calc_timestamping_constants] crtc 26: hwmode: htotal 2720, vtotal 1481, vdisplay 1440
[drm:drm_calc_timestamping_constants] crtc 26: clock 241500 kHz framedur 16680414 linedur 11262
[drm:drm_mode_object_reference] OBJ ID: 37 (1)
[drm] Finished loading i915/kbl_dmc_ver1_01.bin (v1.1)
[drm:drm_mode_object_reference] OBJ ID: 37 (2)
[drm:drm_mode_object_reference] OBJ ID: 42 (1)
[drm:drm_minor_register]
[drm:drm_minor_register] new minor registered 64
[drm:drm_minor_register]
[drm:drm_minor_register] new minor registered 128
[drm:drm_minor_register]
[drm:drm_minor_register] new minor registered 0
[drm:drm_sysfs_connector_add] adding "HDMI-A-1" to sysfs
[drm:drm_sysfs_connector_add] adding "DP-1" to sysfs
[drm:drm_dp_aux_register_devnode] drm_dp_aux_dev: aux [DPDDC-C] registered as minor 0
[drm] Initialized i915 1.6.0 20160919 for drmn on minor 0
[drm:drm_mode_object_reference] OBJ ID: 37 (3)
[drm:drm_mode_object_reference] OBJ ID: 46 (1)
[drm:drm_mode_object_unreference] OBJ ID: 46 (2)
[drm:drm_mode_object_reference] OBJ ID: 63 (1)
[drm:drm_mode_object_reference] OBJ ID: 37 (4)
[drm:drm_mode_object_reference] OBJ ID: 37 (5)
[drm:drm_mode_object_unreference] OBJ ID: 37 (6)
[drm:drm_mode_object_reference] OBJ ID: 37 (5)
name=drmn0 flags=0x0 stride=10240 bpp=32
drmn0: fb0: inteldrmfb frame buffer device
[drm:drm_calc_timestamping_constants] crtc 26: hwmode: htotal 2720, vtotal 1481, vdisplay 1440
[drm:drm_calc_timestamping_constants] crtc 26: clock 241500 kHz framedur 16680414 linedur 11262
[drm:drm_vblank_enable] enabling vblank on crtc 0, ret: 0
[drm:vblank_disable_fn] disabling vblank on crtc 0
[drm:drm_vblank_enable] enabling vblank on crtc 0, ret: 0
[drm:drm_handle_vblank_events] vblank event on 53, current 54
[drm:vblank_disable_fn] disabling vblank on crtc 0
[drm:drm_mode_object_unreference] OBJ ID: 46 (1)
[drm:drm_mode_object_unreference] OBJ ID: 37 (6)
[drm:drm_mode_object_unreference] OBJ ID: 37 (5)
[drm:drm_mode_object_reference] OBJ ID: 63 (2)
[drm:drm_mode_object_unreference] OBJ ID: 47 (1)
[drm:drm_mode_object_unreference] OBJ ID: 37 (4)
[drm:drm_mode_object_reference] OBJ ID: 37 (3)
[drm:drm_mode_object_reference] OBJ ID: 63 (3)
[drm:drm_mode_object_reference] OBJ ID: 64 (1)
[drm:drm_mode_object_unreference] OBJ ID: 64 (2)
[drm:drm_mode_object_unreference] OBJ ID: 63 (4)
[drm:drm_mode_object_reference] OBJ ID: 63 (3)
[drm:drm_mode_object_reference] OBJ ID: 37 (4)
[drm:drm_mode_object_reference] OBJ ID: 37 (5)
[drm:drm_mode_object_unreference] OBJ ID: 37 (6)
[drm:drm_mode_object_reference] OBJ ID: 37 (5)
[drm:drm_vblank_enable] enabling vblank on crtc 0, ret: 0
[drm:vblank_disable_fn] disabling vblank on crtc 0
[drm:drm_vblank_enable] enabling vblank on crtc 0, ret: 0
[drm:drm_handle_vblank_events] vblank event on 57, current 58
[drm:vblank_disable_fn] disabling vblank on crtc 0
[drm:drm_mode_object_unreference] OBJ ID: 37 (6)
[drm:drm_mode_object_unreference] OBJ ID: 37 (5)
[drm:drm_mode_object_unreference] OBJ ID: 64 (1)
[drm:drm_mode_object_unreference] OBJ ID: 63 (4)
[drm:drm_mode_object_reference] OBJ ID: 63 (3)
[drm:drm_mode_object_unreference] OBJ ID: 63 (4)
[drm] RC6 on
My final target will have access to HDMI DDC - (I2C).
how you see right now, I do not have to detect HDMI I2C in my log.

I believe something wrong with GMBus.


I had to try to install Debian on the same machine, HDMI I2C has been detected&working correctly.
For example a report from Debian:
Code:
test@debian# i2cdetect -l
i2c-0  i2c   i915 gmbus dpa   i2c adapter
i2c-1  i2c   i915 gmbus dpb   i2c adapter
i2c-2  i2c   i915 gmbus dpc   i2c adapter
i2c-3  i2c   i915 gmbus dpd   i2c adapter
i2c-4  i2c   i915 DPDDC-C      i2c adapter
[/code
I have only this in my Freebsd Log:
[code]
[drm:drm_dp_aux_register_devnode] drm_dp_aux_dev: aux [DPDDC-C] registered as minor 0
But anyway I do not have any I2C controller under FreeBSD :(

My processor:
Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz (kaby lake)
Internal video card HD Graphics 620

how to finally make this working under FreeBSD?
Any help you are welcome.
 
Last edited by a moderator:
OP
OP
V

Victor910

New Member


Messages: 12

Ok, base on instruction from https://www.freshports.org/graphics/drm-kmod/
I had installed this:
cd /usr/ports/graphics/drm-kmod/ && make install clean

I believe this absolutely correct for my system.

Dmesg report still without I2C:
Code:
dmesg | grep drm
[drm:drm_core_init] Initialized
drmn0: <drmn> on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
[drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19).
[drm:__intel_uncore_early_sanitize] unclaimed mmio detected on uncore init, clearing
[drm] Got stolen memory base 0x8e000000, size 0x2000000
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] Driver supports precise vblank timestamp query.
[drm:drm_irq_install] irq=16
drmn0: failed to link firmware kernel module with mapped name: i915_kbl_dmc_ver1_04_bin
[drm] Connector HDMI-A-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.HDMI-A-1
[drm]   - kern.vt.fb.default_mode
[drm] Connector DP-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.DP-1
[drm]   - kern.vt.fb.default_mode
[drm:drm_calc_timestamping_constants] crtc 37: hwmode: htotal 2720, vtotal 1481, vdisplay 1440
[drm:drm_calc_timestamping_constants] crtc 37: clock 241500 kHz framedur 16680414 linedur 11262
[drm:drm_mode_object_get] OBJ ID: 59 (2)
[drm:drm_mode_object_get] OBJ ID: 59 (3)
[drm:drm_mode_object_get] OBJ ID: 64 (2)
[drm:drm_minor_register]
[drm:drm_minor_register]
[drm:drm_minor_register] new minor registered 128
[drm:drm_minor_register]
[drm:drm_minor_register] new minor registered 0
[drm:drm_sysfs_connector_add] adding "HDMI-A-1" to sysfs
[drm:drm_sysfs_hotplug_event] generating hotplug event
[drm:drm_sysfs_connector_add] adding "DP-1" to sysfs
[drm:drm_sysfs_hotplug_event] generating hotplug event
[drm:drm_dp_aux_register_devnode] drm_dp_aux_dev: aux [DPDDC-C] registered as minor 0
[drm] Initialized i915 1.6.0 20171222 for drmn0 on minor 0
[drm:drm_sysfs_hotplug_event] generating hotplug event
[drm:drm_mode_object_get] OBJ ID: 59 (3)
[drm:drm_mode_object_get] OBJ ID: 68 (1)
[drm:drm_mode_object_put] OBJ ID: 68 (2)
[drm:drm_mode_object_get] OBJ ID: 85 (1)
[drm:drm_mode_object_get] OBJ ID: 59 (5)
[drm:drm_mode_object_get] OBJ ID: 59 (6)
[drm:drm_mode_object_put] OBJ ID: 59 (6)
[drm:drm_mode_object_get] OBJ ID: 59 (5)
name=drmn0 flags=0x0 stride=10240 bpp=32
drmn0: fb0: inteldrmfb frame buffer device
[drm:drm_calc_timestamping_constants] crtc 37: hwmode: htotal 2720, vtotal 1481, vdisplay 1440
[drm:drm_calc_timestamping_constants] crtc 37: clock 241500 kHz framedur 16680414 linedur 11262
[drm] Reducing the compressed framebuffer size. This may lead to less power savings than a non-reduced-size. Try to increase stolen memory size if available in BIOS.
[drm:drm_vblank_enable] enabling vblank on crtc 0, ret: 0
[drm:drm_handle_vblank_events] vblank event on 6, current 6
[drm:drm_mode_object_put] OBJ ID: 68 (1)
[drm:drm_mode_object_get] OBJ ID: 85 (2)
[drm:drm_mode_object_put] OBJ ID: 59 (6)
[drm:drm_mode_object_put] OBJ ID: 59 (5)
[drm:vblank_disable_fn] disabling vblank on crtc 0
drmn0: failed to load firmware with name: i915/kbl_dmc_ver1_04.bin
drmn0: Failed to load DMC firmware i915/kbl_dmc_ver1_04.bin. Disabling runtime power management.
drmn0: DMC firmware homepage: [URL]https://01.org/linuxgraphics/downloads/firmware[/URL]
[/code
what I must do next for will have access to I2C?
 
OP
OP
V

Victor910

New Member


Messages: 12

my kldstat.

kldstat
Code:
Id Refs Address                Size Name
 1   82 0xffffffff80200000  243d1f8 kernel
 2    1 0xffffffff8263e000     2da8 smb.ko
 3    5 0xffffffff82641000     2e18 smbus.ko
 4    1 0xffffffff82644000     3ca8 amdsmb.ko
 5    1 0xffffffff82648000     4c98 iicbb.ko
 6    6 0xffffffff8264d000     6cc8 iicbus.ko
 7    1 0xffffffff82654000     8910 ig4.ko
 8    1 0xffffffff8265e000     3950 iicsmb.ko
 9    1 0xffffffff82662000    185c8 bktr.ko
10    2 0xffffffff8267b000     1530 bktr_mem.ko
11    1 0xffffffff8267d000     3820 iic.ko
12    1 0xffffffff82681000     6230 ichsmb.ko
13    1 0xffffffff82821000   12cc50 i915kms.ko
14    1 0xffffffff8294e000    767d0 drm.ko
15    4 0xffffffff829c5000    104f0 linuxkpi.ko
16    3 0xffffffff829d6000    12f30 linuxkpi_gplv2.ko
17    2 0xffffffff829e9000      6c0 debugfs.ko
18    1 0xffffffff829ea000    15630 if_iwm.ko
19    1 0xffffffff82a00000   10045f iwm7260fw.ko
20    1 0xffffffff82b01000     3aa0 ng_ubt.ko
21    2 0xffffffff82b05000     a020 netgraph.ko
22    1 0xffffffff82b10000     9608 ng_hci.ko
23    1 0xffffffff82b1a000      9c0 ng_bluetooth.ko
24    1 0xffffffff82b1b000    17590 smbfs.ko
25    2 0xffffffff82b33000     3050 libiconv.ko
26    2 0xffffffff82b37000     1dce libmchain.ko
27    1 0xffffffff82b39000      acf mac_ntpd.ko
 

roccobaroccoSC

Aspiring Daemon

Reaction score: 144
Messages: 600

The dmesg output says it all:

Code:
drmn0: failed to load firmware with name: i915/kbl_dmc_ver1_04.bin
drmn0: Failed to load DMC firmware i915/kbl_dmc_ver1_04.bin. Disabling runtime power management.
drmn0: DMC firmware homepage: [URL]https://01.org/linuxgraphics/downloads/firmware[/URL]
You are obviously missing the firmware for your driver. So either take a look if there is a package with the firmware on freshports.org, or visit the URL shown in the error and look for FreeBSD installation instructions for the firmware.
I personally use an AMDGPU card and I had to install separate packages with the firmware: graphics/gpu-firmware-kmod. Maybe you need the same package, check it.
 
OP
OP
V

Victor910

New Member


Messages: 12

I believe this must download automatically, but....
This was the main reason why I switching to drm-stable-kmod, the file has been download automatically, in other words, I did not have this error in my old dmesg log.

Anyway, error has been fixed, my last dmesg:

Code:
dmesg  | grep drm
[drm:drm_core_init] Initialized
drmn0: <drmn> on vgapci0
vgapci0: child drmn0 requested pci_enable_io
vgapci0: child drmn0 requested pci_enable_io
[drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19).
[drm:__intel_uncore_early_sanitize] unclaimed mmio detected on uncore init, clearing
[drm] Got stolen memory base 0x8e000000, size 0x2000000
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] Driver supports precise vblank timestamp query.
[drm:drm_irq_install] irq=16
[drm] Connector HDMI-A-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.HDMI-A-1
[drm]   - kern.vt.fb.default_mode
[drm] Connector DP-1: get mode from tunables:
[drm]   - kern.vt.fb.modes.DP-1
[drm]   - kern.vt.fb.default_mode
[drm:drm_calc_timestamping_constants] crtc 37: hwmode: htotal 2720, vtotal 1481, vdisplay 1440
[drm:drm_calc_timestamping_constants] crtc 37: clock 241500 kHz framedur 16680414 linedur 11262
[drm:drm_mode_object_get] OBJ ID: 59 (2)
[drm:drm_mode_object_get] OBJ ID: 59 (3)
[drm:drm_mode_object_get] OBJ ID: 64 (2)
[drm:drm_minor_register]
[drm:drm_minor_register]
[drm:drm_minor_register] new minor registered 128
[drm:drm_minor_register]
[drm:drm_minor_register] new minor registered 0
[drm:drm_sysfs_connector_add] adding "HDMI-A-1" to sysfs
[drm:drm_sysfs_hotplug_event] generating hotplug event
[drm:drm_sysfs_connector_add] adding "DP-1" to sysfs
[drm:drm_sysfs_hotplug_event] generating hotplug event
[drm:drm_dp_aux_register_devnode] drm_dp_aux_dev: aux [DPDDC-C] registered as minor 0
[drm] Initialized i915 1.6.0 20171222 for drmn0 on minor 0
[drm:drm_sysfs_hotplug_event] generating hotplug event
[drm:drm_mode_object_get] OBJ ID: 59 (3)
[drm:drm_mode_object_get] OBJ ID: 68 (1)
[drm:drm_mode_object_put] OBJ ID: 68 (2)
[drm:drm_mode_object_get] OBJ ID: 85 (1)
[drm:drm_mode_object_get] OBJ ID: 59 (5)
[drm:drm_mode_object_get] OBJ ID: 59 (6)
[drm:drm_mode_object_put] OBJ ID: 59 (6)
[drm:drm_mode_object_get] OBJ ID: 59 (5)
[drm:drm_calc_timestamping_constants] crtc 37: hwmode: htotal 2720, vtotal 1481, vdisplay 1440
[drm:drm_calc_timestamping_constants] crtc 37: clock 241500 kHz framedur 16680414 linedur 11262
[drm] Reducing the compressed framebuffer size. This may lead to less power savings than a non-reduced-size. Try to increase stolen memory size if available in BIOS.
[drm:drm_vblank_enable] enabling vblank on crtc 0, ret: 0
name=drmn0 flags=0x0 stride=10240 bpp=32
drmn0: fb0: inteldrmfb frame buffer device
[drm:drm_handle_vblank_events] vblank event on 5, current 5
[drm:drm_mode_object_put] OBJ ID: 68 (1)
[drm:drm_mode_object_get] OBJ ID: 85 (2)
[drm:drm_mode_object_put] OBJ ID: 59 (6)
[drm:drm_mode_object_put] OBJ ID: 59 (5)
[drm:vblank_disable_fn] disabling vblank on crtc 0
drmn0: successfully loaded firmware image with name: i915/kbl_dmc_ver1_04.bin
[drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4)
Everything looks fine, but I still do not have I2C.
I still believe something wrong with GMBus, maybe I wrong.
please help me to fix this problem.
 
OP
OP
V

Victor910

New Member


Messages: 12

Sorry Guys, maybe I'm in the wrong place? Can I have link wheres FreeBSD developers have the conversation?
I'm only 1 month with FreeBSD and don't know all forums address with FreeBSD professionals
 

Phishfry

Son of Beastie

Reaction score: 1,504
Messages: 4,347

I am wondering where you came up with gmbus being needed?

I am going to use this as an example:
vgapci0: child drmn0 requested pci_enable_io
You see that a child device drmn0 is requesting pci_enable_io.
The same will hold true for 'gmbus'
You want to load the top level device and it will load all the child devices. Like a 'gmbus'.

Here is another example.
When I kldload the APU2 gpio driver it automatically loads dependent devices, like gpiobus.

So look at the drm driver. It also loads iic and iicbb on my computer.
You need to load the correct top level device and the rest will come automatically.
If your device is not supported then you might have to do some manual loading.

For further help the freebsd-questions mailing list and freebsd-hackers list get lots of eyeballs.
 
OP
OP
V

Victor910

New Member


Messages: 12

OK, gmbus don't need.
Simple question, how to have access to DDC (I2C) under FreeBSD? Under Linux everything working perfectly under the same hardware. I believe you do not disappear before answer this simple question.
 

Phishfry

Son of Beastie

Reaction score: 1,504
Messages: 4,347

I think that roccobaroccoSC hit the nail on the head. You are missing the firmware, so the drm driver you are using is not correct.
Maybe your video device is not supported by FreeBSD.

I don't know much about iic and I myself am learning about iic trying to get touchscreen working.
Not sure how you have ig4 loaded as that is what I need for touchscreen.
 

roccobaroccoSC

Aspiring Daemon

Reaction score: 144
Messages: 600

Everything looks fine, but I still do not have I2C.
What does this mean? Can you be more specific?
You should use drm-kmod and you should have gpu-firmware-kmod installed. If that's the case, describe what exactly does not work yet and show dmesg and Xorg.0.log with errors.
 
OP
OP
V

Victor910

New Member


Messages: 12

drm-kmod and gpu-firmware-kmod have been installed.
I do not have Xorg on my system, don't need for me.
Ok I will try again will be more specific, after my system has been loaded, I must have I2C devices, but I don't have.
How you know, every video card includes I2C controller for purpose manage monitors.
My system, Freebsd 12, do not detect video card I2C controllers.
How to fix that?
Again,
my system FreeBSD 12
drm-kmod and gpu-firmware-kmod has been installed
My CPU Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
My videocard Intel HD Graphics 620


base on the information from the internet, I must have logs something like this when i2c has been detected:

Code:
kldload drm2.ko' yields the following in /var/log/messages:
drmn0: <Intel i965GM> on vgapci0
intel_iicbb0 on drmn0
iicbus0: <Philips I2C bus> on iicbb0 addr 0xf2
iic0: <I2C generic I/O> on iicbus0
iicbus1: <Philips I2C bus> on intel_gmbus0
iic1: <I2C generic I/O> on iicbus1
intel_iicbb1 on drmn0
iicbus2: <Philips I2C bus> on iicbb1 addr 0xf2
iic2: <I2C generic I/O> on iicbus2
iicbus3: <Philips I2C bus> on intel_gmbus1
iic3: <I2C generic I/O> on iicbus3
intel_iicbb2 on drmn0
iicbus4: <Philips I2C bus> on iicbb2 addr 0xf2
iic4: <I2C generic I/O> on iicbus4
iicbus5: <Philips I2C bus> on intel_gmbus2
iic5: <I2C generic I/O> on iicbus5
intel_iicbb3 on drmn0
iicbus6: <Philips I2C bus> on iicbb3 addr 0xf2
iic6: <I2C generic I/O> on iicbus6
iicbus7: <Philips I2C bus> on intel_gmbus3
iic7: <I2C generic I/O> on iicbus7
intel_iicbb4 on drmn0
iicbus8: <Philips I2C bus> on iicbb4 addr 0xf2
iic8: <I2C generic I/O> on iicbus8
iicbus9: <Philips I2C bus> on intel_gmbus4
iic9: <I2C generic I/O> on iicbus9
intel_iicbb5 on drmn0
This reported has to include I2C controllers from Video card.

My report doesn't have any I2C devices.


my kldstat again:


Code:
Id Refs Address                Size Name
 1   82 0xffffffff80200000  243d1f8 kernel
 2    1 0xffffffff8263e000     2da8 smb.ko
 3    5 0xffffffff82641000     2e18 smbus.ko
 4    1 0xffffffff82644000     3ca8 amdsmb.ko
 5    1 0xffffffff82648000     4c98 iicbb.ko
 6    6 0xffffffff8264d000     6cc8 iicbus.ko
 7    1 0xffffffff82654000     8910 ig4.ko
 8    1 0xffffffff8265e000     3950 iicsmb.ko
 9    1 0xffffffff82662000    185c8 bktr.ko
10    2 0xffffffff8267b000     1530 bktr_mem.ko
11    1 0xffffffff8267d000     3820 iic.ko
12    1 0xffffffff82681000     6230 ichsmb.ko
13    1 0xffffffff82821000   12cc50 i915kms.ko
14    1 0xffffffff8294e000    767d0 drm.ko
15    4 0xffffffff829c5000    104f0 linuxkpi.ko
16    3 0xffffffff829d6000    12f30 linuxkpi_gplv2.ko
17    2 0xffffffff829e9000      6c0 debugfs.ko
18    1 0xffffffff829ea000    15630 if_iwm.ko
19    1 0xffffffff82a00000   10045f iwm7260fw.ko
20    1 0xffffffff82b01000     3aa0 ng_ubt.ko
21    2 0xffffffff82b05000     a020 netgraph.ko
22    1 0xffffffff82b10000     9608 ng_hci.ko
23    1 0xffffffff82b1a000      9c0 ng_bluetooth.ko
24    1 0xffffffff82b1b000    17590 smbfs.ko
25    2 0xffffffff82b33000     3050 libiconv.ko
26    2 0xffffffff82b37000     1dce libmchain.ko
27    1 0xffffffff82b39000      acf mac_ntpd.ko

Ok. I believe I provide more than enough information, my problem showing clearly for everyone, and we don't start running around the circle.
 
Top