Buffalo NAS-Central Forums

Welcome to the Linkstation Wiki community
It is currently Thu Aug 16, 2018 6:23 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 36 posts ]  Go to page Previous 1 2 3
Author Message
PostPosted: Mon Jun 15, 2009 9:01 pm 
Offline
Regular Member

Joined: Mon Nov 07, 2005 4:37 pm
Posts: 205
Location: Germany
Okay - i checked the buffalo stock sources, compare it with the lsmini-setup.c and create an own one for the ls pro duo (Attention: Revision 1!!!!). Here the diff:
Code:
diff -ruN linux-2.6.30/arch/arm/configs/orion5x_defconfig linux-2.6.30.mod1/arch/arm/configs/orion5x_defconfig
--- linux-2.6.30/arch/arm/configs/orion5x_defconfig     2009-06-10 05:05:27.000000000 +0200
+++ linux-2.6.30.mod1/arch/arm/configs/orion5x_defconfig        2009-06-15 21:05:12.000000000 +0200
@@ -182,6 +182,7 @@
 CONFIG_MACH_TERASTATION_PRO2=y
 CONFIG_MACH_LINKSTATION_PRO=y
 CONFIG_MACH_LINKSTATION_MINI=y
+CONFIG_MACH_LINKSTATION_PRODUO=y
 CONFIG_MACH_TS409=y
 CONFIG_MACH_WRT350N_V2=y
 CONFIG_MACH_TS78XX=y
diff -ruN linux-2.6.30/arch/arm/mach-orion5x/Kconfig linux-2.6.30.mod1/arch/arm/mach-orion5x/Kconfig
--- linux-2.6.30/arch/arm/mach-orion5x/Kconfig  2009-06-10 05:05:27.000000000 +0200
+++ linux-2.6.30.mod1/arch/arm/mach-orion5x/Kconfig     2009-06-15 21:05:12.000000000 +0200
@@ -57,6 +57,13 @@
          Say 'Y' here if you want your kernel to support the
          Buffalo Linkstation Mini platform.

+config MACH_LINKSTATION_PRODUO
+       bool "Buffalo Linkstation Pro Duo"
+       select I2C_BOARDINFO
+       help
+         Say 'Y' here if you want your kernel to support the
+         Buffalo Linkstation Pro Duo platform.
+
 config MACH_TS409
        bool "QNAP TS-409"
        help
