Buffalo NAS-Central Forums

Welcome to the Linkstation Wiki community
It is currently Mon Jun 25, 2018 3:27 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed Aug 20, 2008 11:55 am 
Offline
Newbie

Joined: Sun Jul 27, 2008 11:16 am
Posts: 34
Location: Somewhere over the hill
I can't seem to find the kernel configuration (.config) for the stock kernel in the kernel package from Buffalo. Does anyone know where I get it? Or do I have write Buffalo?

_________________
LS-WSGL/R1 Linkstation Mini (stock, not for long...)


Top
   
PostPosted: Wed Aug 20, 2008 8:12 pm 
Offline
Site Admin
User avatar

Joined: Mon Aug 28, 2006 1:15 am
Posts: 2606
You have a LS Mini... is that a WSGL? Can you provide a link to the source? It seems that it is not listed here: http://gpl.nas-central.org/BUFFALO/open ... orage.html

Also, could you provide
Code:
uname -r
for your current kernel? (not sure if anyone has posted this yet...)

_________________
LS1 (foonas, nfs, Tranmission & p910nd print server, Firefly for my Roku)
LS-HG500 (Lenny)
Various LS-Pros v1,v2 (unbricked w/ serial & jtag)
KuroPro, LS2 & KuroHG (foonas)
Working on davysweather.dyndns.org lately...

=> wooohooo!
wooohooo!
Unknown command 'wooohooo!' - try 'help'


Top
   
PostPosted: Thu Aug 21, 2008 8:45 am 
Offline
Newbie

Joined: Fri Jun 27, 2008 11:27 am
Posts: 52
Location: Turku, Finland
The kernel sources (afaik) can be found here: http://opensource.buffalo.jp/ls-wsgl-100.html
The current kernel (for me at least) is 2.6.16.16-arm1

I tried to search for the .config as well, but couldn't find it. The thing is that I'm not sure if Buffalo is actually obligated by the GPL to release this config even if you ask for it. The sources for the different modules that they've added are there, so in that sense they are following the GPL, but I'm not sure if the license also covers used configs (at least it could be very hard to prove that they would be derivative work...)

IANAL, and I can't say that I've read the GPL that thoroughly... so don't take my word for any of this :)

bottom line: I haven't been able to find the .config at least. :(

-NRG


Top
   
PostPosted: Thu Aug 21, 2008 12:02 pm 
Offline
Newbie

Joined: Sun Jul 27, 2008 11:16 am
Posts: 34
Location: Somewhere over the hill
The reason why I'm looking for the stock kernel config is that I'm trying to create a linkstation_mini-setup.c for mach-orion5x. And being that the mini doesn't have micon (UART1), I'm having trouble finding the shutdown routine, and there are a few other discrepancies: the RTC INT (GPIO3) seems to be sharing a LED, the 3-position (off, on, auto) switch is a little awkward.

The off position is NC and a shutdown should be performed when neither on nor auto are active.

Perhaps you guys can help figure some of this out. Here's my work thus far based on Tuesday's git patch for 2.6.27-rc3.
Code:
/*
 * arch/arm/mach-orion5x/linkstation_mini-setup.c
 *
 * Maintainer:
 *
 * 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/irq.h>
#include <linux/delay.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/serial_reg.h>
#include <linux/ata_platform.h>
#include <asm/mach-types.h>
#include <asm/gpio.h>
#include <asm/mach/arch.h>
#include <asm/mach/pci.h>
#include <mach/orion5x.h>
#include "common.h"
#include "mpp.h"

/*****************************************************************************
 * LINKSTATION_MINI Info
 ****************************************************************************/

/*
 * Linkstation Mini LS-WSGL/R1
 * - Marvell 88F5182-A2
 * - Marvell 88E1118 Gigabit Ethernet PHY
 * - Ricoh RS5C372A RTC (@0x32) on I2C Bus
 * - 4Mb NOR Flash (256kiB)
 * - 4 LEDS (blue, green, red, blue)
 * - 1 3-Way Switch (off, on, auto)
 * - 1 Button
 * - 3 Marvell MVPG3[01]x Field Programmable DSP Switcher (buck regulator)
 */

/*****************************************************************************
 * 256KB NOR Flash on BOOT Device
 ****************************************************************************/
#define LINKSTATION_MINI_NOR_BOOT_BASE   0xf4000000
#define LINKSTATION_MINI_NOR_BOOT_SIZE   SZ_256K

