linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* HELP! Memory mapping and address space doubts
@ 2006-01-26 14:04 Jose França (Ext_GTBC)
  2006-01-27 13:37 ` Vitaly Bordug
  0 siblings, 1 reply; 4+ messages in thread
From: Jose França (Ext_GTBC) @ 2006-01-26 14:04 UTC (permalink / raw)
  To: linuxppc-embedded

Hello u all!

	I need to clarify some aspects of the memory management in ppc linux =
and i hope that you could help me.
	Lets imagine we have a mpc8272 based board with 3 devices A, B and C.In =
the bootloader (in my case, i use u-boot), i configured the BRx and Orx =
so that A has base address X, B has base address Y and C has base =
address Z. My first doubt arrises here: what address should i use? Being =
SDRAM base address 0x00000000 and kernel base address 0xC0000000, where =
will i put these devices mapped on? Above 0xC0000000 or in between the =
end of physical memory and 0xC0000000? Do i really need to configure the =
BAT registers in u boot?
	In linux 2.4 kernel, we have ppc_md.setup_io_mappings to map address =
blocks into the BAT registers... As i observed in the kernel source tree =
examples, we must map CPM (why?). And what about the other devices A, B =
and C? How will i setup them in this case and what addresses i can use? =
Above 0xC0000000 or in between the end of physical memory and =
0xC0000000? Is the SDRAM included?

	Thanks in advance to all contributions! All of them will be most =
welcomed!





Best regards,
Filipe

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

* Re: HELP! Memory mapping and address space doubts
  2006-01-26 14:04 Jose França (Ext_GTBC)
@ 2006-01-27 13:37 ` Vitaly Bordug
  0 siblings, 0 replies; 4+ messages in thread
From: Vitaly Bordug @ 2006-01-27 13:37 UTC (permalink / raw)
  To: Jose França; +Cc: linuxppc-embedded

Jose,
Can you please be a bit more specific in targets you want to achieve?

An example how to setup br/or and use the device could be found as a part of PQ2 PCI support,
where interrupt controller is implemented as a CPLD device (arch/ppc/syslib/m82xx_pci.{c,h}).


On Thu, 26 Jan 2006 14:04:49 -0000
Jose França (Ext_GTBC) <Jose.Franca.Ext@siemens.com> wrote:

> Hello u all!
> 
> 	I need to clarify some aspects of the memory management in ppc linux and i hope that you could help me.
> 	Lets imagine we have a mpc8272 based board with 3 devices A, B and C.In the bootloader (in my case, i use u-boot), i configured the BRx and Orx so that A has base address X, B has base address Y and C has base address Z. My first doubt arrises here: what address should i use? Being SDRAM base address 0x00000000 and kernel base address 0xC0000000, where will i put these devices mapped on? Above 0xC0000000 or in between the end of physical memory and 0xC0000000? Do i really need to configure the BAT registers in u boot?
> 	In linux 2.4 kernel, we have ppc_md.setup_io_mappings to map address blocks into the BAT registers... As i observed in the kernel source tree examples, we must map CPM (why?). And what about the other devices A, B and C? How will i setup them in this case and what addresses i can use? Above 0xC0000000 or in between the end of physical memory and 0xC0000000? Is the SDRAM included?
> 
> 	Thanks in advance to all contributions! All of them will be most welcomed!
> 
> 
> 
> 
> 
> Best regards,
> Filipe
> 
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 
> 


-- 
Sincerely, 
Vitaly

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

* RE: HELP! Memory mapping and address space doubts
@ 2006-01-30 23:29 Jose França (Ext_GTBC)
  2006-02-10 13:04 ` Tore Martin Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Jose França (Ext_GTBC) @ 2006-01-30 23:29 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: linuxppc-embedded

Vml0YWx5LA0KIA0KICAgICBJJ20gdXNpbmcgYSBsaW51eCAyLjQuMzEga2VybmVsLiBJbiB0aGUg
cHJlc2VudCBzaXR1YXRpb24gSSBoYXZlIEJSeC9PUnggd2VsbCBjb25maWd1cmVkIGFuZCBpIGNh
biBib290IHUtYm9vdCBub3JtYWxseSBhbmQgd2l0aG91dCBwcm9ibGVtcy4gSSBoYXZlIGEgZmxh
c2ggZXByb20gd2l0aCBiYXNlIGFkZHJlc3MgMHhEMDAwMDAwMCBhbmQgYSBGUEdBIGluIDB4RTAw
MDAwMDAuIEluIGxpbnV4LCBpIGhhdmUgdGhlIG10ZCBkcml2ZXIgc2ltaW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T4NCgk+IEJlc3QgcmVnYXJkcywNCgk+
IEZpbGlwZQ0KCT4NCgk+IF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fDQoJPiBMaW51eHBwYy1lbWJlZGRlZCBtYWlsaW5nIGxpc3QNCgk+IExpbnV4cHBjLWVt
YmVkZGVkQG96bGFicy5vcmcNCgk+IGh0dHBzOi8vb3psYWJzLm9yZy9tYWlsbWFuL2xpc3RpbmZv
L2xpbnV4cHBjLWVtYmVkZGVkDQoJPg0KCT4NCgkNCgkNCgktLQ0KCVNpbmNlcmVseSwNCglWaXRh
bHkNCglfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXw0KCUxp
bnV4cHBjLWVtYmVkZGVkIG1haWxpbmcgbGlzdA0KCUxpbnV4cHBjLWVtYmVkZGVkQG96bGFicy5v
cmcNCglodHRwczovL296bGFicy5vcmcvbWFpbG1hbi9saXN0aW5mby9saW51eHBwYy1lbWJlZGRl
ZCANCg0K

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

* Re: HELP! Memory mapping and address space doubts
  2006-01-30 23:29 HELP! Memory mapping and address space doubts Jose França (Ext_GTBC)
@ 2006-02-10 13:04 ` Tore Martin Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Tore Martin Hagen @ 2006-02-10 13:04 UTC (permalink / raw)
  To: "Jose França (Ext_GTBC)"; +Cc: linuxppc-embedded