diff -ruN linux-2.6.30/arch/arm/mach-orion5x/lsproduo-setup.c linux-2.6.30.mod1/arch/arm/mach-orion5x/lsproduo-setup.c
--- linux-2.6.30/arch/arm/mach-orion5x/lsproduo-setup.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.30.mod1/arch/arm/mach-orion5x/lsproduo-setup.c    2009-06-15 21:56:14.000000000 +0200
@@ -0,0 +1,268 @@
+/*
+ * arch/arm/mach-orion5x/lsproduo-setup.c
+ *
+ * Source taken from arch/arm/mach-orion5x/lsmini-setup.c - kernel 2.6.30
+ * Maintainer: Manuel Bernhardt <prodigy7@gmail.com>
+ *
+ * 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/pci.h>
+#include <linux/mtd/physmap.h>
+#include <linux/mv643xx_eth.h>
+#include <linux/leds.h>
+#include <linux/gpio_keys.h>
+#include <linux/input.h>
+#include <linux/i2c.h>
+#include <linux/ata_platform.h>
+#include <asm/mach-types.h>
+#include <linux/gpio.h>
+#include <asm/mach/arch.h>
+#include "common.h"
+#include "mpp.h"
+#include "include/mach/system.h"
+
+/*****************************************************************************
+ * Linkstation Pro Duo Info
+ ****************************************************************************/
+
+/*
+ * 256K NOR flash Device bus boot chip select
+ */
+
+#define LSPRODUO_NOR_BOOT_BASE 0xf4000000
+#define LSPRODUO_NOR_BOOT_SIZE SZ_256K
+
+/*****************************************************************************
+ * 256KB NOR Flash on BOOT Device
+ ****************************************************************************/
+
+static struct physmap_flash_data lsproduo_nor_flash_data = {
+       .width          = 1,
+};
+
+static struct resource lsproduo_nor_flash_resource = {
+       .flags  = IORESOURCE_MEM,
+       .start  = LSPRODUO_NOR_BOOT_BASE,
+       .end    = LSPRODUO_NOR_BOOT_BASE + LSPRODUO_NOR_BOOT_SIZE - 1,
+};
+
+static struct platform_device lsproduo_nor_flash = {
+       .name                   = "physmap-flash",
+       .id                     = 0,
+       .dev            = {
+               .platform_data  = &lsproduo_nor_flash_data,
+       },
+       .num_resources          = 1,
+       .resource               = &lsproduo_nor_flash_resource,
+};
+
+/*****************************************************************************
+ * Ethernet
+ ****************************************************************************/
+
+static struct mv643xx_eth_platform_data lsproduo_eth_data = {
+       .phy_addr       = 8,
+};
+
+/*****************************************************************************
+ * RTC 5C372a on I2C bus
+ ****************************************************************************/
+
+static struct i2c_board_info __initdata lsproduo_i2c_rtc = {
+       I2C_BOARD_INFO("rs5c372a", 0x32),
+};
+
+/*****************************************************************************
+ * LEDs attached to GPIO
+ ****************************************************************************/
+
+#define LSPRODUO_GPIO_LED_ALARM        2
+#define LSPRODUO_GPIO_LED_INFO 3
+#define LSPRODUO_GPIO_LED_PWR  0
+
+static struct gpio_led lsproduo_led_pins[] = {
+       {
+               .name      = "alarm:red",
+               .gpio      = LSPRODUO_GPIO_LED_ALARM,
+               .active_low     = 1,
+       }, {
+               .name      = "info:amber",
+               .gpio      = LSPRODUO_GPIO_LED_INFO,
+               .active_low     = 1,
+       }, {
+               .name      = "power:blue:bottom",
+               .gpio      = LSPRODUO_GPIO_LED_PWR,
+       },
+};
+
+static struct gpio_led_platform_data lsproduo_led_data = {
+       .leds      = lsproduo_led_pins,
+       .num_leds       = ARRAY_SIZE(lsproduo_led_pins),
+};
+
+static struct platform_device lsproduo_leds = {
+       .name   = "leds-gpio",
+       .id     = -1,
+       .dev    = {
+               .platform_data  = &lsproduo_led_data,
+       },
+};
+
+/****************************************************************************
+ * GPIO Attached Keys
+ ****************************************************************************/
+
+#define LSPRODUO_GPIO_KEY_POWER                8
+#define LSPRODUO_GPIO_KEY_AUTOPOWER    10
+
+#define LSPRODUO_SW_POWER              0x00
+#define LSPRODUO_SW_AUTOPOWER          0x01
+
+static struct gpio_keys_button lsproduo_buttons[] = {
+       {
+               .type           = EV_SW,
+               .code      = LSPRODUO_SW_POWER,
+               .gpio      = LSPRODUO_GPIO_KEY_POWER,
+               .desc      = "Power-on Switch",
+               .active_low     = 1,
+       }, {
+               .type           = EV_SW,
+               .code      = LSPRODUO_SW_AUTOPOWER,
+               .gpio      = LSPRODUO_GPIO_KEY_AUTOPOWER,
+               .desc      = "Power-auto Switch",
+               .active_low     = 1,
+       },
+};
+
+static struct gpio_keys_platform_data lsproduo_button_data = {
+       .buttons        = lsproduo_buttons,
+       .nbuttons       = ARRAY_SIZE(lsproduo_buttons),
+};
+
+static struct platform_device lsproduo_button_device = {
+       .name      = "gpio-keys",
+       .id          = -1,
+       .num_resources  = 0,
+       .dev        = {
+               .platform_data  = &lsproduo_button_data,
+       },
+};
+
+
+/*****************************************************************************
+ * SATA
+ ****************************************************************************/
+static struct mv_sata_platform_data lsproduo_sata_data = {
+       .n_ports        = 2,
+};
+
+
+/*****************************************************************************
+ * Linkstation Pro Duo specific power off method: reboot
+ ****************************************************************************/
+/*
+ * On the Linkstation Pro Duo, the shutdown process is following:
+ * - Userland monitors key events until the power switch goes to off position
+ * - The board reboots
+ * - U-boot starts and goes into an idle mode waiting for the user
+ *   to move the switch to ON position
+ */
+
+static void lsproduo_power_off(void)
+{
+       arch_reset(0, NULL);
+}
+
+
+/*****************************************************************************
+ * General Setup
+ ****************************************************************************/
+
+#define LSPRODUO_GPIO_USB_POWER                9
+#define LSPRODUO_GPIO_AUTO_POWER       10
+#define LSPRODUO_GPIO_POWER            8
+
+#define LSPRODUO_GPIO_HDD_POWER0       1
+
+static struct orion5x_mpp_mode lsproduo_mpp_modes[] __initdata = {
+       {  0, MPP_GPIO },       /* LED_PWR */
+       {  1, MPP_GPIO },       /* HDD_PWR */
+       {  2, MPP_GPIO },       /* LED_ALARM */
+       {  3, MPP_GPIO },       /* LED_INFO */
+       {  4, MPP_UNUSED },
+       {  5, MPP_UNUSED },
+       {  6, MPP_GPIO },       /* FAN_LCK */
+       {  7, MPP_GPIO },       /* INIT */
+       {  8, MPP_GPIO },       /* POWER */
+       {  9, MPP_GPIO },       /* USB_PWR */
+       { 10, MPP_GPIO },       /* AUTO_POWER */
+       { 11, MPP_UNUSED },     /* LED_ETH dummy */
+       { 12, MPP_UNUSED },
+       { 13, MPP_UNUSED },
+       { 14, MPP_GPIO },       /* FAN_HIGH */
+       { 15, MPP_UNUSED },
+       { 16, MPP_UNUSED },
+       { 17, MPP_GPIO },       /* FAN_LOW */
+       { 18, MPP_UNUSED },
+       { 19, MPP_UNUSED },
+       { -1 },
+};
+
+static void __init lsproduo_init(void)
+{
+       /*
+        * Setup basic Orion functions. Need to be called early.
+        */
+       orion5x_init();
+
+       orion5x_mpp_conf(lsproduo_mpp_modes);
+
+       /*
+        * Configure peripherals.
+        */
+       orion5x_ehci0_init();
+       orion5x_ehci1_init();
+       orion5x_eth_init(&lsproduo_eth_data);
+       orion5x_i2c_init();
+       orion5x_sata_init(&lsproduo_sata_data);
+       orion5x_uart0_init();
+       orion5x_xor_init();
+
+       orion5x_setup_dev_boot_win(LSPRODUO_NOR_BOOT_BASE,
+                                  LSPRODUO_NOR_BOOT_SIZE);
+       platform_device_register(&lsproduo_nor_flash);
+
+       platform_device_register(&lsproduo_button_device);
+
+       platform_device_register(&lsproduo_leds);
+
+       i2c_register_board_info(0, &lsproduo_i2c_rtc, 1);
+
+       /* enable USB power */
+       gpio_set_value(LSPRODUO_GPIO_USB_POWER, 1);
+
+       /* register power-off method */
+       pm_power_off = lsproduo_power_off;
+
+       pr_info("%s: finished\n", __func__);
+}
+
+#ifdef CONFIG_MACH_LINKSTATION_PRODUO
+MACHINE_START(LINKSTATION_PRODUO, "Buffalo Linkstation Pro Duo")
+       /* Maintainer: Manuel Bernhardt <prodigy7@gmail.com> */
+       .phys_io        = ORION5X_REGS_PHYS_BASE,
+       .io_pg_offst    = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
+       .boot_params    = 0x00000100,
+       .init_machine   = lsproduo_init,
+       .map_io         = orion5x_map_io,
+       .init_irq       = orion5x_init_irq,
+       .timer          = &orion5x_timer,
+       .fixup          = tag_fixup_mem32,
+MACHINE_END
+#endif
diff -ruN linux-2.6.30/arch/arm/mach-orion5x/Makefile linux-2.6.30.mod1/arch/arm/mach-orion5x/Makefile
--- linux-2.6.30/arch/arm/mach-orion5x/Makefile 2009-06-10 05:05:27.000000000 +0200
+++ linux-2.6.30.mod1/arch/arm/mach-orion5x/Makefile    2009-06-15 21:05:12.000000000 +0200
@@ -5,6 +5,7 @@
 obj-$(CONFIG_MACH_TERASTATION_PRO2)    += terastation_pro2-setup.o
 obj-$(CONFIG_MACH_LINKSTATION_PRO) += kurobox_pro-setup.o
 obj-$(CONFIG_MACH_LINKSTATION_MINI) += lsmini-setup.o
