HARDWARE HP Compaq nx6125 with Turion64

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the Hardware series.
Laptops TV Tuner Cards Wireless Servers Storage Other Hardware Motherboards Related
The HP nx6125 running Linux
The HP nx6125 running Linux

[edit] Intro

This is for the AMD Turion64 based nx6125's.

Contents


[edit] The hardware

  • AMD Turion64 ML-32 1.8 GHz ( scales down to 1.6 and 0.8 GHz )
  • 512 MB RAM, extendable up to 2GB ( 4 GB ) ? Mine came with the ram as single module, which is an advantage if you want to upgrade, as you dont have to throw out a module.
  • 60GB Harddrive
  • Broadcom BCM4318 wlan
  • Broadcom BCM5788 gigabit ethernet
  • DVD+RW ( Even though cd-info says it cant write DVD+RWs it seems to work fine )
  • USB 2.0 and Firewire
  • ATI X300 mobile GPU ( PCI-E )
  • Texas Instruments PCIxx21/x515 Cardbus SD/SM/MMC/MS/MS Pro Cardreader

[edit] Other details

[edit] Battery life

As the brochure says, you can get 3 hours battery life from this, but if the system is under load, the wifi is on and the screen brightness is all the way up, you may find this brought down to about 1:20.

[edit] Layout

I personally found the layout to be very well thought out. At the rear is the network, power and an USB port. This means that everything that you normally plug in ( network cable, power supply, and mouse ) is at the same place. The headphones jack is near the front, and to the side, which i found a lot nicer that at the back. USB ports are located at the side as well as at the back, meaning that you dont have to unplug your mouse when you want to use a USB key. Also the side USB ports aren't resessed, also making USB keys/mp3 player easier to plug in. For the ports on the left, there are icons for each port on the top so that you dont have to guess where to plug the devices into.

[edit] Installation

I'm assuming you are installing Gentoo from scratch and already have an installation guide ( e.g. here ). I'm also assuming you are going for a 64-bit installation, not a 32-bit one.

[edit] CFLAGS

This wiki page says that for this CPU you should use these CFLAGS.

CHOST="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe -msse3"
CXXFLAGS="${CFLAGS}"

[edit] Kernel

Use a kernel that is at least a 2.6.17. I can not stress this enough, the older kernels have all sorts of problems. ( Like the fans not starting (causing the thing to overheat), the power status often freezes, CPU scaling doesnt work properly, and on some very only kernels it wont boot or the time will run twice as fast as it should ). In fact, if you have any problems that you think may be kernel related, then get the latest -rc from kernel.org and install it. Kernel versions starting from 2.6.21-rc1 should be bug free according to bugzilla kernel bug number 5534

Warning: The 2.6.18-rc2 kernel has removed the code nessary for the fans to spin up, as it messes with some other hardware configurations. So use 2.6.18-rc1 or 2.6.17.x. Code necessary for fans to work correctly were finally added at version linux-2.6.21-rc1


[edit] Kernel Config

These are just the options that are important. Of course, you will also need keyboard/mouse/etc/etc support, but i'm assuming that either the defaults will be fine or you already know how to do that. This is my kernel config. It has a few weird settings, but overall is pretty normal.

Linux Kernel Configuration: Vanilla 2.6.18-r1
# CPU
Processor type and features  --->
 Processor family (AMD-Opteron/Athlon64)

