|
CptTitanic, thanks for your advices. For now I has not finished my PCB design, I can not confirm this error is because of 16c554 chip's missing. I am designing PCB now, and I will test it again on the new board with this chip.
halliday, Have you solved your problem? congrarulation! If you have not solved it, here is the 8250_..._st16c554.c I copied from internet, I hope it is helpful for you.
#include <linux/module.h> #include <linux/init.h> #include <linux/serial_8250.h> #include <mach/gpio.h> #include <mach/at91sam9_smc.h> #include <../sam9_smc.h>
#define XR16V554_BASE1 (AT91_CHIPSELECT_2 + 0X00) //Base address of USART0 #define XR16V554_BASE2 (AT91_CHIPSELECT_2 + 0X08) #define XR16V554_BASE3 (AT91_CHIPSELECT_2 + 0X10) #define XR16V554_BASE4 (AT91_CHIPSELECT_2 + 0X18)
#define XR16V554_IRQ1 AT91_PIN_PB19 #define XR16V554_IRQ2 AT91_PIN_PB20 #define XR16V554_IRQ3 AT91_PIN_PB21 #define XR16V554_IRQ4 AT91_PIN_PB22
/* Tuned for MCLK=100MHZ also applied for MCLK=133MHZ */ static struct sam9_smc_config __initdata ek_xr16v554_smc_config = { .ncs_read_setup = 0, .nrd_setup = 2, .ncs_write_setup = 0, .nwe_setup = 2,
.ncs_read_pulse = 16, /* min 40ns */ .nrd_pulse = 12, /* min 40ns */ .ncs_write_pulse = 16, .nwe_pulse = 12,
.read_cycle = 18, .write_cycle = 18,
.mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_DBW_8, .tdf_cycles = 10, };
#define PORT(_base,_irq) \ { \ .mapbase = _base, \ .irq = _irq, \ .uartclk = 7372800, \ .iotype = UPIO_MEM, \ .regshift = 0, \ .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,\ }
static struct plat_serial8250_port exar_data[] = { PORT(XR16V554_BASE1, XR16V554_IRQ1), PORT(XR16V554_BASE2, XR16V554_IRQ2), PORT(XR16V554_BASE3, XR16V554_IRQ3), PORT(XR16V554_BASE4, XR16V554_IRQ4), { }, };
static struct platform_device exar_device = { .name = "serial8250", .id = PLAT8250_DEV_AT91_XR16V554, .dev = { .platform_data = &exar_data, }, };
static int __init exar_init(void) { /* Set the inerrupt pin to gpio and enable pullup. */ at91_set_GPIO_periph(AT91_PIN_PB19, 1); at91_set_GPIO_periph(AT91_PIN_PB20, 1); at91_set_GPIO_periph(AT91_PIN_PB21, 1); at91_set_GPIO_periph(AT91_PIN_PB22, 1);
/* Enable input and pullup. */ at91_set_gpio_input(AT91_PIN_PB19, 1); at91_set_gpio_input(AT91_PIN_PB20, 1); at91_set_gpio_input(AT91_PIN_PB21, 1); at91_set_gpio_input(AT91_PIN_PB22, 1);
/* Enable glitch. */ at91_set_deglitch(AT91_PIN_PB19, 1); at91_set_deglitch(AT91_PIN_PB20, 1); at91_set_deglitch(AT91_PIN_PB21, 1); at91_set_deglitch(AT91_PIN_PB22, 1);
/* Set up the 8-bit bus */ /* configure chip-select 2 (XR16V554D) */ sam9_smc_configure(2, &ek_xr16v554_smc_config);
printk("8250_at91_xr16v554 device register!\n");
return platform_device_register(&exar_device); }
module_init(exar_init);
|