Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Compile Firmware into Kernel (SOLVED)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
ustone
n00b
n00b


Joined: 13 Mar 2012
Posts: 22

PostPosted: Wed Mar 14, 2012 9:06 pm    Post subject: Compile Firmware into Kernel (SOLVED) Reply with quote

I have a question regarding this option in kernel configuration...

Where are the firmware-files stored by genkernel? directly in the kernel file? i ask because i tried to upgrade the kernel, but with same firmware-files like in the old config in /var/log/dmsg exists "no file found" or similiar regarding the specified files...now i'm unsure, if the really stored in the kernel, or will they be used from filesystem? Or maybe from initramfs?


Last edited by ustone on Fri Mar 16, 2012 10:47 am; edited 1 time in total
Back to top
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Thu Mar 15, 2012 12:12 am    Post subject: Reply with quote

ustone,

As far as I know the firmware file is built directly into your binary kernel image.

There's some info on it here http://cateee.net/lkddb/web-lkddb/EXTRA_FIRMWARE.html
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21633

PostPosted: Thu Mar 15, 2012 1:45 am    Post subject: Reply with quote

The files are not stored by genkernel. The kernel build process will read them from the local filesystem and embed them in the generated kernel binary.
Back to top
View user's profile Send private message
Kaso_da_Zmok
Apprentice
Apprentice


Joined: 19 Aug 2004
Posts: 189
Location: Zurich, Switzerland

PostPosted: Thu Mar 15, 2012 1:52 am    Post subject: Reply with quote

check here?
Code:
$ ls /lib/firmware/

maybe you removed this in the process and now the files are not there anymore:
Code:
* sys-kernel/linux-firmware
     Available versions:  20110731 (~)20110818 20120125 (~)20120219 **99999999 {savedconfig}
     Homepage:            http://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git
     Description:         Linux firmware files
Back to top
View user's profile Send private message
Deathwing00
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Thu Mar 15, 2012 9:19 am    Post subject: Reply with quote

Moved from Installing Gentoo to Kernel & Hardware.
Back to top
View user's profile Send private message
ustone
n00b
n00b


Joined: 13 Mar 2012
Posts: 22

PostPosted: Thu Mar 15, 2012 7:39 pm    Post subject: Reply with quote

Thanx for clarify this.

firmware files are still in /firmware/lib/radeon

The problem maybe caused by wrong firmware for my ati card....

let me explain:

in kernel 3.2.1-gentoo-r2 i used the ati TURKS firmware which worked well..

