From: paulo@nlink.com.br (Paulo Fragoso)
To: linux-arm-kernel@lists.infradead.org
Subject: External serial 8250/16550
Date: Sun, 24 Apr 2011 12:57:55 -0300 [thread overview]
Message-ID: <4DB44883.3000608@nlink.com.br> (raw)
Hi,
I was called for help to add a external serial using a board based on
at91sam9g45, was useded chip TL16c2550 conected on EBI1_D[0-7] for data
and EBI_A[0-2] for address register.
There are two UART in this chip which will be select by EBI1_NCS1 and
PC13/NCS2
I'm trying to register this uart in this way:
static struct plat_serial8250_port tms_serial_data[] = {
PORT(0x70000000, AT91_PIN_PC0),
PORT(0x80000000, AT91_PIN_PC1),
{ },
};
static struct platform_device tms_serial_device = {
.name = "serial8250",
.id = -1,
.dev =
{
.platform_data = &tms_serial_data,
},
};
static void tms_add_device_serial(void)
{
at91_sys_write(AT91_SMC_CSR(1),
AT91_SMC_ACSS_STD
| AT91_SMC_DBW_8
| AT91_SMC_BAT
| AT91_SMC_WSEN
| AT91_SMC_NWS_(32) /* wait states */
| AT91_SMC_RWSETUP_(6) /* setup time */
| AT91_SMC_RWHOLD_(4) /* hold time */
);
at91_sys_write(AT91_SMC_CSR(2),
AT91_SMC_ACSS_STD
| AT91_SMC_DBW_8
| AT91_SMC_BAT
| AT91_SMC_WSEN
| AT91_SMC_NWS_(32) /* wait states */
| AT91_SMC_RWSETUP_(6) /* setup time */
| AT91_SMC_RWHOLD_(4) /* hold time */
);
platform_device_register(&tms_serial_device);
}
//#endif
static void __init ek_map_io(void)
{
/* Initialize processor: 12.000 MHz crystal */
at91sam9g45_initialize(12000000);
/* DGBU on ttyS0. (Rx & Tx only) */
at91_register_uart(0, 0, 0);
/* USART0 on ttyS2. (Rx, Tx, RTS, CTS) - Used by smartcard */
at91_register_uart(AT91SAM9G45_ID_US0, 2, ATMEL_UART_CTS | ATMEL_UART_RTS);
/* USART1 on ttyS1. (Rx, Tx, RTS, CTS) */
at91_register_uart(AT91SAM9G45_ID_US1, 1, ATMEL_UART_CTS | ATMEL_UART_RTS);
/* set serial console to ttyS0 (ie, DBGU) */
at91_set_serial_console(0);
/* antes: at91_init_serial(&tms_uart_config); */
/* how to map IO */
}
static void __init ek_board_init(void)
{
/* Serial */
at91_add_device_serial();
...
/* External Serial */
tms_add_device_serial();
}
But doesn't work, how to map correctly external serial port?
Is there any sample code for external uart using linux-2.6.36 and arm
AT91SAM9?
Thanks.
Paulo.
next reply other threads:[~2011-04-24 15:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-24 15:57 Paulo Fragoso [this message]
2011-04-26 16:39 ` External serial 8250/16550 Andrew Victor
2011-05-06 12:57 ` Paulo Fragoso
2011-05-10 3:24 ` Paulo Fragoso
2011-05-12 2:23 ` Paulo Fragoso
2011-05-19 20:13 ` Paulo Fragoso
2011-05-24 4:31 ` Paulo Fragoso
2011-05-24 13:46 ` Christian Gagneraud
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DB44883.3000608@nlink.com.br \
--to=paulo@nlink.com.br \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.