Hack BBS

[全部のスレッド一覧][新着順に表示][返信フォーム][この記事のスレッド][記事の削除・変更] [Home Page]

この記事のスレッドの最初は【No.6246】の投稿です

記事番号 【No.6246】
投稿者: 通りすがり
投稿日時: 14/10/16(木) 23:29:45
タイトル: LS-VLシリーズのkernel3.17.1パッチ
コメント: バニラはmach-kirkwoodをmach-mvebuに統合してくれたおかげで私のLS-XHLが起動しません(泣)
88f6282のLS-VLはばっちり動かしましたのでpatchを載せます。
「make mvebu_v5_defconfig」と「System Type --->[*] Marvell Engineering Business Unit (MVEBU) SoCs --->[*] Marvell Kirkwood boards [*] Buffalo LS-VL Series」を忘れずに。
DTBをつかうので、
# make kirkwood-lsvl.dtb
# cat arch/arm/boot/zImage arch/arm/boot//dts/kirkwood-lsvl.dtb > arch/arm/boot/zImage_w_dtb
# mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n 'Linux-3.0' -d arch/arm/boot/zImage_w_dtb arch/arm/boot/uImage.buffalo
kernelでコマンド渡せるので、MTDもdebian謹製「uboot-envtools」でいじくれます。

-----
--- linux-3.17.1/arch/arm/tools/mach-types.orig 2014-10-16 18:35:51.463599000 +0900
+++ linux-3.17.1/arch/arm/tools/mach-types 2014-10-16 18:47:17.293599000 +0900
@@ -118,6 +118,7 @@
omap_osk MACH_OMAP_OSK OMAP_OSK 515
tosa MACH_TOSA TOSA 520
avila MACH_AVILA AVILA 526
+lsvl MACH_LINKSTATION_LSVL LINKSTATION_LSVL 527
edb9302 MACH_EDB9302 EDB9302 538
husky MACH_HUSKY HUSKY 543
shepherd MACH_SHEPHERD SHEPHERD 545
--- linux-3.17.1/arch/arm/boot/dts/Makefile.orig 2014-10-16 18:34:46.163599000 +0900
+++ linux-3.17.1/arch/arm/boot/dts/Makefile 2014-10-16 18:51:38.813599000 +0900
@@ -126,6 +126,7 @@
kirkwood-laplug.dtb \
kirkwood-lschlv2.dtb \
kirkwood-lsxhl.dtb \
+ kirkwood-lsvl.dtb \
kirkwood-mplcec4.dtb \
kirkwood-mv88f6281gtw-ge.dtb \
kirkwood-net2big.dtb \
--- /dev/null 2014-10-16 17:33:40.698012000 +0900
+++ linux-3.17.1/arch/arm/boot/dts/kirkwood-lsvl.dts 2014-10-16 18:32:38.813599000 +0900
@@ -0,0 +1,240 @@
+/dts-v1/;
+
+#include "kirkwood.dtsi"
+#include "kirkwood-6282.dtsi"
+
+/ {
+ model = "Buffalo Linkstation LS-VL";
+ compatible = "buffalo,lsvl", "marvell,kirkwood-88f6282", "marvell,kirkwood";
+
+ memory {
+ device_type = "memory";
+ reg = <0x00000000 0x10000000>;
+ };
+
+ ocp@f1000000 {
+ serial@12000 {
+ status = "okay";
+ };
+ };
+
+ chosen {
+ bootargs = "console=ttyS0,115200n8 earlyprintk";
+ stdout-path = &uart0;
+ };
+
+ ocp@f1000000 {
+ pinctrl: pin-controller@10000 {
+ pmx_power_hdd: pmx-power-hdd {
+ marvell,pins = "mpp8";
+ marvell,function = "gpio";
+ };
+ pmx_usb_vbus: pmx-usb-vbus {
+ marvell,pins = "mpp12";
+ marvell,function = "gpo";
+ };
+ pmx_fan_high: pmx-fan-high {
+ marvell,pins = "mpp16";
+ marvell,function = "gpio";
+ };
+ pmx_fan_low: pmx-fan-low {
+ marvell,pins = "mpp17";
+ marvell,function = "gpio";
+ };
+ pmx_led_function_blue: pmx-led-function-blue {
+ marvell,pins = "mpp39";
+ marvell,function = "gpio";
+ };
+ pmx_led_alarm: pmx-led-alarm {
+ marvell,pins = "mpp36";
+ marvell,function = "gpio";
+ };
+ pmx_led_function_red: pmx-led-function_red {
+ marvell,pins = "mpp37";
+ marvell,function = "gpio";
+ };
+ pmx_led_info: pmx-led-info {
+ marvell,pins = "mpp38";
+ marvell,function = "gpio";
+ };
+ pmx_led_power: pmx-led-power {
+ marvell,pins = "mpp40";
+ marvell,function = "gpio";
+ };
+ pmx_fan_lock: pmx-fan-lock {
+ marvell,pins = "mpp43";
+ marvell,function = "gpio";
+ };
+ pmx_button_function: pmx-button-function {
+ marvell,pins = "mpp45";
+ marvell,function = "gpio";
+ };
+ pmx_power_switch: pmx-power-switch {
+ marvell,pins = "mpp46";
+ marvell,function = "gpio";
+ };
+ pmx_power_auto_switch: pmx-power-auto-switch {
+ marvell,pins = "mpp47";
+ marvell,function = "gpio";
+ };
+
+ };
+ sata@80000 {
+ status = "okay";
+ nr-ports = <1>;
+ };
+
+ spi@10600 {
+ status = "okay";
+
+ m25p40@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "m25p40";
+ reg = <0>;
+ spi-max-frequency = <25000000>;
+ mode = <0>;
+
+ partition@0 {
+ reg = <0x0 0x60000>;
+ label = "uboot";
+ read-only;
+ };
+
+ partition@60000 {
+ reg = <0x60000 0x10000>;
+ label = "dtb";
+ read-only;
+ };
+
+ partition@70000 {
+ reg = <0x70000 0x10000>;
+ label = "uboot_env";
+ };
+ };
+ };
+ };
+
+ gpio_leds {
+ compatible = "gpio-leds";
+ pinctrl-0 = <&pmx_led_function_red &pmx_led_alarm
+ &pmx_led_info &pmx_led_power
+ &pmx_led_function_blue>;
+ pinctrl-names = "default";
+
+ led@1 {
+ label = "lsvl:red:alarm";
+ gpios = <&gpio0 36 GPIO_ACTIVE_LOW>;
+ };
+
+ led@2 {
+ label = "lsvl:red:func";
+ gpios = <&gpio0 37 GPIO_ACTIVE_LOW>;
+ };
+
+ led@3 {
+ label = "lsvl:amber:info";
+ gpios = <&gpio0 38 GPIO_ACTIVE_LOW>;
+ };
+
+ led@4 {
+ label = "lsvl:blue:func";
+ gpios = <&gpio0 39 GPIO_ACTIVE_LOW>;
+ };
+
+ led@5 {
+ label = "lsvl:blue:power";
+ gpios = <&gpio0 40 GPIO_ACTIVE_LOW>;
+ default-state = "keep";
+ };
+ };
+
+ gpio_keys {
+ compatible = "gpio-keys";
+ pinctrl-0 = <&pmx_button_function &pmx_power_switch
+ &pmx_power_auto_switch>;
+ pinctrl-names = "default";
+
+ button@1 {
+ label = "Function Button";
+ linux,code = <KEY_OPTION>;
+ gpios = <&gpio0 45 GPIO_ACTIVE_LOW>;
+ };
+ button@2 {
+ label = "Power-on Switch";
+ linux,code = <KEY_RESERVED>;
+ linux,input-type = <5>;
+ gpios = <&gpio0 46 GPIO_ACTIVE_LOW>;
+ };
+ button@3 {
+ label = "Power-auto Switch";
+ linux,code = <KEY_ESC>;
+ linux,input-type = <5>;
+ gpios = <&gpio0 47 GPIO_ACTIVE_LOW>;
+ };
+ };
+
+ gpio_fan {
+ compatible = "gpio-fan";
+ pinctrl-0 = <&pmx_fan_low &pmx_fan_high &pmx_fan_lock>;
+ pinctrl-names = "default";
+ gpios = <&gpio0 17 GPIO_ACTIVE_LOW
+ &gpio0 16 GPIO_ACTIVE_LOW>;
+ gpio-fan,speed-map = <0 3
+ 1500 2
+ 3250 1
+ 5000 0>;
+ alarm-gpios = <&gpio0 43 GPIO_ACTIVE_HIGH>;
+ };
+
+ restart_poweroff {
+ compatible = "restart-poweroff";
+ };
+
+ regulators {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pinctrl-0 = <&pmx_power_hdd &pmx_usb_vbus>;
+ pinctrl-names = "default";
+
+ usb_power: regulator@1 {
+ compatible = "regulator-fixed";
+ reg = <1>;
+ regulator-name = "USB Power";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ enable-active-high;
+ regulator-always-on;
+ regulator-boot-on;
+ gpio = <&gpio0 12 0>;
+ };
+ hdd_power: regulator@2 {
+ compatible = "regulator-fixed";
+ reg = <2>;
+ regulator-name = "HDD Power";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ enable-active-high;
+ regulator-always-on;
+ regulator-boot-on;
+ gpio = <&gpio0 8 0>;
+ };
+ };
+};
+
+&mdio {
+ status = "okay";
+
+ ethphy0: ethernet-phy@0 {
+ reg = <0>;
+ };
+};
+
+&eth0 {
+ status = "okay";
+ ethernet0-port@0 {
+ phy-handle = <&ethphy0>;
+ };
+};
+
--- linux-3.17.1/arch/arm/mach-mvebu/Kconfig.orig 2014-10-16 18:34:30.893599000 +0900
+++ linux-3.17.1/arch/arm/mach-mvebu/Kconfig 2014-10-16 19:05:14.273599000 +0900
@@ -102,6 +102,13 @@
Say 'Y' here if you want your kernel to support boards based
on the Marvell Kirkwood device tree.

+config MACH_LINKSTATION_LSVL
+ bool "Buffalo LS-VL Series"
+ depends on MACH_KIRKWOOD
+ help
+ Say 'Y' here if you want your kernel to support the
+ Buffalo LS-VL Series.
+
config MACH_NETXBIG
bool "LaCie 2Big and 5Big Network v2"
depends on MACH_KIRKWOOD
--- linux-3.17.1/arch/arm/mach-mvebu/Makefile.orig 2014-10-16 18:35:15.273599000 +0900
+++ linux-3.17.1/arch/arm/mach-mvebu/Makefile 2014-10-16 19:06:00.893599000 +0900
@@ -13,4 +13,5 @@

obj-$(CONFIG_MACH_DOVE) += dove.o
obj-$(CONFIG_MACH_KIRKWOOD) += kirkwood.o kirkwood-pm.o
+obj-$(CONFIG_MACH_LINKSTATION_LSVL) += board-lsvl.o
obj-$(CONFIG_MACH_NETXBIG) += netxbig.o
--- linux-3.17.1/arch/arm/mach-mvebu/board.h.orig 2014-10-16 18:39:07.693599000 +0900
+++ linux-3.17.1/arch/arm/mach-mvebu/board.h 2014-10-16 18:58:03.803599000 +0900
@@ -13,6 +13,12 @@
#ifndef __ARCH_MVEBU_BOARD_H
#define __ARCH_MVEBU_BOARD_H

+#ifdef CONFIG_MACH_LINKSTATION_LSVL
+void lsvl_init(void);
+#else
+static inline void lsvl_init(void) {};
+#endif
+
#ifdef CONFIG_MACH_NETXBIG
void netxbig_init(void);
#else
--- linux-3.17.1/arch/arm/mach-mvebu/kirkwood.c.orig 2014-10-16 18:36:19.043599000 +0900
+++ linux-3.17.1/arch/arm/mach-mvebu/kirkwood.c 2014-10-16 22:58:24.196673000 +0900
@@ -180,6 +180,9 @@
kirkwood_pm_init();
kirkwood_dt_eth_fixup();

+ if (of_machine_is_compatible("buffalo,lsvl"))
+ lsvl_init();
+
if (of_machine_is_compatible("lacie,netxbig"))
netxbig_init();

--- /dev/null 2014-10-16 21:54:30.736509000 +0900
+++ linux-3.17.1/arch/arm/mach-mvebu/board-lsvl.c 2014-10-16 18:37:31.223599000 +0900
@@ -0,0 +1,175 @@
+/*
+ * arch/arm/mach-mvbu/board-lsvl.c
+ *
+ * Buffalo LS-VL Series Setup
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+
+#include <linux/kernel.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include "common.h"
+
+#include <linux/leds.h>
+#include <linux/gpio.h>
+#include <linux/gpio_keys.h>
+#include <linux/input.h>
+#include <linux/gpio-fan.h>
+
+/*****************************************************************************
+ * General Setup
+ ****************************************************************************/
+//LEDs
+#define LSVL_GPIO_LED_ALARM 36
+#define LSVL_GPIO_LED_FUNC_RED 37
+#define LSVL_GPIO_LED_INFO 38
+#define LSVL_GPIO_LED_FUNC_BLUE 39
+#define LSVL_GPIO_LED_PWR 40
+
+// Keys
+#define LSVL_GPIO_KEY_FUNC 45
+#define LSVL_GPIO_KEY_POWER 46
+#define LSVL_GPIO_KEY_AUTOPOWER 47
+
+//Fan
+#define LSVL_GPIO_FAN_HIGH 16
+#define LSVL_GPIO_FAN_LOW 17
+#define LSVL_GPIO_FAN_LOCK 43
+
+/*****************************************************************************
+ * LEDs attached to GPIO
+ ****************************************************************************/
+static struct gpio_led lsvl_led_pins[] = {
+ {
+ .name = "lsvl:red:alarm",
+ .gpio = LSVL_GPIO_LED_ALARM,
+ },
+ {
+ .name = "lsvl:red:func",
+ .gpio = LSVL_GPIO_LED_FUNC_RED,
+ },
+ {
+ .name = "lsvl:amber:info",
+ .gpio = LSVL_GPIO_LED_INFO,
+ },
+ {
+ .name = "lsvl:blue:func",
+ .gpio = LSVL_GPIO_LED_FUNC_BLUE,
+ },
+
+ {
+ .name = "lsvl:blue:power",
+ .default_trigger = "default-on",
+ .gpio = LSVL_GPIO_LED_PWR,
+ .active_low = 1,
+ },
+};
+
+static struct gpio_led_platform_data lsvl_led_data = {
+ .leds = lsvl_led_pins,
+ .num_leds = ARRAY_SIZE(lsvl_led_pins),
+};
+
+static struct platform_device lsvl_leds = {
+ .name = "leds-gpio",
+ .id = -1,
+ .dev = {
+ .platform_data = &lsvl_led_data,
+ }
+};
+
+
+/*****************************************************************************
+ * GPIO Attached Keys
+ ****************************************************************************/
+static struct gpio_keys_button lsvl_buttons[] = {
+ {
+ .type = EV_SW,
+ .code = KEY_RESERVED,
+ .gpio = LSVL_GPIO_KEY_POWER,
+ .desc = "Power-on Switch",
+ .active_low = 1,
+ }, {
+ .type = EV_SW,
+ .code = KEY_ESC,
+ .gpio = LSVL_GPIO_KEY_AUTOPOWER,
+ .desc = "Power-auto Switch",
+ .active_low = 1,
+ }, {
+ .type = EV_KEY,
+ .code = KEY_OPTION,
+ .gpio = LSVL_GPIO_KEY_FUNC,
+ .desc = "Function Button",
+ .active_low = 1,
+ },
+};
+
+static struct gpio_keys_platform_data lsvl_button_data = {
+ .buttons = lsvl_buttons,
+ .nbuttons = ARRAY_SIZE(lsvl_buttons),
+};
+
+static struct platform_device lsvl_button_device = {
+ .name = "gpio-keys",
+ .id = -1,
+ .num_resources = 0,
+ .dev = {
+ .platform_data = &lsvl_button_data,
+ },
+};
+
+/*****************************************************************************
+ * GPIO Fan
+ ****************************************************************************/
+static struct gpio_fan_alarm lsvl_alarm = {
+ .gpio = LSVL_GPIO_FAN_LOCK,
+};
+
+static struct gpio_fan_speed lsvl_speeds[] = {
+ {
+ .rpm = 0,
+ .ctrl_val = 3,
+ }, {
+ .rpm = 1500,
+ .ctrl_val = 1,
+ }, {
+ .rpm = 3250,
+ .ctrl_val = 2,
+ }, {
+ .rpm = 5000,
+ .ctrl_val = 0,
+ }
+};
+
+static int lsvl_gpio_list[] = {
+ LSVL_GPIO_FAN_HIGH, LSVL_GPIO_FAN_LOW,
+};
+
+static struct gpio_fan_platform_data lsvl_fan_data = {
+ .num_ctrl = ARRAY_SIZE(lsvl_gpio_list),
+ .ctrl = lsvl_gpio_list,
+ .alarm = &lsvl_alarm,
+ .num_speed = ARRAY_SIZE(lsvl_speeds),
+ .speed = lsvl_speeds,
+};
+
+static struct platform_device lsvl_fan_device = {
+ .name = "gpio-fan",
+ .id = -1,
+ .num_resources = 0,
+ .dev = {
+ .platform_data = &lsvl_fan_data,
+ },
+};
+
+
+void __init lsvl_init(void)
+{
+ platform_device_register(&lsvl_button_device);
+ platform_device_register(&lsvl_leds);
+ platform_device_register(&lsvl_fan_device);
+}


この記事のスレッド

★の赤文字はこの記事【No.6246】です

返信用投稿フォーム


記事番号【No.6246】に返信投稿する方は下にご記入の上送信してください
お名前:
タイトル:(変更可)
コメント: ↓引用が不要な場合は、適宜削除してください

削除用パスワード。コメントの変更および削除の際必要です
(半角英数字使用)

ボタンは1回だけ押して下さい。押した後にエラーになるかも知れませんが、おそらくちゃんと書込まれています。