Subject: Re: problem with bus_space_map
To: Christian Groessler <cpg@aladdin.de>
From: Anand Lalgondar <solarflares@fastmail.fm>
List: tech-kern
Date: 02/12/2004 10:37:47
> >I didn't see anything wrong in you code, but what is this MEM area you're
> >trying to map ?
> 
> It's a dual processor i486 + i860 board. One can split the installed
> memory btw. the two processors. The i486 mem starts at address 0
> growing upwards, and the i860 mem starts at 0xffffffff growing
> downwards.
> 
> I want to map the i860 memory to be able to load i860 programs and run
> them there.
> 
> > Are you sure parts of it aren't already mapped ?
> 
> I think so (what should have mapped it?). But how can I see the
> mappings which exist?
> 

Well something came to my mind when reading this. Here the user is not
sure whether the memory that he requires is free or is mapped to some
device. Now if there was a table that would store the name, physical
address, virtual address, size allocated and IRQ number, for all type of
devices (when they get configured) that would be helpful to people who
struggle to find what type of memory to be allocated.

This particular module can be enabled if there is an option in the kernel
configuration file. By this information a person who tries to write a new
driver will not spend too much time in figuring out what memory is free
to be used.

Something Like:
--------------------------------------------------------------------------------------
Name    Physical Address    Virtual Address    Size    IRQ Number   
Added-Information
--------------------------------------------------------------------------------------


considering an example:
--------------------------
P1 at mainbus*
P2 at mainbus*

C1 at P1
C2 at P1

C3 at P2
C3 at P2
--------------------------

Now here mainbus is only used to configure the device driver tree so know
information regarding the same in the table. Next P1 would be mapped to
some physical address say 0x00000000-0x10000000 and virtual address
0x80000000-0x90000000 with the respective size, IRQ depending on the
requirment with added info which sould be updated in the global table.
Now when the child device C1 tries to configure he should update his
information and the PA range should be with-in the physical range
specified by the parent. This way the complete memory mapping of all the
devices that get configured should update the information.

This would be an added advantage in all the architectures, which would
speed up the phase of driver development.

 - Anand

-- 
http://www.fastmail.fm - IMAP accessible web-mail