Skip to content

Commit

Permalink
Merge tag 'omap-for-v3.8/cleanup-headers-serial-take2-signed' of git:…
Browse files Browse the repository at this point in the history
…//git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/headers

These changes remove plat/serial.h usage for omap2+.

Note that this branch is based on a tty commit 3e9a632
(tty/serial/8250: Make omap hardware workarounds local to 8250.h)
merged with omap-for-v3.8/cleanup-headers-signed.

The tty commit is needed to keep things compiling for omaps,
and omap-for-v3.8/cleanup-headers-signed is needed to avoid
multiple merge conflicts with the includes. I've verified
with Greg KH that the tty commit above is immutable and OK
to use as a base.

By Tony Lindgren
via Tony Lindgren
* tag 'omap-for-v3.8/cleanup-headers-serial-take2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP: Split plat/serial.h for omap1 and omap2+
  ARM: OMAP: Split uncompress.h to mach-omap1 and mach-omap2
  • Loading branch information
Olof Johansson committed Nov 5, 2012
2 parents 6d06721 + 3d82cbb commit 1c7ebf1
Show file tree
Hide file tree
Showing 18 changed files with 354 additions and 235 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-omap1/include/mach/debug-macro.S
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include <linux/serial_reg.h>

#include <plat/serial.h>
#include "serial.h"

.pushsection .data
omap_uart_phys: .word 0x0
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap1/include/mach/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static inline u32 omap_cs3_phys(void)

#endif /* ifndef __ASSEMBLER__ */

#include <plat/serial.h>
#include <mach/serial.h>

/*
* ---------------------------------------------------------------------------
Expand Down
53 changes: 53 additions & 0 deletions arch/arm/mach-omap1/include/mach/serial.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright (C) 2009 Texas Instruments
* Added OMAP4 support- Santosh Shilimkar <santosh.shilimkar@ti.com>
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/

#ifndef __ASM_ARCH_SERIAL_H
#define __ASM_ARCH_SERIAL_H

#include <linux/init.h>

/*
* Memory entry used for the DEBUG_LL UART configuration, relative to
* start of RAM. See also uncompress.h and debug-macro.S.
*
* Note that using a memory location for storing the UART configuration
* has at least two limitations:
*
* 1. Kernel uncompress code cannot overlap OMAP_UART_INFO as the
* uncompress code could then partially overwrite itself
* 2. We assume printascii is called at least once before paging_init,
* and addruart has a chance to read OMAP_UART_INFO
*/
#define OMAP_UART_INFO_OFS 0x3ffc

/* OMAP1 serial ports */
#define OMAP1_UART1_BASE 0xfffb0000
#define OMAP1_UART2_BASE 0xfffb0800
#define OMAP1_UART3_BASE 0xfffb9800

#define OMAP_PORT_SHIFT 2
#define OMAP7XX_PORT_SHIFT 0

#define OMAP1510_BASE_BAUD (12000000/16)
#define OMAP16XX_BASE_BAUD (48000000/16)

/*
* DEBUG_LL port encoding stored into the UART1 scratchpad register by
* decomp_setup in uncompress.h
*/
#define OMAP1UART1 11
#define OMAP1UART2 12
#define OMAP1UART3 13

#ifndef __ASSEMBLER__
extern void omap_serial_init(void);
#endif

#endif
121 changes: 119 additions & 2 deletions arch/arm/mach-omap1/include/mach/uncompress.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,122 @@
/*
* arch/arm/mach-omap1/include/mach/uncompress.h
* arch/arm/plat-omap/include/mach/uncompress.h
*
* Serial port stubs for kernel decompress status messages
*
* Initially based on:
* linux-2.4.15-rmk1-dsplinux1.6/arch/arm/plat-omap/include/mach1510/uncompress.h
* Copyright (C) 2000 RidgeRun, Inc.
* Author: Greg Lonnon <glonnon@ridgerun.com>
*
* Rewritten by:
* Author: <source@mvista.com>
* 2004 (c) MontaVista Software, Inc.
*
* This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed "as is" without any warranty of any
* kind, whether express or implied.
*/