# Normall ACPI stuff
Power management options (ACPI, APM)  --->
 ACPI (Advanced Configuration and Power Interface) Support  --->
  [*] ACPI Support
  <*>   AC Adapter
  <*>   Battery
  <*>   Button
  <*>   Video
  < >   Generic Hotkey (EXPERIMENTAL)
  <*>   Fan
  <*>   Processor
  <*>     Thermal Zone

 CPU Frequency scaling  --->
  [*] CPU Frequency scaling
  <*>   'powersave' governor
  <*>   'userspace' governor for userspace frequency scaling
  <*>   'ondemand' cpufreq policy governor
  <*>   'conservative' cpufreq governor
  <*>   AMD Opteron/Athlon64 PowerNow!

 # The GFX card is PCIE ( i suspect the network cards are too )
 Bus options (PCI, PCMCIA, EISA, MCA, ISA)
  <*> PCI Express support
 
 # HDD DMA support
 Device Drivers  --->
  ATA/ATAPI/MFM/RLL support  --->
   PCI IDE chipset support  --->
    [*]  Generic PCI bus-master DMA support    
     <*>  ATI IXP chipset IDE support     
 
 # The (wired) network card
 Device Drivers  --->
  Network device support  --->
   <*> Broadcom Tigon3 support

 Sound  --->
  <*> Sound card support
  Advanced Linux Sound Architecture  --->
   <M> Advanced Linux Sound Architecture
   PCI devices  --->   
    <*> ATI IXP AC97 Controller
    < > ATI IXP Modem
 # Unless you need modem support, dont enable it as it
 #  stops the mute LED from working.

[edit] USE flags

These are the USE flags that you should pay attention too.

USE=" ... acpi dri dvd hal ieee1394 usb ... "

Xorg 7.0 driver flags.

INPUT_DEVICES="keyboard mouse synaptics"
# Keyboard, mouse and touchpad
VIDEO_CARDS="fglrx radeon vesa vga"
# Binary ATi driver, OSS ATi drivers, and generic.

[edit] Driver / config setup

[edit] Things that worked out of the box

  • DVD+RW ( needed dvd burning software )
  • USB
  • Sound ( may need kernel config )
  • Gigabit network card. ( Also needs kernel config )
  • Normal stuff ...

[edit] Things that were not working or tested

  • Firewire. This is detected by the kernel and i have heard reports of it working by other Linux users.
  • Fingerprint reader. This is actually a USB device ( / scanner ). I didn't try to get it working, but here are some links [1] [2] [3] [4].

[edit] Video

Here you can either use the binary driver from ATi or the OSS radeon driver.

[edit] Binary driver

This may be harder to set up and crashed more often, however if you want 3d acceleration, this is the only option. HOWTO ATI Drivers has details on this. I had trouble compiling it on a 2.6.18-rc1 kernel ( not suprising though ).

It also detects the true size of the LCD panel which works out to 86x88 dpi for the 1024*768 display.

You can fix this by telling X.org that your display is larger, so that it will get 75dpi.

Section "Monitor"
...
        DisplaySize  347 260
...
EndSection

Also the display brightness buttons don't work with the binary driver ( i suspect there is a way around this, in a xorg.conf option). You can work around this by Ctrl+Alt+F1, adjust brightness with fn+F9/F10, Alt+F7. I.e., swap over to a terminal, change it and swap back.

[edit] OSS driver

I found this to be faster than the binary driver for 2d.

  • DRI currently ( 2006/07 ) doesn't work due to this being a PCIe card.
  • Sometimes when swapping between terminals and X ( i.e., Ctrl+Alt+F1 ), the screen start flickering very badly with a grey-ish color. Sometimes it can be recovered by repeatedly swapping between terminals and X, or by pushing the lid close switch.

[edit] Wireless

See the Broadcom 43xx article.

[edit] Hibernation / suspend setup

I have it working ( except when using the ATi binary driver ).

If you are trying to get it working i would recommend running mount -o remount,sync / as root so that your filesystem doesn't damage itself should the resume fail.

Warning: Currently suspend to disk ( aka, hibernate ) will cause the next hibernate/suspend to fail. So you can only use it once.

[edit] You will need ....

Emerge the hibernation scripts with emerge -av sys-power/hibernate-script.

You will also need a swap partion ( which you have normally ) for hibernation.

The suspend2 kernel patch may be of help, but i didn't use it.

[edit] Kernel settings & modules

Kernel boot parameters are "noapic resume=/dev/path_to_swap" ( you may find you kernel doesn't need the noapic parameter, and if it doesn't remove it as it decreases performance ).

Possible modules that may stop it from working :

  • flgrx - The ATI binary drivers. It sometimes worked with this, but it would almost never work if i suspended again in the same boot.
  • ndiswrapper - Either the windows driver or the ndiswrapper driver itself may cause it to fail.
  • ieee1394 ( firewire ) - I don't have any proof of it being responsible, but on a couple of occasions it wouldn't resume right after i inserted these modules.
  • Suspend2.net says "yenta_socket" may cause problems.
  • I'm almost sure the 'fan' acpi driver is causing prolems ( and my fan reset script ).

