Path: blob/master/arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
10819 views
/*1* arch/arm/mach-mv78xx0/buffalo-wxl-setup.c2*3* Buffalo WXL (Terastation Duo) Setup routines4*5* sebastien requiem <[email protected]>6*7* This file is licensed under the terms of the GNU General Public8* License version 2. This program is licensed "as is" without any9* warranty of any kind, whether express or implied.10*/1112#include <linux/kernel.h>13#include <linux/init.h>14#include <linux/platform_device.h>15#include <linux/ata_platform.h>16#include <linux/mv643xx_eth.h>17#include <linux/ethtool.h>18#include <linux/i2c.h>19#include <mach/mv78xx0.h>20#include <asm/mach-types.h>21#include <asm/mach/arch.h>22#include "common.h"23#include "mpp.h"242526/* This arch has 2 Giga Ethernet */2728static struct mv643xx_eth_platform_data db78x00_ge00_data = {29.phy_addr = MV643XX_ETH_PHY_ADDR(0),30};3132static struct mv643xx_eth_platform_data db78x00_ge01_data = {33.phy_addr = MV643XX_ETH_PHY_ADDR(8),34};353637/* 2 SATA controller supporting HotPlug */3839static struct mv_sata_platform_data db78x00_sata_data = {40.n_ports = 2,41};4243static struct i2c_board_info __initdata db78x00_i2c_rtc = {44I2C_BOARD_INFO("ds1338", 0x68),45};464748static unsigned int wxl_mpp_config[] __initdata = {49MPP0_GE1_TXCLK,50MPP1_GE1_TXCTL,51MPP2_GE1_RXCTL,52MPP3_GE1_RXCLK,53MPP4_GE1_TXD0,54MPP5_GE1_TXD1,55MPP6_GE1_TXD2,56MPP7_GE1_TXD3,57MPP8_GE1_RXD0,58MPP9_GE1_RXD1,59MPP10_GE1_RXD2,60MPP11_GE1_RXD3,61MPP12_GPIO,62MPP13_SYSRST_OUTn,63MPP14_SATA1_ACTn,64MPP15_SATA0_ACTn,65MPP16_GPIO,66MPP17_GPIO,67MPP18_GPIO,68MPP19_GPIO,69MPP20_GPIO,70MPP21_GPIO,71MPP22_GPIO,72MPP23_GPIO,73MPP24_UA2_TXD,74MPP25_UA2_RXD,75MPP26_UA2_CTSn,76MPP27_UA2_RTSn,77MPP28_GPIO,78MPP29_SYSRST_OUTn,79MPP30_GPIO,80MPP31_GPIO,81MPP32_GPIO,82MPP33_GPIO,83MPP34_GPIO,84MPP35_GPIO,85MPP36_GPIO,86MPP37_GPIO,87MPP38_GPIO,88MPP39_GPIO,89MPP40_UNUSED,90MPP41_UNUSED,91MPP42_UNUSED,92MPP43_UNUSED,93MPP44_UNUSED,94MPP45_UNUSED,95MPP46_UNUSED,96MPP47_UNUSED,97MPP48_SATA1_ACTn,98MPP49_SATA0_ACTn,990100};101102103static void __init wxl_init(void)104{105/*106* Basic MV78xx0 setup. Needs to be called early.107*/108mv78xx0_init();109mv78xx0_mpp_conf(wxl_mpp_config);110111/*112* Partition on-chip peripherals between the two CPU cores.113*/114mv78xx0_ehci0_init();115mv78xx0_ehci1_init();116mv78xx0_ehci2_init();117mv78xx0_ge00_init(&db78x00_ge00_data);118mv78xx0_ge01_init(&db78x00_ge01_data);119mv78xx0_sata_init(&db78x00_sata_data);120mv78xx0_uart0_init();121mv78xx0_uart1_init();122mv78xx0_uart2_init();123mv78xx0_uart3_init();124mv78xx0_i2c_init();125i2c_register_board_info(0, &db78x00_i2c_rtc, 1);126}127128static int __init wxl_pci_init(void)129{130if (machine_is_terastation_wxl()) {131/*132* Assign the x16 PCIe slot on the board to CPU core133* #0, and let CPU core #1 have the four x1 slots.134*/135if (mv78xx0_core_index() == 0)136mv78xx0_pcie_init(0, 1);137else138mv78xx0_pcie_init(1, 0);139}140141return 0;142}143subsys_initcall(wxl_pci_init);144145MACHINE_START(TERASTATION_WXL, "Buffalo Nas WXL")146/* Maintainer: Sebastien Requiem <[email protected]> */147.boot_params = 0x00000100,148.init_machine = wxl_init,149.map_io = mv78xx0_map_io,150.init_early = mv78xx0_init_early,151.init_irq = mv78xx0_init_irq,152.timer = &mv78xx0_timer,153MACHINE_END154155156