static struct physmap_flash_data linkstation_mini_nor_flash_data = {
   .width   = 1,
};

static struct resource linkstation_mini_nor_flash_resource = {
   .flags   = IORESOURCE_MEM,
   .start   = LINKSTATION_MINI_NOR_BOOT_BASE,
   .end   = LINKSTATION_MINI_NOR_BOOT_BASE + LINKSTATION_MINI_NOR_BOOT_SIZE - 1,
};

static struct platform_device linkstation_mini_nor_flash = {
   .name   = "physmap-flash",
   .id   = 0,
   .dev   = {
      .platform_data   = &linkstation_mini_nor_flash_data,
   },
   .num_resources   = 1,
   .resource   = &linkstation_mini_nor_flash_resource,
};

/*****************************************************************************
 * PCI, PCB has no access to the interface
 ****************************************************************************/
static int __init linkstation_mini_pci_map_irq(struct pci_dev *dev, u8 slot
      , u8 pin)
{
   int irq;

   /*
    * Check for devices with hard-wired IRQs.
    */
   irq = orion5x_pci_map_irq(dev, slot, pin);
   if (irq != -1)
      return irq;

   /*
    * PCI isn't used on the hardware
    */
   return -1;
}

static struct hw_pci linkstation_mini_pci __initdata = {
   .nr_controllers   = 2,
   .swizzle   = pci_std_swizzle,
   .setup   = orion5x_pci_sys_setup,
   .scan      = orion5x_pci_sys_scan_bus,
   .map_irq   = linkstation_mini_pci_map_irq,
};

static int __init linkstation_mini_pci_init(void)
{
   if (machine_is_linkstation_mini())
      pci_common_init(&linkstation_mini_pci);

   return 0;
}

subsys_initcall(linkstation_mini_pci_init);

/*****************************************************************************
 * Ethernet
 ****************************************************************************/
static struct mv643xx_eth_platform_data linkstation_mini_eth_data = {
   .phy_addr   = 8,
};

/*****************************************************************************
 * RTC 5C372a on I2C bus
 ****************************************************************************/
#define LINKSTATION_MINI_RTC_GPIO

static struct i2c_board_info __initdata linkstation_mini_i2c_rtc = {
   I2C_BOARD_INFO("rs5c372a", 0x32),
};

/*****************************************************************************
 * LEDs attached to GPIO
 * - TODO active low per GPIO must be tested
 ****************************************************************************/
static struct gpio_led linkstation_mini_led_pins[] = {
   {
      .name   = "linkstation_mini:red:alarm",
      .gpio   = 2,
      .active_low   = 1,
   }, {
      .name   = "linkstation_mini:green:information",
      /* FIXME stock kernel source seems to be ambiguous
      .gpio   = 3,
      .gpio   = 11,
       */
      .active_low   = 1,
      /* FIXME Stock kernel muxes eth activity, I'd rather see hdd
      .default_trigger = ledtrig_eth_activity,
      .default_trigger = ledtrig_ide_activity,
       */
   }, {
      /* top led */
      .name   = "linkstation_mini:blue:function",
      .gpio   = 9,
      .active_low   = 1,
   }, {
      /* two (seemingly) hw strapped leds under Linkstation label */
      .name   = "linkstation_mini:blue:power",
      .gpio   = 14,
      .active_low   = 1,
   },
};

static struct gpio_led_platform_data linkstation_mini_led_data = {
   .leds      = linkstation_mini_led_pins,
   .num_leds   = ARRAY_SIZE(linkstation_mini_led_pins),
/*   TODO .gpio_blink_set = &orion5x_gpio_led_blink, */
};

static struct platform_device linkstation_leds = {
   .name   = "leds-gpio",
   .id   = -1,
   .dev   = {
      .platform_data = &linkstation_mini_led_data,
   },
};

/*****************************************************************************
 * Keys attached to GPIO
 * - active low per GPIO must be tested
 ****************************************************************************/
#define LINKSTATION_MINI_GPIO_KEY_MEDIA   15
#define LINKSTATION_MINI_GPIO_SWITCH_AUTO   17
#define LINKSTATION_MINI_GPIO_SWITCH_ON   18

/*
 * Using SW_ events in the hope not to trigger repeat events on an active
 * position. The codes are arbitrary: I guess any KEY_ would do here...
 */