[edit] Hibernate.conf & other settings

  • Add 'fglrx' to /etc/hibernate/blacklisted-modules.
Note: I am currently trying suspend with fglrx, and i'm not expericening too many issues.
  • Disable VbetoolPost in /etc/hibernate/(ram|disk).conf - AFAIK the vbe POST doesn't work.
  • Enable EnableVbetool and install vbetool (as recommended by the s2ram program ).
  • Create ( and chmod +x ), this which turns the fans off on resume ( use when you have trouble with the fans being on at resume ).
File: /etc/hibernate/reset_fans.sh
#!/bin/sh
echo 3 > /proc/acpi/fan/C255/state
echo 3 > /proc/acpi/fan/C256/state
echo 3 > /proc/acpi/fan/C257/state
echo 3 > /proc/acpi/fan/C258/state
  • Add "OnResume 00 /etc/hibernate/reset_fans.sh" to /etc/hibernate/(ram|disk).conf
  • There is an option that locks you WM ( e.g., KDE ) when it resumes. You may want that setting.

...

[edit] Other stuff to make it easier to use

If you want to run hibernate or hibernate-ram as someone other than root, you will need to :

  • Setup a group to only allow certain users access.
  • Edit /etc/sudoers to allow a certain group to run the program(s).
  • Set up bash scripts in /usr/bin to act a wrappers to sudo.
  • Map the power button or one of the multimedia buttons to either hibernate or hibernate-ram.

E.g.,

File: /usr/bin/hibernate
#!/bin/sh
/usr/bin/sudo /usr/sbin/hibernate $@
File: /usr/bin/hibernate-ram
#!/bin/sh
/usr/bin/sudo /usr/sbin/hibernate --config-file /etc/hibernate/ram.conf $@
addgroup hibernate
usermod -a -G hibernate <the user>

chown root:hibernate /usr/bin/hibernate*
chmod 750 /usr/bin/hibernate*

And add ..

Code: /etc/sudoers
...
%hibernate ALL=(root) NOPASSWD: /usr/sbin/hibernate
...

For a KDE .desktop shortcut :

File: ~/Desktop/Suspend.desktop
[Desktop Entry]
Comment=
Exec=/usr/bin/hibernate-ram
GenericName=Suspend
Icon=laptop_battery
Name=Suspend
StartupNotify=false
Type=Application

[edit] Quirks / issues

  • The wifi device/drivers can turn itself off after a while. You can reset it by unloading/loading the ndiswrapper module.
  • If the lid switch is hit and released to quickly the screen will turn off. This appears to be a hardware issue.
  Note: pressing the Fn+F4 key (for switching to external display) resolves that problem and turns the display on again.
  • Once X wouldn't load the fglrx ( ATi binary ) driver when the lid was down at boot time.
  • The HDD led goes on at random times when ther laptop is moved. It resets when the HDD is

used again. I theorize that the HDD has parked itself, but i really have no idea.

EDIT : I have this laptop, under Fedora 6, and the same problem, I fix it whith hdparm, using : #/sbin/hdparm -q -B 255 /dev/hda at startup for turning off the power management of the hdd. (Sorry for my bad english, and I invite the author of this wiki to rewrite this better :) , my mail : bloodaxes@gmail.com. Arnaud)

  • The HDD appears to turn off then on then off when i power off the machine. The same happen in M$ Windows. I have no idea why this is happening, but i suspend it is either a BIOS, motherboard, or HDD issue.

[edit] Processor undervoltage

It seems that linux kernel defaults to do some overvoltage on this machine. It uses 1,45 V (For Turion ML-32) and it should use 1,35 V (AMD spec). This is worth checking and correcting - with perhaps doing futher undervoltage if vaiable. Proposed ways are:

http://forums.gentoo.org/viewtopic-t-245197.html - patching driver directly
http://tuxamito.com.es/cpupw/index.php - using deamon, with no patches required

