All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/5] m68k/serial: Remove obsolete IRQ_FLG_* users
From: Geert Uytterhoeven @ 2011-10-23 21:18 UTC (permalink / raw)
  To: linux-m68k, linux-kernel; +Cc: devel, Greg Kroah-Hartman, Geert Uytterhoeven
In-Reply-To: <1319404686-10800-1-git-send-email-geert@linux-m68k.org>

The m68k core irq code stopped honoring these flags during the irq
restructuring in 2006.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: devel@driverdev.osuosl.org
---
This is a split-up of "m68k/irq: Remove obsolete IRQ_FLG_* definitions and
users", to reduce conflicts and dependencies.

diff --git a/drivers/tty/serial/68360serial.c b/drivers/tty/serial/68360serial.c
index 0a3e878..daf0b1d 100644
--- a/drivers/staging/serial/68360serial.c
+++ b/drivers/staging/serial/68360serial.c
@@ -2771,8 +2771,8 @@ static int __init rs_360_init(void)
 			*/
 			/* cpm_install_handler(IRQ_MACHSPEC | state->irq, rs_360_interrupt, info);  */
 			/*request_irq(IRQ_MACHSPEC | state->irq, rs_360_interrupt, */
-			request_irq(state->irq, rs_360_interrupt,
-						IRQ_FLG_LOCK, "ttyS", (void *)info);
+			request_irq(state->irq, rs_360_interrupt, 0, "ttyS",
+				    (void *)info);
 
 			/* Set up the baud rate generator.
 			*/
-- 
1.7.0.4

^ permalink raw reply related

* [PATCH] TTY: tty flip buffer change reserve memory strategy.
From: Ilya Zykov @ 2011-10-23 21:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Alan Cox, linux-kernel, ilya

Currently, free flip buffer (tty->buf->free) reserve memory for further used,
only if driver send to ldisc less 257 bytes in one time.
If driver send more, flip buffer reserve(kmalloc()) and then
free(kfree()) every chunk more 256 bytes every time,
even we have in free buffer enough space, because we can't
pass through chunk boundary in free buffer. Also we can't limit reserve
memory size. In worse case we will have in free buffer:
(256 * 256 byte chunk) = (256 * 552 ) = 141312 byte unused memory.

This patch allow reserve more than 256 bytes in one time. And have
self-regulation chunk size ability(very useful for pty).
Also we can limit reserve memory size, but then,
we will be use kmalloc()-kree() calls on intensive stream from the driver.

diff -uprN last-orig/drivers/tty/tty_buffer.c tty_buffer.patched/drivers/tty/tty_buffer.c
--- last-orig/drivers/tty/tty_buffer.c	2011-10-18 13:57:32.000000000 +0400
+++ tty_buffer.patched/drivers/tty/tty_buffer.c	2011-10-22 09:45:09.000000000 +0400
@@ -58,7 +58,7 @@ static struct tty_buffer *tty_buffer_all
 {
 	struct tty_buffer *p;
 
-	if (tty->buf.memory_used + size > 65536)
+	if (tty->buf.memory_used + size > TTY_BUFFER_MAX)
 		return NULL;
 	p = kmalloc(sizeof(struct tty_buffer) + 2 * size, GFP_ATOMIC);
 	if (p == NULL)
@@ -91,10 +91,21 @@ static void tty_buffer_free(struct tty_s
 	tty->buf.memory_used -= b->size;
 	WARN_ON(tty->buf.memory_used < 0);
 
-	if (b->size >= 512)
-		kfree(b);
-	else {
-		b->next = tty->buf.free;
+	tty->buf.memory_reserve += b->size;
+	b->next = NULL;
+	if (tty->buf.free != NULL) {
+		struct tty_buffer *p = tty->buf.free;
+		while (p->next != NULL)
+			p = p->next;
+		p->next = b;
+		while (tty->buf.memory_reserve > TTY_BUFFER_RESERVE ) {
+			p = tty->buf.free;
+			tty->buf.free = p->next;
+			tty->buf.memory_reserve -= p->size;
+			WARN_ON(tty->buf.memory_reserve < 0);
+			kfree(p);
+		}
+	} else {
 		tty->buf.free = b;
 	}
 }
@@ -175,6 +186,8 @@ static struct tty_buffer *tty_buffer_fin
 			t->commit = 0;
 			t->read = 0;
 			tty->buf.memory_used += t->size;
+			tty->buf.memory_reserve -= t->size;
+			WARN_ON(tty->buf.memory_reserve < 0);
 			return t;
 		}
 		tbh = &((*tbh)->next);
@@ -517,6 +530,7 @@ void tty_buffer_init(struct tty_struct *
 	tty->buf.tail = NULL;
 	tty->buf.free = NULL;
 	tty->buf.memory_used = 0;
+	tty->buf.memory_reserve = 0;
 	INIT_WORK(&tty->buf.work, flush_to_ldisc);
 }
 
diff -uprN last-orig/include/linux/tty.h tty_buffer.patched/include/linux/tty.h
--- last-orig/include/linux/tty.h	2011-05-19 08:06:34.000000000 +0400
+++ tty_buffer.patched/include/linux/tty.h	2011-10-22 13:48:46.000000000 +0400
@@ -79,7 +79,8 @@ struct tty_buffer {
  */
 
 #define TTY_BUFFER_PAGE	(((PAGE_SIZE - sizeof(struct tty_buffer)) / 2) & ~0xFF)
-
+#define TTY_BUFFER_MAX		65536
+#define TTY_BUFFER_RESERVE	TTY_BUFFER_MAX
 
 struct tty_bufhead {
 	struct work_struct work;
@@ -87,8 +88,8 @@ struct tty_bufhead {
 	struct tty_buffer *head;	/* Queue head */
 	struct tty_buffer *tail;	/* Active buffer */
 	struct tty_buffer *free;	/* Free queue head */
-	int memory_used;		/* Buffer space used excluding
-								free queue */
+	int memory_used;		/* Buffer space used excluding free queue */
+	int memory_reserve;		/* Free queue space */
 };
 /*
  * When a break, frame error, or parity error happens, these codes are

^ permalink raw reply

* [U-Boot] [PATCH v3 10/10] arm, davinci: add cam_enc_4xx support
From: Igor Grinberg @ 2011-10-23 21:11 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <1319178738-29065-11-git-send-email-hs@denx.de>

On 10/21/2011 08:32 AM, Heiko Schocher wrote:
> - DM368 SOC
> - booting with spl not with UBL from TI
> - before loading u-boot from NAND into RAM, test
>   the RAM with the post memory test. If error
>   is found, switch all LEDs on and halt system.
> - SPI Flash
>   Dataflash Typ: M25PE80
> - Ethernet DM9161BI
> - MMC
> - USB
>
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Sandeep Paulraj <s-paulraj@ti.com>
> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
> ---
> changes for v2:
> - rebase to TOT
> - adapted to new spl framework
> - add USB support
> - MDIO Clk only 1MHz
> - LED: set LED in spl code, and clear them after 1 second
> - add "bdinfo" command
> - add nandrbl board specific command for switching
>   between rbl and uboot ecc calculation algorithm
>
> changes for v3:
> - add CONFIG_SYS_NAND_HW_ECC_OOBFIRST
>
>  MAINTAINERS                          |    1 +
>  board/ait/cam_enc_4xx/Makefile       |   52 ++++
>  board/ait/cam_enc_4xx/cam_enc_4xx.c  |  455 ++++++++++++++++++++++++++++++++++
>  board/ait/cam_enc_4xx/config.mk      |   13 +
>  board/ait/cam_enc_4xx/u-boot-spl.lds |   73 ++++++
>  board/ait/cam_enc_4xx/ublimage.cfg   |   48 ++++
>  boards.cfg                           |    1 +
>  doc/README.davinci.nand_spl          |  141 +++++++++++
>  include/configs/cam_enc_4xx.h        |  450 +++++++++++++++++++++++++++++++++
>  9 files changed, 1234 insertions(+), 0 deletions(-)
>  create mode 100644 board/ait/cam_enc_4xx/Makefile
>  create mode 100644 board/ait/cam_enc_4xx/cam_enc_4xx.c
>  create mode 100644 board/ait/cam_enc_4xx/config.mk
>  create mode 100644 board/ait/cam_enc_4xx/u-boot-spl.lds
>  create mode 100644 board/ait/cam_enc_4xx/ublimage.cfg
>  create mode 100644 doc/README.davinci.nand_spl
>  create mode 100644 include/configs/cam_enc_4xx.h
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index bb95e6d..3fe6ade 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -417,6 +417,7 @@ Georg Schardt <schardt@team-ctech.de>
>  
>  Heiko Schocher <hs@denx.de>
>  
> +	cam_enc_4xx	davinci/ARM926EJS
>  	charon		MPC5200
>  	ids8247		MPC8247
>  	jupiter		MPC5200
> diff --git a/board/ait/cam_enc_4xx/Makefile b/board/ait/cam_enc_4xx/Makefile
> new file mode 100644
> index 0000000..4804597
> --- /dev/null
> +++ b/board/ait/cam_enc_4xx/Makefile
> @@ -0,0 +1,52 @@
> +#
> +# (C) Copyright 2000, 2001, 2002
> +# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> +#
> +# Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation; either version 2 of
> +# the License, or (at your option) any later version.
> +#
> +# 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.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> +# MA 02111-1307 USA
> +#
> +
> +include $(TOPDIR)/config.mk
> +
> +LIB	= $(obj)lib$(BOARD).o
> +
> +COBJS	:= $(BOARD).o
> +SOBJS	:=
> +
> +SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
> +OBJS	:= $(addprefix $(obj),$(COBJS))
> +SOBJS	:= $(addprefix $(obj),$(SOBJS))
> +
> +$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
> +	$(call cmd_link_o_target, $(OBJS) $(SOBJS))
> +
> +clean:
> +	rm -f $(SOBJS) $(OBJS)
> +
> +distclean:	clean
> +	rm -f $(LIB) core *.bak $(obj).depend

I don't think you should be adding this.
Please, see the commit 464c79207c89f247f97b344495924eabb0c9738e
(punt unused clean/distclean targets) by Mike.

> +
> +#########################################################################
> +# This is for $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#########################################################################
> diff --git a/board/ait/cam_enc_4xx/cam_enc_4xx.c b/board/ait/cam_enc_4xx/cam_enc_4xx.c
> new file mode 100644
> index 0000000..059a08a
> --- /dev/null
> +++ b/board/ait/cam_enc_4xx/cam_enc_4xx.c
> @@ -0,0 +1,455 @@
> +/*
> + * Copyright (C) 2009 Texas Instruments Incorporated
> + *
> + * Copyright (C) 2011
> + * Heiko Schocher, DENX Software Engineering, hs at denx.de.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * 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.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> + */
> +
> +#include <common.h>
> +#include <linux/mtd/nand.h>
> +#include <nand.h>
> +#include <miiphy.h>
> +#include <netdev.h>
> +#include <asm/io.h>
> +#include <asm/arch/hardware.h>
> +#include <asm/arch/nand_defs.h>
> +#include <asm/arch/davinci_misc.h>
> +#ifdef CONFIG_DAVINCI_MMC
> +#include <mmc.h>
> +#include <asm/arch/sdmmc_defs.h>
> +#endif
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +#ifndef CONFIG_SPL_BUILD
> +int dram_init(void)
> +{
> +	/* dram_init must store complete ramsize in gd->ram_size */
> +	gd->ram_size = get_ram_size(
> +			(void *)CONFIG_SYS_SDRAM_BASE,
> +			CONFIG_MAX_RAM_BANK_SIZE);
> +	return 0;
> +}
> +
> +void dram_init_banksize(void)
> +{
> +	gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
> +	gd->bd->bi_dram[0].size = gd->ram_size;
> +}
> +
> +static struct davinci_timer *timer =
> +	(struct davinci_timer *)DAVINCI_TIMER3_BASE;
> +
> +static unsigned long get_timer_val(void)
> +{
> +	unsigned long now = readl(&timer->tim34);
> +
> +	return now;
> +}
> +
> +static void stop_timer(void)
> +{
> +	writel(0x0, &timer->tcr);
> +	return;
> +}
> +
> +int checkboard(void)
> +{
> +	printf("Board: AIT CAM ENC 4XX\n");
> +	return 0;
> +}
> +
> +int board_init(void)
> +{
> +	gd->bd->bi_arch_number = MACH_TYPE_DAVINCI_DM365_EVM;

You should be using the new standard for specifying the machine type.
Please, read the README file (CONFIG_MACH_TYPE option).

> +	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
> +
> +	return 0;
> +}
> +
> +#ifdef CONFIG_DRIVER_TI_EMAC
> +int board_eth_init(bd_t *bis)
> +{
> +	davinci_emac_initialize();
> +
> +	return 0;
> +}
> +#endif
> +
> +#ifdef CONFIG_NAND_DAVINCI
> +static int
> +davinci_std_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
> +				   uint8_t *buf, int page)
> +{
> +	struct nand_chip *this = mtd->priv;
> +	int i, eccsize = chip->ecc.size;
> +	int eccbytes = chip->ecc.bytes;
> +	int eccsteps = chip->ecc.steps;
> +	uint8_t *p = buf;
> +	uint8_t *oob = chip->oob_poi;
> +
> +	chip->cmdfunc(mtd, NAND_CMD_READOOB, 0x0, page & this->pagemask);
> +
> +	chip->read_buf(mtd, oob, mtd->oobsize);
> +
> +	chip->cmdfunc(mtd, NAND_CMD_READ0, 0x0, page & this->pagemask);
> +
> +
> +	for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
> +		int stat;
> +
> +		chip->ecc.hwctl(mtd, NAND_ECC_READ);
> +		chip->read_buf(mtd, p, eccsize);
> +		chip->ecc.hwctl(mtd, NAND_ECC_READSYN);
> +
> +		if (chip->ecc.prepad)
> +			oob += chip->ecc.prepad;
> +
> +		stat = chip->ecc.correct(mtd, p, oob, NULL);
> +
> +		if (stat == -1)
> +			mtd->ecc_stats.failed++;
> +		else
> +			mtd->ecc_stats.corrected += stat;
> +
> +		oob += eccbytes;
> +
> +		if (chip->ecc.postpad)
> +			oob += chip->ecc.postpad;
> +	}
> +
> +	/* Calculate remaining oob bytes */
> +	i = mtd->oobsize - (oob - chip->oob_poi);
> +	if (i)
> +		chip->read_buf(mtd, oob, i);
> +
> +	return 0;
> +}
> +
> +static void davinci_std_write_page_syndrome(struct mtd_info *mtd,
> +				    struct nand_chip *chip, const uint8_t *buf)
> +{
> +	unsigned char davinci_ecc_buf[NAND_MAX_OOBSIZE];
> +	struct nand_chip *this = mtd->priv;
> +	int i, eccsize = chip->ecc.size;
> +	int eccbytes = chip->ecc.bytes;
> +	int eccsteps = chip->ecc.steps;
> +	int chunk = chip->ecc.bytes + chip->ecc.prepad + chip->ecc.postpad;
> +	int offset = 0;
> +	const uint8_t *p = buf;
> +	uint8_t *oob = chip->oob_poi;
> +
> +	for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
> +		chip->ecc.hwctl(mtd, NAND_ECC_WRITE);
> +		chip->write_buf(mtd, p, eccsize);
> +
> +		/* Calculate ECC without prepad */
> +		chip->ecc.calculate(mtd, p, oob + chip->ecc.prepad);
> +
> +		if (chip->ecc.prepad) {
> +			offset = ((chip->ecc.steps - eccsteps) * chunk);
> +			memcpy(&davinci_ecc_buf[offset], oob, chip->ecc.prepad);
> +			oob += chip->ecc.prepad;
> +		}
> +
> +		offset = (((chip->ecc.steps - eccsteps) * chunk) +
> +				chip->ecc.prepad);

2 sets of parenthesis is enough.
I don't see any good in having the whole expression wrapped.

> +		memcpy(&davinci_ecc_buf[offset], oob, eccbytes);
> +		oob += eccbytes;
> +
> +		if (chip->ecc.postpad) {
> +			offset = (((chip->ecc.steps - eccsteps) * chunk) +
> +					(chip->ecc.prepad + eccbytes));

same here

> +			memcpy(&davinci_ecc_buf[offset], oob,
> +				chip->ecc.postpad);
> +			oob += chip->ecc.postpad;
> +		}
> +	}
> +
> +	/*
> +	 * Write the sparebytes into the page once
> +	 * all eccsteps have been covered
> +	 */
> +	for (i = 0; i < mtd->oobsize; i++)
> +		writeb(davinci_ecc_buf[i], this->IO_ADDR_W);
> +
> +	/* Calculate remaining oob bytes */
> +	i = mtd->oobsize - (oob - chip->oob_poi);

This one looks good, I think the previous should be the same.

> +	if (i)
> +		chip->write_buf(mtd, oob, i);
> +}
> +
> +static int davinci_std_write_oob_syndrome(struct mtd_info *mtd,
> +				   struct nand_chip *chip, int page)
> +{
> +	int pos, status = 0;
> +	const uint8_t *bufpoi = chip->oob_poi;
> +
> +	pos = mtd->writesize;
> +
> +	chip->cmdfunc(mtd, NAND_CMD_SEQIN, pos, page);
> +
> +	chip->write_buf(mtd, bufpoi, mtd->oobsize);
> +
> +	chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1);
> +	status = chip->waitfunc(mtd, chip);
> +
> +	return status & NAND_STATUS_FAIL ? -1 : 0;
> +}
> +
> +static int davinci_std_read_oob_syndrome(struct mtd_info *mtd,
> +	struct nand_chip *chip, int page, int sndcmd)
> +{
> +	struct nand_chip *this = mtd->priv;
> +	uint8_t *buf = chip->oob_poi;
> +	uint8_t *bufpoi = buf;
> +
> +	chip->cmdfunc(mtd, NAND_CMD_READOOB, 0x0, page & this->pagemask);
> +
> +	chip->read_buf(mtd, bufpoi, mtd->oobsize);
> +
> +	return 1;
> +}
> +
> +static void nand_dm365evm_select_chip(struct mtd_info *mtd, int chip)
> +{
> +	struct nand_chip	*this = mtd->priv;
> +	unsigned long		wbase = (unsigned long) this->IO_ADDR_W;
> +	unsigned long		rbase = (unsigned long) this->IO_ADDR_R;
> +
> +	if (chip == 1) {
> +		__set_bit(14, &wbase);
> +		__set_bit(14, &rbase);
> +	} else {
> +		__clear_bit(14, &wbase);
> +		__clear_bit(14, &rbase);
> +	}
> +	this->IO_ADDR_W = (void *)wbase;
> +	this->IO_ADDR_R = (void *)rbase;
> +}
> +
> +int board_nand_init(struct nand_chip *nand)
> +{
> +	davinci_nand_init(nand);
> +	nand->select_chip = nand_dm365evm_select_chip;
> +
> +	return 0;
> +}
> +
> +struct nand_ecc_ctrl org_ecc;
> +static int notsaved = 1;
> +
> +static int nand_switch_hw_func(int mode)
> +{
> +	struct nand_chip *nand;
> +	struct mtd_info *mtd;
> +
> +	if (nand_curr_device < 0 ||
> +	    nand_curr_device >= CONFIG_SYS_MAX_NAND_DEVICE ||
> +	    !nand_info[nand_curr_device].name) {
> +		printf("Error: Can't switch hw functions," \
> +			" no devices available\n");
> +		return -1;
> +	}
> +
> +	mtd = &nand_info[nand_curr_device];
> +	nand = mtd->priv;
> +
> +	if (mode == 0) {
> +		printf("switching to uboot hw functions.\n");
> +		memcpy(&nand->ecc, &org_ecc, sizeof(struct nand_ecc_ctrl));
> +	} else {
> +		/* RBL */
> +		printf("switching to RBL hw functions.\n");
> +		if (notsaved == 1) {
> +			memcpy(&org_ecc, &nand->ecc,
> +				sizeof(struct nand_ecc_ctrl));
> +			notsaved = 0;
> +		}
> +		nand->ecc.mode = NAND_ECC_HW_SYNDROME;
> +		nand->ecc.prepad = 6;
> +		nand->ecc.read_page = davinci_std_read_page_syndrome;
> +		nand->ecc.write_page = davinci_std_write_page_syndrome;
> +		nand->ecc.read_oob = davinci_std_read_oob_syndrome;
> +		nand->ecc.write_oob = davinci_std_write_oob_syndrome;
> +	}
> +	return mode;
> +}
> +
> +static int hwmode;
> +
> +static int do_switch_ecc(cmd_tbl_t *cmdtp, int flag, int argc,
> +		char *const argv[])
> +{
> +	if (argc != 2)
> +		goto usage;
> +	if (strncmp(argv[1], "rbl", 2) == 0)
> +		hwmode = nand_switch_hw_func(1);
> +	else if (strncmp(argv[1], "uboot", 2) == 0)
> +		hwmode = nand_switch_hw_func(0);
> +	else
> +		goto usage;
> +
> +	return 0;
> +
> +usage:
> +	printf("Usage: nandrbl %s\n", cmdtp->usage);
> +	return 1;
> +}
> +
> +U_BOOT_CMD(
> +	nandrbl, 2, 1,	do_switch_ecc,
> +	"switch between rbl/uboot NAND ECC calculation algorithm",
> +	"[rbl/uboot] - Switch between rbl/uboot NAND ECC algorithm"
> +);
> +
> +
> +#endif /* #ifdef CONFIG_NAND_DAVINCI */
> +
> +#ifdef CONFIG_DAVINCI_MMC
> +static struct davinci_mmc mmc_sd0 = {
> +	.reg_base	= (struct davinci_mmc_regs *)DAVINCI_MMC_SD0_BASE,
> +	.input_clk	= 121500000,
> +	.host_caps	= MMC_MODE_4BIT,
> +	.voltages	= MMC_VDD_32_33 | MMC_VDD_33_34,
> +	.version	= MMC_CTLR_VERSION_2,
> +};
> +
> +int board_mmc_init(bd_t *bis)
> +{
> +	int err;
> +
> +	/* Add slot-0 to mmc subsystem */
> +	err = davinci_mmc_init(bis, &mmc_sd0);
> +
> +	return err;
> +}
> +#endif
> +
> +void enable_vbus(void)
> +{
> +	/*
> +	 * nothing to do, but this function is needed from
> +	 * drivers/usb/musb/davinci.c
> +	 */
> +}

I think the common way would be to define a "weak" implementation in
drivers/usb/musb/davinci.c?

> +
> +int board_late_init(void)
> +{
> +	struct davinci_gpio *gpio = davinci_gpio_bank45;
> +
> +	/* 24MHz InputClock / 15 prediv -> 1.6 MHz timer running */
> +	while (get_timer_val() < 0x186a00)
> +		;
> +
> +	/* 1 sec reached -> stop timer, clear all LED */
> +	stop_timer();
> +	clrbits_le32(&gpio->out_data, CONFIG_CAM_ENC_LED_MASK);
> +	return 0;
> +}
> +
> +void reset_phy(void)
> +{
> +	char *name = "GENERIC @ 0x00";
> +
> +	/* reset the phy */
> +	miiphy_reset(name, 0x0);
> +}
> +
> +#else

I think, adding a comment to which #if that #else belongs,
will improve the understanding/readability.

> +static void cam_enc_4xx_set_all_led(void)
> +{
> +	struct davinci_gpio *gpio = davinci_gpio_bank45;
> +
> +	setbits_le32(&gpio->out_data, CONFIG_CAM_ENC_LED_MASK);
> +}
> +
> +/*
> + * TIMER 0 is used for tick
> + */
> +static struct davinci_timer *timer =
> +	(struct davinci_timer *)DAVINCI_TIMER3_BASE;
> +
> +#define TIMER_LOAD_VAL	0xffffffff
> +#define TIM_CLK_DIV	16
> +
> +static int cam_enc_4xx_timer_init(void)
> +{
> +	/* We are using timer34 in unchained 32-bit mode, full speed */
> +	writel(0x0, &timer->tcr);
> +	writel(0x0, &timer->tgcr);
> +	writel(0x06 | ((TIM_CLK_DIV - 1) << 8), &timer->tgcr);
> +	writel(0x0, &timer->tim34);
> +	writel(TIMER_LOAD_VAL, &timer->prd34);
> +	writel(2 << 22, &timer->tcr);
> +	return 0;
> +}
> +
> +void board_gpio_init(void)
> +{
> +	struct davinci_gpio *gpio;
> +
> +	cam_enc_4xx_set_all_led();
> +	cam_enc_4xx_timer_init();
> +	gpio = davinci_gpio_bank01;
> +	clrbits_le32(&gpio->dir, ~0xfdfffffe);
> +	/* clear LED D14 = GPIO25 */
> +	clrbits_le32(&gpio->out_data, 0x02000000);
> +	gpio = davinci_gpio_bank23;
> +	clrbits_le32(&gpio->dir, ~0x5ff0afef);
> +	/* set GPIO61 to 1 -> intern UART0 as Console */
> +	setbits_le32(&gpio->out_data, 0x20000000);
> +	/*
> +	 * PHY out of reset GIO 50 = 1
> +	 * NAND WP off GIO 51 = 1
> +	 */
> +	setbits_le32(&gpio->out_data, 0x000c0004);
> +	gpio = davinci_gpio_bank45;
> +	clrbits_le32(&gpio->dir, ~(0xdb2fffff) | CONFIG_CAM_ENC_LED_MASK);
> +	/*
> +	 * clear LED:
> +	 * D17 = GPIO86
> +	 * D11 = GPIO87
> +	 * GPIO88
> +	 * GPIO89
> +	 * D13 = GPIO90
> +	 * GPIO91
> +	 */
> +	clrbits_le32(&gpio->out_data, CONFIG_CAM_ENC_LED_MASK);
> +	gpio = davinci_gpio_bank67;
> +	clrbits_le32(&gpio->dir, ~0x000007ff);
> +}
> +
> +/*
> + * functions for the post memory test.
> + */
> +int arch_memory_test_prepare(u32 *vstart, u32 *size, phys_addr_t *phys_offset)
> +{
> +	*vstart = CONFIG_SYS_SDRAM_BASE;
> +	*size = PHYS_SDRAM_1_SIZE;
> +	*phys_offset = 0;
> +	return 0;
> +}
> +
> +void arch_memory_failure_handle(void)
> +{
> +	cam_enc_4xx_set_all_led();
> +	puts("mem failure\n");
> +	while (1)
> +		;
> +}
> +#endif
> diff --git a/board/ait/cam_enc_4xx/config.mk b/board/ait/cam_enc_4xx/config.mk
> new file mode 100644
> index 0000000..2801e9e
> --- /dev/null
> +++ b/board/ait/cam_enc_4xx/config.mk
> @@ -0,0 +1,13 @@
> +#
> +# 	AIT cam_enc_4xx board
> +#	cam_enc_4xx board has 1 bank of 256 MB DDR RAM
> +#	Physical Address: 8000'0000 to 9000'0000
> +#
> +# Linux Kernel is expected to be at 8000'8000, entry 8000'8000
> +# (mem base + reserved)
> +#
> +
> +#Provide at least 16MB spacing between us and the Linux Kernel image
> +PAD_TO	:= 12320
> +UBL_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/ublimage.cfg
> +ALL += $(obj)u-boot.ubl
> diff --git a/board/ait/cam_enc_4xx/u-boot-spl.lds b/board/ait/cam_enc_4xx/u-boot-spl.lds
> new file mode 100644
> index 0000000..6f6e065
> --- /dev/null
> +++ b/board/ait/cam_enc_4xx/u-boot-spl.lds
> @@ -0,0 +1,73 @@
> +/*
> + * (C) Copyright 2002
> + * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
> + *
> + * (C) Copyright 2008
> + * Guennadi Liakhovetki, DENX Software Engineering, <lg@denx.de>
> + *
> + * See file CREDITS for list of people who contributed to this
> + * project.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * 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.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
> +		LENGTH = CONFIG_SPL_MAX_SIZE }
> +
> +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
> +OUTPUT_ARCH(arm)
> +ENTRY(_start)
> +SECTIONS
> +{
> +	. = 0x00000000;
> +
> +	. = ALIGN(4);
> +	.text      :
> +	{
> +	__start = .;
> +	  arch/arm/cpu/arm926ejs/start.o	(.text)
> +	  *(.text*)
> +	} >.sram
> +
> +	. = ALIGN(4);
> +	.rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } >.sram
> +
> +	. = ALIGN(4);
> +	.data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
> +	. = ALIGN(4);
> +	.rel.dyn : {
> +		__rel_dyn_start = .;
> +		*(.rel*)
> +		__rel_dyn_end = .;
> +	} >.sram
> +
> +	.dynsym : {
> +		__dynsym_start = .;
> +		*(.dynsym)
> +	} >.sram
> +
> +	.bss :
> +	{
> +		. = ALIGN(4);
> +		__bss_start = .;
> +		*(.bss*)
> +		. = ALIGN(4);
> +		__bss_end__ = .;
> +	} >.sram
> +
> +	__image_copy_end = .;
> +	_end = .;
> +}
> diff --git a/board/ait/cam_enc_4xx/ublimage.cfg b/board/ait/cam_enc_4xx/ublimage.cfg
> new file mode 100644
> index 0000000..95182ca
> --- /dev/null
> +++ b/board/ait/cam_enc_4xx/ublimage.cfg
> @@ -0,0 +1,48 @@
> +#
> +# (C Copyright 2011
> +# Heiko Schocher DENX Software Engineering hs at denx.de.
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation; either version 2 of
> +# the License or (at your option) any later version.
> +#
> +# 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.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not write to the Free Software
> +# Foundation Inc. 51 Franklin Street Fifth Floor Boston,
> +# MA 02110-1301 USA
> +#
> +# Refer doc/README.ublimage for more details about how-to configure
> +# and create ublimage boot image
> +#
> +# The syntax is taken as close as possible with the kwbimage
> +
> +# UBL special mode : one of
> +# safe (the board has no nand neither onenand)
> +MODE	safe
> +
> +# Entry point address for the user bootloader (absolute address)
> +# nand spl TEXT_BASE = 0x20 !!
> +ENTRY	0x00000020
> +
> +# Number of pages (size of user bootloader in number of pages)
> +# @ nand spl 6 pages
> +PAGES	6
> +
> +# Block number where user bootloader is present
> +# RBL starts always with block 1
> +START_BLOCK	5
> +
> +# Page number where user bootloader is present
> +# Page 0 is always UBL header
> +START_PAGE	0
> +
> +LD_ADDR		0x20
> diff --git a/boards.cfg b/boards.cfg
> index 1e3bfdc..0e212a1 100644
> --- a/boards.cfg
> +++ b/boards.cfg
> @@ -120,6 +120,7 @@ pm9263                       arm         arm926ejs   pm9263              ronetix
>  pm9g45                       arm         arm926ejs   pm9g45              ronetix        at91        pm9g45:AT91SAM9G45
>  da830evm                     arm         arm926ejs   da8xxevm            davinci        davinci
>  da850evm                     arm         arm926ejs   da8xxevm            davinci        davinci
> +cam_enc_4xx                  arm         arm926ejs   cam_enc_4xx         ait            davinci     cam_enc_4xx
>  hawkboard                    arm         arm926ejs   da8xxevm            davinci        davinci
>  hawkboard_nand               arm         arm926ejs   da8xxevm            davinci        davinci     hawkboard:NAND_U_BOOT
>  hawkboard_uart               arm         arm926ejs   da8xxevm            davinci        davinci     hawkboard:UART_U_BOOT
> diff --git a/doc/README.davinci.nand_spl b/doc/README.davinci.nand_spl
> new file mode 100644
> index 0000000..f46721a
> --- /dev/null
> +++ b/doc/README.davinci.nand_spl
> @@ -0,0 +1,141 @@
> +With this approach, we don't need the UBL any more on DaVinci boards.
> +A "make boardname" will compile a u-boot.ubl, with UBL Header, which is
> +needed for the RBL to find the "UBL", which actually is a  UBL-compatible
> +header, nand spl code and u-boot code.
> +
> +
> +As the RBL uses another read function as the "standard" u-boot,
> +we need a command, which switches between this two read/write
> +functions, so we can write the UBL header and the spl
> +code in a format, which the RBL can read. This is realize
> +(at the moment in board specific code) in the u-boot command
> +nandrbl
> +
> +nandrbl without arguments returns actual mode (rbl or uboot).
> +with nandrbl mode (mode = "rbl" or "uboot") you can switch
> +between the two NAND read/write modes.
> +
> +
> +To set up mkimage you need a config file for mkimage, example:
> +board/ait/cam_enc_4xx/ublimage.cfg
> +
> +For information about the configuration please see:
> +doc/README.ublimage
> +
> +Example for the cam_enc_4xx board:
> +On the cam_enc_4xx board we have a NAND flash with blocksize = 0x20000 and
> +pagesize = 0x800, so the u-boot.ubl image (which you get with:
> +"make cam_enc_4xx") looks like this:
> +
> +00000000  00 ed ac a1 20 00 00 00  06 00 00 00 05 00 00 00  |.... ...........|
> +00000010  00 00 00 00 20 00 00 00  ff ff ff ff ff ff ff ff  |.... ...........|
> +00000020  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
> +*
> +00000800  14 00 00 ea 14 f0 9f e5  10 f0 9f e5 0c f0 9f e5  |................|
> +00000810  08 f0 9f e5 04 f0 9f e5  00 f0 9f e5 04 f0 1f e5  |................|
> +00000820  00 01 00 00 78 56 34 12  78 56 34 12 78 56 34 12  |....xV4.xV4.xV4.|
> +[...]
> +*
> +00001fe0  00 00 00 00 00 00 00 00  ff ff ff ff ff ff ff ff  |................|
> +00001ff0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
> +*
> +00003800  14 00 00 ea 14 f0 9f e5  14 f0 9f e5 14 f0 9f e5  |................|
> +00003810  14 f0 9f e5 14 f0 9f e5  14 f0 9f e5 14 f0 9f e5  |................|
> +00003820  80 01 08 81 e0 01 08 81  40 02 08 81 a0 02 08 81  |........ at .......|
> +
> +In the first "page" of the image, we have the UBL Header, needed for
> +the RBL to find the spl code.
> +
> +The spl code starts in the second "page" of the image, with a size
> +defined by:
> +
> +#define CONFIG_SYS_NROF_PAGES_NAND_SPL	6
> +
> +After the spl code, there comes the "real" u-boot code
> +@ (6 + 1) * pagesize = 0x3800
> +
> +------------------------------------------------------------------------
> +Setting up spl code:
> +
> +/*
> + * RBL searches from Block n (n = 1..24)
> + * so we can define, how many UBL Headers
> + * we write before the real spl code
> + */
> +#define CONFIG_SYS_NROF_UBL_HEADER	5
> +#define CONFIG_SYS_NROF_PAGES_NAND_SPL	6
> +
> +#define CONFIG_SYS_NAND_U_BOOT_OFFS	((CONFIG_SYS_NROF_UBL_HEADER * \
> +					CONFIG_SYS_NAND_BLOCK_SIZE) + \
> +					(CONFIG_SYS_NROF_PAGES_NAND_SPL) * \
> +					CONFIG_SYS_NAND_PAGE_SIZE)
> +------------------------------------------------------------------------
> +
> +Burning into NAND:
> +
> +step 1:
> +The RBL searches from Block n ( n = 1..24) on page 0 for valid UBL
> +Headers, so you have to burn the UBL header page from the u-boot.ubl
> +image to the blocks, you want to have the UBL header.
> +!! Don;t forget to switch to rbl nand read/write functions with
> +   "nandrbl rbl"
> +
> +step 2:
> +You need to setup in the ublimage.cfg, where the RBL can find the spl
> +code, and how big it is.
> +
> +!! RBL always starts reading from page 0 !!
> +
> +For the AIT board, we have:
> +PAGES		6
> +START_BLOCK	5
> +
> +So we need to copy the spl code to block 5 page 0
> +!! Don;t forget to switch to rbl nand read/write functions with
> +   "nandrbl rbl"
> +
> +step 3:
> +You need to copy the u-boot image to the block/page
> +where the spl code reads it (CONFIG_SYS_NAND_U_BOOT_OFFS)
> +!! Don;t forget to switch to rbl nand read/write functions with
> +   "nandrbl uboot", which is default.
> +
> +On the cam_enc_4xx board it is:
> +#define CONFIG_SYS_NAND_U_BOOT_OFFS	(0xc0000)
> +
> +-> this results in following NAND usage on the cam_enc_4xx board:
> +
> +addr
> +
> +20000		possible UBL Header
> +40000		possible UBL Header
> +60000		possible UBL Header
> +80000		possilbe UBL Header
> +a0000		spl code
> +c0000		u-boot code
> +
> +The above steps are executeed through the following environment vars:
> +(using 80000 as address for the UBL header)
> +
> +pagesz=800
> +uboot=/tftpboot/cam_enc_4xx/u-boot.ubl
> +load=tftp 80000000 ${uboot}
> +writeheader nandrbl rbl;nand erase 80000 ${pagesz};nand write 80000000 80000 ${pagesz};nandrbl uboot
> +writenand_spl nandrbl rbl;nand erase a0000 3000;nand write 80000800 a0000 3000;nandrbl uboot
> +writeuboot nandrbl uboot;nand erase c0000 5d000;nand write 80003800 c0000 5d000
> +update=run load writeheader writenand_spl writeuboot
> +
> +If you do a "run load update" u-boot, spl + ubl header
> +are magically updated ;-)
> +
> +Note:
> +- There seem to be a bug in the RBL code (at least on my HW),
> +  In the UBL block, I can set the page to values != 0, so it
> +  is possible to burn step 1 and step 2 in one step into the
> +  flash, but the RBL ignores the page settings, so I have to
> +  burn the UBL Header to a page 0 and the spl code to
> +  a page 0 ... :-(
> +- If we make the nand read/write functions in the RBL equal to
> +  the functions in u-boot (as I have no RBL code, it is only
> +  possible in u-boot), we could burn the complete image in
> +  one step ... that would be nice ...
> diff --git a/include/configs/cam_enc_4xx.h b/include/configs/cam_enc_4xx.h
> new file mode 100644
> index 0000000..bf6efbc
> --- /dev/null
> +++ b/include/configs/cam_enc_4xx.h
> @@ -0,0 +1,450 @@
> +/*
> + * Copyright (C) 2009 Texas Instruments Incorporated
> + *
> + * Copyright (C) 2011
> + * Heiko Schocher, DENX Software Engineering, hs at denx.de.
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * 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.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + */
> +
> +#ifndef __CONFIG_H
> +#define __CONFIG_H
> +
> +#define CONFIG_SYS_NO_FLASH		/* that is, no *NOR* flash */
> +#define CONFIG_SYS_CONSOLE_INFO_QUIET
> +
> +/* SoC Configuration */
> +#define CONFIG_ARM926EJS				/* arm926ejs CPU */
> +#define CONFIG_SYS_TIMERBASE		0x01c21400	/* use timer 0 */
> +#define CONFIG_SYS_HZ_CLOCK		24000000	/* timer0 freq */
> +#define CONFIG_SYS_HZ			1000
> +#define CONFIG_SOC_DM365
> +
> +#define CONFIG_HOSTNAME			cam_enc_4xx
> +
> +#define	BOARD_LATE_INIT
> +#define CONFIG_CAM_ENC_LED_MASK		0x0fc00000
> +
> +/* Memory Info */
> +#define CONFIG_NR_DRAM_BANKS		1
> +#define PHYS_SDRAM_1			0x80000000
> +#define PHYS_SDRAM_1_SIZE		(256 << 20)	/* 256 MiB */
> +#define DDR_4BANKS				/* 4-bank DDR2 (256MB) */
> +#define CONFIG_MAX_RAM_BANK_SIZE	(256 << 20)	/* 256 MB */
> +#define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
> +
> +/* Serial Driver info: UART0 for console  */
> +#define CONFIG_SYS_NS16550
> +#define CONFIG_SYS_NS16550_SERIAL
> +#define CONFIG_SYS_NS16550_REG_SIZE	-4
> +#define CONFIG_SYS_NS16550_COM1		0x01c20000
> +#define CONFIG_SYS_NS16550_CLK		CONFIG_SYS_HZ_CLOCK
> +#define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
> +#define CONFIG_CONS_INDEX		1
> +#define CONFIG_BAUDRATE			115200
> +
> +/* Network Configuration */
> +#define CONFIG_DRIVER_TI_EMAC
> +#define CONFIG_EMAC_MDIO_PHY_NUM	0
> +#define	CONFIG_SYS_EMAC_TI_CLKDIV	0xa9	/* 1MHz */
> +#define CONFIG_MII
> +#define CONFIG_BOOTP_DEFAULT
> +#define CONFIG_BOOTP_DNS
> +#define CONFIG_BOOTP_DNS2
> +#define CONFIG_BOOTP_SEND_HOSTNAME
> +#define CONFIG_NET_RETRY_COUNT	10
> +#define CONFIG_NET_MULTI
> +#define CONFIG_CMD_MII
> +#define CONFIG_SYS_DCACHE_OFF
> +#define CONFIG_RESET_PHY_R
> +
> +/* I2C */
> +#define CONFIG_HARD_I2C
> +#define CONFIG_DRIVER_DAVINCI_I2C
> +#define CONFIG_SYS_I2C_SPEED		400000
> +#define CONFIG_SYS_I2C_SLAVE		0x10	/* SMBus host address */
> +
> +/* NAND: socketed, two chipselects, normally 2 GBytes */
> +#define CONFIG_NAND_DAVINCI
> +#define CONFIG_SYS_NAND_CS		2
> +#define CONFIG_SYS_NAND_USE_FLASH_BBT
> +#define CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST
> +#define CONFIG_SYS_NAND_PAGE_2K
> +
> +#define CONFIG_SYS_NAND_LARGEPAGE
> +#define CONFIG_SYS_NAND_BASE_LIST	{ 0x02000000, }
> +/* socket has two chipselects, nCE0 gated by address BIT(14) */
> +#define CONFIG_SYS_MAX_NAND_DEVICE	1
> +#define CONFIG_SYS_NAND_MAX_CHIPS	1
> +
> +/* SPI support */
> +#define CONFIG_SPI
> +#define CONFIG_SPI_FLASH
> +#define CONFIG_SPI_FLASH_STMICRO
> +#define CONFIG_DAVINCI_SPI
> +#define CONFIG_SYS_SPI_BASE		DAVINCI_SPI1_BASE
> +#define CONFIG_SYS_SPI_CLK		davinci_clk_get(SPI_PLLDIV)
> +#define CONFIG_SF_DEFAULT_SPEED		3000000
> +#define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
> +#define CONFIG_CMD_SF
> +
> +/* SD/MMC */
> +#define CONFIG_MMC
> +#define CONFIG_GENERIC_MMC
> +#define CONFIG_DAVINCI_MMC
> +#define CONFIG_MMC_MBLOCK
> +
> +/* U-Boot command configuration */
> +#include <config_cmd_default.h>
> +
> +#define CONFIG_CMD_BDI
> +#undef CONFIG_CMD_FLASH
> +#undef CONFIG_CMD_FPGA
> +#undef CONFIG_CMD_SETGETDCR
> +#define CONFIG_CMD_ASKENV
> +#define CONFIG_CMD_CACHE
> +#define CONFIG_CMD_DHCP
> +#define CONFIG_CMD_I2C
> +#define CONFIG_CMD_PING
> +#define CONFIG_CMD_SAVES
> +
> +#ifdef CONFIG_MMC
> +#define CONFIG_DOS_PARTITION
> +#define CONFIG_CMD_EXT2
> +#define CONFIG_CMD_FAT
> +#define CONFIG_CMD_MMC
> +#endif
> +
> +#ifdef CONFIG_NAND_DAVINCI
> +#define CONFIG_CMD_MTDPARTS
> +#define CONFIG_MTD_PARTITIONS
> +#define CONFIG_MTD_DEVICE
> +#define CONFIG_CMD_NAND
> +#define CONFIG_CMD_UBI
> +#define CONFIG_RBTREE
> +#endif
> +
> +#define CONFIG_CRC32_VERIFY
> +#define CONFIG_MX_CYCLIC
> +
> +/* U-Boot general configuration */
> +#undef CONFIG_USE_IRQ				/* No IRQ/FIQ in U-Boot */
> +#define CONFIG_BOOTFILE		"uImage"	/* Boot file name */
> +#define CONFIG_SYS_PROMPT	"cam_enc_4xx> "	/* Monitor Command Prompt */
> +#define CONFIG_SYS_CBSIZE	1024		/* Console I/O Buffer Size  */
> +#define CONFIG_SYS_PBSIZE			/* Print buffer size */ \
> +		(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
> +#define CONFIG_SYS_MAXARGS	16		/* max number of command args */
> +#define CONFIG_SYS_HUSH_PARSER
> +#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
> +#define CONFIG_SYS_LONGHELP
> +
> +#ifdef CONFIG_NAND_DAVINCI
> +#define CONFIG_ENV_SIZE		(256 << 10)	/* 256 KiB */
> +#define CONFIG_ENV_IS_IN_NAND
> +#define CONFIG_ENV_OFFSET	0x0
> +#undef CONFIG_ENV_IS_IN_FLASH
> +#endif
> +
> +#if defined(CONFIG_MMC) && !defined(CONFIG_ENV_IS_IN_NAND)
> +#define CONFIG_CMD_ENV
> +#define CONFIG_ENV_SIZE		(16 << 10)	/* 16 KiB */
> +#define CONFIG_ENV_OFFSET	(51 << 9)	/* Sector 51 */
> +#define CONFIG_ENV_IS_IN_MMC
> +#undef CONFIG_ENV_IS_IN_FLASH
> +#endif
> +
> +#define CONFIG_BOOTDELAY	3
> +
> +#define CONFIG_CMDLINE_EDITING
> +#define CONFIG_VERSION_VARIABLE
> +#define CONFIG_TIMESTAMP
> +
> +/* U-Boot memory configuration */
> +#define CONFIG_STACKSIZE		(256 << 10)	/* 256 KiB */
> +#define CONFIG_SYS_MALLOC_LEN		(1 << 20)	/* 1 MiB */
> +#define CONFIG_SYS_MEMTEST_START	0x80000000	/* physical address */
> +#define CONFIG_SYS_MEMTEST_END		0x81000000	/* test 16MB RAM */
> +
> +/* Linux interfacing */
> +#define CONFIG_CMDLINE_TAG
> +#define CONFIG_SETUP_MEMORY_TAGS
> +#define CONFIG_SYS_BARGSIZE	1024			/* bootarg Size */
> +#define CONFIG_SYS_LOAD_ADDR	0x80700000		/* kernel address */
> +
> +#define MTDIDS_DEFAULT		"nand0=davinci_nand.0"
> +
> +#ifdef CONFIG_SYS_NAND_LARGEPAGE
> +/*  Use same layout for 128K/256K blocks; allow some bad blocks */
> +#define PART_BOOT		"2m(bootloader)ro,"
> +#endif
> +
> +#define PART_KERNEL		"4m(kernel),"	/* kernel + initramfs */
> +#define PART_REST		"-(filesystem)"
> +
> +#define MTDPARTS_DEFAULT	\
> +	"mtdparts=davinci_nand.0:" PART_BOOT PART_KERNEL PART_REST
> +
> +#define CONFIG_SYS_NAND_PAGE_SIZE	(0x800)
> +#define CONFIG_SYS_NAND_BLOCK_SIZE	(0x20000)
> +
> +/* Defines for SPL */
> +#define CONFIG_SPL
> +#define CONFIG_SPL_NAND_SUPPORT
> +#define CONFIG_SPL_NAND_SIMPLE
> +#define CONFIG_SYS_NAND_HW_ECC_OOBFIRST
> +#define CONFIG_SPL_SERIAL_SUPPORT
> +#define CONFIG_SPL_POST_MEM_SUPPORT
> +#define CONFIG_SPL_LDSCRIPT		"$(BOARDDIR)/u-boot-spl.lds"
> +#define CONFIG_SPL_STACK		(0x00010000 + 0x7f00)
> +
> +#define CONFIG_SPL_TEXT_BASE		0x0000020 /*CONFIG_SYS_SRAM_START*/
> +#define CONFIG_SPL_MAX_SIZE		12320
> +
> +#ifndef CONFIG_SPL_BUILD
> +#define CONFIG_SYS_TEXT_BASE		0x81080000
> +#endif
> +
> +#define CONFIG_SYS_NAND_BASE		0x02000000
> +#define CONFIG_SYS_NAND_PAGE_COUNT	(CONFIG_SYS_NAND_BLOCK_SIZE / \
> +					CONFIG_SYS_NAND_PAGE_SIZE)
> +
> +#define CONFIG_SYS_NAND_ECCPOS		{				\
> +				24, 25, 26, 27, 28,			\
> +				29, 30, 31, 32, 33, 34, 35, 36, 37, 38,	\
> +				39, 40, 41, 42, 43, 44, 45, 46, 47, 48,	\
> +				49, 50, 51, 52, 53, 54, 55, 56, 57, 58,	\
> +				59, 60, 61, 62, 63 }
> +#define CONFIG_SYS_NAND_BAD_BLOCK_POS	0
> +#define CONFIG_SYS_NAND_ECCSIZE		0x200
> +#define CONFIG_SYS_NAND_ECCBYTES	10
> +#define CONFIG_SYS_NAND_OOBSIZE		64
> +#define CONFIG_SYS_NAND_5_ADDR_CYCLE
> +#define CONFIG_SYS_NAND_ECCSTEPS	(CONFIG_SYS_NAND_PAGE_SIZE /	 \
> +					 CONFIG_SYS_NAND_ECCSIZE)
> +#define CONFIG_SYS_NAND_ECCTOTAL	(40)
> +
> +/*
> + * RBL searches from Block n (n = 1..24)
> + * so we can define, how many UBL Headers
> + * we can write before the real spl code
> + */
> +#define CONFIG_SYS_NROF_UBL_HEADER	5
> +#define CONFIG_SYS_NROF_PAGES_NAND_SPL	6
> +
> +#define CONFIG_SYS_NAND_U_BOOT_DST	0x81080000 /* u-boot TEXT_BASE */
> +#define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_NAND_U_BOOT_DST
> +
> +/*
> + * Post tests for memory testing
> + */
> +#define CONFIG_POST	CONFIG_SYS_POST_MEMORY
> +#define _POST_WORD_ADDR	0x0
> +
> +#define CONFIG_DISPLAY_CPUINFO
> +#define CONFIG_DISPLAY_BOARDINFO
> +
> +#define CONFIG_SYS_INIT_SP_ADDR		CONFIG_SPL_STACK
> +
> +#define CONFIG_SYS_NAND_U_BOOT_OFFS	0xc0000
> +#define CONFIG_SYS_NAND_U_BOOT_SIZE	0x60000
> +
> +/*
> + * U-Boot is a 3rd stage loader and if booting with spl, cpu setup is
> + * done in board_init_f from c code.
> + */
> +#define CONFIG_SKIP_LOWLEVEL_INIT
> +
> +/* for UBL header */
> +#define CONFIG_SYS_UBL_BLOCK		(CONFIG_SYS_NAND_PAGE_SIZE)
> +
> +#define CONFIG_SYS_DM36x_PLL1_PLLM	0x55
> +#define CONFIG_SYS_DM36x_PLL1_PREDIV	0x8005
> +#define CONFIG_SYS_DM36x_PLL2_PLLM	0x09
> +#define CONFIG_SYS_DM36x_PLL2_PREDIV	0x8000
> +#define CONFIG_SYS_DM36x_PERI_CLK_CTRL	0x243F04FC
> +#define CONFIG_SYS_DM36x_PLL1_PLLDIV1	0x801b
> +#define CONFIG_SYS_DM36x_PLL1_PLLDIV2	0x8001
> +/* POST DIV 680/2 = 340Mhz  -> MJCP and HDVICP bus interface clock */
> +#define CONFIG_SYS_DM36x_PLL1_PLLDIV3	0x8001
> +/*
> + * POST DIV 680/4 = 170Mhz  -> EDMA/Peripheral CFG0(1/2 MJCP/HDVICP bus
> + * interface clk)
> + */
> +#define CONFIG_SYS_DM36x_PLL1_PLLDIV4	0x8003
> +/* POST DIV 680/2 = 340Mhz  -> VPSS */
> +#define CONFIG_SYS_DM36x_PLL1_PLLDIV5	0x8001
> +/* POST DIV 680/9 = 75.6 Mhz -> VENC */
> +#define CONFIG_SYS_DM36x_PLL1_PLLDIV6	0x8008
> +/*
> + * POST DIV 680/1 = 680Mhz -> DDRx2(with internal divider of 2, clock boils
> + * down to 340 Mhz)
> + */
> +#define CONFIG_SYS_DM36x_PLL1_PLLDIV7	0x8000
> +/* POST DIV 680/7= 97Mhz-> MMC0/SD0 */
> +#define CONFIG_SYS_DM36x_PLL1_PLLDIV8	0x8006
> +/* POST DIV 680/28 = 24.3Mhz-> CLKOUT */
> +#define CONFIG_SYS_DM36x_PLL1_PLLDIV9	0x801b
> +
> +#define CONFIG_SYS_DM36x_PLL2_PLLDIV1	0x8011
> +/* POST DIV 432/1=432 Mhz  -> ARM926/(HDVICP block) clk */
> +#define CONFIG_SYS_DM36x_PLL2_PLLDIV2	0x8000
> +#define CONFIG_SYS_DM36x_PLL2_PLLDIV3	0x8001
> +/* POST DIV 432/21= 20.5714 Mhz->VOICE Codec clk */
> +#define CONFIG_SYS_DM36x_PLL2_PLLDIV4	0x8014
> +/* POST DIV 432/16=27 Mhz  -> VENC(For SD modes, requires) */
> +#define CONFIG_SYS_DM36x_PLL2_PLLDIV5	0x800f
> +
> +/*
> + * READ LATENCY 7 (CL + 2)
> + * CONFIG_PWRDNEN = 1
> + * CONFIG_EXT_STRBEN = 1
> + */
> +#define CONFIG_SYS_DM36x_DDR2_DDRPHYCR	(0 \
> +	| DV_DDR_PHY_EXT_STRBEN \
> +	| DV_DDR_PHY_PWRDNEN \
> +	| (7 << DV_DDR_PHY_RD_LATENCY_SHIFT))
> +
> +/*
> + * T_RFC = (trfc/DDR_CLK) - 1 = (195 / 2.941) - 1
> + * T_RP  = (trp/DDR_CLK) - 1  = (12.5 / 2.941) - 1
> + * T_RCD = (trcd/DDR_CLK) - 1 = (12.5 / 2.941) - 1
> + * T_WR  = (twr/DDR_CLK) - 1  = (15 / 2.941) - 1
> + * T_RAS = (tras/DDR_CLK) - 1 = (45 / 2.941) - 1
> + * T_RC  = (trc/DDR_CLK) - 1  = (57.5 / 2.941) - 1
> + * T_RRD = (trrd/DDR_CLK) - 1 = (7.5 / 2.941) - 1
> + * T_WTR = (twtr/DDR_CLK) - 1 = (7.5 / 2.941) - 1
> + */
> +#define CONFIG_SYS_DM36x_DDR2_SDTIMR	(0 \
> +	| (66 << DV_DDR_SDTMR1_RFC_SHIFT) \
> +	| (4  << DV_DDR_SDTMR1_RP_SHIFT) \
> +	| (4  << DV_DDR_SDTMR1_RCD_SHIFT) \
> +	| (5  << DV_DDR_SDTMR1_WR_SHIFT) \
> +	| (14 << DV_DDR_SDTMR1_RAS_SHIFT) \
> +	| (19 << DV_DDR_SDTMR1_RC_SHIFT) \
> +	| (2  << DV_DDR_SDTMR1_RRD_SHIFT) \
> +	| (2  << DV_DDR_SDTMR1_WTR_SHIFT))
> +
> +/*
> + * T_RASMAX = (trasmax/refresh_rate) - 1 = (70K / 7812.6) - 1
> + * T_XP  = tCKE - 1 = 3 - 2
> + * T_XSNR= ((trfc + 10)/DDR_CLK) - 1 = (205 / 2.941) - 1
> + * T_XSRD = txsrd - 1 = 200 - 1
> + * T_RTP = (trtp/DDR_CLK) - 1 = (7.5 / 2.941) - 1
> + * T_CKE = tcke - 1     = 3 - 1
> + */
> +#define CONFIG_SYS_DM36x_DDR2_SDTIMR2	(0 \
> +	| (8  << DV_DDR_SDTMR2_RASMAX_SHIFT) \
> +	| (2  << DV_DDR_SDTMR2_XP_SHIFT) \
> +	| (69 << DV_DDR_SDTMR2_XSNR_SHIFT) \
> +	| (199 <<  DV_DDR_SDTMR2_XSRD_SHIFT) \
> +	| (2 <<  DV_DDR_SDTMR2_RTP_SHIFT) \
> +	| (2 <<  DV_DDR_SDTMR2_CKE_SHIFT))
> +
> +/* PR_OLD_COUNT = 0xfe */
> +#define CONFIG_SYS_DM36x_DDR2_PBBPR	0x000000FE
> +/* refresh rate = 0x768 */
> +#define CONFIG_SYS_DM36x_DDR2_SDRCR	0x00000768
> +
> +#define CONFIG_SYS_DM36x_DDR2_SDBCR	(0 \
> +	| (2 << DV_DDR_SDCR_PAGESIZE_SHIFT) \
> +	| (3 << DV_DDR_SDCR_IBANK_SHIFT) \
> +	| (5 << DV_DDR_SDCR_CL_SHIFT) \
> +	| (1 << DV_DDR_SDCR_BUS_WIDTH_SHIFT)	\
> +	| (1 << DV_DDR_SDCR_TIMUNLOCK_SHIFT) \
> +	| (1 << DV_DDR_SDCR_DDREN_SHIFT) \
> +	| (0 << DV_DDR_SDCR_DDRDRIVE0_SHIFT)	\
> +	| (1 << DV_DDR_SDCR_DDR2EN_SHIFT) \
> +	| (1 << DV_DDR_SDCR_DDR_DDQS_SHIFT) \
> +	| (1 << DV_DDR_SDCR_BOOTUNLOCK_SHIFT))
> +
> +#define CONFIG_SYS_DM36x_AWCCR	0xff
> +#define CONFIG_SYS_DM36x_AB1CR	0x40400204
> +#define CONFIG_SYS_DM36x_AB2CR	0x04ca2650
> +
> +/* All Video Inputs */
> +#define CONFIG_SYS_DM36x_PINMUX0	0x00000000
> +/*
> + * All Video Outputs,
> + * GPIO 86, 87 + 90 0x0000f030
> + */
> +#define CONFIG_SYS_DM36x_PINMUX1	0x00530002
> +#define CONFIG_SYS_DM36x_PINMUX2	0x00001815
> +/*
> + * SPI1, UART1, I2C, SD0, SD1, McBSP0, CLKOUTs
> + * GPIO 25 0x60000000
> + */
> +#define CONFIG_SYS_DM36x_PINMUX3	0x9b5affff
> +/*
> + * MMC/SD0 instead of MS, SPI0
> + * GPIO 34 0x0000c000
> + */
> +#define CONFIG_SYS_DM36x_PINMUX4	0x00002655
> +
> +/*
> + * Default environment settings
> + */
> +#define xstr(s)	str(s)
> +#define str(s)	#s
> +
> +#define DVN4XX_UBOOT_ADDR_R_RAM		0x80000000
> +/* (DVN4XX_UBOOT_ADDR_R_RAM + CONFIG_SYS_NAND_PAGE_SIZE) */
> +#define DVN4XX_UBOOT_ADDR_R_NAND_SPL	0x80000800
> +/*
> + * (DVN4XX_UBOOT_ADDR_R_NAND_SPL + (CONFIG_SYS_NROF_PAGES_NAND_SPL * \
> + * CONFIG_SYS_NAND_PAGE_SIZE))
> + */
> +#define DVN4XX_UBOOT_ADDR_R_UBOOT	0x80003800
> +
> +#define	CONFIG_EXTRA_ENV_SETTINGS					\
> +	"u_boot_addr_r=" xstr(DVN4XX_UBOOT_ADDR_R_RAM) "\0"		\
> +	"u-boot=" xstr(CONFIG_HOSTNAME) "/u-boot.ubl\0"			\
> +	"load=tftp ${u_boot_addr_r} ${uboot}\0"				\
> +	"pagesz=" xstr(CONFIG_SYS_NAND_PAGE_SIZE) "\0"			\
> +	"writeheader=nandrbl rbl;nand erase 80000 ${pagesz};"		\
> +		"nand write ${u_boot_addr_r} 80000 ${pagesz};"		\
> +		"nandrbl uboot\0"					\
> +	"writenand_spl=nandrbl rbl;nand erase a0000 3000;"		\
> +		"nand write " xstr(DVN4XX_UBOOT_ADDR_R_NAND_SPL)	\
> +		" a0000 3000;nandrbl uboot\0"				\
> +	"writeuboot=nandrbl uboot;"					\
> +		"nand erase " xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) " "	\
> +		 xstr(CONFIG_SYS_NAND_U_BOOT_SIZE)			\
> +		";nand write " xstr(DVN4XX_UBOOT_ADDR_R_UBOOT)		\
> +		" " xstr(CONFIG_SYS_NAND_U_BOOT_OFFS) " "		\
> +		xstr(CONFIG_SYS_NAND_U_BOOT_SIZE) "\0"			\
> +	"update=run load writenand_spl writeuboot\0"			\
> +	"bootcmd=run bootcmd\0"						\
> +	"rootpath=/opt/eldk-arm/arm\0"					\
> +	"\0"
> +
> +/* USB Configuration */
> +#define CONFIG_USB_DAVINCI
> +#define CONFIG_MUSB_HCD
> +#define CONFIG_DV_USBPHY_CTL (USBPHY_SESNDEN | USBPHY_VBDTCTEN | \
> +				USBPHY_PHY24MHZ)
> +
> +#define CONFIG_CMD_USB         /* include support for usb cmd */
> +#define CONFIG_USB_STORAGE     /* MSC class support */
> +#define CONFIG_CMD_STORAGE     /* inclue support for usb-storage cmd */
> +#define CONFIG_CMD_FAT         /* inclue support for FAT/storage */
> +#define CONFIG_DOS_PARTITION   /* inclue support for FAT/storage */
> +
> +#undef DAVINCI_DM365EVM
> +#define PINMUX4_USBDRVBUS_BITCLEAR       0x3000
> +#define PINMUX4_USBDRVBUS_BITSET         0x2000
> +
> +#endif /* __CONFIG_H */

^ permalink raw reply

* [RFC PATCH 15/15] ARM: uncompress: Add documentation
From: Zoltan Devai @ 2011-10-23 21:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1319404245-12740-1-git-send-email-zoss@devai.org>

Short description for mach maintainters on how to use the
ucuart driver. It is in-line in the print.c file, as they will
probably look there for any compile/link errors caused by
their decompressor UART setup.

Signed-off-by: Zoltan Devai <zoss@devai.org>
---
 arch/arm/boot/compressed/print.c |   35 ++++++++++++++++++++++++++---------
 1 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/arch/arm/boot/compressed/print.c b/arch/arm/boot/compressed/print.c
index cbb0dbf..b495c2e 100644
--- a/arch/arm/boot/compressed/print.c
+++ b/arch/arm/boot/compressed/print.c
@@ -1,21 +1,38 @@
 /*
- * misc.c
- * 
- * This is a collection of several routines from gzip-1.0.3 
- * adapted for Linux.
- *
- * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
- *
- * Modified for ARM Linux by Russell King
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  *
  * Nicolas Pitre <nico@visuaide.com>  1999/04/14 :
  *  For this code to run directly from Flash, all constant variables must
- *  be marked with 'const' and all other variables initialized at run-time 
+ *  be marked with 'const' and all other variables initialized at run-time
  *  only.  This way all non constant variables will end up in the bss segment,
  *  which should point to addresses in RAM and cleared to 0 on start.
  *  This allows for a much quicker boot time.
  */
 
+/* UART usage before kernel start:
+ * The files in this directory allow the boot of a self-extracting kernel
+ * image. As the kernel itself is compressed, this is a separate environment
+ * and thus needs a separate UART driver to communicate with the outside.
+ * Machines have multiple ways for providing this UART driver in their
+ * uncompress.h files:
+ *
+ * a) If your UART is compatible with a standard 8250 or AMBA01X port,
+ *    call one of the below ucuart_8250/amba01x setup routines from the
+ *    function "static inline void arch_decomp_setup(void)", that
+ *    resides in the uncompress.h file.
+ * b) If your UART is not a standard one, but still an MMIO one, that
+ *    has at least a direct register for TX, use the generic ucuart_init()
+ *    function.
+ * c) If your UART is too complicated for these simple routines, or you
+ *    rather want to use a framebuffer, provide your own putc(), flush() and
+ *    arch_decomp_setup() functions and #define ARCH_UCUART_NONGENERIC
+ *    in your header file.
+ * d) You can supply the description of the UART in a device tree blob that
+ *    is passed to the kernel.
+ *    (Not yet: In this case, you may omit the uncompress.h file entirely)
+ */
 #include <linux/compiler.h>	/* for inline */
 #include <linux/types.h>
 #include <linux/linkage.h>
-- 
1.7.4.1

^ permalink raw reply related

* [RFC PATCH 14/15] ARM: uncompress: Get decompress UART info from DT
From: Zoltan Devai @ 2011-10-23 21:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1319404245-12740-1-git-send-email-zoss@devai.org>

Allow the static decompress UART setup in uncompress.h
files to be overridden with an ucuart description in DT.

At a later stage, this may also allow to skip the
inclusion of uncompress.h files on arches which are DT-only,
to get rid of these files completely.

Signed-off-by: Zoltan Devai <zoss@devai.org>
---
 arch/arm/Kconfig                  |    9 +++++++
 arch/arm/boot/compressed/Makefile |    7 +++++
 arch/arm/boot/compressed/head.S   |    8 ++++++
 arch/arm/boot/compressed/print.c  |   45 +++++++++++++++++++++++++++++++++++++
 4 files changed, 69 insertions(+), 0 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 7a011f4..edfd4b7 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1866,6 +1866,15 @@ config ZBOOT_ROM_SH_MOBILE_SDHI
 
 endchoice
 
+config UCUART_DT
+	bool "Configure the decompress UART port from DT"
+	depends on OF
+	help
+	  With this option, the decompressor will use the UART port set up
+	  via the device tree.
+	  This configuration will override the hardcoded settings in any
+	  uncompress.h files.
+
 config ARM_APPENDED_DTB
 	bool "Use appended device tree blob to zImage (EXPERIMENTAL)"
 	depends on OF && !ZBOOT_ROM && EXPERIMENTAL
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index d955d4f..a4a1b8b 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -110,6 +110,13 @@ ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y)
 OBJS	+= $(libfdt_objs) atags_to_fdt.o
 endif
 
+$(addprefix $(obj)/,$(libfdt_objs) print.o): \
+	$(addprefix $(obj)/,$(libfdt_hdrs))
+
+ifeq ($(CONFIG_UCUART_DT),y)
+OBJS	+= $(libfdt_objs)
+endif
+
 targets       := vmlinux vmlinux.lds \
 		 piggy.$(suffix_y) piggy.$(suffix_y).o \
 		 lib1funcs.o lib1funcs.S font.o font.c head.o misc.o $(OBJS)
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index 9f5ac11..b80e5df 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -443,6 +443,14 @@ not_relocated:	mov	r0, #0
 		cmp	r2, r3
 		blo	1b
 
+#ifdef CONFIG_UCUART_DT
+/* Set up the uncompress UART port from DT data */
+		stmfd	sp!, {r0-r3, ip, lr}
+		mov	r0, r6			@ ATAG / DT pointer
+		bl	ucuart_init_dt
+		ldmfd	sp!, {r0-r3, ip, lr}
+#endif /* CONFIG_UCUART_DT */
+
 /*
  * The C runtime environment should now be setup sufficiently.
  * Set up some pointers, and start decompressing.
diff --git a/arch/arm/boot/compressed/print.c b/arch/arm/boot/compressed/print.c
index 1529d15..cbb0dbf 100644
--- a/arch/arm/boot/compressed/print.c
+++ b/arch/arm/boot/compressed/print.c
@@ -49,9 +49,54 @@ void ucuart_init(int base, int regshift, enum ucuart_iotypes iotype,
 		 int flush_val);
 
 void ucuart_init_8250(int base, int regshift, enum ucuart_iotypes iotype);
+void ucuart_init_amba01x(int base);
 
 struct uncompress_uart ucuart;
 
+#ifdef CONFIG_UCUART_DT
+#include <libfdt.h>
+
+/* Just a concept sketch... */
+void ucuart_init_dt(void *fdt)
+{
+	int ret, offset;
+	const void *prop;
+	const int *uart_base, *uart_regshift;
+	enum ucuart_iotypes iotype = UCUART_IO_MEM8;
+
+	ret = fdt_check_header(fdt);
+	if (ret < 0)
+		return;
+
+	offset = fdt_path_offset(fdt, "/chosen");
+	if (offset == -FDT_ERR_NOTFOUND)
+		return;
+
+	prop = fdt_getprop(fdt, offset, "linux,ucuart-8250", NULL);
+	if (!prop) {
+		putstr("non-8250 uart\n");
+		return;
+	}
+
+	prop = fdt_getprop(fdt, offset, "linux,ucuart-io-32", NULL);
+	if (prop)
+		iotype = UCUART_IO_MEM32;
+
+	uart_base = fdt_getprop(fdt, offset, "linux,ucuart-base", NULL);
+	uart_regshift = fdt_getprop(fdt, offset, "linux,ucuart-regshift", NULL);
+
+	prop = fdt_getprop(fdt, offset, "linux,ucuart-8250", NULL);
+	if (prop)
+		ucuart_init_8250(*uart_base, *uart_regshift, iotype);
+
+	prop = fdt_getprop(fdt, offset, "linux,ucuart-amba01x", NULL);
+	if (prop)
+		ucuart_init_amba01x(*uart_base);
+
+	fdt_pack(fdt);
+}
+#endif
+
 #include <mach/uncompress.h>
 
 #ifndef ARCH_UCUART_NONGENERIC
-- 
1.7.4.1

^ permalink raw reply related

* [RFC PATCH 13/15] ARM: uncompress.h: Cleanup header guards and banners
From: Zoltan Devai @ 2011-10-23 21:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1319404245-12740-1-git-send-email-zoss@devai.org>

Bring some standard into the files:
- uncompress.h should only be included once, don't hide an
  error with the header guards
- If the copyright banner is longer than the real content,
  or the file has been mostly rewritten, just stick
  a short-form GPl notice on top

Signed-off-by: Zoltan Devai <zoss@devai.org>
---
 arch/arm/mach-at91/include/mach/uncompress.h       |   31 +------------------
 arch/arm/mach-bcmring/include/mach/uncompress.h    |   18 +++--------
 arch/arm/mach-clps711x/include/mach/uncompress.h   |   18 +----------
 arch/arm/mach-cns3xxx/include/mach/uncompress.h    |    8 +----
 arch/arm/mach-dove/include/mach/uncompress.h       |    3 --
 arch/arm/mach-ebsa110/include/mach/uncompress.h    |    5 ---
 arch/arm/mach-exynos4/include/mach/uncompress.h    |   15 +--------
 arch/arm/mach-footbridge/include/mach/uncompress.h |    8 +----
 arch/arm/mach-gemini/include/mach/uncompress.h     |   16 +---------
 arch/arm/mach-h720x/include/mach/uncompress.h      |   12 ++------
 arch/arm/mach-integrator/include/mach/uncompress.h |   18 +----------
 arch/arm/mach-iop13xx/include/mach/uncompress.h    |    5 +++
 arch/arm/mach-iop32x/include/mach/uncompress.h     |    4 ++-
 arch/arm/mach-iop33x/include/mach/uncompress.h     |    5 ++-
 arch/arm/mach-ixp2000/include/mach/uncompress.h    |   16 ++--------
 arch/arm/mach-ixp23xx/include/mach/uncompress.h    |   10 ------
 arch/arm/mach-ixp4xx/include/mach/uncompress.h     |   12 -------
 arch/arm/mach-kirkwood/include/mach/uncompress.h   |    2 -
 arch/arm/mach-ks8695/include/mach/uncompress.h     |   13 --------
 arch/arm/mach-lpc32xx/include/mach/uncompress.h    |   22 +-------------
 arch/arm/mach-mmp/include/mach/uncompress.h        |    2 -
 arch/arm/mach-msm/include/mach/uncompress.h        |   28 +++++-------------
 arch/arm/mach-mv78xx0/include/mach/uncompress.h    |    2 -
 arch/arm/mach-mxs/include/mach/uncompress.h        |   21 +------------
 arch/arm/mach-netx/include/mach/uncompress.h       |   25 +--------------
 arch/arm/mach-nomadik/include/mach/uncompress.h    |   22 +-------------
 arch/arm/mach-omap1/include/mach/uncompress.h      |    4 --
 arch/arm/mach-omap2/include/mach/uncompress.h      |    4 --
 arch/arm/mach-orion5x/include/mach/uncompress.h    |   10 ++----
 arch/arm/mach-picoxcell/include/mach/uncompress.h  |   16 +---------
 arch/arm/mach-pnx4008/include/mach/uncompress.h    |   20 +-----------
 arch/arm/mach-prima2/include/mach/uncompress.h     |   13 ++------
 arch/arm/mach-pxa/include/mach/uncompress.h        |    5 ---
 arch/arm/mach-realview/include/mach/uncompress.h   |   18 +----------
 arch/arm/mach-s3c64xx/include/mach/uncompress.h    |   18 +----------
 arch/arm/mach-s5p64x0/include/mach/uncompress.h    |    6 ----
 arch/arm/mach-s5pc100/include/mach/uncompress.h    |    6 ----
 arch/arm/mach-s5pv210/include/mach/uncompress.h    |   16 +---------
 arch/arm/mach-sa1100/include/mach/uncompress.h     |    9 ++----
 arch/arm/mach-shark/include/mach/uncompress.h      |    9 ++----
 arch/arm/mach-shmobile/include/mach/uncompress.h   |   13 +++-----
 arch/arm/mach-spear3xx/include/mach/uncompress.h   |   18 -----------
 arch/arm/mach-spear6xx/include/mach/uncompress.h   |   18 -----------
 arch/arm/mach-tegra/include/mach/uncompress.h      |   26 ++--------------
 arch/arm/mach-u300/include/mach/uncompress.h       |   18 +----------
 arch/arm/mach-ux500/include/mach/uncompress.h      |   21 +------------
 arch/arm/mach-versatile/include/mach/uncompress.h  |   18 +----------
 arch/arm/mach-vexpress/include/mach/uncompress.h   |   18 +----------
 arch/arm/mach-vt8500/include/mach/uncompress.h     |   19 ++---------
 arch/arm/mach-w90x900/include/mach/uncompress.h    |   20 +-----------
 arch/arm/mach-zynq/include/mach/uncompress.h       |   22 ++-----------
 arch/arm/plat-mxc/include/mach/uncompress.h        |    5 ---
 arch/arm/plat-spear/include/plat/uncompress.h      |   18 ++---------
 arch/arm/plat-tcc/include/mach/uncompress.h        |    6 ++--
 54 files changed, 106 insertions(+), 629 deletions(-)

diff --git a/arch/arm/mach-at91/include/mach/uncompress.h b/arch/arm/mach-at91/include/mach/uncompress.h
index 59c1c68..78eb71c 100644
--- a/arch/arm/mach-at91/include/mach/uncompress.h
+++ b/arch/arm/mach-at91/include/mach/uncompress.h
@@ -1,26 +1,8 @@
 /*
- * arch/arm/mach-at91/include/mach/uncompress.h
- *
- *  Copyright (C) 2003 SAN People
- *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
-
-#ifndef __ASM_ARCH_UNCOMPRESS_H
-#define __ASM_ARCH_UNCOMPRESS_H
-
 #include <linux/atmel_serial.h>
 
 #if defined(CONFIG_AT91_EARLY_DBGU)
@@ -40,18 +22,9 @@
 #elif
 #define UART_OFFSET 0
 
-/*
- * The following code assumes the serial port has already been
- * initialized by the bootloader.  If you didn't setup a port in
- * your bootloader then nothing will appear (which might be desired).
- *
- * This does not append a newline
- */
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init(UART_OFFSET, 0, UCUART_IO_MEM32, ATMEL_US_THR,
 			ATMEL_US_CSR, ATMEL_US_TXRDY, ATMEL_US_TXRDY,
 			ATMEL_US_CSR, ATMEL_US_TXEMPTY, ATMEL_US_TXEMPTY);
 }
-
-#endif
\ No newline at end of file
diff --git a/arch/arm/mach-bcmring/include/mach/uncompress.h b/arch/arm/mach-bcmring/include/mach/uncompress.h
index 125f7b4..ed7a564 100644
--- a/arch/arm/mach-bcmring/include/mach/uncompress.h
+++ b/arch/arm/mach-bcmring/include/mach/uncompress.h
@@ -1,16 +1,8 @@
-/*****************************************************************************
-* Copyright 2005 - 2008 Broadcom Corporation.  All rights reserved.
-*
-* Unless you and Broadcom execute a separate written software license
-* agreement governing use of this software, this software is licensed to you
-* under the terms of the GNU General Public License version 2, available at
-* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
-*
-* Notwithstanding the above, under no circumstances may you combine this
-* software in any way with any other Broadcom software provided under a
-* license other than the GPL, without Broadcom's express prior written
-* consent.
-*****************************************************************************/
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
 #include <mach/csp/mm_addr.h>
 
 #define BCMRING_UART_0_DR	MM_ADDR_IO_UARTA
diff --git a/arch/arm/mach-clps711x/include/mach/uncompress.h b/arch/arm/mach-clps711x/include/mach/uncompress.h
index c0fadf2..c947d4e 100644
--- a/arch/arm/mach-clps711x/include/mach/uncompress.h
+++ b/arch/arm/mach-clps711x/include/mach/uncompress.h
@@ -1,21 +1,7 @@
 /*
- *  arch/arm/mach-clps711x/include/mach/uncompress.h
- *
- *  Copyright (C) 2000 Deep Blue Solutions Ltd
- *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 #include <mach/hardware.h>
 #include <asm/hardware/clps7111.h>
diff --git a/arch/arm/mach-cns3xxx/include/mach/uncompress.h b/arch/arm/mach-cns3xxx/include/mach/uncompress.h
index 35be756..f649fa7 100644
--- a/arch/arm/mach-cns3xxx/include/mach/uncompress.h
+++ b/arch/arm/mach-cns3xxx/include/mach/uncompress.h
@@ -1,12 +1,8 @@
 /*
- * Copyright 2003 ARM Limited
- * Copyright 2008 Cavium Networks
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, Version 2, as
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
 #include <asm/mach-types.h>
 #include <mach/cns3xxx.h>
 
diff --git a/arch/arm/mach-dove/include/mach/uncompress.h b/arch/arm/mach-dove/include/mach/uncompress.h
index 97a00eb..106f2f0 100644
--- a/arch/arm/mach-dove/include/mach/uncompress.h
+++ b/arch/arm/mach-dove/include/mach/uncompress.h
@@ -1,11 +1,8 @@
 /*
- * arch/arm/mach-dove/include/mach/uncompress.h
- *
  * 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 <mach/dove.h>
 
 static inline void arch_decomp_setup(void)
diff --git a/arch/arm/mach-ebsa110/include/mach/uncompress.h b/arch/arm/mach-ebsa110/include/mach/uncompress.h
index 38c0f7f..6ea8429 100644
--- a/arch/arm/mach-ebsa110/include/mach/uncompress.h
+++ b/arch/arm/mach-ebsa110/include/mach/uncompress.h
@@ -1,13 +1,8 @@
 /*
- *  arch/arm/mach-ebsa110/include/mach/uncompress.h
- *
- *  Copyright (C) 1996,1997,1998 Russell King
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(0xf0000be0, 2, UCUART_IO_MEM8);
diff --git a/arch/arm/mach-exynos4/include/mach/uncompress.h b/arch/arm/mach-exynos4/include/mach/uncompress.h
index 21d97bc..21b7bd1 100644
--- a/arch/arm/mach-exynos4/include/mach/uncompress.h
+++ b/arch/arm/mach-exynos4/include/mach/uncompress.h
@@ -1,18 +1,8 @@
-/* linux/arch/arm/mach-exynos4/include/mach/uncompress.h
- *
- * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
- *		http://www.samsung.com
- *
- * EXYNOS4 - uncompress code
- *
+/*
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
-*/
-
-#ifndef __ASM_ARCH_UNCOMPRESS_H
-#define __ASM_ARCH_UNCOMPRESS_H __FILE__
-
+ */
 #include <mach/map.h>
 #include <plat/uncompress.h>
 
@@ -27,4 +17,3 @@ static void arch_detect_cpu(void)
 	fifo_mask = S5PV210_UFSTAT_TXMASK;
 	fifo_max = 15 << S5PV210_UFSTAT_TXSHIFT;
 }
-#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-footbridge/include/mach/uncompress.h b/arch/arm/mach-footbridge/include/mach/uncompress.h
index 5f41698..9cef55a 100644
--- a/arch/arm/mach-footbridge/include/mach/uncompress.h
+++ b/arch/arm/mach-footbridge/include/mach/uncompress.h
@@ -1,8 +1,4 @@
 /*
- *  arch/arm/mach-footbridge/include/mach/uncompress.h
- *
- *  Copyright (C) 1996-1999 Russell King
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
@@ -12,8 +8,8 @@
 /*
  * Note! This could cause problems on the NetWinder
  */
-#define DC21285_BASE ((volatile unsigned int *)0x42000160)
-#define SER0_BASE    ((volatile unsigned char *)0x7c0003f8)
+#define DC21285_BASE	0x42000160
+#define SER0_BASE	0x7c0003f8
 
 static inline void arch_decomp_setup(void)
 {
diff --git a/arch/arm/mach-gemini/include/mach/uncompress.h b/arch/arm/mach-gemini/include/mach/uncompress.h
index dd81586..9841798 100644
--- a/arch/arm/mach-gemini/include/mach/uncompress.h
+++ b/arch/arm/mach-gemini/include/mach/uncompress.h
@@ -1,23 +1,11 @@
 /*
- * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
- *
- * Based on mach-pxa/include/mach/uncompress.h:
- * Copyright:	(C) 2001 MontaVista Software Inc.
- *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
-
-#ifndef __MACH_UNCOMPRESS_H
-#define __MACH_UNCOMPRESS_H
-
 #include <mach/hardware.h>
 
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(GEMINI_UART_BASE, 2, UCUART_IO_MEM32);
 }
-
-#endif /* __MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-h720x/include/mach/uncompress.h b/arch/arm/mach-h720x/include/mach/uncompress.h
index 6f727ba..9c8bdd1 100644
--- a/arch/arm/mach-h720x/include/mach/uncompress.h
+++ b/arch/arm/mach-h720x/include/mach/uncompress.h
@@ -1,12 +1,8 @@
 /*
- * arch/arm/mach-h720x/include/mach/uncompress.h
- *
- * Copyright (C) 2001-2002 Jungjun Kim
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
-
-#ifndef __ASM_ARCH_UNCOMPRESS_H
-#define __ASM_ARCH_UNCOMPRESS_H
-
 #include <mach/hardware.h>
 
 /* debug-macro.S treats this port as an AMBA01x, but according to the
@@ -16,5 +12,3 @@ static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(SERIAL0_BASE, 2, UCUART_IO_MEM8);
 }
-
-#endif
diff --git a/arch/arm/mach-integrator/include/mach/uncompress.h b/arch/arm/mach-integrator/include/mach/uncompress.h
index 57cc838..a6c0afb 100644
--- a/arch/arm/mach-integrator/include/mach/uncompress.h
+++ b/arch/arm/mach-integrator/include/mach/uncompress.h
@@ -1,21 +1,7 @@
 /*
- *  arch/arm/mach-integrator/include/mach/uncompress.h
- *
- *  Copyright (C) 1999 ARM Limited
- *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 static inline void arch_decomp_setup(void)
 {
diff --git a/arch/arm/mach-iop13xx/include/mach/uncompress.h b/arch/arm/mach-iop13xx/include/mach/uncompress.h
index 6c1c385..dfe67a8 100644
--- a/arch/arm/mach-iop13xx/include/mach/uncompress.h
+++ b/arch/arm/mach-iop13xx/include/mach/uncompress.h
@@ -1,3 +1,8 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
 #include <mach/hardware.h>
 
 static inline void arch_decomp_setup(void)
diff --git a/arch/arm/mach-iop32x/include/mach/uncompress.h b/arch/arm/mach-iop32x/include/mach/uncompress.h
index 3d970a9..6fe0ad9 100644
--- a/arch/arm/mach-iop32x/include/mach/uncompress.h
+++ b/arch/arm/mach-iop32x/include/mach/uncompress.h
@@ -1,5 +1,7 @@
 /*
- * arch/arm/mach-iop32x/include/mach/uncompress.h
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 #include <mach/hardware.h>
 
diff --git a/arch/arm/mach-iop33x/include/mach/uncompress.h b/arch/arm/mach-iop33x/include/mach/uncompress.h
index 9ee4b3b..c661412 100644
--- a/arch/arm/mach-iop33x/include/mach/uncompress.h
+++ b/arch/arm/mach-iop33x/include/mach/uncompress.h
@@ -1,7 +1,8 @@
 /*
- * arch/arm/mach-iop33x/include/mach/uncompress.h
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
-
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
 
diff --git a/arch/arm/mach-ixp2000/include/mach/uncompress.h b/arch/arm/mach-ixp2000/include/mach/uncompress.h
index e9911fb..d32b2ef 100644
--- a/arch/arm/mach-ixp2000/include/mach/uncompress.h
+++ b/arch/arm/mach-ixp2000/include/mach/uncompress.h
@@ -1,17 +1,7 @@
 /*
- * arch/arm/mach-ixp2000/include/mach/uncompress.h
- *
- *
- * Original Author: Naeem Afzal <naeem.m.afzal@intel.com>
- * Maintainer: Deepak Saxena <dsaxena@plexity.net>
- *
- * Copyright 2002 Intel Corp.
- *
- *  This program is free software; you can redistribute  it and/or modify it
- *  under  the terms of  the GNU General  Public License as published by the
- *  Free Software Foundation;  either version 2 of the  License, or (at your
- *  option) any later version.
- *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 static inline void arch_decomp_setup(void)
 {
diff --git a/arch/arm/mach-ixp23xx/include/mach/uncompress.h b/arch/arm/mach-ixp23xx/include/mach/uncompress.h
index 22cc9f5..af3d63d 100644
--- a/arch/arm/mach-ixp23xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ixp23xx/include/mach/uncompress.h
@@ -1,21 +1,11 @@
 /*
- * arch/arm/mach-ixp23xx/include/mach/uncompress.h
- *
- * Copyright (C) 2002-2004 Intel Corporation.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
-#ifndef __ASM_ARCH_UNCOMPRESS_H
-#define __ASM_ARCH_UNCOMPRESS_H
-
 #include <mach/ixp23xx.h>
 
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(IXP23XX_UART1_PHYS, 2, UCUART_IO_MEM32);
 }
-
-#endif
diff --git a/arch/arm/mach-ixp4xx/include/mach/uncompress.h b/arch/arm/mach-ixp4xx/include/mach/uncompress.h
index a8d075c..d3c683b 100644
--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h
@@ -1,18 +1,8 @@
 /*
- * arch/arm/mach-ixp4xx/include/mach/uncompress.h 
- *
- * Copyright (C) 2002 Intel Corporation.
- * Copyright (C) 2003-2004 MontaVista Software, Inc.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
- *
  */
-
-#ifndef _ARCH_UNCOMPRESS_H_
-#define _ARCH_UNCOMPRESS_H_
-
 #include "ixp4xx-regs.h"
 #include <asm/mach-types.h>
 
@@ -28,5 +18,3 @@ static inline void arch_decomp_setup(void)
 	else
 		ucuart_init_8250(IXP4XX_UART1_BASE_PHYS, 2, UCUART_IO_MEM32);
 }
-
-#endif
diff --git a/arch/arm/mach-kirkwood/include/mach/uncompress.h b/arch/arm/mach-kirkwood/include/mach/uncompress.h
index da9f19f..f2739f4 100644
--- a/arch/arm/mach-kirkwood/include/mach/uncompress.h
+++ b/arch/arm/mach-kirkwood/include/mach/uncompress.h
@@ -1,6 +1,4 @@
 /*
- * arch/arm/mach-kirkwood/include/mach/uncompress.h
- *
  * 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.
diff --git a/arch/arm/mach-ks8695/include/mach/uncompress.h b/arch/arm/mach-ks8695/include/mach/uncompress.h
index 99cac67..e2be045a07 100644
--- a/arch/arm/mach-ks8695/include/mach/uncompress.h
+++ b/arch/arm/mach-ks8695/include/mach/uncompress.h
@@ -1,19 +1,8 @@
 /*
- * arch/arm/mach-ks8695/include/mach/uncompress.h
- *
- * Copyright (C) 2006 Ben Dooks <ben@simtec.co.uk>
- * Copyright (C) 2006 Simtec Electronics
- *
- * KS8695 - Kernel uncompressor
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
-#ifndef __ASM_ARCH_UNCOMPRESS_H
-#define __ASM_ARCH_UNCOMPRESS_H
-
 #include <mach/regs-uart.h>
 
 static inline void arch_decomp_setup(void)
@@ -22,5 +11,3 @@ static inline void arch_decomp_setup(void)
 			KS8695_URLS, URLS_URTHRE, URLS_URTHRE,
 			KS8695_URLS, URLS_URTE, URLS_URTE);
 }
-
-#endif
diff --git a/arch/arm/mach-lpc32xx/include/mach/uncompress.h b/arch/arm/mach-lpc32xx/include/mach/uncompress.h
index 0e119c4..0586c4c 100644
--- a/arch/arm/mach-lpc32xx/include/mach/uncompress.h
+++ b/arch/arm/mach-lpc32xx/include/mach/uncompress.h
@@ -1,29 +1,11 @@
 /*
- * arch/arm/mach-lpc32xx/include/mach/uncompress.h
- *
- * Author: Kevin Wells <kevin.wells@nxp.com>
- *
- * Copyright (C) 2010 NXP Semiconductors
- *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
-
-#ifndef __ASM_ARM_ARCH_UNCOMPRESS_H
-#define __ASM_ARM_ARCH_UNCOMPRESS_H
-
 #include <mach/platform.h>
 
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(LPC32XX_UART5_BASE, 2, UCUART_IO_MEM32);
 }
-
-#endif
diff --git a/arch/arm/mach-mmp/include/mach/uncompress.h b/arch/arm/mach-mmp/include/mach/uncompress.h
index e9bf8bf..c8b652f 100644
--- a/arch/arm/mach-mmp/include/mach/uncompress.h
+++ b/arch/arm/mach-mmp/include/mach/uncompress.h
@@ -1,6 +1,4 @@
 /*
- * arch/arm/mach-mmp/include/mach/uncompress.h
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
diff --git a/arch/arm/mach-msm/include/mach/uncompress.h b/arch/arm/mach-msm/include/mach/uncompress.h
index 0fa9795..bb4d080 100644
--- a/arch/arm/mach-msm/include/mach/uncompress.h
+++ b/arch/arm/mach-msm/include/mach/uncompress.h
@@ -1,30 +1,18 @@
-/* arch/arm/mach-msm/include/mach/uncompress.h
- *
- * Copyright (C) 2007 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * 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.
- *
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
-
-#ifndef __ASM_ARCH_MSM_UNCOMPRESS_H
-
 #include "hardware.h"
-#include "linux/io.h"
 #include "mach/msm_iomap.h"
 
+#ifndef MSM_DEBUG_UART_PHYS
+#define MSM_DEBUG_UART_PHYS 0
+#endif /* MSM_DEBUG_UART_PHYS */
+
 static inline void arch_decomp_setup(void)
 {
-#if defined(MSM_DEBUG_UART_PHYS)
 	ucuart_init(MSM_DEBUG_UART_PHYS, 2, UCUART_IO_MEM32, 0x0c,
 			0x08, 0x04, 0x04,
 			0, 0, 0);
-#endif /* MSM_DEBUG_UART_PHYS */
 }
-#endif
diff --git a/arch/arm/mach-mv78xx0/include/mach/uncompress.h b/arch/arm/mach-mv78xx0/include/mach/uncompress.h
index 064bb96..60115d3 100644
--- a/arch/arm/mach-mv78xx0/include/mach/uncompress.h
+++ b/arch/arm/mach-mv78xx0/include/mach/uncompress.h
@@ -1,6 +1,4 @@
 /*
- * arch/arm/mach-mv78xx0/include/mach/uncompress.h
- *
  * 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.
diff --git a/arch/arm/mach-mxs/include/mach/uncompress.h b/arch/arm/mach-mxs/include/mach/uncompress.h
index c9587ce..9934c25 100644
--- a/arch/arm/mach-mxs/include/mach/uncompress.h
+++ b/arch/arm/mach-mxs/include/mach/uncompress.h
@@ -1,23 +1,8 @@
 /*
- *  arch/arm/mach-mxs/include/mach/uncompress.h
- *
- *  Copyright (C) 1999 ARM Limited
- *  Copyright (C) Shane Nay (shane at minirl.com)
- *  Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
- *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
-#ifndef __MACH_MXS_UNCOMPRESS_H__
-#define __MACH_MXS_UNCOMPRESS_H__
-
 #include <asm/mach-types.h>
 
 #define MX23_DUART_BASE_ADDR	0x80070000
@@ -37,5 +22,3 @@ static inline void arch_decomp_setup(void)
 		break;
 	}
 }
-
-#endif /* __MACH_MXS_UNCOMPRESS_H__ */
diff --git a/arch/arm/mach-netx/include/mach/uncompress.h b/arch/arm/mach-netx/include/mach/uncompress.h
index 5a32b87..5944b34 100644
--- a/arch/arm/mach-netx/include/mach/uncompress.h
+++ b/arch/arm/mach-netx/include/mach/uncompress.h
@@ -1,29 +1,8 @@
 /*
- * arch/arm/mach-netx/include/mach/uncompress.h
- *
- * Copyright (C) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
- *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
-
-/*
- * The following code assumes the serial port has already been
- * initialized by the bootloader.  We search for the first enabled
- * port in the most probable order.  If you didn't setup a port in
- * your bootloader then nothing will appear (which might be desired).
- */
-
 #define UART1_BASE 0x100a00
 #define UART2_BASE 0x100a80
 
diff --git a/arch/arm/mach-nomadik/include/mach/uncompress.h b/arch/arm/mach-nomadik/include/mach/uncompress.h
index f5da290..24d0525 100644
--- a/arch/arm/mach-nomadik/include/mach/uncompress.h
+++ b/arch/arm/mach-nomadik/include/mach/uncompress.h
@@ -1,29 +1,11 @@
 /*
- *  Copyright (C) 2008 STMicroelectronics
- *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
-
-#ifndef __ASM_ARCH_UNCOMPRESS_H
-#define __ASM_ARCH_UNCOMPRESS_H
-
 #include <mach/hardware.h>
 
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_amba01x(NOMADIK_UART1_BASE);
 }
-
-#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-omap1/include/mach/uncompress.h b/arch/arm/mach-omap1/include/mach/uncompress.h
index 0ff22dc..a4acb71 100644
--- a/arch/arm/mach-omap1/include/mach/uncompress.h
+++ b/arch/arm/mach-omap1/include/mach/uncompress.h
@@ -1,5 +1 @@
-/*
- * arch/arm/mach-omap1/include/mach/uncompress.h
- */
-
 #include <plat/uncompress.h>
diff --git a/arch/arm/mach-omap2/include/mach/uncompress.h b/arch/arm/mach-omap2/include/mach/uncompress.h
index 78e0557..a4acb71 100644
--- a/arch/arm/mach-omap2/include/mach/uncompress.h
+++ b/arch/arm/mach-omap2/include/mach/uncompress.h
@@ -1,5 +1 @@
-/*
- * arch/arm/mach-omap2/include/mach/uncompress.h
- */
-
 #include <plat/uncompress.h>
diff --git a/arch/arm/mach-orion5x/include/mach/uncompress.h b/arch/arm/mach-orion5x/include/mach/uncompress.h
index 4d7c1ba..692c366 100644
--- a/arch/arm/mach-orion5x/include/mach/uncompress.h
+++ b/arch/arm/mach-orion5x/include/mach/uncompress.h
@@ -1,11 +1,7 @@
 /*
- * arch/arm/mach-orion5x/include/mach/uncompress.h
- *
- * Tzachi Perelstein <tzachi@marvell.com>
- *
- * 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.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 #include <mach/orion5x.h>
 
diff --git a/arch/arm/mach-picoxcell/include/mach/uncompress.h b/arch/arm/mach-picoxcell/include/mach/uncompress.h
index 9464c63..bb627c3 100644
--- a/arch/arm/mach-picoxcell/include/mach/uncompress.h
+++ b/arch/arm/mach-picoxcell/include/mach/uncompress.h
@@ -1,19 +1,7 @@
 /*
- * Copyright (c) 2011 Picochip Ltd., Jamie Iles
- *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 #define ARCH_UCUART_NONGENERIC
 #define putc(c)
diff --git a/arch/arm/mach-pnx4008/include/mach/uncompress.h b/arch/arm/mach-pnx4008/include/mach/uncompress.h
index 1a18501..79be042 100644
--- a/arch/arm/mach-pnx4008/include/mach/uncompress.h
+++ b/arch/arm/mach-pnx4008/include/mach/uncompress.h
@@ -1,24 +1,8 @@
 /*
- *  arch/arm/mach-pnx4008/include/mach/uncompress.h
- *
- *  Copyright (C) 1999 ARM Limited
- *  Copyright (C) 2006 MontaVista Software, Inc.
- *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
-
 #define UART5_BASE 0x40090000
 
 static inline void arch_decomp_setup(void)
diff --git a/arch/arm/mach-prima2/include/mach/uncompress.h b/arch/arm/mach-prima2/include/mach/uncompress.h
index 29ee15e..5e1fcbe 100644
--- a/arch/arm/mach-prima2/include/mach/uncompress.h
+++ b/arch/arm/mach-prima2/include/mach/uncompress.h
@@ -1,14 +1,8 @@
 /*
- * arch/arm/mach-prima2/include/mach/uncompress.h
- *
- * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
- *
- * Licensed under GPLv2 or later.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
-
-#ifndef __ASM_ARCH_UNCOMPRESS_H
-#define __ASM_ARCH_UNCOMPRESS_H
-
 #include <mach/uart.h>
 
 static inline void arch_decomp_setup(void)
@@ -17,4 +11,3 @@ static inline void arch_decomp_setup(void)
 			SIRFSOC_UART_TXFIFO_DATA, SIRFSOC_UART_TXFIFO_STATUS,
 			SIRFSOC_UART1_TXFIFO_FULL, 0, 0, 0, 0);
 }
-#endif
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h b/arch/arm/mach-pxa/include/mach/uncompress.h
index 7d24bf1..f123d9f 100644
--- a/arch/arm/mach-pxa/include/mach/uncompress.h
+++ b/arch/arm/mach-pxa/include/mach/uncompress.h
@@ -1,9 +1,4 @@
 /*
- * arch/arm/mach-pxa/include/mach/uncompress.h
- *
- * Author:	Nicolas Pitre
- * Copyright:	(C) 2001 MontaVista Software Inc.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
diff --git a/arch/arm/mach-realview/include/mach/uncompress.h b/arch/arm/mach-realview/include/mach/uncompress.h
index f69b003..8e7ecaf 100644
--- a/arch/arm/mach-realview/include/mach/uncompress.h
+++ b/arch/arm/mach-realview/include/mach/uncompress.h
@@ -1,21 +1,7 @@
 /*
- *  arch/arm/mach-realview/include/mach/uncompress.h
- *
- *  Copyright (C) 2003 ARM Limited
- *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 #include <asm/mach-types.h>
 
diff --git a/arch/arm/mach-s3c64xx/include/mach/uncompress.h b/arch/arm/mach-s3c64xx/include/mach/uncompress.h
index c6a82a2..78f5e06 100644
--- a/arch/arm/mach-s3c64xx/include/mach/uncompress.h
+++ b/arch/arm/mach-s3c64xx/include/mach/uncompress.h
@@ -1,20 +1,8 @@
-/* arch/arm/mach-s3c6400/include/mach/uncompress.h
- *
- * Copyright 2008 Openmoko, Inc.
- * Copyright 2008 Simtec Electronics
- *	http://armlinux.simtec.co.uk/
- *	Ben Dooks <ben@simtec.co.uk>
- *
- * S3C6400 - uncompress code
- *
+/*
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
-*/
-
-#ifndef __ASM_ARCH_UNCOMPRESS_H
-#define __ASM_ARCH_UNCOMPRESS_H
-
+ */
 #include <mach/map.h>
 #include <plat/uncompress.h>
 
@@ -24,5 +12,3 @@ static void arch_detect_cpu(void)
 	fifo_mask = S3C2440_UFSTAT_TXMASK;
 	fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
 }
-
-#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s5p64x0/include/mach/uncompress.h b/arch/arm/mach-s5p64x0/include/mach/uncompress.h
index 0b896fc..436920a 100644
--- a/arch/arm/mach-s5p64x0/include/mach/uncompress.h
+++ b/arch/arm/mach-s5p64x0/include/mach/uncompress.h
@@ -9,10 +9,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
 */
-
-#ifndef __ASM_ARCH_UNCOMPRESS_H
-#define __ASM_ARCH_UNCOMPRESS_H
-
 #define ARCH_UCUART_NONGENERIC
 
 #include <mach/map.h>
@@ -177,5 +173,3 @@ static void arch_detect_cpu(void)
 {
 	/* we do not need to do any cpu detection here at the moment. */
 }
-
-#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s5pc100/include/mach/uncompress.h b/arch/arm/mach-s5pc100/include/mach/uncompress.h
index 3d67981..9d64a2c 100644
--- a/arch/arm/mach-s5pc100/include/mach/uncompress.h
+++ b/arch/arm/mach-s5pc100/include/mach/uncompress.h
@@ -11,10 +11,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
 */
-
-#ifndef __ASM_ARCH_UNCOMPRESS_H
-#define __ASM_ARCH_UNCOMPRESS_H
-
 #define ARCH_UCUART_NONGENERIC
 
 #include <mach/map.h>
@@ -26,5 +22,3 @@ static void arch_detect_cpu(void)
 	fifo_mask = S3C2440_UFSTAT_TXMASK;
 	fifo_max = 63 << S3C2440_UFSTAT_TXSHIFT;
 }
-
-#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/uncompress.h b/arch/arm/mach-s5pv210/include/mach/uncompress.h
index f5454f3..81afd51 100644
--- a/arch/arm/mach-s5pv210/include/mach/uncompress.h
+++ b/arch/arm/mach-s5pv210/include/mach/uncompress.h
@@ -1,18 +1,8 @@
-/* linux/arch/arm/mach-s5pv210/include/mach/uncompress.h
- *
- * Copyright (c) 2010 Samsung Electronics Co., Ltd.
- *		http://www.samsung.com/
- *
- * S5PV210 - uncompress code
- *
+/*
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
-*/
-
-#ifndef __ASM_ARCH_UNCOMPRESS_H
-#define __ASM_ARCH_UNCOMPRESS_H
-
+ */
 #define ARCH_UCUART_NONGENERIC
 #include <mach/map.h>
 #include <plat/uncompress.h>
@@ -21,5 +11,3 @@ static void arch_detect_cpu(void)
 {
 	/* we do not need to do any cpu detection here at the moment. */
 }
-
-#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-sa1100/include/mach/uncompress.h b/arch/arm/mach-sa1100/include/mach/uncompress.h
index 714f957..4c89c40 100644
--- a/arch/arm/mach-sa1100/include/mach/uncompress.h
+++ b/arch/arm/mach-sa1100/include/mach/uncompress.h
@@ -1,11 +1,8 @@
 /*
- * arch/arm/mach-sa1100/include/mach/uncompress.h
- *
- * (C) 1999 Nicolas Pitre <nico@fluxnic.net>
- *
- * Reorganised to be machine independent.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
-
 #include "hardware.h"
 
 static inline int uart_enabled(int base)
diff --git a/arch/arm/mach-shark/include/mach/uncompress.h b/arch/arm/mach-shark/include/mach/uncompress.h
index cc1ce9b..3d3ab55 100644
--- a/arch/arm/mach-shark/include/mach/uncompress.h
+++ b/arch/arm/mach-shark/include/mach/uncompress.h
@@ -1,10 +1,7 @@
 /*
- * arch/arm/mach-shark/include/mach/uncompress.h
- * by Alexander Schulz
- *
- * derived from:
- * arch/arm/mach-footbridge/include/mach/uncompress.h
- * Copyright (C) 1996,1997,1998 Russell King
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 static inline void arch_decomp_setup(void)
 {
diff --git a/arch/arm/mach-shmobile/include/mach/uncompress.h b/arch/arm/mach-shmobile/include/mach/uncompress.h
index 9df3a71..346028a 100644
--- a/arch/arm/mach-shmobile/include/mach/uncompress.h
+++ b/arch/arm/mach-shmobile/include/mach/uncompress.h
@@ -1,11 +1,10 @@
-#ifndef __ASM_MACH_UNCOMPRESS_H
-#define __ASM_MACH_UNCOMPRESS_H
-
-#define ARCH_UCUART_NONGENERIC
-
 /*
- * This does not append a newline
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
+#define ARCH_UCUART_NONGENERIC
+
 static void putc(int c)
 {
 }
@@ -15,5 +14,3 @@ static inline void flush(void)
 }
 
 #define arch_decomp_setup()
-
-#endif /* __ASM_MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/uncompress.h b/arch/arm/mach-spear3xx/include/mach/uncompress.h
index 53ba8bb..a4acb71 100644
--- a/arch/arm/mach-spear3xx/include/mach/uncompress.h
+++ b/arch/arm/mach-spear3xx/include/mach/uncompress.h
@@ -1,19 +1 @@
-/*
- * arch/arm/mach-spear3xx/include/mach/uncompress.h
- *
- * Serial port stubs for kernel decompress status messages
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar<viresh.kumar@st.com>
- *
- * 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.
- */
-
-#ifndef __MACH_UNCOMPRESS_H
-#define __MACH_UNCOMPRESS_H
-
 #include <plat/uncompress.h>
-
-#endif /* __MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-spear6xx/include/mach/uncompress.h b/arch/arm/mach-spear6xx/include/mach/uncompress.h
index 77f0765..a4acb71 100644
--- a/arch/arm/mach-spear6xx/include/mach/uncompress.h
+++ b/arch/arm/mach-spear6xx/include/mach/uncompress.h
@@ -1,19 +1 @@
-/*
- * arch/arm/mach-spear6xx/include/mach/uncompress.h
- *
- * Serial port stubs for kernel decompress status messages
- *
- * Copyright (C) 2009 ST Microelectronics
- * Rajeev Kumar<rajeev-dlh.kumar@st.com>
- *
- * 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.
- */
-
-#ifndef __MACH_UNCOMPRESS_H
-#define __MACH_UNCOMPRESS_H
-
 #include <plat/uncompress.h>
-
-#endif	/* __MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-tegra/include/mach/uncompress.h b/arch/arm/mach-tegra/include/mach/uncompress.h
index 5c3ec5e..13318ef 100644
--- a/arch/arm/mach-tegra/include/mach/uncompress.h
+++ b/arch/arm/mach-tegra/include/mach/uncompress.h
@@ -1,26 +1,8 @@
 /*
- * arch/arm/mach-tegra/include/mach/uncompress.h
- *
- * Copyright (C) 2010 Google, Inc.
- *
- * Author:
- *	Colin Cross <ccross@google.com>
- *	Erik Gilling <konkers@google.com>
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * 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.
- *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
-
-#ifndef __MACH_TEGRA_UNCOMPRESS_H
-#define __MACH_TEGRA_UNCOMPRESS_H
-
 #include <linux/types.h>
 #include <linux/serial_reg.h>
 
@@ -38,5 +20,3 @@ static inline void arch_decomp_setup(void)
 
 	ucuart_init_8250(TEGRA_DEBUG_UART_BASE, 2, UCUART_IO_MEM8);
 }
-
-#endif
diff --git a/arch/arm/mach-u300/include/mach/uncompress.h b/arch/arm/mach-u300/include/mach/uncompress.h
index 7f09047..df644d4 100644
--- a/arch/arm/mach-u300/include/mach/uncompress.h
+++ b/arch/arm/mach-u300/include/mach/uncompress.h
@@ -1,21 +1,7 @@
 /*
- * arch/arm/mach-u300/include/mach/uncompress.h
- *
- * Copyright (C) 2003 ARM Limited
- *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 static inline void arch_decomp_setup(void)
 {
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h
index eb30110..39fcc4f 100644
--- a/arch/arm/mach-ux500/include/mach/uncompress.h
+++ b/arch/arm/mach-ux500/include/mach/uncompress.h
@@ -1,23 +1,8 @@
 /*
- *  Copyright (C) 2009 ST-Ericsson
- *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
-#ifndef __ASM_ARCH_UNCOMPRESS_H
-#define __ASM_ARCH_UNCOMPRESS_H
-
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
 
@@ -29,5 +14,3 @@ static inline void arch_decomp_setup(void)
 	else
 		ucuart_init_amba01x(U8500_UART2_BASE);
 }
-
-#endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-versatile/include/mach/uncompress.h b/arch/arm/mach-versatile/include/mach/uncompress.h
index 01390bd..5afe25b 100644
--- a/arch/arm/mach-versatile/include/mach/uncompress.h
+++ b/arch/arm/mach-versatile/include/mach/uncompress.h
@@ -1,21 +1,7 @@
 /*
- *  arch/arm/mach-versatile/include/mach/uncompress.h
- *
- *  Copyright (C) 2003 ARM Limited
- *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 static inline void arch_decomp_setup(void)
 {
diff --git a/arch/arm/mach-vexpress/include/mach/uncompress.h b/arch/arm/mach-vexpress/include/mach/uncompress.h
index 970eba5..aedf7cc 100644
--- a/arch/arm/mach-vexpress/include/mach/uncompress.h
+++ b/arch/arm/mach-vexpress/include/mach/uncompress.h
@@ -1,21 +1,7 @@
 /*
- *  arch/arm/mach-vexpress/include/mach/uncompress.h
- *
- *  Copyright (C) 2003 ARM Limited
- *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 static inline void arch_decomp_setup(void)
 {
diff --git a/arch/arm/mach-vt8500/include/mach/uncompress.h b/arch/arm/mach-vt8500/include/mach/uncompress.h
index 7fb6603..477ab84 100644
--- a/arch/arm/mach-vt8500/include/mach/uncompress.h
+++ b/arch/arm/mach-vt8500/include/mach/uncompress.h
@@ -1,18 +1,7 @@
-/* arch/arm/mach-vt8500/include/mach/uncompress.h
- *
- * Copyright (C) 2010 Alexey Charkov <alchark@gmail.com>
- *
- * Based on arch/arm/mach-dove/include/mach/uncompress.h
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * 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.
- *
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 static inline void arch_decomp_setup(void)
 {
diff --git a/arch/arm/mach-w90x900/include/mach/uncompress.h b/arch/arm/mach-w90x900/include/mach/uncompress.h
index f082f83..6118a77 100644
--- a/arch/arm/mach-w90x900/include/mach/uncompress.h
+++ b/arch/arm/mach-w90x900/include/mach/uncompress.h
@@ -1,27 +1,11 @@
 /*
- * arch/arm/mach-w90x900/include/mach/uncompress.h
- *
- * Copyright (c) 2008 Nuvoton technology corporation
- * All rights reserved.
- *
- * Wan ZongShun <mcuos.com@gmail.com>
- *
- * Based on arch/arm/mach-s3c2410/include/mach/uncompress.h
- *
  * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
-
-#ifndef __ASM_ARCH_UNCOMPRESS_H
-#define __ASM_ARCH_UNCOMPRESS_H
-
 #include <mach/map.h>
 
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(W90X900_PA_UART, 2, UCUART_IO_MEM32);
 }
-#endif/* __ASM_W90X900_UNCOMPRESS_H */
diff --git a/arch/arm/mach-zynq/include/mach/uncompress.h b/arch/arm/mach-zynq/include/mach/uncompress.h
index 5eaf93b..fb1bbdf 100644
--- a/arch/arm/mach-zynq/include/mach/uncompress.h
+++ b/arch/arm/mach-zynq/include/mach/uncompress.h
@@ -1,20 +1,8 @@
-/* arch/arm/mach-zynq/include/mach/uncompress.h
- *
- *  Copyright (C) 2011 Xilinx
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * 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.
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
-
-#ifndef __MACH_UNCOMPRESS_H__
-#define __MACH_UNCOMPRESS_H__
-
 #include <mach/zynq_soc.h>
 #include <mach/uart.h>
 
@@ -24,5 +12,3 @@ static inline void arch_decomp_setup(void)
 			UART_SR_OFFSET, UART_SR_TXFULL, 0,
 			UART_SR_OFFSET, UART_SR_TXEMPTY, UART_SR_TXEMPTY);
 }
-
-#endif
diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/plat-mxc/include/mach/uncompress.h
index b7023be..00059cc 100644
--- a/arch/arm/plat-mxc/include/mach/uncompress.h
+++ b/arch/arm/plat-mxc/include/mach/uncompress.h
@@ -14,9 +14,6 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  */
-#ifndef __ASM_ARCH_MXC_UNCOMPRESS_H__
-#define __ASM_ARCH_MXC_UNCOMPRESS_H__
-
 #define __MXC_BOOT_UNCOMPRESS
 
 #include <asm/mach-types.h>
@@ -111,5 +108,3 @@ static inline void arch_decomp_setup(void)
 	ucuart_init(uart_base, 0, UCUART_IO_MEM32, TXR,
 			USR2, USR2_TXFE, USR2_TXFE, 0, 0, 0);
 }
-
-#endif				/* __ASM_ARCH_MXC_UNCOMPRESS_H__ */
diff --git a/arch/arm/plat-spear/include/plat/uncompress.h b/arch/arm/plat-spear/include/plat/uncompress.h
index b9d8f6e..ffdfcde 100644
--- a/arch/arm/plat-spear/include/plat/uncompress.h
+++ b/arch/arm/plat-spear/include/plat/uncompress.h
@@ -1,22 +1,10 @@
 /*
- * arch/arm/plat-spear/include/plat/uncompress.h
- *
- * Serial port stubs for kernel decompress status messages
- *
- * Copyright (C) 2009 ST Microelectronics
- * Viresh Kumar<viresh.kumar@st.com>
- *
- * 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.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 #include <mach/hardware.h>
-
-#ifndef __PLAT_UNCOMPRESS_H
-#define __PLAT_UNCOMPRESS_H
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_amba01x(SPEAR_DBG_UART_BASE);
 }
-#endif /* __PLAT_UNCOMPRESS_H */
diff --git a/arch/arm/plat-tcc/include/mach/uncompress.h b/arch/arm/plat-tcc/include/mach/uncompress.h
index 23b2b77..f12e63e 100644
--- a/arch/arm/plat-tcc/include/mach/uncompress.h
+++ b/arch/arm/plat-tcc/include/mach/uncompress.h
@@ -1,7 +1,7 @@
 /*
- * Copyright (C) 2009 Hans J. Koch <hjk@linutronix.de>
- *
- * This file is licensed under the terms of the GPL version 2.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
  */
 #include <mach/tcc8k-regs.h>
 
-- 
1.7.4.1

^ permalink raw reply related

* [RFC PATCH 12/15] ARM: uncompress.h: make the ucuart driver the default implementation
From: Zoltan Devai @ 2011-10-23 21:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1319404245-12740-1-git-send-email-zoss@devai.org>

As most of the machines now use the ucuart driver, let's make
this the default implementation, and mark those which do not
conform with ARCH_UCUART_NONGENERIC.

Signed-off-by: Zoltan Devai <zoss@devai.org>
---
 arch/arm/boot/compressed/print.c                   |    2 +-
 arch/arm/mach-at91/include/mach/uncompress.h       |    9 +++------
 arch/arm/mach-bcmring/include/mach/uncompress.h    |    1 -
 arch/arm/mach-clps711x/include/mach/uncompress.h   |    2 --
 arch/arm/mach-cns3xxx/include/mach/uncompress.h    |    2 --
 arch/arm/mach-davinci/include/mach/uncompress.h    |    2 --
 arch/arm/mach-dove/include/mach/uncompress.h       |    2 --
 arch/arm/mach-ebsa110/include/mach/uncompress.h    |    1 -
 arch/arm/mach-ep93xx/include/mach/uncompress.h     |    2 --
 arch/arm/mach-footbridge/include/mach/uncompress.h |    2 --
 arch/arm/mach-gemini/include/mach/uncompress.h     |    2 --
 arch/arm/mach-h720x/include/mach/uncompress.h      |    2 --
 arch/arm/mach-integrator/include/mach/uncompress.h |    2 --
 arch/arm/mach-iop13xx/include/mach/uncompress.h    |    2 --
 arch/arm/mach-iop32x/include/mach/uncompress.h     |    2 --
 arch/arm/mach-iop33x/include/mach/uncompress.h     |    2 --
 arch/arm/mach-ixp2000/include/mach/uncompress.h    |    3 ---
 arch/arm/mach-ixp23xx/include/mach/uncompress.h    |    2 --
 arch/arm/mach-ixp4xx/include/mach/uncompress.h     |    2 --
 arch/arm/mach-kirkwood/include/mach/uncompress.h   |    2 --
 arch/arm/mach-ks8695/include/mach/uncompress.h     |    2 --
 arch/arm/mach-lpc32xx/include/mach/uncompress.h    |    2 --
 arch/arm/mach-msm/include/mach/uncompress.h        |    2 --
 arch/arm/mach-mv78xx0/include/mach/uncompress.h    |    4 ----
 arch/arm/mach-netx/include/mach/uncompress.h       |    2 --
 arch/arm/mach-nomadik/include/mach/uncompress.h    |    2 --
 arch/arm/mach-orion5x/include/mach/uncompress.h    |    2 --
 arch/arm/mach-picoxcell/include/mach/uncompress.h  |    1 +
 arch/arm/mach-pnx4008/include/mach/uncompress.h    |    1 -
 arch/arm/mach-prima2/include/mach/uncompress.h     |    2 --
 arch/arm/mach-pxa/include/mach/uncompress.h        |    2 --
 arch/arm/mach-realview/include/mach/uncompress.h   |    1 -
 arch/arm/mach-rpc/include/mach/uncompress.h        |    4 +++-
 arch/arm/mach-s3c2410/include/mach/uncompress.h    |    2 ++
 arch/arm/mach-s5p64x0/include/mach/uncompress.h    |    2 ++
 arch/arm/mach-s5pc100/include/mach/uncompress.h    |    2 ++
 arch/arm/mach-s5pv210/include/mach/uncompress.h    |    1 +
 arch/arm/mach-sa1100/include/mach/uncompress.h     |    8 --------
 arch/arm/mach-shark/include/mach/uncompress.h      |    3 ---
 arch/arm/mach-shmobile/include/mach/uncompress.h   |    2 ++
 arch/arm/mach-tegra/include/mach/uncompress.h      |    2 --
 arch/arm/mach-u300/include/mach/uncompress.h       |    2 --
 arch/arm/mach-versatile/include/mach/uncompress.h  |    2 --
 arch/arm/mach-vexpress/include/mach/uncompress.h   |    2 --
 arch/arm/mach-vt8500/include/mach/uncompress.h     |    2 --
 arch/arm/mach-zynq/include/mach/uncompress.h       |    2 --
 arch/arm/plat-samsung/include/plat/uncompress.h    |    2 ++
 arch/arm/plat-spear/include/plat/uncompress.h      |    2 --
 arch/arm/plat-tcc/include/mach/uncompress.h        |    2 --
 49 files changed, 19 insertions(+), 92 deletions(-)

diff --git a/arch/arm/boot/compressed/print.c b/arch/arm/boot/compressed/print.c
index 24a08d4..1529d15 100644
--- a/arch/arm/boot/compressed/print.c
+++ b/arch/arm/boot/compressed/print.c
@@ -54,7 +54,7 @@ struct uncompress_uart ucuart;
 
 #include <mach/uncompress.h>
 
-#ifdef ARCH_HAVE_UCUART_GENERIC
+#ifndef ARCH_UCUART_NONGENERIC
 
 #include <linux/io.h>
 #include <linux/serial_reg.h>
diff --git a/arch/arm/mach-at91/include/mach/uncompress.h b/arch/arm/mach-at91/include/mach/uncompress.h
index 46acdd5..59c1c68 100644
--- a/arch/arm/mach-at91/include/mach/uncompress.h
+++ b/arch/arm/mach-at91/include/mach/uncompress.h
@@ -21,7 +21,6 @@
 #ifndef __ASM_ARCH_UNCOMPRESS_H
 #define __ASM_ARCH_UNCOMPRESS_H
 
-#include <linux/io.h>
 #include <linux/atmel_serial.h>
 
 #if defined(CONFIG_AT91_EARLY_DBGU)
@@ -38,7 +37,8 @@
 #define UART_OFFSET AT91_USART4
 #elif defined(CONFIG_AT91_EARLY_USART5)
 #define UART_OFFSET AT91_USART5
-#endif
+#elif
+#define UART_OFFSET 0
 
 /*
  * The following code assumes the serial port has already been
@@ -47,9 +47,6 @@
  *
  * This does not append a newline
  */
-#ifdef UART_OFFSET
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init(UART_OFFSET, 0, UCUART_IO_MEM32, ATMEL_US_THR,
@@ -57,4 +54,4 @@ static inline void arch_decomp_setup(void)
 			ATMEL_US_CSR, ATMEL_US_TXEMPTY, ATMEL_US_TXEMPTY);
 }
 
-#endif /* UART_OFFSET */
+#endif
\ No newline at end of file
diff --git a/arch/arm/mach-bcmring/include/mach/uncompress.h b/arch/arm/mach-bcmring/include/mach/uncompress.h
index 7e44ad3..125f7b4 100644
--- a/arch/arm/mach-bcmring/include/mach/uncompress.h
+++ b/arch/arm/mach-bcmring/include/mach/uncompress.h
@@ -16,7 +16,6 @@
 #define BCMRING_UART_0_DR	MM_ADDR_IO_UARTA
 #define BCMRING_UART_0_FR	0x18
 
-#define ARCH_HAVE_UCUART_GENERIC
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init(MM_ADDR_IO_UARTA, 0, UCUART_IO_MEM32, BCMRING_UART_0_DR,
diff --git a/arch/arm/mach-clps711x/include/mach/uncompress.h b/arch/arm/mach-clps711x/include/mach/uncompress.h
index ba17cc6..c0fadf2 100644
--- a/arch/arm/mach-clps711x/include/mach/uncompress.h
+++ b/arch/arm/mach-clps711x/include/mach/uncompress.h
@@ -28,8 +28,6 @@
 #define UARTDRx	UARTDR1
 #endif
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init(CLPS7111_PHYS_BASE, 0, UCUART_IO_MEM32, UARTDRx,
diff --git a/arch/arm/mach-cns3xxx/include/mach/uncompress.h b/arch/arm/mach-cns3xxx/include/mach/uncompress.h
index 93cdbd6..35be756 100644
--- a/arch/arm/mach-cns3xxx/include/mach/uncompress.h
+++ b/arch/arm/mach-cns3xxx/include/mach/uncompress.h
@@ -10,8 +10,6 @@
 #include <asm/mach-types.h>
 #include <mach/cns3xxx.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	if (machine_is_cns3420vb())
diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h
index daa318d..ca9308a 100644
--- a/arch/arm/mach-davinci/include/mach/uncompress.h
+++ b/arch/arm/mach-davinci/include/mach/uncompress.h
@@ -24,8 +24,6 @@
 
 #include <mach/serial.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void set_uart_info(u32 phys, void * __iomem virt)
 {
 	/*
diff --git a/arch/arm/mach-dove/include/mach/uncompress.h b/arch/arm/mach-dove/include/mach/uncompress.h
index 0062a56..97a00eb 100644
--- a/arch/arm/mach-dove/include/mach/uncompress.h
+++ b/arch/arm/mach-dove/include/mach/uncompress.h
@@ -8,8 +8,6 @@
 
 #include <mach/dove.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(DOVE_UART0_PHYS_BASE, 2, UCUART_IO_MEM8);
diff --git a/arch/arm/mach-ebsa110/include/mach/uncompress.h b/arch/arm/mach-ebsa110/include/mach/uncompress.h
index 56a569f..38c0f7f 100644
--- a/arch/arm/mach-ebsa110/include/mach/uncompress.h
+++ b/arch/arm/mach-ebsa110/include/mach/uncompress.h
@@ -7,7 +7,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#define ARCH_HAVE_UCUART_GENERIC
 
 static inline void arch_decomp_setup(void)
 {
diff --git a/arch/arm/mach-ep93xx/include/mach/uncompress.h b/arch/arm/mach-ep93xx/include/mach/uncompress.h
index 1b36813..b5693c9 100644
--- a/arch/arm/mach-ep93xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ep93xx/include/mach/uncompress.h
@@ -43,8 +43,6 @@ static void ethernet_reset(void)
 		;
 }
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ethernet_reset();
diff --git a/arch/arm/mach-footbridge/include/mach/uncompress.h b/arch/arm/mach-footbridge/include/mach/uncompress.h
index 32e9654..5f41698 100644
--- a/arch/arm/mach-footbridge/include/mach/uncompress.h
+++ b/arch/arm/mach-footbridge/include/mach/uncompress.h
@@ -15,8 +15,6 @@
 #define DC21285_BASE ((volatile unsigned int *)0x42000160)
 #define SER0_BASE    ((volatile unsigned char *)0x7c0003f8)
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	if (machine_is_netwinder())
diff --git a/arch/arm/mach-gemini/include/mach/uncompress.h b/arch/arm/mach-gemini/include/mach/uncompress.h
index 855eb5b..dd81586 100644
--- a/arch/arm/mach-gemini/include/mach/uncompress.h
+++ b/arch/arm/mach-gemini/include/mach/uncompress.h
@@ -15,8 +15,6 @@
 
 #include <mach/hardware.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(GEMINI_UART_BASE, 2, UCUART_IO_MEM32);
diff --git a/arch/arm/mach-h720x/include/mach/uncompress.h b/arch/arm/mach-h720x/include/mach/uncompress.h
index be44fd1..6f727ba 100644
--- a/arch/arm/mach-h720x/include/mach/uncompress.h
+++ b/arch/arm/mach-h720x/include/mach/uncompress.h
@@ -9,8 +9,6 @@
 
 #include <mach/hardware.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 /* debug-macro.S treats this port as an AMBA01x, but according to the
  * datasheet, this should be a 8250
  */
diff --git a/arch/arm/mach-integrator/include/mach/uncompress.h b/arch/arm/mach-integrator/include/mach/uncompress.h
index 19f2eb3..57cc838 100644
--- a/arch/arm/mach-integrator/include/mach/uncompress.h
+++ b/arch/arm/mach-integrator/include/mach/uncompress.h
@@ -17,8 +17,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_amba01x(0x16000000);
diff --git a/arch/arm/mach-iop13xx/include/mach/uncompress.h b/arch/arm/mach-iop13xx/include/mach/uncompress.h
index ac09a33..6c1c385 100644
--- a/arch/arm/mach-iop13xx/include/mach/uncompress.h
+++ b/arch/arm/mach-iop13xx/include/mach/uncompress.h
@@ -1,7 +1,5 @@
 #include <mach/hardware.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(IOP13XX_UART1_PHYS, 2, UCUART_IO_MEM32);
diff --git a/arch/arm/mach-iop32x/include/mach/uncompress.h b/arch/arm/mach-iop32x/include/mach/uncompress.h
index 97fb970..3d970a9 100644
--- a/arch/arm/mach-iop32x/include/mach/uncompress.h
+++ b/arch/arm/mach-iop32x/include/mach/uncompress.h
@@ -3,8 +3,6 @@
  */
 #include <mach/hardware.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	if (machine_is_iq80321())
diff --git a/arch/arm/mach-iop33x/include/mach/uncompress.h b/arch/arm/mach-iop33x/include/mach/uncompress.h
index 294c444..9ee4b3b 100644
--- a/arch/arm/mach-iop33x/include/mach/uncompress.h
+++ b/arch/arm/mach-iop33x/include/mach/uncompress.h
@@ -5,8 +5,6 @@
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	if (machine_is_iq80331() || machine_is_iq80332())
diff --git a/arch/arm/mach-ixp2000/include/mach/uncompress.h b/arch/arm/mach-ixp2000/include/mach/uncompress.h
index dc24c65..e9911fb 100644
--- a/arch/arm/mach-ixp2000/include/mach/uncompress.h
+++ b/arch/arm/mach-ixp2000/include/mach/uncompress.h
@@ -13,9 +13,6 @@
  *  option) any later version.
  *
  */
-
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(0xc0030000, 2, UCUART_IO_MEM32);
diff --git a/arch/arm/mach-ixp23xx/include/mach/uncompress.h b/arch/arm/mach-ixp23xx/include/mach/uncompress.h
index e986753..22cc9f5 100644
--- a/arch/arm/mach-ixp23xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ixp23xx/include/mach/uncompress.h
@@ -13,8 +13,6 @@
 
 #include <mach/ixp23xx.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(IXP23XX_UART1_PHYS, 2, UCUART_IO_MEM32);
diff --git a/arch/arm/mach-ixp4xx/include/mach/uncompress.h b/arch/arm/mach-ixp4xx/include/mach/uncompress.h
index 17b430a..a8d075c 100644
--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h
@@ -16,8 +16,6 @@
 #include "ixp4xx-regs.h"
 #include <asm/mach-types.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	/*
diff --git a/arch/arm/mach-kirkwood/include/mach/uncompress.h b/arch/arm/mach-kirkwood/include/mach/uncompress.h
index e46c96c..da9f19f 100644
--- a/arch/arm/mach-kirkwood/include/mach/uncompress.h
+++ b/arch/arm/mach-kirkwood/include/mach/uncompress.h
@@ -7,8 +7,6 @@
  */
 #include <mach/kirkwood.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(UART0_PHYS_BASE, 2, UCUART_IO_MEM8);
diff --git a/arch/arm/mach-ks8695/include/mach/uncompress.h b/arch/arm/mach-ks8695/include/mach/uncompress.h
index 9e6ba4e..99cac67 100644
--- a/arch/arm/mach-ks8695/include/mach/uncompress.h
+++ b/arch/arm/mach-ks8695/include/mach/uncompress.h
@@ -16,8 +16,6 @@
 
 #include <mach/regs-uart.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init(KS8695_UART_PA, 0, UCUART_MEM32, KS8695_URTH,
diff --git a/arch/arm/mach-lpc32xx/include/mach/uncompress.h b/arch/arm/mach-lpc32xx/include/mach/uncompress.h
index 61a16eb..0e119c4 100644
--- a/arch/arm/mach-lpc32xx/include/mach/uncompress.h
+++ b/arch/arm/mach-lpc32xx/include/mach/uncompress.h
@@ -21,8 +21,6 @@
 
 #include <mach/platform.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(LPC32XX_UART5_BASE, 2, UCUART_IO_MEM32);
diff --git a/arch/arm/mach-msm/include/mach/uncompress.h b/arch/arm/mach-msm/include/mach/uncompress.h
index d427ce8..0fa9795 100644
--- a/arch/arm/mach-msm/include/mach/uncompress.h
+++ b/arch/arm/mach-msm/include/mach/uncompress.h
@@ -19,8 +19,6 @@
 #include "linux/io.h"
 #include "mach/msm_iomap.h"
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 #if defined(MSM_DEBUG_UART_PHYS)
diff --git a/arch/arm/mach-mv78xx0/include/mach/uncompress.h b/arch/arm/mach-mv78xx0/include/mach/uncompress.h
index 720340e..064bb96 100644
--- a/arch/arm/mach-mv78xx0/include/mach/uncompress.h
+++ b/arch/arm/mach-mv78xx0/include/mach/uncompress.h
@@ -5,12 +5,8 @@
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-
-#include <linux/serial_reg.h>
 #include <mach/mv78xx0.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(UART0_PHYS_BASE, 2, UCUART_IO_MEM8);
diff --git a/arch/arm/mach-netx/include/mach/uncompress.h b/arch/arm/mach-netx/include/mach/uncompress.h
index f61e22b..5a32b87 100644
--- a/arch/arm/mach-netx/include/mach/uncompress.h
+++ b/arch/arm/mach-netx/include/mach/uncompress.h
@@ -27,8 +27,6 @@
 #define UART1_BASE 0x100a00
 #define UART2_BASE 0x100a80
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_amba01x(UART1_BASE);
diff --git a/arch/arm/mach-nomadik/include/mach/uncompress.h b/arch/arm/mach-nomadik/include/mach/uncompress.h
index 1eb4ae6..f5da290 100644
--- a/arch/arm/mach-nomadik/include/mach/uncompress.h
+++ b/arch/arm/mach-nomadik/include/mach/uncompress.h
@@ -21,8 +21,6 @@
 
 #include <mach/hardware.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_amba01x(NOMADIK_UART1_BASE);
diff --git a/arch/arm/mach-orion5x/include/mach/uncompress.h b/arch/arm/mach-orion5x/include/mach/uncompress.h
index 1ac83f5..4d7c1ba 100644
--- a/arch/arm/mach-orion5x/include/mach/uncompress.h
+++ b/arch/arm/mach-orion5x/include/mach/uncompress.h
@@ -9,8 +9,6 @@
  */
 #include <mach/orion5x.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(UART0_PHYS_BASE, 2, UCUART_IO_MEM8);
diff --git a/arch/arm/mach-picoxcell/include/mach/uncompress.h b/arch/arm/mach-picoxcell/include/mach/uncompress.h
index db46249..9464c63 100644
--- a/arch/arm/mach-picoxcell/include/mach/uncompress.h
+++ b/arch/arm/mach-picoxcell/include/mach/uncompress.h
@@ -15,6 +15,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+#define ARCH_UCUART_NONGENERIC
 #define putc(c)
 #define flush()
 #define arch_decomp_setup()
diff --git a/arch/arm/mach-pnx4008/include/mach/uncompress.h b/arch/arm/mach-pnx4008/include/mach/uncompress.h
index dee85ef..1a18501 100644
--- a/arch/arm/mach-pnx4008/include/mach/uncompress.h
+++ b/arch/arm/mach-pnx4008/include/mach/uncompress.h
@@ -20,7 +20,6 @@
  */
 
 #define UART5_BASE 0x40090000
-#define ARCH_HAVE_UCUART_GENERIC
 
 static inline void arch_decomp_setup(void)
 {
diff --git a/arch/arm/mach-prima2/include/mach/uncompress.h b/arch/arm/mach-prima2/include/mach/uncompress.h
index 14effdc..29ee15e 100644
--- a/arch/arm/mach-prima2/include/mach/uncompress.h
+++ b/arch/arm/mach-prima2/include/mach/uncompress.h
@@ -11,8 +11,6 @@
 
 #include <mach/uart.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init(SIRFSOC_UART1_PA_BASE, 0, UCUART_IO_MEM32,
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h b/arch/arm/mach-pxa/include/mach/uncompress.h
index 57f1755..7d24bf1 100644
--- a/arch/arm/mach-pxa/include/mach/uncompress.h
+++ b/arch/arm/mach-pxa/include/mach/uncompress.h
@@ -16,8 +16,6 @@
 #define BTUART_BASE	(0x40200000)
 #define STUART_BASE	(0x40700000)
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	unsigned long uart_base;
diff --git a/arch/arm/mach-realview/include/mach/uncompress.h b/arch/arm/mach-realview/include/mach/uncompress.h
index 899aef7..f69b003 100644
--- a/arch/arm/mach-realview/include/mach/uncompress.h
+++ b/arch/arm/mach-realview/include/mach/uncompress.h
@@ -25,7 +25,6 @@
 #include <mach/board-pba8.h>
 #include <mach/board-pbx.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
 static inline void arch_decomp_setup(void)
 {
 	int uart_base;
diff --git a/arch/arm/mach-rpc/include/mach/uncompress.h b/arch/arm/mach-rpc/include/mach/uncompress.h
index 0fd4b0b..4583bd1 100644
--- a/arch/arm/mach-rpc/include/mach/uncompress.h
+++ b/arch/arm/mach-rpc/include/mach/uncompress.h
@@ -7,8 +7,10 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#define ARCH_UCUART_NONGENERIC
+
 #define VIDMEM ((char *)SCREEN_START)
- 
+
 #include <linux/io.h>
 #include <mach/hardware.h>
 #include <asm/setup.h>
diff --git a/arch/arm/mach-s3c2410/include/mach/uncompress.h b/arch/arm/mach-s3c2410/include/mach/uncompress.h
index 8b283f8..7c98c81 100644
--- a/arch/arm/mach-s3c2410/include/mach/uncompress.h
+++ b/arch/arm/mach-s3c2410/include/mach/uncompress.h
@@ -14,6 +14,8 @@
 #ifndef __ASM_ARCH_UNCOMPRESS_H
 #define __ASM_ARCH_UNCOMPRESS_H
 
+#define ARCH_UCUART_NONGENERIC
+
 #include <mach/regs-gpio.h>
 #include <mach/map.h>
 
diff --git a/arch/arm/mach-s5p64x0/include/mach/uncompress.h b/arch/arm/mach-s5p64x0/include/mach/uncompress.h
index 00b70b8..0b896fc 100644
--- a/arch/arm/mach-s5p64x0/include/mach/uncompress.h
+++ b/arch/arm/mach-s5p64x0/include/mach/uncompress.h
@@ -13,6 +13,8 @@
 #ifndef __ASM_ARCH_UNCOMPRESS_H
 #define __ASM_ARCH_UNCOMPRESS_H
 
+#define ARCH_UCUART_NONGENERIC
+
 #include <mach/map.h>
 
 /*
diff --git a/arch/arm/mach-s5pc100/include/mach/uncompress.h b/arch/arm/mach-s5pc100/include/mach/uncompress.h
index 01ccf53..3d67981 100644
--- a/arch/arm/mach-s5pc100/include/mach/uncompress.h
+++ b/arch/arm/mach-s5pc100/include/mach/uncompress.h
@@ -15,6 +15,8 @@
 #ifndef __ASM_ARCH_UNCOMPRESS_H
 #define __ASM_ARCH_UNCOMPRESS_H
 
+#define ARCH_UCUART_NONGENERIC
+
 #include <mach/map.h>
 #include <plat/uncompress.h>
 
diff --git a/arch/arm/mach-s5pv210/include/mach/uncompress.h b/arch/arm/mach-s5pv210/include/mach/uncompress.h
index 08ff2fd..f5454f3 100644
--- a/arch/arm/mach-s5pv210/include/mach/uncompress.h
+++ b/arch/arm/mach-s5pv210/include/mach/uncompress.h
@@ -13,6 +13,7 @@
 #ifndef __ASM_ARCH_UNCOMPRESS_H
 #define __ASM_ARCH_UNCOMPRESS_H
 
+#define ARCH_UCUART_NONGENERIC
 #include <mach/map.h>
 #include <plat/uncompress.h>
 
diff --git a/arch/arm/mach-sa1100/include/mach/uncompress.h b/arch/arm/mach-sa1100/include/mach/uncompress.h
index dc0c8b7..714f957 100644
--- a/arch/arm/mach-sa1100/include/mach/uncompress.h
+++ b/arch/arm/mach-sa1100/include/mach/uncompress.h
@@ -8,14 +8,6 @@
 
 #include "hardware.h"
 
-/*
- * The following code assumes the serial port has already been
- * initialized by the bootloader.  We search for the first enabled
- * port in the most probable order.  If you didn't setup a port in
- * your bootloader then nothing will appear (which might be desired).
- */
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline int uart_enabled(int base)
 {
 	if (__raw_readl((void __iomem *)(base + UTCR3)) & UTCR3_TXE)
diff --git a/arch/arm/mach-shark/include/mach/uncompress.h b/arch/arm/mach-shark/include/mach/uncompress.h
index 9900826..cc1ce9b 100644
--- a/arch/arm/mach-shark/include/mach/uncompress.h
+++ b/arch/arm/mach-shark/include/mach/uncompress.h
@@ -6,9 +6,6 @@
  * arch/arm/mach-footbridge/include/mach/uncompress.h
  * Copyright (C) 1996,1997,1998 Russell King
  */
-
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(0x400003f8, 0, UCUART_IO_MEM8);
diff --git a/arch/arm/mach-shmobile/include/mach/uncompress.h b/arch/arm/mach-shmobile/include/mach/uncompress.h
index 462e84e..9df3a71 100644
--- a/arch/arm/mach-shmobile/include/mach/uncompress.h
+++ b/arch/arm/mach-shmobile/include/mach/uncompress.h
@@ -1,6 +1,8 @@
 #ifndef __ASM_MACH_UNCOMPRESS_H
 #define __ASM_MACH_UNCOMPRESS_H
 
+#define ARCH_UCUART_NONGENERIC
+
 /*
  * This does not append a newline
  */
diff --git a/arch/arm/mach-tegra/include/mach/uncompress.h b/arch/arm/mach-tegra/include/mach/uncompress.h
index 61dfd6b..5c3ec5e 100644
--- a/arch/arm/mach-tegra/include/mach/uncompress.h
+++ b/arch/arm/mach-tegra/include/mach/uncompress.h
@@ -26,8 +26,6 @@
 
 #include <mach/iomap.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	void __iomem *uart_base = (void*)TEGRA_DEBUG_UART_BASE;
diff --git a/arch/arm/mach-u300/include/mach/uncompress.h b/arch/arm/mach-u300/include/mach/uncompress.h
index 8bc389a..7f09047 100644
--- a/arch/arm/mach-u300/include/mach/uncompress.h
+++ b/arch/arm/mach-u300/include/mach/uncompress.h
@@ -17,8 +17,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_amba01x(0xc0013000);
diff --git a/arch/arm/mach-versatile/include/mach/uncompress.h b/arch/arm/mach-versatile/include/mach/uncompress.h
index 14294ef..01390bd 100644
--- a/arch/arm/mach-versatile/include/mach/uncompress.h
+++ b/arch/arm/mach-versatile/include/mach/uncompress.h
@@ -17,8 +17,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_amba01x(0x101F1000);
diff --git a/arch/arm/mach-vexpress/include/mach/uncompress.h b/arch/arm/mach-vexpress/include/mach/uncompress.h
index 00c45e5..970eba5 100644
--- a/arch/arm/mach-vexpress/include/mach/uncompress.h
+++ b/arch/arm/mach-vexpress/include/mach/uncompress.h
@@ -17,8 +17,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_amba01x(0x10009000);
diff --git a/arch/arm/mach-vt8500/include/mach/uncompress.h b/arch/arm/mach-vt8500/include/mach/uncompress.h
index 3f7e315..7fb6603 100644
--- a/arch/arm/mach-vt8500/include/mach/uncompress.h
+++ b/arch/arm/mach-vt8500/include/mach/uncompress.h
@@ -14,8 +14,6 @@
  * GNU General Public License for more details.
  *
  */
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init(0xd8200000, 0, UCUART_IO_MEM8, 0, 0x1C, 0x2, 0, 0, 0, 0);
diff --git a/arch/arm/mach-zynq/include/mach/uncompress.h b/arch/arm/mach-zynq/include/mach/uncompress.h
index c968774..5eaf93b 100644
--- a/arch/arm/mach-zynq/include/mach/uncompress.h
+++ b/arch/arm/mach-zynq/include/mach/uncompress.h
@@ -18,8 +18,6 @@
 #include <mach/zynq_soc.h>
 #include <mach/uart.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init(LL_UART_PADDR, 0, UCUART_IO_MEM32, UART_FIFO_OFFSET,
diff --git a/arch/arm/plat-samsung/include/plat/uncompress.h b/arch/arm/plat-samsung/include/plat/uncompress.h
index 94fecf9..114c6e5 100644
--- a/arch/arm/plat-samsung/include/plat/uncompress.h
+++ b/arch/arm/plat-samsung/include/plat/uncompress.h
@@ -14,6 +14,8 @@
 #ifndef __ASM_PLAT_UNCOMPRESS_H
 #define __ASM_PLAT_UNCOMPRESS_H
 
+#define ARCH_UCUART_NONGENERIC
+
 typedef unsigned int upf_t;	/* cannot include linux/serial_core.h */
 
 /* uart setup */
diff --git a/arch/arm/plat-spear/include/plat/uncompress.h b/arch/arm/plat-spear/include/plat/uncompress.h
index 1eb0d82..b9d8f6e 100644
--- a/arch/arm/plat-spear/include/plat/uncompress.h
+++ b/arch/arm/plat-spear/include/plat/uncompress.h
@@ -15,8 +15,6 @@
 #ifndef __PLAT_UNCOMPRESS_H
 #define __PLAT_UNCOMPRESS_H
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_amba01x(SPEAR_DBG_UART_BASE);
diff --git a/arch/arm/plat-tcc/include/mach/uncompress.h b/arch/arm/plat-tcc/include/mach/uncompress.h
index b71a605..23b2b77 100644
--- a/arch/arm/plat-tcc/include/mach/uncompress.h
+++ b/arch/arm/plat-tcc/include/mach/uncompress.h
@@ -5,8 +5,6 @@
  */
 #include <mach/tcc8k-regs.h>
 
-#define ARCH_HAVE_UCUART_GENERIC
-
 static inline void arch_decomp_setup(void)
 {
 	ucuart_init_8250(UART_BASE_PHYS, 2, UCUART_IO_MEM32);
-- 
1.7.4.1

^ permalink raw reply related

* [RFC PATCH 11/15] ARM: uncompress: Call arch_decomp_setup by default
From: Zoltan Devai @ 2011-10-23 21:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1319404245-12740-1-git-send-email-zoss@devai.org>

Now that the initialization of the ucuart uses arch_decomp_setup,
almost all machines use it, so make this the default behaviour.

Signed-off-by: Zoltan Devai <zoss@devai.org>
---
 arch/arm/boot/compressed/print.c                  |    8 --------
 arch/arm/mach-mmp/include/mach/uncompress.h       |    2 --
 arch/arm/mach-picoxcell/include/mach/uncompress.h |    1 +
 arch/arm/mach-rpc/include/mach/uncompress.h       |    2 --
 arch/arm/mach-s5p64x0/include/mach/uncompress.h   |    2 --
 arch/arm/mach-shmobile/include/mach/uncompress.h  |    2 ++
 arch/arm/mach-ux500/include/mach/uncompress.h     |    2 --
 arch/arm/plat-samsung/include/plat/uncompress.h   |    2 --
 8 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/arch/arm/boot/compressed/print.c b/arch/arm/boot/compressed/print.c
index fbffc99..24a08d4 100644
--- a/arch/arm/boot/compressed/print.c
+++ b/arch/arm/boot/compressed/print.c
@@ -56,8 +56,6 @@ struct uncompress_uart ucuart;
 
 #ifdef ARCH_HAVE_UCUART_GENERIC
 
-#define ARCH_HAVE_DECOMP_SETUP
-
 #include <linux/io.h>
 #include <linux/serial_reg.h>
 #include <linux/amba/serial.h>
@@ -224,13 +222,7 @@ void error(char *x)
 	while(1);	/* Halt */
 }
 
-#ifdef ARCH_HAVE_DECOMP_SETUP
 void inline decomp_setup(void)
 {
 	arch_decomp_setup();
 }
-#else /* ARCH_HAVE_DECOMP_SETUP */
-void inline decomp_setup(void)
-{
-}
-#endif /* ARCH_HAVE_DECOMP_SETUP */
diff --git a/arch/arm/mach-mmp/include/mach/uncompress.h b/arch/arm/mach-mmp/include/mach/uncompress.h
index 4cafe10..e9bf8bf 100644
--- a/arch/arm/mach-mmp/include/mach/uncompress.h
+++ b/arch/arm/mach-mmp/include/mach/uncompress.h
@@ -12,8 +12,6 @@
 #define UART2_BASE	(APB_PHYS_BASE + 0x17000)
 #define UART3_BASE	(APB_PHYS_BASE + 0x18000)
 
-#define ARCH_HAVE_DECOMP_SETUP
-
 static inline void arch_decomp_setup(void)
 {
 	if (machine_is_avengers_lite())
diff --git a/arch/arm/mach-picoxcell/include/mach/uncompress.h b/arch/arm/mach-picoxcell/include/mach/uncompress.h
index f04f368..db46249 100644
--- a/arch/arm/mach-picoxcell/include/mach/uncompress.h
+++ b/arch/arm/mach-picoxcell/include/mach/uncompress.h
@@ -17,3 +17,4 @@
  */
 #define putc(c)
 #define flush()
+#define arch_decomp_setup()
diff --git a/arch/arm/mach-rpc/include/mach/uncompress.h b/arch/arm/mach-rpc/include/mach/uncompress.h
index 5ea3974..0fd4b0b 100644
--- a/arch/arm/mach-rpc/include/mach/uncompress.h
+++ b/arch/arm/mach-rpc/include/mach/uncompress.h
@@ -109,8 +109,6 @@ static inline void flush(void)
 {
 }
 
-#define ARCH_HAVE_DECOMP_SETUP
-
 /*
  * Setup for decompression
  */
diff --git a/arch/arm/mach-s5p64x0/include/mach/uncompress.h b/arch/arm/mach-s5p64x0/include/mach/uncompress.h
index 8d537eb..00b70b8 100644
--- a/arch/arm/mach-s5p64x0/include/mach/uncompress.h
+++ b/arch/arm/mach-s5p64x0/include/mach/uncompress.h
@@ -151,8 +151,6 @@ static inline void arch_enable_uart_fifo(void)
 #define arch_enable_uart_fifo() do { } while(0)
 #endif
 
-#define ARCH_HAVE_DECOMP_SETUP
-
 static void arch_decomp_setup(void)
 {
 	/*
diff --git a/arch/arm/mach-shmobile/include/mach/uncompress.h b/arch/arm/mach-shmobile/include/mach/uncompress.h
index b2b2860..462e84e 100644
--- a/arch/arm/mach-shmobile/include/mach/uncompress.h
+++ b/arch/arm/mach-shmobile/include/mach/uncompress.h
@@ -12,4 +12,6 @@ static inline void flush(void)
 {
 }
 
+#define arch_decomp_setup()
+
 #endif /* __ASM_MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h
index 7e3b48a..eb30110 100644
--- a/arch/arm/mach-ux500/include/mach/uncompress.h
+++ b/arch/arm/mach-ux500/include/mach/uncompress.h
@@ -21,8 +21,6 @@
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
 
-#define ARCH_HAVE_DECOMP_SETUP
-
 static inline void arch_decomp_setup(void)
 {
 	/* Check in run time if we run on an U8500 or U5500 */
diff --git a/arch/arm/plat-samsung/include/plat/uncompress.h b/arch/arm/plat-samsung/include/plat/uncompress.h
index b10e0be..94fecf9 100644
--- a/arch/arm/plat-samsung/include/plat/uncompress.h
+++ b/arch/arm/plat-samsung/include/plat/uncompress.h
@@ -130,8 +130,6 @@ static inline void arch_enable_uart_fifo(void)
 #define arch_enable_uart_fifo() do { } while(0)
 #endif
 
-#define ARCH_HAVE_DECOMP_SETUP
-
 static void
 arch_decomp_setup(void)
 {
-- 
1.7.4.1

^ permalink raw reply related

* [RFC PATCH 10/15] ARM: uncompress.h: Convert machines to use the new ucuart driver
From: Zoltan Devai @ 2011-10-23 21:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1319404245-12740-1-git-send-email-zoss@devai.org>

Finally convert the machine-specific uncompress.h files
to use the ucuart driver. This gets rid dozens of
re-implementations for handling an UART.

Samsung stuff needs re-thinking.

Signed-off-by: Zoltan Devai <zoss@devai.org>
---
 arch/arm/mach-at91/include/mach/uncompress.h       |   24 ++-----
 arch/arm/mach-bcmring/include/mach/uncompress.h    |   29 ++------
 arch/arm/mach-clps711x/include/mach/uncompress.h   |   24 ++------
 arch/arm/mach-cns3xxx/include/mach/uncompress.h    |   35 +---------
 arch/arm/mach-davinci/include/mach/uncompress.h    |   24 +------
 arch/arm/mach-dove/include/mach/uncompress.h       |   21 +-----
 arch/arm/mach-ebsa110/include/mach/uncompress.h    |   30 +--------
 arch/arm/mach-ep93xx/include/mach/uncompress.h     |   48 +-------------
 arch/arm/mach-footbridge/include/mach/uncompress.h |   20 ++----
 arch/arm/mach-gemini/include/mach/uncompress.h     |   18 +----
 arch/arm/mach-h720x/include/mach/uncompress.h      |   21 ++----
 arch/arm/mach-integrator/include/mach/uncompress.h |   24 +------
 arch/arm/mach-iop13xx/include/mach/uncompress.h    |   15 +----
 arch/arm/mach-iop32x/include/mach/uncompress.h     |   30 ++-------
 arch/arm/mach-iop33x/include/mach/uncompress.h     |   26 +------
 arch/arm/mach-ixp2000/include/mach/uncompress.h    |   28 +-------
 arch/arm/mach-ixp23xx/include/mach/uncompress.h    |   19 +-----
 arch/arm/mach-ixp4xx/include/mach/uncompress.h     |   31 +--------
 arch/arm/mach-kirkwood/include/mach/uncompress.h   |   32 +--------
 arch/arm/mach-ks8695/include/mach/uncompress.h     |   16 ++---
 arch/arm/mach-lpc32xx/include/mach/uncompress.h    |   31 +--------
 arch/arm/mach-mmp/include/mach/uncompress.h        |   30 +--------
 arch/arm/mach-msm/include/mach/uncompress.h        |   17 ++---
 arch/arm/mach-mv78xx0/include/mach/uncompress.h    |   30 +--------
 arch/arm/mach-mxs/include/mach/uncompress.h        |   42 +-----------
 arch/arm/mach-netx/include/mach/uncompress.h       |   42 +-----------
 arch/arm/mach-nomadik/include/mach/uncompress.h    |   32 +--------
 arch/arm/mach-orion5x/include/mach/uncompress.h    |   32 +--------
 arch/arm/mach-pnx4008/include/mach/uncompress.h    |   18 +----
 arch/arm/mach-prima2/include/mach/uncompress.h     |   22 ++-----
 arch/arm/mach-pxa/include/mach/uncompress.h        |   69 +++++---------------
 arch/arm/mach-realview/include/mach/uncompress.h   |   47 +++----------
 arch/arm/mach-sa1100/include/mach/uncompress.h     |   41 ++++++------
 arch/arm/mach-shark/include/mach/uncompress.h      |   36 +---------
 arch/arm/mach-tegra/include/mach/uncompress.h      |   34 ++-------
 arch/arm/mach-u300/include/mach/uncompress.h       |   21 +-----
 arch/arm/mach-ux500/include/mach/uncompress.h      |   31 +--------
 arch/arm/mach-versatile/include/mach/uncompress.h  |   21 +-----
 arch/arm/mach-vexpress/include/mach/uncompress.h   |   27 +-------
 arch/arm/mach-vt8500/include/mach/uncompress.h     |   15 +----
 arch/arm/mach-w90x900/include/mach/uncompress.h    |   21 +------
 arch/arm/mach-zynq/include/mach/uncompress.h       |   25 ++------
 arch/arm/plat-mxc/include/mach/uncompress.h        |   34 +++-------
 arch/arm/plat-omap/include/plat/uncompress.h       |   43 +++---------
 arch/arm/plat-spear/include/plat/uncompress.h      |   19 +-----
 arch/arm/plat-tcc/include/mach/uncompress.h        |   21 +-----
 46 files changed, 227 insertions(+), 1089 deletions(-)

diff --git a/arch/arm/mach-at91/include/mach/uncompress.h b/arch/arm/mach-at91/include/mach/uncompress.h
index c644b13..46acdd5 100644
--- a/arch/arm/mach-at91/include/mach/uncompress.h
+++ b/arch/arm/mach-at91/include/mach/uncompress.h
@@ -47,26 +47,14 @@
  *
  * This does not append a newline
  */
-static void putc(int c)
-{
 #ifdef UART_OFFSET
-	void __iomem *sys = (void __iomem *) UART_OFFSET;	/* physical address */
-
-	while (!(__raw_readl(sys + ATMEL_US_CSR) & ATMEL_US_TXRDY))
-		barrier();
-	__raw_writel(c, sys + ATMEL_US_THR);
-#endif
-}
+#define ARCH_HAVE_UCUART_GENERIC
 
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
-#ifdef UART_OFFSET
-	void __iomem *sys = (void __iomem *) UART_OFFSET;	/* physical address */
-
-	/* wait for transmission to complete */
-	while (!(__raw_readl(sys + ATMEL_US_CSR) & ATMEL_US_TXEMPTY))
-		barrier();
-#endif
+	ucuart_init(UART_OFFSET, 0, UCUART_IO_MEM32, ATMEL_US_THR,
+			ATMEL_US_CSR, ATMEL_US_TXRDY, ATMEL_US_TXRDY,
+			ATMEL_US_CSR, ATMEL_US_TXEMPTY, ATMEL_US_TXEMPTY);
 }
 
-#endif
+#endif /* UART_OFFSET */
diff --git a/arch/arm/mach-bcmring/include/mach/uncompress.h b/arch/arm/mach-bcmring/include/mach/uncompress.h
index 7a365aa..7e44ad3 100644
--- a/arch/arm/mach-bcmring/include/mach/uncompress.h
+++ b/arch/arm/mach-bcmring/include/mach/uncompress.h
@@ -13,28 +13,13 @@
 *****************************************************************************/
 #include <mach/csp/mm_addr.h>
 
-#define BCMRING_UART_0_DR (*(volatile unsigned int *)MM_ADDR_IO_UARTA)
-#define BCMRING_UART_0_FR (*(volatile unsigned int *)(MM_ADDR_IO_UARTA + 0x18))
-/*
- * This does not append a newline
- */
-static inline void putc(int c)
-{
-	/* Send out UARTA */
-	while (BCMRING_UART_0_FR & (1 << 5))
-		;
-
-	BCMRING_UART_0_DR = c;
-}
+#define BCMRING_UART_0_DR	MM_ADDR_IO_UARTA
+#define BCMRING_UART_0_FR	0x18
 
-
-static inline void flush(void)
+#define ARCH_HAVE_UCUART_GENERIC
+static inline void arch_decomp_setup(void)
 {
-	/* Wait for the tx fifo to be empty */
-	while ((BCMRING_UART_0_FR & (1 << 7)) == 0)
-		;
-
-	/* Wait for the final character to be sent on the txd line */
-	while (BCMRING_UART_0_FR & (1 << 3))
-		;
+	ucuart_init(MM_ADDR_IO_UARTA, 0, UCUART_IO_MEM32, BCMRING_UART_0_DR,
+			BCMRING_UART_0_FR, (1 << 5), 0,
+			BCMRING_UART_0_FR, (1 << 7) | (1 << 3), (1 << 7));
 }
diff --git a/arch/arm/mach-clps711x/include/mach/uncompress.h b/arch/arm/mach-clps711x/include/mach/uncompress.h
index 3090a43..ba17cc6 100644
--- a/arch/arm/mach-clps711x/include/mach/uncompress.h
+++ b/arch/arm/mach-clps711x/include/mach/uncompress.h
@@ -17,16 +17,9 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#include <mach/io.h>
 #include <mach/hardware.h>
 #include <asm/hardware/clps7111.h>
 
-#undef CLPS7111_BASE
-#define CLPS7111_BASE CLPS7111_PHYS_BASE
-
-#define __raw_readl(p)		(*(unsigned long *)(p))
-#define __raw_writel(v,p)	(*(unsigned long *)(p) = (v))
-
 #ifdef CONFIG_DEBUG_CLPS711X_UART2
 #define SYSFLGx	SYSFLG2
 #define UARTDRx	UARTDR2
@@ -35,18 +28,11 @@
 #define UARTDRx	UARTDR1
 #endif
 
-/*
- * This does not append a newline
- */
-static inline void putc(int c)
-{
-	while (clps_readl(SYSFLGx) & SYSFLG_UTXFF)
-		barrier();
-	clps_writel(c, UARTDRx);
-}
+#define ARCH_HAVE_UCUART_GENERIC
 
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
-	while (clps_readl(SYSFLGx) & SYSFLG_UBUSY)
-		barrier();
+	ucuart_init(CLPS7111_PHYS_BASE, 0, UCUART_IO_MEM32, UARTDRx,
+			SYSFLGx, SYSFLG_UTXOFF, 0,
+			SYSFLGx, SYSFLG_UBUSY, 0);
 }
diff --git a/arch/arm/mach-cns3xxx/include/mach/uncompress.h b/arch/arm/mach-cns3xxx/include/mach/uncompress.h
index 255a167..93cdbd6 100644
--- a/arch/arm/mach-cns3xxx/include/mach/uncompress.h
+++ b/arch/arm/mach-cns3xxx/include/mach/uncompress.h
@@ -10,39 +10,10 @@
 #include <asm/mach-types.h>
 #include <mach/cns3xxx.h>
 
-#define AMBA_UART_DR(base)	(*(volatile unsigned char *)((base) + 0x00))
-#define AMBA_UART_LCRH(base)	(*(volatile unsigned char *)((base) + 0x2c))
-#define AMBA_UART_CR(base)	(*(volatile unsigned char *)((base) + 0x30))
-#define AMBA_UART_FR(base)	(*(volatile unsigned char *)((base) + 0x18))
+#define ARCH_HAVE_UCUART_GENERIC
 
-/*
- * Return the UART base address
- */
-static inline unsigned long get_uart_base(void)
+static inline void arch_decomp_setup(void)
 {
 	if (machine_is_cns3420vb())
-		return CNS3XXX_UART0_BASE;
-	else
-		return 0;
-}
-
-/*
- * This does not append a newline
- */
-static inline void putc(int c)
-{
-	unsigned long base = get_uart_base();
-
-	while (AMBA_UART_FR(base) & (1 << 5))
-		barrier();
-
-	AMBA_UART_DR(base) = c;
-}
-
-static inline void flush(void)
-{
-	unsigned long base = get_uart_base();
-
-	while (AMBA_UART_FR(base) & (1 << 3))
-		barrier();
+		ucuart_init_amba01x(CNS3XXX_UART0_BASE);
 }
diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h
index 1947ff9..daa318d 100644
--- a/arch/arm/mach-davinci/include/mach/uncompress.h
+++ b/arch/arm/mach-davinci/include/mach/uncompress.h
@@ -19,27 +19,12 @@
  */
 
 #include <linux/types.h>
-#include <linux/serial_reg.h>
 
 #include <asm/mach-types.h>
 
 #include <mach/serial.h>
 
-u32 *uart;
-
-/* PORT_16C550A, in polled non-fifo mode */
-static void putc(char c)
-{
-	while (!(uart[UART_LSR] & UART_LSR_THRE))
-		barrier();
-	uart[UART_TX] = c;
-}
-
-static inline void flush(void)
-{
-	while (!(uart[UART_LSR] & UART_LSR_THRE))
-		barrier();
-}
+#define ARCH_HAVE_UCUART_GENERIC
 
 static inline void set_uart_info(u32 phys, void * __iomem virt)
 {
@@ -53,6 +38,8 @@ static inline void set_uart_info(u32 phys, void * __iomem virt)
 	uart = (u32 *)phys;
 	uart_info[0] = phys;
 	uart_info[1] = (u32)virt;
+
+	ucuart_init_8250(phys, 2, UCUART_IO_MEM32);
 }
 
 #define _DEBUG_LL_ENTRY(machine, phys, virt)			\
@@ -73,7 +60,7 @@ static inline void set_uart_info(u32 phys, void * __iomem virt)
 	_DEBUG_LL_ENTRY(machine, TNETV107X_UART##port##_BASE,	\
 			TNETV107X_UART##port##_VIRT)
 
-static inline void __arch_decomp_setup(unsigned long arch_id)
+static inline void arch_decomp_setup(void)
 {
 	/*
 	 * Initialize the port based on the machine ID from the bootloader.
@@ -101,6 +88,3 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
 		DEBUG_LL_TNETV107X(tnetv107x,		1);
 	} while (0);
 }
-
-#define ARCH_HAVE_DECOMP_SETUP
-#define arch_decomp_setup()	__arch_decomp_setup(arch_id)
diff --git a/arch/arm/mach-dove/include/mach/uncompress.h b/arch/arm/mach-dove/include/mach/uncompress.h
index 3bc22a1..0062a56 100644
--- a/arch/arm/mach-dove/include/mach/uncompress.h
+++ b/arch/arm/mach-dove/include/mach/uncompress.h
@@ -8,24 +8,9 @@
 
 #include <mach/dove.h>
 
-#define UART_THR ((volatile unsigned char *)(DOVE_UART0_PHYS_BASE + 0x0))
-#define UART_LSR ((volatile unsigned char *)(DOVE_UART0_PHYS_BASE + 0x14))
+#define ARCH_HAVE_UCUART_GENERIC
 
-#define LSR_THRE	0x20
-
-static void putc(const char c)
-{
-	int i;
-
-	for (i = 0; i < 0x1000; i++) {
-		/* Transmit fifo not full? */
-		if (*UART_LSR & LSR_THRE)
-			break;
-	}
-
-	*UART_THR = c;
-}
-
-static void flush(void)
+static inline void arch_decomp_setup(void)
 {
+	ucuart_init_8250(DOVE_UART0_PHYS_BASE, 2, UCUART_IO_MEM8);
 }
diff --git a/arch/arm/mach-ebsa110/include/mach/uncompress.h b/arch/arm/mach-ebsa110/include/mach/uncompress.h
index 507ec2a..56a569f 100644
--- a/arch/arm/mach-ebsa110/include/mach/uncompress.h
+++ b/arch/arm/mach-ebsa110/include/mach/uncompress.h
@@ -7,33 +7,9 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+#define ARCH_HAVE_UCUART_GENERIC
 
-#include <linux/serial_reg.h>
-
-#define SERIAL_BASE	((unsigned char *)0xf0000be0)
-
-/*
- * This does not append a newline
- */
-static inline void putc(int c)
-{
-	unsigned char v, *base = SERIAL_BASE;
-
-	do {
-		v = base[UART_LSR << 2];
-		barrier();
-	} while (!(v & UART_LSR_THRE));
-
-	base[UART_TX << 2] = c;
-}
-
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
-	unsigned char v, *base = SERIAL_BASE;
-
-	do {
-		v = base[UART_LSR << 2];
-		barrier();
-	} while ((v & (UART_LSR_TEMT|UART_LSR_THRE)) !=
-		 (UART_LSR_TEMT|UART_LSR_THRE));
+	ucuart_init_8250(0xf0000be0, 2, UCUART_IO_MEM8);
 }
diff --git a/arch/arm/mach-ep93xx/include/mach/uncompress.h b/arch/arm/mach-ep93xx/include/mach/uncompress.h
index f1cd638..1b36813 100644
--- a/arch/arm/mach-ep93xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ep93xx/include/mach/uncompress.h
@@ -11,26 +11,6 @@
 
 #include <mach/ep93xx-regs.h>
 
-static unsigned char __raw_readb(unsigned int ptr)
-{
-	return *((volatile unsigned char *)ptr);
-}
-
-static unsigned int __raw_readl(unsigned int ptr)
-{
-	return *((volatile unsigned int *)ptr);
-}
-
-static void __raw_writeb(unsigned char value, unsigned int ptr)
-{
-	*((volatile unsigned char *)ptr) = value;
-}
-
-static void __raw_writel(unsigned int value, unsigned int ptr)
-{
-	*((volatile unsigned int *)ptr) = value;
-}
-
 #if defined(CONFIG_EP93XX_EARLY_UART1)
 #define UART_BASE		EP93XX_UART1_PHYS_BASE
 #elif defined(CONFIG_EP93XX_EARLY_UART2)
@@ -41,28 +21,6 @@ static void __raw_writel(unsigned int value, unsigned int ptr)
 #define UART_BASE		EP93XX_UART1_PHYS_BASE
 #endif
 
-#define PHYS_UART_DATA		(UART_BASE + 0x00)
-#define PHYS_UART_FLAG		(UART_BASE + 0x18)
-#define UART_FLAG_TXFF		0x20
-
-static inline void putc(int c)
-{
-	int i;
-
-	for (i = 0; i < 1000; i++) {
-		/* Transmit fifo not full?  */
-		if (!(__raw_readb(PHYS_UART_FLAG) & UART_FLAG_TXFF))
-			break;
-	}
-
-	__raw_writeb(c, PHYS_UART_DATA);
-}
-
-static inline void flush(void)
-{
-}
-
-
 /*
  * Some bootloaders don't turn off DMA from the ethernet MAC before
  * jumping to linux, which means that we might end up with bits of RX
@@ -85,9 +43,11 @@ static void ethernet_reset(void)
 		;
 }
 
-#define ARCH_HAVE_DECOMP_SETUP
+#define ARCH_HAVE_UCUART_GENERIC
 
-static void arch_decomp_setup(void)
+static inline void arch_decomp_setup(void)
 {
 	ethernet_reset();
+
+	ucuart_init_amba01x(UART_BASE);
 }
diff --git a/arch/arm/mach-footbridge/include/mach/uncompress.h b/arch/arm/mach-footbridge/include/mach/uncompress.h
index 36313de..32e9654 100644
--- a/arch/arm/mach-footbridge/include/mach/uncompress.h
+++ b/arch/arm/mach-footbridge/include/mach/uncompress.h
@@ -15,18 +15,14 @@
 #define DC21285_BASE ((volatile unsigned int *)0x42000160)
 #define SER0_BASE    ((volatile unsigned char *)0x7c0003f8)
 
-static inline void putc(char c)
-{
-	if (machine_is_netwinder()) {
-		while ((SER0_BASE[5] & 0x60) != 0x60)
-			barrier();
-		SER0_BASE[0] = c;
-	} else {
-		while (DC21285_BASE[6] & 8);
-		DC21285_BASE[0] = c;
-	}
-}
+#define ARCH_HAVE_UCUART_GENERIC
 
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
+	if (machine_is_netwinder())
+		ucuart_init_8250(SER0_BASE, 0, UCUART_IO_MEM8);
+	else
+		ucuart_init(DC21285_BASE, 2, UCUART_IO_MEM32, 0,
+				6, 8, 0,
+				0, 0, 0);
 }
diff --git a/arch/arm/mach-gemini/include/mach/uncompress.h b/arch/arm/mach-gemini/include/mach/uncompress.h
index 1828862..855eb5b 100644
--- a/arch/arm/mach-gemini/include/mach/uncompress.h
+++ b/arch/arm/mach-gemini/include/mach/uncompress.h
@@ -13,25 +13,13 @@
 #ifndef __MACH_UNCOMPRESS_H
 #define __MACH_UNCOMPRESS_H
 
-#include <linux/serial_reg.h>
 #include <mach/hardware.h>
 
-static volatile unsigned long * const UART = (unsigned long *)GEMINI_UART_BASE;
+#define ARCH_HAVE_UCUART_GENERIC
 
-/*
- * The following code assumes the serial port has already been
- * initialized by the bootloader.  If you didn't setup a port in
- * your bootloader then nothing will appear (which might be desired).
- */
-static inline void putc(char c)
-{
-	while (!(UART[UART_LSR] & UART_LSR_THRE))
-		barrier();
-	UART[UART_TX] = c;
-}
-
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
+	ucuart_init_8250(GEMINI_UART_BASE, 2, UCUART_IO_MEM32);
 }
 
 #endif /* __MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-h720x/include/mach/uncompress.h b/arch/arm/mach-h720x/include/mach/uncompress.h
index 46c8d5a..be44fd1 100644
--- a/arch/arm/mach-h720x/include/mach/uncompress.h
+++ b/arch/arm/mach-h720x/include/mach/uncompress.h
@@ -9,23 +9,14 @@
 
 #include <mach/hardware.h>
 
-#define LSR 	0x14
-#define TEMPTY 	0x40
+#define ARCH_HAVE_UCUART_GENERIC
 
-static inline void putc(int c)
-{
-	volatile unsigned char *p = (volatile unsigned char *)(IO_PHYS+0x20000);
-
-	/* wait until transmit buffer is empty */
-	while((p[LSR] & TEMPTY) == 0x0)
-		barrier();
-
-	/* write next character */
-	*p = c;
-}
-
-static inline void flush(void)
+/* debug-macro.S treats this port as an AMBA01x, but according to the
+ * datasheet, this should be a 8250
+ */
+static inline void arch_decomp_setup(void)
 {
+	ucuart_init_8250(SERIAL0_BASE, 2, UCUART_IO_MEM8);
 }
 
 #endif
diff --git a/arch/arm/mach-integrator/include/mach/uncompress.h b/arch/arm/mach-integrator/include/mach/uncompress.h
index 9f61543..19f2eb3 100644
--- a/arch/arm/mach-integrator/include/mach/uncompress.h
+++ b/arch/arm/mach-integrator/include/mach/uncompress.h
@@ -17,27 +17,9 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+#define ARCH_HAVE_UCUART_GENERIC
 
-#define AMBA_UART_DR	(*(volatile unsigned char *)0x16000000)
-#define AMBA_UART_LCRH	(*(volatile unsigned char *)0x16000008)
-#define AMBA_UART_LCRM	(*(volatile unsigned char *)0x1600000c)
-#define AMBA_UART_LCRL	(*(volatile unsigned char *)0x16000010)
-#define AMBA_UART_CR	(*(volatile unsigned char *)0x16000014)
-#define AMBA_UART_FR	(*(volatile unsigned char *)0x16000018)
-
-/*
- * This does not append a newline
- */
-static void putc(int c)
-{
-	while (AMBA_UART_FR & (1 << 5))
-		barrier();
-
-	AMBA_UART_DR = c;
-}
-
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
-	while (AMBA_UART_FR & (1 << 3))
-		barrier();
+	ucuart_init_amba01x(0x16000000);
 }
diff --git a/arch/arm/mach-iop13xx/include/mach/uncompress.h b/arch/arm/mach-iop13xx/include/mach/uncompress.h
index bfa8eac..ac09a33 100644
--- a/arch/arm/mach-iop13xx/include/mach/uncompress.h
+++ b/arch/arm/mach-iop13xx/include/mach/uncompress.h
@@ -1,17 +1,8 @@
-#include <asm/types.h>
-#include <linux/serial_reg.h>
 #include <mach/hardware.h>
 
-#define UART_BASE ((volatile u32 *)IOP13XX_UART1_PHYS)
-#define TX_DONE (UART_LSR_TEMT | UART_LSR_THRE)
+#define ARCH_HAVE_UCUART_GENERIC
 
-static inline void putc(char c)
-{
-	while ((UART_BASE[UART_LSR] & TX_DONE) != TX_DONE)
-		barrier();
-	UART_BASE[UART_TX] = c;
-}
-
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
+	ucuart_init_8250(IOP13XX_UART1_PHYS, 2, UCUART_IO_MEM32);
 }
diff --git a/arch/arm/mach-iop32x/include/mach/uncompress.h b/arch/arm/mach-iop32x/include/mach/uncompress.h
index c1ff29a..97fb970 100644
--- a/arch/arm/mach-iop32x/include/mach/uncompress.h
+++ b/arch/arm/mach-iop32x/include/mach/uncompress.h
@@ -1,36 +1,16 @@
 /*
  * arch/arm/mach-iop32x/include/mach/uncompress.h
  */
-
-#include <asm/types.h>
-#include <asm/mach-types.h>
-#include <linux/serial_reg.h>
 #include <mach/hardware.h>
 
-volatile u8 *uart_base;
-
-#define TX_DONE		(UART_LSR_TEMT | UART_LSR_THRE)
-
-static inline void putc(char c)
-{
-	while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
-		barrier();
-	uart_base[UART_TX] = c;
-}
+#define ARCH_HAVE_UCUART_GENERIC
 
-static inline void flush(void)
-{
-}
-
-static __inline__ void __arch_decomp_setup(unsigned long arch_id)
+static inline void arch_decomp_setup(void)
 {
 	if (machine_is_iq80321())
-		uart_base = (volatile u8 *)IQ80321_UART;
+		ucuart_init_8250(IQ80321_UART, 0, UCUART_IO_MEM8);
 	else if (machine_is_iq31244() || machine_is_em7210())
-		uart_base = (volatile u8 *)IQ31244_UART;
+		ucuart_init_8250(IQ31244_UART, 0, UCUART_IO_MEM8);
 	else
-		uart_base = (volatile u8 *)0xfe800000;
+		ucuart_init_8250(0xfe800000, 0, UCUART_IO_MEM8);
 }
-
-#define ARCH_HAVE_DECOMP_SETUP
-#define arch_decomp_setup()	__arch_decomp_setup(arch_id)
diff --git a/arch/arm/mach-iop33x/include/mach/uncompress.h b/arch/arm/mach-iop33x/include/mach/uncompress.h
index 9537d4b..294c444 100644
--- a/arch/arm/mach-iop33x/include/mach/uncompress.h
+++ b/arch/arm/mach-iop33x/include/mach/uncompress.h
@@ -2,33 +2,15 @@
  * arch/arm/mach-iop33x/include/mach/uncompress.h
  */
 
-#include <asm/types.h>
 #include <asm/mach-types.h>
-#include <linux/serial_reg.h>
 #include <mach/hardware.h>
 
-volatile u32 *uart_base;
+#define ARCH_HAVE_UCUART_GENERIC
 
-#define TX_DONE		(UART_LSR_TEMT | UART_LSR_THRE)
-
-static inline void putc(char c)
-{
-	while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
-		barrier();
-	uart_base[UART_TX] = c;
-}
-
-static inline void flush(void)
-{
-}
-
-static __inline__ void __arch_decomp_setup(unsigned long arch_id)
+static inline void arch_decomp_setup(void)
 {
 	if (machine_is_iq80331() || machine_is_iq80332())
-		uart_base = (volatile u32 *)IOP33X_UART0_PHYS;
+		ucuart_init_8250(IOP33X_UART0_PHYS, 2, UCUART_IO_MEM32);
 	else
-		uart_base = (volatile u32 *)0xfe800000;
+		ucuart_init_8250(0xfe800000, 2, UCUART_IO_MEM32);
 }
-
-#define ARCH_HAVE_DECOMP_SETUP
-#define arch_decomp_setup()	__arch_decomp_setup(arch_id)
diff --git a/arch/arm/mach-ixp2000/include/mach/uncompress.h b/arch/arm/mach-ixp2000/include/mach/uncompress.h
index 519ba97..dc24c65 100644
--- a/arch/arm/mach-ixp2000/include/mach/uncompress.h
+++ b/arch/arm/mach-ixp2000/include/mach/uncompress.h
@@ -14,31 +14,9 @@
  *
  */
 
-#include <linux/serial_reg.h>
+#define ARCH_HAVE_UCUART_GENERIC
 
-#define UART_BASE	0xc0030000
-
-#define PHYS(x)          ((volatile unsigned long *)(UART_BASE + x))
-
-#define UARTDR          PHYS(0x00)      /* Transmit reg dlab=0 */
-#define UARTDLL         PHYS(0x00)      /* Divisor Latch reg dlab=1*/
-#define UARTDLM         PHYS(0x04)      /* Divisor Latch reg dlab=1*/
-#define UARTIER         PHYS(0x04)      /* Interrupt enable reg */
-#define UARTFCR         PHYS(0x08)      /* FIFO control reg dlab =0*/
-#define UARTLCR         PHYS(0x0c)      /* Control reg */
-#define UARTSR          PHYS(0x14)      /* Status reg */
-
-
-static inline void putc(int c)
-{
-	int j = 0x1000;
-
-	while (--j && !(*UARTSR & UART_LSR_THRE))
-		barrier();
-
-	*UARTDR = c;
-}
-
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
+	ucuart_init_8250(0xc0030000, 2, UCUART_IO_MEM32);
 }
diff --git a/arch/arm/mach-ixp23xx/include/mach/uncompress.h b/arch/arm/mach-ixp23xx/include/mach/uncompress.h
index ab23cbb..e986753 100644
--- a/arch/arm/mach-ixp23xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ixp23xx/include/mach/uncompress.h
@@ -12,25 +12,12 @@
 #define __ASM_ARCH_UNCOMPRESS_H
 
 #include <mach/ixp23xx.h>
-#include <linux/serial_reg.h>
 
-#define UART_BASE	((volatile u32 *)IXP23XX_UART1_PHYS)
+#define ARCH_HAVE_UCUART_GENERIC
 
-static inline void putc(char c)
-{
-	int j;
-
-	for (j = 0; j < 0x1000; j++) {
-		if (UART_BASE[UART_LSR] & UART_LSR_THRE)
-			break;
-		barrier();
-	}
-
-	UART_BASE[UART_TX] = c;
-}
-
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
+	ucuart_init_8250(IXP23XX_UART1_PHYS, 2, UCUART_IO_MEM32);
 }
 
 #endif
diff --git a/arch/arm/mach-ixp4xx/include/mach/uncompress.h b/arch/arm/mach-ixp4xx/include/mach/uncompress.h
index 0a0102c..17b430a 100644
--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h
@@ -15,27 +15,10 @@
 
 #include "ixp4xx-regs.h"
 #include <asm/mach-types.h>
-#include <linux/serial_reg.h>
 
-#define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE)
+#define ARCH_HAVE_UCUART_GENERIC
 
-volatile u32* uart_base;
-
-static inline void putc(int c)
-{
-	/* Check THRE and TEMT bits before we transmit the character.
-	 */
-	while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
-		barrier();
-
-	*uart_base = c;
-}
-
-static void flush(void)
-{
-}
-
-static __inline__ void __arch_decomp_setup(unsigned long arch_id)
+static inline void arch_decomp_setup(void)
 {
 	/*
 	 * Some boards are using UART2 as console
@@ -43,15 +26,9 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
 	if (machine_is_adi_coyote() || machine_is_gtwx5715() ||
 	    machine_is_gateway7001() || machine_is_wg302v2() ||
 	    machine_is_devixp() || machine_is_miccpt() || machine_is_mic256())
-		uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS;
+		ucuart_init_8250(IXP4XX_UART2_BASE_PHYS, 2, UCUART_IO_MEM32);
 	else
-		uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS;
+		ucuart_init_8250(IXP4XX_UART1_BASE_PHYS, 2, UCUART_IO_MEM32);
 }
 
-/*
- * arch_id is a variable in decompress_kernel()
- */
-#define ARCH_HAVE_DECOMP_SETUP
-#define arch_decomp_setup()	__arch_decomp_setup(arch_id)
-
 #endif
diff --git a/arch/arm/mach-kirkwood/include/mach/uncompress.h b/arch/arm/mach-kirkwood/include/mach/uncompress.h
index 1fc91eb..e46c96c 100644
--- a/arch/arm/mach-kirkwood/include/mach/uncompress.h
+++ b/arch/arm/mach-kirkwood/include/mach/uncompress.h
@@ -5,37 +5,11 @@
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-
-#include <linux/serial_reg.h>
 #include <mach/kirkwood.h>
 
-#define SERIAL_BASE	((unsigned char *)UART0_PHYS_BASE)
-
-static void putc(const char c)
-{
-	unsigned char *base = SERIAL_BASE;
-	int i;
-
-	for (i = 0; i < 0x1000; i++) {
-		if (base[UART_LSR << 2] & UART_LSR_THRE)
-			break;
-		barrier();
-	}
+#define ARCH_HAVE_UCUART_GENERIC
 
-	base[UART_TX << 2] = c;
-}
-
-static void flush(void)
+static inline void arch_decomp_setup(void)
 {
-	unsigned char *base = SERIAL_BASE;
-	unsigned char mask;
-	int i;
-
-	mask = UART_LSR_TEMT | UART_LSR_THRE;
-
-	for (i = 0; i < 0x1000; i++) {
-		if ((base[UART_LSR << 2] & mask) == mask)
-			break;
-		barrier();
-	}
+	ucuart_init_8250(UART0_PHYS_BASE, 2, UCUART_IO_MEM8);
 }
diff --git a/arch/arm/mach-ks8695/include/mach/uncompress.h b/arch/arm/mach-ks8695/include/mach/uncompress.h
index 548c43b..9e6ba4e 100644
--- a/arch/arm/mach-ks8695/include/mach/uncompress.h
+++ b/arch/arm/mach-ks8695/include/mach/uncompress.h
@@ -14,21 +14,15 @@
 #ifndef __ASM_ARCH_UNCOMPRESS_H
 #define __ASM_ARCH_UNCOMPRESS_H
 
-#include <linux/io.h>
 #include <mach/regs-uart.h>
 
-static void putc(char c)
-{
-	while (!(__raw_readl(KS8695_UART_PA + KS8695_URLS) & URLS_URTHRE))
-		barrier();
-
-	__raw_writel(c, KS8695_UART_PA + KS8695_URTH);
-}
+#define ARCH_HAVE_UCUART_GENERIC
 
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
-	while (!(__raw_readl(KS8695_UART_PA + KS8695_URLS) & URLS_URTE))
-		barrier();
+	ucuart_init(KS8695_UART_PA, 0, UCUART_MEM32, KS8695_URTH,
+			KS8695_URLS, URLS_URTHRE, URLS_URTHRE,
+			KS8695_URLS, URLS_URTE, URLS_URTE);
 }
 
 #endif
diff --git a/arch/arm/mach-lpc32xx/include/mach/uncompress.h b/arch/arm/mach-lpc32xx/include/mach/uncompress.h
index 36176e2..61a16eb 100644
--- a/arch/arm/mach-lpc32xx/include/mach/uncompress.h
+++ b/arch/arm/mach-lpc32xx/include/mach/uncompress.h
@@ -19,38 +19,13 @@
 #ifndef __ASM_ARM_ARCH_UNCOMPRESS_H
 #define __ASM_ARM_ARCH_UNCOMPRESS_H
 
-#include <linux/io.h>
-
-#include <mach/hardware.h>
 #include <mach/platform.h>
 
-/*
- * Uncompress output is hardcoded to standard UART 5
- */
-
-#define UART_FIFO_CTL_TX_RESET	(1 << 2)
-#define UART_STATUS_TX_MT	(1 << 6)
-
-#define _UARTREG(x)		(void __iomem *)(LPC32XX_UART5_BASE + (x))
-
-#define LPC32XX_UART_DLLFIFO_O	0x00
-#define LPC32XX_UART_IIRFCR_O	0x08
-#define LPC32XX_UART_LSR_O	0x14
-
-static inline void putc(int ch)
-{
-	/* Wait for transmit FIFO to empty */
-	while ((__raw_readl(_UARTREG(LPC32XX_UART_LSR_O)) &
-		UART_STATUS_TX_MT) == 0)
-		;
-
-	__raw_writel((u32) ch, _UARTREG(LPC32XX_UART_DLLFIFO_O));
-}
+#define ARCH_HAVE_UCUART_GENERIC
 
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
-	__raw_writel(__raw_readl(_UARTREG(LPC32XX_UART_IIRFCR_O)) |
-		UART_FIFO_CTL_TX_RESET, _UARTREG(LPC32XX_UART_IIRFCR_O));
+	ucuart_init_8250(LPC32XX_UART5_BASE, 2, UCUART_IO_MEM32);
 }
 
 #endif
diff --git a/arch/arm/mach-mmp/include/mach/uncompress.h b/arch/arm/mach-mmp/include/mach/uncompress.h
index 8c58b57..4cafe10 100644
--- a/arch/arm/mach-mmp/include/mach/uncompress.h
+++ b/arch/arm/mach-mmp/include/mach/uncompress.h
@@ -5,8 +5,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
-#include <linux/serial_reg.h>
 #include <mach/addr-map.h>
 #include <asm/mach-types.h>
 
@@ -14,34 +12,12 @@
 #define UART2_BASE	(APB_PHYS_BASE + 0x17000)
 #define UART3_BASE	(APB_PHYS_BASE + 0x18000)
 
-volatile unsigned long *UART;
-
-static inline void putc(char c)
-{
-	/* UART enabled? */
-	if (!(UART[UART_IER] & UART_IER_UUE))
-		return;
-
-	while (!(UART[UART_LSR] & UART_LSR_THRE))
-		barrier();
-
-	UART[UART_TX] = c;
-}
-
-/*
- * This does not append a newline
- */
-static inline void flush(void)
-{
-}
-
 #define ARCH_HAVE_DECOMP_SETUP
 
 static inline void arch_decomp_setup(void)
 {
-	/* default to UART2 */
-	UART = (unsigned long *)UART2_BASE;
-
 	if (machine_is_avengers_lite())
-		UART = (unsigned long *)UART3_BASE;
+		ucuart_init_8250(UART3_BASE, 2, UCUART_IO_MEM32);
+	else
+		ucuart_init_8250(UART2_BASE, 2, UCUART_IO_MEM32);
 }
diff --git a/arch/arm/mach-msm/include/mach/uncompress.h b/arch/arm/mach-msm/include/mach/uncompress.h
index 7fa472d..d427ce8 100644
--- a/arch/arm/mach-msm/include/mach/uncompress.h
+++ b/arch/arm/mach-msm/include/mach/uncompress.h
@@ -19,17 +19,14 @@
 #include "linux/io.h"
 #include "mach/msm_iomap.h"
 
-static void putc(int c)
-{
-#if defined(MSM_DEBUG_UART_PHYS)
-	unsigned base = MSM_DEBUG_UART_PHYS;
-	while (!(readl(base + 0x08) & 0x04)) ;
-	writel(c, base + 0x0c);
-#endif
-}
+#define ARCH_HAVE_UCUART_GENERIC
 
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
+#if defined(MSM_DEBUG_UART_PHYS)
+	ucuart_init(MSM_DEBUG_UART_PHYS, 2, UCUART_IO_MEM32, 0x0c,
+			0x08, 0x04, 0x04,
+			0, 0, 0);
+#endif /* MSM_DEBUG_UART_PHYS */
 }
-
 #endif
diff --git a/arch/arm/mach-mv78xx0/include/mach/uncompress.h b/arch/arm/mach-mv78xx0/include/mach/uncompress.h
index d26eb30..720340e 100644
--- a/arch/arm/mach-mv78xx0/include/mach/uncompress.h
+++ b/arch/arm/mach-mv78xx0/include/mach/uncompress.h
@@ -9,33 +9,9 @@
 #include <linux/serial_reg.h>
 #include <mach/mv78xx0.h>
 
-#define SERIAL_BASE	((unsigned char *)UART0_PHYS_BASE)
+#define ARCH_HAVE_UCUART_GENERIC
 
-static void putc(const char c)
+static inline void arch_decomp_setup(void)
 {
-	unsigned char *base = SERIAL_BASE;
-	int i;
-
-	for (i = 0; i < 0x1000; i++) {
-		if (base[UART_LSR << 2] & UART_LSR_THRE)
-			break;
-		barrier();
-	}
-
-	base[UART_TX << 2] = c;
-}
-
-static void flush(void)
-{
-	unsigned char *base = SERIAL_BASE;
-	unsigned char mask;
-	int i;
-
-	mask = UART_LSR_TEMT | UART_LSR_THRE;
-
-	for (i = 0; i < 0x1000; i++) {
-		if ((base[UART_LSR << 2] & mask) == mask)
-			break;
-		barrier();
-	}
+	ucuart_init_8250(UART0_PHYS_BASE, 2, UCUART_IO_MEM8);
 }
diff --git a/arch/arm/mach-mxs/include/mach/uncompress.h b/arch/arm/mach-mxs/include/mach/uncompress.h
index eded40b..c9587ce 100644
--- a/arch/arm/mach-mxs/include/mach/uncompress.h
+++ b/arch/arm/mach-mxs/include/mach/uncompress.h
@@ -20,58 +20,22 @@
 
 #include <asm/mach-types.h>
 
-unsigned long mxs_duart_base;
-
-#define MXS_DUART(x)	(*(volatile unsigned long *)(mxs_duart_base + (x)))
-
-#define MXS_DUART_DR		0x00
-#define MXS_DUART_FR		0x18
-#define MXS_DUART_FR_TXFE	(1 << 7)
-#define MXS_DUART_CR		0x30
-#define MXS_DUART_CR_UARTEN	(1 << 0)
-
-/*
- * The following code assumes the serial port has already been
- * initialized by the bootloader. If it's not, the output is
- * simply discarded.
- */
-
-static void putc(int ch)
-{
-	if (!mxs_duart_base)
-		return;
-	if (!(MXS_DUART(MXS_DUART_CR) & MXS_DUART_CR_UARTEN))
-		return;
-
-	while (!(MXS_DUART(MXS_DUART_FR) & MXS_DUART_FR_TXFE))
-		barrier();
-
-	MXS_DUART(MXS_DUART_DR) = ch;
-}
-
-static inline void flush(void)
-{
-}
-
 #define MX23_DUART_BASE_ADDR	0x80070000
 #define MX28_DUART_BASE_ADDR	0x80074000
 
-static inline void __arch_decomp_setup(unsigned long arch_id)
+static inline void arch_decomp_setup(void)
 {
 	switch (arch_id) {
 	case MACH_TYPE_MX23EVK:
-		mxs_duart_base = MX23_DUART_BASE_ADDR;
+		ucuart_init_amba01x(MX23_DUART_BASE_ADDR);
 		break;
 	case MACH_TYPE_MX28EVK:
 	case MACH_TYPE_TX28:
-		mxs_duart_base = MX28_DUART_BASE_ADDR;
+		ucuart_init_amba01x(MX28_DUART_BASE_ADDR);
 		break;
 	default:
 		break;
 	}
 }
 
-#define ARCH_HAVE_DECOMP_SETUP
-#define arch_decomp_setup()	__arch_decomp_setup(arch_id)
-
 #endif /* __MACH_MXS_UNCOMPRESS_H__ */
diff --git a/arch/arm/mach-netx/include/mach/uncompress.h b/arch/arm/mach-netx/include/mach/uncompress.h
index 0e011ee..f61e22b 100644
--- a/arch/arm/mach-netx/include/mach/uncompress.h
+++ b/arch/arm/mach-netx/include/mach/uncompress.h
@@ -22,49 +22,15 @@
  * initialized by the bootloader.  We search for the first enabled
  * port in the most probable order.  If you didn't setup a port in
  * your bootloader then nothing will appear (which might be desired).
- *
- * This does not append a newline
  */
 
-#define REG(x) (*(volatile unsigned long *)(x))
-
 #define UART1_BASE 0x100a00
 #define UART2_BASE 0x100a80
 
-#define UART_DR 0x0
-
-#define UART_CR 0x14
-#define CR_UART_EN (1<<0)
+#define ARCH_HAVE_UCUART_GENERIC
 
-#define UART_FR 0x18
-#define FR_BUSY (1<<3)
-#define FR_TXFF (1<<5)
-
-static void putc(char c)
+static inline void arch_decomp_setup(void)
 {
-	unsigned long base;
-
-	if (REG(UART1_BASE + UART_CR) & CR_UART_EN)
-		base = UART1_BASE;
-	else if (REG(UART2_BASE + UART_CR) & CR_UART_EN)
-		base = UART2_BASE;
-	else
-		return;
-
-	while (REG(base + UART_FR) & FR_TXFF);
-	REG(base + UART_DR) = c;
-}
-
-static inline void flush(void)
-{
-	unsigned long base;
-
-	if (REG(UART1_BASE + UART_CR) & CR_UART_EN)
-		base = UART1_BASE;
-	else if (REG(UART2_BASE + UART_CR) & CR_UART_EN)
-		base = UART2_BASE;
-	else
-		return;
-
-	while (REG(base + UART_FR) & FR_BUSY);
+	ucuart_init_amba01x(UART1_BASE);
+	ucuart_init_amba01x(UART2_BASE);
 }
diff --git a/arch/arm/mach-nomadik/include/mach/uncompress.h b/arch/arm/mach-nomadik/include/mach/uncompress.h
index 08f6615..1eb4ae6 100644
--- a/arch/arm/mach-nomadik/include/mach/uncompress.h
+++ b/arch/arm/mach-nomadik/include/mach/uncompress.h
@@ -19,39 +19,13 @@
 #ifndef __ASM_ARCH_UNCOMPRESS_H
 #define __ASM_ARCH_UNCOMPRESS_H
 
-#include <asm/setup.h>
-#include <asm/io.h>
 #include <mach/hardware.h>
 
-/* we need the constants in amba/serial.h, but it refers to amba_device */
-struct amba_device;
-#include <linux/amba/serial.h>
+#define ARCH_HAVE_UCUART_GENERIC
 
-#define NOMADIK_UART_DR		0x101FB000
-#define NOMADIK_UART_LCRH	0x101FB02c
-#define NOMADIK_UART_CR		0x101FB030
-#define NOMADIK_UART_FR		0x101FB018
-
-static void putc(const char c)
-{
-	/* Do nothing if the UART is not enabled. */
-	if (!(readb(NOMADIK_UART_CR) & UART01x_CR_UARTEN))
-		return;
-
-	if (c == '\n')
-		putc('\r');
-
-	while (readb(NOMADIK_UART_FR) & UART01x_FR_TXFF)
-		barrier();
-	writeb(c, NOMADIK_UART_DR);
-}
-
-static void flush(void)
+static inline void arch_decomp_setup(void)
 {
-	if (!(readb(NOMADIK_UART_CR) & UART01x_CR_UARTEN))
-		return;
-	while (readb(NOMADIK_UART_FR) & UART01x_FR_BUSY)
-		barrier();
+	ucuart_init_amba01x(NOMADIK_UART1_BASE);
 }
 
 #endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-orion5x/include/mach/uncompress.h b/arch/arm/mach-orion5x/include/mach/uncompress.h
index a4dca1c..1ac83f5 100644
--- a/arch/arm/mach-orion5x/include/mach/uncompress.h
+++ b/arch/arm/mach-orion5x/include/mach/uncompress.h
@@ -7,37 +7,11 @@
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-
-#include <linux/serial_reg.h>
 #include <mach/orion5x.h>
 
-#define SERIAL_BASE	((unsigned char *)UART0_PHYS_BASE)
-
-static void putc(const char c)
-{
-	unsigned char *base = SERIAL_BASE;
-	int i;
-
-	for (i = 0; i < 0x1000; i++) {
-		if (base[UART_LSR << 2] & UART_LSR_THRE)
-			break;
-		barrier();
-	}
+#define ARCH_HAVE_UCUART_GENERIC
 
-	base[UART_TX << 2] = c;
-}
-
-static void flush(void)
+static inline void arch_decomp_setup(void)
 {
-	unsigned char *base = SERIAL_BASE;
-	unsigned char mask;
-	int i;
-
-	mask = UART_LSR_TEMT | UART_LSR_THRE;
-
-	for (i = 0; i < 0x1000; i++) {
-		if ((base[UART_LSR << 2] & mask) == mask)
-			break;
-		barrier();
-	}
+	ucuart_init_8250(UART0_PHYS_BASE, 2, UCUART_IO_MEM8);
 }
diff --git a/arch/arm/mach-pnx4008/include/mach/uncompress.h b/arch/arm/mach-pnx4008/include/mach/uncompress.h
index add0c75..dee85ef 100644
--- a/arch/arm/mach-pnx4008/include/mach/uncompress.h
+++ b/arch/arm/mach-pnx4008/include/mach/uncompress.h
@@ -20,21 +20,9 @@
  */
 
 #define UART5_BASE 0x40090000
+#define ARCH_HAVE_UCUART_GENERIC
 
-#define UART5_DR    (*(volatile unsigned char *) (UART5_BASE))
-#define UART5_FR    (*(volatile unsigned char *) (UART5_BASE + 18))
-
-static __inline__ void putc(char c)
-{
-	while (UART5_FR & (1 << 5))
-		barrier();
-
-	UART5_DR = c;
-}
-
-/*
- * This does not append a newline
- */
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
+	ucuart_init_amba01x(UART5_BASE);
 }
diff --git a/arch/arm/mach-prima2/include/mach/uncompress.h b/arch/arm/mach-prima2/include/mach/uncompress.h
index 9ee022f..14effdc 100644
--- a/arch/arm/mach-prima2/include/mach/uncompress.h
+++ b/arch/arm/mach-prima2/include/mach/uncompress.h
@@ -9,26 +9,14 @@
 #ifndef __ASM_ARCH_UNCOMPRESS_H
 #define __ASM_ARCH_UNCOMPRESS_H
 
-#include <linux/io.h>
-#include <mach/hardware.h>
 #include <mach/uart.h>
 
-static __inline__ void putc(char c)
-{
-	/*
-	 * during kernel decompression, all mappings are flat:
-	 *  virt_addr == phys_addr
-	 */
-	while (__raw_readl(SIRFSOC_UART1_PA_BASE + SIRFSOC_UART_TXFIFO_STATUS)
-		& SIRFSOC_UART1_TXFIFO_FULL)
-		barrier();
-
-	__raw_writel(c, SIRFSOC_UART1_PA_BASE + SIRFSOC_UART_TXFIFO_DATA);
-}
+#define ARCH_HAVE_UCUART_GENERIC
 
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
+	ucuart_init(SIRFSOC_UART1_PA_BASE, 0, UCUART_IO_MEM32,
+			SIRFSOC_UART_TXFIFO_DATA, SIRFSOC_UART_TXFIFO_STATUS,
+			SIRFSOC_UART1_TXFIFO_FULL, 0, 0, 0, 0);
 }
-
 #endif
-
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h b/arch/arm/mach-pxa/include/mach/uncompress.h
index 28acded..57f1755 100644
--- a/arch/arm/mach-pxa/include/mach/uncompress.h
+++ b/arch/arm/mach-pxa/include/mach/uncompress.h
@@ -16,61 +16,24 @@
 #define BTUART_BASE	(0x40200000)
 #define STUART_BASE	(0x40700000)
 
-unsigned long uart_base;
-unsigned int uart_shift;
-unsigned int uart_is_pxa;
-
-static inline unsigned char uart_read(int offset)
-{
-	return *(volatile unsigned char *)(uart_base + (offset << uart_shift));
-}
-
-static inline void uart_write(unsigned char val, int offset)
-{
-	*(volatile unsigned char *)(uart_base + (offset << uart_shift)) = val;
-}
-
-static inline int uart_is_enabled(void)
-{
-	/* assume enabled by default for non-PXA uarts */
-	return uart_is_pxa ? uart_read(UART_IER) & UART_IER_UUE : 1;
-}
-
-static inline void putc(char c)
-{
-	if (!uart_is_enabled())
-		return;
-
-	while (!(uart_read(UART_LSR) & UART_LSR_THRE))
-		barrier();
-
-	uart_write(c, UART_TX);
-}
-
-/*
- * This does not append a newline
- */
-static inline void flush(void)
-{
-}
-
-#define ARCH_HAVE_DECOMP_SETUP
+#define ARCH_HAVE_UCUART_GENERIC
 
 static inline void arch_decomp_setup(void)
 {
-	/* initialize to default */
-	uart_base = FFUART_BASE;
-	uart_shift = 2;
-	uart_is_pxa = 1;
-
-	if (machine_is_littleton() || machine_is_intelmote2()
-	    || machine_is_csb726() || machine_is_stargate2()
-	    || machine_is_cm_x300() || machine_is_balloon3())
-		uart_base = STUART_BASE;
+	unsigned long uart_base;
+
+	if (machine_is_arcom_zeus())
+		ucuart_init_8250(0x10000000, 1, UCUART_IO_MEM8); /* nCS4 */
+	else if (machine_is_littleton() || machine_is_intelmote2()
+			|| machine_is_csb726() || machine_is_stargate2()
+			|| machine_is_cm_x300() || machine_is_balloon3())
+			uart_base = STUART_BASE;
+	else
+		uart_base = FFUART_BASE;
+
+	/* Don't do anything if UART is not enabled */
+	if (!__raw_readl(uart_base + UART_IER) & UART_IER_UUE)
+		return;
 
-	if (machine_is_arcom_zeus()) {
-		uart_base = 0x10000000;	/* nCS4 */
-		uart_shift = 1;
-		uart_is_pxa = 0;
-	}
+	ucuart_init_8250(uart_base, 2, UCUART_IO_MEM8);
 }
diff --git a/arch/arm/mach-realview/include/mach/uncompress.h b/arch/arm/mach-realview/include/mach/uncompress.h
index 9ba06e9..899aef7 100644
--- a/arch/arm/mach-realview/include/mach/uncompress.h
+++ b/arch/arm/mach-realview/include/mach/uncompress.h
@@ -17,7 +17,6 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#include <mach/hardware.h>
 #include <asm/mach-types.h>
 
 #include <mach/board-eb.h>
@@ -26,47 +25,23 @@
 #include <mach/board-pba8.h>
 #include <mach/board-pbx.h>
 
-#define AMBA_UART_DR(base)	(*(volatile unsigned char *)((base) + 0x00))
-#define AMBA_UART_LCRH(base)	(*(volatile unsigned char *)((base) + 0x2c))
-#define AMBA_UART_CR(base)	(*(volatile unsigned char *)((base) + 0x30))
-#define AMBA_UART_FR(base)	(*(volatile unsigned char *)((base) + 0x18))
-
-/*
- * Return the UART base address
- */
-static inline unsigned long get_uart_base(void)
+#define ARCH_HAVE_UCUART_GENERIC
+static inline void arch_decomp_setup(void)
 {
+	int uart_base;
+
 	if (machine_is_realview_eb())
-		return REALVIEW_EB_UART0_BASE;
+		uart_base = REALVIEW_EB_UART0_BASE;
 	else if (machine_is_realview_pb11mp())
-		return REALVIEW_PB11MP_UART0_BASE;
+		uart_base = REALVIEW_PB11MP_UART0_BASE;
 	else if (machine_is_realview_pb1176())
-		return REALVIEW_PB1176_UART0_BASE;
+		uart_base = REALVIEW_PB1176_UART0_BASE;
 	else if (machine_is_realview_pba8())
-		return REALVIEW_PBA8_UART0_BASE;
+		uart_base = REALVIEW_PBA8_UART0_BASE;
 	else if (machine_is_realview_pbx())
-		return REALVIEW_PBX_UART0_BASE;
+		uart_base = REALVIEW_PBX_UART0_BASE;
 	else
-		return 0;
-}
-
-/*
- * This does not append a newline
- */
-static inline void putc(int c)
-{
-	unsigned long base = get_uart_base();
-
-	while (AMBA_UART_FR(base) & (1 << 5))
-		barrier();
-
-	AMBA_UART_DR(base) = c;
-}
-
-static inline void flush(void)
-{
-	unsigned long base = get_uart_base();
+		return;
 
-	while (AMBA_UART_FR(base) & (1 << 3))
-		barrier();
+	ucuart_init_amba01x(uart_base);
 }
diff --git a/arch/arm/mach-sa1100/include/mach/uncompress.h b/arch/arm/mach-sa1100/include/mach/uncompress.h
index 55c9e59..dc0c8b7 100644
--- a/arch/arm/mach-sa1100/include/mach/uncompress.h
+++ b/arch/arm/mach-sa1100/include/mach/uncompress.h
@@ -14,31 +14,30 @@
  * port in the most probable order.  If you didn't setup a port in
  * your bootloader then nothing will appear (which might be desired).
  */
+#define ARCH_HAVE_UCUART_GENERIC
 
-#define UART(x)		(*(volatile unsigned long *)(serial_port + (x)))
-
-static void putc(int c)
+static inline int uart_enabled(int base)
 {
-	unsigned long serial_port;
-
-	do {
-		serial_port = _Ser3UTCR0;
-		if (UART(UTCR3) & UTCR3_TXE) break;
-		serial_port = _Ser1UTCR0;
-		if (UART(UTCR3) & UTCR3_TXE) break;
-		serial_port = _Ser2UTCR0;
-		if (UART(UTCR3) & UTCR3_TXE) break;
-		return;
-	} while (0);
+	if (__raw_readl((void __iomem *)(base + UTCR3)) & UTCR3_TXE)
+		return 1;
 
-	/* wait for space in the UART's transmitter */
-	while (!(UART(UTSR1) & UTSR1_TNF))
-		barrier();
-
-	/* send the character out. */
-	UART(UTDR) = c;
+	return 0;
 }
 
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
+	int uart_base;
+
+	if (uart_enabled(_Ser3UTCR0))
+		uart_base = _Ser3UTCR0;
+	else if (uart_enabled(_Ser1UTCR0))
+		uart_base = _Ser1UTCR0;
+	else if (uart_enabled(_Ser2UTCR0))
+		uart_base = _Ser2UTCR0;
+	else
+		return;
+
+	ucuart_init(uart_base, 0, UCUART_IO_MEM32, UTDR,
+			UTSR1, UTSR1_TNF, UTSR1_TNF,
+			0, 0, 0);
 }
diff --git a/arch/arm/mach-shark/include/mach/uncompress.h b/arch/arm/mach-shark/include/mach/uncompress.h
index 40f4b68..9900826 100644
--- a/arch/arm/mach-shark/include/mach/uncompress.h
+++ b/arch/arm/mach-shark/include/mach/uncompress.h
@@ -7,39 +7,9 @@
  * Copyright (C) 1996,1997,1998 Russell King
  */
 
-#define SERIAL_BASE ((volatile unsigned char *)0x400003f8)
+#define ARCH_HAVE_UCUART_GENERIC
 
-static inline void putc(int c)
+static inline void arch_decomp_setup(void)
 {
-	volatile int t;
-
-	SERIAL_BASE[0] = c;
-	t=0x10000;
-	while (t--);
-}
-
-static inline void flush(void)
-{
-}
-
-#ifdef DEBUG
-static void putn(unsigned long z)
-{
-	int i;
-	char x;
-
-	putc('0');
-	putc('x');
-	for (i=0;i<8;i++) {
-		x='0'+((z>>((7-i)*4))&0xf);
-		if (x>'9') x=x-'0'+'A'-10;
-		putc(x);
-	}
-}
-
-static void putr()
-{
-	putc('\n');
-	putc('\r');
+	ucuart_init_8250(0x400003f8, 0, UCUART_IO_MEM8);
 }
-#endif
diff --git a/arch/arm/mach-tegra/include/mach/uncompress.h b/arch/arm/mach-tegra/include/mach/uncompress.h
index 1b07047..61dfd6b 100644
--- a/arch/arm/mach-tegra/include/mach/uncompress.h
+++ b/arch/arm/mach-tegra/include/mach/uncompress.h
@@ -26,37 +26,19 @@
 
 #include <mach/iomap.h>
 
-static void putc(int c)
-{
-	volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE;
-	int shift = 2;
-
-	if (uart == NULL)
-		return;
-
-	while (!(uart[UART_LSR << shift] & UART_LSR_THRE))
-		barrier();
-	uart[UART_TX << shift] = c;
-}
-
-static inline void flush(void)
-{
-}
-
-#define ARCH_HAVE_DECOMP_SETUP
+#define ARCH_HAVE_UCUART_GENERIC
 
 static inline void arch_decomp_setup(void)
 {
-	volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE;
-	int shift = 2;
+	void __iomem *uart_base = (void*)TEGRA_DEBUG_UART_BASE;
 
-	if (uart == NULL)
-		return;
+	__raw_writel(__raw_readl(uart_base + UART_LCR << 2) | UART_LCR_DLAB,
+			uart_base + UART_LCR << 2);
+	__raw_writel(0x75, uart_base + UART_DLL << 2);
+	__raw_writel(0, uart_base + UART_DLM << 2);
+	__raw_writel(3, uart_base + UART_LCR << 2);
 
-	uart[UART_LCR << shift] |= UART_LCR_DLAB;
-	uart[UART_DLL << shift] = 0x75;
-	uart[UART_DLM << shift] = 0x0;
-	uart[UART_LCR << shift] = 3;
+	ucuart_init_8250(TEGRA_DEBUG_UART_BASE, 2, UCUART_IO_MEM8);
 }
 
 #endif
diff --git a/arch/arm/mach-u300/include/mach/uncompress.h b/arch/arm/mach-u300/include/mach/uncompress.h
index 68d0298..8bc389a 100644
--- a/arch/arm/mach-u300/include/mach/uncompress.h
+++ b/arch/arm/mach-u300/include/mach/uncompress.h
@@ -17,24 +17,9 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#define AMBA_UART_DR	(*(volatile unsigned char *)0xc0013000)
-#define AMBA_UART_LCRH	(*(volatile unsigned char *)0xc001302C)
-#define AMBA_UART_CR	(*(volatile unsigned char *)0xc0013030)
-#define AMBA_UART_FR	(*(volatile unsigned char *)0xc0013018)
+#define ARCH_HAVE_UCUART_GENERIC
 
-/*
- * This does not append a newline
- */
-static inline void putc(int c)
-{
-	while (AMBA_UART_FR & (1 << 5))
-		barrier();
-
-	AMBA_UART_DR = c;
-}
-
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
-	while (AMBA_UART_FR & (1 << 3))
-		barrier();
+	ucuart_init_amba01x(0xc0013000);
 }
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h
index d096c99..7e3b48a 100644
--- a/arch/arm/mach-ux500/include/mach/uncompress.h
+++ b/arch/arm/mach-ux500/include/mach/uncompress.h
@@ -18,45 +18,18 @@
 #ifndef __ASM_ARCH_UNCOMPRESS_H
 #define __ASM_ARCH_UNCOMPRESS_H
 
-#include <asm/setup.h>
 #include <asm/mach-types.h>
-#include <linux/io.h>
-#include <linux/amba/serial.h>
 #include <mach/hardware.h>
 
-u32 ux500_uart_base;
-
-static void putc(const char c)
-{
-	/* Do nothing if the UART is not enabled. */
-	if (!(__raw_readb(ux500_uart_base + UART011_CR) & 0x1))
-		return;
-
-	if (c == '\n')
-		putc('\r');
-
-	while (__raw_readb(ux500_uart_base + UART01x_FR) & (1 << 5))
-		barrier();
-	__raw_writeb(c, ux500_uart_base + UART01x_DR);
-}
-
-static void flush(void)
-{
-	if (!(__raw_readb(ux500_uart_base + UART011_CR) & 0x1))
-		return;
-	while (__raw_readb(ux500_uart_base + UART01x_FR) & (1 << 3))
-		barrier();
-}
-
 #define ARCH_HAVE_DECOMP_SETUP
 
 static inline void arch_decomp_setup(void)
 {
 	/* Check in run time if we run on an U8500 or U5500 */
 	if (machine_is_u5500())
-		ux500_uart_base = U5500_UART0_BASE;
+		ucuart_init_amba01x(U5500_UART0_BASE);
 	else
-		ux500_uart_base = U8500_UART2_BASE;
+		ucuart_init_amba01x(U8500_UART2_BASE);
 }
 
 #endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-versatile/include/mach/uncompress.h b/arch/arm/mach-versatile/include/mach/uncompress.h
index 164b9b5..14294ef 100644
--- a/arch/arm/mach-versatile/include/mach/uncompress.h
+++ b/arch/arm/mach-versatile/include/mach/uncompress.h
@@ -17,24 +17,9 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#define AMBA_UART_DR	(*(volatile unsigned char *)0x101F1000)
-#define AMBA_UART_LCRH	(*(volatile unsigned char *)0x101F102C)
-#define AMBA_UART_CR	(*(volatile unsigned char *)0x101F1030)
-#define AMBA_UART_FR	(*(volatile unsigned char *)0x101F1018)
+#define ARCH_HAVE_UCUART_GENERIC
 
-/*
- * This does not append a newline
- */
-static inline void putc(int c)
-{
-	while (AMBA_UART_FR & (1 << 5))
-		barrier();
-
-	AMBA_UART_DR = c;
-}
-
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
-	while (AMBA_UART_FR & (1 << 3))
-		barrier();
+	ucuart_init_amba01x(0x101F1000);
 }
diff --git a/arch/arm/mach-vexpress/include/mach/uncompress.h b/arch/arm/mach-vexpress/include/mach/uncompress.h
index 0f85a648..00c45e5 100644
--- a/arch/arm/mach-vexpress/include/mach/uncompress.h
+++ b/arch/arm/mach-vexpress/include/mach/uncompress.h
@@ -17,30 +17,9 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#define AMBA_UART_DR(base)	(*(volatile unsigned char *)((base) + 0x00))
-#define AMBA_UART_LCRH(base)	(*(volatile unsigned char *)((base) + 0x2c))
-#define AMBA_UART_CR(base)	(*(volatile unsigned char *)((base) + 0x30))
-#define AMBA_UART_FR(base)	(*(volatile unsigned char *)((base) + 0x18))
+#define ARCH_HAVE_UCUART_GENERIC
 
-#define get_uart_base()	(0x10000000 + 0x00009000)
-
-/*
- * This does not append a newline
- */
-static inline void putc(int c)
+static inline void arch_decomp_setup(void)
 {
-	unsigned long base = get_uart_base();
-
-	while (AMBA_UART_FR(base) & (1 << 5))
-		barrier();
-
-	AMBA_UART_DR(base) = c;
-}
-
-static inline void flush(void)
-{
-	unsigned long base = get_uart_base();
-
-	while (AMBA_UART_FR(base) & (1 << 3))
-		barrier();
+	ucuart_init_amba01x(0x10009000);
 }
diff --git a/arch/arm/mach-vt8500/include/mach/uncompress.h b/arch/arm/mach-vt8500/include/mach/uncompress.h
index 6b93a01..3f7e315 100644
--- a/arch/arm/mach-vt8500/include/mach/uncompress.h
+++ b/arch/arm/mach-vt8500/include/mach/uncompress.h
@@ -14,18 +14,9 @@
  * GNU General Public License for more details.
  *
  */
+#define ARCH_HAVE_UCUART_GENERIC
 
-#define UART0_PHYS 0xd8200000
-#include <asm/io.h>
-
-static void putc(const char c)
-{
-	while (readb(UART0_PHYS + 0x1c) & 0x2)
-		/* Tx busy, wait and poll */;
-
-	writeb(c, UART0_PHYS);
-}
-
-static void flush(void)
+static inline void arch_decomp_setup(void)
 {
+	ucuart_init(0xd8200000, 0, UCUART_IO_MEM8, 0, 0x1C, 0x2, 0, 0, 0, 0);
 }
diff --git a/arch/arm/mach-w90x900/include/mach/uncompress.h b/arch/arm/mach-w90x900/include/mach/uncompress.h
index 935d950..f082f83 100644
--- a/arch/arm/mach-w90x900/include/mach/uncompress.h
+++ b/arch/arm/mach-w90x900/include/mach/uncompress.h
@@ -18,27 +18,10 @@
 #ifndef __ASM_ARCH_UNCOMPRESS_H
 #define __ASM_ARCH_UNCOMPRESS_H
 
-/* Defines for UART registers */
-
-#include <mach/regs-serial.h>
 #include <mach/map.h>
-#include <linux/serial_reg.h>
-
-#define TX_DONE	(UART_LSR_TEMT | UART_LSR_THRE)
-static volatile u32 * const uart_base = (u32 *)UART0_PA;
 
-static void putc(int ch)
+static inline void arch_decomp_setup(void)
 {
-	/* Check THRE and TEMT bits before we transmit the character.
-	 */
-	while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
-		barrier();
-
-	*uart_base = ch;
+	ucuart_init_8250(W90X900_PA_UART, 2, UCUART_IO_MEM32);
 }
-
-static inline void flush(void)
-{
-}
-
 #endif/* __ASM_W90X900_UNCOMPRESS_H */
diff --git a/arch/arm/mach-zynq/include/mach/uncompress.h b/arch/arm/mach-zynq/include/mach/uncompress.h
index 623cebe..c968774 100644
--- a/arch/arm/mach-zynq/include/mach/uncompress.h
+++ b/arch/arm/mach-zynq/include/mach/uncompress.h
@@ -15,31 +15,16 @@
 #ifndef __MACH_UNCOMPRESS_H__
 #define __MACH_UNCOMPRESS_H__
 
-#include <linux/io.h>
-#include <asm/processor.h>
 #include <mach/zynq_soc.h>
 #include <mach/uart.h>
 
-static inline void flush(void)
-{
-	/*
-	 * Wait while the FIFO is not empty
-	 */
-	while (!(__raw_readl(IOMEM(LL_UART_PADDR + UART_SR_OFFSET)) &
-		UART_SR_TXEMPTY))
-		cpu_relax();
-}
+#define ARCH_HAVE_UCUART_GENERIC
 
-static void putc(char ch)
+static inline void arch_decomp_setup(void)
 {
-	/*
-	 * Wait for room in the FIFO, then write the char into the FIFO
-	 */
-	while (__raw_readl(IOMEM(LL_UART_PADDR + UART_SR_OFFSET)) &
-		UART_SR_TXFULL)
-		cpu_relax();
-
-	__raw_writel(ch, IOMEM(LL_UART_PADDR + UART_FIFO_OFFSET));
+	ucuart_init(LL_UART_PADDR, 0, UCUART_IO_MEM32, UART_FIFO_OFFSET,
+			UART_SR_OFFSET, UART_SR_TXFULL, 0,
+			UART_SR_OFFSET, UART_SR_TXEMPTY, UART_SR_TXEMPTY);
 }
 
 #endif
diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/plat-mxc/include/mach/uncompress.h
index 6e43f5e..b7023be 100644
--- a/arch/arm/plat-mxc/include/mach/uncompress.h
+++ b/arch/arm/plat-mxc/include/mach/uncompress.h
@@ -21,10 +21,6 @@
 
 #include <asm/mach-types.h>
 
-unsigned long uart_base;
-
-#define UART(x) (*(volatile unsigned long *)(uart_base + (x)))
-
 #define USR2 0x98
 #define USR2_TXFE (1<<14)
 #define TXR  0x40
@@ -40,23 +36,6 @@ unsigned long uart_base;
  * This does not append a newline
  */
 
-static void putc(int ch)
-{
-	if (!uart_base)
-		return;
-	if (!(UART(UCR1) & UCR1_UARTEN))
-		return;
-
-	while (!(UART(USR2) & USR2_TXFE))
-		barrier();
-
-	UART(TXR) = ch;
-}
-
-static inline void flush(void)
-{
-}
-
 #define MX1_UART1_BASE_ADDR	0x00206000
 #define MX25_UART1_BASE_ADDR	0x43f90000
 #define MX2X_UART1_BASE_ADDR	0x1000a000
@@ -67,8 +46,10 @@ static inline void flush(void)
 #define MX50_UART1_BASE_ADDR	0x53fbc000
 #define MX53_UART1_BASE_ADDR	0x53fbc000
 
-static __inline__ void __arch_decomp_setup(unsigned long arch_id)
+static inline void arch_decomp_setup(void)
 {
+	int uart_base;
+
 	switch (arch_id) {
 	case MACH_TYPE_MX1ADS:
 	case MACH_TYPE_SCB9328:
@@ -123,9 +104,12 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
 	default:
 		break;
 	}
-}
 
-#define ARCH_HAVE_DECOMP_SETUP
-#define arch_decomp_setup()	__arch_decomp_setup(arch_id)
+	if (!__raw_readl((void __iomem *)uart_base + UCR1) & UCR1_UARTEN)
+		return;
+
+	ucuart_init(uart_base, 0, UCUART_IO_MEM32, TXR,
+			USR2, USR2_TXFE, USR2_TXFE, 0, 0, 0);
+}
 
 #endif				/* __ASM_ARCH_MXC_UNCOMPRESS_H__ */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
index 860c02b..8f87c24 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -16,20 +16,11 @@
  * version 2. This program is licensed "as is" without any warranty of any
  * kind, whether express or implied.
  */
-
-#include <linux/types.h>
-#include <linux/serial_reg.h>
-
-#include <asm/memory.h>
 #include <asm/mach-types.h>
-
 #include <plat/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.
@@ -45,30 +36,12 @@ static void set_omap_uart_info(unsigned char port)
 	*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_base = (dbg_uart);					\
 		uart_shift = (dbg_shft);				\
 		port = (dbg_id);					\
 		set_omap_uart_info(port);				\
@@ -103,8 +76,10 @@ static inline void flush(void)
 	_DEBUG_LL_ENTRY(mach, TI816X_UART##p##_BASE, OMAP_PORT_SHIFT,	\
 		TI816XUART##p)
 
-static inline void __arch_decomp_setup(unsigned long arch_id)
+static inline void arch_decomp_setup(void)
 {
+	int uart_base;
+	int uart_shift;
 	int port = 0;
 
 	/*
@@ -180,7 +155,11 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
 		DEBUG_LL_TI816X(3, ti8168evm);
 
 	} while (0);
-}
 
-#define ARCH_HAVE_DECOMP_SETUP
-#define arch_decomp_setup()	__arch_decomp_setup(arch_id)
+	/* Check for UART 16x mode */
+	if (__raw_readl((void __iomem *)uart_base +
+			UART_OMAP_MDR1 << uart_shift) & MDR1_MODE_MASK)
+		return;
+
+	ucuart_init_8250(uart_base, uart_shift, UCUART_IO_MEM8);
+}
diff --git a/arch/arm/plat-spear/include/plat/uncompress.h b/arch/arm/plat-spear/include/plat/uncompress.h
index 317cfe4..1eb0d82 100644
--- a/arch/arm/plat-spear/include/plat/uncompress.h
+++ b/arch/arm/plat-spear/include/plat/uncompress.h
@@ -10,28 +10,15 @@
  * License version 2. This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-
-#include <linux/io.h>
-#include <linux/amba/serial.h>
 #include <mach/hardware.h>
 
 #ifndef __PLAT_UNCOMPRESS_H
 #define __PLAT_UNCOMPRESS_H
-/*
- * This does not append a newline
- */
-static inline void putc(int c)
-{
-	void __iomem *base = (void __iomem *)SPEAR_DBG_UART_BASE;
 
-	while (readl_relaxed(base + UART01x_FR) & UART01x_FR_TXFF)
-		barrier();
+#define ARCH_HAVE_UCUART_GENERIC
 
-	writel_relaxed(c, base + UART01x_DR);
-}
-
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
+	ucuart_init_amba01x(SPEAR_DBG_UART_BASE);
 }
-
 #endif /* __PLAT_UNCOMPRESS_H */
diff --git a/arch/arm/plat-tcc/include/mach/uncompress.h b/arch/arm/plat-tcc/include/mach/uncompress.h
index 35a924e..b71a605 100644
--- a/arch/arm/plat-tcc/include/mach/uncompress.h
+++ b/arch/arm/plat-tcc/include/mach/uncompress.h
@@ -3,26 +3,11 @@
  *
  * This file is licensed under the terms of the GPL version 2.
  */
-
-#include <linux/serial_reg.h>
-#include <linux/types.h>
-
 #include <mach/tcc8k-regs.h>
 
-unsigned int system_rev;
-
-#define ID_MASK			0x7fff
-
-static void putc(int c)
-{
-	u32 *uart_lsr = (u32 *)(UART_BASE_PHYS + (UART_LSR << 2));
-	u32 *uart_tx = (u32 *)(UART_BASE_PHYS + (UART_TX << 2));
-
-	while (!(*uart_lsr & UART_LSR_THRE))
-		barrier();
-	*uart_tx = c;
-}
+#define ARCH_HAVE_UCUART_GENERIC
 
-static inline void flush(void)
+static inline void arch_decomp_setup(void)
 {
+	ucuart_init_8250(UART_BASE_PHYS, 2, UCUART_IO_MEM32);
 }
-- 
1.7.4.1

^ permalink raw reply related

* [RFC PATCH 09/15] ARM: uncompress: Introduce ucuart as low-level serial port driver
From: Zoltan Devai @ 2011-10-23 21:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1319404245-12740-1-git-send-email-zoss@devai.org>

This adds the ucuart struct which should be a sufficient
description for being able to print through a serial port.

Generic versions of putc() and flush() using ucuart are also
added, along with initialization helpers, one specifically
for the 8250 family UART and one for the AMBA01X PrimeCell.

The port structure is not declared statically, but inited
through arch_decomp_setup() to have it in the .bss area,
thus in RAM.

Signed-off-by: Zoltan Devai <zoss@devai.org>
---
 arch/arm/boot/compressed/print.c |  128 +++++++++++++++++++++++++++++++++++--
 1 files changed, 121 insertions(+), 7 deletions(-)

diff --git a/arch/arm/boot/compressed/print.c b/arch/arm/boot/compressed/print.c
index 25f0fb2..fbffc99 100644
--- a/arch/arm/boot/compressed/print.c
+++ b/arch/arm/boot/compressed/print.c
@@ -25,18 +25,120 @@ void error(char *x);
 extern unsigned int __machine_arch_type;
 #define arch_id __machine_arch_type
 
+enum ucuart_iotypes {
+	UCUART_IO_MEM32 = 0,
+	UCUART_IO_MEM8,
+};
+
+struct uncompress_uart {
+	void __iomem		*base;
+	int			reg_shift;
+	enum ucuart_iotypes	iotype;
+	int			tx_regoff;
+	int			txfree_regoff;
+	int			txfree_mask;
+	int			txfree_val;
+	int			flush_regoff;
+	int			flush_mask;
+	int			flush_val;
+};
+
+void ucuart_init(int base, int regshift, enum ucuart_iotypes iotype,
+		 int tx_regoff, int txfree_regoff, int txfree_mask,
+		 int txfree_val, int flush_regoff, int flush_mask,
+		 int flush_val);
+
+void ucuart_init_8250(int base, int regshift, enum ucuart_iotypes iotype);
+
+struct uncompress_uart ucuart;
+
 #include <mach/uncompress.h>
 
-#ifdef ARCH_HAVE_DECOMP_SETUP
-void inline decomp_setup(void)
+#ifdef ARCH_HAVE_UCUART_GENERIC
+
+#define ARCH_HAVE_DECOMP_SETUP
+
+#include <linux/io.h>
+#include <linux/serial_reg.h>
+#include <linux/amba/serial.h>
+
+void ucuart_init(int base, int regshift, enum ucuart_iotypes iotype,
+		 int tx_regoff, int txfree_regoff, int txfree_mask,
+		 int txfree_val, int flush_regoff, int flush_mask,
+		 int flush_val)
 {
-	arch_decomp_setup();
+	ucuart.base = (void __iomem *)base;
+	ucuart.reg_shift = regshift;
+	ucuart.iotype = iotype;
+
+	ucuart.tx_regoff = tx_regoff;
+	ucuart.txfree_regoff = txfree_regoff;
+	ucuart.txfree_mask = txfree_mask;
+	ucuart.txfree_val = txfree_val;
+	ucuart.flush_regoff = flush_regoff;
+	ucuart.flush_mask = flush_mask;
+	ucuart.flush_val = flush_val;
 }
-#else /* ARCH_HAVE_DECOMP_SETUP */
-void inline decomp_setup(void)
+
+void inline ucuart_init_8250(int base, int regshift, enum ucuart_iotypes iotype)
 {
+	ucuart_init(base, regshift, iotype, UART_TX,
+			UART_LSR, UART_LSR_THRE, UART_LSR_THRE,
+			UART_LSR, (UART_LSR_TEMT | UART_LSR_THRE),
+			(UART_LSR_TEMT | UART_LSR_THRE));
 }
-#endif /* ARCH_HAVE_DECOMP_SETUP */
+
+void ucuart_init_amba01x(int base)
+{
+	/* Do nothing if the UART is not enabled. */
+	if (!(__raw_readl(base + UART011_CR) & UART01x_CR_UARTEN))
+		return;
+
+	ucuart_init(base, 0, UCUART_IO_MEM32, UART01x_DR,
+			UART01x_FR, UART01x_FR_TXFF, 0,
+			UART01x_FR, UART01x_FR_BUSY, 0);
+}
+
+static inline int uart_read(int regoff)
+{
+	if (ucuart.iotype == UCUART_IO_MEM32)
+		return __raw_readl(ucuart.base + (regoff << ucuart.reg_shift));
+	else
+		return __raw_readb(ucuart.base + (regoff << ucuart.reg_shift));
+}
+
+static inline void uart_write(int regoff, int value)
+{
+	if (ucuart.iotype == UCUART_IO_MEM32)
+		__raw_writel(value, ucuart.base + (regoff << ucuart.reg_shift));
+	else
+		__raw_writeb(value, ucuart.base + (regoff << ucuart.reg_shift));
+}
+
+static inline void putc(int ch)
+{
+	if (!ucuart.base)
+		return;
+
+	if (ucuart.txfree_regoff) {
+		while ((uart_read(ucuart.txfree_regoff) & ucuart.txfree_mask)
+				!= ucuart.txfree_val)
+			barrier();
+	}
+
+	uart_write(ucuart.tx_regoff, ch);
+}
+
+static inline void flush(void)
+{
+	if (ucuart.flush_regoff) {
+		while ((uart_read(ucuart.flush_regoff) & ucuart.flush_mask) !=
+				ucuart.flush_val)
+			barrier();
+	}
+}
+#endif /* ARCH_HAVE_UCUART_GENERIC */
+
 
 #ifdef CONFIG_DEBUG_ICEDCC
 
@@ -91,7 +193,8 @@ static void icedcc_putc(int ch)
 #endif
 
 #define putc(ch)	icedcc_putc(ch)
-#endif
+#define flush()
+#endif /* CONFIG_DEBUG_ICEDCC */
 
 void putstr(const char *ptr)
 {
@@ -120,3 +223,14 @@ void error(char *x)
 
 	while(1);	/* Halt */
 }
+
+#ifdef ARCH_HAVE_DECOMP_SETUP
+void inline decomp_setup(void)
+{
+	arch_decomp_setup();
+}
+#else /* ARCH_HAVE_DECOMP_SETUP */
+void inline decomp_setup(void)
+{
+}
+#endif /* ARCH_HAVE_DECOMP_SETUP */
-- 
1.7.4.1

^ permalink raw reply related

* [RFC PATCH 08/15] ARM: uncompress: Rename misc.c to print.c
From: Zoltan Devai @ 2011-10-23 21:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1319404245-12740-1-git-send-email-zoss@devai.org>

Now that misc.c only holds functions related to printout
during decompression, rename it accordingly.

Signed-off-by: Zoltan Devai <zoss@devai.org>
---
 arch/arm/boot/compressed/Makefile |    2 +-
 arch/arm/boot/compressed/misc.c   |  122 -------------------------------------
 arch/arm/boot/compressed/print.c  |  122 +++++++++++++++++++++++++++++++++++++
 3 files changed, 123 insertions(+), 123 deletions(-)
 delete mode 100644 arch/arm/boot/compressed/misc.c
 create mode 100644 arch/arm/boot/compressed/print.c

diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index e4f32a8..d955d4f 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -23,7 +23,7 @@ endif
 
 AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
 HEAD	= head.o
-OBJS	+= misc.o decompress.o
+OBJS	+= print.o decompress.o
 FONTC	= $(srctree)/drivers/video/console/font_acorn_8x8.c
 
 # string library code (-Os is enforced to keep it much smaller)
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
deleted file mode 100644
index 25f0fb2..0000000
--- a/arch/arm/boot/compressed/misc.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * misc.c
- * 
- * This is a collection of several routines from gzip-1.0.3 
- * adapted for Linux.
- *
- * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
- *
- * Modified for ARM Linux by Russell King
- *
- * Nicolas Pitre <nico@visuaide.com>  1999/04/14 :
- *  For this code to run directly from Flash, all constant variables must
- *  be marked with 'const' and all other variables initialized at run-time 
- *  only.  This way all non constant variables will end up in the bss segment,
- *  which should point to addresses in RAM and cleared to 0 on start.
- *  This allows for a much quicker boot time.
- */
-
-#include <linux/compiler.h>	/* for inline */
-#include <linux/types.h>
-#include <linux/linkage.h>
-
-void putstr(const char *ptr);
-void error(char *x);
-extern unsigned int __machine_arch_type;
-#define arch_id __machine_arch_type
-
-#include <mach/uncompress.h>
-
-#ifdef ARCH_HAVE_DECOMP_SETUP
-void inline decomp_setup(void)
-{
-	arch_decomp_setup();
-}
-#else /* ARCH_HAVE_DECOMP_SETUP */
-void inline decomp_setup(void)
-{
-}
-#endif /* ARCH_HAVE_DECOMP_SETUP */
-
-#ifdef CONFIG_DEBUG_ICEDCC
-
-#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
-
-static void icedcc_putc(int ch)
-{
-	int status, i = 0x4000000;
-
-	do {
-		if (--i < 0)
-			return;
-
-		asm volatile ("mrc p14, 0, %0, c0, c1, 0" : "=r" (status));
-	} while (status & (1 << 29));
-
-	asm("mcr p14, 0, %0, c0, c5, 0" : : "r" (ch));
-}
-
-#elif defined(CONFIG_CPU_XSCALE)
-
-static void icedcc_putc(int ch)
-{
-	int status, i = 0x4000000;
-
-	do {
-		if (--i < 0)
-			return;
-
-		asm volatile ("mrc p14, 0, %0, c14, c0, 0" : "=r" (status));
-	} while (status & (1 << 28));
-
-	asm("mcr p14, 0, %0, c8, c0, 0" : : "r" (ch));
-}
-
-#else
-
-static void icedcc_putc(int ch)
-{
-	int status, i = 0x4000000;
-
-	do {
-		if (--i < 0)
-			return;
-
-		asm volatile ("mrc p14, 0, %0, c0, c0, 0" : "=r" (status));
-	} while (status & 2);
-
-	asm("mcr p14, 0, %0, c1, c0, 0" : : "r" (ch));
-}
-
-#endif
-
-#define putc(ch)	icedcc_putc(ch)
-#endif
-
-void putstr(const char *ptr)
-{
-	char c;
-
-	while ((c = *ptr++) != '\0') {
-		if (c == '\n')
-			putc('\r');
-		putc(c);
-	}
-
-	flush();
-}
-
-#ifndef arch_error
-#define arch_error(x)
-#endif
-
-void error(char *x)
-{
-	arch_error(x);
-
-	putstr("\n\n");
-	putstr(x);
-	putstr("\n\n -- System halted");
-
-	while(1);	/* Halt */
-}
diff --git a/arch/arm/boot/compressed/print.c b/arch/arm/boot/compressed/print.c
new file mode 100644
index 0000000..25f0fb2
--- /dev/null
+++ b/arch/arm/boot/compressed/print.c
@@ -0,0 +1,122 @@
+/*
+ * misc.c
+ * 
+ * This is a collection of several routines from gzip-1.0.3 
+ * adapted for Linux.
+ *
+ * malloc by Hannu Savolainen 1993 and Matthias Urlichs 1994
+ *
+ * Modified for ARM Linux by Russell King
+ *
+ * Nicolas Pitre <nico@visuaide.com>  1999/04/14 :
+ *  For this code to run directly from Flash, all constant variables must
+ *  be marked with 'const' and all other variables initialized at run-time 
+ *  only.  This way all non constant variables will end up in the bss segment,
+ *  which should point to addresses in RAM and cleared to 0 on start.
+ *  This allows for a much quicker boot time.
+ */
+
+#include <linux/compiler.h>	/* for inline */
+#include <linux/types.h>
+#include <linux/linkage.h>
+
+void putstr(const char *ptr);
+void error(char *x);
+extern unsigned int __machine_arch_type;
+#define arch_id __machine_arch_type
+
+#include <mach/uncompress.h>
+
+#ifdef ARCH_HAVE_DECOMP_SETUP
+void inline decomp_setup(void)
+{
+	arch_decomp_setup();
+}
+#else /* ARCH_HAVE_DECOMP_SETUP */
+void inline decomp_setup(void)
+{
+}
+#endif /* ARCH_HAVE_DECOMP_SETUP */
+
+#ifdef CONFIG_DEBUG_ICEDCC
+
+#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
+
+static void icedcc_putc(int ch)
+{
+	int status, i = 0x4000000;
+
+	do {
+		if (--i < 0)
+			return;
+
+		asm volatile ("mrc p14, 0, %0, c0, c1, 0" : "=r" (status));
+	} while (status & (1 << 29));
+
+	asm("mcr p14, 0, %0, c0, c5, 0" : : "r" (ch));
+}
+
+#elif defined(CONFIG_CPU_XSCALE)
+
+static void icedcc_putc(int ch)
+{
+	int status, i = 0x4000000;
+
+	do {
+		if (--i < 0)
+			return;
+
+		asm volatile ("mrc p14, 0, %0, c14, c0, 0" : "=r" (status));
+	} while (status & (1 << 28));
+
+	asm("mcr p14, 0, %0, c8, c0, 0" : : "r" (ch));
+}
+
+#else
+
+static void icedcc_putc(int ch)
+{
+	int status, i = 0x4000000;
+
+	do {
+		if (--i < 0)
+			return;
+
+		asm volatile ("mrc p14, 0, %0, c0, c0, 0" : "=r" (status));
+	} while (status & 2);
+
+	asm("mcr p14, 0, %0, c1, c0, 0" : : "r" (ch));
+}
+
+#endif
+
+#define putc(ch)	icedcc_putc(ch)
+#endif
+
+void putstr(const char *ptr)
+{
+	char c;
+
+	while ((c = *ptr++) != '\0') {
+		if (c == '\n')
+			putc('\r');
+		putc(c);
+	}
+
+	flush();
+}
+
+#ifndef arch_error
+#define arch_error(x)
+#endif
+
+void error(char *x)
+{
+	arch_error(x);
+
+	putstr("\n\n");
+	putstr(x);
+	putstr("\n\n -- System halted");
+
+	while(1);	/* Halt */
+}
-- 
1.7.4.1

^ permalink raw reply related

* [RFC PATCH 07/15] ARM: uncompress: Move decompressing related stuff to decompress.c
From: Zoltan Devai @ 2011-10-23 21:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1319404245-12740-1-git-send-email-zoss@devai.org>

Move decompressing related functions and declarations from misc.c
to decompress.c as it seems to be more logical.
misc.c now only holds the inclusion of uncompress.h and printing
functions.

Signed-off-by: Zoltan Devai <zoss@devai.org>
---
 arch/arm/boot/compressed/decompress.c |   59 +++++++++++++++++++++++++++++-
 arch/arm/boot/compressed/misc.c       |   66 ++++++++-------------------------
 2 files changed, 74 insertions(+), 51 deletions(-)

diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
index 6dec528..17200d5 100644
--- a/arch/arm/boot/compressed/decompress.c
+++ b/arch/arm/boot/compressed/decompress.c
@@ -1,3 +1,12 @@
+/*
+ * Nicolas Pitre <nico@visuaide.com>  1999/04/14 :
+ *  For this code to run directly from Flash, all constant variables must
+ *  be marked with 'const' and all other variables initialized at run-time
+ *  only.  This way all non constant variables will end up in the bss segment,
+ *  which should point to addresses in RAM and cleared to 0 on start.
+ *  This allows for a much quicker boot time.
+ */
+
 #define _LINUX_STRING_H_
 
 #include <linux/compiler.h>	/* for inline */
@@ -25,7 +34,55 @@ extern void error(char *);
 #include "../../../../lib/decompress_unlzma.c"
 #endif
 
-int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
+static int
+do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
 {
 	return decompress(input, len, NULL, NULL, output, NULL, error);
 }
+
+unsigned int __machine_arch_type;
+
+/* These are in misc.c */
+extern void putstr(const char *ptr);
+extern void error(char *x);
+extern void decomp_setup(void);
+
+/*
+ * gzip declarations
+ */
+extern char input_data[];
+extern char input_data_end[];
+
+unsigned char *output_data;
+
+unsigned long free_mem_ptr;
+unsigned long free_mem_end_ptr;
+
+void
+decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
+		unsigned long free_mem_ptr_end_p,
+		int arch_id)
+{
+	int ret;
+
+	output_data		= (unsigned char *)output_start;
+	free_mem_ptr		= free_mem_ptr_p;
+	free_mem_end_ptr	= free_mem_ptr_end_p;
+	__machine_arch_type	= arch_id;
+
+	/* This is arch_decomp_setup if its use is defined in uncompress.h */
+	decomp_setup();
+
+	putstr("Uncompressing Linux...");
+	ret = do_decompress(input_data, input_data_end - input_data,
+			    output_data, error);
+	if (ret)
+		error("decompressor returned an error");
+	else
+		putstr(" done, booting the kernel.\n");
+}
+
+asmlinkage void __div0(void)
+{
+	error("Attempting division by 0!");
+}
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index a4b8df2..25f0fb2 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -16,17 +16,28 @@
  *  This allows for a much quicker boot time.
  */
 
-unsigned int __machine_arch_type;
-
 #include <linux/compiler.h>	/* for inline */
 #include <linux/types.h>
 #include <linux/linkage.h>
 
-static void putstr(const char *ptr);
-extern void error(char *x);
+void putstr(const char *ptr);
+void error(char *x);
+extern unsigned int __machine_arch_type;
+#define arch_id __machine_arch_type
 
 #include <mach/uncompress.h>
 
+#ifdef ARCH_HAVE_DECOMP_SETUP
+void inline decomp_setup(void)
+{
+	arch_decomp_setup();
+}
+#else /* ARCH_HAVE_DECOMP_SETUP */
+void inline decomp_setup(void)
+{
+}
+#endif /* ARCH_HAVE_DECOMP_SETUP */
+
 #ifdef CONFIG_DEBUG_ICEDCC
 
 #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
@@ -45,7 +56,6 @@ static void icedcc_putc(int ch)
 	asm("mcr p14, 0, %0, c0, c5, 0" : : "r" (ch));
 }
 
-
 #elif defined(CONFIG_CPU_XSCALE)
 
 static void icedcc_putc(int ch)
@@ -83,7 +93,7 @@ static void icedcc_putc(int ch)
 #define putc(ch)	icedcc_putc(ch)
 #endif
 
-static void putstr(const char *ptr)
+void putstr(const char *ptr)
 {
 	char c;
 
@@ -96,17 +106,6 @@ static void putstr(const char *ptr)
 	flush();
 }
 
-/*
- * gzip declarations
- */
-extern char input_data[];
-extern char input_data_end[];
-
-unsigned char *output_data;
-
-unsigned long free_mem_ptr;
-unsigned long free_mem_end_ptr;
-
 #ifndef arch_error
 #define arch_error(x)
 #endif
@@ -121,36 +120,3 @@ void error(char *x)
 
 	while(1);	/* Halt */
 }
-
-asmlinkage void __div0(void)
-{
-	error("Attempting division by 0!");
-}
-
-extern int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x));
-
-
-void
-decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
-		unsigned long free_mem_ptr_end_p,
-		int arch_id)
-{
-	int ret;
-
-	output_data		= (unsigned char *)output_start;
-	free_mem_ptr		= free_mem_ptr_p;
-	free_mem_end_ptr	= free_mem_ptr_end_p;
-	__machine_arch_type	= arch_id;
-
-#ifdef ARCH_HAVE_DECOMP_SETUP
-	arch_decomp_setup();
-#endif /* ARCH_HAVE_DECOMP_SETUP */
-
-	putstr("Uncompressing Linux...");
-	ret = do_decompress(input_data, input_data_end - input_data,
-			    output_data, error);
-	if (ret)
-		error("decompressor returned an error");
-	else
-		putstr(" done, booting the kernel.\n");
-}
-- 
1.7.4.1

^ permalink raw reply related

* [RFC PATCH 06/15] ARM: uncompress: Remove unused Trace functions
From: Zoltan Devai @ 2011-10-23 21:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1319404245-12740-1-git-send-email-zoss@devai.org>

These trace functions were only used by the old inflate code
which isn't used on ARM anymore.

Signed-off-by: Zoltan Devai <zoss@devai.org>
---
 arch/arm/boot/compressed/decompress.c |   17 -----------------
 1 files changed, 0 insertions(+), 17 deletions(-)

diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
index 75b1605..6dec528 100644
--- a/arch/arm/boot/compressed/decompress.c
+++ b/arch/arm/boot/compressed/decompress.c
@@ -13,23 +13,6 @@ extern void error(char *);
 #define STATIC static
 #define STATIC_RW_DATA	/* non-static please */
 
-/* Diagnostic functions */
-#ifdef DEBUG
-#  define Assert(cond,msg) {if(!(cond)) error(msg);}
-#  define Trace(x) fprintf x
-#  define Tracev(x) {if (verbose) fprintf x ;}
-#  define Tracevv(x) {if (verbose>1) fprintf x ;}
-#  define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
-#  define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
-#else
-#  define Assert(cond,msg)
-#  define Trace(x)
-#  define Tracev(x)
-#  define Tracevv(x)
-#  define Tracec(c,x)
-#  define Tracecv(c,x)
-#endif
-
 #ifdef CONFIG_KERNEL_GZIP
 #include "../../../../lib/decompress_inflate.c"
 #endif
-- 
1.7.4.1

^ permalink raw reply related

* [RFC PATCH 05/15] ARM: uncompress.h: Remove unused arch_decomp_setup declarations
From: Zoltan Devai @ 2011-10-23 21:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1319404245-12740-1-git-send-email-zoss@devai.org>

Now that the decompressor code only calls this function
when ARCH_HAVE_DECOMP_SETUP is defined, the unused empty
declarations can go away.

As an added bonus, over 30 comments stating "nothing to do"
get deleted, making the ARM arch more busy than ever.

Signed-off-by: Zoltan Devai <zoss@devai.org>
---
 arch/arm/mach-at91/include/mach/uncompress.h       |    2 --
 arch/arm/mach-bcmring/include/mach/uncompress.h    |    2 --
 arch/arm/mach-clps711x/include/mach/uncompress.h   |    5 -----
 arch/arm/mach-cns3xxx/include/mach/uncompress.h    |    5 -----
 arch/arm/mach-dove/include/mach/uncompress.h       |    5 -----
 arch/arm/mach-ebsa110/include/mach/uncompress.h    |    5 -----
 arch/arm/mach-footbridge/include/mach/uncompress.h |    5 -----
 arch/arm/mach-gemini/include/mach/uncompress.h     |    5 -----
 arch/arm/mach-h720x/include/mach/uncompress.h      |    5 -----
 arch/arm/mach-integrator/include/mach/uncompress.h |    5 -----
 arch/arm/mach-iop13xx/include/mach/uncompress.h    |    5 -----
 arch/arm/mach-ixp2000/include/mach/uncompress.h    |    2 --
 arch/arm/mach-ixp23xx/include/mach/uncompress.h    |    2 --
 arch/arm/mach-kirkwood/include/mach/uncompress.h   |    5 -----
 arch/arm/mach-ks8695/include/mach/uncompress.h     |    2 --
 arch/arm/mach-lpc32xx/include/mach/uncompress.h    |    3 ---
 arch/arm/mach-msm/include/mach/uncompress.h        |    4 ----
 arch/arm/mach-mv78xx0/include/mach/uncompress.h    |    5 -----
 arch/arm/mach-netx/include/mach/uncompress.h       |    5 -----
 arch/arm/mach-nomadik/include/mach/uncompress.h    |    4 ----
 arch/arm/mach-orion5x/include/mach/uncompress.h    |    5 -----
 arch/arm/mach-picoxcell/include/mach/uncompress.h  |    1 -
 arch/arm/mach-pnx4008/include/mach/uncompress.h    |    5 -----
 arch/arm/mach-prima2/include/mach/uncompress.h     |    4 ----
 arch/arm/mach-realview/include/mach/uncompress.h   |    5 -----
 arch/arm/mach-sa1100/include/mach/uncompress.h     |    5 -----
 arch/arm/mach-shark/include/mach/uncompress.h      |    5 -----
 arch/arm/mach-shmobile/include/mach/uncompress.h   |    4 ----
 arch/arm/mach-u300/include/mach/uncompress.h       |    5 -----
 arch/arm/mach-versatile/include/mach/uncompress.h  |    5 -----
 arch/arm/mach-vexpress/include/mach/uncompress.h   |    5 -----
 arch/arm/mach-vt8500/include/mach/uncompress.h     |    5 -----
 arch/arm/mach-w90x900/include/mach/uncompress.h    |    4 ----
 arch/arm/mach-zynq/include/mach/uncompress.h       |    4 ----
 arch/arm/plat-spear/include/plat/uncompress.h      |    5 -----
 arch/arm/plat-tcc/include/mach/uncompress.h        |    5 -----
 36 files changed, 0 insertions(+), 153 deletions(-)

diff --git a/arch/arm/mach-at91/include/mach/uncompress.h b/arch/arm/mach-at91/include/mach/uncompress.h
index b5dd672..c644b13 100644
--- a/arch/arm/mach-at91/include/mach/uncompress.h
+++ b/arch/arm/mach-at91/include/mach/uncompress.h
@@ -69,6 +69,4 @@ static inline void flush(void)
 #endif
 }
 
-#define arch_decomp_setup()
-
 #endif
diff --git a/arch/arm/mach-bcmring/include/mach/uncompress.h b/arch/arm/mach-bcmring/include/mach/uncompress.h
index 5419901..7a365aa 100644
--- a/arch/arm/mach-bcmring/include/mach/uncompress.h
+++ b/arch/arm/mach-bcmring/include/mach/uncompress.h
@@ -38,5 +38,3 @@ static inline void flush(void)
 	while (BCMRING_UART_0_FR & (1 << 3))
 		;
 }
-
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-clps711x/include/mach/uncompress.h b/arch/arm/mach-clps711x/include/mach/uncompress.h
index 2edd488..3090a43 100644
--- a/arch/arm/mach-clps711x/include/mach/uncompress.h
+++ b/arch/arm/mach-clps711x/include/mach/uncompress.h
@@ -50,8 +50,3 @@ static inline void flush(void)
 	while (clps_readl(SYSFLGx) & SYSFLG_UBUSY)
 		barrier();
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-cns3xxx/include/mach/uncompress.h b/arch/arm/mach-cns3xxx/include/mach/uncompress.h
index 7a030b9..255a167 100644
--- a/arch/arm/mach-cns3xxx/include/mach/uncompress.h
+++ b/arch/arm/mach-cns3xxx/include/mach/uncompress.h
@@ -46,8 +46,3 @@ static inline void flush(void)
 	while (AMBA_UART_FR(base) & (1 << 3))
 		barrier();
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-dove/include/mach/uncompress.h b/arch/arm/mach-dove/include/mach/uncompress.h
index 5c8ae9b..3bc22a1 100644
--- a/arch/arm/mach-dove/include/mach/uncompress.h
+++ b/arch/arm/mach-dove/include/mach/uncompress.h
@@ -29,8 +29,3 @@ static void putc(const char c)
 static void flush(void)
 {
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-ebsa110/include/mach/uncompress.h b/arch/arm/mach-ebsa110/include/mach/uncompress.h
index ab64bea..507ec2a 100644
--- a/arch/arm/mach-ebsa110/include/mach/uncompress.h
+++ b/arch/arm/mach-ebsa110/include/mach/uncompress.h
@@ -37,8 +37,3 @@ static inline void flush(void)
 	} while ((v & (UART_LSR_TEMT|UART_LSR_THRE)) !=
 		 (UART_LSR_TEMT|UART_LSR_THRE));
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-footbridge/include/mach/uncompress.h b/arch/arm/mach-footbridge/include/mach/uncompress.h
index a69398c..36313de 100644
--- a/arch/arm/mach-footbridge/include/mach/uncompress.h
+++ b/arch/arm/mach-footbridge/include/mach/uncompress.h
@@ -30,8 +30,3 @@ static inline void putc(char c)
 static inline void flush(void)
 {
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-gemini/include/mach/uncompress.h b/arch/arm/mach-gemini/include/mach/uncompress.h
index 02e2256..1828862 100644
--- a/arch/arm/mach-gemini/include/mach/uncompress.h
+++ b/arch/arm/mach-gemini/include/mach/uncompress.h
@@ -34,9 +34,4 @@ static inline void flush(void)
 {
 }
 
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
-
 #endif /* __MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-h720x/include/mach/uncompress.h b/arch/arm/mach-h720x/include/mach/uncompress.h
index 43e343c..46c8d5a 100644
--- a/arch/arm/mach-h720x/include/mach/uncompress.h
+++ b/arch/arm/mach-h720x/include/mach/uncompress.h
@@ -28,9 +28,4 @@ static inline void flush(void)
 {
 }
 
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
-
 #endif
diff --git a/arch/arm/mach-integrator/include/mach/uncompress.h b/arch/arm/mach-integrator/include/mach/uncompress.h
index 8f3cc99..9f61543 100644
--- a/arch/arm/mach-integrator/include/mach/uncompress.h
+++ b/arch/arm/mach-integrator/include/mach/uncompress.h
@@ -41,8 +41,3 @@ static inline void flush(void)
 	while (AMBA_UART_FR & (1 << 3))
 		barrier();
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-iop13xx/include/mach/uncompress.h b/arch/arm/mach-iop13xx/include/mach/uncompress.h
index d3791ec..bfa8eac 100644
--- a/arch/arm/mach-iop13xx/include/mach/uncompress.h
+++ b/arch/arm/mach-iop13xx/include/mach/uncompress.h
@@ -15,8 +15,3 @@ static inline void putc(char c)
 static inline void flush(void)
 {
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-ixp2000/include/mach/uncompress.h b/arch/arm/mach-ixp2000/include/mach/uncompress.h
index 126e5d7..519ba97 100644
--- a/arch/arm/mach-ixp2000/include/mach/uncompress.h
+++ b/arch/arm/mach-ixp2000/include/mach/uncompress.h
@@ -42,5 +42,3 @@ static inline void putc(int c)
 static inline void flush(void)
 {
 }
-
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-ixp23xx/include/mach/uncompress.h b/arch/arm/mach-ixp23xx/include/mach/uncompress.h
index 1ac7020..ab23cbb 100644
--- a/arch/arm/mach-ixp23xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ixp23xx/include/mach/uncompress.h
@@ -33,6 +33,4 @@ static inline void flush(void)
 {
 }
 
-#define arch_decomp_setup()
-
 #endif
diff --git a/arch/arm/mach-kirkwood/include/mach/uncompress.h b/arch/arm/mach-kirkwood/include/mach/uncompress.h
index 5bca553..1fc91eb 100644
--- a/arch/arm/mach-kirkwood/include/mach/uncompress.h
+++ b/arch/arm/mach-kirkwood/include/mach/uncompress.h
@@ -39,8 +39,3 @@ static void flush(void)
 		barrier();
 	}
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-ks8695/include/mach/uncompress.h b/arch/arm/mach-ks8695/include/mach/uncompress.h
index 9a54080..548c43b 100644
--- a/arch/arm/mach-ks8695/include/mach/uncompress.h
+++ b/arch/arm/mach-ks8695/include/mach/uncompress.h
@@ -31,6 +31,4 @@ static inline void flush(void)
 		barrier();
 }
 
-#define arch_decomp_setup()
-
 #endif
diff --git a/arch/arm/mach-lpc32xx/include/mach/uncompress.h b/arch/arm/mach-lpc32xx/include/mach/uncompress.h
index 1198a89..36176e2 100644
--- a/arch/arm/mach-lpc32xx/include/mach/uncompress.h
+++ b/arch/arm/mach-lpc32xx/include/mach/uncompress.h
@@ -53,7 +53,4 @@ static inline void flush(void)
 		UART_FIFO_CTL_TX_RESET, _UARTREG(LPC32XX_UART_IIRFCR_O));
 }
 
-/* NULL functions; we don't presently need them */
-#define arch_decomp_setup()
-
 #endif
diff --git a/arch/arm/mach-msm/include/mach/uncompress.h b/arch/arm/mach-msm/include/mach/uncompress.h
index 0fe7930..7fa472d 100644
--- a/arch/arm/mach-msm/include/mach/uncompress.h
+++ b/arch/arm/mach-msm/include/mach/uncompress.h
@@ -32,8 +32,4 @@ static inline void flush(void)
 {
 }
 
-static inline void arch_decomp_setup(void)
-{
-}
-
 #endif
diff --git a/arch/arm/mach-mv78xx0/include/mach/uncompress.h b/arch/arm/mach-mv78xx0/include/mach/uncompress.h
index 6a761c4..d26eb30 100644
--- a/arch/arm/mach-mv78xx0/include/mach/uncompress.h
+++ b/arch/arm/mach-mv78xx0/include/mach/uncompress.h
@@ -39,8 +39,3 @@ static void flush(void)
 		barrier();
 	}
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-netx/include/mach/uncompress.h b/arch/arm/mach-netx/include/mach/uncompress.h
index 5cb1051..0e011ee 100644
--- a/arch/arm/mach-netx/include/mach/uncompress.h
+++ b/arch/arm/mach-netx/include/mach/uncompress.h
@@ -68,8 +68,3 @@ static inline void flush(void)
 
 	while (REG(base + UART_FR) & FR_BUSY);
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-nomadik/include/mach/uncompress.h b/arch/arm/mach-nomadik/include/mach/uncompress.h
index 765bff1..08f6615 100644
--- a/arch/arm/mach-nomadik/include/mach/uncompress.h
+++ b/arch/arm/mach-nomadik/include/mach/uncompress.h
@@ -54,8 +54,4 @@ static void flush(void)
 		barrier();
 }
 
-static inline void arch_decomp_setup(void)
-{
-}
-
 #endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-orion5x/include/mach/uncompress.h b/arch/arm/mach-orion5x/include/mach/uncompress.h
index abd26b5..a4dca1c 100644
--- a/arch/arm/mach-orion5x/include/mach/uncompress.h
+++ b/arch/arm/mach-orion5x/include/mach/uncompress.h
@@ -41,8 +41,3 @@ static void flush(void)
 		barrier();
 	}
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-picoxcell/include/mach/uncompress.h b/arch/arm/mach-picoxcell/include/mach/uncompress.h
index db46249..f04f368 100644
--- a/arch/arm/mach-picoxcell/include/mach/uncompress.h
+++ b/arch/arm/mach-picoxcell/include/mach/uncompress.h
@@ -17,4 +17,3 @@
  */
 #define putc(c)
 #define flush()
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-pnx4008/include/mach/uncompress.h b/arch/arm/mach-pnx4008/include/mach/uncompress.h
index 26b507d..add0c75 100644
--- a/arch/arm/mach-pnx4008/include/mach/uncompress.h
+++ b/arch/arm/mach-pnx4008/include/mach/uncompress.h
@@ -38,8 +38,3 @@ static __inline__ void putc(char c)
 static inline void flush(void)
 {
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-prima2/include/mach/uncompress.h b/arch/arm/mach-prima2/include/mach/uncompress.h
index 1e17796..9ee022f 100644
--- a/arch/arm/mach-prima2/include/mach/uncompress.h
+++ b/arch/arm/mach-prima2/include/mach/uncompress.h
@@ -13,10 +13,6 @@
 #include <mach/hardware.h>
 #include <mach/uart.h>
 
-void arch_decomp_setup(void)
-{
-}
-
 static __inline__ void putc(char c)
 {
 	/*
diff --git a/arch/arm/mach-realview/include/mach/uncompress.h b/arch/arm/mach-realview/include/mach/uncompress.h
index cfa30d2..9ba06e9 100644
--- a/arch/arm/mach-realview/include/mach/uncompress.h
+++ b/arch/arm/mach-realview/include/mach/uncompress.h
@@ -70,8 +70,3 @@ static inline void flush(void)
 	while (AMBA_UART_FR(base) & (1 << 3))
 		barrier();
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-sa1100/include/mach/uncompress.h b/arch/arm/mach-sa1100/include/mach/uncompress.h
index a834962..55c9e59 100644
--- a/arch/arm/mach-sa1100/include/mach/uncompress.h
+++ b/arch/arm/mach-sa1100/include/mach/uncompress.h
@@ -42,8 +42,3 @@ static void putc(int c)
 static inline void flush(void)
 {
 }
-
-/*
- * Nothing to do for these
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-shark/include/mach/uncompress.h b/arch/arm/mach-shark/include/mach/uncompress.h
index a168435..40f4b68 100644
--- a/arch/arm/mach-shark/include/mach/uncompress.h
+++ b/arch/arm/mach-shark/include/mach/uncompress.h
@@ -43,8 +43,3 @@ static void putr()
 	putc('\r');
 }
 #endif
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-shmobile/include/mach/uncompress.h b/arch/arm/mach-shmobile/include/mach/uncompress.h
index f1aee56..b2b2860 100644
--- a/arch/arm/mach-shmobile/include/mach/uncompress.h
+++ b/arch/arm/mach-shmobile/include/mach/uncompress.h
@@ -12,8 +12,4 @@ static inline void flush(void)
 {
 }
 
-static void arch_decomp_setup(void)
-{
-}
-
 #endif /* __ASM_MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-u300/include/mach/uncompress.h b/arch/arm/mach-u300/include/mach/uncompress.h
index 783e7e6..68d0298 100644
--- a/arch/arm/mach-u300/include/mach/uncompress.h
+++ b/arch/arm/mach-u300/include/mach/uncompress.h
@@ -38,8 +38,3 @@ static inline void flush(void)
 	while (AMBA_UART_FR & (1 << 3))
 		barrier();
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-versatile/include/mach/uncompress.h b/arch/arm/mach-versatile/include/mach/uncompress.h
index 986e3d3..164b9b5 100644
--- a/arch/arm/mach-versatile/include/mach/uncompress.h
+++ b/arch/arm/mach-versatile/include/mach/uncompress.h
@@ -38,8 +38,3 @@ static inline void flush(void)
 	while (AMBA_UART_FR & (1 << 3))
 		barrier();
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-vexpress/include/mach/uncompress.h b/arch/arm/mach-vexpress/include/mach/uncompress.h
index a16872b..0f85a648 100644
--- a/arch/arm/mach-vexpress/include/mach/uncompress.h
+++ b/arch/arm/mach-vexpress/include/mach/uncompress.h
@@ -44,8 +44,3 @@ static inline void flush(void)
 	while (AMBA_UART_FR(base) & (1 << 3))
 		barrier();
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-vt8500/include/mach/uncompress.h b/arch/arm/mach-vt8500/include/mach/uncompress.h
index 14ec0ec..6b93a01 100644
--- a/arch/arm/mach-vt8500/include/mach/uncompress.h
+++ b/arch/arm/mach-vt8500/include/mach/uncompress.h
@@ -29,8 +29,3 @@ static void putc(const char c)
 static void flush(void)
 {
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
diff --git a/arch/arm/mach-w90x900/include/mach/uncompress.h b/arch/arm/mach-w90x900/include/mach/uncompress.h
index 4b7c324..935d950 100644
--- a/arch/arm/mach-w90x900/include/mach/uncompress.h
+++ b/arch/arm/mach-w90x900/include/mach/uncompress.h
@@ -41,8 +41,4 @@ static inline void flush(void)
 {
 }
 
-static void arch_decomp_setup(void)
-{
-}
-
 #endif/* __ASM_W90X900_UNCOMPRESS_H */
diff --git a/arch/arm/mach-zynq/include/mach/uncompress.h b/arch/arm/mach-zynq/include/mach/uncompress.h
index 11c3216..623cebe 100644
--- a/arch/arm/mach-zynq/include/mach/uncompress.h
+++ b/arch/arm/mach-zynq/include/mach/uncompress.h
@@ -20,10 +20,6 @@
 #include <mach/zynq_soc.h>
 #include <mach/uart.h>
 
-void arch_decomp_setup(void)
-{
-}
-
 static inline void flush(void)
 {
 	/*
diff --git a/arch/arm/plat-spear/include/plat/uncompress.h b/arch/arm/plat-spear/include/plat/uncompress.h
index b631aab..317cfe4 100644
--- a/arch/arm/plat-spear/include/plat/uncompress.h
+++ b/arch/arm/plat-spear/include/plat/uncompress.h
@@ -34,9 +34,4 @@ static inline void flush(void)
 {
 }
 
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
-
 #endif /* __PLAT_UNCOMPRESS_H */
diff --git a/arch/arm/plat-tcc/include/mach/uncompress.h b/arch/arm/plat-tcc/include/mach/uncompress.h
index 2e9c2bb..35a924e 100644
--- a/arch/arm/plat-tcc/include/mach/uncompress.h
+++ b/arch/arm/plat-tcc/include/mach/uncompress.h
@@ -26,8 +26,3 @@ static void putc(int c)
 static inline void flush(void)
 {
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_setup()
-- 
1.7.4.1

^ permalink raw reply related

* [RFC PATCH 04/15] ARM: uncompress: Only call arch_decomp_setup when needed
From: Zoltan Devai @ 2011-10-23 21:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1319404245-12740-1-git-send-email-zoss@devai.org>

As only the minority of the machines uses arch_decomp_setup,
ifdef it out when not needed, to avoid needless defines in
all uncompress.h files.

Machines using this feature should add
in their uncompress.h headers.

Signed-off-by: Zoltan Devai <zoss@devai.org>
---
 arch/arm/boot/compressed/misc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index 8e2a8fc..a4b8df2 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -142,7 +142,9 @@ decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
 	free_mem_end_ptr	= free_mem_ptr_end_p;
 	__machine_arch_type	= arch_id;
 
+#ifdef ARCH_HAVE_DECOMP_SETUP
 	arch_decomp_setup();
+#endif /* ARCH_HAVE_DECOMP_SETUP */
 
 	putstr("Uncompressing Linux...");
 	ret = do_decompress(input_data, input_data_end - input_data,
-- 
1.7.4.1

^ permalink raw reply related

* [RFC PATCH 03/15] ARM: uncompress.h: Introduce ARCH_HAVE_DECOMP_SETUP
From: Zoltan Devai @ 2011-10-23 21:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1319404245-12740-1-git-send-email-zoss@devai.org>

Add this define to machines which really make use of
this function.

Signed-off-by: Zoltan Devai <zoss@devai.org>
---
 arch/arm/mach-davinci/include/mach/uncompress.h |    1 +
 arch/arm/mach-ep93xx/include/mach/uncompress.h  |    1 +
 arch/arm/mach-iop32x/include/mach/uncompress.h  |    4 +---
 arch/arm/mach-iop33x/include/mach/uncompress.h  |    4 +---
 arch/arm/mach-ixp4xx/include/mach/uncompress.h  |    1 +
 arch/arm/mach-mmp/include/mach/uncompress.h     |    2 ++
 arch/arm/mach-mxs/include/mach/uncompress.h     |    1 +
 arch/arm/mach-pxa/include/mach/uncompress.h     |    2 ++
 arch/arm/mach-rpc/include/mach/uncompress.h     |    2 ++
 arch/arm/mach-s5p64x0/include/mach/uncompress.h |    2 ++
 arch/arm/mach-tegra/include/mach/uncompress.h   |    2 ++
 arch/arm/mach-ux500/include/mach/uncompress.h   |    2 ++
 arch/arm/plat-mxc/include/mach/uncompress.h     |    1 +
 arch/arm/plat-omap/include/plat/uncompress.h    |    1 +
 arch/arm/plat-samsung/include/plat/uncompress.h |    2 ++
 15 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h
index 8d63753..1947ff9 100644
--- a/arch/arm/mach-davinci/include/mach/uncompress.h
+++ b/arch/arm/mach-davinci/include/mach/uncompress.h
@@ -102,4 +102,5 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
 	} while (0);
 }
 
+#define ARCH_HAVE_DECOMP_SETUP
 #define arch_decomp_setup()	__arch_decomp_setup(arch_id)
diff --git a/arch/arm/mach-ep93xx/include/mach/uncompress.h b/arch/arm/mach-ep93xx/include/mach/uncompress.h
index b2ecb98..f1cd638 100644
--- a/arch/arm/mach-ep93xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ep93xx/include/mach/uncompress.h
@@ -85,6 +85,7 @@ static void ethernet_reset(void)
 		;
 }
 
+#define ARCH_HAVE_DECOMP_SETUP
 
 static void arch_decomp_setup(void)
 {
diff --git a/arch/arm/mach-iop32x/include/mach/uncompress.h b/arch/arm/mach-iop32x/include/mach/uncompress.h
index b3d45fd..c1ff29a 100644
--- a/arch/arm/mach-iop32x/include/mach/uncompress.h
+++ b/arch/arm/mach-iop32x/include/mach/uncompress.h
@@ -32,7 +32,5 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
 		uart_base = (volatile u8 *)0xfe800000;
 }
 
-/*
- * nothing to do
- */
+#define ARCH_HAVE_DECOMP_SETUP
 #define arch_decomp_setup()	__arch_decomp_setup(arch_id)
diff --git a/arch/arm/mach-iop33x/include/mach/uncompress.h b/arch/arm/mach-iop33x/include/mach/uncompress.h
index ed282e1..9537d4b 100644
--- a/arch/arm/mach-iop33x/include/mach/uncompress.h
+++ b/arch/arm/mach-iop33x/include/mach/uncompress.h
@@ -30,7 +30,5 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
 		uart_base = (volatile u32 *)0xfe800000;
 }
 
-/*
- * nothing to do
- */
+#define ARCH_HAVE_DECOMP_SETUP
 #define arch_decomp_setup()	__arch_decomp_setup(arch_id)
diff --git a/arch/arm/mach-ixp4xx/include/mach/uncompress.h b/arch/arm/mach-ixp4xx/include/mach/uncompress.h
index 7b25c02..0a0102c 100644
--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h
@@ -51,6 +51,7 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
 /*
  * arch_id is a variable in decompress_kernel()
  */
+#define ARCH_HAVE_DECOMP_SETUP
 #define arch_decomp_setup()	__arch_decomp_setup(arch_id)
 
 #endif
diff --git a/arch/arm/mach-mmp/include/mach/uncompress.h b/arch/arm/mach-mmp/include/mach/uncompress.h
index 8890fa8..8c58b57 100644
--- a/arch/arm/mach-mmp/include/mach/uncompress.h
+++ b/arch/arm/mach-mmp/include/mach/uncompress.h
@@ -35,6 +35,8 @@ static inline void flush(void)
 {
 }
 
+#define ARCH_HAVE_DECOMP_SETUP
+
 static inline void arch_decomp_setup(void)
 {
 	/* default to UART2 */
diff --git a/arch/arm/mach-mxs/include/mach/uncompress.h b/arch/arm/mach-mxs/include/mach/uncompress.h
index 6ab8972..eded40b 100644
--- a/arch/arm/mach-mxs/include/mach/uncompress.h
+++ b/arch/arm/mach-mxs/include/mach/uncompress.h
@@ -71,6 +71,7 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
 	}
 }
 
+#define ARCH_HAVE_DECOMP_SETUP
 #define arch_decomp_setup()	__arch_decomp_setup(arch_id)
 
 #endif /* __MACH_MXS_UNCOMPRESS_H__ */
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h b/arch/arm/mach-pxa/include/mach/uncompress.h
index 8c27757..28acded 100644
--- a/arch/arm/mach-pxa/include/mach/uncompress.h
+++ b/arch/arm/mach-pxa/include/mach/uncompress.h
@@ -54,6 +54,8 @@ static inline void flush(void)
 {
 }
 
+#define ARCH_HAVE_DECOMP_SETUP
+
 static inline void arch_decomp_setup(void)
 {
 	/* initialize to default */
diff --git a/arch/arm/mach-rpc/include/mach/uncompress.h b/arch/arm/mach-rpc/include/mach/uncompress.h
index 0fd4b0b..5ea3974 100644
--- a/arch/arm/mach-rpc/include/mach/uncompress.h
+++ b/arch/arm/mach-rpc/include/mach/uncompress.h
@@ -109,6 +109,8 @@ static inline void flush(void)
 {
 }
 
+#define ARCH_HAVE_DECOMP_SETUP
+
 /*
  * Setup for decompression
  */
diff --git a/arch/arm/mach-s5p64x0/include/mach/uncompress.h b/arch/arm/mach-s5p64x0/include/mach/uncompress.h
index 00b70b8..8d537eb 100644
--- a/arch/arm/mach-s5p64x0/include/mach/uncompress.h
+++ b/arch/arm/mach-s5p64x0/include/mach/uncompress.h
@@ -151,6 +151,8 @@ static inline void arch_enable_uart_fifo(void)
 #define arch_enable_uart_fifo() do { } while(0)
 #endif
 
+#define ARCH_HAVE_DECOMP_SETUP
+
 static void arch_decomp_setup(void)
 {
 	/*
diff --git a/arch/arm/mach-tegra/include/mach/uncompress.h b/arch/arm/mach-tegra/include/mach/uncompress.h
index 565daa6..1b07047 100644
--- a/arch/arm/mach-tegra/include/mach/uncompress.h
+++ b/arch/arm/mach-tegra/include/mach/uncompress.h
@@ -43,6 +43,8 @@ static inline void flush(void)
 {
 }
 
+#define ARCH_HAVE_DECOMP_SETUP
+
 static inline void arch_decomp_setup(void)
 {
 	volatile u8 *uart = (volatile u8 *)TEGRA_DEBUG_UART_BASE;
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h
index ec957e8..d096c99 100644
--- a/arch/arm/mach-ux500/include/mach/uncompress.h
+++ b/arch/arm/mach-ux500/include/mach/uncompress.h
@@ -48,6 +48,8 @@ static void flush(void)
 		barrier();
 }
 
+#define ARCH_HAVE_DECOMP_SETUP
+
 static inline void arch_decomp_setup(void)
 {
 	/* Check in run time if we run on an U8500 or U5500 */
diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/plat-mxc/include/mach/uncompress.h
index d9412a1..6e43f5e 100644
--- a/arch/arm/plat-mxc/include/mach/uncompress.h
+++ b/arch/arm/plat-mxc/include/mach/uncompress.h
@@ -125,6 +125,7 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
 	}
 }
 
+#define ARCH_HAVE_DECOMP_SETUP
 #define arch_decomp_setup()	__arch_decomp_setup(arch_id)
 
 #endif				/* __ASM_ARCH_MXC_UNCOMPRESS_H__ */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
index c5111bd..860c02b 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -182,4 +182,5 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
 	} while (0);
 }
 
+#define ARCH_HAVE_DECOMP_SETUP
 #define arch_decomp_setup()	__arch_decomp_setup(arch_id)
diff --git a/arch/arm/plat-samsung/include/plat/uncompress.h b/arch/arm/plat-samsung/include/plat/uncompress.h
index 94fecf9..b10e0be 100644
--- a/arch/arm/plat-samsung/include/plat/uncompress.h
+++ b/arch/arm/plat-samsung/include/plat/uncompress.h
@@ -130,6 +130,8 @@ static inline void arch_enable_uart_fifo(void)
 #define arch_enable_uart_fifo() do { } while(0)
 #endif
 
+#define ARCH_HAVE_DECOMP_SETUP
+
 static void
 arch_decomp_setup(void)
 {
-- 
1.7.4.1

^ permalink raw reply related

* [RFC PATCH 02/15] ARM: uncompress: Remove unused definition of ARCH_HAS_DECOMP_WATCHDOG
From: Zoltan Devai @ 2011-10-23 21:10 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1319404245-12740-1-git-send-email-zoss@devai.org>

This was only used by the old inflate code, which isn't used
anymore by ARM.

Signed-off-by: Zoltan Devai <zoss@devai.org>
---
 arch/arm/boot/compressed/decompress.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
index 07be5a2..75b1605 100644
--- a/arch/arm/boot/compressed/decompress.c
+++ b/arch/arm/boot/compressed/decompress.c
@@ -13,8 +13,6 @@ extern void error(char *);
 #define STATIC static
 #define STATIC_RW_DATA	/* non-static please */
 
-#define ARCH_HAS_DECOMP_WDOG
-
 /* Diagnostic functions */
 #ifdef DEBUG
 #  define Assert(cond,msg) {if(!(cond)) error(msg);}
-- 
1.7.4.1

^ permalink raw reply related

* [RFC PATCH 01/15] ARM: uncompress.h: Remove unused arch_decomp_wdog defines
From: Zoltan Devai @ 2011-10-23 21:10 UTC (permalink / raw)
  To: linux-arm-kernel

arch_decomp_wdog is only used by lib/inflate.c which isn't used
by the ARM arch since 2.6.33.
Stop carrying it around and re-adding it with every new machine.

The only real user was the Samsung platform, but since this
feature wasn't working for over a year, it's probably
not needed at all.

Signed-off-by: Zoltan Devai <zoss@devai.org>
---
 arch/arm/mach-at91/include/mach/uncompress.h       |    2 -
 arch/arm/mach-bcmring/include/mach/uncompress.h    |    1 -
 arch/arm/mach-clps711x/include/mach/uncompress.h   |    2 -
 arch/arm/mach-cns3xxx/include/mach/uncompress.h    |    1 -
 arch/arm/mach-davinci/include/mach/uncompress.h    |    1 -
 arch/arm/mach-dove/include/mach/uncompress.h       |    1 -
 arch/arm/mach-ebsa110/include/mach/uncompress.h    |    1 -
 arch/arm/mach-ep93xx/include/mach/uncompress.h     |    2 -
 arch/arm/mach-footbridge/include/mach/uncompress.h |    1 -
 arch/arm/mach-gemini/include/mach/uncompress.h     |    2 -
 arch/arm/mach-h720x/include/mach/uncompress.h      |    1 -
 arch/arm/mach-integrator/include/mach/uncompress.h |    2 -
 arch/arm/mach-iop13xx/include/mach/uncompress.h    |    1 -
 arch/arm/mach-iop32x/include/mach/uncompress.h     |    1 -
 arch/arm/mach-iop33x/include/mach/uncompress.h     |    1 -
 arch/arm/mach-ixp2000/include/mach/uncompress.h    |    1 -
 arch/arm/mach-ixp23xx/include/mach/uncompress.h    |    2 -
 arch/arm/mach-ixp4xx/include/mach/uncompress.h     |    2 -
 arch/arm/mach-kirkwood/include/mach/uncompress.h   |    1 -
 arch/arm/mach-ks8695/include/mach/uncompress.h     |    1 -
 arch/arm/mach-lpc32xx/include/mach/uncompress.h    |    1 -
 arch/arm/mach-mmp/include/mach/uncompress.h        |    6 ---
 arch/arm/mach-msm/include/mach/uncompress.h        |    4 --
 arch/arm/mach-mv78xx0/include/mach/uncompress.h    |    1 -
 arch/arm/mach-mxs/include/mach/uncompress.h        |    1 -
 arch/arm/mach-netx/include/mach/uncompress.h       |    1 -
 arch/arm/mach-nomadik/include/mach/uncompress.h    |    2 -
 arch/arm/mach-orion5x/include/mach/uncompress.h    |    1 -
 arch/arm/mach-picoxcell/include/mach/uncompress.h  |    1 -
 arch/arm/mach-pnx4008/include/mach/uncompress.h    |    1 -
 arch/arm/mach-prima2/include/mach/uncompress.h     |    2 -
 arch/arm/mach-pxa/include/mach/uncompress.h        |    5 ---
 arch/arm/mach-realview/include/mach/uncompress.h   |    1 -
 arch/arm/mach-rpc/include/mach/uncompress.h        |    5 ---
 arch/arm/mach-s5p64x0/include/mach/uncompress.h    |   33 --------------------
 arch/arm/mach-sa1100/include/mach/uncompress.h     |    1 -
 arch/arm/mach-shark/include/mach/uncompress.h      |    1 -
 arch/arm/mach-shmobile/include/mach/uncompress.h   |    2 -
 arch/arm/mach-tegra/include/mach/uncompress.h      |    4 --
 arch/arm/mach-u300/include/mach/uncompress.h       |    1 -
 arch/arm/mach-ux500/include/mach/uncompress.h      |    2 -
 arch/arm/mach-versatile/include/mach/uncompress.h  |    1 -
 arch/arm/mach-vexpress/include/mach/uncompress.h   |    1 -
 arch/arm/mach-vt8500/include/mach/uncompress.h     |    1 -
 arch/arm/mach-w90x900/include/mach/uncompress.h    |    2 -
 arch/arm/mach-zynq/include/mach/uncompress.h       |    2 -
 arch/arm/plat-mxc/include/mach/uncompress.h        |    1 -
 arch/arm/plat-omap/include/plat/uncompress.h       |    5 ---
 arch/arm/plat-samsung/Kconfig                      |    8 -----
 arch/arm/plat-samsung/include/plat/uncompress.h    |   33 --------------------
 arch/arm/plat-spear/include/plat/uncompress.h      |    1 -
 arch/arm/plat-tcc/include/mach/uncompress.h        |    1 -
 52 files changed, 0 insertions(+), 159 deletions(-)

diff --git a/arch/arm/mach-at91/include/mach/uncompress.h b/arch/arm/mach-at91/include/mach/uncompress.h
index 18bdcde..b5dd672 100644
--- a/arch/arm/mach-at91/include/mach/uncompress.h
+++ b/arch/arm/mach-at91/include/mach/uncompress.h
@@ -71,6 +71,4 @@ static inline void flush(void)
 
 #define arch_decomp_setup()
 
-#define arch_decomp_wdog()
-
 #endif
diff --git a/arch/arm/mach-bcmring/include/mach/uncompress.h b/arch/arm/mach-bcmring/include/mach/uncompress.h
index 9c9821b..5419901 100644
--- a/arch/arm/mach-bcmring/include/mach/uncompress.h
+++ b/arch/arm/mach-bcmring/include/mach/uncompress.h
@@ -40,4 +40,3 @@ static inline void flush(void)
 }
 
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-clps711x/include/mach/uncompress.h b/arch/arm/mach-clps711x/include/mach/uncompress.h
index 7164310..2edd488 100644
--- a/arch/arm/mach-clps711x/include/mach/uncompress.h
+++ b/arch/arm/mach-clps711x/include/mach/uncompress.h
@@ -55,5 +55,3 @@ static inline void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-cns3xxx/include/mach/uncompress.h b/arch/arm/mach-cns3xxx/include/mach/uncompress.h
index a91b605..7a030b9 100644
--- a/arch/arm/mach-cns3xxx/include/mach/uncompress.h
+++ b/arch/arm/mach-cns3xxx/include/mach/uncompress.h
@@ -51,4 +51,3 @@ static inline void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h
index 9dc7cf9..8d63753 100644
--- a/arch/arm/mach-davinci/include/mach/uncompress.h
+++ b/arch/arm/mach-davinci/include/mach/uncompress.h
@@ -103,4 +103,3 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
 }
 
 #define arch_decomp_setup()	__arch_decomp_setup(arch_id)
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-dove/include/mach/uncompress.h b/arch/arm/mach-dove/include/mach/uncompress.h
index 2c5cdd7..5c8ae9b 100644
--- a/arch/arm/mach-dove/include/mach/uncompress.h
+++ b/arch/arm/mach-dove/include/mach/uncompress.h
@@ -34,4 +34,3 @@ static void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-ebsa110/include/mach/uncompress.h b/arch/arm/mach-ebsa110/include/mach/uncompress.h
index 3204150..ab64bea 100644
--- a/arch/arm/mach-ebsa110/include/mach/uncompress.h
+++ b/arch/arm/mach-ebsa110/include/mach/uncompress.h
@@ -42,4 +42,3 @@ static inline void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-ep93xx/include/mach/uncompress.h b/arch/arm/mach-ep93xx/include/mach/uncompress.h
index 16026c2..b2ecb98 100644
--- a/arch/arm/mach-ep93xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ep93xx/include/mach/uncompress.h
@@ -90,5 +90,3 @@ static void arch_decomp_setup(void)
 {
 	ethernet_reset();
 }
-
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-footbridge/include/mach/uncompress.h b/arch/arm/mach-footbridge/include/mach/uncompress.h
index 5dfa442..a69398c 100644
--- a/arch/arm/mach-footbridge/include/mach/uncompress.h
+++ b/arch/arm/mach-footbridge/include/mach/uncompress.h
@@ -35,4 +35,3 @@ static inline void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-gemini/include/mach/uncompress.h b/arch/arm/mach-gemini/include/mach/uncompress.h
index 0efa262..02e2256 100644
--- a/arch/arm/mach-gemini/include/mach/uncompress.h
+++ b/arch/arm/mach-gemini/include/mach/uncompress.h
@@ -39,6 +39,4 @@ static inline void flush(void)
  */
 #define arch_decomp_setup()
 
-#define arch_decomp_wdog()
-
 #endif /* __MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-h720x/include/mach/uncompress.h b/arch/arm/mach-h720x/include/mach/uncompress.h
index d662323..43e343c 100644
--- a/arch/arm/mach-h720x/include/mach/uncompress.h
+++ b/arch/arm/mach-h720x/include/mach/uncompress.h
@@ -32,6 +32,5 @@ static inline void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
 
 #endif
diff --git a/arch/arm/mach-integrator/include/mach/uncompress.h b/arch/arm/mach-integrator/include/mach/uncompress.h
index 30452f0..8f3cc99 100644
--- a/arch/arm/mach-integrator/include/mach/uncompress.h
+++ b/arch/arm/mach-integrator/include/mach/uncompress.h
@@ -46,5 +46,3 @@ static inline void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-iop13xx/include/mach/uncompress.h b/arch/arm/mach-iop13xx/include/mach/uncompress.h
index fa4f805..d3791ec 100644
--- a/arch/arm/mach-iop13xx/include/mach/uncompress.h
+++ b/arch/arm/mach-iop13xx/include/mach/uncompress.h
@@ -20,4 +20,3 @@ static inline void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-iop32x/include/mach/uncompress.h b/arch/arm/mach-iop32x/include/mach/uncompress.h
index 4fd7154..b3d45fd 100644
--- a/arch/arm/mach-iop32x/include/mach/uncompress.h
+++ b/arch/arm/mach-iop32x/include/mach/uncompress.h
@@ -36,4 +36,3 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
  * nothing to do
  */
 #define arch_decomp_setup()	__arch_decomp_setup(arch_id)
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-iop33x/include/mach/uncompress.h b/arch/arm/mach-iop33x/include/mach/uncompress.h
index f99bb84..ed282e1 100644
--- a/arch/arm/mach-iop33x/include/mach/uncompress.h
+++ b/arch/arm/mach-iop33x/include/mach/uncompress.h
@@ -34,4 +34,3 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
  * nothing to do
  */
 #define arch_decomp_setup()	__arch_decomp_setup(arch_id)
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-ixp2000/include/mach/uncompress.h b/arch/arm/mach-ixp2000/include/mach/uncompress.h
index ce36308..126e5d7 100644
--- a/arch/arm/mach-ixp2000/include/mach/uncompress.h
+++ b/arch/arm/mach-ixp2000/include/mach/uncompress.h
@@ -44,4 +44,3 @@ static inline void flush(void)
 }
 
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-ixp23xx/include/mach/uncompress.h b/arch/arm/mach-ixp23xx/include/mach/uncompress.h
index 8b4c358..1ac7020 100644
--- a/arch/arm/mach-ixp23xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ixp23xx/include/mach/uncompress.h
@@ -34,7 +34,5 @@ static inline void flush(void)
 }
 
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
-
 
 #endif
diff --git a/arch/arm/mach-ixp4xx/include/mach/uncompress.h b/arch/arm/mach-ixp4xx/include/mach/uncompress.h
index eb945a9..7b25c02 100644
--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h
@@ -53,6 +53,4 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
  */
 #define arch_decomp_setup()	__arch_decomp_setup(arch_id)
 
-#define arch_decomp_wdog()
-
 #endif
diff --git a/arch/arm/mach-kirkwood/include/mach/uncompress.h b/arch/arm/mach-kirkwood/include/mach/uncompress.h
index 75d5497..5bca553 100644
--- a/arch/arm/mach-kirkwood/include/mach/uncompress.h
+++ b/arch/arm/mach-kirkwood/include/mach/uncompress.h
@@ -44,4 +44,3 @@ static void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-ks8695/include/mach/uncompress.h b/arch/arm/mach-ks8695/include/mach/uncompress.h
index 9495cb4..9a54080 100644
--- a/arch/arm/mach-ks8695/include/mach/uncompress.h
+++ b/arch/arm/mach-ks8695/include/mach/uncompress.h
@@ -32,6 +32,5 @@ static inline void flush(void)
 }
 
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
 
 #endif
diff --git a/arch/arm/mach-lpc32xx/include/mach/uncompress.h b/arch/arm/mach-lpc32xx/include/mach/uncompress.h
index c142487..1198a89 100644
--- a/arch/arm/mach-lpc32xx/include/mach/uncompress.h
+++ b/arch/arm/mach-lpc32xx/include/mach/uncompress.h
@@ -55,6 +55,5 @@ static inline void flush(void)
 
 /* NULL functions; we don't presently need them */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
 
 #endif
diff --git a/arch/arm/mach-mmp/include/mach/uncompress.h b/arch/arm/mach-mmp/include/mach/uncompress.h
index d6daeb7..8890fa8 100644
--- a/arch/arm/mach-mmp/include/mach/uncompress.h
+++ b/arch/arm/mach-mmp/include/mach/uncompress.h
@@ -43,9 +43,3 @@ static inline void arch_decomp_setup(void)
 	if (machine_is_avengers_lite())
 		UART = (unsigned long *)UART3_BASE;
 }
-
-/*
- * nothing to do
- */
-
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-msm/include/mach/uncompress.h b/arch/arm/mach-msm/include/mach/uncompress.h
index d94292c..0fe7930 100644
--- a/arch/arm/mach-msm/include/mach/uncompress.h
+++ b/arch/arm/mach-msm/include/mach/uncompress.h
@@ -36,8 +36,4 @@ static inline void arch_decomp_setup(void)
 {
 }
 
-static inline void arch_decomp_wdog(void)
-{
-}
-
 #endif
diff --git a/arch/arm/mach-mv78xx0/include/mach/uncompress.h b/arch/arm/mach-mv78xx0/include/mach/uncompress.h
index 3652642..6a761c4 100644
--- a/arch/arm/mach-mv78xx0/include/mach/uncompress.h
+++ b/arch/arm/mach-mv78xx0/include/mach/uncompress.h
@@ -44,4 +44,3 @@ static void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-mxs/include/mach/uncompress.h b/arch/arm/mach-mxs/include/mach/uncompress.h
index 7f8bf65..6ab8972 100644
--- a/arch/arm/mach-mxs/include/mach/uncompress.h
+++ b/arch/arm/mach-mxs/include/mach/uncompress.h
@@ -72,6 +72,5 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
 }
 
 #define arch_decomp_setup()	__arch_decomp_setup(arch_id)
-#define arch_decomp_wdog()
 
 #endif /* __MACH_MXS_UNCOMPRESS_H__ */
diff --git a/arch/arm/mach-netx/include/mach/uncompress.h b/arch/arm/mach-netx/include/mach/uncompress.h
index 84f9128..5cb1051 100644
--- a/arch/arm/mach-netx/include/mach/uncompress.h
+++ b/arch/arm/mach-netx/include/mach/uncompress.h
@@ -73,4 +73,3 @@ static inline void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-nomadik/include/mach/uncompress.h b/arch/arm/mach-nomadik/include/mach/uncompress.h
index 071003b..765bff1 100644
--- a/arch/arm/mach-nomadik/include/mach/uncompress.h
+++ b/arch/arm/mach-nomadik/include/mach/uncompress.h
@@ -58,6 +58,4 @@ static inline void arch_decomp_setup(void)
 {
 }
 
-#define arch_decomp_wdog() /* nothing to do here */
-
 #endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-orion5x/include/mach/uncompress.h b/arch/arm/mach-orion5x/include/mach/uncompress.h
index 4322dba..abd26b5 100644
--- a/arch/arm/mach-orion5x/include/mach/uncompress.h
+++ b/arch/arm/mach-orion5x/include/mach/uncompress.h
@@ -46,4 +46,3 @@ static void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-picoxcell/include/mach/uncompress.h b/arch/arm/mach-picoxcell/include/mach/uncompress.h
index b60b19d..db46249 100644
--- a/arch/arm/mach-picoxcell/include/mach/uncompress.h
+++ b/arch/arm/mach-picoxcell/include/mach/uncompress.h
@@ -18,4 +18,3 @@
 #define putc(c)
 #define flush()
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-pnx4008/include/mach/uncompress.h b/arch/arm/mach-pnx4008/include/mach/uncompress.h
index bb4751e..26b507d 100644
--- a/arch/arm/mach-pnx4008/include/mach/uncompress.h
+++ b/arch/arm/mach-pnx4008/include/mach/uncompress.h
@@ -43,4 +43,3 @@ static inline void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-prima2/include/mach/uncompress.h b/arch/arm/mach-prima2/include/mach/uncompress.h
index 83125c6..1e17796 100644
--- a/arch/arm/mach-prima2/include/mach/uncompress.h
+++ b/arch/arm/mach-prima2/include/mach/uncompress.h
@@ -17,8 +17,6 @@ void arch_decomp_setup(void)
 {
 }
 
-#define arch_decomp_wdog()
-
 static __inline__ void putc(char c)
 {
 	/*
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h b/arch/arm/mach-pxa/include/mach/uncompress.h
index 5519a34..8c27757 100644
--- a/arch/arm/mach-pxa/include/mach/uncompress.h
+++ b/arch/arm/mach-pxa/include/mach/uncompress.h
@@ -72,8 +72,3 @@ static inline void arch_decomp_setup(void)
 		uart_is_pxa = 0;
 	}
 }
-
-/*
- * nothing to do
- */
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-realview/include/mach/uncompress.h b/arch/arm/mach-realview/include/mach/uncompress.h
index 83050378..cfa30d2 100644
--- a/arch/arm/mach-realview/include/mach/uncompress.h
+++ b/arch/arm/mach-realview/include/mach/uncompress.h
@@ -75,4 +75,3 @@ static inline void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-rpc/include/mach/uncompress.h b/arch/arm/mach-rpc/include/mach/uncompress.h
index 9cd9bcd..0fd4b0b 100644
--- a/arch/arm/mach-rpc/include/mach/uncompress.h
+++ b/arch/arm/mach-rpc/include/mach/uncompress.h
@@ -189,8 +189,3 @@ static void arch_decomp_setup(void)
 	if (nr_pages * page_size < 4096*1024) error("<4M of mem\n");
 }
 #endif
-
-/*
- * nothing to do
- */
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-s5p64x0/include/mach/uncompress.h b/arch/arm/mach-s5p64x0/include/mach/uncompress.h
index 1608faf..00b70b8 100644
--- a/arch/arm/mach-s5p64x0/include/mach/uncompress.h
+++ b/arch/arm/mach-s5p64x0/include/mach/uncompress.h
@@ -36,10 +36,6 @@ static void arch_detect_cpu(void);
 #include <plat/regs-serial.h>
 #include <plat/regs-watchdog.h>
 
-/* working in physical space... */
-#undef S3C2410_WDOGREG
-#define S3C2410_WDOGREG(x) ((S3C24XX_PA_WATCHDOG + (x)))
-
 /* how many bytes we allow into the FIFO at a time in FIFO mode */
 #define FIFO_MAX	 (14)
 
@@ -116,34 +112,6 @@ static inline void flush(void)
 		*((volatile unsigned int __force *)(ad)) = (d); \
 	} while (0)
 
-/*
- * CONFIG_S3C_BOOT_WATCHDOG
- *
- * Simple boot-time watchdog setup, to reboot the system if there is
- * any problem with the boot process
- */
-
-#ifdef CONFIG_S3C_BOOT_WATCHDOG
-
-#define WDOG_COUNT (0xff00)
-
-static inline void arch_decomp_wdog(void)
-{
-	__raw_writel(WDOG_COUNT, S3C2410_WTCNT);
-}
-
-static void arch_decomp_wdog_start(void)
-{
-	__raw_writel(WDOG_COUNT, S3C2410_WTDAT);
-	__raw_writel(WDOG_COUNT, S3C2410_WTCNT);
-	__raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON);
-}
-
-#else
-#define arch_decomp_wdog_start()
-#define arch_decomp_wdog()
-#endif
-
 #ifdef CONFIG_S3C_BOOT_ERROR_RESET
 
 static void arch_decomp_error(const char *x)
@@ -192,7 +160,6 @@ static void arch_decomp_setup(void)
 	 */
 
 	arch_detect_cpu();
-	arch_decomp_wdog_start();
 
 	/*
 	 * Enable the UART FIFOs if they where not enabled and our
diff --git a/arch/arm/mach-sa1100/include/mach/uncompress.h b/arch/arm/mach-sa1100/include/mach/uncompress.h
index 6cb39dd..a834962 100644
--- a/arch/arm/mach-sa1100/include/mach/uncompress.h
+++ b/arch/arm/mach-sa1100/include/mach/uncompress.h
@@ -47,4 +47,3 @@ static inline void flush(void)
  * Nothing to do for these
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-shark/include/mach/uncompress.h b/arch/arm/mach-shark/include/mach/uncompress.h
index 22ccab4..a168435 100644
--- a/arch/arm/mach-shark/include/mach/uncompress.h
+++ b/arch/arm/mach-shark/include/mach/uncompress.h
@@ -48,4 +48,3 @@ static void putr()
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-shmobile/include/mach/uncompress.h b/arch/arm/mach-shmobile/include/mach/uncompress.h
index 0bd7556..f1aee56 100644
--- a/arch/arm/mach-shmobile/include/mach/uncompress.h
+++ b/arch/arm/mach-shmobile/include/mach/uncompress.h
@@ -16,6 +16,4 @@ static void arch_decomp_setup(void)
 {
 }
 
-#define arch_decomp_wdog()
-
 #endif /* __ASM_MACH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-tegra/include/mach/uncompress.h b/arch/arm/mach-tegra/include/mach/uncompress.h
index 4e83237..565daa6 100644
--- a/arch/arm/mach-tegra/include/mach/uncompress.h
+++ b/arch/arm/mach-tegra/include/mach/uncompress.h
@@ -57,8 +57,4 @@ static inline void arch_decomp_setup(void)
 	uart[UART_LCR << shift] = 3;
 }
 
-static inline void arch_decomp_wdog(void)
-{
-}
-
 #endif
diff --git a/arch/arm/mach-u300/include/mach/uncompress.h b/arch/arm/mach-u300/include/mach/uncompress.h
index 29acb71..783e7e6 100644
--- a/arch/arm/mach-u300/include/mach/uncompress.h
+++ b/arch/arm/mach-u300/include/mach/uncompress.h
@@ -43,4 +43,3 @@ static inline void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h
index 6fb3c4b..ec957e8 100644
--- a/arch/arm/mach-ux500/include/mach/uncompress.h
+++ b/arch/arm/mach-ux500/include/mach/uncompress.h
@@ -57,6 +57,4 @@ static inline void arch_decomp_setup(void)
 		ux500_uart_base = U8500_UART2_BASE;
 }
 
-#define arch_decomp_wdog() /* nothing to do here */
-
 #endif /* __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-versatile/include/mach/uncompress.h b/arch/arm/mach-versatile/include/mach/uncompress.h
index 3dd0048..986e3d3 100644
--- a/arch/arm/mach-versatile/include/mach/uncompress.h
+++ b/arch/arm/mach-versatile/include/mach/uncompress.h
@@ -43,4 +43,3 @@ static inline void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-vexpress/include/mach/uncompress.h b/arch/arm/mach-vexpress/include/mach/uncompress.h
index 7972c57..a16872b 100644
--- a/arch/arm/mach-vexpress/include/mach/uncompress.h
+++ b/arch/arm/mach-vexpress/include/mach/uncompress.h
@@ -49,4 +49,3 @@ static inline void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-vt8500/include/mach/uncompress.h b/arch/arm/mach-vt8500/include/mach/uncompress.h
index bb9e2d2..14ec0ec 100644
--- a/arch/arm/mach-vt8500/include/mach/uncompress.h
+++ b/arch/arm/mach-vt8500/include/mach/uncompress.h
@@ -34,4 +34,3 @@ static void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
diff --git a/arch/arm/mach-w90x900/include/mach/uncompress.h b/arch/arm/mach-w90x900/include/mach/uncompress.h
index 0313021..4b7c324 100644
--- a/arch/arm/mach-w90x900/include/mach/uncompress.h
+++ b/arch/arm/mach-w90x900/include/mach/uncompress.h
@@ -24,8 +24,6 @@
 #include <mach/map.h>
 #include <linux/serial_reg.h>
 
-#define arch_decomp_wdog()
-
 #define TX_DONE	(UART_LSR_TEMT | UART_LSR_THRE)
 static volatile u32 * const uart_base = (u32 *)UART0_PA;
 
diff --git a/arch/arm/mach-zynq/include/mach/uncompress.h b/arch/arm/mach-zynq/include/mach/uncompress.h
index af4e844..11c3216 100644
--- a/arch/arm/mach-zynq/include/mach/uncompress.h
+++ b/arch/arm/mach-zynq/include/mach/uncompress.h
@@ -34,8 +34,6 @@ static inline void flush(void)
 		cpu_relax();
 }
 
-#define arch_decomp_wdog()
-
 static void putc(char ch)
 {
 	/*
diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/plat-mxc/include/mach/uncompress.h
index 88fd404..d9412a1 100644
--- a/arch/arm/plat-mxc/include/mach/uncompress.h
+++ b/arch/arm/plat-mxc/include/mach/uncompress.h
@@ -126,6 +126,5 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
 }
 
 #define arch_decomp_setup()	__arch_decomp_setup(arch_id)
-#define arch_decomp_wdog()
 
 #endif				/* __ASM_ARCH_MXC_UNCOMPRESS_H__ */
diff --git a/arch/arm/plat-omap/include/plat/uncompress.h b/arch/arm/plat-omap/include/plat/uncompress.h
index 2f472e9..c5111bd 100644
--- a/arch/arm/plat-omap/include/plat/uncompress.h
+++ b/arch/arm/plat-omap/include/plat/uncompress.h
@@ -183,8 +183,3 @@ static inline void __arch_decomp_setup(unsigned long arch_id)
 }
 
 #define arch_decomp_setup()	__arch_decomp_setup(arch_id)
-
-/*
- * nothing to do
- */
-#define arch_decomp_wdog()
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 49a134f..6c49c35 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -19,14 +19,6 @@ if PLAT_SAMSUNG
 
 comment "Boot options"
 
-config S3C_BOOT_WATCHDOG
-	bool "S3C Initialisation watchdog"
-	depends on S3C2410_WATCHDOG
-	help
-	  Say y to enable the watchdog during the kernel decompression
-	  stage. If the kernel fails to uncompress, then the watchdog
-	  will trigger a reset and the system should restart.
-
 config S3C_BOOT_ERROR_RESET
 	bool "S3C Reboot on decompression error"
 	help
diff --git a/arch/arm/plat-samsung/include/plat/uncompress.h b/arch/arm/plat-samsung/include/plat/uncompress.h
index ee48e12..94fecf9 100644
--- a/arch/arm/plat-samsung/include/plat/uncompress.h
+++ b/arch/arm/plat-samsung/include/plat/uncompress.h
@@ -30,10 +30,6 @@ static void arch_detect_cpu(void);
 #include <plat/regs-serial.h>
 #include <plat/regs-watchdog.h>
 
-/* working in physical space... */
-#undef S3C2410_WDOGREG
-#define S3C2410_WDOGREG(x) ((S3C24XX_PA_WATCHDOG + (x)))
-
 /* how many bytes we allow into the FIFO at a time in FIFO mode */
 #define FIFO_MAX	 (14)
 
@@ -95,33 +91,6 @@ static inline void flush(void)
 		*((volatile unsigned int __force *)(ad)) = (d); \
 	} while (0)
 
-/* CONFIG_S3C_BOOT_WATCHDOG
- *
- * Simple boot-time watchdog setup, to reboot the system if there is
- * any problem with the boot process
-*/
-
-#ifdef CONFIG_S3C_BOOT_WATCHDOG
-
-#define WDOG_COUNT (0xff00)
-
-static inline void arch_decomp_wdog(void)
-{
-	__raw_writel(WDOG_COUNT, S3C2410_WTCNT);
-}
-
-static void arch_decomp_wdog_start(void)
-{
-	__raw_writel(WDOG_COUNT, S3C2410_WTDAT);
-	__raw_writel(WDOG_COUNT, S3C2410_WTCNT);
-	__raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x80), S3C2410_WTCON);
-}
-
-#else
-#define arch_decomp_wdog_start()
-#define arch_decomp_wdog()
-#endif
-
 #ifdef CONFIG_S3C_BOOT_ERROR_RESET
 
 static void arch_decomp_error(const char *x)
@@ -161,7 +130,6 @@ static inline void arch_enable_uart_fifo(void)
 #define arch_enable_uart_fifo() do { } while(0)
 #endif
 
-
 static void
 arch_decomp_setup(void)
 {
@@ -171,7 +139,6 @@ arch_decomp_setup(void)
 	 */
 
 	arch_detect_cpu();
-	arch_decomp_wdog_start();
 
 	/* Enable the UART FIFOs if they where not enabled and our
 	 * configuration says we should turn them on.
diff --git a/arch/arm/plat-spear/include/plat/uncompress.h b/arch/arm/plat-spear/include/plat/uncompress.h
index 1bf8452..b631aab 100644
--- a/arch/arm/plat-spear/include/plat/uncompress.h
+++ b/arch/arm/plat-spear/include/plat/uncompress.h
@@ -38,6 +38,5 @@ static inline void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
 
 #endif /* __PLAT_UNCOMPRESS_H */
diff --git a/arch/arm/plat-tcc/include/mach/uncompress.h b/arch/arm/plat-tcc/include/mach/uncompress.h
index 7a3e33a..2e9c2bb 100644
--- a/arch/arm/plat-tcc/include/mach/uncompress.h
+++ b/arch/arm/plat-tcc/include/mach/uncompress.h
@@ -31,4 +31,3 @@ static inline void flush(void)
  * nothing to do
  */
 #define arch_decomp_setup()
-#define arch_decomp_wdog()
-- 
1.7.4.1

^ permalink raw reply related

* Re: [22/27] VFS: Fix automount for negative autofs dentries
From: Miklos Szeredi @ 2011-10-23 21:09 UTC (permalink / raw)
  To: Greg KH
  Cc: Linus Torvalds, David Howells, linux-kernel, stable,
	stable-review, akpm, alan, Ian Kent, Al Viro, Chuck Ebbert,
	Trond Myklebust
In-Reply-To: <20111023083636.GA14048@suse.de>

Greg KH <gregkh@suse.de> writes:

> On Sun, Oct 23, 2011 at 10:35:14AM +0300, Linus Torvalds wrote:
>> This one is debatable.
>> 
>> I think it also wants
>> 
>>  - commit 0ec26fd0698285b31248e34bf1abb022c00f23d6 (with
>> LOOKUP_PARENT->LOOKUP_CONTINUE too)
>
> Really?  I thought I dropped this one from the last stable release due
> to problems with it, or does this patch here, and the one you mention
> below, resolve those issues?
>
>>  - commit d94c177beeb4469cd4f6e83354ab0223353e98ed (to get the few
>> other cases right too)
>> 
>> anything else I missed?
>
> Ok, that makes a bit more sense, I'll add these if David and Miklos
> agree that they are ok to add here.  David and Miklos?

IMO they are OK to add as long as they are both added.

Last time the first one had to be backed out because Linus wasn't
totally comfortable with the other one going into -stable until it got
some testing in 3.1.  Or at least that's how I understood (or
misunderstood).

Thanks,
Miklos

^ permalink raw reply

* [U-Boot] [PATCH V3 3/3] mkimage: adding support for Davinci AIS image
From: Wolfgang Denk @ 2011-10-23 21:08 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <1318846063-9496-1-git-send-email-sbabic@denx.de>

Dear Stefano Babic,

In message <1318846063-9496-1-git-send-email-sbabic@denx.de> you wrote:
> Some Davinci processors supports the Application
> Image Script (AIS) boot process. The patch adds the generation
> of the AIS image inside the mkimage tool to make possible
> to generate a bootable U-boot without external tools
> (TI Davinci AIS Generator).
> 
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Wolfgang Denk <wd@denx.de>
> ---
> 
> Changes since V2:
> 	- rebased on mainline and sort uimage_type list (Wolfgang Denk)
> 
> Changes since V1:
> 	- removed warning in gcc 4.6 iwhen -Wunused-but-set-variable is set
> 	- drop remained warnings raised by checkpatch
> 
> 
>  common/image.c   |    9 +-
>  include/image.h  |    1 +
>  tools/Makefile   |    4 +-
>  tools/aisimage.c |  451 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  tools/aisimage.h |   97 ++++++++++++
>  tools/mkimage.c  |    2 +
>  tools/mkimage.h  |    1 +
>  7 files changed, 560 insertions(+), 5 deletions(-)
>  create mode 100644 tools/aisimage.c
>  create mode 100644 tools/aisimage.h

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Plan to throw one away.  You will anyway."
                              - Fred Brooks, "The Mythical Man Month"

^ permalink raw reply

* [U-Boot] [PATCH 5/5] net: xilinx_enet: drop unused !NET_MULTI driver
From: Wolfgang Denk @ 2011-10-23 21:08 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <1318795453-18090-6-git-send-email-vapier@gentoo.org>

Dear Mike Frysinger,

In message <1318795453-18090-6-git-send-email-vapier@gentoo.org> you wrote:
> This driver doesn't support the NET_MULTI framework, and I can't find
> any boards/configs/files that reference this subdir, so punt it all.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  board/xilinx/xilinx_enet/emac_adapter.c   |  165 ----
>  board/xilinx/xilinx_enet/xemac.c          |  844 ------------------
>  board/xilinx/xilinx_enet/xemac.h          |  673 ---------------
>  board/xilinx/xilinx_enet/xemac_g.c        |   60 --
>  board/xilinx/xilinx_enet/xemac_i.h        |  207 -----
>  board/xilinx/xilinx_enet/xemac_intr.c     |  402 ---------
>  board/xilinx/xilinx_enet/xemac_intr_dma.c | 1344 -----------------------------
>  board/xilinx/xilinx_enet/xemac_l.h        |  462 ----------
>  board/xilinx/xilinx_enet/xemac_options.c  |  318 -------
>  board/xilinx/xilinx_enet/xemac_polled.c   |  482 -----------
>  10 files changed, 0 insertions(+), 4957 deletions(-)
>  delete mode 100644 board/xilinx/xilinx_enet/emac_adapter.c
>  delete mode 100644 board/xilinx/xilinx_enet/xemac.c
>  delete mode 100644 board/xilinx/xilinx_enet/xemac.h
>  delete mode 100644 board/xilinx/xilinx_enet/xemac_g.c
>  delete mode 100644 board/xilinx/xilinx_enet/xemac_i.h
>  delete mode 100644 board/xilinx/xilinx_enet/xemac_intr.c
>  delete mode 100644 board/xilinx/xilinx_enet/xemac_intr_dma.c
>  delete mode 100644 board/xilinx/xilinx_enet/xemac_l.h
>  delete mode 100644 board/xilinx/xilinx_enet/xemac_options.c
>  delete mode 100644 board/xilinx/xilinx_enet/xemac_polled.c

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Man is the best computer we can put aboard a spacecraft ...  and  the
only one that can be mass produced with unskilled labor.
                                                  - Wernher von Braun

^ permalink raw reply

* [U-Boot] [PATCH 4/5] net: sc589: drop unused !NET_MULTI driver
From: Wolfgang Denk @ 2011-10-23 21:06 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <1318795453-18090-5-git-send-email-vapier@gentoo.org>

Dear Mike Frysinger,

In message <1318795453-18090-5-git-send-email-vapier@gentoo.org> you wrote:
> No boards appear to use this driver, and it doesn't support NET_MULTI,
> so punt the old driver.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  drivers/net/3c589.c  |  517 --------------------------------------------------
>  drivers/net/3c589.h  |  435 ------------------------------------------
>  drivers/net/Makefile |    1 -
>  3 files changed, 0 insertions(+), 953 deletions(-)
>  delete mode 100644 drivers/net/3c589.c
>  delete mode 100644 drivers/net/3c589.h

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Any technology distinguishable from magic is insufficiently advanced.

^ permalink raw reply

* [U-Boot] [PATCH 3/5] net: s3c4510b_eth: drop unused !NET_MULTI driver
From: Wolfgang Denk @ 2011-10-23 21:04 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <1318795453-18090-4-git-send-email-vapier@gentoo.org>

Dear Mike Frysinger,

In message <1318795453-18090-4-git-send-email-vapier@gentoo.org> you wrote:
> No boards appear to use this driver, and it doesn't support NET_MULTI,
> so punt the old driver.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  drivers/net/Makefile       |    1 -
>  drivers/net/s3c4510b_eth.c |  241 -----------------------------------
>  drivers/net/s3c4510b_eth.h |  302 --------------------------------------------
>  3 files changed, 0 insertions(+), 544 deletions(-)
>  delete mode 100644 drivers/net/s3c4510b_eth.c
>  delete mode 100644 drivers/net/s3c4510b_eth.h

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You see things; and you say ``Why?'' But I dream  things  that  never
were; and I say ``Why not?''
       - George Bernard Shaw _Back to Methuselah_ (1921) pt. 1, act 1

^ permalink raw reply

* Re: Problem with log which are corrupted and need help with hitcount and FORWARD rules
From: Azerty Ytreza @ 2011-10-23 21:04 UTC (permalink / raw)
  To: netfilter
In-Reply-To: <1319377798.26402.6408.camel@andybev-desktop>

>> > Hitcount matches when the number of packets is greater than or *equal*,
>> > so defining a number of "1" will always match.
>>
>> I have try to increase that but it's the same thing.
>> iptables -A FORWARD -i eth1 -p tcp -m tcp --dport 443 -m state --state
>> NEW -m recent --update --seconds 600 --hitcount 10 -j DROP
>>
>> >
>> > Also, hitcount refers to number of packets, so you'll need a rule in
>> > there to only apply the DROP to NEW connections, otherwise you'll block
>> > a successful connection as soon as that number of packets has been sent.
>>
>> Yes, I have modified this rules by removing "NEW" but the port is
>> always blocked :(
>> iptables -A FORWARD -i eth1 -p tcp -m tcp --dport 443 -m state --state
>> RELATED,ESTABLISHED -j ACCEPT
>
> Can you re-post all the rules please so that we can have a look at them?

It's OK ! I have founded my error ...
Thank you for your help !

My big mistake it's with the INPUT rule followed by a FORWARD :(
I doesn't know that FORWARD open the port without INPUT.

Else the error was here : iptables -A FORWARD -i eth1 -p tcp -m tcp
--dport 443 -m state --state **NEW,**RELATED,ESTABLISHED -j ACCEPT


Else you have an idea for my corrupted log ?
It's probably linked to LXC but there is a way for check where come
the problem ?

>> > This website is quite good:
>> >
>> > http://thiemonagel.de/2006/02/preventing-brute-force-attacks-using-iptables-recent-matching/
>> >
>> > Although you'll have to change INPUT to FORWARD.
>> >
>>
>> This website use blacklist and name but it's the same no in my rules ?
>
> "Probably", although I've not looked closely. If you really have written
> equivalent rules then it should work okay. If you can re-post all your
> rules then we can check.
>
> Andy
>
>
>

^ permalink raw reply

* [U-Boot] [PATCH 2/5] net: ns9750: drop !NET_MULTI driver
From: Wolfgang Denk @ 2011-10-23 21:03 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <1318795453-18090-3-git-send-email-vapier@gentoo.org>

Dear Mike Frysinger,

In message <1318795453-18090-3-git-send-email-vapier@gentoo.org> you wrote:
> Only one board uses this driver (ns9750dev), but the board doesn't seem
> to have an entry to actually build it in the Makefile/boards.cfg, so just
> delete net support from its board config.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  drivers/net/Makefile        |    1 -
>  drivers/net/ns9750_eth.c    |  789 -------------------------------------------
>  include/configs/ns9750dev.h |    2 -
>  include/ns9750_eth.h        |  298 ----------------
>  4 files changed, 0 insertions(+), 1090 deletions(-)
>  delete mode 100644 drivers/net/ns9750_eth.c
>  delete mode 100644 include/ns9750_eth.h

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I'm frequently appalled by the low regard you Earthmen have for life.
	-- Spock, "The Galileo Seven", stardate 2822.3

^ permalink raw reply


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.