mips架构窗口设置代码(loongson3A)

时间:2021-07-08 20:09:08

这时基于loongson3A 64位CPU平台的分析:

/*
*这时初始化xbar的代码,其中说明一下关键地址
*win0地址为
*0x9000-0000-03ff0-2000到0x9000-0000-3ff0-20b8
*win1地址为
*0x9000-0000-03ff0-2100到0x9000-0000-3ff0-21b8
*win2地址为
*0x9000-0000-03ff0-2200到0x9000-0000-3ff0-22b8
*win3地址为
*0x9000-0000-03ff0-2300到0x9000-0000-3ff0-23b8
*east地址为
*0x9000-0000-03ff0-2400到0x9000-0000-3ff0-24b8
*south地址为
*0x9000-0000-03ff0-2500到0x9000-0000-3ff0-25b8
*west地址为
*0x9000-0000-03ff0-2600到0x9000-0000-3ff0-26b8
*north地址为
*0x9000-0000-03ff0-2700到0x9000-0000-3ff0-27b8
*/



dlit0, 0x900000003ff02000 //加载win0寄存器地址
dlit2, 0x900000003ff02700 //加载north地址用于循环
1:
//map HT: PCI IO : 0x90000efd_fc000000 --> 0x18000000
//map 0x90000efd_fd000000 --> 0x19000000
//map HT: PCI CFG: 0x90000efd_fe000000 --> 0x1a000000
//map HT: PCI CFG: 0x90000efd_ff000000 --> 0x1b000000
dlit1, 0x000000001b000000 //加载要写入的值
sd t1, 0x0(t0)//写入到寄存器base0中
dlit1, 0xffffffffff000000//加载要写入到mask的值
sdt1, 0x40(t0)//写入到mask寄存器中
dlit1, 0x00000e001f0000f7 //加载要写入到mmap的值
sdt1, 0x80(t0)//写入到mmap寄存器中

// map PCIE space to 0x10000000//配置第二个窗口
dlit1, 0x0000000018000000//要写入base1的值
sdt1, 0x08(t0)//写入base1
dlit1, 0xffffffffff000000//加载要写入mask1的值
sdt1, 0x48(t0)//写入mask1
dlit1, 0x00000e00180000f7//要写入到mmap1的值
sdt1, 0x88(t0)//写入到mmap1

dlit1, 0x0000000010000000//要写入到base2的值
sdt1, 0x10(t0)//写入到base2
dlit1, 0xfffffffff8000000//写入到mask2的值
sdt1, 0x50(t0)//写入到mask2
dlit1, 0x00000e00100000f7//
sdt1, 0x90(t0)写入到mmap2


// below added for ls2h PCIE device mem1 space
//map 0x90000e50_00000000 --> 0x40000000

dlit1, 0x0000000040000000
sdt1, 0x18(t0)//写入到base3
dlit1, 0xffffffffc0000000
sdt1, 0x58(t0)//写入到mask3
dlit1, 0x00000e50000000f7
sdt1, 0x98(t0)//写入到mmap3


// below added for ls2h dc frame buffer
//map 0x90000e00_00000000 --> 0x20000000

dli t1, 0x0000000020000000
sd t1, 0x20(t0) //写入到base4
dli t1, 0xfffffffff0000000
sd t1, 0x60(t0) //写入到mask4
dli t1, 0x00000e00000000f7
sd t1, 0xa0(t0)//写入到mmap4



daddiu t0, t0, 0x100//设置写一个master窗口
bne t0, t2, 1b
nop