static struct gpio_keys_button linkstation_mini_switch_on = {
   .code      = KEY_WAKEUP,
   .gpio      = LINKSTATION_MINI_GPIO_SWITCH_ON,
   .desc      = "Power On Switch",
   .type      = EV_SW,
   .wakeup   = 1,
   .active_low   = 1,
};
static struct gpio_keys_button linkstation_mini_switch_auto = {
   .code      = KEY_SLEEP,
   .gpio      = LINKSTATION_MINI_GPIO_SWITCH_AUTO,
   .desc      = "Power Sleep Switch",
   .type      = EV_SW,
   .active_low   = 1,
};

static struct gpio_keys_button linkstation_mini_buttons[] = {
   {
      .code      = KEY_COPY,
      .gpio      = LINKSTATION_MINI_GPIO_KEY_MEDIA,
      .desc      = "USB Copy Button",
      .active_low   = 1,
#if 0
/* TODO
 * Not quite sure what I should do here...
 *
 * This hardware has a 3-position switch: off, on, auto. Only the positions on
 * and auto are connected to gpio. Only one of the two positions registers a
 * signal at any given time. However, the hardware should be powered down only
 * when neither is active.
 *
 * What's the possibility of using acpi/apm events here?
 */
   }, {
      .code      = KEY_POWER,
      .desc      = "Power Off Switch",
      .type      = EV_SW,
      .active_low   = 1,

      /* TODO
       * requires a layer of abstraction
       * activate when neither KEY_WAKEUP nor KEY_SLEEP are active
       */
      .virtual_gpio   = {
         &linkstation_mini_switch_on,
         &linkstation_mini_switch_auto,
      },
#endif
   },
   &linkstation_mini_switch_on,
   &linkstation_mini_switch_auto,
};

static struct gpio_keys_platform_data linkstation_mini_button_data = {
   .buttons   = linkstation_mini_buttons,
   .nbuttons   = ARRAY_SIZE(linkstation_mini_buttons),
};

static struct platform_device linkstation_mini_button_device = {
   .name      = "gpio-keys",
   .id      = -1,
   .num_resources   = 0,
   .dev      = {
      .platform_data = &linkstation_mini_button_data,
   },
};

/*****************************************************************************
 * SATA
 ****************************************************************************/
static struct mv_sata_platform_data linkstation_mini_sata_data = {
   .n_ports   = 2,
};

/*****************************************************************************
 * Linkstation Mini specific power off method
 * - it doesn't have micon
 * - stock kernel seems to send magic to rtc (WD?)
 ****************************************************************************/
static void linkstation_mini_power_off(void)
{
   const unsigned char watchdogkill[]   = {0x01, 0x35, 0x00};
   const unsigned char shutdownwait[]   = {0x00, 0x0c};
   const unsigned char poweroff[]      = {0x00, 0x06};
   /* 38400 baud divisor */
   const unsigned divisor = ((ORION5X_TCLK + (8 * 38400)) / (16 * 38400));

   pr_info("%s: triggering power-off...\n", __func__);

   /* hijack uart1 and reset into sane state (38400,8n1,even parity) */
   writel(0x83, UART1_REG(LCR));
   writel(divisor & 0xff, UART1_REG(DLL));
   writel((divisor >> 8) & 0xff, UART1_REG(DLM));
   writel(0x1b, UART1_REG(LCR));
   writel(0x00, UART1_REG(IER));
   writel(0x07, UART1_REG(FCR));
   writel(0x00, UART1_REG(MCR));

   /* Send the commands to shutdown the Linkstation Mini */
   linkstation_mini_miconsend(watchdogkill, sizeof(watchdogkill)) ;
   linkstation_mini_miconsend(shutdownwait, sizeof(shutdownwait)) ;
   linkstation_mini_miconsend(poweroff, sizeof(poweroff));
}

/*****************************************************************************
 * General Setup
 * - TODO should the button/switch be int'ed or polled?
 *        I wonder if we could fake acpi events here? Advantage being, user
 *        could configure this using acpid.
 ****************************************************************************/