+obj-$(CONFIG_MACH_LINKSTATION_PRODUO) += lsproduo-setup.o
 obj-$(CONFIG_MACH_DNS323)      += dns323-setup.o
 obj-$(CONFIG_MACH_TS209)       += ts209-setup.o tsx09-common.o
 obj-$(CONFIG_MACH_TS409)       += ts409-setup.o tsx09-common.o

Can someone with kernel experience check this? Is there an error somewhere which could damage my hardware maybe?
Additionally I also added some more informations here -> http://buffalo.nas-central.org/wiki/LS_ ... -_Boot-Log

_________________
LS2 (U-Boot + Freelink) | Kurobox (U-Boot + Deboostraped) | LS Pro Duo (Freelink)


Top
   
PostPosted: Fri Aug 21, 2009 3:59 am 
Offline
Regular Member
User avatar

Joined: Fri Jul 25, 2008 3:23 pm
Posts: 160
Location: Kobe, Japan
There is a little chance that you damage your HW with a kernel.

Do you have serial access? If so, the rest is easy. You need to boot from TFTP, there were an article on the wiki.


Top
   
PostPosted: Fri Aug 21, 2009 8:30 am 
Offline
Regular Member

Joined: Mon Nov 07, 2005 4:37 pm
Posts: 205
Location: Germany
LaitrKeiows wrote:
There is a little chance that you damage your HW with a kernel.

Do you have serial access? If so, the rest is easy. You need to boot from TFTP, there were an article on the wiki.

Yes - I've serial access and can also boot an patched kernel (patch here -> http://download.prodigy7.de/files/packa ... o-vanilla/) without problems (uptime of my bos is now 53 days with the kernel). So far, I can port existing sources - but now I've the problem, that i don't know how I can control the fan. I've all neccessary addresses but if no code, made it possible, controlling the fan via sysfs.

_________________
LS2 (U-Boot + Freelink) | Kurobox (U-Boot + Deboostraped) | LS Pro Duo (Freelink)


Top
   
PostPosted: Fri Aug 21, 2009 8:45 am 
Offline
Regular Member
User avatar

Joined: Fri Jul 25, 2008 3:23 pm
Posts: 160
Location: Kobe, Japan
prodigy7 wrote:
I've all neccessary addresses but if no code, made it possible, controlling the fan via sysfs.

Did you try asking someone from Marvell or asking at the mailing list?
See repository owners here or corresponding maintainers in the sources: http://git.marvell.com/


Top
   
PostPosted: Fri Aug 21, 2009 8:25 pm 
Offline
Regular Member

Joined: Mon Nov 07, 2005 4:37 pm
Posts: 205
Location: Germany
LaitrKeiows wrote:
Did you try asking someone from Marvell or asking at the mailing list?
See repository owners here or corresponding maintainers in the sources: http://git.marvell.com/

No! But good hint - I'll try it!

_________________
LS2 (U-Boot + Freelink) | Kurobox (U-Boot + Deboostraped) | LS Pro Duo (Freelink)


Top
   
PostPosted: Tue Dec 06, 2011 12:51 am 
Offline
Regular Member
User avatar

Joined: Sun Nov 16, 2008 2:45 am
Posts: 105
Location: eu/fr/35/rennes
hi

are there any progress on support of those /proc/buffalo/gpio/switch/power handles ?
or can you lead to some deamon that listen to /dev/input/event0 events ?

Regards


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 36 posts ]  Go to page Previous 1 2 3

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited