Hack BBS
[全部のスレッド一覧][新規投稿][記事の削除・変更]
[Home Page]
返信投稿はタイトルのリンクをクリックして下さい
スレッド【No.6154】の中の記事をすべて表示しています
【No.6154】のスレッド
13/11/19(火) 22:52:18 投稿者[LS-VLユーザー] [No.6154]のスレッド内
- 【No.6154】 タイトル[LS-VL kernel3.12 のパッチ]
この記事がスレッドの最初です
- お借りして申し訳ありません。
chl、xhlはヴァニラに取り込まれましたが、LS-VL大好きな人が一人でもメンテしてくれればとの願いを込めて...
MTDは3.3.4のソースを仕事の合間に眺めながら探っていますが時間がなくてマージできていません。
---
--- linux-3.12/arch/arm/mach-kirkwood/Kconfig.orig 2013-11-10 20:15:24.825218000 +0900
+++ linux-3.12/arch/arm/mach-kirkwood/Kconfig 2013-11-10 20:19:24.725218000 +0900
@@ -112,6 +112,12 @@
help
Say 'Y' here if you want your kernel to support the
Marvell 88F6281 GTW GE Board (Flattened Device Tree).
+config MACH_LSVL
+ bool "Buffalo LS-VL Series"
+ select KIRKWOOD_LEGACY
+ help
+ Say 'Y' here if you want your kernel to support the
+ Buffalo LS-VL Series.
endmenu
--- linux-3.12/arch/arm/mach-kirkwood/Makefile.orig 2013-11-10 20:16:46.515218000 +0900
+++ linux-3.12/arch/arm/mach-kirkwood/Makefile 2013-11-10 20:20:52.665218000 +0900
@@ -9,6 +9,7 @@
obj-$(CONFIG_MACH_T5325) += t5325-setup.o
obj-$(CONFIG_MACH_TS219) += ts219-setup.o tsx1x-common.o
obj-$(CONFIG_MACH_TS41X) += ts41x-setup.o tsx1x-common.o
+obj-$(CONFIG_MACH_LSVL) += lsvl-setup.o
obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o
obj-$(CONFIG_MACH_MV88F6281GTW_GE_DT) += board-mv88f6281gtw_ge.o
--- /dev/null 2013-11-09 21:16:48.277521000 +0900
+++ linux-3.12/arch/arm/mach-kirkwood/lsvl-setup.c 2013-11-11 00:05:53.075218000 +0900
@@ -0,0 +1,263 @@
+/*
+ * arch/arm/mach-kirkwood/lsvl-setup.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/init.h>
+#include <linux/platform_device.h>
+#include <linux/ata_platform.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
+#include <linux/spi/flash.h>
+#include <linux/spi/spi.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/gpio.h>
+#include <linux/leds.h>
+#include <linux/gpio_keys.h>
+#include <linux/input.h>
+#include <linux/gpio-fan.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/kirkwood.h>
+#include <linux/platform_data/mmc-mvsdio.h>
+#include "common.h"
+#include "mpp.h"
+
+static struct mv643xx_eth_platform_data lsvl_ge00_data = {
+ .phy_addr = MV643XX_ETH_PHY_ADDR(0),
+};
+
+static struct mv_sata_platform_data lsvl_sata_data = {
+ .n_ports = 1,
+};
+
+#define LSVL_GPIO_KEY_FUNC 45
+#define LSVL_GPIO_KEY_POWER 46
+#define LSVL_GPIO_KEY_AUTOPOWER 47
+
+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,
+ },
+};
+
+#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
+
+static struct gpio_led lsvl_led_pins[] = {
+ {
+ .name = "alarm:red",
+ .gpio = LSVL_GPIO_LED_ALARM,
+ },
+ {
+ .name = "func:red:bottom",
+ .gpio = LSVL_GPIO_LED_FUNC_RED,
+ },
+ {
+ .name = "info:amber",
+ .gpio = LSVL_GPIO_LED_INFO,
+ },
+ {
+ .name = "func:blue:bottom",
+ .gpio = LSVL_GPIO_LED_FUNC_BLUE,
+ },
+
+ {
+ .name = "power:blue",
+ .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,
+ }
+};
+
+#define LSVL_GPIO_FAN_HIGH 16
+#define LSVL_GPIO_FAN_LOW 17
+#define LSVL_GPIO_FAN_LOCK 43
+
+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,
+ },
+};
+
+static unsigned int lsvl_mpp_config[] __initdata = {
+ MPP0_NF_IO2,
+ MPP1_NF_IO3,
+ MPP2_NF_IO4,
+ MPP3_NF_IO5,
+ MPP4_NF_IO6,
+ MPP5_NF_IO7,
+ MPP6_SYSRST_OUTn,
+ MPP7_SPI_SCn,
+ MPP8_GPIO, /* HDD Power */
+ MPP9_GPIO,
+ MPP10_UART0_TXD,
+ MPP11_UART0_RXD,
+ MPP12_GPO, /* USB VBUS EN */
+ MPP13_GPIO,
+ MPP14_GPIO,
+ MPP15_GPIO,
+ MPP16_GPIO, /* FAN HIGH: on:0, off:1 */
+ MPP17_GPIO, /* FAN LOW: on:0, off:1 */
+ MPP18_NF_IO0,
+ MPP19_NF_IO1,
+ MPP20_GPIO,
+ MPP21_GPIO,
+ MPP22_GPIO,
+ MPP23_GPIO,
+ MPP24_GPIO,
+ MPP25_GPIO,
+ MPP26_GPIO,
+ MPP27_GPIO,
+ MPP28_GPIO,
+ MPP29_GPIO,
+ MPP30_GPIO,
+ MPP31_GPIO,
+ MPP32_GPIO,
+ MPP33_GPO,
+ MPP34_GPIO,
+ MPP35_GPIO,
+ MPP36_GPIO, /* ALARM LED */
+ MPP37_GPIO, /* FUNC RED LED */
+ MPP38_GPIO, /* INFO LED */
+ MPP39_GPIO, /* FUNC LED */
+ MPP40_GPIO, /* POWER LED */
+ MPP41_GPIO,
+ MPP42_GPIO,
+ MPP43_GPIO, /* FAN LOCK */
+ MPP44_GPIO,
+ MPP45_GPIO, /* FUNC SW */
+ MPP46_GPIO, /* POWER SW */
+ MPP47_GPIO, /* POWER AUTO SW */
+ MPP48_GPIO, /* UART EN */
+ MPP49_GPIO,
+ 0
+};
+
+static void lsvl_power_off(void)
+{
+ kirkwood_restart('h', NULL);
+}
+
+static void __init lsvl_init(void)
+{
+ /*
+ * Basic setup. Needs to be called early.
+ */
+ kirkwood_init();
+ kirkwood_mpp_conf(lsvl_mpp_config);
+
+ kirkwood_spi_init();
+ kirkwood_uart0_init();
+
+ if (gpio_request(12, "USB Power Enable") != 0 ||
+ gpio_direction_output(12, 1) != 0)
+ pr_err("can't set up GPIO 12 (USB Power Enable)\n");
+ kirkwood_ehci_init();
+
+ kirkwood_ge00_init(&lsvl_ge00_data);
+ kirkwood_sata_init(&lsvl_sata_data);
+
+ platform_device_register(&lsvl_leds);
+ platform_device_register(&lsvl_button_device);
+ platform_device_register(&lsvl_fan_device);
+
+ /* register power-off method */
+ pm_power_off = lsvl_power_off;
+}
+
+MACHINE_START(LSVL, "Buffalo LS-VL Series")
+ .atag_offset = 0x100,
+ .init_machine = lsvl_init,
+ .map_io = kirkwood_map_io,
+ .init_early = kirkwood_init_early,
+ .init_irq = kirkwood_init_irq,
+ .init_time = kirkwood_timer_init,
+ .restart = kirkwood_restart,
+MACHINE_END
--- linux-3.12/arch/arm/tools/mach-types.orig 2013-11-10 20:16:04.345218000 +0900
+++ linux-3.12/arch/arm/tools/mach-types 2013-11-10 20:22:15.295218000 +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_LSVL LSVL 527
edb9302 MACH_EDB9302 EDB9302 538
husky MACH_HUSKY HUSKY 543
shepherd MACH_SHEPHERD SHEPHERD 545