Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 281911
b: refs/heads/master
c: 8612bd2
h: refs/heads/master
i:
  281909: 8bd4b92
  281907: 01f5176
  281903: 5c34195
v: v3
  • Loading branch information
Govindraj.R authored and Kevin Hilman committed Dec 15, 2011
1 parent 0e52d0f commit 178c3d2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 969996a57fd2345a1141280dddcf9e10fa5f6690
refs/heads/master: 8612bd22f30369745d0fda0d540aca39ab591cc5
51 changes: 25 additions & 26 deletions trunk/arch/arm/mach-omap2/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ struct omap_uart_state {

static LIST_HEAD(uart_list);
static u8 num_uarts;
static u8 console_uart_id = -1;

#define DEFAULT_RXDMA_POLLRATE 1 /* RX DMA polling rate (us) */
#define DEFAULT_RXDMA_BUFSIZE 4096 /* RX DMA buffer size */
Expand Down Expand Up @@ -264,12 +265,20 @@ static void omap_serial_fill_default_pads(struct omap_board_data *bdata)
static void omap_serial_fill_default_pads(struct omap_board_data *bdata) {}
#endif

char *cmdline_find_option(char *str)
{
extern char *saved_command_line;

return strstr(saved_command_line, str);
}

static int __init omap_serial_early_init(void)
{
do {
char oh_name[MAX_UART_HWMOD_NAME_LEN];
struct omap_hwmod *oh;
struct omap_uart_state *uart;
char uart_name[MAX_UART_HWMOD_NAME_LEN];

snprintf(oh_name, MAX_UART_HWMOD_NAME_LEN,
"uart%d", num_uarts + 1);
Expand All @@ -284,18 +293,22 @@ static int __init omap_serial_early_init(void)
uart->oh = oh;
uart->num = num_uarts++;
list_add_tail(&uart->node, &uart_list);

/*
* NOTE: omap_hwmod_setup*() has not yet been called,
* so no hwmod functions will work yet.
*/

/*
* During UART early init, device need to be probed
* to determine SoC specific init before omap_device
* is ready. Therefore, don't allow idle here
*/
uart->oh->flags |= HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET;
snprintf(uart_name, MAX_UART_HWMOD_NAME_LEN,
"%s%d", OMAP_SERIAL_NAME, uart->num);

if (cmdline_find_option(uart_name)) {
console_uart_id = uart->num;
/*
* omap-uart can be used for earlyprintk logs
* So if omap-uart is used as console then prevent
* uart reset and idle to get logs from omap-uart
* until uart console driver is available to take
* care for console messages.
* Idling or resetting omap-uart while printing logs
* early boot logs can stall the boot-up.
*/
oh->flags |= HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET;
}
} while (1);

return 0;
Expand Down Expand Up @@ -379,20 +392,6 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,

oh->dev_attr = uart;

console_lock(); /* in case the earlycon is on the UART */

/*
* Because of early UART probing, UART did not get idled
* on init. Now that omap_device is ready, ensure full idle
* before doing omap_device_enable().
*/
omap_hwmod_idle(uart->oh);

omap_device_enable(uart->pdev);
omap_device_idle(uart->pdev);

console_unlock();

if ((cpu_is_omap34xx() || cpu_is_omap44xx()) && bdata->pads)
device_init_wakeup(&pdev->dev, true);
}
Expand Down

0 comments on commit 178c3d2

Please sign in to comment.