GNU/Linux on a Soekris net4801

Henrik Brix Andersen

Revision History
Revision 0.2.3 2005-09-04 HBA
Added note about disabling other gettys
Revision 0.2.2 2005-07-22 HBA
Updated lm_sensors configuration
Revision 0.2.1 2005-07-20 HBA
Added further instructions for lm_sensors
Revision 0.2.0 2005-07-08 HBA
Updated for linux-2.6.12
Revision 0.1.3 2005-03-03 HBA
Updated for linux-2.6.11
Revision 0.1.3 2005-02-26 HBA
  • Use init=3 for the PC87366 chip to enable Vbat (in9)

  • Updated sensors.conf

Revision 0.1.2 2005-02-24 HBA
Fixed minor typos
Revision 0.1.1 2005-02-24 HBA
Use init=2 for the PC87366 chip
Revision 0.1.0 2005-02-24 HBA
Initial revision

Abstract

This document describes the process of configuring GNU/Linux for the Soekris net4801.

The document is also available as plain text. The Docbook XML source from which it was created is available as well. The latest version of this document can be obtained from www.brixandersen.dk.


Table of Contents

1. Introduction
1.1. Copyright and License
1.2. Disclaimer
1.3. Thanks
1.4. Feedback
2. The Soekris net4801
3. Kernel Configuration
3.1. CPU and Architecture
3.2. IDE Chipset
3.3. Ethernet Ports
3.4. USB Port
3.5. Serial Ports
3.6. General Purpose I/O
3.7. Error LED
3.8. Hardware Watchdog
3.9. Temperature and Voltage Monitor
3.10. Real Time Clock
4. Conclusion
5. Related Links

1. Introduction

This document describes my experiences with configuring GNU/Linux to run on the Soekris net4801. The document covers how to boot Linux on the net4801 and how set up the kernel for the specific hardware found in the net4801. A certain amount of experience with kernel configuration is required.

Although the instructions in this document are based on my experiences with Gentoo Linux it should be fairly trivial to use them with any other Linux distribution. I've tried to be as general as possible and left out distribution specific instructions.

1.1. Copyright and License

This document is copyrighted © 2005 by Henrik Brix Andersen. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is available at http://www.gnu.org/copyleft/fdl.html.

Linux is a registered trademark of Linus Torvalds.

1.2. Disclaimer

No liability for the contents of this document can be accepted. Use the concepts, examples and information at your own risk. There may be errors and inaccuracies, that could be damaging to your system. Proceed with caution, and although this is highly unlikely, the author(s) do not take any responsibility.

All copyrights are held by their by their respective owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Naming of particular products or brands should not be seen as endorsements.

1.3. Thanks

I would like to thank pil.dk for sponsoring my work on this project. If you need hosting you should consider contacting them.

1.4. Feedback

Feedback is most certainly welcome for this document. Send your additions, comments and criticisms to the following email address: .

2. The Soekris net4801

The Soekris net4801 has the configuration shown in the output of the lspci utility from pciutils in Figure 1.

# lspci
0000:00:00.0 Host bridge: Cyrix Corporation PCI Master
0000:00:06.0 Ethernet controller: National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller
0000:00:07.0 Ethernet controller: National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller
0000:00:08.0 Ethernet controller: National Semiconductor Corporation DP83815 (MacPhyter) Ethernet Controller
0000:00:12.0 ISA bridge: National Semiconductor Corporation SC1100 Bridge
0000:00:12.1 Bridge: National Semiconductor Corporation SC1100 SMI
0000:00:12.2 IDE interface: National Semiconductor Corporation SCx200 IDE (rev 01)
0000:00:12.5 Bridge: National Semiconductor Corporation SC1100 XBus
0000:00:13.0 USB Controller: Compaq Computer Corporation ZFMicro Chipset USB (rev 08)

Figure 1. Output of the lspci command


Note

The lscpi utility reports the ethernet controllers to be DP83815s, but they're actually DP83816s.

3. Kernel Configuration

This section describes how to configure a Linux kernel version 2.6.x for the hardware of the net4801. The instructions found in this revision of the document has been tested with linux-2.6.12. Only options closely related to the net4801 specific hardware are mentioned; which options to enable apart from those are beyond the scope of this document.

If you use a kernel earlier than 2.6.12, you will need to apply my patch for determining the Configuration Block address at run-time. This patch was included upstream in linux-2.6.12.

My latest kernel .config file can be found at my web site.

3.1. CPU and Architecture

The Geode SC1100 processor is an i586 class CPU with MMX (also referred to as Pentium MMX). You need to enable the kernel option listed below to support the CPU and architecture of the net4801.

  • Subarchitecture Type (PC-compatible) (CONFIG_X86_PC)

  • Processor family (GeodeGX1) (CONFIG_MGEODEGX1)

  • PCI support (CONFIG_PCI)

  • PCI device name database (CONFIG_PCI_NAMES)

  • ISA support (CONFIG_ISA)

  • NatSemi SCx200 support (CONFIG_SCx200)

