分享

au1200_mips_dm9000

 昵称6042 2006-08-25

Hello all,

I am trying to use the DM9000 Ethernet controller on the AU1200.
so we connected the DM9000 on the Static bus controller #3 on the au1200.
and we configured the RCS#3 as a I/O device.
The Physical address of I/O device on au1200 is from the 0xD 0000 0000 to
0xD ffff ffff.
I guess I need to convert this address to virtual address for access it.
But I don‘t know exactly how to do it. Do I need to configure the TBL?
I am using the YAMON as a bootloader. and try to access the DM9000.
But It is not easy for me.

Any advice or examples are welcome.
Thanks,

 

On Jan 16, 2006, at 10:40 PM, Youngduk Goo wrote:


I guess I need to convert this address to virtual address for access it.
You have to map it, yes.

But I don‘t know exactly how to do it. Do I need to configure the TBL?
I am using the YAMON as a bootloader. and try to access the DM9000.


You will have to modify the YAMON source code to map TLB entries
for the device.  Take a look at the sys_tlb_write() function along with
ensuring you update the CP0 wired register so they don‘t disappear.
Also, you will have to check what else may be doing this so you don‘t
me%POST http://www.360doc.com/writeArt.aspx HTTP32

In Linux, all you need to do is call ioremap() and use the virtual
address returned to you.

        -- Dan

 

Thanks Dan for the reply.

I set the TLB as you mentioned on the DM9000 driver in YAMON.
UINT32 pte[5];

pte[0] = 0;                                       /* TLB Entry : 0    */
pte[1] = 0x01FFE000;                      /* Page Mask : 16MB */
pte[2] = 0xD0000000;                       /* EntryHi: 0xD0000000 */
pte[3] = (0xD0000000>>2) | 0x0017;  /* EntryLo0            */
pte[4] = (0xD0100000>>2) | 0x0017;  /* EntryLo1            */

sys_tlb_write(pte);                 /* set the TLB entry 0 */
CP0_wired_write(2);                 /* wired register for 2 entry */

After setting, I could access DM9000 with the Base address 0xD0000000.
In here, I have some more questions.
1. I set the 1 TLB entry, so others does not affect the address translation.
   so Whenever I use the 0xD0000000, it always converted to 0xD 0000 0000
   on the bootloader.
   Am I right?
2. On the linux, If I want to use ioremap for Dm9000, Do I need to set the TLB
    and do not need to change the ioremap source code ?

Thank you in advance,
youngduk

 

On 1/17/06, Dan Malek <dan@embeddedalley.com> wrote:
>
> On Jan 16, 2006, at 10:40 PM, Youngduk Goo wrote:
>
> > I guess I need to convert this address to virtual address for access
> > it.
>
> You have to map it, yes.
>
> > But I don‘t know exactly how to do it. Do I need to configure the TBL?
> > I am using the YAMON as a bootloader. and try to access the DM9000.
>
> You will have to modify the YAMON source code to map TLB entries
> for the device.  Take a look at the sys_tlb_write() function along with
> ensuring you update the CP0 wired register so they don‘t disappear.
> Also, you will have to check what else may be doing this so you don‘t
> mess up other mappings.
>
> In Linux, all you need to do is call ioremap() and use the virtual
> address returned to you.
>
>        -- Dan
>
>

 

On Jan 17, 2006, at 2:08 AM, Youngduk Goo wrote:


After setting, I could access DM9000 with the Base address 0xD0000000.
In here, I have some more questions.

1. I set the 1 TLB entry, so others does not affect the address translation. so Whenever I use the 0xD0000000, it always converted to 0xD 0000 0000
   on the bootloader.
   Am I right?


Yes, looks good.


2. On the linux, If I want to use ioremap for Dm9000, Do I need to set the TLB
    and do not need to change the ioremap source code ?


Make sure you have CONFIG_64BIT_PHYS_ADDR configured
and you are using a recent kernel.  No changes to any code and ioremap()
will ensure the TLB is set correctly.  Just use the virtual address
returned from ioremap().


        -- Dan

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多