This is the NIC Driver.
This cost me a lot of time.
I first use the driver that comes with dm9000, then compile, download, load and execute. When the NIC Driver is loaded (enable the NIC, IP-config), the following message is displayed:
Dm9000 Ethernet driver, v1.31
Then wait.
When I check the normal start process, the next step is to print a message in probe, that is, the dm9000 registration is successful, similar:
Eth0: dm9000a at c8858000, c885c400 IRQ 185 Mac: AA: BB: CC: DD: EE: FF (CHIP)
But none of them. I'm a little surprised. Why didn't probe be executed?
For a long time, I first suspected that there was a problem with the driver in the new kernel. According to the old dm9000 driver in the kernel, I modified some, that is, I initialized the MAC address, then, change the read MAC address from the eeprom to a dead address value. Or not.
Then, replace the old driver directly. Many compilation problems are encountered, such as the most obvious one:
// Board_info_t * DB = (board_info_t *) Dev-> priv;
Board_info_t * DB = netdev_priv (Dev); // rings WPL add
The above is the old code, which needs to be changed to the following, similar to many here, which needs to be modified one by one. Of course there are other problems, which are similar.
After this change, it will not work.
Think carefully.
Think carefully.
About one day.
Think of the time when the driver is initialized, the so-called interrupt, base address and other resources. Then remember there should be a place to initialize, of course think of linux-03.00.01.06_baegle/ARCH/ARM/mach-omap2/board-omap3beagle.c
Beagle was used to access this file, and some items were not added, for example:
# Define omap_dm9000_gpio_irq 25
Static void _ init omap_dm9000_init (void)
{
If (gpio_request (omap_dm9000_gpio_irq, "dm9000 IRQ") <0 ){
Printk (kern_err "failed to request gpio % d For dm9000 IRQ/N ",
Omap_dm9000_gpio_irq );
Return;
}
Gpio_direction_input (omap_dm9000_gpio_irq );
}
The origin is omap3_beagle_init_irq. At the end, add the omap_dm9000_init () call.
This is an interruption.
Resources, first:
Static struct platform_device * omap3_beagle_devices [] _ initdata = {
& Omap3_beagle_ LCD _device,
& Amp; leds_gpio,
& Keys_gpio,
& Omap_dm9000_dev, // WPL add
};
Involved:
Static struct platform_device omap_dm9000_dev = {
. Name = "dm9000 ",
. ID =-1,
. Num_resources = array_size (omap_dm9000_resources ),
. Resource = omap_dm9000_resources,
. Dev = {
. Platform_data = & omap_dm9000_platdata,
},
};
This involves:
Static struct resource omap_dm9000_resources [] = {
[0] = {
. Start = omap_dm9000_base,
. End = (omap_dm9000_base + 0x4-1 ),
. Flags = ioresource_mem,
},
[1] = {
. Start = (omap_dm9000_base + 0x400 ),
. End = (omap_dm9000_base + 0x400 + 0x4-1 ),
. Flags = ioresource_mem,
},
[2] = {
. Start = omap_gpio_irq (omap_dm9000_gpio_irq ),
. End = omap_gpio_irq (omap_dm9000_gpio_irq ),
. Flags = ioresource_irq | ir1__trigger_low,
},
};
If the error message "irqf_trigger_low" is returned, add the following error:
# Include <Linux/dm9000.h>
# Include <Linux/interrupt. h>
Then, compile it.