Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2)  * arch/arm/mach-dove/cm-a510.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  * Copyright (C) 2010 CompuLab, Ltd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  * Konstantin Sinyuk <kostyas@compulab.co.il>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  * Based on Marvell DB-MV88AP510-BP Development Board Setup
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9)  * This file is licensed under the terms of the GNU General Public
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)  * License version 2.  This program is licensed "as is" without any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)  * warranty of any kind, whether express or implied.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/platform_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/ata_platform.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include <linux/mv643xx_eth.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #include <linux/spi/spi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #include <linux/spi/flash.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #include <asm/mach-types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include <asm/mach/arch.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #include "dove.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #include "common.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) static struct mv643xx_eth_platform_data cm_a510_ge00_data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 	.phy_addr	= MV643XX_ETH_PHY_ADDR_DEFAULT,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) static struct mv_sata_platform_data cm_a510_sata_data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	.n_ports        = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)  * SPI Devices:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)  * SPI0: 1M Flash Winbond w25q32bv
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) static const struct flash_platform_data cm_a510_spi_flash_data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 	.type		= "w25q32bv",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) static struct spi_board_info __initdata cm_a510_spi_flash_info[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 		.modalias       = "m25p80",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 		.platform_data  = &cm_a510_spi_flash_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 		.irq            = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 		.max_speed_hz   = 20000000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 		.bus_num        = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 		.chip_select    = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) static int __init cm_a510_pci_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 	if (machine_is_cm_a510())
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 		dove_pcie_init(1, 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) subsys_initcall(cm_a510_pci_init);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) /* Board Init */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) static void __init cm_a510_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) 	 * Basic Dove setup. Needs to be called early.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) 	dove_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) 	dove_ge00_init(&cm_a510_ge00_data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) 	dove_ehci0_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) 	dove_ehci1_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) 	dove_sata_init(&cm_a510_sata_data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) 	dove_sdio0_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) 	dove_sdio1_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) 	dove_spi0_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) 	dove_spi1_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) 	dove_uart0_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) 	dove_uart1_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) 	dove_i2c_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) 	spi_register_board_info(cm_a510_spi_flash_info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) 				ARRAY_SIZE(cm_a510_spi_flash_info));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) MACHINE_START(CM_A510, "Compulab CM-A510 Board")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) 	.atag_offset	= 0x100,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) 	.nr_irqs	= DOVE_NR_IRQS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) 	.init_machine	= cm_a510_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) 	.map_io		= dove_map_io,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) 	.init_early	= dove_init_early,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) 	.init_irq	= dove_init_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) 	.init_time	= dove_timer_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) 	.restart	= dove_restart,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) MACHINE_END