static struct orion5x_mpp_mode linkstation_mini_mpp_modes[] __initdata = {
   {  0, MPP_GPIO },      /* LED reserve 1 (what's this?) */
   {  1, MPP_GPIO },      /* TODO SATA 0? power control (MVPG3[01]x) */
   {  2, MPP_GPIO },      /* LED alarm (red) */
   {  3, MPP_GPIO },      /* FIXME LED information (green) - RTC INT */
   {  4, MPP_UNUSED },
   {  5, MPP_UNUSED },
   {  6, MPP_UNUSED },
   {  7, MPP_UNUSED },
   {  8, MPP_UNUSED },
   {  9, MPP_GPIO },      /* LED function (blue) */
   { 10, MPP_UNUSED },
   { 11, MPP_GPIO },      /* FIXME LED information (green) muxed w/ eth activity */
   { 12, MPP_UNUSED },
   { 13, MPP_UNUSED },
   { 14, MPP_GPIO },      /* LED power (blue) */
   { 15, MPP_GPIO },      /* TODO Button copy/restore */
   { 16, MPP_GPIO },      /* USB power control (MVPG3[01]x) */
   { 17, MPP_GPIO },      /* TODO Switch auto (position 2) */
   { 18, MPP_GPIO },      /* TODO Switch on (position 1) */
   { 19, MPP_GPIO },      /* TODO SATA 1? power control (MVPG3[01]x) */
   { -1 },
};

static void __init linkstation_mini_init(void)
{
   /*
    * Setup basic Orion functions. Need to be called early.
    */
   orion5x_init();

   orion5x_mpp_conf(linkstation_mini_mpp_modes);

   /*
    * Configure peripherals.
    * TODO power controls (usb, sata[01]) must be initialized
    */

   /* TODO only one ehci is accessible */
   orion5x_ehci0_init();
   orion5x_ehci1_init();
   orion5x_eth_init(&linkstation_mini_eth_data);
   orion5x_i2c_init();
   orion5x_sata_init(&linkstation_mini_sata_data);
   /* TODO only one uart is accessible */
   orion5x_uart0_init();
   orion5x_uart1_init();
   orion5x_xor_init();
   /* TODO maybe we'll get this someday;) orion5x_crypto_engine_init(); */

   orion5x_setup_dev_boot_win(LINKSTATION_MINI_NOR_BOOT_BASE,
               LINKSTATION_MINI_NOR_BOOT_SIZE);
   platform_device_register(&linkstation_mini_nor_flash);

   i2c_register_board_info(0, &linkstation_mini_i2c_rtc, 1);

   /* register Linkstation Mini specific power-off method */
   pm_power_off = linkstation_mini_power_off;
}

#ifdef CONFIG_MACH_LINKSTATION_MINI
MACHINE_START(LINKSTATION_MINI, "Buffalo Linkstation Mini")
   /* Maintainer: */
   .phys_io   = ORION5X_REGS_PHYS_BASE,
   .io_pg_offst   = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
   .boot_params   = 0x00000100,
   .init_machine   = linkstation_mini_init,
   .map_io      = orion5x_map_io,
   .init_irq   = orion5x_init_irq,
   .timer      = &orion5x_timer,
   .fixup      = tag_fixup_mem32,
MACHINE_END
#endif

_________________
LS-WSGL/R1 Linkstation Mini (stock, not for long...)


Top
   
PostPosted: Thu Aug 21, 2008 2:04 pm 
Offline
Site Admin
User avatar

Joined: Mon Aug 28, 2006 1:15 am
Posts: 2606
It is possible (though seemingly unlikely) that it is listed in the kernel (that's an option available through Kconfig) in /proc/config.gz.

That's a slim chance that they would leave it there, so at least you can list the modules available with something like:
(simple list)
Code:
modprobe -l  
...

While in menuconfig, you could just check them off you list one by one as you enable them...

_________________
LS1 (foonas, nfs, Tranmission & p910nd print server, Firefly for my Roku)
LS-HG500 (Lenny)
Various LS-Pros v1,v2 (unbricked w/ serial & jtag)
KuroPro, LS2 & KuroHG (foonas)
Working on davysweather.dyndns.org lately...

=> wooohooo!
wooohooo!
Unknown command 'wooohooo!' - try 'help'


Top
   
PostPosted: Fri Aug 22, 2008 9:19 am 
Offline
Newbie

Joined: Sun Jul 27, 2008 11:16 am
Posts: 34
Location: Somewhere over the hill
davy_gravy wrote:
While in menuconfig, you could just check them off you list one by one as you enable them...


Each of the options are individually selectable: none of them have dependencies:(

I think it may be best to turn off certain subsystems (non-vital) and try, try again until MPP works as expected. But first I'll have to get the serial console working...

Haven't figured out how halt works yet...

_________________
LS-WSGL/R1 Linkstation Mini (stock, not for long...)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 4 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:
cron
Powered by phpBB® Forum Software © phpBB Limited