Message ID | 4BDF7358.8050101@loongson.cn |
---|---|
State | New |
Headers | show |
δΉε΄ wrote: >I add Sebastian Herbsz's patch,add WIN_WIN_STANDBYNOW1 support to fix > hw_error on linux shut down etc. > > I am not familiar with git send-email,I am studying it now :). [snip] > >From e94912b03ed33080d550eb5764fc99911498101b Mon Sep 17 00:00:00 2001 > From: QiaoChong <qiaochong@loongson.cn> > Date: Tue, 4 May 2010 07:31:30 +0800 > Subject: [PATCH] ahci pci ids into pci_ids.h,add warning messages. > > move ahci pci device id define into pci_ids.h,add warning messages for > unsupported features. > > Signed-off-by: QiaoChong <qiaochong@loongson.cn> > --- > hw/ahci.c | 10 +++++----- > hw/pci_ids.h | 1 + > 2 files changed, 6 insertions(+), 5 deletions(-) > > diff --git a/hw/ahci.c b/hw/ahci.c > index cb4a851..e1aed4a 100644 > --- a/hw/ahci.c > +++ b/hw/ahci.c > @@ -662,7 +662,9 @@ static void handle_cmd(AHCIState *s,int port,int slot) > > if(fis[1]==0) > { > - > +#ifdef DEBUG_AHCI > + printf("now,just ignore command fis[0]=%02x fis[1]=%02x fis[2]=%02x\n",fis[0],fis[1],fis[2]); > +#endif > } > > if(fis[1]==(1<<7)) > @@ -755,15 +757,13 @@ static void ahci_pci_map(PCIDevice *pci_dev, int region_num, > cpu_register_physical_memory(addr, size, s->mem); > } > > -#define PCI_VENDOR_MYDEVICE 0x8086 > -#define PCI_PRODUCT_MYDEVICE 0x2652 > > static int pci_ahci_init(PCIDevice *dev) > { > struct ahci_pci_state *d; > d = DO_UPCAST(struct ahci_pci_state, card, dev); > - pci_config_set_vendor_id(d->card.config,PCI_VENDOR_MYDEVICE); > - pci_config_set_device_id(d->card.config,PCI_PRODUCT_MYDEVICE); > + pci_config_set_vendor_id(d->card.config,PCI_VENDOR_ID_INTEL); > + pci_config_set_device_id(d->card.config,PCI_DEVICE_ID_INTEL_ICH6R_AHCI); > d->card.config[PCI_COMMAND] = PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER; > d->card.config[PCI_CLASS_DEVICE] = 0; > d->card.config[0x0b] = 1;//storage > diff --git a/hw/pci_ids.h b/hw/pci_ids.h > index fe7a121..4d4de93 100644 > --- a/hw/pci_ids.h > +++ b/hw/pci_ids.h > @@ -97,3 +97,4 @@ > #define PCI_DEVICE_ID_INTEL_82371AB 0x7111 > #define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112 > #define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113 > +#define PCI_DEVICE_ID_INTEL_ICH6R_AHCI 0x2652 The list is sorted by vendor and device id. This entry should go after "PCI_DEVICE_ID_INTEL_ESB_9". The naming scheme seems to be VENDOR_DEVICE_FUNCTION, so i suggest something like PCI_DEVICE_ID_INTEL_ICH6R_2 or PCI_DEVICE_ID_INTEL_82801FR_2. Sebastian
On Tue, May 04, 2010 at 10:51:37PM +0200, Sebastian Herbszt wrote: > >diff --git a/hw/pci_ids.h b/hw/pci_ids.h > >index fe7a121..4d4de93 100644 > >--- a/hw/pci_ids.h > >+++ b/hw/pci_ids.h > >@@ -97,3 +97,4 @@ > >#define PCI_DEVICE_ID_INTEL_82371AB 0x7111 > >#define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112 > >#define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113 > >+#define PCI_DEVICE_ID_INTEL_ICH6R_AHCI 0x2652 > > The list is sorted by vendor and device id. This entry should go > after "PCI_DEVICE_ID_INTEL_ESB_9". The naming scheme seems > to be VENDOR_DEVICE_FUNCTION, so i suggest something like > PCI_DEVICE_ID_INTEL_ICH6R_2 or PCI_DEVICE_ID_INTEL_82801FR_2. Linux seems to have called this PCI_DEVICE_ID_INTEL_ICH6_4 at one point. So this should be function 4, no? Cheers,
Stuart Brady wrote: > On Tue, May 04, 2010 at 10:51:37PM +0200, Sebastian Herbszt wrote: >> >diff --git a/hw/pci_ids.h b/hw/pci_ids.h >> >index fe7a121..4d4de93 100644 >> >--- a/hw/pci_ids.h >> >+++ b/hw/pci_ids.h >> >@@ -97,3 +97,4 @@ >> >#define PCI_DEVICE_ID_INTEL_82371AB 0x7111 >> >#define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112 >> >#define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113 >> >+#define PCI_DEVICE_ID_INTEL_ICH6R_AHCI 0x2652 >> >> The list is sorted by vendor and device id. This entry should go >> after "PCI_DEVICE_ID_INTEL_ESB_9". The naming scheme seems >> to be VENDOR_DEVICE_FUNCTION, so i suggest something like >> PCI_DEVICE_ID_INTEL_ICH6R_2 or PCI_DEVICE_ID_INTEL_82801FR_2. > > Linux seems to have called this PCI_DEVICE_ID_INTEL_ICH6_4 at one point. > > So this should be function 4, no? Well, i am not sure if the last part is the function number. pci_ids.h from the linux kernel got this: #define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 #define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641 #define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642 #define PCI_DEVICE_ID_INTEL_ICH6_16 0x266a #define PCI_DEVICE_ID_INTEL_ICH6_17 0x266d #define PCI_DEVICE_ID_INTEL_ICH6_18 0x266e #define PCI_DEVICE_ID_INTEL_ICH6_19 0x266f According to the Intel spec the SATA controller is D31:F2. So we got device 31 and function 2. The IDE controller is D31:F1, but above it's ICH6_19. Sebastian > Cheers, > -- > Stuart Brady > > >
From e94912b03ed33080d550eb5764fc99911498101b Mon Sep 17 00:00:00 2001 From: QiaoChong <qiaochong@loongson.cn> Date: Tue, 4 May 2010 07:31:30 +0800 Subject: [PATCH] ahci pci ids into pci_ids.h,add warning messages. move ahci pci device id define into pci_ids.h,add warning messages for unsupported features. Signed-off-by: QiaoChong <qiaochong@loongson.cn> --- hw/ahci.c | 10 +++++----- hw/pci_ids.h | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/ahci.c b/hw/ahci.c index cb4a851..e1aed4a 100644 --- a/hw/ahci.c +++ b/hw/ahci.c @@ -662,7 +662,9 @@ static void handle_cmd(AHCIState *s,int port,int slot) if(fis[1]==0) { - +#ifdef DEBUG_AHCI + printf("now,just ignore command fis[0]=%02x fis[1]=%02x fis[2]=%02x\n",fis[0],fis[1],fis[2]); +#endif } if(fis[1]==(1<<7)) @@ -755,15 +757,13 @@ static void ahci_pci_map(PCIDevice *pci_dev, int region_num, cpu_register_physical_memory(addr, size, s->mem); } -#define PCI_VENDOR_MYDEVICE 0x8086 -#define PCI_PRODUCT_MYDEVICE 0x2652 static int pci_ahci_init(PCIDevice *dev) { struct ahci_pci_state *d; d = DO_UPCAST(struct ahci_pci_state, card, dev); - pci_config_set_vendor_id(d->card.config,PCI_VENDOR_MYDEVICE); - pci_config_set_device_id(d->card.config,PCI_PRODUCT_MYDEVICE); + pci_config_set_vendor_id(d->card.config,PCI_VENDOR_ID_INTEL); + pci_config_set_device_id(d->card.config,PCI_DEVICE_ID_INTEL_ICH6R_AHCI); d->card.config[PCI_COMMAND] = PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER; d->card.config[PCI_CLASS_DEVICE] = 0; d->card.config[0x0b] = 1;//storage diff --git a/hw/pci_ids.h b/hw/pci_ids.h index fe7a121..4d4de93 100644 --- a/hw/pci_ids.h +++ b/hw/pci_ids.h @@ -97,3 +97,4 @@ #define PCI_DEVICE_ID_INTEL_82371AB 0x7111 #define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112 #define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113 +#define PCI_DEVICE_ID_INTEL_ICH6R_AHCI 0x2652 -- 1.5.6.5