login
Header Space

 
 

Re: [PATCH 18/56] microblaze_v2: early_printk support

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <monstr@...>
Cc: <linux-kernel@...>, <arnd@...>, <linux-arch@...>, <stephen.neuendorffer@...>, <John.Linn@...>, <matthew@...>, <will.newton@...>, <drepper@...>, <microblaze-uclinux@...>, <grant.likely@...>, Michal Simek <monstr@...>
Date: Monday, May 5, 2008 - 7:22 pm

On Sun, 2008-05-04 at 13:41 +0200, monstr@seznam.cz wrote:



The while() loop needs a retry counter - if you configure
EARLY_PRINTK_BASE_ADDRESS wrongly and it points to memory or anything
that is not a uartlite, the loop spins forever and you get silent
lockup.  Not nice behaviour from debug code :)

Here's my current implementation:

static void early_printk_putc(char c)
{
        /* Limit how many times we'll spin waiting for TX FIFO status.
           This will prevent lockups if the base address is incorrectly
set, or
           any other issue on the UARTLITE.

           This limit is pretty arbitrary, unless we are at about 10
baud 
           we'll never timeout on a working UART. */

        unsigned retries=10000;
        while (retries-- && (ioread32(STATUS) & (1<<3)))
                ;

        /* Only attempt the iowrite if we didn't timeout */
        if(retries)
                iowrite32((c & 0xff), TX_FIFO);
}

Cheers

John


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Microblaze patches V2, , (Sun May 4, 7:40 am)
Re: [PATCH 01/56] microblaze_v2: Kconfig patches, Grant Likely, (Sun May 4, 5:24 pm)
Re: [PATCH 01/56] microblaze_v2: Kconfig patches, Michal Simek, (Mon May 5, 2:36 am)
RE: [microblaze-uclinux] [PATCH 04/56] microblaze_v2: Open f..., Stephen Neuendorffer, (Wed May 7, 12:04 pm)
RE: [microblaze-uclinux] [PATCH 04/56] microblaze_v2: Open f..., Stephen Neuendorffer, (Wed May 7, 4:14 pm)
RE: [PATCH 04/56] microblaze_v2: Open firmware files, Stephen Neuendorffer, (Mon May 5, 5:56 pm)
Re: [PATCH 04/56] microblaze_v2: Open firmware files, Michal Simek, (Tue May 6, 3:27 am)
Re: [PATCH 04/56] microblaze_v2: Open firmware files, Grant Likely, (Mon May 5, 10:24 am)
RE: [PATCH 07/56] microblaze_v2: Signal support, Stephen Neuendorffer, (Mon May 5, 5:32 pm)
RE: [PATCH 07/56] microblaze_v2: Signal support, John Williams, (Mon May 5, 7:33 pm)
RE: [PATCH 07/56] microblaze_v2: Signal support, Stephen Neuendorffer, (Mon May 5, 8:13 pm)
RE: [PATCH 07/56] microblaze_v2: Signal support, John Williams, (Mon May 5, 8:25 pm)
RE: [PATCH 07/56] microblaze_v2: Signal support, Stephen Neuendorffer, (Mon May 5, 8:33 pm)
Re: [PATCH 07/56] microblaze_v2: Signal support, Michal Simek, (Tue May 6, 5:41 am)
RE: [PATCH 09/56] microblaze_v2: cache support, Stephen Neuendorffer, (Mon May 5, 6:37 pm)
RE: [microblaze-uclinux] [PATCH 09/56] microblaze_v2: cache ..., Stephen Neuendorffer, (Mon May 5, 1:37 pm)
RE: [PATCH 10/56] microblaze_v2: Generic dts file for platfo..., Stephen Neuendorffer, (Mon May 5, 1:25 pm)
RE: [PATCH 10/56] microblaze_v2: Generic dts file for platfo..., Stephen Neuendorffer, (Mon May 5, 7:32 pm)
RE: [PATCH 10/56] microblaze_v2: Generic dts file for platfo..., Stephen Neuendorffer, (Mon May 5, 8:17 pm)
Re: [PATCH 18/56] microblaze_v2: early_printk support, John Williams, (Mon May 5, 7:22 pm)
Re: [PATCH 18/56] microblaze_v2: early_printk support, Michal Simek, (Tue May 6, 4:14 am)
Re: [PATCH 18/56] microblaze_v2: early_printk support, Grant Likely, (Mon May 5, 10:36 am)
Re: [PATCH 18/56] microblaze_v2: early_printk support, Michal Simek, (Mon May 5, 4:10 pm)
Re: [PATCH 24/56] microblaze_v2: time support, Thomas Gleixner, (Wed May 7, 3:22 am)
Re: [PATCH 37/56] microblaze_v2: headers for irq, Thomas Gleixner, (Wed May 7, 3:26 am)
Re: [PATCH 37/56] microblaze_v2: headers for irq, Michal Simek, (Sun May 11, 9:56 am)
Re: [PATCH 46/56] microblaze_v2: headers files entry.h curre..., Geert Uytterhoeven, (Tue May 6, 4:57 pm)
[PATCH 54/56] microblaze_v2: entry.S, , (Sun May 4, 7:41 am)
Re: [PATCH 52/56] microblaze_v2: pci headers, Arnd Bergmann, (Sun May 4, 6:45 pm)
Re: [PATCH 52/56] microblaze_v2: pci headers, Michal Simek, (Mon May 5, 10:08 am)
Re: [PATCH 48/56] microblaze_v2: pool.h socket.h, Arnd Bergmann, (Sun May 4, 6:39 pm)
Re: [PATCH 43/56] microblaze_v2: termbits.h termios.h, Arnd Bergmann, (Mon May 5, 5:50 am)
Re: [PATCH 42/56] microblaze_v2: stats headers, Arnd Bergmann, (Sun May 4, 6:31 pm)
Re: [PATCH 36/56] microblaze_v2: dma support, John Williams, (Sun May 4, 10:25 pm)
Re: [PATCH 36/56] microblaze_v2: dma support, Geert Uytterhoeven, (Mon May 5, 2:45 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Michal Simek, (Tue May 6, 5:16 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Geert Uytterhoeven, (Tue May 6, 5:48 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Michal Simek, (Tue May 6, 5:53 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Geert Uytterhoeven, (Tue May 6, 7:17 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Arnd Bergmann, (Tue May 6, 7:24 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Michal Simek, (Tue May 6, 9:20 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Arnd Bergmann, (Tue May 6, 11:36 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Michal Simek, (Wed May 7, 2:24 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Geert Uytterhoeven, (Wed May 7, 3:17 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Arnd Bergmann, (Wed May 7, 5:21 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Michal Simek, (Wed May 7, 2:43 pm)
Re: [PATCH 33/56] microblaze_v2: ioctl support, Arnd Bergmann, (Sun May 4, 5:34 pm)
Re: [PATCH 33/56] microblaze_v2: ioctl support, Michal Simek, (Mon May 5, 10:06 am)
Re: [PATCH 32/56] microblaze_v2: definitions of types, Arnd Bergmann, (Sun May 4, 5:28 pm)
Re: [PATCH 30/56] microblaze_v2: includes SHM*, msgbuf, Arnd Bergmann, (Sun May 4, 5:10 pm)
Re: [PATCH 24/56] microblaze_v2: time support, John Williams, (Sun May 4, 10:19 pm)
Re: [PATCH 24/56] microblaze_v2: time support, Michal Simek, (Mon May 5, 10:22 am)
Re: [PATCH 24/56] microblaze_v2: time support, John Williams, (Mon May 5, 8:30 pm)
Re: [PATCH 24/56] microblaze_v2: time support, Michal Simek, (Tue May 6, 6:02 am)
Re: [PATCH 24/56] microblaze_v2: time support, Arnd Bergmann, (Tue May 6, 7:38 am)
RE: [PATCH 24/56] microblaze_v2: time support, Stephen Neuendorffer, (Tue May 6, 12:36 pm)
Re: [PATCH 24/56] microblaze_v2: time support, Grant Likely, (Tue May 6, 10:28 am)
Re: [PATCH 24/56] microblaze_v2: time support, Michal Simek, (Tue May 6, 9:26 am)
Re: [PATCH 24/56] microblaze_v2: time support, John Williams, (Tue May 6, 6:50 pm)
Re: [PATCH 24/56] microblaze_v2: time support, Michal Simek, (Tue May 6, 5:56 am)
Re: [PATCH 21/56] microblaze_v2: setup.c - system setting, John Williams, (Sun May 4, 10:15 pm)
Re: [PATCH 17/56] microblaze_v2: checksum support, Arnd Bergmann, (Sun May 4, 3:59 pm)
Re: [PATCH 17/56] microblaze_v2: checksum support, Michal Simek, (Mon May 5, 10:05 am)
Re: [PATCH 12/56] microblaze_v2: lmb support, John Williams, (Sun May 4, 10:11 pm)
Re: [PATCH 12/56] microblaze_v2: lmb support, Segher Boessenkool, (Mon May 5, 5:32 pm)
Re: [PATCH 09/56] microblaze_v2: cache support, John Williams, (Sun May 4, 10:09 pm)
Re: [PATCH 07/56] microblaze_v2: Signal support, Arnd Bergmann, (Sun May 4, 3:52 pm)
Re: [PATCH 03/56] microblaze_v2: Cpuinfo handling, John Williams, (Sun May 4, 9:52 pm)
Re: [PATCH 03/56] microblaze_v2: Cpuinfo handling, Michal Simek, (Mon May 5, 10:19 am)
Re: [PATCH 01/56] microblaze_v2: Kconfig patches, John Williams, (Sun May 4, 9:42 pm)
Re: [PATCH 01/56] microblaze_v2: Kconfig patches, Michal Simek, (Mon May 5, 10:16 am)
Re: [PATCH 01/56] microblaze_v2: Kconfig patches, Michal Simek, (Mon May 5, 2:46 am)
Re: Microblaze patches V2, John Williams, (Sun May 4, 10:30 pm)
Re: Microblaze patches V2, Michal Simek, (Mon May 5, 3:02 am)
speck-geostationary