18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * arch/arm/mach-mv78x00/rd78x00-masa-setup.c
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Marvell RD-78x00-mASA Development Board Setup
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * This file is licensed under the terms of the GNU General Public
78c2ecf20Sopenharmony_ci * License version 2.  This program is licensed "as is" without any
88c2ecf20Sopenharmony_ci * warranty of any kind, whether express or implied.
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include <linux/kernel.h>
128c2ecf20Sopenharmony_ci#include <linux/init.h>
138c2ecf20Sopenharmony_ci#include <linux/platform_device.h>
148c2ecf20Sopenharmony_ci#include <linux/ata_platform.h>
158c2ecf20Sopenharmony_ci#include <linux/mv643xx_eth.h>
168c2ecf20Sopenharmony_ci#include <linux/ethtool.h>
178c2ecf20Sopenharmony_ci#include <asm/mach-types.h>
188c2ecf20Sopenharmony_ci#include <asm/mach/arch.h>
198c2ecf20Sopenharmony_ci#include "mv78xx0.h"
208c2ecf20Sopenharmony_ci#include "common.h"
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_cistatic struct mv643xx_eth_platform_data rd78x00_masa_ge00_data = {
238c2ecf20Sopenharmony_ci	.phy_addr	= MV643XX_ETH_PHY_ADDR(8),
248c2ecf20Sopenharmony_ci};
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_cistatic struct mv643xx_eth_platform_data rd78x00_masa_ge01_data = {
278c2ecf20Sopenharmony_ci	.phy_addr	= MV643XX_ETH_PHY_ADDR(9),
288c2ecf20Sopenharmony_ci};
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_cistatic struct mv643xx_eth_platform_data rd78x00_masa_ge10_data = {
318c2ecf20Sopenharmony_ci};
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_cistatic struct mv643xx_eth_platform_data rd78x00_masa_ge11_data = {
348c2ecf20Sopenharmony_ci};
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_cistatic struct mv_sata_platform_data rd78x00_masa_sata_data = {
378c2ecf20Sopenharmony_ci	.n_ports	= 2,
388c2ecf20Sopenharmony_ci};
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_cistatic void __init rd78x00_masa_init(void)
418c2ecf20Sopenharmony_ci{
428c2ecf20Sopenharmony_ci	/*
438c2ecf20Sopenharmony_ci	 * Basic MV78x00 setup. Needs to be called early.
448c2ecf20Sopenharmony_ci	 */
458c2ecf20Sopenharmony_ci	mv78xx0_init();
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci	/*
488c2ecf20Sopenharmony_ci	 * Partition on-chip peripherals between the two CPU cores.
498c2ecf20Sopenharmony_ci	 */
508c2ecf20Sopenharmony_ci	if (mv78xx0_core_index() == 0) {
518c2ecf20Sopenharmony_ci		mv78xx0_ehci0_init();
528c2ecf20Sopenharmony_ci		mv78xx0_ehci1_init();
538c2ecf20Sopenharmony_ci		mv78xx0_ge00_init(&rd78x00_masa_ge00_data);
548c2ecf20Sopenharmony_ci		mv78xx0_ge10_init(&rd78x00_masa_ge10_data);
558c2ecf20Sopenharmony_ci		mv78xx0_sata_init(&rd78x00_masa_sata_data);
568c2ecf20Sopenharmony_ci		mv78xx0_uart0_init();
578c2ecf20Sopenharmony_ci		mv78xx0_uart2_init();
588c2ecf20Sopenharmony_ci	} else {
598c2ecf20Sopenharmony_ci		mv78xx0_ehci2_init();
608c2ecf20Sopenharmony_ci		mv78xx0_ge01_init(&rd78x00_masa_ge01_data);
618c2ecf20Sopenharmony_ci		mv78xx0_ge11_init(&rd78x00_masa_ge11_data);
628c2ecf20Sopenharmony_ci		mv78xx0_uart1_init();
638c2ecf20Sopenharmony_ci		mv78xx0_uart3_init();
648c2ecf20Sopenharmony_ci	}
658c2ecf20Sopenharmony_ci}
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_cistatic int __init rd78x00_pci_init(void)
688c2ecf20Sopenharmony_ci{
698c2ecf20Sopenharmony_ci	/*
708c2ecf20Sopenharmony_ci	 * Assign all PCIe devices to CPU core #0.
718c2ecf20Sopenharmony_ci	 */
728c2ecf20Sopenharmony_ci	if (machine_is_rd78x00_masa() && mv78xx0_core_index() == 0)
738c2ecf20Sopenharmony_ci		mv78xx0_pcie_init(1, 1);
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci	return 0;
768c2ecf20Sopenharmony_ci}
778c2ecf20Sopenharmony_cisubsys_initcall(rd78x00_pci_init);
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ciMACHINE_START(RD78X00_MASA, "Marvell RD-78x00-MASA Development Board")
808c2ecf20Sopenharmony_ci	/* Maintainer: Lennert Buytenhek <buytenh@marvell.com> */
818c2ecf20Sopenharmony_ci	.atag_offset	= 0x100,
828c2ecf20Sopenharmony_ci	.nr_irqs	= MV78XX0_NR_IRQS,
838c2ecf20Sopenharmony_ci	.init_machine	= rd78x00_masa_init,
848c2ecf20Sopenharmony_ci	.map_io		= mv78xx0_map_io,
858c2ecf20Sopenharmony_ci	.init_early	= mv78xx0_init_early,
868c2ecf20Sopenharmony_ci	.init_irq	= mv78xx0_init_irq,
878c2ecf20Sopenharmony_ci	.init_time	= mv78xx0_timer_init,
888c2ecf20Sopenharmony_ci	.restart	= mv78xx0_restart,
898c2ecf20Sopenharmony_ciMACHINE_END
90