Hi Vitaly,

It seams that you are mixing virtual addresses and physical addresses. 
You must put RAM at physical address 0 and you can keep the flash and 
fpga as it is. The 0xc0000000 is  the virtual address of the kernel, and 
has nothing to do with the physical address.

Where have you mapped the IMMR?

If you have problems with probing of the CFI flash I would try to find 
out what the problem realy is. I was given a board with what I would 
call SwapEndian, I had to use littleendian for read and bigendian for 
writes.

/Tore Martin Hagen



Jose França (Ext_GTBC) wrote:

>Vitaly,
> 
>     I'm using a linux 2.4.31 kernel. In the present situation I have BRx/ORx well configured and i can boot u-boot normally and without problems. I have a flash eprom with base address 0xD0000000 and a FPGA in 0xE0000000. In linux, i have the mtd driver similar to the rpxlite board. cfi_probe doesn't find my flash eprom. My colleague developped an fpga driver, but he can't access it either... It seem's that all the addresses that we try to access are all mixed-up. In ppc_md.map_io, i'm doing io_block_mapping for the CPM (from 0xf0000000 to the end of memory) , 0x80000000 and 0xa0000000 for PCI address space, both with 256MB of length. We are a bit lost... It seems that we forgot something to do. Can you help me on this?
> 
> 
>Best regards,
>Filipe.
>
>	-----Mensagem original----- 
>	De: linuxppc-embedded-bounces@ozlabs.org em nome de Vitaly Bordug 
>	Enviada: sex 27-01-2006 13:37 
>	Para: Jose França (Ext_GTBC) 
>	Cc: linuxppc-embedded@ozlabs.org 
>	Assunto: Re: HELP! Memory mapping and address space doubts
>	
>	
>
>	Jose,
>	Can you please be a bit more specific in targets you want to achieve?
>	
>	An example how to setup br/or and use the device could be found as a part of PQ2 PCI support,
>	where interrupt controller is implemented as a CPLD device (arch/ppc/syslib/m82xx_pci.{c,h}).
>	
>	
>	On Thu, 26 Jan 2006 14:04:49 -0000
>	Jose França (Ext_GTBC) <Jose.Franca.Ext@siemens.com> wrote:
>	
>	> Hello u all!
>	>
>	>       I need to clarify some aspects of the memory management in ppc linux and i hope that you could help me.
>	>       Lets imagine we have a mpc8272 based board with 3 devices A, B and C.In the bootloader (in my case, i use u-boot), i configured the BRx and Orx so that A has base address X, B has base address Y and C has base address Z. My first doubt arrises here: what address should i use? Being SDRAM base address 0x00000000 and kernel base address 0xC0000000, where will i put these devices mapped on? Above 0xC0000000 or in between the end of physical memory and 0xC0000000? Do i really need to configure the BAT registers in u boot?
>	>       In linux 2.4 kernel, we have ppc_md.setup_io_mappings to map address blocks into the BAT registers... As i observed in the kernel source tree examples, we must map CPM (why?). And what about the other devices A, B and C? How will i setup them in this case and what addresses i can use? Above 0xC0000000 or in between the end of physical memory and 0xC0000000? Is the SDRAM included?
>	>
>	>       Thanks in advance to all contributions! All of them will be most welcomed!
>	>
>	>
>	>
>	>
>	>
>	> Best regards,
>	> Filipe
>	>
>	> _______________________________________________
>	> Linuxppc-embedded mailing list
>	> Linuxppc-embedded@ozlabs.org
>	> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>	>
>	>
>	
>	
>	--
>	Sincerely,
>	Vitaly
>	_______________________________________________
>	Linuxppc-embedded mailing list
>	Linuxppc-embedded@ozlabs.org
>	https://ozlabs.org/mailman/listinfo/linuxppc-embedded 
>
>_______________________________________________
>Linuxppc-embedded mailing list
>Linuxppc-embedded@ozlabs.org
>https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>

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

end of thread, other threads:[~2006-02-10 13:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-30 23:29 HELP! Memory mapping and address space doubts Jose França (Ext_GTBC)
2006-02-10 13:04 ` Tore Martin Hagen
  -- strict thread matches above, loose matches on Subject: below --
2006-01-26 14:04 Jose França (Ext_GTBC)
2006-01-27 13:37 ` Vitaly Bordug

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).