Path: blob/master/arch/arm/mach-kirkwood/rd88f6281-setup.c
10817 views
/*1* arch/arm/mach-kirkwood/rd88f6281-setup.c2*3* Marvell RD-88F6281 Reference Board Setup4*5* This file is licensed under the terms of the GNU General Public6* License version 2. This program is licensed "as is" without any7* warranty of any kind, whether express or implied.8*/910#include <linux/kernel.h>11#include <linux/init.h>12#include <linux/platform_device.h>13#include <linux/irq.h>14#include <linux/mtd/partitions.h>15#include <linux/ata_platform.h>16#include <linux/mv643xx_eth.h>17#include <linux/ethtool.h>18#include <net/dsa.h>19#include <asm/mach-types.h>20#include <asm/mach/arch.h>21#include <mach/kirkwood.h>22#include <plat/mvsdio.h>23#include "common.h"24#include "mpp.h"2526static struct mtd_partition rd88f6281_nand_parts[] = {27{28.name = "u-boot",29.offset = 0,30.size = SZ_1M31}, {32.name = "uImage",33.offset = MTDPART_OFS_NXTBLK,34.size = SZ_2M35}, {36.name = "root",37.offset = MTDPART_OFS_NXTBLK,38.size = MTDPART_SIZ_FULL39},40};4142static struct mv643xx_eth_platform_data rd88f6281_ge00_data = {43.phy_addr = MV643XX_ETH_PHY_NONE,44.speed = SPEED_1000,45.duplex = DUPLEX_FULL,46};4748static struct dsa_chip_data rd88f6281_switch_chip_data = {49.port_names[0] = "lan1",50.port_names[1] = "lan2",51.port_names[2] = "lan3",52.port_names[3] = "lan4",53.port_names[5] = "cpu",54};5556static struct dsa_platform_data rd88f6281_switch_plat_data = {57.nr_chips = 1,58.chip = &rd88f6281_switch_chip_data,59};6061static struct mv643xx_eth_platform_data rd88f6281_ge01_data = {62.phy_addr = MV643XX_ETH_PHY_ADDR(11),63};6465static struct mv_sata_platform_data rd88f6281_sata_data = {66.n_ports = 2,67};6869static struct mvsdio_platform_data rd88f6281_mvsdio_data = {70.gpio_card_detect = 28,71};7273static unsigned int rd88f6281_mpp_config[] __initdata = {74MPP28_GPIO,75076};7778static void __init rd88f6281_init(void)79{80u32 dev, rev;8182/*83* Basic setup. Needs to be called early.84*/85kirkwood_init();86kirkwood_mpp_conf(rd88f6281_mpp_config);8788kirkwood_nand_init(ARRAY_AND_SIZE(rd88f6281_nand_parts), 25);89kirkwood_ehci_init();9091kirkwood_ge00_init(&rd88f6281_ge00_data);92kirkwood_pcie_id(&dev, &rev);93if (rev == MV88F6281_REV_A0) {94rd88f6281_switch_chip_data.sw_addr = 10;95kirkwood_ge01_init(&rd88f6281_ge01_data);96} else {97rd88f6281_switch_chip_data.port_names[4] = "wan";98}99kirkwood_ge00_switch_init(&rd88f6281_switch_plat_data, NO_IRQ);100101kirkwood_sata_init(&rd88f6281_sata_data);102kirkwood_sdio_init(&rd88f6281_mvsdio_data);103kirkwood_uart0_init();104}105106static int __init rd88f6281_pci_init(void)107{108if (machine_is_rd88f6281())109kirkwood_pcie_init(KW_PCIE0);110111return 0;112}113subsys_initcall(rd88f6281_pci_init);114115MACHINE_START(RD88F6281, "Marvell RD-88F6281 Reference Board")116/* Maintainer: Saeed Bishara <[email protected]> */117.boot_params = 0x00000100,118.init_machine = rd88f6281_init,119.map_io = kirkwood_map_io,120.init_early = kirkwood_init_early,121.init_irq = kirkwood_init_irq,122.timer = &kirkwood_timer,123MACHINE_END124125126