in kernel 3.2.11 i used the same and i got the file not found error, but strange not for TURKS, but for another (can't remember and log files are lost, was beginning with B)..even if on boot "Loading TURKS" were displayed..


i was thinking maybe another firmware was used in older kernel, because in the beginning i wrote all existing firmwarefiles into kernel config, but the last compiled working 3.2.1 kernel i used was only with TURKS...

is this the correct driver for my card or is there any kind of "display used firmware" problem in 3.2.1?

lspci | grep VGA
01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Whistler XT [AMD Radeon HD 6700M Series]

i'm confused....

ps: thanx for your answeres: i use gentoo since 4 weeks and the community here is great...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54237
Location: 56N 3W

PostPosted: Thu Mar 15, 2012 8:28 pm    Post subject: Reply with quote

ustone,

Some firmware is distributed with the kernel. It can be found in /usr/src/linux/firmware.
Yet more firmware is contained in the linux-firmware package. This installs its payload into /lib/firmware.
Its huge but its size can be contaned by setting up its config file, so only some files are actually installed.

I don't know the files your card needs but dmesg will tell you, one file at a time about any files that can't be found.

The firmware files are embedded in the kernel binary. You will need to tell the kernel which files you want and where they are located.

Under Generic Driver Options, you need something like this
Code:
(/sbin/hotplug) path to uevent helper                   
  │ │ [ ] Maintain a devtmpfs filesystem to mount at /dev               
  │ │ [*] Select only drivers that don't need compile-time external firmware   
  │ │ [*] Prevent firmware from being built                                                                   
  │ │ -*- Userspace firmware loading support                                         
  │ │ [ ]   Include in-kernel firmware blobs in kernel binary   
  │ │ (rtl_nic/rtl8168e-2.fw radeon/PALM_pfp.bin radeon/PALM_me.bin radeon/SUMO_rlc.bin) External firmware blobs to build into the kernel binary   
  │ │ (/lib/firmware/) Firmware blobs root directory

Look at the last tine. This tells the kernel where to look for the firmware that is to be included.
The linle above the last line is a space separated list of file names to include, relative to the
Code:
Firmware blobs root directory
entry

The above is taken from my media player. You will need to fix those last two entries to suit your video card.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Kaso_da_Zmok
Apprentice
Apprentice


Joined: 19 Aug 2004
Posts: 189
Location: Zurich, Switzerland

PostPosted: Thu Mar 15, 2012 9:59 pm    Post subject: Reply with quote

your ATI 6700M Whistler uses TURKS

This should do:
Code:
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE="radeon/TURKS_mc.bin radeon/TURKS_me.bin radeon/TURKS_pfp.bin"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"


assuming the files are where expected
Code:

risko@phenomx6 ~ $ ls -l /lib/firmware/radeon/TURKS_*
-rw-r--r-- 1 root root 24096 Feb 24 21:48 /lib/firmware/radeon/TURKS_mc.bin
-rw-r--r-- 1 root root  5504 Feb 24 21:48 /lib/firmware/radeon/TURKS_me.bin
-rw-r--r-- 1 root root  4480 Feb 24 21:48 /lib/firmware/radeon/TURKS_pfp.bin
Back to top
View user's profile Send private message
ustone
n00b
n00b


Joined: 13 Mar 2012
Posts: 22

PostPosted: Fri Mar 16, 2012 7:35 am    Post subject: Reply with quote

hmmm...

Code:


ls -l /lib/firmware/radeon/TURKS_*
-rw-r--r-- 1 root root 24096 Mar  2 23:39 /lib/firmware/radeon/TURKS_mc.bin
-rw-r--r-- 1 root root  5504 Mar  2 23:39 /lib/firmware/radeon/TURKS_me.bin
-rw-r--r-- 1 root root  4480 Mar  2 23:39 /lib/firmware/radeon/TURKS_pfp.bin

Code:



 grep  -C 3 CONFIG_EXTRA_FIRMWARE /usr/src/linux-3.2.11-gentoo/.config
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE="radeon/TURKS_mc.bin radeon/TURKS_me.bin radeon/TURKS_pfp.bin"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware/"
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set

any other suggestions?
Back to top
View user's profile Send private message
Kaso_da_Zmok
Apprentice
Apprentice


Joined: 19 Aug 2004
Posts: 189
Location: Zurich, Switzerland

PostPosted: Fri Mar 16, 2012 7:43 am    Post subject: Reply with quote

maybe this can make the difference:
try to change this:
Code:
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware/"

to this:
Code:
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"
Back to top
View user's profile Send private message
ustone
n00b
n00b


Joined: 13 Mar 2012
Posts: 22

PostPosted: Fri Mar 16, 2012 8:03 am    Post subject: Reply with quote

ok....iirc i have read that the last / in path is importand...but i'll try...

additional info: its strange that turks is trying to load but missing radeon/BTC_rlc.bin??

Code:


cat /var/log/dmesg | sed -ne "348,375p"


drm] initializing kernel modesetting (TURKS 0x1002:0x6740 0x1028:0x04A3).
[drm] register mmio base: 0xE3820000
[drm] register mmio size: 131072
ATOM BIOS: Dell
radeon 0000:01:00.0: VRAM: 1024M 0x0000000000000000 - 0x000000003FFFFFFF (1024M used)
radeon 0000:01:00.0: GTT: 512M 0x0000000040000000 - 0x000000005FFFFFFF
[drm] Detected VRAM RAM=1024M, BAR=256M
[drm] RAM width 128bits DDR
[TTM] Zone  kernel: Available graphics memory: 4070636 kiB.
[TTM] Zone   dma32: Available graphics memory: 2097152 kiB.
[TTM] Initializing pool allocator.
[drm] radeon: 1024M of VRAM memory ready
[drm] radeon: 512M of GTT memory ready.
[drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
[drm] Driver supports precise vblank timestamp query.
radeon 0000:01:00.0: irq 41 for MSI/MSI-X
radeon 0000:01:00.0: radeon: using MSI.
[drm] radeon: irq initialized.
[drm] GART: num cpu pages 131072, num gpu pages 131072
[drm] Loading TURKS Microcode
Refined TSC clocksource calibration: 2195.014 MHz.
Switching to clocksource tsc
ni_cp: Failed to load firmware "radeon/BTC_rlc.bin"
[drm:evergreen_startup] *ERROR* Failed to load firmware!
radeon 0000:01:00.0: disabling GPU acceleration
radeon 0000:01:00.0: ffff880220421800 unpin not necessary
radeon 0000:01:00.0: ffff880220421800 unpin not necessary
[drm:evergreen_init] *ERROR* radeon: MC ucode required for NI+.

Back to top
View user's profile Send private message
Kaso_da_Zmok
Apprentice
Apprentice


Joined: 19 Aug 2004
Posts: 189
Location: Zurich, Switzerland

PostPosted: Fri Mar 16, 2012 8:14 am    Post subject: Reply with quote

what happens if you add the BTC to kernel?

Code:
[drm] Loading TURKS Microcode
Refined TSC clocksource calibration: 2195.014 MHz.
Switching to clocksource tsc
ni_cp: Failed to load firmware "radeon/BTC_rlc.bin"


it looks like turks is loaded , only the BTC is missing. the trailing slash '/' in the /lib/firmware/ you don't need to try without it, it is not causing the problem.
Back to top
View user's profile Send private message
ustone
n00b
n00b


Joined: 13 Mar 2012
Posts: 22

PostPosted: Fri Mar 16, 2012 8:44 am    Post subject: Reply with quote

:D too late i tried the slash and it doesn't solve the problem :-)

adding btc solve the problem....but i don't understand why in 3.2.1-rc1 this was not neccessary....

btw...what means btc?
Back to top
View user's profile Send private message
Kaso_da_Zmok
Apprentice
Apprentice


Joined: 19 Aug 2004
Posts: 189
Location: Zurich, Switzerland

PostPosted: Fri Mar 16, 2012 10:58 am    Post subject: Reply with quote

AMD Fusion Chipset uses BTC_rlc.bin, what is the laptop model you have there?

don't know what BTC stands for.
the card was not working without the BTC ?
Back to top
View user's profile Send private message
ustone
n00b
n00b


Joined: 13 Mar 2012
Posts: 22

PostPosted: Fri Mar 16, 2012 11:29 am    Post subject: Reply with quote

dell precision m4600

strange for me was:

a couple of weeks ago i compiled kernel 3.2.1-rc2 and had problems..i tried all radeon firmware files and that worked..later is deleted all other firmware but turks and it worked too...this i can't explain...
this week i tried kernel 3.2.11 with same firmware config as 3.2.1 and it didn't worked...

so to your question:

it worked in 3.2.1-rc2 w/o btc and in 3.2.11 not......i have to reproduce that with a clean build in 3.2.1-rc2
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum