openwrt/target/linux/kirkwood/base-files/etc/init.d/hwmon_fancontrol

56 lines
2.3 KiB
Plaintext
Raw Normal View History

kirkwood: add ZyXEL NSA310b The ZyXEL NSA310 device is a Kirkwood based NAS: - SoC: Marvell 88F6702 1200Mhz - SDRAM memory: 256MB DDR2 400Mhz - Gigabit ethernet: Realtek (over pcie) - Flash memory: 128MB - 1 Power button - 1 Power LED (blue) - 5 Status LED (green/red) - 1 Copy/Sync button - 1 Reset button - 2 SATA II port (1 internal and 1 external) - 2 USB 2.0 ports (1 front and 1 back) - Smart fan The stock u-boot cannot read ubi so it should be replaced with the LEDE/OpenWRT's u-boot or with a u-boot from here https://github.com/mibodhi/u-boot-kirkwood This device's boot ROM supports "kwboot" tool (in mainline u-boot, built automatically if CONFIG_KIRKWOOD is declared) that sends an uboot image to the board over serial connection, it is very easy to unbrick. The stock bootloader can use usb and read from FAT filesystems, so the installation process is simple, place the uboot file on a USB flashdrive formatted as FAT (here it is "openwrt-kirkwood-nsa310.bin", then connect TTL to the board and write the following commands in the bootloader console: usb reset fatload usb 0 0x1000000 openwrt-kirkwood-nsa310.bin nand write 0x1000000 0x00000 0x100000 reset Now you are rebooting in the new u-boot, write this in its console to install the firmware: usb reset fatload usb 0 0x2000000 lede-kirkwood-nsa310b-squashfs-factory.bin nand erase.part ubi nand write 0x2000000 ubi 0x600000 If your firmware file is bigger than 6 MiBs you should write its size in hex instead of 0x600000 above, or remove that number entirely (it will take a while in this case). If you are using another uboot that can read ubi, set mtdparts like this mtdparts=mtdparts=orion_nand:0x00c0000(uboot),0x80000(uboot_env),0x7ec0000(ubi) And set your bootcmd to be like this bootcmd=run setenv bootargs; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000 Then you can install the firmware as described above. After you installed (or configured) the u-boot for booting the firmware, write the device's mac address in the ethaddr u-boot env. The MAC address is usually on a sticker under the device (one of the two codes is the serial), it should begin with "107BEF" as it is assigned to ZyXEL. write in the u-boot console (use your MAC address instead of the example) setenv ethaddr 10:7B:EF:00:00:00 saveenv to save the mac address in the u-boot. Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
2017-01-23 20:34:29 +01:00
#!/bin/sh /etc/rc.common
START=98
boot() {
# configuring (lm85/lm63) onboard temp/fan controller to run the fan on its own
# for more information, please read https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface
kirkwood: add ZyXEL NSA310b The ZyXEL NSA310 device is a Kirkwood based NAS: - SoC: Marvell 88F6702 1200Mhz - SDRAM memory: 256MB DDR2 400Mhz - Gigabit ethernet: Realtek (over pcie) - Flash memory: 128MB - 1 Power button - 1 Power LED (blue) - 5 Status LED (green/red) - 1 Copy/Sync button - 1 Reset button - 2 SATA II port (1 internal and 1 external) - 2 USB 2.0 ports (1 front and 1 back) - Smart fan The stock u-boot cannot read ubi so it should be replaced with the LEDE/OpenWRT's u-boot or with a u-boot from here https://github.com/mibodhi/u-boot-kirkwood This device's boot ROM supports "kwboot" tool (in mainline u-boot, built automatically if CONFIG_KIRKWOOD is declared) that sends an uboot image to the board over serial connection, it is very easy to unbrick. The stock bootloader can use usb and read from FAT filesystems, so the installation process is simple, place the uboot file on a USB flashdrive formatted as FAT (here it is "openwrt-kirkwood-nsa310.bin", then connect TTL to the board and write the following commands in the bootloader console: usb reset fatload usb 0 0x1000000 openwrt-kirkwood-nsa310.bin nand write 0x1000000 0x00000 0x100000 reset Now you are rebooting in the new u-boot, write this in its console to install the firmware: usb reset fatload usb 0 0x2000000 lede-kirkwood-nsa310b-squashfs-factory.bin nand erase.part ubi nand write 0x2000000 ubi 0x600000 If your firmware file is bigger than 6 MiBs you should write its size in hex instead of 0x600000 above, or remove that number entirely (it will take a while in this case). If you are using another uboot that can read ubi, set mtdparts like this mtdparts=mtdparts=orion_nand:0x00c0000(uboot),0x80000(uboot_env),0x7ec0000(ubi) And set your bootcmd to be like this bootcmd=run setenv bootargs; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000 Then you can install the firmware as described above. After you installed (or configured) the u-boot for booting the firmware, write the device's mac address in the ethaddr u-boot env. The MAC address is usually on a sticker under the device (one of the two codes is the serial), it should begin with "107BEF" as it is assigned to ZyXEL. write in the u-boot console (use your MAC address instead of the example) setenv ethaddr 10:7B:EF:00:00:00 saveenv to save the mac address in the u-boot. Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
2017-01-23 20:34:29 +01:00
case $(board_name) in
ctera,c200-v1)
path_to_hwmon='/sys/devices/platform/ocp@f1000000/f1011000.i2c/i2c-0/0-004c/hwmon/hwmon0'
# It should be related to hdd temerature instead lm63 temp
echo 1 > "$path_to_hwmon/pwm1_enable"
echo 128 > "$path_to_hwmon/pwm1"
;;
iom,ix2-200)
path_to_hwmon='/sys/class/hwmon/hwmon0'
echo 2 > "$path_to_hwmon/pwm1_enable" # fan is on pwm1
;;
kirkwood: add support for Seagate BlackArmor NAS220 The Seagate BlackArmor NAS220 is a consumer NAS with two internal drive bays. The stock OS runs RAID 1 over the disks via mdadm. Device specification: - SoC: Marvell 88F6192 800 MHz - RAM: 128 MB - Flash: 32 MB - 2 x internal SATA II drives - Ethernet: 10/100/1000 Mbps (single port, no switch) - WLAN: None - LED: Power, Status, Sata Activity - Key: Power, Reset - Serial: 10 pin header, (115200,8,N,1), 3.3V TTL 9|x - x|10 7|x - x|8 5|x - GND|6 3|x - RX|4 1|TX - x|2 front of case - USB ports: 2 x USB 2.0 Flash instruction: NOTE: this process uses a serial connection. It will upgrade the bootloader and reset the bootloader environment variables TFTP server setup - Setup PC with TFTP server set the PC IP to 10.4.50.5 as TFTP server - Copy these files to TFTP server location - u-boot.kwb - seagate_blackarmor-nas220-initramfs-uImage - seagate_blackarmor-nas220-squashfs-sysupgrade.bin - seagate_blackarmor-nas220-squashfs-factory.bin Seagate NAS setup - Connect LAN cable between PC and seagate device - Connect to serial to seagate device Install u-boot - Boot seagate device and stop in bootloader by pressing any key - run 'printenv' from u-boot and save the values - tftpboot 0x2000000 u-boot.kwb - nand erase.part uboot - nand write 0x2000000 0x0 ${filesize} - reset Update MAC address in u-boot env - Stop in u-boot by pressing any key - Get your MAC address from your saved printenv. Is also on chassis - setenv ethaddr <your MAC> - saveenv Option 1 (recommended) - Install OpenWrt via initramfs and sysupgrade - tftpboot 0x2000000 seagate_blackarmor-nas220-initramfs-uImage - bootm 0x2000000 - *OpenWrt should be running now, however it is not written to flash yet* - From the running instance of OpenWrt use Luci's "flash image" feature from the web site or use sysupgrade from the console to write seagate_blackarmor-nas220-squashfs-sysupgrade.bin to flash Option 2 - Install OpenWrt by flashing factory image from u-boot - nand erase.part ubi - tftpboot 0x2000000 seagate_blackarmor-nas220-squashfs-factory.bin - nand write 0x2000000 ubi ${filesize} - reset Signed-off-by: Kip Porterfield <kip.porterfield@gmail.com>
2020-08-03 16:07:51 +02:00
seagate,blackarmor-nas220)
path_to_hwmon='/sys/devices/platform/ocp@f1000000/f1011000.i2c/i2c-0/0-002e/hwmon/hwmon0'
# adt7476 fan control chip. 3 temp sensors. Set to 1/4 speed at 35C and max speed at 48C.
echo 7 > "$path_to_hwmon/pwm1_auto_channels_temp"
echo 64 > "$path_to_hwmon/pwm1_auto_point1_pwm"
echo 255 > "$path_to_hwmon/pwm1_auto_point2_pwm"
echo 35000 > "$path_to_hwmon/temp1_auto_point1_temp"
echo 48000 > "$path_to_hwmon/temp1_auto_point2_temp"
echo 35000 > "$path_to_hwmon/temp2_auto_point1_temp"
echo 48000 > "$path_to_hwmon/temp2_auto_point2_temp"
echo 35000 > "$path_to_hwmon/temp3_auto_point1_temp"
echo 48000 > "$path_to_hwmon/temp3_auto_point2_temp"
echo 2 > "$path_to_hwmon/pwm1_enable"
;;
zyxel,nsa310b)
path_to_hwmon='/sys/devices/platform/ocp@f1000000/f1011000.i2c/i2c-0/0-002e/hwmon/hwmon0'
# use the max. value of (temp1) OR (temp2) OR (temp3) as an input
# for the PWM of the cooling fan
echo 123 > "$path_to_hwmon/pwm1_auto_channels"
# Temperature sensor #1 placed on mainboard
echo 30000 > "$path_to_hwmon/temp1_auto_temp_min"
echo 49600 > "$path_to_hwmon/temp1_auto_temp_max"
# Temperature sensor #2 placed on mainboard
# range: 0 to 127000 in steps of 1000 [millicelsius]
echo 30000 > "$path_to_hwmon/temp2_auto_temp_min"
# range: 0 to 127000 in steps of ???? [millicelsius]
echo 49600 > "$path_to_hwmon/temp2_auto_temp_max"
# Temperature sensor #3 placed close to a chipset
# range: 0 to 60000 in steps of 1000 [millicelsius]
echo 23000 > "$path_to_hwmon/temp3_auto_temp_min"
# pre-defined steps: 103000, 122000, 143300, 170000 in [millicelsius]
echo 103000 > "$path_to_hwmon/temp3_auto_temp_max"
;;
esac
kirkwood: add ZyXEL NSA310b The ZyXEL NSA310 device is a Kirkwood based NAS: - SoC: Marvell 88F6702 1200Mhz - SDRAM memory: 256MB DDR2 400Mhz - Gigabit ethernet: Realtek (over pcie) - Flash memory: 128MB - 1 Power button - 1 Power LED (blue) - 5 Status LED (green/red) - 1 Copy/Sync button - 1 Reset button - 2 SATA II port (1 internal and 1 external) - 2 USB 2.0 ports (1 front and 1 back) - Smart fan The stock u-boot cannot read ubi so it should be replaced with the LEDE/OpenWRT's u-boot or with a u-boot from here https://github.com/mibodhi/u-boot-kirkwood This device's boot ROM supports "kwboot" tool (in mainline u-boot, built automatically if CONFIG_KIRKWOOD is declared) that sends an uboot image to the board over serial connection, it is very easy to unbrick. The stock bootloader can use usb and read from FAT filesystems, so the installation process is simple, place the uboot file on a USB flashdrive formatted as FAT (here it is "openwrt-kirkwood-nsa310.bin", then connect TTL to the board and write the following commands in the bootloader console: usb reset fatload usb 0 0x1000000 openwrt-kirkwood-nsa310.bin nand write 0x1000000 0x00000 0x100000 reset Now you are rebooting in the new u-boot, write this in its console to install the firmware: usb reset fatload usb 0 0x2000000 lede-kirkwood-nsa310b-squashfs-factory.bin nand erase.part ubi nand write 0x2000000 ubi 0x600000 If your firmware file is bigger than 6 MiBs you should write its size in hex instead of 0x600000 above, or remove that number entirely (it will take a while in this case). If you are using another uboot that can read ubi, set mtdparts like this mtdparts=mtdparts=orion_nand:0x00c0000(uboot),0x80000(uboot_env),0x7ec0000(ubi) And set your bootcmd to be like this bootcmd=run setenv bootargs; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000 Then you can install the firmware as described above. After you installed (or configured) the u-boot for booting the firmware, write the device's mac address in the ethaddr u-boot env. The MAC address is usually on a sticker under the device (one of the two codes is the serial), it should begin with "107BEF" as it is assigned to ZyXEL. write in the u-boot console (use your MAC address instead of the example) setenv ethaddr 10:7B:EF:00:00:00 saveenv to save the mac address in the u-boot. Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
2017-01-23 20:34:29 +01:00
}