From mboxrd@z Thu Jan 1 00:00:00 1970 From: Subject: Re: acpi_find_bmc() and acpi_get_table() Date: Mon, 26 Feb 2007 12:30:29 -0600 Message-ID: <5DDAB7BA7BDB58439DD0EED0B8E9A3AE073879@ausx3mpc102.aus.amer.dell.com> References: <200702102327.28312.lenb@kernel.org> <200702152103.54960.bjorn.helgaas@hp.com> <45D53DDE.5000300@acm.org> <200702192131.52947.bjorn.helgaas@hp.com> <45DA9931.80605@linux.intel.com> <45DAFDD8.909@acm.org> <20070225215922.GA28931@lists.us.dell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C759D4.3155C160" Return-path: Content-class: urn:content-classes:message List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openipmi-developer-bounces@lists.sourceforge.net Errors-To: openipmi-developer-bounces@lists.sourceforge.net To: Matt_Domsch@dell.com, minyard@acm.org Cc: linux-acpi@vger.kernel.org, alexey.y.starikovskiy@linux.intel.com, bjorn.helgaas@hp.com, openipmi-developer@lists.sourceforge.net, lenb@kernel.org List-Id: linux-acpi@vger.kernel.org This is a multi-part message in MIME format. ------_=_NextPart_001_01C759D4.3155C160 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Corey, Here is the patch (RHEL5 base code) I've been testing that detects the = ACPI namespace object. The IPI0001 device doesn't contain the register spacing directly; it has = a _CRS resource object that (for KCS) has two I/O port entries. I save the first port in = io.addr_data, then calculate the register spacing based on subtracting = the 2nd port address and the 1st. I'm thinking of changing the register spacing to using an array of = port/memory addresses to make calculating interface addresses more = generic. eg. static unsigned char port_inb(struct si_sm_io *io, unsigned int offset) { unsigned int addr =3D io->addr_data; return inb(addr + (offset * io->regspacing)); } would become something like: static unsigned char port_inb(struct si_sm_io *io, unsigned int offset) { unsigned int addr =3D io->addr_data[offset]; return inb(addr); } --jordan hargrave Dell Enterprise Linux Engineering -----Original Message----- From: Matt Domsch [mailto:Matt_Domsch@dell.com] Sent: Sun 2/25/2007 3:59 PM To: Corey Minyard; Hargrave, Jordan Cc: Alexey Starikovskiy; linux-acpi@vger.kernel.org; openipmi; Len = Brown; Bjorn Helgaas Subject: Re: [Openipmi-developer] acpi_find_bmc() and acpi_get_table() =20 On Tue, Feb 20, 2007 at 07:55:36AM -0600, Corey Minyard wrote: > Alexey Starikovskiy wrote: > > Bjorn Helgaas wrote: > >> On Thursday 15 February 2007 22:15, Corey Minyard wrote: > >> =20 > >>> Bjorn Helgaas wrote: > >>> =20 > >>>> On Saturday 10 February 2007 21:27, Len Brown wrote: > >>>> =20 > >>>>> acpi_find_bmc() appears to be searching for multiple SPMI tables = > >>>>> in the RSDT and running > >>>>> try_init_acpi() on each of them > >>>>> until it doesn't find any more. > >>>>> =20 > >>>> I can't remember why we look at the SPMI table(s) rather than > >>>> registering a normal ACPI (or even PNP) driver. Unless we > >>>> need to poke the BMC very early, wouldn't it be better to > >>>> rely on the device description in the namespace? > >>>> =20 > >>> For some strange reason the normal ACPI information does not > >>> have all the information needed by the driver. It doesn't have > >>> register size or spacing information. > >>> =20 > >> > >> I guess that would be a defect in the way ACPI is being used, > >> wouldn't it? A PNP ID should define the device programming > >> model, including things like register size and spacing. It > >> sounds like somebody didn't define a new PNP ID when he should > >> have. I wonder whether it's worth trying to fix this. > >> > >> =20 > > Yes, it is considered an ACPI fault. Could you please describe in=20 > > detail, which registers miss the information? And probably your=20 > > acpidump will help as well. > I don't have a machine with an ACPI description of the BMC. I'll copy = > the mailing list to see if anyone has an ACPI-described BMC. >=20 > I don't know that much about ACPI, so maybe that information is=20 > described somehow in a way the IPMI spec doesn't talk about directly,=20 > like in the _CRS object. Let me copy my teammate Jordan Hargrave in on this, as he's been working with our BIOS team to implement discovery through an IPI0 object in the namespace, and thinks he can derive the register spacing and interrupt assignment (if any). --=20 Matt Domsch Software Architect Dell Linux Solutions linux.dell.com & www.dell.com/linux Linux on Dell mailing lists @ http://lists.us.dell.com ------_=_NextPart_001_01C759D4.3155C160 Content-Type: text/x-patch; name="rhel5.patch" Content-Transfer-Encoding: base64 Content-Description: rhel5.patch Content-Disposition: attachment; filename="rhel5.patch" LS0tIC91c3Ivc3JjL3JlZGhhdC9CVUlMRC9rZXJuZWwtMi42LjE4L2xpbnV4LTIuNi4xOC54ODZf NjQvZHJpdmVycy9jaGFyL2lwbWkvaXBtaV9zaV9pbnRmLmMJMjAwNy0wMi0yNiAxMDo0MDo1NS4w MDAwMDAwMDAgLTA2MDAKKysrIGlwbWlfc2lfaW50Zi5jCTIwMDctMDItMjYgMTI6MTA6MDUuMDAw MDAwMDAwIC0wNjAwCkBAIC0xMzcxLDYgKzEzNzEsNTggQEAgc3RhdGljIF9fZGV2aW5pdCB2b2lk IGhhcmRjb2RlX2ZpbmRfYm1jKAogICAgdGhyb3VnaCB0aGUgdGFibGVzIHNlcXVlbnRpYWxseS4g IE9uY2Ugd2UgZG9uJ3QgZmluZCBhIHRhYmxlLCB0aGVyZQogICAgYXJlIG5vIG1vcmUuICovCiBz dGF0aWMgaW50IGFjcGlfZmFpbHVyZSA9IDA7CitzdGF0aWMgYWNwaV9oYW5kbGUgYWNwaV9pcG1p X2hhbmRsZTsKKworI2RlZmluZSBBQ1BJX0lQTUlfRFJJVkVSX05BTUUgImlwbWkiCisjZGVmaW5l IEFDUElfSVBNSV9DTEFTUyAgICAgICAiaXBtaSIKKyNkZWZpbmUgQUNQSV9JUE1JX0hJRCAgICAg ICAgICJJUEkwMDAxIgorCitzdGF0aWMgaW50IGFjcGlfaXBtaV9hZGQoc3RydWN0IGFjcGlfZGV2 aWNlICopOworc3RhdGljIGludCBhY3BpX2lwbWlfcmVtb3ZlKHN0cnVjdCBhY3BpX2RldmljZSAq LCBpbnQpOworCitzdGF0aWMgc3RydWN0IGFjcGlfZHJpdmVyIGFjcGlfaXBtaV9kcml2ZXIgPSB7 CisgIC5uYW1lID0gQUNQSV9JUE1JX0RSSVZFUl9OQU1FLAorICAuY2xhc3MgPSBBQ1BJX0lQTUlf Q0xBU1MsCisg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0 YXR1cyA9IGFjcGlfZ2V0X2Zpcm13YXJlX3RhYmxlKCJTUE1JIiwgaSsxLAogCQkJCQkJIEFDUElf TE9HSUNBTF9BRERSRVNTSU5HLAo= ------_=_NextPart_001_01C759D4.3155C160 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ------_=_NextPart_001_01C759D4.3155C160 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Openipmi-developer mailing list Openipmi-developer@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openipmi-developer ------_=_NextPart_001_01C759D4.3155C160--