Hello,
I added a DM9000B device to my AT91SAM9260-ek board to the SMC/EBI controller on CS2 (almost identical to the to the AT91SAM9261-ek ethernet setup except the interrupt line is PB19 instead of PC11) but I'm having issues getting it to work. While loading the Linux kernel, I get these messages:
dm9000 Ethernet Driver, V1.31
dm9000 dm9000.0: read wrong id 0x2b012900
dm9000 dm9000.0: read wrong id 0x2b012900
...
dm9000 dm9000.0: wrong id: 0x2b2a2928
dm9000 dm9000.0: not found (-19).
Which signifies that the driver couldn't find the device. Upon further inspection, it seems as though the reads & writes are occurring, but they are not reaching the CS2 (address 0x30000000). So, I'm wondering if anyone had any previous experiences with the DM9000 on the AT91SAM926x or possibly might have some insight on the SMC/EBI interface. Is there any possibility that initializing it wrong would make this occur?
Thanks,
Jesse L. Zamora
Code from the board-at91sam9260-ek.c file for the DM9000:
...
#if defined(CONFIG_DM9000)
static struct resource dm9000_resource[] = {
[0] = {
.start = AT91_CHIPSELECT_2,
.end = AT91_CHIPSELECT_2 + 3,
.flags = IORESOURCE_MEM
},
[1] = {
.start = AT91_CHIPSELECT_2 + 0x44,
.end = AT91_CHIPSELECT_2 + 0xFF,
.flags = IORESOURCE_MEM
},
[2] = {
.start = AT91_PIN_PB19,
.end = AT91_PIN_PB19,
.flags = IORESOURCE_IRQ
}
};
static struct dm9000_plat_data dm9000_platdata = {
.flags = DM9000_PLATF_16BITONLY,
};
static struct platform_device dm9000_device = {
.name = "dm9000",
.id = 0,
.num_resources = ARRAY_SIZE(dm9000_resource),
.resource = dm9000_resource,
.dev = {
.platform_data = &dm9000_platdata,
}
};
/*
* SMC timings for the DM9000.
* Note: These timings were calculated for MASTER_CLOCK = 100000000 according to the DM9000 timings.
*/
static struct sam9_smc_config __initdata dm9000_smc_config = {
.ncs_read_setup = 0,
.nrd_setup = 2,
.ncs_write_setup = 0,
.nwe_setup = 2,
.ncs_read_pulse = 16,
.nrd_pulse = 8,
.ncs_write_pulse = 16,
.nwe_pulse = 8,
.read_cycle = 16,
.write_cycle = 16,
.mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_BAT_WRITE | AT91_SMC_DBW_16,
.tdf_cycles = 1,
};
static void __init ek_add_device_dm9000(void)
{
/* Intialize dm9000 on chip select 2 */
sam9_smc_configure(2, &dm9000_smc_config);
/* Is this necessary? Currently the reset pin doesn't seem to do anything.... */
//at91_set_gpio_output(AT91_PIN_PC10, 0);
/* Initialize the PB19 interrupt */
at91_set_gpio_input(AT91_PIN_PB19, 0);
platform_device_register(&dm9000_device);
}
#else
static void __init ek_add_device_dm9000(void) {}
#endif
...
static void __init ek_board_init(void)
{
...
/* DM9000 ethernet */
ek_add_device_dm9000();
...
}