From ast@marabu.ch  Sun May 22 13:56:05 2005
Return-Path: <ast@marabu.ch>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8C1D716A41C;
	Sun, 22 May 2005 13:56:05 +0000 (GMT)
	(envelope-from ast@marabu.ch)
Received: from oneplusone.ch (oneplusone.ch [212.55.208.170])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B927E43D1D;
	Sun, 22 May 2005 13:56:04 +0000 (GMT)
	(envelope-from ast@marabu.ch)
Received: from oneplusone.ch (localhost [127.0.0.1])
	by oneplusone.ch (8.13.3/8.13.3) with ESMTP id j4MDu2Ex058405
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sun, 22 May 2005 15:56:02 +0200 (CEST)
	(envelope-from ast@marabu.ch)
Received: (from uucp@localhost)
	by oneplusone.ch (8.13.3/8.13.3/Submit) with UUCP id j4MDu2tP058404;
	Sun, 22 May 2005 15:56:02 +0200 (CEST)
	(envelope-from ast@marabu.ch)
Received: from pano.marabu.ch (localhost [127.0.0.1])
	by pano.marabu.ch (8.13.3/8.13.3) with ESMTP id j4MDmP8R014806;
	Sun, 22 May 2005 15:48:25 +0200 (CEST)
	(envelope-from ast@pano.marabu.ch)
Received: (from ast@localhost)
	by pano.marabu.ch (8.13.3/8.13.3/Submit) id j4MDmPXi014805;
	Sun, 22 May 2005 15:48:25 +0200 (CEST)
	(envelope-from ast)
Message-Id: <200505221348.j4MDmPXi014805@pano.marabu.ch>
Date: Sun, 22 May 2005 15:48:25 +0200 (CEST)
From: Adrian Steinmann <ast@marabu.ch>
Reply-To: Adrian Steinmann <ast@marabu.ch>
To: FreeBSD-gnats-submit@freebsd.org
Cc: phk@freebsd.org
Subject: [patch] generic bios_string for GPIO/watchdog on Soekris/PCEngines/Advantech
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         81360
>Category:       kern
>Synopsis:       [patch] generic bios_string for GPIO/watchdog on Soekris/PCEngines/Advantech
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 22 14:00:23 GMT 2005
>Closed-Date:    Thu Jul 21 09:49:02 GMT 2005
>Last-Modified:  Thu Jul 21 09:49:02 GMT 2005
>Originator:     Adrian Steinmann
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
Webgroup Consulting AG
>Environment:
System: FreeBSD pano.marabu.ch 5.4-STABLE FreeBSD 5.4-STABLE #1: Sun May 8 10:51:49 CEST 2005 root@pano.marabu.ch:/r/usr/obj/usr/src/sys/PANO i386

Tested on platforms which use the Geode or Elan processors; i.e.:
	Soekris net45xx and net4801 platforms
	Advantech PCM-582x platforms
	PC Engines WRAP
>Description:
	i386/geode.c wasn't finding the PC Engines signature, the second
	argument needs to be > 0xf9000 in the call:

	    bios_string(0xf9000, 0xf9000, "PC Engines WRAP.1C ", 0)

	Fixing this, I found it to be nice for bios_string to work
	more generically to find other info in the BIOS OEM area.

	As another side effect, watchdog() is now supported on
	Advantech boxes when options CPU_GEODE is specified in
	the kernel config.

>How-To-Repeat:
	boot kernel with options CPU_SOEKRIS and options CPU_GEODE
	on PC Engines platforms
>Fix:

The patches (files.i386 too different in RELENG_5/HEAD) at

    http://webgroup.ch/FreeBSD/bios_oem_strings.patch_HEAD
    http://webgroup.ch/FreeBSD/bios_oem_strings.patch_RELENG_5

now positively identify specific CPU_GEODE and CPU_ELAN platforms, i.e.:

Elan-mmcr Soekris net45xx comBIOS ver. 1.26a 20040819 Copyright (C) 2000-2004
Geode Soekris net4801 comBIOS ver. 1.27a 20041206 Copyright (C) 2000-2004
Geode PCM-5823 BIOS V1.12 (08/12/2002) 06/07/2002-GXm-Cx5530-2A434AKCC-00
Geode PC Engines WRAP.1C v1.03 tinyBIOS V1.4a (C)1997-2003

These dmesg strings are emitted at boot time and are also used in
i386/geode.c and i386/elan-mmcr.c for controlling the logic of GPIO
device configuration. The undocumented bios_string() is replaced
by a more generic bios_oem_strings(9) routine, now documented in
bios(9).

As a side effect, watchdog(8) is now easily supported on Advantech
PCM-582x platforms when options CPU_GEODE is specified in the kernel
config.

PS. There was a recent thread on this in -hackers starting at
Message-ID: <17037.14274.229768.369886@zaphod.home.loc>
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Thu Jul 21 09:48:47 GMT 2005 
State-Changed-Why:  
Committed with minor changes. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=81360 
>Unformatted:
