Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: dts: Convert Linkstation Mini to Device Tree

The title says it all. The name of the dts file as been changed to
better reflect the manufacturer's device name (LS-WSGL), rather than
the original "lsmini", which exists in a kirkwood version too.

[gregory.clement@free-electrons.com]: use tab instead of space to
indent dts at line 185. Reslove merge conflict with patch "ARM: dts:
orion5x: add buffalo linkstation ls-wtgl" in the file
arch/arm/boot/dts/Makefile.

Signed-off-by: Benjamin Cama <benoar@dolka.fr>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Alexey Kopytko <alexey@kopytko.ru>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>

authored by

Benjamin Cama and committed by
Gregory CLEMENT
15979aee cba3bbcb

+280 -284
+1
arch/arm/boot/dts/Makefile
··· 467 467 orion5x-lacie-d2-network.dtb \ 468 468 orion5x-lacie-ethernet-disk-mini-v2.dtb \ 469 469 orion5x-linkstation-lswtgl.dtb \ 470 + orion5x-lswsgl.dtb \ 470 471 orion5x-maxtor-shared-storage-2.dtb \ 471 472 orion5x-rd88f5182-nas.dtb 472 473 dtb-$(CONFIG_ARCH_PRIMA2) += \
+276
arch/arm/boot/dts/orion5x-lswsgl.dts
··· 1 + /* 2 + * Copyright (C) 2015 Benjamin Cama <benoar@dolka.fr> 3 + * Copyright (C) 2014 Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 4 + * Based on the board file arch/arm/mach-orion5x/lsmini-setup.c, 5 + * Copyright (C) 2008 Alexey Kopytko <alexey@kopytko.ru> 6 + * 7 + * This file is dual-licensed: you can use it either under the terms 8 + * of the GPL or the X11 license, at your option. Note that this dual 9 + * licensing only applies to this file, and not this project as a 10 + * whole. 11 + * 12 + * a) This file is free software; you can redistribute it and/or 13 + * modify it under the terms of the GNU General Public License as 14 + * published by the Free Software Foundation; either version 2 of the 15 + * License, or (at your option) any later version. 16 + * 17 + * This file is distributed in the hope that it will be useful 18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 + * GNU General Public License for more details. 21 + * 22 + * Or, alternatively 23 + * 24 + * b) Permission is hereby granted, free of charge, to any person 25 + * obtaining a copy of this software and associated documentation 26 + * files (the "Software"), to deal in the Software without 27 + * restriction, including without limitation the rights to use 28 + * copy, modify, merge, publish, distribute, sublicense, and/or 29 + * sell copies of the Software, and to permit persons to whom the 30 + * Software is furnished to do so, subject to the following 31 + * conditions: 32 + * 33 + * The above copyright notice and this permission notice shall be 34 + * included in all copies or substantial portions of the Software. 35 + * 36 + * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND 37 + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 38 + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 39 + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 40 + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY 41 + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 42 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 43 + * OTHER DEALINGS IN THE SOFTWARE. 44 + */ 45 + 46 + /dts-v1/; 47 + 48 + #include <dt-bindings/gpio/gpio.h> 49 + #include <dt-bindings/input/input.h> 50 + #include <dt-bindings/interrupt-controller/irq.h> 51 + #include "orion5x-mv88f5182.dtsi" 52 + 53 + / { 54 + model = "Buffalo Linkstation Mini (LS-WSGL)"; 55 + compatible = "buffalo,lswsgl", "marvell,orion5x-88f5182", "marvell,orion5x"; 56 + 57 + memory { 58 + reg = <0x00000000 0x8000000>; /* 128 MB */ 59 + }; 60 + 61 + chosen { 62 + bootargs = "console=ttyS0,115200 earlyprintk"; 63 + linux,stdout-path = &uart0; 64 + }; 65 + 66 + soc { 67 + ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>, 68 + <MBUS_ID(0x09, 0x00) 0 0xf2200000 0x800>, 69 + <MBUS_ID(0x01, 0x0f) 0 0xf4000000 0x40000>; 70 + }; 71 + 72 + gpio-keys { 73 + compatible = "gpio-keys"; 74 + pinctrl-0 = <&pmx_buttons>; 75 + pinctrl-names = "default"; 76 + #address-cells = <1>; 77 + #size-cells = <0>; 78 + func { 79 + label = "Function Button"; 80 + linux,code = <KEY_OPTION>; 81 + gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; 82 + }; 83 + 84 + power { 85 + label = "Power-on Switch"; 86 + linux,input-type = <5>; /* EV_SW */ 87 + linux,code = <KEY_RESERVED>; /* LSMINI_SW_POWER */ 88 + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; 89 + }; 90 + 91 + autopower { 92 + label = "Power-auto Switch"; 93 + linux,input-type = <5>; /* EV_SW */ 94 + linux,code = <KEY_ESC>; /* LSMINI_SW_AUTOPOWER */ 95 + gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; 96 + }; 97 + }; 98 + 99 + gpio-leds { 100 + compatible = "gpio-leds"; 101 + pinctrl-0 = <&pmx_led_alarm &pmx_led_info &pmx_led_func 102 + &pmx_led_power>; 103 + pinctrl-names = "default"; 104 + 105 + alarm { 106 + label = "lswsgl:alarm:red"; 107 + gpio = <&gpio0 2 GPIO_ACTIVE_LOW>; 108 + }; 109 + 110 + info { 111 + label = "lswsgl:info:amber"; 112 + gpio = <&gpio0 3 GPIO_ACTIVE_LOW>; 113 + }; 114 + 115 + func { 116 + label = "lswsgl:func:blue:top"; 117 + gpio = <&gpio0 9 GPIO_ACTIVE_LOW>; 118 + }; 119 + 120 + power { 121 + label = "lswsgl:power:blue:bottom"; 122 + gpio = <&gpio0 14 GPIO_ACTIVE_LOW>; 123 + default-state = "on"; 124 + }; 125 + }; 126 + 127 + restart_poweroff { 128 + compatible = "restart-poweroff"; 129 + }; 130 + 131 + regulators { 132 + compatible = "simple-bus"; 133 + #address-cells = <1>; 134 + #size-cells = <0>; 135 + pinctrl-0 = <&pmx_sata0_power &pmx_sata1_power &pmx_usb_power>; 136 + pinctrl-names = "default"; 137 + 138 + sata0_power: regulator@0 { 139 + compatible = "regulator-fixed"; 140 + reg = <0>; 141 + regulator-name = "SATA0 Power"; 142 + regulator-min-microvolt = <5000000>; 143 + regulator-max-microvolt = <5000000>; 144 + enable-active-high; 145 + regulator-always-on; 146 + regulator-boot-on; 147 + gpio = <&gpio0 1 GPIO_ACTIVE_HIGH>; 148 + }; 149 + 150 + sata1_power: regulator@1 { 151 + compatible = "regulator-fixed"; 152 + reg = <1>; 153 + regulator-name = "SATA1 Power"; 154 + regulator-min-microvolt = <5000000>; 155 + regulator-max-microvolt = <5000000>; 156 + enable-active-high; 157 + regulator-always-on; 158 + regulator-boot-on; 159 + gpio = <&gpio0 19 GPIO_ACTIVE_HIGH>; 160 + }; 161 + 162 + usb_power: regulator@2 { 163 + compatible = "regulator-fixed"; 164 + reg = <2>; 165 + regulator-name = "USB Power"; 166 + regulator-min-microvolt = <5000000>; 167 + regulator-max-microvolt = <5000000>; 168 + enable-active-high; 169 + regulator-always-on; 170 + regulator-boot-on; 171 + gpio = <&gpio0 16 GPIO_ACTIVE_HIGH>; 172 + }; 173 + }; 174 + }; 175 + 176 + &devbus_bootcs { 177 + status = "okay"; 178 + 179 + devbus,keep-config; 180 + 181 + flash@0 { 182 + compatible = "cfi-flash"; 183 + reg = <0 0x40000>; 184 + bank-width = <1>; 185 + #address-cells = <1>; 186 + #size-cells = <1>; 187 + 188 + partition@0 { 189 + label = "Full256Kb"; 190 + reg = <0 0x40000>; 191 + read-only; 192 + }; 193 + }; 194 + }; 195 + 196 + &mdio { 197 + status = "okay"; 198 + 199 + ethphy: ethernet-phy { 200 + reg = <8>; 201 + }; 202 + }; 203 + 204 + &ehci0 { 205 + status = "okay"; 206 + }; 207 + 208 + &eth { 209 + status = "okay"; 210 + 211 + ethernet-port@0 { 212 + phy-handle = <&ethphy>; 213 + }; 214 + }; 215 + 216 + &i2c { 217 + status = "okay"; 218 + clock-frequency = <100000>; 219 + #address-cells = <1>; 220 + 221 + rtc@32 { 222 + compatible = "ricoh,rs5c372a"; 223 + reg = <0x32>; 224 + }; 225 + }; 226 + 227 + &pinctrl { 228 + pmx_buttons: pmx-buttons { 229 + marvell,pins = "mpp15", "mpp17", "mpp18"; 230 + marvell,function = "gpio"; 231 + }; 232 + 233 + pmx_led_alarm: pmx-leds { 234 + marvell,pins = "mpp2"; 235 + marvell,function = "gpio"; 236 + }; 237 + 238 + pmx_led_info: pmx-leds { 239 + marvell,pins = "mpp3"; 240 + marvell,function = "gpio"; 241 + }; 242 + 243 + pmx_led_func: pmx-leds { 244 + marvell,pins = "mpp9"; 245 + marvell,function = "gpio"; 246 + }; 247 + 248 + pmx_led_power: pmx-leds { 249 + marvell,pins = "mpp14"; 250 + marvell,function = "gpio"; 251 + }; 252 + 253 + pmx_sata0_power: pmx-sata0-power { 254 + marvell,pins = "mpp1"; 255 + marvell,function = "gpio"; 256 + }; 257 + 258 + pmx_sata1_power: pmx-sata1-power { 259 + marvell,pins = "mpp19"; 260 + marvell,function = "gpio"; 261 + }; 262 + 263 + pmx_usb_power: pmx-usb-power { 264 + marvell,pins = "mpp16"; 265 + marvell,function = "gpio"; 266 + }; 267 + }; 268 + 269 + &sata { 270 + status = "okay"; 271 + nr-ports = <2>; 272 + }; 273 + 274 + &uart0 { 275 + status = "okay"; 276 + };
+3 -3
arch/arm/mach-orion5x/Kconfig
··· 78 78 Buffalo Linkstation Live v3 (LS-CHL) platform. 79 79 80 80 config MACH_LINKSTATION_MINI 81 - bool "Buffalo Linkstation Mini" 82 - select I2C_BOARDINFO 81 + bool "Buffalo Linkstation Mini (Flattened Device Tree)" 82 + select ARCH_ORION5X_DT 83 83 help 84 84 Say 'Y' here if you want your kernel to support the 85 - Buffalo Linkstation Mini platform. 85 + Buffalo Linkstation Mini (LS-WSGL) platform. 86 86 87 87 config MACH_LINKSTATION_LS_HGL 88 88 bool "Buffalo Linkstation LS-HGL"
-1
arch/arm/mach-orion5x/Makefile
··· 4 4 obj-$(CONFIG_MACH_KUROBOX_PRO) += kurobox_pro-setup.o 5 5 obj-$(CONFIG_MACH_TERASTATION_PRO2) += terastation_pro2-setup.o 6 6 obj-$(CONFIG_MACH_LINKSTATION_PRO) += kurobox_pro-setup.o 7 - obj-$(CONFIG_MACH_LINKSTATION_MINI) += lsmini-setup.o 8 7 obj-$(CONFIG_MACH_LINKSTATION_LS_HGL) += ls_hgl-setup.o 9 8 obj-$(CONFIG_MACH_DNS323) += dns323-setup.o 10 9 obj-$(CONFIG_MACH_TS209) += ts209-setup.o tsx09-common.o
-280
arch/arm/mach-orion5x/lsmini-setup.c
··· 1 - /* 2 - * arch/arm/mach-orion5x/lsmini-setup.c 3 - * 4 - * Maintainer: Alexey Kopytko <alexey@kopytko.ru> 5 - * 6 - * This file is licensed under the terms of the GNU General Public 7 - * License version 2. This program is licensed "as is" without any 8 - * warranty of any kind, whether express or implied. 9 - */ 10 - 11 - #include <linux/kernel.h> 12 - #include <linux/init.h> 13 - #include <linux/platform_device.h> 14 - #include <linux/mtd/physmap.h> 15 - #include <linux/mv643xx_eth.h> 16 - #include <linux/leds.h> 17 - #include <linux/gpio_keys.h> 18 - #include <linux/input.h> 19 - #include <linux/i2c.h> 20 - #include <linux/ata_platform.h> 21 - #include <linux/gpio.h> 22 - #include <asm/mach-types.h> 23 - #include <asm/mach/arch.h> 24 - #include <mach/orion5x.h> 25 - #include "common.h" 26 - #include "mpp.h" 27 - 28 - /***************************************************************************** 29 - * Linkstation Mini Info 30 - ****************************************************************************/ 31 - 32 - /* 33 - * 256K NOR flash Device bus boot chip select 34 - */ 35 - 36 - #define LSMINI_NOR_BOOT_BASE 0xf4000000 37 - #define LSMINI_NOR_BOOT_SIZE SZ_256K 38 - 39 - /***************************************************************************** 40 - * 256KB NOR Flash on BOOT Device 41 - ****************************************************************************/ 42 - 43 - static struct physmap_flash_data lsmini_nor_flash_data = { 44 - .width = 1, 45 - }; 46 - 47 - static struct resource lsmini_nor_flash_resource = { 48 - .flags = IORESOURCE_MEM, 49 - .start = LSMINI_NOR_BOOT_BASE, 50 - .end = LSMINI_NOR_BOOT_BASE + LSMINI_NOR_BOOT_SIZE - 1, 51 - }; 52 - 53 - static struct platform_device lsmini_nor_flash = { 54 - .name = "physmap-flash", 55 - .id = 0, 56 - .dev = { 57 - .platform_data = &lsmini_nor_flash_data, 58 - }, 59 - .num_resources = 1, 60 - .resource = &lsmini_nor_flash_resource, 61 - }; 62 - 63 - /***************************************************************************** 64 - * Ethernet 65 - ****************************************************************************/ 66 - 67 - static struct mv643xx_eth_platform_data lsmini_eth_data = { 68 - .phy_addr = 8, 69 - }; 70 - 71 - /***************************************************************************** 72 - * RTC 5C372a on I2C bus 73 - ****************************************************************************/ 74 - 75 - static struct i2c_board_info __initdata lsmini_i2c_rtc = { 76 - I2C_BOARD_INFO("rs5c372a", 0x32), 77 - }; 78 - 79 - /***************************************************************************** 80 - * LEDs attached to GPIO 81 - ****************************************************************************/ 82 - 83 - #define LSMINI_GPIO_LED_ALARM 2 84 - #define LSMINI_GPIO_LED_INFO 3 85 - #define LSMINI_GPIO_LED_FUNC 9 86 - #define LSMINI_GPIO_LED_PWR 14 87 - 88 - static struct gpio_led lsmini_led_pins[] = { 89 - { 90 - .name = "alarm:red", 91 - .gpio = LSMINI_GPIO_LED_ALARM, 92 - .active_low = 1, 93 - }, { 94 - .name = "info:amber", 95 - .gpio = LSMINI_GPIO_LED_INFO, 96 - .active_low = 1, 97 - }, { 98 - .name = "func:blue:top", 99 - .gpio = LSMINI_GPIO_LED_FUNC, 100 - .active_low = 1, 101 - }, { 102 - .name = "power:blue:bottom", 103 - .gpio = LSMINI_GPIO_LED_PWR, 104 - }, 105 - }; 106 - 107 - static struct gpio_led_platform_data lsmini_led_data = { 108 - .leds = lsmini_led_pins, 109 - .num_leds = ARRAY_SIZE(lsmini_led_pins), 110 - }; 111 - 112 - static struct platform_device lsmini_leds = { 113 - .name = "leds-gpio", 114 - .id = -1, 115 - .dev = { 116 - .platform_data = &lsmini_led_data, 117 - }, 118 - }; 119 - 120 - /**************************************************************************** 121 - * GPIO Attached Keys 122 - ****************************************************************************/ 123 - 124 - #define LSMINI_GPIO_KEY_FUNC 15 125 - #define LSMINI_GPIO_KEY_POWER 18 126 - #define LSMINI_GPIO_KEY_AUTOPOWER 17 127 - 128 - #define LSMINI_SW_POWER 0x00 129 - #define LSMINI_SW_AUTOPOWER 0x01 130 - 131 - static struct gpio_keys_button lsmini_buttons[] = { 132 - { 133 - .code = KEY_OPTION, 134 - .gpio = LSMINI_GPIO_KEY_FUNC, 135 - .desc = "Function Button", 136 - .active_low = 1, 137 - }, { 138 - .type = EV_SW, 139 - .code = LSMINI_SW_POWER, 140 - .gpio = LSMINI_GPIO_KEY_POWER, 141 - .desc = "Power-on Switch", 142 - .active_low = 1, 143 - }, { 144 - .type = EV_SW, 145 - .code = LSMINI_SW_AUTOPOWER, 146 - .gpio = LSMINI_GPIO_KEY_AUTOPOWER, 147 - .desc = "Power-auto Switch", 148 - .active_low = 1, 149 - }, 150 - }; 151 - 152 - static struct gpio_keys_platform_data lsmini_button_data = { 153 - .buttons = lsmini_buttons, 154 - .nbuttons = ARRAY_SIZE(lsmini_buttons), 155 - }; 156 - 157 - static struct platform_device lsmini_button_device = { 158 - .name = "gpio-keys", 159 - .id = -1, 160 - .num_resources = 0, 161 - .dev = { 162 - .platform_data = &lsmini_button_data, 163 - }, 164 - }; 165 - 166 - 167 - /***************************************************************************** 168 - * SATA 169 - ****************************************************************************/ 170 - static struct mv_sata_platform_data lsmini_sata_data = { 171 - .n_ports = 2, 172 - }; 173 - 174 - 175 - /***************************************************************************** 176 - * Linkstation Mini specific power off method: reboot 177 - ****************************************************************************/ 178 - /* 179 - * On the Linkstation Mini, the shutdown process is following: 180 - * - Userland monitors key events until the power switch goes to off position 181 - * - The board reboots 182 - * - U-boot starts and goes into an idle mode waiting for the user 183 - * to move the switch to ON position 184 - */ 185 - 186 - static void lsmini_power_off(void) 187 - { 188 - orion5x_restart(REBOOT_HARD, NULL); 189 - } 190 - 191 - 192 - /***************************************************************************** 193 - * General Setup 194 - ****************************************************************************/ 195 - 196 - #define LSMINI_GPIO_USB_POWER 16 197 - #define LSMINI_GPIO_AUTO_POWER 17 198 - #define LSMINI_GPIO_POWER 18 199 - 200 - #define LSMINI_GPIO_HDD_POWER0 1 201 - #define LSMINI_GPIO_HDD_POWER1 19 202 - 203 - static unsigned int lsmini_mpp_modes[] __initdata = { 204 - MPP0_UNUSED, /* LED_RESERVE1 (unused) */ 205 - MPP1_GPIO, /* HDD_PWR */ 206 - MPP2_GPIO, /* LED_ALARM */ 207 - MPP3_GPIO, /* LED_INFO */ 208 - MPP4_UNUSED, 209 - MPP5_UNUSED, 210 - MPP6_UNUSED, 211 - MPP7_UNUSED, 212 - MPP8_UNUSED, 213 - MPP9_GPIO, /* LED_FUNC */ 214 - MPP10_UNUSED, 215 - MPP11_UNUSED, /* LED_ETH (dummy) */ 216 - MPP12_UNUSED, 217 - MPP13_UNUSED, 218 - MPP14_GPIO, /* LED_PWR */ 219 - MPP15_GPIO, /* FUNC */ 220 - MPP16_GPIO, /* USB_PWR */ 221 - MPP17_GPIO, /* AUTO_POWER */ 222 - MPP18_GPIO, /* POWER */ 223 - MPP19_GPIO, /* HDD_PWR1 */ 224 - 0, 225 - }; 226 - 227 - static void __init lsmini_init(void) 228 - { 229 - /* 230 - * Setup basic Orion functions. Need to be called early. 231 - */ 232 - orion5x_init(); 233 - 234 - orion5x_mpp_conf(lsmini_mpp_modes); 235 - 236 - /* 237 - * Configure peripherals. 238 - */ 239 - orion5x_ehci0_init(); 240 - orion5x_ehci1_init(); 241 - orion5x_eth_init(&lsmini_eth_data); 242 - orion5x_i2c_init(); 243 - orion5x_sata_init(&lsmini_sata_data); 244 - orion5x_uart0_init(); 245 - orion5x_xor_init(); 246 - 247 - mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET, 248 - ORION_MBUS_DEVBUS_BOOT_ATTR, 249 - LSMINI_NOR_BOOT_BASE, 250 - LSMINI_NOR_BOOT_SIZE); 251 - platform_device_register(&lsmini_nor_flash); 252 - 253 - platform_device_register(&lsmini_button_device); 254 - 255 - platform_device_register(&lsmini_leds); 256 - 257 - i2c_register_board_info(0, &lsmini_i2c_rtc, 1); 258 - 259 - /* enable USB power */ 260 - gpio_set_value(LSMINI_GPIO_USB_POWER, 1); 261 - 262 - /* register power-off method */ 263 - pm_power_off = lsmini_power_off; 264 - 265 - pr_info("%s: finished\n", __func__); 266 - } 267 - 268 - #ifdef CONFIG_MACH_LINKSTATION_MINI 269 - MACHINE_START(LINKSTATION_MINI, "Buffalo Linkstation Mini") 270 - /* Maintainer: Alexey Kopytko <alexey@kopytko.ru> */ 271 - .atag_offset = 0x100, 272 - .init_machine = lsmini_init, 273 - .map_io = orion5x_map_io, 274 - .init_early = orion5x_init_early, 275 - .init_irq = orion5x_init_irq, 276 - .init_time = orion5x_timer_init, 277 - .fixup = tag_fixup_mem32, 278 - .restart = orion5x_restart, 279 - MACHINE_END 280 - #endif