1 // SPDX-License-Identifier: GPL-2.0-only
3 * arch/arm/mach-mv78xx0/buffalo-wxl-setup.c
5 * Buffalo WXL (Terastation Duo) Setup routines
7 * sebastien requiem <sebastien@requiem.fr>
10 #include <linux/kernel.h>
11 #include <linux/init.h>
12 #include <linux/platform_device.h>
13 #include <linux/ata_platform.h>
14 #include <linux/mv643xx_eth.h>
15 #include <linux/ethtool.h>
16 #include <linux/i2c.h>
17 #include <asm/mach-types.h>
18 #include <asm/mach/arch.h>
24 /* This arch has 2 Giga Ethernet */
26 static struct mv643xx_eth_platform_data db78x00_ge00_data = {
27 .phy_addr = MV643XX_ETH_PHY_ADDR(0),
30 static struct mv643xx_eth_platform_data db78x00_ge01_data = {
31 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
35 /* 2 SATA controller supporting HotPlug */
37 static struct mv_sata_platform_data db78x00_sata_data = {
41 static struct i2c_board_info __initdata db78x00_i2c_rtc = {
42 I2C_BOARD_INFO("ds1338", 0x68),
46 static unsigned int wxl_mpp_config[] __initdata = {
101 static void __init wxl_init(void)
104 * Basic MV78xx0 setup. Needs to be called early.
107 mv78xx0_mpp_conf(wxl_mpp_config);
110 * Partition on-chip peripherals between the two CPU cores.
112 mv78xx0_ehci0_init();
113 mv78xx0_ehci1_init();
114 mv78xx0_ehci2_init();
115 mv78xx0_ge00_init(&db78x00_ge00_data);
116 mv78xx0_ge01_init(&db78x00_ge01_data);
117 mv78xx0_sata_init(&db78x00_sata_data);
118 mv78xx0_uart0_init();
119 mv78xx0_uart1_init();
120 mv78xx0_uart2_init();
121 mv78xx0_uart3_init();
123 i2c_register_board_info(0, &db78x00_i2c_rtc, 1);
126 static int __init wxl_pci_init(void)
128 if (machine_is_terastation_wxl()) {
130 * Assign the x16 PCIe slot on the board to CPU core
131 * #0, and let CPU core #1 have the four x1 slots.
133 if (mv78xx0_core_index() == 0)
134 mv78xx0_pcie_init(0, 1);
136 mv78xx0_pcie_init(1, 0);
141 subsys_initcall(wxl_pci_init);
143 MACHINE_START(TERASTATION_WXL, "Buffalo Nas WXL")
144 /* Maintainer: Sebastien Requiem <sebastien@requiem.fr> */
145 .atag_offset = 0x100,
146 .nr_irqs = MV78XX0_NR_IRQS,
147 .init_machine = wxl_init,
148 .map_io = mv78xx0_map_io,
149 .init_early = mv78xx0_init_early,
150 .init_irq = mv78xx0_init_irq,
151 .init_time = mv78xx0_timer_init,
152 .restart = mv78xx0_restart,