All of lore.kernel.org
 help / color / mirror / Atom feed
From: hjk@linutronix.de (Hans J. Koch)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/7 v2] Basic IO mappings for mach-tcc8k
Date: Sat, 27 Mar 2010 18:08:56 +0100	[thread overview]
Message-ID: <20100327170855.GF2035@bluebox.local> (raw)
In-Reply-To: <20100325203758.GF24984@n2100.arm.linux.org.uk>

On Thu, Mar 25, 2010 at 08:37:58PM +0000, Russell King - ARM Linux wrote:
> On Thu, Mar 25, 2010 at 09:15:09PM +0100, Hans J. Koch wrote:
> > +#include <linux/kernel.h>
> > +#include <linux/init.h>
> > +
> > +#include <asm/tlb.h>
> 
> You don't need asm/tlb.h in this file.

Removed.

> 
> > +#include <asm/mach/map.h>
> > +#include <asm/io.h>
> 
> linux/io.h

OK.

> 
> > +
> > +#include <mach/tcc8k-regs.h>
> > +
> > +/*
> > + * The machine specific code may provide the extra mapping besides the
> > + * default mapping provided here.
> > + */
> > +static struct map_desc tcc8k_io_desc[] __initdata = {
> > +	{
> > +		.virtual	= CS1_BASE_VIRT,	/* CS1 (CS8900) */
> > +		.pfn		= __phys_to_pfn(CS1_BASE),
> > +		.length		= CS1_SIZE,
> > +		.type		= MT_DEVICE
> > +	},
> > +	{
> 
> 	}, {
> 
> is more conventional and avoids using up valuable vertical screen
> realestate.

Right, fixed.

> 
> > +		.virtual	= AHB_PERI_BASE_VIRT,	/* AHB peripherals */
> > +		.pfn		= __phys_to_pfn(AHB_PERI_BASE),
> > +		.length		= AHB_PERI_SIZE,
> > +		.type		= MT_DEVICE
> > +	},
> > +	{
> > +		.virtual	= APB0_PERI_BASE_VIRT,	/* APB peripherals */
> > +		.pfn		= __phys_to_pfn(APB0_PERI_BASE),
> > +		.length		= APB0_PERI_SIZE,
> > +		.type		= MT_DEVICE
> > +	},
> > +	{
> > +		.virtual	= APB1_PERI_BASE_VIRT,	/* APB peripherals */
> > +		.pfn		= __phys_to_pfn(APB1_PERI_BASE),
> > +		.length		= APB1_PERI_SIZE,
> > +		.type		= MT_DEVICE
> > +	},
> > +	{
> > +		.virtual	= EXT_MEM_CTRL_BASE_VIRT, /* Ext. mem.contr. */
> > +		.pfn		= __phys_to_pfn(EXT_MEM_CTRL_BASE),
> > +		.length		= EXT_MEM_CTRL_SIZE,
> > +		.type		= MT_DEVICE
> > +	},
> > +};
> > +
> > +/*
> > + * Maps common IO regions for tcc8k.
> > + *
> > + */
> > +void __init tcc8k_map_common_io(void)
> > +{
> > +	iotable_init(tcc8k_io_desc, ARRAY_SIZE(tcc8k_io_desc));
> > +}
> > +
> > diff --git a/arch/arm/plat-tcc/include/mach/io.h b/arch/arm/plat-tcc/include/mach/io.h
> > new file mode 100644
> > index 0000000..7d84370
> > --- /dev/null
> > +++ b/arch/arm/plat-tcc/include/mach/io.h
> > @@ -0,0 +1,53 @@
> > +/*
> > + * Based on:    linux/include/asm-arm/arch-sa1100/io.h
> > + * Author : <linux@telechips.com>
> > + * Created: June 10, 2008
> > + * Description: IO definitions for TCC8300 processors and boards
> > + *
> > + * Copyright (C) 1997-1999 Russell King
> > + * Copyright (C) 2008-2009 Telechips
> > + *
> > + * Modifications for mainline (C) 2009 Hans J. Koch <hjk@linutronix.de>
> > + *
> > + * Licensed under the terms of the GNU Public License version 2.
> > + */
> > +
> > +#ifndef __ASM_ARM_ARCH_IO_H
> > +#define __ASM_ARM_ARCH_IO_H
> > +
> > +#define IO_SPACE_LIMIT 0xffffffff
> > +
> > +/*
> > + * We don't actually have real ISA nor PCI buses, but there is so many
> > + * drivers out there that might just work if we fake them...
> > + */
> > +#define __io(a)			((void __iomem *)(PCIO_BASE + (a)))
> 
> #define __io(a)		__typesafe_io(a)
> 
> please.

OK.

> 
> > +#define __mem_pci(a)		(a)
> > +
> > +/*
> > + * ----------------------------------------------------------------------------
> > + * I/O mapping
> > + * ----------------------------------------------------------------------------
> > + */
> > +
> > +#define PCIO_BASE	0
> > +
> > +/* Address Map of Internal Peripherials (Base 0x80000000) */
> > +#define IO_PHYS_A			0x80000000
> > +#define IO_OFFSET_A			0x70000000 /* Virtual IO = 0xF0000000 */
> > +#define IO_SIZE_A			0x100000
> > +#define IO_VIRT_A			(IO_PHYS + IO_OFFSET)
> > +#define IO_ADDRESS_A(pa)	((pa) + IO_OFFSET)
> > +#define IO_P2V_A(pa)		((pa) + IO_OFFSET)
> > +#define IO_V2P_A(va)		((va) - IO_OFFSET)
> 
> Where is IO_OFFSET defined?

Nowhere. Actually, none of these #define IO_* is needed at all. Removed.

Thanks,
Hans

  reply	other threads:[~2010-03-27 17:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25 20:04 [PATCH 0/7 v2] Add basic support for Telechips TCC8xxx SoCs Hans J. Koch
2010-03-25 20:07 ` [PATCH 1/7 v2] Introduce plat-tcc Hans J. Koch
2010-03-25 20:31   ` Russell King - ARM Linux
2010-03-27 16:02     ` Hans J. Koch
2010-03-25 20:09 ` [PATCH 2/7 v2] Add clock framework for plat-tcc Hans J. Koch
2010-03-25 20:32   ` Russell King - ARM Linux
2010-03-27 16:20     ` Hans J. Koch
2010-03-25 20:10 ` [PATCH 3/7 v2] Introduce plat-tcc irq framework Hans J. Koch
2010-03-25 20:33   ` Russell King - ARM Linux
2010-03-27 16:33     ` Hans J. Koch
2010-03-25 20:12 ` [PATCH 4/7 v2] Add TCC8xxx system timer Hans J. Koch
2010-03-25 20:35   ` Russell King - ARM Linux
2010-03-27 16:49     ` Hans J. Koch
2010-03-25 20:15 ` [PATCH 5/7 v2] Basic IO mappings for mach-tcc8k Hans J. Koch
2010-03-25 20:37   ` Russell King - ARM Linux
2010-03-27 17:08     ` Hans J. Koch [this message]
2010-03-25 20:16 ` [PATCH 6/7 v2] Add common platform devices for TCC8xxx SoCs Hans J. Koch
2010-03-25 20:38   ` Russell King - ARM Linux
2010-03-27 17:41     ` Hans J. Koch
2010-03-25 20:18 ` [PATCH 7/7 v2] Add board support for Telechips TCC8000-SDK board Hans J. Koch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100327170855.GF2035@bluebox.local \
    --to=hjk@linutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.