#include <plat/uncompress.h>
#include <linux/types.h>
#include <linux/serial_reg.h>

#include <asm/memory.h>
#include <asm/mach-types.h>

#include "serial.h"

#define MDR1_MODE_MASK 0x07

volatile u8 *uart_base;
int uart_shift;

/*
* Store the DEBUG_LL uart number into memory.
* See also debug-macro.S, and serial.c for related code.
*/
static void set_omap_uart_info(unsigned char port)
{
/*
* Get address of some.bss variable and round it down
* a la CONFIG_AUTO_ZRELADDR.
*/
u32 ram_start = (u32)&uart_shift & 0xf8000000;
u32 *uart_info = (u32 *)(ram_start + OMAP_UART_INFO_OFS);
*uart_info = port;
}

static void putc(int c)
{
if (!uart_base)
return;

/* Check for UART 16x mode */
if ((uart_base[UART_OMAP_MDR1 << uart_shift] & MDR1_MODE_MASK) != 0)
return;

while (!(uart_base[UART_LSR << uart_shift] & UART_LSR_THRE))
barrier();
uart_base[UART_TX << uart_shift] = c;
}

static inline void flush(void)
{
}

/*
* Macros to configure UART1 and debug UART
*/
#define _DEBUG_LL_ENTRY(mach, dbg_uart, dbg_shft, dbg_id) \
if (machine_is_##mach()) { \
uart_base = (volatile u8 *)(dbg_uart); \
uart_shift = (dbg_shft); \
port = (dbg_id); \
set_omap_uart_info(port); \
break; \
}

#define DEBUG_LL_OMAP7XX(p, mach) \
_DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP7XX_PORT_SHIFT, \
OMAP1UART##p)

#define DEBUG_LL_OMAP1(p, mach) \
_DEBUG_LL_ENTRY(mach, OMAP1_UART##p##_BASE, OMAP_PORT_SHIFT, \
OMAP1UART##p)

static inline void arch_decomp_setup(void)
{
int port = 0;

/*
* Initialize the port based on the machine ID from the bootloader.
* Note that we're using macros here instead of switch statement
* as machine_is functions are optimized out for the boards that
* are not selected.
*/
do {
/* omap7xx/8xx based boards using UART1 with shift 0 */
DEBUG_LL_OMAP7XX(1, herald);
DEBUG_LL_OMAP7XX(1, omap_perseus2);

/* omap15xx/16xx based boards using UART1 */
DEBUG_LL_OMAP1(1, ams_delta);
DEBUG_LL_OMAP1(1, nokia770);
DEBUG_LL_OMAP1(1, omap_h2);
DEBUG_LL_OMAP1(1, omap_h3);
DEBUG_LL_OMAP1(1, omap_innovator);
DEBUG_LL_OMAP1(1, omap_osk);
DEBUG_LL_OMAP1(1, omap_palmte);
DEBUG_LL_OMAP1(1, omap_palmz71);

/* omap15xx/16xx based boards using UART2 */
DEBUG_LL_OMAP1(2, omap_palmtt);

/* omap15xx/16xx based boards using UART3 */
DEBUG_LL_OMAP1(3, sx1);
} while (0);
}

/*
* nothing to do
*/
#define arch_decomp_wdog()
1 change: 0 additions & 1 deletion arch/arm/mach-omap2/board-rm680.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <plat/usb.h>
#include "gpmc.h"
#include "common.h"
#include <plat/serial.h>

#include "mux.h"
#include "mmc.h"
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-omap2/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@

#include <asm/proc-fns.h>

#include <plat/serial.h>

#include "../plat-omap/common.h"

#include "i2c.h"
#include "serial.h"

#define OMAP_INTC_START NR_IRQS

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/include/mach/debug-macro.S
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include <linux/serial_reg.h>

#include <plat/serial.h>
#include <../mach-omap2/serial.h>

#define UART_OFFSET(addr) ((addr) & 0x00ffffff)

Expand Down
Loading

0 comments on commit 1c7ebf1

Please sign in to comment.