AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20081208171759.2007ddf3@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:exch1.onstor.net
NSV:
SSH:
R:<maxim.kozlovsky@onstor.com>,<bfisher@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/andys@onstor.net@exch1.onstor.net/INBOX	0	2779531E7C760D4491C96305019FEEB5175DB9E715@exch1.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Mon, 8 Dec 2008 17:18:15 -0800
From: Andrew Sharp <andy.sharp@onstor.com>
To: Maxim Kozlovsky <maxim.kozlovsky@onstor.com>
Cc: Bill Fisher <bfisher@onstor.com>
Subject: Re: code to export memory through pci
Message-ID: <20081208171815.55395317@ripper.onstor.net>
In-Reply-To: <2779531E7C760D4491C96305019FEEB5175DB9E715@exch1.onstor.net>
References: <2779531E7C760D4491C96305019FEEB5175DB9E715@exch1.onstor.net>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Doesn't the prom set it up that way for us?

On Mon, 8 Dec 2008 16:56:53 -0800 Maxim Kozlovsky
<maxim.kozlovsky@onstor.com> wrote:

> Code/sm-pci/pci-init.c ~100
> 
>     pci_cfg_write(0, 0, 0, PHB_EXTCONFIGDIS, 1);
> 
>     /* Each PCI configuration register from 0x44 to 0x80 provides
> access to
>      * 1MB of memory, 0x1 is enable bit.
>          */
>         uintptr_t pci_phys_start = virt_to_phys(LOCAL_MEM);
>         uintptr_t pci_phys_end = pci_phys_start + 16 * 1024 * 1024;
>         uintptr_t addr;
>     int n;
> 
>         for (addr = pci_phys_start, n = 0;
>                   addr < pci_phys_end;
>                   addr += 1024 * 1024, n++) {
>                 pci_cfg_write(0, 0, 0, R_BCM1480_PHB_MAP(n), (addr >>
> 8) | 0x1); }
> 
>         /* Disable access to map registers.
>          */
>     pci_cfg_write(0, 0, 0, PHB_EXTCONFIGDIS, 0);
> 
