linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* On mini2440 IO mappings.
@ 2013-06-04  7:41 mind entropy
  2013-06-04  8:52 ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: mind entropy @ 2013-06-04  7:41 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

   I am going through the mini2440 source code for my understanding of
porting an ARM board to linux. I have a doubt regarding initial
mappings sizes of the IRQ, GPIO etc. In
arch/arm/mach-s3c24xx/include/mach/map.h S3C24XX_SZ_IRQ is set to
SZ_1M but in the documentation (Pg 1-27 of s3c2440.pdf datasheet) the
physical address extends from 0X4A000000 to 0X4A00001C. So shouldn't a
size of 4K(small page) or 1K(tiny page) be enough?

Thanks,
Gautam.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* On mini2440 IO mappings.
  2013-06-04  7:41 On mini2440 IO mappings mind entropy
@ 2013-06-04  8:52 ` Arnd Bergmann
  2013-06-04  9:29   ` mind entropy
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2013-06-04  8:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 04 June 2013 13:11:04 mind entropy wrote:
> 
>    I am going through the mini2440 source code for my understanding of
> porting an ARM board to linux. I have a doubt regarding initial
> mappings sizes of the IRQ, GPIO etc. In
> arch/arm/mach-s3c24xx/include/mach/map.h S3C24XX_SZ_IRQ is set to
> SZ_1M but in the documentation (Pg 1-27 of s3c2440.pdf datasheet) the
> physical address extends from 0X4A000000 to 0X4A00001C. So shouldn't a
> size of 4K(small page) or 1K(tiny page) be enough?

Yes, that would be enough, but I think it makes little difference
either way.

What kind of board port are you doing? New ports would look quite
different from s3c24xx/mini2440, so it might not be the best
example to look at.

	Arnd

^ permalink raw reply	[flat|nested] 5+ messages in thread

* On mini2440 IO mappings.
  2013-06-04  8:52 ` Arnd Bergmann
@ 2013-06-04  9:29   ` mind entropy
  2013-06-04  9:47     ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: mind entropy @ 2013-06-04  9:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 4, 2013 at 2:22 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday 04 June 2013 13:11:04 mind entropy wrote:

>> arch/arm/mach-s3c24xx/include/mach/map.h S3C24XX_SZ_IRQ is set to
>> SZ_1M but in the documentation (Pg 1-27 of s3c2440.pdf datasheet) the
>> physical address extends from 0X4A000000 to 0X4A00001C. So shouldn't a
>> size of 4K(small page) or 1K(tiny page) be enough?
>
> Yes, that would be enough, but I think it makes little difference
> either way.
>

Just to clarify, this would create an overlap i.e. 2 different virtual
address will point to the same physical address right?

> What kind of board port are you doing? New ports would look quite
> different from s3c24xx/mini2440, so it might not be the best
> example to look at.
>
>         Arnd

I am just trying my hand on the minimal bootup of the board. I am
looking at the existing port and trying to write my own. I am using
the 3.9 vanilla kernel with pengutronix patches.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* On mini2440 IO mappings.
  2013-06-04  9:29   ` mind entropy
@ 2013-06-04  9:47     ` Arnd Bergmann
  2013-06-05  7:22       ` mind entropy
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2013-06-04  9:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Tuesday 04 June 2013 14:59:17 mind entropy wrote:
> On Tue, Jun 4, 2013 at 2:22 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Tuesday 04 June 2013 13:11:04 mind entropy wrote:
> 
> >> arch/arm/mach-s3c24xx/include/mach/map.h S3C24XX_SZ_IRQ is set to
> >> SZ_1M but in the documentation (Pg 1-27 of s3c2440.pdf datasheet) the
> >> physical address extends from 0X4A000000 to 0X4A00001C. So shouldn't a
> >> size of 4K(small page) or 1K(tiny page) be enough?
> >
> > Yes, that would be enough, but I think it makes little difference
> > either way.
> >
> 
> Just to clarify, this would create an overlap i.e. 2 different virtual
> address will point to the same physical address right?

I don't think it does. The mappings are

static struct map_desc s3c_iodesc[] __initdata = {
        IODESC_ENT(GPIO),
        IODESC_ENT(IRQ),
        IODESC_ENT(MEMCTRL),
        IODESC_ENT(UART)
};

using these virtual addresses:

#define S3C_ADDR_BASE   0xF6000000
#define S3C_ADDR(x)     ((void __iomem __force *)S3C_ADDR_BASE + (x))
#define S3C_VA_IRQ      S3C_ADDR(0x00000000)    /* irq controller(s) */
#define S3C_VA_SYS      S3C_ADDR(0x00100000)    /* system control */
#define S3C_VA_MEM      S3C_ADDR(0x00200000)    /* memory control */
#define S3C_VA_UART     S3C_ADDR(0x01000000)    /* UART */
#define S3C24XX_VA_GPIO   ((S3C24XX_PA_GPIO - S3C24XX_PA_UART) + S3C24XX_VA_UART)

and these physical addresses

#define S3C2410_PA_UART         (0x50000000)
#define S3C2410_PA_GPIO         (0x56000000)
#define S3C2410_PA_IRQ          (0x4A000000)
#define S3C2410_PA_MEMCTRL      (0x48000000)

Everything is aligned to full megabytes.

> I am just trying my hand on the minimal bootup of the board. I am
> looking at the existing port and trying to write my own. I am using
> the 3.9 vanilla kernel with pengutronix patches.

Ok, I see.

	Arnd

^ permalink raw reply	[flat|nested] 5+ messages in thread

* On mini2440 IO mappings.
  2013-06-04  9:47     ` Arnd Bergmann
@ 2013-06-05  7:22       ` mind entropy
  0 siblings, 0 replies; 5+ messages in thread
From: mind entropy @ 2013-06-05  7:22 UTC (permalink / raw)
  To: linux-arm-kernel

> I don't think it does. The mappings are
>
> static struct map_desc s3c_iodesc[] __initdata = {
>         IODESC_ENT(GPIO),
>         IODESC_ENT(IRQ),
>         IODESC_ENT(MEMCTRL),
>         IODESC_ENT(UART)
> };
>
> using these virtual addresses:
>
> #define S3C_ADDR_BASE   0xF6000000
> #define S3C_ADDR(x)     ((void __iomem __force *)S3C_ADDR_BASE + (x))
> #define S3C_VA_IRQ      S3C_ADDR(0x00000000)    /* irq controller(s) */
> #define S3C_VA_SYS      S3C_ADDR(0x00100000)    /* system control */
> #define S3C_VA_MEM      S3C_ADDR(0x00200000)    /* memory control */
> #define S3C_VA_UART     S3C_ADDR(0x01000000)    /* UART */
> #define S3C24XX_VA_GPIO   ((S3C24XX_PA_GPIO - S3C24XX_PA_UART) + S3C24XX_VA_UART)
>
> and these physical addresses
>
> #define S3C2410_PA_UART         (0x50000000)
> #define S3C2410_PA_GPIO         (0x56000000)
> #define S3C2410_PA_IRQ          (0x4A000000)
> #define S3C2410_PA_MEMCTRL      (0x48000000)
>
> Everything is aligned to full megabytes.

You are right. Sorry I misread the virtual addresses. Now in this
scheme would there be unused holes in the virtual address space (For
eg. IRQ address space is not 1 MB big)?

-Gautam

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-05  7:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-04  7:41 On mini2440 IO mappings mind entropy
2013-06-04  8:52 ` Arnd Bergmann
2013-06-04  9:29   ` mind entropy
2013-06-04  9:47     ` Arnd Bergmann
2013-06-05  7:22       ` mind entropy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).