LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Loading radeon KMS from an initrd (https://www.linuxquestions.org/questions/slackware-14/loading-radeon-kms-from-an-initrd-874196/)

adamk75 04-10-2011 08:48 PM

Loading radeon KMS from an initrd
 
I'm trying to get radeon to load early from an initrd, and have created an initrd with radeon, drm, ttm and drm_kms_helper modules, as well as the radeon firmware under /lib/firmware/radeon/.

About 5 seconds into the boot process, the radeon drm is loaded, but the boot hangs for nearly a minute as it tries to load the firmware and then error out. I checked on #radeon, and Dave Airlie says that udev is needed, but I did build the initrd with the -u option, which includes udev. And, after expanding the created initrd, I see the radeon and drm modules, the firmware, and udev.

I know this can work, as I've seen it on Fedora, opensuse, and Ubuntu. And, in fact, Dave said "that stuff just works on most distros".

Does anyone have any pointers on how to get this working?

Adam

andrewthomas 04-11-2011 02:17 PM

Is your firmware in the kernel?

Code:

#
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH=""
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
# CONFIG_STANDALONE is not set
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE="radeon/R600_rlc.bin amd-ucode/microcode_amd.bin"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"


adamk75 04-11-2011 02:24 PM

I'm trying this on 2.6.37.6 generic from -current. So this is that section of the config file.

Code:

CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""

I have not set CONFIG_EXTRA_FIRMWARE or CONFIG_EXTRA_FIRMWARE_DIR. The point of adding the firmware to the initrd is so that you can load radeon from the same initrd without needing the firmware to be compiled into the kernel.

Adam

andrewthomas 04-11-2011 08:33 PM

I don't see why it won't work for you.

I just made an initrd for the generic-2.6.38.2 kernel using

Code:

mkinitrd -c -k 2.6.38.2 -f ext4 -r /dev/sda14 -m ext4 -u
and my microcode loaded just fine.

adamk75 04-11-2011 08:40 PM

Well, according to that, you're not adding the radeon kernel module to the initrd. Which is my goal, here.

Adam

willysr 04-11-2011 08:49 PM

AFAIK, initrd is required to load additional modules required to boot since the generic kernel only support EXT2. That's why in most cases, initrd is used to load EXT3/EXT4/Reiserfs or any other filesystems, not modules which will be loaded automatically by the kernel

adamk75 04-12-2011 04:28 AM

Quote:

Originally Posted by willysr (Post 4321658)
AFAIK, initrd is required to load additional modules required to boot since the generic kernel only support EXT2. That's why in most cases, initrd is used to load EXT3/EXT4/Reiserfs or any other filesystems, not modules which will be loaded automatically by the kernel

And it can be used to load any number of other modules, such as radeon. This is why, for example, Fedora and OpenSUSE, switch to a KMS driven framebuffer within just three or four seconds of booting. I'm just trying to figure out how to accomplish this. I could, of course, just recompile the kernel and add the radeon drm and firmware directly to the kernel, but that's what I'm trying to avoid by using an initrd.

Adam

rworkman 04-12-2011 12:55 PM

I know this *can* work, Adam, as I did it on one of my systems with an ATI chipset. It was back when we were still heavily testing all of the KMS stuff, and that system is long wiped, but I'll look into doing it again just for you :-)
I know for my T400 (which doesn't require firmware), it's as simple as this in mkinitrd.conf:
Code:

MODULE_LIST="ext4:intel_agp:drm:i915"

adamk75 04-12-2011 01:14 PM

Well, don't worry about it too much. I'll just recompile the kernel with the firmware and radeon driver compiled in if it comes down to it :-)

Adam

rworkman 06-05-2011 11:24 PM

I messed with this quite a bit, and I don't know what's going wrong, but I can't get it to work either any more... :/

rvdboom 08-07-2011 04:30 AM

How do you add the firmware files to the initrd?
I'm trying to compile a 3.0.1 kernel and put in the radeon driver so I don't have to bother about the module itself, but I'd be interested in having the firmware loaded without building them in the kernel.

adamk75 08-07-2011 07:31 AM

Well, that's kind of the point of this thread... I never got it to work and, apparently, neither did rworkman.

Besides, if the radeon DRM driver is compiled into the kernel, the firmware needs to be as well.

Adam

rvdboom 08-08-2011 12:31 AM

Ah, I didn't know that.
OK, thanks, I'll go for inclusion in the kernel then.

the3dfxdude 08-08-2011 08:26 AM

rvdboom, I am able to just modprobe it in rc.local:
### Radeon KMS
modprobe radeon
modprobe fbcon

So if you don't want to recompile, try that.

Richa7d 08-16-2011 03:24 PM

Has anyone managed to get this working? I mean as in a solution to Adam's original post?

I was trying to get kms to load early, with the goal of having a native resolution frambuffer at boot. For now I have settled on compiling it into the kernel as per Andrew's post but never the less I can't seem to let this go :).

Quote:

Dave Airlie says that udev is needed, but I did build the initrd with the -u option, which includes udev
I read that udev needs to be available before the module is loaded. ???

So I edited the init script in initrd-tree, moving the udev lines before loading the modules. That seems to have made a difference but not solved the problem. Does this shed any light on things?


All times are GMT -5. The time now is 03:34 AM.