karkwood-dt ix2-200 FAN not working

This forum is for topics dealing with problems with software specifically in the ARMv5 repo.

karkwood-dt ix2-200 FAN not working

Postby nabeelryk » Fri Apr 24, 2020 8:33 am

Hi,
This is my first time in Arch-Linux. But I am not new to Linux platform as I am using Ubuntu servers since 2016 and I new few beginner stuff. Due to lock-down I was bored, So I look around in my store to find something that i can work on and I found an old but working ix2-200. It was 2 Slot NAS but i used it 1 Hard drive for my Ubuntu server. So it was left with 1 drive with its firmware and due to no use for like 5-6 years that only drive also died and i was left with broken NAS ix2-200. After a lot of Googling i was unable to install its original firmware and i reset its SETENV values to default. And After that i stumbled upon these forums about installing Arch-Linux in ix2-200 and as i followed along and with few tweaks I was able to run Arch-Linux as i wanted it.

Now my OS is booted from a 16GB class 10 SDCARD using USB card reader.
And my Bay 1 and Bay 2 HDDs are mounted as separate Storages. As i will be using this storage only for kids cartoons and stuff that are easily downloadable again so i dont want RAID1 backup of these and waste my half of the storage. I know you might be thinking that is stupid using NAS for cartoons as kids can live stream, well as I am in 3rd world country we get charged alot of money for internet and on high speed internets we get charged per GB Data we use. So for me its very economical and I get to reduce to load over my internet so i can work in peace without lag.

I followed

https://kiljan.org/2016/11/15/installin ... a-ix2-200/

viewtopic.php?f=53&t=13477

Now the Problem is that my uboot shows temperature rise and decline from 25 to 51 degrees but the fan speed is always zero. And I dont want toast my hard-Drives or NAS board due to high temperature. I am looking for some help in this.
If you can point me in some direction.

The FAN rotates when i turn it with a finger. And well plugged to 12v pwer supple it rotates fine.
So the FAN is okey but uboot is not running it.

I have FTDI cable connected to serial port of NAS and below is the output of my current uboot and setenv.

