[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Freeipmi-users] sparc64 compilation errors

From: Anand Babu Periasamy
Subject: Re: [Freeipmi-users] sparc64 compilation errors
Date: Mon, 19 Mar 2007 05:14:54 -0700

corentin.labbe writes:
This is the patch necessary for freeipmi to compile on sparc
machines.  The solution for the typedef error is simple, don't
include <asm/io.h> because iopl,inb,outb isn't used.  For testing i
just put printf in _INB _OUTB macro, but replace it with read/write
is easy.  It's necessary to make that __ARCH_IS_SPARC__ is defined
in config.h when compiling on sparc.
Yes correct!

But now, there is an another problem. Some tools segfault when using
it.  For example i saw that smbios segfault ipmi-locate. (when
removing smbios_probe...() from ipmi-locate.c it detect nothing).
ipmi-locate is the first tool we need to get to work. If you have
already loaded kernel based IPMI modules, please unload them.
The other problem is, do my sparc have really IPMI?  The thing that
makes me thinking that is that the lm_sensors tools(sensors-detect)
say to me:
Probing for `IPMI BMC KCS' at 0xca0...                      Success!
     (confidence 4, driver `bmcsensors')
Probing for `IPMI BMC SMIC' at 0xca8...                     Success!
     (confidence 4, driver `bmcsensors')
but when i search the web for infos about ipmi on it, i don't find
anything.  I also tried to check this addresses with a home-prog and
i just read 0 value.  Same value in 0xca1 0xca2 etc.. so i think
that memory is initialized with zeroes, and so perhaps the
sensors-detect adresses!=FF test is false.

If you have any idea for helping me to know if i have really IPMI on
it.  Anyway, i hope that my works was usefull for you, i saw that
some recent sun station have IPMI.

Default IPMI KCS  port is 0x0CA2
Default IPMI SMIC port is 0x0CA9

It looks like your IPMI KCS and SMIC system interfaces is available on
non-default port addresses. GNU FreeIPMI uses DMI, SMBIOS, ACPI and
defaults to probe for system interfaces. May be SMBIOS tables are not
available on SPARC architecture. Only your BIOS vendor can confirm
this. If it is the case, we have to skip SMBIOS probe for SPARC
See if any of the following commands shows any useful info about IPMI.
# dmidecode
# bmc-info --no-probing -D KCS --driver-address=3232
# bmc-info --no-probing -D SMIC --driver-address=3240

SMIC is an alternative to KCS system interface. It is very unlikely to
implement both of them on same board. This makes the validity of
sensors-detect output suspicious. Best way to confirm is to look at
the mother board manual or ask your mother board manufacturer.
Some of Sun's system do support IPMI.

--- freeipmi-0.3.1/libfreeipmi/src/ipmi-inband.h        2006-09-13 
23:23:56.000000000 +0200
+++ /freeipmi-0.3.1/libfreeipmi/src/ipmi-inband.h      2007-03-17 
17:07:09.000000000 +0100
@@ -21,6 +21,8 @@
  #ifndef _IPMI_INBAND_H
  #define        _IPMI_INBAND_H 1

+int devport;

see below..

  #ifdef __cplusplus
  extern "C" {
@@ -40,15 +42,22 @@
  # include <sys/io.h>
  #elif defined(HAVE_ASM_IO_H)
  /* PPC */
+#ifndef __ARCH_IS_SPARC__
  # include <asm/io.h>

#if defined(__FreeBSD__)
# include <machine/cpufunc.h>
# include <machine/sysarch.h>
#elif defined(__NetBSD__) || defined(__OpenBSD__)
# include <machine/pio.h>       /* inb/outb */
# include <machine/sysarch.h>   /* sysarch call */
#elif defined(__ARCH_IS_SPARC__)
# int _fi_inband_port_fd;
#elif defined(HAVE_SYS_IO_H)

Rest of the patch is fine, except use a more reserved name
_fi_inband_port_fd instead of devport. Patch looks fine. Lets get it
to work now.
  #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
  # define _INB(port)  inb (port)
  # define _OUTB(data, port)  outb (port, data)
+#ifdef __ARCH_IS_SPARC__
+# define _INB(port)  printf ("read %d port=%d\n",devport,port)
+# define _OUTB(data, port) printf ("write %d port=%d date=%d\n",devport, 
+#else /* !__ARCH_IS_SPARC__ */
  # define _INB(port)  inb (port)
  # define _OUTB(data, port)  outb (data, port)
+#endif /* !__ARCH_IS_SPARC__*/

  #ifdef __cplusplus
--- freeipmi-0.3.1/libfreeipmi/src/ipmi-smic-api.c      2006-09-13 
23:23:56.000000000 +0200
+++ /freeipmi-0.3.1/libfreeipmi/src/ipmi-smic-api.c    2007-03-17 
16:57:21.000000000 +0100
@@ -146,7 +146,12 @@
    return (ipmi_smic_dev_io_fd == -1 ? -1 : 0);
+#ifdef __ARCH_IS_SPARC__
+devport = open("/dev/port",O_RDONLY);
+return devport;
+#else /* !__ARCH_IS_SPARC__ */
    return (iopl (3));
+#endif /* !__ARCH_IS_SPARC__ */

--- freeipmi-0.3.1/libfreeipmi/src/ipmi-kcs-api.c       2006-07-29 
19:05:22.000000000 +0200
+++ /freeipmi-0.3.1/libfreeipmi/src/ipmi-kcs-api.c     2007-03-17 
16:53:41.000000000 +0100
@@ -371,6 +371,10 @@
  #endif /* !USE_IOPERM */
  #else  /* !__FreeBSD__ */
+# ifdef __ARCH_IS_SPARC__
+devport = open("/dev/port",O_RDONLY);
+return devport;
+#else /*!__ARCH_IS_SPARC__*/
    if (iopl (3) < 0)
        if (errno == EPERM || errno == EACCES)
@@ -379,6 +383,7 @@
          ERR_LOG(ctx->errnum = IPMI_KCS_CTX_ERR_INTERNAL);
        return (-1);
+#endif /* !__ARCH_IS_SPARC__*/
  #endif/* !__FreeBSD__ */

    ctx->io_init = 1;

Anand Babu
GPG Key ID: 0x62E15A31
Blog []
The GNU Operating System []

reply via email to

[Prev in Thread] Current Thread [Next in Thread]