3.1.1. Suspend Modulation

To enable the Suspend Modulation feature of the Geode SC1100 processor you need the kernel options listed below.

  • CPU Frequency scaling (CONFIG_CPU_FREQ)

  • Cyrix MediaGX/NatSemi Geode Suspend Modulation (CONFIG_X86_GX_SUSPMOD)

3.2. IDE Chipset

If you intend to use the onboard IDE controller (HDD and/or Compact Flash) you will need the kernel options listed below. Please note that the Compact Flash is not hot-pluggable.

  • ATA/ATAPI/MFM/RLL support (CONFIG_IDE)

  • Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support (CONFIG_BLK_DEV_IDE)

  • Include IDE/ATA-2 DISK support (CONFIG_BLK_DEV_IDEDISK)

  • PCI IDE chipset support (CONFIG_BLK_DEV_IDEPCI)

  • Sharing PCI IDE interrupts support (CONFIG_IDEPCI_SHARE_IRQ)

  • Generic PCI bus-master DMA support (CONFIG_BLK_DEV_IDEDMA_PCI)

  • Use PCI DMA by default when available (CONFIG_IDEDMA_PCI_AUTO)

  • National SCx200 chipset support (CONFIG_BLK_DEV_SC1200)

3.3. Ethernet Ports

To enable the 3 ethernet ports of the net4801 you need the kernel options listed below.

  • Ethernet (10 or 100Mbit) (CONFIG_NET_ETHERNET)

  • Generic Media Independent Interface device support (CONFIG_MII)

  • EISA, VLB, PCI and on board controllers (CONFIG_NET_PCI)

  • National Semiconductor DP8381x series PCI Ethernet support (CONFIG_NATSEMI)

3.4. USB Port

To enable the USB port of the net4801 you need the kernel options listed below along with drivers for the devices you plan to attach.

  • Support for Host-side USB (CONFIG_USB)

  • OHCI HCD support (CONFIG_USB_OHCI_HCD)

3.5. Serial Ports

To enable the two serial ports of the net4801 you need the kernel options below.

  • 8250/16550 and compatible serial support (CONFIG_SERIAL_8250)

  • Maximum number of non-legacy 8250/16550 serial ports (2) (CONFIG_SERIAL_8250_NR_UARTS)

3.5.1. Serial Console

If you want to have a console on the serial port you will need the kernel option listed below.

  • Console on 8250/16550 and compatible serial port (CONFIG_SERIAL_8250_CONSOLE)

You also need to instruct the kernel to use the serial port for console as shown in Figure 2. For more information see the documentation for the kernel and your boot loader.

console=ttyS0,19200n8

Figure 2. Kernel command line argument for serial console


Most boot loaders supports console on a serial port as well. Instructions for setting up GNU GRUB can be seen in Figure 3. For more information see the documentation for your boot loader.

serial --unit=0 --speed=19200 --word=8 --parity=no --stop=1
terminal serial

Figure 3. /boot/grub/grub.conf setup for serial console


Finally you will need to tell /sbin/init to spawn a login on the serial console. An example for this using /sbin/agetty can be seen in Figure 4. You should comment out the other terminal entries in /etc/inittab to avoid spawning unnecessary gettys.

s0:12345:respawn:/sbin/agetty 19200 ttyS0 vt100

Figure 4. /etc/inittab entry for serial console


Note

Make sure the baud rate set in the BIOS, GRUB, the Linux kernel and inittab are identical or you will end up with garbage on your console during part of the boot process.

3.6. General Purpose I/O

The GPIO of the net4801 is controlled through the PC87366 SuperI/O chip from Winbond/National Semiconductor. There is no in-kernel driver for controlling the GPIO yet, but Martin Hejl and Stanislav Meduna has written one. It doesn't play too well with the in-kernel SCx200 drivers, though. Jim Cromie has written a more generic GPIO driver for the PC87366 chip.

3.7. Error LED

The error LED is connected to GPIO20 on the SC1100 processor. To control it from user-space you need the kernel option listed below.

  • NatSemi SCx200 GPIO Support (CONFIG_SCx200_GPIO)

You will need to create a device entry for the error LED using the command mknod -m 600 /dev/error_led c 254 20. You can then control the LED by echoing either 0 or 1 to the /dev/error_led device node.

3.8. Hardware Watchdog

To enable the hardware watchdog you need the kernel options listed below. You will also need a user-space utility such as watchdog.

  • Watchdog Timer Support (CONFIG_WATCHDOG)

  • National Semiconductor SCx200 Watchdog (CONFIG_SCx200_WDT)

3.9. Temperature and Voltage Monitor

