Skip to contentSkip to conversation

IBM 440GP 36-bit addressing

DISCUSSION Vishwanath 3 participants 5 messages Aug 23, 2002 – Aug 26, 2002

lore
Share & tools
lore

Vishwanath

author
#0 lore raw

Hi,

I am new to PPC Linux. I am working on IBM 440 GP board. I am using MontaVista Linux source code. I didn't understand how 36-bit addressing is taken care in this code. If an application has to access the a memory location in SDRAM of 440 GP or its internal peripheral registers, whether it has to pass 36-bit address or normal 32-bit address.

I am afraid my doubt is silly one. But still I am totally confused.

Hope to get reply soon.

Thanks and regards,
Vishwanath

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 6 lines · Vishwanath

I am new to PPC Linux. I am working on IBM 440 GP board. I am using MontaVista Linux source code. I didn't understand how 36-bit addressing is taken care in this code. If an application has to access the a memory location in SDRAM of 440 GP or its internal peripheral registers, whether it has to pass 36-bit address or normal 32-bit address.

It's a 36-bit real address space, but 32-bit effective (aka "virtual"). Applications, which run entirely in effective address space, have no reason to think about such things and require no modification.

The kernel has to care about the real address space, mostly when you want to ioremap (all the on-chip peripheral addresses are higher than 4GB as I recall) a 36-bit real address to a 32-bit effective address so you can use it in the kernel (which also runs in effective mode).

-Hollis

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

author
#2 lore raw

Hi All,

Thanks for your information. I have few more doubts.

By going through the code, I understood that ioremap64() is used for mapping the 36-bit real address onto 32-bit effective address space. How this mapping information is conveyed to user applications ?

If I am writing assembly instructions to access 440GP registers, do I have to pass 36-bit real address or 32-bit effective address ?

Physical address map of 440GP provides information only about Real addresses. How can I convert these real addresses onto effective addresses ? Do I have to write a TLB entry regarding my addresses ?

Thanks and Regards,
Vishwa

----- Original Message -----
From: "Hollis Blanchard" <[email protected]>
To: <[email protected]>
Sent: Friday, August 23, 2002 8:30 PM
Subject: Re: IBM 440GP 36-bit addressing

Quoted 5 lines · Vishwanath
Quoted 3 lines

I am new to PPC Linux. I am working on IBM 440 GP board. I am using MontaVista Linux source code. I didn't understand how 36-bit addressing

is

Quoted 2 lines
Quoted 2 lines

taken care in this code. If an application has to access the a memory location in SDRAM of 440 GP or its internal peripheral registers,

whether it

Quoted 6 lines
Quoted 1 line

has to pass 36-bit address or normal 32-bit address.

It's a 36-bit real address space, but 32-bit effective (aka "virtual"). Applications, which run entirely in effective address space, have no reason to think about such things and require no modification.

Quoted 10 lines

The kernel has to care about the real address space, mostly when you want to ioremap (all the on-chip peripheral addresses are higher than 4GB as I recall) a 36-bit real address to a 32-bit effective address so you can use it in the kernel (which also runs in effective mode).

-Hollis

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#3 lore raw
Quoted 4 lines · Vishwanath

By going through the code, I understood that ioremap64() is used for mapping the 36-bit real address onto 32-bit effective address space. How this mapping information is conveyed to user applications ?

I don't understand the question. Do you mean "how does userspace know what the kernel has ioremapped"? I don't think it does.

Do you mean "how can userspace map in a 36-bit real address"? The usual (32-bit) way is to mmap(/dev/mem). I don't know if that will work with 36-bit addresses.

Quoted 2 lines

If I am writing assembly instructions to access 440GP registers, do I have to pass 36-bit real address or 32-bit effective address ?

Do you mean a memory-mapped register, i.e. an on-chip peripheral like the UART? If so, that's what we've been talking about. You must map the 36-bit real address into your 32-bit effective address space, then access the effective address.

Quoted 3 lines

Physical address map of 440GP provides information only about Real addresses. How can I convert these real addresses onto effective addresses ? Do I have to write a TLB entry regarding my addresses ?

Exactly, that's what I mean by "mapping".

Of course, some TLB entries may already have been set up for you by the kernel or firmware. Whatever the case, you need to make sure there is a TLB entry in place.

-Hollis

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#4 lore raw

Hollis,

Quoted 3 lines · you

The usual(32-bit) way is to mmap(/dev/mem). I don't know if that will work with
36-bit addresses.

It will work only for first 4G of physical address space. /dev/mem cannot be used to access EPB/OCP or PCI address space on 440.

For this purpose "/dev/mem-like" device can be easily written that takes into account 36-bit phys addresses.

Thanks,

Eugene Surovegin <mailto:[email protected]>

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/