__ __ _ _
| \/ | __ _ _ ____ _____| | |
| |\/| |/ _` | '__\ \ / / _ \ | |
| | | | (_| | | \ V / __/ | |
|_| |_|\__,_|_| \_/ \___|_|_|
_ _ ____ _
| | | | | __ ) ___ ___ | |_
| | | |___| _ \ / _ \ / _ \| __|
| |_| |___| |_) | (_) | (_) | |_
\___/ |____/ \___/ \___/ \__|
** MARVELL BOARD: RD-88F6281A LE

U-Boot 1.1.4 (Sep 8 2009 - 09:31:54) Marvell version: 3.4.14

Mapower version: 2.0 (32MB) (2009/09/08)

U-Boot code: 00600000 -> 0067FFF0 BSS: -> 006CEE60

Soc: 88F6281 A0 (DDR2)
CPU running @ 1000Mhz L2 running @ 333Mhz
SysClock = 333Mhz , TClock = 200Mhz

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000 size 256MB
DRAM Total size 256MB 16bit width
Flash: 0 kB
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:32 MB

CPU : Marvell Feroceon (Rev 1)

Streaming disabled
Write allocate disabled

Module 0 is RGMII
Module 1 is TDM

USB 0: host mode
PEX 0: interface detected no Link.
Net: egiga0, egiga1 [PRIME]
Fan lookup table initialized.

Current remote temperature: 37
Current fan speed: 0

Hit any key to stop autoboot: 0
Marvell>> printenv
baudrate=115200
loads_echo=0
ipaddr=10.4.50.165
serverip=10.4.50.5
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x1f00000@0x100000(root)
CASset=min
MALLOC_len=1
ethprime=egiga1
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
ethmtu=1500
eth1addr=00:50:43:00:02:02
eth1mtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
FanHysteresis=2
FanTempStart=58
uboot_start=0x0
uboot_size=0xc0000
env_start=0xa0000
env_size=0x20000
kernel_start=0x100000
kernel_size=0x300000
initrd_start=0x540000
initrd_size=0x300000
flash_load=run make_boot_args load1 load2 boot
load1=nand read.e 0x2000000 $(kernel_start) $(kernel_size)
load2=nand read.e 0x4500000 $(initrd_start) $(initrd_size)
boot=bootm 0x2000000 0x4500000
make_boot_args=setenv bootargs console=ttyS0,115200 mtdparts=nand_mtd:;setenv bootargs $(bootargs)$(uboot_size)@$(uboot_start)(uboot),;setenv bootargs $(bootargs)$(env_size)@$(env_start)(env),;setenv bootargs $(bootargs)$(kernel_size)@$(kernel_start)(zImage),;setenv bootargs $(bootargs)$(initrd_size)@$(initrd_start)(initrd),;setenv bootargs $(bootargs)128m@0x0(flash);
iomega=123
ethaddr=AA:00:00:00:00:01
arcNumber=1682
bootargs_console=console=ttyS0,115200
bootargs_mtdparts=mtdparts=orion_nand:640k(u-boot)ro,16k(u-boot-env),-(iomega-firmware)ro
bootargs_root=root=LABEL=ROOT rw
memoffset_kernel=0x02000000
memoffset_initrd=0x08004000
bootargs_combine=setenv bootargs ${bootargs_console} ${bootargs_mtdparts} ${bootargs_root}
bootlinux=bootm ${memoffset_kernel} ${memoffset_initrd}
usb_load_firstdevice=ext2load usb 0:1 ${memoffset_kernel} /uImage; ext2load usb 0:1 ${memoffset_initrd} /uInitrd
usb_load=run bootargs_combine; usb reset; run usb_load_firstdevice; run bootlinux
sata_load_disk1=ext2load ide 0:1 ${memoffset_kernel} /uImage; ext2load ide 0:1 ${memoffset_initrd} /uInitrd
sata_load_disk2=ext2load ide 1:1 ${memoffset_kernel} /uImage; ext2load ide 1:1 ${memoffset_initrd} /uInitrd
sata_load=run bootargs_combine; ide reset; run sata_load_disk1; run sata_load_disk2; run bootlinux
bootcmd=run usb_load; run sata_load
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=yes
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootdelay=3
disaMvPnp=no
hddPowerCtrl=no
enaAutoRecovery=yes
ethact=egiga1

Environment size: 2776/16380 bytes
Marvell>>
nabeelryk
 
Posts: 8
Joined: Thu Apr 23, 2020 6:21 am

Re: karkwood-dt ix2-200 FAN not working

Postby kriztioan » Fri Apr 24, 2020 7:27 pm

The ix2-200's fan is controlled via two U-Boot parameters, which in your case are:
$this->bbcode_second_pass_code('', '
FanHysteresis=2
FanTempStart=58
')

This means you're fan won't turn on until the temperature hits 58 ºC and turn off when it falls back to 56 ºC. You can change these parameters on the U-Boot prompt or using the fw_setenv command. I have mine set as:

$this->bbcode_second_pass_code('', '
FanTempStart=45
FanHysteresis=3
')

The ix2-200's fan 'curve' has a lot to wish for. Fortunately, the fan can be controlled via a sysfs-interface, which allows you to 'tweak' the curve. For this I use the script below, which is run once at startup using systemd:

$this->bbcode_second_pass_code('', '
#!/bin/bash

DEVICE=hwmon0
CONTROLLER=pwm1
TEMP=( 51000 51500 52000 52500 53000 53500 54000 54500 )
PWM=( 227 228 230 233 237 242 248 255)

function pwm_set_curve {

for (( i=0; i<${#TEMP[@]}; i++ ))
do
echo -n ${TEMP[$i]} > /sys/class/hwmon/${DEVICE}/${CONTROLLER}_auto_point$(( $i + 1))_temp
echo -n ${PWM[$i]} > /sys/class/hwmon/${DEVICE}/${CONTROLLER}_auto_point$(( $i + 1))_pwm
done
}

function pwm_manual_mode {

echo -n 1 > /sys/class/hwmon/${DEVICE}/${CONTROLLER}_enable
}

function pwm_automatic_mode {

echo -n 2 > /sys/class/hwmon/${DEVICE}/${CONTROLLER}_enable
}


pwm_manual_mode
pwm_set_curve
pwm_automatic_mode
')

You can read up on the sysfs-interface at https://www.mjmwired.net/kernel/Documentation/hwmon/sysfs-interface.
kriztioan
 
Posts: 51
Joined: Sat Apr 29, 2017 1:32 am

Re: karkwood-dt ix2-200 FAN not working

Postby nabeelryk » Tue Apr 28, 2020 3:58 pm

Sorry for late reply i got it working too. Using LM63 drivers and following fan speed control thread.

https://wiki.archlinux.org/index.php/Fan_speed_control
nabeelryk
 
Posts: 8
Joined: Thu Apr 23, 2020 6:21 am

Re: karkwood-dt ix2-200 FAN not working

Postby nabeelryk » Tue Apr 28, 2020 10:36 pm

tried to setenv but it resets to
FanHysteresis=2
FanTempStart=58
on every reboot.

I reconfigured fancontrol to start at 40 with minimum speed of 45 pwm.
And when temperature is 50 C it sets pwm 255 that is maximum speed of fan.

So far its working fine.

I am looking for temperature check command that can echo current temperature on cli.
I will look into your provided link and script today.
nabeelryk
 
Posts: 8
Joined: Thu Apr 23, 2020 6:21 am

Re: karkwood-dt ix2-200 FAN not working

Postby moonman » Tue Apr 28, 2020 10:43 pm

$this->bbcode_second_pass_quote('nabeelryk', 't')ried to setenv but it resets to
FanHysteresis=2
FanTempStart=58
on every reboot.

"setenv" sets the variable in ram, but doesn't commit it to NAND. "saveenv" will save all modifications to NAND.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3387
Joined: Sat Jan 15, 2011 3:36 am

Re: karkwood-dt ix2-200 FAN not working

Postby kriztioan » Tue Apr 28, 2020 11:04 pm

Yes, a "saveenv" on the U-boot prompt will commit the changes to NAND. For getting temperature readings on the cli, 'lmsensors' can do that for you. Or, you can directly again use the sysfs-interface and read '/sys/class/hwmon/hwmon0/temp1_input' and '/sys/class/hwmon/hwmon0/temp2_input' files, e.g.,

$this->bbcode_second_pass_code('', '$ cat /sys/class/hwmon/hwmon0/temp1_input
46000')
$this->bbcode_second_pass_code('', '$ cat /sys/class/hwmon/hwmon0/temp1_input
46125')
Yes, there are two sensors on the ix2-200 and the returned values are in millicelcius.
kriztioan
 
Posts: 51
Joined: Sat Apr 29, 2017 1:32 am


Return to ARMv5

Who is online

Users browsing this forum: No registered users and 8 guests