To enable the temperature and voltage monitor of the net4801 you need the kernel options listed below.

  • I2C support (CONFIG_I2C)

  • National Semiconductor PC87360 family (CONFIG_SENSORS_PC87360)

You need to pass at least init=1 to the pc87360 driver or you wont get any readings. See Table 1 for a list of valid initialization levels. Beware that repeatedly sampling in9 will reduce battery lifetime, more information is available in the pc87360 file included with lm_sensors.

Value Description
0 None
1 Forcibly enable internal voltage and temperature channels, except in9
2 Forcibly enable all voltage and temperature channels, except in9
3 Forcibly enable all voltage and temperature channels, including in9

Table 1. PC87360 initialization level


You will also need the user-space utility lm_sensors version 2.9.1 or newer. You should add contents similar to that of Figure 5 to /etc/sensors.conf.

The setup shown is partly based on the PC87366 datasheet and partly borrowed from Poul-Henning Kamp's env4801 utility since Soekris Engineering have yet to release any information about the external voltage dividers and recommended operating conditions. I have contacted Soekris Engineering about this, but I haven't heard anything from them yet.

chip "pc87366-*"

# Soekris net4801 configuration

# Written by Henrik Brix Andersen 
# Latest version can be found at http://www.brixandersen.dk/

# The configuration is partly based on the PC87366 datasheet and
# partly borrowed from the env4801 utility by Poul-Henning
# Kamp 

# Datasheet: http://www.winbond.com/PDF/APCsheet/PC87366.pdf
# env4801:   http://phk.freebsd.dk/soekris/env4801/


# Voltage inputs
  ignore vid

  # Unknown
  # label in0     "avi0"
  ignore in0


  # Core Voltage, +2.0V
  label in1     "VCORE"
  set in1_min   1.9
  set in1_max   2.1


  # VCC, +5.0V
  label in2     "VCC"
  compute in2   @*2, @/2


  # Power Supply Input, +6.0V - +28.0V
  label in3     "VPWR"
  compute in3   @*20.1, @/20.1
  set in3_min    6.0
  set in3_max   28.0


  # +12V
  label in4     "+12V"
  compute in4   @*4.83, @/4.83
  set in4_min   11
  set in4_max   13


  # -12V
  label in5     "-12V"
  # If in10 on your net4801 doesn't have the 3.3V reference, use this
  # compute line instead:
  # compute in5   (@-3.3)*19.2+3.3, (@-3.3)/19.2+3.3
  compute in5   (@-in10)*19.2+in10, (@-in10)/19.2+in10
  set in5_min   -13
  set in5_max   -11


  # GND, 0V
  label in6     "GND"
  set in6_min   0
  set in6_max   0


  # Standby Voltage, +3.3V
  # Internally divided by 2
  label in7     "Vsb"
  compute in7   @*2, @/2
  set in7_min    3.0
  set in7_max    3.6


  # Supply Voltage, +3.3V
  # Internally divided by 2
  label in8     "Vdd"
  compute in8   @*2, @/2
  set in8_min    3.0
  set in8_max    3.6


  # Battery Backup Supply Voltage, +3.0V
  label in9     "Vbat"
  set in9_min    2.4
  set in9_max    3.6


  # Analog Supply Voltage, +3.3V
  # Internally divided by 2
  label in10    "AVdd"
  compute in10  @*2, @/2
  set in10_min   3.0
  set in10_max   3.6


# Temperature inputs
  ignore temp1
  ignore temp2

  # PC87366 Internal Temperature
  # PC87366 Recommended Operating Conditions: 0 - 70C
  # SC1100  Recommended Operating Conditions: 0 - 85C
  label temp3       "Temp"
  label temp3_crit  "Critical"
  set temp3_min      0
  set temp3_max     70
  set temp3_crit    85


  ignore temp4
  ignore temp5
  ignore temp6


# Fan inputs
  ignore fan1
  ignore fan2
  ignore fan3

Figure 5. /etc/sensors.conf setup for the net4801


You need to execute the command sensors -s at boot time to initialize the sensors. You can then run the command sensors to read the sensors.

Tip

If your HDD supports SMART (Self-Monitoring, Analysis and Reporting Technology), you can monitor the temperature of it using either the hddtemp utility or smartmontools.

3.10. Real Time Clock

To enable the Real Time Clock of the net4801 you need the kernel option listed below.

  • Enhanced Real Time Clock Support (CONFIG_RTC)

4. Conclusion

The Soekris net4801 runs smoothly with GNU/Linux. The only thing I've encountered not working out-of-the-box so far is the GPIO, but you should be able to get it going using one of the above mentioned drivers.

5. Related Links

This section contains a list of hopefully helpful links to various documentation related to the Soekris net4801 which I've collected during the the writing of this document.

Miscellaneous

Datesheets