Modify

Opened 10 years ago

Closed 9 years ago

#2516 closed defect (fixed)

Selecting kmod-ide-aec62xx for a BCM947xx/953cc [2.6] target has no effect

Reported by: anonymous Owned by: developers
Priority: normal Milestone: Kamikaze 8.09 RC1
Component: kernel Version:
Keywords: Cc:

Description

This problem has been experienced independently by at least 3 persons. When trying to build an image for a WL-700gE using a 2.6 kernel, selecting the driver for the PATA device on the board has no effect. The driver is not built. This has been reported in the forums (http://forum.openwrt.org/viewtopic.php?id=12095) and on FreeSA (http://www.freesa.org/trac/wiki/BuildingAecModule) on which there is a workaround. There is no need to have a WL-700gE device to reproduce this problem.

To reproduce the issue (with revision 9285), choose the following options with menuconfig:

  • Target System (Broadcom BCM947xx/953xx [2.6])
  • Kernel modules ---> Block Devices ---> kmod-ide-aec62xx <*>
  • Kernel modules ---> Block Devices ---> kmod-ide-core <*>

Running make will build the images without incident. Checking the ".config" file in the kernel source directory will show that it was not configured to build the driver. There will be no "kmod-ide-aec62xx_2.6.23-brcm47xx-1_mipsel.ipk" package in bin/packages either:

~/kamikaze$ ls build_dir/linux-brcm47xx/linux-2.6.23/.config
build_dir/linux-brcm47xx/linux-2.6.23/.config
~/kamikaze$ grep AEC build_dir/linux-brcm47xx/linux-2.6.23/.config
~/kamikaze$ ls bin/packages/kmod* | more
bin/packages/kmod-diag_2.6.23-brcm47xx-2_mipsel.ipk
bin/packages/kmod-fs-ext3_2.6.23-brcm47xx-1_mipsel.ipk
bin/packages/kmod-ide-core_2.6.23-brcm47xx-1_mipsel.ipk
bin/packages/kmod-nls-base_2.6.23-brcm47xx-1_mipsel.ipk
bin/packages/kmod-nls-utf8_2.6.23-brcm47xx-1_mipsel.ipk
bin/packages/kmod-switch_2.6.23-brcm47xx-1_mipsel.ipk

To build the driver, the kernel has to be compiled manually:

export PATH=`pwd`/staging_dir/toolchain-mipsel_gcc4.1.2/bin:$PATH
cd build_dir/linux-brcm47xx/linux-2.6.23
ARCH=mips make menuconfig
ARCH=mips make

If the configuration recommendation on freesa.org (http://www.freesa.org/trac/wiki/AccessingTheHardDisk) have been followed then:

~/kamikaze/build_dir/linux-brcm47xx/linux-2.6.23$ grep AEC .config
CONFIG_BLK_DEV_AEC62XX=y

I am not familiar with the intricacies of buildroot-ng and therefore cannot provide a patch to solve the problem. Sorry.

Attachments (4)

aec62xx.patch (1.3 KB) - added by xaviour 10 years ago.
Build fix for aec62xx driver
aec62xx_boot.patch (3.1 KB) - added by xaviour 10 years ago.
Fix compilation and ugly hack to get the module loaded
aec62xx.2.patch (2.6 KB) - added by xaviour 10 years ago.
[Clean] Fix building and loading of aec62xx driver for WL-700gE.
aec62xx_boot.2.patch (1.4 KB) - added by xaviour 10 years ago.
[Ugly] Use hard drive as root filesystem on WL-700gE.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 10 years ago by anonymous

Studying the boot process reveals that OpenWRT calls the option "CONFIG_PACKAGE_kmod-ide-aec62xx" while Linux calls it "CONFIG_BLK_DEV_AEC62XX". The name of the kernel module itself (aec62xx.ko). The mapping is done in "package/kernel/modules/block.mk":

define KernelPackage/ide-aec62xx
  SUBMENU:=$(BLOCK_MENU)
  TITLE:=Acard AEC62xx IDE driver
  DEPENDS:=@PCI_SUPPORT
  KCONFIG:=CONFIG_BLK_DEV_AEC62XX
  FILES:=$(LINUX_DIR)/drivers/ide/pci/aec62xx.$(LINUX_KMOD_SUFFIX)
  AUTOLOAD:=$(call AutoLoad,30,aec62xx)
endef

define KernelPackage/ide-aec62xx/description
 Support for Acard AEC62xx (Artop ATP8xx) IDE controllers.
endef

$(eval $(call KernelPackage,ide-aec62xx))

The description of the package seams correct. Linux configuration files in "build_dir/linux-brcm47xx/linux-2.6.23/drivers/ide/Kconfig" matches:

config BLK_DEV_AEC62XX
        tristate "AEC62XX chipset support"
        help
          This driver adds explicit support for Acard AEC62xx (Artop ATP8xx)
          IDE controllers. This allows the kernel to change PIO, DMA and UDMA
          speeds and to configure the chip to optimum performance.

And the source file for the driver is also located where OpenWRT expects it:

~/kamikaze$ ls build_dir/linux-brcm47xx/linux-2.6.23/drivers/ide/pci/aec62xx.c
build_dir/linux-brcm47xx/linux-2.6.23/drivers/ide/pci/aec62xx.c

However building OpenWRT in verbose mode reveals the following:

make V=99
[...]
WARNING: kmod-ide-aec62xx is not available in the kernel config
[...]

Any idea what is going wrong?

comment:2 Changed 10 years ago by anonymous

By adding some tracing statements in "include/kernel-defaults.mk" as follows:

define Kernel/Configure/2.6
        echo kernel-default : Is the driver still here : `grep AEC /home/xdd/kamikaze/build_dir/linux-brcm47xx/linux-2.6.23/.config`
        -$(MAKE) $(KERNEL_MAKEOPTS) CC="$(KERNEL_CC)" oldconfig prepare scripts
        echo kernel-default : Is the driver still here : `grep AEC /home/xdd/kamikaze/build_dir/linux-brcm47xx/linux-2.6.23/.config`
endef

it was possible to find out that the driver is removed when doing "make oldconfig". To include the driver for aec62xx, some other parameters must be selected.

CONFIG_IDE
  CONFIG_BLK_DEV_IDE
  CONFIG_BLK_DEV_IDEPCI
  CONFIG_BLK_DEV_IDEDMA_PCI
    CONFIG_BLK_DEV_AEC62XX

The problem is double. First, in the configuration file "package/kernel/modules/block.mk", two of the options are missing.

~/kamikaze$ svn diff package/kernel/modules/block.mk
Index: package/kernel/modules/block.mk
===================================================================
--- package/kernel/modules/block.mk     (revision 9285)
+++ package/kernel/modules/block.mk     (working copy)
@@ -94,7 +94,7 @@
   SUBMENU:=$(BLOCK_MENU)
   TITLE:=Acard AEC62xx IDE driver
   DEPENDS:=@PCI_SUPPORT
-  KCONFIG:=CONFIG_BLK_DEV_AEC62XX
+  KCONFIG:=CONFIG_BLK_DEV_AEC62XX CONFIG_BLK_DEV_IDEDMA_PCI CONFIG_BLK_DEV_IDEPCI
   FILES:=$(LINUX_DIR)/drivers/ide/pci/aec62xx.$(LINUX_KMOD_SUFFIX)
   AUTOLOAD:=$(call AutoLoad,30,aec62xx)
 endef

Then some of the options cannot be selected as modules which means that the previous patch does not work. The options are ignored and the "oldconfig" process becomes interactive

.config:109:warning: symbol value 'm' invalid for BLK_DEV_IDEDMA_PCI
.config:111:warning: symbol value 'm' invalid for BLK_DEV_IDEPCI

After answering the different questions manually, the build process continues and "kmod-ide-aec62xx_2.6.23-brcm47xx-1_mipsel.ipk" ends up being built properly.

So, it remains to be found how to select a kernel option of type bool instead of tristate. This is not indicated in buildroot documentation (http://downloads.openwrt.org/docs/buildroot-documentation.html).

Changed 10 years ago by xaviour

Build fix for aec62xx driver

comment:3 Changed 10 years ago by xaviour

The file "scripts/metadata.pl" contains the solution to the problem:

        open FILE, "<$pkginfo" or return;
        while (<FILE>) {
                /^Package:\s*(.+?)\s*$/ and $package = $1;
                /^Kernel-Config:\s*(.+?)\s*$/ and do {
                        my @config = split /\s+/, $1;
                        foreach my $config (@config) {
                                my $val = 'm';
                                my $override;
                                if ($config =~ /^(.+?)=(.+)$/) {
                                        $config = $1;
                                        $override = 1;
                                        $val = $2;
                                }
                                if ($config{"CONFIG_PACKAGE_$package"} and ($config ne 'n')) {
                                        $kconfig{$config} = $val;
                                } elsif (!$override) {
                                        $kconfig{$config} or $kconfig{$config} = 'n';
                                }
                        }
                };
        };
        close FILE;

This snippet of code transform the configuration options that have been set in "block.mk" into the format used by the kernel configuration process. It is possible to append "=y" at the end of an option to avoid it being selected as a module. Another way to find the solution was to do:

grep KCONFIG package/kernel/modules/*.mk

But then a good night of sleep is usually needed to find the solution.

A patch has been added to this ticket. It solves the compilation issue. Testing on target will not be done before this weekend. The patch changes "block.mk" as expected plus "target/linux/brcm47xx/config-2.6.2" to avoid forcing interactive mode during the kernel configuration.

Changed 10 years ago by xaviour

Fix compilation and ugly hack to get the module loaded

comment:4 follow-up: Changed 10 years ago by xaviour

The patch has been split and cleaned up.

  • aec62xx.patch: is 100% functional. It creates a profile for the WL-700gE. It load the driver for the hard drive. It is up to the user to do something with it. It is candidate for merge.
  • aec62xx_boot.patch: is also functional. It works on top on the previous patch. It modifies "mount_root" to use the hard drive instead of "jffs". It should not be merged but is a good starting point for devices with an internal hard drive.

Changed 10 years ago by xaviour

[Clean] Fix building and loading of aec62xx driver for WL-700gE.

Changed 10 years ago by xaviour

[Ugly] Use hard drive as root filesystem on WL-700gE.

comment:5 in reply to: ↑ 4 Changed 10 years ago by anonymous

Replying to xaviour:

The patch has been split and cleaned up.

  • aec62xx.patch: is 100% functional. It creates a profile for the WL-700gE. It load the driver for the hard drive. It is up to the user to do something with it. It is candidate for merge.
  • aec62xx_boot.patch: is also functional. It works on top on the previous patch. It modifies "mount_root" to use the hard drive instead of "jffs". It should not be merged but is a good starting point for devices with an internal hard drive.

Trac would allow overwriting the old patches so the actual names are "aec62xx.2.patch" and "aec62xx_boot.2.patch".

comment:6 Changed 9 years ago by florian

  • Resolution set to fixed
  • Status changed from new to closed

This got fixed. I am not fond of automatic switching to the harddisk, and this needs a more generic way for people using usb sticks as well.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.