You are doing this at your own risk!

[edit] Suspending to RAM

Using the SuSE s2ram tool i have found that "s2ram -f -s" works fine.

[edit] Hibernation ( suspend to disk )

I finally got this to work. I'm not sure exactly what it involved but i have it working ( except the fans turn on full as re-boot ). It appears that the kernel restores all kinds of states to devices when it resumes, like the ac adaptor status will remain it the original state until the status is cycled.

I'm still tracing down exactly what stopped it from working before, but from what i can tell it needed the noapic kernel parameter , and some modules removed.
Scratch that, it works fine with the fglrx and ndiswrapper ( And USB, sound, 1394, etc) modules running.
Hmm, i take that back, i'm almost sure now that the 1394 drivers can be a problem ....
Hmm, or maybe fglrx only works for the first hibernate and not the second .....

[edit] Rebooting when GRUB has a gfxical interface

It doesnt. When i had grub set up to use a graphical interface it wouldn't reboot. I've heard that "reboot=b" as a kernel option would help this.

[edit] Polling acpi -t

Code: Add to /etc/conf.d/local.start or similar

sh -c "while(true) do sleep 5 ; acpi -t > /dev/null ; done "&

One work around for the fan problem is to poll the acpi termal monitors often. The above line forks a shell the checks ( and then redirects to /dev/null ) every 5 seconds.

[edit] Others

[edit] Acpi auto cpufreq adjuster

Put this in your acpi handler to have it automaticly change the cpufreq scaling_governor when the ac_adapter state changes.

If you want it changed at boot put /etc/acpi/default.sh ac_adapter local.start in your /etc/conf.d/local.start.

File: /etc/acpi/default.sh
...
ac_adapter)
 if  grep on-line /proc/acpi/ac_adapter/*/state &> /dev/null ; then
  echo 1800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
 else
  echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
 fi
 ;;
...

[edit] Multimedia keys

The laptop has an (i) ( infomation ), presentation, and volume up/down/mute buttons. The volume mute button also has the mute LED inset. See a generic guide like HOWTO Use Multimedia Keys for more details on setting this up.

This is an example hotkeys config definition file.

File: /usr/share/hotkeys/hpnx6125.def
<?xml version="1.0"?>
<definition>
<!-- /usr/share/hotkeys/hpnx6125.def -->
  <config model="HP Compaq NX6125 Laptop">
    <userdef keycode="176" command="/usr/bin/amixer set Master 4%+ > /dev/null">Volume Up</userdef>
    <userdef keycode="174" command="/usr/bin/amixer set Master 4%- > /dev/null">Volume Down</userdef>
    <userdef keycode="160" command="/usr/bin/amixer set Master toggle > /dev/null">Volume Mute</userdef>
    <userdef keycode="xxx" command="/usr/bin/sudo /bin/sh /etc/mountCrypto.sh">Toggle CryptoFS</userdef>
    <userdef keycode="xxx" command="/usr/bin/xmms -t ">Toggle XMMS Pause status</userdef>
  </config>
  <contributor>
    <name>Matthew Peterson</name>
    <email>paranoidgeek@gmail.com</email>
  </contributor>
</definition>

[edit] LM Sensors

Simply enable support for the following modules in your kernel:
i2c_piix4, adm1021 and k8temp (Linux >=2.6.19 required)
After modprobing the modules you can use lm_sensors (>=2.10.1) to display the temperature.

[edit] Built-In CardReader

02:04.3 Mass storage controller: Texas Instruments PCIxx21 Integrated FlashMedia Controller

Onse the system being installed, you need next modules for cardreader working properly:

tifm_core
tifm_7xx1
tifm_sd
mmc_core

Just modprobe them. You may get notification from dmesg:

mmcblk0: mmc2:0001 MMCm   ... KiB 
 mmcblk0: p1

Also, you´ll get

/dev/mmcblk0
/dev/mmcblk0p1

block devices created.

Anyway, you cannot mount them, until you strike something like that:

setpci -s 02:04.3 4c=22

It´s a little trick, but it works! Reinsert the card.

[edit] See also

Personal tools