[PATCH 2.6.13-rc7] dcdbas: add Dell Systems Management Base Driver with sysfs support

2005-08-25 Thread Doug Warzecha
This patch adds the Dell Systems Management Base Driver with sysfs support.

This driver has been tested with Dell OpenManage.

Signed-off-by: Doug Warzecha <[EMAIL PROTECTED]>
---

diff -uprN linux-2.6.13-rc7.orig/Documentation/dcdbas.txt 
linux-2.6.13-rc7/Documentation/dcdbas.txt
--- linux-2.6.13-rc7.orig/Documentation/dcdbas.txt  1969-12-31 
18:00:00.0 -0600
+++ linux-2.6.13-rc7/Documentation/dcdbas.txt   2005-08-25 10:58:40.0 
-0500
@@ -0,0 +1,91 @@
+Overview
+
+The Dell Systems Management Base Driver provides a sysfs interface for
+systems management software such as Dell OpenManage to perform system
+management interrupts and host control actions (system power cycle or
+power off after OS shutdown) on certain Dell systems.
+
+Dell OpenManage requires this driver on the following Dell PowerEdge systems:
+300, 1300, 1400, 400SC, 500SC, 1500SC, 1550, 600SC, 1600SC, 650, 1655MC,
+700, and 750.  Other Dell software such as the open source libsmbios project
+is expected to make use of this driver, and it may include the use of this
+driver on other Dell systems.
+
+The Dell libsmbios project aims towards providing access to as much BIOS
+information as possible.  See http://linux.dell.com/libsmbios/main/ for
+more information about the libsmbios project.
+
+
+System Management Interrupt
+
+On some Dell systems, systems management software must access certain
+management information via a system management interrupt (SMI).  The SMI data
+buffer must reside in 32-bit address space, and the physical address of the
+buffer is required for the SMI.  The driver maintains the memory required for
+the SMI and provides a way for the application to generate the SMI.
+The driver creates the following sysfs entries for systems management
+software to perform these system management interrupts:
+
+/sys/devices/platform/dcdbas/smi_data
+/sys/devices/platform/dcdbas/smi_data_buf_phys_addr
+/sys/devices/platform/dcdbas/smi_data_buf_size
+/sys/devices/platform/dcdbas/smi_request
+
+Systems management software must perform the following steps to execute
+a SMI using this driver:
+
+1) Lock smi_data.
+2) Write system management command to smi_data.
+3) Write "1" to smi_request to generate a calling interface SMI or
+   "2" to generate a raw SMI.
+4) Read system management command response from smi_data.
+5) Unlock smi_data.
+
+
+Host Control Action
+
+Dell OpenManage supports a host control feature that allows the administrator
+to perform a power cycle or power off of the system after the OS has finished
+shutting down.  On some Dell systems, this host control feature requires that
+a driver perform a SMI after the OS has finished shutting down.
+
+The driver creates the following sysfs entries for systems management software
+to schedule the driver to perform a power cycle or power off host control
+action after the system has finished shutting down:
+
+/sys/devices/platform/dcdbas/host_control_action
+/sys/devices/platform/dcdbas/host_control_smi_type
+/sys/devices/platform/dcdbas/host_control_on_shutdown
+
+Dell OpenManage performs the following steps to execute a power cycle or
+power off host control action using this driver:
+
+1) Write host control action to be performed to host_control_action.
+2) Write type of SMI that driver needs to perform to host_control_smi_type.
+3) Write "1" to host_control_on_shutdown to enable host control action.
+4) Initiate OS shutdown.
+   (Driver will perform host control SMI when it is notified that the OS
+   has finished shutting down.)
+
+
+Host Control SMI Type
+
+The following table shows the value to write to host_control_smi_type to
+perform a power cycle or power off host control action:
+
+PowerEdge SystemHost Control SMI Type
+-
+  300 HC_SMITYPE_TYPE1
+ 1300 HC_SMITYPE_TYPE1
+ 1400 HC_SMITYPE_TYPE2
+  500SC   HC_SMITYPE_TYPE2
+ 1500SC   HC_SMITYPE_TYPE2
+ 1550 HC_SMITYPE_TYPE2
+  600SC   HC_SMITYPE_TYPE2
+ 1600SC   HC_SMITYPE_TYPE2
+  650 HC_SMITYPE_TYPE2
+ 1655MC   HC_SMITYPE_TYPE2
+  700 HC_SMITYPE_TYPE3
+  750 HC_SMITYPE_TYPE3
+
+
diff -uprN linux-2.6.13-rc7.orig/drivers/firmware/dcdbas.c 
linux-2.6.13-rc7/drivers/firmware/dcdbas.c
--- linux-2.6.13-rc7.orig/drivers/firmware/dcdbas.c 1969-12-31 
18:00:00.0 -0600
+++ linux-2.6.13-rc7/drivers/firmware/dcdbas.c  2005-08-25 19:01:20.0 
-0500
@@ -0,0 +1,596 @@
+/*
+ *  dcdbas.c: Dell Systems Management Base Driver
+ *
+ *  The Dell Systems Management Base Driver provides a sysfs interface for
+ *  systems management software to perform System Management Interrupts (SMIs)
+ *  and Host Control Actions (power cycle or power off after OS shutdown) on
+ *  Dell systems.
+ *
+ *  See Documentation/dcdbas.txt for more information.
+ *
+

Re: [PATCH 2.6.13-rc6] dcdbas: add Dell Systems Management Base Driver with sysfs support

2005-08-25 Thread Doug Warzecha
On Wed, Aug 24, 2005 at 08:09:09PM -0700, Chris Wedgwood wrote:
> On Wed, Aug 24, 2005 at 09:00:21PM -0500, Doug Warzecha wrote:
> 
> [...]
> 
> > +Dell OpenManage requires this driver on the following Dell PowerEdge 
> > systems:
> > +300, 1300, 1400, 400SC, 500SC, 1500SC, 1550, 600SC, 1600SC, 650, 1655MC,
> > +700, and 750.  Other Dell software such as the open source Libsmbios 
> > library
> > +is expected to make use of this driver, and it may include the use of this
> > +driver on other Dell systems.
> 
> I'd like to see a URL/pointer somewhere about here in the docs for the
> location of libsmbios if nobody objects.

No objections.  I'll add it.

Doug
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2.6.13-rc6] dcdbas: add Dell Systems Management Base Driver with sysfs support

2005-08-24 Thread Doug Warzecha
This patch adds the Dell Systems Management Base Driver with sysfs support.

This driver has been tested with Dell OpenManage.

Signed-off-by: Doug Warzecha <[EMAIL PROTECTED]>
---

diff -uprN linux-2.6.13-rc6.orig/Documentation/dcdbas.txt 
linux-2.6.13-rc6/Documentation/dcdbas.txt
--- linux-2.6.13-rc6.orig/Documentation/dcdbas.txt  1969-12-31 
18:00:00.0 -0600
+++ linux-2.6.13-rc6/Documentation/dcdbas.txt   2005-08-19 18:45:37.0 
-0500
@@ -0,0 +1,87 @@
+Overview
+
+The Dell Systems Management Base Driver provides a sysfs interface for
+systems management software such as Dell OpenManage to perform system
+management interrupts and host control actions (system power cycle or
+power off after OS shutdown) on certain Dell systems.
+
+Dell OpenManage requires this driver on the following Dell PowerEdge systems:
+300, 1300, 1400, 400SC, 500SC, 1500SC, 1550, 600SC, 1600SC, 650, 1655MC,
+700, and 750.  Other Dell software such as the open source Libsmbios library
+is expected to make use of this driver, and it may include the use of this
+driver on other Dell systems.
+
+
+System Management Interrupt
+
+On some Dell systems, systems management software must access certain
+management information via a system management interrupt (SMI).  The SMI data
+buffer must reside in 32-bit address space, and the physical address of the
+buffer is required for the SMI.  The driver maintains the memory required for
+the SMI and provides a way for the application to generate the SMI.
+The driver creates the following sysfs entries for systems management
+software to perform these system management interrupts:
+
+/sys/devices/platform/dcdbas/smi_data
+/sys/devices/platform/dcdbas/smi_data_buf_phys_addr
+/sys/devices/platform/dcdbas/smi_data_buf_size
+/sys/devices/platform/dcdbas/smi_request
+
+Systems management software must perform the following steps to execute
+a SMI using this driver:
+
+1) Lock smi_data.
+2) Write system management command to smi_data.
+3) Write "1" to smi_request to generate a calling interface SMI or
+   "2" to generate a raw SMI.
+4) Read system management command response from smi_data.
+5) Unlock smi_data.
+
+
+Host Control Action
+
+Dell OpenManage supports a host control feature that allows the administrator
+to perform a power cycle or power off of the system after the OS has finished
+shutting down.  On some Dell systems, this host control feature requires that
+a driver perform a SMI after the OS has finished shutting down.
+
+The driver creates the following sysfs entries for systems management software
+to schedule the driver to perform a power cycle or power off host control
+action after the system has finished shutting down:
+
+/sys/devices/platform/dcdbas/host_control_action
+/sys/devices/platform/dcdbas/host_control_smi_type
+/sys/devices/platform/dcdbas/host_control_on_shutdown
+
+Dell OpenManage performs the following steps to execute a power cycle or
+power off host control action using this driver:
+
+1) Write host control action to be performed to host_control_action.
+2) Write type of SMI that driver needs to perform to host_control_smi_type.
+3) Write "1" to host_control_on_shutdown to enable host control action.
+4) Initiate OS shutdown.
+   (Driver will perform host control SMI when it is notified that the OS
+   has finished shutting down.)
+
+
+Host Control SMI Type
+
+The following table shows the value to write to host_control_smi_type to
+perform a power cycle or power off host control action:
+
+PowerEdge SystemHost Control SMI Type
+-
+  300 HC_SMITYPE_TYPE1
+ 1300 HC_SMITYPE_TYPE1
+ 1400 HC_SMITYPE_TYPE2
+  500SC   HC_SMITYPE_TYPE2
+ 1500SC   HC_SMITYPE_TYPE2
+ 1550 HC_SMITYPE_TYPE2
+  600SC   HC_SMITYPE_TYPE2
+ 1600SC   HC_SMITYPE_TYPE2
+  650 HC_SMITYPE_TYPE2
+ 1655MC   HC_SMITYPE_TYPE2
+  700 HC_SMITYPE_TYPE3
+  750 HC_SMITYPE_TYPE3
+
+
diff -uprN linux-2.6.13-rc6.orig/drivers/firmware/dcdbas.c 
linux-2.6.13-rc6/drivers/firmware/dcdbas.c
--- linux-2.6.13-rc6.orig/drivers/firmware/dcdbas.c 1969-12-31 
18:00:00.0 -0600
+++ linux-2.6.13-rc6/drivers/firmware/dcdbas.c  2005-08-19 19:07:50.823719952 
-0500
@@ -0,0 +1,593 @@
+/*
+ *  dcdbas.c: Dell Systems Management Base Driver
+ *
+ *  The Dell Systems Management Base Driver provides a sysfs interface for
+ *  systems management software to perform System Management Interrupts (SMIs)
+ *  and Host Control Actions (power cycle or power off after OS shutdown) on
+ *  Dell systems.
+ *
+ *  See Documentation/dcdbas.txt for more information.
+ *
+ *  Copyright (C) 1995-2005 Dell Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License v2.0 as published 

[PATCH 2.6.13-rc6] dcdbas: add Dell Systems Management Base Driver with sysfs support

2005-08-20 Thread Doug Warzecha
This patch adds the Dell Systems Management Base Driver with sysfs support.

This patch incorporates changes based on comments from the previous posting.

Summary of changes:

* Changed permissions on sysfs files so that only owner can read.
* Changed to use __uNN/__sNN types in structs.
* smi_data_write will grow smi_data_buf if needed.
* Renamed struct callintf_cmd to struct smi_cmd.
* Renamed callintf_smi to smi_request.
* Added 2 more supported values that were requested in smi_request_store.
* Hold rtc_lock across SMI in host_control_smi.

Signed-off-by: Doug Warzecha <[EMAIL PROTECTED]>
---

diff -uprN linux-2.6.13-rc6.orig/Documentation/dcdbas.txt 
linux-2.6.13-rc6/Documentation/dcdbas.txt
--- linux-2.6.13-rc6.orig/Documentation/dcdbas.txt  1969-12-31 
18:00:00.0 -0600
+++ linux-2.6.13-rc6/Documentation/dcdbas.txt   2005-08-19 18:45:37.0 
-0500
@@ -0,0 +1,87 @@
+Overview
+
+The Dell Systems Management Base Driver provides a sysfs interface for
+systems management software such as Dell OpenManage to perform system
+management interrupts and host control actions (system power cycle or
+power off after OS shutdown) on certain Dell systems.
+
+Dell OpenManage requires this driver on the following Dell PowerEdge systems:
+300, 1300, 1400, 400SC, 500SC, 1500SC, 1550, 600SC, 1600SC, 650, 1655MC,
+700, and 750.  Other Dell software such as the open source Libsmbios library
+is expected to make use of this driver, and it may include the use of this
+driver on other Dell systems.
+
+
+System Management Interrupt
+
+On some Dell systems, systems management software must access certain
+management information via a system management interrupt (SMI).  The SMI data
+buffer must reside in 32-bit address space, and the physical address of the
+buffer is required for the SMI.  The driver maintains the memory required for
+the SMI and provides a way for the application to generate the SMI.
+The driver creates the following sysfs entries for systems management
+software to perform these system management interrupts:
+
+/sys/devices/platform/dcdbas/smi_data
+/sys/devices/platform/dcdbas/smi_data_buf_phys_addr
+/sys/devices/platform/dcdbas/smi_data_buf_size
+/sys/devices/platform/dcdbas/smi_request
+
+Systems management software must perform the following steps to execute
+a SMI using this driver:
+
+1) Lock smi_data.
+2) Write system management command to smi_data.
+3) Write "1" to smi_request to generate a calling interface SMI or
+   "2" to generate a raw SMI.
+4) Read system management command response from smi_data.
+5) Unlock smi_data.
+
+
+Host Control Action
+
+Dell OpenManage supports a host control feature that allows the administrator
+to perform a power cycle or power off of the system after the OS has finished
+shutting down.  On some Dell systems, this host control feature requires that
+a driver perform a SMI after the OS has finished shutting down.
+
+The driver creates the following sysfs entries for systems management software
+to schedule the driver to perform a power cycle or power off host control
+action after the system has finished shutting down:
+
+/sys/devices/platform/dcdbas/host_control_action
+/sys/devices/platform/dcdbas/host_control_smi_type
+/sys/devices/platform/dcdbas/host_control_on_shutdown
+
+Dell OpenManage performs the following steps to execute a power cycle or
+power off host control action using this driver:
+
+1) Write host control action to be performed to host_control_action.
+2) Write type of SMI that driver needs to perform to host_control_smi_type.
+3) Write "1" to host_control_on_shutdown to enable host control action.
+4) Initiate OS shutdown.
+   (Driver will perform host control SMI when it is notified that the OS
+   has finished shutting down.)
+
+
+Host Control SMI Type
+
+The following table shows the value to write to host_control_smi_type to
+perform a power cycle or power off host control action:
+
+PowerEdge SystemHost Control SMI Type
+-
+  300 HC_SMITYPE_TYPE1
+ 1300 HC_SMITYPE_TYPE1
+ 1400 HC_SMITYPE_TYPE2
+  500SC   HC_SMITYPE_TYPE2
+ 1500SC   HC_SMITYPE_TYPE2
+ 1550 HC_SMITYPE_TYPE2
+  600SC   HC_SMITYPE_TYPE2
+ 1600SC   HC_SMITYPE_TYPE2
+  650 HC_SMITYPE_TYPE2
+ 1655MC   HC_SMITYPE_TYPE2
+  700 HC_SMITYPE_TYPE3
+  750 HC_SMITYPE_TYPE3
+
+
diff -uprN linux-2.6.13-rc6.orig/drivers/firmware/dcdbas.c 
linux-2.6.13-rc6/drivers/firmware/dcdbas.c
--- linux-2.6.13-rc6.orig/drivers/firmware/dcdbas.c 1969-12-31 
18:00:00.0 -0600
+++ linux-2.6.13-rc6/drivers/firmware/dcdbas.c  2005-08-19 19:07:50.823719952 
-0500
@@ -0,0 +1,593 @@
+/*
+ *  dcdbas.c: Dell Systems Management Base Driver
+ *
+ *  The Dell Systems Management Base Driver provides a sysfs interface for
+ *  systems m

Re: [RFC][PATCH 2.6.13-rc6] add Dell Systems Management Base Driver (dcdbas) with sysfs support

2005-08-16 Thread Doug Warzecha
On Mon, Aug 15, 2005 at 10:52:48PM -0700, Greg KH wrote:
> On Mon, Aug 15, 2005 at 03:05:22PM -0500, Doug Warzecha wrote:
> > +
> > +1) Lock smi_data.
> > +2) Determine buffer size needed for system management command.
> > +3) Write buffer size needed to smi_data_buf_size.
> > +   (Driver will ensure that its SMI data buffer is at least that size.)
> 
> Why have this step?  Why is it needed?  Just go off of the size of the
> buffer that is written to smi_data.  Or am I missing something?

I'll change smi_data_write to do that.

> > +4) If physical address of SMI data buffer is needed to set up system
> > +   management command, read physical address from smi_data_buf_phys_addr
> > +   and add to command data.
> 
> How do you know this?

It depends on the SMI calling convention.  Dell OpenManage needs the physical 
address for the SMI to get the ESM log on the PowerEdge systems listed in this 
doc.

> > +#define DCDBAS_DEV_ATTR_RW(_name) \
> > +   DEVICE_ATTR(_name,0644,_name##_show,_name##_store);
> > +
> > +#define DCDBAS_DEV_ATTR_RO(_name) \
> > +   DEVICE_ATTR(_name,0444,_name##_show,NULL);
> 
> Why let all users read this data?

Will be changed so that only owner can read.

> > +#define DCDBAS_BIN_ATTR_RW(_name) \
> > +struct bin_attribute bin_attr_##_name = { \
> > +   .attr =  { .name = __stringify(_name), \
> > +  .mode = 0644, \
> 
> Why let everyone read this data?

Will be changed so that only owner can read.

> > +struct callintf_cmd {
> > +   u32 magic;
> 
> Why even have this?  Does it really stop anything except random
> scribblings?

It's to stop random writing.

> > +   u16 command_address;
> > +   u8 command_code;
> > +   u8 reserved;
> > +   u32 command_signature;
> > +   u8 command_buffer[1];
> > +} __attribute__ ((packed));
> 
> As these cross the userspace/kernelspace boundry, please use the __u32,
> __u16, and __u8 variable types.

Will be changed.

> > +struct apm_cmd {
> > +   u8 command;
> > +   s8 status;
> > +   u16 reserved;
> > +   union {
> > +   struct {
> > +   u8 parm[MAX_SYSMGMT_SHORTCMD_PARMBUF_LEN];
> > +   } __attribute__ ((packed)) shortreq;
> > +
> > +   struct {
> > +   u16 num_sg_entries;
> > +   struct {
> > +   u32 size;
> > +   u64 addr;
> > +   } __attribute__ ((packed))
> > +   sglist[MAX_SYSMGMT_LONGCMD_SGENTRY_NUM];
> > +   } __attribute__ ((packed)) longreq;
> > +   } __attribute__ ((packed)) parameters;
> > +} __attribute__ ((packed));
> 
> Same here (I think...)

Will be changed.

Doug

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC][PATCH 2.6.13-rc6] add Dell Systems Management Base Driver (dcdbas) with sysfs support

2005-08-15 Thread Doug Warzecha
On Mon, Aug 15, 2005 at 04:23:37PM -0400, Kyle Moffett wrote:
> On Aug 15, 2005, at 16:05:22, Doug Warzecha wrote:
> >This patch adds the Dell Systems Management Base Driver with sysfs  
> >support.
> 
> >+On some Dell systems, systems management software must access certain
> >+management information via a system management interrupt (SMI).   
> >The SMI data
> >+buffer must reside in 32-bit address space, and the physical  
> >address of the
> >+buffer is required for the SMI.  The driver maintains the memory  
> >required for
> >+the SMI and provides a way for the application to generate the SMI.
> >+The driver creates the following sysfs entries for systems management
> >+software to perform these system management interrupts:
> 
> Why can't you just implement the system management actions in the kernel
> driver?

We want to minimize the amount of code in the kernel and avoid having to update 
the driver each time a new system management command is added.

> This is tantamount to a binary SMI hook to userspace.  What
> functionality does this provide on a dell system from an administrator's
> point of view?

The libsmbios project is being updated to use this code.  
http://linux.dell.com/libsmbios/main/.  Using the libsmbios code, you will be 
able to set all of the options in BIOS F2 screen from Linux userspace.  Also, 
libsmbios is looking at implementing a few other things like fan status.  
Libsmbios is 100% open-source (OSL/GPL dual license).

> >+Host Control Action
> >+
> >+Dell OpenManage supports a host control feature that allows the  
> >administrator
> >+to perform a power cycle or power off of the system after the OS  
> >has finished
> >+shutting down.  On some Dell systems, this host control feature  
> >requires that
> >+a driver perform a SMI after the OS has finished shutting down.
> >+
> >+The driver creates the following sysfs entries for systems  
> >management software
> >+to schedule the driver to perform a power cycle or power off host  
> >control
> >+action after the system has finished shutting down:
> >+
> >+/sys/devices/platform/dcdbas/host_control_action
> >+/sys/devices/platform/dcdbas/host_control_smi_type
> >+/sys/devices/platform/dcdbas/host_control_on_shutdown
> 
> How is this different from shutdown() or reboot()?

The power cycle feature of the system powers off the system for a few seconds 
and then powers the system back on without user intervention.  shutdown() and 
reboot() don't provide that feature.

> What exactly is smi_type used for?  Please provide better documentation
> on how to use this and what it does.

The method of generating a host control SMI is not exactly the same for each 
PowerEdge system listed in dcdbas.txt.  host_control_smi_type tells the driver 
how to generate the host control SMI for the system in use.  I'll update 
dcdbas.txt with the SMI type value associated with the systems listed in that 
file.

> If this is supposed to be used with the RBU code to trigger a BIOS  
> update, ...

This driver is not needed by the RBU code.

Doug
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC][PATCH 2.6.13-rc6] add Dell Systems Management Base Driver (dcdbas) with sysfs support

2005-08-15 Thread Doug Warzecha
This patch adds the Dell Systems Management Base Driver with sysfs support.

This driver has been tested with Dell OpenManage.

Signed-off-by: Doug Warzecha <[EMAIL PROTECTED]>
---
diff -uprN linux-2.6.13-rc6.orig/Documentation/dcdbas.txt 
linux-2.6.13-rc6/Documentation/dcdbas.txt
--- linux-2.6.13-rc6.orig/Documentation/dcdbas.txt  1969-12-31 
18:00:00.0 -0600
+++ linux-2.6.13-rc6/Documentation/dcdbas.txt   2005-08-15 14:07:21.0 
-0500
@@ -0,0 +1,71 @@
+Overview
+
+The Dell Systems Management Base Driver provides a sysfs interface for
+systems management software such as Dell OpenManage to perform system
+management interrupts and host control actions (system power cycle or
+power off after OS shutdown) on certain Dell systems.
+
+Dell OpenManage requires this driver on the following Dell PowerEdge systems:
+300, 1300, 1400, 400SC, 500SC, 1500SC, 1550, 600SC, 1600SC, 650, 1655MC,
+700, and 750.  Other Dell software such as the open source Libsmbios library
+is expected to make use of this driver, and it may include use on other Dell
+systems.
+
+
+System Management Interrupt
+
+On some Dell systems, systems management software must access certain
+management information via a system management interrupt (SMI).  The SMI data
+buffer must reside in 32-bit address space, and the physical address of the
+buffer is required for the SMI.  The driver maintains the memory required for
+the SMI and provides a way for the application to generate the SMI.
+The driver creates the following sysfs entries for systems management
+software to perform these system management interrupts:
+
+/sys/devices/platform/dcdbas/smi_data
+/sys/devices/platform/dcdbas/smi_data_buf_phys_addr
+/sys/devices/platform/dcdbas/smi_data_buf_size
+/sys/devices/platform/dcdbas/callintf_smi
+
+Systems management software must perform the following steps to execute
+a SMI using this driver:
+
+1) Lock smi_data.
+2) Determine buffer size needed for system management command.
+3) Write buffer size needed to smi_data_buf_size.
+   (Driver will ensure that its SMI data buffer is at least that size.)
+4) If physical address of SMI data buffer is needed to set up system
+   management command, read physical address from smi_data_buf_phys_addr
+   and add to command data.
+5) Write system management command to smi_data.
+6) Write "1" to callintf_smi to generate a calling interface SMI.
+7) Read system management command response from smi_data.
+8) Unlock smi_data.
+
+
+Host Control Action
+
+Dell OpenManage supports a host control feature that allows the administrator
+to perform a power cycle or power off of the system after the OS has finished
+shutting down.  On some Dell systems, this host control feature requires that
+a driver perform a SMI after the OS has finished shutting down.
+
+The driver creates the following sysfs entries for systems management software
+to schedule the driver to perform a power cycle or power off host control
+action after the system has finished shutting down:
+
+/sys/devices/platform/dcdbas/host_control_action
+/sys/devices/platform/dcdbas/host_control_smi_type
+/sys/devices/platform/dcdbas/host_control_on_shutdown
+
+Dell OpenManage performs the following steps to execute a power cycle or
+power off host control action using this driver:
+
+1) Write host control action to be performed to host_control_action.
+2) Write type of SMI that driver needs to perform to host_control_smi_type.
+3) Write "1" to host_control_on_shutdown to enable host control action.
+4) Initiate OS shutdown.
+   (Driver will perform host control SMI when it is notified that the OS
+   has finished shutting down.)
+
+
diff -uprN linux-2.6.13-rc6.orig/drivers/firmware/dcdbas.c 
linux-2.6.13-rc6/drivers/firmware/dcdbas.c
--- linux-2.6.13-rc6.orig/drivers/firmware/dcdbas.c 1969-12-31 
18:00:00.0 -0600
+++ linux-2.6.13-rc6/drivers/firmware/dcdbas.c  2005-08-15 14:07:32.0 
-0500
@@ -0,0 +1,601 @@
+/*
+ *  dcdbas.c: Dell Systems Management Base Driver
+ *
+ *  The Dell Systems Management Base Driver provides a sysfs interface for
+ *  systems management software to perform System Management Interrupts (SMIs)
+ *  and Host Control Actions (power cycle or power off after OS shutdown) on
+ *  Dell systems.
+ *
+ *  See Documentation/dcdbas.txt for more information.
+ *
+ *  Copyright (C) 1995-2005 Dell Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License v2.0 as published by
+ *  the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#inc

Re: [PATCH] char: Add Dell Systems Management Base driver

2005-07-12 Thread Doug Warzecha
On Wed, Jul 06, 2005 at 11:07:37AM -0500, Greg KH wrote:
>On Wed, Jul 06, 2005 at 10:57:35AM -0500, Doug Warzecha wrote:
>> On Tue, Jul 05, 2005 at 11:17:03PM -0500, Greg KH wrote:
>> >
>> >I'm sure I commented on this driver already, yet, I never got a
>response
>> >and the code is not changed.  Is there some reason for this? 
>That's a
>> >sure way to prevent your patch from ever being applied...
>>
>> This is the first comment on the release function.  The code has been
>> changing in response to comments from you and others.  We'll continue
>> to make changes as needed.
> 
>You never responded to those questions though, so determining if the
>code was changed is difficult.  And I still see you using ioctls, which,
>if I remember, was what I asked about.
> 

The dcdbas driver has been shipping outside of the kernel tree for some time 
now in support of the systems listed in the source and is expected to support 
the listed systems for some time to come.  The driver has always used ioctls 
for Dell systems management software to communicate with it.  The systems that 
are supported by the driver are older Dell PowerEdge systems which contain Dell 
proprietary hardware systems management interfaces.  The latest shipping 
PowerEdge systems support the standard IPMI hardware systems management 
interface which can be accessed by the in-kernel standard IPMI driver (which 
uses ioctls).  Future PowerEdge systems are expected to support the IPMI 
systems management interface as well.

Even though the dcdbas driver is not expected to be needed for future PowerEdge 
systems, we would like to make it easier for Dell customers to run Dell systems 
management software with the latest kernel on the systems supported by the 
dcdbas driver by making the driver available in the kernel tree.  We would like 
to do that without impacting the existing Dell systems management software for 
the older systems so that we can focus our resources on the newer systems.

Is it an absolute "must" that this driver not use ioctls?

Doug
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] char: Add Dell Systems Management Base driver

2005-07-12 Thread Doug Warzecha
On Tue, Jul 05, 2005 at 07:53:20PM -0500, Chris Wedgwood wrote:
>On Tue, Jul 05, 2005 at 07:13:34PM -0500, Doug Warzecha wrote:
> 
>> This patch adds the Dell Systems Management Base driver.
> 
>You keep posting this driver without explaining/showing how it's used.
>Could you perhaps give some more details here please?

Here's some more information on the driver and the systems that it supports.  
Because the hardware interfaces on those systems and the Dell systems 
management software that access the interfaces are proprietary, I can't provide 
specifications for the interfaces or source code for the software.

The systems that are supported by the dcdbas driver contain the following Dell 
proprietary hardware systems management interfaces:  Temperature Voltage 
Monitor (TVM) and Calling Interface.  These interfaces are supported by older 
Dell PowerEdge systems.  The latest shipping PowerEdge systems support the 
standard IPMI hardware systems management interface which can be accessed by 
the in-kernel standard IPMI driver on Linux.  Future PowerEdge systems are 
expected to support the IPMI systems management interface as well.

The Dell TVM and Calling Interface interfaces are accessed through the use of 
Systems Management Interrupts.  The dcdbas driver acts primarily as a 
pass-through mechanism for Dell systems management software to generate those 
interrupts.  Dell systems management software (which is proprietary) loads and 
uses the driver if it is needed.  The dcdbas driver provides access to the TVM 
and Calling Interface systems management interfaces through the use of ioctls.

Here is a brief description of each ioctl request that is supported:

ESM_TVM_ALLOC_MEM - used to allocate a buffer for systems management requests 
on systems that contain the TVM systems management interface.  The physical 
address of the buffer is needed to generate the request.

ESM_TVM_WRITE_MEM - used to put systems management request data in the TVM 
buffer.  After this is done, Dell systems management software generates the 
request.

ESM_TVM_READ_MEM - used to get systems management response data from the TVM 
buffer after the systems management request has completed.

ESM_CALLINTF_REQ - used to generate a systems management request on systems 
that contain the Calling Interface systems management interface.

ESM_TVM_HC_ACTION - used to tell the driver what host control action to perform 
on systems that contain the TVM systems management interface.

ESM_HOLD_OS_ON_SHUTDOWN - used to tell the driver to perform the previously set 
host control action when it is notified that the OS has finished shutting down. 
 Dell systems management software initiates the OS shutdown after this request.

ESM_CANCEL_HOLD_OS_ON_SHUTDOWN - used to cancel ESM_HOLD_OS_ON_SHUTDOWN if the 
systems management software encounters a problem in the host control process.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] char: Add Dell Systems Management Base driver

2005-07-06 Thread Doug Warzecha
On Tue, Jul 05, 2005 at 11:17:03PM -0500, Greg KH wrote:
>> +static void dcdbas_device_release(struct device *dev)
>> +{
>> + /* nothing to release */
>> +}
> 
>This is a symptom of a broken driver.
> 
>Hm, I wonder if there's some way for the compiler to check the fact that
>a function pointer passed to another function, is really a null
>function.  That would stop this kind of nonsense...

