diff -urN old/Makefile new/Makefile --- old/Makefile 2009-10-05 23:38:08.000000000 +0800 +++ new/Makefile 2009-11-11 09:36:23.000000000 +0800 @@ -1,3 +1,10 @@ +#//*************************************************************************************** +#// linux/Makefile +#// Project: iConnect (NAS PLUG) +#// function: +#// version: 1.0 (2009/11/11) +#// Modifier: Ken Cheng (kencheng@mapower.com.tw) +#//*************************************************************************************** VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 30 @@ -190,8 +197,8 @@ # Default value for CROSS_COMPILE is not to prefix executables # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile export KBUILD_BUILDHOST := $(SUBARCH) -ARCH ?= $(SUBARCH) -CROSS_COMPILE ?= +ARCH ?= arm +CROSS_COMPILE ?= arm-none-linux-gnueabi- # Architecture as present in compile.h UTS_MACHINE := $(ARCH) diff -urN old/arch/arm/configs/kirkwood_defconfig new/arch/arm/configs/kirkwood_defconfig --- old/arch/arm/configs/kirkwood_defconfig 2009-10-05 23:38:08.000000000 +0800 +++ new/arch/arm/configs/kirkwood_defconfig 2009-11-11 09:34:18.000000000 +0800 @@ -1,8 +1,15 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.30-rc4 -# Mon May 4 11:58:57 2009 +# Linux kernel version: 2.6.30.9 +# Wed Nov 11 09:31:44 2009 # +#//*************************************************************************************** +#// linux/arch/arm/configs/kirkwood_defconfig +#// Project: iConnect (NAS PLUG) +#// function: +#// version: 1.0 (2009/11/11) +#// Modifier: Ken Cheng (kencheng@mapower.com.tw) +#//*************************************************************************************** CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y CONFIG_GENERIC_GPIO=y @@ -179,11 +186,11 @@ # # Marvell Kirkwood Implementations # -CONFIG_MACH_DB88F6281_BP=y -CONFIG_MACH_RD88F6192_NAS=y +# CONFIG_MACH_DB88F6281_BP is not set +# CONFIG_MACH_RD88F6192_NAS is not set CONFIG_MACH_RD88F6281=y -CONFIG_MACH_SHEEVAPLUG=y -CONFIG_MACH_TS219=y +# CONFIG_MACH_SHEEVAPLUG is not set +# CONFIG_MACH_TS219 is not set CONFIG_PLAT_ORION=y # @@ -238,7 +245,7 @@ CONFIG_HZ=100 CONFIG_AEABI=y # CONFIG_OABI_COMPAT is not set -CONFIG_ARCH_FLATMEM_HAS_HOLES=y +# CONFIG_ARCH_HAS_HOLES_MEMORYMODEL is not set # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set # CONFIG_HIGHMEM is not set @@ -256,6 +263,7 @@ CONFIG_UNEVICTABLE_LRU=y CONFIG_HAVE_MLOCK=y CONFIG_HAVE_MLOCKED_PAGE_BIT=y +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 CONFIG_ALIGNMENT_TRAP=y # @@ -488,9 +496,6 @@ # Self-contained MTD device drivers # # CONFIG_MTD_PMC551 is not set -# CONFIG_MTD_DATAFLASH is not set -CONFIG_MTD_M25P80=y -CONFIG_M25PXX_USE_FAST_READ=y # CONFIG_MTD_SLRAM is not set # CONFIG_MTD_PHRAM is not set # CONFIG_MTD_MTDRAM is not set @@ -611,7 +616,6 @@ # CONFIG_SCSI_MVSAS is not set # CONFIG_SCSI_STEX is not set # CONFIG_SCSI_SYM53C8XX_2 is not set -# CONFIG_SCSI_IPR is not set # CONFIG_SCSI_QLOGIC_1280 is not set # CONFIG_SCSI_QLA_FC is not set # CONFIG_SCSI_QLA_ISCSI is not set @@ -623,65 +627,7 @@ # CONFIG_SCSI_SRP is not set # CONFIG_SCSI_DH is not set # CONFIG_SCSI_OSD_INITIATOR is not set -CONFIG_ATA=y -# CONFIG_ATA_NONSTANDARD is not set -CONFIG_SATA_PMP=y -# CONFIG_SATA_AHCI is not set -# CONFIG_SATA_SIL24 is not set -CONFIG_ATA_SFF=y -# CONFIG_SATA_SVW is not set -# CONFIG_ATA_PIIX is not set -CONFIG_SATA_MV=y -# CONFIG_SATA_NV is not set -# CONFIG_PDC_ADMA is not set -# CONFIG_SATA_QSTOR is not set -# CONFIG_SATA_PROMISE is not set -# CONFIG_SATA_SX4 is not set -# CONFIG_SATA_SIL is not set -# CONFIG_SATA_SIS is not set -# CONFIG_SATA_ULI is not set -# CONFIG_SATA_VIA is not set -# CONFIG_SATA_VITESSE is not set -# CONFIG_SATA_INIC162X is not set -# CONFIG_PATA_ALI is not set -# CONFIG_PATA_AMD is not set -# CONFIG_PATA_ARTOP is not set -# CONFIG_PATA_ATIIXP is not set -# CONFIG_PATA_CMD640_PCI is not set -# CONFIG_PATA_CMD64X is not set -# CONFIG_PATA_CS5520 is not set -# CONFIG_PATA_CS5530 is not set -# CONFIG_PATA_CYPRESS is not set -# CONFIG_PATA_EFAR is not set -# CONFIG_ATA_GENERIC is not set -# CONFIG_PATA_HPT366 is not set -# CONFIG_PATA_HPT37X is not set -# CONFIG_PATA_HPT3X2N is not set -# CONFIG_PATA_HPT3X3 is not set -# CONFIG_PATA_IT821X is not set -# CONFIG_PATA_IT8213 is not set -# CONFIG_PATA_JMICRON is not set -# CONFIG_PATA_TRIFLEX is not set -# CONFIG_PATA_MARVELL is not set -# CONFIG_PATA_MPIIX is not set -# CONFIG_PATA_OLDPIIX is not set -# CONFIG_PATA_NETCELL is not set -# CONFIG_PATA_NINJA32 is not set -# CONFIG_PATA_NS87410 is not set -# CONFIG_PATA_NS87415 is not set -# CONFIG_PATA_OPTI is not set -# CONFIG_PATA_OPTIDMA is not set -# CONFIG_PATA_PDC_OLD is not set -# CONFIG_PATA_RADISYS is not set -# CONFIG_PATA_RZ1000 is not set -# CONFIG_PATA_SC1200 is not set -# CONFIG_PATA_SERVERWORKS is not set -# CONFIG_PATA_PDC2027X is not set -# CONFIG_PATA_SIL680 is not set -# CONFIG_PATA_SIS is not set -# CONFIG_PATA_VIA is not set -# CONFIG_PATA_WINBOND is not set -# CONFIG_PATA_SCH is not set +# CONFIG_ATA is not set # CONFIG_MD is not set # CONFIG_FUSION is not set @@ -733,7 +679,6 @@ # CONFIG_NET_VENDOR_3COM is not set # CONFIG_SMC91X is not set # CONFIG_DM9000 is not set -# CONFIG_ENC28J60 is not set # CONFIG_ETHOC is not set # CONFIG_SMC911X is not set # CONFIG_SMSC911X is not set @@ -798,12 +743,11 @@ # # Wireless LAN # -# CONFIG_WLAN_PRE80211 is not set +CONFIG_WLAN_PRE80211=y +# CONFIG_STRIP is not set CONFIG_WLAN_80211=y CONFIG_LIBERTAS=y # CONFIG_LIBERTAS_USB is not set -CONFIG_LIBERTAS_SDIO=y -# CONFIG_LIBERTAS_SPI is not set # CONFIG_LIBERTAS_DEBUG is not set # CONFIG_LIBERTAS_THINFIRM is not set # CONFIG_ATMEL is not set @@ -827,7 +771,12 @@ # CONFIG_B43 is not set # CONFIG_B43LEGACY is not set # CONFIG_ZD1211RW is not set -# CONFIG_RT2X00 is not set +CONFIG_RT2X00=y +# CONFIG_RT2400PCI is not set +# CONFIG_RT2500PCI is not set +# CONFIG_RT61PCI is not set +# CONFIG_RT2500USB is not set +# CONFIG_RT73USB is not set # CONFIG_HERMES is not set # @@ -864,7 +813,7 @@ # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y -CONFIG_INPUT_MOUSEDEV_PSAUX=y +# CONFIG_INPUT_MOUSEDEV_PSAUX is not set CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_INPUT_JOYDEV is not set @@ -875,7 +824,7 @@ # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y -CONFIG_KEYBOARD_ATKBD=y +# CONFIG_KEYBOARD_ATKBD is not set # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set @@ -891,11 +840,7 @@ # # Hardware I/O ports # -CONFIG_SERIO=y -CONFIG_SERIO_SERPORT=y -# CONFIG_SERIO_PCIPS2 is not set -CONFIG_SERIO_LIBPS2=y -# CONFIG_SERIO_RAW is not set +# CONFIG_SERIO is not set # CONFIG_GAMEPORT is not set # @@ -923,7 +868,6 @@ # # Non-8250 serial port support # -# CONFIG_SERIAL_MAX3100 is not set CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_JSM is not set @@ -1004,27 +948,74 @@ # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set # CONFIG_I2C_DEBUG_CHIP is not set -CONFIG_SPI=y -# CONFIG_SPI_DEBUG is not set -CONFIG_SPI_MASTER=y - -# -# SPI Master Controller Drivers -# -# CONFIG_SPI_BITBANG is not set -# CONFIG_SPI_GPIO is not set -CONFIG_SPI_ORION=y - -# -# SPI Protocol Masters -# -# CONFIG_SPI_SPIDEV is not set -# CONFIG_SPI_TLE62X0 is not set +# CONFIG_SPI is not set # CONFIG_W1 is not set # CONFIG_POWER_SUPPLY is not set -# CONFIG_HWMON is not set -# CONFIG_THERMAL is not set -# CONFIG_THERMAL_HWMON is not set +CONFIG_HWMON=y +# CONFIG_HWMON_VID is not set +# CONFIG_SENSORS_AD7414 is not set +# CONFIG_SENSORS_AD7418 is not set +# CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set +# CONFIG_SENSORS_ADM1029 is not set +# CONFIG_SENSORS_ADM1031 is not set +# CONFIG_SENSORS_ADM9240 is not set +# CONFIG_SENSORS_ADT7462 is not set +# CONFIG_SENSORS_ADT7470 is not set +# CONFIG_SENSORS_ADT7473 is not set +# CONFIG_SENSORS_ADT7475 is not set +# CONFIG_SENSORS_ATXP1 is not set +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_I5K_AMB is not set +# CONFIG_SENSORS_F71805F is not set +# CONFIG_SENSORS_F71882FG is not set +# CONFIG_SENSORS_F75375S is not set +# CONFIG_SENSORS_G760A is not set +# CONFIG_SENSORS_GL518SM is not set +# CONFIG_SENSORS_GL520SM is not set +# CONFIG_SENSORS_IT87 is not set +CONFIG_SENSORS_LM63=y +# CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set +# CONFIG_SENSORS_LM78 is not set +# CONFIG_SENSORS_LM80 is not set +# CONFIG_SENSORS_LM83 is not set +# CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set +# CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_LM92 is not set +# CONFIG_SENSORS_LM93 is not set +# CONFIG_SENSORS_LTC4215 is not set +# CONFIG_SENSORS_LTC4245 is not set +# CONFIG_SENSORS_LM95241 is not set +# CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_MAX6650 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_PC87427 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_SHT15 is not set +# CONFIG_SENSORS_SIS5595 is not set +# CONFIG_SENSORS_DME1737 is not set +# CONFIG_SENSORS_SMSC47M1 is not set +# CONFIG_SENSORS_SMSC47M192 is not set +# CONFIG_SENSORS_SMSC47B397 is not set +# CONFIG_SENSORS_ADS7828 is not set +# CONFIG_SENSORS_THMC50 is not set +# CONFIG_SENSORS_VIA686A is not set +# CONFIG_SENSORS_VT1211 is not set +# CONFIG_SENSORS_VT8231 is not set +# CONFIG_SENSORS_W83781D is not set +# CONFIG_SENSORS_W83791D is not set +# CONFIG_SENSORS_W83792D is not set +# CONFIG_SENSORS_W83793 is not set +# CONFIG_SENSORS_W83L785TS is not set +# CONFIG_SENSORS_W83L786NG is not set +# CONFIG_SENSORS_W83627HF is not set +# CONFIG_SENSORS_W83627EHF is not set +CONFIG_HWMON_DEBUG_CHIP=y +CONFIG_THERMAL=y +CONFIG_THERMAL_HWMON=y # CONFIG_WATCHDOG is not set CONFIG_SSB_POSSIBLE=y @@ -1082,48 +1073,7 @@ # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y # CONFIG_SOUND is not set -CONFIG_HID_SUPPORT=y -CONFIG_HID=y -# CONFIG_HID_DEBUG is not set -# CONFIG_HIDRAW is not set - -# -# USB Input Devices -# -CONFIG_USB_HID=y -# CONFIG_HID_PID is not set -# CONFIG_USB_HIDDEV is not set - -# -# Special HID drivers -# -CONFIG_HID_A4TECH=y -CONFIG_HID_APPLE=y -CONFIG_HID_BELKIN=y -CONFIG_HID_CHERRY=y -CONFIG_HID_CHICONY=y -CONFIG_HID_CYPRESS=y -# CONFIG_DRAGONRISE_FF is not set -CONFIG_HID_EZKEY=y -CONFIG_HID_KYE=y -CONFIG_HID_GYRATION=y -CONFIG_HID_KENSINGTON=y -CONFIG_HID_LOGITECH=y -# CONFIG_LOGITECH_FF is not set -# CONFIG_LOGIRUMBLEPAD2_FF is not set -CONFIG_HID_MICROSOFT=y -CONFIG_HID_MONTEREY=y -CONFIG_HID_NTRIG=y -CONFIG_HID_PANTHERLORD=y -# CONFIG_PANTHERLORD_FF is not set -CONFIG_HID_PETALYNX=y -CONFIG_HID_SAMSUNG=y -CONFIG_HID_SONY=y -CONFIG_HID_SUNPLUS=y -# CONFIG_GREENASIA_FF is not set -CONFIG_HID_TOPSEED=y -# CONFIG_THRUSTMASTER_FF is not set -# CONFIG_ZEROPLUS_FF is not set +# CONFIG_HID_SUPPORT is not set CONFIG_USB_SUPPORT=y CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y @@ -1233,25 +1183,7 @@ # CONFIG_USB_GPIO_VBUS is not set # CONFIG_NOP_USB_XCEIV is not set # CONFIG_UWB is not set -CONFIG_MMC=y -# CONFIG_MMC_DEBUG is not set -# CONFIG_MMC_UNSAFE_RESUME is not set - -# -# MMC/SD/SDIO Card Drivers -# -CONFIG_MMC_BLOCK=y -CONFIG_MMC_BLOCK_BOUNCE=y -CONFIG_SDIO_UART=y -# CONFIG_MMC_TEST is not set - -# -# MMC/SD/SDIO Host Controller Drivers -# -# CONFIG_MMC_SDHCI is not set -# CONFIG_MMC_TIFM_SD is not set -CONFIG_MMC_MVSDIO=y -# CONFIG_MMC_SPI is not set +# CONFIG_MMC is not set # CONFIG_MEMSTICK is not set # CONFIG_ACCESSIBILITY is not set CONFIG_NEW_LEDS=y @@ -1265,7 +1197,6 @@ CONFIG_LEDS_GPIO_PLATFORM=y # CONFIG_LEDS_LP5521 is not set # CONFIG_LEDS_PCA955X is not set -# CONFIG_LEDS_DAC124S085 is not set # CONFIG_LEDS_BD2802 is not set # @@ -1308,20 +1239,13 @@ # CONFIG_RTC_DRV_PCF8563 is not set # CONFIG_RTC_DRV_PCF8583 is not set # CONFIG_RTC_DRV_M41T80 is not set -CONFIG_RTC_DRV_S35390A=y +# CONFIG_RTC_DRV_S35390A is not set # CONFIG_RTC_DRV_FM3130 is not set # CONFIG_RTC_DRV_RX8581 is not set # # SPI RTC drivers # -# CONFIG_RTC_DRV_M41T94 is not set -# CONFIG_RTC_DRV_DS1305 is not set -# CONFIG_RTC_DRV_DS1390 is not set -# CONFIG_RTC_DRV_MAX6902 is not set -# CONFIG_RTC_DRV_R9701 is not set -# CONFIG_RTC_DRV_RS5C348 is not set -# CONFIG_RTC_DRV_DS3234 is not set # # Platform RTC drivers @@ -1376,10 +1300,10 @@ # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set # CONFIG_FS_POSIX_ACL is not set -CONFIG_FILE_LOCKING=y # CONFIG_XFS_FS is not set # CONFIG_OCFS2_FS is not set # CONFIG_BTRFS_FS is not set +CONFIG_FILE_LOCKING=y CONFIG_DNOTIFY=y CONFIG_INOTIFY=y CONFIG_INOTIFY_USER=y diff -urN old/arch/arm/mach-kirkwood/mpp.h new/arch/arm/mach-kirkwood/mpp.h --- old/arch/arm/mach-kirkwood/mpp.h 2009-10-05 23:38:08.000000000 +0800 +++ new/arch/arm/mach-kirkwood/mpp.h 2009-11-11 09:35:43.000000000 +0800 @@ -7,6 +7,13 @@ * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ +//*************************************************************************************** +// linux/arch/arm/mach-kirkwood/mpp.h +// Project: iConnect (NAS PLUG) +// function: +// version: 1.0 (2009/11/11) +// Modifier: Ken Cheng (kencheng@mapower.com.tw) +//*************************************************************************************** #ifndef __KIRKWOOD_MPP_H #define __KIRKWOOD_MPP_H @@ -102,7 +109,7 @@ #define MPP11_PTP_CLK MPP( 11, 0xd, 1, 0, 1, 1, 1, 1 ) #define MPP11_SATA0_ACTn MPP( 11, 0x5, 0, 1, 0, 1, 1, 1 ) -#define MPP12_GPO MPP( 12, 0x0, 0, 1, 1, 1, 1, 1 ) +#define MPP12_GPIO MPP( 12, 0x0, 1, 1, 1, 1, 1, 1 ) #define MPP12_SD_CLK MPP( 12, 0x1, 0, 1, 1, 1, 1, 1 ) #define MPP13_GPIO MPP( 13, 0x0, 1, 1, 1, 1, 1, 1 ) diff -urN old/arch/arm/mach-kirkwood/rd88f6281-setup.c new/arch/arm/mach-kirkwood/rd88f6281-setup.c --- old/arch/arm/mach-kirkwood/rd88f6281-setup.c 2009-10-05 23:38:08.000000000 +0800 +++ new/arch/arm/mach-kirkwood/rd88f6281-setup.c 2009-11-11 09:35:54.000000000 +0800 @@ -7,6 +7,13 @@ * License version 2. This program is licensed "as is" without any * warranty of any kind, whether express or implied. */ +//*************************************************************************************** +// linux/arch/arm/mach-kirkwood/rd88f6281-setup.c +// Project: iConnect (NAS PLUG) +// function: +// version: 1.0 (2009/11/11) +// Modifier: Ken Cheng (kencheng@mapower.com.tw) +//*************************************************************************************** #include #include @@ -18,6 +25,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -69,41 +81,136 @@ }; static struct mv643xx_eth_platform_data rd88f6281_ge00_data = { - .phy_addr = MV643XX_ETH_PHY_NONE, - .speed = SPEED_1000, - .duplex = DUPLEX_FULL, + .phy_addr = MV643XX_ETH_PHY_ADDR(0xB), }; -static struct dsa_chip_data rd88f6281_switch_chip_data = { - .port_names[0] = "lan1", - .port_names[1] = "lan2", - .port_names[2] = "lan3", - .port_names[3] = "lan4", - .port_names[5] = "cpu", +/***************************************************************************** + * LEDs attached to GPIO + ****************************************************************************/ + +static struct gpio_led rd88f6281_led_pins[] = { + { + .name = "power_blue_led", + .gpio = 42, + .default_trigger = "timer", + }, + { + .name = "power_red_led", + .gpio = 43, + }, + { + .name = "usb_1_led", + .gpio = 44, + }, + { + .name = "usb_2_led", + .gpio = 45, + }, + { + .name = "usb_3_led", + .gpio = 46, + }, + { + .name = "usb_4_led", + .gpio = 47, + }, + { + .name = "otb_led", + .gpio = 48, + }, +}; + +#define ORION_BLINK_HALF_PERIOD 100 /* ms */ + +int rd88f6281_gpio_blink_set(unsigned gpio, + unsigned long *delay_on, unsigned long *delay_off) +{ + if (!*delay_on && !*delay_off) + *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD; + + if (ORION_BLINK_HALF_PERIOD == *delay_on + && ORION_BLINK_HALF_PERIOD == *delay_off) { + orion_gpio_set_blink(gpio, 1); + return 0; + } + + return -EINVAL; +} + +static struct gpio_led_platform_data rd88f6281_led_data = { + .leds = rd88f6281_led_pins, + .num_leds = ARRAY_SIZE(rd88f6281_led_pins), + .gpio_blink_set = rd88f6281_gpio_blink_set, }; -static struct dsa_platform_data rd88f6281_switch_plat_data = { - .nr_chips = 1, - .chip = &rd88f6281_switch_chip_data, +static struct platform_device rd88f6281_leds = { + .name = "leds-gpio", + .id = -1, + .dev = { + .platform_data = &rd88f6281_led_data, + } }; -static struct mv643xx_eth_platform_data rd88f6281_ge01_data = { - .phy_addr = MV643XX_ETH_PHY_ADDR(11), +/**************************************************************************** + * GPIO Attached Keys + ****************************************************************************/ + +#define RD88F6281_GPIO_KEY_RESET 12 +#define RD88F6281_GPIO_KEY_OTB 35 + +#define RD88F6281_SW_RESET 0x00 +#define RD88F6281_SW_OTB 0x01 + +static struct gpio_keys_button rd88f6281_buttons[] = { + { + .type = EV_SW, + .code = RD88F6281_SW_RESET, + .gpio = RD88F6281_GPIO_KEY_RESET, + .desc = "Reset Button", + .active_low = 1, + .debounce_interval = 100, + }, + { + .type = EV_SW, + .code = RD88F6281_SW_OTB, + .gpio = RD88F6281_GPIO_KEY_OTB, + .desc = "OTB Button", + .active_low = 1, + .debounce_interval = 100, + }, }; -static struct mv_sata_platform_data rd88f6281_sata_data = { - .n_ports = 2, +static struct gpio_keys_platform_data rd88f6281_button_data = { + .buttons = rd88f6281_buttons, + .nbuttons = ARRAY_SIZE(rd88f6281_buttons), }; -static struct mvsdio_platform_data rd88f6281_mvsdio_data = { - .gpio_card_detect = 28, +static struct platform_device rd88f6281_button_device = { + .name = "gpio-keys", + .id = -1, + .num_resources = 0, + .dev = { + .platform_data = &rd88f6281_button_data, + }, }; static unsigned int rd88f6281_mpp_config[] __initdata = { - MPP28_GPIO, + MPP12_GPIO, + MPP35_GPIO, + MPP42_GPIO, + MPP43_GPIO, + MPP44_GPIO, + MPP45_GPIO, + MPP46_GPIO, + MPP47_GPIO, + MPP48_GPIO, 0 }; +static struct i2c_board_info __initdata rd88f6281_i2c_rtc = { + I2C_BOARD_INFO("lm63", 0x4c), +}; + static void __init rd88f6281_init(void) { u32 dev, rev; @@ -118,19 +225,15 @@ kirkwood_ge00_init(&rd88f6281_ge00_data); kirkwood_pcie_id(&dev, &rev); - if (rev == MV88F6281_REV_A0) { - rd88f6281_switch_chip_data.sw_addr = 10; - kirkwood_ge01_init(&rd88f6281_ge01_data); - } else { - rd88f6281_switch_chip_data.port_names[4] = "wan"; - } - kirkwood_ge00_switch_init(&rd88f6281_switch_plat_data, NO_IRQ); - - kirkwood_sata_init(&rd88f6281_sata_data); - kirkwood_sdio_init(&rd88f6281_mvsdio_data); kirkwood_uart0_init(); platform_device_register(&rd88f6281_nand_flash); + + platform_device_register(&rd88f6281_leds); + platform_device_register(&rd88f6281_button_device); + + kirkwood_i2c_init(); + i2c_register_board_info(0, &rd88f6281_i2c_rtc, 1); } static int __init rd88f6281_pci_init(void)