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) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *  linux/arch/arm/mach-mmp/teton_bga.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *  Support for the Marvell PXA168 Teton BGA Development Platform.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *  Author: Mark F. Brown <mark.brown314@gmail.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  *  This code is based on aspenite.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/platform_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/gpio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #include <linux/gpio-pxa.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/input.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <linux/platform_data/keypad-pxa27x.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <linux/i2c.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include <asm/mach-types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include <asm/mach/arch.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #include "addr-map.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include "mfp-pxa168.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #include "pxa168.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #include "teton_bga.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #include "irqs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) #include "common.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) static unsigned long teton_bga_pin_config[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	/* UART1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	GPIO107_UART1_TXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	GPIO108_UART1_RXD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	/* Keypad */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	GPIO109_KP_MKIN1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	GPIO110_KP_MKIN0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	GPIO111_KP_MKOUT7,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	GPIO112_KP_MKOUT6,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	/* I2C Bus */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	GPIO105_CI2C_SDA,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	GPIO106_CI2C_SCL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	/* RTC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	GPIO78_GPIO,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) static struct pxa_gpio_platform_data pxa168_gpio_pdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	.irq_base	= MMP_GPIO_TO_IRQ(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) static unsigned int teton_bga_matrix_key_map[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	KEY(0, 6, KEY_ESC),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	KEY(0, 7, KEY_ENTER),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	KEY(1, 6, KEY_LEFT),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	KEY(1, 7, KEY_RIGHT),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) static struct matrix_keymap_data teton_bga_matrix_keymap_data = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	.keymap			= teton_bga_matrix_key_map,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	.keymap_size		= ARRAY_SIZE(teton_bga_matrix_key_map),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) static struct pxa27x_keypad_platform_data teton_bga_keypad_info __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	.matrix_key_rows        = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	.matrix_key_cols        = 8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	.matrix_keymap_data	= &teton_bga_matrix_keymap_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	.debounce_interval      = 30,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) static struct i2c_board_info teton_bga_i2c_info[] __initdata = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 		I2C_BOARD_INFO("ds1337", 0x68),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 		.irq = MMP_GPIO_TO_IRQ(RTC_INT_GPIO)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) static void __init teton_bga_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	mfp_config(ARRAY_AND_SIZE(teton_bga_pin_config));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	/* on-chip devices */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	pxa168_add_uart(1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	pxa168_add_keypad(&teton_bga_keypad_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(teton_bga_i2c_info));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	platform_device_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 				 sizeof(struct pxa_gpio_platform_data));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	platform_device_register(&pxa168_device_gpio);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	.map_io		= mmp_map_io,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	.nr_irqs	= MMP_NR_IRQS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	.init_irq       = pxa168_init_irq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	.init_time	= pxa168_timer_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	.init_machine   = teton_bga_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	.restart	= pxa168_restart,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) MACHINE_END