There are other drivers in the kernel tree with null device release functions.

> 
>I'm sure I commented on this driver already, yet, I never got a response
>and the code is not changed.  Is there some reason for this?  That's a
>sure way to prevent your patch from ever being applied...

This is the first comment on the release function.  The code has been changing 
in response to comments from you and others.  We'll continue to make changes as 
needed.

Doug
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] char: Add Dell Systems Management Base driver

2005-07-06 Thread Doug Warzecha
On Wed, Jul 06, 2005 at 09:07:37AM -0700, Greg KH wrote:
> On Wed, Jul 06, 2005 at 10:57:35AM -0500, Doug Warzecha wrote:
> > On Tue, Jul 05, 2005 at 11:17:03PM -0500, Greg KH wrote:
> > >> +static void dcdbas_device_release(struct device *dev)
> > >> +{
> > >> + /* nothing to release */
> > >> +}
> > > 
> > >This is a symptom of a broken driver.
> > > 
> > >Hm, I wonder if there's some way for the compiler to check the fact 
> > > that
> > >a function pointer passed to another function, is really a null
> > >function.  That would stop this kind of nonsense...
> > 
> > There are other drivers in the kernel tree with null device release 
> > functions.
> 
> Where?

Here's a couple:

drivers/video/vfb.c: vfb_platform_release
drivers/video/epson1355fb.c: epson1355fb_platform_release

Doug
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] char: Add Dell Systems Management Base driver

2005-07-05 Thread Doug Warzecha
This patch adds the Dell Systems Management Base driver.

The Dell Systems Management Base driver is a character driver that
implements ioctls for Dell systems management software to use to
communicate with the driver.  The driver provides support for Dell
systems management software to manage the following Dell PowerEdge
systems: 300, 1300, 1400, 400SC, 500SC, 1500SC, 1550, 600SC, 1600SC,
650, 1655MC, 700, and 750.

By making a contribution to this project, I certify that:
The contribution was created in whole or in part by me and
I have the right to submit it under the open source license
indicated in the file.

Signed-off-by: Doug Warzecha <[EMAIL PROTECTED]>
---

diff -uprN linux-2.6.13-rc1.orig/drivers/char/dcdbas.c 
linux-2.6.13-rc1/drivers/char/dcdbas.c
--- linux-2.6.13-rc1.orig/drivers/char/dcdbas.c 1969-12-31 18:00:00.0 
-0600
+++ linux-2.6.13-rc1/drivers/char/dcdbas.c  2005-07-05 10:26:22.355056432 
-0500
@@ -0,0 +1,777 @@
+/*
+ *  dcdbas.c: Dell Systems Management Base Driver
+ *
+ *  Copyright (C) 1995-2005 Dell Inc.
+ *
+ *  The Dell Systems Management Base driver is a character driver that
+ *  implements ioctls for Dell systems management software to use to
+ *  communicate with the driver.  The driver provides support for Dell
+ *  systems management software to manage the following Dell PowerEdge
+ *  systems: 300, 1300, 1400, 400SC, 500SC, 1500SC, 1550, 600SC, 1600SC,
+ *  650, 1655MC, 700, and 750.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License v2.0 as published by
+ *  the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "dcdbas.h"
+
+#define DRIVER_NAME"dcdbas"
+#define DRIVER_VERSION "5.6.0-1"
+#define DRIVER_DESCRIPTION "Systems Management Base Driver"
+
+static int driver_major;
+static atomic_t hold_on_shutdown;
+static struct semaphore tvm_lock;
+static u8 *tvm_dma_buf;
+static dma_addr_t tvm_dma_buf_handle;
+static u32 tvm_dma_buf_phys_addr;
+static unsigned int tvm_dma_buf_size;
+static u8 tvm_hc_action;
+static u8 tvm_smi_type;
+
+/**
+ * dcdbas_device_release - device release method
+ * @dev: device
+ */
+static void dcdbas_device_release(struct device *dev)
+{
+   /* nothing to release */
+}
+
+static struct platform_device dcdbas_pdev = {
+   .name = DRIVER_NAME,
+   .id   = -1,
+   .dev  = {
+   .coherent_dma_mask = DMA_32BIT_MASK,
+   .dma_mask  = &dcdbas_pdev.dev.coherent_dma_mask,
+   .release   = dcdbas_device_release,
+   },
+};
+
+/**
+ * tvm_free_dma_buf - free buffer allocated for TVM systems management
+ */
+static void tvm_free_dma_buf(void)
+{
+   if (tvm_dma_buf == NULL)
+   return;
+
+   dev_dbg(&dcdbas_pdev.dev, "%s: phys: %x size: %u\n",
+   __FUNCTION__, tvm_dma_buf_phys_addr, tvm_dma_buf_size);
+
+   dma_free_coherent(&dcdbas_pdev.dev, tvm_dma_buf_size, tvm_dma_buf,
+   tvm_dma_buf_handle);
+   tvm_dma_buf = NULL;
+   tvm_dma_buf_handle = 0;
+   tvm_dma_buf_phys_addr = 0;
+   tvm_dma_buf_size = 0;
+}
+
+/**
+ * tvm_realloc_dma_buf - reallocate buffer for TVM systems management if needed
+ * @size: size of memory needed
+ */
+static int tvm_realloc_dma_buf(unsigned int size)
+{
+   u8 *buf;
+   dma_addr_t handle;
+
+   if (size > MAX_TVM_DMA_BUF_SIZE)
+   return -EINVAL;
+
+   if (tvm_dma_buf_size >= size) {
+   if ((size != 0) && (tvm_dma_buf == NULL)) {
+   dev_dbg(&dcdbas_pdev.dev,
+   "%s: corruption detected\n", __FUNCTION__);
+   return -EFAULT;
+   }
+
+   /* current buffer is big enough */
+   return 0;
+   }
+
+   /* new buffer is needed */
+   buf = dma_alloc_coherent(&dcdbas_pdev.dev, size, &handle, GFP_KERNEL);
+   if (buf == NULL) {
+   dev_info(&dcdbas_pdev.dev,
+   "failed to allocate memory of size %u for TVM\n",
+   size);
+   return -ENOMEM;
+   }
+
+   /* free any existing buffer */
+   tvm_free_dma_buf();
+
+   /* set up new buffer for use */
+   tvm_dma_buf = buf;
+   tvm_dma_buf_handle = handle;
+   tvm_dma_buf_phys_addr = (u32)virt_to_phys(buf);
+