mpc8349 - local bus on ppc

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mpc8349 - local bus on ppc

4,199 Views
aurelihein
Contributor I
hello,
I am currently working on a ppc(mpc8349) platform.
I modified BR3 and OR3 to enable LCS3 when I'm trying to access a specific address on the local bus in a GPCM mode.
The problem is that i don't know how to access my device on the local bus.
I know that i have to change the physical address to virtual address, but what are those functions . . .
do we have dma function ?should i use virt_to_bus(...) or bus_to_virt(...) ?
some help could be very appreciated
Thank you all

Message Edited by aurelihein on 2007-05-0210:43 AM

Message Edited by Alban on 2007-05-03 05:49 PM

0 Kudos
3 Replies

1,196 Views
aurelihein
Contributor I
Thank you fjpse for your answer, i actually find out yersteday how to access to the local bus
I will try what you did
The first thing is to configure some registers BRn and ORn to enable the chip select when you are accessing the chip on the local bus, and window some adresses on the mapping with LBLAWBARn and LBLAWARn.
For example i have a chip at the address 0xf0010000, in GPCM mode, with a 16bits port.

            //VIRT_IMMRBAR is the base register of my ppc
            *(unsigned long*)(VIRT_IMMRBAR + 0x5010) = 0xf00110001;  //BR2
            *(unsigned long*)(VIRT_IMMRBAR + 0x5014) = 0xffff80f0;        //OR2
            *(unsigned long*)(VIRT_IMMRBAR + 0x38) = 0xf0010000;        //LBLAWBAR3
            *(unsigned long*)(VIRT_IMMRBAR + 0x3c) = 0x8000000b;        //LBLAWAR3

            char *mypointer = ioremap(0xf0010000,1*1024);
            writel(value,mypointer);
            iounmap(mypointer);

I don't know what is the best way between our codes, after that i will have to use some DMA to do some transfers if you have some information i could be very interrested

thanks for your answer,
0 Kudos

1,196 Views
fjpse
Contributor I
Hello again, aurelihein

I send you what I do in a linux 2.4 kernel to access registers in an external PLD connected to the memory bus (I use a mpc860 but I think it work for 83xx)

<pre>
static void* PldRemap;

static int
PLDDRV_Initialize(void)
{
    /*
     * Inicialización de la PLD
     */
    if(check_mem_region(PLD_ADDRESS, PLD_SIZE) == 0)
    {
         request_mem_region(PLD_ADDRESS, PLD_SIZE, DRV_NAME);
         PldRemap = ioremap_nocache(PLD_ADDRESS, PLD_SIZE);
         if(PldRemap != NULL)
        {
              /*
               * now I can read/write the PLD registers using PldRemap
               */
         }
         else
         {
              printk("ioremap failed\n");
         }
     }
     else
     {
          printk("region just used\n");
     }
}

static void
PLDDRV_Finalize(void)
{
    /*
     * Finalización de la PLD
     */
    iounmap(PldRemap);
    release_mem_region(PLD_ADDRESS, PLD_SIZE);
}

</pre>

I hope it help you

0 Kudos

1,196 Views
fjpse
Contributor I
In the previous post,

PLD_ADDRESS is the physical address of the PLD registers.


0 Kudos