@@ -10,6 +10,6 SUBDIRS = \ | |||
|
10 | 10 | genericrwplugin \ |
|
11 | 11 | memctrlrplugin \ |
|
12 | 12 | memcheckplugin |
|
13 | unix:SUBDIRS += spwplugin | |
|
13 | 14 | |
|
14 | 15 | OTHER_FILES += SocExplorer-plugins.spec |
|
15 | #unix:SUBDIRS += spwplugin |
@@ -20,7 +20,7 | |||
|
20 | 20 | -- Mail : alexis.jeandet@lpp.polytechnique.fr |
|
21 | 21 | ----------------------------------------------------------------------------*/ |
|
22 | 22 | #include "ahbdevicelist.h" |
|
23 | ||
|
23 | #include "ahbpluginui.h" | |
|
24 | 24 | |
|
25 | 25 | |
|
26 | 26 | ahbdevicelist::ahbdevicelist(QWidget *parent):QTableWidget(parent) |
@@ -36,6 +36,24 void ahbdevicelist::clearAHBdevicesList( | |||
|
36 | 36 | this->setHorizontalHeaderLabels(QStringList() << tr("Device Name")<<tr("BAR0")<<tr("BAR1")<<tr("BAR2")<<tr("BAR3")<<tr("Vendor ID")<<tr("Product ID")); |
|
37 | 37 | } |
|
38 | 38 | |
|
39 | QString decodeType(int type) | |
|
40 | { | |
|
41 | switch (type) { | |
|
42 | case AHB_PLUGNPLAY_APB_IO_SPACE: | |
|
43 | return "APB IO space"; | |
|
44 | break; | |
|
45 | case AHB_PLUGNPLAY_MEMORY_SPACE: | |
|
46 | return "Memory space"; | |
|
47 | break; | |
|
48 | case AHB_PLUGNPLAY_AHB_IO_SPACE: | |
|
49 | return "AHB IO space"; | |
|
50 | break; | |
|
51 | default: | |
|
52 | return "Unknown type"; | |
|
53 | break; | |
|
54 | } | |
|
55 | } | |
|
56 | ||
|
39 | 57 | void ahbdevicelist::addAHBdevice(ahbdeviceInfo* device) |
|
40 | 58 | { |
|
41 | 59 | if(this->rowCount()==0) |
@@ -56,7 +74,10 void ahbdevicelist::addAHBdevice(ahbdevi | |||
|
56 | 74 | { |
|
57 | 75 | if(device->BAR[i].size!=0) |
|
58 | 76 | { |
|
59 |
newItem = new QTableWidgetItem("0x" + QString::number(device->BAR[i].address, 16) |
|
|
77 | newItem = new QTableWidgetItem("0x" + QString::number(device->BAR[i].address, 16) | |
|
78 | +" -> 0x"+ QString::number(device->BAR[i].address + device->BAR[i].size-1, 16) | |
|
79 | +" size = "+device->barAdressSize(i) | |
|
80 | +" "+ decodeType(device->BAR[i].type)); | |
|
60 | 81 | newItem->setFlags(newItem->flags() &~ Qt::ItemIsEditable); |
|
61 | 82 | this->setItem(this->rowCount()-1, i+1, newItem); |
|
62 | 83 | } |
@@ -39,7 +39,7 ahbPluginUi::ahbPluginUi(socexplorerplug | |||
|
39 | 39 | |
|
40 | 40 | |
|
41 | 41 | |
|
42 | ahbdeviceInfo* ahbPluginUi::extractInfos(int *pnpregs) | |
|
42 | ahbdeviceInfo* ahbPluginUi::extractInfos(unsigned int *pnpregs) | |
|
43 | 43 | { |
|
44 | 44 | AHBbarreg BAR[4]; |
|
45 | 45 | |
@@ -47,13 +47,32 ahbdeviceInfo* ahbPluginUi::extractInfos | |||
|
47 | 47 | int PID; |
|
48 | 48 | for(int i=0;i<4;i++) |
|
49 | 49 | { |
|
50 |
|
|
|
51 |
|
|
|
50 | unsigned int addr=(pnpregs[i+4] & 0xfff00000)>>20; | |
|
51 | unsigned int mask=(pnpregs[i+4] & 0x0FFF0)>>4; | |
|
52 | BAR[i].type = (unsigned char)(pnpregs[i+4]&0x0f); | |
|
53 | printf("%x\n",addr); | |
|
54 | BAR[i].size = 0; | |
|
55 | BAR[i].address = 0; | |
|
56 | switch ((int)(BAR[i].type)) | |
|
57 | { | |
|
58 | case AHB_PLUGNPLAY_APB_IO_SPACE: | |
|
59 | break; | |
|
60 | case AHB_PLUGNPLAY_MEMORY_SPACE: | |
|
61 | BAR[i].address = addr<<20; | |
|
62 | BAR[i].size = (mask)<<20; | |
|
63 | break; | |
|
64 | case AHB_PLUGNPLAY_AHB_IO_SPACE: | |
|
65 | BAR[i].address = 0xfff00000 + (addr<<8); | |
|
66 | BAR[i].size = (mask)<<8; | |
|
67 | break; | |
|
68 | default: | |
|
69 | break; | |
|
70 | } | |
|
71 | ||
|
52 | 72 | if(BAR[i].size!=0) |
|
53 | 73 | BAR[i].size = (((-1^BAR[i].size)|BAR[i].address)-BAR[i].address)+1; |
|
54 | 74 | BAR[i].cacheable = (bool)((pnpregs[i+4]&0x00010000)>>16); |
|
55 | 75 | BAR[i].prefectchable = (bool)((pnpregs[i+4]&0x00020000)>>17); |
|
56 | BAR[i].type = (unsigned char)(pnpregs[i+4]&0xf); | |
|
57 | 76 | } |
|
58 | 77 | |
|
59 | 78 | VID = (pnpregs[0]>>24)&0xff; |
@@ -76,9 +95,11 void ahbPluginUi::scanAHB() | |||
|
76 | 95 | { |
|
77 | 96 | if(pnpregs[j]!=0) |
|
78 | 97 | { |
|
79 | ahbdeviceInfo* devinfo=this->extractInfos(pnpregs+j); | |
|
98 | ahbdeviceInfo* devinfo=this->extractInfos((unsigned int*)(pnpregs+j)); | |
|
80 | 99 | if(!devinfo->deviceName->compare("DSU3")) |
|
81 | 100 | SocExplorerEngine::addEnumDevice(this->_plugin,devinfo->VID,devinfo->PID,devinfo->BAR[0].address,*devinfo->deviceName); |
|
101 | if(!devinfo->deviceName->compare("SDCTRL")) | |
|
102 | SocExplorerEngine::addEnumDevice(this->_plugin,devinfo->VID,devinfo->PID,devinfo->BAR[1].address,*devinfo->deviceName); | |
|
82 | 103 | emit this->addAHBdevice(devinfo); |
|
83 | 104 | } |
|
84 | 105 | i+=32; |
@@ -31,14 +31,20 | |||
|
31 | 31 | #define AHB_PLUGNPLAY_MASTER_STOP ((unsigned int)(0xFFFFF800)) |
|
32 | 32 | #define AHB_PLUGNPLAY_SLAVE_START ((unsigned int)(0xFFFFF800)) |
|
33 | 33 | #define AHB_PLUGNPLAY_SLAVE_STOP ((unsigned int)(0xFFFFFFFC)) |
|
34 | ||
|
34 | /*0001 = APB I/O space | |
|
35 | 0010 = AHB Memory space | |
|
36 | 0011 = AHB I/O space | |
|
37 | */ | |
|
38 | #define AHB_PLUGNPLAY_APB_IO_SPACE 0x01 | |
|
39 | #define AHB_PLUGNPLAY_MEMORY_SPACE 0x02 | |
|
40 | #define AHB_PLUGNPLAY_AHB_IO_SPACE 0x03 | |
|
35 | 41 | |
|
36 | 42 | class ahbPluginUi : public QWidget |
|
37 | 43 | { |
|
38 | 44 | Q_OBJECT |
|
39 | 45 | public: |
|
40 | 46 | explicit ahbPluginUi(socexplorerplugin* plugin,QWidget *parent = 0); |
|
41 | ahbdeviceInfo* extractInfos(int* pnpregs); | |
|
47 | ahbdeviceInfo* extractInfos(unsigned int* pnpregs); | |
|
42 | 48 | public slots: |
|
43 | 49 | void scanAHB(); |
|
44 | 50 | signals: |
@@ -79,6 +79,7 void apbPluginUi::scanAPB() | |||
|
79 | 79 | unsigned long long i = APB_PLUGNPLAY_START; |
|
80 | 80 | int pnpregs[size]; |
|
81 | 81 | emit this->clearAPBdevicesList(); |
|
82 | this->devList.clear(); | |
|
82 | 83 | if(this->_plugin->Read((unsigned int*)pnpregs,size,(unsigned int)APB_PLUGNPLAY_START)==size) |
|
83 | 84 | { |
|
84 | 85 | while(i<APB_PLUGNPLAY_STOP) |
@@ -87,11 +88,15 void apbPluginUi::scanAPB() | |||
|
87 | 88 | { |
|
88 | 89 | apbdeviceInfo* devinfos=this->extractInfos(pnpregs+j); |
|
89 | 90 | SocExplorerEngine::addEnumDevice(this->_plugin,devinfos->VID,devinfos->PID,devinfos->BAR[0].address,devinfos->deviceName); |
|
90 |
|
|
|
91 | if(!this->devList.contains(devinfos->BAR[0].address)) | |
|
92 | { | |
|
93 | this->devList.append(devinfos->BAR[0].address); | |
|
94 | emit this->addAPBdevice(devinfos); | |
|
95 | } | |
|
91 | 96 | } |
|
92 | 97 | i+=8; |
|
93 | 98 | j+=2; |
|
94 | if(pnpregs[0]==pnpregs[j]&&pnpregs[1]==pnpregs[j+1])break; | |
|
99 | // if(pnpregs[0]!=0&&pnpregs[0]==pnpregs[j]&&pnpregs[1]==pnpregs[j+1])break; | |
|
95 | 100 | } |
|
96 | 101 | } |
|
97 | 102 | this->unlockScanBp(); |
@@ -54,6 +54,7 private: | |||
|
54 | 54 | QPushButton* scanBp; |
|
55 | 55 | apbdevicelist* deviceslst; |
|
56 | 56 | socexplorerplugin* _plugin; |
|
57 | QList<int> devList; | |
|
57 | 58 | }; |
|
58 | 59 | |
|
59 | 60 | #endif // APBPLUGINUI_H |
@@ -7,7 +7,7 CONFIG += socexplorerplugin | |||
|
7 | 7 | CONFIG += dll |
|
8 | 8 | CONFIG -= static |
|
9 | 9 | VERSION=0.2.0 |
|
10 |
TARGET = ambaplugin |
|
|
10 | TARGET = ambaplugin | |
|
11 | 11 | DEFINES += PLUGIN=ambaplugin |
|
12 | 12 | DEFINES += PLUGINHEADER="\"\\\"ambaplugin.h"\\\"\" |
|
13 | 13 | DEFINES += driver_Name="\"\\\"AMBA_PLUGIN"\\\"\" |
General Comments 0
You need to be logged in to leave comments.
Login now